#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 fabs(double);
double s6minbddist(double gvec[6]) {
  int ii;
  double dists[6];
  double minbd;
  dists[0] = fabs(gvec[0]);
  dists[1] = fabs(gvec[1]);
  dists[2] = fabs(gvec[2]);
  dists[3] = fabs(gvec[3]);
  dists[4] = fabs(gvec[4]);
  dists[5] = fabs(gvec[5]);
  minbd = dists[0];
  for (ii = 1; ii < 6; ii++) {
    minbd = (((minbd) < (dists[ii])) ? (minbd) : (dists[ii]));
  }
  return minbd;
}


x86 assembly (clang, -O0):
<s6minbddist>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
movaps 0xee9(%rip),%xmm1
pand   %xmm1,%xmm0
movsd  %xmm0,-0x40(%rbp)
mov    -0x8(%rbp),%rax
movsd  0x8(%rax),%xmm0
movaps 0xed0(%rip),%xmm1
pand   %xmm1,%xmm0
movsd  %xmm0,-0x38(%rbp)
mov    -0x8(%rbp),%rax
movsd  0x10(%rax),%xmm0
movaps 0xeb7(%rip),%xmm1
pand   %xmm1,%xmm0
movsd  %xmm0,-0x30(%rbp)
mov    -0x8(%rbp),%rax
movsd  0x18(%rax),%xmm0
movaps 0xe9e(%rip),%xmm1
pand   %xmm1,%xmm0
movsd  %xmm0,-0x28(%rbp)
mov    -0x8(%rbp),%rax
movsd  0x20(%rax),%xmm0
movaps 0xe85(%rip),%xmm1
pand   %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
mov    -0x8(%rbp),%rax
movsd  0x28(%rax),%xmm0
movaps 0xe6c(%rip),%xmm1
pand   %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x40(%rbp),%xmm0
movsd  %xmm0,-0x48(%rbp)
movl   $0x1,-0xc(%rbp)
cmpl   $0x6,-0xc(%rbp)
jge    1207 <s6minbddist+0x107>
movsd  -0x48(%rbp),%xmm1
movslq -0xc(%rbp),%rax
movsd  -0x40(%rbp,%rax,8),%xmm0
ucomisd %xmm1,%xmm0
jbe    11e0 <s6minbddist+0xe0>
movsd  -0x48(%rbp),%xmm0
movsd  %xmm0,-0x50(%rbp)
jmp    11ef <s6minbddist+0xef>
movslq -0xc(%rbp),%rax
movsd  -0x40(%rbp,%rax,8),%xmm0
movsd  %xmm0,-0x50(%rbp)
movsd  -0x50(%rbp),%xmm0
movsd  %xmm0,-0x48(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    11ae <s6minbddist+0xae>
movsd  -0x48(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<s6minbddist>:
movdqu (%rdi),%xmm0
movdqa 0xef4(%rip),%xmm1
pand   %xmm1,%xmm0
movq   0x10(%rdi),%xmm2
pand   %xmm1,%xmm2
movq   0x18(%rdi),%xmm3
pand   %xmm1,%xmm3
movq   0x20(%rdi),%xmm4
pand   %xmm1,%xmm4
movq   0x28(%rdi),%xmm5
pand   %xmm1,%xmm5
pshufd $0xee,%xmm0,%xmm1
minsd  %xmm1,%xmm0
minsd  %xmm2,%xmm0
minsd  %xmm3,%xmm0
minsd  %xmm4,%xmm0
minsd  %xmm5,%xmm0
ret

LLVM IR (-O0):
define double @s6minbddist(double* %0) {
%2 = alloca double*
%3 = alloca i32
%4 = alloca [6 x double]
%5 = alloca double
store double* %0, double** %2
%6 = load double*, double** %2
%7 = getelementptr inbounds double, double* %6, i64 0
%8 = load double, double* %7
%9 = call double @llvm.fabs.f64(double %8)
%10 = getelementptr inbounds [6 x double], [6 x double]* %4, i64 0, i64 0
store double %9, double* %10
%11 = load double*, double** %2
%12 = getelementptr inbounds double, double* %11, i64 1
%13 = load double, double* %12
%14 = call double @llvm.fabs.f64(double %13)
%15 = getelementptr inbounds [6 x double], [6 x double]* %4, i64 0, i64 1
store double %14, double* %15
%16 = load double*, double** %2
%17 = getelementptr inbounds double, double* %16, i64 2
%18 = load double, double* %17
%19 = call double @llvm.fabs.f64(double %18)
%20 = getelementptr inbounds [6 x double], [6 x double]* %4, i64 0, i64 2
store double %19, double* %20
%21 = load double*, double** %2
%22 = getelementptr inbounds double, double* %21, i64 3
%23 = load double, double* %22
%24 = call double @llvm.fabs.f64(double %23)
%25 = getelementptr inbounds [6 x double], [6 x double]* %4, i64 0, i64 3
store double %24, double* %25
%26 = load double*, double** %2
%27 = getelementptr inbounds double, double* %26, i64 4
%28 = load double, double* %27
%29 = call double @llvm.fabs.f64(double %28)
%30 = getelementptr inbounds [6 x double], [6 x double]* %4, i64 0, i64 4
store double %29, double* %30
%31 = load double*, double** %2
%32 = getelementptr inbounds double, double* %31, i64 5
%33 = load double, double* %32
%34 = call double @llvm.fabs.f64(double %33)
%35 = getelementptr inbounds [6 x double], [6 x double]* %4, i64 0, i64 5
store double %34, double* %35
%36 = getelementptr inbounds [6 x double], [6 x double]* %4, i64 0, i64 0
%37 = load double, double* %36
store double %37, double* %5
store i32 1, i32* %3
br label %38
38: ; preds = %57, %1
%39 = load i32, i32* %3
%40 = icmp slt i32 %39, 6
br i1 %40, label %41, label %60
41: ; preds = %38
%42 = load double, double* %5
%43 = load i32, i32* %3
%44 = sext i32 %43 to i64
%45 = getelementptr inbounds [6 x double], [6 x double]* %4, i64 0, i64 %44
%46 = load double, double* %45
%47 = fcmp olt double %42, %46
br i1 %47, label %48, label %50
48: ; preds = %41
%49 = load double, double* %5
br label %55
50: ; preds = %41
%51 = load i32, i32* %3
%52 = sext i32 %51 to i64
%53 = getelementptr inbounds [6 x double], [6 x double]* %4, i64 0, i64 %52
%54 = load double, double* %53
br label %55
55: ; preds = %50, %48
%56 = phi double [ %49, %48 ], [ %54, %50 ]
store double %56, double* %5
br label %57
57: ; preds = %55
%58 = load i32, i32* %3
%59 = add nsw i32 %58, 1
store i32 %59, i32* %3
br label %38
60: ; preds = %38
%61 = load double, double* %5
ret double %61
}

LLVM IR (-O2):
define double @s6minbddist(double* nocapture %0) {
%2 = bitcast double* %0 to <2 x double>*
%3 = load <2 x double>, <2 x double>* %2
%4 = call <2 x double> @llvm.fabs.v2f64(<2 x double> %3)
%5 = getelementptr inbounds double, double* %0, i64 2
%6 = load double, double* %5
%7 = tail call double @llvm.fabs.f64(double %6)
%8 = getelementptr inbounds double, double* %0, i64 3
%9 = load double, double* %8
%10 = tail call double @llvm.fabs.f64(double %9)
%11 = getelementptr inbounds double, double* %0, i64 4
%12 = load double, double* %11
%13 = tail call double @llvm.fabs.f64(double %12)
%14 = getelementptr inbounds double, double* %0, i64 5
%15 = load double, double* %14
%16 = tail call double @llvm.fabs.f64(double %15)
%17 = extractelement <2 x double> %4, i64 0
%18 = extractelement <2 x double> %4, i64 1
%19 = fcmp olt double %17, %18
%20 = select i1 %19, double %17, double %18
%21 = fcmp olt double %20, %7
%22 = select i1 %21, double %20, double %7
%23 = fcmp olt double %22, %10
%24 = select i1 %23, double %22, double %10
%25 = fcmp olt double %24, %13
%26 = select i1 %25, double %24, double %13
%27 = fcmp olt double %26, %16
%28 = select i1 %27, double %26, double %16
ret double %28
}