; LLVM IR from Amoiensis/Optimization-Algorithm :: [Unconstrained_Optimization]无约束优化/[DFP_Method]DFP方法 (main)

; 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._Matrix = type { i32, i32, ptr }

@.str.16 = external hidden unnamed_addr constant [6 x i8], align 1
@__const.main._mat_X = external hidden unnamed_addr constant [1 x [3 x double]], align 16
@.str.27 = external hidden unnamed_addr constant [20 x i8], align 1
@.str.28 = external hidden unnamed_addr constant [13 x i8], align 1
@.str.29 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.30 = external hidden unnamed_addr constant [12 x i8], align 1

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

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

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

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

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

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

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

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

; Function Attrs: nounwind uwtable
declare dso_local ptr @M_Inverse(ptr noundef) #0

declare i32 @system(ptr noundef) #2

; Function Attrs: nounwind uwtable
declare dso_local ptr @M_T(ptr noundef) #0

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

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

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

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

; Function Attrs: nounwind uwtable
define dso_local i32 @main(i32 noundef %0, ptr noundef %1) #0 {
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca [1 x [3 x double]], align 16
  %8 = alloca double, align 8
  %9 = alloca double, align 8
  %10 = alloca double, align 8
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca ptr, align 8
  %14 = alloca double, align 8
  %15 = alloca ptr, align 8
  %16 = alloca ptr, align 8
  %17 = alloca ptr, align 8
  %18 = alloca ptr, align 8
  %19 = alloca ptr, align 8
  %20 = alloca ptr, align 8
  %21 = alloca ptr, align 8
  %22 = alloca ptr, align 8
  %23 = alloca i32, align 4
  %24 = alloca double, align 8
  store i32 0, ptr %3, align 4
  store i32 %0, ptr %4, align 4, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #4
  store ptr @Function, ptr %6, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 24, ptr %7) #4
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %7, ptr align 16 @__const.main._mat_X, i64 24, i1 false)
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #4
  store double 1.000000e-02, ptr %8, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #4
  store double 1.000000e-02, ptr %9, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #4
  store double 1.000000e-02, ptr %10, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #4
  store i32 1, ptr %11, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #4
  store i32 3, ptr %12, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #4
  %25 = load i32, ptr %11, align 4, !tbaa !5
  %26 = load i32, ptr %12, align 4, !tbaa !5
  %27 = getelementptr inbounds [1 x [3 x double]], ptr %7, i64 0, i64 0
  %28 = call ptr @Matrix_gen(i32 noundef %25, i32 noundef %26, ptr noundef %27)
  store ptr %28, ptr %13, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #4
  %29 = load double, ptr %8, align 8, !tbaa !11
  %30 = fmul double 1.000000e+01, %29
  store double %30, ptr %14, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #4
  store ptr null, ptr %15, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #4
  store ptr null, ptr %16, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #4
  store ptr null, ptr %17, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #4
  store ptr null, ptr %18, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #4
  store ptr null, ptr %19, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #4
  store ptr null, ptr %20, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %21) #4
  store ptr null, ptr %21, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %22) #4
  store ptr null, ptr %22, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %23) #4
  store i32 0, ptr %23, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %24) #4
  store double 0.000000e+00, ptr %24, align 8, !tbaa !11
  br label %31

31:                                               ; preds = %176, %2
  %32 = load double, ptr %14, align 8, !tbaa !11
  %33 = load double, ptr %8, align 8, !tbaa !11
  %34 = fcmp ogt double %32, %33
  br i1 %34, label %35, label %183

35:                                               ; preds = %31
  %36 = load ptr, ptr %16, align 8, !tbaa !9
  store ptr %36, ptr %15, align 8, !tbaa !9
  %37 = load i32, ptr %23, align 4, !tbaa !5
  %38 = icmp eq i32 %37, 0
  br i1 %38, label %39, label %45

39:                                               ; preds = %35
  %40 = load ptr, ptr %13, align 8, !tbaa !9
  %41 = load double, ptr %9, align 8, !tbaa !11
  %42 = call ptr @Func_derivative(ptr noundef %40, double noundef %41)
  store ptr %42, ptr %16, align 8, !tbaa !9
  %43 = load ptr, ptr %16, align 8, !tbaa !9
  %44 = call i32 @M_print(ptr noundef %43)
  br label %59

45:                                               ; preds = %35
  %46 = load ptr, ptr %13, align 8, !tbaa !9
  %47 = load double, ptr %9, align 8, !tbaa !11
  %48 = call ptr @Func_derivative(ptr noundef %46, double noundef %47)
  store ptr %48, ptr %16, align 8, !tbaa !9
  %49 = load ptr, ptr %16, align 8, !tbaa !9
  %50 = call i32 @M_print(ptr noundef %49)
  %51 = load ptr, ptr %16, align 8, !tbaa !9
  store ptr %51, ptr %17, align 8, !tbaa !9
  %52 = load ptr, ptr %17, align 8, !tbaa !9
  %53 = load ptr, ptr %18, align 8, !tbaa !9
  %54 = call ptr @M_mul(ptr noundef %52, ptr noundef %53)
  store ptr %54, ptr %16, align 8, !tbaa !9
  %55 = load ptr, ptr %16, align 8, !tbaa !9
  %56 = call i32 @M_print(ptr noundef %55)
  %57 = load ptr, ptr %17, align 8, !tbaa !9
  %58 = call i32 @M_free(ptr noundef %57)
  br label %59

59:                                               ; preds = %45, %39
  %60 = load ptr, ptr %13, align 8, !tbaa !9
  %61 = load ptr, ptr %16, align 8, !tbaa !9
  %62 = call double @Bisection_Method(ptr noundef %60, ptr noundef %61)
  store double %62, ptr %10, align 8, !tbaa !11
  %63 = load double, ptr %10, align 8, !tbaa !11
  %64 = call i32 (ptr, ...) @printf(ptr noundef @.str.27, double noundef %63)
  %65 = load ptr, ptr %13, align 8, !tbaa !9
  store ptr %65, ptr %17, align 8, !tbaa !9
  %66 = load ptr, ptr %13, align 8, !tbaa !9
  %67 = call i32 @M_print(ptr noundef %66)
  %68 = load ptr, ptr %17, align 8, !tbaa !9
  %69 = load double, ptr %10, align 8, !tbaa !11
  %70 = load ptr, ptr %16, align 8, !tbaa !9
  %71 = call ptr @M_add_sub(double noundef 1.000000e+00, ptr noundef %68, double noundef %69, ptr noundef %70)
  store ptr %71, ptr %13, align 8, !tbaa !9
  %72 = load ptr, ptr %13, align 8, !tbaa !9
  %73 = call i32 @M_print(ptr noundef %72)
  %74 = load i32, ptr %23, align 4, !tbaa !5
  %75 = icmp eq i32 %74, 0
  br i1 %75, label %76, label %83

76:                                               ; preds = %59
  %77 = load ptr, ptr %13, align 8, !tbaa !9
  %78 = getelementptr inbounds %struct._Matrix, ptr %77, i32 0, i32 1
  %79 = load i32, ptr %78, align 4, !tbaa !13
  %80 = call ptr @M_I(i32 noundef %79)
  store ptr %80, ptr %18, align 8, !tbaa !9
  %81 = load ptr, ptr %18, align 8, !tbaa !9
  %82 = call i32 @M_print(ptr noundef %81)
  br label %176

83:                                               ; preds = %59
  %84 = load ptr, ptr %13, align 8, !tbaa !9
  %85 = load ptr, ptr %17, align 8, !tbaa !9
  %86 = call ptr @M_add_sub(double noundef 1.000000e+00, ptr noundef %84, double noundef 1.000000e+00, ptr noundef %85)
  store ptr %86, ptr %20, align 8, !tbaa !9
  %87 = load ptr, ptr %20, align 8, !tbaa !9
  %88 = call i32 @M_print(ptr noundef %87)
  %89 = load ptr, ptr %16, align 8, !tbaa !9
  %90 = load ptr, ptr %15, align 8, !tbaa !9
  %91 = call ptr @M_add_sub(double noundef 1.000000e+00, ptr noundef %89, double noundef 1.000000e+00, ptr noundef %90)
  store ptr %91, ptr %19, align 8, !tbaa !9
  %92 = load ptr, ptr %19, align 8, !tbaa !9
  %93 = call i32 @M_print(ptr noundef %92)
  %94 = load ptr, ptr %19, align 8, !tbaa !9
  %95 = load ptr, ptr %20, align 8, !tbaa !9
  %96 = call ptr @M_T(ptr noundef %95)
  %97 = call ptr @M_mul(ptr noundef %94, ptr noundef %96)
  %98 = call i32 @M_print(ptr noundef %97)
  %99 = load ptr, ptr %19, align 8, !tbaa !9
  %100 = load ptr, ptr %20, align 8, !tbaa !9
  %101 = call ptr @M_T(ptr noundef %100)
  %102 = call ptr @M_mul(ptr noundef %99, ptr noundef %101)
  %103 = call double @M_det(ptr noundef %102)
  %104 = call i32 (ptr, ...) @printf(ptr noundef @.str.28, double noundef %103)
  %105 = load ptr, ptr %20, align 8, !tbaa !9
  %106 = call ptr @M_T(ptr noundef %105)
  %107 = load ptr, ptr %19, align 8, !tbaa !9
  %108 = call ptr @M_mul(ptr noundef %106, ptr noundef %107)
  %109 = call ptr @M_Inverse(ptr noundef %108)
  %110 = call i32 @M_print(ptr noundef %109)
  %111 = load ptr, ptr %20, align 8, !tbaa !9
  %112 = call ptr @M_T(ptr noundef %111)
  %113 = load ptr, ptr %20, align 8, !tbaa !9
  %114 = call ptr @M_mul(ptr noundef %112, ptr noundef %113)
  %115 = load ptr, ptr %19, align 8, !tbaa !9
  %116 = load ptr, ptr %20, align 8, !tbaa !9
  %117 = call ptr @M_T(ptr noundef %116)
  %118 = call ptr @M_mul(ptr noundef %115, ptr noundef %117)
  %119 = call double @M_det(ptr noundef %118)
  %120 = fdiv double 1.000000e+00, %119
  %121 = call ptr @M_numul(ptr noundef %114, double noundef %120)
  store ptr %121, ptr %21, align 8, !tbaa !9
  %122 = load ptr, ptr %21, align 8, !tbaa !9
  %123 = call i32 @M_print(ptr noundef %122)
  %124 = load ptr, ptr %19, align 8, !tbaa !9
  %125 = load ptr, ptr %18, align 8, !tbaa !9
  %126 = call ptr @M_mul(ptr noundef %124, ptr noundef %125)
  %127 = load ptr, ptr %19, align 8, !tbaa !9
  %128 = call ptr @M_T(ptr noundef %127)
  %129 = call ptr @M_mul(ptr noundef %126, ptr noundef %128)
  %130 = call i32 @M_print(ptr noundef %129)
  %131 = load ptr, ptr %19, align 8, !tbaa !9
  %132 = load ptr, ptr %18, align 8, !tbaa !9
  %133 = call ptr @M_mul(ptr noundef %131, ptr noundef %132)
  %134 = load ptr, ptr %19, align 8, !tbaa !9
  %135 = call ptr @M_T(ptr noundef %134)
  %136 = call ptr @M_mul(ptr noundef %133, ptr noundef %135)
  %137 = call double @M_det(ptr noundef %136)
  %138 = call i32 (ptr, ...) @printf(ptr noundef @.str.28, double noundef %137)
  %139 = load ptr, ptr %18, align 8, !tbaa !9
  %140 = load ptr, ptr %19, align 8, !tbaa !9
  %141 = call ptr @M_T(ptr noundef %140)
  %142 = call ptr @M_mul(ptr noundef %139, ptr noundef %141)
  %143 = load ptr, ptr %19, align 8, !tbaa !9
  %144 = call ptr @M_mul(ptr noundef %142, ptr noundef %143)
  %145 = load ptr, ptr %18, align 8, !tbaa !9
  %146 = call ptr @M_mul(ptr noundef %144, ptr noundef %145)
  %147 = call i32 @M_print(ptr noundef %146)
  %148 = load ptr, ptr %18, align 8, !tbaa !9
  %149 = load ptr, ptr %19, align 8, !tbaa !9
  %150 = call ptr @M_T(ptr noundef %149)
  %151 = call ptr @M_mul(ptr noundef %148, ptr noundef %150)
  %152 = load ptr, ptr %19, align 8, !tbaa !9
  %153 = call ptr @M_mul(ptr noundef %151, ptr noundef %152)
  %154 = load ptr, ptr %18, align 8, !tbaa !9
  %155 = call ptr @M_mul(ptr noundef %153, ptr noundef %154)
  %156 = load ptr, ptr %19, align 8, !tbaa !9
  %157 = load ptr, ptr %18, align 8, !tbaa !9
  %158 = call ptr @M_mul(ptr noundef %156, ptr noundef %157)
  %159 = load ptr, ptr %19, align 8, !tbaa !9
  %160 = call ptr @M_T(ptr noundef %159)
  %161 = call ptr @M_mul(ptr noundef %158, ptr noundef %160)
  %162 = call double @M_det(ptr noundef %161)
  %163 = fdiv double 1.000000e+00, %162
  %164 = call ptr @M_numul(ptr noundef %155, double noundef %163)
  store ptr %164, ptr %22, align 8, !tbaa !9
  %165 = load ptr, ptr %22, align 8, !tbaa !9
  %166 = call i32 @M_print(ptr noundef %165)
  %167 = load ptr, ptr %18, align 8, !tbaa !9
  %168 = load ptr, ptr %21, align 8, !tbaa !9
  %169 = call ptr @M_add_sub(double noundef 1.000000e+00, ptr noundef %167, double noundef -1.000000e+00, ptr noundef %168)
  %170 = load ptr, ptr %22, align 8, !tbaa !9
  %171 = call ptr @M_add_sub(double noundef 1.000000e+00, ptr noundef %169, double noundef 1.000000e+00, ptr noundef %170)
  store ptr %171, ptr %18, align 8, !tbaa !9
  %172 = load ptr, ptr %18, align 8, !tbaa !9
  %173 = call i32 @M_print(ptr noundef %172)
  %174 = load ptr, ptr %20, align 8, !tbaa !9
  %175 = call double @M_norm(ptr noundef %174, i32 noundef 2)
  store double %175, ptr %14, align 8, !tbaa !11
  br label %176

176:                                              ; preds = %83, %76
  %177 = load ptr, ptr %17, align 8, !tbaa !9
  %178 = call i32 @M_free(ptr noundef %177)
  %179 = load ptr, ptr %16, align 8, !tbaa !9
  %180 = call i32 @M_free(ptr noundef %179)
  %181 = load i32, ptr %23, align 4, !tbaa !5
  %182 = add nsw i32 %181, 1
  store i32 %182, ptr %23, align 4, !tbaa !5
  br label %31, !llvm.loop !15

183:                                              ; preds = %31
  %184 = call i32 (ptr, ...) @printf(ptr noundef @.str.29)
  %185 = load ptr, ptr %13, align 8, !tbaa !9
  %186 = call i32 @M_print(ptr noundef %185)
  %187 = load ptr, ptr %6, align 8, !tbaa !9
  %188 = load ptr, ptr %13, align 8, !tbaa !9
  %189 = call double %187(ptr noundef %188)
  %190 = call i32 (ptr, ...) @printf(ptr noundef @.str.30, double noundef %189)
  %191 = call i32 @system(ptr noundef @.str.16)
  call void @llvm.lifetime.end.p0(i64 8, ptr %24) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %23) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #4
  call void @llvm.lifetime.end.p0(i64 24, ptr %7) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #4
  ret i32 0
}

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

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #3

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

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

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 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #4 = { nounwind }

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

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

@.str.16 = external hidden unnamed_addr constant [6 x i8], align 1
@__const.main._mat_X = external hidden unnamed_addr constant [1 x [3 x double]], align 16
@.str.27 = external hidden unnamed_addr constant [20 x i8], align 1
@.str.28 = external hidden unnamed_addr constant [13 x i8], align 1
@.str.29 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.30 = external hidden unnamed_addr constant [12 x i8], align 1

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

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

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

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

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

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

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

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

; Function Attrs: nounwind uwtable
declare dso_local ptr @M_Inverse(ptr noundef) local_unnamed_addr #0

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

; Function Attrs: nounwind uwtable
declare dso_local ptr @M_T(ptr noundef) local_unnamed_addr #0

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

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

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

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

; Function Attrs: nounwind uwtable
define dso_local noundef i32 @main(i32 noundef %0, ptr nocapture noundef readnone %1) local_unnamed_addr #0 {
  %3 = alloca [1 x [3 x double]], align 16
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %3) #5
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 16 dereferenceable(24) %3, ptr noundef nonnull align 16 dereferenceable(24) @__const.main._mat_X, i64 24, i1 false)
  %4 = call ptr @Matrix_gen(i32 noundef 1, i32 noundef 3, ptr noundef nonnull %3)
  br label %5

5:                                                ; preds = %2, %77
  %.085 = phi i32 [ 0, %2 ], [ %80, %77 ]
  %.07584 = phi ptr [ null, %2 ], [ %.1, %77 ]
  %.07683 = phi ptr [ null, %2 ], [ %.177, %77 ]
  %.07882 = phi double [ 1.000000e-01, %2 ], [ %.179, %77 ]
  %.08081 = phi ptr [ %4, %2 ], [ %17, %77 ]
  %6 = icmp eq i32 %.085, 0
  %7 = call ptr @Func_derivative(ptr noundef %.08081, double noundef 1.000000e-02)
  %8 = call i32 @M_print(ptr noundef %7)
  br i1 %6, label %13, label %9

9:                                                ; preds = %5
  %10 = call ptr @M_mul(ptr noundef %7, ptr noundef %.07584)
  %11 = call i32 @M_print(ptr noundef %10)
  %12 = call i32 @M_free(ptr noundef %7)
  br label %13

13:                                               ; preds = %5, %9
  %.177 = phi ptr [ %10, %9 ], [ %7, %5 ]
  %14 = call double @Bisection_Method(ptr noundef %.08081, ptr noundef %.177)
  %15 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.27, double noundef %14)
  %16 = call i32 @M_print(ptr noundef %.08081)
  %17 = call ptr @M_add_sub(double noundef 1.000000e+00, ptr noundef %.08081, double noundef %14, ptr noundef %.177)
  %18 = call i32 @M_print(ptr noundef %17)
  br i1 %6, label %19, label %24

19:                                               ; preds = %13
  %20 = getelementptr inbounds i8, ptr %17, i64 4
  %21 = load i32, ptr %20, align 4, !tbaa !5
  %22 = call ptr @M_I(i32 noundef %21)
  %23 = call i32 @M_print(ptr noundef %22)
  br label %77

24:                                               ; preds = %13
  %25 = call ptr @M_add_sub(double noundef 1.000000e+00, ptr noundef %17, double noundef 1.000000e+00, ptr noundef %.08081)
  %26 = call i32 @M_print(ptr noundef %25)
  %27 = call ptr @M_add_sub(double noundef 1.000000e+00, ptr noundef %.177, double noundef 1.000000e+00, ptr noundef %.07683)
  %28 = call i32 @M_print(ptr noundef %27)
  %29 = call ptr @M_T(ptr noundef %25)
  %30 = call ptr @M_mul(ptr noundef %27, ptr noundef %29)
  %31 = call i32 @M_print(ptr noundef %30)
  %32 = call ptr @M_T(ptr noundef %25)
  %33 = call ptr @M_mul(ptr noundef %27, ptr noundef %32)
  %34 = call double @M_det(ptr noundef %33)
  %35 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.28, double noundef %34)
  %36 = call ptr @M_T(ptr noundef %25)
  %37 = call ptr @M_mul(ptr noundef %36, ptr noundef %27)
  %38 = call ptr @M_Inverse(ptr noundef %37)
  %39 = call i32 @M_print(ptr noundef %38)
  %40 = call ptr @M_T(ptr noundef %25)
  %41 = call ptr @M_mul(ptr noundef %40, ptr noundef %25)
  %42 = call ptr @M_T(ptr noundef %25)
  %43 = call ptr @M_mul(ptr noundef %27, ptr noundef %42)
  %44 = call double @M_det(ptr noundef %43)
  %45 = fdiv double 1.000000e+00, %44
  %46 = call ptr @M_numul(ptr noundef %41, double noundef %45)
  %47 = call i32 @M_print(ptr noundef %46)
  %48 = call ptr @M_mul(ptr noundef %27, ptr noundef %.07584)
  %49 = call ptr @M_T(ptr noundef %27)
  %50 = call ptr @M_mul(ptr noundef %48, ptr noundef %49)
  %51 = call i32 @M_print(ptr noundef %50)
  %52 = call ptr @M_mul(ptr noundef %27, ptr noundef %.07584)
  %53 = call ptr @M_T(ptr noundef %27)
  %54 = call ptr @M_mul(ptr noundef %52, ptr noundef %53)
  %55 = call double @M_det(ptr noundef %54)
  %56 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.28, double noundef %55)
  %57 = call ptr @M_T(ptr noundef %27)
  %58 = call ptr @M_mul(ptr noundef %.07584, ptr noundef %57)
  %59 = call ptr @M_mul(ptr noundef %58, ptr noundef %27)
  %60 = call ptr @M_mul(ptr noundef %59, ptr noundef %.07584)
  %61 = call i32 @M_print(ptr noundef %60)
  %62 = call ptr @M_T(ptr noundef %27)
  %63 = call ptr @M_mul(ptr noundef %.07584, ptr noundef %62)
  %64 = call ptr @M_mul(ptr noundef %63, ptr noundef %27)
  %65 = call ptr @M_mul(ptr noundef %64, ptr noundef %.07584)
  %66 = call ptr @M_mul(ptr noundef %27, ptr noundef %.07584)
  %67 = call ptr @M_T(ptr noundef %27)
  %68 = call ptr @M_mul(ptr noundef %66, ptr noundef %67)
  %69 = call double @M_det(ptr noundef %68)
  %70 = fdiv double 1.000000e+00, %69
  %71 = call ptr @M_numul(ptr noundef %65, double noundef %70)
  %72 = call i32 @M_print(ptr noundef %71)
  %73 = call ptr @M_add_sub(double noundef 1.000000e+00, ptr noundef %.07584, double noundef -1.000000e+00, ptr noundef %46)
  %74 = call ptr @M_add_sub(double noundef 1.000000e+00, ptr noundef %73, double noundef 1.000000e+00, ptr noundef %71)
  %75 = call i32 @M_print(ptr noundef %74)
  %76 = call double @M_norm(ptr noundef %25, i32 noundef 2)
  br label %77

77:                                               ; preds = %24, %19
  %.179 = phi double [ %.07882, %19 ], [ %76, %24 ]
  %.1 = phi ptr [ %22, %19 ], [ %74, %24 ]
  %78 = call i32 @M_free(ptr noundef %.08081)
  %79 = call i32 @M_free(ptr noundef %.177)
  %80 = add nuw nsw i32 %.085, 1
  %81 = fcmp ogt double %.179, 1.000000e-02
  br i1 %81, label %5, label %82, !llvm.loop !11

82:                                               ; preds = %77
  %83 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.29)
  %84 = call i32 @M_print(ptr noundef %17)
  %85 = call double @Function(ptr noundef %17)
  %86 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.30, double noundef %85)
  %87 = call i32 @system(ptr noundef nonnull @.str.16) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %3) #5
  ret i32 0
}

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

; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #4

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

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

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 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { 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 #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 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
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, !7, i64 4}
!6 = !{!"_Matrix", !7, i64 0, !7, i64 4, !10, i64 8}
!7 = !{!"int", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"any pointer", !8, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}


; Effective O3 passes: EarlyCSEPass,GVNPass,GlobalOptPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,LCSSAPass,LoopRotatePass,LoopUnrollPass,PostOrderFunctionAttrsPass,SROAPass,SimplifyCFGPass