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

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

%"class.Rcs::CmdLineParser" = type { i8 }

@RCS_GLOBAL_RLOG_CB = external global ptr, align 8
@RcsLogLevel = external global i32, align 4
@stderr = external global ptr, align 8
@.str.6 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.18 = external hidden unnamed_addr constant [1 x i8], align 1
@.str.20 = external hidden unnamed_addr constant [8 x i8], align 1
@.str.21 = external hidden unnamed_addr constant [8 x i8], align 1
@.str.22 = external hidden unnamed_addr constant [11 x i8], align 1
@.str.60 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.62 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.190 = external hidden unnamed_addr constant [8 x i8], align 1
@.str.191 = external hidden unnamed_addr constant [94 x i8], align 1
@.str.202 = external hidden unnamed_addr constant [3 x i8], align 1
@__func__.testMillerInversion = external hidden unnamed_addr constant [20 x i8], align 1
@.str.231 = external hidden unnamed_addr constant [341 x i8], align 1
@.str.232 = external hidden unnamed_addr constant [8 x i8], align 1
@.str.233 = external hidden unnamed_addr constant [68 x i8], align 1
@.str.234 = external hidden unnamed_addr constant [17 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

declare void @_ZN3Rcs13CmdLineParserC1EiPPc(ptr noundef nonnull align 1 dereferenceable(1), i32 noundef, ptr noundef) unnamed_addr #2

declare noundef zeroext i1 @_ZNK3Rcs13CmdLineParser11getArgumentEPKcPdS2_z(ptr noundef nonnull align 1 dereferenceable(1), ptr noundef, ptr noundef, ptr noundef, ...) #2

declare ptr @MatNd_create(i32 noundef, i32 noundef) #2

declare void @MatNd_setRandom(ptr noundef, double noundef, double noundef) #2

declare void @MatNd_destroy(ptr noundef) #2

declare i32 @fflush(ptr noundef) #2

declare noundef zeroext i1 @_ZNK3Rcs13CmdLineParser11getArgumentEPKcPiS2_z(ptr noundef nonnull align 1 dereferenceable(1), ptr noundef, ptr noundef, ptr noundef, ...) #2

declare double @Timer_getTime() #2

declare void @MatNd_printTwoArraysDiff(ptr noundef, ptr noundef, i32 noundef) #2

declare i32 @printf(ptr noundef, ...) #2

declare double @MatNd_rwPinv2(ptr noundef, ptr noundef, ptr noundef, ptr noundef) #2

declare double @MatNd_sqrDistance(ptr noundef, ptr noundef) #2

; Function Attrs: mustprogress uwtable
define dso_local zeroext i1 @testMillerInversion(i32 noundef %0, ptr noundef %1) #3 {
  %3 = alloca i32, align 4
  %4 = alloca ptr, align 8
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca double, align 8
  %9 = alloca double, align 8
  %10 = alloca i8, align 1
  %11 = alloca %"class.Rcs::CmdLineParser", align 1
  %12 = alloca ptr, align 8
  %13 = alloca ptr, align 8
  %14 = alloca ptr, align 8
  %15 = alloca ptr, align 8
  %16 = alloca double, align 8
  %17 = alloca ptr, align 8
  %18 = alloca double, align 8
  %19 = alloca double, align 8
  store i32 %0, ptr %3, align 4, !tbaa !5
  store ptr %1, ptr %4, align 8, !tbaa !9
  br label %20

20:                                               ; preds = %2
  %21 = load ptr, ptr @RCS_GLOBAL_RLOG_CB, align 8, !tbaa !9
  %22 = icmp ne ptr %21, null
  br i1 %22, label %23, label %25

23:                                               ; preds = %20
  %24 = load ptr, ptr @RCS_GLOBAL_RLOG_CB, align 8, !tbaa !9
  call void (i32, ptr, ptr, i32, ptr, ...) %24(i32 noundef 2, ptr noundef @.str.18, ptr noundef @__func__.testMillerInversion, i32 noundef 2270, ptr noundef @.str.231)
  br label %25

25:                                               ; preds = %23, %20
  %26 = load i32, ptr @RcsLogLevel, align 4, !tbaa !5
  %27 = icmp sle i32 2, %26
  br i1 %27, label %28, label %35

28:                                               ; preds = %25
  %29 = load ptr, ptr @stderr, align 8, !tbaa !9
  %30 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %29, ptr noundef @.str.22, ptr noundef @__func__.testMillerInversion, i32 noundef 2270) #4
  %31 = load ptr, ptr @stderr, align 8, !tbaa !9
  %32 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %31, ptr noundef @.str.231) #4
  %33 = load ptr, ptr @stderr, align 8, !tbaa !9
  %34 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %33, ptr noundef @.str.6) #4
  br label %35

35:                                               ; preds = %28, %25
  br label %36

36:                                               ; preds = %35
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #4
  store i32 4, ptr %5, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #4
  store i32 20, ptr %6, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #4
  store i32 6, ptr %7, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #4
  store double 1.000000e-08, ptr %8, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #4
  store double 1.000000e-08, ptr %9, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 1, ptr %10) #4
  store i8 1, ptr %10, align 1, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 1, ptr %11) #4
  %37 = load i32, ptr %3, align 4, !tbaa !5
  %38 = load ptr, ptr %4, align 8, !tbaa !9
  call void @_ZN3Rcs13CmdLineParserC1EiPPc(ptr noundef nonnull align 1 dereferenceable(1) %11, i32 noundef %37, ptr noundef %38)
  %39 = call noundef zeroext i1 (ptr, ptr, ptr, ptr, ...) @_ZNK3Rcs13CmdLineParser11getArgumentEPKcPiS2_z(ptr noundef nonnull align 1 dereferenceable(1) %11, ptr noundef @.str.60, ptr noundef %5, ptr noundef null)
  %40 = call noundef zeroext i1 (ptr, ptr, ptr, ptr, ...) @_ZNK3Rcs13CmdLineParser11getArgumentEPKcPiS2_z(ptr noundef nonnull align 1 dereferenceable(1) %11, ptr noundef @.str.62, ptr noundef %6, ptr noundef null)
  %41 = call noundef zeroext i1 (ptr, ptr, ptr, ptr, ...) @_ZNK3Rcs13CmdLineParser11getArgumentEPKcPiS2_z(ptr noundef nonnull align 1 dereferenceable(1) %11, ptr noundef @.str.190, ptr noundef %7, ptr noundef null)
  %42 = call noundef zeroext i1 (ptr, ptr, ptr, ptr, ...) @_ZNK3Rcs13CmdLineParser11getArgumentEPKcPdS2_z(ptr noundef nonnull align 1 dereferenceable(1) %11, ptr noundef @.str.232, ptr noundef %9, ptr noundef null)
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #4
  %43 = load i32, ptr %5, align 4, !tbaa !5
  %44 = load i32, ptr %6, align 4, !tbaa !5
  %45 = call ptr @MatNd_create(i32 noundef %43, i32 noundef %44)
  store ptr %45, ptr %12, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #4
  %46 = load i32, ptr %6, align 4, !tbaa !5
  %47 = call ptr @MatNd_create(i32 noundef %46, i32 noundef 1)
  store ptr %47, ptr %13, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #4
  %48 = load i32, ptr %5, align 4, !tbaa !5
  %49 = call ptr @MatNd_create(i32 noundef %48, i32 noundef 1)
  store ptr %49, ptr %14, align 8, !tbaa !9
  %50 = load ptr, ptr %12, align 8, !tbaa !9
  call void @MatNd_setRandom(ptr noundef %50, double noundef -1.000000e+00, double noundef 1.000000e+00)
  %51 = load ptr, ptr %13, align 8, !tbaa !9
  %52 = load double, ptr %9, align 8, !tbaa !11
  call void @MatNd_setElementsTo(ptr noundef %51, double noundef %52)
  %53 = load ptr, ptr %14, align 8, !tbaa !9
  call void @MatNd_setRandom(ptr noundef %53, double noundef 4.000000e-01, double noundef 6.000000e-01)
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #4
  %54 = load i32, ptr %6, align 4, !tbaa !5
  %55 = load i32, ptr %5, align 4, !tbaa !5
  %56 = call ptr @MatNd_create(i32 noundef %54, i32 noundef %55)
  store ptr %56, ptr %15, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #4
  %57 = call double @Timer_getTime()
  store double %57, ptr %16, align 8, !tbaa !11
  %58 = load ptr, ptr %15, align 8, !tbaa !9
  %59 = load ptr, ptr %12, align 8, !tbaa !9
  %60 = load ptr, ptr %14, align 8, !tbaa !9
  %61 = load ptr, ptr %13, align 8, !tbaa !9
  call void @MatNd_MillerPinv(ptr noundef %58, ptr noundef %59, ptr noundef %60, ptr noundef %61)
  %62 = call double @Timer_getTime()
  %63 = load double, ptr %16, align 8, !tbaa !11
  %64 = fsub double %62, %63
  store double %64, ptr %16, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #4
  %65 = load i32, ptr %6, align 4, !tbaa !5
  %66 = load i32, ptr %5, align 4, !tbaa !5
  %67 = call ptr @MatNd_create(i32 noundef %65, i32 noundef %66)
  store ptr %67, ptr %17, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #4
  %68 = call double @Timer_getTime()
  store double %68, ptr %18, align 8, !tbaa !11
  %69 = load ptr, ptr %17, align 8, !tbaa !9
  %70 = load ptr, ptr %12, align 8, !tbaa !9
  %71 = load ptr, ptr %14, align 8, !tbaa !9
  %72 = load ptr, ptr %13, align 8, !tbaa !9
  %73 = call double @MatNd_rwPinv2(ptr noundef %69, ptr noundef %70, ptr noundef %71, ptr noundef %72)
  %74 = call double @Timer_getTime()
  %75 = load double, ptr %18, align 8, !tbaa !11
  %76 = fsub double %74, %75
  store double %76, ptr %18, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #4
  %77 = load ptr, ptr %15, align 8, !tbaa !9
  %78 = load ptr, ptr %17, align 8, !tbaa !9
  %79 = call double @MatNd_sqrDistance(ptr noundef %77, ptr noundef %78)
  store double %79, ptr %19, align 8, !tbaa !11
  %80 = load i32, ptr @RcsLogLevel, align 4, !tbaa !5
  %81 = icmp sle i32 2, %80
  br i1 %81, label %82, label %111

82:                                               ; preds = %36
  br label %83

83:                                               ; preds = %82
  %84 = load ptr, ptr @stderr, align 8, !tbaa !9
  %85 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %84, ptr noundef @.str.22, ptr noundef @__func__.testMillerInversion, i32 noundef 2307) #4
  %86 = load ptr, ptr @stderr, align 8, !tbaa !9
  %87 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %86, ptr noundef @.str.191) #4
  %88 = load ptr, ptr @stderr, align 8, !tbaa !9
  %89 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %88, ptr noundef @.str.6) #4
  %90 = load ptr, ptr @stderr, align 8, !tbaa !9
  %91 = call i32 @fflush(ptr noundef %90)
  br label %92

92:                                               ; preds = %83
  br label %93

93:                                               ; preds = %92
  %94 = load ptr, ptr %15, align 8, !tbaa !9
  %95 = load ptr, ptr %17, align 8, !tbaa !9
  %96 = load i32, ptr %7, align 4, !tbaa !5
  call void @MatNd_printTwoArraysDiff(ptr noundef %94, ptr noundef %95, i32 noundef %96)
  %97 = load double, ptr %16, align 8, !tbaa !11
  %98 = fmul double 1.000000e+06, %97
  %99 = load double, ptr %18, align 8, !tbaa !11
  %100 = fmul double 1.000000e+06, %99
  %101 = call i32 (ptr, ...) @printf(ptr noundef @.str.233, double noundef %98, double noundef %100)
  %102 = load double, ptr %19, align 8, !tbaa !11
  %103 = fcmp olt double %102, 1.000000e-08
  br i1 %103, label %104, label %105

104:                                              ; preds = %93
  br label %106

105:                                              ; preds = %93
  br label %106

106:                                              ; preds = %105, %104
  %107 = phi ptr [ @.str.20, %104 ], [ @.str.21, %105 ]
  %108 = getelementptr inbounds [8 x i8], ptr %107, i64 0, i64 0
  %109 = load double, ptr %19, align 8, !tbaa !11
  %110 = call i32 (ptr, ...) @printf(ptr noundef @.str.234, ptr noundef %108, double noundef %109)
  br label %111

111:                                              ; preds = %106, %36
  %112 = load double, ptr %19, align 8, !tbaa !11
  %113 = fcmp ogt double %112, 1.000000e-08
  br i1 %113, label %114, label %115

114:                                              ; preds = %111
  store i8 0, ptr %10, align 1, !tbaa !13
  br label %115

115:                                              ; preds = %114, %111
  %116 = load ptr, ptr %12, align 8, !tbaa !9
  call void @MatNd_destroy(ptr noundef %116)
  %117 = load ptr, ptr %13, align 8, !tbaa !9
  call void @MatNd_destroy(ptr noundef %117)
  %118 = load ptr, ptr %14, align 8, !tbaa !9
  call void @MatNd_destroy(ptr noundef %118)
  %119 = load ptr, ptr %15, align 8, !tbaa !9
  call void @MatNd_destroy(ptr noundef %119)
  %120 = load ptr, ptr %17, align 8, !tbaa !9
  call void @MatNd_destroy(ptr noundef %120)
  br label %121

121:                                              ; preds = %115
  %122 = load ptr, ptr @RCS_GLOBAL_RLOG_CB, align 8, !tbaa !9
  %123 = icmp ne ptr %122, null
  br i1 %123, label %124, label %133

124:                                              ; preds = %121
  %125 = load ptr, ptr @RCS_GLOBAL_RLOG_CB, align 8, !tbaa !9
  %126 = load i8, ptr %10, align 1, !tbaa !13, !range !15, !noundef !16
  %127 = trunc i8 %126 to i1
  br i1 %127, label %128, label %129

128:                                              ; preds = %124
  br label %130

129:                                              ; preds = %124
  br label %130

130:                                              ; preds = %129, %128
  %131 = phi ptr [ @.str.20, %128 ], [ @.str.21, %129 ]
  %132 = getelementptr inbounds [8 x i8], ptr %131, i64 0, i64 0
  call void (i32, ptr, ptr, i32, ptr, ...) %125(i32 noundef 1, ptr noundef @.str.18, ptr noundef @__func__.testMillerInversion, i32 noundef 2325, ptr noundef @.str.202, ptr noundef %132)
  br label %133

133:                                              ; preds = %130, %121
  %134 = load i32, ptr @RcsLogLevel, align 4, !tbaa !5
  %135 = icmp sle i32 1, %134
  br i1 %135, label %136, label %150

136:                                              ; preds = %133
  %137 = load ptr, ptr @stderr, align 8, !tbaa !9
  %138 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %137, ptr noundef @.str.22, ptr noundef @__func__.testMillerInversion, i32 noundef 2325) #4
  %139 = load ptr, ptr @stderr, align 8, !tbaa !9
  %140 = load i8, ptr %10, align 1, !tbaa !13, !range !15, !noundef !16
  %141 = trunc i8 %140 to i1
  br i1 %141, label %142, label %143

142:                                              ; preds = %136
  br label %144

143:                                              ; preds = %136
  br label %144

144:                                              ; preds = %143, %142
  %145 = phi ptr [ @.str.20, %142 ], [ @.str.21, %143 ]
  %146 = getelementptr inbounds [8 x i8], ptr %145, i64 0, i64 0
  %147 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %139, ptr noundef @.str.202, ptr noundef %146) #4
  %148 = load ptr, ptr @stderr, align 8, !tbaa !9
  %149 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %148, ptr noundef @.str.6) #4
  br label %150

150:                                              ; preds = %144, %133
  br label %151

151:                                              ; preds = %150
  br label %152

152:                                              ; preds = %151
  %153 = load i8, ptr %10, align 1, !tbaa !13, !range !15, !noundef !16
  %154 = trunc i8 %153 to i1
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #4
  call void @llvm.lifetime.end.p0(i64 1, ptr %11) #4
  call void @llvm.lifetime.end.p0(i64 1, ptr %10) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #4
  ret i1 %154
}

declare void @MatNd_setElementsTo(ptr noundef, double noundef) #2

declare void @MatNd_MillerPinv(ptr noundef, ptr noundef, ptr noundef, ptr noundef) #2

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 = { "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 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 = { 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 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"any pointer", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"double", !7, i64 0}
!13 = !{!14, !14, i64 0}
!14 = !{!"bool", !7, i64 0}
!15 = !{i8 0, i8 2}
!16 = !{}


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

%"class.Rcs::CmdLineParser" = type { i8 }

@RCS_GLOBAL_RLOG_CB = external local_unnamed_addr global ptr, align 8
@RcsLogLevel = external local_unnamed_addr global i32, align 4
@stderr = external local_unnamed_addr global ptr, align 8
@.str.6 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.18 = external hidden unnamed_addr constant [1 x i8], align 1
@.str.20 = external hidden unnamed_addr constant [8 x i8], align 1
@.str.21 = external hidden unnamed_addr constant [8 x i8], align 1
@.str.22 = external hidden unnamed_addr constant [11 x i8], align 1
@.str.60 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.62 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.190 = external hidden unnamed_addr constant [8 x i8], align 1
@.str.191 = external hidden unnamed_addr constant [94 x i8], align 1
@.str.202 = external hidden unnamed_addr constant [3 x i8], align 1
@__func__.testMillerInversion = external hidden unnamed_addr constant [20 x i8], align 1
@.str.231 = external hidden unnamed_addr constant [341 x i8], align 1
@.str.232 = external hidden unnamed_addr constant [8 x i8], align 1
@.str.233 = external hidden unnamed_addr constant [68 x i8], align 1
@.str.234 = external hidden unnamed_addr constant [17 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

declare void @_ZN3Rcs13CmdLineParserC1EiPPc(ptr noundef nonnull align 1 dereferenceable(1), i32 noundef, ptr noundef) unnamed_addr #2

declare noundef zeroext i1 @_ZNK3Rcs13CmdLineParser11getArgumentEPKcPdS2_z(ptr noundef nonnull align 1 dereferenceable(1), ptr noundef, ptr noundef, ptr noundef, ...) local_unnamed_addr #2

declare ptr @MatNd_create(i32 noundef, i32 noundef) local_unnamed_addr #2

declare void @MatNd_setRandom(ptr noundef, double noundef, double noundef) local_unnamed_addr #2

declare void @MatNd_destroy(ptr noundef) local_unnamed_addr #2

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

declare noundef zeroext i1 @_ZNK3Rcs13CmdLineParser11getArgumentEPKcPiS2_z(ptr noundef nonnull align 1 dereferenceable(1), ptr noundef, ptr noundef, ptr noundef, ...) local_unnamed_addr #2

declare double @Timer_getTime() local_unnamed_addr #2

declare void @MatNd_printTwoArraysDiff(ptr noundef, ptr noundef, i32 noundef) local_unnamed_addr #2

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

declare double @MatNd_rwPinv2(ptr noundef, ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #2

declare double @MatNd_sqrDistance(ptr noundef, ptr noundef) local_unnamed_addr #2

; Function Attrs: mustprogress uwtable
define dso_local zeroext i1 @testMillerInversion(i32 noundef %0, ptr noundef %1) local_unnamed_addr #3 {
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca double, align 8
  %7 = alloca %"class.Rcs::CmdLineParser", align 1
  %8 = load ptr, ptr @RCS_GLOBAL_RLOG_CB, align 8, !tbaa !5
  %.not = icmp eq ptr %8, null
  br i1 %.not, label %10, label %9

9:                                                ; preds = %2
  tail call void (i32, ptr, ptr, i32, ptr, ...) %8(i32 noundef 2, ptr noundef nonnull @.str.18, ptr noundef nonnull @__func__.testMillerInversion, i32 noundef 2270, ptr noundef nonnull @.str.231)
  br label %10

10:                                               ; preds = %9, %2
  %11 = load i32, ptr @RcsLogLevel, align 4, !tbaa !9
  %12 = icmp sgt i32 %11, 1
  br i1 %12, label %13, label %20

13:                                               ; preds = %10
  %14 = load ptr, ptr @stderr, align 8, !tbaa !5
  %15 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %14, ptr noundef nonnull @.str.22, ptr noundef nonnull @__func__.testMillerInversion, i32 noundef 2270) #4
  %16 = load ptr, ptr @stderr, align 8, !tbaa !5
  %17 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %16, ptr noundef nonnull @.str.231) #4
  %18 = load ptr, ptr @stderr, align 8, !tbaa !5
  %19 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %18, ptr noundef nonnull @.str.6) #4
  br label %20

20:                                               ; preds = %10, %13
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #5
  store i32 4, ptr %3, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %4) #5
  store i32 20, ptr %4, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %5) #5
  store i32 6, ptr %5, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #5
  store double 1.000000e-08, ptr %6, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %7) #5
  call void @_ZN3Rcs13CmdLineParserC1EiPPc(ptr noundef nonnull align 1 dereferenceable(1) %7, i32 noundef %0, ptr noundef %1)
  %21 = call noundef zeroext i1 (ptr, ptr, ptr, ptr, ...) @_ZNK3Rcs13CmdLineParser11getArgumentEPKcPiS2_z(ptr noundef nonnull align 1 dereferenceable(1) %7, ptr noundef nonnull @.str.60, ptr noundef nonnull %3, ptr noundef null)
  %22 = call noundef zeroext i1 (ptr, ptr, ptr, ptr, ...) @_ZNK3Rcs13CmdLineParser11getArgumentEPKcPiS2_z(ptr noundef nonnull align 1 dereferenceable(1) %7, ptr noundef nonnull @.str.62, ptr noundef nonnull %4, ptr noundef null)
  %23 = call noundef zeroext i1 (ptr, ptr, ptr, ptr, ...) @_ZNK3Rcs13CmdLineParser11getArgumentEPKcPiS2_z(ptr noundef nonnull align 1 dereferenceable(1) %7, ptr noundef nonnull @.str.190, ptr noundef nonnull %5, ptr noundef null)
  %24 = call noundef zeroext i1 (ptr, ptr, ptr, ptr, ...) @_ZNK3Rcs13CmdLineParser11getArgumentEPKcPdS2_z(ptr noundef nonnull align 1 dereferenceable(1) %7, ptr noundef nonnull @.str.232, ptr noundef nonnull %6, ptr noundef null)
  %25 = load i32, ptr %3, align 4, !tbaa !9
  %26 = load i32, ptr %4, align 4, !tbaa !9
  %27 = call ptr @MatNd_create(i32 noundef %25, i32 noundef %26)
  %28 = load i32, ptr %4, align 4, !tbaa !9
  %29 = call ptr @MatNd_create(i32 noundef %28, i32 noundef 1)
  %30 = load i32, ptr %3, align 4, !tbaa !9
  %31 = call ptr @MatNd_create(i32 noundef %30, i32 noundef 1)
  call void @MatNd_setRandom(ptr noundef %27, double noundef -1.000000e+00, double noundef 1.000000e+00)
  %32 = load double, ptr %6, align 8, !tbaa !11
  call void @MatNd_setElementsTo(ptr noundef %29, double noundef %32)
  call void @MatNd_setRandom(ptr noundef %31, double noundef 4.000000e-01, double noundef 6.000000e-01)
  %33 = load i32, ptr %4, align 4, !tbaa !9
  %34 = load i32, ptr %3, align 4, !tbaa !9
  %35 = call ptr @MatNd_create(i32 noundef %33, i32 noundef %34)
  %36 = call double @Timer_getTime()
  call void @MatNd_MillerPinv(ptr noundef %35, ptr noundef %27, ptr noundef %31, ptr noundef %29)
  %37 = call double @Timer_getTime()
  %38 = load i32, ptr %4, align 4, !tbaa !9
  %39 = load i32, ptr %3, align 4, !tbaa !9
  %40 = call ptr @MatNd_create(i32 noundef %38, i32 noundef %39)
  %41 = call double @Timer_getTime()
  %42 = call double @MatNd_rwPinv2(ptr noundef %40, ptr noundef %27, ptr noundef %31, ptr noundef %29)
  %43 = call double @Timer_getTime()
  %44 = call double @MatNd_sqrDistance(ptr noundef %35, ptr noundef %40)
  %45 = load i32, ptr @RcsLogLevel, align 4, !tbaa !9
  %46 = icmp sgt i32 %45, 1
  br i1 %46, label %47, label %65

47:                                               ; preds = %20
  %48 = fsub double %43, %41
  %49 = fsub double %37, %36
  %50 = load ptr, ptr @stderr, align 8, !tbaa !5
  %51 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %50, ptr noundef nonnull @.str.22, ptr noundef nonnull @__func__.testMillerInversion, i32 noundef 2307) #4
  %52 = load ptr, ptr @stderr, align 8, !tbaa !5
  %53 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %52, ptr noundef nonnull @.str.191) #4
  %54 = load ptr, ptr @stderr, align 8, !tbaa !5
  %55 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %54, ptr noundef nonnull @.str.6) #4
  %56 = load ptr, ptr @stderr, align 8, !tbaa !5
  %57 = call i32 @fflush(ptr noundef %56)
  %58 = load i32, ptr %5, align 4, !tbaa !9
  call void @MatNd_printTwoArraysDiff(ptr noundef %35, ptr noundef %40, i32 noundef %58)
  %59 = fmul double %49, 1.000000e+06
  %60 = fmul double %48, 1.000000e+06
  %61 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.233, double noundef %59, double noundef %60)
  %62 = fcmp olt double %44, 1.000000e-08
  %63 = select i1 %62, ptr @.str.20, ptr @.str.21
  %64 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.234, ptr noundef nonnull %63, double noundef %44)
  br label %65

65:                                               ; preds = %47, %20
  %66 = fcmp ule double %44, 1.000000e-08
  call void @MatNd_destroy(ptr noundef %27)
  call void @MatNd_destroy(ptr noundef %29)
  call void @MatNd_destroy(ptr noundef %31)
  call void @MatNd_destroy(ptr noundef %35)
  call void @MatNd_destroy(ptr noundef %40)
  %67 = load ptr, ptr @RCS_GLOBAL_RLOG_CB, align 8, !tbaa !5
  %.not34 = icmp eq ptr %67, null
  br i1 %.not34, label %69, label %68

68:                                               ; preds = %65
  %.str.20..str.21 = select i1 %66, ptr @.str.20, ptr @.str.21
  call void (i32, ptr, ptr, i32, ptr, ...) %67(i32 noundef 1, ptr noundef nonnull @.str.18, ptr noundef nonnull @__func__.testMillerInversion, i32 noundef 2325, ptr noundef nonnull @.str.202, ptr noundef nonnull %.str.20..str.21)
  br label %69

69:                                               ; preds = %68, %65
  %70 = load i32, ptr @RcsLogLevel, align 4, !tbaa !9
  %71 = icmp sgt i32 %70, 0
  br i1 %71, label %72, label %79

72:                                               ; preds = %69
  %73 = load ptr, ptr @stderr, align 8, !tbaa !5
  %74 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %73, ptr noundef nonnull @.str.22, ptr noundef nonnull @__func__.testMillerInversion, i32 noundef 2325) #4
  %75 = load ptr, ptr @stderr, align 8, !tbaa !5
  %.str.20..str.211 = select i1 %66, ptr @.str.20, ptr @.str.21
  %76 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %75, ptr noundef nonnull @.str.202, ptr noundef nonnull %.str.20..str.211) #4
  %77 = load ptr, ptr @stderr, align 8, !tbaa !5
  %78 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %77, ptr noundef nonnull @.str.6) #4
  br label %79

79:                                               ; preds = %72, %69
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %7) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #5
  ret i1 %66
}

declare void @MatNd_setElementsTo(ptr noundef, double noundef) local_unnamed_addr #2

declare void @MatNd_MillerPinv(ptr noundef, ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #2

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 = { "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 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 = { cold nounwind }
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++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"double", !7, i64 0}


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