// File: /workspace/github_cpp_makefile_star2_O3/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, -0x38(%rbp)
movq %rdi, -0x30(%rbp)
movq 0xf0(%rdi), %rax
movslq %esi, %r14
movslq (%rax,%r14,4), %r13
leaq (,%r13,8), %rax
testq %r13, %r13
movl %r13d, %ebx
movq $-0x1, %rdi
cmovnsq %rax, %rdi
callq 0x3030
movq %rax, %r15
movq -0x38(%rbp), %rax
movl (%rax), %ecx
movq -0x30(%rbp), %rax
movl 0x40(%rax), %eax
imull %r14d, %eax
subl %eax, %ecx
leal (%rcx,%r13), %eax
cmpl %eax, %ecx
jge 0x5a04
movq -0x30(%rbp), %rdx
movq 0x50(%rdx), %rax
movq (%rax,%r14,8), %rax
movslq %ecx, %rcx
shlq $0x2, %rcx
addq 0x58(%rdx), %rcx
xorl %edx, %edx
movslq (%rcx,%rdx,4), %rsi
movsd (%r12,%rsi,8), %xmm0
movslq %edx, %rsi
subsd (%rax,%rsi,8), %xmm0
movsd %xmm0, (%r15,%rsi,8)
incq %rdx
cmpl %edx, %ebx
jne 0x59e5
cmpq $0x19, %rbx
je 0x5ab1
cmpl $0x32, %ebx
je 0x5a68
cmpl $0x64, %ebx
jne 0x5b02
movq -0x30(%rbp), %rax
movq 0xe8(%rax), %rbx
movl $0x320, %edi            # imm = 0x320
callq 0x3030
movl $0x63, %ecx
movq (%rbx,%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 0x5a43
movsd %xmm0, (%rax,%rcx,8)
subq $0x1, %rcx
jae 0x5a36
jmp 0x5af8
movq -0x30(%rbp), %rax
movq 0xe0(%rax), %rbx
movl $0x190, %edi            # imm = 0x190
callq 0x3030
movl $0x31, %ecx
movq (%rbx,%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 0x5a8f
movsd %xmm0, (%rax,%rcx,8)
subq $0x1, %rcx
jae 0x5a82
jmp 0x5af8
movq -0x30(%rbp), %rax
movq 0xd8(%rax), %rbx
movl $0xc8, %edi
callq 0x3030
movl $0x18, %ecx
movq (%rbx,%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 0x5ad8
movsd %xmm0, (%rax,%rcx,8)
subq $0x1, %rcx
jae 0x5acb
movq -0x30(%rbp), %rcx
movq %rax, 0x78(%rcx)
jmp 0x5b45
movq 0x94c7(%rip), %r12      # 0xefd0
leaq 0x5606(%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 -0x30(%rbp), %rdx
movq 0xf0(%rdx), %rax
movl (%rax,%r14,4), %eax
movq -0x38(%rbp), %rcx
addl %eax, (%rcx)
movq 0x78(%rdx), %rax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop