#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 */
struct kdtree {
  int dummy;
};
struct kdres {
  int dummy;
};

/* Variables and functions */
struct kdres *kd_nearest_range(struct kdtree *, float *, float);
struct kdres *kd_nearest_range3(struct kdtree *tree, float x, float y, float z,
                                float range) {
  float buf[3];
  buf[0] = x;
  buf[1] = y;
  buf[2] = z;
  return kd_nearest_range(tree, buf, range);
}


x86 assembly (clang, -O0):
<kd_nearest_range3>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
movss  %xmm0,-0xc(%rbp)
movss  %xmm1,-0x10(%rbp)
movss  %xmm2,-0x14(%rbp)
movss  %xmm3,-0x18(%rbp)
movss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x24(%rbp)
movss  -0x10(%rbp),%xmm0
movss  %xmm0,-0x20(%rbp)
movss  -0x14(%rbp),%xmm0
movss  %xmm0,-0x1c(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x24(%rbp),%rsi
movss  -0x18(%rbp),%xmm0
call   1030 <kd_nearest_range@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<kd_nearest_range3>:
sub    $0x18,%rsp
movss  %xmm0,0xc(%rsp)
movss  %xmm1,0x10(%rsp)
movss  %xmm2,0x14(%rsp)
lea    0xc(%rsp),%rsi
movaps %xmm3,%xmm0
call   1030 <kd_nearest_range@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.kdres = type { i32 }
%struct.kdtree = type { i32 }
define %struct.kdres* @kd_nearest_range3(%struct.kdtree* %0, float %1, float %2, float %3, float %4) {
%6 = alloca %struct.kdtree*
%7 = alloca float
%8 = alloca float
%9 = alloca float
%10 = alloca float
%11 = alloca [3 x float]
store %struct.kdtree* %0, %struct.kdtree** %6
store float %1, float* %7
store float %2, float* %8
store float %3, float* %9
store float %4, float* %10
%12 = load float, float* %7
%13 = getelementptr inbounds [3 x float], [3 x float]* %11, i64 0, i64 0
store float %12, float* %13
%14 = load float, float* %8
%15 = getelementptr inbounds [3 x float], [3 x float]* %11, i64 0, i64 1
store float %14, float* %15
%16 = load float, float* %9
%17 = getelementptr inbounds [3 x float], [3 x float]* %11, i64 0, i64 2
store float %16, float* %17
%18 = load %struct.kdtree*, %struct.kdtree** %6
%19 = getelementptr inbounds [3 x float], [3 x float]* %11, i64 0, i64 0
%20 = load float, float* %10
%21 = call %struct.kdres* @kd_nearest_range(%struct.kdtree* %18, float* %19, float %20)
ret %struct.kdres* %21
}

LLVM IR (-O2):
%struct.kdres = type { i32 }
%struct.kdtree = type { i32 }
define %struct.kdres* @kd_nearest_range3(%struct.kdtree* %0, float %1, float %2, float %3, float %4) {
%6 = alloca [3 x float]
%7 = bitcast [3 x float]* %6 to i8*
%8 = getelementptr inbounds [3 x float], [3 x float]* %6, i64 0, i64 0
store float %1, float* %8
%9 = getelementptr inbounds [3 x float], [3 x float]* %6, i64 0, i64 1
store float %2, float* %9
%10 = getelementptr inbounds [3 x float], [3 x float]* %6, i64 0, i64 2
store float %3, float* %10
%11 = call %struct.kdres* @kd_nearest_range(%struct.kdtree* %0, float* %8, float %4)
ret %struct.kdres* %11
}