int get_Delaunay_reduction_basis_2D(double basis[3][3], const double symprec) {
  int i, j, k, l;
  double dot_product;
  for (i = 0; i < 3; i++) {
    for (j = i + 1; j < 3; j++) {
      dot_product = 0.0;
      for (k = 0; k < 3; k++) {
        dot_product += basis[i][k] * basis[j][k];
      }
      if (dot_product > symprec) {
        for (k = 0; k < 3; k++) {
          if (!(k == i || k == j)) {
            for (l = 0; l < 3; l++) {
              basis[k][l] += 2 * basis[i][l];
            }
            break;
          }
        }
        for (k = 0; k < 3; k++) {
          basis[i][k] = -basis[i][k];
        }
        return 0;
      }
    }
  }
  return 1;
}


x86 assembly (clang, -O0):
<get_Delaunay_reduction_basis_2D>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
movsd  %xmm0,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
cmpl   $0x3,-0x1c(%rbp)
jge    12df <get_Delaunay_reduction_basis_2D+0x1df>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
cmpl   $0x3,-0x20(%rbp)
jge    12cc <get_Delaunay_reduction_basis_2D+0x1cc>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x30(%rbp)
movl   $0x0,-0x24(%rbp)
cmpl   $0x3,-0x24(%rbp)
jge    119a <get_Delaunay_reduction_basis_2D+0x9a>
mov    -0x10(%rbp),%rax
movslq -0x1c(%rbp),%rcx
imul   $0x18,%rcx,%rcx
add    %rcx,%rax
movslq -0x24(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x10(%rbp),%rax
movslq -0x20(%rbp),%rcx
imul   $0x18,%rcx,%rcx
add    %rcx,%rax
movslq -0x24(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm2
movsd  -0x30(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x30(%rbp)
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    1140 <get_Delaunay_reduction_basis_2D+0x40>
movsd  -0x30(%rbp),%xmm0
ucomisd -0x18(%rbp),%xmm0
jbe    12b9 <get_Delaunay_reduction_basis_2D+0x1b9>
movl   $0x0,-0x24(%rbp)
cmpl   $0x3,-0x24(%rbp)
jge    1247 <get_Delaunay_reduction_basis_2D+0x147>
mov    -0x24(%rbp),%eax
cmp    -0x1c(%rbp),%eax
je     1234 <get_Delaunay_reduction_basis_2D+0x134>
mov    -0x24(%rbp),%eax
cmp    -0x20(%rbp),%eax
je     1234 <get_Delaunay_reduction_basis_2D+0x134>
movl   $0x0,-0x28(%rbp)
cmpl   $0x3,-0x28(%rbp)
jge    122f <get_Delaunay_reduction_basis_2D+0x12f>
mov    -0x10(%rbp),%rax
movslq -0x1c(%rbp),%rcx
imul   $0x18,%rcx,%rcx
add    %rcx,%rax
movslq -0x28(%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  (%rax,%rcx,8),%xmm1
addsd  %xmm0,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x28(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x28(%rbp)
jmp    11da <get_Delaunay_reduction_basis_2D+0xda>
jmp    1247 <get_Delaunay_reduction_basis_2D+0x147>
jmp    1239 <get_Delaunay_reduction_basis_2D+0x139>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    11b1 <get_Delaunay_reduction_basis_2D+0xb1>
movl   $0x0,-0x24(%rbp)
cmpl   $0x3,-0x24(%rbp)
jge    12ad <get_Delaunay_reduction_basis_2D+0x1ad>
mov    -0x10(%rbp),%rax
movslq -0x1c(%rbp),%rcx
imul   $0x18,%rcx,%rcx
add    %rcx,%rax
movslq -0x24(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mov    -0x10(%rbp),%rax
movslq -0x1c(%rbp),%rcx
imul   $0x18,%rcx,%rcx
add    %rcx,%rax
movslq -0x24(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    124e <get_Delaunay_reduction_basis_2D+0x14e>
movl   $0x0,-0x4(%rbp)
jmp    12e6 <get_Delaunay_reduction_basis_2D+0x1e6>
jmp    12be <get_Delaunay_reduction_basis_2D+0x1be>
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    1127 <get_Delaunay_reduction_basis_2D+0x27>
jmp    12d1 <get_Delaunay_reduction_basis_2D+0x1d1>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1114 <get_Delaunay_reduction_basis_2D+0x14>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_Delaunay_reduction_basis_2D>:
movsd  (%rdi),%xmm2
movsd  0x8(%rdi),%xmm1
movsd  0x18(%rdi),%xmm3
mulsd  %xmm2,%xmm3
xorpd  %xmm4,%xmm4
addsd  %xmm4,%xmm3
movsd  0x20(%rdi),%xmm5
mulsd  %xmm1,%xmm5
addsd  %xmm3,%xmm5
movsd  0x10(%rdi),%xmm3
movsd  0x28(%rdi),%xmm6
mulsd  %xmm3,%xmm6
addsd  %xmm5,%xmm6
xor    %eax,%eax
ucomisd %xmm0,%xmm6
jbe    1148 <get_Delaunay_reduction_basis_2D+0x48>
mov    $0x2,%ecx
jmp    11b2 <get_Delaunay_reduction_basis_2D+0xb2>
mulsd  0x30(%rdi),%xmm2
addsd  %xmm4,%xmm2
mulsd  0x38(%rdi),%xmm1
mulsd  0x40(%rdi),%xmm3
addsd  %xmm2,%xmm1
addsd  %xmm1,%xmm3
ucomisd %xmm0,%xmm3
jbe    1172 <get_Delaunay_reduction_basis_2D+0x72>
mov    $0x1,%ecx
xor    %eax,%eax
jmp    11b2 <get_Delaunay_reduction_basis_2D+0xb2>
movsd  0x18(%rdi),%xmm1
movsd  0x20(%rdi),%xmm2
mulsd  0x30(%rdi),%xmm1
xorpd  %xmm3,%xmm3
addsd  %xmm1,%xmm3
mulsd  0x38(%rdi),%xmm2
addsd  %xmm3,%xmm2
movsd  0x28(%rdi),%xmm1
mulsd  0x40(%rdi),%xmm1
addsd  %xmm2,%xmm1
mov    $0x1,%eax
ucomisd %xmm0,%xmm1
jbe    120f <get_Delaunay_reduction_basis_2D+0x10f>
mov    $0x1,%eax
xor    %ecx,%ecx
lea    (%rax,%rax,2),%rax
lea    (%rcx,%rcx,2),%rcx
movupd (%rdi,%rax,8),%xmm0
movupd (%rdi,%rcx,8),%xmm1
addpd  %xmm0,%xmm0
addpd  %xmm1,%xmm0
movupd %xmm0,(%rdi,%rcx,8)
movsd  0x10(%rdi,%rax,8),%xmm0
addsd  %xmm0,%xmm0
addsd  0x10(%rdi,%rcx,8),%xmm0
movsd  %xmm0,0x10(%rdi,%rcx,8)
movupd (%rdi,%rax,8),%xmm0
movapd 0xe0c(%rip),%xmm1
xorpd  %xmm1,%xmm0
movupd %xmm0,(%rdi,%rax,8)
movsd  0x10(%rdi,%rax,8),%xmm0
xorpd  %xmm1,%xmm0
movlpd %xmm0,0x10(%rdi,%rax,8)
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @get_Delaunay_reduction_basis_2D([3 x double]* nocapture %0, double %1) {
%3 = getelementptr inbounds [3 x double], [3 x double]* %0, i64 0, i64 0
%4 = load double, double* %3
%5 = getelementptr inbounds [3 x double], [3 x double]* %0, i64 1, i64 0
%6 = load double, double* %5
%7 = tail call double @llvm.fmuladd.f64(double %4, double %6, double 0.000000e+00)
%8 = getelementptr inbounds [3 x double], [3 x double]* %0, i64 0, i64 1
%9 = load double, double* %8
%10 = getelementptr inbounds [3 x double], [3 x double]* %0, i64 1, i64 1
%11 = load double, double* %10
%12 = tail call double @llvm.fmuladd.f64(double %9, double %11, double %7)
%13 = getelementptr inbounds [3 x double], [3 x double]* %0, i64 0, i64 2
%14 = load double, double* %13
%15 = getelementptr inbounds [3 x double], [3 x double]* %0, i64 1, i64 2
%16 = load double, double* %15
%17 = tail call double @llvm.fmuladd.f64(double %14, double %16, double %12)
%18 = fcmp ogt double %17, %1
br i1 %18, label %36, label %60
19: ; preds = %60
%20 = getelementptr inbounds [3 x double], [3 x double]* %0, i64 1, i64 0
%21 = load double, double* %20
%22 = getelementptr inbounds [3 x double], [3 x double]* %0, i64 2, i64 0
%23 = load double, double* %22
%24 = tail call double @llvm.fmuladd.f64(double %21, double %23, double 0.000000e+00)
%25 = getelementptr inbounds [3 x double], [3 x double]* %0, i64 1, i64 1
%26 = load double, double* %25
%27 = getelementptr inbounds [3 x double], [3 x double]* %0, i64 2, i64 1
%28 = load double, double* %27
%29 = tail call double @llvm.fmuladd.f64(double %26, double %28, double %24)
%30 = getelementptr inbounds [3 x double], [3 x double]* %0, i64 1, i64 2
%31 = load double, double* %30
%32 = getelementptr inbounds [3 x double], [3 x double]* %0, i64 2, i64 2
%33 = load double, double* %32
%34 = tail call double @llvm.fmuladd.f64(double %31, double %33, double %29)
%35 = fcmp ogt double %34, %1
br i1 %35, label %36, label %71
36: ; preds = %60, %2, %19
%37 = phi i64 [ 1, %19 ], [ 0, %2 ], [ 0, %60 ]
%38 = phi i64 [ 0, %19 ], [ 2, %2 ], [ 1, %60 ]
%39 = getelementptr inbounds [3 x double], [3 x double]* %0, i64 %37, i64 0
%40 = getelementptr inbounds [3 x double], [3 x double]* %0, i64 %38, i64 0
%41 = bitcast double* %39 to <2 x double>*
%42 = load <2 x double>, <2 x double>* %41
%43 = bitcast double* %40 to <2 x double>*
%44 = load <2 x double>, <2 x double>* %43
%45 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %42, <2 x double> <double 2.000000e+00, double 2.000000e+00>, <2 x double> %44)
%46 = bitcast double* %40 to <2 x double>*
store <2 x double> %45, <2 x double>* %46
%47 = getelementptr inbounds [3 x double], [3 x double]* %0, i64 %37, i64 2
%48 = load double, double* %47
%49 = getelementptr inbounds [3 x double], [3 x double]* %0, i64 %38, i64 2
%50 = load double, double* %49
%51 = tail call double @llvm.fmuladd.f64(double %48, double 2.000000e+00, double %50)
store double %51, double* %49
%52 = getelementptr inbounds [3 x double], [3 x double]* %0, i64 %37, i64 0
%53 = bitcast double* %52 to <2 x double>*
%54 = load <2 x double>, <2 x double>* %53
%55 = fneg <2 x double> %54
%56 = bitcast double* %52 to <2 x double>*
store <2 x double> %55, <2 x double>* %56
%57 = getelementptr inbounds [3 x double], [3 x double]* %0, i64 %37, i64 2
%58 = load double, double* %57
%59 = fneg double %58
store double %59, double* %57
br label %71
60: ; preds = %2
%61 = getelementptr inbounds [3 x double], [3 x double]* %0, i64 2, i64 0
%62 = load double, double* %61
%63 = tail call double @llvm.fmuladd.f64(double %4, double %62, double 0.000000e+00)
%64 = getelementptr inbounds [3 x double], [3 x double]* %0, i64 2, i64 1
%65 = load double, double* %64
%66 = tail call double @llvm.fmuladd.f64(double %9, double %65, double %63)
%67 = getelementptr inbounds [3 x double], [3 x double]* %0, i64 2, i64 2
%68 = load double, double* %67
%69 = tail call double @llvm.fmuladd.f64(double %14, double %68, double %66)
%70 = fcmp ogt double %69, %1
br i1 %70, label %36, label %19
71: ; preds = %19, %36
%72 = phi i32 [ 0, %36 ], [ 1, %19 ]
ret i32 %72
}