#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 const);
double const exp(double const);
double pd_c(double const, double const, double const);
double const pow(double, double const);
double pv_c(double const, double const, double const);
double thetas_t_c(const double p0, const double T, const double qt,
                  const double qv, const double qc, const double L) {
  const double qd = 1.0 - qt;
  const double pd = pd_c(p0, qt, qt - qc);
  const double pv = pv_c(p0, qt, qt - qc);
  const double cpm = cpm_c(qt);
  return T * pow(100000.0 / pd, qd * 287.1 / cpm) *
         pow(100000.0 / pv, qt * 461.5 / cpm) * exp(-L * qc / (cpm * T));
}


x86 assembly (clang, -O0):
<thetas_t_c>:
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  0xe9a(%rip),%xmm0
subsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm2
subsd  -0x28(%rbp),%xmm2
call   1070 <pd_c@plt>
movsd  %xmm0,-0x40(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm2
subsd  -0x28(%rbp),%xmm2
call   1030 <pv_c@plt>
movsd  %xmm0,-0x48(%rbp)
movsd  -0x18(%rbp),%xmm0
call   1040 <cpm_c@plt>
movsd  %xmm0,-0x50(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x68(%rbp)
movsd  0xe23(%rip),%xmm0
divsd  -0x40(%rbp),%xmm0
movsd  0xe1e(%rip),%xmm1
mulsd  -0x38(%rbp),%xmm1
divsd  -0x50(%rbp),%xmm1
call   1060 <pow@plt>
movaps %xmm0,%xmm1
movsd  -0x68(%rbp),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x60(%rbp)
movsd  0xdee(%rip),%xmm0
divsd  -0x48(%rbp),%xmm0
movsd  0xdd9(%rip),%xmm1
mulsd  -0x18(%rbp),%xmm1
divsd  -0x50(%rbp),%xmm1
call   1060 <pow@plt>
movaps %xmm0,%xmm1
movsd  -0x60(%rbp),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x58(%rbp)
movsd  -0x30(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  -0x28(%rbp),%xmm0
movsd  -0x50(%rbp),%xmm1
mulsd  -0x10(%rbp),%xmm1
divsd  %xmm1,%xmm0
call   1050 <exp@plt>
movaps %xmm0,%xmm1
movsd  -0x58(%rbp),%xmm0
mulsd  %xmm1,%xmm0
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<thetas_t_c>:
sub    $0x58,%rsp
movaps %xmm5,0x40(%rsp)
movsd  %xmm4,0x38(%rsp)
movsd  %xmm1,0x28(%rsp)
movsd  %xmm0,0x10(%rsp)
movsd  0xe8d(%rip),%xmm1
subsd  %xmm2,%xmm1
movsd  %xmm1,0x20(%rsp)
movapd %xmm2,%xmm1
movsd  %xmm2,0x8(%rsp)
subsd  %xmm4,%xmm2
movsd  %xmm2,0x18(%rsp)
call   1070 <pd_c@plt>
movsd  %xmm0,0x30(%rsp)
movsd  0x10(%rsp),%xmm0
movsd  0x8(%rsp),%xmm1
movsd  0x18(%rsp),%xmm2
call   1030 <pv_c@plt>
movsd  %xmm0,0x18(%rsp)
movsd  0x8(%rsp),%xmm0
call   1040 <cpm_c@plt>
movapd %xmm0,%xmm2
movsd  %xmm0,0x10(%rsp)
movsd  0xe32(%rip),%xmm0
divsd  0x30(%rsp),%xmm0
movsd  0x20(%rsp),%xmm1
mulsd  0xe26(%rip),%xmm1
divsd  %xmm2,%xmm1
call   1060 <pow@plt>
mulsd  0x28(%rsp),%xmm0
movsd  %xmm0,0x20(%rsp)
movsd  0xe01(%rip),%xmm0
divsd  0x18(%rsp),%xmm0
movsd  0x8(%rsp),%xmm1
mulsd  0xdfd(%rip),%xmm1
divsd  0x10(%rsp),%xmm1
call   1060 <pow@plt>
movapd 0x40(%rsp),%xmm2
xorpd  0xdec(%rip),%xmm2
mulsd  0x20(%rsp),%xmm0
movsd  %xmm0,0x8(%rsp)
mulsd  0x38(%rsp),%xmm2
movsd  0x10(%rsp),%xmm1
mulsd  0x28(%rsp),%xmm1
divsd  %xmm1,%xmm2
movapd %xmm2,%xmm0
call   1050 <exp@plt>
mulsd  0x8(%rsp),%xmm0
add    $0x58,%rsp
ret

LLVM IR (-O0):
define double @thetas_t_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
%15 = alloca double
%16 = 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
%17 = load double, double* %9
%18 = fsub double 1.000000e+00, %17
store double %18, double* %13
%19 = load double, double* %7
%20 = load double, double* %9
%21 = load double, double* %9
%22 = load double, double* %11
%23 = fsub double %21, %22
%24 = call double @pd_c(double %19, double %20, double %23)
store double %24, double* %14
%25 = load double, double* %7
%26 = load double, double* %9
%27 = load double, double* %9
%28 = load double, double* %11
%29 = fsub double %27, %28
%30 = call double @pv_c(double %25, double %26, double %29)
store double %30, double* %15
%31 = load double, double* %9
%32 = call double @cpm_c(double %31)
store double %32, double* %16
%33 = load double, double* %8
%34 = load double, double* %14
%35 = fdiv double 1.000000e+05, %34
%36 = load double, double* %13
%37 = fmul double %36, 2.871000e+02
%38 = load double, double* %16
%39 = fdiv double %37, %38
%40 = call double @pow(double %35, double %39)
%41 = fmul double %33, %40
%42 = load double, double* %15
%43 = fdiv double 1.000000e+05, %42
%44 = load double, double* %9
%45 = fmul double %44, 4.615000e+02
%46 = load double, double* %16
%47 = fdiv double %45, %46
%48 = call double @pow(double %43, double %47)
%49 = fmul double %41, %48
%50 = load double, double* %12
%51 = fneg double %50
%52 = load double, double* %11
%53 = fmul double %51, %52
%54 = load double, double* %16
%55 = load double, double* %8
%56 = fmul double %54, %55
%57 = fdiv double %53, %56
%58 = call double @exp(double %57)
%59 = fmul double %49, %58
ret double %59
}

LLVM IR (-O2):
define double @thetas_t_c(double %0, double %1, double %2, double %3, double %4, double %5) {
%7 = fsub double 1.000000e+00, %2
%8 = fsub double %2, %4
%9 = tail call double @pd_c(double %0, double %2, double %8)
%10 = tail call double @pv_c(double %0, double %2, double %8)
%11 = tail call double @cpm_c(double %2)
%12 = fdiv double 1.000000e+05, %9
%13 = fmul double %7, 2.871000e+02
%14 = fdiv double %13, %11
%15 = tail call double @pow(double %12, double %14)
%16 = fmul double %15, %1
%17 = fdiv double 1.000000e+05, %10
%18 = fmul double %2, 4.615000e+02
%19 = fdiv double %18, %11
%20 = tail call double @pow(double %17, double %19)
%21 = fmul double %16, %20
%22 = fneg double %5
%23 = fmul double %22, %4
%24 = fmul double %11, %1
%25 = fdiv double %23, %24
%26 = tail call double @exp(double %25)
%27 = fmul double %21, %26
ret double %27
}