#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*/ free_vector(float *, int, int);
float *vector(int, int);
void splin2(float x1a[], float x2a[], float **ya, float **y2a, int m, int n,
            float x1, float x2, float *y) {
  void spline(float x[], float y[], int n, float yp1, float ypn, float y2[]);
  void splint(float xa[], float ya[], float y2a[], int n, float x, float *y);
  int j;
  float *ytmp, *yytmp;
  ytmp = vector(1, m);
  yytmp = vector(1, m);
  for (j = 1; j <= m; j++)
    splint(x2a, ya[j], y2a[j], n, x2, &yytmp[j]);
  spline(x1a, yytmp, m, 1.0e30, 1.0e30, ytmp);
  splint(x1a, yytmp, ytmp, m, x1, y);
  free_vector(yytmp, 1, m);
  free_vector(ytmp, 1, m);
}


x86 assembly (clang, -O0):
<splin2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    0x10(%rbp),%rax
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8d,-0x24(%rbp)
mov    %r9d,-0x28(%rbp)
movss  %xmm0,-0x2c(%rbp)
movss  %xmm1,-0x30(%rbp)
mov    -0x24(%rbp),%esi
mov    $0x1,%edi
call   1050 <vector@plt>
mov    %rax,-0x40(%rbp)
mov    -0x24(%rbp),%esi
mov    $0x1,%edi
call   1050 <vector@plt>
mov    %rax,-0x48(%rbp)
movl   $0x1,-0x34(%rbp)
mov    -0x34(%rbp),%eax
cmp    -0x24(%rbp),%eax
jg     11e9 <splin2+0xa9>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rax
movslq -0x34(%rbp),%rcx
mov    (%rax,%rcx,8),%rsi
mov    -0x20(%rbp),%rax
movslq -0x34(%rbp),%rcx
mov    (%rax,%rcx,8),%rdx
mov    -0x28(%rbp),%ecx
movss  -0x30(%rbp),%xmm0
mov    -0x48(%rbp),%r8
movslq -0x34(%rbp),%rax
shl    $0x2,%rax
add    %rax,%r8
call   1030 <splint@plt>
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    1197 <splin2+0x57>
mov    -0x8(%rbp),%rdi
mov    -0x48(%rbp),%rsi
mov    -0x24(%rbp),%edx
mov    -0x40(%rbp),%rcx
movss  0xe00(%rip),%xmm1
movaps %xmm1,%xmm0
call   1060 <spline@plt>
mov    -0x8(%rbp),%rdi
mov    -0x48(%rbp),%rsi
mov    -0x40(%rbp),%rdx
mov    -0x24(%rbp),%ecx
movss  -0x2c(%rbp),%xmm0
mov    0x10(%rbp),%r8
call   1030 <splint@plt>
mov    -0x48(%rbp),%rdi
mov    -0x24(%rbp),%edx
mov    $0x1,%esi
call   1040 <free_vector@plt>
mov    -0x40(%rbp),%rdi
mov    -0x24(%rbp),%edx
mov    $0x1,%esi
call   1040 <free_vector@plt>
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<splin2>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x28,%rsp
movss  %xmm1,0xc(%rsp)
movss  %xmm0,0x4(%rsp)
mov    %r9d,0x8(%rsp)
mov    %r8d,%ebp
mov    %rcx,%r15
mov    %rdx,%r12
mov    %rsi,%r14
mov    %rdi,0x10(%rsp)
mov    0x60(%rsp),%rax
mov    %rax,0x18(%rsp)
mov    $0x1,%edi
mov    %r8d,%esi
call   1050 <vector@plt>
mov    %rax,0x20(%rsp)
mov    $0x1,%edi
mov    %ebp,%esi
call   1050 <vector@plt>
mov    %rax,%rbx
mov    %ebp,(%rsp)
test   %ebp,%ebp
jle    11e7 <splin2+0xa7>
mov    (%rsp),%eax
lea    0x4(,%rax,4),%r13
mov    $0x4,%ebp
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    (%r12,%rbp,2),%rsi
mov    (%r15,%rbp,2),%rdx
lea    (%rbx,%rbp,1),%r8
mov    %r14,%rdi
mov    0x8(%rsp),%ecx
movss  0xc(%rsp),%xmm0
call   1030 <splint@plt>
add    $0x4,%rbp
cmp    %rbp,%r13
jne    11c0 <splin2+0x80>
movss  0xe11(%rip),%xmm0
mov    0x10(%rsp),%r15
mov    %r15,%rdi
mov    %rbx,%rsi
mov    (%rsp),%ebp
mov    %ebp,%edx
movaps %xmm0,%xmm1
mov    0x20(%rsp),%r14
mov    %r14,%rcx
call   1060 <spline@plt>
mov    %r15,%rdi
mov    %rbx,%rsi
mov    %r14,%rdx
mov    %ebp,%ecx
movss  0x4(%rsp),%xmm0
mov    0x18(%rsp),%r8
call   1030 <splint@plt>
mov    %rbx,%rdi
mov    $0x1,%esi
mov    %ebp,%edx
call   1040 <free_vector@plt>
mov    %r14,%rdi
mov    $0x1,%esi
mov    %ebp,%edx
add    $0x28,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1040 <free_vector@plt>

LLVM IR (-O0):
define void @splin2(float* %0, float* %1, float** %2, float** %3, i32 %4, i32 %5, float %6, float %7, float* %8) {
%10 = alloca float*
%11 = alloca float*
%12 = alloca float**
%13 = alloca float**
%14 = alloca i32
%15 = alloca i32
%16 = alloca float
%17 = alloca float
%18 = alloca float*
%19 = alloca i32
%20 = alloca float*
%21 = alloca float*
store float* %0, float** %10
store float* %1, float** %11
store float** %2, float*** %12
store float** %3, float*** %13
store i32 %4, i32* %14
store i32 %5, i32* %15
store float %6, float* %16
store float %7, float* %17
store float* %8, float** %18
%22 = load i32, i32* %14
%23 = call float* @vector(i32 1, i32 %22)
store float* %23, float** %20
%24 = load i32, i32* %14
%25 = call float* @vector(i32 1, i32 %24)
store float* %25, float** %21
store i32 1, i32* %19
br label %26
26: ; preds = %48, %9
%27 = load i32, i32* %19
%28 = load i32, i32* %14
%29 = icmp sle i32 %27, %28
br i1 %29, label %30, label %51
30: ; preds = %26
%31 = load float*, float** %11
%32 = load float**, float*** %12
%33 = load i32, i32* %19
%34 = sext i32 %33 to i64
%35 = getelementptr inbounds float*, float** %32, i64 %34
%36 = load float*, float** %35
%37 = load float**, float*** %13
%38 = load i32, i32* %19
%39 = sext i32 %38 to i64
%40 = getelementptr inbounds float*, float** %37, i64 %39
%41 = load float*, float** %40
%42 = load i32, i32* %15
%43 = load float, float* %17
%44 = load float*, float** %21
%45 = load i32, i32* %19
%46 = sext i32 %45 to i64
%47 = getelementptr inbounds float, float* %44, i64 %46
br label %48
48: ; preds = %30
%49 = load i32, i32* %19
%50 = add nsw i32 %49, 1
store i32 %50, i32* %19
br label %26
51: ; preds = %26
%52 = load float*, float** %10
%53 = load float*, float** %21
%54 = load i32, i32* %14
%55 = load float*, float** %20
%56 = load float*, float** %10
%57 = load float*, float** %21
%58 = load float*, float** %20
%59 = load i32, i32* %14
%60 = load float, float* %16
%61 = load float*, float** %18
%62 = load float*, float** %21
%63 = load i32, i32* %14
%64 = call i32 @free_vector(float* %62, i32 1, i32 %63)
%65 = load float*, float** %20
%66 = load i32, i32* %14
%67 = call i32 @free_vector(float* %65, i32 1, i32 %66)
ret void
}

LLVM IR (-O2):
define void @splin2(float* %0, float* %1, float** nocapture %2, float** nocapture %3, i32 %4, i32 %5, float %6, float %7, float* %8) {
%10 = tail call float* @vector(i32 1, i32 %4)
%11 = tail call float* @vector(i32 1, i32 %4)
%12 = icmp slt i32 %4, 1
br i1 %12, label %25, label %13
13: ; preds = %9
%14 = add nuw i32 %4, 1
%15 = zext i32 %14 to i64
br label %16
16: ; preds = %13, %16
%17 = phi i64 [ 1, %13 ], [ %23, %16 ]
%18 = getelementptr inbounds float*, float** %2, i64 %17
%19 = load float*, float** %18
%20 = getelementptr inbounds float*, float** %3, i64 %17
%21 = load float*, float** %20
%22 = getelementptr inbounds float, float* %11, i64 %17
tail call void @splint(float* %1, float* %19, float* %21, i32 %5, float %7, float* %22)
%23 = add nuw nsw i64 %17, 1
%24 = icmp eq i64 %23, %15
br i1 %24, label %25, label %16
25: ; preds = %16, %9
tail call void @spline(float* %0, float* %11, i32 %4, float 0x46293E5940000000, float 0x46293E5940000000, float* %10)
tail call void @splint(float* %0, float* %11, float* %10, i32 %4, float %6, float* %8)
%26 = tail call i32 @free_vector(float* %11, i32 1, i32 %4)
%27 = tail call i32 @free_vector(float* %10, i32 1, i32 %4)
ret void
}