#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*/ EvalSpline0(float, float, float *);
int /*<<< orphan*/ printf(char *, float);
int main() {
  float x = 5.;
  float y = 3.;
  float out[6];
  for (int k = 0; k < 1e6; k++) {
    EvalSpline0(x, y, out);
  }
  printf("s = %f\n", out[0]);
  printf("ds/dx = %f \n", out[1]);
  printf("ds/dy = %f \n", out[2]);
  printf("d2s/dx2 = %f \n", out[3]);
  printf("d2s/dy2 = %f \n", out[4]);
  printf("d2s/dxdy = %f \n", out[5]);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
movss  0xecd(%rip),%xmm0
movss  %xmm0,-0x8(%rbp)
movss  0xebc(%rip),%xmm0
movss  %xmm0,-0xc(%rbp)
movl   $0x0,-0x34(%rbp)
cvtsi2sdl -0x34(%rbp),%xmm1
movsd  0xeab(%rip),%xmm0
ucomisd %xmm1,%xmm0
jbe    1188 <main+0x68>
movss  -0x8(%rbp),%xmm0
movss  -0xc(%rbp),%xmm1
lea    -0x30(%rbp),%rdi
call   1040 <EvalSpline0@plt>
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    1150 <main+0x30>
movss  -0x30(%rbp),%xmm0
lea    0xe7c(%rip),%rdi
call   1030 <printf@plt>
movss  -0x2c(%rbp),%xmm0
lea    0xe73(%rip),%rdi
call   1030 <printf@plt>
movss  -0x28(%rbp),%xmm0
lea    0xe6f(%rip),%rdi
call   1030 <printf@plt>
movss  -0x24(%rbp),%xmm0
lea    0xe6b(%rip),%rdi
call   1030 <printf@plt>
movss  -0x20(%rbp),%xmm0
lea    0xe69(%rip),%rdi
call   1030 <printf@plt>
movss  -0x1c(%rbp),%xmm0
lea    0xe67(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
sub    $0x18,%rsp
mov    $0xf4240,%ebp
mov    %rsp,%rbx
xchg   %ax,%ax
movss  0xec8(%rip),%xmm0
movss  0xec4(%rip),%xmm1
mov    %rbx,%rdi
call   1040 <EvalSpline0@plt>
add    $0xffffffff,%ebp
jne    1130 <main+0x10>
movss  (%rsp),%xmm0
lea    0xeaf(%rip),%rdi
call   1030 <printf@plt>
movss  0x4(%rsp),%xmm0
lea    0xea5(%rip),%rdi
call   1030 <printf@plt>
movss  0x8(%rsp),%xmm0
lea    0xea0(%rip),%rdi
call   1030 <printf@plt>
movss  0xc(%rsp),%xmm0
lea    0xe9b(%rip),%rdi
call   1030 <printf@plt>
movss  0x10(%rsp),%xmm0
lea    0xe98(%rip),%rdi
call   1030 <printf@plt>
movss  0x14(%rsp),%xmm0
lea    0xe95(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [8 x i8] c"s = %f\0A\00"
@.str.1 = [13 x i8] c"ds/dx = %f \0A\00"
@.str.2 = [13 x i8] c"ds/dy = %f \0A\00"
@.str.3 = [15 x i8] c"d2s/dx2 = %f \0A\00"
@.str.4 = [15 x i8] c"d2s/dy2 = %f \0A\00"
@.str.5 = [16 x i8] c"d2s/dxdy = %f \0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca float
%3 = alloca float
%4 = alloca [6 x float]
%5 = alloca i32
store i32 0, i32* %1
store float 5.000000e+00, float* %2
store float 3.000000e+00, float* %3
store i32 0, i32* %5
br label %6
6: ; preds = %15, %0
%7 = load i32, i32* %5
%8 = sitofp i32 %7 to double
%9 = fcmp olt double %8, 1.000000e+06
br i1 %9, label %10, label %18
10: ; preds = %6
%11 = load float, float* %2
%12 = load float, float* %3
%13 = getelementptr inbounds [6 x float], [6 x float]* %4, i64 0, i64 0
%14 = call i32 @EvalSpline0(float %11, float %12, float* %13)
br label %15
15: ; preds = %10
%16 = load i32, i32* %5
%17 = add nsw i32 %16, 1
store i32 %17, i32* %5
br label %6
18: ; preds = %6
%19 = getelementptr inbounds [6 x float], [6 x float]* %4, i64 0, i64 0
%20 = load float, float* %19
%21 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), float %20)
%22 = getelementptr inbounds [6 x float], [6 x float]* %4, i64 0, i64 1
%23 = load float, float* %22
%24 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), float %23)
%25 = getelementptr inbounds [6 x float], [6 x float]* %4, i64 0, i64 2
%26 = load float, float* %25
%27 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0), float %26)
%28 = getelementptr inbounds [6 x float], [6 x float]* %4, i64 0, i64 3
%29 = load float, float* %28
%30 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.3, i64 0, i64 0), float %29)
%31 = getelementptr inbounds [6 x float], [6 x float]* %4, i64 0, i64 4
%32 = load float, float* %31
%33 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.4, i64 0, i64 0), float %32)
%34 = getelementptr inbounds [6 x float], [6 x float]* %4, i64 0, i64 5
%35 = load float, float* %34
%36 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.5, i64 0, i64 0), float %35)
%37 = load i32, i32* %1
ret i32 %37
}

LLVM IR (-O2):
@.str = [8 x i8] c"s = %f\0A\00"
@.str.1 = [13 x i8] c"ds/dx = %f \0A\00"
@.str.2 = [13 x i8] c"ds/dy = %f \0A\00"
@.str.3 = [15 x i8] c"d2s/dx2 = %f \0A\00"
@.str.4 = [15 x i8] c"d2s/dy2 = %f \0A\00"
@.str.5 = [16 x i8] c"d2s/dxdy = %f \0A\00"
define i32 @main() {
%1 = alloca [6 x float]
%2 = bitcast [6 x float]* %1 to i8*
%3 = getelementptr inbounds [6 x float], [6 x float]* %1, i64 0, i64 0
br label %22
4: ; preds = %22
%5 = load float, float* %3
%6 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), float %5)
%7 = getelementptr inbounds [6 x float], [6 x float]* %1, i64 0, i64 1
%8 = load float, float* %7
%9 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), float %8)
%10 = getelementptr inbounds [6 x float], [6 x float]* %1, i64 0, i64 2
%11 = load float, float* %10
%12 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0), float %11)
%13 = getelementptr inbounds [6 x float], [6 x float]* %1, i64 0, i64 3
%14 = load float, float* %13
%15 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.3, i64 0, i64 0), float %14)
%16 = getelementptr inbounds [6 x float], [6 x float]* %1, i64 0, i64 4
%17 = load float, float* %16
%18 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.4, i64 0, i64 0), float %17)
%19 = getelementptr inbounds [6 x float], [6 x float]* %1, i64 0, i64 5
%20 = load float, float* %19
%21 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.5, i64 0, i64 0), float %20)
ret i32 0
22: ; preds = %0, %22
%23 = phi i32 [ 0, %0 ], [ %25, %22 ]
%24 = call i32 @EvalSpline0(float 5.000000e+00, float 3.000000e+00, float* %3)
%25 = add nuw nsw i32 %23, 1
%26 = icmp eq i32 %25, 1000000
br i1 %26, label %4, label %22
}