#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 */
double cuberp(double, double *);
double bicuberp(double x, double y, double *f) {
  double fcol[4];
  int i;
  for (i = 0; i < 4; i++)
    fcol[i] = cuberp(x, f + 4 * i);
  return cuberp(y, fcol);
}


x86 assembly (clang, -O0):
<bicuberp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
mov    %rdi,-0x18(%rbp)
movl   $0x0,-0x44(%rbp)
cmpl   $0x4,-0x44(%rbp)
jge    116c <bicuberp+0x5c>
movsd  -0x8(%rbp),%xmm0
mov    -0x18(%rbp),%rdi
mov    -0x44(%rbp),%eax
shl    $0x2,%eax
cltq
shl    $0x3,%rax
add    %rax,%rdi
call   1030 <cuberp@plt>
movslq -0x44(%rbp),%rax
movsd  %xmm0,-0x40(%rbp,%rax,8)
mov    -0x44(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x44(%rbp)
jmp    112d <bicuberp+0x1d>
movsd  -0x10(%rbp),%xmm0
lea    -0x40(%rbp),%rdi
call   1030 <cuberp@plt>
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bicuberp>:
push   %rbx
sub    $0x30,%rsp
mov    %rdi,%rbx
movsd  %xmm1,0x8(%rsp)
movsd  %xmm0,(%rsp)
call   1030 <cuberp@plt>
movsd  %xmm0,0x10(%rsp)
lea    0x20(%rbx),%rdi
movsd  (%rsp),%xmm0
call   1030 <cuberp@plt>
movsd  %xmm0,0x18(%rsp)
lea    0x40(%rbx),%rdi
movsd  (%rsp),%xmm0
call   1030 <cuberp@plt>
movsd  %xmm0,0x20(%rsp)
add    $0x60,%rbx
movsd  (%rsp),%xmm0
mov    %rbx,%rdi
call   1030 <cuberp@plt>
movsd  %xmm0,0x28(%rsp)
lea    0x10(%rsp),%rdi
movsd  0x8(%rsp),%xmm0
call   1030 <cuberp@plt>
add    $0x30,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define double @bicuberp(double %0, double %1, double* %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca double*
%7 = alloca [4 x double]
%8 = alloca i32
store double %0, double* %4
store double %1, double* %5
store double* %2, double** %6
store i32 0, i32* %8
br label %9
9: ; preds = %23, %3
%10 = load i32, i32* %8
%11 = icmp slt i32 %10, 4
br i1 %11, label %12, label %26
12: ; preds = %9
%13 = load double, double* %4
%14 = load double*, double** %6
%15 = load i32, i32* %8
%16 = mul nsw i32 4, %15
%17 = sext i32 %16 to i64
%18 = getelementptr inbounds double, double* %14, i64 %17
%19 = call double @cuberp(double %13, double* %18)
%20 = load i32, i32* %8
%21 = sext i32 %20 to i64
%22 = getelementptr inbounds [4 x double], [4 x double]* %7, i64 0, i64 %21
store double %19, double* %22
br label %23
23: ; preds = %12
%24 = load i32, i32* %8
%25 = add nsw i32 %24, 1
store i32 %25, i32* %8
br label %9
26: ; preds = %9
%27 = load double, double* %5
%28 = getelementptr inbounds [4 x double], [4 x double]* %7, i64 0, i64 0
%29 = call double @cuberp(double %27, double* %28)
ret double %29
}

LLVM IR (-O2):
define double @bicuberp(double %0, double %1, double* %2) {
%4 = alloca [4 x double]
%5 = bitcast [4 x double]* %4 to i8*
%6 = tail call double @cuberp(double %0, double* %2)
%7 = getelementptr inbounds [4 x double], [4 x double]* %4, i64 0, i64 0
store double %6, double* %7
%8 = getelementptr inbounds double, double* %2, i64 4
%9 = tail call double @cuberp(double %0, double* %8)
%10 = getelementptr inbounds [4 x double], [4 x double]* %4, i64 0, i64 1
store double %9, double* %10
%11 = getelementptr inbounds double, double* %2, i64 8
%12 = tail call double @cuberp(double %0, double* %11)
%13 = getelementptr inbounds [4 x double], [4 x double]* %4, i64 0, i64 2
store double %12, double* %13
%14 = getelementptr inbounds double, double* %2, i64 12
%15 = tail call double @cuberp(double %0, double* %14)
%16 = getelementptr inbounds [4 x double], [4 x double]* %4, i64 0, i64 3
store double %15, double* %16
%17 = call double @cuberp(double %1, double* %7)
ret double %17
}