#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 sin(double);
double depth(double pressure, double latitude) {
  double x, gr, depth;
  x = sin(latitude / 57.29578);
  x = x * x;
  gr = 9.780318 * (1.0 + (5.2788e-3 + 2.36e-5 * x) * x) + 1.092e-6 * pressure;
  depth =
      (((-1.82e-15 * pressure + 2.279e-10) * pressure - 2.2512e-5) * pressure +
       9.72659) *
      pressure;
  return depth / gr;
}


x86 assembly (clang, -O0):
<depth>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  0xf19(%rip),%xmm1
divsd  %xmm1,%xmm0
call   1030 <sin@plt>
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
mulsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  0xedf(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xedb(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  -0x18(%rbp),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xeb6(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  0xea2(%rip),%xmm1
mulsd  -0x8(%rbp),%xmm1
movsd  0xe8d(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xe63(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xe5f(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  -0x8(%rbp),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xe3a(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  -0x8(%rbp),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xe1d(%rip),%xmm1
addsd  %xmm1,%xmm0
mulsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x28(%rbp),%xmm0
divsd  -0x20(%rbp),%xmm0
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<depth>:
push   %rax
movsd  %xmm0,(%rsp)
divsd  0xee2(%rip),%xmm1
movapd %xmm1,%xmm0
call   1030 <sin@plt>
mulsd  %xmm0,%xmm0
movsd  0xed5(%rip),%xmm1
mulsd  %xmm0,%xmm1
addsd  0xed1(%rip),%xmm1
mulsd  %xmm0,%xmm1
addsd  0xecd(%rip),%xmm1
movsd  0xecd(%rip),%xmm0
movsd  (%rsp),%xmm2
mulsd  %xmm2,%xmm0
mulsd  0xec4(%rip),%xmm1
addsd  %xmm0,%xmm1
movsd  0xec0(%rip),%xmm0
mulsd  %xmm2,%xmm0
addsd  0xebc(%rip),%xmm0
mulsd  %xmm2,%xmm0
addsd  0xeb8(%rip),%xmm0
mulsd  %xmm2,%xmm0
addsd  0xeb4(%rip),%xmm0
mulsd  %xmm2,%xmm0
divsd  %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @depth(double %0, double %1) {
%3 = alloca double
%4 = alloca double
%5 = alloca double
%6 = alloca double
%7 = alloca double
store double %0, double* %3
store double %1, double* %4
%8 = load double, double* %4
%9 = fdiv double %8, 0x404CA5DC1E7967CB
%10 = call double @sin(double %9)
store double %10, double* %5
%11 = load double, double* %5
%12 = load double, double* %5
%13 = fmul double %11, %12
store double %13, double* %5
%14 = load double, double* %5
%15 = call double @llvm.fmuladd.f64(double 2.360000e-05, double %14, double 5.278800e-03)
%16 = load double, double* %5
%17 = call double @llvm.fmuladd.f64(double %15, double %16, double 1.000000e+00)
%18 = load double, double* %3
%19 = fmul double 1.092000e-06, %18
%20 = call double @llvm.fmuladd.f64(double 0x40238F85D744F5D3, double %17, double %19)
store double %20, double* %6
%21 = load double, double* %3
%22 = call double @llvm.fmuladd.f64(double -1.820000e-15, double %21, double 2.279000e-10)
%23 = load double, double* %3
%24 = call double @llvm.fmuladd.f64(double %22, double %23, double -2.251200e-05)
%25 = load double, double* %3
%26 = call double @llvm.fmuladd.f64(double %24, double %25, double 0x402374039ABF3387)
%27 = load double, double* %3
%28 = fmul double %26, %27
store double %28, double* %7
%29 = load double, double* %7
%30 = load double, double* %6
%31 = fdiv double %29, %30
ret double %31
}

LLVM IR (-O2):
define double @depth(double %0, double %1) {
%3 = fdiv double %1, 0x404CA5DC1E7967CB
%4 = tail call double @sin(double %3)
%5 = fmul double %4, %4
%6 = tail call double @llvm.fmuladd.f64(double %5, double 2.360000e-05, double 5.278800e-03)
%7 = tail call double @llvm.fmuladd.f64(double %6, double %5, double 1.000000e+00)
%8 = fmul double %0, 1.092000e-06
%9 = tail call double @llvm.fmuladd.f64(double %7, double 0x40238F85D744F5D3, double %8)
%10 = tail call double @llvm.fmuladd.f64(double %0, double -1.820000e-15, double 2.279000e-10)
%11 = tail call double @llvm.fmuladd.f64(double %10, double %0, double -2.251200e-05)
%12 = tail call double @llvm.fmuladd.f64(double %11, double %0, double 0x402374039ABF3387)
%13 = fmul double %12, %0
%14 = fdiv double %13, %9
ret double %14
}