#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 */
double exp(double);
void PMat_K80(double l, double kappa, double ***Pij) {
  double Ts, Tv, e1, e2, aux;
  aux = -2 * l / (kappa + 2);
  e1 = exp(aux * 2);
  if (1.0 != kappa) {
    e2 = exp(aux * (kappa + 1));
    Tv = .25 * (1 - e1);
    Ts = .25 * (1 + e1 - 2 * e2);
  } else {
    Ts = Tv = .25 * (1 - e1);
  }
  (*Pij)[0][1] = (*Pij)[1][0] = Tv;
  (*Pij)[0][2] = (*Pij)[2][0] = Ts;
  (*Pij)[0][3] = (*Pij)[3][0] = Tv;
  (*Pij)[1][2] = (*Pij)[2][1] = Tv;
  (*Pij)[1][3] = (*Pij)[3][1] = Ts;
  (*Pij)[2][3] = (*Pij)[3][2] = Tv;
  (*Pij)[0][0] = (*Pij)[1][1] = (*Pij)[2][2] = (*Pij)[3][3] = 1. - Ts - 2. * Tv;
}


x86 assembly (clang, -O0):
<PMat_K80>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
mov    %rdi,-0x18(%rbp)
movsd  0xee2(%rip),%xmm0
mulsd  -0x8(%rbp),%xmm0
movsd  0xecd(%rip),%xmm1
addsd  -0x10(%rbp),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  0xeb7(%rip),%xmm0
mulsd  -0x40(%rbp),%xmm0
call   1030 <exp@plt>
movsd  %xmm0,-0x30(%rbp)
movsd  0xe98(%rip),%xmm0
ucomisd -0x10(%rbp),%xmm0
jne    117e <PMat_K80+0x6e>
jp     117e <PMat_K80+0x6e>
jmp    11ec <PMat_K80+0xdc>
movsd  -0x40(%rbp),%xmm0
movsd  0xe75(%rip),%xmm1
addsd  -0x10(%rbp),%xmm1
mulsd  %xmm1,%xmm0
call   1030 <exp@plt>
movsd  %xmm0,-0x38(%rbp)
movsd  0xe5a(%rip),%xmm1
subsd  -0x30(%rbp),%xmm1
movsd  0xe65(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  0xe3c(%rip),%xmm1
addsd  -0x30(%rbp),%xmm1
movsd  -0x38(%rbp),%xmm0
addsd  %xmm0,%xmm0
subsd  %xmm0,%xmm1
movsd  0xe3a(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
jmp    120f <PMat_K80+0xff>
movsd  0xe0c(%rip),%xmm1
subsd  -0x30(%rbp),%xmm1
movsd  0xe17(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  %xmm0,-0x20(%rbp)
movsd  -0x28(%rbp),%xmm0
mov    -0x18(%rbp),%rax
mov    (%rax),%rax
mov    0x8(%rax),%rax
movsd  %xmm0,(%rax)
mov    -0x18(%rbp),%rax
mov    (%rax),%rax
mov    (%rax),%rax
movsd  %xmm0,0x8(%rax)
movsd  -0x20(%rbp),%xmm0
mov    -0x18(%rbp),%rax
mov    (%rax),%rax
mov    0x10(%rax),%rax
movsd  %xmm0,(%rax)
mov    -0x18(%rbp),%rax
mov    (%rax),%rax
mov    (%rax),%rax
movsd  %xmm0,0x10(%rax)
movsd  -0x28(%rbp),%xmm0
mov    -0x18(%rbp),%rax
mov    (%rax),%rax
mov    0x18(%rax),%rax
movsd  %xmm0,(%rax)
mov    -0x18(%rbp),%rax
mov    (%rax),%rax
mov    (%rax),%rax
movsd  %xmm0,0x18(%rax)
movsd  -0x28(%rbp),%xmm0
mov    -0x18(%rbp),%rax
mov    (%rax),%rax
mov    0x10(%rax),%rax
movsd  %xmm0,0x8(%rax)
mov    -0x18(%rbp),%rax
mov    (%rax),%rax
mov    0x8(%rax),%rax
movsd  %xmm0,0x10(%rax)
movsd  -0x20(%rbp),%xmm0
mov    -0x18(%rbp),%rax
mov    (%rax),%rax
mov    0x18(%rax),%rax
movsd  %xmm0,0x8(%rax)
mov    -0x18(%rbp),%rax
mov    (%rax),%rax
mov    0x8(%rax),%rax
movsd  %xmm0,0x18(%rax)
movsd  -0x28(%rbp),%xmm0
mov    -0x18(%rbp),%rax
mov    (%rax),%rax
mov    0x18(%rax),%rax
movsd  %xmm0,0x10(%rax)
mov    -0x18(%rbp),%rax
mov    (%rax),%rax
mov    0x10(%rax),%rax
movsd  %xmm0,0x18(%rax)
movsd  0xd11(%rip),%xmm0
subsd  -0x20(%rbp),%xmm0
movsd  -0x28(%rbp),%xmm1
addsd  %xmm1,%xmm1
subsd  %xmm1,%xmm0
mov    -0x18(%rbp),%rax
mov    (%rax),%rax
mov    0x18(%rax),%rax
movsd  %xmm0,0x18(%rax)
mov    -0x18(%rbp),%rax
mov    (%rax),%rax
mov    0x10(%rax),%rax
movsd  %xmm0,0x10(%rax)
mov    -0x18(%rbp),%rax
mov    (%rax),%rax
mov    0x8(%rax),%rax
movsd  %xmm0,0x8(%rax)
mov    -0x18(%rbp),%rax
mov    (%rax),%rax
mov    (%rax),%rax
movsd  %xmm0,(%rax)
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<PMat_K80>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
movsd  %xmm1,(%rsp)
mulsd  0xedb(%rip),%xmm0
movsd  0xedb(%rip),%xmm2
addsd  %xmm1,%xmm2
divsd  %xmm2,%xmm0
movsd  %xmm0,0x8(%rsp)
addsd  %xmm0,%xmm0
call   1030 <exp@plt>
movsd  (%rsp),%xmm1
movapd %xmm0,%xmm2
ucomisd 0xebb(%rip),%xmm1
jne    1159 <PMat_K80+0x49>
jnp    11a8 <PMat_K80+0x98>
addsd  0xeaf(%rip),%xmm1
mulsd  0x8(%rsp),%xmm1
movapd %xmm1,%xmm0
movsd  %xmm2,(%rsp)
call   1030 <exp@plt>
movsd  (%rsp),%xmm3
movsd  0xe8e(%rip),%xmm4
movapd %xmm4,%xmm1
subsd  %xmm3,%xmm1
movsd  0xe86(%rip),%xmm2
mulsd  %xmm2,%xmm1
addsd  %xmm4,%xmm3
addsd  %xmm0,%xmm0
subsd  %xmm0,%xmm3
mulsd  %xmm2,%xmm3
jmp    11c0 <PMat_K80+0xb0>
movsd  0xe60(%rip),%xmm1
subsd  %xmm2,%xmm1
mulsd  0xe5c(%rip),%xmm1
movapd %xmm1,%xmm3
mov    (%rbx),%rax
mov    0x8(%rax),%rcx
movsd  %xmm1,(%rcx)
mov    (%rax),%rdx
movsd  %xmm1,0x8(%rdx)
mov    0x10(%rax),%rsi
movsd  %xmm3,(%rsi)
movsd  %xmm3,0x10(%rdx)
mov    0x18(%rax),%rax
movsd  %xmm1,(%rax)
movsd  %xmm1,0x18(%rdx)
movsd  %xmm1,0x8(%rsi)
movsd  %xmm1,0x10(%rcx)
movsd  %xmm3,0x8(%rax)
movsd  %xmm3,0x18(%rcx)
movsd  %xmm1,0x10(%rax)
movsd  %xmm1,0x18(%rsi)
movsd  0xdfd(%rip),%xmm0
subsd  %xmm3,%xmm0
addsd  %xmm1,%xmm1
subsd  %xmm1,%xmm0
movsd  %xmm0,0x18(%rax)
movsd  %xmm0,0x10(%rsi)
movsd  %xmm0,0x8(%rcx)
movsd  %xmm0,(%rdx)
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define void @PMat_K80(double %0, double %1, double*** %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca double***
%7 = alloca double
%8 = alloca double
%9 = alloca double
%10 = alloca double
%11 = alloca double
store double %0, double* %4
store double %1, double* %5
store double*** %2, double**** %6
%12 = load double, double* %4
%13 = fmul double -2.000000e+00, %12
%14 = load double, double* %5
%15 = fadd double %14, 2.000000e+00
%16 = fdiv double %13, %15
store double %16, double* %11
%17 = load double, double* %11
%18 = fmul double %17, 2.000000e+00
%19 = call double @exp(double %18)
store double %19, double* %9
%20 = load double, double* %5
%21 = fcmp une double 1.000000e+00, %20
br i1 %21, label %22, label %36
22: ; preds = %3
%23 = load double, double* %11
%24 = load double, double* %5
%25 = fadd double %24, 1.000000e+00
%26 = fmul double %23, %25
%27 = call double @exp(double %26)
store double %27, double* %10
%28 = load double, double* %9
%29 = fsub double 1.000000e+00, %28
%30 = fmul double 2.500000e-01, %29
store double %30, double* %8
%31 = load double, double* %9
%32 = fadd double 1.000000e+00, %31
%33 = load double, double* %10
%34 = call double @llvm.fmuladd.f64(double -2.000000e+00, double %33, double %32)
%35 = fmul double 2.500000e-01, %34
store double %35, double* %7
br label %40
36: ; preds = %3
%37 = load double, double* %9
%38 = fsub double 1.000000e+00, %37
%39 = fmul double 2.500000e-01, %38
store double %39, double* %8
store double %39, double* %7
br label %40
40: ; preds = %36, %22
%41 = load double, double* %8
%42 = load double***, double**** %6
%43 = load double**, double*** %42
%44 = getelementptr inbounds double*, double** %43, i64 1
%45 = load double*, double** %44
%46 = getelementptr inbounds double, double* %45, i64 0
store double %41, double* %46
%47 = load double***, double**** %6
%48 = load double**, double*** %47
%49 = getelementptr inbounds double*, double** %48, i64 0
%50 = load double*, double** %49
%51 = getelementptr inbounds double, double* %50, i64 1
store double %41, double* %51
%52 = load double, double* %7
%53 = load double***, double**** %6
%54 = load double**, double*** %53
%55 = getelementptr inbounds double*, double** %54, i64 2
%56 = load double*, double** %55
%57 = getelementptr inbounds double, double* %56, i64 0
store double %52, double* %57
%58 = load double***, double**** %6
%59 = load double**, double*** %58
%60 = getelementptr inbounds double*, double** %59, i64 0
%61 = load double*, double** %60
%62 = getelementptr inbounds double, double* %61, i64 2
store double %52, double* %62
%63 = load double, double* %8
%64 = load double***, double**** %6
%65 = load double**, double*** %64
%66 = getelementptr inbounds double*, double** %65, i64 3
%67 = load double*, double** %66
%68 = getelementptr inbounds double, double* %67, i64 0
store double %63, double* %68
%69 = load double***, double**** %6
%70 = load double**, double*** %69
%71 = getelementptr inbounds double*, double** %70, i64 0
%72 = load double*, double** %71
%73 = getelementptr inbounds double, double* %72, i64 3
store double %63, double* %73
%74 = load double, double* %8
%75 = load double***, double**** %6
%76 = load double**, double*** %75
%77 = getelementptr inbounds double*, double** %76, i64 2
%78 = load double*, double** %77
%79 = getelementptr inbounds double, double* %78, i64 1
store double %74, double* %79
%80 = load double***, double**** %6
%81 = load double**, double*** %80
%82 = getelementptr inbounds double*, double** %81, i64 1
%83 = load double*, double** %82
%84 = getelementptr inbounds double, double* %83, i64 2
store double %74, double* %84
%85 = load double, double* %7
%86 = load double***, double**** %6
%87 = load double**, double*** %86
%88 = getelementptr inbounds double*, double** %87, i64 3
%89 = load double*, double** %88
%90 = getelementptr inbounds double, double* %89, i64 1
store double %85, double* %90
%91 = load double***, double**** %6
%92 = load double**, double*** %91
%93 = getelementptr inbounds double*, double** %92, i64 1
%94 = load double*, double** %93
%95 = getelementptr inbounds double, double* %94, i64 3
store double %85, double* %95
%96 = load double, double* %8
%97 = load double***, double**** %6
%98 = load double**, double*** %97
%99 = getelementptr inbounds double*, double** %98, i64 3
%100 = load double*, double** %99
%101 = getelementptr inbounds double, double* %100, i64 2
store double %96, double* %101
%102 = load double***, double**** %6
%103 = load double**, double*** %102
%104 = getelementptr inbounds double*, double** %103, i64 2
%105 = load double*, double** %104
%106 = getelementptr inbounds double, double* %105, i64 3
store double %96, double* %106
%107 = load double, double* %7
%108 = fsub double 1.000000e+00, %107
%109 = load double, double* %8
%110 = call double @llvm.fmuladd.f64(double -2.000000e+00, double %109, double %108)
%111 = load double***, double**** %6
%112 = load double**, double*** %111
%113 = getelementptr inbounds double*, double** %112, i64 3
%114 = load double*, double** %113
%115 = getelementptr inbounds double, double* %114, i64 3
store double %110, double* %115
%116 = load double***, double**** %6
%117 = load double**, double*** %116
%118 = getelementptr inbounds double*, double** %117, i64 2
%119 = load double*, double** %118
%120 = getelementptr inbounds double, double* %119, i64 2
store double %110, double* %120
%121 = load double***, double**** %6
%122 = load double**, double*** %121
%123 = getelementptr inbounds double*, double** %122, i64 1
%124 = load double*, double** %123
%125 = getelementptr inbounds double, double* %124, i64 1
store double %110, double* %125
%126 = load double***, double**** %6
%127 = load double**, double*** %126
%128 = getelementptr inbounds double*, double** %127, i64 0
%129 = load double*, double** %128
%130 = getelementptr inbounds double, double* %129, i64 0
store double %110, double* %130
ret void
}

LLVM IR (-O2):
define void @PMat_K80(double %0, double %1, double*** nocapture %2) {
%4 = fmul double %0, -2.000000e+00
%5 = fadd double %1, 2.000000e+00
%6 = fdiv double %4, %5
%7 = fmul double %6, 2.000000e+00
%8 = tail call double @exp(double %7)
%9 = fcmp une double %1, 1.000000e+00
br i1 %9, label %10, label %19
10: ; preds = %3
%11 = fadd double %1, 1.000000e+00
%12 = fmul double %11, %6
%13 = tail call double @exp(double %12)
%14 = fsub double 1.000000e+00, %8
%15 = fmul double %14, 2.500000e-01
%16 = fadd double %8, 1.000000e+00
%17 = tail call double @llvm.fmuladd.f64(double %13, double -2.000000e+00, double %16)
%18 = fmul double %17, 2.500000e-01
br label %22
19: ; preds = %3
%20 = fsub double 1.000000e+00, %8
%21 = fmul double %20, 2.500000e-01
br label %22
22: ; preds = %19, %10
%23 = phi double [ %15, %10 ], [ %21, %19 ]
%24 = phi double [ %18, %10 ], [ %21, %19 ]
%25 = load double**, double*** %2
%26 = getelementptr inbounds double*, double** %25, i64 1
%27 = load double*, double** %26
store double %23, double* %27
%28 = load double*, double** %25
%29 = getelementptr inbounds double, double* %28, i64 1
store double %23, double* %29
%30 = getelementptr inbounds double*, double** %25, i64 2
%31 = load double*, double** %30
store double %24, double* %31
%32 = getelementptr inbounds double, double* %28, i64 2
store double %24, double* %32
%33 = getelementptr inbounds double*, double** %25, i64 3
%34 = load double*, double** %33
store double %23, double* %34
%35 = getelementptr inbounds double, double* %28, i64 3
store double %23, double* %35
%36 = getelementptr inbounds double, double* %31, i64 1
store double %23, double* %36
%37 = getelementptr inbounds double, double* %27, i64 2
store double %23, double* %37
%38 = getelementptr inbounds double, double* %34, i64 1
store double %24, double* %38
%39 = getelementptr inbounds double, double* %27, i64 3
store double %24, double* %39
%40 = getelementptr inbounds double, double* %34, i64 2
store double %23, double* %40
%41 = getelementptr inbounds double, double* %31, i64 3
store double %23, double* %41
%42 = fsub double 1.000000e+00, %24
%43 = tail call double @llvm.fmuladd.f64(double %23, double -2.000000e+00, double %42)
%44 = getelementptr inbounds double, double* %34, i64 3
store double %43, double* %44
%45 = getelementptr inbounds double, double* %31, i64 2
store double %43, double* %45
%46 = getelementptr inbounds double, double* %27, i64 1
store double %43, double* %46
store double %43, double* %28
ret void
}