#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*/ free(double *);
scalar_t__ malloc(int);
void _compute_transition_counts(double *transition_counts, const double *A,
                                const double *pobs, const double *alpha,
                                const double *beta, int N, int T) {
  int i, j, t;
  double sum, *tmp;
  for (i = 0; i < N; i++)
    for (j = 0; j < N; j++)
      transition_counts[i * N + j] = 0.0;
  tmp = (double *)malloc(N * N * sizeof(double));
  for (t = 0; t < T - 1; t++) {
    sum = 0.0;
    for (i = 0; i < N; i++)
      for (j = 0; j < N; j++) {
        tmp[i * N + j] = alpha[t * N + i] * A[i * N + j] *
                         pobs[(t + 1) * N + j] * beta[(t + 1) * N + j];
        sum += tmp[i * N + j];
      }
    for (i = 0; i < N; i++)
      for (j = 0; j < N; j++)
        transition_counts[i * N + j] += tmp[i * N + j] / sum;
  }
  free(tmp);
}


x86 assembly (clang, -O0):
<_compute_transition_counts>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    0x10(%rbp),%eax
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9d,-0x2c(%rbp)
movl   $0x0,-0x30(%rbp)
mov    -0x30(%rbp),%eax
cmp    -0x2c(%rbp),%eax
jge    11a3 <_compute_transition_counts+0x83>
movl   $0x0,-0x34(%rbp)
mov    -0x34(%rbp),%eax
cmp    -0x2c(%rbp),%eax
jge    1190 <_compute_transition_counts+0x70>
mov    -0x8(%rbp),%rax
mov    -0x30(%rbp),%ecx
imul   -0x2c(%rbp),%ecx
add    -0x34(%rbp),%ecx
movslq %ecx,%rcx
xorps  %xmm0,%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    115d <_compute_transition_counts+0x3d>
jmp    1195 <_compute_transition_counts+0x75>
mov    -0x30(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x30(%rbp)
jmp    114a <_compute_transition_counts+0x2a>
mov    -0x2c(%rbp),%eax
imul   -0x2c(%rbp),%eax
cltq
shl    $0x3,%rax
mov    %eax,%edi
call   1040 <malloc@plt>
mov    %rax,-0x48(%rbp)
movl   $0x0,-0x38(%rbp)
mov    -0x38(%rbp),%eax
mov    0x10(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jge    1346 <_compute_transition_counts+0x226>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x40(%rbp)
movl   $0x0,-0x30(%rbp)
mov    -0x30(%rbp),%eax
cmp    -0x2c(%rbp),%eax
jge    12b6 <_compute_transition_counts+0x196>
movl   $0x0,-0x34(%rbp)
mov    -0x34(%rbp),%eax
cmp    -0x2c(%rbp),%eax
jge    12a3 <_compute_transition_counts+0x183>
mov    -0x20(%rbp),%rax
mov    -0x38(%rbp),%ecx
imul   -0x2c(%rbp),%ecx
add    -0x30(%rbp),%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x10(%rbp),%rax
mov    -0x30(%rbp),%ecx
imul   -0x2c(%rbp),%ecx
add    -0x34(%rbp),%ecx
movslq %ecx,%rcx
mulsd  (%rax,%rcx,8),%xmm0
mov    -0x18(%rbp),%rax
mov    -0x38(%rbp),%ecx
add    $0x1,%ecx
imul   -0x2c(%rbp),%ecx
add    -0x34(%rbp),%ecx
movslq %ecx,%rcx
mulsd  (%rax,%rcx,8),%xmm0
mov    -0x28(%rbp),%rax
mov    -0x38(%rbp),%ecx
add    $0x1,%ecx
imul   -0x2c(%rbp),%ecx
add    -0x34(%rbp),%ecx
movslq %ecx,%rcx
mulsd  (%rax,%rcx,8),%xmm0
mov    -0x48(%rbp),%rax
mov    -0x30(%rbp),%ecx
imul   -0x2c(%rbp),%ecx
add    -0x34(%rbp),%ecx
movslq %ecx,%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x48(%rbp),%rax
mov    -0x30(%rbp),%ecx
imul   -0x2c(%rbp),%ecx
add    -0x34(%rbp),%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
addsd  -0x40(%rbp),%xmm0
movsd  %xmm0,-0x40(%rbp)
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    11f5 <_compute_transition_counts+0xd5>
jmp    12a8 <_compute_transition_counts+0x188>
mov    -0x30(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x30(%rbp)
jmp    11e2 <_compute_transition_counts+0xc2>
movl   $0x0,-0x30(%rbp)
mov    -0x30(%rbp),%eax
cmp    -0x2c(%rbp),%eax
jge    1333 <_compute_transition_counts+0x213>
movl   $0x0,-0x34(%rbp)
mov    -0x34(%rbp),%eax
cmp    -0x2c(%rbp),%eax
jge    1320 <_compute_transition_counts+0x200>
mov    -0x48(%rbp),%rax
mov    -0x30(%rbp),%ecx
imul   -0x2c(%rbp),%ecx
add    -0x34(%rbp),%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
divsd  -0x40(%rbp),%xmm0
mov    -0x8(%rbp),%rax
mov    -0x30(%rbp),%ecx
imul   -0x2c(%rbp),%ecx
add    -0x34(%rbp),%ecx
movslq %ecx,%rcx
addsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    12d0 <_compute_transition_counts+0x1b0>
jmp    1325 <_compute_transition_counts+0x205>
mov    -0x30(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x30(%rbp)
jmp    12bd <_compute_transition_counts+0x19d>
jmp    1338 <_compute_transition_counts+0x218>
mov    -0x38(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x38(%rbp)
jmp    11c2 <_compute_transition_counts+0xa2>
mov    -0x48(%rbp),%rdi
call   1030 <free@plt>
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_compute_transition_counts>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0xa8,%rsp
mov    %r8,0x58(%rsp)
mov    %rcx,%rbx
mov    %rdx,0x70(%rsp)
mov    %rsi,0x68(%rsp)
mov    %rdi,%r14
mov    0xe0(%rsp),%eax
mov    %rax,0x28(%rsp)
mov    %r9d,%r15d
test   %r9d,%r9d
mov    %r9,0x10(%rsp)
mov    %rdi,0x30(%rsp)
jle    128f <_compute_transition_counts+0x15f>
lea    0x0(,%r15,8),%rcx
lea    -0x1(%r15),%rax
mov    %r15d,%edx
and    $0x3,%edx
mov    %rdx,0x40(%rsp)
xor    %r14d,%r14d
cmp    $0x3,%rax
mov    %rcx,0x18(%rsp)
jae    11a4 <_compute_transition_counts+0x74>
xor    %ebp,%ebp
jmp    1249 <_compute_transition_counts+0x119>
mov    %r15d,%eax
and    $0xfffffffc,%eax
mov    %rax,0x20(%rsp)
lea    (%r9,%r9,1),%eax
mov    %rax,0x8(%rsp)
lea    0x0(,%r9,4),%eax
mov    %eax,0x50(%rsp)
lea    (%r9,%r9,2),%eax
mov    %rax,0x48(%rsp)
xor    %ebp,%ebp
mov    0x30(%rsp),%r12
mov    0x18(%rsp),%r13
nopl   0x0(%rax)
movslq %r14d,%r14
lea    (%r12,%r14,8),%rdi
xor    %esi,%esi
mov    %r13,%rdx
call   1040 <memset@plt>
mov    0x10(%rsp),%rax
add    %r14d,%eax
cltq
lea    (%r12,%rax,8),%rdi
xor    %esi,%esi
mov    %r13,%rdx
call   1040 <memset@plt>
mov    0x8(%rsp),%rax
add    %r14d,%eax
cltq
lea    (%r12,%rax,8),%rdi
xor    %esi,%esi
mov    %r13,%rdx
call   1040 <memset@plt>
mov    0x48(%rsp),%rax
add    %r14d,%eax
cltq
lea    (%r12,%rax,8),%rdi
xor    %esi,%esi
mov    %r13,%rdx
call   1040 <memset@plt>
add    $0x4,%rbp
add    0x50(%rsp),%r14d
cmp    %rbp,0x20(%rsp)
jne    11e0 <_compute_transition_counts+0xb0>
mov    0x40(%rsp),%r13
test   %r13,%r13
mov    0x10(%rsp),%r9
mov    0x18(%rsp),%r12
mov    0x30(%rsp),%r14
je     128f <_compute_transition_counts+0x15f>
imul   %r9d,%ebp
cs nopw 0x0(%rax,%rax,1)
movslq %ebp,%rbp
lea    (%r14,%rbp,8),%rdi
xor    %esi,%esi
mov    %r12,%rdx
call   1040 <memset@plt>
mov    0x10(%rsp),%r9
add    %r9d,%ebp
add    $0xffffffffffffffff,%r13
jne    1270 <_compute_transition_counts+0x140>
mov    %r9d,%edi
imul   %r9d,%edi
shl    $0x3,%edi
call   1050 <malloc@plt>
cmpl   $0x2,0x28(%rsp)
jl     169c <_compute_transition_counts+0x56c>
mov    %r14,%rbp
mov    %rax,0x8(%rsp)
mov    0x28(%rsp),%rax
add    $0xffffffff,%eax
mov    %rax,0x28(%rsp)
movslq 0x10(%rsp),%rcx
mov    %r15d,%r12d
and    $0xfffffffe,%r12d
lea    -0x2(%r12),%rax
mov    %rax,0x40(%rsp)
mov    %rax,%rdx
shr    %rdx
add    $0x1,%rdx
mov    %rdx,%rax
mov    %rdx,0xa0(%rsp)
and    $0xfffffffffffffffe,%rdx
mov    %rdx,0x98(%rsp)
mov    %r15,%rax
neg    %rax
mov    %rax,0x48(%rsp)
mov    0x8(%rsp),%rax
add    $0x8,%rax
mov    %rax,0x60(%rsp)
lea    0x0(,%rcx,8),%rax
mov    %rax,0x18(%rsp)
mov    0x68(%rsp),%rax
lea    0x8(%rax),%rax
mov    %rax,0x90(%rsp)
mov    0x58(%rsp),%rax
lea    0x8(%rax,%rcx,8),%r14
mov    0x70(%rsp),%rax
mov    %rcx,0x20(%rsp)
lea    0x8(%rax,%rcx,8),%r10
mov    0x8(%rsp),%rax
lea    0x10(%rbp),%rcx
mov    %rcx,0x88(%rsp)
lea    0x10(%rax),%rcx
mov    %rcx,0x80(%rsp)
lea    0x8(%rbp),%rcx
mov    %rcx,0x78(%rsp)
xor    %ecx,%ecx
mov    %rcx,0x38(%rsp)
jmp    13a7 <_compute_transition_counts+0x277>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    0x38(%rsp),%rdx
add    $0x1,%rdx
mov    0x18(%rsp),%rcx
add    %rcx,%r14
add    %rcx,%r10
mov    %rdx,%rcx
mov    %rdx,0x38(%rsp)
cmp    0x28(%rsp),%rdx
je     169c <_compute_transition_counts+0x56c>
cmpl   $0x0,0x10(%rsp)
jle    1380 <_compute_transition_counts+0x250>
mov    0x38(%rsp),%rcx
mov    %rcx,%r9
mov    0x20(%rsp),%rax
imul   %rax,%r9
lea    0x1(%rcx),%r8
imul   %rax,%r8
xorpd  %xmm0,%xmm0
mov    0x90(%rsp),%rcx
mov    0x60(%rsp),%rbp
xor    %eax,%eax
mov    0x10(%rsp),%r11
mov    0x58(%rsp),%r13
jmp    1408 <_compute_transition_counts+0x2d8>
cs nopw 0x0(%rax,%rax,1)
add    $0x1,%rax
mov    0x18(%rsp),%rdx
add    %rdx,%rbp
add    %rdx,%rcx
cmp    %r15,%rax
je     14c0 <_compute_transition_counts+0x390>
lea    (%rax,%r9,1),%rdx
xor    %edi,%edi
cmp    $0x1,%r11d
je     146c <_compute_transition_counts+0x33c>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
movsd  (%rbx,%rdx,8),%xmm1
mulsd  -0x8(%rcx,%rdi,8),%xmm1
mulsd  -0x8(%r10,%rdi,8),%xmm1
mulsd  -0x8(%r14,%rdi,8),%xmm1
movsd  %xmm1,-0x8(%rbp,%rdi,8)
addsd  %xmm0,%xmm1
movsd  (%rbx,%rdx,8),%xmm0
mulsd  (%rcx,%rdi,8),%xmm0
mulsd  (%r10,%rdi,8),%xmm0
mulsd  (%r14,%rdi,8),%xmm0
movsd  %xmm0,0x0(%rbp,%rdi,8)
addsd  %xmm1,%xmm0
add    $0x2,%rdi
cmp    %rdi,%r12
jne    1420 <_compute_transition_counts+0x2f0>
test   $0x1,%r15b
je     13f0 <_compute_transition_counts+0x2c0>
mov    %rax,%rsi
imul   0x20(%rsp),%rsi
movsd  (%rbx,%rdx,8),%xmm1
add    %rdi,%rsi
mov    0x68(%rsp),%rdx
mulsd  (%rdx,%rsi,8),%xmm1
add    %r8,%rdi
mov    0x70(%rsp),%rdx
mulsd  (%rdx,%rdi,8),%xmm1
mulsd  0x0(%r13,%rdi,8),%xmm1
mov    0x8(%rsp),%rdx
movsd  %xmm1,(%rdx,%rsi,8)
addsd  %xmm1,%xmm0
jmp    13f0 <_compute_transition_counts+0x2c0>
nopl   0x0(%rax,%rax,1)
test   %r11d,%r11d
mov    0x30(%rsp),%rbp
mov    0x8(%rsp),%rax
jle    1380 <_compute_transition_counts+0x250>
movapd %xmm0,%xmm1
unpcklpd %xmm0,%xmm1
mov    0x78(%rsp),%r9
mov    0x60(%rsp),%r11
mov    0x80(%rsp),%r13
mov    0x88(%rsp),%r8
xor    %esi,%esi
jmp    151e <_compute_transition_counts+0x3ee>
nopl   0x0(%rax)
add    $0x1,%rsi
mov    0x18(%rsp),%rcx
add    %rcx,%r8
add    %rcx,%r13
add    %rcx,%r11
add    %rcx,%r9
cmp    %r15,%rsi
je     1380 <_compute_transition_counts+0x250>
mov    %rsi,%rcx
imul   0x20(%rsp),%rcx
cmpl   $0x2,0x10(%rsp)
jb     1569 <_compute_transition_counts+0x439>
lea    (%rcx,%r15,1),%rdx
lea    (%rax,%rdx,8),%rdi
mov    %rdi,0x50(%rsp)
lea    0x0(,%rcx,8),%rdi
add    %rbp,%rdi
cmp    0x50(%rsp),%rdi
jae    15f0 <_compute_transition_counts+0x4c0>
lea    (%rax,%rcx,8),%rdi
lea    0x0(,%rdx,8),%rdx
add    %rbp,%rdx
cmp    %rdx,%rdi
jae    15f0 <_compute_transition_counts+0x4c0>
xor    %edi,%edi
mov    %rdi,%rdx
test   $0x1,%r15b
je     1593 <_compute_transition_counts+0x463>
add    %rdi,%rcx
movsd  (%rax,%rcx,8),%xmm2
divsd  %xmm0,%xmm2
addsd  0x0(%rbp,%rcx,8),%xmm2
movsd  %xmm2,0x0(%rbp,%rcx,8)
mov    %rdi,%rdx
or     $0x1,%rdx
not    %rdi
cmp    0x48(%rsp),%rdi
je     1500 <_compute_transition_counts+0x3d0>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
movsd  -0x8(%r11,%rdx,8),%xmm2
divsd  %xmm0,%xmm2
addsd  -0x8(%r9,%rdx,8),%xmm2
movsd  %xmm2,-0x8(%r9,%rdx,8)
movsd  (%r11,%rdx,8),%xmm2
divsd  %xmm0,%xmm2
addsd  (%r9,%rdx,8),%xmm2
movsd  %xmm2,(%r9,%rdx,8)
add    $0x2,%rdx
cmp    %rdx,%r15
jne    15b0 <_compute_transition_counts+0x480>
jmp    1500 <_compute_transition_counts+0x3d0>
nopl   (%rax)
cmpq   $0x0,0x40(%rsp)
je     1689 <_compute_transition_counts+0x559>
mov    0x98(%rsp),%rdi
xor    %edx,%edx
mov    0x8(%rsp),%rax
nopl   0x0(%rax,%rax,1)
movupd -0x10(%r13,%rdx,8),%xmm2
divpd  %xmm1,%xmm2
movupd -0x10(%r8,%rdx,8),%xmm3
addpd  %xmm2,%xmm3
movupd (%r8,%rdx,8),%xmm2
movupd %xmm3,-0x10(%r8,%rdx,8)
movupd 0x0(%r13,%rdx,8),%xmm3
divpd  %xmm1,%xmm3
addpd  %xmm2,%xmm3
movupd %xmm3,(%r8,%rdx,8)
add    $0x4,%rdx
add    $0xfffffffffffffffe,%rdi
jne    1610 <_compute_transition_counts+0x4e0>
testb  $0x1,0xa0(%rsp)
01
je     1678 <_compute_transition_counts+0x548>
add    %rcx,%rdx
movupd (%rax,%rdx,8),%xmm2
divpd  %xmm1,%xmm2
movupd 0x0(%rbp,%rdx,8),%xmm3
addpd  %xmm2,%xmm3
movupd %xmm3,0x0(%rbp,%rdx,8)
mov    %r12,%rdi
cmp    %r15,%r12
je     1500 <_compute_transition_counts+0x3d0>
jmp    156b <_compute_transition_counts+0x43b>
xor    %edx,%edx
mov    0x8(%rsp),%rax
testb  $0x1,0xa0(%rsp)
01
jne    165c <_compute_transition_counts+0x52c>
jmp    1678 <_compute_transition_counts+0x548>
mov    %rax,%rdi
add    $0xa8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <free@plt>

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

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