void calcTNAuxProbs(double *Pi, double *PAPG, double *PCPT, double *PR,
                    double *PY) {
  *PR = Pi[0] + Pi[2];
  *PY = Pi[1] + Pi[3];
  *PAPG = Pi[0] * Pi[2];
  *PCPT = Pi[1] * Pi[3];
  return;
}


x86 assembly (clang, -O0):
<calcTNAuxProbs>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x8(%rbp),%rax
addsd  0x10(%rax),%xmm0
mov    -0x20(%rbp),%rax
movsd  %xmm0,(%rax)
mov    -0x8(%rbp),%rax
movsd  0x8(%rax),%xmm0
mov    -0x8(%rbp),%rax
addsd  0x18(%rax),%xmm0
mov    -0x28(%rbp),%rax
movsd  %xmm0,(%rax)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x8(%rbp),%rax
mulsd  0x10(%rax),%xmm0
mov    -0x10(%rbp),%rax
movsd  %xmm0,(%rax)
mov    -0x8(%rbp),%rax
movsd  0x8(%rax),%xmm0
mov    -0x8(%rbp),%rax
mulsd  0x18(%rax),%xmm0
mov    -0x18(%rbp),%rax
movsd  %xmm0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<calcTNAuxProbs>:
movsd  (%rdi),%xmm0
addsd  0x10(%rdi),%xmm0
movsd  %xmm0,(%rcx)
movsd  0x8(%rdi),%xmm0
addsd  0x18(%rdi),%xmm0
movsd  %xmm0,(%r8)
movsd  (%rdi),%xmm0
mulsd  0x10(%rdi),%xmm0
movsd  %xmm0,(%rsi)
movsd  0x8(%rdi),%xmm0
mulsd  0x18(%rdi),%xmm0
movsd  %xmm0,(%rdx)
ret

LLVM IR (-O0):
define void @calcTNAuxProbs(double* %0, double* %1, double* %2, double* %3, double* %4) {
%6 = alloca double*
%7 = alloca double*
%8 = alloca double*
%9 = alloca double*
%10 = alloca double*
store double* %0, double** %6
store double* %1, double** %7
store double* %2, double** %8
store double* %3, double** %9
store double* %4, double** %10
%11 = load double*, double** %6
%12 = getelementptr inbounds double, double* %11, i64 0
%13 = load double, double* %12
%14 = load double*, double** %6
%15 = getelementptr inbounds double, double* %14, i64 2
%16 = load double, double* %15
%17 = fadd double %13, %16
%18 = load double*, double** %9
store double %17, double* %18
%19 = load double*, double** %6
%20 = getelementptr inbounds double, double* %19, i64 1
%21 = load double, double* %20
%22 = load double*, double** %6
%23 = getelementptr inbounds double, double* %22, i64 3
%24 = load double, double* %23
%25 = fadd double %21, %24
%26 = load double*, double** %10
store double %25, double* %26
%27 = load double*, double** %6
%28 = getelementptr inbounds double, double* %27, i64 0
%29 = load double, double* %28
%30 = load double*, double** %6
%31 = getelementptr inbounds double, double* %30, i64 2
%32 = load double, double* %31
%33 = fmul double %29, %32
%34 = load double*, double** %7
store double %33, double* %34
%35 = load double*, double** %6
%36 = getelementptr inbounds double, double* %35, i64 1
%37 = load double, double* %36
%38 = load double*, double** %6
%39 = getelementptr inbounds double, double* %38, i64 3
%40 = load double, double* %39
%41 = fmul double %37, %40
%42 = load double*, double** %8
store double %41, double* %42
ret void
}

LLVM IR (-O2):
define void @calcTNAuxProbs(double* nocapture %0, double* nocapture writeonly %1, double* nocapture writeonly %2, double* nocapture writeonly %3, double* nocapture writeonly %4) {
%6 = load double, double* %0
%7 = getelementptr inbounds double, double* %0, i64 2
%8 = load double, double* %7
%9 = fadd double %6, %8
store double %9, double* %3
%10 = getelementptr inbounds double, double* %0, i64 1
%11 = load double, double* %10
%12 = getelementptr inbounds double, double* %0, i64 3
%13 = load double, double* %12
%14 = fadd double %11, %13
store double %14, double* %4
%15 = load double, double* %0
%16 = load double, double* %7
%17 = fmul double %15, %16
store double %17, double* %1
%18 = load double, double* %10
%19 = load double, double* %12
%20 = fmul double %18, %19
store double %20, double* %2
ret void
}