#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 S6Dist_pass(double *, double *, double);
int /*<<< orphan*/ s61234distsq(double *, double *);
double s6minbddist(double *);
double sqrt(int /*<<< orphan*/);
double CS6Dist(double gvec1[6], double gvec2[6]) {
  double dist, dist1, dist2, distmin;
  dist1 = s6minbddist(gvec1);
  dist2 = s6minbddist(gvec2);
  distmin = (((dist1) < (dist2)) ? (dist1) : (dist2));
  dist = sqrt(s61234distsq(gvec1, gvec2));
  ;

  dist = S6Dist_pass(gvec1, gvec2, dist);
  return dist;
}


x86 assembly (clang, -O0):
<CS6Dist>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <s6minbddist@plt>
movsd  %xmm0,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <s6minbddist@plt>
movsd  %xmm0,-0x28(%rbp)
movsd  -0x20(%rbp),%xmm1
movsd  -0x28(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jbe    118f <CS6Dist+0x4f>
movsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x38(%rbp)
jmp    1199 <CS6Dist+0x59>
movsd  -0x28(%rbp),%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  -0x38(%rbp),%xmm0
movsd  %xmm0,-0x30(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1050 <s61234distsq@plt>
mov    %eax,%edi
call   1060 <sqrt@plt>
movsd  %xmm0,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
movsd  -0x18(%rbp),%xmm0
call   1040 <S6Dist_pass@plt>
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<CS6Dist>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
call   1030 <s6minbddist@plt>
mov    %r14,%rdi
call   1030 <s6minbddist@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1050 <s61234distsq@plt>
mov    %eax,%edi
call   1060 <sqrt@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <S6Dist_pass@plt>

LLVM IR (-O0):
define double @CS6Dist(double* %0, double* %1) {
%3 = alloca double*
%4 = alloca double*
%5 = alloca double
%6 = alloca double
%7 = alloca double
%8 = alloca double
store double* %0, double** %3
store double* %1, double** %4
%9 = load double*, double** %3
%10 = call double @s6minbddist(double* %9)
store double %10, double* %6
%11 = load double*, double** %4
%12 = call double @s6minbddist(double* %11)
store double %12, double* %7
%13 = load double, double* %6
%14 = load double, double* %7
%15 = fcmp olt double %13, %14
br i1 %15, label %16, label %18
16: ; preds = %2
%17 = load double, double* %6
br label %20
18: ; preds = %2
%19 = load double, double* %7
br label %20
20: ; preds = %18, %16
%21 = phi double [ %17, %16 ], [ %19, %18 ]
store double %21, double* %8
%22 = load double*, double** %3
%23 = load double*, double** %4
%24 = call i32 @s61234distsq(double* %22, double* %23)
%25 = call double @sqrt(i32 %24)
store double %25, double* %5
%26 = load double*, double** %3
%27 = load double*, double** %4
%28 = load double, double* %5
%29 = call double @S6Dist_pass(double* %26, double* %27, double %28)
store double %29, double* %5
%30 = load double, double* %5
ret double %30
}

LLVM IR (-O2):
define double @CS6Dist(double* %0, double* %1) {
%3 = tail call double @s6minbddist(double* %0)
%4 = tail call double @s6minbddist(double* %1)
%5 = tail call i32 @s61234distsq(double* %0, double* %1)
%6 = tail call double @sqrt(i32 %5)
%7 = tail call double @S6Dist_pass(double* %0, double* %1, double %6)
ret double %7
}