#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 fabs(float);
double sqrt(float);
int eigenVectAndValues(float a, float b, float c, float *lambda1,
                       float *lambda2, float *v1x, float *v1y, float *v2x,
                       float *v2y) {
  if (fabs(a) < 0.000001)
    a = 0.000001;
  if (fabs(b) < 0.000001)
    b = 0.000001;
  if (fabs(c) < 0.000001)
    c = 0.000001;
  double disc = sqrt((a - c) * (a - c) + 4 * b * b) / 2;
  (*lambda1) = (a + c) / 2 + disc;
  (*lambda2) = (a + c) / 2 - disc;
  if (fabs((*lambda1)) < 0.000001 && fabs((*lambda2)) < 0.000001) {
    return 1;
  }
  (*v1x) = -b;
  (*v1y) = a - (*lambda1);
  (*v2x) = -b;
  (*v2y) = a - (*lambda2);
  float v1mag = sqrt((*v1x) * (*v1x) + (*v1y) * (*v1y)) + 0.000001;
  float v2mag = sqrt((*v2x) * (*v2x) + (*v2y) * (*v2y)) + 0.000001;
  (*v1x) = (*v1x) / v1mag;
  (*v1y) = (*v1y) / v1mag;
  (*v2x) = (*v2x) / v2mag;
  (*v2y) = (*v2y) / v2mag;
  return 0;
}


x86 assembly (clang, -O0):
<eigenVectAndValues>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movss  %xmm0,-0x8(%rbp)
movss  %xmm1,-0xc(%rbp)
movss  %xmm2,-0x10(%rbp)
mov    %rdi,-0x18(%rbp)
mov    %rsi,-0x20(%rbp)
mov    %rdx,-0x28(%rbp)
mov    %rcx,-0x30(%rbp)
mov    %r8,-0x38(%rbp)
mov    %r9,-0x40(%rbp)
movss  -0x8(%rbp),%xmm0
call   1030 <fabs@plt>
movaps %xmm0,%xmm1
movsd  0xe9c(%rip),%xmm0
ucomisd %xmm1,%xmm0
jbe    117b <eigenVectAndValues+0x5b>
movss  0xe9a(%rip),%xmm0
movss  %xmm0,-0x8(%rbp)
movss  -0xc(%rbp),%xmm0
call   1030 <fabs@plt>
movaps %xmm0,%xmm1
movsd  0xe70(%rip),%xmm0
ucomisd %xmm1,%xmm0
jbe    11a7 <eigenVectAndValues+0x87>
movss  0xe6e(%rip),%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0x10(%rbp),%xmm0
call   1030 <fabs@plt>
movaps %xmm0,%xmm1
movsd  0xe44(%rip),%xmm0
ucomisd %xmm1,%xmm0
jbe    11d3 <eigenVectAndValues+0xb3>
movss  0xe42(%rip),%xmm0
movss  %xmm0,-0x10(%rbp)
movss  -0x8(%rbp),%xmm0
subss  -0x10(%rbp),%xmm0
movss  -0x8(%rbp),%xmm2
subss  -0x10(%rbp),%xmm2
movss  0xe29(%rip),%xmm1
mulss  -0xc(%rbp),%xmm1
mulss  -0xc(%rbp),%xmm1
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
call   1040 <sqrt@plt>
movsd  0xdfa(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x48(%rbp)
movss  -0x8(%rbp),%xmm0
addss  -0x10(%rbp),%xmm0
movss  0xdeb(%rip),%xmm1
divss  %xmm1,%xmm0
cvtss2sd %xmm0,%xmm0
addsd  -0x48(%rbp),%xmm0
cvtsd2ss %xmm0,%xmm0
mov    -0x18(%rbp),%rax
movss  %xmm0,(%rax)
movss  -0x8(%rbp),%xmm0
addss  -0x10(%rbp),%xmm0
movss  0xdc0(%rip),%xmm1
divss  %xmm1,%xmm0
cvtss2sd %xmm0,%xmm0
subsd  -0x48(%rbp),%xmm0
cvtsd2ss %xmm0,%xmm0
mov    -0x20(%rbp),%rax
movss  %xmm0,(%rax)
mov    -0x18(%rbp),%rax
movss  (%rax),%xmm0
call   1030 <fabs@plt>
movaps %xmm0,%xmm1
movsd  0xd7b(%rip),%xmm0
ucomisd %xmm1,%xmm0
jbe    12bd <eigenVectAndValues+0x19d>
mov    -0x20(%rbp),%rax
movss  (%rax),%xmm0
call   1030 <fabs@plt>
movaps %xmm0,%xmm1
movsd  0xd59(%rip),%xmm0
ucomisd %xmm1,%xmm0
jbe    12bd <eigenVectAndValues+0x19d>
movl   $0x1,-0x4(%rbp)
jmp    13fa <eigenVectAndValues+0x2da>
movss  -0xc(%rbp),%xmm0
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
mov    -0x28(%rbp),%rax
movss  %xmm0,(%rax)
movss  -0x8(%rbp),%xmm0
mov    -0x18(%rbp),%rax
subss  (%rax),%xmm0
mov    -0x30(%rbp),%rax
movss  %xmm0,(%rax)
movss  -0xc(%rbp),%xmm0
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
mov    -0x38(%rbp),%rax
movss  %xmm0,(%rax)
movss  -0x8(%rbp),%xmm0
mov    -0x20(%rbp),%rax
subss  (%rax),%xmm0
mov    -0x40(%rbp),%rax
movss  %xmm0,(%rax)
mov    -0x28(%rbp),%rax
movss  (%rax),%xmm0
mov    -0x28(%rbp),%rax
movss  (%rax),%xmm2
mov    -0x30(%rbp),%rax
movss  (%rax),%xmm1
mov    -0x30(%rbp),%rax
mulss  (%rax),%xmm1
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
call   1040 <sqrt@plt>
movsd  0xcb0(%rip),%xmm1
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x4c(%rbp)
mov    -0x38(%rbp),%rax
movss  (%rax),%xmm0
mov    -0x38(%rbp),%rax
movss  (%rax),%xmm2
mov    -0x40(%rbp),%rax
movss  (%rax),%xmm1
mov    -0x40(%rbp),%rax
mulss  (%rax),%xmm1
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
call   1040 <sqrt@plt>
movsd  0xc6e(%rip),%xmm1
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x50(%rbp)
mov    -0x28(%rbp),%rax
movss  (%rax),%xmm0
divss  -0x4c(%rbp),%xmm0
mov    -0x28(%rbp),%rax
movss  %xmm0,(%rax)
mov    -0x30(%rbp),%rax
movss  (%rax),%xmm0
divss  -0x4c(%rbp),%xmm0
mov    -0x30(%rbp),%rax
movss  %xmm0,(%rax)
mov    -0x38(%rbp),%rax
movss  (%rax),%xmm0
divss  -0x50(%rbp),%xmm0
mov    -0x38(%rbp),%rax
movss  %xmm0,(%rax)
mov    -0x40(%rbp),%rax
movss  (%rax),%xmm0
divss  -0x50(%rbp),%xmm0
mov    -0x40(%rbp),%rax
movss  %xmm0,(%rax)
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<eigenVectAndValues>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x28,%rsp
mov    %r9,%r14
mov    %r8,%r15
mov    %rcx,%r12
mov    %rdx,%r13
mov    %rsi,%rbx
mov    %rdi,%rbp
movss  %xmm2,0xc(%rsp)
movss  %xmm1,0x8(%rsp)
movss  %xmm0,0x10(%rsp)
call   1030 <fabs@plt>
movsd  0xea1(%rip),%xmm1
ucomisd %xmm0,%xmm1
movss  0xea5(%rip),%xmm0
movss  %xmm0,0x4(%rsp)
movss  %xmm0,(%rsp)
ja     1183 <eigenVectAndValues+0x63>
movss  0x10(%rsp),%xmm0
movss  %xmm0,(%rsp)
movss  0x8(%rsp),%xmm0
call   1030 <fabs@plt>
movsd  0xe6a(%rip),%xmm1
ucomisd %xmm0,%xmm1
movss  0xe6e(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
ja     11b4 <eigenVectAndValues+0x94>
movss  0x8(%rsp),%xmm0
movaps %xmm0,0x10(%rsp)
movss  0xc(%rsp),%xmm0
call   1030 <fabs@plt>
movsd  0xe39(%rip),%xmm1
ucomisd %xmm0,%xmm1
ja     11d9 <eigenVectAndValues+0xb9>
movss  0xc(%rsp),%xmm0
movss  %xmm0,0x4(%rsp)
movss  (%rsp),%xmm0
subss  0x4(%rsp),%xmm0
movss  0xe28(%rip),%xmm1
movaps 0x10(%rsp),%xmm2
mulss  %xmm2,%xmm1
mulss  %xmm2,%xmm1
mulss  %xmm0,%xmm0
addss  %xmm1,%xmm0
call   1040 <sqrt@plt>
mulsd  0xdfa(%rip),%xmm0
movss  0x4(%rsp),%xmm1
addss  (%rsp),%xmm1
mulss  0xdf7(%rip),%xmm1
cvtss2sd %xmm1,%xmm1
movapd %xmm0,%xmm2
addsd  %xmm1,%xmm2
cvtsd2ss %xmm2,%xmm2
movss  %xmm2,0x0(%rbp)
subsd  %xmm0,%xmm1
xorps  %xmm0,%xmm0
cvtsd2ss %xmm1,%xmm0
movss  %xmm0,(%rbx)
movss  0x0(%rbp),%xmm0
call   1030 <fabs@plt>
movsd  0xda9(%rip),%xmm1
ucomisd %xmm0,%xmm1
jbe    127d <eigenVectAndValues+0x15d>
movss  (%rbx),%xmm0
call   1030 <fabs@plt>
movsd  0xd92(%rip),%xmm1
mov    $0x1,%eax
ucomisd %xmm0,%xmm1
ja     1348 <eigenVectAndValues+0x228>
movaps 0x10(%rsp),%xmm3
xorps  0xd97(%rip),%xmm3
movss  %xmm3,0x0(%r13)
movss  (%rsp),%xmm2
movaps %xmm2,%xmm0
subss  0x0(%rbp),%xmm0
movss  %xmm0,(%r12)
movss  %xmm3,(%r15)
subss  (%rbx),%xmm2
movss  %xmm2,(%r14)
movss  0x0(%r13),%xmm0
movss  (%r12),%xmm1
mulss  %xmm1,%xmm1
mulss  %xmm0,%xmm0
addss  %xmm1,%xmm0
call   1040 <sqrt@plt>
addsd  0xd2b(%rip),%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,(%rsp)
movss  (%r15),%xmm0
movss  (%r14),%xmm1
mulss  %xmm1,%xmm1
mulss  %xmm0,%xmm0
addss  %xmm1,%xmm0
call   1040 <sqrt@plt>
addsd  0xcff(%rip),%xmm0
cvtsd2ss %xmm0,%xmm0
movss  0x0(%r13),%xmm1
movss  (%rsp),%xmm2
divss  %xmm2,%xmm1
movss  %xmm1,0x0(%r13)
movss  (%r12),%xmm1
divss  %xmm2,%xmm1
movss  %xmm1,(%r12)
movss  (%r15),%xmm1
divss  %xmm0,%xmm1
movss  %xmm1,(%r15)
movss  (%r14),%xmm1
divss  %xmm0,%xmm1
movss  %xmm1,(%r14)
xor    %eax,%eax
add    $0x28,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define i32 @eigenVectAndValues(float %0, float %1, float %2, float* %3, float* %4, float* %5, float* %6, float* %7, float* %8) {
%10 = alloca i32
%11 = alloca float
%12 = alloca float
%13 = alloca float
%14 = alloca float*
%15 = alloca float*
%16 = alloca float*
%17 = alloca float*
%18 = alloca float*
%19 = alloca float*
%20 = alloca double
%21 = alloca float
%22 = alloca float
store float %0, float* %11
store float %1, float* %12
store float %2, float* %13
store float* %3, float** %14
store float* %4, float** %15
store float* %5, float** %16
store float* %6, float** %17
store float* %7, float** %18
store float* %8, float** %19
%23 = load float, float* %11
%24 = call double @fabs(float %23)
%25 = fcmp olt double %24, 0x3EB0C6F7A0B5ED8D
br i1 %25, label %26, label %27
26: ; preds = %9
store float 0x3EB0C6F7A0000000, float* %11
br label %27
27: ; preds = %26, %9
%28 = load float, float* %12
%29 = call double @fabs(float %28)
%30 = fcmp olt double %29, 0x3EB0C6F7A0B5ED8D
br i1 %30, label %31, label %32
31: ; preds = %27
store float 0x3EB0C6F7A0000000, float* %12
br label %32
32: ; preds = %31, %27
%33 = load float, float* %13
%34 = call double @fabs(float %33)
%35 = fcmp olt double %34, 0x3EB0C6F7A0B5ED8D
br i1 %35, label %36, label %37
36: ; preds = %32
store float 0x3EB0C6F7A0000000, float* %13
br label %37
37: ; preds = %36, %32
%38 = load float, float* %11
%39 = load float, float* %13
%40 = fsub float %38, %39
%41 = load float, float* %11
%42 = load float, float* %13
%43 = fsub float %41, %42
%44 = load float, float* %12
%45 = fmul float 4.000000e+00, %44
%46 = load float, float* %12
%47 = fmul float %45, %46
%48 = call float @llvm.fmuladd.f32(float %40, float %43, float %47)
%49 = call double @sqrt(float %48)
%50 = fdiv double %49, 2.000000e+00
store double %50, double* %20
%51 = load float, float* %11
%52 = load float, float* %13
%53 = fadd float %51, %52
%54 = fdiv float %53, 2.000000e+00
%55 = fpext float %54 to double
%56 = load double, double* %20
%57 = fadd double %55, %56
%58 = fptrunc double %57 to float
%59 = load float*, float** %14
store float %58, float* %59
%60 = load float, float* %11
%61 = load float, float* %13
%62 = fadd float %60, %61
%63 = fdiv float %62, 2.000000e+00
%64 = fpext float %63 to double
%65 = load double, double* %20
%66 = fsub double %64, %65
%67 = fptrunc double %66 to float
%68 = load float*, float** %15
store float %67, float* %68
%69 = load float*, float** %14
%70 = load float, float* %69
%71 = call double @fabs(float %70)
%72 = fcmp olt double %71, 0x3EB0C6F7A0B5ED8D
br i1 %72, label %73, label %79
73: ; preds = %37
%74 = load float*, float** %15
%75 = load float, float* %74
%76 = call double @fabs(float %75)
%77 = fcmp olt double %76, 0x3EB0C6F7A0B5ED8D
br i1 %77, label %78, label %79
78: ; preds = %73
store i32 1, i32* %10
br label %142
79: ; preds = %73, %37
%80 = load float, float* %12
%81 = fneg float %80
%82 = load float*, float** %16
store float %81, float* %82
%83 = load float, float* %11
%84 = load float*, float** %14
%85 = load float, float* %84
%86 = fsub float %83, %85
%87 = load float*, float** %17
store float %86, float* %87
%88 = load float, float* %12
%89 = fneg float %88
%90 = load float*, float** %18
store float %89, float* %90
%91 = load float, float* %11
%92 = load float*, float** %15
%93 = load float, float* %92
%94 = fsub float %91, %93
%95 = load float*, float** %19
store float %94, float* %95
%96 = load float*, float** %16
%97 = load float, float* %96
%98 = load float*, float** %16
%99 = load float, float* %98
%100 = load float*, float** %17
%101 = load float, float* %100
%102 = load float*, float** %17
%103 = load float, float* %102
%104 = fmul float %101, %103
%105 = call float @llvm.fmuladd.f32(float %97, float %99, float %104)
%106 = call double @sqrt(float %105)
%107 = fadd double %106, 0x3EB0C6F7A0B5ED8D
%108 = fptrunc double %107 to float
store float %108, float* %21
%109 = load float*, float** %18
%110 = load float, float* %109
%111 = load float*, float** %18
%112 = load float, float* %111
%113 = load float*, float** %19
%114 = load float, float* %113
%115 = load float*, float** %19
%116 = load float, float* %115
%117 = fmul float %114, %116
%118 = call float @llvm.fmuladd.f32(float %110, float %112, float %117)
%119 = call double @sqrt(float %118)
%120 = fadd double %119, 0x3EB0C6F7A0B5ED8D
%121 = fptrunc double %120 to float
store float %121, float* %22
%122 = load float*, float** %16
%123 = load float, float* %122
%124 = load float, float* %21
%125 = fdiv float %123, %124
%126 = load float*, float** %16
store float %125, float* %126
%127 = load float*, float** %17
%128 = load float, float* %127
%129 = load float, float* %21
%130 = fdiv float %128, %129
%131 = load float*, float** %17
store float %130, float* %131
%132 = load float*, float** %18
%133 = load float, float* %132
%134 = load float, float* %22
%135 = fdiv float %133, %134
%136 = load float*, float** %18
store float %135, float* %136
%137 = load float*, float** %19
%138 = load float, float* %137
%139 = load float, float* %22
%140 = fdiv float %138, %139
%141 = load float*, float** %19
store float %140, float* %141
store i32 0, i32* %10
br label %142
142: ; preds = %79, %78
%143 = load i32, i32* %10
ret i32 %143
}

LLVM IR (-O2):
define i32 @eigenVectAndValues(float %0, float %1, float %2, float* nocapture %3, float* nocapture %4, float* nocapture %5, float* nocapture %6, float* nocapture %7, float* nocapture %8) {
%10 = tail call double @fabs(float %0)
%11 = fcmp olt double %10, 0x3EB0C6F7A0B5ED8D
%12 = select i1 %11, float 0x3EB0C6F7A0000000, float %0
%13 = tail call double @fabs(float %1)
%14 = fcmp olt double %13, 0x3EB0C6F7A0B5ED8D
%15 = select i1 %14, float 0x3EB0C6F7A0000000, float %1
%16 = tail call double @fabs(float %2)
%17 = fcmp olt double %16, 0x3EB0C6F7A0B5ED8D
%18 = select i1 %17, float 0x3EB0C6F7A0000000, float %2
%19 = fsub float %12, %18
%20 = fmul float %15, 4.000000e+00
%21 = fmul float %15, %20
%22 = tail call float @llvm.fmuladd.f32(float %19, float %19, float %21)
%23 = tail call double @sqrt(float %22)
%24 = fmul double %23, 5.000000e-01
%25 = fadd float %12, %18
%26 = fmul float %25, 5.000000e-01
%27 = fpext float %26 to double
%28 = fadd double %24, %27
%29 = fptrunc double %28 to float
store float %29, float* %3
%30 = fsub double %27, %24
%31 = fptrunc double %30 to float
store float %31, float* %4
%32 = load float, float* %3
%33 = tail call double @fabs(float %32)
%34 = fcmp olt double %33, 0x3EB0C6F7A0B5ED8D
br i1 %34, label %35, label %39
35: ; preds = %9
%36 = load float, float* %4
%37 = tail call double @fabs(float %36)
%38 = fcmp olt double %37, 0x3EB0C6F7A0B5ED8D
br i1 %38, label %67, label %39
39: ; preds = %35, %9
%40 = fneg float %15
store float %40, float* %5
%41 = load float, float* %3
%42 = fsub float %12, %41
store float %42, float* %6
store float %40, float* %7
%43 = load float, float* %4
%44 = fsub float %12, %43
store float %44, float* %8
%45 = load float, float* %5
%46 = load float, float* %6
%47 = fmul float %46, %46
%48 = tail call float @llvm.fmuladd.f32(float %45, float %45, float %47)
%49 = tail call double @sqrt(float %48)
%50 = fadd double %49, 0x3EB0C6F7A0B5ED8D
%51 = fptrunc double %50 to float
%52 = load float, float* %7
%53 = load float, float* %8
%54 = fmul float %53, %53
%55 = tail call float @llvm.fmuladd.f32(float %52, float %52, float %54)
%56 = tail call double @sqrt(float %55)
%57 = fadd double %56, 0x3EB0C6F7A0B5ED8D
%58 = fptrunc double %57 to float
%59 = load float, float* %5
%60 = fdiv float %59, %51
store float %60, float* %5
%61 = load float, float* %6
%62 = fdiv float %61, %51
store float %62, float* %6
%63 = load float, float* %7
%64 = fdiv float %63, %58
store float %64, float* %7
%65 = load float, float* %8
%66 = fdiv float %65, %58
store float %66, float* %8
br label %67
67: ; preds = %35, %39
%68 = phi i32 [ 0, %39 ], [ 1, %35 ]
ret i32 %68
}