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


x86 assembly (clang, -O0):
<it_pol_neville2D_s3>:
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>
sub    $0x1,%eax
mov    %eax,-0x28(%rbp)
mov    -0x28(%rbp),%edi
xor    %esi,%esi
call   1040 <max@plt>
mov    %eax,-0x28(%rbp)
mov    -0x28(%rbp),%edi
mov    -0x8(%rbp),%esi
sub    $0x3,%esi
call   1030 <min@plt>
mov    %eax,-0x28(%rbp)
movsd  -0x18(%rbp),%xmm0
call   1060 <floor@plt>
sub    $0x1,%eax
mov    %eax,-0x2c(%rbp)
mov    -0x2c(%rbp),%edi
xor    %esi,%esi
call   1040 <max@plt>
mov    %eax,-0x2c(%rbp)
mov    -0x2c(%rbp),%edi
mov    -0x4(%rbp),%esi
sub    $0x3,%esi
call   1030 <min@plt>
mov    %eax,-0x2c(%rbp)
movl   $0x0,-0x24(%rbp)
cmpl   $0x3,-0x24(%rbp)
jge    1216 <it_pol_neville2D_s3+0xd6>
mov    -0x10(%rbp),%rax
mov    -0x2c(%rbp),%ecx
add    -0x24(%rbp),%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,8),%rdi
movslq -0x28(%rbp),%rax
shl    $0x3,%rax
add    %rax,%rdi
movsd  -0x20(%rbp),%xmm0
cvtsi2sdl -0x28(%rbp),%xmm1
subsd  %xmm1,%xmm0
call   1050 <it_pol_neville_s3@plt>
movslq -0x24(%rbp),%rcx
lea    0x2e4d(%rip),%rax
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    11bf <it_pol_neville2D_s3+0x7f>
movsd  -0x18(%rbp),%xmm0
cvtsi2sdl -0x2c(%rbp),%xmm1
subsd  %xmm1,%xmm0
lea    0x2e25(%rip),%rdi
call   1050 <it_pol_neville_s3@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<it_pol_neville2D_s3>:
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>
lea    -0x1(%rax),%edi
xor    %esi,%esi
call   1040 <max@plt>
add    $0xfffffffd,%ebx
mov    %eax,%edi
mov    %ebx,%esi
call   1030 <min@plt>
mov    %eax,%ebx
movsd  0x10(%rsp),%xmm0
call   1060 <floor@plt>
lea    -0x1(%rax),%edi
xor    %esi,%esi
call   1040 <max@plt>
add    $0xfffffffd,%ebp
mov    %eax,%edi
mov    %ebp,%esi
call   1030 <min@plt>
movslq %ebx,%rbp
xorps  %xmm1,%xmm1
cvtsi2sd %ebp,%xmm1
movsd  0x8(%rsp),%xmm0
subsd  %xmm1,%xmm0
movsd  %xmm0,0x8(%rsp)
movslq %eax,%rbx
shl    $0x3,%rbp
mov    (%r14,%rbx,8),%rdi
add    %rbp,%rdi
call   1050 <it_pol_neville_s3@plt>
movsd  %xmm0,0x2e7d(%rip)
lea    0x2e76(%rip),%r15
mov    0x8(%r14,%rbx,8),%rdi
add    %rbp,%rdi
movsd  0x8(%rsp),%xmm0
call   1050 <it_pol_neville_s3@plt>
movsd  %xmm0,0x2e63(%rip)
add    0x10(%r14,%rbx,8),%rbp
mov    %rbp,%rdi
movsd  0x8(%rsp),%xmm0
call   1050 <it_pol_neville_s3@plt>
movsd  %xmm0,0x2e50(%rip)
xorps  %xmm1,%xmm1
cvtsi2sd %ebx,%xmm1
movsd  0x10(%rsp),%xmm0
subsd  %xmm1,%xmm0
mov    %r15,%rdi
add    $0x18,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
jmp    1050 <it_pol_neville_s3@plt>

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

LLVM IR (-O2):
@it_pol_neville2D_s3.x_interm = internal global [3 x double] zeroinitializer
define double @it_pol_neville2D_s3(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 = add nsw i32 %7, -1
%9 = tail call i32 @max(i32 %8, i32 0)
%10 = add nsw i32 %1, -3
%11 = tail call i32 @min(i32 %9, i32 %10)
%12 = tail call i64 @floor(double %3)
%13 = trunc i64 %12 to i32
%14 = add nsw i32 %13, -1
%15 = tail call i32 @max(i32 %14, i32 0)
%16 = add nsw i32 %0, -3
%17 = tail call i32 @min(i32 %15, i32 %16)
%18 = sext i32 %11 to i64
%19 = sitofp i32 %11 to double
%20 = fsub double %4, %19
%21 = sext i32 %17 to i64
%22 = getelementptr inbounds double*, double** %2, i64 %21
%23 = load double*, double** %22
%24 = getelementptr inbounds double, double* %23, i64 %18
%25 = tail call double @it_pol_neville_s3(double* %24, double %20)
store double %25, double* getelementptr inbounds ([3 x double], [3 x double]* @it_pol_neville2D_s3.x_interm, i64 0, i64 0)
%26 = add nsw i64 %21, 1
%27 = getelementptr inbounds double*, double** %2, i64 %26
%28 = load double*, double** %27
%29 = getelementptr inbounds double, double* %28, i64 %18
%30 = tail call double @it_pol_neville_s3(double* %29, double %20)
store double %30, double* getelementptr inbounds ([3 x double], [3 x double]* @it_pol_neville2D_s3.x_interm, i64 0, i64 1)
%31 = add nsw i64 %21, 2
%32 = getelementptr inbounds double*, double** %2, i64 %31
%33 = load double*, double** %32
%34 = getelementptr inbounds double, double* %33, i64 %18
%35 = tail call double @it_pol_neville_s3(double* %34, double %20)
store double %35, double* getelementptr inbounds ([3 x double], [3 x double]* @it_pol_neville2D_s3.x_interm, i64 0, i64 2)
%36 = sitofp i32 %17 to double
%37 = fsub double %3, %36
%38 = tail call double @it_pol_neville_s3(double* getelementptr inbounds ([3 x double], [3 x double]* @it_pol_neville2D_s3.x_interm, i64 0, i64 0), double %37)
ret double %38
}