#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 */
scalar_t__ BILINEAR();
int /*<<< orphan*/ bilinear_interpolation_at(float *, float *, int, int, int,
                                             float, float);
int /*<<< orphan*/ interpolate_nearest(float *, float *, int, int, int, float,
                                       float);
void env_interpolate_at(float *out, float *x, int w, int h, int pd, float p,
                        float q) {
  if (BILINEAR())
    bilinear_interpolation_at(out, x, w, h, pd, p, q);
  else
    interpolate_nearest(out, x, w, h, pd, p, q);
}


x86 assembly (clang, -O0):
<env_interpolate_at>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    %r8d,-0x1c(%rbp)
movss  %xmm0,-0x20(%rbp)
movss  %xmm1,-0x24(%rbp)
mov    $0x0,%al
call   1040 <BILINEAR@plt>
cmp    $0x0,%rax
je     118b <env_interpolate_at+0x5b>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
mov    -0x18(%rbp),%ecx
mov    -0x1c(%rbp),%r8d
movss  -0x20(%rbp),%xmm0
movss  -0x24(%rbp),%xmm1
call   1050 <bilinear_interpolation_at@plt>
jmp    11ac <env_interpolate_at+0x7c>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
mov    -0x18(%rbp),%ecx
mov    -0x1c(%rbp),%r8d
movss  -0x20(%rbp),%xmm0
movss  -0x24(%rbp),%xmm1
call   1030 <interpolate_nearest@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<env_interpolate_at>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x10,%rsp
movss  %xmm1,0xc(%rsp)
movss  %xmm0,0x8(%rsp)
mov    %r8d,%r14d
mov    %ecx,%r15d
mov    %edx,%r12d
mov    %rsi,%rbp
mov    %rdi,%rbx
xor    %eax,%eax
call   1040 <BILINEAR@plt>
mov    %rbx,%rdi
mov    %rbp,%rsi
mov    %r12d,%edx
mov    %r15d,%ecx
mov    %r14d,%r8d
test   %rax,%rax
je     118f <env_interpolate_at+0x5f>
movss  0x8(%rsp),%xmm0
movss  0xc(%rsp),%xmm1
add    $0x10,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
jmp    1050 <bilinear_interpolation_at@plt>
movss  0x8(%rsp),%xmm0
movss  0xc(%rsp),%xmm1
add    $0x10,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <interpolate_nearest@plt>

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

LLVM IR (-O2):
define void @env_interpolate_at(float* %0, float* %1, i32 %2, i32 %3, i32 %4, float %5, float %6) {
%8 = tail call i64 (...) @BILINEAR()
%9 = icmp eq i64 %8, 0
br i1 %9, label %12, label %10
10: ; preds = %7
%11 = tail call i32 @bilinear_interpolation_at(float* %0, float* %1, i32 %2, i32 %3, i32 %4, float %5, float %6)
br label %14
12: ; preds = %7
%13 = tail call i32 @interpolate_nearest(float* %0, float* %1, i32 %2, i32 %3, i32 %4, float %5, float %6)
br label %14
14: ; preds = %12, %10
ret void
}