#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 */
int pow(double, int);
double laplacian_u(double (*u)(double x, double y), double h, double x,
                   double y) {
  return pow(h, -2) *
         (4 * u(x, y) - u(x - 1, y) - u(x + 1, y) - u(x, y - 1) - u(x, y + 1));
}


x86 assembly (clang, -O0):
<laplacian_u>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    %rdi,-0x8(%rbp)
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
movsd  %xmm2,-0x20(%rbp)
movsd  -0x10(%rbp),%xmm0
mov    $0xfffffffe,%edi
call   1030 <pow@plt>
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0x28(%rbp)
mov    -0x8(%rbp),%rax
movsd  -0x18(%rbp),%xmm0
movsd  -0x20(%rbp),%xmm1
call   *%rax
movsd  %xmm0,-0x48(%rbp)
mov    -0x8(%rbp),%rax
movsd  -0x18(%rbp),%xmm0
movsd  0xe97(%rip),%xmm1
subsd  %xmm1,%xmm0
movsd  -0x20(%rbp),%xmm1
call   *%rax
movaps %xmm0,%xmm1
movsd  -0x48(%rbp),%xmm0
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
movsd  0xe6d(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x40(%rbp)
mov    -0x8(%rbp),%rax
movsd  0xe4c(%rip),%xmm0
addsd  -0x18(%rbp),%xmm0
movsd  -0x20(%rbp),%xmm1
call   *%rax
movaps %xmm0,%xmm1
movsd  -0x40(%rbp),%xmm0
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x38(%rbp)
mov    -0x8(%rbp),%rax
movsd  -0x18(%rbp),%xmm0
movsd  -0x20(%rbp),%xmm1
movsd  0xe19(%rip),%xmm2
subsd  %xmm2,%xmm1
call   *%rax
movaps %xmm0,%xmm1
movsd  -0x38(%rbp),%xmm0
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x30(%rbp)
mov    -0x8(%rbp),%rax
movsd  -0x18(%rbp),%xmm0
movsd  0xdf1(%rip),%xmm1
addsd  -0x20(%rbp),%xmm1
call   *%rax
movsd  -0x30(%rbp),%xmm1
movaps %xmm0,%xmm2
movsd  -0x28(%rbp),%xmm0
subsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<laplacian_u>:
push   %rbx
sub    $0x20,%rsp
movsd  %xmm2,0x8(%rsp)
movsd  %xmm1,0x10(%rsp)
mov    %rdi,%rbx
mov    $0xfffffffe,%edi
call   1030 <pow@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
movsd  %xmm0,0x18(%rsp)
movsd  0x10(%rsp),%xmm0
movsd  0x8(%rsp),%xmm1
call   *%rbx
movsd  %xmm0,(%rsp)
movsd  0x10(%rsp),%xmm0
addsd  0xea4(%rip),%xmm0
movsd  0x8(%rsp),%xmm1
call   *%rbx
movsd  (%rsp),%xmm1
mulsd  0xe97(%rip),%xmm1
subsd  %xmm0,%xmm1
movsd  %xmm1,(%rsp)
movsd  0x10(%rsp),%xmm0
addsd  0xe88(%rip),%xmm0
movsd  0x8(%rsp),%xmm1
call   *%rbx
movsd  (%rsp),%xmm1
subsd  %xmm0,%xmm1
movsd  %xmm1,(%rsp)
movsd  0xe5a(%rip),%xmm1
addsd  0x8(%rsp),%xmm1
movsd  0x10(%rsp),%xmm0
call   *%rbx
movsd  (%rsp),%xmm1
subsd  %xmm0,%xmm1
movsd  %xmm1,(%rsp)
movsd  0x8(%rsp),%xmm1
addsd  0xe40(%rip),%xmm1
movsd  0x10(%rsp),%xmm0
call   *%rbx
movsd  (%rsp),%xmm1
subsd  %xmm0,%xmm1
mulsd  0x18(%rsp),%xmm1
movapd %xmm1,%xmm0
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define double @laplacian_u(double (double, double)* %0, double %1, double %2, double %3) {
%5 = alloca double (double, double)*
%6 = alloca double
%7 = alloca double
%8 = alloca double
store double (double, double)* %0, double (double, double)** %5
store double %1, double* %6
store double %2, double* %7
store double %3, double* %8
%9 = load double, double* %6
%10 = call i32 @pow(double %9, i32 -2)
%11 = sitofp i32 %10 to double
%12 = load double (double, double)*, double (double, double)** %5
%13 = load double, double* %7
%14 = load double, double* %8
%15 = call double %12(double %13, double %14)
%16 = load double (double, double)*, double (double, double)** %5
%17 = load double, double* %7
%18 = fsub double %17, 1.000000e+00
%19 = load double, double* %8
%20 = call double %16(double %18, double %19)
%21 = fneg double %20
%22 = call double @llvm.fmuladd.f64(double 4.000000e+00, double %15, double %21)
%23 = load double (double, double)*, double (double, double)** %5
%24 = load double, double* %7
%25 = fadd double %24, 1.000000e+00
%26 = load double, double* %8
%27 = call double %23(double %25, double %26)
%28 = fsub double %22, %27
%29 = load double (double, double)*, double (double, double)** %5
%30 = load double, double* %7
%31 = load double, double* %8
%32 = fsub double %31, 1.000000e+00
%33 = call double %29(double %30, double %32)
%34 = fsub double %28, %33
%35 = load double (double, double)*, double (double, double)** %5
%36 = load double, double* %7
%37 = load double, double* %8
%38 = fadd double %37, 1.000000e+00
%39 = call double %35(double %36, double %38)
%40 = fsub double %34, %39
%41 = fmul double %11, %40
ret double %41
}

LLVM IR (-O2):
define double @laplacian_u(double (double, double)* nocapture %0, double %1, double %2, double %3) {
%5 = tail call i32 @pow(double %1, i32 -2)
%6 = sitofp i32 %5 to double
%7 = tail call double %0(double %2, double %3)
%8 = fadd double %2, -1.000000e+00
%9 = tail call double %0(double %8, double %3)
%10 = fneg double %9
%11 = tail call double @llvm.fmuladd.f64(double %7, double 4.000000e+00, double %10)
%12 = fadd double %2, 1.000000e+00
%13 = tail call double %0(double %12, double %3)
%14 = fsub double %11, %13
%15 = fadd double %3, -1.000000e+00
%16 = tail call double %0(double %2, double %15)
%17 = fsub double %14, %16
%18 = fadd double %3, 1.000000e+00
%19 = tail call double %0(double %2, double %18)
%20 = fsub double %17, %19
%21 = fmul double %20, %6
ret double %21
}