#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*/ getch();
int /*<<< orphan*/ printf(char *, int /*<<< orphan*/);
int /*<<< orphan*/ tdpolyval(double **, int, int, double, double);
main() {
  double a[3][2] = {{5.6, 7.9}, {4.4, -2.0}, {-2.0, -4.0}}, x = 1.37, y = -4.9;
  printf("\n The result is :%lf", tdpolyval(a, 3, 2, x, y));
  getch();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
lea    -0x30(%rbp),%rdi
xor    %esi,%esi
mov    $0x30,%edx
call   1040 <memset@plt>
movsd  0xed0(%rip),%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  0xebb(%rip),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  0xea6(%rip),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  0xe91(%rip),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  0xe84(%rip),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  0xe6f(%rip),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  0xe5a(%rip),%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  0xe45(%rip),%xmm0
movsd  %xmm0,-0x40(%rbp)
lea    -0x30(%rbp),%rdi
movsd  -0x38(%rbp),%xmm0
movsd  -0x40(%rbp),%xmm1
mov    $0x3,%esi
mov    $0x2,%edx
call   1060 <tdpolyval@plt>
mov    %eax,%esi
lea    0xe52(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1050 <getch@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x38,%rsp
movaps 0xec5(%rip),%xmm0
movaps %xmm0,(%rsp)
movaps 0xeca(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xece(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
mov    %rsp,%rdi
movsd  0xece(%rip),%xmm0
movsd  0xece(%rip),%xmm1
mov    $0x3,%esi
mov    $0x2,%edx
call   1050 <tdpolyval@plt>
lea    0xec0(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
call   1040 <getch@plt>
xor    %eax,%eax
add    $0x38,%rsp
ret

LLVM IR (-O0):
@.str = [21 x i8] c"\0A The result is :%lf\00"
define i32 @main() {
%1 = alloca [3 x [2 x double]]
%2 = alloca double
%3 = alloca double
%4 = bitcast [3 x [2 x double]]* %1 to i8*
%5 = bitcast i8* %4 to [3 x [2 x double]]*
%6 = getelementptr inbounds [3 x [2 x double]], [3 x [2 x double]]* %5, i32 0, i32 0
%7 = getelementptr inbounds [2 x double], [2 x double]* %6, i32 0, i32 0
store double 5.600000e+00, double* %7
%8 = getelementptr inbounds [2 x double], [2 x double]* %6, i32 0, i32 1
store double 7.900000e+00, double* %8
%9 = getelementptr inbounds [3 x [2 x double]], [3 x [2 x double]]* %5, i32 0, i32 1
%10 = getelementptr inbounds [2 x double], [2 x double]* %9, i32 0, i32 0
store double 4.400000e+00, double* %10
%11 = getelementptr inbounds [2 x double], [2 x double]* %9, i32 0, i32 1
store double -2.000000e+00, double* %11
%12 = getelementptr inbounds [3 x [2 x double]], [3 x [2 x double]]* %5, i32 0, i32 2
%13 = getelementptr inbounds [2 x double], [2 x double]* %12, i32 0, i32 0
store double -2.000000e+00, double* %13
%14 = getelementptr inbounds [2 x double], [2 x double]* %12, i32 0, i32 1
store double -4.000000e+00, double* %14
store double 1.370000e+00, double* %2
store double -4.900000e+00, double* %3
%15 = getelementptr inbounds [3 x [2 x double]], [3 x [2 x double]]* %1, i64 0, i64 0
%16 = bitcast [2 x double]* %15 to double**
%17 = load double, double* %2
%18 = load double, double* %3
%19 = call i32 @tdpolyval(double** %16, i32 3, i32 2, double %17, double %18)
%20 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i32 %19)
%21 = call i32 (...) @getch()
ret i32 0
}

LLVM IR (-O2):
@.str = [21 x i8] c"\0A The result is :%lf\00"
define i32 @main() {
%1 = alloca [3 x [2 x double]]
%2 = bitcast [3 x [2 x double]]* %1 to i8*
%3 = bitcast [3 x [2 x double]]* %1 to <2 x double>*
store <2 x double> <double 5.600000e+00, double 7.900000e+00>, <2 x double>* %3
%4 = getelementptr inbounds [3 x [2 x double]], [3 x [2 x double]]* %1, i64 0, i64 1, i64 0
%5 = bitcast double* %4 to <2 x double>*
store <2 x double> <double 4.400000e+00, double -2.000000e+00>, <2 x double>* %5
%6 = getelementptr inbounds [3 x [2 x double]], [3 x [2 x double]]* %1, i64 0, i64 2, i64 0
%7 = bitcast double* %6 to <2 x double>*
store <2 x double> <double -2.000000e+00, double -4.000000e+00>, <2 x double>* %7
%8 = bitcast [3 x [2 x double]]* %1 to double**
%9 = call i32 @tdpolyval(double** %8, i32 3, i32 2, double 1.370000e+00, double -4.900000e+00)
%10 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i32 %9)
%11 = call i32 (...) @getch()
ret i32 0
}