#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_saar(double, double, double);
double gsw_fdelta(double p, double lon, double lat) {
  double sa, saar;
  saar = gsw_saar(p, lon, lat);
  sa = ((1.0 + 0.35) * saar) / (1.0 - 0.35 * saar);
  if (saar > 1e10)
    sa = 9e15;
  else
    sa = ((1.0 + 0.35) * saar) / (1.0 - 0.35 * saar);
  return (sa);
}


x86 assembly (clang, -O0):
<gsw_fdelta>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm2
call   1030 <gsw_saar@plt>
movsd  %xmm0,-0x28(%rbp)
movsd  0xed0(%rip),%xmm0
mulsd  -0x28(%rbp),%xmm0
movsd  -0x28(%rbp),%xmm1
movsd  0xeae(%rip),%xmm2
mulsd  %xmm2,%xmm1
movsd  0xeaa(%rip),%xmm2
addsd  %xmm2,%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x28(%rbp),%xmm0
movsd  0xe80(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    119c <gsw_fdelta+0x8c>
movsd  0xe8e(%rip),%xmm0
movsd  %xmm0,-0x20(%rbp)
jmp    11cf <gsw_fdelta+0xbf>
movsd  0xe74(%rip),%xmm0
mulsd  -0x28(%rbp),%xmm0
movsd  -0x28(%rbp),%xmm1
movsd  0xe52(%rip),%xmm2
mulsd  %xmm2,%xmm1
movsd  0xe4e(%rip),%xmm2
addsd  %xmm2,%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gsw_fdelta>:
push   %rax
call   1030 <gsw_saar@plt>
ucomisd 0xeea(%rip),%xmm0
jbe    112a <gsw_fdelta+0x1a>
movsd  0xed8(%rip),%xmm0
pop    %rax
ret
movsd  0xede(%rip),%xmm1
mulsd  %xmm0,%xmm1
addsd  0xeda(%rip),%xmm1
mulsd  0xeda(%rip),%xmm0
divsd  %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @gsw_fdelta(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
%9 = load double, double* %4
%10 = load double, double* %5
%11 = load double, double* %6
%12 = call double @gsw_saar(double %9, double %10, double %11)
store double %12, double* %8
%13 = load double, double* %8
%14 = fmul double 1.350000e+00, %13
%15 = load double, double* %8
%16 = call double @llvm.fmuladd.f64(double -3.500000e-01, double %15, double 1.000000e+00)
%17 = fdiv double %14, %16
store double %17, double* %7
%18 = load double, double* %8
%19 = fcmp ogt double %18, 1.000000e+10
br i1 %19, label %20, label %21
20: ; preds = %3
store double 9.000000e+15, double* %7
br label %27
21: ; preds = %3
%22 = load double, double* %8
%23 = fmul double 1.350000e+00, %22
%24 = load double, double* %8
%25 = call double @llvm.fmuladd.f64(double -3.500000e-01, double %24, double 1.000000e+00)
%26 = fdiv double %23, %25
store double %26, double* %7
br label %27
27: ; preds = %21, %20
%28 = load double, double* %7
ret double %28
}

LLVM IR (-O2):
define double @gsw_fdelta(double %0, double %1, double %2) {
%4 = tail call double @gsw_saar(double %0, double %1, double %2)
%5 = fcmp ogt double %4, 1.000000e+10
br i1 %5, label %10, label %6
6: ; preds = %3
%7 = tail call double @llvm.fmuladd.f64(double %4, double -3.500000e-01, double 1.000000e+00)
%8 = fmul double %4, 1.350000e+00
%9 = fdiv double %8, %7
br label %10
10: ; preds = %3, %6
%11 = phi double [ %9, %6 ], [ 9.000000e+15, %3 ]
ret double %11
}