; 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 }
%struct._MatNd = type { ptr, i32, i32, i32, i8 }

@RCS_GLOBAL_RLOG_CB = external global ptr, align 8
@.str.3 = external hidden unnamed_addr constant [74 x i8], align 1
@RcsLogLevel = external global i32, align 4
@stderr = external global ptr, align 8
@.str.5 = external hidden unnamed_addr constant [16 x i8], align 1
@.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.57 = external hidden unnamed_addr constant [43 x i8], align 1
@.str.157 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.158 = external hidden unnamed_addr constant [7 x i8], align 1
@__func__.testCurveFitting = external hidden unnamed_addr constant [17 x i8], align 1
@.str.159 = external hidden unnamed_addr constant [12 x i8], align 1
@.str.160 = external hidden unnamed_addr constant [22 x i8], align 1
@.str.161 = external hidden unnamed_addr constant [9 x i8], align 1
@.str.162 = external hidden unnamed_addr constant [12 x i8], align 1
@.str.163 = external hidden unnamed_addr constant [134 x i8], align 1
@.str.164 = external hidden unnamed_addr constant [12 x i8], align 1
@.str.165 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.166 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.167 = external hidden unnamed_addr constant [38 x i8], align 1
@.str.168 = external hidden unnamed_addr constant [23 x i8], align 1
@.str.169 = external hidden unnamed_addr constant [43 x i8], align 1
@.str.170 = external hidden unnamed_addr constant [24 x i8], align 1
@.str.171 = external hidden unnamed_addr constant [25 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 double @MatNd_get(ptr noundef, i32 noundef, i32 noundef) #2

declare void @MatNd_destroy(ptr noundef) #2

declare i32 @fflush(ptr noundef) #2

declare void @MatNd_set(ptr noundef, i32 noundef, i32 noundef, double noundef) #2

declare zeroext i1 @MatNd_toFile(ptr noundef, ptr noundef) #2

declare i32 @system(ptr noundef) #2

declare void @print_trace() #2

; Function Attrs: noreturn nounwind
declare void @abort() #3

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

declare double @VecNd_sqrDiff(ptr noundef, ptr noundef, i32 noundef) #2

; Function Attrs: mustprogress uwtable
define dso_local zeroext i1 @testCurveFitting(i32 noundef %0, ptr noundef %1) #4 {
  %3 = alloca i32, align 4
  %4 = alloca ptr, align 8
  %5 = alloca %"class.Rcs::CmdLineParser", align 1
  %6 = alloca i8, align 1
  %7 = alloca i32, align 4
  %8 = alloca double, align 8
  %9 = alloca ptr, align 8
  %10 = alloca ptr, align 8
  %11 = alloca i32, align 4
  %12 = alloca double, align 8
  %13 = alloca double, align 8
  %14 = alloca double, align 8
  %15 = alloca double, align 8
  %16 = alloca double, align 8
  %17 = alloca double, align 8
  %18 = alloca ptr, align 8
  %19 = alloca i32, align 4
  %20 = alloca ptr, align 8
  %21 = alloca ptr, align 8
  %22 = alloca i32, align 4
  %23 = alloca double, align 8
  %24 = alloca double, align 8
  %25 = alloca double, align 8
  store i32 %0, ptr %3, align 4, !tbaa !5
  store ptr %1, ptr %4, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 1, ptr %5) #6
  %26 = load i32, ptr %3, align 4, !tbaa !5
  %27 = load ptr, ptr %4, align 8, !tbaa !9
  call void @_ZN3Rcs13CmdLineParserC1EiPPc(ptr noundef nonnull align 1 dereferenceable(1) %5, i32 noundef %26, ptr noundef %27)
  call void @llvm.lifetime.start.p0(i64 1, ptr %6) #6
  store i8 1, ptr %6, align 1, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #6
  store i32 100, ptr %7, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #6
  store double 1.000000e+00, ptr %8, align 8, !tbaa !13
  %28 = call noundef zeroext i1 (ptr, ptr, ptr, ptr, ...) @_ZNK3Rcs13CmdLineParser11getArgumentEPKcPiS2_z(ptr noundef nonnull align 1 dereferenceable(1) %5, ptr noundef @.str.157, ptr noundef %7, ptr noundef null)
  %29 = call noundef zeroext i1 (ptr, ptr, ptr, ptr, ...) @_ZNK3Rcs13CmdLineParser11getArgumentEPKcPdS2_z(ptr noundef nonnull align 1 dereferenceable(1) %5, ptr noundef @.str.158, ptr noundef %8, ptr noundef null)
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #6
  %30 = load i32, ptr %7, align 4, !tbaa !5
  %31 = call ptr @MatNd_create(i32 noundef %30, i32 noundef 1)
  store ptr %31, ptr %9, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #6
  %32 = load i32, ptr %7, align 4, !tbaa !5
  %33 = call ptr @MatNd_create(i32 noundef %32, i32 noundef 2)
  store ptr %33, ptr %10, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #6
  store i32 0, ptr %11, align 4, !tbaa !5
  br label %34

34:                                               ; preds = %62, %2
  %35 = load i32, ptr %11, align 4, !tbaa !5
  %36 = load ptr, ptr %10, align 8, !tbaa !9
  %37 = getelementptr inbounds %struct._MatNd, ptr %36, i32 0, i32 1
  %38 = load i32, ptr %37, align 8, !tbaa !15
  %39 = icmp ult i32 %35, %38
  br i1 %39, label %41, label %40

40:                                               ; preds = %34
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #6
  br label %65

41:                                               ; preds = %34
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #6
  %42 = load i32, ptr %11, align 4, !tbaa !5
  %43 = uitofp i32 %42 to double
  %44 = fdiv double %43, 2.500000e+01
  %45 = call double @sin(double noundef %44) #6
  %46 = call double @llvm.fmuladd.f64(double 1.000000e+01, double %45, double 2.000000e+01)
  store double %46, ptr %12, align 8, !tbaa !13
  %47 = load ptr, ptr %10, align 8, !tbaa !9
  %48 = load i32, ptr %11, align 4, !tbaa !5
  %49 = load i32, ptr %11, align 4, !tbaa !5
  %50 = uitofp i32 %49 to double
  call void @MatNd_set(ptr noundef %47, i32 noundef %48, i32 noundef 0, double noundef %50)
  %51 = load ptr, ptr %10, align 8, !tbaa !9
  %52 = load i32, ptr %11, align 4, !tbaa !5
  %53 = load double, ptr %12, align 8, !tbaa !13
  %54 = load double, ptr %8, align 8, !tbaa !13
  %55 = fneg double %54
  %56 = load double, ptr %8, align 8, !tbaa !13
  %57 = call double @Math_getRandomNumber(double noundef %55, double noundef %56)
  %58 = fadd double %53, %57
  call void @MatNd_set(ptr noundef %51, i32 noundef %52, i32 noundef 1, double noundef %58)
  %59 = load ptr, ptr %9, align 8, !tbaa !9
  %60 = load i32, ptr %11, align 4, !tbaa !5
  %61 = load double, ptr %12, align 8, !tbaa !13
  call void @MatNd_set(ptr noundef %59, i32 noundef %60, i32 noundef 0, double noundef %61)
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #6
  br label %62

62:                                               ; preds = %41
  %63 = load i32, ptr %11, align 4, !tbaa !5
  %64 = add i32 %63, 1
  store i32 %64, ptr %11, align 4, !tbaa !5
  br label %34, !llvm.loop !17

65:                                               ; preds = %40
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #6
  %66 = load ptr, ptr %10, align 8, !tbaa !9
  %67 = call zeroext i1 @MatNd_lineFit2D(ptr noundef %13, ptr noundef %14, ptr noundef %66)
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #6
  %68 = load ptr, ptr %10, align 8, !tbaa !9
  %69 = call zeroext i1 @MatNd_parabolicFit2D(ptr noundef %15, ptr noundef %16, ptr noundef %17, ptr noundef %68)
  br label %70

70:                                               ; preds = %65
  %71 = load ptr, ptr @RCS_GLOBAL_RLOG_CB, align 8, !tbaa !9
  %72 = icmp ne ptr %71, null
  br i1 %72, label %73, label %77

73:                                               ; preds = %70
  %74 = load ptr, ptr @RCS_GLOBAL_RLOG_CB, align 8, !tbaa !9
  %75 = load double, ptr %13, align 8, !tbaa !13
  %76 = load double, ptr %14, align 8, !tbaa !13
  call void (i32, ptr, ptr, i32, ptr, ...) %74(i32 noundef 3, ptr noundef @.str.3, ptr noundef @__func__.testCurveFitting, i32 noundef 1381, ptr noundef @.str.159, double noundef %75, double noundef %76)
  br label %77

77:                                               ; preds = %73, %70
  %78 = load i32, ptr @RcsLogLevel, align 4, !tbaa !5
  %79 = icmp sle i32 3, %78
  br i1 %79, label %80, label %89

80:                                               ; preds = %77
  %81 = load ptr, ptr @stderr, align 8, !tbaa !9
  %82 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %81, ptr noundef @.str.5, ptr noundef @.str.3, ptr noundef @__func__.testCurveFitting, i32 noundef 1381) #6
  %83 = load ptr, ptr @stderr, align 8, !tbaa !9
  %84 = load double, ptr %13, align 8, !tbaa !13
  %85 = load double, ptr %14, align 8, !tbaa !13
  %86 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %83, ptr noundef @.str.159, double noundef %84, double noundef %85) #6
  %87 = load ptr, ptr @stderr, align 8, !tbaa !9
  %88 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %87, ptr noundef @.str.6) #6
  br label %89

89:                                               ; preds = %80, %77
  br label %90

90:                                               ; preds = %89
  br label %91

91:                                               ; preds = %90
  br label %92

92:                                               ; preds = %91
  %93 = load ptr, ptr @RCS_GLOBAL_RLOG_CB, align 8, !tbaa !9
  %94 = icmp ne ptr %93, null
  br i1 %94, label %95, label %100

95:                                               ; preds = %92
  %96 = load ptr, ptr @RCS_GLOBAL_RLOG_CB, align 8, !tbaa !9
  %97 = load double, ptr %15, align 8, !tbaa !13
  %98 = load double, ptr %16, align 8, !tbaa !13
  %99 = load double, ptr %17, align 8, !tbaa !13
  call void (i32, ptr, ptr, i32, ptr, ...) %96(i32 noundef 3, ptr noundef @.str.3, ptr noundef @__func__.testCurveFitting, i32 noundef 1382, ptr noundef @.str.160, double noundef %97, double noundef %98, double noundef %99)
  br label %100

100:                                              ; preds = %95, %92
  %101 = load i32, ptr @RcsLogLevel, align 4, !tbaa !5
  %102 = icmp sle i32 3, %101
  br i1 %102, label %103, label %113

103:                                              ; preds = %100
  %104 = load ptr, ptr @stderr, align 8, !tbaa !9
  %105 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %104, ptr noundef @.str.5, ptr noundef @.str.3, ptr noundef @__func__.testCurveFitting, i32 noundef 1382) #6
  %106 = load ptr, ptr @stderr, align 8, !tbaa !9
  %107 = load double, ptr %15, align 8, !tbaa !13
  %108 = load double, ptr %16, align 8, !tbaa !13
  %109 = load double, ptr %17, align 8, !tbaa !13
  %110 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %106, ptr noundef @.str.160, double noundef %107, double noundef %108, double noundef %109) #6
  %111 = load ptr, ptr @stderr, align 8, !tbaa !9
  %112 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %111, ptr noundef @.str.6) #6
  br label %113

113:                                              ; preds = %103, %100
  br label %114

114:                                              ; preds = %113
  br label %115

115:                                              ; preds = %114
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #6
  %116 = load i32, ptr %7, align 4, !tbaa !5
  %117 = call ptr @MatNd_create(i32 noundef %116, i32 noundef 4)
  store ptr %117, ptr %18, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #6
  store i32 0, ptr %19, align 4, !tbaa !5
  br label %118

118:                                              ; preds = %156, %115
  %119 = load i32, ptr %19, align 4, !tbaa !5
  %120 = load i32, ptr %7, align 4, !tbaa !5
  %121 = icmp slt i32 %119, %120
  br i1 %121, label %123, label %122

122:                                              ; preds = %118
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #6
  br label %159

123:                                              ; preds = %118
  %124 = load ptr, ptr %18, align 8, !tbaa !9
  %125 = load i32, ptr %19, align 4, !tbaa !5
  %126 = load ptr, ptr %10, align 8, !tbaa !9
  %127 = load i32, ptr %19, align 4, !tbaa !5
  %128 = call double @MatNd_get(ptr noundef %126, i32 noundef %127, i32 noundef 0)
  call void @MatNd_set(ptr noundef %124, i32 noundef %125, i32 noundef 0, double noundef %128)
  %129 = load ptr, ptr %18, align 8, !tbaa !9
  %130 = load i32, ptr %19, align 4, !tbaa !5
  %131 = load ptr, ptr %10, align 8, !tbaa !9
  %132 = load i32, ptr %19, align 4, !tbaa !5
  %133 = call double @MatNd_get(ptr noundef %131, i32 noundef %132, i32 noundef 1)
  call void @MatNd_set(ptr noundef %129, i32 noundef %130, i32 noundef 1, double noundef %133)
  %134 = load ptr, ptr %18, align 8, !tbaa !9
  %135 = load i32, ptr %19, align 4, !tbaa !5
  %136 = load double, ptr %13, align 8, !tbaa !13
  %137 = load i32, ptr %19, align 4, !tbaa !5
  %138 = sitofp i32 %137 to double
  %139 = load double, ptr %14, align 8, !tbaa !13
  %140 = call double @llvm.fmuladd.f64(double %136, double %138, double %139)
  call void @MatNd_set(ptr noundef %134, i32 noundef %135, i32 noundef 2, double noundef %140)
  %141 = load ptr, ptr %18, align 8, !tbaa !9
  %142 = load i32, ptr %19, align 4, !tbaa !5
  %143 = load double, ptr %15, align 8, !tbaa !13
  %144 = load i32, ptr %19, align 4, !tbaa !5
  %145 = sitofp i32 %144 to double
  %146 = fmul double %143, %145
  %147 = load i32, ptr %19, align 4, !tbaa !5
  %148 = sitofp i32 %147 to double
  %149 = load double, ptr %16, align 8, !tbaa !13
  %150 = load i32, ptr %19, align 4, !tbaa !5
  %151 = sitofp i32 %150 to double
  %152 = fmul double %149, %151
  %153 = call double @llvm.fmuladd.f64(double %146, double %148, double %152)
  %154 = load double, ptr %17, align 8, !tbaa !13
  %155 = fadd double %153, %154
  call void @MatNd_set(ptr noundef %141, i32 noundef %142, i32 noundef 3, double noundef %155)
  br label %156

156:                                              ; preds = %123
  %157 = load i32, ptr %19, align 4, !tbaa !5
  %158 = add nsw i32 %157, 1
  store i32 %158, ptr %19, align 4, !tbaa !5
  br label %118, !llvm.loop !19

159:                                              ; preds = %122
  %160 = load i32, ptr @RcsLogLevel, align 4, !tbaa !5
  %161 = icmp sle i32 2, %160
  br i1 %161, label %162, label %212

162:                                              ; preds = %159
  %163 = load ptr, ptr %10, align 8, !tbaa !9
  %164 = call zeroext i1 @MatNd_toFile(ptr noundef %163, ptr noundef @.str.161)
  %165 = load ptr, ptr %18, align 8, !tbaa !9
  %166 = call zeroext i1 @MatNd_toFile(ptr noundef %165, ptr noundef @.str.162)
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #6
  store ptr @.str.163, ptr %20, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %21) #6
  %167 = call noalias ptr @fopen(ptr noundef @.str.164, ptr noundef @.str.165)
  store ptr %167, ptr %21, align 8, !tbaa !9
  br label %168

168:                                              ; preds = %162
  %169 = load ptr, ptr %21, align 8, !tbaa !9
  %170 = icmp ne ptr %169, null
  br i1 %170, label %174, label %171

171:                                              ; preds = %168
  %172 = load ptr, ptr @stderr, align 8, !tbaa !9
  %173 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %172, ptr noundef @.str.57, ptr noundef @.str.3, ptr noundef @__func__.testCurveFitting, i32 noundef 1402, ptr noundef @.str.166) #6
  call void @print_trace()
  call void @abort() #7
  unreachable

174:                                              ; preds = %168
  br label %175

175:                                              ; preds = %174
  br label %176

176:                                              ; preds = %175
  %177 = load ptr, ptr %21, align 8, !tbaa !9
  %178 = load ptr, ptr %20, align 8, !tbaa !9
  %179 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %177, ptr noundef %178) #6
  %180 = load ptr, ptr %21, align 8, !tbaa !9
  %181 = call i32 @fflush(ptr noundef %180)
  %182 = load ptr, ptr %21, align 8, !tbaa !9
  %183 = call i32 @fclose(ptr noundef %182)
  call void @llvm.lifetime.start.p0(i64 4, ptr %22) #6
  %184 = call i32 @system(ptr noundef @.str.167)
  store i32 %184, ptr %22, align 4, !tbaa !5
  %185 = load i32, ptr %22, align 4, !tbaa !5
  %186 = icmp eq i32 %185, -1
  br i1 %186, label %187, label %199

187:                                              ; preds = %176
  br label %188

188:                                              ; preds = %187
  %189 = load ptr, ptr @stderr, align 8, !tbaa !9
  %190 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %189, ptr noundef @.str.22, ptr noundef @__func__.testCurveFitting, i32 noundef 1411) #6
  %191 = load ptr, ptr @stderr, align 8, !tbaa !9
  %192 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %191, ptr noundef @.str.168) #6
  %193 = load ptr, ptr @stderr, align 8, !tbaa !9
  %194 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %193, ptr noundef @.str.6) #6
  %195 = load ptr, ptr @stderr, align 8, !tbaa !9
  %196 = call i32 @fflush(ptr noundef %195)
  br label %197

197:                                              ; preds = %188
  br label %198

198:                                              ; preds = %197
  br label %211

199:                                              ; preds = %176
  br label %200

200:                                              ; preds = %199
  %201 = load ptr, ptr @stderr, align 8, !tbaa !9
  %202 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %201, ptr noundef @.str.22, ptr noundef @__func__.testCurveFitting, i32 noundef 1415) #6
  %203 = load ptr, ptr @stderr, align 8, !tbaa !9
  %204 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %203, ptr noundef @.str.169) #6
  %205 = load ptr, ptr @stderr, align 8, !tbaa !9
  %206 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %205, ptr noundef @.str.6) #6
  %207 = load ptr, ptr @stderr, align 8, !tbaa !9
  %208 = call i32 @fflush(ptr noundef %207)
  br label %209

209:                                              ; preds = %200
  br label %210

210:                                              ; preds = %209
  br label %211

211:                                              ; preds = %210, %198
  call void @llvm.lifetime.end.p0(i64 4, ptr %22) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #6
  br label %212

212:                                              ; preds = %211, %159
  %213 = load ptr, ptr %18, align 8, !tbaa !9
  call void @MatNd_transposeSelf(ptr noundef %213)
  call void @llvm.lifetime.start.p0(i64 8, ptr %23) #6
  %214 = load ptr, ptr %9, align 8, !tbaa !9
  %215 = getelementptr inbounds %struct._MatNd, ptr %214, i32 0, i32 0
  %216 = load ptr, ptr %215, align 8, !tbaa !20
  %217 = load i32, ptr %7, align 4, !tbaa !5
  %218 = call double @VecNd_sqrLength(ptr noundef %216, i32 noundef %217)
  store double %218, ptr %23, align 8, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 8, ptr %24) #6
  %219 = load ptr, ptr %18, align 8, !tbaa !9
  %220 = call ptr @MatNd_getRowPtr(ptr noundef %219, i32 noundef 2)
  %221 = load ptr, ptr %9, align 8, !tbaa !9
  %222 = getelementptr inbounds %struct._MatNd, ptr %221, i32 0, i32 0
  %223 = load ptr, ptr %222, align 8, !tbaa !20
  %224 = load i32, ptr %7, align 4, !tbaa !5
  %225 = call double @VecNd_sqrDiff(ptr noundef %220, ptr noundef %223, i32 noundef %224)
  store double %225, ptr %24, align 8, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 8, ptr %25) #6
  %226 = load ptr, ptr %18, align 8, !tbaa !9
  %227 = call ptr @MatNd_getRowPtr(ptr noundef %226, i32 noundef 3)
  %228 = load ptr, ptr %9, align 8, !tbaa !9
  %229 = getelementptr inbounds %struct._MatNd, ptr %228, i32 0, i32 0
  %230 = load ptr, ptr %229, align 8, !tbaa !20
  %231 = load i32, ptr %7, align 4, !tbaa !5
  %232 = call double @VecNd_sqrDiff(ptr noundef %227, ptr noundef %230, i32 noundef %231)
  store double %232, ptr %25, align 8, !tbaa !13
  %233 = load double, ptr %25, align 8, !tbaa !13
  %234 = load double, ptr %24, align 8, !tbaa !13
  %235 = fcmp oge double %233, %234
  br i1 %235, label %240, label %236

236:                                              ; preds = %212
  %237 = load double, ptr %24, align 8, !tbaa !13
  %238 = load double, ptr %23, align 8, !tbaa !13
  %239 = fcmp oge double %237, %238
  br i1 %239, label %240, label %265

240:                                              ; preds = %236, %212
  br label %241

241:                                              ; preds = %240
  %242 = load ptr, ptr @RCS_GLOBAL_RLOG_CB, align 8, !tbaa !9
  %243 = icmp ne ptr %242, null
  br i1 %243, label %244, label %249

244:                                              ; preds = %241
  %245 = load ptr, ptr @RCS_GLOBAL_RLOG_CB, align 8, !tbaa !9
  %246 = load double, ptr %23, align 8, !tbaa !13
  %247 = load double, ptr %24, align 8, !tbaa !13
  %248 = load double, ptr %25, align 8, !tbaa !13
  call void (i32, ptr, ptr, i32, ptr, ...) %245(i32 noundef 1, ptr noundef @.str.3, ptr noundef @__func__.testCurveFitting, i32 noundef 1426, ptr noundef @.str.170, double noundef %246, double noundef %247, double noundef %248)
  br label %249

249:                                              ; preds = %244, %241
  %250 = load i32, ptr @RcsLogLevel, align 4, !tbaa !5
  %251 = icmp sle i32 1, %250
  br i1 %251, label %252, label %262

252:                                              ; preds = %249
  %253 = load ptr, ptr @stderr, align 8, !tbaa !9
  %254 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %253, ptr noundef @.str.5, ptr noundef @.str.3, ptr noundef @__func__.testCurveFitting, i32 noundef 1426) #6
  %255 = load ptr, ptr @stderr, align 8, !tbaa !9
  %256 = load double, ptr %23, align 8, !tbaa !13
  %257 = load double, ptr %24, align 8, !tbaa !13
  %258 = load double, ptr %25, align 8, !tbaa !13
  %259 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %255, ptr noundef @.str.170, double noundef %256, double noundef %257, double noundef %258) #6
  %260 = load ptr, ptr @stderr, align 8, !tbaa !9
  %261 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %260, ptr noundef @.str.6) #6
  br label %262

262:                                              ; preds = %252, %249
  br label %263

263:                                              ; preds = %262
  br label %264

264:                                              ; preds = %263
  store i8 0, ptr %6, align 1, !tbaa !11
  br label %265

265:                                              ; preds = %264, %236
  %266 = load ptr, ptr %10, align 8, !tbaa !9
  call void @MatNd_destroy(ptr noundef %266)
  %267 = load ptr, ptr %9, align 8, !tbaa !9
  call void @MatNd_destroy(ptr noundef %267)
  %268 = load ptr, ptr %18, align 8, !tbaa !9
  call void @MatNd_destroy(ptr noundef %268)
  br label %269

269:                                              ; preds = %265
  %270 = load ptr, ptr @RCS_GLOBAL_RLOG_CB, align 8, !tbaa !9
  %271 = icmp ne ptr %270, null
  br i1 %271, label %272, label %281

272:                                              ; preds = %269
  %273 = load ptr, ptr @RCS_GLOBAL_RLOG_CB, align 8, !tbaa !9
  %274 = load i8, ptr %6, align 1, !tbaa !11, !range !21, !noundef !22
  %275 = trunc i8 %274 to i1
  br i1 %275, label %276, label %277

276:                                              ; preds = %272
  br label %278

277:                                              ; preds = %272
  br label %278

278:                                              ; preds = %277, %276
  %279 = phi ptr [ @.str.20, %276 ], [ @.str.21, %277 ]
  %280 = getelementptr inbounds [8 x i8], ptr %279, i64 0, i64 0
  call void (i32, ptr, ptr, i32, ptr, ...) %273(i32 noundef 1, ptr noundef @.str.18, ptr noundef @__func__.testCurveFitting, i32 noundef 1434, ptr noundef @.str.171, ptr noundef %280)
  br label %281

281:                                              ; preds = %278, %269
  %282 = load i32, ptr @RcsLogLevel, align 4, !tbaa !5
  %283 = icmp sle i32 1, %282
  br i1 %283, label %284, label %298

284:                                              ; preds = %281
  %285 = load ptr, ptr @stderr, align 8, !tbaa !9
  %286 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %285, ptr noundef @.str.22, ptr noundef @__func__.testCurveFitting, i32 noundef 1434) #6
  %287 = load ptr, ptr @stderr, align 8, !tbaa !9
  %288 = load i8, ptr %6, align 1, !tbaa !11, !range !21, !noundef !22
  %289 = trunc i8 %288 to i1
  br i1 %289, label %290, label %291

290:                                              ; preds = %284
  br label %292

291:                                              ; preds = %284
  br label %292

292:                                              ; preds = %291, %290
  %293 = phi ptr [ @.str.20, %290 ], [ @.str.21, %291 ]
  %294 = getelementptr inbounds [8 x i8], ptr %293, i64 0, i64 0
  %295 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %287, ptr noundef @.str.171, ptr noundef %294) #6
  %296 = load ptr, ptr @stderr, align 8, !tbaa !9
  %297 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %296, ptr noundef @.str.6) #6
  br label %298

298:                                              ; preds = %292, %281
  br label %299

299:                                              ; preds = %298
  br label %300

300:                                              ; preds = %299
  %301 = load i8, ptr %6, align 1, !tbaa !11, !range !21, !noundef !22
  %302 = trunc i8 %301 to i1
  call void @llvm.lifetime.end.p0(i64 8, ptr %25) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %24) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %23) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr %6) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr %5) #6
  ret i1 %302
}

; Function Attrs: nounwind
declare double @sin(double noundef) #1

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

declare double @Math_getRandomNumber(double noundef, double noundef) #2

declare zeroext i1 @MatNd_lineFit2D(ptr noundef, ptr noundef, ptr noundef) #2

declare zeroext i1 @MatNd_parabolicFit2D(ptr noundef, ptr noundef, ptr noundef, ptr noundef) #2

declare noalias ptr @fopen(ptr noundef, ptr noundef) #2

declare i32 @fclose(ptr noundef) #2

declare void @MatNd_transposeSelf(ptr noundef) #2

declare double @VecNd_sqrLength(ptr noundef, i32 noundef) #2

declare ptr @MatNd_getRowPtr(ptr noundef, i32 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 = { noreturn 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 #4 = { 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 #5 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #6 = { nounwind }
attributes #7 = { noreturn 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 = !{!"bool", !7, i64 0}
!13 = !{!14, !14, i64 0}
!14 = !{!"double", !7, i64 0}
!15 = !{!16, !6, i64 8}
!16 = !{!"_ZTS6_MatNd", !10, i64 0, !6, i64 8, !6, i64 12, !6, i64 16, !12, i64 20}
!17 = distinct !{!17, !18}
!18 = !{!"llvm.loop.mustprogress"}
!19 = distinct !{!19, !18}
!20 = !{!16, !10, i64 0}
!21 = !{i8 0, i8 2}
!22 = !{}


; 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
@.str.3 = external hidden unnamed_addr constant [74 x i8], align 1
@RcsLogLevel = external local_unnamed_addr global i32, align 4
@stderr = external local_unnamed_addr global ptr, align 8
@.str.5 = external hidden unnamed_addr constant [16 x i8], align 1
@.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.57 = external hidden unnamed_addr constant [43 x i8], align 1
@.str.157 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.158 = external hidden unnamed_addr constant [7 x i8], align 1
@__func__.testCurveFitting = external hidden unnamed_addr constant [17 x i8], align 1
@.str.159 = external hidden unnamed_addr constant [12 x i8], align 1
@.str.160 = external hidden unnamed_addr constant [22 x i8], align 1
@.str.161 = external hidden unnamed_addr constant [9 x i8], align 1
@.str.162 = external hidden unnamed_addr constant [12 x i8], align 1
@.str.163 = external hidden unnamed_addr constant [134 x i8], align 1
@.str.164 = external hidden unnamed_addr constant [12 x i8], align 1
@.str.165 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.166 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.167 = external hidden unnamed_addr constant [38 x i8], align 1
@.str.168 = external hidden unnamed_addr constant [23 x i8], align 1
@.str.169 = external hidden unnamed_addr constant [43 x i8], align 1
@.str.170 = external hidden unnamed_addr constant [24 x i8], align 1
@.str.171 = external hidden unnamed_addr constant [25 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 double @MatNd_get(ptr noundef, i32 noundef, i32 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 void @MatNd_set(ptr noundef, i32 noundef, i32 noundef, double noundef) local_unnamed_addr #2

declare zeroext i1 @MatNd_toFile(ptr noundef, ptr noundef) local_unnamed_addr #2

; Function Attrs: nofree
declare noundef i32 @system(ptr nocapture noundef readonly) local_unnamed_addr #3

declare void @print_trace() local_unnamed_addr #2

; Function Attrs: noreturn nounwind
declare void @abort() local_unnamed_addr #4

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 @VecNd_sqrDiff(ptr noundef, ptr noundef, i32 noundef) local_unnamed_addr #2

; Function Attrs: mustprogress uwtable
define dso_local noundef zeroext i1 @testCurveFitting(i32 noundef %0, ptr noundef %1) local_unnamed_addr #5 {
  %3 = alloca %"class.Rcs::CmdLineParser", align 1
  %4 = alloca i32, align 4
  %5 = alloca double, align 8
  %6 = alloca double, align 8
  %7 = alloca double, align 8
  %8 = alloca double, align 8
  %9 = alloca double, align 8
  %10 = alloca double, align 8
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %3) #8
  call void @_ZN3Rcs13CmdLineParserC1EiPPc(ptr noundef nonnull align 1 dereferenceable(1) %3, i32 noundef %0, ptr noundef %1)
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %4) #8
  store i32 100, ptr %4, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #8
  store double 1.000000e+00, ptr %5, align 8, !tbaa !9
  %11 = call noundef zeroext i1 (ptr, ptr, ptr, ptr, ...) @_ZNK3Rcs13CmdLineParser11getArgumentEPKcPiS2_z(ptr noundef nonnull align 1 dereferenceable(1) %3, ptr noundef nonnull @.str.157, ptr noundef nonnull %4, ptr noundef null)
  %12 = call noundef zeroext i1 (ptr, ptr, ptr, ptr, ...) @_ZNK3Rcs13CmdLineParser11getArgumentEPKcPdS2_z(ptr noundef nonnull align 1 dereferenceable(1) %3, ptr noundef nonnull @.str.158, ptr noundef nonnull %5, ptr noundef null)
  %13 = load i32, ptr %4, align 4, !tbaa !5
  %14 = call ptr @MatNd_create(i32 noundef %13, i32 noundef 1)
  %15 = load i32, ptr %4, align 4, !tbaa !5
  %16 = call ptr @MatNd_create(i32 noundef %15, i32 noundef 2)
  %17 = getelementptr inbounds i8, ptr %16, i64 8
  %18 = load i32, ptr %17, align 8, !tbaa !11
  %.not82 = icmp eq i32 %18, 0
  br i1 %.not82, label %._crit_edge, label %.lr.ph

._crit_edge:                                      ; preds = %.lr.ph, %2
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %7) #8
  %19 = call zeroext i1 @MatNd_lineFit2D(ptr noundef nonnull %6, ptr noundef nonnull %7, ptr noundef nonnull %16)
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %8) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %9) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %10) #8
  %20 = call zeroext i1 @MatNd_parabolicFit2D(ptr noundef nonnull %8, ptr noundef nonnull %9, ptr noundef nonnull %10, ptr noundef nonnull %16)
  %21 = load ptr, ptr @RCS_GLOBAL_RLOG_CB, align 8, !tbaa !15
  %.not = icmp eq ptr %21, null
  br i1 %.not, label %36, label %33

.lr.ph:                                           ; preds = %2, %.lr.ph
  %.06577 = phi i32 [ %30, %.lr.ph ], [ 0, %2 ]
  %22 = uitofp i32 %.06577 to double
  %23 = fdiv double %22, 2.500000e+01
  %24 = call double @sin(double noundef %23) #8
  %25 = call double @llvm.fmuladd.f64(double %24, double 1.000000e+01, double 2.000000e+01)
  call void @MatNd_set(ptr noundef nonnull %16, i32 noundef %.06577, i32 noundef 0, double noundef %22)
  %26 = load double, ptr %5, align 8, !tbaa !9
  %27 = fneg double %26
  %28 = call double @Math_getRandomNumber(double noundef %27, double noundef %26)
  %29 = fadd double %25, %28
  call void @MatNd_set(ptr noundef nonnull %16, i32 noundef %.06577, i32 noundef 1, double noundef %29)
  call void @MatNd_set(ptr noundef %14, i32 noundef %.06577, i32 noundef 0, double noundef %25)
  %30 = add nuw i32 %.06577, 1
  %31 = load i32, ptr %17, align 8, !tbaa !11
  %32 = icmp ult i32 %30, %31
  br i1 %32, label %.lr.ph, label %._crit_edge, !llvm.loop !16

33:                                               ; preds = %._crit_edge
  %34 = load double, ptr %6, align 8, !tbaa !9
  %35 = load double, ptr %7, align 8, !tbaa !9
  call void (i32, ptr, ptr, i32, ptr, ...) %21(i32 noundef 3, ptr noundef nonnull @.str.3, ptr noundef nonnull @__func__.testCurveFitting, i32 noundef 1381, ptr noundef nonnull @.str.159, double noundef %34, double noundef %35)
  br label %36

36:                                               ; preds = %33, %._crit_edge
  %37 = load i32, ptr @RcsLogLevel, align 4, !tbaa !5
  %38 = icmp sgt i32 %37, 2
  br i1 %38, label %39, label %48

39:                                               ; preds = %36
  %40 = load ptr, ptr @stderr, align 8, !tbaa !15
  %41 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %40, ptr noundef nonnull @.str.5, ptr noundef nonnull @.str.3, ptr noundef nonnull @__func__.testCurveFitting, i32 noundef 1381) #9
  %42 = load ptr, ptr @stderr, align 8, !tbaa !15
  %43 = load double, ptr %6, align 8, !tbaa !9
  %44 = load double, ptr %7, align 8, !tbaa !9
  %45 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %42, ptr noundef nonnull @.str.159, double noundef %43, double noundef %44) #9
  %46 = load ptr, ptr @stderr, align 8, !tbaa !15
  %47 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %46, ptr noundef nonnull @.str.6) #9
  br label %48

48:                                               ; preds = %36, %39
  %49 = load ptr, ptr @RCS_GLOBAL_RLOG_CB, align 8, !tbaa !15
  %.not73 = icmp eq ptr %49, null
  br i1 %.not73, label %54, label %50

50:                                               ; preds = %48
  %51 = load double, ptr %8, align 8, !tbaa !9
  %52 = load double, ptr %9, align 8, !tbaa !9
  %53 = load double, ptr %10, align 8, !tbaa !9
  call void (i32, ptr, ptr, i32, ptr, ...) %49(i32 noundef 3, ptr noundef nonnull @.str.3, ptr noundef nonnull @__func__.testCurveFitting, i32 noundef 1382, ptr noundef nonnull @.str.160, double noundef %51, double noundef %52, double noundef %53)
  br label %54

54:                                               ; preds = %50, %48
  %55 = load i32, ptr @RcsLogLevel, align 4, !tbaa !5
  %56 = icmp sgt i32 %55, 2
  br i1 %56, label %57, label %67

57:                                               ; preds = %54
  %58 = load ptr, ptr @stderr, align 8, !tbaa !15
  %59 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %58, ptr noundef nonnull @.str.5, ptr noundef nonnull @.str.3, ptr noundef nonnull @__func__.testCurveFitting, i32 noundef 1382) #9
  %60 = load ptr, ptr @stderr, align 8, !tbaa !15
  %61 = load double, ptr %8, align 8, !tbaa !9
  %62 = load double, ptr %9, align 8, !tbaa !9
  %63 = load double, ptr %10, align 8, !tbaa !9
  %64 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %60, ptr noundef nonnull @.str.160, double noundef %61, double noundef %62, double noundef %63) #9
  %65 = load ptr, ptr @stderr, align 8, !tbaa !15
  %66 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %65, ptr noundef nonnull @.str.6) #9
  br label %67

67:                                               ; preds = %57, %54
  %68 = load i32, ptr %4, align 4, !tbaa !5
  %69 = call ptr @MatNd_create(i32 noundef %68, i32 noundef 4)
  %70 = load i32, ptr %4, align 4, !tbaa !5
  %71 = icmp sgt i32 %70, 0
  br i1 %71, label %.lr.ph80, label %._crit_edge81

._crit_edge81:                                    ; preds = %.lr.ph80, %67
  %72 = load i32, ptr @RcsLogLevel, align 4, !tbaa !5
  %73 = icmp sgt i32 %72, 1
  br i1 %73, label %90, label %110

.lr.ph80:                                         ; preds = %67, %.lr.ph80
  %.06678 = phi i32 [ %87, %.lr.ph80 ], [ 0, %67 ]
  %74 = call double @MatNd_get(ptr noundef %16, i32 noundef %.06678, i32 noundef 0)
  call void @MatNd_set(ptr noundef %69, i32 noundef %.06678, i32 noundef 0, double noundef %74)
  %75 = call double @MatNd_get(ptr noundef %16, i32 noundef %.06678, i32 noundef 1)
  call void @MatNd_set(ptr noundef %69, i32 noundef %.06678, i32 noundef 1, double noundef %75)
  %76 = load double, ptr %6, align 8, !tbaa !9
  %77 = uitofp nneg i32 %.06678 to double
  %78 = load double, ptr %7, align 8, !tbaa !9
  %79 = call double @llvm.fmuladd.f64(double %76, double %77, double %78)
  call void @MatNd_set(ptr noundef %69, i32 noundef %.06678, i32 noundef 2, double noundef %79)
  %80 = load double, ptr %8, align 8, !tbaa !9
  %81 = fmul double %80, %77
  %82 = load double, ptr %9, align 8, !tbaa !9
  %83 = fmul double %82, %77
  %84 = call double @llvm.fmuladd.f64(double %81, double %77, double %83)
  %85 = load double, ptr %10, align 8, !tbaa !9
  %86 = fadd double %85, %84
  call void @MatNd_set(ptr noundef %69, i32 noundef %.06678, i32 noundef 3, double noundef %86)
  %87 = add nuw nsw i32 %.06678, 1
  %88 = load i32, ptr %4, align 4, !tbaa !5
  %89 = icmp slt i32 %87, %88
  br i1 %89, label %.lr.ph80, label %._crit_edge81, !llvm.loop !18

90:                                               ; preds = %._crit_edge81
  %91 = call zeroext i1 @MatNd_toFile(ptr noundef %16, ptr noundef nonnull @.str.161)
  %92 = call zeroext i1 @MatNd_toFile(ptr noundef %69, ptr noundef nonnull @.str.162)
  %93 = call noalias ptr @fopen(ptr noundef nonnull @.str.164, ptr noundef nonnull @.str.165)
  %.not74 = icmp eq ptr %93, null
  br i1 %.not74, label %94, label %.sink.split

94:                                               ; preds = %90
  %95 = load ptr, ptr @stderr, align 8, !tbaa !15
  %96 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %95, ptr noundef nonnull @.str.57, ptr noundef nonnull @.str.3, ptr noundef nonnull @__func__.testCurveFitting, i32 noundef 1402, ptr noundef nonnull @.str.166) #9
  call void @print_trace()
  call void @abort() #10
  unreachable

.sink.split:                                      ; preds = %90
  %97 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef nonnull %93, ptr noundef nonnull @.str.163) #8
  %98 = call i32 @fflush(ptr noundef nonnull %93)
  %99 = call i32 @fclose(ptr noundef nonnull %93)
  %100 = call i32 @system(ptr noundef nonnull @.str.167)
  %101 = icmp eq i32 %100, -1
  %102 = load ptr, ptr @stderr, align 8, !tbaa !15
  %. = select i1 %101, i32 1411, i32 1415
  %.str.168..str.169 = select i1 %101, ptr @.str.168, ptr @.str.169
  %103 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %102, ptr noundef nonnull @.str.22, ptr noundef nonnull @__func__.testCurveFitting, i32 noundef %.) #9
  %104 = load ptr, ptr @stderr, align 8, !tbaa !15
  %105 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %104, ptr noundef nonnull %.str.168..str.169) #9
  %106 = load ptr, ptr @stderr, align 8, !tbaa !15
  %107 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %106, ptr noundef nonnull @.str.6) #9
  %108 = load ptr, ptr @stderr, align 8, !tbaa !15
  %109 = call i32 @fflush(ptr noundef %108)
  br label %110

110:                                              ; preds = %.sink.split, %._crit_edge81
  call void @MatNd_transposeSelf(ptr noundef %69)
  %111 = load ptr, ptr %14, align 8, !tbaa !19
  %112 = load i32, ptr %4, align 4, !tbaa !5
  %113 = call double @VecNd_sqrLength(ptr noundef %111, i32 noundef %112)
  %114 = call ptr @MatNd_getRowPtr(ptr noundef %69, i32 noundef 2)
  %115 = load ptr, ptr %14, align 8, !tbaa !19
  %116 = load i32, ptr %4, align 4, !tbaa !5
  %117 = call double @VecNd_sqrDiff(ptr noundef %114, ptr noundef %115, i32 noundef %116)
  %118 = call ptr @MatNd_getRowPtr(ptr noundef %69, i32 noundef 3)
  %119 = load ptr, ptr %14, align 8, !tbaa !19
  %120 = load i32, ptr %4, align 4, !tbaa !5
  %121 = call double @VecNd_sqrDiff(ptr noundef %118, ptr noundef %119, i32 noundef %120)
  %122 = fcmp ult double %121, %117
  %123 = fcmp ult double %117, %113
  %or.cond = select i1 %122, i1 %123, i1 false
  br i1 %or.cond, label %137, label %124

124:                                              ; preds = %110
  %125 = load ptr, ptr @RCS_GLOBAL_RLOG_CB, align 8, !tbaa !15
  %.not75 = icmp eq ptr %125, null
  br i1 %.not75, label %127, label %126

126:                                              ; preds = %124
  call void (i32, ptr, ptr, i32, ptr, ...) %125(i32 noundef 1, ptr noundef nonnull @.str.3, ptr noundef nonnull @__func__.testCurveFitting, i32 noundef 1426, ptr noundef nonnull @.str.170, double noundef %113, double noundef %117, double noundef %121)
  br label %127

127:                                              ; preds = %126, %124
  %128 = load i32, ptr @RcsLogLevel, align 4, !tbaa !5
  %129 = icmp sgt i32 %128, 0
  br i1 %129, label %130, label %137

130:                                              ; preds = %127
  %131 = load ptr, ptr @stderr, align 8, !tbaa !15
  %132 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %131, ptr noundef nonnull @.str.5, ptr noundef nonnull @.str.3, ptr noundef nonnull @__func__.testCurveFitting, i32 noundef 1426) #9
  %133 = load ptr, ptr @stderr, align 8, !tbaa !15
  %134 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %133, ptr noundef nonnull @.str.170, double noundef %113, double noundef %117, double noundef %121) #9
  %135 = load ptr, ptr @stderr, align 8, !tbaa !15
  %136 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %135, ptr noundef nonnull @.str.6) #9
  br label %137

137:                                              ; preds = %127, %130, %110
  call void @MatNd_destroy(ptr noundef %16)
  call void @MatNd_destroy(ptr noundef nonnull %14)
  call void @MatNd_destroy(ptr noundef %69)
  %138 = load ptr, ptr @RCS_GLOBAL_RLOG_CB, align 8, !tbaa !15
  %.not76 = icmp eq ptr %138, null
  br i1 %.not76, label %140, label %139

139:                                              ; preds = %137
  %.str.20..str.21 = select i1 %or.cond, ptr @.str.20, ptr @.str.21
  call void (i32, ptr, ptr, i32, ptr, ...) %138(i32 noundef 1, ptr noundef nonnull @.str.18, ptr noundef nonnull @__func__.testCurveFitting, i32 noundef 1434, ptr noundef nonnull @.str.171, ptr noundef nonnull %.str.20..str.21)
  br label %140

140:                                              ; preds = %139, %137
  %141 = load i32, ptr @RcsLogLevel, align 4, !tbaa !5
  %142 = icmp sgt i32 %141, 0
  br i1 %142, label %143, label %150

143:                                              ; preds = %140
  %144 = load ptr, ptr @stderr, align 8, !tbaa !15
  %145 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %144, ptr noundef nonnull @.str.22, ptr noundef nonnull @__func__.testCurveFitting, i32 noundef 1434) #9
  %146 = load ptr, ptr @stderr, align 8, !tbaa !15
  %.str.20..str.211 = select i1 %or.cond, ptr @.str.20, ptr @.str.21
  %147 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %146, ptr noundef nonnull @.str.171, ptr noundef nonnull %.str.20..str.211) #9
  %148 = load ptr, ptr @stderr, align 8, !tbaa !15
  %149 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %148, ptr noundef nonnull @.str.6) #9
  br label %150

150:                                              ; preds = %143, %140
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %10) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %9) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #8
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %3) #8
  ret i1 %or.cond
}

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

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

declare double @Math_getRandomNumber(double noundef, double noundef) local_unnamed_addr #2

declare zeroext i1 @MatNd_lineFit2D(ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #2

declare zeroext i1 @MatNd_parabolicFit2D(ptr noundef, ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #2

; Function Attrs: nofree nounwind
declare noalias noundef ptr @fopen(ptr nocapture noundef readonly, ptr nocapture noundef readonly) local_unnamed_addr #1

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

declare void @MatNd_transposeSelf(ptr noundef) local_unnamed_addr #2

declare double @VecNd_sqrLength(ptr noundef, i32 noundef) local_unnamed_addr #2

declare ptr @MatNd_getRowPtr(ptr noundef, i32 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 = { nofree "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 = { noreturn 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 #5 = { 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 #6 = { 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 #7 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #8 = { nounwind }
attributes #9 = { cold nounwind }
attributes #10 = { noreturn 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 = !{!"double", !7, i64 0}
!11 = !{!12, !6, i64 8}
!12 = !{!"_ZTS6_MatNd", !13, i64 0, !6, i64 8, !6, i64 12, !6, i64 16, !14, i64 20}
!13 = !{!"any pointer", !7, i64 0}
!14 = !{!"bool", !7, i64 0}
!15 = !{!13, !13, i64 0}
!16 = distinct !{!16, !17}
!17 = !{!"llvm.loop.mustprogress"}
!18 = distinct !{!18, !17}
!19 = !{!12, !13, i64 0}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LICMPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,PostOrderFunctionAttrsPass,ReassociatePass,SROAPass,SimplifyCFGPass