; LLVM IR from sbu-fsl/kernel-ml :: src/math (matrix)

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

@.str.1 = external hidden unnamed_addr constant [69 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [4 x i8], align 1
@__PRETTY_FUNCTION__.matrix_stddev = external hidden unnamed_addr constant [47 x i8], align 1

; Function Attrs: nounwind uwtable
declare dso_local ptr @allocate_matrix(i32 noundef, i32 noundef, i32 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: noreturn nounwind
declare void @__assert_fail(ptr noundef, ptr noundef, i32 noundef, ptr noundef) #2

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

declare float @fast_sqrt_f(float noundef) #3

declare double @fast_sqrt_d(double noundef) #3

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare float @llvm.fmuladd.f32(float, float, float) #4

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

; Function Attrs: nounwind uwtable
define dso_local ptr @matrix_stddev(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 ptr, align 8
  %10 = alloca float, align 4
  %11 = alloca double, 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
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #5
  %12 = load ptr, ptr %4, align 8, !tbaa !5
  %13 = getelementptr inbounds %struct.matrix, ptr %12, i32 0, i32 1
  %14 = load i32, ptr %13, align 4, !tbaa !11
  %15 = load ptr, ptr %4, align 8, !tbaa !5
  %16 = getelementptr inbounds %struct.matrix, ptr %15, i32 0, i32 2
  %17 = load i32, ptr %16, align 8, !tbaa !13
  %18 = call ptr @allocate_matrix(i32 noundef 1, i32 noundef %14, i32 noundef %17)
  store ptr %18, ptr %9, align 8, !tbaa !5
  store i32 0, ptr %8, align 4, !tbaa !9
  br label %19

19:                                               ; preds = %215, %3
  %20 = load i32, ptr %8, align 4, !tbaa !9
  %21 = load ptr, ptr %4, align 8, !tbaa !5
  %22 = getelementptr inbounds %struct.matrix, ptr %21, i32 0, i32 1
  %23 = load i32, ptr %22, align 4, !tbaa !11
  %24 = icmp slt i32 %20, %23
  br i1 %24, label %25, label %218

25:                                               ; preds = %19
  store i32 0, ptr %7, align 4, !tbaa !9
  br label %26

26:                                               ; preds = %122, %25
  %27 = load i32, ptr %7, align 4, !tbaa !9
  %28 = load ptr, ptr %4, align 8, !tbaa !5
  %29 = getelementptr inbounds %struct.matrix, ptr %28, i32 0, i32 0
  %30 = load i32, ptr %29, align 8, !tbaa !14
  %31 = icmp slt i32 %27, %30
  br i1 %31, label %32, label %125

32:                                               ; preds = %26
  %33 = load ptr, ptr %4, align 8, !tbaa !5
  %34 = getelementptr inbounds %struct.matrix, ptr %33, i32 0, i32 2
  %35 = load i32, ptr %34, align 8, !tbaa !13
  switch i32 %35, label %121 [
    i32 1, label %36
    i32 2, label %78
    i32 0, label %120
  ]

36:                                               ; preds = %32
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #5
  %37 = load ptr, ptr %4, align 8, !tbaa !5
  %38 = getelementptr inbounds %struct.matrix, ptr %37, i32 0, i32 3
  %39 = load ptr, ptr %38, align 8, !tbaa !15
  %40 = load i32, ptr %7, align 4, !tbaa !9
  %41 = load ptr, ptr %4, align 8, !tbaa !5
  %42 = getelementptr inbounds %struct.matrix, ptr %41, i32 0, i32 1
  %43 = load i32, ptr %42, align 4, !tbaa !11
  %44 = mul nsw i32 %40, %43
  %45 = load i32, ptr %8, align 4, !tbaa !9
  %46 = add nsw i32 %44, %45
  %47 = sext i32 %46 to i64
  %48 = getelementptr inbounds float, ptr %39, i64 %47
  %49 = load float, ptr %48, align 4, !tbaa !16
  %50 = load ptr, ptr %5, align 8, !tbaa !5
  %51 = getelementptr inbounds %struct.matrix, ptr %50, i32 0, i32 3
  %52 = load ptr, ptr %51, align 8, !tbaa !15
  %53 = load ptr, ptr %5, align 8, !tbaa !5
  %54 = getelementptr inbounds %struct.matrix, ptr %53, i32 0, i32 1
  %55 = load i32, ptr %54, align 4, !tbaa !11
  %56 = mul nsw i32 0, %55
  %57 = load i32, ptr %8, align 4, !tbaa !9
  %58 = add nsw i32 %56, %57
  %59 = sext i32 %58 to i64
  %60 = getelementptr inbounds float, ptr %52, i64 %59
  %61 = load float, ptr %60, align 4, !tbaa !16
  %62 = fsub float %49, %61
  store float %62, ptr %10, align 4, !tbaa !16
  %63 = load float, ptr %10, align 4, !tbaa !16
  %64 = load float, ptr %10, align 4, !tbaa !16
  %65 = load ptr, ptr %9, align 8, !tbaa !5
  %66 = getelementptr inbounds %struct.matrix, ptr %65, i32 0, i32 3
  %67 = load ptr, ptr %66, align 8, !tbaa !15
  %68 = load ptr, ptr %9, align 8, !tbaa !5
  %69 = getelementptr inbounds %struct.matrix, ptr %68, i32 0, i32 1
  %70 = load i32, ptr %69, align 4, !tbaa !11
  %71 = mul nsw i32 0, %70
  %72 = load i32, ptr %8, align 4, !tbaa !9
  %73 = add nsw i32 %71, %72
  %74 = sext i32 %73 to i64
  %75 = getelementptr inbounds float, ptr %67, i64 %74
  %76 = load float, ptr %75, align 4, !tbaa !16
  %77 = call float @llvm.fmuladd.f32(float %63, float %64, float %76)
  store float %77, ptr %75, align 4, !tbaa !16
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #5
  br label %121

78:                                               ; preds = %32
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #5
  %79 = load ptr, ptr %4, align 8, !tbaa !5
  %80 = getelementptr inbounds %struct.matrix, ptr %79, i32 0, i32 3
  %81 = load ptr, ptr %80, align 8, !tbaa !15
  %82 = load i32, ptr %7, align 4, !tbaa !9
  %83 = load ptr, ptr %4, align 8, !tbaa !5
  %84 = getelementptr inbounds %struct.matrix, ptr %83, i32 0, i32 1
  %85 = load i32, ptr %84, align 4, !tbaa !11
  %86 = mul nsw i32 %82, %85
  %87 = load i32, ptr %8, align 4, !tbaa !9
  %88 = add nsw i32 %86, %87
  %89 = sext i32 %88 to i64
  %90 = getelementptr inbounds double, ptr %81, i64 %89
  %91 = load double, ptr %90, align 8, !tbaa !18
  %92 = load ptr, ptr %5, align 8, !tbaa !5
  %93 = getelementptr inbounds %struct.matrix, ptr %92, i32 0, i32 3
  %94 = load ptr, ptr %93, align 8, !tbaa !15
  %95 = load ptr, ptr %5, align 8, !tbaa !5
  %96 = getelementptr inbounds %struct.matrix, ptr %95, i32 0, i32 1
  %97 = load i32, ptr %96, align 4, !tbaa !11
  %98 = mul nsw i32 0, %97
  %99 = load i32, ptr %8, align 4, !tbaa !9
  %100 = add nsw i32 %98, %99
  %101 = sext i32 %100 to i64
  %102 = getelementptr inbounds double, ptr %94, i64 %101
  %103 = load double, ptr %102, align 8, !tbaa !18
  %104 = fsub double %91, %103
  store double %104, ptr %11, align 8, !tbaa !18
  %105 = load double, ptr %11, align 8, !tbaa !18
  %106 = load double, ptr %11, align 8, !tbaa !18
  %107 = load ptr, ptr %9, align 8, !tbaa !5
  %108 = getelementptr inbounds %struct.matrix, ptr %107, i32 0, i32 3
  %109 = load ptr, ptr %108, align 8, !tbaa !15
  %110 = load ptr, ptr %9, align 8, !tbaa !5
  %111 = getelementptr inbounds %struct.matrix, ptr %110, i32 0, i32 1
  %112 = load i32, ptr %111, align 4, !tbaa !11
  %113 = mul nsw i32 0, %112
  %114 = load i32, ptr %8, align 4, !tbaa !9
  %115 = add nsw i32 %113, %114
  %116 = sext i32 %115 to i64
  %117 = getelementptr inbounds double, ptr %109, i64 %116
  %118 = load double, ptr %117, align 8, !tbaa !18
  %119 = call double @llvm.fmuladd.f64(double %105, double %106, double %118)
  store double %119, ptr %117, align 8, !tbaa !18
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #5
  br label %121

120:                                              ; preds = %32
  call void @__assert_fail(ptr noundef @.str.10, ptr noundef @.str.1, i32 noundef 880, ptr noundef @__PRETTY_FUNCTION__.matrix_stddev) #6
  unreachable

121:                                              ; preds = %78, %36, %32
  br label %122

122:                                              ; preds = %121
  %123 = load i32, ptr %7, align 4, !tbaa !9
  %124 = add nsw i32 %123, 1
  store i32 %124, ptr %7, align 4, !tbaa !9
  br label %26, !llvm.loop !20

125:                                              ; preds = %26
  %126 = load ptr, ptr %4, align 8, !tbaa !5
  %127 = getelementptr inbounds %struct.matrix, ptr %126, i32 0, i32 2
  %128 = load i32, ptr %127, align 8, !tbaa !13
  switch i32 %128, label %214 [
    i32 1, label %129
    i32 2, label %171
    i32 0, label %213
  ]

129:                                              ; preds = %125
  %130 = load ptr, ptr %4, align 8, !tbaa !5
  %131 = getelementptr inbounds %struct.matrix, ptr %130, i32 0, i32 0
  %132 = load i32, ptr %131, align 8, !tbaa !14
  %133 = sitofp i32 %132 to float
  %134 = load ptr, ptr %9, align 8, !tbaa !5
  %135 = getelementptr inbounds %struct.matrix, ptr %134, i32 0, i32 3
  %136 = load ptr, ptr %135, align 8, !tbaa !15
  %137 = load ptr, ptr %9, align 8, !tbaa !5
  %138 = getelementptr inbounds %struct.matrix, ptr %137, i32 0, i32 1
  %139 = load i32, ptr %138, align 4, !tbaa !11
  %140 = mul nsw i32 0, %139
  %141 = load i32, ptr %8, align 4, !tbaa !9
  %142 = add nsw i32 %140, %141
  %143 = sext i32 %142 to i64
  %144 = getelementptr inbounds float, ptr %136, i64 %143
  %145 = load float, ptr %144, align 4, !tbaa !16
  %146 = fdiv float %145, %133
  store float %146, ptr %144, align 4, !tbaa !16
  %147 = load ptr, ptr %9, align 8, !tbaa !5
  %148 = getelementptr inbounds %struct.matrix, ptr %147, i32 0, i32 3
  %149 = load ptr, ptr %148, align 8, !tbaa !15
  %150 = load ptr, ptr %9, align 8, !tbaa !5
  %151 = getelementptr inbounds %struct.matrix, ptr %150, i32 0, i32 1
  %152 = load i32, ptr %151, align 4, !tbaa !11
  %153 = mul nsw i32 0, %152
  %154 = load i32, ptr %8, align 4, !tbaa !9
  %155 = add nsw i32 %153, %154
  %156 = sext i32 %155 to i64
  %157 = getelementptr inbounds float, ptr %149, i64 %156
  %158 = load float, ptr %157, align 4, !tbaa !16
  %159 = call float @fast_sqrt_f(float noundef %158)
  %160 = load ptr, ptr %9, align 8, !tbaa !5
  %161 = getelementptr inbounds %struct.matrix, ptr %160, i32 0, i32 3
  %162 = load ptr, ptr %161, align 8, !tbaa !15
  %163 = load ptr, ptr %9, align 8, !tbaa !5
  %164 = getelementptr inbounds %struct.matrix, ptr %163, i32 0, i32 1
  %165 = load i32, ptr %164, align 4, !tbaa !11
  %166 = mul nsw i32 0, %165
  %167 = load i32, ptr %8, align 4, !tbaa !9
  %168 = add nsw i32 %166, %167
  %169 = sext i32 %168 to i64
  %170 = getelementptr inbounds float, ptr %162, i64 %169
  store float %159, ptr %170, align 4, !tbaa !16
  br label %214

171:                                              ; preds = %125
  %172 = load ptr, ptr %4, align 8, !tbaa !5
  %173 = getelementptr inbounds %struct.matrix, ptr %172, i32 0, i32 0
  %174 = load i32, ptr %173, align 8, !tbaa !14
  %175 = sitofp i32 %174 to double
  %176 = load ptr, ptr %9, align 8, !tbaa !5
  %177 = getelementptr inbounds %struct.matrix, ptr %176, i32 0, i32 3
  %178 = load ptr, ptr %177, align 8, !tbaa !15
  %179 = load ptr, ptr %9, align 8, !tbaa !5
  %180 = getelementptr inbounds %struct.matrix, ptr %179, i32 0, i32 1
  %181 = load i32, ptr %180, align 4, !tbaa !11
  %182 = mul nsw i32 0, %181
  %183 = load i32, ptr %8, align 4, !tbaa !9
  %184 = add nsw i32 %182, %183
  %185 = sext i32 %184 to i64
  %186 = getelementptr inbounds double, ptr %178, i64 %185
  %187 = load double, ptr %186, align 8, !tbaa !18
  %188 = fdiv double %187, %175
  store double %188, ptr %186, align 8, !tbaa !18
  %189 = load ptr, ptr %9, align 8, !tbaa !5
  %190 = getelementptr inbounds %struct.matrix, ptr %189, i32 0, i32 3
  %191 = load ptr, ptr %190, align 8, !tbaa !15
  %192 = load ptr, ptr %9, align 8, !tbaa !5
  %193 = getelementptr inbounds %struct.matrix, ptr %192, i32 0, i32 1
  %194 = load i32, ptr %193, align 4, !tbaa !11
  %195 = mul nsw i32 0, %194
  %196 = load i32, ptr %8, align 4, !tbaa !9
  %197 = add nsw i32 %195, %196
  %198 = sext i32 %197 to i64
  %199 = getelementptr inbounds double, ptr %191, i64 %198
  %200 = load double, ptr %199, align 8, !tbaa !18
  %201 = call double @fast_sqrt_d(double noundef %200)
  %202 = load ptr, ptr %9, align 8, !tbaa !5
  %203 = getelementptr inbounds %struct.matrix, ptr %202, i32 0, i32 3
  %204 = load ptr, ptr %203, align 8, !tbaa !15
  %205 = load ptr, ptr %9, align 8, !tbaa !5
  %206 = getelementptr inbounds %struct.matrix, ptr %205, i32 0, i32 1
  %207 = load i32, ptr %206, align 4, !tbaa !11
  %208 = mul nsw i32 0, %207
  %209 = load i32, ptr %8, align 4, !tbaa !9
  %210 = add nsw i32 %208, %209
  %211 = sext i32 %210 to i64
  %212 = getelementptr inbounds double, ptr %204, i64 %211
  store double %201, ptr %212, align 8, !tbaa !18
  br label %214

213:                                              ; preds = %125
  call void @__assert_fail(ptr noundef @.str.10, ptr noundef @.str.1, i32 noundef 898, ptr noundef @__PRETTY_FUNCTION__.matrix_stddev) #6
  unreachable

214:                                              ; preds = %171, %129, %125
  br label %215

215:                                              ; preds = %214
  %216 = load i32, ptr %8, align 4, !tbaa !9
  %217 = add nsw i32 %216, 1
  store i32 %217, ptr %8, align 4, !tbaa !9
  br label %19, !llvm.loop !22

218:                                              ; preds = %19
  %219 = load ptr, ptr %9, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #5
  ret ptr %219
}

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 = { 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 = { "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 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #5 = { nounwind }
attributes #6 = { noreturn nounwind }

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

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


; 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.1 = external hidden unnamed_addr constant [69 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [4 x i8], align 1
@__PRETTY_FUNCTION__.matrix_stddev = external hidden unnamed_addr constant [47 x i8], align 1

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

; Function Attrs: noreturn nounwind
declare void @__assert_fail(ptr noundef, ptr noundef, i32 noundef, ptr noundef) local_unnamed_addr #1

declare float @fast_sqrt_f(float noundef) local_unnamed_addr #2

declare double @fast_sqrt_d(double noundef) local_unnamed_addr #2

; Function Attrs: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare float @llvm.fmuladd.f32(float, float, float) #3

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

; Function Attrs: nounwind uwtable
define dso_local ptr @matrix_stddev(ptr nocapture noundef readonly %0, ptr nocapture noundef readonly %1, i32 noundef %2) local_unnamed_addr #0 {
  %4 = getelementptr inbounds i8, ptr %0, i64 4
  %5 = load i32, ptr %4, align 4, !tbaa !5
  %6 = getelementptr inbounds i8, ptr %0, i64 8
  %7 = load i32, ptr %6, align 8, !tbaa !10
  %8 = tail call ptr @allocate_matrix(i32 noundef 1, i32 noundef %5, i32 noundef %7)
  %9 = load i32, ptr %4, align 4, !tbaa !5
  %10 = icmp sgt i32 %9, 0
  br i1 %10, label %.preheader.lr.ph, label %._crit_edge65

.preheader.lr.ph:                                 ; preds = %3
  %11 = getelementptr inbounds i8, ptr %0, i64 16
  %12 = getelementptr inbounds i8, ptr %1, i64 16
  %13 = getelementptr inbounds i8, ptr %8, i64 16
  br label %.preheader

.preheader:                                       ; preds = %.preheader.lr.ph, %125
  %indvars.iv74 = phi i64 [ 0, %.preheader.lr.ph ], [ %indvars.iv.next75, %125 ]
  %14 = phi i32 [ %9, %.preheader.lr.ph ], [ %126, %125 ]
  %15 = load i32, ptr %0, align 8, !tbaa !11
  %16 = icmp sgt i32 %15, 0
  %.pre = load i32, ptr %6, align 8, !tbaa !10
  br i1 %16, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %.preheader
  switch i32 %.pre, label %125 [
    i32 0, label %73
    i32 1, label %.lr.ph.split.split.us.preheader
    i32 2, label %.lr.ph.split.split.us58.preheader
  ]

.lr.ph.split.split.us58.preheader:                ; preds = %.lr.ph
  %17 = sext i32 %14 to i64
  %wide.trip.count = zext nneg i32 %15 to i64
  %xtraiter = and i64 %wide.trip.count, 1
  %18 = icmp eq i32 %15, 1
  br i1 %18, label %._crit_edge.loopexit79.unr-lcssa, label %.lr.ph.split.split.us58.preheader.new

.lr.ph.split.split.us58.preheader.new:            ; preds = %.lr.ph.split.split.us58.preheader
  %unroll_iter = and i64 %wide.trip.count, 2147483646
  br label %.lr.ph.split.split.us58

.lr.ph.split.split.us.preheader:                  ; preds = %.lr.ph
  %19 = sext i32 %14 to i64
  %wide.trip.count72 = zext nneg i32 %15 to i64
  %xtraiter80 = and i64 %wide.trip.count72, 1
  %20 = icmp eq i32 %15, 1
  br i1 %20, label %._crit_edge.loopexit.unr-lcssa, label %.lr.ph.split.split.us.preheader.new

.lr.ph.split.split.us.preheader.new:              ; preds = %.lr.ph.split.split.us.preheader
  %unroll_iter82 = and i64 %wide.trip.count72, 2147483646
  br label %.lr.ph.split.split.us

.lr.ph.split.split.us:                            ; preds = %.lr.ph.split.split.us, %.lr.ph.split.split.us.preheader.new
  %indvars.iv69 = phi i64 [ 0, %.lr.ph.split.split.us.preheader.new ], [ %indvars.iv.next70.1, %.lr.ph.split.split.us ]
  %niter83 = phi i64 [ 0, %.lr.ph.split.split.us.preheader.new ], [ %niter83.next.1, %.lr.ph.split.split.us ]
  %21 = load ptr, ptr %11, align 8, !tbaa !12
  %22 = mul nsw i64 %indvars.iv69, %19
  %23 = getelementptr float, ptr %21, i64 %22
  %24 = getelementptr float, ptr %23, i64 %indvars.iv74
  %25 = load float, ptr %24, align 4, !tbaa !13
  %26 = load ptr, ptr %12, align 8, !tbaa !12
  %27 = getelementptr inbounds float, ptr %26, i64 %indvars.iv74
  %28 = load float, ptr %27, align 4, !tbaa !13
  %29 = fsub float %25, %28
  %30 = load ptr, ptr %13, align 8, !tbaa !12
  %31 = getelementptr inbounds float, ptr %30, i64 %indvars.iv74
  %32 = load float, ptr %31, align 4, !tbaa !13
  %33 = tail call float @llvm.fmuladd.f32(float %29, float %29, float %32)
  store float %33, ptr %31, align 4, !tbaa !13
  %indvars.iv.next70 = or disjoint i64 %indvars.iv69, 1
  %34 = load ptr, ptr %11, align 8, !tbaa !12
  %35 = mul nsw i64 %indvars.iv.next70, %19
  %36 = getelementptr float, ptr %34, i64 %35
  %37 = getelementptr float, ptr %36, i64 %indvars.iv74
  %38 = load float, ptr %37, align 4, !tbaa !13
  %39 = load ptr, ptr %12, align 8, !tbaa !12
  %40 = getelementptr inbounds float, ptr %39, i64 %indvars.iv74
  %41 = load float, ptr %40, align 4, !tbaa !13
  %42 = fsub float %38, %41
  %43 = load ptr, ptr %13, align 8, !tbaa !12
  %44 = getelementptr inbounds float, ptr %43, i64 %indvars.iv74
  %45 = load float, ptr %44, align 4, !tbaa !13
  %46 = tail call float @llvm.fmuladd.f32(float %42, float %42, float %45)
  store float %46, ptr %44, align 4, !tbaa !13
  %indvars.iv.next70.1 = add nuw nsw i64 %indvars.iv69, 2
  %niter83.next.1 = add i64 %niter83, 2
  %niter83.ncmp.1 = icmp eq i64 %niter83.next.1, %unroll_iter82
  br i1 %niter83.ncmp.1, label %._crit_edge.loopexit.unr-lcssa, label %.lr.ph.split.split.us, !llvm.loop !15

.lr.ph.split.split.us58:                          ; preds = %.lr.ph.split.split.us58, %.lr.ph.split.split.us58.preheader.new
  %indvars.iv = phi i64 [ 0, %.lr.ph.split.split.us58.preheader.new ], [ %indvars.iv.next.1, %.lr.ph.split.split.us58 ]
  %niter = phi i64 [ 0, %.lr.ph.split.split.us58.preheader.new ], [ %niter.next.1, %.lr.ph.split.split.us58 ]
  %47 = load ptr, ptr %11, align 8, !tbaa !12
  %48 = mul nsw i64 %indvars.iv, %17
  %49 = getelementptr double, ptr %47, i64 %48
  %50 = getelementptr double, ptr %49, i64 %indvars.iv74
  %51 = load double, ptr %50, align 8, !tbaa !17
  %52 = load ptr, ptr %12, align 8, !tbaa !12
  %53 = getelementptr inbounds double, ptr %52, i64 %indvars.iv74
  %54 = load double, ptr %53, align 8, !tbaa !17
  %55 = fsub double %51, %54
  %56 = load ptr, ptr %13, align 8, !tbaa !12
  %57 = getelementptr inbounds double, ptr %56, i64 %indvars.iv74
  %58 = load double, ptr %57, align 8, !tbaa !17
  %59 = tail call double @llvm.fmuladd.f64(double %55, double %55, double %58)
  store double %59, ptr %57, align 8, !tbaa !17
  %indvars.iv.next = or disjoint i64 %indvars.iv, 1
  %60 = load ptr, ptr %11, align 8, !tbaa !12
  %61 = mul nsw i64 %indvars.iv.next, %17
  %62 = getelementptr double, ptr %60, i64 %61
  %63 = getelementptr double, ptr %62, i64 %indvars.iv74
  %64 = load double, ptr %63, align 8, !tbaa !17
  %65 = load ptr, ptr %12, align 8, !tbaa !12
  %66 = getelementptr inbounds double, ptr %65, i64 %indvars.iv74
  %67 = load double, ptr %66, align 8, !tbaa !17
  %68 = fsub double %64, %67
  %69 = load ptr, ptr %13, align 8, !tbaa !12
  %70 = getelementptr inbounds double, ptr %69, i64 %indvars.iv74
  %71 = load double, ptr %70, align 8, !tbaa !17
  %72 = tail call double @llvm.fmuladd.f64(double %68, double %68, double %71)
  store double %72, ptr %70, align 8, !tbaa !17
  %indvars.iv.next.1 = add nuw nsw i64 %indvars.iv, 2
  %niter.next.1 = add i64 %niter, 2
  %niter.ncmp.1 = icmp eq i64 %niter.next.1, %unroll_iter
  br i1 %niter.ncmp.1, label %._crit_edge.loopexit79.unr-lcssa, label %.lr.ph.split.split.us58, !llvm.loop !15

73:                                               ; preds = %.lr.ph
  tail call void @__assert_fail(ptr noundef nonnull @.str.10, ptr noundef nonnull @.str.1, i32 noundef 880, ptr noundef nonnull @__PRETTY_FUNCTION__.matrix_stddev) #4
  unreachable

._crit_edge.loopexit.unr-lcssa:                   ; preds = %.lr.ph.split.split.us, %.lr.ph.split.split.us.preheader
  %indvars.iv69.unr = phi i64 [ 0, %.lr.ph.split.split.us.preheader ], [ %indvars.iv.next70.1, %.lr.ph.split.split.us ]
  %lcmp.mod81.not = icmp eq i64 %xtraiter80, 0
  br i1 %lcmp.mod81.not, label %._crit_edge, label %.lr.ph.split.split.us.epil

.lr.ph.split.split.us.epil:                       ; preds = %._crit_edge.loopexit.unr-lcssa
  %74 = load ptr, ptr %11, align 8, !tbaa !12
  %75 = mul nsw i64 %indvars.iv69.unr, %19
  %76 = getelementptr float, ptr %74, i64 %75
  %77 = getelementptr float, ptr %76, i64 %indvars.iv74
  %78 = load float, ptr %77, align 4, !tbaa !13
  %79 = load ptr, ptr %12, align 8, !tbaa !12
  %80 = getelementptr inbounds float, ptr %79, i64 %indvars.iv74
  %81 = load float, ptr %80, align 4, !tbaa !13
  %82 = fsub float %78, %81
  %83 = load ptr, ptr %13, align 8, !tbaa !12
  %84 = getelementptr inbounds float, ptr %83, i64 %indvars.iv74
  %85 = load float, ptr %84, align 4, !tbaa !13
  %86 = tail call float @llvm.fmuladd.f32(float %82, float %82, float %85)
  store float %86, ptr %84, align 4, !tbaa !13
  br label %._crit_edge

._crit_edge.loopexit79.unr-lcssa:                 ; preds = %.lr.ph.split.split.us58, %.lr.ph.split.split.us58.preheader
  %indvars.iv.unr = phi i64 [ 0, %.lr.ph.split.split.us58.preheader ], [ %indvars.iv.next.1, %.lr.ph.split.split.us58 ]
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br i1 %lcmp.mod.not, label %._crit_edge, label %.lr.ph.split.split.us58.epil

.lr.ph.split.split.us58.epil:                     ; preds = %._crit_edge.loopexit79.unr-lcssa
  %87 = load ptr, ptr %11, align 8, !tbaa !12
  %88 = mul nsw i64 %indvars.iv.unr, %17
  %89 = getelementptr double, ptr %87, i64 %88
  %90 = getelementptr double, ptr %89, i64 %indvars.iv74
  %91 = load double, ptr %90, align 8, !tbaa !17
  %92 = load ptr, ptr %12, align 8, !tbaa !12
  %93 = getelementptr inbounds double, ptr %92, i64 %indvars.iv74
  %94 = load double, ptr %93, align 8, !tbaa !17
  %95 = fsub double %91, %94
  %96 = load ptr, ptr %13, align 8, !tbaa !12
  %97 = getelementptr inbounds double, ptr %96, i64 %indvars.iv74
  %98 = load double, ptr %97, align 8, !tbaa !17
  %99 = tail call double @llvm.fmuladd.f64(double %95, double %95, double %98)
  store double %99, ptr %97, align 8, !tbaa !17
  br label %._crit_edge

._crit_edge:                                      ; preds = %.lr.ph.split.split.us58.epil, %._crit_edge.loopexit79.unr-lcssa, %.lr.ph.split.split.us.epil, %._crit_edge.loopexit.unr-lcssa, %.preheader
  switch i32 %.pre, label %125 [
    i32 1, label %100
    i32 2, label %112
    i32 0, label %124
  ]

100:                                              ; preds = %._crit_edge
  %101 = sitofp i32 %15 to float
  %102 = load ptr, ptr %13, align 8, !tbaa !12
  %103 = getelementptr inbounds float, ptr %102, i64 %indvars.iv74
  %104 = load float, ptr %103, align 4, !tbaa !13
  %105 = fdiv float %104, %101
  store float %105, ptr %103, align 4, !tbaa !13
  %106 = load ptr, ptr %13, align 8, !tbaa !12
  %107 = getelementptr inbounds float, ptr %106, i64 %indvars.iv74
  %108 = load float, ptr %107, align 4, !tbaa !13
  %109 = tail call float @fast_sqrt_f(float noundef %108) #5
  %110 = load ptr, ptr %13, align 8, !tbaa !12
  %111 = getelementptr inbounds float, ptr %110, i64 %indvars.iv74
  store float %109, ptr %111, align 4, !tbaa !13
  br label %125

112:                                              ; preds = %._crit_edge
  %113 = sitofp i32 %15 to double
  %114 = load ptr, ptr %13, align 8, !tbaa !12
  %115 = getelementptr inbounds double, ptr %114, i64 %indvars.iv74
  %116 = load double, ptr %115, align 8, !tbaa !17
  %117 = fdiv double %116, %113
  store double %117, ptr %115, align 8, !tbaa !17
  %118 = load ptr, ptr %13, align 8, !tbaa !12
  %119 = getelementptr inbounds double, ptr %118, i64 %indvars.iv74
  %120 = load double, ptr %119, align 8, !tbaa !17
  %121 = tail call double @fast_sqrt_d(double noundef %120) #5
  %122 = load ptr, ptr %13, align 8, !tbaa !12
  %123 = getelementptr inbounds double, ptr %122, i64 %indvars.iv74
  store double %121, ptr %123, align 8, !tbaa !17
  br label %125

124:                                              ; preds = %._crit_edge
  tail call void @__assert_fail(ptr noundef nonnull @.str.10, ptr noundef nonnull @.str.1, i32 noundef 898, ptr noundef nonnull @__PRETTY_FUNCTION__.matrix_stddev) #4
  unreachable

125:                                              ; preds = %.lr.ph, %._crit_edge, %100, %112
  %indvars.iv.next75 = add nuw nsw i64 %indvars.iv74, 1
  %126 = load i32, ptr %4, align 4, !tbaa !5
  %127 = sext i32 %126 to i64
  %128 = icmp slt i64 %indvars.iv.next75, %127
  br i1 %128, label %.preheader, label %._crit_edge65, !llvm.loop !19

._crit_edge65:                                    ; preds = %125, %3
  ret ptr %8
}

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 = { 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 #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 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #4 = { noreturn nounwind }
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, !7, i64 8, !8, i64 16}
!7 = !{!"int", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!6, !7, i64 8}
!11 = !{!6, !7, i64 0}
!12 = !{!8, !8, i64 0}
!13 = !{!14, !14, i64 0}
!14 = !{!"float", !8, i64 0}
!15 = distinct !{!15, !16}
!16 = !{!"llvm.loop.mustprogress"}
!17 = !{!18, !18, i64 0}
!18 = !{!"double", !8, i64 0}
!19 = distinct !{!19, !16}


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