; 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"

@stderr = external global ptr, align 8
@.str.3 = external hidden unnamed_addr constant [2 x i8], align 1
@RCS_GLOBAL_RLOG_CB = external global ptr, align 8
@RcsLogLevel = external global i32, align 4
@.str.29 = external hidden unnamed_addr constant [1 x i8], align 1
@__func__.Mat3d_compareEigenbasis = external hidden unnamed_addr constant [24 x i8], align 1
@.str.30 = external hidden unnamed_addr constant [25 x i8], align 1
@.str.31 = external hidden unnamed_addr constant [11 x i8], align 1
@.str.32 = external hidden unnamed_addr constant [37 x i8], align 1
@.str.33 = external hidden unnamed_addr constant [33 x i8], align 1

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

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

; Function Attrs: nounwind
declare i32 @fprintf(ptr noundef, ptr noundef, ...) #1

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

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

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

declare i32 @fflush(ptr noundef) #4

; Function Attrs: nounwind uwtable
define dso_local zeroext i1 @Mat3d_compareEigenbasis(ptr noundef %0, ptr noundef %1, ptr noundef %2, ptr noundef %3, double noundef %4) #2 {
  %6 = alloca i1, align 1
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca ptr, align 8
  %10 = alloca ptr, align 8
  %11 = alloca double, align 8
  %12 = alloca [3 x double], align 16
  %13 = alloca [3 x [3 x double]], align 16
  %14 = alloca [3 x double], align 16
  %15 = alloca [3 x [3 x double]], align 16
  %16 = alloca i32, align 4
  %17 = alloca i32, align 4
  %18 = alloca double, align 8
  %19 = alloca double, align 8
  store ptr %0, ptr %7, align 8, !tbaa !5
  store ptr %1, ptr %8, align 8, !tbaa !5
  store ptr %2, ptr %9, align 8, !tbaa !5
  store ptr %3, ptr %10, align 8, !tbaa !5
  store double %4, ptr %11, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 24, ptr %12) #5
  call void @llvm.lifetime.start.p0(i64 72, ptr %13) #5
  call void @llvm.lifetime.start.p0(i64 24, ptr %14) #5
  call void @llvm.lifetime.start.p0(i64 72, ptr %15) #5
  %20 = getelementptr inbounds [3 x double], ptr %12, i64 0, i64 0
  %21 = load ptr, ptr %7, align 8, !tbaa !5
  call void @Vec3d_copy(ptr noundef %20, ptr noundef %21)
  %22 = getelementptr inbounds [3 x double], ptr %14, i64 0, i64 0
  %23 = load ptr, ptr %9, align 8, !tbaa !5
  call void @Vec3d_copy(ptr noundef %22, ptr noundef %23)
  %24 = getelementptr inbounds [3 x [3 x double]], ptr %13, i64 0, i64 0
  %25 = load ptr, ptr %8, align 8, !tbaa !5
  call void @Mat3d_copy(ptr noundef %24, ptr noundef %25)
  %26 = getelementptr inbounds [3 x [3 x double]], ptr %15, i64 0, i64 0
  %27 = load ptr, ptr %10, align 8, !tbaa !5
  call void @Mat3d_copy(ptr noundef %26, ptr noundef %27)
  %28 = getelementptr inbounds [3 x double], ptr %12, i64 0, i64 0
  %29 = getelementptr inbounds [3 x [3 x double]], ptr %13, i64 0, i64 0
  call void @Mat3d_sortEigenbasis(ptr noundef %28, ptr noundef %29, i1 noundef zeroext true)
  %30 = getelementptr inbounds [3 x double], ptr %14, i64 0, i64 0
  %31 = getelementptr inbounds [3 x [3 x double]], ptr %15, i64 0, i64 0
  call void @Mat3d_sortEigenbasis(ptr noundef %30, ptr noundef %31, i1 noundef zeroext true)
  %32 = getelementptr inbounds [3 x double], ptr %12, i64 0, i64 0
  %33 = getelementptr inbounds [3 x double], ptr %14, i64 0, i64 0
  %34 = load double, ptr %11, align 8, !tbaa !9
  %35 = call zeroext i1 @Vec3d_isEqual(ptr noundef %32, ptr noundef %33, double noundef %34)
  br i1 %35, label %57, label %36

36:                                               ; preds = %5
  br label %37

37:                                               ; preds = %36
  %38 = load ptr, ptr @RCS_GLOBAL_RLOG_CB, align 8, !tbaa !5
  %39 = icmp ne ptr %38, null
  br i1 %39, label %40, label %42

40:                                               ; preds = %37
  %41 = load ptr, ptr @RCS_GLOBAL_RLOG_CB, align 8, !tbaa !5
  call void (i32, ptr, ptr, i32, ptr, ...) %41(i32 noundef 4, ptr noundef @.str.29, ptr noundef @__func__.Mat3d_compareEigenbasis, i32 noundef 1939, ptr noundef @.str.30)
  br label %42

42:                                               ; preds = %40, %37
  %43 = load i32, ptr @RcsLogLevel, align 4, !tbaa !11
  %44 = icmp sle i32 4, %43
  br i1 %44, label %45, label %52

45:                                               ; preds = %42
  %46 = load ptr, ptr @stderr, align 8, !tbaa !5
  %47 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %46, ptr noundef @.str.31, ptr noundef @__func__.Mat3d_compareEigenbasis, i32 noundef 1939) #5
  %48 = load ptr, ptr @stderr, align 8, !tbaa !5
  %49 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %48, ptr noundef @.str.30) #5
  %50 = load ptr, ptr @stderr, align 8, !tbaa !5
  %51 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %50, ptr noundef @.str.3) #5
  br label %52

52:                                               ; preds = %45, %42
  br label %53

53:                                               ; preds = %52
  br label %54

54:                                               ; preds = %53
  %55 = getelementptr inbounds [3 x double], ptr %12, i64 0, i64 0
  %56 = getelementptr inbounds [3 x double], ptr %14, i64 0, i64 0
  call void @Vec3d_printTwoVectorsDiff(ptr noundef %55, ptr noundef %56, i32 noundef 12)
  store i1 false, ptr %6, align 1
  store i32 1, ptr %16, align 4
  br label %154

57:                                               ; preds = %5
  %58 = getelementptr inbounds [3 x double], ptr %12, i64 0, i64 0
  %59 = load double, ptr %11, align 8, !tbaa !9
  %60 = call i32 @Vec3d_multiplicity(ptr noundef %58, double noundef %59)
  %61 = icmp ne i32 %60, 1
  br i1 %61, label %62, label %63

62:                                               ; preds = %57
  store i1 true, ptr %6, align 1
  store i32 1, ptr %16, align 4
  br label %154

63:                                               ; preds = %57
  %64 = getelementptr inbounds [3 x [3 x double]], ptr %13, i64 0, i64 0
  call void @Mat3d_transposeSelf(ptr noundef %64)
  %65 = getelementptr inbounds [3 x [3 x double]], ptr %15, i64 0, i64 0
  call void @Mat3d_transposeSelf(ptr noundef %65)
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #5
  store i32 0, ptr %17, align 4, !tbaa !11
  br label %66

66:                                               ; preds = %148, %63
  %67 = load i32, ptr %17, align 4, !tbaa !11
  %68 = icmp ult i32 %67, 3
  br i1 %68, label %70, label %69

69:                                               ; preds = %66
  store i32 4, ptr %16, align 4
  br label %151

70:                                               ; preds = %66
  %71 = load i32, ptr %17, align 4, !tbaa !11
  %72 = zext i32 %71 to i64
  %73 = getelementptr inbounds [3 x [3 x double]], ptr %13, i64 0, i64 %72
  %74 = getelementptr inbounds [3 x double], ptr %73, i64 0, i64 0
  %75 = call double @Vec3d_normalizeSelf(ptr noundef %74)
  %76 = load i32, ptr %17, align 4, !tbaa !11
  %77 = zext i32 %76 to i64
  %78 = getelementptr inbounds [3 x [3 x double]], ptr %15, i64 0, i64 %77
  %79 = getelementptr inbounds [3 x double], ptr %78, i64 0, i64 0
  %80 = call double @Vec3d_normalizeSelf(ptr noundef %79)
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #5
  %81 = load i32, ptr %17, align 4, !tbaa !11
  %82 = zext i32 %81 to i64
  %83 = getelementptr inbounds [3 x [3 x double]], ptr %13, i64 0, i64 %82
  %84 = getelementptr inbounds [3 x double], ptr %83, i64 0, i64 0
  %85 = load i32, ptr %17, align 4, !tbaa !11
  %86 = zext i32 %85 to i64
  %87 = getelementptr inbounds [3 x [3 x double]], ptr %15, i64 0, i64 %86
  %88 = getelementptr inbounds [3 x double], ptr %87, i64 0, i64 0
  %89 = call double @Vec3d_innerProduct(ptr noundef %84, ptr noundef %88)
  %90 = call double @llvm.fabs.f64(double %89)
  store double %90, ptr %18, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #5
  %91 = load double, ptr %18, align 8, !tbaa !9
  %92 = fsub double %91, 1.000000e+00
  %93 = call double @llvm.fabs.f64(double %92)
  store double %93, ptr %19, align 8, !tbaa !9
  %94 = load double, ptr %19, align 8, !tbaa !9
  %95 = load double, ptr %11, align 8, !tbaa !9
  %96 = fcmp ogt double %94, %95
  br i1 %96, label %97, label %144

97:                                               ; preds = %70
  %98 = load i32, ptr @RcsLogLevel, align 4, !tbaa !11
  %99 = icmp sle i32 4, %98
  br i1 %99, label %100, label %143

100:                                              ; preds = %97
  br label %101

101:                                              ; preds = %100
  %102 = load ptr, ptr @stderr, align 8, !tbaa !5
  %103 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %102, ptr noundef @.str.31, ptr noundef @__func__.Mat3d_compareEigenbasis, i32 noundef 1967) #5
  %104 = load ptr, ptr @stderr, align 8, !tbaa !5
  %105 = load i32, ptr %17, align 4, !tbaa !11
  %106 = load double, ptr %18, align 8, !tbaa !9
  %107 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %104, ptr noundef @.str.32, i32 noundef %105, double noundef %106) #5
  %108 = load ptr, ptr @stderr, align 8, !tbaa !5
  %109 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %108, ptr noundef @.str.3) #5
  %110 = load ptr, ptr @stderr, align 8, !tbaa !5
  %111 = call i32 @fflush(ptr noundef %110)
  br label %112

112:                                              ; preds = %101
  br label %113

113:                                              ; preds = %112
  br label %114

114:                                              ; preds = %113
  %115 = load ptr, ptr @stderr, align 8, !tbaa !5
  %116 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %115, ptr noundef @.str.31, ptr noundef @__func__.Mat3d_compareEigenbasis, i32 noundef 1969) #5
  %117 = load ptr, ptr @stderr, align 8, !tbaa !5
  %118 = load i32, ptr %17, align 4, !tbaa !11
  %119 = zext i32 %118 to i64
  %120 = getelementptr inbounds [3 x [3 x double]], ptr %13, i64 0, i64 %119
  %121 = getelementptr inbounds [3 x double], ptr %120, i64 0, i64 0
  %122 = load i32, ptr %17, align 4, !tbaa !11
  %123 = zext i32 %122 to i64
  %124 = getelementptr inbounds [3 x [3 x double]], ptr %15, i64 0, i64 %123
  %125 = getelementptr inbounds [3 x double], ptr %124, i64 0, i64 0
  %126 = call double @Vec3d_diffAngle(ptr noundef %121, ptr noundef %125)
  %127 = fmul double 0x404CA5DC1A63C1F8, %126
  %128 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %117, ptr noundef @.str.33, double noundef %127) #5
  %129 = load ptr, ptr @stderr, align 8, !tbaa !5
  %130 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %129, ptr noundef @.str.3) #5
  %131 = load ptr, ptr @stderr, align 8, !tbaa !5
  %132 = call i32 @fflush(ptr noundef %131)
  br label %133

133:                                              ; preds = %114
  br label %134

134:                                              ; preds = %133
  %135 = load i32, ptr %17, align 4, !tbaa !11
  %136 = zext i32 %135 to i64
  %137 = getelementptr inbounds [3 x [3 x double]], ptr %13, i64 0, i64 %136
  %138 = getelementptr inbounds [3 x double], ptr %137, i64 0, i64 0
  %139 = load i32, ptr %17, align 4, !tbaa !11
  %140 = zext i32 %139 to i64
  %141 = getelementptr inbounds [3 x [3 x double]], ptr %15, i64 0, i64 %140
  %142 = getelementptr inbounds [3 x double], ptr %141, i64 0, i64 0
  call void @Vec3d_printTwoVectorsDiff(ptr noundef %138, ptr noundef %142, i32 noundef 8)
  br label %143

143:                                              ; preds = %134, %97
  store i1 false, ptr %6, align 1
  store i32 1, ptr %16, align 4
  br label %145

144:                                              ; preds = %70
  store i32 0, ptr %16, align 4
  br label %145

145:                                              ; preds = %144, %143
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #5
  %146 = load i32, ptr %16, align 4
  switch i32 %146, label %151 [
    i32 0, label %147
  ]

147:                                              ; preds = %145
  br label %148

148:                                              ; preds = %147
  %149 = load i32, ptr %17, align 4, !tbaa !11
  %150 = add i32 %149, 1
  store i32 %150, ptr %17, align 4, !tbaa !11
  br label %66, !llvm.loop !13

151:                                              ; preds = %145, %69
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #5
  %152 = load i32, ptr %16, align 4
  switch i32 %152, label %154 [
    i32 4, label %153
  ]

153:                                              ; preds = %151
  store i1 true, ptr %6, align 1
  store i32 1, ptr %16, align 4
  br label %154

154:                                              ; preds = %153, %151, %62, %54
  call void @llvm.lifetime.end.p0(i64 72, ptr %15) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr %14) #5
  call void @llvm.lifetime.end.p0(i64 72, ptr %13) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr %12) #5
  %155 = load i1, ptr %6, align 1
  ret i1 %155
}

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

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

declare zeroext i1 @Vec3d_isEqual(ptr noundef, ptr noundef, double noundef) #4

declare void @Vec3d_printTwoVectorsDiff(ptr noundef, ptr noundef, i32 noundef) #4

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

declare double @Vec3d_normalizeSelf(ptr noundef) #4

declare double @Vec3d_innerProduct(ptr noundef, ptr noundef) #4

declare double @Vec3d_diffAngle(ptr noundef, ptr noundef) #4

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #2 = { 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 #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}
!13 = distinct !{!13, !14}
!14 = !{!"llvm.loop.mustprogress"}


; 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"

@stderr = external local_unnamed_addr global ptr, align 8
@.str.3 = external hidden unnamed_addr constant [2 x i8], align 1
@RCS_GLOBAL_RLOG_CB = external local_unnamed_addr global ptr, align 8
@RcsLogLevel = external local_unnamed_addr global i32, align 4
@.str.29 = external hidden unnamed_addr constant [1 x i8], align 1
@__func__.Mat3d_compareEigenbasis = external hidden unnamed_addr constant [24 x i8], align 1
@.str.30 = external hidden unnamed_addr constant [25 x i8], align 1
@.str.31 = external hidden unnamed_addr constant [11 x i8], align 1
@.str.32 = external hidden unnamed_addr constant [37 x i8], align 1
@.str.33 = external hidden unnamed_addr constant [33 x i8], align 1

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

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

; Function Attrs: nofree nounwind
declare noundef i32 @fprintf(ptr nocapture noundef, ptr nocapture noundef readonly, ...) local_unnamed_addr #1

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

; 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 void @Mat3d_transposeSelf(ptr noundef) local_unnamed_addr #2

; Function Attrs: nofree nounwind
declare noundef i32 @fflush(ptr nocapture noundef) local_unnamed_addr #1

; Function Attrs: nounwind uwtable
define dso_local noundef zeroext i1 @Mat3d_compareEigenbasis(ptr noundef %0, ptr noundef %1, ptr noundef %2, ptr noundef %3, double noundef %4) local_unnamed_addr #2 {
  %6 = alloca [3 x double], align 16
  %7 = alloca [3 x [3 x double]], align 16
  %8 = alloca [3 x double], align 16
  %9 = alloca [3 x [3 x double]], align 16
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %6) #5
  call void @llvm.lifetime.start.p0(i64 72, ptr nonnull %7) #5
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %8) #5
  call void @llvm.lifetime.start.p0(i64 72, ptr nonnull %9) #5
  call void @Vec3d_copy(ptr noundef nonnull %6, ptr noundef %0) #5
  call void @Vec3d_copy(ptr noundef nonnull %8, ptr noundef %2) #5
  call void @Mat3d_copy(ptr noundef nonnull %7, ptr noundef %1)
  call void @Mat3d_copy(ptr noundef nonnull %9, ptr noundef %3)
  call void @Mat3d_sortEigenbasis(ptr noundef nonnull %6, ptr noundef nonnull %7, i1 noundef zeroext true)
  call void @Mat3d_sortEigenbasis(ptr noundef nonnull %8, ptr noundef nonnull %9, i1 noundef zeroext true)
  %10 = call zeroext i1 @Vec3d_isEqual(ptr noundef nonnull %6, ptr noundef nonnull %8, double noundef %4) #5
  br i1 %10, label %25, label %11

11:                                               ; preds = %5
  %12 = load ptr, ptr @RCS_GLOBAL_RLOG_CB, align 8, !tbaa !5
  %.not = icmp eq ptr %12, null
  br i1 %.not, label %14, label %13

13:                                               ; preds = %11
  call void (i32, ptr, ptr, i32, ptr, ...) %12(i32 noundef 4, ptr noundef nonnull @.str.29, ptr noundef nonnull @__func__.Mat3d_compareEigenbasis, i32 noundef 1939, ptr noundef nonnull @.str.30) #5
  br label %14

14:                                               ; preds = %13, %11
  %15 = load i32, ptr @RcsLogLevel, align 4, !tbaa !9
  %16 = icmp sgt i32 %15, 3
  br i1 %16, label %17, label %24

17:                                               ; preds = %14
  %18 = load ptr, ptr @stderr, align 8, !tbaa !5
  %19 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %18, ptr noundef nonnull @.str.31, ptr noundef nonnull @__func__.Mat3d_compareEigenbasis, i32 noundef 1939) #6
  %20 = load ptr, ptr @stderr, align 8, !tbaa !5
  %21 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %20, ptr noundef nonnull @.str.30) #6
  %22 = load ptr, ptr @stderr, align 8, !tbaa !5
  %23 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %22, ptr noundef nonnull @.str.3) #6
  br label %24

24:                                               ; preds = %17, %14
  call void @Vec3d_printTwoVectorsDiff(ptr noundef nonnull %6, ptr noundef nonnull %8, i32 noundef 12) #5
  br label %.loopexit

25:                                               ; preds = %5
  %26 = call i32 @Vec3d_multiplicity(ptr noundef nonnull %6, double noundef %4) #5
  %.not28 = icmp eq i32 %26, 1
  br i1 %.not28, label %27, label %.loopexit

27:                                               ; preds = %25
  call void @Mat3d_transposeSelf(ptr noundef nonnull %7)
  call void @Mat3d_transposeSelf(ptr noundef nonnull %9)
  %28 = call double @Vec3d_normalizeSelf(ptr noundef nonnull %7) #5
  %29 = call double @Vec3d_normalizeSelf(ptr noundef nonnull %9) #5
  %30 = call double @Vec3d_innerProduct(ptr noundef nonnull %7, ptr noundef nonnull %9) #5
  %31 = call double @llvm.fabs.f64(double %30)
  %32 = fadd double %31, -1.000000e+00
  %33 = call double @llvm.fabs.f64(double %32)
  %34 = fcmp ule double %33, %4
  br i1 %34, label %.critedge, label %35

35:                                               ; preds = %.critedge.1, %.critedge, %27
  %.02632.lcssa.wide = phi i32 [ 0, %27 ], [ 1, %.critedge ], [ 2, %.critedge.1 ]
  %.lcssa36 = phi ptr [ %7, %27 ], [ %57, %.critedge ], [ %66, %.critedge.1 ]
  %.lcssa34 = phi ptr [ %9, %27 ], [ %59, %.critedge ], [ %68, %.critedge.1 ]
  %.lcssa = phi double [ %31, %27 ], [ %62, %.critedge ], [ %71, %.critedge.1 ]
  %36 = load i32, ptr @RcsLogLevel, align 4, !tbaa !9
  %37 = icmp sgt i32 %36, 3
  br i1 %37, label %38, label %.loopexit

38:                                               ; preds = %35
  %39 = load ptr, ptr @stderr, align 8, !tbaa !5
  %40 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %39, ptr noundef nonnull @.str.31, ptr noundef nonnull @__func__.Mat3d_compareEigenbasis, i32 noundef 1967) #6
  %41 = load ptr, ptr @stderr, align 8, !tbaa !5
  %42 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %41, ptr noundef nonnull @.str.32, i32 noundef %.02632.lcssa.wide, double noundef %.lcssa) #6
  %43 = load ptr, ptr @stderr, align 8, !tbaa !5
  %44 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %43, ptr noundef nonnull @.str.3) #6
  %45 = load ptr, ptr @stderr, align 8, !tbaa !5
  %46 = call i32 @fflush(ptr noundef %45)
  %47 = load ptr, ptr @stderr, align 8, !tbaa !5
  %48 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %47, ptr noundef nonnull @.str.31, ptr noundef nonnull @__func__.Mat3d_compareEigenbasis, i32 noundef 1969) #6
  %49 = load ptr, ptr @stderr, align 8, !tbaa !5
  %50 = call double @Vec3d_diffAngle(ptr noundef nonnull %.lcssa36, ptr noundef nonnull %.lcssa34) #5
  %51 = fmul double %50, 0x404CA5DC1A63C1F8
  %52 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %49, ptr noundef nonnull @.str.33, double noundef %51) #6
  %53 = load ptr, ptr @stderr, align 8, !tbaa !5
  %54 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %53, ptr noundef nonnull @.str.3) #6
  %55 = load ptr, ptr @stderr, align 8, !tbaa !5
  %56 = call i32 @fflush(ptr noundef %55)
  call void @Vec3d_printTwoVectorsDiff(ptr noundef nonnull %.lcssa36, ptr noundef nonnull %.lcssa34, i32 noundef 8) #5
  br label %.loopexit

.critedge:                                        ; preds = %27
  %57 = getelementptr inbounds i8, ptr %7, i64 24
  %58 = call double @Vec3d_normalizeSelf(ptr noundef nonnull %57) #5
  %59 = getelementptr inbounds i8, ptr %9, i64 24
  %60 = call double @Vec3d_normalizeSelf(ptr noundef nonnull %59) #5
  %61 = call double @Vec3d_innerProduct(ptr noundef nonnull %57, ptr noundef nonnull %59) #5
  %62 = call double @llvm.fabs.f64(double %61)
  %63 = fadd double %62, -1.000000e+00
  %64 = call double @llvm.fabs.f64(double %63)
  %65 = fcmp ule double %64, %4
  br i1 %65, label %.critedge.1, label %35

.critedge.1:                                      ; preds = %.critedge
  %66 = getelementptr inbounds i8, ptr %7, i64 48
  %67 = call double @Vec3d_normalizeSelf(ptr noundef nonnull %66) #5
  %68 = getelementptr inbounds i8, ptr %9, i64 48
  %69 = call double @Vec3d_normalizeSelf(ptr noundef nonnull %68) #5
  %70 = call double @Vec3d_innerProduct(ptr noundef nonnull %66, ptr noundef nonnull %68) #5
  %71 = call double @llvm.fabs.f64(double %70)
  %72 = fadd double %71, -1.000000e+00
  %73 = call double @llvm.fabs.f64(double %72)
  %74 = fcmp ule double %73, %4
  br i1 %74, label %.loopexit, label %35

.loopexit:                                        ; preds = %.critedge.1, %35, %38, %25, %24
  %.3 = phi i1 [ false, %24 ], [ true, %25 ], [ false, %38 ], [ false, %35 ], [ true, %.critedge.1 ]
  call void @llvm.lifetime.end.p0(i64 72, ptr nonnull %9) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %8) #5
  call void @llvm.lifetime.end.p0(i64 72, ptr nonnull %7) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %6) #5
  ret i1 %.3
}

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

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

declare zeroext i1 @Vec3d_isEqual(ptr noundef, ptr noundef, double noundef) local_unnamed_addr #4

declare void @Vec3d_printTwoVectorsDiff(ptr noundef, ptr noundef, i32 noundef) local_unnamed_addr #4

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

declare double @Vec3d_normalizeSelf(ptr noundef) local_unnamed_addr #4

declare double @Vec3d_innerProduct(ptr noundef, ptr noundef) local_unnamed_addr #4

declare double @Vec3d_diffAngle(ptr noundef, ptr noundef) local_unnamed_addr #4

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { nofree 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 #2 = { 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 #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 = { nounwind }
attributes #6 = { cold 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 = !{!"int", !7, i64 0}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LCSSAPass,LoopRotatePass,LoopSimplifyPass,PostOrderFunctionAttrsPass,SROAPass,SimplifyCFGPass