#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__ delaunay_reduce_basis_2D(double **, double const);
int /*<<< orphan*/ get_delaunay_shortest_vectors_2D(double **, double *,
                                                    double const);
int /*<<< orphan*/ get_exteneded_basis_2D(double **, double **);
double const mat_Dabs(double);
double mat_get_determinant_d3(double **);
int delaunay_reduce_2D(double red_lattice[3][3], double lattice[3][3],
                       const int unique_axis, const double symprec) {
  int i, j, k;
  double volume;
  double basis[3][3], lattice_2D[3][2], unique_vec[3];
  k = 0;
  for (i = 0; i < 3; i++) {
    unique_vec[i] = lattice[i][unique_axis];
  }
  for (i = 0; i < 3; i++) {
    if (i != unique_axis) {
      for (j = 0; j < 3; j++) {
        lattice_2D[j][k] = lattice[j][i];
      }
      k++;
    }
  }
  get_exteneded_basis_2D(basis, lattice_2D);
  while (1) {
    if (delaunay_reduce_basis_2D(basis, symprec)) {
      break;
    }
  }
  get_delaunay_shortest_vectors_2D(basis, unique_vec, symprec);
  k = 0;
  for (i = 0; i < 3; i++) {
    if (i == unique_axis) {
      for (j = 0; j < 3; j++) {
        red_lattice[j][i] = lattice[j][i];
      }
    } else {
      for (j = 0; j < 3; j++) {
        red_lattice[j][i] = basis[k][j];
      }
      k++;
    }
  }
  volume = mat_get_determinant_d3(red_lattice);
  if (mat_Dabs(volume) < symprec) {
    ;
    goto err;
  }
  if (volume < 0) {
    for (i = 0; i < 3; i++) {
      red_lattice[i][unique_axis] = -red_lattice[i][unique_axis];
    }
  }
  return 1;
err:
  return 0;
}


x86 assembly (clang, -O0):
<delaunay_reduce_2D>:
push   %rbp
mov    %rsp,%rbp
sub    $0xe0,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %edx,-0x1c(%rbp)
movsd  %xmm0,-0x28(%rbp)
movl   $0x0,-0x34(%rbp)
movl   $0x0,-0x2c(%rbp)
cmpl   $0x3,-0x2c(%rbp)
jge    11b6 <delaunay_reduce_2D+0x66>
mov    -0x18(%rbp),%rax
movslq -0x2c(%rbp),%rcx
imul   $0x18,%rcx,%rcx
add    %rcx,%rax
movslq -0x1c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
movslq -0x2c(%rbp),%rax
movsd  %xmm0,-0xe0(%rbp,%rax,8)
ff ff
mov    -0x2c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2c(%rbp)
jmp    1179 <delaunay_reduce_2D+0x29>
movl   $0x0,-0x2c(%rbp)
cmpl   $0x3,-0x2c(%rbp)
jge    1241 <delaunay_reduce_2D+0xf1>
mov    -0x2c(%rbp),%eax
cmp    -0x1c(%rbp),%eax
je     122e <delaunay_reduce_2D+0xde>
movl   $0x0,-0x30(%rbp)
cmpl   $0x3,-0x30(%rbp)
jge    1225 <delaunay_reduce_2D+0xd5>
mov    -0x18(%rbp),%rax
movslq -0x30(%rbp),%rcx
imul   $0x18,%rcx,%rcx
add    %rcx,%rax
movslq -0x2c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
movslq -0x30(%rbp),%rcx
lea    -0xc0(%rbp),%rax
shl    $0x4,%rcx
add    %rcx,%rax
movslq -0x34(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x30(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x30(%rbp)
jmp    11da <delaunay_reduce_2D+0x8a>
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    1233 <delaunay_reduce_2D+0xe3>
mov    -0x2c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2c(%rbp)
jmp    11bd <delaunay_reduce_2D+0x6d>
lea    -0x90(%rbp),%rdi
lea    -0xc0(%rbp),%rsi
call   1050 <get_exteneded_basis_2D@plt>
lea    -0x90(%rbp),%rdi
movsd  -0x28(%rbp),%xmm0
call   1030 <delaunay_reduce_basis_2D@plt>
cmp    $0x0,%rax
je     1274 <delaunay_reduce_2D+0x124>
jmp    1279 <delaunay_reduce_2D+0x129>
jmp    1254 <delaunay_reduce_2D+0x104>
lea    -0x90(%rbp),%rdi
lea    -0xe0(%rbp),%rsi
movsd  -0x28(%rbp),%xmm0
call   1060 <get_delaunay_shortest_vectors_2D@plt>
movl   $0x0,-0x34(%rbp)
movl   $0x0,-0x2c(%rbp)
cmpl   $0x3,-0x2c(%rbp)
jge    1377 <delaunay_reduce_2D+0x227>
mov    -0x2c(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jne    1309 <delaunay_reduce_2D+0x1b9>
movl   $0x0,-0x30(%rbp)
cmpl   $0x3,-0x30(%rbp)
jge    1304 <delaunay_reduce_2D+0x1b4>
mov    -0x18(%rbp),%rax
movslq -0x30(%rbp),%rcx
imul   $0x18,%rcx,%rcx
add    %rcx,%rax
movslq -0x2c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x10(%rbp),%rax
movslq -0x30(%rbp),%rcx
imul   $0x18,%rcx,%rcx
add    %rcx,%rax
movslq -0x2c(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x30(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x30(%rbp)
jmp    12bc <delaunay_reduce_2D+0x16c>
jmp    1364 <delaunay_reduce_2D+0x214>
movl   $0x0,-0x30(%rbp)
cmpl   $0x3,-0x30(%rbp)
jge    135b <delaunay_reduce_2D+0x20b>
movslq -0x34(%rbp),%rcx
lea    -0x90(%rbp),%rax
imul   $0x18,%rcx,%rcx
add    %rcx,%rax
movslq -0x30(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x10(%rbp),%rax
movslq -0x30(%rbp),%rcx
imul   $0x18,%rcx,%rcx
add    %rcx,%rax
movslq -0x2c(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x30(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x30(%rbp)
jmp    1310 <delaunay_reduce_2D+0x1c0>
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    1369 <delaunay_reduce_2D+0x219>
mov    -0x2c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2c(%rbp)
jmp    129f <delaunay_reduce_2D+0x14f>
mov    -0x10(%rbp),%rdi
call   1040 <mat_get_determinant_d3@plt>
movsd  %xmm0,-0x40(%rbp)
movsd  -0x40(%rbp),%xmm0
call   1070 <mat_Dabs@plt>
movaps %xmm0,%xmm1
movsd  -0x28(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jbe    13a6 <delaunay_reduce_2D+0x256>
jmp    142b <delaunay_reduce_2D+0x2db>
xorps  %xmm0,%xmm0
ucomisd -0x40(%rbp),%xmm0
jbe    141f <delaunay_reduce_2D+0x2cf>
movl   $0x0,-0x2c(%rbp)
cmpl   $0x3,-0x2c(%rbp)
jge    141a <delaunay_reduce_2D+0x2ca>
mov    -0x10(%rbp),%rax
movslq -0x2c(%rbp),%rcx
imul   $0x18,%rcx,%rcx
add    %rcx,%rax
movslq -0x1c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mov    -0x10(%rbp),%rax
movslq -0x2c(%rbp),%rcx
imul   $0x18,%rcx,%rcx
add    %rcx,%rax
movslq -0x1c(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x2c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2c(%rbp)
jmp    13bb <delaunay_reduce_2D+0x26b>
jmp    141f <delaunay_reduce_2D+0x2cf>
movl   $0x1,-0x4(%rbp)
jmp    1432 <delaunay_reduce_2D+0x2e2>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0xe0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<delaunay_reduce_2D>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0xa8,%rsp
movsd  %xmm0,0x8(%rsp)
mov    %edx,%r15d
mov    %rsi,%rbx
mov    %rdi,%r14
movslq %edx,%r12
movsd  (%rsi,%r12,8),%xmm0
movsd  %xmm0,0x40(%rsp)
movsd  0x18(%rsi,%r12,8),%xmm0
movsd  %xmm0,0x48(%rsp)
movsd  0x30(%rsi,%r12,8),%xmm0
movsd  %xmm0,0x50(%rsp)
test   %r12d,%r12d
je     11ce <delaunay_reduce_2D+0x7e>
movsd  (%rbx),%xmm0
movsd  %xmm0,0x10(%rsp)
movsd  0x18(%rbx),%xmm0
movsd  %xmm0,0x20(%rsp)
movsd  0x30(%rbx),%xmm0
movsd  %xmm0,0x30(%rsp)
mov    $0x1,%r13b
mov    $0x1,%eax
cmp    $0x1,%r15d
jne    11d0 <delaunay_reduce_2D+0x80>
jmp    1206 <delaunay_reduce_2D+0xb6>
xor    %eax,%eax
mov    %eax,%ecx
movsd  0x8(%rbx),%xmm0
movsd  %xmm0,0x10(%rsp,%rcx,8)
movsd  0x20(%rbx),%xmm0
movsd  %xmm0,0x20(%rsp,%rcx,8)
movsd  0x38(%rbx),%xmm0
movsd  %xmm0,0x30(%rsp,%rcx,8)
xor    %r13d,%r13d
cmp    $0x2,%r15d
jne    1203 <delaunay_reduce_2D+0xb3>
mov    $0x1,%al
mov    %eax,(%rsp)
jmp    1230 <delaunay_reduce_2D+0xe0>
add    $0x1,%eax
mov    %eax,%eax
movsd  0x10(%rbx),%xmm0
movsd  %xmm0,0x10(%rsp,%rax,8)
movsd  0x28(%rbx),%xmm0
movsd  %xmm0,0x20(%rsp,%rax,8)
movsd  0x40(%rbx),%xmm0
movsd  %xmm0,0x30(%rsp,%rax,8)
movl   $0x0,(%rsp)
lea    0x60(%rsp),%rbp
lea    0x10(%rsp),%rsi
mov    %rbp,%rdi
call   1050 <get_exteneded_basis_2D@plt>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %rbp,%rdi
movsd  0x8(%rsp),%xmm0
call   1030 <delaunay_reduce_basis_2D@plt>
test   %rax,%rax
je     1250 <delaunay_reduce_2D+0x100>
lea    0x60(%rsp),%rdi
lea    0x40(%rsp),%rsi
movsd  0x8(%rsp),%xmm0
call   1060 <get_delaunay_shortest_vectors_2D@plt>
test   %r15d,%r15d
je     12a1 <delaunay_reduce_2D+0x151>
movsd  0x60(%rsp),%xmm0
movsd  %xmm0,(%r14)
movsd  0x68(%rsp),%xmm0
movsd  %xmm0,0x18(%r14)
mov    $0x1,%eax
movsd  0x70(%rsp),%xmm0
jmp    12bc <delaunay_reduce_2D+0x16c>
movsd  (%rbx),%xmm0
movsd  %xmm0,(%r14)
movsd  0x18(%rbx),%xmm0
movsd  %xmm0,0x18(%r14)
movsd  0x30(%rbx),%xmm0
xor    %eax,%eax
movsd  %xmm0,0x30(%r14)
test   %r13b,%r13b
je     12ea <delaunay_reduce_2D+0x19a>
movsd  0x8(%rbx),%xmm0
movsd  %xmm0,0x8(%r14)
movsd  0x20(%rbx),%xmm0
movsd  %xmm0,0x20(%r14)
movsd  0x38(%rbx),%xmm0
movsd  %xmm0,0x38(%r14)
jmp    1317 <delaunay_reduce_2D+0x1c7>
mov    %eax,%ecx
lea    (%rcx,%rcx,2),%rcx
movsd  0x60(%rsp,%rcx,8),%xmm0
movsd  %xmm0,0x8(%r14)
movsd  0x68(%rsp,%rcx,8),%xmm0
movsd  %xmm0,0x20(%r14)
movsd  0x70(%rsp,%rcx,8),%xmm0
movsd  %xmm0,0x38(%r14)
add    $0x1,%eax
mov    (%rsp),%ecx
test   %cl,%cl
je     133a <delaunay_reduce_2D+0x1ea>
movsd  0x10(%rbx),%xmm0
movsd  %xmm0,0x10(%r14)
movsd  0x28(%rbx),%xmm0
movsd  %xmm0,0x28(%r14)
add    $0x40,%rbx
jmp    1360 <delaunay_reduce_2D+0x210>
mov    %eax,%eax
lea    (%rax,%rax,2),%rax
movsd  0x60(%rsp,%rax,8),%xmm0
movsd  %xmm0,0x10(%r14)
movsd  0x68(%rsp,%rax,8),%xmm0
movsd  %xmm0,0x28(%r14)
lea    (%rsp,%rax,8),%rbx
add    $0x70,%rbx
movsd  (%rbx),%xmm0
movsd  %xmm0,0x40(%r14)
mov    %r14,%rdi
call   1040 <mat_get_determinant_d3@plt>
movsd  %xmm0,(%rsp)
call   1070 <mat_Dabs@plt>
xor    %eax,%eax
movsd  0x8(%rsp),%xmm1
ucomisd %xmm0,%xmm1
ja     13d6 <delaunay_reduce_2D+0x286>
mov    $0x1,%eax
xorpd  %xmm0,%xmm0
ucomisd (%rsp),%xmm0
jbe    13d6 <delaunay_reduce_2D+0x286>
movsd  (%r14,%r12,8),%xmm0
movsd  0x18(%r14,%r12,8),%xmm1
movsd  0x30(%r14,%r12,8),%xmm2
movapd 0xc4a(%rip),%xmm3
xorpd  %xmm3,%xmm0
movlpd %xmm0,(%r14,%r12,8)
xorpd  %xmm3,%xmm1
movlpd %xmm1,0x18(%r14,%r12,8)
xorpd  %xmm3,%xmm2
movlpd %xmm2,0x30(%r14,%r12,8)
add    $0xa8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

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

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