#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 /*<<< orphan*/ free(double **);
int /*<<< orphan*/ imprime_teste_interpolacao(double **, double **, double **,
                                              double **, int);
double **matriz_nula(int, int);
double **matriz_valores(int, int, double *);
void teste_interpolacao_grau_4() {
  int dim = 4;
  double x[4][1] = {{1}, {2}, {3}, {4}};
  double fx[4][1] = {{-17}, {4}, {71}, {202}};
  double pol[4][1] = {{-10}, {-15}, {5}, {3}};
  double **X, **Fx, **Pol;
  double **Pol_correto;
  X = matriz_valores(dim, 1, &x[0][0]);
  Fx = matriz_valores(dim, 1, &fx[0][0]);
  Pol = matriz_nula(dim, 1);
  Pol_correto = matriz_valores(dim, 1, &pol[0][0]);
  imprime_teste_interpolacao(X, Fx, Pol, Pol_correto, dim);
  free(X);
  X = NULL;
  free(Fx);
  Fx = NULL;
  free(Pol);
  Pol = NULL;
  free(Pol_correto);
  Pol_correto = NULL;
}


x86 assembly (clang, -O0):
<teste_interpolacao_grau_4>:
push   %rbp
mov    %rsp,%rbp
sub    $0x90,%rsp
movl   $0x4,-0x4(%rbp)
mov    0xea7(%rip),%rax
mov    %rax,-0x30(%rbp)
mov    0xea4(%rip),%rax
mov    %rax,-0x28(%rbp)
mov    0xea1(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xe9e(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xe9b(%rip),%rax
mov    %rax,-0x50(%rbp)
mov    0xe98(%rip),%rax
mov    %rax,-0x48(%rbp)
mov    0xe95(%rip),%rax
mov    %rax,-0x40(%rbp)
mov    0xe92(%rip),%rax
mov    %rax,-0x38(%rbp)
mov    0xe8f(%rip),%rax
mov    %rax,-0x70(%rbp)
mov    0xe8c(%rip),%rax
mov    %rax,-0x68(%rbp)
mov    0xe89(%rip),%rax
mov    %rax,-0x60(%rbp)
mov    0xe86(%rip),%rax
mov    %rax,-0x58(%rbp)
mov    -0x4(%rbp),%edi
lea    -0x30(%rbp),%rdx
mov    $0x1,%esi
call   1040 <matriz_valores@plt>
mov    %rax,-0x78(%rbp)
mov    -0x4(%rbp),%edi
lea    -0x50(%rbp),%rdx
mov    $0x1,%esi
call   1040 <matriz_valores@plt>
mov    %rax,-0x80(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x1,%esi
call   1050 <matriz_nula@plt>
mov    %rax,-0x88(%rbp)
mov    -0x4(%rbp),%edi
lea    -0x70(%rbp),%rdx
mov    $0x1,%esi
call   1040 <matriz_valores@plt>
mov    %rax,-0x90(%rbp)
mov    -0x78(%rbp),%rdi
mov    -0x80(%rbp),%rsi
mov    -0x88(%rbp),%rdx
mov    -0x90(%rbp),%rcx
mov    -0x4(%rbp),%r8d
call   1060 <imprime_teste_interpolacao@plt>
mov    -0x78(%rbp),%rdi
call   1030 <free@plt>
movq   $0x0,-0x78(%rbp)
mov    -0x80(%rbp),%rdi
call   1030 <free@plt>
movq   $0x0,-0x80(%rbp)
mov    -0x88(%rbp),%rdi
call   1030 <free@plt>
movq   $0x0,-0x88(%rbp)
mov    -0x90(%rbp),%rdi
call   1030 <free@plt>
movq   $0x0,-0x90(%rbp)
add    $0x90,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<teste_interpolacao_grau_4>:
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x68,%rsp
movaps 0xebe(%rip),%xmm0
movaps %xmm0,0x50(%rsp)
movaps 0xea2(%rip),%xmm0
movaps %xmm0,0x40(%rsp)
movaps 0xec6(%rip),%xmm0
movaps %xmm0,0x30(%rsp)
movaps 0xeaa(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
movaps 0xece(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xeb2(%rip),%xmm0
movaps %xmm0,(%rsp)
lea    0x40(%rsp),%rdx
mov    $0x4,%edi
mov    $0x1,%esi
call   1040 <matriz_valores@plt>
mov    %rax,%r14
lea    0x20(%rsp),%rdx
mov    $0x4,%edi
mov    $0x1,%esi
call   1040 <matriz_valores@plt>
mov    %rax,%r15
mov    $0x4,%edi
mov    $0x1,%esi
call   1050 <matriz_nula@plt>
mov    %rax,%r12
mov    %rsp,%rdx
mov    $0x4,%edi
mov    $0x1,%esi
call   1040 <matriz_valores@plt>
mov    %rax,%rbx
mov    %r14,%rdi
mov    %r15,%rsi
mov    %r12,%rdx
mov    %rax,%rcx
mov    $0x4,%r8d
call   1060 <imprime_teste_interpolacao@plt>
mov    %r14,%rdi
call   1030 <free@plt>
mov    %r15,%rdi
call   1030 <free@plt>
mov    %r12,%rdi
call   1030 <free@plt>
mov    %rbx,%rdi
call   1030 <free@plt>
add    $0x68,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@__const.teste_interpolacao_grau_4.x = [4 x [1 x double]] [[1 x double] [double 1.000000e+00], [1 x double] [double 2.000000e+00], [1 x double] [double 3.000000e+00], [1 x double] [double 4.000000e+00]]
@__const.teste_interpolacao_grau_4.fx = [4 x [1 x double]] [[1 x double] [double -1.700000e+01], [1 x double] [double 4.000000e+00], [1 x double] [double 7.100000e+01], [1 x double] [double 2.020000e+02]]
@__const.teste_interpolacao_grau_4.pol = [4 x [1 x double]] [[1 x double] [double -1.000000e+01], [1 x double] [double -1.500000e+01], [1 x double] [double 5.000000e+00], [1 x double] [double 3.000000e+00]]
define void @teste_interpolacao_grau_4() {
%1 = alloca i32
%2 = alloca [4 x [1 x double]]
%3 = alloca [4 x [1 x double]]
%4 = alloca [4 x [1 x double]]
%5 = alloca double**
%6 = alloca double**
%7 = alloca double**
%8 = alloca double**
store i32 4, i32* %1
%9 = bitcast [4 x [1 x double]]* %2 to i8*
%10 = bitcast [4 x [1 x double]]* %3 to i8*
%11 = bitcast [4 x [1 x double]]* %4 to i8*
%12 = load i32, i32* %1
%13 = getelementptr inbounds [4 x [1 x double]], [4 x [1 x double]]* %2, i64 0, i64 0
%14 = getelementptr inbounds [1 x double], [1 x double]* %13, i64 0, i64 0
%15 = call double** @matriz_valores(i32 %12, i32 1, double* %14)
store double** %15, double*** %5
%16 = load i32, i32* %1
%17 = getelementptr inbounds [4 x [1 x double]], [4 x [1 x double]]* %3, i64 0, i64 0
%18 = getelementptr inbounds [1 x double], [1 x double]* %17, i64 0, i64 0
%19 = call double** @matriz_valores(i32 %16, i32 1, double* %18)
store double** %19, double*** %6
%20 = load i32, i32* %1
%21 = call double** @matriz_nula(i32 %20, i32 1)
store double** %21, double*** %7
%22 = load i32, i32* %1
%23 = getelementptr inbounds [4 x [1 x double]], [4 x [1 x double]]* %4, i64 0, i64 0
%24 = getelementptr inbounds [1 x double], [1 x double]* %23, i64 0, i64 0
%25 = call double** @matriz_valores(i32 %22, i32 1, double* %24)
store double** %25, double*** %8
%26 = load double**, double*** %5
%27 = load double**, double*** %6
%28 = load double**, double*** %7
%29 = load double**, double*** %8
%30 = load i32, i32* %1
%31 = call i32 @imprime_teste_interpolacao(double** %26, double** %27, double** %28, double** %29, i32 %30)
%32 = load double**, double*** %5
%33 = call i32 @free(double** %32)
store double** null, double*** %5
%34 = load double**, double*** %6
%35 = call i32 @free(double** %34)
store double** null, double*** %6
%36 = load double**, double*** %7
%37 = call i32 @free(double** %36)
store double** null, double*** %7
%38 = load double**, double*** %8
%39 = call i32 @free(double** %38)
store double** null, double*** %8
ret void
}

LLVM IR (-O2):
@__const.teste_interpolacao_grau_4.x = [4 x [1 x double]] [[1 x double] [double 1.000000e+00], [1 x double] [double 2.000000e+00], [1 x double] [double 3.000000e+00], [1 x double] [double 4.000000e+00]]
@__const.teste_interpolacao_grau_4.fx = [4 x [1 x double]] [[1 x double] [double -1.700000e+01], [1 x double] [double 4.000000e+00], [1 x double] [double 7.100000e+01], [1 x double] [double 2.020000e+02]]
@__const.teste_interpolacao_grau_4.pol = [4 x [1 x double]] [[1 x double] [double -1.000000e+01], [1 x double] [double -1.500000e+01], [1 x double] [double 5.000000e+00], [1 x double] [double 3.000000e+00]]
define void @teste_interpolacao_grau_4() {
%1 = alloca [4 x [1 x double]]
%2 = alloca [4 x [1 x double]]
%3 = alloca [4 x [1 x double]]
%4 = bitcast [4 x [1 x double]]* %1 to i8*
%5 = bitcast [4 x [1 x double]]* %2 to i8*
%6 = bitcast [4 x [1 x double]]* %3 to i8*
%7 = getelementptr inbounds [4 x [1 x double]], [4 x [1 x double]]* %1, i64 0, i64 0, i64 0
%8 = call double** @matriz_valores(i32 4, i32 1, double* %7)
%9 = getelementptr inbounds [4 x [1 x double]], [4 x [1 x double]]* %2, i64 0, i64 0, i64 0
%10 = call double** @matriz_valores(i32 4, i32 1, double* %9)
%11 = call double** @matriz_nula(i32 4, i32 1)
%12 = getelementptr inbounds [4 x [1 x double]], [4 x [1 x double]]* %3, i64 0, i64 0, i64 0
%13 = call double** @matriz_valores(i32 4, i32 1, double* %12)
%14 = call i32 @imprime_teste_interpolacao(double** %8, double** %10, double** %11, double** %13, i32 4)
%15 = call i32 @free(double** %8)
%16 = call i32 @free(double** %10)
%17 = call i32 @free(double** %11)
%18 = call i32 @free(double** %13)
ret void
}