#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 pd_c(double, double, double);
double pv_c(double, double, double);
double sd_c(double const, double);
double sv_c(double const, double);
double s_tendency_c(double p0, double qt, double qv, double T,
                    double qt_tendency, double T_tendency) {
  const double pv = pv_c(p0, qt, qv);
  const double pd = pd_c(p0, qt, qv);
  return cpm_c(qt) * T_tendency / T + (sv_c(pv, T) - sd_c(pd, T)) * qt_tendency;
}


x86 assembly (clang, -O0):
<s_tendency_c>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%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  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm2
call   1030 <pv_c@plt>
movsd  %xmm0,-0x38(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm2
call   1070 <pd_c@plt>
movsd  %xmm0,-0x40(%rbp)
movsd  -0x10(%rbp),%xmm0
call   1040 <cpm_c@plt>
mulsd  -0x30(%rbp),%xmm0
divsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x50(%rbp)
movsd  -0x38(%rbp),%xmm0
movsd  -0x20(%rbp),%xmm1
call   1060 <sv_c@plt>
movsd  %xmm0,-0x48(%rbp)
movsd  -0x40(%rbp),%xmm0
movsd  -0x20(%rbp),%xmm1
call   1050 <sd_c@plt>
movsd  -0x50(%rbp),%xmm1
movaps %xmm0,%xmm2
movsd  -0x48(%rbp),%xmm0
subsd  %xmm2,%xmm0
movsd  -0x28(%rbp),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
add    $0x50,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define double @s_tendency_c(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
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
%15 = load double, double* %7
%16 = load double, double* %8
%17 = load double, double* %9
%18 = call double @pv_c(double %15, double %16, double %17)
store double %18, double* %13
%19 = load double, double* %7
%20 = load double, double* %8
%21 = load double, double* %9
%22 = call double @pd_c(double %19, double %20, double %21)
store double %22, double* %14
%23 = load double, double* %8
%24 = call double @cpm_c(double %23)
%25 = load double, double* %12
%26 = fmul double %24, %25
%27 = load double, double* %10
%28 = fdiv double %26, %27
%29 = load double, double* %13
%30 = load double, double* %10
%31 = call double @sv_c(double %29, double %30)
%32 = load double, double* %14
%33 = load double, double* %10
%34 = call double @sd_c(double %32, double %33)
%35 = fsub double %31, %34
%36 = load double, double* %11
%37 = call double @llvm.fmuladd.f64(double %35, double %36, double %28)
ret double %37
}

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