#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*/ printf(char *);
int /*<<< orphan*/ spline(int, double *, double *);
int main() {
  double x1[] = {0.0, 0.5};
  double y1[] = {1.0, 2.71828};
  int n1 = 2;
  double x2[] = {-0.25, 0.25};
  double y2[] = {1.33203, 0.800781};
  int n2 = 2;
  double x3[] = {0.1, 0.2, 0.3};
  double y3[] = {-0.29004996, -0.56079734, -0.81401972};
  int n3 = 3;
  double x4[] = {-1.0, -0.5, 0.0, 0.5};
  double y4[] = {0.86199480, 0.95802009, 1.0986123, 1.2943767};
  int n4 = 4;
  double x5[] = {0.0, 0.25, 0.75, 1.0};
  double y5[] = {1.0, 0.778800783, 0.472366553, 0.367879441};
  int n5 = 4;
  printf("4a)\n");
  spline(n1, x1, y1);
  printf("\nb)\n");
  spline(n2, x2, y2);
  printf("\nc)\n");
  spline(n3, x3, y3);
  printf("\nd)\n");
  spline(n4, x4, y4);
  printf("\n16)\n");
  spline(n5, x5, y5);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x140,%rsp
mov    0xece(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    0xecb(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    0xec8(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xec5(%rip),%rax
mov    %rax,-0x18(%rbp)
movl   $0x2,-0x24(%rbp)
mov    0xebb(%rip),%rax
mov    %rax,-0x40(%rbp)
mov    0xeb8(%rip),%rax
mov    %rax,-0x38(%rbp)
mov    0xeb5(%rip),%rax
mov    %rax,-0x50(%rbp)
mov    0xeb2(%rip),%rax
mov    %rax,-0x48(%rbp)
movl   $0x2,-0x54(%rbp)
mov    0xea8(%rip),%rax
mov    %rax,-0x70(%rbp)
mov    0xea5(%rip),%rax
mov    %rax,-0x68(%rbp)
mov    0xea2(%rip),%rax
mov    %rax,-0x60(%rbp)
mov    0xea7(%rip),%rax
mov    %rax,-0x90(%rbp)
mov    0xea1(%rip),%rax
mov    %rax,-0x88(%rbp)
mov    0xe9b(%rip),%rax
mov    %rax,-0x80(%rbp)
movl   $0x3,-0x94(%rbp)
mov    0xe96(%rip),%rax
mov    %rax,-0xc0(%rbp)
mov    0xe90(%rip),%rax
mov    %rax,-0xb8(%rbp)
mov    0xe8a(%rip),%rax
mov    %rax,-0xb0(%rbp)
mov    0xe84(%rip),%rax
mov    %rax,-0xa8(%rbp)
mov    0xe7e(%rip),%rax
mov    %rax,-0xe0(%rbp)
mov    0xe78(%rip),%rax
mov    %rax,-0xd8(%rbp)
mov    0xe72(%rip),%rax
mov    %rax,-0xd0(%rbp)
mov    0xe6c(%rip),%rax
mov    %rax,-0xc8(%rbp)
movl   $0x4,-0xe4(%rbp)
mov    0xe5c(%rip),%rax
mov    %rax,-0x110(%rbp)
mov    0xe56(%rip),%rax
mov    %rax,-0x108(%rbp)
mov    0xe50(%rip),%rax
mov    %rax,-0x100(%rbp)
mov    0xe4a(%rip),%rax
mov    %rax,-0xf8(%rbp)
mov    0xe44(%rip),%rax
mov    %rax,-0x130(%rbp)
mov    0xe3e(%rip),%rax
mov    %rax,-0x128(%rbp)
mov    0xe38(%rip),%rax
mov    %rax,-0x120(%rbp)
mov    0xe32(%rip),%rax
mov    %rax,-0x118(%rbp)
movl   $0x4,-0x134(%rbp)
lea    0xe22(%rip),%rdi
call   1030 <printf@plt>
mov    -0x24(%rbp),%edi
lea    -0x10(%rbp),%rsi
lea    -0x20(%rbp),%rdx
call   1040 <spline@plt>
lea    0xe0b(%rip),%rdi
call   1030 <printf@plt>
mov    -0x54(%rbp),%edi
lea    -0x40(%rbp),%rsi
lea    -0x50(%rbp),%rdx
call   1040 <spline@plt>
lea    0xdf4(%rip),%rdi
call   1030 <printf@plt>
mov    -0x94(%rbp),%edi
lea    -0x70(%rbp),%rsi
lea    -0x90(%rbp),%rdx
call   1040 <spline@plt>
lea    0xdd7(%rip),%rdi
call   1030 <printf@plt>
mov    -0xe4(%rbp),%edi
lea    -0xc0(%rbp),%rsi
lea    -0xe0(%rbp),%rdx
call   1040 <spline@plt>
lea    0xdb7(%rip),%rdi
call   1030 <printf@plt>
mov    -0x134(%rbp),%edi
lea    -0x110(%rbp),%rsi
lea    -0x130(%rbp),%rdx
call   1040 <spline@plt>
xor    %eax,%eax
add    $0x140,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x108,%rsp
movaps 0xed2(%rip),%xmm0
movaps %xmm0,0x70(%rsp)
movaps 0xed6(%rip),%xmm0
movaps %xmm0,0x60(%rsp)
movaps 0xeda(%rip),%xmm0
movaps %xmm0,0x50(%rsp)
movaps 0xede(%rip),%xmm0
movaps %xmm0,0x40(%rsp)
mov    0xef2(%rip),%rax
mov    %rax,0x30(%rsp)
movaps 0xed6(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
mov    0xefa(%rip),%rax
mov    %rax,0x10(%rsp)
movaps 0xede(%rip),%xmm0
movaps %xmm0,(%rsp)
movaps 0xf03(%rip),%xmm0
movaps %xmm0,0xf0(%rsp)
movaps 0xee4(%rip),%xmm0
movaps %xmm0,0xe0(%rsp)
movaps 0xf05(%rip),%xmm0
movaps %xmm0,0xd0(%rsp)
movaps 0xee6(%rip),%xmm0
movaps %xmm0,0xc0(%rsp)
movaps 0xf07(%rip),%xmm0
movaps %xmm0,0xb0(%rsp)
movaps 0xee8(%rip),%xmm0
movaps %xmm0,0xa0(%rsp)
movaps 0xf09(%rip),%xmm0
movaps %xmm0,0x90(%rsp)
movaps 0xeea(%rip),%xmm0
movaps %xmm0,0x80(%rsp)
lea    0xefb(%rip),%rdi
call   1030 <puts@plt>
lea    0x70(%rsp),%rsi
lea    0x60(%rsp),%rdx
mov    $0x2,%edi
call   1040 <spline@plt>
lea    0xedf(%rip),%rdi
call   1030 <puts@plt>
lea    0x50(%rsp),%rsi
lea    0x40(%rsp),%rdx
mov    $0x2,%edi
call   1040 <spline@plt>
lea    0xec3(%rip),%rdi
call   1030 <puts@plt>
lea    0x20(%rsp),%rsi
mov    %rsp,%rdx
mov    $0x3,%edi
call   1040 <spline@plt>
lea    0xea9(%rip),%rdi
call   1030 <puts@plt>
lea    0xe0(%rsp),%rsi
lea    0xc0(%rsp),%rdx
mov    $0x4,%edi
call   1040 <spline@plt>
lea    0xe87(%rip),%rdi
call   1030 <puts@plt>
lea    0xa0(%rsp),%rsi
lea    0x80(%rsp),%rdx
mov    $0x4,%edi
call   1040 <spline@plt>
xor    %eax,%eax
add    $0x108,%rsp
ret

LLVM IR (-O0):
@__const.main.x1 = [2 x double] [double 0.000000e+00, double 5.000000e-01]
@__const.main.y1 = [2 x double] [double 1.000000e+00, double 2.718280e+00]
@__const.main.x2 = [2 x double] [double -2.500000e-01, double 2.500000e-01]
@__const.main.y2 = [2 x double] [double 1.332030e+00, double 0x3FE99FFF79C842FA]
@__const.main.x3 = [3 x double] [double 1.000000e-01, double 2.000000e-01, double 3.000000e-01]
@__const.main.y3 = [3 x double] [double 0xBFD2902DB519FDAD, double 0xBFE1F20D435F7B3B, double 0xBFEA0C7315765ED7]
@__const.main.x4 = [4 x double] [double -1.000000e+00, double -5.000000e-01, double 0.000000e+00, double 5.000000e-01]
@__const.main.y4 = [4 x double] [double 0x3FEB95761E6A4E52, double 0x3FEEA819BF6EC052, double 0x3FF193EA7DB7BBC4, double 0x3FF4B5C457B3453C]
@__const.main.x5 = [4 x double] [double 0.000000e+00, double 2.500000e-01, double 7.500000e-01, double 1.000000e+00]
@__const.main.y5 = [4 x double] [double 1.000000e+00, double 0x3FE8EBEF9EA2B1B5, double 0x3FDE3B40EC36FDF7, double 0x3FD78B5635FDCF09]
@.str = [5 x i8] c"4a)\0A\00"
@.str.1 = [5 x i8] c"\0Ab)\0A\00"
@.str.2 = [5 x i8] c"\0Ac)\0A\00"
@.str.3 = [5 x i8] c"\0Ad)\0A\00"
@.str.4 = [6 x i8] c"\0A16)\0A\00"
define i32 @main() {
%1 = alloca [2 x double]
%2 = alloca [2 x double]
%3 = alloca i32
%4 = alloca [2 x double]
%5 = alloca [2 x double]
%6 = alloca i32
%7 = alloca [3 x double]
%8 = alloca [3 x double]
%9 = alloca i32
%10 = alloca [4 x double]
%11 = alloca [4 x double]
%12 = alloca i32
%13 = alloca [4 x double]
%14 = alloca [4 x double]
%15 = alloca i32
%16 = bitcast [2 x double]* %1 to i8*
%17 = bitcast [2 x double]* %2 to i8*
store i32 2, i32* %3
%18 = bitcast [2 x double]* %4 to i8*
%19 = bitcast [2 x double]* %5 to i8*
store i32 2, i32* %6
%20 = bitcast [3 x double]* %7 to i8*
%21 = bitcast [3 x double]* %8 to i8*
store i32 3, i32* %9
%22 = bitcast [4 x double]* %10 to i8*
%23 = bitcast [4 x double]* %11 to i8*
store i32 4, i32* %12
%24 = bitcast [4 x double]* %13 to i8*
%25 = bitcast [4 x double]* %14 to i8*
store i32 4, i32* %15
%26 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%27 = load i32, i32* %3
%28 = getelementptr inbounds [2 x double], [2 x double]* %1, i64 0, i64 0
%29 = getelementptr inbounds [2 x double], [2 x double]* %2, i64 0, i64 0
%30 = call i32 @spline(i32 %27, double* %28, double* %29)
%31 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%32 = load i32, i32* %6
%33 = getelementptr inbounds [2 x double], [2 x double]* %4, i64 0, i64 0
%34 = getelementptr inbounds [2 x double], [2 x double]* %5, i64 0, i64 0
%35 = call i32 @spline(i32 %32, double* %33, double* %34)
%36 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0))
%37 = load i32, i32* %9
%38 = getelementptr inbounds [3 x double], [3 x double]* %7, i64 0, i64 0
%39 = getelementptr inbounds [3 x double], [3 x double]* %8, i64 0, i64 0
%40 = call i32 @spline(i32 %37, double* %38, double* %39)
%41 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0))
%42 = load i32, i32* %12
%43 = getelementptr inbounds [4 x double], [4 x double]* %10, i64 0, i64 0
%44 = getelementptr inbounds [4 x double], [4 x double]* %11, i64 0, i64 0
%45 = call i32 @spline(i32 %42, double* %43, double* %44)
%46 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0))
%47 = load i32, i32* %15
%48 = getelementptr inbounds [4 x double], [4 x double]* %13, i64 0, i64 0
%49 = getelementptr inbounds [4 x double], [4 x double]* %14, i64 0, i64 0
%50 = call i32 @spline(i32 %47, double* %48, double* %49)
ret i32 0
}

LLVM IR (-O2):
@__const.main.x1 = [2 x double] [double 0.000000e+00, double 5.000000e-01]
@__const.main.y1 = [2 x double] [double 1.000000e+00, double 2.718280e+00]
@__const.main.x2 = [2 x double] [double -2.500000e-01, double 2.500000e-01]
@__const.main.y2 = [2 x double] [double 1.332030e+00, double 0x3FE99FFF79C842FA]
@__const.main.x3 = [3 x double] [double 1.000000e-01, double 2.000000e-01, double 3.000000e-01]
@__const.main.y3 = [3 x double] [double 0xBFD2902DB519FDAD, double 0xBFE1F20D435F7B3B, double 0xBFEA0C7315765ED7]
@__const.main.x4 = [4 x double] [double -1.000000e+00, double -5.000000e-01, double 0.000000e+00, double 5.000000e-01]
@__const.main.y4 = [4 x double] [double 0x3FEB95761E6A4E52, double 0x3FEEA819BF6EC052, double 0x3FF193EA7DB7BBC4, double 0x3FF4B5C457B3453C]
@__const.main.x5 = [4 x double] [double 0.000000e+00, double 2.500000e-01, double 7.500000e-01, double 1.000000e+00]
@__const.main.y5 = [4 x double] [double 1.000000e+00, double 0x3FE8EBEF9EA2B1B5, double 0x3FDE3B40EC36FDF7, double 0x3FD78B5635FDCF09]
@str = [4 x i8] c"4a)\00"
@str.5 = [4 x i8] c"\0Ab)\00"
@str.6 = [4 x i8] c"\0Ac)\00"
@str.7 = [4 x i8] c"\0Ad)\00"
@str.8 = [5 x i8] c"\0A16)\00"
define i32 @main() {
%1 = alloca [2 x double]
%2 = alloca [2 x double]
%3 = alloca [2 x double]
%4 = alloca [2 x double]
%5 = alloca [3 x double]
%6 = alloca [3 x double]
%7 = alloca [4 x double]
%8 = alloca [4 x double]
%9 = alloca [4 x double]
%10 = alloca [4 x double]
%11 = bitcast [2 x double]* %1 to i8*
%12 = bitcast [2 x double]* %2 to i8*
%13 = bitcast [2 x double]* %3 to i8*
%14 = bitcast [2 x double]* %4 to i8*
%15 = bitcast [3 x double]* %5 to i8*
%16 = bitcast [3 x double]* %6 to i8*
%17 = bitcast [4 x double]* %7 to i8*
%18 = bitcast [4 x double]* %8 to i8*
%19 = bitcast [4 x double]* %9 to i8*
%20 = bitcast [4 x double]* %10 to i8*
%21 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @str, i64 0, i64 0))
%22 = getelementptr inbounds [2 x double], [2 x double]* %1, i64 0, i64 0
%23 = getelementptr inbounds [2 x double], [2 x double]* %2, i64 0, i64 0
%24 = call i32 @spline(i32 2, double* %22, double* %23)
%25 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @str.5, i64 0, i64 0))
%26 = getelementptr inbounds [2 x double], [2 x double]* %3, i64 0, i64 0
%27 = getelementptr inbounds [2 x double], [2 x double]* %4, i64 0, i64 0
%28 = call i32 @spline(i32 2, double* %26, double* %27)
%29 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @str.6, i64 0, i64 0))
%30 = getelementptr inbounds [3 x double], [3 x double]* %5, i64 0, i64 0
%31 = getelementptr inbounds [3 x double], [3 x double]* %6, i64 0, i64 0
%32 = call i32 @spline(i32 3, double* %30, double* %31)
%33 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @str.7, i64 0, i64 0))
%34 = getelementptr inbounds [4 x double], [4 x double]* %7, i64 0, i64 0
%35 = getelementptr inbounds [4 x double], [4 x double]* %8, i64 0, i64 0
%36 = call i32 @spline(i32 4, double* %34, double* %35)
%37 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @str.8, i64 0, i64 0))
%38 = getelementptr inbounds [4 x double], [4 x double]* %9, i64 0, i64 0
%39 = getelementptr inbounds [4 x double], [4 x double]* %10, i64 0, i64 0
%40 = call i32 @spline(i32 4, double* %38, double* %39)
ret i32 0
}