; LLVM IR from radualexandrub/Optimization-Algorithms-Find-local-minimum :: 2D_Derivative_NonQuadratic_CostFunctions (Newton_Clasic)

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

@logfile1 = external dso_local global ptr, align 8
@.str = external hidden unnamed_addr constant [20 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [47 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [18 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [28 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local void @Newton_Clasic(i32 noundef %0, ptr noundef %1, ptr noundef %2, ptr noundef %3, double noundef %4, ptr noundef %5) #0 {
  %7 = alloca i32, align 4
  %8 = alloca ptr, align 8
  %9 = alloca ptr, align 8
  %10 = alloca ptr, align 8
  %11 = alloca double, align 8
  %12 = alloca ptr, align 8
  %13 = alloca ptr, align 8
  %14 = alloca i64, align 8
  %15 = alloca i64, align 8
  %16 = alloca i64, align 8
  %17 = alloca i64, align 8
  %18 = alloca i32, align 4
  %19 = alloca i32, align 4
  %20 = alloca i32, align 4
  %21 = alloca ptr, align 8
  %22 = alloca i64, align 8
  %23 = alloca i64, align 8
  %24 = alloca i32, align 4
  %25 = alloca i64, align 8
  %26 = alloca i64, align 8
  %27 = alloca i64, align 8
  store i32 %0, ptr %7, align 4, !tbaa !5
  store ptr %1, ptr %8, align 8, !tbaa !9
  store ptr %2, ptr %9, align 8, !tbaa !9
  store ptr %3, ptr %10, align 8, !tbaa !9
  store double %4, ptr %11, align 8, !tbaa !11
  store ptr %5, ptr %12, align 8, !tbaa !9
  %28 = load i32, ptr %7, align 4, !tbaa !5
  %29 = zext i32 %28 to i64
  %30 = load ptr, ptr @logfile1, align 8, !tbaa !9
  %31 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %30, ptr noundef @.str) #6
  %32 = load i32, ptr %7, align 4, !tbaa !5
  %33 = zext i32 %32 to i64
  %34 = call ptr @llvm.stacksave.p0()
  store ptr %34, ptr %13, align 8
  %35 = alloca double, i64 %33, align 16
  store i64 %33, ptr %14, align 8
  %36 = load i32, ptr %7, align 4, !tbaa !5
  %37 = zext i32 %36 to i64
  %38 = alloca double, i64 %37, align 16
  store i64 %37, ptr %15, align 8
  %39 = load i32, ptr %7, align 4, !tbaa !5
  %40 = zext i32 %39 to i64
  %41 = load i32, ptr %7, align 4, !tbaa !5
  %42 = zext i32 %41 to i64
  %43 = mul nuw i64 %40, %42
  %44 = alloca double, i64 %43, align 16
  store i64 %40, ptr %16, align 8
  store i64 %42, ptr %17, align 8
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #6
  store i32 50, ptr %18, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #6
  store i32 0, ptr %19, align 4, !tbaa !5
  br label %45

45:                                               ; preds = %216, %6
  %46 = load i32, ptr %19, align 4, !tbaa !5
  %47 = load i32, ptr %18, align 4, !tbaa !5
  %48 = icmp slt i32 %46, %47
  br i1 %48, label %50, label %49

49:                                               ; preds = %45
  store i32 2, ptr %20, align 4
  br label %219

50:                                               ; preds = %45
  %51 = load ptr, ptr %9, align 8, !tbaa !9
  %52 = load ptr, ptr %12, align 8, !tbaa !9
  %53 = getelementptr inbounds double, ptr %52, i64 0
  %54 = load double, ptr %53, align 8, !tbaa !11
  %55 = load ptr, ptr %12, align 8, !tbaa !9
  %56 = getelementptr inbounds double, ptr %55, i64 1
  %57 = load double, ptr %56, align 8, !tbaa !11
  %58 = call double %51(double noundef %54, double noundef %57)
  %59 = getelementptr inbounds double, ptr %35, i64 0
  store double %58, ptr %59, align 16, !tbaa !11
  %60 = load ptr, ptr %10, align 8, !tbaa !9
  %61 = load ptr, ptr %12, align 8, !tbaa !9
  %62 = getelementptr inbounds double, ptr %61, i64 0
  %63 = load double, ptr %62, align 8, !tbaa !11
  %64 = load ptr, ptr %12, align 8, !tbaa !9
  %65 = getelementptr inbounds double, ptr %64, i64 1
  %66 = load double, ptr %65, align 8, !tbaa !11
  %67 = call double %60(double noundef %63, double noundef %66)
  %68 = getelementptr inbounds double, ptr %35, i64 1
  store double %67, ptr %68, align 8, !tbaa !11
  %69 = load i32, ptr %7, align 4, !tbaa !5
  %70 = zext i32 %69 to i64
  %71 = call ptr @llvm.stacksave.p0()
  store ptr %71, ptr %21, align 8
  %72 = alloca double, i64 %70, align 16
  store i64 %70, ptr %22, align 8
  %73 = load i32, ptr %7, align 4, !tbaa !5
  %74 = zext i32 %73 to i64
  %75 = alloca double, i64 %74, align 16
  store i64 %74, ptr %23, align 8
  %76 = load i32, ptr %7, align 4, !tbaa !5
  %77 = load ptr, ptr %12, align 8, !tbaa !9
  call void @Vec_scale(i32 noundef %76, double noundef 1.000000e+00, ptr noundef %77, ptr noundef %72)
  call void @llvm.lifetime.start.p0(i64 4, ptr %24) #6
  store i32 0, ptr %24, align 4, !tbaa !5
  br label %78

78:                                               ; preds = %154, %50
  %79 = load i32, ptr %24, align 4, !tbaa !5
  %80 = load i32, ptr %7, align 4, !tbaa !5
  %81 = icmp slt i32 %79, %80
  br i1 %81, label %83, label %82

82:                                               ; preds = %78
  store i32 5, ptr %20, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %24) #6
  br label %157

83:                                               ; preds = %78
  %84 = load ptr, ptr %12, align 8, !tbaa !9
  %85 = load i32, ptr %24, align 4, !tbaa !5
  %86 = sext i32 %85 to i64
  %87 = getelementptr inbounds double, ptr %84, i64 %86
  %88 = load double, ptr %87, align 8, !tbaa !11
  %89 = call double @llvm.fabs.f64(double %88)
  %90 = load double, ptr %11, align 8, !tbaa !11
  %91 = call double @sqrt(double noundef %90) #6
  %92 = fmul double %89, %91
  %93 = load i32, ptr %24, align 4, !tbaa !5
  %94 = sext i32 %93 to i64
  %95 = getelementptr inbounds double, ptr %38, i64 %94
  store double %92, ptr %95, align 8, !tbaa !11
  %96 = load i32, ptr %24, align 4, !tbaa !5
  %97 = sext i32 %96 to i64
  %98 = getelementptr inbounds double, ptr %38, i64 %97
  %99 = load double, ptr %98, align 8, !tbaa !11
  %100 = load i32, ptr %24, align 4, !tbaa !5
  %101 = sext i32 %100 to i64
  %102 = getelementptr inbounds double, ptr %72, i64 %101
  %103 = load double, ptr %102, align 8, !tbaa !11
  %104 = fadd double %103, %99
  store double %104, ptr %102, align 8, !tbaa !11
  %105 = load ptr, ptr %9, align 8, !tbaa !9
  %106 = getelementptr inbounds double, ptr %72, i64 0
  %107 = load double, ptr %106, align 16, !tbaa !11
  %108 = getelementptr inbounds double, ptr %72, i64 1
  %109 = load double, ptr %108, align 8, !tbaa !11
  %110 = call double %105(double noundef %107, double noundef %109)
  %111 = getelementptr inbounds double, ptr %75, i64 0
  store double %110, ptr %111, align 16, !tbaa !11
  %112 = load ptr, ptr %10, align 8, !tbaa !9
  %113 = getelementptr inbounds double, ptr %72, i64 0
  %114 = load double, ptr %113, align 16, !tbaa !11
  %115 = getelementptr inbounds double, ptr %72, i64 1
  %116 = load double, ptr %115, align 8, !tbaa !11
  %117 = call double %112(double noundef %114, double noundef %116)
  %118 = getelementptr inbounds double, ptr %75, i64 1
  store double %117, ptr %118, align 8, !tbaa !11
  %119 = load i32, ptr %24, align 4, !tbaa !5
  %120 = sext i32 %119 to i64
  %121 = getelementptr inbounds double, ptr %38, i64 %120
  %122 = load double, ptr %121, align 8, !tbaa !11
  %123 = load i32, ptr %24, align 4, !tbaa !5
  %124 = sext i32 %123 to i64
  %125 = getelementptr inbounds double, ptr %72, i64 %124
  %126 = load double, ptr %125, align 8, !tbaa !11
  %127 = fsub double %126, %122
  store double %127, ptr %125, align 8, !tbaa !11
  %128 = load i32, ptr %7, align 4, !tbaa !5
  %129 = load i32, ptr %24, align 4, !tbaa !5
  %130 = sext i32 %129 to i64
  %131 = mul nsw i64 %130, %42
  %132 = getelementptr inbounds double, ptr %44, i64 %131
  call void @Vec_add_coefVec(i32 noundef %128, ptr noundef %75, double noundef -1.000000e+00, ptr noundef %35, ptr noundef %132)
  %133 = load i32, ptr %24, align 4, !tbaa !5
  %134 = sext i32 %133 to i64
  %135 = getelementptr inbounds double, ptr %38, i64 %134
  %136 = load double, ptr %135, align 8, !tbaa !11
  %137 = fcmp une double %136, 0.000000e+00
  br i1 %137, label %138, label %153

138:                                              ; preds = %83
  %139 = load i32, ptr %7, align 4, !tbaa !5
  %140 = load i32, ptr %24, align 4, !tbaa !5
  %141 = sext i32 %140 to i64
  %142 = getelementptr inbounds double, ptr %38, i64 %141
  %143 = load double, ptr %142, align 8, !tbaa !11
  %144 = fdiv double 1.000000e+00, %143
  %145 = load i32, ptr %24, align 4, !tbaa !5
  %146 = sext i32 %145 to i64
  %147 = mul nsw i64 %146, %42
  %148 = getelementptr inbounds double, ptr %44, i64 %147
  %149 = load i32, ptr %24, align 4, !tbaa !5
  %150 = sext i32 %149 to i64
  %151 = mul nsw i64 %150, %42
  %152 = getelementptr inbounds double, ptr %44, i64 %151
  call void @Vec_scale(i32 noundef %139, double noundef %144, ptr noundef %148, ptr noundef %152)
  br label %153

153:                                              ; preds = %138, %83
  br label %154

154:                                              ; preds = %153
  %155 = load i32, ptr %24, align 4, !tbaa !5
  %156 = add nsw i32 %155, 1
  store i32 %156, ptr %24, align 4, !tbaa !5
  br label %78, !llvm.loop !13

157:                                              ; preds = %82
  %158 = load i32, ptr %7, align 4, !tbaa !5
  %159 = call double @Vec_norm(i32 noundef %158, ptr noundef %35)
  %160 = load double, ptr %11, align 8, !tbaa !11
  %161 = fcmp olt double %159, %160
  br i1 %161, label %162, label %165

162:                                              ; preds = %157
  %163 = load i32, ptr %19, align 4, !tbaa !5
  %164 = call i32 (ptr, ...) @printf(ptr noundef @.str.1, i32 noundef %163)
  store i32 2, ptr %20, align 4
  br label %212

165:                                              ; preds = %157
  %166 = load i32, ptr %7, align 4, !tbaa !5
  %167 = zext i32 %166 to i64
  %168 = load i32, ptr %7, align 4, !tbaa !5
  %169 = zext i32 %168 to i64
  %170 = mul nuw i64 %167, %169
  %171 = alloca double, i64 %170, align 16
  store i64 %167, ptr %25, align 8
  store i64 %169, ptr %26, align 8
  %172 = load i32, ptr %7, align 4, !tbaa !5
  %173 = zext i32 %172 to i64
  %174 = alloca double, i64 %173, align 16
  store i64 %173, ptr %27, align 8
  %175 = load i32, ptr %7, align 4, !tbaa !5
  call void @Mat_inv(i32 noundef %175, ptr noundef %44, ptr noundef %171)
  %176 = load i32, ptr %7, align 4, !tbaa !5
  %177 = load i32, ptr %7, align 4, !tbaa !5
  call void @Mat_mult_Vec(i32 noundef %176, i32 noundef %177, ptr noundef %171, ptr noundef %35, ptr noundef %174)
  %178 = load i32, ptr %7, align 4, !tbaa !5
  %179 = load ptr, ptr %12, align 8, !tbaa !9
  %180 = load ptr, ptr %12, align 8, !tbaa !9
  call void @Vec_add_coefVec(i32 noundef %178, ptr noundef %179, double noundef -1.000000e+00, ptr noundef %174, ptr noundef %180)
  %181 = load ptr, ptr @logfile1, align 8, !tbaa !9
  %182 = load ptr, ptr %12, align 8, !tbaa !9
  %183 = getelementptr inbounds double, ptr %182, i64 0
  %184 = load double, ptr %183, align 8, !tbaa !11
  %185 = load ptr, ptr %12, align 8, !tbaa !9
  %186 = getelementptr inbounds double, ptr %185, i64 1
  %187 = load double, ptr %186, align 8, !tbaa !11
  %188 = load ptr, ptr %8, align 8, !tbaa !9
  %189 = load ptr, ptr %12, align 8, !tbaa !9
  %190 = getelementptr inbounds double, ptr %189, i64 0
  %191 = load double, ptr %190, align 8, !tbaa !11
  %192 = load ptr, ptr %12, align 8, !tbaa !9
  %193 = getelementptr inbounds double, ptr %192, i64 1
  %194 = load double, ptr %193, align 8, !tbaa !11
  %195 = call double %188(double noundef %191, double noundef %194)
  %196 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %181, ptr noundef @.str.2, double noundef %184, double noundef %187, double noundef %195) #6
  %197 = load ptr, ptr %12, align 8, !tbaa !9
  %198 = getelementptr inbounds double, ptr %197, i64 0
  %199 = load double, ptr %198, align 8, !tbaa !11
  %200 = load ptr, ptr %12, align 8, !tbaa !9
  %201 = getelementptr inbounds double, ptr %200, i64 1
  %202 = load double, ptr %201, align 8, !tbaa !11
  %203 = load ptr, ptr %8, align 8, !tbaa !9
  %204 = load ptr, ptr %12, align 8, !tbaa !9
  %205 = getelementptr inbounds double, ptr %204, i64 0
  %206 = load double, ptr %205, align 8, !tbaa !11
  %207 = load ptr, ptr %12, align 8, !tbaa !9
  %208 = getelementptr inbounds double, ptr %207, i64 1
  %209 = load double, ptr %208, align 8, !tbaa !11
  %210 = call double %203(double noundef %206, double noundef %209)
  %211 = call i32 (ptr, ...) @printf(ptr noundef @.str.3, double noundef %199, double noundef %202, double noundef %210)
  store i32 0, ptr %20, align 4
  br label %212

212:                                              ; preds = %165, %162
  %213 = load ptr, ptr %21, align 8
  call void @llvm.stackrestore.p0(ptr %213)
  %214 = load i32, ptr %20, align 4
  switch i32 %214, label %219 [
    i32 0, label %215
  ]

215:                                              ; preds = %212
  br label %216

216:                                              ; preds = %215
  %217 = load i32, ptr %19, align 4, !tbaa !5
  %218 = add nsw i32 %217, 1
  store i32 %218, ptr %19, align 4, !tbaa !5
  br label %45, !llvm.loop !15

219:                                              ; preds = %212, %49
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #6
  br label %220

220:                                              ; preds = %219
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #6
  %221 = load ptr, ptr %13, align 8
  call void @llvm.stackrestore.p0(ptr %221)
  ret void
}

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

; Function Attrs: nocallback nofree nosync nounwind willreturn
declare ptr @llvm.stacksave.p0() #2

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

; Function Attrs: nounwind uwtable
declare dso_local void @Vec_scale(i32 noundef, double noundef, ptr noundef, ptr noundef) #0

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

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

; Function Attrs: nounwind uwtable
declare dso_local void @Vec_add_coefVec(i32 noundef, ptr noundef, double noundef, ptr noundef, ptr noundef) #0

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

; Function Attrs: nounwind uwtable
declare dso_local double @Vec_norm(i32 noundef, ptr noundef) #0

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

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

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

; Function Attrs: nocallback nofree nosync nounwind willreturn
declare void @llvm.stackrestore.p0(ptr) #2

attributes #0 = { 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 #1 = { nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { nocallback nofree nosync nounwind willreturn }
attributes #3 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #4 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #5 = { "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 }

!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/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"any pointer", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"double", !7, i64 0}
!13 = distinct !{!13, !14}
!14 = !{!"llvm.loop.mustprogress"}
!15 = distinct !{!15, !14}


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

@logfile1 = external dso_local local_unnamed_addr global ptr, align 8
@.str = external hidden unnamed_addr constant [20 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [47 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [18 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [28 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local void @Newton_Clasic(i32 noundef %0, ptr nocapture noundef readonly %1, ptr nocapture noundef readonly %2, ptr nocapture noundef readonly %3, double noundef %4, ptr noundef %5) local_unnamed_addr #0 {
  %7 = load ptr, ptr @logfile1, align 8, !tbaa !5
  %8 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %7, ptr noundef nonnull @.str) #5
  %9 = zext i32 %0 to i64
  %10 = alloca double, i64 %9, align 16
  %11 = mul nuw i64 %9, %9
  %12 = alloca double, i64 %11, align 16
  %13 = getelementptr inbounds i8, ptr %5, i64 8
  %14 = getelementptr inbounds i8, ptr %10, i64 8
  %15 = icmp sgt i32 %0, 0
  br label %16

16:                                               ; preds = %6, %55
  %.068 = phi i32 [ 0, %6 ], [ %67, %55 ]
  %17 = load double, ptr %5, align 8, !tbaa !9
  %18 = load double, ptr %13, align 8, !tbaa !9
  %19 = call double %2(double noundef %17, double noundef %18) #5
  store double %19, ptr %10, align 16, !tbaa !9
  %20 = load double, ptr %5, align 8, !tbaa !9
  %21 = load double, ptr %13, align 8, !tbaa !9
  %22 = call double %3(double noundef %20, double noundef %21) #5
  store double %22, ptr %14, align 8, !tbaa !9
  %23 = call ptr @llvm.stacksave.p0()
  %24 = alloca double, i64 %9, align 16
  %25 = alloca double, i64 %9, align 16
  call void @Vec_scale(i32 noundef %0, double noundef 1.000000e+00, ptr noundef nonnull %5, ptr noundef nonnull %24)
  br i1 %15, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %16
  %26 = getelementptr inbounds i8, ptr %24, i64 8
  %27 = getelementptr inbounds i8, ptr %25, i64 8
  br label %30

._crit_edge:                                      ; preds = %52, %16
  %28 = call double @Vec_norm(i32 noundef %0, ptr noundef nonnull %10)
  %29 = fcmp uge double %28, %4
  br i1 %29, label %55, label %53

30:                                               ; preds = %.lr.ph, %52
  %indvars.iv = phi i64 [ 0, %.lr.ph ], [ %indvars.iv.next, %52 ]
  %31 = getelementptr inbounds double, ptr %5, i64 %indvars.iv
  %32 = load double, ptr %31, align 8, !tbaa !9
  %33 = call double @llvm.fabs.f64(double %32)
  %34 = call double @sqrt(double noundef %4) #5
  %35 = fmul double %33, %34
  %36 = getelementptr inbounds double, ptr %24, i64 %indvars.iv
  %37 = load double, ptr %36, align 8, !tbaa !9
  %38 = fadd double %37, %35
  store double %38, ptr %36, align 8, !tbaa !9
  %39 = load double, ptr %24, align 16, !tbaa !9
  %40 = load double, ptr %26, align 8, !tbaa !9
  %41 = call double %2(double noundef %39, double noundef %40) #5
  store double %41, ptr %25, align 16, !tbaa !9
  %42 = load double, ptr %24, align 16, !tbaa !9
  %43 = load double, ptr %26, align 8, !tbaa !9
  %44 = call double %3(double noundef %42, double noundef %43) #5
  store double %44, ptr %27, align 8, !tbaa !9
  %45 = load double, ptr %36, align 8, !tbaa !9
  %46 = fsub double %45, %35
  store double %46, ptr %36, align 8, !tbaa !9
  %47 = mul nuw nsw i64 %indvars.iv, %9
  %48 = getelementptr inbounds double, ptr %12, i64 %47
  call void @Vec_add_coefVec(i32 noundef %0, ptr noundef nonnull %25, double noundef -1.000000e+00, ptr noundef nonnull %10, ptr noundef nonnull %48)
  %49 = fcmp une double %35, 0.000000e+00
  br i1 %49, label %50, label %52

50:                                               ; preds = %30
  %51 = fdiv double 1.000000e+00, %35
  call void @Vec_scale(i32 noundef %0, double noundef %51, ptr noundef nonnull %48, ptr noundef nonnull %48)
  br label %52

52:                                               ; preds = %30, %50
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next, %9
  br i1 %exitcond.not, label %._crit_edge, label %30, !llvm.loop !11

53:                                               ; preds = %._crit_edge
  %54 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %.068)
  call void @llvm.stackrestore.p0(ptr %23)
  br label %.loopexit

55:                                               ; preds = %._crit_edge
  %56 = alloca double, i64 %11, align 16
  %57 = alloca double, i64 %9, align 16
  call void @Mat_inv(i32 noundef %0, ptr noundef nonnull %12, ptr noundef nonnull %56)
  call void @Mat_mult_Vec(i32 noundef %0, i32 noundef %0, ptr noundef nonnull %56, ptr noundef nonnull %10, ptr noundef nonnull %57)
  call void @Vec_add_coefVec(i32 noundef %0, ptr noundef nonnull %5, double noundef -1.000000e+00, ptr noundef nonnull %57, ptr noundef nonnull %5)
  %58 = load ptr, ptr @logfile1, align 8, !tbaa !5
  %59 = load double, ptr %5, align 8, !tbaa !9
  %60 = load double, ptr %13, align 8, !tbaa !9
  %61 = call double %1(double noundef %59, double noundef %60) #5
  %62 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %58, ptr noundef nonnull @.str.2, double noundef %59, double noundef %60, double noundef %61) #5
  %63 = load double, ptr %5, align 8, !tbaa !9
  %64 = load double, ptr %13, align 8, !tbaa !9
  %65 = call double %1(double noundef %63, double noundef %64) #5
  %66 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, double noundef %63, double noundef %64, double noundef %65)
  call void @llvm.stackrestore.p0(ptr %23)
  %67 = add nuw nsw i32 %.068, 1
  %exitcond72.not = icmp eq i32 %67, 50
  br i1 %exitcond72.not, label %.loopexit, label %16, !llvm.loop !13

.loopexit:                                        ; preds = %55, %53
  ret void
}

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

; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare ptr @llvm.stacksave.p0() #2

; Function Attrs: nounwind uwtable
declare dso_local void @Vec_scale(i32 noundef, double noundef, ptr noundef, ptr noundef) local_unnamed_addr #0

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

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

; Function Attrs: nounwind uwtable
declare dso_local void @Vec_add_coefVec(i32 noundef, ptr noundef, double noundef, ptr noundef, ptr noundef) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
declare dso_local double @Vec_norm(i32 noundef, ptr noundef) local_unnamed_addr #0

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

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

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

; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare void @llvm.stackrestore.p0(ptr) #2

attributes #0 = { 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 #1 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { mustprogress nocallback nofree nosync nounwind willreturn }
attributes #3 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #4 = { 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 #5 = { nounwind }

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"double", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = distinct !{!13, !12}


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