#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 const log10(double);
double log10_add_pow10(double, double);
double *yyx_calc_posterior(const double *log10_prior_vec,
                           const double *log10_likelihood_vec,
                           double *tmp_four_double_vec,
                           double base_change_relative_rate) {
  double alt_hom_log10_posterior = log10_prior_vec[2] + log10_likelihood_vec[2];
  double ref_hom_log10_posterior = log10_prior_vec[0] + log10_likelihood_vec[0];
  double log10_posterior_normalization_constant =
      log10_add_pow10(alt_hom_log10_posterior, ref_hom_log10_posterior);
  double het_log10_posterior = log10_prior_vec[1] + log10_likelihood_vec[1];
  log10_posterior_normalization_constant = log10_add_pow10(
      log10_posterior_normalization_constant, het_log10_posterior);
  double mosaic_log10_posterior = log10_prior_vec[3] + log10_likelihood_vec[3] +
                                  log10(base_change_relative_rate);
  log10_posterior_normalization_constant = log10_add_pow10(
      log10_posterior_normalization_constant, mosaic_log10_posterior);
  tmp_four_double_vec[0] =
      ref_hom_log10_posterior - log10_posterior_normalization_constant;
  tmp_four_double_vec[1] =
      het_log10_posterior - log10_posterior_normalization_constant;
  tmp_four_double_vec[2] =
      alt_hom_log10_posterior - log10_posterior_normalization_constant;
  tmp_four_double_vec[3] =
      mosaic_log10_posterior - log10_posterior_normalization_constant;
  return tmp_four_double_vec;
}


x86 assembly (clang, -O0):
<yyx_calc_posterior>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
movsd  %xmm0,-0x20(%rbp)
mov    -0x8(%rbp),%rax
movsd  0x10(%rax),%xmm0
mov    -0x10(%rbp),%rax
addsd  0x10(%rax),%xmm0
movsd  %xmm0,-0x28(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x10(%rbp),%rax
addsd  (%rax),%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x28(%rbp),%xmm0
movsd  -0x30(%rbp),%xmm1
call   1030 <log10_add_pow10@plt>
movsd  %xmm0,-0x38(%rbp)
mov    -0x8(%rbp),%rax
movsd  0x8(%rax),%xmm0
mov    -0x10(%rbp),%rax
addsd  0x8(%rax),%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  -0x38(%rbp),%xmm0
movsd  -0x40(%rbp),%xmm1
call   1030 <log10_add_pow10@plt>
movsd  %xmm0,-0x38(%rbp)
mov    -0x8(%rbp),%rax
movsd  0x18(%rax),%xmm0
mov    -0x10(%rbp),%rax
addsd  0x18(%rax),%xmm0
movsd  %xmm0,-0x50(%rbp)
movsd  -0x20(%rbp),%xmm0
call   1040 <log10@plt>
movaps %xmm0,%xmm1
movsd  -0x50(%rbp),%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x48(%rbp)
movsd  -0x38(%rbp),%xmm0
movsd  -0x48(%rbp),%xmm1
call   1030 <log10_add_pow10@plt>
movsd  %xmm0,-0x38(%rbp)
movsd  -0x30(%rbp),%xmm0
subsd  -0x38(%rbp),%xmm0
mov    -0x18(%rbp),%rax
movsd  %xmm0,(%rax)
movsd  -0x40(%rbp),%xmm0
subsd  -0x38(%rbp),%xmm0
mov    -0x18(%rbp),%rax
movsd  %xmm0,0x8(%rax)
movsd  -0x28(%rbp),%xmm0
subsd  -0x38(%rbp),%xmm0
mov    -0x18(%rbp),%rax
movsd  %xmm0,0x10(%rax)
movsd  -0x48(%rbp),%xmm0
subsd  -0x38(%rbp),%xmm0
mov    -0x18(%rbp),%rax
movsd  %xmm0,0x18(%rax)
mov    -0x18(%rbp),%rax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<yyx_calc_posterior>:
push   %r15
push   %r14
push   %rbx
sub    $0x50,%rsp
movsd  %xmm0,(%rsp)
mov    %rdx,%r14
mov    %rsi,%r15
mov    %rdi,%rbx
movsd  (%rdi),%xmm1
movsd  0x10(%rdi),%xmm0
addsd  0x10(%rsi),%xmm0
movapd %xmm0,0x40(%rsp)
addsd  (%rsi),%xmm1
movapd %xmm1,0x30(%rsp)
call   1030 <log10_add_pow10@plt>
movsd  0x8(%rbx),%xmm1
addsd  0x8(%r15),%xmm1
movapd %xmm1,0x20(%rsp)
call   1030 <log10_add_pow10@plt>
movsd  %xmm0,0x18(%rsp)
movsd  0x18(%rbx),%xmm0
addsd  0x18(%r15),%xmm0
movsd  %xmm0,0x10(%rsp)
movsd  (%rsp),%xmm0
call   1040 <log10@plt>
movapd %xmm0,%xmm1
addsd  0x10(%rsp),%xmm1
movapd %xmm1,(%rsp)
movsd  0x18(%rsp),%xmm0
call   1030 <log10_add_pow10@plt>
movapd 0x30(%rsp),%xmm1
unpcklpd 0x20(%rsp),%xmm1
unpcklpd %xmm0,%xmm0
subpd  %xmm0,%xmm1
movupd %xmm1,(%r14)
movapd 0x40(%rsp),%xmm1
unpcklpd (%rsp),%xmm1
subpd  %xmm0,%xmm1
movupd %xmm1,0x10(%r14)
mov    %r14,%rax
add    $0x50,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define double* @yyx_calc_posterior(double* %0, double* %1, double* %2, double %3) {
%5 = alloca double*
%6 = alloca double*
%7 = alloca double*
%8 = alloca double
%9 = alloca double
%10 = alloca double
%11 = alloca double
%12 = alloca double
%13 = alloca double
store double* %0, double** %5
store double* %1, double** %6
store double* %2, double** %7
store double %3, double* %8
%14 = load double*, double** %5
%15 = getelementptr inbounds double, double* %14, i64 2
%16 = load double, double* %15
%17 = load double*, double** %6
%18 = getelementptr inbounds double, double* %17, i64 2
%19 = load double, double* %18
%20 = fadd double %16, %19
store double %20, double* %9
%21 = load double*, double** %5
%22 = getelementptr inbounds double, double* %21, i64 0
%23 = load double, double* %22
%24 = load double*, double** %6
%25 = getelementptr inbounds double, double* %24, i64 0
%26 = load double, double* %25
%27 = fadd double %23, %26
store double %27, double* %10
%28 = load double, double* %9
%29 = load double, double* %10
%30 = call double @log10_add_pow10(double %28, double %29)
store double %30, double* %11
%31 = load double*, double** %5
%32 = getelementptr inbounds double, double* %31, i64 1
%33 = load double, double* %32
%34 = load double*, double** %6
%35 = getelementptr inbounds double, double* %34, i64 1
%36 = load double, double* %35
%37 = fadd double %33, %36
store double %37, double* %12
%38 = load double, double* %11
%39 = load double, double* %12
%40 = call double @log10_add_pow10(double %38, double %39)
store double %40, double* %11
%41 = load double*, double** %5
%42 = getelementptr inbounds double, double* %41, i64 3
%43 = load double, double* %42
%44 = load double*, double** %6
%45 = getelementptr inbounds double, double* %44, i64 3
%46 = load double, double* %45
%47 = fadd double %43, %46
%48 = load double, double* %8
%49 = call double @log10(double %48)
%50 = fadd double %47, %49
store double %50, double* %13
%51 = load double, double* %11
%52 = load double, double* %13
%53 = call double @log10_add_pow10(double %51, double %52)
store double %53, double* %11
%54 = load double, double* %10
%55 = load double, double* %11
%56 = fsub double %54, %55
%57 = load double*, double** %7
%58 = getelementptr inbounds double, double* %57, i64 0
store double %56, double* %58
%59 = load double, double* %12
%60 = load double, double* %11
%61 = fsub double %59, %60
%62 = load double*, double** %7
%63 = getelementptr inbounds double, double* %62, i64 1
store double %61, double* %63
%64 = load double, double* %9
%65 = load double, double* %11
%66 = fsub double %64, %65
%67 = load double*, double** %7
%68 = getelementptr inbounds double, double* %67, i64 2
store double %66, double* %68
%69 = load double, double* %13
%70 = load double, double* %11
%71 = fsub double %69, %70
%72 = load double*, double** %7
%73 = getelementptr inbounds double, double* %72, i64 3
store double %71, double* %73
%74 = load double*, double** %7
ret double* %74
}

LLVM IR (-O2):
define double* @yyx_calc_posterior(double* nocapture %0, double* nocapture %1, double* returned writeonly %2, double %3) {
%5 = getelementptr inbounds double, double* %0, i64 2
%6 = load double, double* %5
%7 = getelementptr inbounds double, double* %1, i64 2
%8 = load double, double* %7
%9 = fadd double %6, %8
%10 = load double, double* %0
%11 = load double, double* %1
%12 = fadd double %10, %11
%13 = tail call double @log10_add_pow10(double %9, double %12)
%14 = getelementptr inbounds double, double* %0, i64 1
%15 = load double, double* %14
%16 = getelementptr inbounds double, double* %1, i64 1
%17 = load double, double* %16
%18 = fadd double %15, %17
%19 = tail call double @log10_add_pow10(double %13, double %18)
%20 = getelementptr inbounds double, double* %0, i64 3
%21 = load double, double* %20
%22 = getelementptr inbounds double, double* %1, i64 3
%23 = load double, double* %22
%24 = fadd double %21, %23
%25 = tail call double @log10(double %3)
%26 = fadd double %24, %25
%27 = tail call double @log10_add_pow10(double %19, double %26)
%28 = insertelement <2 x double> poison, double %12, i64 0
%29 = insertelement <2 x double> %28, double %18, i64 1
%30 = insertelement <2 x double> poison, double %27, i64 0
%31 = shufflevector <2 x double> %30, <2 x double> poison, <2 x i32> zeroinitializer
%32 = fsub <2 x double> %29, %31
%33 = bitcast double* %2 to <2 x double>*
store <2 x double> %32, <2 x double>* %33
%34 = getelementptr inbounds double, double* %2, i64 2
%35 = insertelement <2 x double> poison, double %9, i64 0
%36 = insertelement <2 x double> %35, double %26, i64 1
%37 = fsub <2 x double> %36, %31
%38 = bitcast double* %34 to <2 x double>*
store <2 x double> %37, <2 x double>* %38
ret double* %2
}