#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 quatMultiply(double *, double *, double *, int);
int quatMultLoopf(float *q1, float *q2, float *q1q2, unsigned long long nq1,
                  unsigned long long nq2, int p) {
  unsigned long long i, j, q1step, q2step, q1q2step, nq, istep;
  int trash;
  double q1temp[4], q2temp[4], q1q2temp[4];
  q1q2step = 4;
  q1step = (nq1 == 1) ? 0 : 4;
  q2step = (nq2 == 1) ? 0 : 4;
  if ((nq1 > 1) && (nq2 > 1)) {
    nq = (nq1 <= nq2) ? nq1 : nq2;
  } else {
    nq = (nq1 >= nq2) ? nq1 : nq2;
  }
  if ((nq1 == 1) && (nq > 1)) {
#pragma omp parallel shared(q1, q2, q1q2) private(i, j, trash, q1temp, q2temp, \
                                                  q1q2temp)                    \
    firstprivate(q1step, q2step, q1q2step, nq, p)
    {
      for (j = 0; j < 4; j++)
        q1temp[j] = (double)q1[j];
#pragma omp for schedule(static) nowait
      for (i = 0; i < nq; i++) {
        for (j = 0; j < 4; j++)
          q2temp[j] = (double)q2[i * q2step + j];
        trash = quatMultiply(q1temp, q2temp, q1q2temp, p);
        for (j = 0; j < 4; j++)
          q1q2[i * q1q2step + j] = (float)q1q2temp[j];
      }
    }
  } else if ((nq2 == 1) && nq > 1) {
#pragma omp parallel shared(q1, q2, q1q2) private(i, j, trash, q1temp, q2temp, \
                                                  q1q2temp)                    \
    firstprivate(q1step, q2step, q1q2step, nq, p)
    {
      for (j = 0; j < 4; j++)
        q2temp[j] = (double)q2[j];
#pragma omp for schedule(static) nowait
      for (i = 0; i < nq; i++) {
        for (j = 0; j < 4; j++)
          q1temp[j] = (double)q1[i * q1step + j];
        trash = quatMultiply(q1temp, q2temp, q1q2temp, p);
        for (j = 0; j < 4; j++)
          q1q2[i * q1q2step + j] = (float)q1q2temp[j];
      }
    }
  } else {
#pragma omp parallel shared(q1, q2, q1q2) private(i, j, trash, q1temp, q2temp, \
                                                  q1q2temp)                    \
    firstprivate(q1step, q2step, q1q2step, nq, p)
    {
#pragma omp for schedule(static) nowait
      for (i = 0; i < nq; i++) {
        for (j = 0; j < 4; j++) {
          q2temp[j] = (double)q2[i * q2step + j];
          q1temp[j] = (double)q1[i * q1step + j];
        }
        trash = quatMultiply(q1temp, q2temp, q1q2temp, p);
        for (j = 0; j < 4; j++)
          q1q2[i * q1q2step + j] = (float)q1q2temp[j];
      }
    }
  }
  return 1;
}


x86 assembly (clang, -O0):
<quatMultLoopf>:
push   %rbp
mov    %rsp,%rbp
sub    $0xe0,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9d,-0x2c(%rbp)
movq   $0x4,-0x58(%rbp)
mov    -0x20(%rbp),%rdx
mov    $0x4,%eax
xor    %ecx,%ecx
cmp    $0x1,%rdx
cmove  %ecx,%eax
cltq
mov    %rax,-0x48(%rbp)
mov    -0x28(%rbp),%rdx
mov    $0x4,%eax
xor    %ecx,%ecx
cmp    $0x1,%rdx
cmove  %ecx,%eax
cltq
mov    %rax,-0x50(%rbp)
cmpq   $0x1,-0x20(%rbp)
jbe    11ba <quatMultLoopf+0xaa>
cmpq   $0x1,-0x28(%rbp)
jbe    11ba <quatMultLoopf+0xaa>
mov    -0x20(%rbp),%rax
cmp    -0x28(%rbp),%rax
ja     119f <quatMultLoopf+0x8f>
mov    -0x20(%rbp),%rax
mov    %rax,-0xd8(%rbp)
jmp    11aa <quatMultLoopf+0x9a>
mov    -0x28(%rbp),%rax
mov    %rax,-0xd8(%rbp)
mov    -0xd8(%rbp),%rax
mov    %rax,-0x60(%rbp)
jmp    11ee <quatMultLoopf+0xde>
mov    -0x20(%rbp),%rax
cmp    -0x28(%rbp),%rax
jb     11d8 <quatMultLoopf+0xc8>
mov    -0x20(%rbp),%rax
mov    %rax,-0xe0(%rbp)
jmp    11e3 <quatMultLoopf+0xd3>
mov    -0x28(%rbp),%rax
mov    %rax,-0xe0(%rbp)
mov    -0xe0(%rbp),%rax
mov    %rax,-0x60(%rbp)
cmpq   $0x1,-0x20(%rbp)
jne    132d <quatMultLoopf+0x21d>
cmpq   $0x1,-0x60(%rbp)
jbe    132d <quatMultLoopf+0x21d>
movq   $0x0,-0x40(%rbp)
cmpq   $0x4,-0x40(%rbp)
jae    1246 <quatMultLoopf+0x136>
mov    -0x8(%rbp),%rax
mov    -0x40(%rbp),%rcx
movss  (%rax,%rcx,4),%xmm0
cvtss2sd %xmm0,%xmm0
mov    -0x40(%rbp),%rax
movsd  %xmm0,-0x90(%rbp,%rax,8)
ff ff
mov    -0x40(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x40(%rbp)
jmp    120c <quatMultLoopf+0xfc>
movq   $0x0,-0x38(%rbp)
mov    -0x38(%rbp),%rax
cmp    -0x60(%rbp),%rax
jae    1328 <quatMultLoopf+0x218>
movq   $0x0,-0x40(%rbp)
cmpq   $0x4,-0x40(%rbp)
jae    12a7 <quatMultLoopf+0x197>
mov    -0x10(%rbp),%rax
mov    -0x38(%rbp),%rcx
imul   -0x50(%rbp),%rcx
add    -0x40(%rbp),%rcx
movss  (%rax,%rcx,4),%xmm0
cvtss2sd %xmm0,%xmm0
mov    -0x40(%rbp),%rax
movsd  %xmm0,-0xb0(%rbp,%rax,8)
ff ff
mov    -0x40(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x40(%rbp)
jmp    1264 <quatMultLoopf+0x154>
lea    -0x90(%rbp),%rdi
lea    -0xb0(%rbp),%rsi
lea    -0xd0(%rbp),%rdx
mov    -0x2c(%rbp),%ecx
call   1030 <quatMultiply@plt>
mov    %eax,-0x6c(%rbp)
movq   $0x0,-0x40(%rbp)
cmpq   $0x4,-0x40(%rbp)
jae    1312 <quatMultLoopf+0x202>
mov    -0x40(%rbp),%rax
movsd  -0xd0(%rbp,%rax,8),%xmm0
ff ff
cvtsd2ss %xmm0,%xmm0
mov    -0x18(%rbp),%rax
mov    -0x38(%rbp),%rcx
imul   -0x58(%rbp),%rcx
add    -0x40(%rbp),%rcx
movss  %xmm0,(%rax,%rcx,4)
mov    -0x40(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x40(%rbp)
jmp    12cf <quatMultLoopf+0x1bf>
jmp    1317 <quatMultLoopf+0x207>
mov    -0x38(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x38(%rbp)
jmp    124e <quatMultLoopf+0x13e>
jmp    157f <quatMultLoopf+0x46f>
cmpq   $0x1,-0x28(%rbp)
jne    146c <quatMultLoopf+0x35c>
cmpq   $0x1,-0x60(%rbp)
jbe    146c <quatMultLoopf+0x35c>
movq   $0x0,-0x40(%rbp)
cmpq   $0x4,-0x40(%rbp)
jae    1385 <quatMultLoopf+0x275>
mov    -0x10(%rbp),%rax
mov    -0x40(%rbp),%rcx
movss  (%rax,%rcx,4),%xmm0
cvtss2sd %xmm0,%xmm0
mov    -0x40(%rbp),%rax
movsd  %xmm0,-0xb0(%rbp,%rax,8)
ff ff
mov    -0x40(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x40(%rbp)
jmp    134b <quatMultLoopf+0x23b>
movq   $0x0,-0x38(%rbp)
mov    -0x38(%rbp),%rax
cmp    -0x60(%rbp),%rax
jae    1467 <quatMultLoopf+0x357>
movq   $0x0,-0x40(%rbp)
cmpq   $0x4,-0x40(%rbp)
jae    13e6 <quatMultLoopf+0x2d6>
mov    -0x8(%rbp),%rax
mov    -0x38(%rbp),%rcx
imul   -0x48(%rbp),%rcx
add    -0x40(%rbp),%rcx
movss  (%rax,%rcx,4),%xmm0
cvtss2sd %xmm0,%xmm0
mov    -0x40(%rbp),%rax
movsd  %xmm0,-0x90(%rbp,%rax,8)
ff ff
mov    -0x40(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x40(%rbp)
jmp    13a3 <quatMultLoopf+0x293>
lea    -0x90(%rbp),%rdi
lea    -0xb0(%rbp),%rsi
lea    -0xd0(%rbp),%rdx
mov    -0x2c(%rbp),%ecx
call   1030 <quatMultiply@plt>
mov    %eax,-0x6c(%rbp)
movq   $0x0,-0x40(%rbp)
cmpq   $0x4,-0x40(%rbp)
jae    1451 <quatMultLoopf+0x341>
mov    -0x40(%rbp),%rax
movsd  -0xd0(%rbp,%rax,8),%xmm0
ff ff
cvtsd2ss %xmm0,%xmm0
mov    -0x18(%rbp),%rax
mov    -0x38(%rbp),%rcx
imul   -0x58(%rbp),%rcx
add    -0x40(%rbp),%rcx
movss  %xmm0,(%rax,%rcx,4)
mov    -0x40(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x40(%rbp)
jmp    140e <quatMultLoopf+0x2fe>
jmp    1456 <quatMultLoopf+0x346>
mov    -0x38(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x38(%rbp)
jmp    138d <quatMultLoopf+0x27d>
jmp    157a <quatMultLoopf+0x46a>
movq   $0x0,-0x38(%rbp)
mov    -0x38(%rbp),%rax
cmp    -0x60(%rbp),%rax
jae    1575 <quatMultLoopf+0x465>
movq   $0x0,-0x40(%rbp)
cmpq   $0x4,-0x40(%rbp)
jae    14f4 <quatMultLoopf+0x3e4>
mov    -0x10(%rbp),%rax
mov    -0x38(%rbp),%rcx
imul   -0x50(%rbp),%rcx
add    -0x40(%rbp),%rcx
movss  (%rax,%rcx,4),%xmm0
cvtss2sd %xmm0,%xmm0
mov    -0x40(%rbp),%rax
movsd  %xmm0,-0xb0(%rbp,%rax,8)
ff ff
mov    -0x8(%rbp),%rax
mov    -0x38(%rbp),%rcx
imul   -0x48(%rbp),%rcx
add    -0x40(%rbp),%rcx
movss  (%rax,%rcx,4),%xmm0
cvtss2sd %xmm0,%xmm0
mov    -0x40(%rbp),%rax
movsd  %xmm0,-0x90(%rbp,%rax,8)
ff ff
mov    -0x40(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x40(%rbp)
jmp    148a <quatMultLoopf+0x37a>
lea    -0x90(%rbp),%rdi
lea    -0xb0(%rbp),%rsi
lea    -0xd0(%rbp),%rdx
mov    -0x2c(%rbp),%ecx
call   1030 <quatMultiply@plt>
mov    %eax,-0x6c(%rbp)
movq   $0x0,-0x40(%rbp)
cmpq   $0x4,-0x40(%rbp)
jae    155f <quatMultLoopf+0x44f>
mov    -0x40(%rbp),%rax
movsd  -0xd0(%rbp,%rax,8),%xmm0
ff ff
cvtsd2ss %xmm0,%xmm0
mov    -0x18(%rbp),%rax
mov    -0x38(%rbp),%rcx
imul   -0x58(%rbp),%rcx
add    -0x40(%rbp),%rcx
movss  %xmm0,(%rax,%rcx,4)
mov    -0x40(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x40(%rbp)
jmp    151c <quatMultLoopf+0x40c>
jmp    1564 <quatMultLoopf+0x454>
mov    -0x38(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x38(%rbp)
jmp    1474 <quatMultLoopf+0x364>
jmp    157a <quatMultLoopf+0x46a>
jmp    157f <quatMultLoopf+0x46f>
mov    $0x1,%eax
add    $0xe0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<quatMultLoopf>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x68,%rsp
xor    %r13d,%r13d
cmp    $0x1,%r8
setne  %r13b
xor    %eax,%eax
cmp    $0x1,%rcx
setne  %r10b
shl    $0x2,%r13
cmp    %r8,%rcx
mov    %rcx,%r12
cmova  %r8,%r12
mov    %rcx,%r11
cmovb  %r8,%r11
mov    %r9d,%r14d
mov    %rdx,%rbx
mov    %rsi,%rbp
mov    %rdi,%r15
cmp    $0x2,%r8
cmovb  %r11,%r12
cmp    $0x2,%rcx
cmovb  %r11,%r12
cmp    $0x1,%rcx
jne    11dc <quatMultLoopf+0xcc>
cmp    $0x2,%r12
jb     11dc <quatMultLoopf+0xcc>
cvtps2pd (%r15),%xmm0
movaps %xmm0,0x40(%rsp)
cvtps2pd 0x8(%r15),%xmm0
movapd %xmm0,0x50(%rsp)
add    $0x8,%rbp
shl    $0x2,%r13
mov    %rsp,%r15
nop
cvtps2pd -0x8(%rbp),%xmm0
movaps %xmm0,0x20(%rsp)
cvtps2pd 0x0(%rbp),%xmm0
movaps %xmm0,0x30(%rsp)
lea    0x40(%rsp),%rdi
lea    0x20(%rsp),%rsi
mov    %r15,%rdx
mov    %r14d,%ecx
call   1030 <quatMultiply@plt>
cvtpd2ps 0x10(%rsp),%xmm0
cvtpd2ps (%rsp),%xmm1
unpcklpd %xmm0,%xmm1
movupd %xmm1,(%rbx)
add    $0x10,%rbx
add    %r13,%rbp
add    $0xffffffffffffffff,%r12
jne    1190 <quatMultLoopf+0x80>
jmp    12fe <quatMultLoopf+0x1ee>
mov    %r10b,%al
shl    $0x2,%rax
cmp    $0x1,%r8
jne    1263 <quatMultLoopf+0x153>
cmp    $0x1,%r12
jbe    1263 <quatMultLoopf+0x153>
cvtps2pd 0x0(%rbp),%xmm0
movaps %xmm0,0x20(%rsp)
cvtps2pd 0x8(%rbp),%xmm0
movapd %xmm0,0x30(%rsp)
add    $0x8,%r15
shl    $0x2,%rax
mov    %rsp,%rbp
nopl   (%rax)
cvtps2pd -0x8(%r15),%xmm0
movaps %xmm0,0x40(%rsp)
cvtps2pd (%r15),%xmm0
movaps %xmm0,0x50(%rsp)
lea    0x40(%rsp),%rdi
lea    0x20(%rsp),%rsi
mov    %rbp,%rdx
mov    %r14d,%ecx
mov    %rax,%r13
call   1030 <quatMultiply@plt>
mov    %r13,%rax
cvtpd2ps 0x10(%rsp),%xmm0
cvtpd2ps (%rsp),%xmm1
unpcklpd %xmm0,%xmm1
movupd %xmm1,(%rbx)
add    $0x10,%rbx
add    %r13,%r15
add    $0xffffffffffffffff,%r12
jne    1210 <quatMultLoopf+0x100>
jmp    12fe <quatMultLoopf+0x1ee>
test   %r12,%r12
je     12fe <quatMultLoopf+0x1ee>
add    $0x8,%r15
shl    $0x2,%rax
add    $0x8,%rbp
shl    $0x2,%r13
mov    %r13,0x60(%rsp)
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
cvtps2pd -0x8(%rbp),%xmm0
movaps %xmm0,0x20(%rsp)
cvtps2pd -0x8(%r15),%xmm0
movaps %xmm0,0x40(%rsp)
cvtps2pd 0x0(%rbp),%xmm0
movaps %xmm0,0x30(%rsp)
cvtps2pd (%r15),%xmm0
movaps %xmm0,0x50(%rsp)
lea    0x40(%rsp),%rdi
lea    0x20(%rsp),%rsi
mov    %rsp,%rdx
mov    %r14d,%ecx
mov    %r14d,%r13d
mov    %rax,%r14
call   1030 <quatMultiply@plt>
mov    %r14,%rax
mov    %r13d,%r14d
mov    0x60(%rsp),%r13
cvtpd2ps 0x10(%rsp),%xmm0
cvtpd2ps (%rsp),%xmm1
unpcklpd %xmm0,%xmm1
movupd %xmm1,(%rbx)
add    $0x10,%rbx
add    %rax,%r15
add    %r13,%rbp
add    $0xffffffffffffffff,%r12
jne    1290 <quatMultLoopf+0x180>
mov    $0x1,%eax
add    $0x68,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

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

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