// File: /workspace/github_cpp_makefile_star2_O1/mateuz[P]MTS-LS1/source/Benchmarks.cpp
// Function: Benchmarks::rotateVectorConflict(int, int&, double*)
double* Benchmarks::rotateVectorConflict(int i, int &c, double* x)
{
  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)] = x[Pvector[j]] - OvectorVec[i][j-(c - i*overlap)];  
    }

  // 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
subq $0x18, %rsp
movq %rcx, %r12
movq %rdx, %r13
movq %rdi, %r14
movq 0xf0(%rdi), %rax
movq %rax, -0x30(%rbp)
movslq %esi, %rbx
movslq (%rax,%rbx,4), %rax
leaq (,%rax,8), %rcx
testq %rax, %rax
movq $-0x1, %rdi
cmovnsq %rcx, %rdi
callq 0x3030
movq %rax, %r15
movq %r13, -0x38(%rbp)
movslq (%r13), %rcx
movslq 0x40(%r14), %rsi
imulq %rbx, %rsi
movl %ecx, %edx
subl %esi, %edx
movq -0x30(%rbp), %rax
movl (%rax,%rbx,4), %eax
leal (%rax,%rdx), %edi
cmpl %edi, %edx
jge 0x5a2e
movq 0x50(%r14), %rdx
movq (%rdx,%rbx,8), %rdx
shlq $0x2, %rcx
shlq $0x2, %rsi
subq %rsi, %rcx
addq 0x58(%r14), %rcx
xorl %esi, %esi
movslq (%rcx,%rsi,4), %rdi
movsd (%r12,%rdi,8), %xmm0
movslq %esi, %rdi
subsd (%rdx,%rdi,8), %xmm0
movsd %xmm0, (%r15,%rdi,8)
incq %rsi
cmpl %esi, %eax
jne 0x5a0f
cmpq $0x19, %rax
je 0x5ae3
cmpl $0x32, %eax
je 0x5a96
cmpl $0x64, %eax
jne 0x5b34
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 0x5a71
movsd %xmm0, (%rax,%rcx,8)
subq $0x1, %rcx
jae 0x5a5c
jmp 0x5b2e
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 0x5ac1
movsd %xmm0, (%rax,%rcx,8)
subq $0x1, %rcx
jae 0x5aac
jmp 0x5b2e
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 0x5b0e
movsd %xmm0, (%rax,%rcx,8)
subq $0x1, %rcx
jae 0x5af9
movq %rax, 0x78(%r14)
jmp 0x5b77
movq 0x9495(%rip), %r12      # 0xefd0
leaq 0x55d4(%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,%rbx,4), %eax
movq -0x38(%rbp), %rcx
addl %eax, (%rcx)
movq 0x78(%r14), %rax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq