#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 FLT_MAX;
void minimum_image_triclinic(double *dx, float *box) {
  double dx_min[3] = {0.0, 0.0, 0.0};
  double dsq_min = FLT_MAX;
  double dsq;
  double rx;
  double ry[2];
  double rz[3];
  int ix, iy, iz;
  for (ix = -1; ix < 2; ++ix) {
    rx = dx[0] + box[0] * ix;
    for (iy = -1; iy < 2; ++iy) {
      ry[0] = rx + box[3] * iy;
      ry[1] = dx[1] + box[4] * iy;
      for (iz = -1; iz < 2; ++iz) {
        rz[0] = ry[0] + box[6] * iz;
        rz[1] = ry[1] + box[7] * iz;
        rz[2] = dx[2] + box[8] * iz;
        dsq = rz[0] * rz[0] + rz[1] * rz[1] + rz[2] * rz[2];
        if (dsq < dsq_min) {
          dsq_min = dsq;
          dx_min[0] = rz[0];
          dx_min[1] = rz[1];
          dx_min[2] = rz[2];
        }
      }
    }
  }
  dx[0] = dx_min[0];
  dx[1] = dx_min[1];
  dx[2] = dx_min[2];
}


x86 assembly (clang, -O0):
<minimum_image_triclinic>:
push   %rbp
mov    %rsp,%rbp
sub    $0x90,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x30(%rbp),%rdi
xor    %esi,%esi
mov    $0x18,%edx
call   1030 <memset@plt>
mov    0x2eae(%rip),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0x38(%rbp)
movl   $0xffffffff,-0x84(%rbp)
ff ff ff
cmpl   $0x2,-0x84(%rbp)
jge    1336 <minimum_image_triclinic+0x226>
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x10(%rbp),%rax
movss  (%rax),%xmm1
cvtsi2ssl -0x84(%rbp),%xmm2
ff
mulss  %xmm2,%xmm1
cvtss2sd %xmm1,%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x48(%rbp)
movl   $0xffffffff,-0x88(%rbp)
ff ff ff
cmpl   $0x2,-0x88(%rbp)
jge    131d <minimum_image_triclinic+0x20d>
movsd  -0x48(%rbp),%xmm0
mov    -0x10(%rbp),%rax
movss  0xc(%rax),%xmm1
cvtsi2ssl -0x88(%rbp),%xmm2
ff
mulss  %xmm2,%xmm1
cvtss2sd %xmm1,%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x60(%rbp)
mov    -0x8(%rbp),%rax
movsd  0x8(%rax),%xmm0
mov    -0x10(%rbp),%rax
movss  0x10(%rax),%xmm1
cvtsi2ssl -0x88(%rbp),%xmm2
ff
mulss  %xmm2,%xmm1
cvtss2sd %xmm1,%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x58(%rbp)
movl   $0xffffffff,-0x8c(%rbp)
ff ff ff
cmpl   $0x2,-0x8c(%rbp)
jge    1304 <minimum_image_triclinic+0x1f4>
movsd  -0x60(%rbp),%xmm0
mov    -0x10(%rbp),%rax
movss  0x18(%rax),%xmm1
cvtsi2ssl -0x8c(%rbp),%xmm2
ff
mulss  %xmm2,%xmm1
cvtss2sd %xmm1,%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x80(%rbp)
movsd  -0x58(%rbp),%xmm0
mov    -0x10(%rbp),%rax
movss  0x1c(%rax),%xmm1
cvtsi2ssl -0x8c(%rbp),%xmm2
ff
mulss  %xmm2,%xmm1
cvtss2sd %xmm1,%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x78(%rbp)
mov    -0x8(%rbp),%rax
movsd  0x10(%rax),%xmm0
mov    -0x10(%rbp),%rax
movss  0x20(%rax),%xmm1
cvtsi2ssl -0x8c(%rbp),%xmm2
ff
mulss  %xmm2,%xmm1
cvtss2sd %xmm1,%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x70(%rbp)
movsd  -0x80(%rbp),%xmm1
movsd  -0x80(%rbp),%xmm2
movsd  -0x78(%rbp),%xmm0
mulsd  -0x78(%rbp),%xmm0
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
movsd  -0x70(%rbp),%xmm0
movsd  -0x70(%rbp),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  -0x40(%rbp),%xmm1
movsd  -0x38(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jbe    12eb <minimum_image_triclinic+0x1db>
movsd  -0x40(%rbp),%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  -0x80(%rbp),%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x78(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x70(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
jmp    12f0 <minimum_image_triclinic+0x1e0>
mov    -0x8c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8c(%rbp)
jmp    11f6 <minimum_image_triclinic+0xe6>
jmp    1309 <minimum_image_triclinic+0x1f9>
mov    -0x88(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x88(%rbp)
jmp    118d <minimum_image_triclinic+0x7d>
jmp    1322 <minimum_image_triclinic+0x212>
mov    -0x84(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x84(%rbp)
jmp    114d <minimum_image_triclinic+0x3d>
movsd  -0x30(%rbp),%xmm0
mov    -0x8(%rbp),%rax
movsd  %xmm0,(%rax)
movsd  -0x28(%rbp),%xmm0
mov    -0x8(%rbp),%rax
movsd  %xmm0,0x8(%rax)
movsd  -0x20(%rbp),%xmm0
mov    -0x8(%rbp),%rax
movsd  %xmm0,0x10(%rax)
add    $0x90,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<minimum_image_triclinic>:
sub    $0xc8,%rsp
mov    0x2eda(%rip),%rax
movsd  (%rax),%xmm6
movsd  (%rdi),%xmm0
movsd  %xmm0,-0x48(%rsp)
movsd  0x8(%rdi),%xmm0
movaps %xmm0,0x30(%rsp)
movss  (%rsi),%xmm0
movss  %xmm0,-0x74(%rsp)
movsd  0xc(%rsi),%xmm0
movsd  0x18(%rsi),%xmm1
movsd  0x10(%rdi),%xmm8
movaps 0xeb9(%rip),%xmm2
movaps %xmm1,%xmm3
xorps  %xmm2,%xmm3
cvtps2pd %xmm3,%xmm10
movss  0x20(%rsi),%xmm3
cvtss2sd %xmm3,%xmm4
movapd %xmm8,%xmm7
cvtps2pd %xmm1,%xmm5
movaps %xmm5,-0x60(%rsp)
xorps  %xmm5,%xmm5
mulps  %xmm5,%xmm1
cvtps2pd %xmm1,%xmm1
movaps %xmm1,-0x70(%rsp)
subsd  %xmm4,%xmm7
xorps  %xmm1,%xmm1
mulss  %xmm3,%xmm1
cvtss2sd %xmm1,%xmm1
addsd  %xmm8,%xmm1
movapd %xmm1,-0x40(%rsp)
xorps  %xmm0,%xmm2
cvtps2pd %xmm2,%xmm1
movaps %xmm1,(%rsp)
addsd  %xmm4,%xmm8
cvtps2pd %xmm0,%xmm1
movapd %xmm1,-0x10(%rsp)
mulps  %xmm5,%xmm0
cvtps2pd %xmm0,%xmm0
movapd %xmm0,-0x20(%rsp)
xorpd  %xmm1,%xmm1
mov    $0xffffffff,%eax
movapd %xmm8,0x20(%rsp)
movapd %xmm10,-0x30(%rsp)
movapd %xmm7,0x10(%rsp)
jmp    1318 <minimum_image_triclinic+0x218>
cs nopw 0x0(%rax,%rax,1)
nop
cmpltsd 0xb0(%rsp),%xmm9
movapd %xmm9,%xmm2
andnpd 0xa0(%rsp),%xmm9
movapd %xmm4,%xmm10
movapd 0x10(%rsp),%xmm5
andpd  %xmm5,%xmm2
orpd   %xmm2,%xmm9
cmpltsd 0x90(%rsp),%xmm11
movapd %xmm11,%xmm2
andnpd %xmm9,%xmm2
movapd -0x40(%rsp),%xmm4
andpd  %xmm4,%xmm11
orpd   %xmm2,%xmm11
cmpltsd 0x80(%rsp),%xmm13
movapd %xmm13,%xmm2
andnpd %xmm11,%xmm2
movapd 0x20(%rsp),%xmm6
andpd  %xmm6,%xmm13
orpd   %xmm2,%xmm13
cmpltsd 0x70(%rsp),%xmm7
movapd %xmm7,%xmm2
andnpd %xmm13,%xmm2
andpd  %xmm5,%xmm7
orpd   %xmm2,%xmm7
cmpltsd 0x60(%rsp),%xmm3
movapd %xmm3,%xmm2
andnpd %xmm7,%xmm2
movapd %xmm5,%xmm7
movapd %xmm10,%xmm5
andpd  %xmm4,%xmm3
orpd   %xmm2,%xmm3
cmpltsd 0x50(%rsp),%xmm8
01
movapd %xmm8,%xmm2
andnpd %xmm3,%xmm2
andpd  %xmm6,%xmm8
orpd   %xmm2,%xmm8
cmpltsd 0x40(%rsp),%xmm14
01
movapd %xmm14,%xmm2
andnpd %xmm8,%xmm2
movapd %xmm6,%xmm8
andpd  %xmm7,%xmm14
orpd   %xmm2,%xmm14
cmpltsd %xmm12,%xmm15
movapd %xmm15,%xmm2
andnpd %xmm14,%xmm2
andpd  %xmm4,%xmm15
orpd   %xmm2,%xmm15
movapd %xmm1,%xmm6
minsd  %xmm0,%xmm6
cmpltsd %xmm0,%xmm1
movapd %xmm1,%xmm0
andnpd %xmm15,%xmm0
andpd  %xmm8,%xmm1
orpd   %xmm0,%xmm1
add    $0x1,%eax
cmp    $0x2,%eax
movapd -0x30(%rsp),%xmm10
je     15dc <minimum_image_triclinic+0x4dc>
movapd %xmm1,0xa0(%rsp)
xorps  %xmm0,%xmm0
cvtsi2ss %eax,%xmm0
mulss  -0x74(%rsp),%xmm0
xorps  %xmm12,%xmm12
cvtss2sd %xmm0,%xmm12
addsd  -0x48(%rsp),%xmm12
unpcklpd 0x30(%rsp),%xmm12
movapd %xmm12,%xmm3
addpd  (%rsp),%xmm3
movapd %xmm3,%xmm1
addpd  %xmm10,%xmm1
movapd %xmm1,%xmm0
mulpd  %xmm1,%xmm0
unpckhpd %xmm0,%xmm0
movapd %xmm1,%xmm9
mulsd  %xmm1,%xmm9
addsd  %xmm0,%xmm9
movapd %xmm7,%xmm14
mulsd  %xmm7,%xmm14
addsd  %xmm14,%xmm9
ucomisd %xmm9,%xmm6
ja     138f <minimum_image_triclinic+0x28f>
movaps %xmm5,%xmm2
movaps %xmm5,%xmm1
movapd %xmm9,%xmm2
minsd  %xmm6,%xmm2
movapd %xmm3,%xmm4
addpd  -0x70(%rsp),%xmm4
movapd %xmm4,%xmm0
mulpd  %xmm4,%xmm0
unpckhpd %xmm0,%xmm0
movapd %xmm4,%xmm11
mulsd  %xmm4,%xmm11
addsd  %xmm0,%xmm11
movapd -0x40(%rsp),%xmm15
mulsd  %xmm15,%xmm15
addsd  %xmm15,%xmm11
ucomisd %xmm11,%xmm2
ja     13d9 <minimum_image_triclinic+0x2d9>
movapd %xmm1,%xmm4
movapd %xmm6,0xb0(%rsp)
movapd %xmm11,%xmm0
minsd  %xmm2,%xmm0
addpd  -0x60(%rsp),%xmm3
movapd %xmm3,%xmm1
mulpd  %xmm3,%xmm1
unpckhpd %xmm1,%xmm1
movapd %xmm3,%xmm13
mulsd  %xmm3,%xmm13
addsd  %xmm1,%xmm13
movapd %xmm8,%xmm1
mulsd  %xmm8,%xmm1
addsd  %xmm1,%xmm13
ucomisd %xmm13,%xmm0
ja     1426 <minimum_image_triclinic+0x326>
movapd %xmm4,%xmm3
movapd %xmm2,0x90(%rsp)
movapd %xmm13,%xmm2
movapd %xmm0,0x80(%rsp)
minsd  %xmm0,%xmm2
movapd %xmm12,%xmm0
addpd  -0x20(%rsp),%xmm0
movapd %xmm0,%xmm4
addpd  %xmm10,%xmm4
movapd %xmm4,%xmm6
mulpd  %xmm4,%xmm6
unpckhpd %xmm6,%xmm6
movapd %xmm4,%xmm7
mulsd  %xmm4,%xmm7
addsd  %xmm6,%xmm7
addsd  %xmm14,%xmm7
ucomisd %xmm7,%xmm2
ja     147c <minimum_image_triclinic+0x37c>
movapd %xmm3,%xmm4
movapd %xmm7,%xmm5
movapd %xmm2,0x70(%rsp)
minsd  %xmm2,%xmm5
movapd %xmm0,%xmm2
addpd  -0x70(%rsp),%xmm2
movapd %xmm2,%xmm6
mulpd  %xmm2,%xmm6
unpckhpd %xmm6,%xmm6
movapd %xmm2,%xmm3
mulsd  %xmm2,%xmm3
addsd  %xmm6,%xmm3
addsd  %xmm15,%xmm3
ucomisd %xmm3,%xmm5
ja     14bb <minimum_image_triclinic+0x3bb>
movapd %xmm4,%xmm2
movapd %xmm3,%xmm4
movapd %xmm5,0x60(%rsp)
minsd  %xmm5,%xmm4
addpd  -0x60(%rsp),%xmm0
movapd %xmm0,%xmm6
mulpd  %xmm0,%xmm6
unpckhpd %xmm6,%xmm6
movapd %xmm0,%xmm8
mulsd  %xmm0,%xmm8
addsd  %xmm6,%xmm8
addsd  %xmm1,%xmm8
ucomisd %xmm8,%xmm4
ja     14fa <minimum_image_triclinic+0x3fa>
movapd %xmm2,%xmm0
movapd %xmm8,%xmm10
minsd  %xmm4,%xmm10
addpd  -0x10(%rsp),%xmm12
movapd %xmm12,%xmm5
addpd  -0x30(%rsp),%xmm5
movapd %xmm5,%xmm2
mulpd  %xmm5,%xmm2
unpckhpd %xmm2,%xmm2
movapd %xmm5,%xmm6
mulsd  %xmm5,%xmm6
addsd  %xmm2,%xmm6
addsd  %xmm6,%xmm14
ucomisd %xmm14,%xmm10
ja     153e <minimum_image_triclinic+0x43e>
movapd %xmm0,%xmm5
movapd %xmm14,%xmm6
movapd %xmm10,0x40(%rsp)
minsd  %xmm10,%xmm6
movapd %xmm12,%xmm10
addpd  -0x70(%rsp),%xmm10
movapd %xmm10,%xmm0
mulpd  %xmm10,%xmm0
unpckhpd %xmm0,%xmm0
movapd %xmm10,%xmm2
mulsd  %xmm10,%xmm2
addsd  %xmm0,%xmm2
addsd  %xmm2,%xmm15
ucomisd %xmm15,%xmm6
ja     1588 <minimum_image_triclinic+0x488>
movapd %xmm5,%xmm10
movapd %xmm4,0x50(%rsp)
movapd %xmm15,%xmm0
minsd  %xmm6,%xmm0
addpd  -0x60(%rsp),%xmm12
movapd %xmm12,%xmm2
mulpd  %xmm12,%xmm2
unpckhpd %xmm2,%xmm2
movapd %xmm12,%xmm5
mulsd  %xmm12,%xmm5
addsd  %xmm2,%xmm5
addsd  %xmm5,%xmm1
ucomisd %xmm1,%xmm0
movapd %xmm12,%xmm4
movapd %xmm6,%xmm12
ja     11e0 <minimum_image_triclinic+0xe0>
movapd %xmm10,%xmm4
jmp    11e0 <minimum_image_triclinic+0xe0>
movups %xmm5,(%rdi)
movsd  %xmm1,0x10(%rdi)
add    $0xc8,%rsp
ret

LLVM IR (-O0):
@FLT_MAX = global double 0.000000e+00
define void @minimum_image_triclinic(double* %0, float* %1) {
%3 = alloca double*
%4 = alloca float*
%5 = alloca [3 x double]
%6 = alloca double
%7 = alloca double
%8 = alloca double
%9 = alloca [2 x double]
%10 = alloca [3 x double]
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
store double* %0, double** %3
store float* %1, float** %4
%14 = bitcast [3 x double]* %5 to i8*
%15 = load double, double* @FLT_MAX
store double %15, double* %6
store i32 -1, i32* %11
br label %16
16: ; preds = %133, %2
%17 = load i32, i32* %11
%18 = icmp slt i32 %17, 2
br i1 %18, label %19, label %136
19: ; preds = %16
%20 = load double*, double** %3
%21 = getelementptr inbounds double, double* %20, i64 0
%22 = load double, double* %21
%23 = load float*, float** %4
%24 = getelementptr inbounds float, float* %23, i64 0
%25 = load float, float* %24
%26 = load i32, i32* %11
%27 = sitofp i32 %26 to float
%28 = fmul float %25, %27
%29 = fpext float %28 to double
%30 = fadd double %22, %29
store double %30, double* %8
store i32 -1, i32* %12
br label %31
31: ; preds = %129, %19
%32 = load i32, i32* %12
%33 = icmp slt i32 %32, 2
br i1 %33, label %34, label %132
34: ; preds = %31
%35 = load double, double* %8
%36 = load float*, float** %4
%37 = getelementptr inbounds float, float* %36, i64 3
%38 = load float, float* %37
%39 = load i32, i32* %12
%40 = sitofp i32 %39 to float
%41 = fmul float %38, %40
%42 = fpext float %41 to double
%43 = fadd double %35, %42
%44 = getelementptr inbounds [2 x double], [2 x double]* %9, i64 0, i64 0
store double %43, double* %44
%45 = load double*, double** %3
%46 = getelementptr inbounds double, double* %45, i64 1
%47 = load double, double* %46
%48 = load float*, float** %4
%49 = getelementptr inbounds float, float* %48, i64 4
%50 = load float, float* %49
%51 = load i32, i32* %12
%52 = sitofp i32 %51 to float
%53 = fmul float %50, %52
%54 = fpext float %53 to double
%55 = fadd double %47, %54
%56 = getelementptr inbounds [2 x double], [2 x double]* %9, i64 0, i64 1
store double %55, double* %56
store i32 -1, i32* %13
br label %57
57: ; preds = %125, %34
%58 = load i32, i32* %13
%59 = icmp slt i32 %58, 2
br i1 %59, label %60, label %128
60: ; preds = %57
%61 = getelementptr inbounds [2 x double], [2 x double]* %9, i64 0, i64 0
%62 = load double, double* %61
%63 = load float*, float** %4
%64 = getelementptr inbounds float, float* %63, i64 6
%65 = load float, float* %64
%66 = load i32, i32* %13
%67 = sitofp i32 %66 to float
%68 = fmul float %65, %67
%69 = fpext float %68 to double
%70 = fadd double %62, %69
%71 = getelementptr inbounds [3 x double], [3 x double]* %10, i64 0, i64 0
store double %70, double* %71
%72 = getelementptr inbounds [2 x double], [2 x double]* %9, i64 0, i64 1
%73 = load double, double* %72
%74 = load float*, float** %4
%75 = getelementptr inbounds float, float* %74, i64 7
%76 = load float, float* %75
%77 = load i32, i32* %13
%78 = sitofp i32 %77 to float
%79 = fmul float %76, %78
%80 = fpext float %79 to double
%81 = fadd double %73, %80
%82 = getelementptr inbounds [3 x double], [3 x double]* %10, i64 0, i64 1
store double %81, double* %82
%83 = load double*, double** %3
%84 = getelementptr inbounds double, double* %83, i64 2
%85 = load double, double* %84
%86 = load float*, float** %4
%87 = getelementptr inbounds float, float* %86, i64 8
%88 = load float, float* %87
%89 = load i32, i32* %13
%90 = sitofp i32 %89 to float
%91 = fmul float %88, %90
%92 = fpext float %91 to double
%93 = fadd double %85, %92
%94 = getelementptr inbounds [3 x double], [3 x double]* %10, i64 0, i64 2
store double %93, double* %94
%95 = getelementptr inbounds [3 x double], [3 x double]* %10, i64 0, i64 0
%96 = load double, double* %95
%97 = getelementptr inbounds [3 x double], [3 x double]* %10, i64 0, i64 0
%98 = load double, double* %97
%99 = getelementptr inbounds [3 x double], [3 x double]* %10, i64 0, i64 1
%100 = load double, double* %99
%101 = getelementptr inbounds [3 x double], [3 x double]* %10, i64 0, i64 1
%102 = load double, double* %101
%103 = fmul double %100, %102
%104 = call double @llvm.fmuladd.f64(double %96, double %98, double %103)
%105 = getelementptr inbounds [3 x double], [3 x double]* %10, i64 0, i64 2
%106 = load double, double* %105
%107 = getelementptr inbounds [3 x double], [3 x double]* %10, i64 0, i64 2
%108 = load double, double* %107
%109 = call double @llvm.fmuladd.f64(double %106, double %108, double %104)
store double %109, double* %7
%110 = load double, double* %7
%111 = load double, double* %6
%112 = fcmp olt double %110, %111
br i1 %112, label %113, label %124
113: ; preds = %60
%114 = load double, double* %7
store double %114, double* %6
%115 = getelementptr inbounds [3 x double], [3 x double]* %10, i64 0, i64 0
%116 = load double, double* %115
%117 = getelementptr inbounds [3 x double], [3 x double]* %5, i64 0, i64 0
store double %116, double* %117
%118 = getelementptr inbounds [3 x double], [3 x double]* %10, i64 0, i64 1
%119 = load double, double* %118
%120 = getelementptr inbounds [3 x double], [3 x double]* %5, i64 0, i64 1
store double %119, double* %120
%121 = getelementptr inbounds [3 x double], [3 x double]* %10, i64 0, i64 2
%122 = load double, double* %121
%123 = getelementptr inbounds [3 x double], [3 x double]* %5, i64 0, i64 2
store double %122, double* %123
br label %124
124: ; preds = %113, %60
br label %125
125: ; preds = %124
%126 = load i32, i32* %13
%127 = add nsw i32 %126, 1
store i32 %127, i32* %13
br label %57
128: ; preds = %57
br label %129
129: ; preds = %128
%130 = load i32, i32* %12
%131 = add nsw i32 %130, 1
store i32 %131, i32* %12
br label %31
132: ; preds = %31
br label %133
133: ; preds = %132
%134 = load i32, i32* %11
%135 = add nsw i32 %134, 1
store i32 %135, i32* %11
br label %16
136: ; preds = %16
%137 = getelementptr inbounds [3 x double], [3 x double]* %5, i64 0, i64 0
%138 = load double, double* %137
%139 = load double*, double** %3
%140 = getelementptr inbounds double, double* %139, i64 0
store double %138, double* %140
%141 = getelementptr inbounds [3 x double], [3 x double]* %5, i64 0, i64 1
%142 = load double, double* %141
%143 = load double*, double** %3
%144 = getelementptr inbounds double, double* %143, i64 1
store double %142, double* %144
%145 = getelementptr inbounds [3 x double], [3 x double]* %5, i64 0, i64 2
%146 = load double, double* %145
%147 = load double*, double** %3
%148 = getelementptr inbounds double, double* %147, i64 2
store double %146, double* %148
ret void
}

LLVM IR (-O2):
@FLT_MAX = global double 0.000000e+00
define void @minimum_image_triclinic(double* nocapture %0, float* nocapture %1) {
%3 = load double, double* @FLT_MAX
%4 = load double, double* %0
%5 = load float, float* %1
%6 = getelementptr inbounds float, float* %1, i64 3
%7 = getelementptr inbounds double, double* %0, i64 1
%8 = load double, double* %7
%9 = bitcast float* %6 to <2 x float>*
%10 = load <2 x float>, <2 x float>* %9
%11 = getelementptr inbounds float, float* %1, i64 6
%12 = bitcast float* %11 to <2 x float>*
%13 = load <2 x float>, <2 x float>* %12
%14 = getelementptr inbounds double, double* %0, i64 2
%15 = load double, double* %14
%16 = getelementptr inbounds float, float* %1, i64 8
%17 = load float, float* %16
%18 = fneg <2 x float> %13
%19 = fpext <2 x float> %18 to <2 x double>
%20 = fneg float %17
%21 = fpext float %20 to double
%22 = fadd double %15, %21
%23 = fmul <2 x float> %13, zeroinitializer
%24 = fpext <2 x float> %23 to <2 x double>
%25 = fmul float %17, 0.000000e+00
%26 = fpext float %25 to double
%27 = fadd double %15, %26
%28 = fpext <2 x float> %13 to <2 x double>
%29 = fpext float %17 to double
%30 = fadd double %15, %29
%31 = fneg <2 x float> %10
%32 = fpext <2 x float> %31 to <2 x double>
%33 = fmul <2 x float> %10, zeroinitializer
%34 = fpext <2 x float> %33 to <2 x double>
%35 = fpext <2 x float> %10 to <2 x double>
br label %36
36: ; preds = %2, %36
%37 = phi i32 [ -1, %2 ], [ %140, %36 ]
%38 = phi double [ 0.000000e+00, %2 ], [ %138, %36 ]
%39 = phi double [ %3, %2 ], [ %137, %36 ]
%40 = phi <2 x double> [ zeroinitializer, %2 ], [ %139, %36 ]
%41 = sitofp i32 %37 to float
%42 = fmul float %5, %41
%43 = fpext float %42 to double
%44 = fadd double %4, %43
%45 = insertelement <2 x double> poison, double %44, i64 0
%46 = insertelement <2 x double> %45, double %8, i64 1
%47 = fadd <2 x double> %46, %32
%48 = fadd <2 x double> %47, %19
%49 = fmul <2 x double> %48, %48
%50 = extractelement <2 x double> %49, i64 1
%51 = extractelement <2 x double> %48, i64 0
%52 = tail call double @llvm.fmuladd.f64(double %51, double %51, double %50)
%53 = tail call double @llvm.fmuladd.f64(double %22, double %22, double %52)
%54 = fcmp olt double %53, %39
%55 = select i1 %54, double %53, double %39
%56 = select i1 %54, double %22, double %38
%57 = select i1 %54, <2 x double> %48, <2 x double> %40
%58 = fadd <2 x double> %47, %24
%59 = fmul <2 x double> %58, %58
%60 = extractelement <2 x double> %59, i64 1
%61 = extractelement <2 x double> %58, i64 0
%62 = tail call double @llvm.fmuladd.f64(double %61, double %61, double %60)
%63 = tail call double @llvm.fmuladd.f64(double %27, double %27, double %62)
%64 = fcmp olt double %63, %55
%65 = select i1 %64, double %63, double %55
%66 = select i1 %64, double %27, double %56
%67 = select i1 %64, <2 x double> %58, <2 x double> %57
%68 = fadd <2 x double> %47, %28
%69 = fmul <2 x double> %68, %68
%70 = extractelement <2 x double> %69, i64 1
%71 = extractelement <2 x double> %68, i64 0
%72 = tail call double @llvm.fmuladd.f64(double %71, double %71, double %70)
%73 = tail call double @llvm.fmuladd.f64(double %30, double %30, double %72)
%74 = fcmp olt double %73, %65
%75 = select i1 %74, double %73, double %65
%76 = select i1 %74, double %30, double %66
%77 = select i1 %74, <2 x double> %68, <2 x double> %67
%78 = fadd <2 x double> %46, %34
%79 = fadd <2 x double> %78, %19
%80 = fmul <2 x double> %79, %79
%81 = extractelement <2 x double> %80, i64 1
%82 = extractelement <2 x double> %79, i64 0
%83 = tail call double @llvm.fmuladd.f64(double %82, double %82, double %81)
%84 = tail call double @llvm.fmuladd.f64(double %22, double %22, double %83)
%85 = fcmp olt double %84, %75
%86 = select i1 %85, double %84, double %75
%87 = select i1 %85, double %22, double %76
%88 = select i1 %85, <2 x double> %79, <2 x double> %77
%89 = fadd <2 x double> %78, %24
%90 = fmul <2 x double> %89, %89
%91 = extractelement <2 x double> %90, i64 1
%92 = extractelement <2 x double> %89, i64 0
%93 = tail call double @llvm.fmuladd.f64(double %92, double %92, double %91)
%94 = tail call double @llvm.fmuladd.f64(double %27, double %27, double %93)
%95 = fcmp olt double %94, %86
%96 = select i1 %95, double %94, double %86
%97 = select i1 %95, double %27, double %87
%98 = select i1 %95, <2 x double> %89, <2 x double> %88
%99 = fadd <2 x double> %78, %28
%100 = fmul <2 x double> %99, %99
%101 = extractelement <2 x double> %100, i64 1
%102 = extractelement <2 x double> %99, i64 0
%103 = tail call double @llvm.fmuladd.f64(double %102, double %102, double %101)
%104 = tail call double @llvm.fmuladd.f64(double %30, double %30, double %103)
%105 = fcmp olt double %104, %96
%106 = select i1 %105, double %104, double %96
%107 = select i1 %105, double %30, double %97
%108 = select i1 %105, <2 x double> %99, <2 x double> %98
%109 = fadd <2 x double> %46, %35
%110 = fadd <2 x double> %109, %19
%111 = fmul <2 x double> %110, %110
%112 = extractelement <2 x double> %111, i64 1
%113 = extractelement <2 x double> %110, i64 0
%114 = tail call double @llvm.fmuladd.f64(double %113, double %113, double %112)
%115 = tail call double @llvm.fmuladd.f64(double %22, double %22, double %114)
%116 = fcmp olt double %115, %106
%117 = select i1 %116, double %115, double %106
%118 = select i1 %116, double %22, double %107
%119 = select i1 %116, <2 x double> %110, <2 x double> %108
%120 = fadd <2 x double> %109, %24
%121 = fmul <2 x double> %120, %120
%122 = extractelement <2 x double> %121, i64 1
%123 = extractelement <2 x double> %120, i64 0
%124 = tail call double @llvm.fmuladd.f64(double %123, double %123, double %122)
%125 = tail call double @llvm.fmuladd.f64(double %27, double %27, double %124)
%126 = fcmp olt double %125, %117
%127 = select i1 %126, double %125, double %117
%128 = select i1 %126, double %27, double %118
%129 = select i1 %126, <2 x double> %120, <2 x double> %119
%130 = fadd <2 x double> %109, %28
%131 = fmul <2 x double> %130, %130
%132 = extractelement <2 x double> %131, i64 1
%133 = extractelement <2 x double> %130, i64 0
%134 = tail call double @llvm.fmuladd.f64(double %133, double %133, double %132)
%135 = tail call double @llvm.fmuladd.f64(double %30, double %30, double %134)
%136 = fcmp olt double %135, %127
%137 = select i1 %136, double %135, double %127
%138 = select i1 %136, double %30, double %128
%139 = select i1 %136, <2 x double> %130, <2 x double> %129
%140 = add nsw i32 %37, 1
%141 = icmp eq i32 %140, 2
br i1 %141, label %142, label %36
142: ; preds = %36
%143 = bitcast double* %0 to <2 x double>*
store <2 x double> %139, <2 x double>* %143
store double %138, double* %14
ret void
}