#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 const mat_Dabs(int /*<<< orphan*/);
int /*<<< orphan*/ mat_copy_vector_d3(double *, double *);
int /*<<< orphan*/ mat_get_determinant_d3(double **);
scalar_t__ mat_norm_squared_d3(double *);
void get_Delaunay_shortest_vectors_2D(double basis[3][3],
                                      const double unique_vec[3],
                                      const double symprec) {
  int i, j;
  double b[4][3], tmpmat[3][3];
  double tmpvec[3];
  for (i = 0; i < 3; i++) {
    for (j = 0; j < 3; j++) {
      b[i][j] = basis[i][j];
    }
  }
  for (i = 0; i < 3; i++) {
    b[3][i] = basis[0][i] + basis[1][i];
  }
  for (i = 0; i < 3; i++) {
    for (j = 0; j < 3; j++) {
      if (mat_norm_squared_d3(b[j]) > mat_norm_squared_d3(b[j + 1])) {
        mat_copy_vector_d3(tmpvec, b[j]);
        mat_copy_vector_d3(b[j], b[j + 1]);
        mat_copy_vector_d3(b[j + 1], tmpvec);
      }
    }
  }
  for (i = 0; i < 3; i++) {
    tmpmat[i][0] = b[0][i];
    tmpmat[i][1] = unique_vec[i];
  }
  for (i = 1; i < 4; i++) {
    for (j = 0; j < 3; j++) {
      tmpmat[j][2] = b[i][j];
    }
    if (mat_Dabs(mat_get_determinant_d3(tmpmat)) > symprec) {
      for (j = 0; j < 3; j++) {
        basis[0][j] = b[0][j];
        basis[1][j] = b[i][j];
      }
      break;
    }
  }
}


x86 assembly (clang, -O0):
<get_Delaunay_shortest_vectors_2D>:
push   %rbp
mov    %rsp,%rbp
sub    $0x100,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movsd  %xmm0,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
cmpl   $0x3,-0x1c(%rbp)
jge    11cb <get_Delaunay_shortest_vectors_2D+0x8b>
movl   $0x0,-0x20(%rbp)
cmpl   $0x3,-0x20(%rbp)
jge    11b8 <get_Delaunay_shortest_vectors_2D+0x78>
mov    -0x8(%rbp),%rax
movslq -0x1c(%rbp),%rcx
imul   $0x18,%rcx,%rcx
add    %rcx,%rax
movslq -0x20(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
movslq -0x1c(%rbp),%rcx
lea    -0x80(%rbp),%rax
imul   $0x18,%rcx,%rcx
add    %rcx,%rax
movslq -0x20(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    1170 <get_Delaunay_shortest_vectors_2D+0x30>
jmp    11bd <get_Delaunay_shortest_vectors_2D+0x7d>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    115f <get_Delaunay_shortest_vectors_2D+0x1f>
movl   $0x0,-0x1c(%rbp)
cmpl   $0x3,-0x1c(%rbp)
jge    120f <get_Delaunay_shortest_vectors_2D+0xcf>
mov    -0x8(%rbp),%rax
movslq -0x1c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x8(%rbp),%rax
movslq -0x1c(%rbp),%rcx
addsd  0x18(%rax,%rcx,8),%xmm0
movslq -0x1c(%rbp),%rax
movsd  %xmm0,-0x38(%rbp,%rax,8)
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    11d2 <get_Delaunay_shortest_vectors_2D+0x92>
movl   $0x0,-0x1c(%rbp)
cmpl   $0x3,-0x1c(%rbp)
jge    12fe <get_Delaunay_shortest_vectors_2D+0x1be>
movl   $0x0,-0x20(%rbp)
cmpl   $0x3,-0x20(%rbp)
jge    12eb <get_Delaunay_shortest_vectors_2D+0x1ab>
movslq -0x20(%rbp),%rax
lea    -0x80(%rbp),%rdi
imul   $0x18,%rax,%rax
add    %rax,%rdi
call   1040 <mat_norm_squared_d3@plt>
mov    %rax,-0xf8(%rbp)
mov    -0x20(%rbp),%eax
add    $0x1,%eax
cltq
lea    -0x80(%rbp),%rdi
imul   $0x18,%rax,%rax
add    %rax,%rdi
call   1040 <mat_norm_squared_d3@plt>
mov    %rax,%rcx
mov    -0xf8(%rbp),%rax
cmp    %rcx,%rax
jle    12d8 <get_Delaunay_shortest_vectors_2D+0x198>
lea    -0xf0(%rbp),%rdi
movslq -0x20(%rbp),%rax
lea    -0x80(%rbp),%rsi
imul   $0x18,%rax,%rax
add    %rax,%rsi
call   1050 <mat_copy_vector_d3@plt>
movslq -0x20(%rbp),%rax
lea    -0x80(%rbp),%rdi
imul   $0x18,%rax,%rax
add    %rax,%rdi
mov    -0x20(%rbp),%eax
add    $0x1,%eax
cltq
lea    -0x80(%rbp),%rsi
imul   $0x18,%rax,%rax
add    %rax,%rsi
call   1050 <mat_copy_vector_d3@plt>
mov    -0x20(%rbp),%eax
add    $0x1,%eax
cltq
lea    -0x80(%rbp),%rdi
imul   $0x18,%rax,%rax
add    %rax,%rdi
lea    -0xf0(%rbp),%rsi
call   1050 <mat_copy_vector_d3@plt>
jmp    12dd <get_Delaunay_shortest_vectors_2D+0x19d>
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    1227 <get_Delaunay_shortest_vectors_2D+0xe7>
jmp    12f0 <get_Delaunay_shortest_vectors_2D+0x1b0>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1216 <get_Delaunay_shortest_vectors_2D+0xd6>
movl   $0x0,-0x1c(%rbp)
cmpl   $0x3,-0x1c(%rbp)
jge    1361 <get_Delaunay_shortest_vectors_2D+0x221>
movslq -0x1c(%rbp),%rax
movsd  -0x80(%rbp,%rax,8),%xmm0
movslq -0x1c(%rbp),%rcx
lea    -0xd0(%rbp),%rax
imul   $0x18,%rcx,%rcx
add    %rcx,%rax
movsd  %xmm0,(%rax)
mov    -0x10(%rbp),%rax
movslq -0x1c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
movslq -0x1c(%rbp),%rcx
lea    -0xd0(%rbp),%rax
imul   $0x18,%rcx,%rcx
add    %rcx,%rax
movsd  %xmm0,0x8(%rax)
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1305 <get_Delaunay_shortest_vectors_2D+0x1c5>
movl   $0x1,-0x1c(%rbp)
cmpl   $0x4,-0x1c(%rbp)
jge    1452 <get_Delaunay_shortest_vectors_2D+0x312>
movl   $0x0,-0x20(%rbp)
cmpl   $0x3,-0x20(%rbp)
jge    13c0 <get_Delaunay_shortest_vectors_2D+0x280>
movslq -0x1c(%rbp),%rcx
lea    -0x80(%rbp),%rax
imul   $0x18,%rcx,%rcx
add    %rcx,%rax
movslq -0x20(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
movslq -0x20(%rbp),%rcx
lea    -0xd0(%rbp),%rax
imul   $0x18,%rcx,%rcx
add    %rcx,%rax
movsd  %xmm0,0x10(%rax)
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    1379 <get_Delaunay_shortest_vectors_2D+0x239>
lea    -0xd0(%rbp),%rdi
call   1030 <mat_get_determinant_d3@plt>
mov    %eax,%edi
call   1060 <mat_Dabs@plt>
ucomisd -0x18(%rbp),%xmm0
jbe    143f <get_Delaunay_shortest_vectors_2D+0x2ff>
movl   $0x0,-0x20(%rbp)
cmpl   $0x3,-0x20(%rbp)
jge    143a <get_Delaunay_shortest_vectors_2D+0x2fa>
movslq -0x20(%rbp),%rax
movsd  -0x80(%rbp,%rax,8),%xmm0
mov    -0x8(%rbp),%rax
movslq -0x20(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
movslq -0x1c(%rbp),%rcx
lea    -0x80(%rbp),%rax
imul   $0x18,%rcx,%rcx
add    %rcx,%rax
movslq -0x20(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x8(%rbp),%rax
movslq -0x20(%rbp),%rcx
movsd  %xmm0,0x18(%rax,%rcx,8)
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    13e5 <get_Delaunay_shortest_vectors_2D+0x2a5>
jmp    1452 <get_Delaunay_shortest_vectors_2D+0x312>
jmp    1444 <get_Delaunay_shortest_vectors_2D+0x304>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1368 <get_Delaunay_shortest_vectors_2D+0x228>
add    $0x100,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_Delaunay_shortest_vectors_2D>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0xe8,%rsp
movsd  %xmm0,0x8(%rsp)
mov    %rsi,0xe0(%rsp)
mov    %rdi,%rbp
movups (%rdi),%xmm0
movups 0x10(%rdi),%xmm1
movups 0x20(%rdi),%xmm2
movups 0x30(%rdi),%xmm3
movaps %xmm0,0x30(%rsp)
movaps %xmm1,0x40(%rsp)
movaps %xmm2,0x50(%rsp)
movaps %xmm3,0x60(%rsp)
mov    0x40(%rdi),%rax
mov    %rax,0x70(%rsp)
lea    0x60(%rsp),%r15
movupd (%rdi),%xmm0
movupd 0x18(%rdi),%xmm1
addpd  %xmm0,%xmm1
movupd %xmm1,0x78(%rsp)
movsd  0x10(%rdi),%xmm0
addsd  0x28(%rdi),%xmm0
movsd  %xmm0,0x88(%rsp)
lea    0x48(%rsp),%r13
lea    0x30(%rsp),%rdi
call   1040 <mat_norm_squared_d3@plt>
mov    %rax,%rbx
mov    %r13,%rdi
call   1040 <mat_norm_squared_d3@plt>
cmp    %rax,%rbx
jle    1203 <get_Delaunay_shortest_vectors_2D+0xc3>
lea    0x10(%rsp),%r12
lea    0x30(%rsp),%rbx
mov    %r12,%rdi
mov    %rbx,%rsi
call   1050 <mat_copy_vector_d3@plt>
mov    %rbx,%rdi
mov    %r13,%rsi
call   1050 <mat_copy_vector_d3@plt>
mov    %r13,%rdi
mov    %r12,%rsi
call   1050 <mat_copy_vector_d3@plt>
lea    0x78(%rsp),%r12
mov    %r13,%rdi
call   1040 <mat_norm_squared_d3@plt>
mov    %rax,%rbx
mov    %r15,%rdi
call   1040 <mat_norm_squared_d3@plt>
cmp    %rax,%rbx
jle    1246 <get_Delaunay_shortest_vectors_2D+0x106>
lea    0x10(%rsp),%rbx
mov    %rbx,%rdi
mov    %r13,%rsi
call   1050 <mat_copy_vector_d3@plt>
mov    %r13,%rdi
mov    %r15,%rsi
call   1050 <mat_copy_vector_d3@plt>
mov    %r15,%rdi
mov    %rbx,%rsi
call   1050 <mat_copy_vector_d3@plt>
mov    %r15,%rdi
call   1040 <mat_norm_squared_d3@plt>
mov    %rax,%rbx
mov    %r12,%rdi
call   1040 <mat_norm_squared_d3@plt>
cmp    %rax,%rbx
jle    1284 <get_Delaunay_shortest_vectors_2D+0x144>
lea    0x10(%rsp),%rbx
mov    %rbx,%rdi
mov    %r15,%rsi
call   1050 <mat_copy_vector_d3@plt>
mov    %r15,%rdi
mov    %r12,%rsi
call   1050 <mat_copy_vector_d3@plt>
mov    %r12,%rdi
mov    %rbx,%rsi
call   1050 <mat_copy_vector_d3@plt>
lea    0x30(%rsp),%rdi
call   1040 <mat_norm_squared_d3@plt>
mov    %rax,%rbx
mov    %r13,%rdi
call   1040 <mat_norm_squared_d3@plt>
cmp    %rax,%rbx
jle    12c9 <get_Delaunay_shortest_vectors_2D+0x189>
lea    0x10(%rsp),%rbx
lea    0x30(%rsp),%r14
mov    %rbx,%rdi
mov    %r14,%rsi
call   1050 <mat_copy_vector_d3@plt>
mov    %r14,%rdi
mov    %r13,%rsi
call   1050 <mat_copy_vector_d3@plt>
mov    %r13,%rdi
mov    %rbx,%rsi
call   1050 <mat_copy_vector_d3@plt>
mov    %r13,%rdi
call   1040 <mat_norm_squared_d3@plt>
mov    %rax,%rbx
mov    %r15,%rdi
call   1040 <mat_norm_squared_d3@plt>
cmp    %rax,%rbx
jle    1307 <get_Delaunay_shortest_vectors_2D+0x1c7>
lea    0x10(%rsp),%rbx
mov    %rbx,%rdi
mov    %r13,%rsi
call   1050 <mat_copy_vector_d3@plt>
mov    %r13,%rdi
mov    %r15,%rsi
call   1050 <mat_copy_vector_d3@plt>
mov    %r15,%rdi
mov    %rbx,%rsi
call   1050 <mat_copy_vector_d3@plt>
mov    %r15,%rdi
call   1040 <mat_norm_squared_d3@plt>
mov    %rax,%rbx
mov    %r12,%rdi
call   1040 <mat_norm_squared_d3@plt>
cmp    %rax,%rbx
jle    1345 <get_Delaunay_shortest_vectors_2D+0x205>
lea    0x10(%rsp),%rbx
mov    %rbx,%rdi
mov    %r15,%rsi
call   1050 <mat_copy_vector_d3@plt>
mov    %r15,%rdi
mov    %r12,%rsi
call   1050 <mat_copy_vector_d3@plt>
mov    %r12,%rdi
mov    %rbx,%rsi
call   1050 <mat_copy_vector_d3@plt>
lea    0x30(%rsp),%rdi
call   1040 <mat_norm_squared_d3@plt>
mov    %rax,%rbx
mov    %r13,%rdi
call   1040 <mat_norm_squared_d3@plt>
cmp    %rax,%rbx
jle    138a <get_Delaunay_shortest_vectors_2D+0x24a>
lea    0x10(%rsp),%r14
lea    0x30(%rsp),%rbx
mov    %r14,%rdi
mov    %rbx,%rsi
call   1050 <mat_copy_vector_d3@plt>
mov    %rbx,%rdi
mov    %r13,%rsi
call   1050 <mat_copy_vector_d3@plt>
mov    %r13,%rdi
mov    %r14,%rsi
call   1050 <mat_copy_vector_d3@plt>
mov    %r13,%rdi
call   1040 <mat_norm_squared_d3@plt>
mov    %rax,%rbx
mov    %r15,%rdi
call   1040 <mat_norm_squared_d3@plt>
cmp    %rax,%rbx
jle    13c8 <get_Delaunay_shortest_vectors_2D+0x288>
lea    0x10(%rsp),%rbx
mov    %rbx,%rdi
mov    %r13,%rsi
call   1050 <mat_copy_vector_d3@plt>
mov    %r13,%rdi
mov    %r15,%rsi
call   1050 <mat_copy_vector_d3@plt>
mov    %r15,%rdi
mov    %rbx,%rsi
call   1050 <mat_copy_vector_d3@plt>
mov    %r15,%rdi
call   1040 <mat_norm_squared_d3@plt>
mov    %rax,%rbx
mov    %r12,%rdi
call   1040 <mat_norm_squared_d3@plt>
cmp    %rax,%rbx
jle    1406 <get_Delaunay_shortest_vectors_2D+0x2c6>
lea    0x10(%rsp),%rbx
mov    %rbx,%rdi
mov    %r15,%rsi
call   1050 <mat_copy_vector_d3@plt>
mov    %r15,%rdi
mov    %r12,%rsi
call   1050 <mat_copy_vector_d3@plt>
mov    %r12,%rdi
mov    %rbx,%rsi
call   1050 <mat_copy_vector_d3@plt>
movsd  0x30(%rsp),%xmm0
movsd  0x38(%rsp),%xmm1
movsd  %xmm0,0x90(%rsp)
mov    0xe0(%rsp),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,0x98(%rsp)
movsd  %xmm1,0xa8(%rsp)
movsd  0x8(%rax),%xmm0
movsd  %xmm0,0xb0(%rsp)
movsd  0x40(%rsp),%xmm0
movsd  %xmm0,0xc0(%rsp)
movsd  0x10(%rax),%xmm0
movsd  %xmm0,0xc8(%rsp)
movsd  0x48(%rsp),%xmm0
movsd  %xmm0,0xa0(%rsp)
movsd  0x50(%rsp),%xmm0
movsd  %xmm0,0xb8(%rsp)
movsd  0x58(%rsp),%xmm0
movsd  %xmm0,0xd0(%rsp)
lea    0x90(%rsp),%rdi
call   1030 <mat_get_determinant_d3@plt>
mov    %eax,%edi
call   1060 <mat_Dabs@plt>
mov    $0x1,%eax
ucomisd 0x8(%rsp),%xmm0
ja     1558 <get_Delaunay_shortest_vectors_2D+0x418>
movsd  0x60(%rsp),%xmm0
movsd  0x68(%rsp),%xmm1
movsd  %xmm0,0xa0(%rsp)
movsd  %xmm1,0xb8(%rsp)
movsd  0x70(%rsp),%xmm0
movsd  %xmm0,0xd0(%rsp)
lea    0x90(%rsp),%rdi
call   1030 <mat_get_determinant_d3@plt>
mov    %eax,%edi
call   1060 <mat_Dabs@plt>
mov    $0x2,%eax
ucomisd 0x8(%rsp),%xmm0
ja     1558 <get_Delaunay_shortest_vectors_2D+0x418>
movsd  0x78(%rsp),%xmm0
movsd  0x80(%rsp),%xmm1
movsd  %xmm0,0xa0(%rsp)
movsd  %xmm1,0xb8(%rsp)
movsd  0x88(%rsp),%xmm0
movsd  %xmm0,0xd0(%rsp)
lea    0x90(%rsp),%rdi
call   1030 <mat_get_determinant_d3@plt>
mov    %eax,%edi
call   1060 <mat_Dabs@plt>
mov    $0x3,%eax
ucomisd 0x8(%rsp),%xmm0
jbe    1585 <get_Delaunay_shortest_vectors_2D+0x445>
lea    0x18(%rbp),%rcx
mov    0x40(%rsp),%rdx
mov    %rdx,0x10(%rbp)
movaps 0x30(%rsp),%xmm0
movups %xmm0,0x0(%rbp)
lea    (%rax,%rax,2),%rax
mov    0x40(%rsp,%rax,8),%rdx
mov    %rdx,0x10(%rcx)
movupd 0x30(%rsp,%rax,8),%xmm0
movupd %xmm0,(%rcx)
add    $0xe8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define void @get_Delaunay_shortest_vectors_2D([3 x double]* %0, double* %1, double %2) {
%4 = alloca [3 x double]*
%5 = alloca double*
%6 = alloca double
%7 = alloca i32
%8 = alloca i32
%9 = alloca [4 x [3 x double]]
%10 = alloca [3 x [3 x double]]
%11 = alloca [3 x double]
store [3 x double]* %0, [3 x double]** %4
store double* %1, double** %5
store double %2, double* %6
store i32 0, i32* %7
br label %12
12: ; preds = %38, %3
%13 = load i32, i32* %7
%14 = icmp slt i32 %13, 3
br i1 %14, label %15, label %41
15: ; preds = %12
store i32 0, i32* %8
br label %16
16: ; preds = %34, %15
%17 = load i32, i32* %8
%18 = icmp slt i32 %17, 3
br i1 %18, label %19, label %37
19: ; preds = %16
%20 = load [3 x double]*, [3 x double]** %4
%21 = load i32, i32* %7
%22 = sext i32 %21 to i64
%23 = getelementptr inbounds [3 x double], [3 x double]* %20, i64 %22
%24 = load i32, i32* %8
%25 = sext i32 %24 to i64
%26 = getelementptr inbounds [3 x double], [3 x double]* %23, i64 0, i64 %25
%27 = load double, double* %26
%28 = load i32, i32* %7
%29 = sext i32 %28 to i64
%30 = getelementptr inbounds [4 x [3 x double]], [4 x [3 x double]]* %9, i64 0, i64 %29
%31 = load i32, i32* %8
%32 = sext i32 %31 to i64
%33 = getelementptr inbounds [3 x double], [3 x double]* %30, i64 0, i64 %32
store double %27, double* %33
br label %34
34: ; preds = %19
%35 = load i32, i32* %8
%36 = add nsw i32 %35, 1
store i32 %36, i32* %8
br label %16
37: ; preds = %16
br label %38
38: ; preds = %37
%39 = load i32, i32* %7
%40 = add nsw i32 %39, 1
store i32 %40, i32* %7
br label %12
41: ; preds = %12
store i32 0, i32* %7
br label %42
42: ; preds = %63, %41
%43 = load i32, i32* %7
%44 = icmp slt i32 %43, 3
br i1 %44, label %45, label %66
45: ; preds = %42
%46 = load [3 x double]*, [3 x double]** %4
%47 = getelementptr inbounds [3 x double], [3 x double]* %46, i64 0
%48 = load i32, i32* %7
%49 = sext i32 %48 to i64
%50 = getelementptr inbounds [3 x double], [3 x double]* %47, i64 0, i64 %49
%51 = load double, double* %50
%52 = load [3 x double]*, [3 x double]** %4
%53 = getelementptr inbounds [3 x double], [3 x double]* %52, i64 1
%54 = load i32, i32* %7
%55 = sext i32 %54 to i64
%56 = getelementptr inbounds [3 x double], [3 x double]* %53, i64 0, i64 %55
%57 = load double, double* %56
%58 = fadd double %51, %57
%59 = getelementptr inbounds [4 x [3 x double]], [4 x [3 x double]]* %9, i64 0, i64 3
%60 = load i32, i32* %7
%61 = sext i32 %60 to i64
%62 = getelementptr inbounds [3 x double], [3 x double]* %59, i64 0, i64 %61
store double %58, double* %62
br label %63
63: ; preds = %45
%64 = load i32, i32* %7
%65 = add nsw i32 %64, 1
store i32 %65, i32* %7
br label %42
66: ; preds = %42
store i32 0, i32* %7
br label %67
67: ; preds = %116, %66
%68 = load i32, i32* %7
%69 = icmp slt i32 %68, 3
br i1 %69, label %70, label %119
70: ; preds = %67
store i32 0, i32* %8
br label %71
71: ; preds = %112, %70
%72 = load i32, i32* %8
%73 = icmp slt i32 %72, 3
br i1 %73, label %74, label %115
74: ; preds = %71
%75 = load i32, i32* %8
%76 = sext i32 %75 to i64
%77 = getelementptr inbounds [4 x [3 x double]], [4 x [3 x double]]* %9, i64 0, i64 %76
%78 = getelementptr inbounds [3 x double], [3 x double]* %77, i64 0, i64 0
%79 = call i64 @mat_norm_squared_d3(double* %78)
%80 = load i32, i32* %8
%81 = add nsw i32 %80, 1
%82 = sext i32 %81 to i64
%83 = getelementptr inbounds [4 x [3 x double]], [4 x [3 x double]]* %9, i64 0, i64 %82
%84 = getelementptr inbounds [3 x double], [3 x double]* %83, i64 0, i64 0
%85 = call i64 @mat_norm_squared_d3(double* %84)
%86 = icmp sgt i64 %79, %85
br i1 %86, label %87, label %111
87: ; preds = %74
%88 = getelementptr inbounds [3 x double], [3 x double]* %11, i64 0, i64 0
%89 = load i32, i32* %8
%90 = sext i32 %89 to i64
%91 = getelementptr inbounds [4 x [3 x double]], [4 x [3 x double]]* %9, i64 0, i64 %90
%92 = getelementptr inbounds [3 x double], [3 x double]* %91, i64 0, i64 0
%93 = call i32 @mat_copy_vector_d3(double* %88, double* %92)
%94 = load i32, i32* %8
%95 = sext i32 %94 to i64
%96 = getelementptr inbounds [4 x [3 x double]], [4 x [3 x double]]* %9, i64 0, i64 %95
%97 = getelementptr inbounds [3 x double], [3 x double]* %96, i64 0, i64 0
%98 = load i32, i32* %8
%99 = add nsw i32 %98, 1
%100 = sext i32 %99 to i64
%101 = getelementptr inbounds [4 x [3 x double]], [4 x [3 x double]]* %9, i64 0, i64 %100
%102 = getelementptr inbounds [3 x double], [3 x double]* %101, i64 0, i64 0
%103 = call i32 @mat_copy_vector_d3(double* %97, double* %102)
%104 = load i32, i32* %8
%105 = add nsw i32 %104, 1
%106 = sext i32 %105 to i64
%107 = getelementptr inbounds [4 x [3 x double]], [4 x [3 x double]]* %9, i64 0, i64 %106
%108 = getelementptr inbounds [3 x double], [3 x double]* %107, i64 0, i64 0
%109 = getelementptr inbounds [3 x double], [3 x double]* %11, i64 0, i64 0
%110 = call i32 @mat_copy_vector_d3(double* %108, double* %109)
br label %111
111: ; preds = %87, %74
br label %112
112: ; preds = %111
%113 = load i32, i32* %8
%114 = add nsw i32 %113, 1
store i32 %114, i32* %8
br label %71
115: ; preds = %71
br label %116
116: ; preds = %115
%117 = load i32, i32* %7
%118 = add nsw i32 %117, 1
store i32 %118, i32* %7
br label %67
119: ; preds = %67
store i32 0, i32* %7
br label %120
120: ; preds = %142, %119
%121 = load i32, i32* %7
%122 = icmp slt i32 %121, 3
br i1 %122, label %123, label %145
123: ; preds = %120
%124 = getelementptr inbounds [4 x [3 x double]], [4 x [3 x double]]* %9, i64 0, i64 0
%125 = load i32, i32* %7
%126 = sext i32 %125 to i64
%127 = getelementptr inbounds [3 x double], [3 x double]* %124, i64 0, i64 %126
%128 = load double, double* %127
%129 = load i32, i32* %7
%130 = sext i32 %129 to i64
%131 = getelementptr inbounds [3 x [3 x double]], [3 x [3 x double]]* %10, i64 0, i64 %130
%132 = getelementptr inbounds [3 x double], [3 x double]* %131, i64 0, i64 0
store double %128, double* %132
%133 = load double*, double** %5
%134 = load i32, i32* %7
%135 = sext i32 %134 to i64
%136 = getelementptr inbounds double, double* %133, i64 %135
%137 = load double, double* %136
%138 = load i32, i32* %7
%139 = sext i32 %138 to i64
%140 = getelementptr inbounds [3 x [3 x double]], [3 x [3 x double]]* %10, i64 0, i64 %139
%141 = getelementptr inbounds [3 x double], [3 x double]* %140, i64 0, i64 1
store double %137, double* %141
br label %142
142: ; preds = %123
%143 = load i32, i32* %7
%144 = add nsw i32 %143, 1
store i32 %144, i32* %7
br label %120
145: ; preds = %120
store i32 1, i32* %7
br label %146
146: ; preds = %207, %145
%147 = load i32, i32* %7
%148 = icmp slt i32 %147, 4
br i1 %148, label %149, label %210
149: ; preds = %146
store i32 0, i32* %8
br label %150
150: ; preds = %165, %149
%151 = load i32, i32* %8
%152 = icmp slt i32 %151, 3
br i1 %152, label %153, label %168
153: ; preds = %150
%154 = load i32, i32* %7
%155 = sext i32 %154 to i64
%156 = getelementptr inbounds [4 x [3 x double]], [4 x [3 x double]]* %9, i64 0, i64 %155
%157 = load i32, i32* %8
%158 = sext i32 %157 to i64
%159 = getelementptr inbounds [3 x double], [3 x double]* %156, i64 0, i64 %158
%160 = load double, double* %159
%161 = load i32, i32* %8
%162 = sext i32 %161 to i64
%163 = getelementptr inbounds [3 x [3 x double]], [3 x [3 x double]]* %10, i64 0, i64 %162
%164 = getelementptr inbounds [3 x double], [3 x double]* %163, i64 0, i64 2
store double %160, double* %164
br label %165
165: ; preds = %153
%166 = load i32, i32* %8
%167 = add nsw i32 %166, 1
store i32 %167, i32* %8
br label %150
168: ; preds = %150
%169 = getelementptr inbounds [3 x [3 x double]], [3 x [3 x double]]* %10, i64 0, i64 0
%170 = bitcast [3 x double]* %169 to double**
%171 = call i32 @mat_get_determinant_d3(double** %170)
%172 = call double @mat_Dabs(i32 %171)
%173 = load double, double* %6
%174 = fcmp ogt double %172, %173
br i1 %174, label %175, label %206
175: ; preds = %168
store i32 0, i32* %8
br label %176
176: ; preds = %202, %175
%177 = load i32, i32* %8
%178 = icmp slt i32 %177, 3
br i1 %178, label %179, label %205
179: ; preds = %176
%180 = getelementptr inbounds [4 x [3 x double]], [4 x [3 x double]]* %9, i64 0, i64 0
%181 = load i32, i32* %8
%182 = sext i32 %181 to i64
%183 = getelementptr inbounds [3 x double], [3 x double]* %180, i64 0, i64 %182
%184 = load double, double* %183
%185 = load [3 x double]*, [3 x double]** %4
%186 = getelementptr inbounds [3 x double], [3 x double]* %185, i64 0
%187 = load i32, i32* %8
%188 = sext i32 %187 to i64
%189 = getelementptr inbounds [3 x double], [3 x double]* %186, i64 0, i64 %188
store double %184, double* %189
%190 = load i32, i32* %7
%191 = sext i32 %190 to i64
%192 = getelementptr inbounds [4 x [3 x double]], [4 x [3 x double]]* %9, i64 0, i64 %191
%193 = load i32, i32* %8
%194 = sext i32 %193 to i64
%195 = getelementptr inbounds [3 x double], [3 x double]* %192, i64 0, i64 %194
%196 = load double, double* %195
%197 = load [3 x double]*, [3 x double]** %4
%198 = getelementptr inbounds [3 x double], [3 x double]* %197, i64 1
%199 = load i32, i32* %8
%200 = sext i32 %199 to i64
%201 = getelementptr inbounds [3 x double], [3 x double]* %198, i64 0, i64 %200
store double %196, double* %201
br label %202
202: ; preds = %179
%203 = load i32, i32* %8
%204 = add nsw i32 %203, 1
store i32 %204, i32* %8
br label %176
205: ; preds = %176
br label %210
206: ; preds = %168
br label %207
207: ; preds = %206
%208 = load i32, i32* %7
%209 = add nsw i32 %208, 1
store i32 %209, i32* %7
br label %146
210: ; preds = %205, %146
ret void
}

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