#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 bump(double, double, int, int);
double surface(double x, double y) {
  return ((bump(x, y, 2, 2) + bump(x, y, -2, 2) + bump(x, y, -2, -2) +
           bump(x, y, 2, -2) + 1.5 * bump(x, y, 0, 0) +
           0.5 * (bump(x, y, 0, 3) + bump(x, y, 3, 0) + bump(x, y, 0, -3) +
                  bump(x, y, -3, 0))) /
          1.50158867011978);
}


x86 assembly (clang, -O0):
<surface>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
mov    $0x2,%esi
mov    %esi,%edi
call   1030 <bump@plt>
movsd  %xmm0,-0x50(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
mov    $0xfffffffe,%edi
mov    $0x2,%esi
call   1030 <bump@plt>
movaps %xmm0,%xmm1
movsd  -0x50(%rbp),%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x48(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
mov    $0xfffffffe,%esi
mov    %esi,%edi
call   1030 <bump@plt>
movaps %xmm0,%xmm1
movsd  -0x48(%rbp),%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
mov    $0x2,%edi
mov    $0xfffffffe,%esi
call   1030 <bump@plt>
movaps %xmm0,%xmm1
movsd  -0x40(%rbp),%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
xor    %esi,%esi
mov    %esi,%edi
call   1030 <bump@plt>
movsd  -0x38(%rbp),%xmm1
movsd  0xe38(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
xor    %edi,%edi
mov    $0x3,%esi
call   1030 <bump@plt>
movsd  %xmm0,-0x30(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
mov    $0x3,%edi
xor    %esi,%esi
call   1030 <bump@plt>
movaps %xmm0,%xmm1
movsd  -0x30(%rbp),%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
xor    %edi,%edi
mov    $0xfffffffd,%esi
call   1030 <bump@plt>
movaps %xmm0,%xmm1
movsd  -0x28(%rbp),%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
mov    $0xfffffffd,%edi
xor    %esi,%esi
call   1030 <bump@plt>
movsd  -0x20(%rbp),%xmm1
movaps %xmm0,%xmm2
movsd  -0x18(%rbp),%xmm0
addsd  %xmm2,%xmm0
movsd  0xd8b(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  0xd73(%rip),%xmm1
divsd  %xmm1,%xmm0
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<surface>:
sub    $0x28,%rsp
movsd  %xmm1,0x18(%rsp)
movsd  %xmm0,0x10(%rsp)
mov    $0x2,%edi
mov    $0x2,%esi
call   1030 <bump@plt>
movsd  %xmm0,0x8(%rsp)
movsd  0x10(%rsp),%xmm0
movsd  0x18(%rsp),%xmm1
mov    $0xfffffffe,%edi
mov    $0x2,%esi
call   1030 <bump@plt>
addsd  0x8(%rsp),%xmm0
movsd  %xmm0,0x8(%rsp)
movsd  0x10(%rsp),%xmm0
movsd  0x18(%rsp),%xmm1
mov    $0xfffffffe,%edi
mov    $0xfffffffe,%esi
call   1030 <bump@plt>
addsd  0x8(%rsp),%xmm0
movsd  %xmm0,0x8(%rsp)
movsd  0x10(%rsp),%xmm0
movsd  0x18(%rsp),%xmm1
mov    $0x2,%edi
mov    $0xfffffffe,%esi
call   1030 <bump@plt>
addsd  0x8(%rsp),%xmm0
movsd  %xmm0,0x8(%rsp)
movsd  0x10(%rsp),%xmm0
movsd  0x18(%rsp),%xmm1
xor    %edi,%edi
xor    %esi,%esi
call   1030 <bump@plt>
mulsd  0xe39(%rip),%xmm0
addsd  0x8(%rsp),%xmm0
movsd  %xmm0,0x8(%rsp)
movsd  0x10(%rsp),%xmm0
movsd  0x18(%rsp),%xmm1
xor    %edi,%edi
mov    $0x3,%esi
call   1030 <bump@plt>
movsd  %xmm0,0x20(%rsp)
movsd  0x10(%rsp),%xmm0
movsd  0x18(%rsp),%xmm1
mov    $0x3,%edi
xor    %esi,%esi
call   1030 <bump@plt>
addsd  0x20(%rsp),%xmm0
movsd  %xmm0,0x20(%rsp)
movsd  0x10(%rsp),%xmm0
movsd  0x18(%rsp),%xmm1
xor    %edi,%edi
mov    $0xfffffffd,%esi
call   1030 <bump@plt>
addsd  0x20(%rsp),%xmm0
movsd  %xmm0,0x20(%rsp)
movsd  0x10(%rsp),%xmm0
movsd  0x18(%rsp),%xmm1
mov    $0xfffffffd,%edi
xor    %esi,%esi
call   1030 <bump@plt>
addsd  0x20(%rsp),%xmm0
mulsd  0xda9(%rip),%xmm0
addsd  0x8(%rsp),%xmm0
divsd  0xda3(%rip),%xmm0
add    $0x28,%rsp
ret

LLVM IR (-O0):
define double @surface(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %3
%6 = load double, double* %4
%7 = call double @bump(double %5, double %6, i32 2, i32 2)
%8 = load double, double* %3
%9 = load double, double* %4
%10 = call double @bump(double %8, double %9, i32 -2, i32 2)
%11 = fadd double %7, %10
%12 = load double, double* %3
%13 = load double, double* %4
%14 = call double @bump(double %12, double %13, i32 -2, i32 -2)
%15 = fadd double %11, %14
%16 = load double, double* %3
%17 = load double, double* %4
%18 = call double @bump(double %16, double %17, i32 2, i32 -2)
%19 = fadd double %15, %18
%20 = load double, double* %3
%21 = load double, double* %4
%22 = call double @bump(double %20, double %21, i32 0, i32 0)
%23 = call double @llvm.fmuladd.f64(double 1.500000e+00, double %22, double %19)
%24 = load double, double* %3
%25 = load double, double* %4
%26 = call double @bump(double %24, double %25, i32 0, i32 3)
%27 = load double, double* %3
%28 = load double, double* %4
%29 = call double @bump(double %27, double %28, i32 3, i32 0)
%30 = fadd double %26, %29
%31 = load double, double* %3
%32 = load double, double* %4
%33 = call double @bump(double %31, double %32, i32 0, i32 -3)
%34 = fadd double %30, %33
%35 = load double, double* %3
%36 = load double, double* %4
%37 = call double @bump(double %35, double %36, i32 -3, i32 0)
%38 = fadd double %34, %37
%39 = call double @llvm.fmuladd.f64(double 5.000000e-01, double %38, double %23)
%40 = fdiv double %39, 0x3FF80681D7635660
ret double %40
}

LLVM IR (-O2):
define double @surface(double %0, double %1) {
%3 = tail call double @bump(double %0, double %1, i32 2, i32 2)
%4 = tail call double @bump(double %0, double %1, i32 -2, i32 2)
%5 = fadd double %3, %4
%6 = tail call double @bump(double %0, double %1, i32 -2, i32 -2)
%7 = fadd double %5, %6
%8 = tail call double @bump(double %0, double %1, i32 2, i32 -2)
%9 = fadd double %7, %8
%10 = tail call double @bump(double %0, double %1, i32 0, i32 0)
%11 = tail call double @llvm.fmuladd.f64(double %10, double 1.500000e+00, double %9)
%12 = tail call double @bump(double %0, double %1, i32 0, i32 3)
%13 = tail call double @bump(double %0, double %1, i32 3, i32 0)
%14 = fadd double %12, %13
%15 = tail call double @bump(double %0, double %1, i32 0, i32 -3)
%16 = fadd double %14, %15
%17 = tail call double @bump(double %0, double %1, i32 -3, i32 0)
%18 = fadd double %16, %17
%19 = tail call double @llvm.fmuladd.f64(double %18, double 5.000000e-01, double %11)
%20 = fdiv double %19, 0x3FF80681D7635660
ret double %20
}