#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 pow(double, double);
double Rfind(int i1, int j1, int k1, int i2, int j2, int k2,
             const double SiteDistance) {
  double i1d = (double)i1;
  double i2d = (double)i2;
  double j1d = (double)j1;
  double j2d = (double)j2;
  double k1d = (double)k1;
  double k2d = (double)k2;
  return pow(pow((i1d - i2d) * SiteDistance, 2.0) +
                 pow((j1d - j2d) * SiteDistance, 2.0) +
                 pow((k1d - k2d) * SiteDistance, 2.0),
             0.5);
}


x86 assembly (clang, -O0):
<Rfind>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8d,-0x14(%rbp)
mov    %r9d,-0x18(%rbp)
movsd  %xmm0,-0x20(%rbp)
cvtsi2sdl -0x4(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
cvtsi2sdl -0x10(%rbp),%xmm0
movsd  %xmm0,-0x30(%rbp)
cvtsi2sdl -0x8(%rbp),%xmm0
movsd  %xmm0,-0x38(%rbp)
cvtsi2sdl -0x14(%rbp),%xmm0
movsd  %xmm0,-0x40(%rbp)
cvtsi2sdl -0xc(%rbp),%xmm0
movsd  %xmm0,-0x48(%rbp)
cvtsi2sdl -0x18(%rbp),%xmm0
movsd  %xmm0,-0x50(%rbp)
movsd  -0x28(%rbp),%xmm0
subsd  -0x30(%rbp),%xmm0
mulsd  -0x20(%rbp),%xmm0
movsd  0xe84(%rip),%xmm1
call   1030 <pow@plt>
movsd  %xmm0,-0x60(%rbp)
movsd  -0x38(%rbp),%xmm0
subsd  -0x40(%rbp),%xmm0
mulsd  -0x20(%rbp),%xmm0
movsd  0xe63(%rip),%xmm1
call   1030 <pow@plt>
movaps %xmm0,%xmm1
movsd  -0x60(%rbp),%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x58(%rbp)
movsd  -0x48(%rbp),%xmm0
subsd  -0x50(%rbp),%xmm0
mulsd  -0x20(%rbp),%xmm0
movsd  0xe36(%rip),%xmm1
call   1030 <pow@plt>
movaps %xmm0,%xmm1
movsd  -0x58(%rbp),%xmm0
addsd  %xmm1,%xmm0
movsd  0xe15(%rip),%xmm1
call   1030 <pow@plt>
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Rfind>:
cvtsi2sd %esi,%xmm1
cvtsi2sd %r8d,%xmm2
movd   %edx,%xmm3
movd   %edi,%xmm4
punpckldq %xmm3,%xmm4
cvtdq2pd %xmm4,%xmm3
subsd  %xmm2,%xmm1
movd   %r9d,%xmm2
movd   %ecx,%xmm4
punpckldq %xmm2,%xmm4
cvtdq2pd %xmm4,%xmm2
subpd  %xmm2,%xmm3
mulsd  %xmm0,%xmm1
mulsd  %xmm1,%xmm1
unpcklpd %xmm0,%xmm0
mulpd  %xmm3,%xmm0
mulpd  %xmm0,%xmm0
addsd  %xmm0,%xmm1
unpckhpd %xmm0,%xmm0
addsd  %xmm1,%xmm0
movsd  0xe96(%rip),%xmm1
jmp    1030 <pow@plt>

LLVM IR (-O0):
define double @Rfind(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5, double %6) {
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
%14 = alloca double
%15 = alloca double
%16 = alloca double
%17 = alloca double
%18 = alloca double
%19 = alloca double
%20 = alloca double
store i32 %0, i32* %8
store i32 %1, i32* %9
store i32 %2, i32* %10
store i32 %3, i32* %11
store i32 %4, i32* %12
store i32 %5, i32* %13
store double %6, double* %14
%21 = load i32, i32* %8
%22 = sitofp i32 %21 to double
store double %22, double* %15
%23 = load i32, i32* %11
%24 = sitofp i32 %23 to double
store double %24, double* %16
%25 = load i32, i32* %9
%26 = sitofp i32 %25 to double
store double %26, double* %17
%27 = load i32, i32* %12
%28 = sitofp i32 %27 to double
store double %28, double* %18
%29 = load i32, i32* %10
%30 = sitofp i32 %29 to double
store double %30, double* %19
%31 = load i32, i32* %13
%32 = sitofp i32 %31 to double
store double %32, double* %20
%33 = load double, double* %15
%34 = load double, double* %16
%35 = fsub double %33, %34
%36 = load double, double* %14
%37 = fmul double %35, %36
%38 = call double @pow(double %37, double 2.000000e+00)
%39 = load double, double* %17
%40 = load double, double* %18
%41 = fsub double %39, %40
%42 = load double, double* %14
%43 = fmul double %41, %42
%44 = call double @pow(double %43, double 2.000000e+00)
%45 = fadd double %38, %44
%46 = load double, double* %19
%47 = load double, double* %20
%48 = fsub double %46, %47
%49 = load double, double* %14
%50 = fmul double %48, %49
%51 = call double @pow(double %50, double 2.000000e+00)
%52 = fadd double %45, %51
%53 = call double @pow(double %52, double 5.000000e-01)
ret double %53
}

LLVM IR (-O2):
define double @Rfind(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5, double %6) {
%8 = sitofp i32 %1 to double
%9 = sitofp i32 %4 to double
%10 = insertelement <2 x i32> poison, i32 %0, i64 0
%11 = insertelement <2 x i32> %10, i32 %2, i64 1
%12 = sitofp <2 x i32> %11 to <2 x double>
%13 = insertelement <2 x i32> poison, i32 %3, i64 0
%14 = insertelement <2 x i32> %13, i32 %5, i64 1
%15 = sitofp <2 x i32> %14 to <2 x double>
%16 = fsub double %8, %9
%17 = fmul double %16, %6
%18 = fmul double %17, %17
%19 = fsub <2 x double> %12, %15
%20 = insertelement <2 x double> poison, double %6, i64 0
%21 = shufflevector <2 x double> %20, <2 x double> poison, <2 x i32> zeroinitializer
%22 = fmul <2 x double> %19, %21
%23 = fmul <2 x double> %22, %22
%24 = extractelement <2 x double> %23, i64 0
%25 = fadd double %24, %18
%26 = extractelement <2 x double> %23, i64 1
%27 = fadd double %25, %26
%28 = tail call double @pow(double %27, double 5.000000e-01)
ret double %28
}