; LLVM IR from HRI-EU/Rcs :: src/RcsCore (Rcs_Mat3d)

; Unoptimized IR (clang -disable-llvm-passes):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

; Function Attrs: nounwind uwtable
declare dso_local double @Mat3d_trace(ptr noundef) #0

; Function Attrs: nounwind uwtable
declare dso_local void @Mat3d_setIdentity(ptr noundef) #0

; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1

; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1

; Function Attrs: nounwind uwtable
declare dso_local void @Mat3d_addConstToDiag(ptr noundef, double noundef) #0

; Function Attrs: nounwind
declare double @cos(double noundef) #2

; Function Attrs: nounwind uwtable
declare dso_local void @Mat3d_copy(ptr noundef, ptr noundef) #0

; Function Attrs: nounwind uwtable
declare dso_local void @Mat3d_constMulSelf(ptr noundef, double noundef) #0

; Function Attrs: nounwind uwtable
declare dso_local void @Mat3d_mul(ptr noundef, ptr noundef, ptr noundef) #0

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare double @llvm.fmuladd.f64(double, double, double) #3

; Function Attrs: nounwind uwtable
declare dso_local zeroext i1 @Mat3d_isZero(ptr noundef) #0

; Function Attrs: nounwind uwtable
declare dso_local zeroext i1 @Mat3d_isSymmetric(ptr noundef, double noundef) #0

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare double @llvm.fabs.f64(double) #3

; Function Attrs: nounwind uwtable
declare dso_local zeroext i1 @Mat3d_isDiagonal(ptr noundef, double noundef) #0

; Function Attrs: nounwind uwtable
declare dso_local void @Mat3d_transposeSelf(ptr noundef) #0

; Function Attrs: nounwind uwtable
declare dso_local double @Mat3d_determinant(ptr noundef) #0

; Function Attrs: nounwind
declare double @sqrt(double noundef) #2

declare void @Vec3d_crossProduct(ptr noundef, ptr noundef, ptr noundef) #4

declare void @Vec3d_set(ptr noundef, double noundef, double noundef, double noundef) #4

declare double @Math_acos(double noundef) #4

; Function Attrs: nounwind uwtable
declare dso_local void @Mat3d_fromVec(ptr noundef, ptr noundef, i32 noundef) #0

; Function Attrs: nounwind uwtable
declare dso_local zeroext i1 @Mat3d_testEigenbasis(ptr noundef, ptr noundef, ptr noundef, double noundef) #0

; Function Attrs: nounwind uwtable
declare hidden void @Mat3d_sortEigenbasis(ptr noundef, ptr noundef, i1 noundef zeroext) #0

declare i32 @Vec3d_multiplicity(ptr noundef, double noundef) #4

; Function Attrs: nounwind uwtable
define dso_local zeroext i1 @Mat3d_getEigenVectors(ptr noundef %0, ptr noundef %1, ptr noundef %2) #0 {
  %4 = alloca i1, align 1
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca double, align 8
  %9 = alloca [3 x [3 x double]], align 16
  %10 = alloca [3 x [3 x double]], align 16
  %11 = alloca double, align 8
  %12 = alloca double, align 8
  %13 = alloca [3 x double], align 16
  %14 = alloca i32, align 4
  store ptr %0, ptr %5, align 8, !tbaa !5
  store ptr %1, ptr %6, align 8, !tbaa !5
  store ptr %2, ptr %7, align 8, !tbaa !5
  %15 = load ptr, ptr %5, align 8, !tbaa !5
  call void @Mat3d_setIdentity(ptr noundef %15)
  %16 = load ptr, ptr %6, align 8, !tbaa !5
  call void @Vec3d_setZero(ptr noundef %16)
  %17 = load ptr, ptr %7, align 8, !tbaa !5
  %18 = call zeroext i1 @Mat3d_isZero(ptr noundef %17)
  %19 = zext i1 %18 to i32
  %20 = icmp eq i32 %19, 1
  br i1 %20, label %26, label %21

21:                                               ; preds = %3
  %22 = load ptr, ptr %7, align 8, !tbaa !5
  %23 = call zeroext i1 @Mat3d_isSymmetric(ptr noundef %22, double noundef 1.000000e-08)
  %24 = zext i1 %23 to i32
  %25 = icmp eq i32 %24, 0
  br i1 %25, label %26, label %27

26:                                               ; preds = %21, %3
  store i1 false, ptr %4, align 1
  br label %222

27:                                               ; preds = %21
  %28 = load ptr, ptr %7, align 8, !tbaa !5
  %29 = call zeroext i1 @Mat3d_isDiagonal(ptr noundef %28, double noundef 1.000000e-08)
  %30 = zext i1 %29 to i32
  %31 = icmp eq i32 %30, 1
  br i1 %31, label %32, label %49

32:                                               ; preds = %27
  %33 = load ptr, ptr %6, align 8, !tbaa !5
  %34 = load ptr, ptr %7, align 8, !tbaa !5
  %35 = getelementptr inbounds [3 x double], ptr %34, i64 0
  %36 = getelementptr inbounds [3 x double], ptr %35, i64 0, i64 0
  %37 = load double, ptr %36, align 8, !tbaa !9
  %38 = load ptr, ptr %7, align 8, !tbaa !5
  %39 = getelementptr inbounds [3 x double], ptr %38, i64 1
  %40 = getelementptr inbounds [3 x double], ptr %39, i64 0, i64 1
  %41 = load double, ptr %40, align 8, !tbaa !9
  %42 = load ptr, ptr %7, align 8, !tbaa !5
  %43 = getelementptr inbounds [3 x double], ptr %42, i64 2
  %44 = getelementptr inbounds [3 x double], ptr %43, i64 0, i64 2
  %45 = load double, ptr %44, align 8, !tbaa !9
  call void @Vec3d_set(ptr noundef %33, double noundef %37, double noundef %41, double noundef %45)
  %46 = load ptr, ptr %5, align 8, !tbaa !5
  call void @Mat3d_setIdentity(ptr noundef %46)
  %47 = load ptr, ptr %6, align 8, !tbaa !5
  %48 = load ptr, ptr %5, align 8, !tbaa !5
  call void @Mat3d_sortEigenbasis(ptr noundef %47, ptr noundef %48, i1 noundef zeroext true)
  store i1 true, ptr %4, align 1
  br label %222

49:                                               ; preds = %27
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #5
  %50 = load ptr, ptr %7, align 8, !tbaa !5
  %51 = getelementptr inbounds [3 x double], ptr %50, i64 0
  %52 = getelementptr inbounds [3 x double], ptr %51, i64 0, i64 0
  %53 = load double, ptr %52, align 8, !tbaa !9
  %54 = load ptr, ptr %7, align 8, !tbaa !5
  %55 = getelementptr inbounds [3 x double], ptr %54, i64 1
  %56 = getelementptr inbounds [3 x double], ptr %55, i64 0, i64 1
  %57 = load double, ptr %56, align 8, !tbaa !9
  %58 = fadd double %53, %57
  %59 = load ptr, ptr %7, align 8, !tbaa !5
  %60 = getelementptr inbounds [3 x double], ptr %59, i64 2
  %61 = getelementptr inbounds [3 x double], ptr %60, i64 0, i64 2
  %62 = load double, ptr %61, align 8, !tbaa !9
  %63 = fadd double %58, %62
  %64 = fdiv double %63, 3.000000e+00
  store double %64, ptr %8, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 72, ptr %9) #5
  call void @llvm.lifetime.start.p0(i64 72, ptr %10) #5
  %65 = getelementptr inbounds [3 x [3 x double]], ptr %9, i64 0, i64 0
  %66 = load ptr, ptr %7, align 8, !tbaa !5
  call void @Mat3d_copy(ptr noundef %65, ptr noundef %66)
  %67 = getelementptr inbounds [3 x [3 x double]], ptr %9, i64 0, i64 0
  %68 = load double, ptr %8, align 8, !tbaa !9
  %69 = fneg double %68
  call void @Mat3d_addConstToDiag(ptr noundef %67, double noundef %69)
  %70 = getelementptr inbounds [3 x [3 x double]], ptr %10, i64 0, i64 0
  %71 = getelementptr inbounds [3 x [3 x double]], ptr %9, i64 0, i64 0
  %72 = getelementptr inbounds [3 x [3 x double]], ptr %9, i64 0, i64 0
  call void @Mat3d_mul(ptr noundef %70, ptr noundef %71, ptr noundef %72)
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #5
  %73 = getelementptr inbounds [3 x [3 x double]], ptr %10, i64 0, i64 0
  %74 = call double @Mat3d_trace(ptr noundef %73)
  %75 = fdiv double %74, 6.000000e+00
  %76 = call double @sqrt(double noundef %75) #5
  store double %76, ptr %11, align 8, !tbaa !9
  %77 = getelementptr inbounds [3 x [3 x double]], ptr %9, i64 0, i64 0
  %78 = load double, ptr %11, align 8, !tbaa !9
  %79 = fdiv double 1.000000e+00, %78
  call void @Mat3d_constMulSelf(ptr noundef %77, double noundef %79)
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #5
  %80 = getelementptr inbounds [3 x [3 x double]], ptr %9, i64 0, i64 0
  %81 = call double @Mat3d_determinant(ptr noundef %80)
  %82 = fmul double 5.000000e-01, %81
  %83 = call double @Math_acos(double noundef %82)
  %84 = fdiv double %83, 3.000000e+00
  store double %84, ptr %12, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 24, ptr %13) #5
  %85 = load double, ptr %12, align 8, !tbaa !9
  %86 = call double @cos(double noundef %85) #5
  %87 = fmul double 2.000000e+00, %86
  %88 = getelementptr inbounds [3 x double], ptr %13, i64 0, i64 0
  store double %87, ptr %88, align 16, !tbaa !9
  %89 = load double, ptr %12, align 8, !tbaa !9
  %90 = fadd double %89, 0x4000C152382D7365
  %91 = call double @cos(double noundef %90) #5
  %92 = fmul double 2.000000e+00, %91
  %93 = getelementptr inbounds [3 x double], ptr %13, i64 0, i64 1
  store double %92, ptr %93, align 8, !tbaa !9
  %94 = load double, ptr %12, align 8, !tbaa !9
  %95 = fadd double %94, 0x4010C152382D7365
  %96 = call double @cos(double noundef %95) #5
  %97 = fmul double 2.000000e+00, %96
  %98 = getelementptr inbounds [3 x double], ptr %13, i64 0, i64 2
  store double %97, ptr %98, align 16, !tbaa !9
  %99 = load double, ptr %11, align 8, !tbaa !9
  %100 = getelementptr inbounds [3 x double], ptr %13, i64 0, i64 0
  %101 = load double, ptr %100, align 16, !tbaa !9
  %102 = load double, ptr %8, align 8, !tbaa !9
  %103 = call double @llvm.fmuladd.f64(double %99, double %101, double %102)
  %104 = load ptr, ptr %6, align 8, !tbaa !5
  %105 = getelementptr inbounds double, ptr %104, i64 0
  store double %103, ptr %105, align 8, !tbaa !9
  %106 = load double, ptr %11, align 8, !tbaa !9
  %107 = getelementptr inbounds [3 x double], ptr %13, i64 0, i64 1
  %108 = load double, ptr %107, align 8, !tbaa !9
  %109 = load double, ptr %8, align 8, !tbaa !9
  %110 = call double @llvm.fmuladd.f64(double %106, double %108, double %109)
  %111 = load ptr, ptr %6, align 8, !tbaa !5
  %112 = getelementptr inbounds double, ptr %111, i64 1
  store double %110, ptr %112, align 8, !tbaa !9
  %113 = load double, ptr %11, align 8, !tbaa !9
  %114 = getelementptr inbounds [3 x double], ptr %13, i64 0, i64 2
  %115 = load double, ptr %114, align 16, !tbaa !9
  %116 = load double, ptr %8, align 8, !tbaa !9
  %117 = call double @llvm.fmuladd.f64(double %113, double %115, double %116)
  %118 = load ptr, ptr %6, align 8, !tbaa !5
  %119 = getelementptr inbounds double, ptr %118, i64 2
  store double %117, ptr %119, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #5
  %120 = load ptr, ptr %6, align 8, !tbaa !5
  %121 = call i32 @Vec3d_multiplicity(ptr noundef %120, double noundef 0x3EB0C6F7A0B5ED8D)
  store i32 %121, ptr %14, align 4, !tbaa !11
  %122 = load i32, ptr %14, align 4, !tbaa !11
  %123 = icmp eq i32 %122, 1
  br i1 %123, label %124, label %150

124:                                              ; preds = %49
  %125 = load ptr, ptr %5, align 8, !tbaa !5
  %126 = getelementptr inbounds [3 x double], ptr %125, i64 0
  %127 = getelementptr inbounds [3 x double], ptr %126, i64 0, i64 0
  %128 = load ptr, ptr %7, align 8, !tbaa !5
  %129 = load ptr, ptr %6, align 8, !tbaa !5
  %130 = getelementptr inbounds double, ptr %129, i64 0
  %131 = load double, ptr %130, align 8, !tbaa !9
  %132 = call zeroext i1 @calcEVi(ptr noundef %127, ptr noundef %128, double noundef %131)
  %133 = load ptr, ptr %5, align 8, !tbaa !5
  %134 = getelementptr inbounds [3 x double], ptr %133, i64 1
  %135 = getelementptr inbounds [3 x double], ptr %134, i64 0, i64 0
  %136 = load ptr, ptr %7, align 8, !tbaa !5
  %137 = load ptr, ptr %6, align 8, !tbaa !5
  %138 = getelementptr inbounds double, ptr %137, i64 1
  %139 = load double, ptr %138, align 8, !tbaa !9
  %140 = call zeroext i1 @calcEVi(ptr noundef %135, ptr noundef %136, double noundef %139)
  %141 = load ptr, ptr %5, align 8, !tbaa !5
  %142 = getelementptr inbounds [3 x double], ptr %141, i64 2
  %143 = getelementptr inbounds [3 x double], ptr %142, i64 0, i64 0
  %144 = load ptr, ptr %5, align 8, !tbaa !5
  %145 = getelementptr inbounds [3 x double], ptr %144, i64 0
  %146 = getelementptr inbounds [3 x double], ptr %145, i64 0, i64 0
  %147 = load ptr, ptr %5, align 8, !tbaa !5
  %148 = getelementptr inbounds [3 x double], ptr %147, i64 1
  %149 = getelementptr inbounds [3 x double], ptr %148, i64 0, i64 0
  call void @Vec3d_crossProduct(ptr noundef %143, ptr noundef %146, ptr noundef %149)
  br label %214

150:                                              ; preds = %49
  %151 = load i32, ptr %14, align 4, !tbaa !11
  %152 = icmp eq i32 %151, 2
  br i1 %152, label %153, label %213

153:                                              ; preds = %150
  %154 = load ptr, ptr %6, align 8, !tbaa !5
  %155 = getelementptr inbounds double, ptr %154, i64 0
  %156 = load double, ptr %155, align 8, !tbaa !9
  %157 = load ptr, ptr %6, align 8, !tbaa !5
  %158 = getelementptr inbounds double, ptr %157, i64 1
  %159 = load double, ptr %158, align 8, !tbaa !9
  %160 = fsub double %156, %159
  %161 = call double @llvm.fabs.f64(double %160)
  %162 = fcmp olt double %161, 0x3EB0C6F7A0B5ED8D
  br i1 %162, label %163, label %172

163:                                              ; preds = %153
  %164 = getelementptr inbounds [3 x double], ptr %13, i64 0, i64 0
  %165 = load ptr, ptr %7, align 8, !tbaa !5
  %166 = load ptr, ptr %6, align 8, !tbaa !5
  %167 = getelementptr inbounds double, ptr %166, i64 2
  %168 = load double, ptr %167, align 8, !tbaa !9
  %169 = call zeroext i1 @calcEVi(ptr noundef %164, ptr noundef %165, double noundef %168)
  %170 = load ptr, ptr %5, align 8, !tbaa !5
  %171 = getelementptr inbounds [3 x double], ptr %13, i64 0, i64 0
  call void @Mat3d_fromVec(ptr noundef %170, ptr noundef %171, i32 noundef 2)
  br label %212

172:                                              ; preds = %153
  %173 = load ptr, ptr %6, align 8, !tbaa !5
  %174 = getelementptr inbounds double, ptr %173, i64 1
  %175 = load double, ptr %174, align 8, !tbaa !9
  %176 = load ptr, ptr %6, align 8, !tbaa !5
  %177 = getelementptr inbounds double, ptr %176, i64 2
  %178 = load double, ptr %177, align 8, !tbaa !9
  %179 = fsub double %175, %178
  %180 = call double @llvm.fabs.f64(double %179)
  %181 = fcmp olt double %180, 0x3EB0C6F7A0B5ED8D
  br i1 %181, label %182, label %191

182:                                              ; preds = %172
  %183 = getelementptr inbounds [3 x double], ptr %13, i64 0, i64 0
  %184 = load ptr, ptr %7, align 8, !tbaa !5
  %185 = load ptr, ptr %6, align 8, !tbaa !5
  %186 = getelementptr inbounds double, ptr %185, i64 0
  %187 = load double, ptr %186, align 8, !tbaa !9
  %188 = call zeroext i1 @calcEVi(ptr noundef %183, ptr noundef %184, double noundef %187)
  %189 = load ptr, ptr %5, align 8, !tbaa !5
  %190 = getelementptr inbounds [3 x double], ptr %13, i64 0, i64 0
  call void @Mat3d_fromVec(ptr noundef %189, ptr noundef %190, i32 noundef 0)
  br label %211

191:                                              ; preds = %172
  %192 = load ptr, ptr %6, align 8, !tbaa !5
  %193 = getelementptr inbounds double, ptr %192, i64 0
  %194 = load double, ptr %193, align 8, !tbaa !9
  %195 = load ptr, ptr %6, align 8, !tbaa !5
  %196 = getelementptr inbounds double, ptr %195, i64 2
  %197 = load double, ptr %196, align 8, !tbaa !9
  %198 = fsub double %194, %197
  %199 = call double @llvm.fabs.f64(double %198)
  %200 = fcmp olt double %199, 0x3EB0C6F7A0B5ED8D
  br i1 %200, label %201, label %210

201:                                              ; preds = %191
  %202 = getelementptr inbounds [3 x double], ptr %13, i64 0, i64 0
  %203 = load ptr, ptr %7, align 8, !tbaa !5
  %204 = load ptr, ptr %6, align 8, !tbaa !5
  %205 = getelementptr inbounds double, ptr %204, i64 1
  %206 = load double, ptr %205, align 8, !tbaa !9
  %207 = call zeroext i1 @calcEVi(ptr noundef %202, ptr noundef %203, double noundef %206)
  %208 = load ptr, ptr %5, align 8, !tbaa !5
  %209 = getelementptr inbounds [3 x double], ptr %13, i64 0, i64 0
  call void @Mat3d_fromVec(ptr noundef %208, ptr noundef %209, i32 noundef 1)
  br label %210

210:                                              ; preds = %201, %191
  br label %211

211:                                              ; preds = %210, %182
  br label %212

212:                                              ; preds = %211, %163
  br label %213

213:                                              ; preds = %212, %150
  br label %214

214:                                              ; preds = %213, %124
  %215 = load ptr, ptr %5, align 8, !tbaa !5
  call void @Mat3d_transposeSelf(ptr noundef %215)
  %216 = load ptr, ptr %6, align 8, !tbaa !5
  %217 = load ptr, ptr %5, align 8, !tbaa !5
  call void @Mat3d_sortEigenbasis(ptr noundef %216, ptr noundef %217, i1 noundef zeroext true)
  %218 = load ptr, ptr %7, align 8, !tbaa !5
  %219 = load ptr, ptr %6, align 8, !tbaa !5
  %220 = load ptr, ptr %5, align 8, !tbaa !5
  %221 = call zeroext i1 @Mat3d_testEigenbasis(ptr noundef %218, ptr noundef %219, ptr noundef %220, double noundef 0x3EB0C6F7A0B5ED8D)
  store i1 %221, ptr %4, align 1
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr %13) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #5
  call void @llvm.lifetime.end.p0(i64 72, ptr %10) #5
  call void @llvm.lifetime.end.p0(i64 72, ptr %9) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #5
  br label %222

222:                                              ; preds = %214, %32, %26
  %223 = load i1, ptr %4, align 1
  ret i1 %223
}

declare void @Vec3d_setZero(ptr noundef) #4

; Function Attrs: nounwind uwtable
declare hidden zeroext i1 @calcEVi(ptr noundef, ptr noundef, double noundef) #0

attributes #0 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #4 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { nounwind }

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"double", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"int", !7, i64 0}


; Optimized IR (opt -passes='default<O3>'):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

; Function Attrs: nounwind uwtable
declare dso_local double @Mat3d_trace(ptr noundef) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
declare dso_local void @Mat3d_setIdentity(ptr noundef) local_unnamed_addr #0

; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1

; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1

; Function Attrs: nounwind uwtable
declare dso_local void @Mat3d_addConstToDiag(ptr noundef, double noundef) local_unnamed_addr #0

; Function Attrs: mustprogress nofree nounwind willreturn memory(write)
declare double @cos(double noundef) local_unnamed_addr #2

; Function Attrs: nounwind uwtable
declare dso_local void @Mat3d_copy(ptr noundef, ptr noundef) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
declare dso_local void @Mat3d_constMulSelf(ptr noundef, double noundef) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
declare dso_local void @Mat3d_mul(ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #0

; Function Attrs: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare double @llvm.fmuladd.f64(double, double, double) #3

; Function Attrs: nounwind uwtable
declare dso_local zeroext i1 @Mat3d_isZero(ptr noundef) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
declare dso_local zeroext i1 @Mat3d_isSymmetric(ptr noundef, double noundef) local_unnamed_addr #0

; Function Attrs: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare double @llvm.fabs.f64(double) #3

; Function Attrs: nounwind uwtable
declare dso_local zeroext i1 @Mat3d_isDiagonal(ptr noundef, double noundef) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
declare dso_local void @Mat3d_transposeSelf(ptr noundef) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
declare dso_local double @Mat3d_determinant(ptr noundef) local_unnamed_addr #0

; Function Attrs: mustprogress nofree nounwind willreturn memory(write)
declare double @sqrt(double noundef) local_unnamed_addr #2

declare void @Vec3d_crossProduct(ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #4

declare void @Vec3d_set(ptr noundef, double noundef, double noundef, double noundef) local_unnamed_addr #4

declare double @Math_acos(double noundef) local_unnamed_addr #4

; Function Attrs: nounwind uwtable
declare dso_local void @Mat3d_fromVec(ptr noundef, ptr noundef, i32 noundef) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
declare dso_local zeroext i1 @Mat3d_testEigenbasis(ptr noundef, ptr noundef, ptr noundef, double noundef) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
declare hidden void @Mat3d_sortEigenbasis(ptr noundef, ptr noundef, i1 noundef zeroext) local_unnamed_addr #0

declare i32 @Vec3d_multiplicity(ptr noundef, double noundef) local_unnamed_addr #4

; Function Attrs: nounwind uwtable
define dso_local zeroext i1 @Mat3d_getEigenVectors(ptr noundef %0, ptr noundef %1, ptr noundef %2) local_unnamed_addr #0 {
  %4 = alloca [3 x [3 x double]], align 16
  %5 = alloca [3 x [3 x double]], align 16
  %6 = alloca [3 x double], align 16
  tail call void @Mat3d_setIdentity(ptr noundef %0)
  tail call void @Vec3d_setZero(ptr noundef %1) #6
  %7 = tail call zeroext i1 @Mat3d_isZero(ptr noundef %2)
  br i1 %7, label %84, label %8

8:                                                ; preds = %3
  %9 = tail call zeroext i1 @Mat3d_isSymmetric(ptr noundef %2, double noundef 1.000000e-08)
  br i1 %9, label %10, label %84

10:                                               ; preds = %8
  %11 = tail call zeroext i1 @Mat3d_isDiagonal(ptr noundef %2, double noundef 1.000000e-08)
  %12 = load double, ptr %2, align 8, !tbaa !5
  %13 = getelementptr inbounds i8, ptr %2, i64 32
  %14 = load double, ptr %13, align 8, !tbaa !5
  br i1 %11, label %15, label %18

15:                                               ; preds = %10
  %16 = getelementptr inbounds i8, ptr %2, i64 64
  %17 = load double, ptr %16, align 8, !tbaa !5
  tail call void @Vec3d_set(ptr noundef %1, double noundef %12, double noundef %14, double noundef %17) #6
  tail call void @Mat3d_setIdentity(ptr noundef %0)
  tail call void @Mat3d_sortEigenbasis(ptr noundef %1, ptr noundef %0, i1 noundef zeroext true)
  br label %84

18:                                               ; preds = %10
  %19 = fadd double %12, %14
  %20 = getelementptr inbounds i8, ptr %2, i64 64
  %21 = load double, ptr %20, align 8, !tbaa !5
  %22 = fadd double %19, %21
  %23 = fdiv double %22, 3.000000e+00
  call void @llvm.lifetime.start.p0(i64 72, ptr nonnull %4) #6
  call void @llvm.lifetime.start.p0(i64 72, ptr nonnull %5) #6
  call void @Mat3d_copy(ptr noundef nonnull %4, ptr noundef nonnull %2)
  %24 = fneg double %23
  call void @Mat3d_addConstToDiag(ptr noundef nonnull %4, double noundef %24)
  call void @Mat3d_mul(ptr noundef nonnull %5, ptr noundef nonnull %4, ptr noundef nonnull %4)
  %25 = call double @Mat3d_trace(ptr noundef nonnull %5)
  %26 = fdiv double %25, 6.000000e+00
  %27 = call double @sqrt(double noundef %26) #6
  %28 = fdiv double 1.000000e+00, %27
  call void @Mat3d_constMulSelf(ptr noundef nonnull %4, double noundef %28)
  %29 = call double @Mat3d_determinant(ptr noundef nonnull %4)
  %30 = fmul double %29, 5.000000e-01
  %31 = call double @Math_acos(double noundef %30) #6
  %32 = fdiv double %31, 3.000000e+00
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %6) #6
  %33 = call double @cos(double noundef %32) #6
  %34 = fadd double %32, 0x4000C152382D7365
  %35 = getelementptr inbounds i8, ptr %6, i64 8
  %36 = fadd double %32, 0x4010C152382D7365
  %37 = getelementptr inbounds i8, ptr %6, i64 16
  %38 = getelementptr inbounds i8, ptr %1, i64 8
  %39 = fmul double %33, 2.000000e+00
  store double %39, ptr %6, align 16, !tbaa !5
  %40 = call double @cos(double noundef %34) #6
  %41 = fmul double %40, 2.000000e+00
  store double %41, ptr %35, align 8, !tbaa !5
  %42 = call double @cos(double noundef %36) #6
  %43 = fmul double %42, 2.000000e+00
  store double %43, ptr %37, align 16, !tbaa !5
  %44 = insertelement <2 x double> poison, double %27, i64 0
  %45 = shufflevector <2 x double> %44, <2 x double> poison, <2 x i32> zeroinitializer
  %46 = insertelement <2 x double> poison, double %39, i64 0
  %47 = insertelement <2 x double> %46, double %41, i64 1
  %48 = insertelement <2 x double> poison, double %23, i64 0
  %49 = shufflevector <2 x double> %48, <2 x double> poison, <2 x i32> zeroinitializer
  %50 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %45, <2 x double> %47, <2 x double> %49)
  store <2 x double> %50, ptr %1, align 8, !tbaa !5
  %51 = call double @llvm.fmuladd.f64(double %27, double %43, double %23)
  %52 = getelementptr inbounds i8, ptr %1, i64 16
  store double %51, ptr %52, align 8, !tbaa !5
  %53 = call i32 @Vec3d_multiplicity(ptr noundef nonnull %1, double noundef 0x3EB0C6F7A0B5ED8D) #6
  switch i32 %53, label %82 [
    i32 1, label %54
    i32 2, label %61
  ]

54:                                               ; preds = %18
  %55 = load double, ptr %1, align 8, !tbaa !5
  %56 = call zeroext i1 @calcEVi(ptr noundef %0, ptr noundef nonnull %2, double noundef %55)
  %57 = getelementptr inbounds i8, ptr %0, i64 24
  %58 = load double, ptr %38, align 8, !tbaa !5
  %59 = call zeroext i1 @calcEVi(ptr noundef nonnull %57, ptr noundef nonnull %2, double noundef %58)
  %60 = getelementptr inbounds i8, ptr %0, i64 48
  call void @Vec3d_crossProduct(ptr noundef nonnull %60, ptr noundef %0, ptr noundef nonnull %57) #6
  br label %82

61:                                               ; preds = %18
  %62 = load double, ptr %1, align 8, !tbaa !5
  %63 = load double, ptr %38, align 8, !tbaa !5
  %64 = fsub double %62, %63
  %65 = call double @llvm.fabs.f64(double %64)
  %66 = fcmp olt double %65, 0x3EB0C6F7A0B5ED8D
  %67 = load double, ptr %52, align 8, !tbaa !5
  br i1 %66, label %68, label %70

68:                                               ; preds = %61
  %69 = call zeroext i1 @calcEVi(ptr noundef nonnull %6, ptr noundef nonnull %2, double noundef %67)
  call void @Mat3d_fromVec(ptr noundef %0, ptr noundef nonnull %6, i32 noundef 2)
  br label %82

70:                                               ; preds = %61
  %71 = fsub double %63, %67
  %72 = call double @llvm.fabs.f64(double %71)
  %73 = fcmp olt double %72, 0x3EB0C6F7A0B5ED8D
  br i1 %73, label %74, label %76

74:                                               ; preds = %70
  %75 = call zeroext i1 @calcEVi(ptr noundef nonnull %6, ptr noundef nonnull %2, double noundef %62)
  call void @Mat3d_fromVec(ptr noundef %0, ptr noundef nonnull %6, i32 noundef 0)
  br label %82

76:                                               ; preds = %70
  %77 = fsub double %62, %67
  %78 = call double @llvm.fabs.f64(double %77)
  %79 = fcmp olt double %78, 0x3EB0C6F7A0B5ED8D
  br i1 %79, label %80, label %82

80:                                               ; preds = %76
  %81 = call zeroext i1 @calcEVi(ptr noundef nonnull %6, ptr noundef nonnull %2, double noundef %63)
  call void @Mat3d_fromVec(ptr noundef %0, ptr noundef nonnull %6, i32 noundef 1)
  br label %82

82:                                               ; preds = %18, %74, %80, %76, %68, %54
  call void @Mat3d_transposeSelf(ptr noundef %0)
  call void @Mat3d_sortEigenbasis(ptr noundef nonnull %1, ptr noundef %0, i1 noundef zeroext true)
  %83 = call zeroext i1 @Mat3d_testEigenbasis(ptr noundef nonnull %2, ptr noundef nonnull %1, ptr noundef %0, double noundef 0x3EB0C6F7A0B5ED8D)
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %6) #6
  call void @llvm.lifetime.end.p0(i64 72, ptr nonnull %5) #6
  call void @llvm.lifetime.end.p0(i64 72, ptr nonnull %4) #6
  br label %84

84:                                               ; preds = %3, %8, %82, %15
  %.0 = phi i1 [ true, %15 ], [ %83, %82 ], [ false, %8 ], [ false, %3 ]
  ret i1 %.0
}

declare void @Vec3d_setZero(ptr noundef) local_unnamed_addr #4

; Function Attrs: nounwind uwtable
declare hidden zeroext i1 @calcEVi(ptr noundef, ptr noundef, double noundef) local_unnamed_addr #0

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare <2 x double> @llvm.fmuladd.v2f64(<2 x double>, <2 x double>, <2 x double>) #5

attributes #0 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { mustprogress nofree nounwind willreturn memory(write) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #4 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #6 = { nounwind }

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"double", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}


; Effective O3 passes: EarlyCSEPass,GVNPass,GlobalOptPass,InferFunctionAttrsPass,InstCombinePass,SLPVectorizerPass,SROAPass,SimplifyCFGPass,TailCallElimPass