#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 */
float interpfloat(float *, float *, int, float);
void interpolatefloats(float *arrx, float *arry, int nptsIn, float *x, float *y,
                       int nptsOut) {
  int n;
  for (n = 0; n < nptsOut; n++)
    y[n] = interpfloat(arrx, arry, nptsIn, x[n]);
}


x86 assembly (clang, -O0):
<interpolatefloats>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9d,-0x2c(%rbp)
movl   $0x0,-0x30(%rbp)
mov    -0x30(%rbp),%eax
cmp    -0x2c(%rbp),%eax
jge    117a <interpolatefloats+0x6a>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
mov    -0x20(%rbp),%rax
movslq -0x30(%rbp),%rcx
movss  (%rax,%rcx,4),%xmm0
call   1030 <interpfloat@plt>
mov    -0x28(%rbp),%rax
movslq -0x30(%rbp),%rcx
movss  %xmm0,(%rax,%rcx,4)
mov    -0x30(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x30(%rbp)
jmp    1136 <interpolatefloats+0x26>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<interpolatefloats>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
test   %r9d,%r9d
jle    1164 <interpolatefloats+0x54>
mov    %r8,%r15
mov    %rcx,%r12
mov    %edx,%r13d
mov    %rsi,%rbp
mov    %rdi,%rbx
mov    %r9d,%eax
mov    %rax,(%rsp)
xor    %r14d,%r14d
nopl   0x0(%rax)
movss  (%r12,%r14,4),%xmm0
mov    %rbx,%rdi
mov    %rbp,%rsi
mov    %r13d,%edx
call   1030 <interpfloat@plt>
movss  %xmm0,(%r15,%r14,4)
add    $0x1,%r14
cmp    %r14,(%rsp)
jne    1140 <interpolatefloats+0x30>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define void @interpolatefloats(float* %0, float* %1, i32 %2, float* %3, float* %4, i32 %5) {
%7 = alloca float*
%8 = alloca float*
%9 = alloca i32
%10 = alloca float*
%11 = alloca float*
%12 = alloca i32
%13 = alloca i32
store float* %0, float** %7
store float* %1, float** %8
store i32 %2, i32* %9
store float* %3, float** %10
store float* %4, float** %11
store i32 %5, i32* %12
store i32 0, i32* %13
br label %14
14: ; preds = %32, %6
%15 = load i32, i32* %13
%16 = load i32, i32* %12
%17 = icmp slt i32 %15, %16
br i1 %17, label %18, label %35
18: ; preds = %14
%19 = load float*, float** %7
%20 = load float*, float** %8
%21 = load i32, i32* %9
%22 = load float*, float** %10
%23 = load i32, i32* %13
%24 = sext i32 %23 to i64
%25 = getelementptr inbounds float, float* %22, i64 %24
%26 = load float, float* %25
%27 = call float @interpfloat(float* %19, float* %20, i32 %21, float %26)
%28 = load float*, float** %11
%29 = load i32, i32* %13
%30 = sext i32 %29 to i64
%31 = getelementptr inbounds float, float* %28, i64 %30
store float %27, float* %31
br label %32
32: ; preds = %18
%33 = load i32, i32* %13
%34 = add nsw i32 %33, 1
store i32 %34, i32* %13
br label %14
35: ; preds = %14
ret void
}

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