; LLVM IR from Dimandragon/non-parametric-dsp :: alglib-cpp/src (optimization)

; 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.alglib_impl::ae_matrix" = type { i64, i64, i64, i64, i8, %"struct.alglib_impl::ae_dyn_block", %union.anon.1 }
%"struct.alglib_impl::ae_dyn_block" = type { ptr, ptr, ptr, ptr }
%union.anon.1 = type { ptr }
%"struct.alglib_impl::ae_vector" = type { i64, i64, i8, %"struct.alglib_impl::ae_dyn_block", %union.anon.0 }
%union.anon.0 = type { ptr }

@.str.500 = external hidden unnamed_addr constant [50 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: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #0

declare void @_ZN11alglib_impl9ae_assertEbPKcPNS_8ae_stateE(i1 noundef zeroext, ptr noundef, ptr noundef) #1

declare noundef double @_ZN11alglib_impl7ae_sqrtEdPNS_8ae_stateE(double noundef, ptr noundef) #1

declare noundef double @_ZN11alglib_impl10ae_maxrealEddPNS_8ae_stateE(double noundef, double noundef, ptr noundef) #1

declare noundef zeroext i1 @_ZN11alglib_impl13ae_fp_greaterEdd(double noundef, double noundef) #1

declare noundef zeroext i1 @_ZN11alglib_impl10ae_fp_lessEdd(double noundef, double noundef) #1

declare void @_ZN11alglib_impl7rallocvElPNS_9ae_vectorEPNS_8ae_stateE(i64 noundef, ptr noundef, ptr noundef) #1

declare void @_ZN11alglib_impl5rmulvEldPNS_9ae_vectorEPNS_8ae_stateE(i64 noundef, double noundef, ptr noundef, ptr noundef) #1

declare void @_ZN11alglib_impl5rmulrEldPNS_9ae_matrixElPNS_8ae_stateE(i64 noundef, double noundef, ptr noundef, i64 noundef, ptr noundef) #1

declare noundef double @_ZN11alglib_impl6rdotrrElPKNS_9ae_matrixElS2_lPNS_8ae_stateE(i64 noundef, ptr noundef, i64 noundef, ptr noundef, i64 noundef, ptr noundef) #1

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN11alglib_impl23normalizedenselcinplaceEPNS_9ae_matrixElPNS_9ae_vectorES3_lbS3_bPNS_8ae_stateE(ptr noundef %0, i64 noundef %1, ptr noundef %2, ptr noundef %3, i64 noundef %4, i1 noundef zeroext %5, ptr noundef %6, i1 noundef zeroext %7, ptr noundef %8) #2 {
  %10 = alloca ptr, align 8
  %11 = alloca i64, align 8
  %12 = alloca ptr, align 8
  %13 = alloca ptr, align 8
  %14 = alloca i64, align 8
  %15 = alloca i8, align 1
  %16 = alloca ptr, align 8
  %17 = alloca i8, align 1
  %18 = alloca ptr, align 8
  %19 = alloca i64, align 8
  %20 = alloca double, align 8
  %21 = alloca double, align 8
  store ptr %0, ptr %10, align 8, !tbaa !5
  store i64 %1, ptr %11, align 8, !tbaa !9
  store ptr %2, ptr %12, align 8, !tbaa !5
  store ptr %3, ptr %13, align 8, !tbaa !5
  store i64 %4, ptr %14, align 8, !tbaa !9
  %22 = zext i1 %5 to i8
  store i8 %22, ptr %15, align 1, !tbaa !11
  store ptr %6, ptr %16, align 8, !tbaa !5
  %23 = zext i1 %7 to i8
  store i8 %23, ptr %17, align 1, !tbaa !11
  store ptr %8, ptr %18, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %21) #3
  %24 = load i64, ptr %11, align 8, !tbaa !9
  %25 = icmp eq i64 %24, 0
  br i1 %25, label %40, label %26

26:                                               ; preds = %9
  %27 = load ptr, ptr %10, align 8, !tbaa !5
  %28 = getelementptr inbounds %"struct.alglib_impl::ae_matrix", ptr %27, i32 0, i32 0
  %29 = load i64, ptr %28, align 8, !tbaa !13
  %30 = load i64, ptr %11, align 8, !tbaa !9
  %31 = icmp sge i64 %29, %30
  br i1 %31, label %32, label %38

32:                                               ; preds = %26
  %33 = load ptr, ptr %10, align 8, !tbaa !5
  %34 = getelementptr inbounds %"struct.alglib_impl::ae_matrix", ptr %33, i32 0, i32 1
  %35 = load i64, ptr %34, align 8, !tbaa !16
  %36 = load i64, ptr %14, align 8, !tbaa !9
  %37 = icmp sge i64 %35, %36
  br label %38

38:                                               ; preds = %32, %26
  %39 = phi i1 [ false, %26 ], [ %37, %32 ]
  br label %40

40:                                               ; preds = %38, %9
  %41 = phi i1 [ true, %9 ], [ %39, %38 ]
  %42 = load ptr, ptr %18, align 8, !tbaa !5
  call void @_ZN11alglib_impl9ae_assertEbPKcPNS_8ae_stateE(i1 noundef zeroext %41, ptr noundef @.str.500, ptr noundef %42)
  %43 = load i8, ptr %17, align 1, !tbaa !11, !range !17, !noundef !18
  %44 = trunc i8 %43 to i1
  br i1 %44, label %45, label %49

45:                                               ; preds = %40
  %46 = load i64, ptr %11, align 8, !tbaa !9
  %47 = load ptr, ptr %16, align 8, !tbaa !5
  %48 = load ptr, ptr %18, align 8, !tbaa !5
  call void @_ZN11alglib_impl7rallocvElPNS_9ae_vectorEPNS_8ae_stateE(i64 noundef %46, ptr noundef %47, ptr noundef %48)
  br label %49

49:                                               ; preds = %45, %40
  store i64 0, ptr %19, align 8, !tbaa !9
  br label %50

50:                                               ; preds = %119, %49
  %51 = load i64, ptr %19, align 8, !tbaa !9
  %52 = load i64, ptr %11, align 8, !tbaa !9
  %53 = sub nsw i64 %52, 1
  %54 = icmp sle i64 %51, %53
  br i1 %54, label %55, label %122

55:                                               ; preds = %50
  %56 = load i64, ptr %14, align 8, !tbaa !9
  %57 = load ptr, ptr %10, align 8, !tbaa !5
  %58 = load i64, ptr %19, align 8, !tbaa !9
  %59 = load ptr, ptr %10, align 8, !tbaa !5
  %60 = load i64, ptr %19, align 8, !tbaa !9
  %61 = load ptr, ptr %18, align 8, !tbaa !5
  %62 = call noundef double @_ZN11alglib_impl6rdotrrElPKNS_9ae_matrixElS2_lPNS_8ae_stateE(i64 noundef %56, ptr noundef %57, i64 noundef %58, ptr noundef %59, i64 noundef %60, ptr noundef %61)
  %63 = load ptr, ptr %18, align 8, !tbaa !5
  %64 = call noundef double @_ZN11alglib_impl7ae_sqrtEdPNS_8ae_stateE(double noundef %62, ptr noundef %63)
  store double %64, ptr %20, align 8, !tbaa !19
  %65 = load i8, ptr %15, align 1, !tbaa !11, !range !17, !noundef !18
  %66 = trunc i8 %65 to i1
  br i1 %66, label %67, label %71

67:                                               ; preds = %55
  %68 = load double, ptr %20, align 8, !tbaa !19
  %69 = load ptr, ptr %18, align 8, !tbaa !5
  %70 = call noundef double @_ZN11alglib_impl10ae_maxrealEddPNS_8ae_stateE(double noundef %68, double noundef 1.000000e+00, ptr noundef %69)
  store double %70, ptr %20, align 8, !tbaa !19
  br label %71

71:                                               ; preds = %67, %55
  %72 = load i8, ptr %17, align 1, !tbaa !11, !range !17, !noundef !18
  %73 = trunc i8 %72 to i1
  br i1 %73, label %74, label %81

74:                                               ; preds = %71
  %75 = load double, ptr %20, align 8, !tbaa !19
  %76 = load ptr, ptr %16, align 8, !tbaa !5
  %77 = getelementptr inbounds %"struct.alglib_impl::ae_vector", ptr %76, i32 0, i32 4
  %78 = load ptr, ptr %77, align 8, !tbaa !21
  %79 = load i64, ptr %19, align 8, !tbaa !9
  %80 = getelementptr inbounds double, ptr %78, i64 %79
  store double %75, ptr %80, align 8, !tbaa !19
  br label %81

81:                                               ; preds = %74, %71
  %82 = load double, ptr %20, align 8, !tbaa !19
  %83 = call noundef zeroext i1 @_ZN11alglib_impl13ae_fp_greaterEdd(double noundef %82, double noundef 0.000000e+00)
  br i1 %83, label %84, label %118

84:                                               ; preds = %81
  %85 = load double, ptr %20, align 8, !tbaa !19
  %86 = fdiv double 1.000000e+00, %85
  store double %86, ptr %20, align 8, !tbaa !19
  %87 = load i64, ptr %14, align 8, !tbaa !9
  %88 = load double, ptr %20, align 8, !tbaa !19
  %89 = load ptr, ptr %10, align 8, !tbaa !5
  %90 = load i64, ptr %19, align 8, !tbaa !9
  %91 = load ptr, ptr %18, align 8, !tbaa !5
  call void @_ZN11alglib_impl5rmulrEldPNS_9ae_matrixElPNS_8ae_stateE(i64 noundef %87, double noundef %88, ptr noundef %89, i64 noundef %90, ptr noundef %91)
  %92 = load ptr, ptr %12, align 8, !tbaa !5
  %93 = getelementptr inbounds %"struct.alglib_impl::ae_vector", ptr %92, i32 0, i32 4
  %94 = load ptr, ptr %93, align 8, !tbaa !21
  %95 = load i64, ptr %19, align 8, !tbaa !9
  %96 = getelementptr inbounds double, ptr %94, i64 %95
  %97 = load double, ptr %96, align 8, !tbaa !19
  %98 = load double, ptr %20, align 8, !tbaa !19
  %99 = fmul double %97, %98
  %100 = load ptr, ptr %12, align 8, !tbaa !5
  %101 = getelementptr inbounds %"struct.alglib_impl::ae_vector", ptr %100, i32 0, i32 4
  %102 = load ptr, ptr %101, align 8, !tbaa !21
  %103 = load i64, ptr %19, align 8, !tbaa !9
  %104 = getelementptr inbounds double, ptr %102, i64 %103
  store double %99, ptr %104, align 8, !tbaa !19
  %105 = load ptr, ptr %13, align 8, !tbaa !5
  %106 = getelementptr inbounds %"struct.alglib_impl::ae_vector", ptr %105, i32 0, i32 4
  %107 = load ptr, ptr %106, align 8, !tbaa !21
  %108 = load i64, ptr %19, align 8, !tbaa !9
  %109 = getelementptr inbounds double, ptr %107, i64 %108
  %110 = load double, ptr %109, align 8, !tbaa !19
  %111 = load double, ptr %20, align 8, !tbaa !19
  %112 = fmul double %110, %111
  %113 = load ptr, ptr %13, align 8, !tbaa !5
  %114 = getelementptr inbounds %"struct.alglib_impl::ae_vector", ptr %113, i32 0, i32 4
  %115 = load ptr, ptr %114, align 8, !tbaa !21
  %116 = load i64, ptr %19, align 8, !tbaa !9
  %117 = getelementptr inbounds double, ptr %115, i64 %116
  store double %112, ptr %117, align 8, !tbaa !19
  br label %118

118:                                              ; preds = %84, %81
  br label %119

119:                                              ; preds = %118
  %120 = load i64, ptr %19, align 8, !tbaa !9
  %121 = add nsw i64 %120, 1
  store i64 %121, ptr %19, align 8, !tbaa !9
  br label %50, !llvm.loop !22

122:                                              ; preds = %50
  %123 = load i8, ptr %15, align 1, !tbaa !11, !range !17, !noundef !18
  %124 = trunc i8 %123 to i1
  br i1 %124, label %125, label %206

125:                                              ; preds = %122
  store double 0.000000e+00, ptr %21, align 8, !tbaa !19
  store i64 0, ptr %19, align 8, !tbaa !9
  br label %126

126:                                              ; preds = %144, %125
  %127 = load i64, ptr %19, align 8, !tbaa !9
  %128 = load i64, ptr %11, align 8, !tbaa !9
  %129 = sub nsw i64 %128, 1
  %130 = icmp sle i64 %127, %129
  br i1 %130, label %131, label %147

131:                                              ; preds = %126
  %132 = load double, ptr %21, align 8, !tbaa !19
  %133 = load i64, ptr %14, align 8, !tbaa !9
  %134 = load ptr, ptr %10, align 8, !tbaa !5
  %135 = load i64, ptr %19, align 8, !tbaa !9
  %136 = load ptr, ptr %10, align 8, !tbaa !5
  %137 = load i64, ptr %19, align 8, !tbaa !9
  %138 = load ptr, ptr %18, align 8, !tbaa !5
  %139 = call noundef double @_ZN11alglib_impl6rdotrrElPKNS_9ae_matrixElS2_lPNS_8ae_stateE(i64 noundef %133, ptr noundef %134, i64 noundef %135, ptr noundef %136, i64 noundef %137, ptr noundef %138)
  %140 = load ptr, ptr %18, align 8, !tbaa !5
  %141 = call noundef double @_ZN11alglib_impl7ae_sqrtEdPNS_8ae_stateE(double noundef %139, ptr noundef %140)
  %142 = load ptr, ptr %18, align 8, !tbaa !5
  %143 = call noundef double @_ZN11alglib_impl10ae_maxrealEddPNS_8ae_stateE(double noundef %132, double noundef %141, ptr noundef %142)
  store double %143, ptr %21, align 8, !tbaa !19
  br label %144

144:                                              ; preds = %131
  %145 = load i64, ptr %19, align 8, !tbaa !9
  %146 = add nsw i64 %145, 1
  store i64 %146, ptr %19, align 8, !tbaa !9
  br label %126, !llvm.loop !24

147:                                              ; preds = %126
  %148 = load double, ptr %21, align 8, !tbaa !19
  %149 = call noundef zeroext i1 @_ZN11alglib_impl10ae_fp_lessEdd(double noundef %148, double noundef 1.000000e+00)
  br i1 %149, label %150, label %205

150:                                              ; preds = %147
  %151 = load double, ptr %21, align 8, !tbaa !19
  %152 = call noundef zeroext i1 @_ZN11alglib_impl13ae_fp_greaterEdd(double noundef %151, double noundef 0.000000e+00)
  br i1 %152, label %153, label %205

153:                                              ; preds = %150
  %154 = load i8, ptr %17, align 1, !tbaa !11, !range !17, !noundef !18
  %155 = trunc i8 %154 to i1
  br i1 %155, label %156, label %161

156:                                              ; preds = %153
  %157 = load i64, ptr %11, align 8, !tbaa !9
  %158 = load double, ptr %21, align 8, !tbaa !19
  %159 = load ptr, ptr %16, align 8, !tbaa !5
  %160 = load ptr, ptr %18, align 8, !tbaa !5
  call void @_ZN11alglib_impl5rmulvEldPNS_9ae_vectorEPNS_8ae_stateE(i64 noundef %157, double noundef %158, ptr noundef %159, ptr noundef %160)
  br label %161

161:                                              ; preds = %156, %153
  %162 = load double, ptr %21, align 8, !tbaa !19
  %163 = fdiv double 1.000000e+00, %162
  store double %163, ptr %20, align 8, !tbaa !19
  store i64 0, ptr %19, align 8, !tbaa !9
  br label %164

164:                                              ; preds = %201, %161
  %165 = load i64, ptr %19, align 8, !tbaa !9
  %166 = load i64, ptr %11, align 8, !tbaa !9
  %167 = sub nsw i64 %166, 1
  %168 = icmp sle i64 %165, %167
  br i1 %168, label %169, label %204

169:                                              ; preds = %164
  %170 = load i64, ptr %14, align 8, !tbaa !9
  %171 = load double, ptr %20, align 8, !tbaa !19
  %172 = load ptr, ptr %10, align 8, !tbaa !5
  %173 = load i64, ptr %19, align 8, !tbaa !9
  %174 = load ptr, ptr %18, align 8, !tbaa !5
  call void @_ZN11alglib_impl5rmulrEldPNS_9ae_matrixElPNS_8ae_stateE(i64 noundef %170, double noundef %171, ptr noundef %172, i64 noundef %173, ptr noundef %174)
  %175 = load ptr, ptr %12, align 8, !tbaa !5
  %176 = getelementptr inbounds %"struct.alglib_impl::ae_vector", ptr %175, i32 0, i32 4
  %177 = load ptr, ptr %176, align 8, !tbaa !21
  %178 = load i64, ptr %19, align 8, !tbaa !9
  %179 = getelementptr inbounds double, ptr %177, i64 %178
  %180 = load double, ptr %179, align 8, !tbaa !19
  %181 = load double, ptr %20, align 8, !tbaa !19
  %182 = fmul double %180, %181
  %183 = load ptr, ptr %12, align 8, !tbaa !5
  %184 = getelementptr inbounds %"struct.alglib_impl::ae_vector", ptr %183, i32 0, i32 4
  %185 = load ptr, ptr %184, align 8, !tbaa !21
  %186 = load i64, ptr %19, align 8, !tbaa !9
  %187 = getelementptr inbounds double, ptr %185, i64 %186
  store double %182, ptr %187, align 8, !tbaa !19
  %188 = load ptr, ptr %13, align 8, !tbaa !5
  %189 = getelementptr inbounds %"struct.alglib_impl::ae_vector", ptr %188, i32 0, i32 4
  %190 = load ptr, ptr %189, align 8, !tbaa !21
  %191 = load i64, ptr %19, align 8, !tbaa !9
  %192 = getelementptr inbounds double, ptr %190, i64 %191
  %193 = load double, ptr %192, align 8, !tbaa !19
  %194 = load double, ptr %20, align 8, !tbaa !19
  %195 = fmul double %193, %194
  %196 = load ptr, ptr %13, align 8, !tbaa !5
  %197 = getelementptr inbounds %"struct.alglib_impl::ae_vector", ptr %196, i32 0, i32 4
  %198 = load ptr, ptr %197, align 8, !tbaa !21
  %199 = load i64, ptr %19, align 8, !tbaa !9
  %200 = getelementptr inbounds double, ptr %198, i64 %199
  store double %195, ptr %200, align 8, !tbaa !19
  br label %201

201:                                              ; preds = %169
  %202 = load i64, ptr %19, align 8, !tbaa !9
  %203 = add nsw i64 %202, 1
  store i64 %203, ptr %19, align 8, !tbaa !9
  br label %164, !llvm.loop !25

204:                                              ; preds = %164
  br label %205

205:                                              ; preds = %204, %150, %147
  br label %206

206:                                              ; preds = %205, %122
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #3
  ret void
}

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 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 = { 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++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"long", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"bool", !7, i64 0}
!13 = !{!14, !10, i64 0}
!14 = !{!"_ZTSN11alglib_impl9ae_matrixE", !10, i64 0, !10, i64 8, !10, i64 16, !10, i64 24, !12, i64 32, !15, i64 40, !7, i64 72}
!15 = !{!"_ZTSN11alglib_impl12ae_dyn_blockE", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24}
!16 = !{!14, !10, i64 8}
!17 = !{i8 0, i8 2}
!18 = !{}
!19 = !{!20, !20, i64 0}
!20 = !{!"double", !7, i64 0}
!21 = !{!7, !7, i64 0}
!22 = distinct !{!22, !23}
!23 = !{!"llvm.loop.mustprogress"}
!24 = distinct !{!24, !23}
!25 = distinct !{!25, !23}


; 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.500 = external hidden unnamed_addr constant [50 x i8], align 1

declare void @_ZN11alglib_impl9ae_assertEbPKcPNS_8ae_stateE(i1 noundef zeroext, ptr noundef, ptr noundef) local_unnamed_addr #0

declare noundef double @_ZN11alglib_impl7ae_sqrtEdPNS_8ae_stateE(double noundef, ptr noundef) local_unnamed_addr #0

declare noundef double @_ZN11alglib_impl10ae_maxrealEddPNS_8ae_stateE(double noundef, double noundef, ptr noundef) local_unnamed_addr #0

declare noundef zeroext i1 @_ZN11alglib_impl13ae_fp_greaterEdd(double noundef, double noundef) local_unnamed_addr #0

declare noundef zeroext i1 @_ZN11alglib_impl10ae_fp_lessEdd(double noundef, double noundef) local_unnamed_addr #0

declare void @_ZN11alglib_impl7rallocvElPNS_9ae_vectorEPNS_8ae_stateE(i64 noundef, ptr noundef, ptr noundef) local_unnamed_addr #0

declare void @_ZN11alglib_impl5rmulvEldPNS_9ae_vectorEPNS_8ae_stateE(i64 noundef, double noundef, ptr noundef, ptr noundef) local_unnamed_addr #0

declare void @_ZN11alglib_impl5rmulrEldPNS_9ae_matrixElPNS_8ae_stateE(i64 noundef, double noundef, ptr noundef, i64 noundef, ptr noundef) local_unnamed_addr #0

declare noundef double @_ZN11alglib_impl6rdotrrElPKNS_9ae_matrixElS2_lPNS_8ae_stateE(i64 noundef, ptr noundef, i64 noundef, ptr noundef, i64 noundef, ptr noundef) local_unnamed_addr #0

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN11alglib_impl23normalizedenselcinplaceEPNS_9ae_matrixElPNS_9ae_vectorES3_lbS3_bPNS_8ae_stateE(ptr noundef %0, i64 noundef %1, ptr nocapture noundef readonly %2, ptr nocapture noundef readonly %3, i64 noundef %4, i1 noundef zeroext %5, ptr noundef %6, i1 noundef zeroext %7, ptr noundef %8) local_unnamed_addr #1 {
  %10 = icmp eq i64 %1, 0
  br i1 %10, label %17, label %11

11:                                               ; preds = %9
  %12 = load i64, ptr %0, align 8, !tbaa !5
  %.not = icmp slt i64 %12, %1
  br i1 %.not, label %17, label %13

13:                                               ; preds = %11
  %14 = getelementptr inbounds i8, ptr %0, i64 8
  %15 = load i64, ptr %14, align 8, !tbaa !13
  %16 = icmp sge i64 %15, %4
  br label %17

17:                                               ; preds = %11, %13, %9
  %18 = phi i1 [ true, %9 ], [ false, %11 ], [ %16, %13 ]
  tail call void @_ZN11alglib_impl9ae_assertEbPKcPNS_8ae_stateE(i1 noundef zeroext %18, ptr noundef nonnull @.str.500, ptr noundef %8)
  br i1 %7, label %19, label %20

19:                                               ; preds = %17
  tail call void @_ZN11alglib_impl7rallocvElPNS_9ae_vectorEPNS_8ae_stateE(i64 noundef %1, ptr noundef %6, ptr noundef %8)
  br label %20

20:                                               ; preds = %19, %17
  %.not86.not89 = icmp sgt i64 %1, 0
  br i1 %.not86.not89, label %.lr.ph, label %._crit_edge.thread

.lr.ph:                                           ; preds = %20
  %21 = getelementptr inbounds i8, ptr %6, i64 56
  %22 = getelementptr inbounds i8, ptr %2, i64 56
  %23 = getelementptr inbounds i8, ptr %3, i64 56
  br i1 %5, label %.lr.ph.split.us, label %.lr.ph.split

.lr.ph.split.us:                                  ; preds = %.lr.ph, %42
  %.08390.us = phi i64 [ %43, %42 ], [ 0, %.lr.ph ]
  %24 = tail call noundef double @_ZN11alglib_impl6rdotrrElPKNS_9ae_matrixElS2_lPNS_8ae_stateE(i64 noundef %4, ptr noundef %0, i64 noundef %.08390.us, ptr noundef %0, i64 noundef %.08390.us, ptr noundef %8)
  %25 = tail call noundef double @_ZN11alglib_impl7ae_sqrtEdPNS_8ae_stateE(double noundef %24, ptr noundef %8)
  %26 = tail call noundef double @_ZN11alglib_impl10ae_maxrealEddPNS_8ae_stateE(double noundef %25, double noundef 1.000000e+00, ptr noundef %8)
  br i1 %7, label %27, label %30

27:                                               ; preds = %.lr.ph.split.us
  %28 = load ptr, ptr %21, align 8, !tbaa !14
  %29 = getelementptr inbounds double, ptr %28, i64 %.08390.us
  store double %26, ptr %29, align 8, !tbaa !15
  br label %30

30:                                               ; preds = %27, %.lr.ph.split.us
  %31 = tail call noundef zeroext i1 @_ZN11alglib_impl13ae_fp_greaterEdd(double noundef %26, double noundef 0.000000e+00)
  br i1 %31, label %32, label %42

32:                                               ; preds = %30
  %33 = fdiv double 1.000000e+00, %26
  tail call void @_ZN11alglib_impl5rmulrEldPNS_9ae_matrixElPNS_8ae_stateE(i64 noundef %4, double noundef %33, ptr noundef %0, i64 noundef %.08390.us, ptr noundef %8)
  %34 = load ptr, ptr %22, align 8, !tbaa !14
  %35 = getelementptr inbounds double, ptr %34, i64 %.08390.us
  %36 = load double, ptr %35, align 8, !tbaa !15
  %37 = fmul double %33, %36
  store double %37, ptr %35, align 8, !tbaa !15
  %38 = load ptr, ptr %23, align 8, !tbaa !14
  %39 = getelementptr inbounds double, ptr %38, i64 %.08390.us
  %40 = load double, ptr %39, align 8, !tbaa !15
  %41 = fmul double %33, %40
  store double %41, ptr %39, align 8, !tbaa !15
  br label %42

42:                                               ; preds = %32, %30
  %43 = add nuw nsw i64 %.08390.us, 1
  %exitcond101.not = icmp eq i64 %43, %1
  br i1 %exitcond101.not, label %._crit_edge, label %.lr.ph.split.us, !llvm.loop !17

.lr.ph.split:                                     ; preds = %.lr.ph, %61
  %.08390 = phi i64 [ %62, %61 ], [ 0, %.lr.ph ]
  %44 = tail call noundef double @_ZN11alglib_impl6rdotrrElPKNS_9ae_matrixElS2_lPNS_8ae_stateE(i64 noundef %4, ptr noundef %0, i64 noundef %.08390, ptr noundef %0, i64 noundef %.08390, ptr noundef %8)
  %45 = tail call noundef double @_ZN11alglib_impl7ae_sqrtEdPNS_8ae_stateE(double noundef %44, ptr noundef %8)
  br i1 %7, label %46, label %49

46:                                               ; preds = %.lr.ph.split
  %47 = load ptr, ptr %21, align 8, !tbaa !14
  %48 = getelementptr inbounds double, ptr %47, i64 %.08390
  store double %45, ptr %48, align 8, !tbaa !15
  br label %49

49:                                               ; preds = %46, %.lr.ph.split
  %50 = tail call noundef zeroext i1 @_ZN11alglib_impl13ae_fp_greaterEdd(double noundef %45, double noundef 0.000000e+00)
  br i1 %50, label %51, label %61

51:                                               ; preds = %49
  %52 = fdiv double 1.000000e+00, %45
  tail call void @_ZN11alglib_impl5rmulrEldPNS_9ae_matrixElPNS_8ae_stateE(i64 noundef %4, double noundef %52, ptr noundef %0, i64 noundef %.08390, ptr noundef %8)
  %53 = load ptr, ptr %22, align 8, !tbaa !14
  %54 = getelementptr inbounds double, ptr %53, i64 %.08390
  %55 = load double, ptr %54, align 8, !tbaa !15
  %56 = fmul double %52, %55
  store double %56, ptr %54, align 8, !tbaa !15
  %57 = load ptr, ptr %23, align 8, !tbaa !14
  %58 = getelementptr inbounds double, ptr %57, i64 %.08390
  %59 = load double, ptr %58, align 8, !tbaa !15
  %60 = fmul double %52, %59
  store double %60, ptr %58, align 8, !tbaa !15
  br label %61

61:                                               ; preds = %49, %51
  %62 = add nuw nsw i64 %.08390, 1
  %exitcond.not = icmp eq i64 %62, %1
  br i1 %exitcond.not, label %._crit_edge, label %.lr.ph.split, !llvm.loop !17

._crit_edge:                                      ; preds = %61, %42
  br i1 %5, label %.preheader, label %.loopexit

._crit_edge.thread:                               ; preds = %20
  br i1 %5, label %._crit_edge95, label %.loopexit

.preheader:                                       ; preds = %._crit_edge
  br i1 %.not86.not89, label %.lr.ph94, label %._crit_edge95

.lr.ph94:                                         ; preds = %.preheader, %.lr.ph94
  %.093 = phi double [ %65, %.lr.ph94 ], [ 0.000000e+00, %.preheader ]
  %.192 = phi i64 [ %66, %.lr.ph94 ], [ 0, %.preheader ]
  %63 = tail call noundef double @_ZN11alglib_impl6rdotrrElPKNS_9ae_matrixElS2_lPNS_8ae_stateE(i64 noundef %4, ptr noundef %0, i64 noundef %.192, ptr noundef %0, i64 noundef %.192, ptr noundef %8)
  %64 = tail call noundef double @_ZN11alglib_impl7ae_sqrtEdPNS_8ae_stateE(double noundef %63, ptr noundef %8)
  %65 = tail call noundef double @_ZN11alglib_impl10ae_maxrealEddPNS_8ae_stateE(double noundef %.093, double noundef %64, ptr noundef %8)
  %66 = add nuw nsw i64 %.192, 1
  %exitcond102.not = icmp eq i64 %66, %1
  br i1 %exitcond102.not, label %._crit_edge95, label %.lr.ph94, !llvm.loop !19

._crit_edge95:                                    ; preds = %.lr.ph94, %._crit_edge.thread, %.preheader
  %.0.lcssa = phi double [ 0.000000e+00, %.preheader ], [ 0.000000e+00, %._crit_edge.thread ], [ %65, %.lr.ph94 ]
  %67 = tail call noundef zeroext i1 @_ZN11alglib_impl10ae_fp_lessEdd(double noundef %.0.lcssa, double noundef 1.000000e+00)
  br i1 %67, label %68, label %.loopexit

68:                                               ; preds = %._crit_edge95
  %69 = tail call noundef zeroext i1 @_ZN11alglib_impl13ae_fp_greaterEdd(double noundef %.0.lcssa, double noundef 0.000000e+00)
  br i1 %69, label %70, label %.loopexit

70:                                               ; preds = %68
  br i1 %7, label %71, label %72

71:                                               ; preds = %70
  tail call void @_ZN11alglib_impl5rmulvEldPNS_9ae_vectorEPNS_8ae_stateE(i64 noundef %1, double noundef %.0.lcssa, ptr noundef %6, ptr noundef %8)
  br label %72

72:                                               ; preds = %71, %70
  %73 = fdiv double 1.000000e+00, %.0.lcssa
  br i1 %.not86.not89, label %.lr.ph99, label %.loopexit

.lr.ph99:                                         ; preds = %72
  %74 = getelementptr inbounds i8, ptr %2, i64 56
  %75 = getelementptr inbounds i8, ptr %3, i64 56
  br label %76

76:                                               ; preds = %.lr.ph99, %76
  %.297 = phi i64 [ 0, %.lr.ph99 ], [ %85, %76 ]
  tail call void @_ZN11alglib_impl5rmulrEldPNS_9ae_matrixElPNS_8ae_stateE(i64 noundef %4, double noundef %73, ptr noundef %0, i64 noundef %.297, ptr noundef %8)
  %77 = load ptr, ptr %74, align 8, !tbaa !14
  %78 = getelementptr inbounds double, ptr %77, i64 %.297
  %79 = load double, ptr %78, align 8, !tbaa !15
  %80 = fmul double %73, %79
  store double %80, ptr %78, align 8, !tbaa !15
  %81 = load ptr, ptr %75, align 8, !tbaa !14
  %82 = getelementptr inbounds double, ptr %81, i64 %.297
  %83 = load double, ptr %82, align 8, !tbaa !15
  %84 = fmul double %73, %83
  store double %84, ptr %82, align 8, !tbaa !15
  %85 = add nuw nsw i64 %.297, 1
  %exitcond103.not = icmp eq i64 %85, %1
  br i1 %exitcond103.not, label %.loopexit, label %76, !llvm.loop !20

.loopexit:                                        ; preds = %76, %._crit_edge.thread, %72, %._crit_edge95, %68, %._crit_edge
  ret void
}

attributes #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 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" }

!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 = !{!"_ZTSN11alglib_impl9ae_matrixE", !7, i64 0, !7, i64 8, !7, i64 16, !7, i64 24, !10, i64 32, !11, i64 40, !8, i64 72}
!7 = !{!"long", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!"bool", !8, i64 0}
!11 = !{!"_ZTSN11alglib_impl12ae_dyn_blockE", !12, i64 0, !12, i64 8, !12, i64 16, !12, i64 24}
!12 = !{!"any pointer", !8, i64 0}
!13 = !{!6, !7, i64 8}
!14 = !{!8, !8, i64 0}
!15 = !{!16, !16, i64 0}
!16 = !{!"double", !8, i64 0}
!17 = distinct !{!17, !18}
!18 = !{!"llvm.loop.mustprogress"}
!19 = distinct !{!19, !18}
!20 = distinct !{!20, !18}


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