#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 polin2(float x1a[], float x2a[], float **ya, int m, int n, float x1,
            float x2, float *y, float *dy) {
  void polint(float xa[], float ya[], int n, float x, float *y, float *dy);
  int j;
  float *ymtmp;
  ymtmp = vector(1, m);
  for (j = 1; j <= m; j++) {
    polint(x2a, ya[j], n, x2, &ymtmp[j], dy);
  }
  polint(x1a, ymtmp, m, x1, y, dy);
  free_vector(ymtmp, 1, m);
}


x86 assembly (clang, -O0):
<polin2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    0x10(%rbp),%rax
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    %r8d,-0x20(%rbp)
movss  %xmm0,-0x24(%rbp)
movss  %xmm1,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
mov    -0x1c(%rbp),%esi
mov    $0x1,%edi
call   1040 <vector@plt>
mov    %rax,-0x40(%rbp)
movl   $0x1,-0x34(%rbp)
mov    -0x34(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jg     11bf <polin2+0x8f>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rax
movslq -0x34(%rbp),%rcx
mov    (%rax,%rcx,8),%rsi
mov    -0x20(%rbp),%edx
movss  -0x28(%rbp),%xmm0
mov    -0x40(%rbp),%rcx
movslq -0x34(%rbp),%rax
shl    $0x2,%rax
add    %rax,%rcx
mov    0x10(%rbp),%r8
call   1050 <polint@plt>
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    1175 <polin2+0x45>
mov    -0x8(%rbp),%rdi
mov    -0x40(%rbp),%rsi
mov    -0x1c(%rbp),%edx
movss  -0x24(%rbp),%xmm0
mov    -0x30(%rbp),%rcx
mov    0x10(%rbp),%r8
call   1050 <polint@plt>
mov    -0x40(%rbp),%rdi
mov    -0x1c(%rbp),%edx
mov    $0x1,%esi
call   1030 <free_vector@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<polin2>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x28,%rsp
mov    %r9,0x20(%rsp)
movss  %xmm1,0x14(%rsp)
movss  %xmm0,0xc(%rsp)
mov    %r8d,0x10(%rsp)
mov    %ecx,%r15d
mov    %rdx,%r14
mov    %rsi,%r13
mov    %rdi,0x18(%rsp)
mov    0x60(%rsp),%rbx
mov    $0x1,%edi
mov    %ecx,%esi
call   1040 <vector@plt>
mov    %rax,%rbp
mov    %r15d,0x8(%rsp)
test   %r15d,%r15d
jle    11c6 <polin2+0x96>
mov    0x8(%rsp),%eax
lea    0x4(,%rax,4),%r15
mov    $0x4,%r12d
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    (%r14,%r12,2),%rsi
lea    (%r12,%rbp,1),%rcx
mov    %r13,%rdi
mov    0x10(%rsp),%edx
movss  0x14(%rsp),%xmm0
mov    %rbx,%r8
call   1050 <polint@plt>
add    $0x4,%r12
cmp    %r12,%r15
jne    11a0 <polin2+0x70>
mov    0x18(%rsp),%rdi
mov    %rbp,%rsi
mov    0x8(%rsp),%r14d
mov    %r14d,%edx
movss  0xc(%rsp),%xmm0
mov    0x20(%rsp),%rcx
mov    %rbx,%r8
call   1050 <polint@plt>
mov    %rbp,%rdi
mov    $0x1,%esi
mov    %r14d,%edx
add    $0x28,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <free_vector@plt>

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

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