#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;
};

/* Variables and functions */
int kd_insert(struct kdtree *, double *, void *);
int kd_insert3f(struct kdtree *tree, float x, float y, float z, void *data) {
  double buf[3];
  buf[0] = x;
  buf[1] = y;
  buf[2] = z;
  return kd_insert(tree, buf, data);
}


x86 assembly (clang, -O0):
<kd_insert3f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
movss  %xmm0,-0xc(%rbp)
movss  %xmm1,-0x10(%rbp)
movss  %xmm2,-0x14(%rbp)
mov    %rsi,-0x20(%rbp)
movss  -0xc(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  %xmm0,-0x40(%rbp)
movss  -0x10(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  %xmm0,-0x38(%rbp)
movss  -0x14(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  %xmm0,-0x30(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x40(%rbp),%rsi
mov    -0x20(%rbp),%rdx
call   1030 <kd_insert@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<kd_insert3f>:
sub    $0x18,%rsp
unpcklps %xmm1,%xmm0
cvtps2pd %xmm0,%xmm0
mov    %rsi,%rdx
movaps %xmm0,(%rsp)
xorps  %xmm0,%xmm0
cvtss2sd %xmm2,%xmm0
movsd  %xmm0,0x10(%rsp)
mov    %rsp,%rsi
call   1030 <kd_insert@plt>
add    $0x18,%rsp
ret

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

LLVM IR (-O2):
%struct.kdtree = type { i32 }
define i32 @kd_insert3f(%struct.kdtree* %0, float %1, float %2, float %3, i8* %4) {
%6 = alloca [3 x double]
%7 = bitcast [3 x double]* %6 to i8*
%8 = getelementptr inbounds [3 x double], [3 x double]* %6, i64 0, i64 0
%9 = insertelement <2 x float> poison, float %1, i64 0
%10 = insertelement <2 x float> %9, float %2, i64 1
%11 = fpext <2 x float> %10 to <2 x double>
%12 = bitcast [3 x double]* %6 to <2 x double>*
store <2 x double> %11, <2 x double>* %12
%13 = fpext float %3 to double
%14 = getelementptr inbounds [3 x double], [3 x double]* %6, i64 0, i64 2
store double %13, double* %14
%15 = call i32 @kd_insert(%struct.kdtree* %0, double* %8, i8* %4)
ret i32 %15
}