#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 */
typedef int /*<<< orphan*/ y;

/* Variables and functions */
int /*<<< orphan*/ lspa_cleanup();
int /*<<< orphan*/ lspa_get_coefficient();
int /*<<< orphan*/ lspa_set_discrete_data(double *, double *, int);
int main() {
  double x[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16};
  double y[] = {4.00,  6.40,  8.00,  8.80,  9.22,  9.50,  9.70,  9.86,
                10.00, 10.20, 10.32, 10.42, 10.50, 10.55, 10.58, 10.60};
  lspa_set_discrete_data(x, y, sizeof(y) / sizeof(double));
  lspa_get_coefficient();
  lspa_cleanup();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x110,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x90(%rbp),%rdi
lea    0xea0(%rip),%rsi
mov    $0x80,%edx
call   1040 <memcpy@plt>
lea    -0x110(%rbp),%rdi
lea    0xf08(%rip),%rsi
mov    $0x80,%edx
call   1040 <memcpy@plt>
lea    -0x90(%rbp),%rdi
lea    -0x110(%rbp),%rsi
mov    $0x10,%edx
call   1030 <lspa_set_discrete_data@plt>
mov    $0x0,%al
call   1050 <lspa_get_coefficient@plt>
mov    $0x0,%al
call   1060 <lspa_cleanup@plt>
xor    %eax,%eax
add    $0x110,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x108,%rsp
movaps 0xf32(%rip),%xmm0
movaps %xmm0,0xf0(%rsp)
movaps 0xf13(%rip),%xmm0
movaps %xmm0,0xe0(%rsp)
movaps 0xef4(%rip),%xmm0
movaps %xmm0,0xd0(%rsp)
movaps 0xed5(%rip),%xmm0
movaps %xmm0,0xc0(%rsp)
movaps 0xeb6(%rip),%xmm0
movaps %xmm0,0xb0(%rsp)
movaps 0xe97(%rip),%xmm0
movaps %xmm0,0xa0(%rsp)
movaps 0xe78(%rip),%xmm0
movaps %xmm0,0x90(%rsp)
movaps 0xe59(%rip),%xmm0
movaps %xmm0,0x80(%rsp)
movaps 0xf3a(%rip),%xmm0
movaps %xmm0,0x70(%rsp)
movaps 0xf1e(%rip),%xmm0
movaps %xmm0,0x60(%rsp)
movaps 0xf02(%rip),%xmm0
movaps %xmm0,0x50(%rsp)
movaps 0xee6(%rip),%xmm0
movaps %xmm0,0x40(%rsp)
movaps 0xeca(%rip),%xmm0
movaps %xmm0,0x30(%rsp)
movaps 0xeae(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
movaps 0xe92(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xe76(%rip),%xmm0
movaps %xmm0,(%rsp)
lea    0x80(%rsp),%rdi
mov    %rsp,%rsi
mov    $0x10,%edx
call   1030 <lspa_set_discrete_data@plt>
xor    %eax,%eax
call   1040 <lspa_get_coefficient@plt>
xor    %eax,%eax
call   1050 <lspa_cleanup@plt>
xor    %eax,%eax
add    $0x108,%rsp
ret

LLVM IR (-O0):
@__const.main.x = [16 x double] [double 1.000000e+00, double 2.000000e+00, double 3.000000e+00, double 4.000000e+00, double 5.000000e+00, double 6.000000e+00, double 7.000000e+00, double 8.000000e+00, double 9.000000e+00, double 1.000000e+01, double 1.100000e+01, double 1.200000e+01, double 1.300000e+01, double 1.400000e+01, double 1.500000e+01, double 1.600000e+01]
@__const.main.y = [16 x double] [double 4.000000e+00, double 6.400000e+00, double 8.000000e+00, double 8.800000e+00, double 9.220000e+00, double 9.500000e+00, double 0x4023666666666666, double 0x4023B851EB851EB8, double 1.000000e+01, double 1.020000e+01, double 1.032000e+01, double 1.042000e+01, double 1.050000e+01, double 1.055000e+01, double 1.058000e+01, double 1.060000e+01]
define i32 @main() {
%1 = alloca i32
%2 = alloca [16 x double]
%3 = alloca [16 x double]
store i32 0, i32* %1
%4 = bitcast [16 x double]* %2 to i8*
%5 = bitcast [16 x double]* %3 to i8*
%6 = getelementptr inbounds [16 x double], [16 x double]* %2, i64 0, i64 0
%7 = getelementptr inbounds [16 x double], [16 x double]* %3, i64 0, i64 0
%8 = call i32 @lspa_set_discrete_data(double* %6, double* %7, i32 16)
%9 = call i32 (...) @lspa_get_coefficient()
%10 = call i32 (...) @lspa_cleanup()
ret i32 0
}

LLVM IR (-O2):
@__const.main.x = [16 x double] [double 1.000000e+00, double 2.000000e+00, double 3.000000e+00, double 4.000000e+00, double 5.000000e+00, double 6.000000e+00, double 7.000000e+00, double 8.000000e+00, double 9.000000e+00, double 1.000000e+01, double 1.100000e+01, double 1.200000e+01, double 1.300000e+01, double 1.400000e+01, double 1.500000e+01, double 1.600000e+01]
@__const.main.y = [16 x double] [double 4.000000e+00, double 6.400000e+00, double 8.000000e+00, double 8.800000e+00, double 9.220000e+00, double 9.500000e+00, double 0x4023666666666666, double 0x4023B851EB851EB8, double 1.000000e+01, double 1.020000e+01, double 1.032000e+01, double 1.042000e+01, double 1.050000e+01, double 1.055000e+01, double 1.058000e+01, double 1.060000e+01]
define i32 @main() {
%1 = alloca [16 x double]
%2 = alloca [16 x double]
%3 = bitcast [16 x double]* %1 to i8*
%4 = bitcast [16 x double]* %2 to i8*
%5 = getelementptr inbounds [16 x double], [16 x double]* %1, i64 0, i64 0
%6 = getelementptr inbounds [16 x double], [16 x double]* %2, i64 0, i64 0
%7 = call i32 @lspa_set_discrete_data(double* %5, double* %6, i32 16)
%8 = call i32 (...) @lspa_get_coefficient()
%9 = call i32 (...) @lspa_cleanup()
ret i32 0
}