; LLVM IR from ljm941004/HYPERCV_PUBLIC :: modules/algorithm/src (pca)

; 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.HyperMat = type { i32, i32, i32, i32, [3 x i8], ptr, ptr }
%struct.SIMPLE_MAT = type { i32, i32, i32, i32, i32, ptr }

@.str = external hidden unnamed_addr constant [8 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [18 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [2 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local void @hyper_mat_pca(ptr noundef %0, ptr noundef %1, i32 noundef %2) #0 {
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca ptr, align 8
  %11 = alloca ptr, align 8
  %12 = alloca ptr, align 8
  %13 = alloca ptr, align 8
  %14 = alloca ptr, align 8
  %15 = alloca ptr, align 8
  %16 = alloca i32, align 4
  %17 = alloca ptr, align 8
  %18 = alloca i32, align 4
  %19 = alloca ptr, align 8
  store ptr %0, ptr %4, align 8, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !5
  store i32 %2, ptr %6, align 4, !tbaa !9
  %20 = load ptr, ptr %4, align 8, !tbaa !5
  %21 = getelementptr inbounds %struct.HyperMat, ptr %20, i32 0, i32 3
  store i32 4, ptr %21, align 4, !tbaa !11
  br i1 true, label %22, label %23

22:                                               ; preds = %3
  br label %27

23:                                               ; preds = %3
  %24 = call i32 (ptr, ...) @printf(ptr noundef @.str)
  %25 = call i32 (ptr, ...) @printf(ptr noundef @.str.1)
  %26 = call i32 (ptr, ...) @printf(ptr noundef @.str.2)
  call void @exit(i32 noundef 1) #5
  unreachable

27:                                               ; preds = %22
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #6
  %28 = load ptr, ptr %4, align 8, !tbaa !5
  %29 = getelementptr inbounds %struct.HyperMat, ptr %28, i32 0, i32 0
  %30 = load i32, ptr %29, align 8, !tbaa !13
  store i32 %30, ptr %7, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #6
  %31 = load ptr, ptr %4, align 8, !tbaa !5
  %32 = getelementptr inbounds %struct.HyperMat, ptr %31, i32 0, i32 1
  %33 = load i32, ptr %32, align 4, !tbaa !14
  store i32 %33, ptr %8, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #6
  %34 = load ptr, ptr %4, align 8, !tbaa !5
  %35 = getelementptr inbounds %struct.HyperMat, ptr %34, i32 0, i32 2
  %36 = load i32, ptr %35, align 8, !tbaa !15
  store i32 %36, ptr %9, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #6
  %37 = load i32, ptr %8, align 4, !tbaa !9
  %38 = load i32, ptr %7, align 4, !tbaa !9
  %39 = call ptr @create_simple_mat(i32 noundef %37, i32 noundef %38, i32 noundef 4, i32 noundef 1)
  store ptr %39, ptr %10, align 8, !tbaa !5
  %40 = load ptr, ptr %4, align 8, !tbaa !5
  %41 = load ptr, ptr %10, align 8, !tbaa !5
  call void @hyper_mat_mean(ptr noundef %40, ptr noundef %41)
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #6
  %42 = load ptr, ptr %4, align 8, !tbaa !5
  %43 = load i32, ptr %7, align 4, !tbaa !9
  %44 = load i32, ptr %8, align 4, !tbaa !9
  %45 = mul nsw i32 %43, %44
  %46 = load i32, ptr %9, align 4, !tbaa !9
  %47 = call ptr @reshape_hypermat_2_simplemat(ptr noundef %42, i32 noundef %45, i32 noundef %46)
  store ptr %47, ptr %11, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #6
  %48 = load i32, ptr %9, align 4, !tbaa !9
  %49 = load i32, ptr %9, align 4, !tbaa !9
  %50 = call ptr @create_simple_mat(i32 noundef %48, i32 noundef %49, i32 noundef 4, i32 noundef 1)
  store ptr %50, ptr %12, align 8, !tbaa !5
  %51 = load ptr, ptr %11, align 8, !tbaa !5
  %52 = load ptr, ptr %10, align 8, !tbaa !5
  %53 = load ptr, ptr %12, align 8, !tbaa !5
  call void @cal_covariance_matrix(ptr noundef %51, ptr noundef %52, ptr noundef %53)
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #6
  %54 = load ptr, ptr %12, align 8, !tbaa !5
  %55 = call ptr @simple_mat_copy(ptr noundef %54)
  store ptr %55, ptr %13, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #6
  %56 = load ptr, ptr %12, align 8, !tbaa !5
  %57 = getelementptr inbounds %struct.SIMPLE_MAT, ptr %56, i32 0, i32 0
  %58 = load i32, ptr %57, align 8, !tbaa !16
  %59 = load ptr, ptr %12, align 8, !tbaa !5
  %60 = getelementptr inbounds %struct.SIMPLE_MAT, ptr %59, i32 0, i32 1
  %61 = load i32, ptr %60, align 4, !tbaa !18
  %62 = call ptr @create_simple_mat(i32 noundef %58, i32 noundef %61, i32 noundef 4, i32 noundef 1)
  store ptr %62, ptr %14, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #6
  %63 = load ptr, ptr %12, align 8, !tbaa !5
  %64 = getelementptr inbounds %struct.SIMPLE_MAT, ptr %63, i32 0, i32 0
  %65 = load i32, ptr %64, align 8, !tbaa !16
  %66 = load ptr, ptr %12, align 8, !tbaa !5
  %67 = getelementptr inbounds %struct.SIMPLE_MAT, ptr %66, i32 0, i32 1
  %68 = load i32, ptr %67, align 4, !tbaa !18
  %69 = call ptr @create_simple_mat(i32 noundef %65, i32 noundef %68, i32 noundef 4, i32 noundef 1)
  store ptr %69, ptr %15, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #6
  store i32 0, ptr %16, align 4, !tbaa !9
  br label %70

70:                                               ; preds = %98, %27
  %71 = load i32, ptr %16, align 4, !tbaa !9
  %72 = load i32, ptr %6, align 4, !tbaa !9
  %73 = icmp slt i32 %71, %72
  br i1 %73, label %75, label %74

74:                                               ; preds = %70
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #6
  br label %101

75:                                               ; preds = %70
  %76 = load ptr, ptr %13, align 8, !tbaa !5
  %77 = getelementptr inbounds %struct.SIMPLE_MAT, ptr %76, i32 0, i32 5
  %78 = load ptr, ptr %77, align 8, !tbaa !19
  %79 = load ptr, ptr %14, align 8, !tbaa !5
  %80 = getelementptr inbounds %struct.SIMPLE_MAT, ptr %79, i32 0, i32 5
  %81 = load ptr, ptr %80, align 8, !tbaa !19
  %82 = load ptr, ptr %15, align 8, !tbaa !5
  %83 = getelementptr inbounds %struct.SIMPLE_MAT, ptr %82, i32 0, i32 5
  %84 = load ptr, ptr %83, align 8, !tbaa !19
  %85 = load i32, ptr %9, align 4, !tbaa !9
  call void @matrix_QR_float(ptr noundef %78, ptr noundef %81, ptr noundef %84, i32 noundef %85)
  %86 = load ptr, ptr %14, align 8, !tbaa !5
  %87 = getelementptr inbounds %struct.SIMPLE_MAT, ptr %86, i32 0, i32 5
  %88 = load ptr, ptr %87, align 8, !tbaa !19
  %89 = load ptr, ptr %15, align 8, !tbaa !5
  %90 = getelementptr inbounds %struct.SIMPLE_MAT, ptr %89, i32 0, i32 5
  %91 = load ptr, ptr %90, align 8, !tbaa !19
  %92 = load ptr, ptr %13, align 8, !tbaa !5
  %93 = getelementptr inbounds %struct.SIMPLE_MAT, ptr %92, i32 0, i32 5
  %94 = load ptr, ptr %93, align 8, !tbaa !19
  %95 = load i32, ptr %9, align 4, !tbaa !9
  %96 = load i32, ptr %9, align 4, !tbaa !9
  %97 = load i32, ptr %9, align 4, !tbaa !9
  call void @MulMatrix_float(ptr noundef %88, ptr noundef %91, ptr noundef %94, i32 noundef %95, i32 noundef %96, i32 noundef %97)
  br label %98

98:                                               ; preds = %75
  %99 = load i32, ptr %16, align 4, !tbaa !9
  %100 = add nsw i32 %99, 1
  store i32 %100, ptr %16, align 4, !tbaa !9
  br label %70, !llvm.loop !20

101:                                              ; preds = %74
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #6
  %102 = load i32, ptr %9, align 4, !tbaa !9
  %103 = sext i32 %102 to i64
  %104 = mul i64 %103, 4
  %105 = call noalias ptr @malloc(i64 noundef %104) #7
  store ptr %105, ptr %17, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #6
  store i32 0, ptr %18, align 4, !tbaa !9
  br label %106

106:                                              ; preds = %127, %101
  %107 = load i32, ptr %18, align 4, !tbaa !9
  %108 = load i32, ptr %9, align 4, !tbaa !9
  %109 = icmp slt i32 %107, %108
  br i1 %109, label %111, label %110

110:                                              ; preds = %106
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #6
  br label %130

111:                                              ; preds = %106
  %112 = load ptr, ptr %13, align 8, !tbaa !5
  %113 = getelementptr inbounds %struct.SIMPLE_MAT, ptr %112, i32 0, i32 5
  %114 = load ptr, ptr %113, align 8, !tbaa !19
  %115 = load i32, ptr %18, align 4, !tbaa !9
  %116 = load i32, ptr %9, align 4, !tbaa !9
  %117 = mul nsw i32 %115, %116
  %118 = load i32, ptr %18, align 4, !tbaa !9
  %119 = add nsw i32 %117, %118
  %120 = sext i32 %119 to i64
  %121 = getelementptr inbounds float, ptr %114, i64 %120
  %122 = load float, ptr %121, align 4, !tbaa !22
  %123 = load ptr, ptr %17, align 8, !tbaa !5
  %124 = load i32, ptr %18, align 4, !tbaa !9
  %125 = sext i32 %124 to i64
  %126 = getelementptr inbounds float, ptr %123, i64 %125
  store float %122, ptr %126, align 4, !tbaa !22
  br label %127

127:                                              ; preds = %111
  %128 = load i32, ptr %18, align 4, !tbaa !9
  %129 = add nsw i32 %128, 1
  store i32 %129, ptr %18, align 4, !tbaa !9
  br label %106, !llvm.loop !24

130:                                              ; preds = %110
  %131 = load ptr, ptr %17, align 8, !tbaa !5
  %132 = load i32, ptr %9, align 4, !tbaa !9
  call void @sort_array_down_float(ptr noundef %131, i32 noundef %132)
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #6
  %133 = load ptr, ptr %14, align 8, !tbaa !5
  %134 = call ptr @simple_mat_copy(ptr noundef %133)
  store ptr %134, ptr %19, align 8, !tbaa !5
  %135 = load ptr, ptr %12, align 8, !tbaa !5
  %136 = getelementptr inbounds %struct.SIMPLE_MAT, ptr %135, i32 0, i32 5
  %137 = load ptr, ptr %136, align 8, !tbaa !19
  %138 = load ptr, ptr %19, align 8, !tbaa !5
  %139 = getelementptr inbounds %struct.SIMPLE_MAT, ptr %138, i32 0, i32 5
  %140 = load ptr, ptr %139, align 8, !tbaa !19
  %141 = load ptr, ptr %17, align 8, !tbaa !5
  %142 = load i32, ptr %9, align 4, !tbaa !9
  %143 = load i32, ptr %9, align 4, !tbaa !9
  call void @cal_eigen_vector_float(ptr noundef %137, ptr noundef %140, ptr noundef %141, i32 noundef %142, i32 noundef %143)
  %144 = load ptr, ptr %11, align 8, !tbaa !5
  %145 = getelementptr inbounds %struct.SIMPLE_MAT, ptr %144, i32 0, i32 5
  %146 = load ptr, ptr %145, align 8, !tbaa !19
  %147 = load ptr, ptr %19, align 8, !tbaa !5
  %148 = getelementptr inbounds %struct.SIMPLE_MAT, ptr %147, i32 0, i32 5
  %149 = load ptr, ptr %148, align 8, !tbaa !19
  %150 = load ptr, ptr %5, align 8, !tbaa !5
  %151 = getelementptr inbounds %struct.HyperMat, ptr %150, i32 0, i32 5
  %152 = load ptr, ptr %151, align 8, !tbaa !25
  %153 = load i32, ptr %7, align 4, !tbaa !9
  %154 = load i32, ptr %8, align 4, !tbaa !9
  %155 = mul nsw i32 %153, %154
  %156 = load i32, ptr %9, align 4, !tbaa !9
  %157 = load i32, ptr %9, align 4, !tbaa !9
  call void @MulMatrix_float(ptr noundef %146, ptr noundef %149, ptr noundef %152, i32 noundef %155, i32 noundef %156, i32 noundef %157)
  %158 = load ptr, ptr %10, align 8, !tbaa !5
  call void @delete_simple_mat(ptr noundef %158)
  %159 = load ptr, ptr %12, align 8, !tbaa !5
  call void @delete_simple_mat(ptr noundef %159)
  %160 = load ptr, ptr %11, align 8, !tbaa !5
  call void @delete_simple_mat(ptr noundef %160)
  %161 = load ptr, ptr %15, align 8, !tbaa !5
  call void @delete_simple_mat(ptr noundef %161)
  %162 = load ptr, ptr %14, align 8, !tbaa !5
  call void @delete_simple_mat(ptr noundef %162)
  %163 = load ptr, ptr %13, align 8, !tbaa !5
  call void @delete_simple_mat(ptr noundef %163)
  %164 = load ptr, ptr %19, align 8, !tbaa !5
  call void @delete_simple_mat(ptr noundef %164)
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #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 8, ptr %10) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #6
  ret void
}

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

; Function Attrs: noreturn nounwind
declare void @exit(i32 noundef) #2

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

declare ptr @create_simple_mat(i32 noundef, i32 noundef, i32 noundef, i32 noundef) #1

declare void @hyper_mat_mean(ptr noundef, ptr noundef) #1

declare ptr @reshape_hypermat_2_simplemat(ptr noundef, i32 noundef, i32 noundef) #1

; Function Attrs: nounwind uwtable
declare hidden void @cal_covariance_matrix(ptr noundef, ptr noundef, ptr noundef) #0

declare ptr @simple_mat_copy(ptr noundef) #1

declare void @matrix_QR_float(ptr noundef, ptr noundef, ptr noundef, i32 noundef) #1

declare void @MulMatrix_float(ptr noundef, ptr noundef, ptr noundef, i32 noundef, i32 noundef, i32 noundef) #1

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

; Function Attrs: nounwind allocsize(0)
declare noalias ptr @malloc(i64 noundef) #4

declare void @sort_array_down_float(ptr noundef, i32 noundef) #1

declare void @cal_eigen_vector_float(ptr noundef, ptr noundef, ptr noundef, i32 noundef, i32 noundef) #1

declare void @delete_simple_mat(ptr noundef) #1

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 = { "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 = { 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 #3 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #4 = { 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 #5 = { noreturn nounwind }
attributes #6 = { nounwind }
attributes #7 = { 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 12}
!12 = !{!"", !10, i64 0, !10, i64 4, !10, i64 8, !10, i64 12, !7, i64 16, !6, i64 24, !6, i64 32}
!13 = !{!12, !10, i64 0}
!14 = !{!12, !10, i64 4}
!15 = !{!12, !10, i64 8}
!16 = !{!17, !10, i64 0}
!17 = !{!"", !10, i64 0, !10, i64 4, !10, i64 8, !10, i64 12, !10, i64 16, !6, i64 24}
!18 = !{!17, !10, i64 4}
!19 = !{!17, !6, i64 24}
!20 = distinct !{!20, !21}
!21 = !{!"llvm.loop.mustprogress"}
!22 = !{!23, !23, i64 0}
!23 = !{!"float", !7, i64 0}
!24 = distinct !{!24, !21}
!25 = !{!12, !6, i64 24}


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

; Function Attrs: nounwind uwtable
define dso_local void @hyper_mat_pca(ptr noundef %0, ptr nocapture noundef readonly %1, i32 noundef %2) local_unnamed_addr #0 {
  %4 = getelementptr inbounds i8, ptr %0, i64 12
  store i32 4, ptr %4, align 4, !tbaa !5
  %5 = load i32, ptr %0, align 8, !tbaa !11
  %6 = getelementptr inbounds i8, ptr %0, i64 4
  %7 = load i32, ptr %6, align 4, !tbaa !12
  %8 = getelementptr inbounds i8, ptr %0, i64 8
  %9 = load i32, ptr %8, align 8, !tbaa !13
  %10 = tail call ptr @create_simple_mat(i32 noundef %7, i32 noundef %5, i32 noundef 4, i32 noundef 1) #3
  tail call void @hyper_mat_mean(ptr noundef nonnull %0, ptr noundef %10) #3
  %11 = mul nsw i32 %7, %5
  %12 = tail call ptr @reshape_hypermat_2_simplemat(ptr noundef nonnull %0, i32 noundef %11, i32 noundef %9) #3
  %13 = tail call ptr @create_simple_mat(i32 noundef %9, i32 noundef %9, i32 noundef 4, i32 noundef 1) #3
  tail call void @cal_covariance_matrix(ptr noundef %12, ptr noundef %10, ptr noundef %13)
  %14 = tail call ptr @simple_mat_copy(ptr noundef %13) #3
  %15 = load i32, ptr %13, align 8, !tbaa !14
  %16 = getelementptr inbounds i8, ptr %13, i64 4
  %17 = load i32, ptr %16, align 4, !tbaa !16
  %18 = tail call ptr @create_simple_mat(i32 noundef %15, i32 noundef %17, i32 noundef 4, i32 noundef 1) #3
  %19 = load i32, ptr %13, align 8, !tbaa !14
  %20 = load i32, ptr %16, align 4, !tbaa !16
  %21 = tail call ptr @create_simple_mat(i32 noundef %19, i32 noundef %20, i32 noundef 4, i32 noundef 1) #3
  %22 = icmp sgt i32 %2, 0
  br i1 %22, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %3
  %23 = getelementptr inbounds i8, ptr %14, i64 24
  %24 = getelementptr inbounds i8, ptr %18, i64 24
  %25 = getelementptr inbounds i8, ptr %21, i64 24
  br label %33

._crit_edge:                                      ; preds = %33, %3
  %26 = sext i32 %9 to i64
  %27 = shl nsw i64 %26, 2
  %28 = tail call noalias ptr @malloc(i64 noundef %27) #4
  %29 = icmp sgt i32 %9, 0
  br i1 %29, label %.lr.ph72, label %._crit_edge73

.lr.ph72:                                         ; preds = %._crit_edge
  %30 = getelementptr inbounds i8, ptr %14, i64 24
  %31 = load ptr, ptr %30, align 8, !tbaa !17
  %.06668 = add nuw i32 %9, 1
  %wide.trip.count = zext nneg i32 %9 to i64
  %xtraiter = and i64 %wide.trip.count, 3
  %32 = icmp ult i32 %9, 4
  br i1 %32, label %._crit_edge73.loopexit.unr-lcssa, label %.lr.ph72.new

.lr.ph72.new:                                     ; preds = %.lr.ph72
  %unroll_iter = and i64 %wide.trip.count, 2147483644
  br label %57

33:                                               ; preds = %.lr.ph, %33
  %.069 = phi i32 [ 0, %.lr.ph ], [ %40, %33 ]
  %34 = load ptr, ptr %23, align 8, !tbaa !17
  %35 = load ptr, ptr %24, align 8, !tbaa !17
  %36 = load ptr, ptr %25, align 8, !tbaa !17
  tail call void @matrix_QR_float(ptr noundef %34, ptr noundef %35, ptr noundef %36, i32 noundef %9) #3
  %37 = load ptr, ptr %24, align 8, !tbaa !17
  %38 = load ptr, ptr %25, align 8, !tbaa !17
  %39 = load ptr, ptr %23, align 8, !tbaa !17
  tail call void @MulMatrix_float(ptr noundef %37, ptr noundef %38, ptr noundef %39, i32 noundef %9, i32 noundef %9, i32 noundef %9) #3
  %40 = add nuw nsw i32 %.069, 1
  %exitcond.not = icmp eq i32 %40, %2
  br i1 %exitcond.not, label %._crit_edge, label %33, !llvm.loop !18

._crit_edge73.loopexit.unr-lcssa:                 ; preds = %57, %.lr.ph72
  %indvars.iv.unr = phi i64 [ 0, %.lr.ph72 ], [ %indvars.iv.next.3, %57 ]
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br i1 %lcmp.mod.not, label %._crit_edge73, label %.epil.preheader

.epil.preheader:                                  ; preds = %._crit_edge73.loopexit.unr-lcssa, %.epil.preheader
  %indvars.iv.epil = phi i64 [ %indvars.iv.next.epil, %.epil.preheader ], [ %indvars.iv.unr, %._crit_edge73.loopexit.unr-lcssa ]
  %epil.iter = phi i64 [ %epil.iter.next, %.epil.preheader ], [ 0, %._crit_edge73.loopexit.unr-lcssa ]
  %41 = trunc nuw nsw i64 %indvars.iv.epil to i32
  %42 = mul i32 %.06668, %41
  %43 = sext i32 %42 to i64
  %44 = getelementptr inbounds float, ptr %31, i64 %43
  %45 = load float, ptr %44, align 4, !tbaa !20
  %46 = getelementptr inbounds float, ptr %28, i64 %indvars.iv.epil
  store float %45, ptr %46, align 4, !tbaa !20
  %indvars.iv.next.epil = add nuw nsw i64 %indvars.iv.epil, 1
  %epil.iter.next = add i64 %epil.iter, 1
  %epil.iter.cmp.not = icmp eq i64 %epil.iter.next, %xtraiter
  br i1 %epil.iter.cmp.not, label %._crit_edge73, label %.epil.preheader, !llvm.loop !22

._crit_edge73:                                    ; preds = %._crit_edge73.loopexit.unr-lcssa, %.epil.preheader, %._crit_edge
  tail call void @sort_array_down_float(ptr noundef %28, i32 noundef %9) #3
  %47 = tail call ptr @simple_mat_copy(ptr noundef %18) #3
  %48 = getelementptr inbounds i8, ptr %13, i64 24
  %49 = load ptr, ptr %48, align 8, !tbaa !17
  %50 = getelementptr inbounds i8, ptr %47, i64 24
  %51 = load ptr, ptr %50, align 8, !tbaa !17
  tail call void @cal_eigen_vector_float(ptr noundef %49, ptr noundef %51, ptr noundef %28, i32 noundef %9, i32 noundef %9) #3
  %52 = getelementptr inbounds i8, ptr %12, i64 24
  %53 = load ptr, ptr %52, align 8, !tbaa !17
  %54 = load ptr, ptr %50, align 8, !tbaa !17
  %55 = getelementptr inbounds i8, ptr %1, i64 24
  %56 = load ptr, ptr %55, align 8, !tbaa !24
  tail call void @MulMatrix_float(ptr noundef %53, ptr noundef %54, ptr noundef %56, i32 noundef %11, i32 noundef %9, i32 noundef %9) #3
  tail call void @delete_simple_mat(ptr noundef %10) #3
  tail call void @delete_simple_mat(ptr noundef nonnull %13) #3
  tail call void @delete_simple_mat(ptr noundef %12) #3
  tail call void @delete_simple_mat(ptr noundef %21) #3
  tail call void @delete_simple_mat(ptr noundef %18) #3
  tail call void @delete_simple_mat(ptr noundef %14) #3
  tail call void @delete_simple_mat(ptr noundef %47) #3
  ret void

57:                                               ; preds = %57, %.lr.ph72.new
  %indvars.iv = phi i64 [ 0, %.lr.ph72.new ], [ %indvars.iv.next.3, %57 ]
  %niter = phi i64 [ 0, %.lr.ph72.new ], [ %niter.next.3, %57 ]
  %58 = trunc nuw nsw i64 %indvars.iv to i32
  %59 = mul i32 %.06668, %58
  %60 = sext i32 %59 to i64
  %61 = getelementptr inbounds float, ptr %31, i64 %60
  %62 = load float, ptr %61, align 4, !tbaa !20
  %63 = getelementptr inbounds float, ptr %28, i64 %indvars.iv
  store float %62, ptr %63, align 4, !tbaa !20
  %indvars.iv.next = or disjoint i64 %indvars.iv, 1
  %64 = trunc nuw nsw i64 %indvars.iv.next to i32
  %65 = mul i32 %.06668, %64
  %66 = sext i32 %65 to i64
  %67 = getelementptr inbounds float, ptr %31, i64 %66
  %68 = load float, ptr %67, align 4, !tbaa !20
  %69 = getelementptr inbounds float, ptr %28, i64 %indvars.iv.next
  store float %68, ptr %69, align 4, !tbaa !20
  %indvars.iv.next.1 = or disjoint i64 %indvars.iv, 2
  %70 = trunc nuw nsw i64 %indvars.iv.next.1 to i32
  %71 = mul i32 %.06668, %70
  %72 = sext i32 %71 to i64
  %73 = getelementptr inbounds float, ptr %31, i64 %72
  %74 = load float, ptr %73, align 4, !tbaa !20
  %75 = getelementptr inbounds float, ptr %28, i64 %indvars.iv.next.1
  store float %74, ptr %75, align 4, !tbaa !20
  %indvars.iv.next.2 = or disjoint i64 %indvars.iv, 3
  %76 = trunc nuw nsw i64 %indvars.iv.next.2 to i32
  %77 = mul i32 %.06668, %76
  %78 = sext i32 %77 to i64
  %79 = getelementptr inbounds float, ptr %31, i64 %78
  %80 = load float, ptr %79, align 4, !tbaa !20
  %81 = getelementptr inbounds float, ptr %28, i64 %indvars.iv.next.2
  store float %80, ptr %81, align 4, !tbaa !20
  %indvars.iv.next.3 = add nuw nsw i64 %indvars.iv, 4
  %niter.next.3 = add i64 %niter, 4
  %niter.ncmp.3 = icmp eq i64 %niter.next.3, %unroll_iter
  br i1 %niter.ncmp.3, label %._crit_edge73.loopexit.unr-lcssa, label %57, !llvm.loop !25
}

declare ptr @create_simple_mat(i32 noundef, i32 noundef, i32 noundef, i32 noundef) local_unnamed_addr #1

declare void @hyper_mat_mean(ptr noundef, ptr noundef) local_unnamed_addr #1

declare ptr @reshape_hypermat_2_simplemat(ptr noundef, i32 noundef, i32 noundef) local_unnamed_addr #1

; Function Attrs: nounwind uwtable
declare hidden void @cal_covariance_matrix(ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #0

declare ptr @simple_mat_copy(ptr noundef) local_unnamed_addr #1

declare void @matrix_QR_float(ptr noundef, ptr noundef, ptr noundef, i32 noundef) local_unnamed_addr #1

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

declare void @sort_array_down_float(ptr noundef, i32 noundef) local_unnamed_addr #1

declare void @cal_eigen_vector_float(ptr noundef, ptr noundef, ptr noundef, i32 noundef, i32 noundef) local_unnamed_addr #1

declare void @delete_simple_mat(ptr noundef) local_unnamed_addr #1

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 = { "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 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 #3 = { nounwind }
attributes #4 = { 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 12}
!6 = !{!"", !7, i64 0, !7, i64 4, !7, i64 8, !7, i64 12, !8, i64 16, !10, i64 24, !10, i64 32}
!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 0}
!12 = !{!6, !7, i64 4}
!13 = !{!6, !7, i64 8}
!14 = !{!15, !7, i64 0}
!15 = !{!"", !7, i64 0, !7, i64 4, !7, i64 8, !7, i64 12, !7, i64 16, !10, i64 24}
!16 = !{!15, !7, i64 4}
!17 = !{!15, !10, i64 24}
!18 = distinct !{!18, !19}
!19 = !{!"llvm.loop.mustprogress"}
!20 = !{!21, !21, i64 0}
!21 = !{!"float", !8, i64 0}
!22 = distinct !{!22, !23}
!23 = !{!"llvm.loop.unroll.disable"}
!24 = !{!6, !10, i64 24}
!25 = distinct !{!25, !19}


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