#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 */
typedef double temperature;
typedef double pressure;

/* Variables and functions */
double _dsal(double, double);
double _sal(double, double);
double fabs(double);
double sqrt(double);
double conductivity(double salinity, double temperature, double pressure) {
  double corrected_temperature, rt, si, dels, rtt, cp, bt, r;
  int n = 0;
  corrected_temperature = temperature - 15.0;
  if (salinity <= 0.02)
    return 0.0;
  rt = sqrt(salinity / 35.0);
  si = _sal(rt, corrected_temperature);
  do {
    rt = rt + (salinity - si) / _dsal(rt, corrected_temperature);
    si = _sal(rt, corrected_temperature);
    dels = fabs(si - salinity);
    n++;
  } while (n < 10 && dels > 1.0e-4);
  rtt =
      ((((1.0031e-9 * (temperature)-6.9698e-7) * (temperature) + 1.104259e-4) *
            (temperature) +
        2.00564e-2) *
           (temperature) +
       0.6766097) *
      rt * rt;
  cp = rtt * ((((3.989e-15 * (pressure)-6.370e-10) * (pressure) + 2.070e-5) *
               (pressure)) +
              ((4.464e-4 * (temperature) + 3.426e-2) * (temperature) + 1.0));
  bt = ((4.464e-4 * (temperature) + 3.426e-2) * (temperature) + 1.0) -
       rtt * (-3.107E-3 * (temperature) + 0.4215);
  r = sqrt(fabs(bt * bt + 4.0 * (-3.107E-3 * (temperature) + 0.4215) * cp)) -
      bt;
  return 0.5 * r / (-3.107E-3 * (temperature) + 0.4215);
}


x86 assembly (clang, -O0):
<conductivity>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
movsd  %xmm2,-0x20(%rbp)
movl   $0x0,-0x64(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  0xeaa(%rip),%xmm1
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  0xe91(%rip),%xmm0
ucomisd -0x10(%rbp),%xmm0
jb     1187 <conductivity+0x57>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    144f <conductivity+0x31f>
movsd  -0x10(%rbp),%xmm0
movsd  0xe7c(%rip),%xmm1
divsd  %xmm1,%xmm0
call   1050 <sqrt@plt>
movsd  %xmm0,-0x30(%rbp)
movsd  -0x30(%rbp),%xmm0
movsd  -0x28(%rbp),%xmm1
call   1040 <_sal@plt>
movsd  %xmm0,-0x38(%rbp)
movsd  -0x30(%rbp),%xmm0
movsd  %xmm0,-0x70(%rbp)
movsd  -0x10(%rbp),%xmm0
subsd  -0x38(%rbp),%xmm0
movsd  %xmm0,-0x78(%rbp)
movsd  -0x30(%rbp),%xmm0
movsd  -0x28(%rbp),%xmm1
call   1030 <_dsal@plt>
movsd  -0x78(%rbp),%xmm1
movaps %xmm0,%xmm2
movsd  -0x70(%rbp),%xmm0
divsd  %xmm2,%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x30(%rbp),%xmm0
movsd  -0x28(%rbp),%xmm1
call   1040 <_sal@plt>
movsd  %xmm0,-0x38(%rbp)
movsd  -0x38(%rbp),%xmm0
subsd  -0x10(%rbp),%xmm0
movaps 0xe83(%rip),%xmm1
pand   %xmm1,%xmm0
movsd  %xmm0,-0x40(%rbp)
mov    -0x64(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x64(%rbp)
xor    %eax,%eax
cmpl   $0xa,-0x64(%rbp)
mov    %al,-0x79(%rbp)
jge    1255 <conductivity+0x125>
movsd  -0x40(%rbp),%xmm0
movsd  0xdcd(%rip),%xmm1
ucomisd %xmm1,%xmm0
seta   %al
mov    %al,-0x79(%rbp)
mov    -0x79(%rbp),%al
test   $0x1,%al
jne    11b6 <conductivity+0x86>
movsd  -0x18(%rbp),%xmm0
movsd  0xe1b(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xe17(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  -0x18(%rbp),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xdf2(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  -0x18(%rbp),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xdd5(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  -0x18(%rbp),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xdb8(%rip),%xmm1
addsd  %xmm1,%xmm0
mulsd  -0x30(%rbp),%xmm0
mulsd  -0x30(%rbp),%xmm0
movsd  %xmm0,-0x48(%rbp)
movsd  -0x48(%rbp),%xmm0
movsd  -0x20(%rbp),%xmm1
movsd  0xd83(%rip),%xmm2
mulsd  %xmm2,%xmm1
movsd  0xd7f(%rip),%xmm2
addsd  %xmm2,%xmm1
movsd  -0x20(%rbp),%xmm2
mulsd  %xmm2,%xmm1
movsd  0xd5a(%rip),%xmm2
addsd  %xmm2,%xmm1
movsd  -0x20(%rbp),%xmm3
movsd  -0x18(%rbp),%xmm2
movsd  0xd34(%rip),%xmm4
mulsd  %xmm4,%xmm2
movsd  0xd30(%rip),%xmm4
addsd  %xmm4,%xmm2
movsd  -0x18(%rbp),%xmm4
mulsd  %xmm4,%xmm2
movsd  0xd0b(%rip),%xmm4
addsd  %xmm4,%xmm2
mulsd  %xmm3,%xmm1
addsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x50(%rbp)
movsd  -0x18(%rbp),%xmm1
movsd  0xcf1(%rip),%xmm0
mulsd  %xmm0,%xmm1
movsd  0xced(%rip),%xmm0
addsd  %xmm0,%xmm1
movsd  -0x18(%rbp),%xmm0
mulsd  %xmm0,%xmm1
movsd  0xcc8(%rip),%xmm0
addsd  %xmm0,%xmm1
movsd  -0x48(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm2
movsd  0xc92(%rip),%xmm3
mulsd  %xmm3,%xmm2
movsd  0xc8e(%rip),%xmm3
addsd  %xmm3,%xmm2
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x58(%rbp)
movsd  -0x58(%rbp),%xmm0
movsd  -0x58(%rbp),%xmm2
movsd  -0x18(%rbp),%xmm3
movsd  0xc47(%rip),%xmm1
mulsd  %xmm1,%xmm3
movsd  0xc43(%rip),%xmm1
addsd  %xmm1,%xmm3
movsd  0xc47(%rip),%xmm1
mulsd  %xmm3,%xmm1
mulsd  -0x50(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movaps 0xc97(%rip),%xmm1
pand   %xmm1,%xmm0
call   1050 <sqrt@plt>
subsd  -0x58(%rbp),%xmm0
movsd  %xmm0,-0x60(%rbp)
movsd  0xc0c(%rip),%xmm0
mulsd  -0x60(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
movsd  0xbea(%rip),%xmm2
mulsd  %xmm2,%xmm1
movsd  0xbe6(%rip),%xmm2
addsd  %xmm2,%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<conductivity>:
push   %rbx
sub    $0x50,%rsp
movapd %xmm0,%xmm4
xorpd  %xmm0,%xmm0
movsd  0xec3(%rip),%xmm3
ucomisd %xmm4,%xmm3
jae    1346 <conductivity+0x216>
movaps %xmm2,0x30(%rsp)
movsd  0xea4(%rip),%xmm2
movsd  %xmm4,0x20(%rsp)
divsd  0xea6(%rip),%xmm4
movapd %xmm1,0x40(%rsp)
addsd  %xmm1,%xmm2
movsd  %xmm2,0x10(%rsp)
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm4
jb     118d <conductivity+0x5d>
xorps  %xmm0,%xmm0
sqrtsd %xmm4,%xmm0
jmp    1196 <conductivity+0x66>
movapd %xmm4,%xmm0
call   1050 <sqrt@plt>
movsd  %xmm0,(%rsp)
movsd  0x10(%rsp),%xmm1
call   1040 <_sal@plt>
xor    %ebx,%ebx
movsd  0x20(%rsp),%xmm2
xchg   %ax,%ax
movsd  (%rsp),%xmm1
movsd  %xmm1,0x28(%rsp)
subsd  %xmm0,%xmm2
movsd  %xmm2,(%rsp)
movapd %xmm1,%xmm0
movsd  0x10(%rsp),%xmm1
call   1030 <_dsal@plt>
movsd  (%rsp),%xmm1
divsd  %xmm0,%xmm1
addsd  0x28(%rsp),%xmm1
movsd  %xmm1,(%rsp)
movapd %xmm1,%xmm0
movsd  0x10(%rsp),%xmm1
call   1040 <_sal@plt>
movsd  0x20(%rsp),%xmm2
cmp    $0x8,%ebx
ja     121e <conductivity+0xee>
movapd %xmm0,%xmm1
subsd  %xmm2,%xmm1
andpd  0xe6f(%rip),%xmm1
add    $0x1,%ebx
ucomisd 0xdfc(%rip),%xmm1
ja     11b0 <conductivity+0x80>
movsd  0xdfa(%rip),%xmm0
movapd 0x40(%rsp),%xmm2
mulsd  %xmm2,%xmm0
addsd  0xdf0(%rip),%xmm0
mulsd  %xmm2,%xmm0
addsd  0xdec(%rip),%xmm0
mulsd  %xmm2,%xmm0
addsd  0xde8(%rip),%xmm0
mulsd  %xmm2,%xmm0
addsd  0xde4(%rip),%xmm0
movsd  (%rsp),%xmm1
mulsd  %xmm1,%xmm0
mulsd  %xmm1,%xmm0
movsd  0xdd7(%rip),%xmm1
movapd 0x30(%rsp),%xmm3
mulsd  %xmm3,%xmm1
addsd  0xdcd(%rip),%xmm1
mulsd  %xmm3,%xmm1
addsd  0xdc9(%rip),%xmm1
movsd  0xdc9(%rip),%xmm4
mulsd  %xmm2,%xmm4
addsd  0xdc5(%rip),%xmm4
mulsd  %xmm2,%xmm4
addsd  0xdc1(%rip),%xmm4
unpcklpd %xmm1,%xmm2
movapd 0xdd5(%rip),%xmm1
unpcklpd %xmm3,%xmm1
mulpd  %xmm2,%xmm1
movapd 0xdd5(%rip),%xmm3
unpcklpd %xmm4,%xmm3
addpd  %xmm1,%xmm3
movapd 0xdd5(%rip),%xmm1
unpcklpd %xmm0,%xmm1
mulsd  %xmm3,%xmm0
subsd  %xmm0,%xmm4
mulpd  %xmm3,%xmm1
movapd %xmm1,%xmm2
unpckhpd %xmm1,%xmm2
mulsd  %xmm1,%xmm2
movapd %xmm4,%xmm0
mulsd  %xmm4,%xmm0
addsd  %xmm2,%xmm0
andpd  0xd75(%rip),%xmm0
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jb     131b <conductivity+0x1eb>
sqrtsd %xmm0,%xmm0
jmp    1336 <conductivity+0x206>
movapd %xmm4,(%rsp)
movapd %xmm3,0x10(%rsp)
call   1050 <sqrt@plt>
movapd 0x10(%rsp),%xmm3
movapd (%rsp),%xmm4
subsd  %xmm4,%xmm0
mulsd  0xd36(%rip),%xmm0
divsd  %xmm3,%xmm0
add    $0x50,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define double @conductivity(double %0, double %1, double %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca double
%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 i32
store double %0, double* %5
store double %1, double* %6
store double %2, double* %7
store i32 0, i32* %16
%17 = load double, double* %6
%18 = fsub double %17, 1.500000e+01
store double %18, double* %8
%19 = load double, double* %5
%20 = fcmp ole double %19, 2.000000e-02
br i1 %20, label %21, label %22
21: ; preds = %3
store double 0.000000e+00, double* %4
br label %107
22: ; preds = %3
%23 = load double, double* %5
%24 = fdiv double %23, 3.500000e+01
%25 = call double @sqrt(double %24)
store double %25, double* %9
%26 = load double, double* %9
%27 = load double, double* %8
%28 = call double @_sal(double %26, double %27)
store double %28, double* %10
br label %29
29: ; preds = %54, %22
%30 = load double, double* %9
%31 = load double, double* %5
%32 = load double, double* %10
%33 = fsub double %31, %32
%34 = load double, double* %9
%35 = load double, double* %8
%36 = call double @_dsal(double %34, double %35)
%37 = fdiv double %33, %36
%38 = fadd double %30, %37
store double %38, double* %9
%39 = load double, double* %9
%40 = load double, double* %8
%41 = call double @_sal(double %39, double %40)
store double %41, double* %10
%42 = load double, double* %10
%43 = load double, double* %5
%44 = fsub double %42, %43
%45 = call double @llvm.fabs.f64(double %44)
store double %45, double* %11
%46 = load i32, i32* %16
%47 = add nsw i32 %46, 1
store i32 %47, i32* %16
br label %48
48: ; preds = %29
%49 = load i32, i32* %16
%50 = icmp slt i32 %49, 10
br i1 %50, label %51, label %54
51: ; preds = %48
%52 = load double, double* %11
%53 = fcmp ogt double %52, 1.000000e-04
br label %54
54: ; preds = %51, %48
%55 = phi i1 [ false, %48 ], [ %53, %51 ]
br i1 %55, label %29, label %56
56: ; preds = %54
%57 = load double, double* %6
%58 = call double @llvm.fmuladd.f64(double 1.003100e-09, double %57, double -6.969800e-07)
%59 = load double, double* %6
%60 = call double @llvm.fmuladd.f64(double %58, double %59, double 0x3F1CF28E843B034E)
%61 = load double, double* %6
%62 = call double @llvm.fmuladd.f64(double %60, double %61, double 2.005640e-02)
%63 = load double, double* %6
%64 = call double @llvm.fmuladd.f64(double %62, double %63, double 0x3FE5A6C962B500FE)
%65 = load double, double* %9
%66 = fmul double %64, %65
%67 = load double, double* %9
%68 = fmul double %66, %67
store double %68, double* %12
%69 = load double, double* %12
%70 = load double, double* %7
%71 = call double @llvm.fmuladd.f64(double 3.989000e-15, double %70, double -6.370000e-10)
%72 = load double, double* %7
%73 = call double @llvm.fmuladd.f64(double %71, double %72, double 2.070000e-05)
%74 = load double, double* %7
%75 = load double, double* %6
%76 = call double @llvm.fmuladd.f64(double 4.464000e-04, double %75, double 3.426000e-02)
%77 = load double, double* %6
%78 = call double @llvm.fmuladd.f64(double %76, double %77, double 1.000000e+00)
%79 = call double @llvm.fmuladd.f64(double %73, double %74, double %78)
%80 = fmul double %69, %79
store double %80, double* %13
%81 = load double, double* %6
%82 = call double @llvm.fmuladd.f64(double 4.464000e-04, double %81, double 3.426000e-02)
%83 = load double, double* %6
%84 = call double @llvm.fmuladd.f64(double %82, double %83, double 1.000000e+00)
%85 = load double, double* %12
%86 = load double, double* %6
%87 = call double @llvm.fmuladd.f64(double -3.107000e-03, double %86, double 4.215000e-01)
%88 = fneg double %85
%89 = call double @llvm.fmuladd.f64(double %88, double %87, double %84)
store double %89, double* %14
%90 = load double, double* %14
%91 = load double, double* %14
%92 = load double, double* %6
%93 = call double @llvm.fmuladd.f64(double -3.107000e-03, double %92, double 4.215000e-01)
%94 = fmul double 4.000000e+00, %93
%95 = load double, double* %13
%96 = fmul double %94, %95
%97 = call double @llvm.fmuladd.f64(double %90, double %91, double %96)
%98 = call double @llvm.fabs.f64(double %97)
%99 = call double @sqrt(double %98)
%100 = load double, double* %14
%101 = fsub double %99, %100
store double %101, double* %15
%102 = load double, double* %15
%103 = fmul double 5.000000e-01, %102
%104 = load double, double* %6
%105 = call double @llvm.fmuladd.f64(double -3.107000e-03, double %104, double 4.215000e-01)
%106 = fdiv double %103, %105
store double %106, double* %4
br label %107
107: ; preds = %56, %21
%108 = load double, double* %4
ret double %108
}

LLVM IR (-O2):
define double @conductivity(double %0, double %1, double %2) {
%4 = fadd double %1, -1.500000e+01
%5 = fcmp ugt double %0, 2.000000e-02
br i1 %5, label %6, label %55
6: ; preds = %3
%7 = fdiv double %0, 3.500000e+01
%8 = tail call double @sqrt(double %7)
%9 = tail call double @_sal(double %8, double %4)
br label %10
10: ; preds = %10, %6
%11 = phi double [ %9, %6 ], [ %18, %10 ]
%12 = phi double [ %8, %6 ], [ %17, %10 ]
%13 = phi i32 [ 0, %6 ], [ %21, %10 ]
%14 = fsub double %0, %11
%15 = tail call double @_dsal(double %12, double %4)
%16 = fdiv double %14, %15
%17 = fadd double %12, %16
%18 = tail call double @_sal(double %17, double %4)
%19 = fsub double %18, %0
%20 = tail call double @llvm.fabs.f64(double %19)
%21 = add nuw nsw i32 %13, 1
%22 = icmp ult i32 %13, 9
%23 = fcmp ogt double %20, 1.000000e-04
%24 = select i1 %22, i1 %23, i1 false
br i1 %24, label %10, label %25
25: ; preds = %10
%26 = tail call double @llvm.fmuladd.f64(double %1, double 1.003100e-09, double -6.969800e-07)
%27 = tail call double @llvm.fmuladd.f64(double %26, double %1, double 0x3F1CF28E843B034E)
%28 = tail call double @llvm.fmuladd.f64(double %27, double %1, double 2.005640e-02)
%29 = tail call double @llvm.fmuladd.f64(double %28, double %1, double 0x3FE5A6C962B500FE)
%30 = fmul double %29, %17
%31 = fmul double %17, %30
%32 = tail call double @llvm.fmuladd.f64(double %2, double 3.989000e-15, double -6.370000e-10)
%33 = tail call double @llvm.fmuladd.f64(double %32, double %2, double 2.070000e-05)
%34 = tail call double @llvm.fmuladd.f64(double %1, double 4.464000e-04, double 3.426000e-02)
%35 = tail call double @llvm.fmuladd.f64(double %34, double %1, double 1.000000e+00)
%36 = insertelement <2 x double> poison, double %1, i64 0
%37 = insertelement <2 x double> %36, double %33, i64 1
%38 = insertelement <2 x double> <double -3.107000e-03, double poison>, double %2, i64 1
%39 = insertelement <2 x double> <double 4.215000e-01, double poison>, double %35, i64 1
%40 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %37, <2 x double> %38, <2 x double> %39)
%41 = fneg double %31
%42 = extractelement <2 x double> %40, i64 0
%43 = tail call double @llvm.fmuladd.f64(double %41, double %42, double %35)
%44 = insertelement <2 x double> <double 4.000000e+00, double poison>, double %31, i64 1
%45 = fmul <2 x double> %40, %44
%46 = shufflevector <2 x double> %45, <2 x double> poison, <2 x i32> <i32 1, i32 undef>
%47 = fmul <2 x double> %45, %46
%48 = extractelement <2 x double> %47, i64 0
%49 = tail call double @llvm.fmuladd.f64(double %43, double %43, double %48)
%50 = tail call double @llvm.fabs.f64(double %49)
%51 = tail call double @sqrt(double %50)
%52 = fsub double %51, %43
%53 = fmul double %52, 5.000000e-01
%54 = fdiv double %53, %42
br label %55
55: ; preds = %3, %25
%56 = phi double [ %54, %25 ], [ 0.000000e+00, %3 ]
ret double %56
}