#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 cpm_c(double);
double exner_c(double);
double pd_c(double, double, double);
double pv_c(double, double, double);
double sd_c(double const, double);
double sv_c(double const, double);
double entropyflux_from_thetaflux_qtflux(double thetaflux, double qtflux,
                                         double p0_b, double T_b, double qt_b,
                                         double qv_b) {
  const double exner_b = exner_c(p0_b);
  const double pd_b = pd_c(p0_b, qt_b, qv_b);
  const double pv_b = pv_c(p0_b, qt_b, qv_b);
  const double sd_b = sd_c(pd_b, T_b);
  const double sv_b = sv_c(pv_b, T_b);
  const double cp_b = cpm_c(qt_b);
  double entropyflux =
      cp_b * thetaflux * exner_b / T_b + qtflux * (sv_b - sd_b);
  return entropyflux;
}


x86 assembly (clang, -O0):
<entropyflux_from_thetaflux_qtflux>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  %xmm3,-0x20(%rbp)
movsd  %xmm4,-0x28(%rbp)
movsd  %xmm5,-0x30(%rbp)
movsd  -0x18(%rbp),%xmm0
call   1080 <exner_c@plt>
movsd  %xmm0,-0x38(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  -0x28(%rbp),%xmm1
movsd  -0x30(%rbp),%xmm2
call   1070 <pd_c@plt>
movsd  %xmm0,-0x40(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  -0x28(%rbp),%xmm1
movsd  -0x30(%rbp),%xmm2
call   1030 <pv_c@plt>
movsd  %xmm0,-0x48(%rbp)
movsd  -0x40(%rbp),%xmm0
movsd  -0x20(%rbp),%xmm1
call   1050 <sd_c@plt>
movsd  %xmm0,-0x50(%rbp)
movsd  -0x48(%rbp),%xmm0
movsd  -0x20(%rbp),%xmm1
call   1060 <sv_c@plt>
movsd  %xmm0,-0x58(%rbp)
movsd  -0x28(%rbp),%xmm0
call   1040 <cpm_c@plt>
movsd  %xmm0,-0x60(%rbp)
movsd  -0x60(%rbp),%xmm1
mulsd  -0x8(%rbp),%xmm1
mulsd  -0x38(%rbp),%xmm1
divsd  -0x20(%rbp),%xmm1
movsd  -0x10(%rbp),%xmm0
movsd  -0x58(%rbp),%xmm2
subsd  -0x50(%rbp),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x68(%rbp)
movsd  -0x68(%rbp),%xmm0
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<entropyflux_from_thetaflux_qtflux>:
sub    $0x48,%rsp
movsd  %xmm5,0x10(%rsp)
movsd  %xmm4,0x18(%rsp)
movsd  %xmm3,0x20(%rsp)
movsd  %xmm2,0x8(%rsp)
movsd  %xmm1,0x40(%rsp)
movsd  %xmm0,0x38(%rsp)
movaps %xmm2,%xmm0
call   1080 <exner_c@plt>
movsd  %xmm0,0x30(%rsp)
movsd  0x8(%rsp),%xmm0
movsd  0x18(%rsp),%xmm1
movsd  0x10(%rsp),%xmm2
call   1070 <pd_c@plt>
movsd  %xmm0,0x28(%rsp)
movsd  0x8(%rsp),%xmm0
movsd  0x18(%rsp),%xmm1
movsd  0x10(%rsp),%xmm2
call   1030 <pv_c@plt>
movsd  %xmm0,0x8(%rsp)
movsd  0x28(%rsp),%xmm0
movsd  0x20(%rsp),%xmm1
call   1050 <sd_c@plt>
movsd  %xmm0,0x10(%rsp)
movsd  0x8(%rsp),%xmm0
movsd  0x20(%rsp),%xmm1
call   1060 <sv_c@plt>
movsd  %xmm0,0x8(%rsp)
movsd  0x18(%rsp),%xmm0
call   1040 <cpm_c@plt>
mulsd  0x38(%rsp),%xmm0
mulsd  0x30(%rsp),%xmm0
divsd  0x20(%rsp),%xmm0
movsd  0x8(%rsp),%xmm1
subsd  0x10(%rsp),%xmm1
mulsd  0x40(%rsp),%xmm1
addsd  %xmm1,%xmm0
add    $0x48,%rsp
ret

LLVM IR (-O0):
define double @entropyflux_from_thetaflux_qtflux(double %0, double %1, double %2, double %3, double %4, double %5) {
%7 = alloca double
%8 = alloca double
%9 = alloca double
%10 = alloca double
%11 = alloca double
%12 = alloca double
%13 = alloca double
%14 = alloca double
%15 = alloca double
%16 = alloca double
%17 = alloca double
%18 = alloca double
%19 = alloca double
store double %0, double* %7
store double %1, double* %8
store double %2, double* %9
store double %3, double* %10
store double %4, double* %11
store double %5, double* %12
%20 = load double, double* %9
%21 = call double @exner_c(double %20)
store double %21, double* %13
%22 = load double, double* %9
%23 = load double, double* %11
%24 = load double, double* %12
%25 = call double @pd_c(double %22, double %23, double %24)
store double %25, double* %14
%26 = load double, double* %9
%27 = load double, double* %11
%28 = load double, double* %12
%29 = call double @pv_c(double %26, double %27, double %28)
store double %29, double* %15
%30 = load double, double* %14
%31 = load double, double* %10
%32 = call double @sd_c(double %30, double %31)
store double %32, double* %16
%33 = load double, double* %15
%34 = load double, double* %10
%35 = call double @sv_c(double %33, double %34)
store double %35, double* %17
%36 = load double, double* %11
%37 = call double @cpm_c(double %36)
store double %37, double* %18
%38 = load double, double* %18
%39 = load double, double* %7
%40 = fmul double %38, %39
%41 = load double, double* %13
%42 = fmul double %40, %41
%43 = load double, double* %10
%44 = fdiv double %42, %43
%45 = load double, double* %8
%46 = load double, double* %17
%47 = load double, double* %16
%48 = fsub double %46, %47
%49 = call double @llvm.fmuladd.f64(double %45, double %48, double %44)
store double %49, double* %19
%50 = load double, double* %19
ret double %50
}

LLVM IR (-O2):
define double @entropyflux_from_thetaflux_qtflux(double %0, double %1, double %2, double %3, double %4, double %5) {
%7 = tail call double @exner_c(double %2)
%8 = tail call double @pd_c(double %2, double %4, double %5)
%9 = tail call double @pv_c(double %2, double %4, double %5)
%10 = tail call double @sd_c(double %8, double %3)
%11 = tail call double @sv_c(double %9, double %3)
%12 = tail call double @cpm_c(double %4)
%13 = fmul double %12, %0
%14 = fmul double %7, %13
%15 = fdiv double %14, %3
%16 = fsub double %11, %10
%17 = tail call double @llvm.fmuladd.f64(double %1, double %16, double %15)
ret double %17
}