#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */

/* Variables and functions */
double *dvector(int, int);
int /*<<< orphan*/ free_dvector(double *, int, int);
void rotate(double **A, int n, double alpha, double beta, int i, int j) {
  double Aii, Ajj, Aij, *Ai, *Aj;
  int k;
  Ai = dvector(1, n);
  Aj = dvector(1, n);
  for (k = 1; k <= n; k++) {
    Ai[k] = A[i][k];
    Aj[k] = A[j][k];
  }
  Aii = A[i][i];
  Ajj = A[j][j];
  Aij = A[i][j];
  A[i][i] = Aii + 2 * beta * Aij + beta * beta * Ajj;
  A[j][j] = Ajj + 2 * alpha * Aij + alpha * alpha * Aii;
  for (k = 1; k <= n; k++) {
    if (k != i && k != j) {
      A[k][i] = A[i][k] = Ai[k] + beta * Aj[k];
      A[k][j] = A[j][k] = Aj[k] + alpha * Ai[k];
    }
  }
  A[j][i] = A[i][j] = 0;
  free_dvector(Ai, 1, n);
  free_dvector(Aj, 1, n);
  return;
}


x86 assembly (clang, -O0):
<rotate>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movsd  %xmm0,-0x18(%rbp)
movsd  %xmm1,-0x20(%rbp)
mov    %edx,-0x24(%rbp)
mov    %ecx,-0x28(%rbp)
mov    -0xc(%rbp),%esi
mov    $0x1,%edi
call   1030 <dvector@plt>
mov    %rax,-0x48(%rbp)
mov    -0xc(%rbp),%esi
mov    $0x1,%edi
call   1030 <dvector@plt>
mov    %rax,-0x50(%rbp)
movl   $0x1,-0x54(%rbp)
mov    -0x54(%rbp),%eax
cmp    -0xc(%rbp),%eax
jg     11c6 <rotate+0xa6>
mov    -0x8(%rbp),%rax
movslq -0x24(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x54(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x48(%rbp),%rax
movslq -0x54(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x8(%rbp),%rax
movslq -0x28(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x54(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x50(%rbp),%rax
movslq -0x54(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x54(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x54(%rbp)
jmp    1168 <rotate+0x48>
mov    -0x8(%rbp),%rax
movslq -0x24(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x24(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x30(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x28(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x28(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x38(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x24(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x28(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  -0x30(%rbp),%xmm0
movsd  0xddf(%rip),%xmm1
mulsd  -0x20(%rbp),%xmm1
movsd  -0x40(%rbp),%xmm2
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
movsd  -0x20(%rbp),%xmm0
mulsd  -0x20(%rbp),%xmm0
movsd  -0x38(%rbp),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x8(%rbp),%rax
movslq -0x24(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x24(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
movsd  -0x38(%rbp),%xmm0
movsd  0xd94(%rip),%xmm1
mulsd  -0x18(%rbp),%xmm1
movsd  -0x40(%rbp),%xmm2
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
movsd  -0x18(%rbp),%xmm0
mulsd  -0x18(%rbp),%xmm0
movsd  -0x30(%rbp),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x8(%rbp),%rax
movslq -0x28(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x28(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
movl   $0x1,-0x54(%rbp)
mov    -0x54(%rbp),%eax
cmp    -0xc(%rbp),%eax
jg     138a <rotate+0x26a>
mov    -0x54(%rbp),%eax
cmp    -0x24(%rbp),%eax
je     1377 <rotate+0x257>
mov    -0x54(%rbp),%eax
cmp    -0x28(%rbp),%eax
je     1377 <rotate+0x257>
mov    -0x48(%rbp),%rax
movslq -0x54(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm1
movsd  -0x20(%rbp),%xmm0
mov    -0x50(%rbp),%rax
movslq -0x54(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x8(%rbp),%rax
movslq -0x24(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x54(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x8(%rbp),%rax
movslq -0x54(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x24(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x50(%rbp),%rax
movslq -0x54(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm1
movsd  -0x18(%rbp),%xmm0
mov    -0x48(%rbp),%rax
movslq -0x54(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x8(%rbp),%rax
movslq -0x28(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x54(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x8(%rbp),%rax
movslq -0x54(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x28(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
jmp    137c <rotate+0x25c>
mov    -0x54(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x54(%rbp)
jmp    12b1 <rotate+0x191>
mov    -0x8(%rbp),%rax
movslq -0x24(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x28(%rbp),%rcx
xorps  %xmm0,%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x8(%rbp),%rax
movslq -0x28(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x24(%rbp),%rcx
xorps  %xmm0,%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x48(%rbp),%rdi
mov    -0xc(%rbp),%edx
mov    $0x1,%esi
call   1040 <free_dvector@plt>
mov    -0x50(%rbp),%rdi
mov    -0xc(%rbp),%edx
mov    $0x1,%esi
call   1040 <free_dvector@plt>
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rotate>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x58,%rsp
mov    %ecx,%r13d
mov    %edx,%r12d
movsd  %xmm1,0x50(%rsp)
movsd  %xmm0,0x48(%rsp)
mov    %esi,%r14d
mov    %rdi,%r15
mov    $0x1,%edi
call   1030 <dvector@plt>
mov    %rax,%rbp
mov    $0x1,%edi
mov    %r14d,%esi
call   1030 <dvector@plt>
mov    %rax,%rbx
mov    %r12d,0x2c(%rsp)
movslq %r12d,%r8
mov    (%r15,%r8,8),%rcx
mov    %r13d,0x28(%rsp)
movslq %r13d,%r9
mov    (%r15,%r9,8),%r13
mov    %r14d,%r12d
test   %r14d,%r14d
jle    13c3 <rotate+0x2a3>
lea    0x1(%r12),%r10
mov    $0x1,%edi
cmp    $0x4,%r14d
jae    120e <rotate+0xee>
mov    %rdi,%rax
not    %rax
test   $0x1,%r10b
jne    11be <rotate+0x9e>
movsd  (%rcx,%rdi,8),%xmm0
movsd  %xmm0,0x0(%rbp,%rdi,8)
movsd  0x0(%r13,%rdi,8),%xmm0
movsd  %xmm0,(%rbx,%rdi,8)
add    $0x1,%rdi
add    %r10,%rax
je     13c3 <rotate+0x2a3>
nopw   0x0(%rax,%rax,1)
movsd  (%rcx,%rdi,8),%xmm0
movsd  %xmm0,0x0(%rbp,%rdi,8)
movsd  0x0(%r13,%rdi,8),%xmm0
movsd  %xmm0,(%rbx,%rdi,8)
movsd  0x8(%rcx,%rdi,8),%xmm0
movsd  %xmm0,0x8(%rbp,%rdi,8)
movsd  0x8(%r13,%rdi,8),%xmm0
movsd  %xmm0,0x8(%rbx,%rdi,8)
add    $0x2,%rdi
cmp    %rdi,%r10
jne    11d0 <rotate+0xb0>
jmp    13c3 <rotate+0x2a3>
mov    %r14d,0x14(%rsp)
lea    0x0(,%r10,8),%rax
add    %rbp,%rax
mov    %rax,0x20(%rsp)
mov    %rbp,%rax
add    $0x8,%rax
lea    (%rbx,%r10,8),%r14
mov    %rbx,%r11
add    $0x8,%r11
lea    0x8(%rcx),%rdx
mov    %rdx,0x18(%rsp)
lea    (%rcx,%r10,8),%rdx
mov    %rdx,0x30(%rsp)
lea    0x8(%r13),%rsi
mov    %rsi,0x40(%rsp)
lea    0x0(,%r10,8),%rsi
add    %r13,%rsi
mov    %rsi,0x38(%rsp)
cmp    %r14,%rax
setb   0x13(%rsp)
mov    0x20(%rsp),%rsi
cmp    %rsi,%r11
setb   0x12(%rsp)
cmp    %rdx,%rax
setb   0x11(%rsp)
cmp    %rsi,0x18(%rsp)
setb   0x10(%rsp)
mov    0x38(%rsp),%rdx
cmp    %rdx,%rax
setb   0xf(%rsp)
mov    0x40(%rsp),%rax
cmp    %rsi,%rax
setb   0x20(%rsp)
cmp    0x30(%rsp),%r11
setb   %sil
cmp    %r14,0x18(%rsp)
setb   0x18(%rsp)
cmp    %rdx,%r11
setb   %r11b
cmp    %r14,%rax
setb   %dl
mov    0x12(%rsp),%al
test   %al,0x13(%rsp)
jne    150f <rotate+0x3ef>
mov    0x10(%rsp),%al
and    %al,0x11(%rsp)
mov    0x14(%rsp),%r14d
jne    1197 <rotate+0x77>
mov    0x20(%rsp),%al
and    %al,0xf(%rsp)
jne    1197 <rotate+0x77>
and    0x18(%rsp),%sil
jne    1197 <rotate+0x77>
and    %dl,%r11b
jne    1197 <rotate+0x77>
mov    %r12d,%edi
and    $0xfffffffc,%edi
lea    -0x4(%rdi),%rax
mov    %rax,%r11
shr    $0x2,%r11
add    $0x1,%r11
test   %rax,%rax
je     14fb <rotate+0x3db>
mov    %r11,%rdx
and    $0xfffffffffffffffe,%rdx
mov    $0x1,%eax
xchg   %ax,%ax
movups (%rcx,%rax,8),%xmm0
movups 0x10(%rcx,%rax,8),%xmm1
movups %xmm0,0x0(%rbp,%rax,8)
movups %xmm1,0x10(%rbp,%rax,8)
movups 0x0(%r13,%rax,8),%xmm0
movups 0x10(%r13,%rax,8),%xmm1
movups %xmm0,(%rbx,%rax,8)
movups %xmm1,0x10(%rbx,%rax,8)
movups 0x20(%rcx,%rax,8),%xmm0
movups 0x30(%rcx,%rax,8),%xmm1
movups %xmm0,0x20(%rbp,%rax,8)
movups %xmm1,0x30(%rbp,%rax,8)
movups 0x20(%r13,%rax,8),%xmm0
movups 0x30(%r13,%rax,8),%xmm1
movups %xmm0,0x20(%rbx,%rax,8)
movups %xmm1,0x30(%rbx,%rax,8)
add    $0x8,%rax
add    $0xfffffffffffffffe,%rdx
jne    1330 <rotate+0x210>
test   $0x1,%r11b
je     13ba <rotate+0x29a>
movups (%rcx,%rax,8),%xmm0
movups 0x10(%rcx,%rax,8),%xmm1
movups %xmm0,0x0(%rbp,%rax,8)
movups %xmm1,0x10(%rbp,%rax,8)
movups 0x0(%r13,%rax,8),%xmm0
movups 0x10(%r13,%rax,8),%xmm1
movups %xmm0,(%rbx,%rax,8)
movups %xmm1,0x10(%rbx,%rax,8)
cmp    %rdi,%r12
jne    14f2 <rotate+0x3d2>
movsd  (%rcx,%r8,8),%xmm0
movsd  0x0(%r13,%r9,8),%xmm1
movsd  (%rcx,%r9,8),%xmm2
movsd  0x50(%rsp),%xmm5
movapd %xmm5,%xmm3
addsd  %xmm5,%xmm3
mulsd  %xmm2,%xmm3
addsd  %xmm0,%xmm3
movapd %xmm5,%xmm4
mulsd  %xmm5,%xmm4
mulsd  %xmm1,%xmm4
addsd  %xmm3,%xmm4
movsd  %xmm4,(%rcx,%r8,8)
movsd  0x48(%rsp),%xmm4
movapd %xmm4,%xmm3
addsd  %xmm4,%xmm3
mulsd  %xmm2,%xmm3
addsd  %xmm1,%xmm3
movapd %xmm4,%xmm1
mulsd  %xmm4,%xmm1
mulsd  %xmm0,%xmm1
addsd  %xmm3,%xmm1
movsd  %xmm1,0x0(%r13,%r9,8)
test   %r14d,%r14d
jle    14b3 <rotate+0x393>
mov    0x28(%rsp),%edx
mov    0x2c(%rsp),%eax
shl    $0x3,%r12
lea    -0x8(,%rax,8),%rax
ff
lea    -0x8(,%rdx,8),%rdi
ff
xor    %edx,%edx
jmp    1469 <rotate+0x349>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
add    $0x8,%rdx
cmp    %rdx,%r12
je     14b3 <rotate+0x393>
cmp    %rdx,%rax
je     1460 <rotate+0x340>
cmp    %rdx,%rdi
je     1460 <rotate+0x340>
movsd  0x8(%rbx,%rdx,1),%xmm0
mulsd  %xmm5,%xmm0
addsd  0x8(%rbp,%rdx,1),%xmm0
movsd  %xmm0,0x8(%rcx,%rdx,1)
mov    0x8(%r15,%rdx,1),%rsi
movsd  %xmm0,(%rsi,%r8,8)
movsd  0x8(%rbp,%rdx,1),%xmm0
mulsd  %xmm4,%xmm0
addsd  0x8(%rbx,%rdx,1),%xmm0
movsd  %xmm0,0x8(%r13,%rdx,1)
movsd  %xmm0,(%rsi,%r9,8)
jmp    1460 <rotate+0x340>
movq   $0x0,(%rcx,%r9,8)
movq   $0x0,0x0(%r13,%r8,8)
mov    %rbp,%rdi
mov    $0x1,%esi
mov    %r14d,%edx
call   1040 <free_dvector@plt>
mov    %rbx,%rdi
mov    $0x1,%esi
mov    %r14d,%edx
add    $0x58,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1040 <free_dvector@plt>
or     $0x1,%rdi
jmp    1197 <rotate+0x77>
mov    $0x1,%eax
test   $0x1,%r11b
jne    1392 <rotate+0x272>
jmp    13ba <rotate+0x29a>
mov    0x14(%rsp),%r14d
jmp    1197 <rotate+0x77>

LLVM IR (-O0):
define void @rotate(double** %0, i32 %1, double %2, double %3, i32 %4, i32 %5) {
%7 = alloca double**
%8 = alloca i32
%9 = alloca double
%10 = alloca double
%11 = alloca i32
%12 = alloca i32
%13 = alloca double
%14 = alloca double
%15 = alloca double
%16 = alloca double*
%17 = alloca double*
%18 = alloca i32
store double** %0, double*** %7
store i32 %1, i32* %8
store double %2, double* %9
store double %3, double* %10
store i32 %4, i32* %11
store i32 %5, i32* %12
%19 = load i32, i32* %8
%20 = call double* @dvector(i32 1, i32 %19)
store double* %20, double** %16
%21 = load i32, i32* %8
%22 = call double* @dvector(i32 1, i32 %21)
store double* %22, double** %17
store i32 1, i32* %18
br label %23
23: ; preds = %54, %6
%24 = load i32, i32* %18
%25 = load i32, i32* %8
%26 = icmp sle i32 %24, %25
br i1 %26, label %27, label %57
27: ; preds = %23
%28 = load double**, double*** %7
%29 = load i32, i32* %11
%30 = sext i32 %29 to i64
%31 = getelementptr inbounds double*, double** %28, i64 %30
%32 = load double*, double** %31
%33 = load i32, i32* %18
%34 = sext i32 %33 to i64
%35 = getelementptr inbounds double, double* %32, i64 %34
%36 = load double, double* %35
%37 = load double*, double** %16
%38 = load i32, i32* %18
%39 = sext i32 %38 to i64
%40 = getelementptr inbounds double, double* %37, i64 %39
store double %36, double* %40
%41 = load double**, double*** %7
%42 = load i32, i32* %12
%43 = sext i32 %42 to i64
%44 = getelementptr inbounds double*, double** %41, i64 %43
%45 = load double*, double** %44
%46 = load i32, i32* %18
%47 = sext i32 %46 to i64
%48 = getelementptr inbounds double, double* %45, i64 %47
%49 = load double, double* %48
%50 = load double*, double** %17
%51 = load i32, i32* %18
%52 = sext i32 %51 to i64
%53 = getelementptr inbounds double, double* %50, i64 %52
store double %49, double* %53
br label %54
54: ; preds = %27
%55 = load i32, i32* %18
%56 = add nsw i32 %55, 1
store i32 %56, i32* %18
br label %23
57: ; preds = %23
%58 = load double**, double*** %7
%59 = load i32, i32* %11
%60 = sext i32 %59 to i64
%61 = getelementptr inbounds double*, double** %58, i64 %60
%62 = load double*, double** %61
%63 = load i32, i32* %11
%64 = sext i32 %63 to i64
%65 = getelementptr inbounds double, double* %62, i64 %64
%66 = load double, double* %65
store double %66, double* %13
%67 = load double**, double*** %7
%68 = load i32, i32* %12
%69 = sext i32 %68 to i64
%70 = getelementptr inbounds double*, double** %67, i64 %69
%71 = load double*, double** %70
%72 = load i32, i32* %12
%73 = sext i32 %72 to i64
%74 = getelementptr inbounds double, double* %71, i64 %73
%75 = load double, double* %74
store double %75, double* %14
%76 = load double**, double*** %7
%77 = load i32, i32* %11
%78 = sext i32 %77 to i64
%79 = getelementptr inbounds double*, double** %76, i64 %78
%80 = load double*, double** %79
%81 = load i32, i32* %12
%82 = sext i32 %81 to i64
%83 = getelementptr inbounds double, double* %80, i64 %82
%84 = load double, double* %83
store double %84, double* %15
%85 = load double, double* %13
%86 = load double, double* %10
%87 = fmul double 2.000000e+00, %86
%88 = load double, double* %15
%89 = call double @llvm.fmuladd.f64(double %87, double %88, double %85)
%90 = load double, double* %10
%91 = load double, double* %10
%92 = fmul double %90, %91
%93 = load double, double* %14
%94 = call double @llvm.fmuladd.f64(double %92, double %93, double %89)
%95 = load double**, double*** %7
%96 = load i32, i32* %11
%97 = sext i32 %96 to i64
%98 = getelementptr inbounds double*, double** %95, i64 %97
%99 = load double*, double** %98
%100 = load i32, i32* %11
%101 = sext i32 %100 to i64
%102 = getelementptr inbounds double, double* %99, i64 %101
store double %94, double* %102
%103 = load double, double* %14
%104 = load double, double* %9
%105 = fmul double 2.000000e+00, %104
%106 = load double, double* %15
%107 = call double @llvm.fmuladd.f64(double %105, double %106, double %103)
%108 = load double, double* %9
%109 = load double, double* %9
%110 = fmul double %108, %109
%111 = load double, double* %13
%112 = call double @llvm.fmuladd.f64(double %110, double %111, double %107)
%113 = load double**, double*** %7
%114 = load i32, i32* %12
%115 = sext i32 %114 to i64
%116 = getelementptr inbounds double*, double** %113, i64 %115
%117 = load double*, double** %116
%118 = load i32, i32* %12
%119 = sext i32 %118 to i64
%120 = getelementptr inbounds double, double* %117, i64 %119
store double %112, double* %120
store i32 1, i32* %18
br label %121
121: ; preds = %191, %57
%122 = load i32, i32* %18
%123 = load i32, i32* %8
%124 = icmp sle i32 %122, %123
br i1 %124, label %125, label %194
125: ; preds = %121
%126 = load i32, i32* %18
%127 = load i32, i32* %11
%128 = icmp ne i32 %126, %127
br i1 %128, label %129, label %190
129: ; preds = %125
%130 = load i32, i32* %18
%131 = load i32, i32* %12
%132 = icmp ne i32 %130, %131
br i1 %132, label %133, label %190
133: ; preds = %129
%134 = load double*, double** %16
%135 = load i32, i32* %18
%136 = sext i32 %135 to i64
%137 = getelementptr inbounds double, double* %134, i64 %136
%138 = load double, double* %137
%139 = load double, double* %10
%140 = load double*, double** %17
%141 = load i32, i32* %18
%142 = sext i32 %141 to i64
%143 = getelementptr inbounds double, double* %140, i64 %142
%144 = load double, double* %143
%145 = call double @llvm.fmuladd.f64(double %139, double %144, double %138)
%146 = load double**, double*** %7
%147 = load i32, i32* %11
%148 = sext i32 %147 to i64
%149 = getelementptr inbounds double*, double** %146, i64 %148
%150 = load double*, double** %149
%151 = load i32, i32* %18
%152 = sext i32 %151 to i64
%153 = getelementptr inbounds double, double* %150, i64 %152
store double %145, double* %153
%154 = load double**, double*** %7
%155 = load i32, i32* %18
%156 = sext i32 %155 to i64
%157 = getelementptr inbounds double*, double** %154, i64 %156
%158 = load double*, double** %157
%159 = load i32, i32* %11
%160 = sext i32 %159 to i64
%161 = getelementptr inbounds double, double* %158, i64 %160
store double %145, double* %161
%162 = load double*, double** %17
%163 = load i32, i32* %18
%164 = sext i32 %163 to i64
%165 = getelementptr inbounds double, double* %162, i64 %164
%166 = load double, double* %165
%167 = load double, double* %9
%168 = load double*, double** %16
%169 = load i32, i32* %18
%170 = sext i32 %169 to i64
%171 = getelementptr inbounds double, double* %168, i64 %170
%172 = load double, double* %171
%173 = call double @llvm.fmuladd.f64(double %167, double %172, double %166)
%174 = load double**, double*** %7
%175 = load i32, i32* %12
%176 = sext i32 %175 to i64
%177 = getelementptr inbounds double*, double** %174, i64 %176
%178 = load double*, double** %177
%179 = load i32, i32* %18
%180 = sext i32 %179 to i64
%181 = getelementptr inbounds double, double* %178, i64 %180
store double %173, double* %181
%182 = load double**, double*** %7
%183 = load i32, i32* %18
%184 = sext i32 %183 to i64
%185 = getelementptr inbounds double*, double** %182, i64 %184
%186 = load double*, double** %185
%187 = load i32, i32* %12
%188 = sext i32 %187 to i64
%189 = getelementptr inbounds double, double* %186, i64 %188
store double %173, double* %189
br label %190
190: ; preds = %133, %129, %125
br label %191
191: ; preds = %190
%192 = load i32, i32* %18
%193 = add nsw i32 %192, 1
store i32 %193, i32* %18
br label %121
194: ; preds = %121
%195 = load double**, double*** %7
%196 = load i32, i32* %11
%197 = sext i32 %196 to i64
%198 = getelementptr inbounds double*, double** %195, i64 %197
%199 = load double*, double** %198
%200 = load i32, i32* %12
%201 = sext i32 %200 to i64
%202 = getelementptr inbounds double, double* %199, i64 %201
store double 0.000000e+00, double* %202
%203 = load double**, double*** %7
%204 = load i32, i32* %12
%205 = sext i32 %204 to i64
%206 = getelementptr inbounds double*, double** %203, i64 %205
%207 = load double*, double** %206
%208 = load i32, i32* %11
%209 = sext i32 %208 to i64
%210 = getelementptr inbounds double, double* %207, i64 %209
store double 0.000000e+00, double* %210
%211 = load double*, double** %16
%212 = load i32, i32* %8
%213 = call i32 @free_dvector(double* %211, i32 1, i32 %212)
%214 = load double*, double** %17
%215 = load i32, i32* %8
%216 = call i32 @free_dvector(double* %214, i32 1, i32 %215)
ret void
}

LLVM IR (-O2):
define void @rotate(double** nocapture %0, i32 %1, double %2, double %3, i32 %4, i32 %5) {
%7 = tail call double* @dvector(i32 1, i32 %1)
%8 = tail call double* @dvector(i32 1, i32 %1)
%9 = icmp slt i32 %1, 1
%10 = sext i32 %4 to i64
%11 = getelementptr inbounds double*, double** %0, i64 %10
%12 = load double*, double** %11
%13 = sext i32 %5 to i64
%14 = getelementptr inbounds double*, double** %0, i64 %13
%15 = load double*, double** %14
br i1 %9, label %169, label %16
16: ; preds = %6
%17 = add nuw i32 %1, 1
%18 = zext i32 %17 to i64
%19 = add nsw i64 %18, -1
%20 = icmp ult i64 %19, 4
br i1 %20, label %135, label %21
21: ; preds = %16
%22 = getelementptr double, double* %7, i64 1
%23 = getelementptr double, double* %7, i64 %18
%24 = getelementptr double, double* %8, i64 1
%25 = getelementptr double, double* %8, i64 %18
%26 = getelementptr double, double* %12, i64 1
%27 = getelementptr double, double* %12, i64 %18
%28 = getelementptr double, double* %15, i64 1
%29 = getelementptr double, double* %15, i64 %18
%30 = icmp ult double* %22, %25
%31 = icmp ult double* %24, %23
%32 = and i1 %30, %31
%33 = icmp ult double* %22, %27
%34 = icmp ult double* %26, %23
%35 = and i1 %33, %34
%36 = or i1 %32, %35
%37 = icmp ult double* %22, %29
%38 = icmp ult double* %28, %23
%39 = and i1 %37, %38
%40 = or i1 %36, %39
%41 = icmp ult double* %24, %27
%42 = icmp ult double* %26, %25
%43 = and i1 %41, %42
%44 = or i1 %40, %43
%45 = icmp ult double* %24, %29
%46 = icmp ult double* %28, %25
%47 = and i1 %45, %46
%48 = or i1 %44, %47
br i1 %48, label %135, label %49
49: ; preds = %21
%50 = and i64 %19, -4
%51 = or i64 %50, 1
%52 = add nsw i64 %50, -4
%53 = lshr exact i64 %52, 2
%54 = add nuw nsw i64 %53, 1
%55 = and i64 %54, 1
%56 = icmp eq i64 %52, 0
br i1 %56, label %109, label %57
57: ; preds = %49
%58 = and i64 %54, 9223372036854775806
br label %59
59: ; preds = %59, %57
%60 = phi i64 [ 0, %57 ], [ %104, %59 ]
%61 = phi i64 [ 0, %57 ], [ %105, %59 ]
%62 = or i64 %60, 1
%63 = getelementptr inbounds double, double* %12, i64 %62
%64 = bitcast double* %63 to <2 x double>*
%65 = load <2 x double>, <2 x double>* %64
%66 = getelementptr inbounds double, double* %63, i64 2
%67 = bitcast double* %66 to <2 x double>*
%68 = load <2 x double>, <2 x double>* %67
%69 = getelementptr inbounds double, double* %7, i64 %62
%70 = bitcast double* %69 to <2 x double>*
store <2 x double> %65, <2 x double>* %70
%71 = getelementptr inbounds double, double* %69, i64 2
%72 = bitcast double* %71 to <2 x double>*
store <2 x double> %68, <2 x double>* %72
%73 = getelementptr inbounds double, double* %15, i64 %62
%74 = bitcast double* %73 to <2 x double>*
%75 = load <2 x double>, <2 x double>* %74
%76 = getelementptr inbounds double, double* %73, i64 2
%77 = bitcast double* %76 to <2 x double>*
%78 = load <2 x double>, <2 x double>* %77
%79 = getelementptr inbounds double, double* %8, i64 %62
%80 = bitcast double* %79 to <2 x double>*
store <2 x double> %75, <2 x double>* %80
%81 = getelementptr inbounds double, double* %79, i64 2
%82 = bitcast double* %81 to <2 x double>*
store <2 x double> %78, <2 x double>* %82
%83 = or i64 %60, 5
%84 = getelementptr inbounds double, double* %12, i64 %83
%85 = bitcast double* %84 to <2 x double>*
%86 = load <2 x double>, <2 x double>* %85
%87 = getelementptr inbounds double, double* %84, i64 2
%88 = bitcast double* %87 to <2 x double>*
%89 = load <2 x double>, <2 x double>* %88
%90 = getelementptr inbounds double, double* %7, i64 %83
%91 = bitcast double* %90 to <2 x double>*
store <2 x double> %86, <2 x double>* %91
%92 = getelementptr inbounds double, double* %90, i64 2
%93 = bitcast double* %92 to <2 x double>*
store <2 x double> %89, <2 x double>* %93
%94 = getelementptr inbounds double, double* %15, i64 %83
%95 = bitcast double* %94 to <2 x double>*
%96 = load <2 x double>, <2 x double>* %95
%97 = getelementptr inbounds double, double* %94, i64 2
%98 = bitcast double* %97 to <2 x double>*
%99 = load <2 x double>, <2 x double>* %98
%100 = getelementptr inbounds double, double* %8, i64 %83
%101 = bitcast double* %100 to <2 x double>*
store <2 x double> %96, <2 x double>* %101
%102 = getelementptr inbounds double, double* %100, i64 2
%103 = bitcast double* %102 to <2 x double>*
store <2 x double> %99, <2 x double>* %103
%104 = add nuw i64 %60, 8
%105 = add i64 %61, 2
%106 = icmp eq i64 %105, %58
br i1 %106, label %107, label %59
107: ; preds = %59
%108 = or i64 %104, 1
br label %109
109: ; preds = %107, %49
%110 = phi i64 [ 1, %49 ], [ %108, %107 ]
%111 = icmp eq i64 %55, 0
br i1 %111, label %133, label %112
112: ; preds = %109
%113 = getelementptr inbounds double, double* %12, i64 %110
%114 = bitcast double* %113 to <2 x double>*
%115 = load <2 x double>, <2 x double>* %114
%116 = getelementptr inbounds double, double* %113, i64 2
%117 = bitcast double* %116 to <2 x double>*
%118 = load <2 x double>, <2 x double>* %117
%119 = getelementptr inbounds double, double* %7, i64 %110
%120 = bitcast double* %119 to <2 x double>*
store <2 x double> %115, <2 x double>* %120
%121 = getelementptr inbounds double, double* %119, i64 2
%122 = bitcast double* %121 to <2 x double>*
store <2 x double> %118, <2 x double>* %122
%123 = getelementptr inbounds double, double* %15, i64 %110
%124 = bitcast double* %123 to <2 x double>*
%125 = load <2 x double>, <2 x double>* %124
%126 = getelementptr inbounds double, double* %123, i64 2
%127 = bitcast double* %126 to <2 x double>*
%128 = load <2 x double>, <2 x double>* %127
%129 = getelementptr inbounds double, double* %8, i64 %110
%130 = bitcast double* %129 to <2 x double>*
store <2 x double> %125, <2 x double>* %130
%131 = getelementptr inbounds double, double* %129, i64 2
%132 = bitcast double* %131 to <2 x double>*
store <2 x double> %128, <2 x double>* %132
br label %133
133: ; preds = %109, %112
%134 = icmp eq i64 %19, %50
br i1 %134, label %169, label %135
135: ; preds = %21, %16, %133
%136 = phi i64 [ 1, %21 ], [ 1, %16 ], [ %51, %133 ]
%137 = xor i64 %136, -1
%138 = and i64 %18, 1
%139 = icmp eq i64 %138, 0
br i1 %139, label %140, label %148
140: ; preds = %135
%141 = getelementptr inbounds double, double* %12, i64 %136
%142 = load double, double* %141
%143 = getelementptr inbounds double, double* %7, i64 %136
store double %142, double* %143
%144 = getelementptr inbounds double, double* %15, i64 %136
%145 = load double, double* %144
%146 = getelementptr inbounds double, double* %8, i64 %136
store double %145, double* %146
%147 = add nuw nsw i64 %136, 1
br label %148
148: ; preds = %140, %135
%149 = phi i64 [ %136, %135 ], [ %147, %140 ]
%150 = sub nsw i64 0, %18
%151 = icmp eq i64 %137, %150
br i1 %151, label %169, label %152
152: ; preds = %148, %152
%153 = phi i64 [ %167, %152 ], [ %149, %148 ]
%154 = getelementptr inbounds double, double* %12, i64 %153
%155 = load double, double* %154
%156 = getelementptr inbounds double, double* %7, i64 %153
store double %155, double* %156
%157 = getelementptr inbounds double, double* %15, i64 %153
%158 = load double, double* %157
%159 = getelementptr inbounds double, double* %8, i64 %153
store double %158, double* %159
%160 = add nuw nsw i64 %153, 1
%161 = getelementptr inbounds double, double* %12, i64 %160
%162 = load double, double* %161
%163 = getelementptr inbounds double, double* %7, i64 %160
store double %162, double* %163
%164 = getelementptr inbounds double, double* %15, i64 %160
%165 = load double, double* %164
%166 = getelementptr inbounds double, double* %8, i64 %160
store double %165, double* %166
%167 = add nuw nsw i64 %153, 2
%168 = icmp eq i64 %167, %18
br i1 %168, label %169, label %152
169: ; preds = %148, %152, %133, %6
%170 = getelementptr inbounds double, double* %12, i64 %10
%171 = load double, double* %170
%172 = getelementptr inbounds double, double* %15, i64 %13
%173 = load double, double* %172
%174 = getelementptr inbounds double, double* %12, i64 %13
%175 = load double, double* %174
%176 = fmul double %3, 2.000000e+00
%177 = tail call double @llvm.fmuladd.f64(double %176, double %175, double %171)
%178 = fmul double %3, %3
%179 = tail call double @llvm.fmuladd.f64(double %178, double %173, double %177)
store double %179, double* %170
%180 = fmul double %2, 2.000000e+00
%181 = tail call double @llvm.fmuladd.f64(double %180, double %175, double %173)
%182 = fmul double %2, %2
%183 = tail call double @llvm.fmuladd.f64(double %182, double %171, double %181)
store double %183, double* %172
br i1 %9, label %212, label %184
184: ; preds = %169
%185 = zext i32 %5 to i64
%186 = zext i32 %4 to i64
%187 = add nuw i32 %1, 1
%188 = zext i32 %187 to i64
br label %189
189: ; preds = %184, %209
%190 = phi i64 [ 1, %184 ], [ %210, %209 ]
%191 = icmp eq i64 %190, %186
%192 = icmp eq i64 %190, %185
%193 = or i1 %191, %192
br i1 %193, label %209, label %194
194: ; preds = %189
%195 = getelementptr inbounds double, double* %7, i64 %190
%196 = load double, double* %195
%197 = getelementptr inbounds double, double* %8, i64 %190
%198 = load double, double* %197
%199 = tail call double @llvm.fmuladd.f64(double %3, double %198, double %196)
%200 = getelementptr inbounds double, double* %12, i64 %190
store double %199, double* %200
%201 = getelementptr inbounds double*, double** %0, i64 %190
%202 = load double*, double** %201
%203 = getelementptr inbounds double, double* %202, i64 %10
store double %199, double* %203
%204 = load double, double* %197
%205 = load double, double* %195
%206 = tail call double @llvm.fmuladd.f64(double %2, double %205, double %204)
%207 = getelementptr inbounds double, double* %15, i64 %190
store double %206, double* %207
%208 = getelementptr inbounds double, double* %202, i64 %13
store double %206, double* %208
br label %209
209: ; preds = %189, %194
%210 = add nuw nsw i64 %190, 1
%211 = icmp eq i64 %210, %188
br i1 %211, label %212, label %189
212: ; preds = %209, %169
store double 0.000000e+00, double* %174
%213 = getelementptr inbounds double, double* %15, i64 %10
store double 0.000000e+00, double* %213
%214 = tail call i32 @free_dvector(double* %7, i32 1, i32 %1)
%215 = tail call i32 @free_dvector(double* %8, i32 1, i32 %1)
ret void
}