#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*/ assert(int /*<<< orphan*/);
void sumCAT(int tipCase, double *sum, double *x1_start, double *x2_start,
            double *tipVector, char *tipX1, char *tipX2, int lower, int n) {
  int i;
  double *x1, *x2;
  switch (tipCase) {
  case 0:
    for (i = lower; i < n; i++) {
      x1 = &(tipVector[4 * tipX1[i]]);
      x2 = &(tipVector[4 * tipX2[i]]);
      sum[i * 4] = x1[0] * x2[0];
      sum[i * 4 + 1] = x1[1] * x2[1];
      sum[i * 4 + 2] = x1[2] * x2[2];
      sum[i * 4 + 3] = x1[3] * x2[3];
    }
    break;
  case 1:
    for (i = lower; i < n; i++) {
      x1 = &(tipVector[4 * tipX1[i]]);
      x2 = &x2_start[4 * i];
      sum[i * 4] = x1[0] * x2[0];
      sum[i * 4 + 1] = x1[1] * x2[1];
      sum[i * 4 + 2] = x1[2] * x2[2];
      sum[i * 4 + 3] = x1[3] * x2[3];
    }
    break;
  case 2:
    for (i = lower; i < n; i++) {
      x1 = &x1_start[4 * i];
      x2 = &x2_start[4 * i];
      sum[i * 4] = x1[0] * x2[0];
      sum[i * 4 + 1] = x1[1] * x2[1];
      sum[i * 4 + 2] = x1[2] * x2[2];
      sum[i * 4 + 3] = x1[3] * x2[3];
    }
    break;
  default:
    assert(0);
  }
}


x86 assembly (clang, -O0):
<sumCAT>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    0x20(%rbp),%eax
mov    0x18(%rbp),%eax
mov    0x10(%rbp),%rax
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x4c(%rbp)
test   %eax,%eax
je     116e <sumCAT+0x5e>
jmp    114c <sumCAT+0x3c>
mov    -0x4c(%rbp),%eax
sub    $0x1,%eax
je     126c <sumCAT+0x15c>
jmp    115d <sumCAT+0x4d>
mov    -0x4c(%rbp),%eax
sub    $0x2,%eax
je     1361 <sumCAT+0x251>
jmp    144d <sumCAT+0x33d>
mov    0x18(%rbp),%eax
mov    %eax,-0x34(%rbp)
mov    -0x34(%rbp),%eax
cmp    0x20(%rbp),%eax
jge    1267 <sumCAT+0x157>
mov    -0x28(%rbp),%rax
mov    -0x30(%rbp),%rcx
movslq -0x34(%rbp),%rdx
movsbl (%rcx,%rdx,1),%ecx
shl    $0x2,%ecx
movslq %ecx,%rcx
shl    $0x3,%rcx
add    %rcx,%rax
mov    %rax,-0x40(%rbp)
mov    -0x28(%rbp),%rax
mov    0x10(%rbp),%rcx
movslq -0x34(%rbp),%rdx
movsbl (%rcx,%rdx,1),%ecx
shl    $0x2,%ecx
movslq %ecx,%rcx
shl    $0x3,%rcx
add    %rcx,%rax
mov    %rax,-0x48(%rbp)
mov    -0x40(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x48(%rbp),%rax
mulsd  (%rax),%xmm0
mov    -0x10(%rbp),%rax
mov    -0x34(%rbp),%ecx
shl    $0x2,%ecx
movslq %ecx,%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x40(%rbp),%rax
movsd  0x8(%rax),%xmm0
mov    -0x48(%rbp),%rax
mulsd  0x8(%rax),%xmm0
mov    -0x10(%rbp),%rax
mov    -0x34(%rbp),%ecx
shl    $0x2,%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x40(%rbp),%rax
movsd  0x10(%rax),%xmm0
mov    -0x48(%rbp),%rax
mulsd  0x10(%rax),%xmm0
mov    -0x10(%rbp),%rax
mov    -0x34(%rbp),%ecx
shl    $0x2,%ecx
add    $0x2,%ecx
movslq %ecx,%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x40(%rbp),%rax
movsd  0x18(%rax),%xmm0
mov    -0x48(%rbp),%rax
mulsd  0x18(%rax),%xmm0
mov    -0x10(%rbp),%rax
mov    -0x34(%rbp),%ecx
shl    $0x2,%ecx
add    $0x3,%ecx
movslq %ecx,%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    1174 <sumCAT+0x64>
jmp    1454 <sumCAT+0x344>
mov    0x18(%rbp),%eax
mov    %eax,-0x34(%rbp)
mov    -0x34(%rbp),%eax
cmp    0x20(%rbp),%eax
jge    135c <sumCAT+0x24c>
mov    -0x28(%rbp),%rax
mov    -0x30(%rbp),%rcx
movslq -0x34(%rbp),%rdx
movsbl (%rcx,%rdx,1),%ecx
shl    $0x2,%ecx
movslq %ecx,%rcx
shl    $0x3,%rcx
add    %rcx,%rax
mov    %rax,-0x40(%rbp)
mov    -0x20(%rbp),%rax
mov    -0x34(%rbp),%ecx
shl    $0x2,%ecx
movslq %ecx,%rcx
shl    $0x3,%rcx
add    %rcx,%rax
mov    %rax,-0x48(%rbp)
mov    -0x40(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x48(%rbp),%rax
mulsd  (%rax),%xmm0
mov    -0x10(%rbp),%rax
mov    -0x34(%rbp),%ecx
shl    $0x2,%ecx
movslq %ecx,%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x40(%rbp),%rax
movsd  0x8(%rax),%xmm0
mov    -0x48(%rbp),%rax
mulsd  0x8(%rax),%xmm0
mov    -0x10(%rbp),%rax
mov    -0x34(%rbp),%ecx
shl    $0x2,%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x40(%rbp),%rax
movsd  0x10(%rax),%xmm0
mov    -0x48(%rbp),%rax
mulsd  0x10(%rax),%xmm0
mov    -0x10(%rbp),%rax
mov    -0x34(%rbp),%ecx
shl    $0x2,%ecx
add    $0x2,%ecx
movslq %ecx,%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x40(%rbp),%rax
movsd  0x18(%rax),%xmm0
mov    -0x48(%rbp),%rax
mulsd  0x18(%rax),%xmm0
mov    -0x10(%rbp),%rax
mov    -0x34(%rbp),%ecx
shl    $0x2,%ecx
add    $0x3,%ecx
movslq %ecx,%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    1272 <sumCAT+0x162>
jmp    1454 <sumCAT+0x344>
mov    0x18(%rbp),%eax
mov    %eax,-0x34(%rbp)
mov    -0x34(%rbp),%eax
cmp    0x20(%rbp),%eax
jge    1448 <sumCAT+0x338>
mov    -0x18(%rbp),%rax
mov    -0x34(%rbp),%ecx
shl    $0x2,%ecx
movslq %ecx,%rcx
shl    $0x3,%rcx
add    %rcx,%rax
mov    %rax,-0x40(%rbp)
mov    -0x20(%rbp),%rax
mov    -0x34(%rbp),%ecx
shl    $0x2,%ecx
movslq %ecx,%rcx
shl    $0x3,%rcx
add    %rcx,%rax
mov    %rax,-0x48(%rbp)
mov    -0x40(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x48(%rbp),%rax
mulsd  (%rax),%xmm0
mov    -0x10(%rbp),%rax
mov    -0x34(%rbp),%ecx
shl    $0x2,%ecx
movslq %ecx,%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x40(%rbp),%rax
movsd  0x8(%rax),%xmm0
mov    -0x48(%rbp),%rax
mulsd  0x8(%rax),%xmm0
mov    -0x10(%rbp),%rax
mov    -0x34(%rbp),%ecx
shl    $0x2,%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x40(%rbp),%rax
movsd  0x10(%rax),%xmm0
mov    -0x48(%rbp),%rax
mulsd  0x10(%rax),%xmm0
mov    -0x10(%rbp),%rax
mov    -0x34(%rbp),%ecx
shl    $0x2,%ecx
add    $0x2,%ecx
movslq %ecx,%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x40(%rbp),%rax
movsd  0x18(%rax),%xmm0
mov    -0x48(%rbp),%rax
mulsd  0x18(%rax),%xmm0
mov    -0x10(%rbp),%rax
mov    -0x34(%rbp),%ecx
shl    $0x2,%ecx
add    $0x3,%ecx
movslq %ecx,%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    1367 <sumCAT+0x257>
jmp    1454 <sumCAT+0x344>
xor    %edi,%edi
call   1030 <assert@plt>
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sumCAT>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
mov    %rdx,%r10
mov    0x48(%rsp),%edx
mov    0x40(%rsp),%ebx
test   %edi,%edi
je     13ec <sumCAT+0x2dc>
cmp    $0x1,%edi
je     148f <sumCAT+0x37f>
cmp    $0x2,%edi
jne    1515 <sumCAT+0x405>
cmp    %edx,%ebx
jge    15a3 <sumCAT+0x493>
movslq %ebx,%r12
movslq %edx,%rdi
mov    %rdi,%r14
sub    %r12,%r14
cmp    $0x2,%r14
jb     152b <sumCAT+0x41b>
mov    %r12,-0x8(%rsp)
mov    %r12,%r9
not    %r9
add    %rdi,%r9
mov    $0x4,%edx
mov    %r9d,%eax
mul    %edx
mov    %eax,%r8d
lea    0x0(,%rbx,4),%r15d
seto   %r11b
lea    (%r8,%rbx,4),%r13d
mov    $0x20,%edx
mov    %r9,%rax
mul    %rdx
seto   %r12b
cmp    %r15d,%r13d
jl     1526 <sumCAT+0x416>
test   %r11b,%r11b
jne    1526 <sumCAT+0x416>
shr    $0x20,%r9
jne    1526 <sumCAT+0x416>
lea    0x1(,%rbx,4),%edx
lea    (%r8,%rbx,4),%ebp
add    $0x1,%ebp
cmp    %edx,%ebp
jl     1526 <sumCAT+0x416>
test   %r11b,%r11b
jne    1526 <sumCAT+0x416>
test   %r9,%r9
jne    1526 <sumCAT+0x416>
lea    0x2(,%rbx,4),%edx
lea    (%r8,%rbx,4),%ebp
add    $0x2,%ebp
cmp    %edx,%ebp
jl     1526 <sumCAT+0x416>
test   %r11b,%r11b
jne    1526 <sumCAT+0x416>
test   %r9,%r9
jne    1526 <sumCAT+0x416>
lea    0x3(,%rbx,4),%edx
lea    (%r8,%rbx,4),%ebp
add    $0x3,%ebp
cmp    %edx,%ebp
jl     1526 <sumCAT+0x416>
test   %r11b,%r11b
jne    1526 <sumCAT+0x416>
test   %r9,%r9
jne    1526 <sumCAT+0x416>
movslq %r15d,%rdx
lea    (%rsi,%rdx,8),%r9
lea    (%rsi,%rdx,8),%r8
add    $0x10,%r8
lea    (%rax,%r9,1),%rbp
add    $0x10,%rbp
cmp    %r8,%rbp
jb     1526 <sumCAT+0x416>
test   %r12b,%r12b
jne    1526 <sumCAT+0x416>
lea    (%rsi,%rdx,8),%r8
add    $0x18,%r8
lea    (%rax,%r9,1),%rbp
add    $0x18,%rbp
cmp    %r8,%rbp
jb     1526 <sumCAT+0x416>
test   %r12b,%r12b
jne    1526 <sumCAT+0x416>
lea    (%rsi,%rdx,8),%rdx
add    $0x8,%rdx
lea    (%rax,%r9,1),%rbp
add    $0x8,%rbp
cmp    %rdx,%rbp
jb     1526 <sumCAT+0x416>
test   %r12b,%r12b
jne    1526 <sumCAT+0x416>
add    %r9,%rax
cmp    %r9,%rax
jb     1526 <sumCAT+0x416>
test   %r12b,%r12b
jne    1526 <sumCAT+0x416>
shl    $0x2,%ebx
movslq %ebx,%rax
lea    (%rsi,%rax,8),%rdx
lea    (%rax,%rdi,4),%rbp
mov    -0x8(%rsp),%r12
lea    0x0(,%r12,4),%rbx
sub    %rbx,%rbp
lea    (%rsi,%rbp,8),%rbx
lea    (%r10,%rax,8),%r8
lea    (%r10,%rbp,8),%r9
lea    (%rcx,%rax,8),%r11
lea    (%rcx,%rbp,8),%rax
cmp    %r9,%rdx
setb   %r9b
cmp    %rbx,%r8
setb   %r8b
cmp    %rax,%rdx
setb   %al
cmp    %rbx,%r11
setb   %dl
test   %r8b,%r9b
jne    152b <sumCAT+0x41b>
and    %dl,%al
jne    152b <sumCAT+0x41b>
mov    %r14,%rax
and    $0xfffffffffffffffe,%rax
add    %rax,%r12
mov    %rax,%rdx
nopw   0x0(%rax,%rax,1)
movslq %r15d,%r15
movupd (%r10,%r15,8),%xmm6
movupd 0x10(%r10,%r15,8),%xmm4
movupd 0x20(%r10,%r15,8),%xmm5
movupd 0x30(%r10,%r15,8),%xmm8
movupd (%rcx,%r15,8),%xmm0
movupd 0x10(%rcx,%r15,8),%xmm1
movupd 0x20(%rcx,%r15,8),%xmm7
movupd 0x30(%rcx,%r15,8),%xmm9
movapd %xmm6,%xmm3
unpcklpd %xmm5,%xmm3
movapd %xmm0,%xmm2
unpcklpd %xmm7,%xmm2
mulpd  %xmm3,%xmm2
unpckhpd %xmm5,%xmm6
unpckhpd %xmm7,%xmm0
mulpd  %xmm6,%xmm0
movapd %xmm4,%xmm3
unpcklpd %xmm8,%xmm3
movapd %xmm1,%xmm5
unpcklpd %xmm9,%xmm5
mulpd  %xmm3,%xmm5
unpckhpd %xmm8,%xmm4
unpckhpd %xmm9,%xmm1
mulpd  %xmm4,%xmm1
lea    0x3(%r15),%ebp
movslq %ebp,%rbp
movapd %xmm5,%xmm3
unpcklpd %xmm1,%xmm3
movapd %xmm2,%xmm4
unpcklpd %xmm0,%xmm4
movhlps %xmm5,%xmm1
movhlps %xmm2,%xmm0
movups %xmm0,0x8(%rsi,%rbp,8)
movups %xmm1,0x18(%rsi,%rbp,8)
movupd %xmm4,-0x18(%rsi,%rbp,8)
movupd %xmm3,-0x8(%rsi,%rbp,8)
add    $0x8,%r15d
add    $0xfffffffffffffffe,%rdx
jne    1320 <sumCAT+0x210>
cmp    %rax,%r14
jne    152b <sumCAT+0x41b>
jmp    15a3 <sumCAT+0x493>
cmp    %edx,%ebx
jge    15a3 <sumCAT+0x493>
mov    0x38(%rsp),%r10
movslq %ebx,%rcx
movslq %edx,%rdx
shl    $0x2,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movsbq (%r9,%rcx,1),%rdi
shl    $0x5,%rdi
movsbq (%r10,%rcx,1),%rbp
shl    $0x5,%rbp
movsd  (%r8,%rdi,1),%xmm0
mulsd  (%r8,%rbp,1),%xmm0
movslq %ebx,%rbx
movsd  %xmm0,(%rsi,%rbx,8)
movsd  0x8(%r8,%rdi,1),%xmm0
mulsd  0x8(%r8,%rbp,1),%xmm0
lea    0x1(%rbx),%eax
cltq
movsd  %xmm0,(%rsi,%rax,8)
movsd  0x10(%r8,%rdi,1),%xmm0
mulsd  0x10(%r8,%rbp,1),%xmm0
lea    0x2(%rbx),%eax
cltq
movsd  %xmm0,(%rsi,%rax,8)
movsd  0x18(%r8,%rdi,1),%xmm0
mulsd  0x18(%r8,%rbp,1),%xmm0
lea    0x3(%rbx),%eax
cltq
movsd  %xmm0,(%rsi,%rax,8)
add    $0x1,%rcx
add    $0x4,%ebx
cmp    %rcx,%rdx
jne    1410 <sumCAT+0x300>
jmp    15a3 <sumCAT+0x493>
cmp    %edx,%ebx
jge    15a3 <sumCAT+0x493>
movslq %ebx,%rax
movslq %edx,%rdx
shl    $0x2,%ebx
movsbq (%r9,%rax,1),%rdi
shl    $0x5,%rdi
movslq %ebx,%rbp
movsd  (%r8,%rdi,1),%xmm0
mulsd  (%rcx,%rbp,8),%xmm0
movsd  %xmm0,(%rsi,%rbp,8)
movsd  0x8(%r8,%rdi,1),%xmm0
mulsd  0x8(%rcx,%rbp,8),%xmm0
lea    0x1(%rbp),%ebx
movslq %ebx,%rbx
movsd  %xmm0,(%rsi,%rbx,8)
movsd  0x10(%r8,%rdi,1),%xmm0
mulsd  0x10(%rcx,%rbp,8),%xmm0
lea    0x2(%rbp),%ebx
movslq %ebx,%rbx
movsd  %xmm0,(%rsi,%rbx,8)
movsd  0x18(%r8,%rdi,1),%xmm0
mulsd  0x18(%rcx,%rbp,8),%xmm0
lea    0x3(%rbp),%edi
movslq %edi,%rdi
movsd  %xmm0,(%rsi,%rdi,8)
add    $0x1,%rax
lea    0x4(%rbp),%ebx
cmp    %rax,%rdx
jne    14a0 <sumCAT+0x390>
jmp    15a3 <sumCAT+0x493>
xor    %edi,%edi
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <assert@plt>
mov    -0x8(%rsp),%r12
lea    0x0(,%r12,4),%eax
sub    %r12,%rdi
cs nopw 0x0(%rax,%rax,1)
cltq
movsd  (%r10,%rax,8),%xmm0
mulsd  (%rcx,%rax,8),%xmm0
movsd  %xmm0,(%rsi,%rax,8)
movsd  0x8(%r10,%rax,8),%xmm0
mulsd  0x8(%rcx,%rax,8),%xmm0
lea    0x1(%rax),%edx
movslq %edx,%rdx
movsd  %xmm0,(%rsi,%rdx,8)
movsd  0x10(%r10,%rax,8),%xmm0
mulsd  0x10(%rcx,%rax,8),%xmm0
lea    0x2(%rax),%edx
movslq %edx,%rdx
movsd  %xmm0,(%rsi,%rdx,8)
movsd  0x18(%r10,%rax,8),%xmm0
mulsd  0x18(%rcx,%rax,8),%xmm0
lea    0x3(%rax),%edx
movslq %edx,%rdx
movsd  %xmm0,(%rsi,%rdx,8)
add    $0x4,%eax
add    $0xffffffffffffffff,%rdi
jne    1540 <sumCAT+0x430>
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

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

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