#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 */
typedef int uint8_t;

/* Variables and functions */
int /*<<< orphan*/ free(int *);
int *malloc(int);
int /*<<< orphan*/ printf(char *, ...);
int szprod(int *, int const);
void tensadd(const double alpha, double *A, const int n, const int *sa,
             const double beta, double *B, const uint8_t *pb) {
  if (n > 100 || n < 1) {
    printf("whoa there!\n");
    return;
  }
  double acc;
  int i, k, I, J, K;
  int outer, outer2, Bistep;
  int lind;
  int *Bind = malloc(sizeof(int) * (3 * n));
  int *sb = Bind + n;
  int *bound = Bind + 2 * n;
  for (i = 0; i < n; i++) {
    if (pb[i] < 0 || pb[i] >= n) {
      printf("Permutation index out of range (%d)\n", pb[i]);
      free(Bind);
      return;
    }
    Bind[i] = -1;
  }
  for (i = 0; i < n; i++) {
    if (Bind[pb[i]] != -1) {
      printf("Duplicate index (%d -> %d) in B permutation.\n", i, pb[i]);
      free(Bind);
      return;
    }
    Bind[pb[i]] = 0;
    sb[i] = sa[pb[i]];
    bound[i] = sa[i];
    if (pb[i] == n - 1)
      lind = i;
  }
  outer = szprod(bound, n - 1);
  outer2 = sa[n - 1];
  szprod(sb, n);
  Bistep = sb[lind];
  for (I = 0; I < outer; I++) {
    k = 0;
    for (i = 0; i < n; i++)
      k += Bind[i] * sb[i];
    acc = 0.0;
    J = I * outer2;
    for (K = 0; K < outer2; K++) {
      A[J + K] = alpha * A[J + K] + beta * B[k];
      k += Bistep;
    }
    for (i = 0; i < n; i++) {
      Bind[i] = (Bind[i] + !((I + 1) % bound[pb[i]])) % sa[pb[i]];
    }
    Bind[lind] = 0;
  }
  free(Bind);
}


x86 assembly (clang, -O0):
<tensadd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x90,%rsp
movsd  %xmm0,-0x8(%rbp)
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %rdx,-0x20(%rbp)
movsd  %xmm1,-0x28(%rbp)
mov    %rcx,-0x30(%rbp)
mov    %r8,-0x38(%rbp)
cmpl   $0x64,-0x14(%rbp)
jg     117c <tensadd+0x3c>
cmpl   $0x1,-0x14(%rbp)
jge    118f <tensadd+0x4f>
lea    0xe7d(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    14de <tensadd+0x39e>
imul   $0x3,-0x14(%rbp),%eax
cltq
shl    $0x2,%rax
mov    %eax,%edi
call   1050 <malloc@plt>
mov    %rax,-0x70(%rbp)
mov    -0x70(%rbp),%rax
movslq -0x14(%rbp),%rcx
shl    $0x2,%rcx
add    %rcx,%rax
mov    %rax,-0x78(%rbp)
mov    -0x70(%rbp),%rax
mov    -0x14(%rbp),%ecx
shl    $0x1,%ecx
movslq %ecx,%rcx
shl    $0x2,%rcx
add    %rcx,%rax
mov    %rax,-0x80(%rbp)
movl   $0x0,-0x44(%rbp)
mov    -0x44(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    124c <tensadd+0x10c>
mov    -0x38(%rbp),%rax
movslq -0x44(%rbp),%rcx
cmpl   $0x0,(%rax,%rcx,4)
jl     1208 <tensadd+0xc8>
mov    -0x38(%rbp),%rax
movslq -0x44(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
cmp    -0x14(%rbp),%eax
jl     122f <tensadd+0xef>
mov    -0x38(%rbp),%rax
movslq -0x44(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xdf3(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x70(%rbp),%rdi
call   1030 <free@plt>
jmp    14de <tensadd+0x39e>
mov    -0x70(%rbp),%rax
movslq -0x44(%rbp),%rcx
movl   $0xffffffff,(%rax,%rcx,4)
mov    -0x44(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x44(%rbp)
jmp    11d6 <tensadd+0x96>
movl   $0x0,-0x44(%rbp)
mov    -0x44(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    1320 <tensadd+0x1e0>
mov    -0x70(%rbp),%rax
mov    -0x38(%rbp),%rcx
movslq -0x44(%rbp),%rdx
movslq (%rcx,%rdx,4),%rcx
cmpl   $0xffffffff,(%rax,%rcx,4)
je     12a3 <tensadd+0x163>
mov    -0x44(%rbp),%esi
mov    -0x38(%rbp),%rax
movslq -0x44(%rbp),%rcx
mov    (%rax,%rcx,4),%edx
lea    0xda4(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x70(%rbp),%rdi
call   1030 <free@plt>
jmp    14de <tensadd+0x39e>
mov    -0x70(%rbp),%rax
mov    -0x38(%rbp),%rcx
movslq -0x44(%rbp),%rdx
movslq (%rcx,%rdx,4),%rcx
movl   $0x0,(%rax,%rcx,4)
mov    -0x20(%rbp),%rax
mov    -0x38(%rbp),%rcx
movslq -0x44(%rbp),%rdx
movslq (%rcx,%rdx,4),%rcx
mov    (%rax,%rcx,4),%edx
mov    -0x78(%rbp),%rax
movslq -0x44(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x20(%rbp),%rax
movslq -0x44(%rbp),%rcx
mov    (%rax,%rcx,4),%edx
mov    -0x80(%rbp),%rax
movslq -0x44(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x38(%rbp),%rax
movslq -0x44(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
mov    -0x14(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jne    130d <tensadd+0x1cd>
mov    -0x44(%rbp),%eax
mov    %eax,-0x64(%rbp)
jmp    1312 <tensadd+0x1d2>
mov    -0x44(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x44(%rbp)
jmp    1253 <tensadd+0x113>
mov    -0x80(%rbp),%rdi
mov    -0x14(%rbp),%esi
sub    $0x1,%esi
call   1060 <szprod@plt>
mov    %eax,-0x58(%rbp)
mov    -0x20(%rbp),%rax
mov    -0x14(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,4),%eax
mov    %eax,-0x5c(%rbp)
mov    -0x78(%rbp),%rdi
mov    -0x14(%rbp),%esi
call   1060 <szprod@plt>
mov    -0x78(%rbp),%rax
movslq -0x64(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
mov    %eax,-0x60(%rbp)
movl   $0x0,-0x4c(%rbp)
mov    -0x4c(%rbp),%eax
cmp    -0x58(%rbp),%eax
jge    14d5 <tensadd+0x395>
movl   $0x0,-0x48(%rbp)
movl   $0x0,-0x44(%rbp)
mov    -0x44(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    13b7 <tensadd+0x277>
mov    -0x70(%rbp),%rax
movslq -0x44(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
mov    -0x78(%rbp),%rcx
movslq -0x44(%rbp),%rdx
imul   (%rcx,%rdx,4),%eax
add    -0x48(%rbp),%eax
mov    %eax,-0x48(%rbp)
mov    -0x44(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x44(%rbp)
jmp    1380 <tensadd+0x240>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x40(%rbp)
mov    -0x4c(%rbp),%eax
imul   -0x5c(%rbp),%eax
mov    %eax,-0x50(%rbp)
movl   $0x0,-0x54(%rbp)
mov    -0x54(%rbp),%eax
cmp    -0x5c(%rbp),%eax
jge    1436 <tensadd+0x2f6>
movsd  -0x8(%rbp),%xmm0
mov    -0x10(%rbp),%rax
mov    -0x50(%rbp),%ecx
add    -0x54(%rbp),%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm2
movsd  -0x28(%rbp),%xmm1
mov    -0x30(%rbp),%rax
movslq -0x48(%rbp),%rcx
mulsd  (%rax,%rcx,8),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x10(%rbp),%rax
mov    -0x50(%rbp),%ecx
add    -0x54(%rbp),%ecx
movslq %ecx,%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x60(%rbp),%eax
add    -0x48(%rbp),%eax
mov    %eax,-0x48(%rbp)
mov    -0x54(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x54(%rbp)
jmp    13d0 <tensadd+0x290>
movl   $0x0,-0x44(%rbp)
mov    -0x44(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    14b8 <tensadd+0x378>
mov    -0x70(%rbp),%rax
movslq -0x44(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
mov    %eax,-0x84(%rbp)
mov    -0x4c(%rbp),%eax
add    $0x1,%eax
mov    -0x80(%rbp),%rcx
mov    -0x38(%rbp),%rdx
movslq -0x44(%rbp),%rsi
movslq (%rdx,%rsi,4),%rsi
cltd
idivl  (%rcx,%rsi,4)
mov    -0x84(%rbp),%eax
cmp    $0x0,%edx
setne  %cl
xor    $0xff,%cl
and    $0x1,%cl
movzbl %cl,%ecx
add    %ecx,%eax
mov    -0x20(%rbp),%rcx
mov    -0x38(%rbp),%rdx
movslq -0x44(%rbp),%rsi
movslq (%rdx,%rsi,4),%rsi
cltd
idivl  (%rcx,%rsi,4)
mov    -0x70(%rbp),%rax
movslq -0x44(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x44(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x44(%rbp)
jmp    143d <tensadd+0x2fd>
mov    -0x70(%rbp),%rax
movslq -0x64(%rbp),%rcx
movl   $0x0,(%rax,%rcx,4)
mov    -0x4c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4c(%rbp)
jmp    1366 <tensadd+0x226>
mov    -0x70(%rbp),%rdi
call   1030 <free@plt>
add    $0x90,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tensadd>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0xf8,%rsp
mov    %esi,%ebx
lea    -0x65(%rbx),%eax
cmp    $0xffffff9b,%eax
ja     1188 <tensadd+0x38>
lea    0xee1(%rip),%rdi
add    $0xf8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1040 <puts@plt>
mov    %rdi,%rbp
mov    %r8,0x40(%rsp)
mov    %rdx,0x38(%rsp)
movdqa %xmm0,0xd0(%rsp)
movdqa %xmm1,0xe0(%rsp)
mov    %rcx,0x20(%rsp)
mov    %ebx,%r15d
lea    0x0(,%rbx,4),%eax
lea    (%rax,%rax,2),%edi
call   1060 <malloc@plt>
mov    %rax,%r14
lea    (%rax,%r15,4),%rax
mov    %rax,0x8(%rsp)
lea    (%rbx,%rbx,1),%eax
lea    (%r14,%rax,4),%r13
xor    %eax,%eax
mov    0x40(%rsp),%rcx
nopl   0x0(%rax,%rax,1)
mov    (%rcx,%rax,4),%esi
test   %esi,%esi
js     17fd <tensadd+0x6ad>
cmp    %ebx,%esi
jge    17fd <tensadd+0x6ad>
movl   $0xffffffff,(%r14,%rax,4)
ff
add    $0x1,%rax
cmp    %rax,%r15
jne    11e0 <tensadd+0x90>
mov    %rbp,0x28(%rsp)
lea    -0x1(%rbx),%r12d
xor    %esi,%esi
mov    0x38(%rsp),%rdi
mov    0x8(%rsp),%rcx
nopl   0x0(%rax)
mov    0x40(%rsp),%rax
movslq (%rax,%rsi,4),%rdx
cmpl   $0xffffffff,(%r14,%rdx,4)
jne    180d <tensadd+0x6bd>
movl   $0x0,(%r14,%rdx,4)
mov    (%rdi,%rdx,4),%eax
mov    %eax,(%rcx,%rsi,4)
mov    (%rdi,%rsi,4),%eax
mov    %eax,0x0(%r13,%rsi,4)
cmp    %r12d,%edx
cmove  %esi,%ebp
add    $0x1,%rsi
cmp    %rsi,%r15
jne    1220 <tensadd+0xd0>
mov    %r13,%rdi
mov    %r12d,%esi
call   1070 <szprod@plt>
mov    %eax,0x18(%rsp)
mov    %r12d,%eax
mov    0x38(%rsp),%rcx
movslq (%rcx,%rax,4),%rax
mov    %rax,0x30(%rsp)
mov    0x8(%rsp),%rdi
mov    %ebx,%esi
call   1070 <szprod@plt>
mov    0x18(%rsp),%ecx
test   %ecx,%ecx
mov    0x20(%rsp),%rdi
movapd 0xe0(%rsp),%xmm12
movapd 0xd0(%rsp),%xmm13
jle    181b <tensadd+0x6cb>
movslq %ebp,%rdx
mov    0x30(%rsp),%r10
mov    %r10d,%esi
mov    %rsi,0x10(%rsp)
mov    0x8(%rsp),%rax
mov    %rdx,0xc8(%rsp)
movslq (%rax,%rdx,4),%rdx
mov    %rdx,0x48(%rsp)
cmp    $0x1,%rdx
sete   %r8b
mov    %ecx,%ebp
mov    %rbp,0xc0(%rsp)
mov    %r15d,%ebp
and    $0xfffffffc,%ebp
mov    %rbp,0xa0(%rsp)
add    $0xfffffffffffffffc,%rbp
mov    %rbp,0x98(%rsp)
shr    $0x2,%rbp
add    $0x1,%rbp
mov    %ebp,%ecx
and    $0x3,%ecx
and    $0xfffffffffffffffc,%rbp
mov    %rbp,0x78(%rsp)
cmp    $0x4,%esi
setae  %al
and    %r8b,%al
mov    %al,0x7(%rsp)
mov    %esi,%eax
and    $0xfffffffc,%eax
mov    %rax,0x70(%rsp)
imul   %rdx,%rax
mov    %rax,0x68(%rsp)
movapd %xmm12,%xmm8
unpcklpd %xmm12,%xmm8
movapd %xmm13,%xmm9
unpcklpd %xmm13,%xmm9
mov    %rsi,%rax
neg    %rax
mov    %rax,0xa8(%rsp)
mov    %rcx,0x90(%rsp)
shl    $0x4,%rcx
mov    %rcx,0x88(%rsp)
lea    0x0(,%rsi,8),%rax
and    $0xffffffffffffffe0,%rax
mov    %rax,0x60(%rsp)
mov    %rdx,%rax
shl    $0x5,%rax
mov    %rax,0x58(%rsp)
lea    (%rdi,%rsi,8),%rax
mov    %rdi,%rsi
mov    %rax,0x80(%rsp)
lea    0x30(%r14),%r8
lea    0x30(%r14,%r15,4),%r11
mov    0x28(%rsp),%rax
lea    0x10(%rax),%r9
lea    0x0(,%r10,8),%rcx
mov    %rcx,0xb8(%rsp)
lea    0x10(%rdi),%rcx
mov    %rcx,0x50(%rsp)
lea    (%rdi,%rdx,8),%rdi
lea    0x8(%rax),%r10
xor    %r12d,%r12d
mov    %rdi,0x18(%rsp)
mov    %r13,0xb0(%rsp)
nopw   0x0(%rax,%rax,1)
cmp    $0x4,%r15d
jae    1400 <tensadd+0x2b0>
xor    %edx,%edx
xor    %eax,%eax
mov    0x8(%rsp),%rbp
jmp    15a0 <tensadd+0x450>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
cmpq   $0xc,0x98(%rsp)
jae    1420 <tensadd+0x2d0>
pxor   %xmm2,%xmm2
xor    %eax,%eax
mov    0x8(%rsp),%rbp
jmp    1508 <tensadd+0x3b8>
nopl   0x0(%rax,%rax,1)
pxor   %xmm2,%xmm2
mov    0x78(%rsp),%rdx
xor    %eax,%eax
mov    0x8(%rsp),%rbp
movdqu -0x30(%r8,%rax,4),%xmm5
movdqu -0x20(%r8,%rax,4),%xmm6
movdqu -0x10(%r8,%rax,4),%xmm11
movdqu (%r8,%rax,4),%xmm10
movdqu -0x30(%r11,%rax,4),%xmm0
movdqu -0x20(%r11,%rax,4),%xmm1
movdqu -0x10(%r11,%rax,4),%xmm3
movdqu (%r11,%rax,4),%xmm4
pshufd $0xf5,%xmm0,%xmm7
pmuludq %xmm5,%xmm0
pshufd $0xe8,%xmm0,%xmm0
pshufd $0xf5,%xmm5,%xmm5
pmuludq %xmm7,%xmm5
pshufd $0xe8,%xmm5,%xmm5
punpckldq %xmm5,%xmm0
paddd  %xmm2,%xmm0
pshufd $0xf5,%xmm1,%xmm2
pmuludq %xmm6,%xmm1
pshufd $0xe8,%xmm1,%xmm1
pshufd $0xf5,%xmm6,%xmm5
pmuludq %xmm2,%xmm5
pshufd $0xe8,%xmm5,%xmm2
punpckldq %xmm2,%xmm1
pshufd $0xf5,%xmm3,%xmm2
pmuludq %xmm11,%xmm3
pshufd $0xe8,%xmm3,%xmm3
pshufd $0xf5,%xmm11,%xmm5
pmuludq %xmm2,%xmm5
pshufd $0xe8,%xmm5,%xmm2
punpckldq %xmm2,%xmm3
paddd  %xmm1,%xmm3
paddd  %xmm0,%xmm3
pshufd $0xf5,%xmm4,%xmm0
pmuludq %xmm10,%xmm4
pshufd $0xe8,%xmm4,%xmm2
pshufd $0xf5,%xmm10,%xmm1
pmuludq %xmm0,%xmm1
pshufd $0xe8,%xmm1,%xmm0
punpckldq %xmm0,%xmm2
paddd  %xmm3,%xmm2
add    $0x10,%rax
add    $0xfffffffffffffffc,%rdx
jne    1430 <tensadd+0x2e0>
cmpq   $0x0,0x90(%rsp)
mov    0x88(%rsp),%rdi
je     1567 <tensadd+0x417>
lea    0x0(,%rax,4),%rdx
add    %rbp,%rdx
lea    (%r14,%rax,4),%rax
xor    %esi,%esi
nopl   0x0(%rax)
movdqu (%rax,%rsi,1),%xmm0
movdqu (%rdx,%rsi,1),%xmm1
pshufd $0xf5,%xmm1,%xmm3
pmuludq %xmm0,%xmm1
pshufd $0xe8,%xmm1,%xmm1
pshufd $0xf5,%xmm0,%xmm0
pmuludq %xmm0,%xmm3
pshufd $0xe8,%xmm3,%xmm0
punpckldq %xmm0,%xmm1
paddd  %xmm1,%xmm2
add    $0x10,%rsi
cmp    %rsi,%rdi
jne    1530 <tensadd+0x3e0>
pshufd $0xee,%xmm2,%xmm0
paddd  %xmm2,%xmm0
pshufd $0x55,%xmm0,%xmm1
paddd  %xmm0,%xmm1
movd   %xmm1,%eax
mov    0xa0(%rsp),%rsi
mov    %rsi,%rdx
cmp    %r15,%rsi
mov    0x18(%rsp),%rdi
je     15b4 <tensadd+0x464>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    0x0(%rbp,%rdx,4),%esi
imul   (%r14,%rdx,4),%esi
add    %esi,%eax
add    $0x1,%rdx
cmp    %rdx,%r15
jne    15a0 <tensadd+0x450>
cmpl   $0x0,0x30(%rsp)
jle    1780 <tensadd+0x630>
mov    %r12,%rcx
imul   0x30(%rsp),%rcx
movslq %eax,%rbp
cmpb   $0x0,0x7(%rsp)
je     160e <tensadd+0x4be>
mov    0x28(%rsp),%rbx
lea    (%rbx,%rcx,8),%rax
mov    0x80(%rsp),%rdx
lea    (%rdx,%rbp,8),%rsi
cmp    %rsi,%rax
jae    16e6 <tensadd+0x596>
mov    0x10(%rsp),%rax
add    %rcx,%rax
lea    (%rbx,%rax,8),%rax
mov    0x20(%rsp),%rdx
lea    (%rdx,%rbp,8),%rsi
cmp    %rax,%rsi
jae    16e6 <tensadd+0x596>
xor    %esi,%esi
mov    %rbp,%rax
mov    0x10(%rsp),%rbp
test   $0x1,%bpl
jne    1630 <tensadd+0x4e0>
mov    %rsi,%rdx
jmp    166d <tensadd+0x51d>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
add    %rsi,%rcx
mov    0x20(%rsp),%rdx
movsd  (%rdx,%rax,8),%xmm0
mulsd  %xmm12,%xmm0
mov    0x28(%rsp),%rbp
movsd  0x0(%rbp,%rcx,8),%xmm1
mulsd  %xmm13,%xmm1
addsd  %xmm0,%xmm1
movsd  %xmm1,0x0(%rbp,%rcx,8)
mov    0x10(%rsp),%rbp
add    0x48(%rsp),%rax
mov    %rsi,%rdx
or     $0x1,%rdx
not    %rsi
cmp    0xa8(%rsp),%rsi
mov    0x48(%rsp),%rsi
mov    0x20(%rsp),%r13
je     1780 <tensadd+0x630>
nopl   0x0(%rax,%rax,1)
movsd  0x0(%r13,%rax,8),%xmm0
mulsd  %xmm12,%xmm0
movsd  -0x8(%r10,%rdx,8),%xmm1
mulsd  %xmm13,%xmm1
addsd  %xmm0,%xmm1
movsd  %xmm1,-0x8(%r10,%rdx,8)
movsd  (%rdi,%rax,8),%xmm0
mulsd  %xmm12,%xmm0
add    %rsi,%rax
movsd  (%r10,%rdx,8),%xmm1
mulsd  %xmm13,%xmm1
addsd  %xmm0,%xmm1
movsd  %xmm1,(%r10,%rdx,8)
add    %rsi,%rax
add    $0x2,%rdx
cmp    %rdx,%rbp
jne    1690 <tensadd+0x540>
jmp    1780 <tensadd+0x630>
mov    0x68(%rsp),%rax
add    %rbp,%rax
mov    0x50(%rsp),%rdx
lea    (%rdx,%rbp,8),%rsi
xor    %ebp,%ebp
mov    0x60(%rsp),%rdx
mov    0x58(%rsp),%rdi
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
movupd -0x10(%r9,%rbp,1),%xmm0
movupd (%r9,%rbp,1),%xmm1
movupd -0x10(%rsi),%xmm2
movupd (%rsi),%xmm3
mulpd  %xmm8,%xmm2
mulpd  %xmm8,%xmm3
mulpd  %xmm9,%xmm0
addpd  %xmm2,%xmm0
mulpd  %xmm9,%xmm1
addpd  %xmm3,%xmm1
movupd %xmm0,-0x10(%r9,%rbp,1)
movupd %xmm1,(%r9,%rbp,1)
add    $0x20,%rbp
add    %rdi,%rsi
cmp    %rbp,%rdx
jne    1710 <tensadd+0x5c0>
mov    0x70(%rsp),%rdx
mov    %rdx,%rsi
mov    0x10(%rsp),%rbp
cmp    %rbp,%rdx
mov    0x18(%rsp),%rdi
jne    1618 <tensadd+0x4c8>
cs nopw 0x0(%rax,%rax,1)
add    $0x1,%r12
xor    %ebp,%ebp
mov    0xb0(%rsp),%r13
mov    0x38(%rsp),%rbx
mov    0x40(%rsp),%rcx
nopl   0x0(%rax,%rax,1)
mov    (%r14,%rbp,4),%esi
movslq (%rcx,%rbp,4),%rdi
mov    %r12d,%eax
cltd
idivl  0x0(%r13,%rdi,4)
cmp    $0x1,%edx
adc    $0x0,%esi
mov    %esi,%eax
cltd
idivl  (%rbx,%rdi,4)
mov    %edx,(%r14,%rbp,4)
add    $0x1,%rbp
cmp    %rbp,%r15
jne    17a0 <tensadd+0x650>
mov    0xc8(%rsp),%rax
movl   $0x0,(%r14,%rax,4)
mov    0xb8(%rsp),%rax
add    %rax,%r9
add    %rax,%r10
cmp    0xc0(%rsp),%r12
mov    0x18(%rsp),%rdi
jne    13e0 <tensadd+0x290>
jmp    181b <tensadd+0x6cb>
lea    0x7fc(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
jmp    181b <tensadd+0x6cb>
lea    0x811(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %r14,%rdi
add    $0xf8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <free@plt>

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

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