#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*/ EvalSpline1(float, float, float *);
int /*<<< orphan*/ EvalSpline2(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);
  }
  for (int k = 0; k < 1e6; k++) {
    EvalSpline1(x, y, out);
  }
  for (int k = 0; k < 1e6; k++) {
    EvalSpline2(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  0xead(%rip),%xmm0
movss  %xmm0,-0x8(%rbp)
movss  0xe9c(%rip),%xmm0
movss  %xmm0,-0xc(%rbp)
movl   $0x0,-0x34(%rbp)
cvtsi2sdl -0x34(%rbp),%xmm1
movsd  0xe8b(%rip),%xmm0
ucomisd %xmm1,%xmm0
jbe    11a8 <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    1170 <main+0x30>
movl   $0x0,-0x38(%rbp)
cvtsi2sdl -0x38(%rbp),%xmm1
movsd  0xe4c(%rip),%xmm0
ucomisd %xmm1,%xmm0
jbe    11e7 <main+0xa7>
movss  -0x8(%rbp),%xmm0
movss  -0xc(%rbp),%xmm1
lea    -0x30(%rbp),%rdi
call   1060 <EvalSpline1@plt>
mov    -0x38(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x38(%rbp)
jmp    11af <main+0x6f>
movl   $0x0,-0x3c(%rbp)
cvtsi2sdl -0x3c(%rbp),%xmm1
movsd  0xe0d(%rip),%xmm0
ucomisd %xmm1,%xmm0
jbe    1226 <main+0xe6>
movss  -0x8(%rbp),%xmm0
movss  -0xc(%rbp),%xmm1
lea    -0x30(%rbp),%rdi
call   1050 <EvalSpline2@plt>
mov    -0x3c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x3c(%rbp)
jmp    11ee <main+0xae>
movss  -0x30(%rbp),%xmm0
lea    0xdde(%rip),%rdi
call   1030 <printf@plt>
movss  -0x2c(%rbp),%xmm0
lea    0xdd5(%rip),%rdi
call   1030 <printf@plt>
movss  -0x28(%rbp),%xmm0
lea    0xdd1(%rip),%rdi
call   1030 <printf@plt>
movss  -0x24(%rbp),%xmm0
lea    0xdcd(%rip),%rdi
call   1030 <printf@plt>
movss  -0x20(%rbp),%xmm0
lea    0xdcb(%rip),%rdi
call   1030 <printf@plt>
movss  -0x1c(%rbp),%xmm0
lea    0xdc9(%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  0xea8(%rip),%xmm0
movss  0xea4(%rip),%xmm1
mov    %rbx,%rdi
call   1040 <EvalSpline0@plt>
add    $0xffffffff,%ebp
jne    1150 <main+0x10>
mov    $0xf4240,%ebp
mov    %rsp,%rbx
cs nopw 0x0(%rax,%rax,1)
nop
movss  0xe78(%rip),%xmm0
movss  0xe74(%rip),%xmm1
mov    %rbx,%rdi
call   1060 <EvalSpline1@plt>
add    $0xffffffff,%ebp
jne    1180 <main+0x40>
mov    $0xf4240,%ebp
mov    %rsp,%rbx
cs nopw 0x0(%rax,%rax,1)
nop
movss  0xe48(%rip),%xmm0
movss  0xe44(%rip),%xmm1
mov    %rbx,%rdi
call   1050 <EvalSpline2@plt>
add    $0xffffffff,%ebp
jne    11b0 <main+0x70>
movss  (%rsp),%xmm0
lea    0xe2f(%rip),%rdi
call   1030 <printf@plt>
movss  0x4(%rsp),%xmm0
lea    0xe25(%rip),%rdi
call   1030 <printf@plt>
movss  0x8(%rsp),%xmm0
lea    0xe20(%rip),%rdi
call   1030 <printf@plt>
movss  0xc(%rsp),%xmm0
lea    0xe1b(%rip),%rdi
call   1030 <printf@plt>
movss  0x10(%rsp),%xmm0
lea    0xe18(%rip),%rdi
call   1030 <printf@plt>
movss  0x14(%rsp),%xmm0
lea    0xe15(%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
%6 = alloca i32
%7 = 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 %8
8: ; preds = %17, %0
%9 = load i32, i32* %5
%10 = sitofp i32 %9 to double
%11 = fcmp olt double %10, 1.000000e+06
br i1 %11, label %12, label %20
12: ; preds = %8
%13 = load float, float* %2
%14 = load float, float* %3
%15 = getelementptr inbounds [6 x float], [6 x float]* %4, i64 0, i64 0
%16 = call i32 @EvalSpline0(float %13, float %14, float* %15)
br label %17
17: ; preds = %12
%18 = load i32, i32* %5
%19 = add nsw i32 %18, 1
store i32 %19, i32* %5
br label %8
20: ; preds = %8
store i32 0, i32* %6
br label %21
21: ; preds = %30, %20
%22 = load i32, i32* %6
%23 = sitofp i32 %22 to double
%24 = fcmp olt double %23, 1.000000e+06
br i1 %24, label %25, label %33
25: ; preds = %21
%26 = load float, float* %2
%27 = load float, float* %3
%28 = getelementptr inbounds [6 x float], [6 x float]* %4, i64 0, i64 0
%29 = call i32 @EvalSpline1(float %26, float %27, float* %28)
br label %30
30: ; preds = %25
%31 = load i32, i32* %6
%32 = add nsw i32 %31, 1
store i32 %32, i32* %6
br label %21
33: ; preds = %21
store i32 0, i32* %7
br label %34
34: ; preds = %43, %33
%35 = load i32, i32* %7
%36 = sitofp i32 %35 to double
%37 = fcmp olt double %36, 1.000000e+06
br i1 %37, label %38, label %46
38: ; preds = %34
%39 = load float, float* %2
%40 = load float, float* %3
%41 = getelementptr inbounds [6 x float], [6 x float]* %4, i64 0, i64 0
%42 = call i32 @EvalSpline2(float %39, float %40, float* %41)
br label %43
43: ; preds = %38
%44 = load i32, i32* %7
%45 = add nsw i32 %44, 1
store i32 %45, i32* %7
br label %34
46: ; preds = %34
%47 = getelementptr inbounds [6 x float], [6 x float]* %4, i64 0, i64 0
%48 = load float, float* %47
%49 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), float %48)
%50 = getelementptr inbounds [6 x float], [6 x float]* %4, i64 0, i64 1
%51 = load float, float* %50
%52 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), float %51)
%53 = getelementptr inbounds [6 x float], [6 x float]* %4, i64 0, i64 2
%54 = load float, float* %53
%55 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0), float %54)
%56 = getelementptr inbounds [6 x float], [6 x float]* %4, i64 0, i64 3
%57 = load float, float* %56
%58 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.3, i64 0, i64 0), float %57)
%59 = getelementptr inbounds [6 x float], [6 x float]* %4, i64 0, i64 4
%60 = load float, float* %59
%61 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.4, i64 0, i64 0), float %60)
%62 = getelementptr inbounds [6 x float], [6 x float]* %4, i64 0, i64 5
%63 = load float, float* %62
%64 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.5, i64 0, i64 0), float %63)
%65 = load i32, i32* %1
ret i32 %65
}

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 %4
4: ; preds = %0, %4
%5 = phi i32 [ 0, %0 ], [ %7, %4 ]
%6 = call i32 @EvalSpline0(float 5.000000e+00, float 3.000000e+00, float* %3)
%7 = add nuw nsw i32 %5, 1
%8 = icmp eq i32 %7, 1000000
br i1 %8, label %9, label %4
9: ; preds = %4, %9
%10 = phi i32 [ %12, %9 ], [ 0, %4 ]
%11 = call i32 @EvalSpline1(float 5.000000e+00, float 3.000000e+00, float* %3)
%12 = add nuw nsw i32 %10, 1
%13 = icmp eq i32 %12, 1000000
br i1 %13, label %32, label %9
14: ; preds = %32
%15 = load float, float* %3
%16 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), float %15)
%17 = getelementptr inbounds [6 x float], [6 x float]* %1, i64 0, i64 1
%18 = load float, float* %17
%19 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), float %18)
%20 = getelementptr inbounds [6 x float], [6 x float]* %1, i64 0, i64 2
%21 = load float, float* %20
%22 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0), float %21)
%23 = getelementptr inbounds [6 x float], [6 x float]* %1, i64 0, i64 3
%24 = load float, float* %23
%25 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.3, i64 0, i64 0), float %24)
%26 = getelementptr inbounds [6 x float], [6 x float]* %1, i64 0, i64 4
%27 = load float, float* %26
%28 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.4, i64 0, i64 0), float %27)
%29 = getelementptr inbounds [6 x float], [6 x float]* %1, i64 0, i64 5
%30 = load float, float* %29
%31 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.5, i64 0, i64 0), float %30)
ret i32 0
32: ; preds = %9, %32
%33 = phi i32 [ %35, %32 ], [ 0, %9 ]
%34 = call i32 @EvalSpline2(float 5.000000e+00, float 3.000000e+00, float* %3)
%35 = add nuw nsw i32 %33, 1
%36 = icmp eq i32 %35, 1000000
br i1 %36, label %14, label %32
}