#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 */
int /*<<< orphan*/ finalize(double *);
int /*<<< orphan*/ initialize(double *, double const);
int /*<<< orphan*/ step0();
scalar_t__ step1();
scalar_t__ step2();
scalar_t__ step3();
scalar_t__ step4();
scalar_t__ step5();
scalar_t__ step6();
scalar_t__ step7();
scalar_t__ step8();
void niggli_reduce(double *lattice_, const double eps_) {
  int i;
  initialize(lattice_, eps_);
  step0();
  for (i = 0; i < 10; i++) {
    if (step1()) {
      ;
      ;
      ;
    }
    if (step2()) {
      ;
      ;
      ;
      continue;
    }
    if (step3()) {
      ;
      ;
      ;
    }
    if (step4()) {
      ;
      ;
      ;
    }
    if (step5()) {
      ;
      ;
      ;
      continue;
    }
    if (step6()) {
      ;
      ;
      ;
      continue;
    }
    if (step7()) {
      ;
      ;
      ;
      continue;
    }
    if (step8()) {
      ;
      ;
      ;
      continue;
    }
    break;
  }
  finalize(lattice_);
}


x86 assembly (clang, -O0):
<niggli_reduce>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
movsd  %xmm0,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
movsd  -0x10(%rbp),%xmm0
call   1080 <initialize@plt>
mov    $0x0,%al
call   10d0 <step0@plt>
movl   $0x0,-0x14(%rbp)
cmpl   $0xa,-0x14(%rbp)
jge    12aa <niggli_reduce+0xfa>
mov    $0x0,%al
call   1060 <step1@plt>
cmp    $0x0,%rax
je     11fd <niggli_reduce+0x4d>
jmp    11fd <niggli_reduce+0x4d>
mov    $0x0,%al
call   10b0 <step2@plt>
cmp    $0x0,%rax
je     1213 <niggli_reduce+0x63>
jmp    129c <niggli_reduce+0xec>
mov    $0x0,%al
call   1050 <step3@plt>
cmp    $0x0,%rax
je     1229 <niggli_reduce+0x79>
jmp    1229 <niggli_reduce+0x79>
mov    $0x0,%al
call   10a0 <step4@plt>
cmp    $0x0,%rax
je     123f <niggli_reduce+0x8f>
jmp    123f <niggli_reduce+0x8f>
mov    $0x0,%al
call   1030 <step5@plt>
cmp    $0x0,%rax
je     1255 <niggli_reduce+0xa5>
jmp    129c <niggli_reduce+0xec>
mov    $0x0,%al
call   10c0 <step6@plt>
cmp    $0x0,%rax
je     126b <niggli_reduce+0xbb>
jmp    129c <niggli_reduce+0xec>
mov    $0x0,%al
call   1040 <step7@plt>
cmp    $0x0,%rax
je     1281 <niggli_reduce+0xd1>
jmp    129c <niggli_reduce+0xec>
mov    $0x0,%al
call   1090 <step8@plt>
cmp    $0x0,%rax
je     1297 <niggli_reduce+0xe7>
jmp    129c <niggli_reduce+0xec>
jmp    12aa <niggli_reduce+0xfa>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    11dd <niggli_reduce+0x2d>
mov    -0x8(%rbp),%rdi
call   1070 <finalize@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<niggli_reduce>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
call   1080 <initialize@plt>
xor    %eax,%eax
call   10d0 <step0@plt>
xor    %ebp,%ebp
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
xor    %eax,%eax
call   1060 <step1@plt>
xor    %eax,%eax
call   10b0 <step2@plt>
test   %rax,%rax
jne    1220 <niggli_reduce+0x70>
xor    %eax,%eax
call   1050 <step3@plt>
xor    %eax,%eax
call   10a0 <step4@plt>
xor    %eax,%eax
call   1030 <step5@plt>
test   %rax,%rax
jne    1220 <niggli_reduce+0x70>
xor    %eax,%eax
call   10c0 <step6@plt>
test   %rax,%rax
jne    1220 <niggli_reduce+0x70>
xor    %eax,%eax
call   1040 <step7@plt>
test   %rax,%rax
je     122a <niggli_reduce+0x7a>
cs nopw 0x0(%rax,%rax,1)
nop
cmp    $0x8,%ebp
ja     123b <niggli_reduce+0x8b>
add    $0x1,%ebp
jmp    11d0 <niggli_reduce+0x20>
xor    %eax,%eax
call   1090 <step8@plt>
test   %rax,%rax
je     123b <niggli_reduce+0x8b>
cmp    $0x9,%ebp
jb     1225 <niggli_reduce+0x75>
mov    %rbx,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1070 <finalize@plt>

LLVM IR (-O0):
define void @niggli_reduce(double* %0, double %1) {
%3 = alloca double*
%4 = alloca double
%5 = alloca i32
store double* %0, double** %3
store double %1, double* %4
%6 = load double*, double** %3
%7 = load double, double* %4
%8 = call i32 @initialize(double* %6, double %7)
%9 = call i32 (...) @step0()
store i32 0, i32* %5
br label %10
10: ; preds = %46, %2
%11 = load i32, i32* %5
%12 = icmp slt i32 %11, 10
br i1 %12, label %13, label %49
13: ; preds = %10
%14 = call i64 (...) @step1()
%15 = icmp ne i64 %14, 0
br i1 %15, label %16, label %17
16: ; preds = %13
br label %17
17: ; preds = %16, %13
%18 = call i64 (...) @step2()
%19 = icmp ne i64 %18, 0
br i1 %19, label %20, label %21
20: ; preds = %17
br label %46
21: ; preds = %17
%22 = call i64 (...) @step3()
%23 = icmp ne i64 %22, 0
br i1 %23, label %24, label %25
24: ; preds = %21
br label %25
25: ; preds = %24, %21
%26 = call i64 (...) @step4()
%27 = icmp ne i64 %26, 0
br i1 %27, label %28, label %29
28: ; preds = %25
br label %29
29: ; preds = %28, %25
%30 = call i64 (...) @step5()
%31 = icmp ne i64 %30, 0
br i1 %31, label %32, label %33
32: ; preds = %29
br label %46
33: ; preds = %29
%34 = call i64 (...) @step6()
%35 = icmp ne i64 %34, 0
br i1 %35, label %36, label %37
36: ; preds = %33
br label %46
37: ; preds = %33
%38 = call i64 (...) @step7()
%39 = icmp ne i64 %38, 0
br i1 %39, label %40, label %41
40: ; preds = %37
br label %46
41: ; preds = %37
%42 = call i64 (...) @step8()
%43 = icmp ne i64 %42, 0
br i1 %43, label %44, label %45
44: ; preds = %41
br label %46
45: ; preds = %41
br label %49
46: ; preds = %44, %40, %36, %32, %20
%47 = load i32, i32* %5
%48 = add nsw i32 %47, 1
store i32 %48, i32* %5
br label %10
49: ; preds = %45, %10
%50 = load double*, double** %3
%51 = call i32 @finalize(double* %50)
ret void
}

LLVM IR (-O2):
define void @niggli_reduce(double* %0, double %1) {
%3 = tail call i32 @initialize(double* %0, double %1)
%4 = tail call i32 (...) @step0()
br label %5
5: ; preds = %28, %2
%6 = phi i32 [ 0, %2 ], [ %29, %28 ]
%7 = tail call i64 (...) @step1()
%8 = tail call i64 (...) @step2()
%9 = icmp eq i64 %8, 0
br i1 %9, label %10, label %26
10: ; preds = %5
%11 = tail call i64 (...) @step3()
%12 = tail call i64 (...) @step4()
%13 = tail call i64 (...) @step5()
%14 = icmp eq i64 %13, 0
br i1 %14, label %15, label %26
15: ; preds = %10
%16 = tail call i64 (...) @step6()
%17 = icmp eq i64 %16, 0
br i1 %17, label %18, label %26
18: ; preds = %15
%19 = tail call i64 (...) @step7()
%20 = icmp eq i64 %19, 0
br i1 %20, label %21, label %26
21: ; preds = %18
%22 = tail call i64 (...) @step8()
%23 = icmp ne i64 %22, 0
%24 = icmp ult i32 %6, 9
%25 = select i1 %23, i1 %24, i1 false
br i1 %25, label %28, label %30
26: ; preds = %18, %15, %10, %5
%27 = icmp ult i32 %6, 9
br i1 %27, label %28, label %30
28: ; preds = %26, %21
%29 = add nuw nsw i32 %6, 1
br label %5
30: ; preds = %21, %26
%31 = tail call i32 @finalize(double* %0)
ret void
}