#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 */
scalar_t__ floor(double);
double it_pol_neville_s2(double *, double);
int max(int, int /*<<< orphan*/);
int min(int, int);
double it_pol_neville2D_s2(int n, int m, double **f, double y_1, double x_1) {
  static double x_interm[2];
  int indice_x1_inf = (int)floor(x_1);
  indice_x1_inf = max(indice_x1_inf, 0);
  indice_x1_inf = min(indice_x1_inf, m - 2);
  int indice_y1_inf = (int)floor(y_1);
  indice_y1_inf = max(indice_y1_inf, 0);
  indice_y1_inf = min(indice_y1_inf, n - 2);
  x_interm[0] = it_pol_neville_s2(&(f[indice_y1_inf][indice_x1_inf]),
                                  x_1 - indice_x1_inf);
  x_interm[1] = it_pol_neville_s2(&(f[indice_y1_inf + 1][indice_x1_inf]),
                                  x_1 - indice_x1_inf);
  return it_pol_neville_s2(x_interm, y_1 - indice_y1_inf);
}


x86 assembly (clang, -O0):
<it_pol_neville2D_s2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
movsd  %xmm0,-0x18(%rbp)
movsd  %xmm1,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
call   1060 <floor@plt>
mov    %eax,-0x24(%rbp)
mov    -0x24(%rbp),%edi
xor    %esi,%esi
call   1050 <max@plt>
mov    %eax,-0x24(%rbp)
mov    -0x24(%rbp),%edi
mov    -0x8(%rbp),%esi
sub    $0x2,%esi
call   1040 <min@plt>
mov    %eax,-0x24(%rbp)
movsd  -0x18(%rbp),%xmm0
call   1060 <floor@plt>
mov    %eax,-0x28(%rbp)
mov    -0x28(%rbp),%edi
xor    %esi,%esi
call   1050 <max@plt>
mov    %eax,-0x28(%rbp)
mov    -0x28(%rbp),%edi
mov    -0x4(%rbp),%esi
sub    $0x2,%esi
call   1040 <min@plt>
mov    %eax,-0x28(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x28(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
movslq -0x24(%rbp),%rax
shl    $0x3,%rax
add    %rax,%rdi
movsd  -0x20(%rbp),%xmm0
cvtsi2sdl -0x24(%rbp),%xmm1
subsd  %xmm1,%xmm0
call   1030 <it_pol_neville_s2@plt>
movsd  %xmm0,0x2e6c(%rip)
mov    -0x10(%rbp),%rax
mov    -0x28(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,8),%rdi
movslq -0x24(%rbp),%rax
shl    $0x3,%rax
add    %rax,%rdi
movsd  -0x20(%rbp),%xmm0
cvtsi2sdl -0x24(%rbp),%xmm1
subsd  %xmm1,%xmm0
call   1030 <it_pol_neville_s2@plt>
movsd  %xmm0,0x2e3d(%rip)
movsd  -0x18(%rbp),%xmm0
cvtsi2sdl -0x28(%rbp),%xmm1
subsd  %xmm1,%xmm0
lea    0x2e20(%rip),%rdi
call   1030 <it_pol_neville_s2@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<it_pol_neville2D_s2>:
push   %rbp
push   %r15
push   %r14
push   %rbx
sub    $0x18,%rsp
movsd  %xmm1,0x8(%rsp)
movsd  %xmm0,0x10(%rsp)
mov    %rdx,%r14
mov    %esi,%ebx
mov    %edi,%ebp
movaps %xmm1,%xmm0
call   1060 <floor@plt>
mov    %eax,%edi
xor    %esi,%esi
call   1050 <max@plt>
add    $0xfffffffe,%ebx
mov    %eax,%edi
mov    %ebx,%esi
call   1040 <min@plt>
mov    %eax,%ebx
movsd  0x10(%rsp),%xmm0
call   1060 <floor@plt>
mov    %eax,%edi
xor    %esi,%esi
call   1050 <max@plt>
add    $0xfffffffe,%ebp
mov    %eax,%edi
mov    %ebp,%esi
call   1040 <min@plt>
movslq %eax,%rbp
movslq %ebx,%rax
lea    0x0(,%rax,8),%rbx
mov    (%r14,%rbp,8),%rdi
add    %rbx,%rdi
xorps  %xmm1,%xmm1
cvtsi2sd %eax,%xmm1
movsd  0x8(%rsp),%xmm0
subsd  %xmm1,%xmm0
movsd  %xmm0,0x8(%rsp)
call   1030 <it_pol_neville_s2@plt>
movsd  %xmm0,0x2e7b(%rip)
lea    0x2e74(%rip),%r15
add    0x8(%r14,%rbp,8),%rbx
mov    %rbx,%rdi
movsd  0x8(%rsp),%xmm0
call   1030 <it_pol_neville_s2@plt>
movsd  %xmm0,0x2e61(%rip)
xorps  %xmm1,%xmm1
cvtsi2sd %ebp,%xmm1
movsd  0x10(%rsp),%xmm0
subsd  %xmm1,%xmm0
mov    %r15,%rdi
add    $0x18,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <it_pol_neville_s2@plt>

LLVM IR (-O0):
@it_pol_neville2D_s2.x_interm = internal global [2 x double] zeroinitializer
define double @it_pol_neville2D_s2(i32 %0, i32 %1, double** %2, double %3, double %4) {
%6 = alloca i32
%7 = alloca i32
%8 = alloca double**
%9 = alloca double
%10 = alloca double
%11 = alloca i32
%12 = alloca i32
store i32 %0, i32* %6
store i32 %1, i32* %7
store double** %2, double*** %8
store double %3, double* %9
store double %4, double* %10
%13 = load double, double* %10
%14 = call i64 @floor(double %13)
%15 = trunc i64 %14 to i32
store i32 %15, i32* %11
%16 = load i32, i32* %11
%17 = call i32 @max(i32 %16, i32 0)
store i32 %17, i32* %11
%18 = load i32, i32* %11
%19 = load i32, i32* %7
%20 = sub nsw i32 %19, 2
%21 = call i32 @min(i32 %18, i32 %20)
store i32 %21, i32* %11
%22 = load double, double* %9
%23 = call i64 @floor(double %22)
%24 = trunc i64 %23 to i32
store i32 %24, i32* %12
%25 = load i32, i32* %12
%26 = call i32 @max(i32 %25, i32 0)
store i32 %26, i32* %12
%27 = load i32, i32* %12
%28 = load i32, i32* %6
%29 = sub nsw i32 %28, 2
%30 = call i32 @min(i32 %27, i32 %29)
store i32 %30, i32* %12
%31 = load double**, double*** %8
%32 = load i32, i32* %12
%33 = sext i32 %32 to i64
%34 = getelementptr inbounds double*, double** %31, i64 %33
%35 = load double*, double** %34
%36 = load i32, i32* %11
%37 = sext i32 %36 to i64
%38 = getelementptr inbounds double, double* %35, i64 %37
%39 = load double, double* %10
%40 = load i32, i32* %11
%41 = sitofp i32 %40 to double
%42 = fsub double %39, %41
%43 = call double @it_pol_neville_s2(double* %38, double %42)
store double %43, double* getelementptr inbounds ([2 x double], [2 x double]* @it_pol_neville2D_s2.x_interm, i64 0, i64 0)
%44 = load double**, double*** %8
%45 = load i32, i32* %12
%46 = add nsw i32 %45, 1
%47 = sext i32 %46 to i64
%48 = getelementptr inbounds double*, double** %44, i64 %47
%49 = load double*, double** %48
%50 = load i32, i32* %11
%51 = sext i32 %50 to i64
%52 = getelementptr inbounds double, double* %49, i64 %51
%53 = load double, double* %10
%54 = load i32, i32* %11
%55 = sitofp i32 %54 to double
%56 = fsub double %53, %55
%57 = call double @it_pol_neville_s2(double* %52, double %56)
store double %57, double* getelementptr inbounds ([2 x double], [2 x double]* @it_pol_neville2D_s2.x_interm, i64 0, i64 1)
%58 = load double, double* %9
%59 = load i32, i32* %12
%60 = sitofp i32 %59 to double
%61 = fsub double %58, %60
%62 = call double @it_pol_neville_s2(double* getelementptr inbounds ([2 x double], [2 x double]* @it_pol_neville2D_s2.x_interm, i64 0, i64 0), double %61)
ret double %62
}

LLVM IR (-O2):
@it_pol_neville2D_s2.x_interm = internal global [2 x double] zeroinitializer
define double @it_pol_neville2D_s2(i32 %0, i32 %1, double** nocapture %2, double %3, double %4) {
%6 = tail call i64 @floor(double %4)
%7 = trunc i64 %6 to i32
%8 = tail call i32 @max(i32 %7, i32 0)
%9 = add nsw i32 %1, -2
%10 = tail call i32 @min(i32 %8, i32 %9)
%11 = tail call i64 @floor(double %3)
%12 = trunc i64 %11 to i32
%13 = tail call i32 @max(i32 %12, i32 0)
%14 = add nsw i32 %0, -2
%15 = tail call i32 @min(i32 %13, i32 %14)
%16 = sext i32 %15 to i64
%17 = getelementptr inbounds double*, double** %2, i64 %16
%18 = load double*, double** %17
%19 = sext i32 %10 to i64
%20 = getelementptr inbounds double, double* %18, i64 %19
%21 = sitofp i32 %10 to double
%22 = fsub double %4, %21
%23 = tail call double @it_pol_neville_s2(double* %20, double %22)
store double %23, double* getelementptr inbounds ([2 x double], [2 x double]* @it_pol_neville2D_s2.x_interm, i64 0, i64 0)
%24 = add nsw i32 %15, 1
%25 = sext i32 %24 to i64
%26 = getelementptr inbounds double*, double** %2, i64 %25
%27 = load double*, double** %26
%28 = getelementptr inbounds double, double* %27, i64 %19
%29 = tail call double @it_pol_neville_s2(double* %28, double %22)
store double %29, double* getelementptr inbounds ([2 x double], [2 x double]* @it_pol_neville2D_s2.x_interm, i64 0, i64 1)
%30 = sitofp i32 %15 to double
%31 = fsub double %3, %30
%32 = tail call double @it_pol_neville_s2(double* getelementptr inbounds ([2 x double], [2 x double]* @it_pol_neville2D_s2.x_interm, i64 0, i64 0), double %31)
ret double %32
}