#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 exp(double);
double svp(double temp) {
  double SVP;
  SVP = 0.61078 * exp((17.269 * temp) / (237.3 + temp));
  if (temp < 0)
    SVP *= 1.0 + .00972 * temp + .000042 * temp * temp;
  return (SVP * 1000.);
}


x86 assembly (clang, -O0):
<svp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  0xeeb(%rip),%xmm0
mulsd  -0x8(%rbp),%xmm0
movsd  0xed6(%rip),%xmm1
addsd  -0x8(%rbp),%xmm1
divsd  %xmm1,%xmm0
call   1030 <exp@plt>
movaps %xmm0,%xmm1
movsd  0xeb5(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
xorps  %xmm0,%xmm0
ucomisd -0x8(%rbp),%xmm0
jbe    11a3 <svp+0x93>
movsd  -0x8(%rbp),%xmm1
movsd  0xeb1(%rip),%xmm0
mulsd  %xmm0,%xmm1
movsd  0xead(%rip),%xmm0
addsd  %xmm0,%xmm1
movsd  0xe91(%rip),%xmm0
mulsd  -0x8(%rbp),%xmm0
movsd  -0x8(%rbp),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mulsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  0xe85(%rip),%xmm0
mulsd  -0x10(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<svp>:
push   %rax
movapd %xmm0,%xmm2
movsd  %xmm0,(%rsp)
movsd  0xede(%rip),%xmm0
mulsd  %xmm2,%xmm0
movsd  0xeda(%rip),%xmm1
addsd  %xmm2,%xmm1
divsd  %xmm1,%xmm0
call   1030 <exp@plt>
movsd  (%rsp),%xmm3
mulsd  0xec8(%rip),%xmm0
xorpd  %xmm1,%xmm1
ucomisd %xmm3,%xmm1
jbe    117e <svp+0x6e>
movsd  0xebe(%rip),%xmm1
mulsd  %xmm3,%xmm1
addsd  0xeba(%rip),%xmm1
movsd  0xeba(%rip),%xmm2
mulsd  %xmm3,%xmm2
mulsd  %xmm3,%xmm2
addsd  %xmm1,%xmm2
mulsd  %xmm2,%xmm0
mulsd  0xeaa(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @svp(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %2
%4 = load double, double* %2
%5 = fmul double 1.726900e+01, %4
%6 = load double, double* %2
%7 = fadd double 2.373000e+02, %6
%8 = fdiv double %5, %7
%9 = call double @exp(double %8)
%10 = fmul double 6.107800e-01, %9
store double %10, double* %3
%11 = load double, double* %2
%12 = fcmp olt double %11, 0.000000e+00
br i1 %12, label %13, label %22
13: ; preds = %1
%14 = load double, double* %2
%15 = call double @llvm.fmuladd.f64(double 0x3F83E81450EFDC9C, double %14, double 1.000000e+00)
%16 = load double, double* %2
%17 = fmul double 4.200000e-05, %16
%18 = load double, double* %2
%19 = call double @llvm.fmuladd.f64(double %17, double %18, double %15)
%20 = load double, double* %3
%21 = fmul double %20, %19
store double %21, double* %3
br label %22
22: ; preds = %13, %1
%23 = load double, double* %3
%24 = fmul double %23, 1.000000e+03
ret double %24
}

LLVM IR (-O2):
define double @svp(double %0) {
%2 = fmul double %0, 1.726900e+01
%3 = fadd double %0, 2.373000e+02
%4 = fdiv double %2, %3
%5 = tail call double @exp(double %4)
%6 = fmul double %5, 6.107800e-01
%7 = fcmp olt double %0, 0.000000e+00
br i1 %7, label %8, label %13
8: ; preds = %1
%9 = tail call double @llvm.fmuladd.f64(double %0, double 0x3F83E81450EFDC9C, double 1.000000e+00)
%10 = fmul double %0, 4.200000e-05
%11 = tail call double @llvm.fmuladd.f64(double %10, double %0, double %9)
%12 = fmul double %11, %6
br label %13
13: ; preds = %8, %1
%14 = phi double [ %12, %8 ], [ %6, %1 ]
%15 = fmul double %14, 1.000000e+03
ret double %15
}