#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 */
int /*<<< orphan*/ givensRotation_double(double *, double, double);
void performQRStep_Givens_double(double *A, int m) {
  int k, i;
  int row_ind, giv_ind;
  double tau_one = 0.0;
  double tau_two = 0.0;
  double givensValues[4] = {0.0, 0.0, 0.0, 0.0};
  if (m == 2) {
    for (k = 0; k < 2; k++) {
      giv_ind = 2 * k;
      row_ind = 3 * k;
      givensRotation_double(&givensValues[giv_ind], A[row_ind + k],
                            A[row_ind + 3 + k]);
      for (i = 0; i < 3; i++) {
        tau_one = A[row_ind + i];
        tau_two = A[row_ind + 3 + i];
        A[row_ind + i] = tau_one * givensValues[giv_ind] -
                         tau_two * givensValues[giv_ind + 1];
        A[row_ind + 3 + i] = tau_one * givensValues[giv_ind + 1] +
                             tau_two * givensValues[giv_ind];
      }
    }
    for (k = 0; k < 2; k++) {
      giv_ind = 2 * k;
      for (i = 0; i < 3; i++) {
        row_ind = 3 * i;
        tau_one = A[row_ind + k];
        tau_two = A[row_ind + k + 1];
        A[row_ind + k] = tau_one * givensValues[giv_ind] -
                         tau_two * givensValues[giv_ind + 1];
        A[row_ind + k + 1] = tau_one * givensValues[giv_ind + 1] +
                             tau_two * givensValues[giv_ind];
      }
    }
  } else {
    givensRotation_double(givensValues, A[0], A[3]);
    tau_one = A[0];
    tau_two = A[3];
    A[0] = tau_one * givensValues[0] - tau_two * givensValues[1];
    A[3] = tau_one * givensValues[1] + tau_two * givensValues[0];
    tau_one = A[1];
    tau_two = A[4];
    A[1] = tau_one * givensValues[0] - tau_two * givensValues[1];
    A[4] = tau_one * givensValues[1] + tau_two * givensValues[0];
    tau_one = A[0];
    tau_two = A[1];
    A[0] = tau_one * givensValues[0] - tau_two * givensValues[1];
    A[1] = tau_one * givensValues[1] + tau_two * givensValues[0];
    tau_one = A[3];
    tau_two = A[4];
    A[3] = tau_one * givensValues[0] - tau_two * givensValues[1];
    A[4] = tau_one * givensValues[1] + tau_two * givensValues[0];
  }
}


x86 assembly (clang, -O0):
<performQRStep_Givens_double>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x28(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x30(%rbp)
lea    -0x50(%rbp),%rdi
xor    %esi,%esi
mov    $0x20,%edx
call   1040 <memset@plt>
cmpl   $0x2,-0xc(%rbp)
jne    13c5 <performQRStep_Givens_double+0x2a5>
movl   $0x0,-0x10(%rbp)
cmpl   $0x2,-0x10(%rbp)
jge    12aa <performQRStep_Givens_double+0x18a>
mov    -0x10(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0x1c(%rbp)
imul   $0x3,-0x10(%rbp),%eax
mov    %eax,-0x18(%rbp)
movslq -0x1c(%rbp),%rax
lea    -0x50(%rbp),%rdi
shl    $0x3,%rax
add    %rax,%rdi
mov    -0x8(%rbp),%rax
mov    -0x18(%rbp),%ecx
add    -0x10(%rbp),%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x8(%rbp),%rax
mov    -0x18(%rbp),%ecx
add    $0x3,%ecx
add    -0x10(%rbp),%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm1
call   1030 <givensRotation_double@plt>
movl   $0x0,-0x14(%rbp)
cmpl   $0x3,-0x14(%rbp)
jge    1297 <performQRStep_Givens_double+0x177>
mov    -0x8(%rbp),%rax
mov    -0x18(%rbp),%ecx
add    -0x14(%rbp),%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x28(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x18(%rbp),%ecx
add    $0x3,%ecx
add    -0x14(%rbp),%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x28(%rbp),%xmm0
movslq -0x1c(%rbp),%rax
movsd  -0x50(%rbp,%rax,8),%xmm2
movsd  -0x30(%rbp),%xmm1
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
cltq
mulsd  -0x50(%rbp,%rax,8),%xmm1
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x8(%rbp),%rax
mov    -0x18(%rbp),%ecx
add    -0x14(%rbp),%ecx
movslq %ecx,%rcx
movsd  %xmm0,(%rax,%rcx,8)
movsd  -0x28(%rbp),%xmm0
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
cltq
movsd  -0x50(%rbp,%rax,8),%xmm2
movsd  -0x30(%rbp),%xmm1
movslq -0x1c(%rbp),%rax
mulsd  -0x50(%rbp,%rax,8),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x8(%rbp),%rax
mov    -0x18(%rbp),%ecx
add    $0x3,%ecx
add    -0x14(%rbp),%ecx
movslq %ecx,%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    11bc <performQRStep_Givens_double+0x9c>
jmp    129c <performQRStep_Givens_double+0x17c>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1160 <performQRStep_Givens_double+0x40>
movl   $0x0,-0x10(%rbp)
cmpl   $0x2,-0x10(%rbp)
jge    13c0 <performQRStep_Givens_double+0x2a0>
mov    -0x10(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0x1c(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0x3,-0x14(%rbp)
jge    13ad <performQRStep_Givens_double+0x28d>
imul   $0x3,-0x14(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x18(%rbp),%ecx
add    -0x10(%rbp),%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x28(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x18(%rbp),%ecx
add    -0x10(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x28(%rbp),%xmm0
movslq -0x1c(%rbp),%rax
movsd  -0x50(%rbp,%rax,8),%xmm2
movsd  -0x30(%rbp),%xmm1
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
cltq
mulsd  -0x50(%rbp,%rax,8),%xmm1
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x8(%rbp),%rax
mov    -0x18(%rbp),%ecx
add    -0x10(%rbp),%ecx
movslq %ecx,%rcx
movsd  %xmm0,(%rax,%rcx,8)
movsd  -0x28(%rbp),%xmm0
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
cltq
movsd  -0x50(%rbp,%rax,8),%xmm2
movsd  -0x30(%rbp),%xmm1
movslq -0x1c(%rbp),%rax
mulsd  -0x50(%rbp,%rax,8),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x8(%rbp),%rax
mov    -0x18(%rbp),%ecx
add    -0x10(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    12cb <performQRStep_Givens_double+0x1ab>
jmp    13b2 <performQRStep_Givens_double+0x292>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    12b1 <performQRStep_Givens_double+0x191>
jmp    15cf <performQRStep_Givens_double+0x4af>
lea    -0x50(%rbp),%rdi
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x8(%rbp),%rax
movsd  0x18(%rax),%xmm1
call   1030 <givensRotation_double@plt>
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0x28(%rbp)
mov    -0x8(%rbp),%rax
movsd  0x18(%rax),%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x28(%rbp),%xmm0
movsd  -0x50(%rbp),%xmm2
movsd  -0x30(%rbp),%xmm1
mulsd  -0x48(%rbp),%xmm1
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x8(%rbp),%rax
movsd  %xmm0,(%rax)
movsd  -0x28(%rbp),%xmm0
movsd  -0x48(%rbp),%xmm2
movsd  -0x30(%rbp),%xmm1
mulsd  -0x50(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x8(%rbp),%rax
movsd  %xmm0,0x18(%rax)
mov    -0x8(%rbp),%rax
movsd  0x8(%rax),%xmm0
movsd  %xmm0,-0x28(%rbp)
mov    -0x8(%rbp),%rax
movsd  0x20(%rax),%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x28(%rbp),%xmm0
movsd  -0x50(%rbp),%xmm2
movsd  -0x30(%rbp),%xmm1
mulsd  -0x48(%rbp),%xmm1
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x8(%rbp),%rax
movsd  %xmm0,0x8(%rax)
movsd  -0x28(%rbp),%xmm0
movsd  -0x48(%rbp),%xmm2
movsd  -0x30(%rbp),%xmm1
mulsd  -0x50(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x8(%rbp),%rax
movsd  %xmm0,0x20(%rax)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0x28(%rbp)
mov    -0x8(%rbp),%rax
movsd  0x8(%rax),%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x28(%rbp),%xmm0
movsd  -0x50(%rbp),%xmm2
movsd  -0x30(%rbp),%xmm1
mulsd  -0x48(%rbp),%xmm1
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x8(%rbp),%rax
movsd  %xmm0,(%rax)
movsd  -0x28(%rbp),%xmm0
movsd  -0x48(%rbp),%xmm2
movsd  -0x30(%rbp),%xmm1
mulsd  -0x50(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x8(%rbp),%rax
movsd  %xmm0,0x8(%rax)
mov    -0x8(%rbp),%rax
movsd  0x18(%rax),%xmm0
movsd  %xmm0,-0x28(%rbp)
mov    -0x8(%rbp),%rax
movsd  0x20(%rax),%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x28(%rbp),%xmm0
movsd  -0x50(%rbp),%xmm2
movsd  -0x30(%rbp),%xmm1
mulsd  -0x48(%rbp),%xmm1
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x8(%rbp),%rax
movsd  %xmm0,0x18(%rax)
movsd  -0x28(%rbp),%xmm0
movsd  -0x48(%rbp),%xmm2
movsd  -0x30(%rbp),%xmm1
mulsd  -0x50(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x8(%rbp),%rax
movsd  %xmm0,0x20(%rax)
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<performQRStep_Givens_double>:
push   %rbp
push   %rbx
sub    $0x28,%rsp
mov    %esi,%ebp
mov    %rdi,%rbx
xorps  %xmm0,%xmm0
movaps %xmm0,0x10(%rsp)
movaps %xmm0,(%rsp)
movsd  (%rdi),%xmm0
movsd  0x18(%rdi),%xmm1
mov    %rsp,%rdi
call   1030 <givensRotation_double@plt>
cmp    $0x2,%ebp
jne    1347 <performQRStep_Givens_double+0x237>
movsd  (%rsp),%xmm1
movsd  0x8(%rsp),%xmm2
movupd 0x18(%rbx),%xmm3
movupd (%rbx),%xmm4
movapd %xmm2,%xmm0
unpcklpd %xmm2,%xmm0
movapd %xmm0,%xmm5
mulpd  %xmm3,%xmm5
movapd %xmm1,%xmm6
unpcklpd %xmm1,%xmm6
mulpd  %xmm4,%xmm0
mulpd  %xmm6,%xmm4
subpd  %xmm5,%xmm4
movupd %xmm4,(%rbx)
mulpd  %xmm3,%xmm6
addpd  %xmm6,%xmm0
movupd %xmm0,0x18(%rbx)
movsd  0x10(%rbx),%xmm3
movsd  0x28(%rbx),%xmm4
movapd %xmm3,%xmm5
mulsd  %xmm2,%xmm3
mulsd  %xmm4,%xmm2
mulsd  %xmm1,%xmm5
subsd  %xmm2,%xmm5
movsd  %xmm5,0x10(%rbx)
mulsd  %xmm1,%xmm4
addsd  %xmm4,%xmm3
movsd  %xmm3,0x28(%rbx)
lea    0x10(%rsp),%rdi
movsd  0x38(%rbx),%xmm1
unpckhpd %xmm0,%xmm0
call   1030 <givensRotation_double@plt>
movsd  0x10(%rsp),%xmm9
movsd  0x18(%rsp),%xmm8
movsd  0x18(%rbx),%xmm11
movsd  0x30(%rbx),%xmm1
movapd %xmm8,%xmm2
mulsd  %xmm1,%xmm2
movapd %xmm11,%xmm13
mulsd  %xmm9,%xmm13
subsd  %xmm2,%xmm13
mulsd  %xmm9,%xmm1
mulsd  %xmm8,%xmm11
addsd  %xmm1,%xmm11
movupd 0x38(%rbx),%xmm1
movupd 0x20(%rbx),%xmm7
movapd %xmm8,%xmm0
unpcklpd %xmm8,%xmm0
movapd %xmm0,%xmm2
mulpd  %xmm1,%xmm2
movapd %xmm9,%xmm4
unpcklpd %xmm9,%xmm4
mulpd  %xmm7,%xmm0
mulpd  %xmm4,%xmm7
subpd  %xmm2,%xmm7
mulpd  %xmm1,%xmm4
addpd  %xmm4,%xmm0
movsd  (%rsp),%xmm10
movsd  0x8(%rsp),%xmm12
movsd  (%rbx),%xmm5
movupd 0x8(%rbx),%xmm6
movapd %xmm6,%xmm2
mulsd  %xmm10,%xmm2
movapd %xmm5,%xmm1
mulsd  %xmm12,%xmm1
addsd  %xmm2,%xmm1
movapd %xmm7,%xmm2
mulsd  %xmm10,%xmm2
movapd %xmm13,%xmm4
mulsd  %xmm12,%xmm4
addsd  %xmm2,%xmm4
movapd %xmm0,%xmm3
mulsd  %xmm10,%xmm3
movapd %xmm11,%xmm2
mulsd  %xmm12,%xmm2
addsd  %xmm3,%xmm2
unpcklpd %xmm8,%xmm12
movapd %xmm12,%xmm3
mulpd  %xmm6,%xmm3
unpcklpd %xmm1,%xmm5
unpcklpd %xmm9,%xmm10
mulpd  %xmm10,%xmm5
subpd  %xmm3,%xmm5
movupd %xmm5,(%rbx)
unpckhpd %xmm6,%xmm6
mulsd  %xmm9,%xmm6
mulsd  %xmm8,%xmm1
addsd  %xmm6,%xmm1
movsd  %xmm1,0x10(%rbx)
movapd %xmm12,%xmm1
mulpd  %xmm7,%xmm1
unpcklpd %xmm4,%xmm13
mulpd  %xmm10,%xmm13
subpd  %xmm1,%xmm13
movupd %xmm13,0x18(%rbx)
unpckhpd %xmm7,%xmm7
mulsd  %xmm9,%xmm7
mulsd  %xmm8,%xmm4
addsd  %xmm7,%xmm4
movsd  %xmm4,0x28(%rbx)
mulpd  %xmm0,%xmm12
unpcklpd %xmm2,%xmm11
mulpd  %xmm10,%xmm11
subpd  %xmm12,%xmm11
movupd %xmm11,0x30(%rbx)
unpckhpd %xmm0,%xmm0
mulsd  %xmm9,%xmm0
mulsd  %xmm8,%xmm2
addsd  %xmm0,%xmm2
movsd  %xmm2,0x40(%rbx)
jmp    13ed <performQRStep_Givens_double+0x2dd>
movsd  0x18(%rbx),%xmm4
movapd (%rsp),%xmm1
movapd %xmm1,%xmm0
unpckhpd %xmm1,%xmm0
movapd %xmm0,%xmm5
mulsd  %xmm4,%xmm5
movsd  (%rbx),%xmm2
movsd  0x8(%rbx),%xmm6
movapd %xmm2,%xmm3
mulsd  %xmm1,%xmm3
subsd  %xmm5,%xmm3
mulsd  %xmm1,%xmm4
mulsd  %xmm0,%xmm2
addsd  %xmm4,%xmm2
movsd  0x20(%rbx),%xmm4
movapd %xmm0,%xmm5
mulsd  %xmm4,%xmm5
mulsd  %xmm6,%xmm0
mulsd  %xmm1,%xmm6
subsd  %xmm5,%xmm6
mulsd  %xmm1,%xmm4
addsd  %xmm4,%xmm0
movapd 0xc55(%rip),%xmm4
movapd %xmm6,%xmm5
xorpd  %xmm4,%xmm5
unpcklpd %xmm6,%xmm5
unpcklpd %xmm3,%xmm3
mulpd  %xmm1,%xmm3
unpcklpd %xmm2,%xmm2
mulpd  %xmm1,%xmm2
shufpd $0x1,%xmm1,%xmm1
mulpd  %xmm1,%xmm5
addpd  %xmm5,%xmm3
movupd %xmm3,(%rbx)
xorpd  %xmm0,%xmm4
unpcklpd %xmm0,%xmm4
mulpd  %xmm1,%xmm4
addpd  %xmm4,%xmm2
movupd %xmm2,0x18(%rbx)
add    $0x28,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define void @performQRStep_Givens_double(double* %0, i32 %1) {
%3 = alloca double*
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca double
%10 = alloca double
%11 = alloca [4 x double]
store double* %0, double** %3
store i32 %1, i32* %4
store double 0.000000e+00, double* %9
store double 0.000000e+00, double* %10
%12 = bitcast [4 x double]* %11 to i8*
%13 = load i32, i32* %4
%14 = icmp eq i32 %13, 2
br i1 %14, label %15, label %185
15: ; preds = %2
store i32 0, i32* %5
br label %16
16: ; preds = %106, %15
%17 = load i32, i32* %5
%18 = icmp slt i32 %17, 2
br i1 %18, label %19, label %109
19: ; preds = %16
%20 = load i32, i32* %5
%21 = mul nsw i32 2, %20
store i32 %21, i32* %8
%22 = load i32, i32* %5
%23 = mul nsw i32 3, %22
store i32 %23, i32* %7
%24 = load i32, i32* %8
%25 = sext i32 %24 to i64
%26 = getelementptr inbounds [4 x double], [4 x double]* %11, i64 0, i64 %25
%27 = load double*, double** %3
%28 = load i32, i32* %7
%29 = load i32, i32* %5
%30 = add nsw i32 %28, %29
%31 = sext i32 %30 to i64
%32 = getelementptr inbounds double, double* %27, i64 %31
%33 = load double, double* %32
%34 = load double*, double** %3
%35 = load i32, i32* %7
%36 = add nsw i32 %35, 3
%37 = load i32, i32* %5
%38 = add nsw i32 %36, %37
%39 = sext i32 %38 to i64
%40 = getelementptr inbounds double, double* %34, i64 %39
%41 = load double, double* %40
%42 = call i32 @givensRotation_double(double* %26, double %33, double %41)
store i32 0, i32* %6
br label %43
43: ; preds = %102, %19
%44 = load i32, i32* %6
%45 = icmp slt i32 %44, 3
br i1 %45, label %46, label %105
46: ; preds = %43
%47 = load double*, double** %3
%48 = load i32, i32* %7
%49 = load i32, i32* %6
%50 = add nsw i32 %48, %49
%51 = sext i32 %50 to i64
%52 = getelementptr inbounds double, double* %47, i64 %51
%53 = load double, double* %52
store double %53, double* %9
%54 = load double*, double** %3
%55 = load i32, i32* %7
%56 = add nsw i32 %55, 3
%57 = load i32, i32* %6
%58 = add nsw i32 %56, %57
%59 = sext i32 %58 to i64
%60 = getelementptr inbounds double, double* %54, i64 %59
%61 = load double, double* %60
store double %61, double* %10
%62 = load double, double* %9
%63 = load i32, i32* %8
%64 = sext i32 %63 to i64
%65 = getelementptr inbounds [4 x double], [4 x double]* %11, i64 0, i64 %64
%66 = load double, double* %65
%67 = load double, double* %10
%68 = load i32, i32* %8
%69 = add nsw i32 %68, 1
%70 = sext i32 %69 to i64
%71 = getelementptr inbounds [4 x double], [4 x double]* %11, i64 0, i64 %70
%72 = load double, double* %71
%73 = fmul double %67, %72
%74 = fneg double %73
%75 = call double @llvm.fmuladd.f64(double %62, double %66, double %74)
%76 = load double*, double** %3
%77 = load i32, i32* %7
%78 = load i32, i32* %6
%79 = add nsw i32 %77, %78
%80 = sext i32 %79 to i64
%81 = getelementptr inbounds double, double* %76, i64 %80
store double %75, double* %81
%82 = load double, double* %9
%83 = load i32, i32* %8
%84 = add nsw i32 %83, 1
%85 = sext i32 %84 to i64
%86 = getelementptr inbounds [4 x double], [4 x double]* %11, i64 0, i64 %85
%87 = load double, double* %86
%88 = load double, double* %10
%89 = load i32, i32* %8
%90 = sext i32 %89 to i64
%91 = getelementptr inbounds [4 x double], [4 x double]* %11, i64 0, i64 %90
%92 = load double, double* %91
%93 = fmul double %88, %92
%94 = call double @llvm.fmuladd.f64(double %82, double %87, double %93)
%95 = load double*, double** %3
%96 = load i32, i32* %7
%97 = add nsw i32 %96, 3
%98 = load i32, i32* %6
%99 = add nsw i32 %97, %98
%100 = sext i32 %99 to i64
%101 = getelementptr inbounds double, double* %95, i64 %100
store double %94, double* %101
br label %102
102: ; preds = %46
%103 = load i32, i32* %6
%104 = add nsw i32 %103, 1
store i32 %104, i32* %6
br label %43
105: ; preds = %43
br label %106
106: ; preds = %105
%107 = load i32, i32* %5
%108 = add nsw i32 %107, 1
store i32 %108, i32* %5
br label %16
109: ; preds = %16
store i32 0, i32* %5
br label %110
110: ; preds = %181, %109
%111 = load i32, i32* %5
%112 = icmp slt i32 %111, 2
br i1 %112, label %113, label %184
113: ; preds = %110
%114 = load i32, i32* %5
%115 = mul nsw i32 2, %114
store i32 %115, i32* %8
store i32 0, i32* %6
br label %116
116: ; preds = %177, %113
%117 = load i32, i32* %6
%118 = icmp slt i32 %117, 3
br i1 %118, label %119, label %180
119: ; preds = %116
%120 = load i32, i32* %6
%121 = mul nsw i32 3, %120
store i32 %121, i32* %7
%122 = load double*, double** %3
%123 = load i32, i32* %7
%124 = load i32, i32* %5
%125 = add nsw i32 %123, %124
%126 = sext i32 %125 to i64
%127 = getelementptr inbounds double, double* %122, i64 %126
%128 = load double, double* %127
store double %128, double* %9
%129 = load double*, double** %3
%130 = load i32, i32* %7
%131 = load i32, i32* %5
%132 = add nsw i32 %130, %131
%133 = add nsw i32 %132, 1
%134 = sext i32 %133 to i64
%135 = getelementptr inbounds double, double* %129, i64 %134
%136 = load double, double* %135
store double %136, double* %10
%137 = load double, double* %9
%138 = load i32, i32* %8
%139 = sext i32 %138 to i64
%140 = getelementptr inbounds [4 x double], [4 x double]* %11, i64 0, i64 %139
%141 = load double, double* %140
%142 = load double, double* %10
%143 = load i32, i32* %8
%144 = add nsw i32 %143, 1
%145 = sext i32 %144 to i64
%146 = getelementptr inbounds [4 x double], [4 x double]* %11, i64 0, i64 %145
%147 = load double, double* %146
%148 = fmul double %142, %147
%149 = fneg double %148
%150 = call double @llvm.fmuladd.f64(double %137, double %141, double %149)
%151 = load double*, double** %3
%152 = load i32, i32* %7
%153 = load i32, i32* %5
%154 = add nsw i32 %152, %153
%155 = sext i32 %154 to i64
%156 = getelementptr inbounds double, double* %151, i64 %155
store double %150, double* %156
%157 = load double, double* %9
%158 = load i32, i32* %8
%159 = add nsw i32 %158, 1
%160 = sext i32 %159 to i64
%161 = getelementptr inbounds [4 x double], [4 x double]* %11, i64 0, i64 %160
%162 = load double, double* %161
%163 = load double, double* %10
%164 = load i32, i32* %8
%165 = sext i32 %164 to i64
%166 = getelementptr inbounds [4 x double], [4 x double]* %11, i64 0, i64 %165
%167 = load double, double* %166
%168 = fmul double %163, %167
%169 = call double @llvm.fmuladd.f64(double %157, double %162, double %168)
%170 = load double*, double** %3
%171 = load i32, i32* %7
%172 = load i32, i32* %5
%173 = add nsw i32 %171, %172
%174 = add nsw i32 %173, 1
%175 = sext i32 %174 to i64
%176 = getelementptr inbounds double, double* %170, i64 %175
store double %169, double* %176
br label %177
177: ; preds = %119
%178 = load i32, i32* %6
%179 = add nsw i32 %178, 1
store i32 %179, i32* %6
br label %116
180: ; preds = %116
br label %181
181: ; preds = %180
%182 = load i32, i32* %5
%183 = add nsw i32 %182, 1
store i32 %183, i32* %5
br label %110
184: ; preds = %110
br label %302
185: ; preds = %2
%186 = getelementptr inbounds [4 x double], [4 x double]* %11, i64 0, i64 0
%187 = load double*, double** %3
%188 = getelementptr inbounds double, double* %187, i64 0
%189 = load double, double* %188
%190 = load double*, double** %3
%191 = getelementptr inbounds double, double* %190, i64 3
%192 = load double, double* %191
%193 = call i32 @givensRotation_double(double* %186, double %189, double %192)
%194 = load double*, double** %3
%195 = getelementptr inbounds double, double* %194, i64 0
%196 = load double, double* %195
store double %196, double* %9
%197 = load double*, double** %3
%198 = getelementptr inbounds double, double* %197, i64 3
%199 = load double, double* %198
store double %199, double* %10
%200 = load double, double* %9
%201 = getelementptr inbounds [4 x double], [4 x double]* %11, i64 0, i64 0
%202 = load double, double* %201
%203 = load double, double* %10
%204 = getelementptr inbounds [4 x double], [4 x double]* %11, i64 0, i64 1
%205 = load double, double* %204
%206 = fmul double %203, %205
%207 = fneg double %206
%208 = call double @llvm.fmuladd.f64(double %200, double %202, double %207)
%209 = load double*, double** %3
%210 = getelementptr inbounds double, double* %209, i64 0
store double %208, double* %210
%211 = load double, double* %9
%212 = getelementptr inbounds [4 x double], [4 x double]* %11, i64 0, i64 1
%213 = load double, double* %212
%214 = load double, double* %10
%215 = getelementptr inbounds [4 x double], [4 x double]* %11, i64 0, i64 0
%216 = load double, double* %215
%217 = fmul double %214, %216
%218 = call double @llvm.fmuladd.f64(double %211, double %213, double %217)
%219 = load double*, double** %3
%220 = getelementptr inbounds double, double* %219, i64 3
store double %218, double* %220
%221 = load double*, double** %3
%222 = getelementptr inbounds double, double* %221, i64 1
%223 = load double, double* %222
store double %223, double* %9
%224 = load double*, double** %3
%225 = getelementptr inbounds double, double* %224, i64 4
%226 = load double, double* %225
store double %226, double* %10
%227 = load double, double* %9
%228 = getelementptr inbounds [4 x double], [4 x double]* %11, i64 0, i64 0
%229 = load double, double* %228
%230 = load double, double* %10
%231 = getelementptr inbounds [4 x double], [4 x double]* %11, i64 0, i64 1
%232 = load double, double* %231
%233 = fmul double %230, %232
%234 = fneg double %233
%235 = call double @llvm.fmuladd.f64(double %227, double %229, double %234)
%236 = load double*, double** %3
%237 = getelementptr inbounds double, double* %236, i64 1
store double %235, double* %237
%238 = load double, double* %9
%239 = getelementptr inbounds [4 x double], [4 x double]* %11, i64 0, i64 1
%240 = load double, double* %239
%241 = load double, double* %10
%242 = getelementptr inbounds [4 x double], [4 x double]* %11, i64 0, i64 0
%243 = load double, double* %242
%244 = fmul double %241, %243
%245 = call double @llvm.fmuladd.f64(double %238, double %240, double %244)
%246 = load double*, double** %3
%247 = getelementptr inbounds double, double* %246, i64 4
store double %245, double* %247
%248 = load double*, double** %3
%249 = getelementptr inbounds double, double* %248, i64 0
%250 = load double, double* %249
store double %250, double* %9
%251 = load double*, double** %3
%252 = getelementptr inbounds double, double* %251, i64 1
%253 = load double, double* %252
store double %253, double* %10
%254 = load double, double* %9
%255 = getelementptr inbounds [4 x double], [4 x double]* %11, i64 0, i64 0
%256 = load double, double* %255
%257 = load double, double* %10
%258 = getelementptr inbounds [4 x double], [4 x double]* %11, i64 0, i64 1
%259 = load double, double* %258
%260 = fmul double %257, %259
%261 = fneg double %260
%262 = call double @llvm.fmuladd.f64(double %254, double %256, double %261)
%263 = load double*, double** %3
%264 = getelementptr inbounds double, double* %263, i64 0
store double %262, double* %264
%265 = load double, double* %9
%266 = getelementptr inbounds [4 x double], [4 x double]* %11, i64 0, i64 1
%267 = load double, double* %266
%268 = load double, double* %10
%269 = getelementptr inbounds [4 x double], [4 x double]* %11, i64 0, i64 0
%270 = load double, double* %269
%271 = fmul double %268, %270
%272 = call double @llvm.fmuladd.f64(double %265, double %267, double %271)
%273 = load double*, double** %3
%274 = getelementptr inbounds double, double* %273, i64 1
store double %272, double* %274
%275 = load double*, double** %3
%276 = getelementptr inbounds double, double* %275, i64 3
%277 = load double, double* %276
store double %277, double* %9
%278 = load double*, double** %3
%279 = getelementptr inbounds double, double* %278, i64 4
%280 = load double, double* %279
store double %280, double* %10
%281 = load double, double* %9
%282 = getelementptr inbounds [4 x double], [4 x double]* %11, i64 0, i64 0
%283 = load double, double* %282
%284 = load double, double* %10
%285 = getelementptr inbounds [4 x double], [4 x double]* %11, i64 0, i64 1
%286 = load double, double* %285
%287 = fmul double %284, %286
%288 = fneg double %287
%289 = call double @llvm.fmuladd.f64(double %281, double %283, double %288)
%290 = load double*, double** %3
%291 = getelementptr inbounds double, double* %290, i64 3
store double %289, double* %291
%292 = load double, double* %9
%293 = getelementptr inbounds [4 x double], [4 x double]* %11, i64 0, i64 1
%294 = load double, double* %293
%295 = load double, double* %10
%296 = getelementptr inbounds [4 x double], [4 x double]* %11, i64 0, i64 0
%297 = load double, double* %296
%298 = fmul double %295, %297
%299 = call double @llvm.fmuladd.f64(double %292, double %294, double %298)
%300 = load double*, double** %3
%301 = getelementptr inbounds double, double* %300, i64 4
store double %299, double* %301
br label %302
302: ; preds = %185, %184
ret void
}

LLVM IR (-O2):
define void @performQRStep_Givens_double(double* nocapture %0, i32 %1) {
%3 = alloca [4 x double]
%4 = bitcast [4 x double]* %3 to i8*
%5 = icmp eq i32 %1, 2
%6 = getelementptr inbounds [4 x double], [4 x double]* %3, i64 0, i64 0
%7 = load double, double* %0
%8 = getelementptr inbounds double, double* %0, i64 3
%9 = load double, double* %8
%10 = call i32 @givensRotation_double(double* %6, double %7, double %9)
br i1 %5, label %11, label %116
11: ; preds = %2
%12 = load double, double* %6
%13 = getelementptr inbounds [4 x double], [4 x double]* %3, i64 0, i64 1
%14 = load double, double* %13
%15 = getelementptr inbounds double, double* %0, i64 4
%16 = bitcast double* %8 to <2 x double>*
%17 = load <2 x double>, <2 x double>* %16
%18 = getelementptr inbounds double, double* %0, i64 1
%19 = bitcast double* %0 to <2 x double>*
%20 = load <2 x double>, <2 x double>* %19
%21 = fneg <2 x double> %17
%22 = insertelement <2 x double> poison, double %14, i64 0
%23 = shufflevector <2 x double> %22, <2 x double> poison, <2 x i32> zeroinitializer
%24 = fmul <2 x double> %23, %21
%25 = insertelement <2 x double> poison, double %12, i64 0
%26 = shufflevector <2 x double> %25, <2 x double> poison, <2 x i32> zeroinitializer
%27 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %20, <2 x double> %26, <2 x double> %24)
%28 = bitcast double* %0 to <2 x double>*
store <2 x double> %27, <2 x double>* %28
%29 = fmul <2 x double> %17, %26
%30 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %20, <2 x double> %23, <2 x double> %29)
%31 = bitcast double* %8 to <2 x double>*
store <2 x double> %30, <2 x double>* %31
%32 = getelementptr inbounds double, double* %0, i64 2
%33 = load double, double* %32
%34 = getelementptr inbounds double, double* %0, i64 5
%35 = load double, double* %34
%36 = fneg double %35
%37 = fmul double %14, %36
%38 = call double @llvm.fmuladd.f64(double %33, double %12, double %37)
store double %38, double* %32
%39 = fmul double %35, %12
%40 = call double @llvm.fmuladd.f64(double %33, double %14, double %39)
store double %40, double* %34
%41 = getelementptr inbounds [4 x double], [4 x double]* %3, i64 0, i64 2
%42 = getelementptr inbounds double, double* %0, i64 7
%43 = load double, double* %42
%44 = extractelement <2 x double> %30, i64 1
%45 = call i32 @givensRotation_double(double* %41, double %44, double %43)
%46 = load double, double* %41
%47 = getelementptr inbounds [4 x double], [4 x double]* %3, i64 0, i64 3
%48 = load double, double* %47
%49 = load double, double* %8
%50 = getelementptr inbounds double, double* %0, i64 6
%51 = load double, double* %50
%52 = fneg double %51
%53 = fmul double %48, %52
%54 = call double @llvm.fmuladd.f64(double %49, double %46, double %53)
%55 = fmul double %51, %46
%56 = call double @llvm.fmuladd.f64(double %49, double %48, double %55)
%57 = getelementptr inbounds double, double* %0, i64 8
%58 = bitcast double* %42 to <2 x double>*
%59 = load <2 x double>, <2 x double>* %58
%60 = bitcast double* %15 to <2 x double>*
%61 = load <2 x double>, <2 x double>* %60
%62 = fneg <2 x double> %59
%63 = insertelement <2 x double> poison, double %48, i64 0
%64 = shufflevector <2 x double> %63, <2 x double> poison, <2 x i32> zeroinitializer
%65 = fmul <2 x double> %64, %62
%66 = insertelement <2 x double> poison, double %46, i64 0
%67 = shufflevector <2 x double> %66, <2 x double> poison, <2 x i32> zeroinitializer
%68 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %61, <2 x double> %67, <2 x double> %65)
%69 = fmul <2 x double> %59, %67
%70 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %61, <2 x double> %64, <2 x double> %69)
%71 = load double, double* %6
%72 = load double, double* %13
%73 = load double, double* %0
%74 = bitcast double* %18 to <2 x double>*
%75 = load <2 x double>, <2 x double>* %74
%76 = extractelement <2 x double> %75, i64 0
%77 = fmul double %76, %71
%78 = call double @llvm.fmuladd.f64(double %73, double %72, double %77)
%79 = extractelement <2 x double> %68, i64 0
%80 = fmul double %79, %71
%81 = call double @llvm.fmuladd.f64(double %54, double %72, double %80)
%82 = extractelement <2 x double> %70, i64 0
%83 = fmul double %82, %71
%84 = call double @llvm.fmuladd.f64(double %56, double %72, double %83)
%85 = fneg <2 x double> %75
%86 = insertelement <2 x double> poison, double %72, i64 0
%87 = insertelement <2 x double> %86, double %48, i64 1
%88 = fmul <2 x double> %87, %85
%89 = insertelement <2 x double> poison, double %73, i64 0
%90 = insertelement <2 x double> %89, double %78, i64 1
%91 = insertelement <2 x double> poison, double %71, i64 0
%92 = insertelement <2 x double> %91, double %46, i64 1
%93 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %90, <2 x double> %92, <2 x double> %88)
%94 = bitcast double* %0 to <2 x double>*
store <2 x double> %93, <2 x double>* %94
%95 = extractelement <2 x double> %75, i64 1
%96 = fmul double %95, %46
%97 = call double @llvm.fmuladd.f64(double %78, double %48, double %96)
store double %97, double* %32
%98 = fneg <2 x double> %68
%99 = fmul <2 x double> %87, %98
%100 = insertelement <2 x double> poison, double %54, i64 0
%101 = insertelement <2 x double> %100, double %81, i64 1
%102 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %101, <2 x double> %92, <2 x double> %99)
%103 = bitcast double* %8 to <2 x double>*
store <2 x double> %102, <2 x double>* %103
%104 = extractelement <2 x double> %68, i64 1
%105 = fmul double %104, %46
%106 = call double @llvm.fmuladd.f64(double %81, double %48, double %105)
store double %106, double* %34
%107 = fneg <2 x double> %70
%108 = fmul <2 x double> %87, %107
%109 = insertelement <2 x double> poison, double %56, i64 0
%110 = insertelement <2 x double> %109, double %84, i64 1
%111 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %110, <2 x double> %92, <2 x double> %108)
%112 = bitcast double* %50 to <2 x double>*
store <2 x double> %111, <2 x double>* %112
%113 = extractelement <2 x double> %70, i64 1
%114 = fmul double %113, %46
%115 = call double @llvm.fmuladd.f64(double %84, double %48, double %114)
store double %115, double* %57
br label %155
116: ; preds = %2
%117 = load double, double* %0
%118 = load double, double* %8
%119 = bitcast [4 x double]* %3 to <2 x double>*
%120 = load <2 x double>, <2 x double>* %119
%121 = fneg double %118
%122 = extractelement <2 x double> %120, i64 1
%123 = fmul double %122, %121
%124 = extractelement <2 x double> %120, i64 0
%125 = call double @llvm.fmuladd.f64(double %117, double %124, double %123)
%126 = fmul double %118, %124
%127 = call double @llvm.fmuladd.f64(double %117, double %122, double %126)
%128 = getelementptr inbounds double, double* %0, i64 1
%129 = load double, double* %128
%130 = getelementptr inbounds double, double* %0, i64 4
%131 = load double, double* %130
%132 = fneg double %131
%133 = fmul double %122, %132
%134 = call double @llvm.fmuladd.f64(double %129, double %124, double %133)
%135 = fmul double %124, %131
%136 = call double @llvm.fmuladd.f64(double %129, double %122, double %135)
%137 = fneg double %134
%138 = insertelement <2 x double> poison, double %134, i64 0
%139 = insertelement <2 x double> %138, double %137, i64 1
%140 = fmul <2 x double> %120, %139
%141 = shufflevector <2 x double> %140, <2 x double> poison, <2 x i32> <i32 1, i32 0>
%142 = insertelement <2 x double> poison, double %125, i64 0
%143 = shufflevector <2 x double> %142, <2 x double> poison, <2 x i32> zeroinitializer
%144 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %143, <2 x double> %120, <2 x double> %141)
%145 = bitcast double* %0 to <2 x double>*
store <2 x double> %144, <2 x double>* %145
%146 = fneg double %136
%147 = insertelement <2 x double> poison, double %136, i64 0
%148 = insertelement <2 x double> %147, double %146, i64 1
%149 = fmul <2 x double> %120, %148
%150 = shufflevector <2 x double> %149, <2 x double> poison, <2 x i32> <i32 1, i32 0>
%151 = insertelement <2 x double> poison, double %127, i64 0
%152 = shufflevector <2 x double> %151, <2 x double> poison, <2 x i32> zeroinitializer
%153 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %152, <2 x double> %120, <2 x double> %150)
%154 = bitcast double* %8 to <2 x double>*
store <2 x double> %153, <2 x double>* %154
br label %155
155: ; preds = %11, %116
ret void
}