#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 gsw_enthalpy(double, double, double);
double gsw_specvol(double, double, double);
double gsw_internal_energy(double sa, double ct, double p) {
  double p0 = 101325e0, db2pa = 1e4;
  return (gsw_enthalpy(sa, ct, p) - (p0 + db2pa * p) * gsw_specvol(sa, ct, p));
}


x86 assembly (clang, -O0):
<gsw_internal_energy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  0xec9(%rip),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  0xeb4(%rip),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm2
call   1030 <gsw_enthalpy@plt>
movsd  %xmm0,-0x38(%rbp)
movsd  -0x20(%rbp),%xmm1
movsd  -0x28(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm2
call   1040 <gsw_specvol@plt>
movsd  -0x38(%rbp),%xmm1
movaps %xmm0,%xmm2
movsd  -0x30(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gsw_internal_energy>:
sub    $0x28,%rsp
movsd  %xmm2,(%rsp)
movsd  %xmm1,0x18(%rsp)
movsd  %xmm0,0x10(%rsp)
call   1030 <gsw_enthalpy@plt>
movsd  %xmm0,0x20(%rsp)
movsd  0xeb8(%rip),%xmm0
movsd  (%rsp),%xmm2
mulsd  %xmm2,%xmm0
addsd  0xeaf(%rip),%xmm0
movsd  %xmm0,0x8(%rsp)
movsd  0x10(%rsp),%xmm0
movsd  0x18(%rsp),%xmm1
call   1040 <gsw_specvol@plt>
mulsd  0x8(%rsp),%xmm0
movsd  0x20(%rsp),%xmm1
subsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
add    $0x28,%rsp
ret

LLVM IR (-O0):
define double @gsw_internal_energy(double %0, double %1, double %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca double
%7 = alloca double
%8 = alloca double
store double %0, double* %4
store double %1, double* %5
store double %2, double* %6
store double 1.013250e+05, double* %7
store double 1.000000e+04, double* %8
%9 = load double, double* %4
%10 = load double, double* %5
%11 = load double, double* %6
%12 = call double @gsw_enthalpy(double %9, double %10, double %11)
%13 = load double, double* %7
%14 = load double, double* %8
%15 = load double, double* %6
%16 = call double @llvm.fmuladd.f64(double %14, double %15, double %13)
%17 = load double, double* %4
%18 = load double, double* %5
%19 = load double, double* %6
%20 = call double @gsw_specvol(double %17, double %18, double %19)
%21 = fneg double %16
%22 = call double @llvm.fmuladd.f64(double %21, double %20, double %12)
ret double %22
}

LLVM IR (-O2):
define double @gsw_internal_energy(double %0, double %1, double %2) {
%4 = tail call double @gsw_enthalpy(double %0, double %1, double %2)
%5 = tail call double @llvm.fmuladd.f64(double %2, double 1.000000e+04, double 1.013250e+05)
%6 = tail call double @gsw_specvol(double %0, double %1, double %2)
%7 = fneg double %5
%8 = tail call double @llvm.fmuladd.f64(double %7, double %6, double %4)
ret double %8
}