; 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.1 = external hidden unnamed_addr constant [68 x i8], align 1
@.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.6 = external hidden unnamed_addr constant [16 x i8], align 1
@.str.19 = external hidden unnamed_addr constant [15 x i8], align 1
@__func__.Mat3d_testEigenbasis = external hidden unnamed_addr constant [21 x i8], align 1
@.str.20 = external hidden unnamed_addr constant [38 x i8], align 1
@.str.21 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.22 = external hidden unnamed_addr constant [22 x i8], align 1
@.str.23 = external hidden unnamed_addr constant [54 x i8], align 1
@.str.24 = external hidden unnamed_addr constant [48 x i8], align 1
@.str.25 = external hidden unnamed_addr constant [10 x i8], align 1
@.str.26 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.27 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.28 = external hidden unnamed_addr constant [3 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: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare double @llvm.fmuladd.f64(double, double, double) #2

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

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

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

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

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

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

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

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

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

36:                                               ; preds = %4
  %37 = load i32, ptr @RcsLogLevel, align 4, !tbaa !11
  %38 = icmp sle i32 4, %37
  br i1 %38, label %39, label %97

39:                                               ; preds = %36
  br label %40

40:                                               ; preds = %39
  %41 = load ptr, ptr @stderr, align 8, !tbaa !5
  %42 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %41, ptr noundef @.str.19, ptr noundef @.str.1, ptr noundef @__func__.Mat3d_testEigenbasis, i32 noundef 1797) #5
  %43 = load ptr, ptr @stderr, align 8, !tbaa !5
  %44 = load double, ptr %11, align 8, !tbaa !9
  %45 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %43, ptr noundef @.str.20, double noundef %44) #5
  %46 = load ptr, ptr @stderr, align 8, !tbaa !5
  %47 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %46, ptr noundef @.str.3) #5
  %48 = load ptr, ptr @stderr, align 8, !tbaa !5
  %49 = call i32 @fflush(ptr noundef %48)
  br label %50

50:                                               ; preds = %40
  br label %51

51:                                               ; preds = %50
  %52 = load ptr, ptr %6, align 8, !tbaa !5
  call void @Mat3d_printCommentDigits(ptr noundef @.str.21, ptr noundef %52, i32 noundef 8)
  br label %53

53:                                               ; preds = %51
  %54 = load ptr, ptr @stderr, align 8, !tbaa !5
  %55 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %54, ptr noundef @.str.19, ptr noundef @.str.1, ptr noundef @__func__.Mat3d_testEigenbasis, i32 noundef 1799) #5
  %56 = load ptr, ptr @stderr, align 8, !tbaa !5
  %57 = load ptr, ptr %7, align 8, !tbaa !5
  %58 = getelementptr inbounds double, ptr %57, i64 0
  %59 = load double, ptr %58, align 8, !tbaa !9
  %60 = load ptr, ptr %7, align 8, !tbaa !5
  %61 = getelementptr inbounds double, ptr %60, i64 1
  %62 = load double, ptr %61, align 8, !tbaa !9
  %63 = load ptr, ptr %7, align 8, !tbaa !5
  %64 = getelementptr inbounds double, ptr %63, i64 2
  %65 = load double, ptr %64, align 8, !tbaa !9
  %66 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %56, ptr noundef @.str.22, double noundef %59, double noundef %62, double noundef %65) #5
  %67 = load ptr, ptr @stderr, align 8, !tbaa !5
  %68 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %67, ptr noundef @.str.3) #5
  %69 = load ptr, ptr @stderr, align 8, !tbaa !5
  %70 = call i32 @fflush(ptr noundef %69)
  br label %71

71:                                               ; preds = %53
  br label %72

72:                                               ; preds = %71
  br label %73

73:                                               ; preds = %72
  %74 = load ptr, ptr @stderr, align 8, !tbaa !5
  %75 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %74, ptr noundef @.str.19, ptr noundef @.str.1, ptr noundef @__func__.Mat3d_testEigenbasis, i32 noundef 1801) #5
  %76 = load ptr, ptr @stderr, align 8, !tbaa !5
  %77 = load double, ptr %10, align 8, !tbaa !9
  %78 = load ptr, ptr %7, align 8, !tbaa !5
  %79 = getelementptr inbounds double, ptr %78, i64 0
  %80 = load double, ptr %79, align 8, !tbaa !9
  %81 = load ptr, ptr %7, align 8, !tbaa !5
  %82 = getelementptr inbounds double, ptr %81, i64 1
  %83 = load double, ptr %82, align 8, !tbaa !9
  %84 = fmul double %80, %83
  %85 = load ptr, ptr %7, align 8, !tbaa !5
  %86 = getelementptr inbounds double, ptr %85, i64 2
  %87 = load double, ptr %86, align 8, !tbaa !9
  %88 = fmul double %84, %87
  %89 = load double, ptr %11, align 8, !tbaa !9
  %90 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %76, ptr noundef @.str.23, double noundef %77, double noundef %88, double noundef %89) #5
  %91 = load ptr, ptr @stderr, align 8, !tbaa !5
  %92 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %91, ptr noundef @.str.3) #5
  %93 = load ptr, ptr @stderr, align 8, !tbaa !5
  %94 = call i32 @fflush(ptr noundef %93)
  br label %95

95:                                               ; preds = %73
  br label %96

96:                                               ; preds = %95
  br label %97

97:                                               ; preds = %96, %36
  store i1 false, ptr %5, align 1
  store i32 1, ptr %12, align 4
  br label %203

98:                                               ; preds = %4
  call void @llvm.lifetime.start.p0(i64 72, ptr %13) #5
  %99 = getelementptr inbounds [3 x [3 x double]], ptr %13, i64 0, i64 0
  %100 = load ptr, ptr %8, align 8, !tbaa !5
  call void @Mat3d_transpose(ptr noundef %99, ptr noundef %100)
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #5
  store i32 0, ptr %14, align 4, !tbaa !11
  br label %101

101:                                              ; preds = %194, %98
  %102 = load i32, ptr %14, align 4, !tbaa !11
  %103 = icmp ult i32 %102, 3
  br i1 %103, label %105, label %104

104:                                              ; preds = %101
  store i32 8, ptr %12, align 4
  br label %197

105:                                              ; preds = %101
  call void @llvm.lifetime.start.p0(i64 24, ptr %15) #5
  call void @llvm.lifetime.start.p0(i64 24, ptr %16) #5
  %106 = getelementptr inbounds [3 x double], ptr %15, i64 0, i64 0
  %107 = load ptr, ptr %6, align 8, !tbaa !5
  %108 = load i32, ptr %14, align 4, !tbaa !11
  %109 = zext i32 %108 to i64
  %110 = getelementptr inbounds [3 x [3 x double]], ptr %13, i64 0, i64 %109
  %111 = getelementptr inbounds [3 x double], ptr %110, i64 0, i64 0
  call void @Vec3d_rotate(ptr noundef %106, ptr noundef %107, ptr noundef %111)
  %112 = getelementptr inbounds [3 x double], ptr %16, i64 0, i64 0
  %113 = load i32, ptr %14, align 4, !tbaa !11
  %114 = zext i32 %113 to i64
  %115 = getelementptr inbounds [3 x [3 x double]], ptr %13, i64 0, i64 %114
  %116 = getelementptr inbounds [3 x double], ptr %115, i64 0, i64 0
  %117 = load ptr, ptr %7, align 8, !tbaa !5
  %118 = load i32, ptr %14, align 4, !tbaa !11
  %119 = zext i32 %118 to i64
  %120 = getelementptr inbounds double, ptr %117, i64 %119
  %121 = load double, ptr %120, align 8, !tbaa !9
  call void @Vec3d_constMul(ptr noundef %112, ptr noundef %116, double noundef %121)
  %122 = getelementptr inbounds [3 x double], ptr %15, i64 0, i64 0
  %123 = getelementptr inbounds [3 x double], ptr %16, i64 0, i64 0
  call void @Vec3d_subSelf(ptr noundef %122, ptr noundef %123)
  %124 = getelementptr inbounds [3 x double], ptr %15, i64 0, i64 0
  %125 = call double @Vec3d_getLength(ptr noundef %124)
  %126 = load double, ptr %9, align 8, !tbaa !9
  %127 = fcmp ogt double %125, %126
  br i1 %127, label %128, label %190

128:                                              ; preds = %105
  %129 = load i32, ptr @RcsLogLevel, align 4, !tbaa !11
  %130 = icmp sle i32 4, %129
  br i1 %130, label %131, label %189

131:                                              ; preds = %128
  br label %132

132:                                              ; preds = %131
  %133 = load ptr, ptr @RCS_GLOBAL_RLOG_CB, align 8, !tbaa !5
  %134 = icmp ne ptr %133, null
  br i1 %134, label %135, label %140

135:                                              ; preds = %132
  %136 = load ptr, ptr @RCS_GLOBAL_RLOG_CB, align 8, !tbaa !5
  %137 = getelementptr inbounds [3 x double], ptr %15, i64 0, i64 0
  %138 = call double @Vec3d_getLength(ptr noundef %137)
  %139 = load double, ptr %9, align 8, !tbaa !9
  call void (i32, ptr, ptr, i32, ptr, ...) %136(i32 noundef 4, ptr noundef @.str.1, ptr noundef @__func__.Mat3d_testEigenbasis, i32 noundef 1821, ptr noundef @.str.24, double noundef %138, double noundef %139)
  br label %140

140:                                              ; preds = %135, %132
  %141 = load i32, ptr @RcsLogLevel, align 4, !tbaa !11
  %142 = icmp sle i32 4, %141
  br i1 %142, label %143, label %153

143:                                              ; preds = %140
  %144 = load ptr, ptr @stderr, align 8, !tbaa !5
  %145 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %144, ptr noundef @.str.6, ptr noundef @.str.1, ptr noundef @__func__.Mat3d_testEigenbasis, i32 noundef 1821) #5
  %146 = load ptr, ptr @stderr, align 8, !tbaa !5
  %147 = getelementptr inbounds [3 x double], ptr %15, i64 0, i64 0
  %148 = call double @Vec3d_getLength(ptr noundef %147)
  %149 = load double, ptr %9, align 8, !tbaa !9
  %150 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %146, ptr noundef @.str.24, double noundef %148, double noundef %149) #5
  %151 = load ptr, ptr @stderr, align 8, !tbaa !5
  %152 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %151, ptr noundef @.str.3) #5
  br label %153

153:                                              ; preds = %143, %140
  br label %154

154:                                              ; preds = %153
  br label %155

155:                                              ; preds = %154
  br label %156

156:                                              ; preds = %155
  %157 = load ptr, ptr @RCS_GLOBAL_RLOG_CB, align 8, !tbaa !5
  %158 = icmp ne ptr %157, null
  br i1 %158, label %159, label %166

159:                                              ; preds = %156
  %160 = load ptr, ptr @RCS_GLOBAL_RLOG_CB, align 8, !tbaa !5
  %161 = load ptr, ptr %7, align 8, !tbaa !5
  %162 = load i32, ptr %14, align 4, !tbaa !11
  %163 = zext i32 %162 to i64
  %164 = getelementptr inbounds double, ptr %161, i64 %163
  %165 = load double, ptr %164, align 8, !tbaa !9
  call void (i32, ptr, ptr, i32, ptr, ...) %160(i32 noundef 4, ptr noundef @.str.1, ptr noundef @__func__.Mat3d_testEigenbasis, i32 noundef 1822, ptr noundef @.str.25, double noundef %165)
  br label %166

166:                                              ; preds = %159, %156
  %167 = load i32, ptr @RcsLogLevel, align 4, !tbaa !11
  %168 = icmp sle i32 4, %167
  br i1 %168, label %169, label %181

169:                                              ; preds = %166
  %170 = load ptr, ptr @stderr, align 8, !tbaa !5
  %171 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %170, ptr noundef @.str.6, ptr noundef @.str.1, ptr noundef @__func__.Mat3d_testEigenbasis, i32 noundef 1822) #5
  %172 = load ptr, ptr @stderr, align 8, !tbaa !5
  %173 = load ptr, ptr %7, align 8, !tbaa !5
  %174 = load i32, ptr %14, align 4, !tbaa !11
  %175 = zext i32 %174 to i64
  %176 = getelementptr inbounds double, ptr %173, i64 %175
  %177 = load double, ptr %176, align 8, !tbaa !9
  %178 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %172, ptr noundef @.str.25, double noundef %177) #5
  %179 = load ptr, ptr @stderr, align 8, !tbaa !5
  %180 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %179, ptr noundef @.str.3) #5
  br label %181

181:                                              ; preds = %169, %166
  br label %182

182:                                              ; preds = %181
  br label %183

183:                                              ; preds = %182
  %184 = load ptr, ptr %6, align 8, !tbaa !5
  call void @Mat3d_printFormatted(ptr noundef @.str.21, ptr noundef @.str.26, ptr noundef %184)
  %185 = load i32, ptr %14, align 4, !tbaa !11
  %186 = zext i32 %185 to i64
  %187 = getelementptr inbounds [3 x [3 x double]], ptr %13, i64 0, i64 %186
  %188 = getelementptr inbounds [3 x double], ptr %187, i64 0, i64 0
  call void @Vec3d_printFormatted(ptr noundef @.str.27, ptr noundef @.str.28, ptr noundef %188)
  br label %189

189:                                              ; preds = %183, %128
  store i1 false, ptr %5, align 1
  store i32 1, ptr %12, align 4
  br label %191

190:                                              ; preds = %105
  store i32 0, ptr %12, align 4
  br label %191

191:                                              ; preds = %190, %189
  call void @llvm.lifetime.end.p0(i64 24, ptr %16) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr %15) #5
  %192 = load i32, ptr %12, align 4
  switch i32 %192, label %197 [
    i32 0, label %193
  ]

193:                                              ; preds = %191
  br label %194

194:                                              ; preds = %193
  %195 = load i32, ptr %14, align 4, !tbaa !11
  %196 = add i32 %195, 1
  store i32 %196, ptr %14, align 4, !tbaa !11
  br label %101, !llvm.loop !13

197:                                              ; preds = %191, %104
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #5
  %198 = load i32, ptr %12, align 4
  switch i32 %198, label %202 [
    i32 8, label %199
  ]

199:                                              ; preds = %197
  %200 = load ptr, ptr %8, align 8, !tbaa !5
  %201 = call zeroext i1 @Mat3d_isValid(ptr noundef %200)
  store i1 %201, ptr %5, align 1
  store i32 1, ptr %12, align 4
  br label %202

202:                                              ; preds = %199, %197
  call void @llvm.lifetime.end.p0(i64 72, ptr %13) #5
  br label %203

203:                                              ; preds = %202, %97
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #5
  %204 = load i1, ptr %5, align 1
  ret i1 %204
}

declare i32 @fflush(ptr noundef) #4

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

declare double @Vec3d_getLength(ptr noundef) #4

declare void @Vec3d_printFormatted(ptr noundef, 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 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #3 = { 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 #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.1 = external hidden unnamed_addr constant [68 x i8], align 1
@.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.6 = external hidden unnamed_addr constant [16 x i8], align 1
@.str.19 = external hidden unnamed_addr constant [15 x i8], align 1
@__func__.Mat3d_testEigenbasis = external hidden unnamed_addr constant [21 x i8], align 1
@.str.20 = external hidden unnamed_addr constant [38 x i8], align 1
@.str.21 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.22 = external hidden unnamed_addr constant [22 x i8], align 1
@.str.23 = external hidden unnamed_addr constant [54 x i8], align 1
@.str.24 = external hidden unnamed_addr constant [48 x i8], align 1
@.str.25 = external hidden unnamed_addr constant [10 x i8], align 1
@.str.26 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.27 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.28 = external hidden unnamed_addr constant [3 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: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare double @llvm.fmuladd.f64(double, double, double) #2

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

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

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

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

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

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

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

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

; Function Attrs: nounwind uwtable
define dso_local zeroext i1 @Mat3d_testEigenbasis(ptr noundef %0, ptr nocapture noundef readonly %1, ptr noundef %2, double noundef %3) local_unnamed_addr #3 {
  %5 = alloca [3 x [3 x double]], align 16
  %6 = alloca [3 x double], align 16
  %7 = alloca [3 x double], align 16
  %8 = tail call double @Mat3d_determinant(ptr noundef %0)
  %9 = load double, ptr %1, align 8, !tbaa !5
  %10 = getelementptr inbounds i8, ptr %1, i64 8
  %11 = load double, ptr %10, align 8, !tbaa !5
  %12 = fmul double %9, %11
  %13 = getelementptr inbounds i8, ptr %1, i64 16
  %14 = load double, ptr %13, align 8, !tbaa !5
  %15 = fneg double %8
  %16 = tail call double @llvm.fmuladd.f64(double %12, double %14, double %15)
  %17 = tail call double @llvm.fabs.f64(double %16)
  %18 = fcmp ogt double %17, %3
  br i1 %18, label %19, label %55

19:                                               ; preds = %4
  %20 = load i32, ptr @RcsLogLevel, align 4, !tbaa !9
  %21 = icmp sgt i32 %20, 3
  br i1 %21, label %22, label %104

22:                                               ; preds = %19
  %23 = load ptr, ptr @stderr, align 8, !tbaa !11
  %24 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %23, ptr noundef nonnull @.str.19, ptr noundef nonnull @.str.1, ptr noundef nonnull @__func__.Mat3d_testEigenbasis, i32 noundef 1797) #5
  %25 = load ptr, ptr @stderr, align 8, !tbaa !11
  %26 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %25, ptr noundef nonnull @.str.20, double noundef %17) #5
  %27 = load ptr, ptr @stderr, align 8, !tbaa !11
  %28 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %27, ptr noundef nonnull @.str.3) #5
  %29 = load ptr, ptr @stderr, align 8, !tbaa !11
  %30 = tail call i32 @fflush(ptr noundef %29)
  tail call void @Mat3d_printCommentDigits(ptr noundef nonnull @.str.21, ptr noundef %0, i32 noundef 8)
  %31 = load ptr, ptr @stderr, align 8, !tbaa !11
  %32 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %31, ptr noundef nonnull @.str.19, ptr noundef nonnull @.str.1, ptr noundef nonnull @__func__.Mat3d_testEigenbasis, i32 noundef 1799) #5
  %33 = load ptr, ptr @stderr, align 8, !tbaa !11
  %34 = load double, ptr %1, align 8, !tbaa !5
  %35 = load double, ptr %10, align 8, !tbaa !5
  %36 = load double, ptr %13, align 8, !tbaa !5
  %37 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %33, ptr noundef nonnull @.str.22, double noundef %34, double noundef %35, double noundef %36) #5
  %38 = load ptr, ptr @stderr, align 8, !tbaa !11
  %39 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %38, ptr noundef nonnull @.str.3) #5
  %40 = load ptr, ptr @stderr, align 8, !tbaa !11
  %41 = tail call i32 @fflush(ptr noundef %40)
  %42 = load ptr, ptr @stderr, align 8, !tbaa !11
  %43 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %42, ptr noundef nonnull @.str.19, ptr noundef nonnull @.str.1, ptr noundef nonnull @__func__.Mat3d_testEigenbasis, i32 noundef 1801) #5
  %44 = load ptr, ptr @stderr, align 8, !tbaa !11
  %45 = load double, ptr %1, align 8, !tbaa !5
  %46 = load double, ptr %10, align 8, !tbaa !5
  %47 = fmul double %45, %46
  %48 = load double, ptr %13, align 8, !tbaa !5
  %49 = fmul double %47, %48
  %50 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %44, ptr noundef nonnull @.str.23, double noundef %8, double noundef %49, double noundef %17) #5
  %51 = load ptr, ptr @stderr, align 8, !tbaa !11
  %52 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %51, ptr noundef nonnull @.str.3) #5
  %53 = load ptr, ptr @stderr, align 8, !tbaa !11
  %54 = tail call i32 @fflush(ptr noundef %53)
  br label %104

55:                                               ; preds = %4
  call void @llvm.lifetime.start.p0(i64 72, ptr nonnull %5) #6
  call void @Mat3d_transpose(ptr noundef nonnull %5, ptr noundef %2)
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %6) #6
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %7) #6
  call void @Vec3d_rotate(ptr noundef nonnull %6, ptr noundef %0, ptr noundef nonnull %5) #6
  %56 = load double, ptr %1, align 8, !tbaa !5
  call void @Vec3d_constMul(ptr noundef nonnull %7, ptr noundef nonnull %5, double noundef %56) #6
  call void @Vec3d_subSelf(ptr noundef nonnull %6, ptr noundef nonnull %7) #6
  %57 = call double @Vec3d_getLength(ptr noundef nonnull %6) #6
  %58 = fcmp ule double %57, %3
  br i1 %58, label %91, label %59

59:                                               ; preds = %96, %91, %55
  %.lcssa52 = phi i64 [ 0, %55 ], [ 1, %91 ], [ 2, %96 ]
  %.lcssa = phi ptr [ %5, %55 ], [ %92, %91 ], [ %97, %96 ]
  %60 = getelementptr inbounds double, ptr %1, i64 %.lcssa52
  %61 = load i32, ptr @RcsLogLevel, align 4, !tbaa !9
  %62 = icmp sgt i32 %61, 3
  br i1 %62, label %63, label %102

63:                                               ; preds = %59
  %64 = load ptr, ptr @RCS_GLOBAL_RLOG_CB, align 8, !tbaa !11
  %.not = icmp eq ptr %64, null
  br i1 %.not, label %.thread, label %65

65:                                               ; preds = %63
  %66 = call double @Vec3d_getLength(ptr noundef nonnull %6) #6
  call void (i32, ptr, ptr, i32, ptr, ...) %64(i32 noundef 4, ptr noundef nonnull @.str.1, ptr noundef nonnull @__func__.Mat3d_testEigenbasis, i32 noundef 1821, ptr noundef nonnull @.str.24, double noundef %66, double noundef %3) #6
  %.pr = load i32, ptr @RcsLogLevel, align 4, !tbaa !9
  %67 = icmp sgt i32 %.pr, 3
  br i1 %67, label %.thread, label %75

.thread:                                          ; preds = %63, %65
  %68 = load ptr, ptr @stderr, align 8, !tbaa !11
  %69 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %68, ptr noundef nonnull @.str.6, ptr noundef nonnull @.str.1, ptr noundef nonnull @__func__.Mat3d_testEigenbasis, i32 noundef 1821) #5
  %70 = load ptr, ptr @stderr, align 8, !tbaa !11
  %71 = call double @Vec3d_getLength(ptr noundef nonnull %6) #6
  %72 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %70, ptr noundef nonnull @.str.24, double noundef %71, double noundef %3) #5
  %73 = load ptr, ptr @stderr, align 8, !tbaa !11
  %74 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %73, ptr noundef nonnull @.str.3) #5
  br label %75

75:                                               ; preds = %65, %.thread
  %76 = load ptr, ptr @RCS_GLOBAL_RLOG_CB, align 8, !tbaa !11
  %.not45 = icmp eq ptr %76, null
  br i1 %.not45, label %79, label %77

77:                                               ; preds = %75
  %78 = load double, ptr %60, align 8, !tbaa !5
  call void (i32, ptr, ptr, i32, ptr, ...) %76(i32 noundef 4, ptr noundef nonnull @.str.1, ptr noundef nonnull @__func__.Mat3d_testEigenbasis, i32 noundef 1822, ptr noundef nonnull @.str.25, double noundef %78) #6
  br label %79

79:                                               ; preds = %77, %75
  %80 = load i32, ptr @RcsLogLevel, align 4, !tbaa !9
  %81 = icmp sgt i32 %80, 3
  br i1 %81, label %82, label %90

82:                                               ; preds = %79
  %83 = load ptr, ptr @stderr, align 8, !tbaa !11
  %84 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %83, ptr noundef nonnull @.str.6, ptr noundef nonnull @.str.1, ptr noundef nonnull @__func__.Mat3d_testEigenbasis, i32 noundef 1822) #5
  %85 = load ptr, ptr @stderr, align 8, !tbaa !11
  %86 = load double, ptr %60, align 8, !tbaa !5
  %87 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %85, ptr noundef nonnull @.str.25, double noundef %86) #5
  %88 = load ptr, ptr @stderr, align 8, !tbaa !11
  %89 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %88, ptr noundef nonnull @.str.3) #5
  br label %90

90:                                               ; preds = %82, %79
  call void @Mat3d_printFormatted(ptr noundef nonnull @.str.21, ptr noundef nonnull @.str.26, ptr noundef %0)
  call void @Vec3d_printFormatted(ptr noundef nonnull @.str.27, ptr noundef nonnull @.str.28, ptr noundef nonnull %.lcssa) #6
  br label %102

91:                                               ; preds = %55
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %7) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %6) #6
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %6) #6
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %7) #6
  %92 = getelementptr inbounds i8, ptr %5, i64 24
  call void @Vec3d_rotate(ptr noundef nonnull %6, ptr noundef %0, ptr noundef nonnull %92) #6
  %93 = load double, ptr %10, align 8, !tbaa !5
  call void @Vec3d_constMul(ptr noundef nonnull %7, ptr noundef nonnull %92, double noundef %93) #6
  call void @Vec3d_subSelf(ptr noundef nonnull %6, ptr noundef nonnull %7) #6
  %94 = call double @Vec3d_getLength(ptr noundef nonnull %6) #6
  %95 = fcmp ule double %94, %3
  br i1 %95, label %96, label %59

96:                                               ; preds = %91
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %7) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %6) #6
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %6) #6
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %7) #6
  %97 = getelementptr inbounds i8, ptr %5, i64 48
  call void @Vec3d_rotate(ptr noundef nonnull %6, ptr noundef %0, ptr noundef nonnull %97) #6
  %98 = load double, ptr %13, align 8, !tbaa !5
  call void @Vec3d_constMul(ptr noundef nonnull %7, ptr noundef nonnull %97, double noundef %98) #6
  call void @Vec3d_subSelf(ptr noundef nonnull %6, ptr noundef nonnull %7) #6
  %99 = call double @Vec3d_getLength(ptr noundef nonnull %6) #6
  %100 = fcmp ule double %99, %3
  br i1 %100, label %.critedge47, label %59

.critedge47:                                      ; preds = %96
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %7) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %6) #6
  %101 = call zeroext i1 @Mat3d_isValid(ptr noundef %2)
  br label %103

102:                                              ; preds = %90, %59
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %7) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %6) #6
  br label %103

103:                                              ; preds = %102, %.critedge47
  %.3 = phi i1 [ %101, %.critedge47 ], [ false, %102 ]
  call void @llvm.lifetime.end.p0(i64 72, ptr nonnull %5) #6
  br label %104

104:                                              ; preds = %19, %22, %103
  %.4 = phi i1 [ %.3, %103 ], [ false, %22 ], [ false, %19 ]
  ret i1 %.4
}

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

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

declare double @Vec3d_getLength(ptr noundef) local_unnamed_addr #4

declare void @Vec3d_printFormatted(ptr noundef, 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 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #3 = { 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 #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 = { cold nounwind }
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"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"any pointer", !7, i64 0}


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