#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 pow(double, int);
double Cp_water(double T) {
  T = T - 273.15;
  if (T >= 0) {
    return 4.1289 + 9.0864e-5 * T - 5.4731e-6 * pow(T, 2);
  } else {
    return 4.1289 + 5.3062e-3 * T - 9.9516e-4 * pow(T, 2);
  }
}


x86 assembly (clang, -O0):
<Cp_water>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  0xed6(%rip),%xmm1
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jb     1195 <Cp_water+0x85>
movsd  -0x10(%rbp),%xmm0
movsd  0xed6(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xeba(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm0
mov    $0x2,%edi
call   1030 <pow@plt>
movsd  -0x18(%rbp),%xmm1
movsd  0xe9d(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    11e0 <Cp_water+0xd0>
movsd  -0x10(%rbp),%xmm0
movsd  0xe6e(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xe6a(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x10(%rbp),%xmm0
mov    $0x2,%edi
call   1030 <pow@plt>
movsd  -0x20(%rbp),%xmm1
movsd  0xe35(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Cp_water>:
push   %rax
addsd  0xee7(%rip),%xmm0
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jae    1150 <Cp_water+0x40>
movsd  0xef5(%rip),%xmm1
mulsd  %xmm0,%xmm1
addsd  0xed9(%rip),%xmm1
movsd  %xmm1,(%rsp)
mov    $0x2,%edi
call   1030 <pow@plt>
mulsd  0xeda(%rip),%xmm0
jmp    117b <Cp_water+0x6b>
movsd  0xeb0(%rip),%xmm1
mulsd  %xmm0,%xmm1
addsd  0xeac(%rip),%xmm1
movsd  %xmm1,(%rsp)
mov    $0x2,%edi
call   1030 <pow@plt>
mulsd  0xe9d(%rip),%xmm0
addsd  (%rsp),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @Cp_water(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %3
%4 = load double, double* %3
%5 = fsub double %4, 2.731500e+02
store double %5, double* %3
%6 = load double, double* %3
%7 = fcmp oge double %6, 0.000000e+00
br i1 %7, label %8, label %14
8: ; preds = %1
%9 = load double, double* %3
%10 = call double @llvm.fmuladd.f64(double 9.086400e-05, double %9, double 4.128900e+00)
%11 = load double, double* %3
%12 = call double @pow(double %11, i32 2)
%13 = call double @llvm.fmuladd.f64(double -5.473100e-06, double %12, double %10)
store double %13, double* %2
br label %20
14: ; preds = %1
%15 = load double, double* %3
%16 = call double @llvm.fmuladd.f64(double 5.306200e-03, double %15, double 4.128900e+00)
%17 = load double, double* %3
%18 = call double @pow(double %17, i32 2)
%19 = call double @llvm.fmuladd.f64(double -9.951600e-04, double %18, double %16)
store double %19, double* %2
br label %20
20: ; preds = %14, %8
%21 = load double, double* %2
ret double %21
}

LLVM IR (-O2):
define double @Cp_water(double %0) {
%2 = fadd double %0, -2.731500e+02
%3 = fcmp ult double %2, 0.000000e+00
br i1 %3, label %8, label %4
4: ; preds = %1
%5 = tail call double @llvm.fmuladd.f64(double %2, double 9.086400e-05, double 4.128900e+00)
%6 = tail call double @pow(double %2, i32 2)
%7 = tail call double @llvm.fmuladd.f64(double %6, double -5.473100e-06, double %5)
br label %12
8: ; preds = %1
%9 = tail call double @llvm.fmuladd.f64(double %2, double 5.306200e-03, double 4.128900e+00)
%10 = tail call double @pow(double %2, i32 2)
%11 = tail call double @llvm.fmuladd.f64(double %10, double -9.951600e-04, double %9)
br label %12
12: ; preds = %8, %4
%13 = phi double [ %7, %4 ], [ %11, %8 ]
ret double %13
}