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

@.str.497 = external hidden unnamed_addr constant [62 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

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

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_impl8ae_fp_eqEdd(double noundef, double noundef) #1

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

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

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

28:                                               ; preds = %8
  %29 = load ptr, ptr %9, align 8, !tbaa !5
  %30 = getelementptr inbounds %"struct.alglib_impl::sparsematrix", ptr %29, i32 0, i32 5
  %31 = load i64, ptr %30, align 8, !tbaa !13
  %32 = icmp eq i64 %31, 1
  br i1 %32, label %33, label %45

33:                                               ; preds = %28
  %34 = load ptr, ptr %9, align 8, !tbaa !5
  %35 = getelementptr inbounds %"struct.alglib_impl::sparsematrix", ptr %34, i32 0, i32 6
  %36 = load i64, ptr %35, align 8, !tbaa !17
  %37 = load i64, ptr %10, align 8, !tbaa !9
  %38 = icmp eq i64 %36, %37
  br i1 %38, label %39, label %45

39:                                               ; preds = %33
  %40 = load ptr, ptr %9, align 8, !tbaa !5
  %41 = getelementptr inbounds %"struct.alglib_impl::sparsematrix", ptr %40, i32 0, i32 7
  %42 = load i64, ptr %41, align 8, !tbaa !18
  %43 = load i64, ptr %13, align 8, !tbaa !9
  %44 = icmp eq i64 %42, %43
  br label %45

45:                                               ; preds = %39, %33, %28
  %46 = phi i1 [ false, %33 ], [ false, %28 ], [ %44, %39 ]
  br label %47

47:                                               ; preds = %45, %8
  %48 = phi i1 [ true, %8 ], [ %46, %45 ]
  %49 = load ptr, ptr %16, align 8, !tbaa !5
  call void @_ZN11alglib_impl9ae_assertEbPKcPNS_8ae_stateE(i1 noundef zeroext %48, ptr noundef @.str.497, ptr noundef %49)
  %50 = load i8, ptr %15, align 1, !tbaa !11, !range !19, !noundef !20
  %51 = trunc i8 %50 to i1
  br i1 %51, label %52, label %56

52:                                               ; preds = %47
  %53 = load i64, ptr %10, align 8, !tbaa !9
  %54 = load ptr, ptr %14, align 8, !tbaa !5
  %55 = load ptr, ptr %16, align 8, !tbaa !5
  call void @_ZN11alglib_impl7rallocvElPNS_9ae_vectorEPNS_8ae_stateE(i64 noundef %53, ptr noundef %54, ptr noundef %55)
  br label %56

56:                                               ; preds = %52, %47
  store double 0.000000e+00, ptr %23, align 8, !tbaa !21
  store i64 0, ptr %17, align 8, !tbaa !9
  br label %57

57:                                               ; preds = %107, %56
  %58 = load i64, ptr %17, align 8, !tbaa !9
  %59 = load i64, ptr %10, align 8, !tbaa !9
  %60 = sub nsw i64 %59, 1
  %61 = icmp sle i64 %58, %60
  br i1 %61, label %62, label %110

62:                                               ; preds = %57
  store double 0.000000e+00, ptr %22, align 8, !tbaa !21
  %63 = load ptr, ptr %9, align 8, !tbaa !5
  %64 = getelementptr inbounds %"struct.alglib_impl::sparsematrix", ptr %63, i32 0, i32 2
  %65 = getelementptr inbounds %"struct.alglib_impl::ae_vector", ptr %64, i32 0, i32 4
  %66 = load ptr, ptr %65, align 8, !tbaa !23
  %67 = load i64, ptr %17, align 8, !tbaa !9
  %68 = getelementptr inbounds i64, ptr %66, i64 %67
  %69 = load i64, ptr %68, align 8, !tbaa !9
  store i64 %69, ptr %19, align 8, !tbaa !9
  %70 = load ptr, ptr %9, align 8, !tbaa !5
  %71 = getelementptr inbounds %"struct.alglib_impl::sparsematrix", ptr %70, i32 0, i32 2
  %72 = getelementptr inbounds %"struct.alglib_impl::ae_vector", ptr %71, i32 0, i32 4
  %73 = load ptr, ptr %72, align 8, !tbaa !23
  %74 = load i64, ptr %17, align 8, !tbaa !9
  %75 = add nsw i64 %74, 1
  %76 = getelementptr inbounds i64, ptr %73, i64 %75
  %77 = load i64, ptr %76, align 8, !tbaa !9
  %78 = sub nsw i64 %77, 1
  store i64 %78, ptr %20, align 8, !tbaa !9
  %79 = load i64, ptr %19, align 8, !tbaa !9
  store i64 %79, ptr %18, align 8, !tbaa !9
  br label %80

80:                                               ; preds = %96, %62
  %81 = load i64, ptr %18, align 8, !tbaa !9
  %82 = load i64, ptr %20, align 8, !tbaa !9
  %83 = icmp sle i64 %81, %82
  br i1 %83, label %84, label %99

84:                                               ; preds = %80
  %85 = load ptr, ptr %9, align 8, !tbaa !5
  %86 = getelementptr inbounds %"struct.alglib_impl::sparsematrix", ptr %85, i32 0, i32 0
  %87 = getelementptr inbounds %"struct.alglib_impl::ae_vector", ptr %86, i32 0, i32 4
  %88 = load ptr, ptr %87, align 8, !tbaa !23
  %89 = load i64, ptr %18, align 8, !tbaa !9
  %90 = getelementptr inbounds double, ptr %88, i64 %89
  %91 = load double, ptr %90, align 8, !tbaa !21
  store double %91, ptr %21, align 8, !tbaa !21
  %92 = load double, ptr %22, align 8, !tbaa !21
  %93 = load double, ptr %21, align 8, !tbaa !21
  %94 = load double, ptr %21, align 8, !tbaa !21
  %95 = call double @llvm.fmuladd.f64(double %93, double %94, double %92)
  store double %95, ptr %22, align 8, !tbaa !21
  br label %96

96:                                               ; preds = %84
  %97 = load i64, ptr %18, align 8, !tbaa !9
  %98 = add nsw i64 %97, 1
  store i64 %98, ptr %18, align 8, !tbaa !9
  br label %80, !llvm.loop !24

99:                                               ; preds = %80
  %100 = load double, ptr %22, align 8, !tbaa !21
  %101 = load ptr, ptr %16, align 8, !tbaa !5
  %102 = call noundef double @_ZN11alglib_impl7ae_sqrtEdPNS_8ae_stateE(double noundef %100, ptr noundef %101)
  store double %102, ptr %22, align 8, !tbaa !21
  %103 = load double, ptr %23, align 8, !tbaa !21
  %104 = load double, ptr %22, align 8, !tbaa !21
  %105 = load ptr, ptr %16, align 8, !tbaa !5
  %106 = call noundef double @_ZN11alglib_impl10ae_maxrealEddPNS_8ae_stateE(double noundef %103, double noundef %104, ptr noundef %105)
  store double %106, ptr %23, align 8, !tbaa !21
  br label %107

107:                                              ; preds = %99
  %108 = load i64, ptr %17, align 8, !tbaa !9
  %109 = add nsw i64 %108, 1
  store i64 %109, ptr %17, align 8, !tbaa !9
  br label %57, !llvm.loop !26

110:                                              ; preds = %57
  %111 = load double, ptr %23, align 8, !tbaa !21
  %112 = call noundef zeroext i1 @_ZN11alglib_impl8ae_fp_eqEdd(double noundef %111, double noundef 0.000000e+00)
  br i1 %112, label %113, label %121

113:                                              ; preds = %110
  %114 = load i8, ptr %15, align 1, !tbaa !11, !range !19, !noundef !20
  %115 = trunc i8 %114 to i1
  br i1 %115, label %116, label %120

116:                                              ; preds = %113
  %117 = load i64, ptr %10, align 8, !tbaa !9
  %118 = load ptr, ptr %14, align 8, !tbaa !5
  %119 = load ptr, ptr %16, align 8, !tbaa !5
  call void @_ZN11alglib_impl5rsetvEldPNS_9ae_vectorEPNS_8ae_stateE(i64 noundef %117, double noundef 1.000000e+00, ptr noundef %118, ptr noundef %119)
  br label %120

120:                                              ; preds = %116, %113
  store i32 1, ptr %24, align 4
  br label %209

121:                                              ; preds = %110
  %122 = load double, ptr %23, align 8, !tbaa !21
  %123 = fdiv double 1.000000e+00, %122
  store double %123, ptr %22, align 8, !tbaa !21
  %124 = load i8, ptr %15, align 1, !tbaa !11, !range !19, !noundef !20
  %125 = trunc i8 %124 to i1
  br i1 %125, label %126, label %131

126:                                              ; preds = %121
  %127 = load i64, ptr %10, align 8, !tbaa !9
  %128 = load double, ptr %23, align 8, !tbaa !21
  %129 = load ptr, ptr %14, align 8, !tbaa !5
  %130 = load ptr, ptr %16, align 8, !tbaa !5
  call void @_ZN11alglib_impl5rsetvEldPNS_9ae_vectorEPNS_8ae_stateE(i64 noundef %127, double noundef %128, ptr noundef %129, ptr noundef %130)
  br label %131

131:                                              ; preds = %126, %121
  store i64 0, ptr %17, align 8, !tbaa !9
  br label %132

132:                                              ; preds = %205, %131
  %133 = load i64, ptr %17, align 8, !tbaa !9
  %134 = load i64, ptr %10, align 8, !tbaa !9
  %135 = sub nsw i64 %134, 1
  %136 = icmp sle i64 %133, %135
  br i1 %136, label %137, label %208

137:                                              ; preds = %132
  %138 = load ptr, ptr %9, align 8, !tbaa !5
  %139 = getelementptr inbounds %"struct.alglib_impl::sparsematrix", ptr %138, i32 0, i32 2
  %140 = getelementptr inbounds %"struct.alglib_impl::ae_vector", ptr %139, i32 0, i32 4
  %141 = load ptr, ptr %140, align 8, !tbaa !23
  %142 = load i64, ptr %17, align 8, !tbaa !9
  %143 = getelementptr inbounds i64, ptr %141, i64 %142
  %144 = load i64, ptr %143, align 8, !tbaa !9
  store i64 %144, ptr %19, align 8, !tbaa !9
  %145 = load ptr, ptr %9, align 8, !tbaa !5
  %146 = getelementptr inbounds %"struct.alglib_impl::sparsematrix", ptr %145, i32 0, i32 2
  %147 = getelementptr inbounds %"struct.alglib_impl::ae_vector", ptr %146, i32 0, i32 4
  %148 = load ptr, ptr %147, align 8, !tbaa !23
  %149 = load i64, ptr %17, align 8, !tbaa !9
  %150 = add nsw i64 %149, 1
  %151 = getelementptr inbounds i64, ptr %148, i64 %150
  %152 = load i64, ptr %151, align 8, !tbaa !9
  %153 = sub nsw i64 %152, 1
  store i64 %153, ptr %20, align 8, !tbaa !9
  %154 = load i64, ptr %19, align 8, !tbaa !9
  store i64 %154, ptr %18, align 8, !tbaa !9
  br label %155

155:                                              ; preds = %175, %137
  %156 = load i64, ptr %18, align 8, !tbaa !9
  %157 = load i64, ptr %20, align 8, !tbaa !9
  %158 = icmp sle i64 %156, %157
  br i1 %158, label %159, label %178

159:                                              ; preds = %155
  %160 = load ptr, ptr %9, align 8, !tbaa !5
  %161 = getelementptr inbounds %"struct.alglib_impl::sparsematrix", ptr %160, i32 0, i32 0
  %162 = getelementptr inbounds %"struct.alglib_impl::ae_vector", ptr %161, i32 0, i32 4
  %163 = load ptr, ptr %162, align 8, !tbaa !23
  %164 = load i64, ptr %18, align 8, !tbaa !9
  %165 = getelementptr inbounds double, ptr %163, i64 %164
  %166 = load double, ptr %165, align 8, !tbaa !21
  %167 = load double, ptr %22, align 8, !tbaa !21
  %168 = fmul double %166, %167
  %169 = load ptr, ptr %9, align 8, !tbaa !5
  %170 = getelementptr inbounds %"struct.alglib_impl::sparsematrix", ptr %169, i32 0, i32 0
  %171 = getelementptr inbounds %"struct.alglib_impl::ae_vector", ptr %170, i32 0, i32 4
  %172 = load ptr, ptr %171, align 8, !tbaa !23
  %173 = load i64, ptr %18, align 8, !tbaa !9
  %174 = getelementptr inbounds double, ptr %172, i64 %173
  store double %168, ptr %174, align 8, !tbaa !21
  br label %175

175:                                              ; preds = %159
  %176 = load i64, ptr %18, align 8, !tbaa !9
  %177 = add nsw i64 %176, 1
  store i64 %177, ptr %18, align 8, !tbaa !9
  br label %155, !llvm.loop !27

178:                                              ; preds = %155
  %179 = load ptr, ptr %11, align 8, !tbaa !5
  %180 = getelementptr inbounds %"struct.alglib_impl::ae_vector", ptr %179, i32 0, i32 4
  %181 = load ptr, ptr %180, align 8, !tbaa !23
  %182 = load i64, ptr %17, align 8, !tbaa !9
  %183 = getelementptr inbounds double, ptr %181, i64 %182
  %184 = load double, ptr %183, align 8, !tbaa !21
  %185 = load double, ptr %22, align 8, !tbaa !21
  %186 = fmul double %184, %185
  %187 = load ptr, ptr %11, align 8, !tbaa !5
  %188 = getelementptr inbounds %"struct.alglib_impl::ae_vector", ptr %187, i32 0, i32 4
  %189 = load ptr, ptr %188, align 8, !tbaa !23
  %190 = load i64, ptr %17, align 8, !tbaa !9
  %191 = getelementptr inbounds double, ptr %189, i64 %190
  store double %186, ptr %191, align 8, !tbaa !21
  %192 = load ptr, ptr %12, align 8, !tbaa !5
  %193 = getelementptr inbounds %"struct.alglib_impl::ae_vector", ptr %192, i32 0, i32 4
  %194 = load ptr, ptr %193, align 8, !tbaa !23
  %195 = load i64, ptr %17, align 8, !tbaa !9
  %196 = getelementptr inbounds double, ptr %194, i64 %195
  %197 = load double, ptr %196, align 8, !tbaa !21
  %198 = load double, ptr %22, align 8, !tbaa !21
  %199 = fmul double %197, %198
  %200 = load ptr, ptr %12, align 8, !tbaa !5
  %201 = getelementptr inbounds %"struct.alglib_impl::ae_vector", ptr %200, i32 0, i32 4
  %202 = load ptr, ptr %201, align 8, !tbaa !23
  %203 = load i64, ptr %17, align 8, !tbaa !9
  %204 = getelementptr inbounds double, ptr %202, i64 %203
  store double %199, ptr %204, align 8, !tbaa !21
  br label %205

205:                                              ; preds = %178
  %206 = load i64, ptr %17, align 8, !tbaa !9
  %207 = add nsw i64 %206, 1
  store i64 %207, ptr %17, align 8, !tbaa !9
  br label %132, !llvm.loop !28

208:                                              ; preds = %132
  store i32 0, ptr %24, align 4
  br label %209

209:                                              ; preds = %208, %120
  call void @llvm.lifetime.end.p0(i64 8, ptr %23) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #4
  %210 = load i32, ptr %24, align 4
  switch i32 %210, label %212 [
    i32 0, label %211
    i32 1, label %211
  ]

211:                                              ; preds = %209, %209
  ret void

212:                                              ; preds = %209
  unreachable
}

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 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #3 = { 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 #4 = { nounwind }

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"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 320}
!14 = !{!"_ZTSN11alglib_impl12sparsematrixE", !15, i64 0, !15, i64 64, !15, i64 128, !15, i64 192, !15, i64 256, !10, i64 320, !10, i64 328, !10, i64 336, !10, i64 344, !10, i64 352, !10, i64 360}
!15 = !{!"_ZTSN11alglib_impl9ae_vectorE", !10, i64 0, !10, i64 8, !12, i64 16, !16, i64 24, !7, i64 56}
!16 = !{!"_ZTSN11alglib_impl12ae_dyn_blockE", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24}
!17 = !{!14, !10, i64 328}
!18 = !{!14, !10, i64 336}
!19 = !{i8 0, i8 2}
!20 = !{}
!21 = !{!22, !22, i64 0}
!22 = !{!"double", !7, i64 0}
!23 = !{!7, !7, i64 0}
!24 = distinct !{!24, !25}
!25 = !{!"llvm.loop.mustprogress"}
!26 = distinct !{!26, !25}
!27 = distinct !{!27, !25}
!28 = distinct !{!28, !25}


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

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

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

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_impl8ae_fp_eqEdd(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_impl5rsetvEldPNS_9ae_vectorEPNS_8ae_stateE(i64 noundef, double noundef, ptr noundef, ptr noundef) local_unnamed_addr #0

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

10:                                               ; preds = %8
  %11 = getelementptr inbounds i8, ptr %0, i64 320
  %12 = load i64, ptr %11, align 8, !tbaa !5
  %13 = icmp eq i64 %12, 1
  br i1 %13, label %14, label %22

14:                                               ; preds = %10
  %15 = getelementptr inbounds i8, ptr %0, i64 328
  %16 = load i64, ptr %15, align 8, !tbaa !14
  %17 = icmp eq i64 %16, %1
  br i1 %17, label %18, label %22

18:                                               ; preds = %14
  %19 = getelementptr inbounds i8, ptr %0, i64 336
  %20 = load i64, ptr %19, align 8, !tbaa !15
  %21 = icmp eq i64 %20, %4
  br label %22

22:                                               ; preds = %10, %14, %18, %8
  %23 = phi i1 [ true, %8 ], [ false, %14 ], [ false, %10 ], [ %21, %18 ]
  tail call void @_ZN11alglib_impl9ae_assertEbPKcPNS_8ae_stateE(i1 noundef zeroext %23, ptr noundef nonnull @.str.497, ptr noundef %7)
  br i1 %6, label %24, label %25

24:                                               ; preds = %22
  tail call void @_ZN11alglib_impl7rallocvElPNS_9ae_vectorEPNS_8ae_stateE(i64 noundef %1, ptr noundef %5, ptr noundef %7)
  br label %25

25:                                               ; preds = %24, %22
  %.not.not80 = icmp sgt i64 %1, 0
  br i1 %.not.not80, label %.lr.ph84, label %._crit_edge85

.lr.ph84:                                         ; preds = %25
  %26 = getelementptr inbounds i8, ptr %0, i64 184
  %27 = getelementptr inbounds i8, ptr %0, i64 56
  br label %28

28:                                               ; preds = %.lr.ph84, %._crit_edge
  %.082 = phi double [ 0.000000e+00, %.lr.ph84 ], [ %55, %._crit_edge ]
  %.06981 = phi i64 [ 0, %.lr.ph84 ], [ %32, %._crit_edge ]
  %29 = load ptr, ptr %26, align 8, !tbaa !16
  %30 = getelementptr inbounds i64, ptr %29, i64 %.06981
  %31 = load i64, ptr %30, align 8, !tbaa !17
  %32 = add nuw nsw i64 %.06981, 1
  %33 = getelementptr inbounds i64, ptr %29, i64 %32
  %34 = load i64, ptr %33, align 8, !tbaa !17
  %.not.not7677 = icmp slt i64 %31, %34
  br i1 %.not.not7677, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %28
  %35 = load ptr, ptr %27, align 8, !tbaa !16
  %36 = sub i64 %34, %31
  %xtraiter = and i64 %36, 3
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br i1 %lcmp.mod.not, label %.prol.loopexit, label %.prol.preheader

.prol.preheader:                                  ; preds = %.lr.ph, %.prol.preheader
  %.06879.prol = phi double [ %39, %.prol.preheader ], [ 0.000000e+00, %.lr.ph ]
  %.07078.prol = phi i64 [ %40, %.prol.preheader ], [ %31, %.lr.ph ]
  %prol.iter = phi i64 [ %prol.iter.next, %.prol.preheader ], [ 0, %.lr.ph ]
  %37 = getelementptr inbounds double, ptr %35, i64 %.07078.prol
  %38 = load double, ptr %37, align 8, !tbaa !18
  %39 = tail call double @llvm.fmuladd.f64(double %38, double %38, double %.06879.prol)
  %40 = add nsw i64 %.07078.prol, 1
  %prol.iter.next = add i64 %prol.iter, 1
  %prol.iter.cmp.not = icmp eq i64 %prol.iter.next, %xtraiter
  br i1 %prol.iter.cmp.not, label %.prol.loopexit, label %.prol.preheader, !llvm.loop !20

.prol.loopexit:                                   ; preds = %.prol.preheader, %.lr.ph
  %.lcssa.unr = phi double [ poison, %.lr.ph ], [ %39, %.prol.preheader ]
  %.06879.unr = phi double [ 0.000000e+00, %.lr.ph ], [ %39, %.prol.preheader ]
  %.07078.unr = phi i64 [ %31, %.lr.ph ], [ %40, %.prol.preheader ]
  %41 = sub i64 %31, %34
  %42 = icmp ugt i64 %41, -4
  br i1 %42, label %._crit_edge, label %.lr.ph.new

.lr.ph.new:                                       ; preds = %.prol.loopexit
  %invariant.gep = getelementptr i8, ptr %35, i64 8
  %invariant.gep111 = getelementptr i8, ptr %35, i64 16
  %invariant.gep113 = getelementptr i8, ptr %35, i64 24
  br label %43

43:                                               ; preds = %43, %.lr.ph.new
  %.06879 = phi double [ %.06879.unr, %.lr.ph.new ], [ %52, %43 ]
  %.07078 = phi i64 [ %.07078.unr, %.lr.ph.new ], [ %53, %43 ]
  %44 = getelementptr inbounds double, ptr %35, i64 %.07078
  %45 = load double, ptr %44, align 8, !tbaa !18
  %46 = tail call double @llvm.fmuladd.f64(double %45, double %45, double %.06879)
  %gep = getelementptr double, ptr %invariant.gep, i64 %.07078
  %47 = load double, ptr %gep, align 8, !tbaa !18
  %48 = tail call double @llvm.fmuladd.f64(double %47, double %47, double %46)
  %gep112 = getelementptr double, ptr %invariant.gep111, i64 %.07078
  %49 = load double, ptr %gep112, align 8, !tbaa !18
  %50 = tail call double @llvm.fmuladd.f64(double %49, double %49, double %48)
  %gep114 = getelementptr double, ptr %invariant.gep113, i64 %.07078
  %51 = load double, ptr %gep114, align 8, !tbaa !18
  %52 = tail call double @llvm.fmuladd.f64(double %51, double %51, double %50)
  %53 = add nsw i64 %.07078, 4
  %exitcond.not.3 = icmp eq i64 %53, %34
  br i1 %exitcond.not.3, label %._crit_edge, label %43, !llvm.loop !22

._crit_edge:                                      ; preds = %.prol.loopexit, %43, %28
  %.068.lcssa = phi double [ 0.000000e+00, %28 ], [ %.lcssa.unr, %.prol.loopexit ], [ %52, %43 ]
  %54 = tail call noundef double @_ZN11alglib_impl7ae_sqrtEdPNS_8ae_stateE(double noundef %.068.lcssa, ptr noundef %7)
  %55 = tail call noundef double @_ZN11alglib_impl10ae_maxrealEddPNS_8ae_stateE(double noundef %.082, double noundef %54, ptr noundef %7)
  %exitcond97.not = icmp eq i64 %32, %1
  br i1 %exitcond97.not, label %._crit_edge85, label %28, !llvm.loop !24

._crit_edge85:                                    ; preds = %._crit_edge, %25
  %.0.lcssa = phi double [ 0.000000e+00, %25 ], [ %55, %._crit_edge ]
  %56 = tail call noundef zeroext i1 @_ZN11alglib_impl8ae_fp_eqEdd(double noundef %.0.lcssa, double noundef 0.000000e+00)
  br i1 %56, label %57, label %59

57:                                               ; preds = %._crit_edge85
  br i1 %6, label %58, label %.loopexit

58:                                               ; preds = %57
  tail call void @_ZN11alglib_impl5rsetvEldPNS_9ae_vectorEPNS_8ae_stateE(i64 noundef %1, double noundef 1.000000e+00, ptr noundef %5, ptr noundef %7)
  br label %.loopexit

59:                                               ; preds = %._crit_edge85
  %60 = fdiv double 1.000000e+00, %.0.lcssa
  br i1 %6, label %61, label %62

61:                                               ; preds = %59
  tail call void @_ZN11alglib_impl5rsetvEldPNS_9ae_vectorEPNS_8ae_stateE(i64 noundef %1, double noundef %.0.lcssa, ptr noundef %5, ptr noundef %7)
  br label %62

62:                                               ; preds = %61, %59
  br i1 %.not.not80, label %.lr.ph95, label %.loopexit

.lr.ph95:                                         ; preds = %62
  %63 = getelementptr inbounds i8, ptr %0, i64 184
  %64 = getelementptr inbounds i8, ptr %0, i64 56
  %65 = getelementptr inbounds i8, ptr %2, i64 56
  %66 = getelementptr inbounds i8, ptr %3, i64 56
  br label %67

67:                                               ; preds = %.lr.ph95, %._crit_edge91
  %.193 = phi i64 [ 0, %.lr.ph95 ], [ %71, %._crit_edge91 ]
  %68 = load ptr, ptr %63, align 8, !tbaa !16
  %69 = getelementptr inbounds i64, ptr %68, i64 %.193
  %70 = load i64, ptr %69, align 8, !tbaa !17
  %71 = add nuw nsw i64 %.193, 1
  %72 = getelementptr inbounds i64, ptr %68, i64 %71
  %73 = load i64, ptr %72, align 8, !tbaa !17
  %.not.not7587 = icmp slt i64 %70, %73
  br i1 %.not.not7587, label %.lr.ph90.preheader, label %._crit_edge91

.lr.ph90.preheader:                               ; preds = %67
  %74 = sub i64 %73, %70
  %xtraiter103 = and i64 %74, 3
  %lcmp.mod104.not = icmp eq i64 %xtraiter103, 0
  br i1 %lcmp.mod104.not, label %.lr.ph90.prol.loopexit, label %.lr.ph90.prol

.lr.ph90.prol:                                    ; preds = %.lr.ph90.preheader, %.lr.ph90.prol
  %.17188.prol = phi i64 [ %79, %.lr.ph90.prol ], [ %70, %.lr.ph90.preheader ]
  %prol.iter105 = phi i64 [ %prol.iter105.next, %.lr.ph90.prol ], [ 0, %.lr.ph90.preheader ]
  %75 = load ptr, ptr %64, align 8, !tbaa !16
  %76 = getelementptr inbounds double, ptr %75, i64 %.17188.prol
  %77 = load double, ptr %76, align 8, !tbaa !18
  %78 = fmul double %60, %77
  store double %78, ptr %76, align 8, !tbaa !18
  %79 = add nsw i64 %.17188.prol, 1
  %prol.iter105.next = add i64 %prol.iter105, 1
  %prol.iter105.cmp.not = icmp eq i64 %prol.iter105.next, %xtraiter103
  br i1 %prol.iter105.cmp.not, label %.lr.ph90.prol.loopexit, label %.lr.ph90.prol, !llvm.loop !25

.lr.ph90.prol.loopexit:                           ; preds = %.lr.ph90.prol, %.lr.ph90.preheader
  %.17188.unr = phi i64 [ %70, %.lr.ph90.preheader ], [ %79, %.lr.ph90.prol ]
  %80 = sub i64 %70, %73
  %81 = icmp ugt i64 %80, -4
  br i1 %81, label %._crit_edge91, label %.lr.ph90

.lr.ph90:                                         ; preds = %.lr.ph90.prol.loopexit, %.lr.ph90
  %.17188 = phi i64 [ %101, %.lr.ph90 ], [ %.17188.unr, %.lr.ph90.prol.loopexit ]
  %82 = load ptr, ptr %64, align 8, !tbaa !16
  %83 = getelementptr inbounds double, ptr %82, i64 %.17188
  %84 = load double, ptr %83, align 8, !tbaa !18
  %85 = fmul double %60, %84
  store double %85, ptr %83, align 8, !tbaa !18
  %86 = load ptr, ptr %64, align 8, !tbaa !16
  %87 = getelementptr double, ptr %86, i64 %.17188
  %88 = getelementptr i8, ptr %87, i64 8
  %89 = load double, ptr %88, align 8, !tbaa !18
  %90 = fmul double %60, %89
  store double %90, ptr %88, align 8, !tbaa !18
  %91 = load ptr, ptr %64, align 8, !tbaa !16
  %92 = getelementptr double, ptr %91, i64 %.17188
  %93 = getelementptr i8, ptr %92, i64 16
  %94 = load double, ptr %93, align 8, !tbaa !18
  %95 = fmul double %60, %94
  store double %95, ptr %93, align 8, !tbaa !18
  %96 = load ptr, ptr %64, align 8, !tbaa !16
  %97 = getelementptr double, ptr %96, i64 %.17188
  %98 = getelementptr i8, ptr %97, i64 24
  %99 = load double, ptr %98, align 8, !tbaa !18
  %100 = fmul double %60, %99
  store double %100, ptr %98, align 8, !tbaa !18
  %101 = add nsw i64 %.17188, 4
  %exitcond98.not.3 = icmp eq i64 %101, %73
  br i1 %exitcond98.not.3, label %._crit_edge91, label %.lr.ph90, !llvm.loop !26

._crit_edge91:                                    ; preds = %.lr.ph90.prol.loopexit, %.lr.ph90, %67
  %102 = load ptr, ptr %65, align 8, !tbaa !16
  %103 = getelementptr inbounds double, ptr %102, i64 %.193
  %104 = load double, ptr %103, align 8, !tbaa !18
  %105 = fmul double %60, %104
  store double %105, ptr %103, align 8, !tbaa !18
  %106 = load ptr, ptr %66, align 8, !tbaa !16
  %107 = getelementptr inbounds double, ptr %106, i64 %.193
  %108 = load double, ptr %107, align 8, !tbaa !18
  %109 = fmul double %60, %108
  store double %109, ptr %107, align 8, !tbaa !18
  %exitcond99.not = icmp eq i64 %71, %1
  br i1 %exitcond99.not, label %.loopexit, label %67, !llvm.loop !27

.loopexit:                                        ; preds = %._crit_edge91, %62, %57, %58
  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 nocallback nofree nosync nounwind speculatable willreturn memory(none) }
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" }

!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, !8, i64 320}
!6 = !{!"_ZTSN11alglib_impl12sparsematrixE", !7, i64 0, !7, i64 64, !7, i64 128, !7, i64 192, !7, i64 256, !8, i64 320, !8, i64 328, !8, i64 336, !8, i64 344, !8, i64 352, !8, i64 360}
!7 = !{!"_ZTSN11alglib_impl9ae_vectorE", !8, i64 0, !8, i64 8, !11, i64 16, !12, i64 24, !9, i64 56}
!8 = !{!"long", !9, i64 0}
!9 = !{!"omnipotent char", !10, i64 0}
!10 = !{!"Simple C++ TBAA"}
!11 = !{!"bool", !9, i64 0}
!12 = !{!"_ZTSN11alglib_impl12ae_dyn_blockE", !13, i64 0, !13, i64 8, !13, i64 16, !13, i64 24}
!13 = !{!"any pointer", !9, i64 0}
!14 = !{!6, !8, i64 328}
!15 = !{!6, !8, i64 336}
!16 = !{!9, !9, i64 0}
!17 = !{!8, !8, i64 0}
!18 = !{!19, !19, i64 0}
!19 = !{!"double", !9, i64 0}
!20 = distinct !{!20, !21}
!21 = !{!"llvm.loop.unroll.disable"}
!22 = distinct !{!22, !23}
!23 = !{!"llvm.loop.mustprogress"}
!24 = distinct !{!24, !23}
!25 = distinct !{!25, !21}
!26 = distinct !{!26, !23}
!27 = distinct !{!27, !23}


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