#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 RAND_MAX;
int /*<<< orphan*/ assert(int);
int atoi(char *);
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
unsigned int get_msec();
scalar_t__ isdigit(char);
void *kd_create(int);
int /*<<< orphan*/ kd_find_exact(void *, double *);
int /*<<< orphan*/ kd_free(void *);
scalar_t__ kd_insert3(void *, float, float, float, int /*<<< orphan*/);
void *kd_nearest3(void *, int /*<<< orphan*/, int /*<<< orphan*/,
                  int /*<<< orphan*/);
int /*<<< orphan*/ kd_res_free(void *);
int kd_res_size(void *);
int /*<<< orphan*/ printf(char *, int, ...);
scalar_t__ rand();
int /*<<< orphan*/ stdout;
int main(int argc, char **argv) {
  int i, vcount = 10;
  void *kd, *set;
  unsigned int msec, start;
  float x = 0.0;
  float y = 0.0;
  float z = 0.0;
  if (argc > 1 && isdigit(argv[1][0])) {
    vcount = atoi(argv[1]);
  }
  printf("inserting %d random vectors... ", vcount);
  fflush(stdout);
  kd = kd_create(3);
  start = get_msec();
  for (i = 0; i < vcount; i++) {
    x = ((float)rand() / RAND_MAX) * 200.0 - 100.0;
    y = ((float)rand() / RAND_MAX) * 200.0 - 100.0;
    z = ((float)rand() / RAND_MAX) * 200.0 - 100.0;
    assert(kd_insert3(kd, x, y, z, 0) == 0);
  }
  msec = get_msec() - start;
  printf("%.3f sec\n", (float)msec / 1000.0);
  start = get_msec();
  set = kd_nearest3(kd, 0, 0, 0);
  double exact_coord_1[3] = {10, 15, 20};
  kd_find_exact(kd, exact_coord_1);
  double exact_coord_2[3] = {x, y, z};
  kd_find_exact(kd, exact_coord_2);
  msec = get_msec() - start;
  printf("range query returned %d items in %.5f sec\n", kd_res_size(set),
         (float)msec / 1000.0);
  kd_res_free(set);
  kd_free(kd);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x90,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0xa,-0x18(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0x34(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0x38(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0x3c(%rbp)
cmpl   $0x1,-0x8(%rbp)
jle    124c <main+0x6c>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
movsbl (%rax),%edi
call   1040 <isdigit@plt>
cmp    $0x0,%rax
je     124c <main+0x6c>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   10e0 <atoi@plt>
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%esi
lea    0xdc2(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
mov    0x2d74(%rip),%rax
mov    (%rax),%edi
call   10b0 <fflush@plt>
mov    $0x3,%edi
call   10d0 <kd_create@plt>
mov    %rax,-0x20(%rbp)
mov    $0x0,%al
call   10c0 <get_msec@plt>
mov    %eax,-0x30(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x18(%rbp),%eax
jge    1383 <main+0x1a3>
mov    $0x0,%al
call   1100 <rand@plt>
cvtsi2ss %rax,%xmm0
mov    0x2d3f(%rip),%rax
divss  (%rax),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xd4f(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xd4b(%rip),%xmm1
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x34(%rbp)
mov    $0x0,%al
call   1100 <rand@plt>
cvtsi2ss %rax,%xmm0
mov    0x2d03(%rip),%rax
divss  (%rax),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xd13(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xd0f(%rip),%xmm1
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x38(%rbp)
mov    $0x0,%al
call   1100 <rand@plt>
cvtsi2ss %rax,%xmm0
mov    0x2cc7(%rip),%rax
divss  (%rax),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xcd7(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xcd3(%rip),%xmm1
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x3c(%rbp)
mov    -0x20(%rbp),%rdi
movss  -0x34(%rbp),%xmm0
movss  -0x38(%rbp),%xmm1
movss  -0x3c(%rbp),%xmm2
xor    %esi,%esi
call   10f0 <kd_insert3@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1090 <assert@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    128a <main+0xaa>
xor    %eax,%eax
mov    %eax,-0x88(%rbp)
mov    %al,-0x81(%rbp)
call   10c0 <get_msec@plt>
mov    %eax,%ecx
mov    -0x81(%rbp),%al
mov    -0x30(%rbp),%edx
sub    %edx,%ecx
mov    %ecx,-0x2c(%rbp)
mov    -0x2c(%rbp),%ecx
cvtsi2ss %rcx,%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xc46(%rip),%xmm1
divsd  %xmm1,%xmm0
cvttsd2si %xmm0,%esi
lea    0xc6f(%rip),%rdi
call   1070 <printf@plt>
mov    -0x81(%rbp),%al
call   10c0 <get_msec@plt>
mov    -0x88(%rbp),%ecx
mov    %eax,-0x30(%rbp)
mov    -0x20(%rbp),%rdi
mov    %ecx,%esi
mov    %ecx,%edx
call   1030 <kd_nearest3@plt>
mov    %rax,-0x28(%rbp)
mov    0xc86(%rip),%rax
mov    %rax,-0x50(%rbp)
movaps 0xc6b(%rip),%xmm0
movaps %xmm0,-0x60(%rbp)
mov    -0x20(%rbp),%rdi
lea    -0x60(%rbp),%rsi
call   1050 <kd_find_exact@plt>
movss  -0x34(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  %xmm0,-0x80(%rbp)
movss  -0x38(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  %xmm0,-0x78(%rbp)
movss  -0x3c(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  %xmm0,-0x70(%rbp)
mov    -0x20(%rbp),%rdi
lea    -0x80(%rbp),%rsi
call   1050 <kd_find_exact@plt>
mov    -0x81(%rbp),%al
call   10c0 <get_msec@plt>
mov    -0x30(%rbp),%ecx
sub    %ecx,%eax
mov    %eax,-0x2c(%rbp)
mov    -0x28(%rbp),%rdi
call   1060 <kd_res_size@plt>
mov    %eax,%esi
mov    -0x2c(%rbp),%eax
cvtsi2ss %rax,%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xb81(%rip),%xmm1
divsd  %xmm1,%xmm0
lea    0xbb8(%rip),%rdi
mov    $0x1,%al
call   1070 <printf@plt>
mov    -0x28(%rbp),%rdi
call   10a0 <kd_res_free@plt>
mov    -0x20(%rbp),%rdi
call   1080 <kd_free@plt>
xor    %eax,%eax
add    $0x90,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x60,%rsp
mov    $0xa,%ebp
cmp    $0x2,%edi
jl     1215 <main+0x35>
mov    %rsi,%rbx
mov    0x8(%rsi),%rax
movsbl (%rax),%edi
call   1040 <isdigit@plt>
test   %rax,%rax
je     1215 <main+0x35>
mov    0x8(%rbx),%rdi
call   10e0 <atoi@plt>
mov    %eax,%ebp
lea    0xe1c(%rip),%rdi
mov    %ebp,%esi
xor    %eax,%eax
call   1070 <printf@plt>
mov    0x2dac(%rip),%rax
mov    (%rax),%edi
call   10b0 <fflush@plt>
mov    $0x3,%edi
call   10d0 <kd_create@plt>
mov    %rax,%r15
xor    %eax,%eax
call   10c0 <get_msec@plt>
mov    %eax,%r14d
test   %ebp,%ebp
jle    133b <main+0x15b>
mov    0x2d8f(%rip),%r12
nopl   0x0(%rax)
xor    %eax,%eax
call   1100 <rand@plt>
mov    %rax,%rbx
movss  (%r12),%xmm0
movaps %xmm0,(%rsp)
xor    %eax,%eax
call   1100 <rand@plt>
xorps  %xmm0,%xmm0
cvtsi2ss %rbx,%xmm0
xorps  %xmm1,%xmm1
cvtsi2ss %rax,%xmm1
unpcklps %xmm1,%xmm0
movss  (%r12),%xmm1
movaps (%rsp),%xmm2
unpcklps %xmm1,%xmm2
divps  %xmm2,%xmm0
cvtps2pd %xmm0,%xmm0
mulpd  0xd57(%rip),%xmm0
addpd  0xd5f(%rip),%xmm0
cvtpd2ps %xmm0,%xmm0
movapd %xmm0,(%rsp)
movapd %xmm0,%xmm1
shufps $0x55,%xmm0,%xmm1
movaps %xmm1,0x10(%rsp)
xor    %eax,%eax
call   1100 <rand@plt>
xorps  %xmm0,%xmm0
cvtsi2ss %rax,%xmm0
divss  (%r12),%xmm0
cvtss2sd %xmm0,%xmm0
mulsd  0xd38(%rip),%xmm0
addsd  0xd38(%rip),%xmm0
xorps  %xmm2,%xmm2
cvtsd2ss %xmm0,%xmm2
mov    %r15,%rdi
movaps (%rsp),%xmm0
movaps 0x10(%rsp),%xmm1
movss  %xmm2,0x10(%rsp)
xor    %esi,%esi
call   10f0 <kd_insert3@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
call   1090 <assert@plt>
add    $0xffffffff,%ebp
jne    1260 <main+0x80>
cvtps2pd (%rsp),%xmm0
movaps %xmm0,(%rsp)
movss  0x10(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
jmp    1345 <main+0x165>
xorps  %xmm0,%xmm0
movaps %xmm0,(%rsp)
xorps  %xmm0,%xmm0
movsd  %xmm0,0x10(%rsp)
xor    %eax,%eax
call   10c0 <get_msec@plt>
sub    %r14d,%eax
xorps  %xmm0,%xmm0
cvtsi2ss %rax,%xmm0
cvtss2sd %xmm0,%xmm0
divsd  0xcc7(%rip),%xmm0
cvttsd2si %xmm0,%esi
lea    0xce4(%rip),%rdi
xor    %eax,%eax
call   1070 <printf@plt>
xor    %eax,%eax
call   10c0 <get_msec@plt>
mov    %eax,%r14d
mov    %r15,%rdi
xor    %esi,%esi
xor    %edx,%edx
xor    %ecx,%ecx
call   1030 <kd_nearest3@plt>
mov    %rax,%rbp
mov    0xd03(%rip),%rax
mov    %rax,0x50(%rsp)
movaps 0xce7(%rip),%xmm0
movaps %xmm0,0x40(%rsp)
lea    0x40(%rsp),%rsi
mov    %r15,%rdi
call   1050 <kd_find_exact@plt>
movaps (%rsp),%xmm0
movaps %xmm0,0x20(%rsp)
movsd  0x10(%rsp),%xmm0
movsd  %xmm0,0x30(%rsp)
lea    0x20(%rsp),%rsi
mov    %r15,%rdi
call   1050 <kd_find_exact@plt>
xor    %eax,%eax
call   10c0 <get_msec@plt>
mov    %eax,%ebx
sub    %r14d,%ebx
mov    %rbp,%rdi
call   1060 <kd_res_size@plt>
xorps  %xmm0,%xmm0
cvtsi2ss %rbx,%xmm0
cvtss2sd %xmm0,%xmm0
divsd  0xc2b(%rip),%xmm0
lea    0xc56(%rip),%rdi
mov    %eax,%esi
mov    $0x1,%al
call   1070 <printf@plt>
mov    %rbp,%rdi
call   10a0 <kd_res_free@plt>
mov    %r15,%rdi
call   1080 <kd_free@plt>
xor    %eax,%eax
add    $0x60,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [32 x i8] c"inserting %d random vectors... \00"
@stdout = global i32 0
@RAND_MAX = global float 0.000000e+00
@.str.1 = [10 x i8] c"%.3f sec\0A\00"
@__const.main.exact_coord_1 = [3 x double] [double 1.000000e+01, double 1.500000e+01, double 2.000000e+01]
@.str.2 = [43 x i8] c"range query returned %d items in %.5f sec\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
%8 = alloca i8*
%9 = alloca i8*
%10 = alloca i32
%11 = alloca i32
%12 = alloca float
%13 = alloca float
%14 = alloca float
%15 = alloca [3 x double]
%16 = alloca [3 x double]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 10, i32* %7
store float 0.000000e+00, float* %12
store float 0.000000e+00, float* %13
store float 0.000000e+00, float* %14
%17 = load i32, i32* %4
%18 = icmp sgt i32 %17, 1
br i1 %18, label %19, label %32
19: ; preds = %2
%20 = load i8**, i8*** %5
%21 = getelementptr inbounds i8*, i8** %20, i64 1
%22 = load i8*, i8** %21
%23 = getelementptr inbounds i8, i8* %22, i64 0
%24 = load i8, i8* %23
%25 = call i64 @isdigit(i8 signext %24)
%26 = icmp ne i64 %25, 0
br i1 %26, label %27, label %32
27: ; preds = %19
%28 = load i8**, i8*** %5
%29 = getelementptr inbounds i8*, i8** %28, i64 1
%30 = load i8*, i8** %29
%31 = call i32 @atoi(i8* %30)
store i32 %31, i32* %7
br label %32
32: ; preds = %27, %19, %2
%33 = load i32, i32* %7
%34 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i32 %33)
%35 = load i32, i32* @stdout
%36 = call i32 @fflush(i32 %35)
%37 = call i8* @kd_create(i32 3)
store i8* %37, i8** %8
%38 = call i32 (...) @get_msec()
store i32 %38, i32* %11
store i32 0, i32* %6
br label %39
39: ; preds = %73, %32
%40 = load i32, i32* %6
%41 = load i32, i32* %7
%42 = icmp slt i32 %40, %41
br i1 %42, label %43, label %76
43: ; preds = %39
%44 = call i64 (...) @rand()
%45 = sitofp i64 %44 to float
%46 = load float, float* @RAND_MAX
%47 = fdiv float %45, %46
%48 = fpext float %47 to double
%49 = call double @llvm.fmuladd.f64(double %48, double 2.000000e+02, double -1.000000e+02)
%50 = fptrunc double %49 to float
store float %50, float* %12
%51 = call i64 (...) @rand()
%52 = sitofp i64 %51 to float
%53 = load float, float* @RAND_MAX
%54 = fdiv float %52, %53
%55 = fpext float %54 to double
%56 = call double @llvm.fmuladd.f64(double %55, double 2.000000e+02, double -1.000000e+02)
%57 = fptrunc double %56 to float
store float %57, float* %13
%58 = call i64 (...) @rand()
%59 = sitofp i64 %58 to float
%60 = load float, float* @RAND_MAX
%61 = fdiv float %59, %60
%62 = fpext float %61 to double
%63 = call double @llvm.fmuladd.f64(double %62, double 2.000000e+02, double -1.000000e+02)
%64 = fptrunc double %63 to float
store float %64, float* %14
%65 = load i8*, i8** %8
%66 = load float, float* %12
%67 = load float, float* %13
%68 = load float, float* %14
%69 = call i64 @kd_insert3(i8* %65, float %66, float %67, float %68, i32 0)
%70 = icmp eq i64 %69, 0
%71 = zext i1 %70 to i32
%72 = call i32 @assert(i32 %71)
br label %73
73: ; preds = %43
%74 = load i32, i32* %6
%75 = add nsw i32 %74, 1
store i32 %75, i32* %6
br label %39
76: ; preds = %39
%77 = call i32 (...) @get_msec()
%78 = load i32, i32* %11
%79 = sub i32 %77, %78
store i32 %79, i32* %10
%80 = load i32, i32* %10
%81 = uitofp i32 %80 to float
%82 = fpext float %81 to double
%83 = fdiv double %82, 1.000000e+03
%84 = fptosi double %83 to i32
%85 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i32 %84)
%86 = call i32 (...) @get_msec()
store i32 %86, i32* %11
%87 = load i8*, i8** %8
%88 = call i8* @kd_nearest3(i8* %87, i32 0, i32 0, i32 0)
store i8* %88, i8** %9
%89 = bitcast [3 x double]* %15 to i8*
%90 = load i8*, i8** %8
%91 = getelementptr inbounds [3 x double], [3 x double]* %15, i64 0, i64 0
%92 = call i32 @kd_find_exact(i8* %90, double* %91)
%93 = getelementptr inbounds [3 x double], [3 x double]* %16, i64 0, i64 0
%94 = load float, float* %12
%95 = fpext float %94 to double
store double %95, double* %93
%96 = getelementptr inbounds double, double* %93, i64 1
%97 = load float, float* %13
%98 = fpext float %97 to double
store double %98, double* %96
%99 = getelementptr inbounds double, double* %96, i64 1
%100 = load float, float* %14
%101 = fpext float %100 to double
store double %101, double* %99
%102 = load i8*, i8** %8
%103 = getelementptr inbounds [3 x double], [3 x double]* %16, i64 0, i64 0
%104 = call i32 @kd_find_exact(i8* %102, double* %103)
%105 = call i32 (...) @get_msec()
%106 = load i32, i32* %11
%107 = sub i32 %105, %106
store i32 %107, i32* %10
%108 = load i8*, i8** %9
%109 = call i32 @kd_res_size(i8* %108)
%110 = load i32, i32* %10
%111 = uitofp i32 %110 to float
%112 = fpext float %111 to double
%113 = fdiv double %112, 1.000000e+03
%114 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.2, i64 0, i64 0), i32 %109, double %113)
%115 = load i8*, i8** %9
%116 = call i32 @kd_res_free(i8* %115)
%117 = load i8*, i8** %8
%118 = call i32 @kd_free(i8* %117)
ret i32 0
}

LLVM IR (-O2):
@.str = [32 x i8] c"inserting %d random vectors... \00"
@stdout = global i32 0
@RAND_MAX = global float 0.000000e+00
@.str.1 = [10 x i8] c"%.3f sec\0A\00"
@__const.main.exact_coord_1 = [3 x double] [double 1.000000e+01, double 1.500000e+01, double 2.000000e+01]
@.str.2 = [43 x i8] c"range query returned %d items in %.5f sec\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca [3 x double]
%4 = alloca [3 x double]
%5 = icmp sgt i32 %0, 1
br i1 %5, label %6, label %15
6: ; preds = %2
%7 = getelementptr inbounds i8*, i8** %1, i64 1
%8 = load i8*, i8** %7
%9 = load i8, i8* %8
%10 = tail call i64 @isdigit(i8 signext %9)
%11 = icmp eq i64 %10, 0
br i1 %11, label %15, label %12
12: ; preds = %6
%13 = load i8*, i8** %7
%14 = tail call i32 @atoi(i8* %13)
br label %15
15: ; preds = %12, %6, %2
%16 = phi i32 [ %14, %12 ], [ 10, %6 ], [ 10, %2 ]
%17 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i32 %16)
%18 = load i32, i32* @stdout
%19 = tail call i32 @fflush(i32 %18)
%20 = tail call i8* @kd_create(i32 3)
%21 = tail call i32 (...) @get_msec()
%22 = icmp sgt i32 %16, 0
br i1 %22, label %23, label %56
23: ; preds = %15, %23
%24 = phi i32 [ %51, %23 ], [ 0, %15 ]
%25 = tail call i64 (...) @rand()
%26 = load float, float* @RAND_MAX
%27 = tail call i64 (...) @rand()
%28 = insertelement <2 x i64> poison, i64 %25, i64 0
%29 = insertelement <2 x i64> %28, i64 %27, i64 1
%30 = sitofp <2 x i64> %29 to <2 x float>
%31 = load float, float* @RAND_MAX
%32 = insertelement <2 x float> poison, float %26, i64 0
%33 = insertelement <2 x float> %32, float %31, i64 1
%34 = fdiv <2 x float> %30, %33
%35 = fpext <2 x float> %34 to <2 x double>
%36 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %35, <2 x double> <double 2.000000e+02, double 2.000000e+02>, <2 x double> <double -1.000000e+02, double -1.000000e+02>)
%37 = fptrunc <2 x double> %36 to <2 x float>
%38 = tail call i64 (...) @rand()
%39 = sitofp i64 %38 to float
%40 = load float, float* @RAND_MAX
%41 = fdiv float %39, %40
%42 = fpext float %41 to double
%43 = tail call double @llvm.fmuladd.f64(double %42, double 2.000000e+02, double -1.000000e+02)
%44 = fptrunc double %43 to float
%45 = extractelement <2 x float> %37, i64 0
%46 = extractelement <2 x float> %37, i64 1
%47 = tail call i64 @kd_insert3(i8* %20, float %45, float %46, float %44, i32 0)
%48 = icmp eq i64 %47, 0
%49 = zext i1 %48 to i32
%50 = tail call i32 @assert(i32 %49)
%51 = add nuw nsw i32 %24, 1
%52 = icmp eq i32 %51, %16
br i1 %52, label %53, label %23
53: ; preds = %23
%54 = fpext <2 x float> %37 to <2 x double>
%55 = fpext float %44 to double
br label %56
56: ; preds = %53, %15
%57 = phi double [ %55, %53 ], [ 0.000000e+00, %15 ]
%58 = phi <2 x double> [ %54, %53 ], [ zeroinitializer, %15 ]
%59 = tail call i32 (...) @get_msec()
%60 = sub i32 %59, %21
%61 = uitofp i32 %60 to float
%62 = fpext float %61 to double
%63 = fdiv double %62, 1.000000e+03
%64 = fptosi double %63 to i32
%65 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i32 %64)
%66 = tail call i32 (...) @get_msec()
%67 = tail call i8* @kd_nearest3(i8* %20, i32 0, i32 0, i32 0)
%68 = bitcast [3 x double]* %3 to i8*
%69 = getelementptr inbounds [3 x double], [3 x double]* %3, i64 0, i64 0
%70 = call i32 @kd_find_exact(i8* %20, double* %69)
%71 = bitcast [3 x double]* %4 to i8*
%72 = getelementptr inbounds [3 x double], [3 x double]* %4, i64 0, i64 0
%73 = bitcast [3 x double]* %4 to <2 x double>*
store <2 x double> %58, <2 x double>* %73
%74 = getelementptr inbounds [3 x double], [3 x double]* %4, i64 0, i64 2
store double %57, double* %74
%75 = call i32 @kd_find_exact(i8* %20, double* %72)
%76 = call i32 (...) @get_msec()
%77 = sub i32 %76, %66
%78 = call i32 @kd_res_size(i8* %67)
%79 = uitofp i32 %77 to float
%80 = fpext float %79 to double
%81 = fdiv double %80, 1.000000e+03
%82 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.2, i64 0, i64 0), i32 %78, double %81)
%83 = call i32 @kd_res_free(i8* %67)
%84 = call i32 @kd_free(i8* %20)
ret i32 0
}