#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 */
scalar_t__ get_Delaunay_reduction_basis(double **, double const);
int /*<<< orphan*/ get_Delaunay_shortest_vectors(double **, double const);
int /*<<< orphan*/ get_exteneded_basis(double **, double **);
double const mat_Dabs(double);
int /*<<< orphan*/ mat_copy_matrix_d3(double **, double **);
double mat_get_determinant_d3(double **);
int get_Delaunay_reduction(double red_lattice[3][3], double lattice[3][3],
                           const double symprec) {
  int i, j;
  double volume, sum, red_sum;
  double basis[4][3];
  get_exteneded_basis(basis, lattice);
  sum = 0;
  for (i = 0; i < 4; i++) {
    for (j = 0; j < 3; j++) {
      sum += basis[i][j] * basis[i][j];
    }
  }
  while (1) {
    if (get_Delaunay_reduction_basis(basis, symprec)) {
      break;
    }
  }
  get_Delaunay_shortest_vectors(basis, symprec);
  red_sum = 0;
  for (i = 0; i < 4; i++) {
    for (j = 0; j < 3; j++) {
      red_sum += basis[i][j] * basis[i][j];
    }
  }
  if (sum - red_sum > symprec * symprec) {
    for (i = 0; i < 3; i++) {
      for (j = 0; j < 3; j++) {
        red_lattice[i][j] = basis[j][i];
      }
    }
  } else {
    mat_copy_matrix_d3(red_lattice, lattice);
  }
  volume = mat_get_determinant_d3(red_lattice);
  if (mat_Dabs(volume) < symprec) {
    ;
    goto err;
  }
  if (volume < 0) {
    for (i = 0; i < 3; i++) {
      for (j = 0; j < 3; j++) {
        red_lattice[i][j] = -red_lattice[i][j];
      }
    }
  }
  return 1;
err:
  return 0;
}


x86 assembly (clang, -O0):
<get_Delaunay_reduction>:
push   %rbp
mov    %rsp,%rbp
sub    $0xa0,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
movsd  %xmm0,-0x20(%rbp)
lea    -0xa0(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1050 <get_exteneded_basis@plt>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x38(%rbp)
movl   $0x0,-0x24(%rbp)
cmpl   $0x4,-0x24(%rbp)
jge    121b <get_Delaunay_reduction+0xbb>
movl   $0x0,-0x28(%rbp)
cmpl   $0x3,-0x28(%rbp)
jge    1208 <get_Delaunay_reduction+0xa8>
movslq -0x24(%rbp),%rcx
lea    -0xa0(%rbp),%rax
imul   $0x18,%rcx,%rcx
add    %rcx,%rax
movslq -0x28(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
movslq -0x24(%rbp),%rcx
lea    -0xa0(%rbp),%rax
imul   $0x18,%rcx,%rcx
add    %rcx,%rax
movslq -0x28(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm2
movsd  -0x38(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x38(%rbp)
mov    -0x28(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x28(%rbp)
jmp    11a8 <get_Delaunay_reduction+0x48>
jmp    120d <get_Delaunay_reduction+0xad>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    1197 <get_Delaunay_reduction+0x37>
jmp    1220 <get_Delaunay_reduction+0xc0>
lea    -0xa0(%rbp),%rdi
movsd  -0x20(%rbp),%xmm0
call   1060 <get_Delaunay_reduction_basis@plt>
cmp    $0x0,%rax
je     1240 <get_Delaunay_reduction+0xe0>
jmp    1245 <get_Delaunay_reduction+0xe5>
jmp    1220 <get_Delaunay_reduction+0xc0>
lea    -0xa0(%rbp),%rdi
movsd  -0x20(%rbp),%xmm0
call   1040 <get_Delaunay_shortest_vectors@plt>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x40(%rbp)
movl   $0x0,-0x24(%rbp)
cmpl   $0x4,-0x24(%rbp)
jge    12e9 <get_Delaunay_reduction+0x189>
movl   $0x0,-0x28(%rbp)
cmpl   $0x3,-0x28(%rbp)
jge    12d6 <get_Delaunay_reduction+0x176>
movslq -0x24(%rbp),%rcx
lea    -0xa0(%rbp),%rax
imul   $0x18,%rcx,%rcx
add    %rcx,%rax
movslq -0x28(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
movslq -0x24(%rbp),%rcx
lea    -0xa0(%rbp),%rax
imul   $0x18,%rcx,%rcx
add    %rcx,%rax
movslq -0x28(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm2
movsd  -0x40(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x40(%rbp)
mov    -0x28(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x28(%rbp)
jmp    1276 <get_Delaunay_reduction+0x116>
jmp    12db <get_Delaunay_reduction+0x17b>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    1265 <get_Delaunay_reduction+0x105>
movsd  -0x38(%rbp),%xmm0
subsd  -0x40(%rbp),%xmm0
movsd  -0x20(%rbp),%xmm1
mulsd  -0x20(%rbp),%xmm1
ucomisd %xmm1,%xmm0
jbe    1382 <get_Delaunay_reduction+0x222>
movl   $0x0,-0x24(%rbp)
cmpl   $0x3,-0x24(%rbp)
jge    137d <get_Delaunay_reduction+0x21d>
movl   $0x0,-0x28(%rbp)
cmpl   $0x3,-0x28(%rbp)
jge    136a <get_Delaunay_reduction+0x20a>
movslq -0x28(%rbp),%rcx
lea    -0xa0(%rbp),%rax
imul   $0x18,%rcx,%rcx
add    %rcx,%rax
movslq -0x24(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x10(%rbp),%rax
movslq -0x24(%rbp),%rcx
imul   $0x18,%rcx,%rcx
add    %rcx,%rax
movslq -0x28(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x28(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x28(%rbp)
jmp    131f <get_Delaunay_reduction+0x1bf>
jmp    136f <get_Delaunay_reduction+0x20f>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    130e <get_Delaunay_reduction+0x1ae>
jmp    138f <get_Delaunay_reduction+0x22f>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1080 <mat_copy_matrix_d3@plt>
mov    -0x10(%rbp),%rdi
call   1030 <mat_get_determinant_d3@plt>
movsd  %xmm0,-0x30(%rbp)
movsd  -0x30(%rbp),%xmm0
call   1070 <mat_Dabs@plt>
movaps %xmm0,%xmm1
movsd  -0x20(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jbe    13be <get_Delaunay_reduction+0x25e>
jmp    1467 <get_Delaunay_reduction+0x307>
xorps  %xmm0,%xmm0
ucomisd -0x30(%rbp),%xmm0
jbe    145b <get_Delaunay_reduction+0x2fb>
movl   $0x0,-0x24(%rbp)
cmpl   $0x3,-0x24(%rbp)
jge    1456 <get_Delaunay_reduction+0x2f6>
movl   $0x0,-0x28(%rbp)
cmpl   $0x3,-0x28(%rbp)
jge    1443 <get_Delaunay_reduction+0x2e3>
mov    -0x10(%rbp),%rax
movslq -0x24(%rbp),%rcx
imul   $0x18,%rcx,%rcx
add    %rcx,%rax
movslq -0x28(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mov    -0x10(%rbp),%rax
movslq -0x24(%rbp),%rcx
imul   $0x18,%rcx,%rcx
add    %rcx,%rax
movslq -0x28(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x28(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x28(%rbp)
jmp    13e4 <get_Delaunay_reduction+0x284>
jmp    1448 <get_Delaunay_reduction+0x2e8>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    13d3 <get_Delaunay_reduction+0x273>
jmp    145b <get_Delaunay_reduction+0x2fb>
movl   $0x1,-0x4(%rbp)
jmp    146e <get_Delaunay_reduction+0x30e>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0xa0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_Delaunay_reduction>:
push   %r15
push   %r14
push   %rbx
sub    $0xb0,%rsp
movsd  %xmm0,0x8(%rsp)
mov    %rsi,%r14
mov    %rdi,%r15
lea    0x10(%rsp),%rbx
mov    %rbx,%rdi
call   1050 <get_exteneded_basis@plt>
movsd  0x10(%rsp),%xmm0
movsd  0x18(%rsp),%xmm1
mulsd  %xmm0,%xmm0
xorpd  %xmm2,%xmm2
addsd  %xmm0,%xmm2
mulsd  %xmm1,%xmm1
addsd  %xmm2,%xmm1
movsd  0x20(%rsp),%xmm0
mulsd  %xmm0,%xmm0
addsd  %xmm1,%xmm0
movsd  0x28(%rsp),%xmm1
mulsd  %xmm1,%xmm1
addsd  %xmm0,%xmm1
movsd  0x30(%rsp),%xmm0
mulsd  %xmm0,%xmm0
addsd  %xmm1,%xmm0
movsd  0x38(%rsp),%xmm1
mulsd  %xmm1,%xmm1
addsd  %xmm0,%xmm1
movsd  0x40(%rsp),%xmm0
mulsd  %xmm0,%xmm0
addsd  %xmm1,%xmm0
movsd  0x48(%rsp),%xmm1
mulsd  %xmm1,%xmm1
addsd  %xmm0,%xmm1
movsd  0x50(%rsp),%xmm0
mulsd  %xmm0,%xmm0
addsd  %xmm1,%xmm0
movapd %xmm0,0x80(%rsp)
movups 0x58(%rsp),%xmm0
movaps %xmm0,0x90(%rsp)
movaps 0x60(%rsp),%xmm0
movaps %xmm0,0xa0(%rsp)
movsd  0x68(%rsp),%xmm0
movaps %xmm0,0x70(%rsp)
cs nopw 0x0(%rax,%rax,1)
nop
mov    %rbx,%rdi
movsd  0x8(%rsp),%xmm0
call   1060 <get_Delaunay_reduction_basis@plt>
test   %rax,%rax
je     1240 <get_Delaunay_reduction+0xe0>
lea    0x10(%rsp),%rdi
movsd  0x8(%rsp),%xmm0
call   1040 <get_Delaunay_shortest_vectors@plt>
movsd  0x10(%rsp),%xmm9
movsd  0x18(%rsp),%xmm8
movapd %xmm9,%xmm0
mulsd  %xmm9,%xmm0
xorpd  %xmm2,%xmm2
addsd  %xmm0,%xmm2
movapd %xmm8,%xmm0
mulsd  %xmm8,%xmm0
addsd  %xmm2,%xmm0
movsd  0x20(%rsp),%xmm10
movapd %xmm10,%xmm4
mulsd  %xmm10,%xmm4
addsd  %xmm0,%xmm4
movsd  0x28(%rsp),%xmm11
movapd %xmm11,%xmm0
mulsd  %xmm11,%xmm0
addsd  %xmm4,%xmm0
movsd  0x30(%rsp),%xmm4
movapd %xmm4,%xmm6
mulsd  %xmm4,%xmm6
addsd  %xmm0,%xmm6
movsd  0x38(%rsp),%xmm5
movapd %xmm5,%xmm0
mulsd  %xmm5,%xmm0
addsd  %xmm6,%xmm0
movsd  0x40(%rsp),%xmm1
movapd %xmm1,%xmm6
mulsd  %xmm1,%xmm6
addsd  %xmm0,%xmm6
movsd  0x48(%rsp),%xmm2
movapd %xmm2,%xmm7
mulsd  %xmm2,%xmm7
addsd  %xmm6,%xmm7
movsd  0x50(%rsp),%xmm0
movapd %xmm0,%xmm6
mulsd  %xmm0,%xmm6
addsd  %xmm7,%xmm6
movapd 0x90(%rsp),%xmm3
movhpd 0x58(%rsp),%xmm3
movapd 0x80(%rsp),%xmm7
unpcklpd %xmm6,%xmm7
mulpd  %xmm3,%xmm3
movapd 0xa0(%rsp),%xmm6
movhpd 0x60(%rsp),%xmm6
addpd  %xmm7,%xmm3
mulpd  %xmm6,%xmm6
movapd 0x70(%rsp),%xmm7
movhpd 0x68(%rsp),%xmm7
addpd  %xmm3,%xmm6
mulpd  %xmm7,%xmm7
addpd  %xmm6,%xmm7
movapd %xmm7,%xmm6
unpckhpd %xmm7,%xmm6
subsd  %xmm6,%xmm7
movsd  0x8(%rsp),%xmm6
mulsd  %xmm6,%xmm6
ucomisd %xmm6,%xmm7
jbe    13b7 <get_Delaunay_reduction+0x257>
movsd  %xmm9,(%r15)
movsd  %xmm11,0x8(%r15)
movsd  %xmm1,0x10(%r15)
movsd  %xmm8,0x18(%r15)
movsd  %xmm4,0x20(%r15)
movsd  %xmm2,0x28(%r15)
movsd  %xmm10,0x30(%r15)
movsd  %xmm5,0x38(%r15)
movsd  %xmm0,0x40(%r15)
jmp    13c2 <get_Delaunay_reduction+0x262>
mov    %r15,%rdi
mov    %r14,%rsi
call   1080 <mat_copy_matrix_d3@plt>
mov    %r15,%rdi
call   1030 <mat_get_determinant_d3@plt>
movsd  %xmm0,0x70(%rsp)
call   1070 <mat_Dabs@plt>
xor    %eax,%eax
movsd  0x8(%rsp),%xmm1
ucomisd %xmm0,%xmm1
ja     144a <get_Delaunay_reduction+0x2ea>
mov    $0x1,%eax
xorpd  %xmm0,%xmm0
ucomisd 0x70(%rsp),%xmm0
jbe    144a <get_Delaunay_reduction+0x2ea>
movapd 0xc04(%rip),%xmm0
movupd (%r15),%xmm1
movupd 0x10(%r15),%xmm2
movupd 0x20(%r15),%xmm3
movupd 0x30(%r15),%xmm4
xorpd  %xmm0,%xmm1
movupd %xmm1,(%r15)
xorpd  %xmm0,%xmm2
movupd %xmm2,0x10(%r15)
xorpd  %xmm0,%xmm3
movupd %xmm3,0x20(%r15)
xorpd  %xmm0,%xmm4
movupd %xmm4,0x30(%r15)
movsd  0x40(%r15),%xmm1
xorpd  %xmm0,%xmm1
movlpd %xmm1,0x40(%r15)
add    $0xb0,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

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

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