; LLVM IR from Amoiensis/Optimization-Algorithm :: [Direct_Method]直接法/[Univariate_Search_Method]坐标轮换法 (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 }
%struct._Elementary_Transformation = type { i32, i32, double, ptr, ptr }
%struct._Lower_triangular_transformation = type { ptr, ptr }

@.str.8 = external hidden unnamed_addr constant [24 x i8], align 1
@.str.9 = 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: nounwind allocsize(0)
declare noalias ptr @malloc(i64 noundef) #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
declare dso_local ptr @Matrix_copy(ptr noundef) #2

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

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

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

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

; Function Attrs: nounwind uwtable
define dso_local ptr @M_Lowtri_(ptr noundef %0) #2 {
  %2 = alloca ptr, align 8
  %3 = alloca ptr, align 8
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca ptr, align 8
  %9 = alloca ptr, align 8
  %10 = alloca ptr, align 8
  %11 = alloca i32, align 4
  %12 = alloca ptr, align 8
  %13 = alloca ptr, align 8
  store ptr %0, ptr %2, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %3) #4
  %14 = load ptr, ptr %2, align 8, !tbaa !5
  %15 = call ptr @Matrix_copy(ptr noundef %14)
  store ptr %15, ptr %3, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #4
  store ptr null, ptr %8, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #4
  store ptr null, ptr %9, align 8, !tbaa !5
  store i32 0, ptr %4, align 4, !tbaa !9
  br label %16

16:                                               ; preds = %184, %1
  %17 = load i32, ptr %4, align 4, !tbaa !9
  %18 = load ptr, ptr %3, align 8, !tbaa !5
  %19 = getelementptr inbounds %struct._Matrix, ptr %18, i32 0, i32 0
  %20 = load i32, ptr %19, align 8, !tbaa !11
  %21 = icmp slt i32 %17, %20
  br i1 %21, label %22, label %187

22:                                               ; preds = %16
  %23 = load i32, ptr %4, align 4, !tbaa !9
  %24 = add nsw i32 %23, 1
  store i32 %24, ptr %5, align 4, !tbaa !9
  br label %25

25:                                               ; preds = %180, %22
  %26 = load i32, ptr %5, align 4, !tbaa !9
  %27 = load ptr, ptr %3, align 8, !tbaa !5
  %28 = getelementptr inbounds %struct._Matrix, ptr %27, i32 0, i32 1
  %29 = load i32, ptr %28, align 4, !tbaa !13
  %30 = icmp slt i32 %26, %29
  br i1 %30, label %31, label %183

31:                                               ; preds = %25
  store i32 0, ptr %7, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #4
  %32 = call noalias ptr @malloc(i64 noundef 32) #5
  store ptr %32, ptr %10, align 8, !tbaa !5
  %33 = load i32, ptr %5, align 4, !tbaa !9
  %34 = add nsw i32 %33, 1
  %35 = load ptr, ptr %10, align 8, !tbaa !5
  %36 = getelementptr inbounds %struct._Elementary_Transformation, ptr %35, i32 0, i32 0
  store i32 %34, ptr %36, align 8, !tbaa !14
  %37 = load i32, ptr %4, align 4, !tbaa !9
  %38 = add nsw i32 %37, 1
  %39 = load ptr, ptr %10, align 8, !tbaa !5
  %40 = getelementptr inbounds %struct._Elementary_Transformation, ptr %39, i32 0, i32 1
  store i32 %38, ptr %40, align 4, !tbaa !17
  %41 = load ptr, ptr %3, align 8, !tbaa !5
  %42 = getelementptr inbounds %struct._Matrix, ptr %41, i32 0, i32 2
  %43 = load ptr, ptr %42, align 8, !tbaa !18
  %44 = load ptr, ptr %3, align 8, !tbaa !5
  %45 = getelementptr inbounds %struct._Matrix, ptr %44, i32 0, i32 1
  %46 = load i32, ptr %45, align 4, !tbaa !13
  %47 = load i32, ptr %4, align 4, !tbaa !9
  %48 = mul nsw i32 %46, %47
  %49 = load i32, ptr %4, align 4, !tbaa !9
  %50 = add nsw i32 %48, %49
  %51 = sext i32 %50 to i64
  %52 = getelementptr inbounds double, ptr %43, i64 %51
  %53 = load double, ptr %52, align 8, !tbaa !19
  %54 = fcmp une double %53, 0.000000e+00
  br i1 %54, label %55, label %85

55:                                               ; preds = %31
  %56 = load ptr, ptr %3, align 8, !tbaa !5
  %57 = getelementptr inbounds %struct._Matrix, ptr %56, i32 0, i32 2
  %58 = load ptr, ptr %57, align 8, !tbaa !18
  %59 = load ptr, ptr %3, align 8, !tbaa !5
  %60 = getelementptr inbounds %struct._Matrix, ptr %59, i32 0, i32 1
  %61 = load i32, ptr %60, align 4, !tbaa !13
  %62 = load i32, ptr %4, align 4, !tbaa !9
  %63 = mul nsw i32 %61, %62
  %64 = load i32, ptr %5, align 4, !tbaa !9
  %65 = add nsw i32 %63, %64
  %66 = sext i32 %65 to i64
  %67 = getelementptr inbounds double, ptr %58, i64 %66
  %68 = load double, ptr %67, align 8, !tbaa !19
  %69 = load ptr, ptr %3, align 8, !tbaa !5
  %70 = getelementptr inbounds %struct._Matrix, ptr %69, i32 0, i32 2
  %71 = load ptr, ptr %70, align 8, !tbaa !18
  %72 = load ptr, ptr %3, align 8, !tbaa !5
  %73 = getelementptr inbounds %struct._Matrix, ptr %72, i32 0, i32 1
  %74 = load i32, ptr %73, align 4, !tbaa !13
  %75 = load i32, ptr %4, align 4, !tbaa !9
  %76 = mul nsw i32 %74, %75
  %77 = load i32, ptr %4, align 4, !tbaa !9
  %78 = add nsw i32 %76, %77
  %79 = sext i32 %78 to i64
  %80 = getelementptr inbounds double, ptr %71, i64 %79
  %81 = load double, ptr %80, align 8, !tbaa !19
  %82 = fdiv double %68, %81
  %83 = load ptr, ptr %10, align 8, !tbaa !5
  %84 = getelementptr inbounds %struct._Elementary_Transformation, ptr %83, i32 0, i32 2
  store double %82, ptr %84, align 8, !tbaa !20
  br label %131

85:                                               ; preds = %31
  %86 = load ptr, ptr %10, align 8, !tbaa !5
  %87 = getelementptr inbounds %struct._Elementary_Transformation, ptr %86, i32 0, i32 2
  store double 0.000000e+00, ptr %87, align 8, !tbaa !20
  %88 = load i32, ptr %4, align 4, !tbaa !9
  %89 = add nsw i32 %88, 1
  store i32 %89, ptr %6, align 4, !tbaa !9
  br label %90

90:                                               ; preds = %123, %85
  %91 = load i32, ptr %6, align 4, !tbaa !9
  %92 = load ptr, ptr %3, align 8, !tbaa !5
  %93 = getelementptr inbounds %struct._Matrix, ptr %92, i32 0, i32 0
  %94 = load i32, ptr %93, align 8, !tbaa !11
  %95 = icmp slt i32 %91, %94
  br i1 %95, label %96, label %126

96:                                               ; preds = %90
  store i32 1, ptr %7, align 4, !tbaa !9
  %97 = load ptr, ptr %3, align 8, !tbaa !5
  %98 = getelementptr inbounds %struct._Matrix, ptr %97, i32 0, i32 2
  %99 = load ptr, ptr %98, align 8, !tbaa !18
  %100 = load ptr, ptr %3, align 8, !tbaa !5
  %101 = getelementptr inbounds %struct._Matrix, ptr %100, i32 0, i32 1
  %102 = load i32, ptr %101, align 4, !tbaa !13
  %103 = load i32, ptr %6, align 4, !tbaa !9
  %104 = mul nsw i32 %102, %103
  %105 = load i32, ptr %4, align 4, !tbaa !9
  %106 = add nsw i32 %104, %105
  %107 = sext i32 %106 to i64
  %108 = getelementptr inbounds double, ptr %99, i64 %107
  %109 = load double, ptr %108, align 8, !tbaa !19
  %110 = fcmp une double %109, 0.000000e+00
  br i1 %110, label %111, label %122

111:                                              ; preds = %96
  %112 = load i32, ptr %4, align 4, !tbaa !9
  %113 = add nsw i32 %112, 1
  %114 = sub nsw i32 0, %113
  %115 = load ptr, ptr %10, align 8, !tbaa !5
  %116 = getelementptr inbounds %struct._Elementary_Transformation, ptr %115, i32 0, i32 0
  store i32 %114, ptr %116, align 8, !tbaa !14
  %117 = load i32, ptr %6, align 4, !tbaa !9
  %118 = add nsw i32 %117, 1
  %119 = sub nsw i32 0, %118
  %120 = load ptr, ptr %10, align 8, !tbaa !5
  %121 = getelementptr inbounds %struct._Elementary_Transformation, ptr %120, i32 0, i32 1
  store i32 %119, ptr %121, align 4, !tbaa !17
  store i32 2, ptr %7, align 4, !tbaa !9
  br label %126

122:                                              ; preds = %96
  br label %123

123:                                              ; preds = %122
  %124 = load i32, ptr %6, align 4, !tbaa !9
  %125 = add nsw i32 %124, 1
  store i32 %125, ptr %6, align 4, !tbaa !9
  br label %90, !llvm.loop !21

126:                                              ; preds = %111, %90
  %127 = load i32, ptr %7, align 4, !tbaa !9
  %128 = icmp eq i32 %127, 1
  br i1 %128, label %129, label %130

129:                                              ; preds = %126
  store i32 5, ptr %11, align 4
  br label %177

130:                                              ; preds = %126
  br label %131

131:                                              ; preds = %130, %55
  %132 = load ptr, ptr %10, align 8, !tbaa !5
  %133 = getelementptr inbounds %struct._Elementary_Transformation, ptr %132, i32 0, i32 3
  store ptr null, ptr %133, align 8, !tbaa !23
  %134 = load ptr, ptr %10, align 8, !tbaa !5
  %135 = getelementptr inbounds %struct._Elementary_Transformation, ptr %134, i32 0, i32 4
  store ptr null, ptr %135, align 8, !tbaa !24
  %136 = load ptr, ptr %9, align 8, !tbaa !5
  %137 = icmp eq ptr %136, null
  br i1 %137, label %138, label %142

138:                                              ; preds = %131
  %139 = load ptr, ptr %10, align 8, !tbaa !5
  store ptr %139, ptr %9, align 8, !tbaa !5
  %140 = load ptr, ptr %10, align 8, !tbaa !5
  %141 = getelementptr inbounds %struct._Elementary_Transformation, ptr %140, i32 0, i32 3
  store ptr null, ptr %141, align 8, !tbaa !23
  br label %146

142:                                              ; preds = %131
  %143 = load ptr, ptr %8, align 8, !tbaa !5
  %144 = load ptr, ptr %10, align 8, !tbaa !5
  %145 = getelementptr inbounds %struct._Elementary_Transformation, ptr %144, i32 0, i32 3
  store ptr %143, ptr %145, align 8, !tbaa !23
  br label %146

146:                                              ; preds = %142, %138
  %147 = load i32, ptr %4, align 4, !tbaa !9
  %148 = add nsw i32 %147, 1
  %149 = load ptr, ptr %3, align 8, !tbaa !5
  %150 = getelementptr inbounds %struct._Matrix, ptr %149, i32 0, i32 1
  %151 = load i32, ptr %150, align 4, !tbaa !13
  %152 = icmp eq i32 %148, %151
  br i1 %152, label %153, label %156

153:                                              ; preds = %146
  %154 = load ptr, ptr %10, align 8, !tbaa !5
  %155 = getelementptr inbounds %struct._Elementary_Transformation, ptr %154, i32 0, i32 4
  store ptr null, ptr %155, align 8, !tbaa !24
  br label %164

156:                                              ; preds = %146
  %157 = load ptr, ptr %8, align 8, !tbaa !5
  %158 = icmp ne ptr %157, null
  br i1 %158, label %159, label %163

159:                                              ; preds = %156
  %160 = load ptr, ptr %10, align 8, !tbaa !5
  %161 = load ptr, ptr %8, align 8, !tbaa !5
  %162 = getelementptr inbounds %struct._Elementary_Transformation, ptr %161, i32 0, i32 4
  store ptr %160, ptr %162, align 8, !tbaa !24
  br label %163

163:                                              ; preds = %159, %156
  br label %164

164:                                              ; preds = %163, %153
  %165 = load ptr, ptr %3, align 8, !tbaa !5
  %166 = load ptr, ptr %10, align 8, !tbaa !5
  %167 = call i32 @M_E_trans(ptr noundef %165, ptr noundef %166, i32 noundef 0)
  %168 = load ptr, ptr %3, align 8, !tbaa !5
  %169 = call i32 @M_print(ptr noundef %168)
  %170 = load ptr, ptr %10, align 8, !tbaa !5
  store ptr %170, ptr %8, align 8, !tbaa !5
  %171 = load i32, ptr %7, align 4, !tbaa !9
  %172 = icmp eq i32 %171, 2
  br i1 %172, label %173, label %176

173:                                              ; preds = %164
  %174 = load i32, ptr %4, align 4, !tbaa !9
  %175 = sub nsw i32 %174, 1
  store i32 %175, ptr %4, align 4, !tbaa !9
  store i32 5, ptr %11, align 4
  br label %177

176:                                              ; preds = %164
  store i32 0, ptr %11, align 4
  br label %177

177:                                              ; preds = %176, %173, %129
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #4
  %178 = load i32, ptr %11, align 4
  switch i32 %178, label %206 [
    i32 0, label %179
    i32 5, label %183
  ]

179:                                              ; preds = %177
  br label %180

180:                                              ; preds = %179
  %181 = load i32, ptr %5, align 4, !tbaa !9
  %182 = add nsw i32 %181, 1
  store i32 %182, ptr %5, align 4, !tbaa !9
  br label %25, !llvm.loop !25

183:                                              ; preds = %177, %25
  br label %184

184:                                              ; preds = %183
  %185 = load i32, ptr %4, align 4, !tbaa !9
  %186 = add nsw i32 %185, 1
  store i32 %186, ptr %4, align 4, !tbaa !9
  br label %16, !llvm.loop !26

187:                                              ; preds = %16
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #4
  %188 = load ptr, ptr %9, align 8, !tbaa !5
  %189 = load ptr, ptr %3, align 8, !tbaa !5
  %190 = getelementptr inbounds %struct._Matrix, ptr %189, i32 0, i32 0
  %191 = load i32, ptr %190, align 8, !tbaa !11
  %192 = call ptr @Etrans_2_Matrix(ptr noundef %188, i32 noundef %191, i32 noundef 0)
  store ptr %192, ptr %12, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #4
  %193 = call noalias ptr @malloc(i64 noundef 16) #5
  store ptr %193, ptr %13, align 8, !tbaa !5
  %194 = load ptr, ptr %12, align 8, !tbaa !5
  %195 = load ptr, ptr %13, align 8, !tbaa !5
  %196 = getelementptr inbounds %struct._Lower_triangular_transformation, ptr %195, i32 0, i32 0
  store ptr %194, ptr %196, align 8, !tbaa !27
  %197 = load ptr, ptr %3, align 8, !tbaa !5
  %198 = load ptr, ptr %13, align 8, !tbaa !5
  %199 = getelementptr inbounds %struct._Lower_triangular_transformation, ptr %198, i32 0, i32 1
  store ptr %197, ptr %199, align 8, !tbaa !29
  %200 = load ptr, ptr %2, align 8, !tbaa !5
  %201 = call i32 (ptr, ...) @printf(ptr noundef @.str.9, ptr noundef %200)
  %202 = load ptr, ptr %3, align 8, !tbaa !5
  %203 = load ptr, ptr %12, align 8, !tbaa !5
  %204 = call i32 (ptr, ...) @printf(ptr noundef @.str.8, ptr noundef %202, ptr noundef %203)
  %205 = load ptr, ptr %13, align 8, !tbaa !5
  store i32 1, ptr %11, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #4
  ret ptr %205

206:                                              ; preds = %177
  unreachable
}

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

!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 = !{!"int", !7, i64 0}
!11 = !{!12, !10, i64 0}
!12 = !{!"_Matrix", !10, i64 0, !10, i64 4, !6, i64 8}
!13 = !{!12, !10, i64 4}
!14 = !{!15, !10, i64 0}
!15 = !{!"_Elementary_Transformation", !10, i64 0, !10, i64 4, !16, i64 8, !6, i64 16, !6, i64 24}
!16 = !{!"double", !7, i64 0}
!17 = !{!15, !10, i64 4}
!18 = !{!12, !6, i64 8}
!19 = !{!16, !16, i64 0}
!20 = !{!15, !16, i64 8}
!21 = distinct !{!21, !22}
!22 = !{!"llvm.loop.mustprogress"}
!23 = !{!15, !6, i64 16}
!24 = !{!15, !6, i64 24}
!25 = distinct !{!25, !22}
!26 = distinct !{!26, !22}
!27 = !{!28, !6, i64 0}
!28 = !{!"_Lower_triangular_transformation", !6, i64 0, !6, i64 8}
!29 = !{!28, !6, i64 8}


; 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.8 = external hidden unnamed_addr constant [24 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [22 x i8], align 1

; Function Attrs: mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite)
declare noalias noundef ptr @malloc(i64 noundef) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
declare dso_local ptr @Matrix_copy(ptr noundef) local_unnamed_addr #1

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

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

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

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

; Function Attrs: nounwind uwtable
define dso_local noalias noundef ptr @M_Lowtri_(ptr noundef %0) local_unnamed_addr #1 {
  %2 = tail call ptr @Matrix_copy(ptr noundef %0)
  %3 = load i32, ptr %2, align 8, !tbaa !5
  %4 = icmp sgt i32 %3, 0
  br i1 %4, label %.lr.ph108, label %._crit_edge109

.lr.ph108:                                        ; preds = %1
  %5 = getelementptr inbounds i8, ptr %2, i64 4
  %6 = getelementptr inbounds i8, ptr %2, i64 8
  br label %7

7:                                                ; preds = %.lr.ph108, %.thread86
  %.0106 = phi i32 [ 0, %.lr.ph108 ], [ %.pre-phi, %.thread86 ]
  %.071105 = phi ptr [ null, %.lr.ph108 ], [ %.4, %.thread86 ]
  %.075104 = phi ptr [ null, %.lr.ph108 ], [ %.378, %.thread86 ]
  %8 = add nsw i32 %.0106, 1
  %9 = xor i32 %.0106, -1
  %10 = sext i32 %8 to i64
  %11 = sext i32 %.0106 to i64
  br label %12

12:                                               ; preds = %51, %7
  %.176 = phi ptr [ %.075104, %7 ], [ %16, %51 ]
  %.172 = phi ptr [ %.071105, %7 ], [ %..172, %51 ]
  %.068 = phi i32 [ %8, %7 ], [ %17, %51 ]
  %13 = load i32, ptr %5, align 4, !tbaa !11
  %14 = icmp slt i32 %.068, %13
  br i1 %14, label %15, label %.thread86

15:                                               ; preds = %12
  %16 = tail call noalias dereferenceable_or_null(32) ptr @malloc(i64 noundef 32) #3
  %17 = add nsw i32 %.068, 1
  store i32 %17, ptr %16, align 8, !tbaa !12
  %18 = getelementptr inbounds i8, ptr %16, i64 4
  store i32 %8, ptr %18, align 4, !tbaa !15
  %19 = load ptr, ptr %6, align 8, !tbaa !16
  %20 = mul nsw i32 %13, %.0106
  %21 = add nsw i32 %20, %.0106
  %22 = sext i32 %21 to i64
  %23 = getelementptr inbounds double, ptr %19, i64 %22
  %24 = load double, ptr %23, align 8, !tbaa !17
  %25 = fcmp une double %24, 0.000000e+00
  br i1 %25, label %26, label %33

26:                                               ; preds = %15
  %27 = add nsw i32 %20, %.068
  %28 = sext i32 %27 to i64
  %29 = getelementptr inbounds double, ptr %19, i64 %28
  %30 = load double, ptr %29, align 8, !tbaa !17
  %31 = fdiv double %30, %24
  %32 = getelementptr inbounds i8, ptr %16, i64 8
  store double %31, ptr %32, align 8, !tbaa !18
  br label %.critedge

33:                                               ; preds = %15
  %34 = getelementptr inbounds i8, ptr %16, i64 8
  store double 0.000000e+00, ptr %34, align 8, !tbaa !18
  %35 = load i32, ptr %2, align 8, !tbaa !5
  %36 = icmp slt i32 %8, %35
  br i1 %36, label %.lr.ph.preheader, label %.critedge

.lr.ph.preheader:                                 ; preds = %33
  %37 = sext i32 %13 to i64
  %invariant.gep = getelementptr double, ptr %19, i64 %11
  br label %.lr.ph

.lr.ph:                                           ; preds = %.lr.ph.preheader, %43
  %indvars.iv = phi i64 [ %10, %.lr.ph.preheader ], [ %indvars.iv.next, %43 ]
  %38 = mul nsw i64 %indvars.iv, %37
  %gep = getelementptr double, ptr %invariant.gep, i64 %38
  %39 = load double, ptr %gep, align 8, !tbaa !17
  %40 = fcmp une double %39, 0.000000e+00
  br i1 %40, label %.thread, label %43

.thread:                                          ; preds = %.lr.ph
  %41 = trunc nsw i64 %indvars.iv to i32
  store i32 %9, ptr %16, align 8, !tbaa !12
  %42 = xor i32 %41, -1
  store i32 %42, ptr %18, align 4, !tbaa !15
  br label %.critedge

43:                                               ; preds = %.lr.ph
  %indvars.iv.next = add nsw i64 %indvars.iv, 1
  %lftr.wideiv = trunc i64 %indvars.iv.next to i32
  %exitcond.not = icmp eq i32 %35, %lftr.wideiv
  br i1 %exitcond.not, label %.thread86, label %.lr.ph, !llvm.loop !19

.critedge:                                        ; preds = %33, %.thread, %26
  %44 = phi i1 [ false, %26 ], [ true, %.thread ], [ false, %33 ]
  %45 = getelementptr inbounds i8, ptr %16, i64 16
  %46 = icmp eq ptr %.172, null
  %..176 = select i1 %46, ptr null, ptr %.176
  %..172 = select i1 %46, ptr %16, ptr %.172
  %47 = getelementptr inbounds i8, ptr %16, i64 24
  store i64 0, ptr %47, align 8
  store ptr %..176, ptr %45, align 8, !tbaa !21
  %48 = icmp eq i32 %8, %13
  %.not = icmp eq ptr %.176, null
  %or.cond = select i1 %48, i1 true, i1 %.not
  br i1 %or.cond, label %51, label %49

49:                                               ; preds = %.critedge
  %50 = getelementptr inbounds i8, ptr %.176, i64 24
  store ptr %16, ptr %50, align 8, !tbaa !22
  br label %51

51:                                               ; preds = %.critedge, %49
  %52 = tail call i32 @M_E_trans(ptr noundef nonnull %2, ptr noundef nonnull %16, i32 noundef 0)
  %53 = tail call i32 @M_print(ptr noundef nonnull %2)
  br i1 %44, label %.thread86, label %12, !llvm.loop !23

.thread86:                                        ; preds = %12, %51, %43
  %.pre-phi = phi i32 [ %8, %43 ], [ %8, %12 ], [ %.0106, %51 ]
  %.378 = phi ptr [ %.176, %43 ], [ %.176, %12 ], [ %16, %51 ]
  %.4 = phi ptr [ %.172, %43 ], [ %.172, %12 ], [ %..172, %51 ]
  %54 = load i32, ptr %2, align 8, !tbaa !5
  %55 = icmp slt i32 %.pre-phi, %54
  br i1 %55, label %7, label %._crit_edge109, !llvm.loop !24

._crit_edge109:                                   ; preds = %.thread86, %1
  %.071.lcssa = phi ptr [ null, %1 ], [ %.4, %.thread86 ]
  %.lcssa94 = phi i32 [ %3, %1 ], [ %54, %.thread86 ]
  %56 = tail call ptr @Etrans_2_Matrix(ptr noundef %.071.lcssa, i32 noundef %.lcssa94, i32 noundef 0)
  %57 = tail call noalias dereferenceable_or_null(16) ptr @malloc(i64 noundef 16) #3
  store ptr %56, ptr %57, align 8, !tbaa !25
  %58 = getelementptr inbounds i8, ptr %57, i64 8
  store ptr %2, ptr %58, align 8, !tbaa !27
  %59 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.9, ptr noundef %0)
  %60 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.8, ptr noundef nonnull %2, ptr noundef %56)
  ret ptr %57
}

attributes #0 = { mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite) "alloc-family"="malloc" "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 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 #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 = { nounwind allocsize(0) }

!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 0}
!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 = !{!6, !7, i64 4}
!12 = !{!13, !7, i64 0}
!13 = !{!"_Elementary_Transformation", !7, i64 0, !7, i64 4, !14, i64 8, !10, i64 16, !10, i64 24}
!14 = !{!"double", !8, i64 0}
!15 = !{!13, !7, i64 4}
!16 = !{!6, !10, i64 8}
!17 = !{!14, !14, i64 0}
!18 = !{!13, !14, i64 8}
!19 = distinct !{!19, !20}
!20 = !{!"llvm.loop.mustprogress"}
!21 = !{!13, !10, i64 16}
!22 = !{!13, !10, i64 24}
!23 = distinct !{!23, !20}
!24 = distinct !{!24, !20}
!25 = !{!26, !10, i64 0}
!26 = !{!"_Lower_triangular_transformation", !10, i64 0, !10, i64 8}
!27 = !{!26, !10, i64 8}


; Effective O3 passes: BDCEPass,CorrelatedValuePropagationPass,DSEPass,EarlyCSEPass,GVNPass,GlobalOptPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LICMPass,LoopInstSimplifyPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,MemCpyOptPass,PostOrderFunctionAttrsPass,ReassociatePass,SROAPass,SimplifyCFGPass,TailCallElimPass