; LLVM IR from HRI-EU/Rcs :: external (Rcs_thirdPartyMath)

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

%struct._MatNd = type { ptr, i32, i32, i32, i8 }

@RCS_GLOBAL_RLOG_CB = external global ptr, align 8
@.str = external hidden unnamed_addr constant [74 x i8], align 1
@__func__.MatNd_parabolicFit2D = external hidden unnamed_addr constant [21 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [72 x i8], align 1
@RcsLogLevel = external global i32, align 4
@stderr = external global ptr, align 8
@.str.2 = external hidden unnamed_addr constant [16 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [43 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [13 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [22 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 speculatable willreturn memory(none)
declare double @llvm.fmuladd.f64(double, double, double) #1

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

; Function Attrs: nounwind uwtable
define dso_local zeroext i1 @MatNd_parabolicFit2D(ptr noundef %0, ptr noundef %1, ptr noundef %2, ptr noundef %3) #2 {
  %5 = alloca i1, align 1
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca ptr, align 8
  %10 = alloca i32, align 4
  %11 = alloca double, align 8
  %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 double, align 8
  %19 = alloca double, align 8
  %20 = alloca double, align 8
  %21 = alloca double, align 8
  %22 = alloca [3 x [3 x double]], align 16
  %23 = alloca [3 x [3 x double]], align 16
  %24 = alloca i32, align 4
  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 ptr %3, ptr %9, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #6
  store double 0.000000e+00, ptr %11, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #6
  store double 0.000000e+00, ptr %12, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #6
  store double 0.000000e+00, ptr %13, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #6
  store double 0.000000e+00, ptr %14, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #6
  store double 0.000000e+00, ptr %15, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #6
  store double 0.000000e+00, ptr %16, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #6
  store double 0.000000e+00, ptr %17, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %21) #6
  call void @llvm.lifetime.start.p0(i64 72, ptr %22) #6
  call void @llvm.lifetime.start.p0(i64 72, ptr %23) #6
  %25 = load ptr, ptr %9, align 8, !tbaa !5
  %26 = getelementptr inbounds %struct._MatNd, ptr %25, i32 0, i32 1
  %27 = load i32, ptr %26, align 8, !tbaa !11
  %28 = icmp ult i32 %27, 3
  br i1 %28, label %29, label %54

29:                                               ; preds = %4
  br label %30

30:                                               ; preds = %29
  %31 = load ptr, ptr @RCS_GLOBAL_RLOG_CB, align 8, !tbaa !5
  %32 = icmp ne ptr %31, null
  br i1 %32, label %33, label %38

33:                                               ; preds = %30
  %34 = load ptr, ptr @RCS_GLOBAL_RLOG_CB, align 8, !tbaa !5
  %35 = load ptr, ptr %9, align 8, !tbaa !5
  %36 = getelementptr inbounds %struct._MatNd, ptr %35, i32 0, i32 1
  %37 = load i32, ptr %36, align 8, !tbaa !11
  call void (i32, ptr, ptr, i32, ptr, ...) %34(i32 noundef 4, ptr noundef @.str, ptr noundef @__func__.MatNd_parabolicFit2D, i32 noundef 242, ptr noundef @.str.1, i32 noundef %37)
  br label %38

38:                                               ; preds = %33, %30
  %39 = load i32, ptr @RcsLogLevel, align 4, !tbaa !15
  %40 = icmp sle i32 4, %39
  br i1 %40, label %41, label %51

41:                                               ; preds = %38
  %42 = load ptr, ptr @stderr, align 8, !tbaa !5
  %43 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %42, ptr noundef @.str.2, ptr noundef @.str, ptr noundef @__func__.MatNd_parabolicFit2D, i32 noundef 242) #6
  %44 = load ptr, ptr @stderr, align 8, !tbaa !5
  %45 = load ptr, ptr %9, align 8, !tbaa !5
  %46 = getelementptr inbounds %struct._MatNd, ptr %45, i32 0, i32 1
  %47 = load i32, ptr %46, align 8, !tbaa !11
  %48 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %44, ptr noundef @.str.1, i32 noundef %47) #6
  %49 = load ptr, ptr @stderr, align 8, !tbaa !5
  %50 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %49, ptr noundef @.str.3) #6
  br label %51

51:                                               ; preds = %41, %38
  br label %52

52:                                               ; preds = %51
  br label %53

53:                                               ; preds = %52
  store i1 false, ptr %5, align 1
  store i32 1, ptr %24, align 4
  br label %214

54:                                               ; preds = %4
  br label %55

55:                                               ; preds = %54
  %56 = load ptr, ptr %9, align 8, !tbaa !5
  %57 = getelementptr inbounds %struct._MatNd, ptr %56, i32 0, i32 2
  %58 = load i32, ptr %57, align 4, !tbaa !16
  %59 = icmp eq i32 %58, 2
  br i1 %59, label %63, label %60

60:                                               ; preds = %55
  %61 = load ptr, ptr @stderr, align 8, !tbaa !5
  %62 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %61, ptr noundef @.str.4, ptr noundef @.str, ptr noundef @__func__.MatNd_parabolicFit2D, i32 noundef 246, ptr noundef @.str.5) #6
  call void @print_trace()
  call void @abort() #7
  unreachable

63:                                               ; preds = %55
  br label %64

64:                                               ; preds = %63
  br label %65

65:                                               ; preds = %64
  store i32 0, ptr %10, align 4, !tbaa !15
  br label %66

66:                                               ; preds = %107, %65
  %67 = load i32, ptr %10, align 4, !tbaa !15
  %68 = load ptr, ptr %9, align 8, !tbaa !5
  %69 = getelementptr inbounds %struct._MatNd, ptr %68, i32 0, i32 1
  %70 = load i32, ptr %69, align 8, !tbaa !11
  %71 = icmp ult i32 %67, %70
  br i1 %71, label %72, label %110

72:                                               ; preds = %66
  %73 = load ptr, ptr %9, align 8, !tbaa !5
  %74 = load i32, ptr %10, align 4, !tbaa !15
  %75 = call double @MatNd_get(ptr noundef %73, i32 noundef %74, i32 noundef 0)
  store double %75, ptr %18, align 8, !tbaa !9
  %76 = load ptr, ptr %9, align 8, !tbaa !5
  %77 = load i32, ptr %10, align 4, !tbaa !15
  %78 = call double @MatNd_get(ptr noundef %76, i32 noundef %77, i32 noundef 1)
  store double %78, ptr %20, align 8, !tbaa !9
  %79 = load double, ptr %18, align 8, !tbaa !9
  %80 = load double, ptr %18, align 8, !tbaa !9
  %81 = fmul double %79, %80
  store double %81, ptr %19, align 8, !tbaa !9
  %82 = load double, ptr %18, align 8, !tbaa !9
  %83 = load double, ptr %11, align 8, !tbaa !9
  %84 = fadd double %83, %82
  store double %84, ptr %11, align 8, !tbaa !9
  %85 = load double, ptr %19, align 8, !tbaa !9
  %86 = load double, ptr %12, align 8, !tbaa !9
  %87 = fadd double %86, %85
  store double %87, ptr %12, align 8, !tbaa !9
  %88 = load double, ptr %19, align 8, !tbaa !9
  %89 = load double, ptr %18, align 8, !tbaa !9
  %90 = load double, ptr %13, align 8, !tbaa !9
  %91 = call double @llvm.fmuladd.f64(double %88, double %89, double %90)
  store double %91, ptr %13, align 8, !tbaa !9
  %92 = load double, ptr %19, align 8, !tbaa !9
  %93 = load double, ptr %19, align 8, !tbaa !9
  %94 = load double, ptr %14, align 8, !tbaa !9
  %95 = call double @llvm.fmuladd.f64(double %92, double %93, double %94)
  store double %95, ptr %14, align 8, !tbaa !9
  %96 = load double, ptr %20, align 8, !tbaa !9
  %97 = load double, ptr %15, align 8, !tbaa !9
  %98 = fadd double %97, %96
  store double %98, ptr %15, align 8, !tbaa !9
  %99 = load double, ptr %18, align 8, !tbaa !9
  %100 = load double, ptr %20, align 8, !tbaa !9
  %101 = load double, ptr %16, align 8, !tbaa !9
  %102 = call double @llvm.fmuladd.f64(double %99, double %100, double %101)
  store double %102, ptr %16, align 8, !tbaa !9
  %103 = load double, ptr %19, align 8, !tbaa !9
  %104 = load double, ptr %20, align 8, !tbaa !9
  %105 = load double, ptr %17, align 8, !tbaa !9
  %106 = call double @llvm.fmuladd.f64(double %103, double %104, double %105)
  store double %106, ptr %17, align 8, !tbaa !9
  br label %107

107:                                              ; preds = %72
  %108 = load i32, ptr %10, align 4, !tbaa !15
  %109 = add i32 %108, 1
  store i32 %109, ptr %10, align 4, !tbaa !15
  br label %66, !llvm.loop !17

110:                                              ; preds = %66
  %111 = load double, ptr %14, align 8, !tbaa !9
  %112 = getelementptr inbounds [3 x [3 x double]], ptr %22, i64 0, i64 0
  %113 = getelementptr inbounds [3 x double], ptr %112, i64 0, i64 0
  store double %111, ptr %113, align 16, !tbaa !9
  %114 = load double, ptr %13, align 8, !tbaa !9
  %115 = getelementptr inbounds [3 x [3 x double]], ptr %22, i64 0, i64 0
  %116 = getelementptr inbounds [3 x double], ptr %115, i64 0, i64 1
  store double %114, ptr %116, align 8, !tbaa !9
  %117 = load double, ptr %12, align 8, !tbaa !9
  %118 = getelementptr inbounds [3 x [3 x double]], ptr %22, i64 0, i64 0
  %119 = getelementptr inbounds [3 x double], ptr %118, i64 0, i64 2
  store double %117, ptr %119, align 16, !tbaa !9
  %120 = load double, ptr %13, align 8, !tbaa !9
  %121 = getelementptr inbounds [3 x [3 x double]], ptr %22, i64 0, i64 1
  %122 = getelementptr inbounds [3 x double], ptr %121, i64 0, i64 0
  store double %120, ptr %122, align 8, !tbaa !9
  %123 = load double, ptr %12, align 8, !tbaa !9
  %124 = getelementptr inbounds [3 x [3 x double]], ptr %22, i64 0, i64 1
  %125 = getelementptr inbounds [3 x double], ptr %124, i64 0, i64 1
  store double %123, ptr %125, align 8, !tbaa !9
  %126 = load double, ptr %11, align 8, !tbaa !9
  %127 = getelementptr inbounds [3 x [3 x double]], ptr %22, i64 0, i64 1
  %128 = getelementptr inbounds [3 x double], ptr %127, i64 0, i64 2
  store double %126, ptr %128, align 8, !tbaa !9
  %129 = load double, ptr %12, align 8, !tbaa !9
  %130 = getelementptr inbounds [3 x [3 x double]], ptr %22, i64 0, i64 2
  %131 = getelementptr inbounds [3 x double], ptr %130, i64 0, i64 0
  store double %129, ptr %131, align 16, !tbaa !9
  %132 = load double, ptr %11, align 8, !tbaa !9
  %133 = getelementptr inbounds [3 x [3 x double]], ptr %22, i64 0, i64 2
  %134 = getelementptr inbounds [3 x double], ptr %133, i64 0, i64 1
  store double %132, ptr %134, align 8, !tbaa !9
  %135 = load ptr, ptr %9, align 8, !tbaa !5
  %136 = getelementptr inbounds %struct._MatNd, ptr %135, i32 0, i32 1
  %137 = load i32, ptr %136, align 8, !tbaa !11
  %138 = uitofp i32 %137 to double
  %139 = getelementptr inbounds [3 x [3 x double]], ptr %22, i64 0, i64 2
  %140 = getelementptr inbounds [3 x double], ptr %139, i64 0, i64 2
  store double %138, ptr %140, align 16, !tbaa !9
  %141 = getelementptr inbounds [3 x [3 x double]], ptr %23, i64 0, i64 0
  %142 = getelementptr inbounds [3 x [3 x double]], ptr %22, i64 0, i64 0
  %143 = call double @Mat3d_inverse(ptr noundef %141, ptr noundef %142)
  store double %143, ptr %21, align 8, !tbaa !9
  %144 = load double, ptr %21, align 8, !tbaa !9
  %145 = fcmp oeq double %144, 0.000000e+00
  br i1 %145, label %146, label %165

146:                                              ; preds = %110
  br label %147

147:                                              ; preds = %146
  %148 = load ptr, ptr @RCS_GLOBAL_RLOG_CB, align 8, !tbaa !5
  %149 = icmp ne ptr %148, null
  br i1 %149, label %150, label %152

150:                                              ; preds = %147
  %151 = load ptr, ptr @RCS_GLOBAL_RLOG_CB, align 8, !tbaa !5
  call void (i32, ptr, ptr, i32, ptr, ...) %151(i32 noundef 4, ptr noundef @.str, ptr noundef @__func__.MatNd_parabolicFit2D, i32 noundef 277, ptr noundef @.str.6)
  br label %152

152:                                              ; preds = %150, %147
  %153 = load i32, ptr @RcsLogLevel, align 4, !tbaa !15
  %154 = icmp sle i32 4, %153
  br i1 %154, label %155, label %162

155:                                              ; preds = %152
  %156 = load ptr, ptr @stderr, align 8, !tbaa !5
  %157 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %156, ptr noundef @.str.2, ptr noundef @.str, ptr noundef @__func__.MatNd_parabolicFit2D, i32 noundef 277) #6
  %158 = load ptr, ptr @stderr, align 8, !tbaa !5
  %159 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %158, ptr noundef @.str.6) #6
  %160 = load ptr, ptr @stderr, align 8, !tbaa !5
  %161 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %160, ptr noundef @.str.3) #6
  br label %162

162:                                              ; preds = %155, %152
  br label %163

163:                                              ; preds = %162
  br label %164

164:                                              ; preds = %163
  store i1 false, ptr %5, align 1
  store i32 1, ptr %24, align 4
  br label %214

165:                                              ; preds = %110
  %166 = getelementptr inbounds [3 x [3 x double]], ptr %23, i64 0, i64 0
  %167 = getelementptr inbounds [3 x double], ptr %166, i64 0, i64 0
  %168 = load double, ptr %167, align 16, !tbaa !9
  %169 = load double, ptr %17, align 8, !tbaa !9
  %170 = getelementptr inbounds [3 x [3 x double]], ptr %23, i64 0, i64 0
  %171 = getelementptr inbounds [3 x double], ptr %170, i64 0, i64 1
  %172 = load double, ptr %171, align 8, !tbaa !9
  %173 = load double, ptr %16, align 8, !tbaa !9
  %174 = fmul double %172, %173
  %175 = call double @llvm.fmuladd.f64(double %168, double %169, double %174)
  %176 = getelementptr inbounds [3 x [3 x double]], ptr %23, i64 0, i64 0
  %177 = getelementptr inbounds [3 x double], ptr %176, i64 0, i64 2
  %178 = load double, ptr %177, align 16, !tbaa !9
  %179 = load double, ptr %15, align 8, !tbaa !9
  %180 = call double @llvm.fmuladd.f64(double %178, double %179, double %175)
  %181 = load ptr, ptr %6, align 8, !tbaa !5
  store double %180, ptr %181, align 8, !tbaa !9
  %182 = getelementptr inbounds [3 x [3 x double]], ptr %23, i64 0, i64 1
  %183 = getelementptr inbounds [3 x double], ptr %182, i64 0, i64 0
  %184 = load double, ptr %183, align 8, !tbaa !9
  %185 = load double, ptr %17, align 8, !tbaa !9
  %186 = getelementptr inbounds [3 x [3 x double]], ptr %23, i64 0, i64 1
  %187 = getelementptr inbounds [3 x double], ptr %186, i64 0, i64 1
  %188 = load double, ptr %187, align 8, !tbaa !9
  %189 = load double, ptr %16, align 8, !tbaa !9
  %190 = fmul double %188, %189
  %191 = call double @llvm.fmuladd.f64(double %184, double %185, double %190)
  %192 = getelementptr inbounds [3 x [3 x double]], ptr %23, i64 0, i64 1
  %193 = getelementptr inbounds [3 x double], ptr %192, i64 0, i64 2
  %194 = load double, ptr %193, align 8, !tbaa !9
  %195 = load double, ptr %15, align 8, !tbaa !9
  %196 = call double @llvm.fmuladd.f64(double %194, double %195, double %191)
  %197 = load ptr, ptr %7, align 8, !tbaa !5
  store double %196, ptr %197, align 8, !tbaa !9
  %198 = getelementptr inbounds [3 x [3 x double]], ptr %23, i64 0, i64 2
  %199 = getelementptr inbounds [3 x double], ptr %198, i64 0, i64 0
  %200 = load double, ptr %199, align 16, !tbaa !9
  %201 = load double, ptr %17, align 8, !tbaa !9
  %202 = getelementptr inbounds [3 x [3 x double]], ptr %23, i64 0, i64 2
  %203 = getelementptr inbounds [3 x double], ptr %202, i64 0, i64 1
  %204 = load double, ptr %203, align 8, !tbaa !9
  %205 = load double, ptr %16, align 8, !tbaa !9
  %206 = fmul double %204, %205
  %207 = call double @llvm.fmuladd.f64(double %200, double %201, double %206)
  %208 = getelementptr inbounds [3 x [3 x double]], ptr %23, i64 0, i64 2
  %209 = getelementptr inbounds [3 x double], ptr %208, i64 0, i64 2
  %210 = load double, ptr %209, align 16, !tbaa !9
  %211 = load double, ptr %15, align 8, !tbaa !9
  %212 = call double @llvm.fmuladd.f64(double %210, double %211, double %207)
  %213 = load ptr, ptr %8, align 8, !tbaa !5
  store double %212, ptr %213, align 8, !tbaa !9
  store i1 true, ptr %5, align 1
  store i32 1, ptr %24, align 4
  br label %214

214:                                              ; preds = %165, %164, %53
  call void @llvm.lifetime.end.p0(i64 72, ptr %23) #6
  call void @llvm.lifetime.end.p0(i64 72, 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
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #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 %12) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #6
  %215 = load i1, ptr %5, align 1
  ret i1 %215
}

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

declare void @print_trace() #4

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

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

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

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #2 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { 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 = { "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 = { 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 #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 = !{!"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, !13, i64 8}
!12 = !{!"_MatNd", !6, i64 0, !13, i64 8, !13, i64 12, !13, i64 16, !14, i64 20}
!13 = !{!"int", !7, i64 0}
!14 = !{!"_Bool", !7, i64 0}
!15 = !{!13, !13, i64 0}
!16 = !{!12, !13, i64 12}
!17 = distinct !{!17, !18}
!18 = !{!"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"

@RCS_GLOBAL_RLOG_CB = external local_unnamed_addr global ptr, align 8
@.str = external hidden unnamed_addr constant [74 x i8], align 1
@__func__.MatNd_parabolicFit2D = external hidden unnamed_addr constant [21 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [72 x i8], align 1
@RcsLogLevel = external local_unnamed_addr global i32, align 4
@stderr = external local_unnamed_addr global ptr, align 8
@.str.2 = external hidden unnamed_addr constant [16 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [43 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [13 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [22 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 speculatable willreturn memory(none)
declare double @llvm.fmuladd.f64(double, double, double) #1

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

; Function Attrs: nounwind uwtable
define dso_local noundef zeroext i1 @MatNd_parabolicFit2D(ptr nocapture noundef writeonly %0, ptr nocapture noundef writeonly %1, ptr nocapture noundef writeonly %2, ptr noundef %3) local_unnamed_addr #2 {
  %5 = alloca [3 x [3 x double]], align 16
  %6 = alloca [3 x [3 x double]], align 16
  call void @llvm.lifetime.start.p0(i64 72, ptr nonnull %5) #7
  call void @llvm.lifetime.start.p0(i64 72, ptr nonnull %6) #7
  %7 = getelementptr inbounds i8, ptr %3, i64 8
  %8 = load i32, ptr %7, align 8, !tbaa !5
  %9 = icmp ult i32 %8, 3
  br i1 %9, label %10, label %24

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

12:                                               ; preds = %10
  tail call void (i32, ptr, ptr, i32, ptr, ...) %11(i32 noundef 4, ptr noundef nonnull @.str, ptr noundef nonnull @__func__.MatNd_parabolicFit2D, i32 noundef 242, ptr noundef nonnull @.str.1, i32 noundef %8) #7
  br label %13

13:                                               ; preds = %12, %10
  %14 = load i32, ptr @RcsLogLevel, align 4, !tbaa !13
  %15 = icmp sgt i32 %14, 3
  br i1 %15, label %16, label %102

16:                                               ; preds = %13
  %17 = load ptr, ptr @stderr, align 8, !tbaa !12
  %18 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %17, ptr noundef nonnull @.str.2, ptr noundef nonnull @.str, ptr noundef nonnull @__func__.MatNd_parabolicFit2D, i32 noundef 242) #8
  %19 = load ptr, ptr @stderr, align 8, !tbaa !12
  %20 = load i32, ptr %7, align 8, !tbaa !5
  %21 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %19, ptr noundef nonnull @.str.1, i32 noundef %20) #8
  %22 = load ptr, ptr @stderr, align 8, !tbaa !12
  %23 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %22, ptr noundef nonnull @.str.3) #8
  br label %102

24:                                               ; preds = %4
  %25 = getelementptr inbounds i8, ptr %3, i64 12
  %26 = load i32, ptr %25, align 4, !tbaa !14
  %27 = icmp eq i32 %26, 2
  br i1 %27, label %.lr.ph, label %28

28:                                               ; preds = %24
  %29 = load ptr, ptr @stderr, align 8, !tbaa !12
  %30 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %29, ptr noundef nonnull @.str.4, ptr noundef nonnull @.str, ptr noundef nonnull @__func__.MatNd_parabolicFit2D, i32 noundef 246, ptr noundef nonnull @.str.5) #8
  tail call void @print_trace() #7
  tail call void @abort() #9
  unreachable

.lr.ph:                                           ; preds = %24, %.lr.ph
  %.05372 = phi i32 [ %47, %.lr.ph ], [ 0, %24 ]
  %.05867 = phi double [ %43, %.lr.ph ], [ 0.000000e+00, %24 ]
  %31 = phi <2 x double> [ %39, %.lr.ph ], [ zeroinitializer, %24 ]
  %32 = phi <2 x double> [ %42, %.lr.ph ], [ zeroinitializer, %24 ]
  %33 = phi <2 x double> [ %46, %.lr.ph ], [ zeroinitializer, %24 ]
  %34 = tail call double @MatNd_get(ptr noundef nonnull %3, i32 noundef %.05372, i32 noundef 0) #7
  %35 = tail call double @MatNd_get(ptr noundef nonnull %3, i32 noundef %.05372, i32 noundef 1) #7
  %36 = fmul double %34, %34
  %37 = insertelement <2 x double> poison, double %36, i64 0
  %38 = insertelement <2 x double> %37, double %34, i64 1
  %39 = fadd <2 x double> %31, %38
  %40 = shufflevector <2 x double> %37, <2 x double> poison, <2 x i32> zeroinitializer
  %41 = insertelement <2 x double> %40, double %34, i64 1
  %42 = tail call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %40, <2 x double> %41, <2 x double> %32)
  %43 = fadd double %.05867, %35
  %44 = insertelement <2 x double> poison, double %35, i64 0
  %45 = shufflevector <2 x double> %44, <2 x double> poison, <2 x i32> zeroinitializer
  %46 = tail call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %38, <2 x double> %45, <2 x double> %33)
  %47 = add nuw i32 %.05372, 1
  %48 = load i32, ptr %7, align 8, !tbaa !5
  %49 = icmp ult i32 %47, %48
  br i1 %49, label %.lr.ph, label %._crit_edge, !llvm.loop !15

._crit_edge:                                      ; preds = %.lr.ph
  store <2 x double> %42, ptr %5, align 16, !tbaa !17
  %50 = getelementptr inbounds i8, ptr %5, i64 16
  %51 = extractelement <2 x double> %39, i64 0
  store double %51, ptr %50, align 16, !tbaa !17
  %52 = getelementptr inbounds i8, ptr %5, i64 24
  %53 = extractelement <2 x double> %42, i64 1
  store double %53, ptr %52, align 8, !tbaa !17
  %54 = getelementptr inbounds i8, ptr %5, i64 32
  store <2 x double> %39, ptr %54, align 16, !tbaa !17
  %55 = getelementptr inbounds i8, ptr %5, i64 48
  store <2 x double> %39, ptr %55, align 16, !tbaa !17
  %56 = uitofp i32 %48 to double
  %57 = getelementptr inbounds i8, ptr %5, i64 64
  store double %56, ptr %57, align 16, !tbaa !17
  %58 = call double @Mat3d_inverse(ptr noundef nonnull %6, ptr noundef nonnull %5) #7
  %59 = fcmp oeq double %58, 0.000000e+00
  br i1 %59, label %60, label %73

60:                                               ; preds = %._crit_edge
  %61 = load ptr, ptr @RCS_GLOBAL_RLOG_CB, align 8, !tbaa !12
  %.not = icmp eq ptr %61, null
  br i1 %.not, label %63, label %62

62:                                               ; preds = %60
  call void (i32, ptr, ptr, i32, ptr, ...) %61(i32 noundef 4, ptr noundef nonnull @.str, ptr noundef nonnull @__func__.MatNd_parabolicFit2D, i32 noundef 277, ptr noundef nonnull @.str.6) #7
  br label %63

63:                                               ; preds = %62, %60
  %64 = load i32, ptr @RcsLogLevel, align 4, !tbaa !13
  %65 = icmp sgt i32 %64, 3
  br i1 %65, label %66, label %102

66:                                               ; preds = %63
  %67 = load ptr, ptr @stderr, align 8, !tbaa !12
  %68 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %67, ptr noundef nonnull @.str.2, ptr noundef nonnull @.str, ptr noundef nonnull @__func__.MatNd_parabolicFit2D, i32 noundef 277) #8
  %69 = load ptr, ptr @stderr, align 8, !tbaa !12
  %70 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %69, ptr noundef nonnull @.str.6) #8
  %71 = load ptr, ptr @stderr, align 8, !tbaa !12
  %72 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %71, ptr noundef nonnull @.str.3) #8
  br label %102

73:                                               ; preds = %._crit_edge
  %74 = load double, ptr %6, align 16, !tbaa !17
  %75 = getelementptr inbounds i8, ptr %6, i64 8
  %76 = load double, ptr %75, align 8, !tbaa !17
  %77 = extractelement <2 x double> %46, i64 1
  %78 = fmul double %77, %76
  %79 = extractelement <2 x double> %46, i64 0
  %80 = call double @llvm.fmuladd.f64(double %74, double %79, double %78)
  %81 = getelementptr inbounds i8, ptr %6, i64 16
  %82 = load double, ptr %81, align 16, !tbaa !17
  %83 = call double @llvm.fmuladd.f64(double %82, double %43, double %80)
  store double %83, ptr %0, align 8, !tbaa !17
  %84 = getelementptr inbounds i8, ptr %6, i64 24
  %85 = load double, ptr %84, align 8, !tbaa !17
  %86 = getelementptr inbounds i8, ptr %6, i64 32
  %87 = load double, ptr %86, align 16, !tbaa !17
  %88 = fmul double %77, %87
  %89 = call double @llvm.fmuladd.f64(double %85, double %79, double %88)
  %90 = getelementptr inbounds i8, ptr %6, i64 40
  %91 = load double, ptr %90, align 8, !tbaa !17
  %92 = call double @llvm.fmuladd.f64(double %91, double %43, double %89)
  store double %92, ptr %1, align 8, !tbaa !17
  %93 = getelementptr inbounds i8, ptr %6, i64 48
  %94 = load double, ptr %93, align 16, !tbaa !17
  %95 = getelementptr inbounds i8, ptr %6, i64 56
  %96 = load double, ptr %95, align 8, !tbaa !17
  %97 = fmul double %77, %96
  %98 = call double @llvm.fmuladd.f64(double %94, double %79, double %97)
  %99 = getelementptr inbounds i8, ptr %6, i64 64
  %100 = load double, ptr %99, align 16, !tbaa !17
  %101 = call double @llvm.fmuladd.f64(double %100, double %43, double %98)
  store double %101, ptr %2, align 8, !tbaa !17
  br label %102

102:                                              ; preds = %63, %66, %13, %16, %73
  %.0 = phi i1 [ true, %73 ], [ false, %16 ], [ false, %13 ], [ false, %66 ], [ false, %63 ]
  call void @llvm.lifetime.end.p0(i64 72, ptr nonnull %6) #7
  call void @llvm.lifetime.end.p0(i64 72, ptr nonnull %5) #7
  ret i1 %.0
}

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

declare void @print_trace() local_unnamed_addr #4

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

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

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

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

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #2 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { 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 #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 = { 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 #6 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #7 = { nounwind }
attributes #8 = { cold nounwind }
attributes #9 = { 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, !10, i64 8}
!6 = !{!"_MatNd", !7, i64 0, !10, i64 8, !10, i64 12, !10, i64 16, !11, i64 20}
!7 = !{!"any pointer", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"int", !8, i64 0}
!11 = !{!"_Bool", !8, i64 0}
!12 = !{!7, !7, i64 0}
!13 = !{!10, !10, i64 0}
!14 = !{!6, !10, i64 12}
!15 = distinct !{!15, !16}
!16 = !{!"llvm.loop.mustprogress"}
!17 = !{!18, !18, i64 0}
!18 = !{!"double", !8, i64 0}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,InferAlignmentPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,PostOrderFunctionAttrsPass,ReassociatePass,SCCPPass,SLPVectorizerPass,SROAPass,SimplifyCFGPass,TailCallElimPass