; LLVM IR from venumb/ZSPACE :: cpp/depends/alglib/cpp/src (linalg)

; 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.75 = external hidden unnamed_addr constant [70 x i8], align 1
@.str.76 = external hidden unnamed_addr constant [15 x i8], align 1
@.str.77 = external hidden unnamed_addr constant [16 x i8], align 1
@.str.78 = external hidden unnamed_addr constant [15 x i8], align 1
@.str.79 = external hidden unnamed_addr constant [16 x i8], align 1
@.str.80 = external hidden unnamed_addr constant [34 x i8], align 1
@_ZN11alglib_implL20sparse_maxloadfactorE = external hidden global double, align 8

; 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: mustprogress uwtable
define dso_local void @_ZN11alglib_impl9sparseaddEPNS_12sparsematrixElldPNS_8ae_stateE(ptr noundef %0, i64 noundef %1, i64 noundef %2, double noundef %3, ptr noundef %4) #2 {
  %6 = alloca ptr, align 8
  %7 = alloca i64, align 8
  %8 = alloca i64, align 8
  %9 = alloca double, align 8
  %10 = alloca ptr, align 8
  %11 = alloca i64, align 8
  %12 = alloca i64, align 8
  %13 = alloca i64, align 8
  %14 = alloca i32, align 4
  store ptr %0, ptr %6, align 8, !tbaa !5
  store i64 %1, ptr %7, align 8, !tbaa !9
  store i64 %2, ptr %8, align 8, !tbaa !9
  store double %3, ptr %9, align 8, !tbaa !11
  store ptr %4, ptr %10, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #3
  %15 = load ptr, ptr %6, align 8, !tbaa !5
  %16 = getelementptr inbounds %"struct.alglib_impl::sparsematrix", ptr %15, i32 0, i32 5
  %17 = load i64, ptr %16, align 8, !tbaa !13
  %18 = icmp eq i64 %17, 0
  %19 = load ptr, ptr %10, align 8, !tbaa !5
  call void @_ZN11alglib_impl9ae_assertEbPKcPNS_8ae_stateE(i1 noundef zeroext %18, ptr noundef @.str.75, ptr noundef %19)
  %20 = load i64, ptr %7, align 8, !tbaa !9
  %21 = icmp sge i64 %20, 0
  %22 = load ptr, ptr %10, align 8, !tbaa !5
  call void @_ZN11alglib_impl9ae_assertEbPKcPNS_8ae_stateE(i1 noundef zeroext %21, ptr noundef @.str.76, ptr noundef %22)
  %23 = load i64, ptr %7, align 8, !tbaa !9
  %24 = load ptr, ptr %6, align 8, !tbaa !5
  %25 = getelementptr inbounds %"struct.alglib_impl::sparsematrix", ptr %24, i32 0, i32 6
  %26 = load i64, ptr %25, align 8, !tbaa !18
  %27 = icmp slt i64 %23, %26
  %28 = load ptr, ptr %10, align 8, !tbaa !5
  call void @_ZN11alglib_impl9ae_assertEbPKcPNS_8ae_stateE(i1 noundef zeroext %27, ptr noundef @.str.77, ptr noundef %28)
  %29 = load i64, ptr %8, align 8, !tbaa !9
  %30 = icmp sge i64 %29, 0
  %31 = load ptr, ptr %10, align 8, !tbaa !5
  call void @_ZN11alglib_impl9ae_assertEbPKcPNS_8ae_stateE(i1 noundef zeroext %30, ptr noundef @.str.78, ptr noundef %31)
  %32 = load i64, ptr %8, align 8, !tbaa !9
  %33 = load ptr, ptr %6, align 8, !tbaa !5
  %34 = getelementptr inbounds %"struct.alglib_impl::sparsematrix", ptr %33, i32 0, i32 7
  %35 = load i64, ptr %34, align 8, !tbaa !19
  %36 = icmp slt i64 %32, %35
  %37 = load ptr, ptr %10, align 8, !tbaa !5
  call void @_ZN11alglib_impl9ae_assertEbPKcPNS_8ae_stateE(i1 noundef zeroext %36, ptr noundef @.str.79, ptr noundef %37)
  %38 = load double, ptr %9, align 8, !tbaa !11
  %39 = load ptr, ptr %10, align 8, !tbaa !5
  %40 = call noundef zeroext i1 @_ZN11alglib_impl11ae_isfiniteEdPNS_8ae_stateE(double noundef %38, ptr noundef %39)
  %41 = load ptr, ptr %10, align 8, !tbaa !5
  call void @_ZN11alglib_impl9ae_assertEbPKcPNS_8ae_stateE(i1 noundef zeroext %40, ptr noundef @.str.80, ptr noundef %41)
  %42 = load double, ptr %9, align 8, !tbaa !11
  %43 = call noundef zeroext i1 @_ZN11alglib_impl8ae_fp_eqEdd(double noundef %42, double noundef 0.000000e+00)
  br i1 %43, label %44, label %45

44:                                               ; preds = %5
  store i32 1, ptr %14, align 4
  br label %198

45:                                               ; preds = %5
  store i64 -1, ptr %12, align 8, !tbaa !9
  %46 = load ptr, ptr %6, align 8, !tbaa !5
  %47 = getelementptr inbounds %"struct.alglib_impl::sparsematrix", ptr %46, i32 0, i32 10
  %48 = load i64, ptr %47, align 8, !tbaa !20
  store i64 %48, ptr %13, align 8, !tbaa !9
  %49 = load double, ptr @_ZN11alglib_implL20sparse_maxloadfactorE, align 8, !tbaa !11
  %50 = fsub double 1.000000e+00, %49
  %51 = load i64, ptr %13, align 8, !tbaa !9
  %52 = sitofp i64 %51 to double
  %53 = fmul double %50, %52
  %54 = load ptr, ptr %6, align 8, !tbaa !5
  %55 = getelementptr inbounds %"struct.alglib_impl::sparsematrix", ptr %54, i32 0, i32 8
  %56 = load i64, ptr %55, align 8, !tbaa !21
  %57 = sitofp i64 %56 to double
  %58 = call noundef zeroext i1 @_ZN11alglib_impl16ae_fp_greater_eqEdd(double noundef %53, double noundef %57)
  br i1 %58, label %59, label %65

59:                                               ; preds = %45
  %60 = load ptr, ptr %6, align 8, !tbaa !5
  %61 = load ptr, ptr %10, align 8, !tbaa !5
  call void @_ZN11alglib_impl18sparseresizematrixEPNS_12sparsematrixEPNS_8ae_stateE(ptr noundef %60, ptr noundef %61)
  %62 = load ptr, ptr %6, align 8, !tbaa !5
  %63 = getelementptr inbounds %"struct.alglib_impl::sparsematrix", ptr %62, i32 0, i32 10
  %64 = load i64, ptr %63, align 8, !tbaa !20
  store i64 %64, ptr %13, align 8, !tbaa !9
  br label %65

65:                                               ; preds = %59, %45
  %66 = load i64, ptr %7, align 8, !tbaa !9
  %67 = load i64, ptr %8, align 8, !tbaa !9
  %68 = load i64, ptr %13, align 8, !tbaa !9
  %69 = load ptr, ptr %10, align 8, !tbaa !5
  %70 = call noundef i64 @_ZN11alglib_implL11sparse_hashElllPNS_8ae_stateE(i64 noundef %66, i64 noundef %67, i64 noundef %68, ptr noundef %69)
  store i64 %70, ptr %11, align 8, !tbaa !9
  br label %71

71:                                               ; preds = %197, %65
  %72 = load ptr, ptr %6, align 8, !tbaa !5
  %73 = getelementptr inbounds %"struct.alglib_impl::sparsematrix", ptr %72, i32 0, i32 1
  %74 = getelementptr inbounds %"struct.alglib_impl::ae_vector", ptr %73, i32 0, i32 4
  %75 = load ptr, ptr %74, align 8, !tbaa !22
  %76 = load i64, ptr %11, align 8, !tbaa !9
  %77 = mul nsw i64 2, %76
  %78 = getelementptr inbounds i64, ptr %75, i64 %77
  %79 = load i64, ptr %78, align 8, !tbaa !9
  %80 = icmp eq i64 %79, -1
  br i1 %80, label %81, label %121

81:                                               ; preds = %71
  %82 = load i64, ptr %12, align 8, !tbaa !9
  %83 = icmp ne i64 %82, -1
  br i1 %83, label %84, label %86

84:                                               ; preds = %81
  %85 = load i64, ptr %12, align 8, !tbaa !9
  store i64 %85, ptr %11, align 8, !tbaa !9
  br label %86

86:                                               ; preds = %84, %81
  %87 = load double, ptr %9, align 8, !tbaa !11
  %88 = load ptr, ptr %6, align 8, !tbaa !5
  %89 = getelementptr inbounds %"struct.alglib_impl::sparsematrix", ptr %88, i32 0, i32 0
  %90 = getelementptr inbounds %"struct.alglib_impl::ae_vector", ptr %89, i32 0, i32 4
  %91 = load ptr, ptr %90, align 8, !tbaa !22
  %92 = load i64, ptr %11, align 8, !tbaa !9
  %93 = getelementptr inbounds double, ptr %91, i64 %92
  store double %87, ptr %93, align 8, !tbaa !11
  %94 = load i64, ptr %7, align 8, !tbaa !9
  %95 = load ptr, ptr %6, align 8, !tbaa !5
  %96 = getelementptr inbounds %"struct.alglib_impl::sparsematrix", ptr %95, i32 0, i32 1
  %97 = getelementptr inbounds %"struct.alglib_impl::ae_vector", ptr %96, i32 0, i32 4
  %98 = load ptr, ptr %97, align 8, !tbaa !22
  %99 = load i64, ptr %11, align 8, !tbaa !9
  %100 = mul nsw i64 2, %99
  %101 = getelementptr inbounds i64, ptr %98, i64 %100
  store i64 %94, ptr %101, align 8, !tbaa !9
  %102 = load i64, ptr %8, align 8, !tbaa !9
  %103 = load ptr, ptr %6, align 8, !tbaa !5
  %104 = getelementptr inbounds %"struct.alglib_impl::sparsematrix", ptr %103, i32 0, i32 1
  %105 = getelementptr inbounds %"struct.alglib_impl::ae_vector", ptr %104, i32 0, i32 4
  %106 = load ptr, ptr %105, align 8, !tbaa !22
  %107 = load i64, ptr %11, align 8, !tbaa !9
  %108 = mul nsw i64 2, %107
  %109 = add nsw i64 %108, 1
  %110 = getelementptr inbounds i64, ptr %106, i64 %109
  store i64 %102, ptr %110, align 8, !tbaa !9
  %111 = load i64, ptr %12, align 8, !tbaa !9
  %112 = icmp eq i64 %111, -1
  br i1 %112, label %113, label %120

113:                                              ; preds = %86
  %114 = load ptr, ptr %6, align 8, !tbaa !5
  %115 = getelementptr inbounds %"struct.alglib_impl::sparsematrix", ptr %114, i32 0, i32 8
  %116 = load i64, ptr %115, align 8, !tbaa !21
  %117 = sub nsw i64 %116, 1
  %118 = load ptr, ptr %6, align 8, !tbaa !5
  %119 = getelementptr inbounds %"struct.alglib_impl::sparsematrix", ptr %118, i32 0, i32 8
  store i64 %117, ptr %119, align 8, !tbaa !21
  br label %120

120:                                              ; preds = %113, %86
  store i32 1, ptr %14, align 4
  br label %198

121:                                              ; preds = %71
  %122 = load ptr, ptr %6, align 8, !tbaa !5
  %123 = getelementptr inbounds %"struct.alglib_impl::sparsematrix", ptr %122, i32 0, i32 1
  %124 = getelementptr inbounds %"struct.alglib_impl::ae_vector", ptr %123, i32 0, i32 4
  %125 = load ptr, ptr %124, align 8, !tbaa !22
  %126 = load i64, ptr %11, align 8, !tbaa !9
  %127 = mul nsw i64 2, %126
  %128 = getelementptr inbounds i64, ptr %125, i64 %127
  %129 = load i64, ptr %128, align 8, !tbaa !9
  %130 = load i64, ptr %7, align 8, !tbaa !9
  %131 = icmp eq i64 %129, %130
  br i1 %131, label %132, label %177

132:                                              ; preds = %121
  %133 = load ptr, ptr %6, align 8, !tbaa !5
  %134 = getelementptr inbounds %"struct.alglib_impl::sparsematrix", ptr %133, i32 0, i32 1
  %135 = getelementptr inbounds %"struct.alglib_impl::ae_vector", ptr %134, i32 0, i32 4
  %136 = load ptr, ptr %135, align 8, !tbaa !22
  %137 = load i64, ptr %11, align 8, !tbaa !9
  %138 = mul nsw i64 2, %137
  %139 = add nsw i64 %138, 1
  %140 = getelementptr inbounds i64, ptr %136, i64 %139
  %141 = load i64, ptr %140, align 8, !tbaa !9
  %142 = load i64, ptr %8, align 8, !tbaa !9
  %143 = icmp eq i64 %141, %142
  br i1 %143, label %144, label %177

144:                                              ; preds = %132
  %145 = load ptr, ptr %6, align 8, !tbaa !5
  %146 = getelementptr inbounds %"struct.alglib_impl::sparsematrix", ptr %145, i32 0, i32 0
  %147 = getelementptr inbounds %"struct.alglib_impl::ae_vector", ptr %146, i32 0, i32 4
  %148 = load ptr, ptr %147, align 8, !tbaa !22
  %149 = load i64, ptr %11, align 8, !tbaa !9
  %150 = getelementptr inbounds double, ptr %148, i64 %149
  %151 = load double, ptr %150, align 8, !tbaa !11
  %152 = load double, ptr %9, align 8, !tbaa !11
  %153 = fadd double %151, %152
  %154 = load ptr, ptr %6, align 8, !tbaa !5
  %155 = getelementptr inbounds %"struct.alglib_impl::sparsematrix", ptr %154, i32 0, i32 0
  %156 = getelementptr inbounds %"struct.alglib_impl::ae_vector", ptr %155, i32 0, i32 4
  %157 = load ptr, ptr %156, align 8, !tbaa !22
  %158 = load i64, ptr %11, align 8, !tbaa !9
  %159 = getelementptr inbounds double, ptr %157, i64 %158
  store double %153, ptr %159, align 8, !tbaa !11
  %160 = load ptr, ptr %6, 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 !22
  %164 = load i64, ptr %11, align 8, !tbaa !9
  %165 = getelementptr inbounds double, ptr %163, i64 %164
  %166 = load double, ptr %165, align 8, !tbaa !11
  %167 = call noundef zeroext i1 @_ZN11alglib_impl8ae_fp_eqEdd(double noundef %166, double noundef 0.000000e+00)
  br i1 %167, label %168, label %176

168:                                              ; preds = %144
  %169 = load ptr, ptr %6, align 8, !tbaa !5
  %170 = getelementptr inbounds %"struct.alglib_impl::sparsematrix", ptr %169, i32 0, i32 1
  %171 = getelementptr inbounds %"struct.alglib_impl::ae_vector", ptr %170, i32 0, i32 4
  %172 = load ptr, ptr %171, align 8, !tbaa !22
  %173 = load i64, ptr %11, align 8, !tbaa !9
  %174 = mul nsw i64 2, %173
  %175 = getelementptr inbounds i64, ptr %172, i64 %174
  store i64 -2, ptr %175, align 8, !tbaa !9
  br label %176

176:                                              ; preds = %168, %144
  store i32 1, ptr %14, align 4
  br label %198

177:                                              ; preds = %132, %121
  %178 = load i64, ptr %12, align 8, !tbaa !9
  %179 = icmp eq i64 %178, -1
  br i1 %179, label %180, label %192

180:                                              ; preds = %177
  %181 = load ptr, ptr %6, align 8, !tbaa !5
  %182 = getelementptr inbounds %"struct.alglib_impl::sparsematrix", ptr %181, i32 0, i32 1
  %183 = getelementptr inbounds %"struct.alglib_impl::ae_vector", ptr %182, i32 0, i32 4
  %184 = load ptr, ptr %183, align 8, !tbaa !22
  %185 = load i64, ptr %11, align 8, !tbaa !9
  %186 = mul nsw i64 2, %185
  %187 = getelementptr inbounds i64, ptr %184, i64 %186
  %188 = load i64, ptr %187, align 8, !tbaa !9
  %189 = icmp eq i64 %188, -2
  br i1 %189, label %190, label %192

190:                                              ; preds = %180
  %191 = load i64, ptr %11, align 8, !tbaa !9
  store i64 %191, ptr %12, align 8, !tbaa !9
  br label %192

192:                                              ; preds = %190, %180, %177
  %193 = load i64, ptr %11, align 8, !tbaa !9
  %194 = add nsw i64 %193, 1
  %195 = load i64, ptr %13, align 8, !tbaa !9
  %196 = srem i64 %194, %195
  store i64 %196, ptr %11, align 8, !tbaa !9
  br label %197

197:                                              ; preds = %192
  br label %71, !llvm.loop !23

198:                                              ; preds = %176, %120, %44
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #3
  ret void
}

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN11alglib_impl18sparseresizematrixEPNS_12sparsematrixEPNS_8ae_stateE(ptr noundef, ptr noundef) #2

declare noundef zeroext i1 @_ZN11alglib_impl11ae_isfiniteEdPNS_8ae_stateE(double noundef, ptr noundef) #1

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

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

; Function Attrs: mustprogress uwtable
declare hidden noundef i64 @_ZN11alglib_implL11sparse_hashElllPNS_8ae_stateE(i64 noundef, i64 noundef, i64 noundef, ptr noundef) #2

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 = !{!"double", !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, !16, i64 16, !17, i64 24, !7, i64 56}
!16 = !{!"bool", !7, i64 0}
!17 = !{!"_ZTSN11alglib_impl12ae_dyn_blockE", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24}
!18 = !{!14, !10, i64 328}
!19 = !{!14, !10, i64 336}
!20 = !{!14, !10, i64 360}
!21 = !{!14, !10, i64 344}
!22 = !{!7, !7, i64 0}
!23 = distinct !{!23, !24}
!24 = !{!"llvm.loop.mustprogress"}


; 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.75 = external hidden unnamed_addr constant [70 x i8], align 1
@.str.76 = external hidden unnamed_addr constant [15 x i8], align 1
@.str.77 = external hidden unnamed_addr constant [16 x i8], align 1
@.str.78 = external hidden unnamed_addr constant [15 x i8], align 1
@.str.79 = external hidden unnamed_addr constant [16 x i8], align 1
@.str.80 = external hidden unnamed_addr constant [34 x i8], align 1
@_ZN11alglib_implL20sparse_maxloadfactorE = external hidden local_unnamed_addr global double, align 8

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN11alglib_impl9sparseaddEPNS_12sparsematrixElldPNS_8ae_stateE(ptr noundef %0, i64 noundef %1, i64 noundef %2, double noundef %3, ptr noundef %4) local_unnamed_addr #1 {
  %6 = getelementptr inbounds i8, ptr %0, i64 320
  %7 = load i64, ptr %6, align 8, !tbaa !5
  %8 = icmp eq i64 %7, 0
  tail call void @_ZN11alglib_impl9ae_assertEbPKcPNS_8ae_stateE(i1 noundef zeroext %8, ptr noundef nonnull @.str.75, ptr noundef %4)
  %9 = icmp sgt i64 %1, -1
  tail call void @_ZN11alglib_impl9ae_assertEbPKcPNS_8ae_stateE(i1 noundef zeroext %9, ptr noundef nonnull @.str.76, ptr noundef %4)
  %10 = getelementptr inbounds i8, ptr %0, i64 328
  %11 = load i64, ptr %10, align 8, !tbaa !14
  %12 = icmp sgt i64 %11, %1
  tail call void @_ZN11alglib_impl9ae_assertEbPKcPNS_8ae_stateE(i1 noundef zeroext %12, ptr noundef nonnull @.str.77, ptr noundef %4)
  %13 = icmp sgt i64 %2, -1
  tail call void @_ZN11alglib_impl9ae_assertEbPKcPNS_8ae_stateE(i1 noundef zeroext %13, ptr noundef nonnull @.str.78, ptr noundef %4)
  %14 = getelementptr inbounds i8, ptr %0, i64 336
  %15 = load i64, ptr %14, align 8, !tbaa !15
  %16 = icmp sgt i64 %15, %2
  tail call void @_ZN11alglib_impl9ae_assertEbPKcPNS_8ae_stateE(i1 noundef zeroext %16, ptr noundef nonnull @.str.79, ptr noundef %4)
  %17 = tail call noundef zeroext i1 @_ZN11alglib_impl11ae_isfiniteEdPNS_8ae_stateE(double noundef %3, ptr noundef %4)
  tail call void @_ZN11alglib_impl9ae_assertEbPKcPNS_8ae_stateE(i1 noundef zeroext %17, ptr noundef nonnull @.str.80, ptr noundef %4)
  %18 = tail call noundef zeroext i1 @_ZN11alglib_impl8ae_fp_eqEdd(double noundef %3, double noundef 0.000000e+00)
  br i1 %18, label %82, label %19

19:                                               ; preds = %5
  %20 = getelementptr inbounds i8, ptr %0, i64 360
  %21 = load i64, ptr %20, align 8, !tbaa !16
  %22 = load double, ptr @_ZN11alglib_implL20sparse_maxloadfactorE, align 8, !tbaa !17
  %23 = fsub double 1.000000e+00, %22
  %24 = sitofp i64 %21 to double
  %25 = fmul double %23, %24
  %26 = getelementptr inbounds i8, ptr %0, i64 344
  %27 = load i64, ptr %26, align 8, !tbaa !19
  %28 = sitofp i64 %27 to double
  %29 = tail call noundef zeroext i1 @_ZN11alglib_impl16ae_fp_greater_eqEdd(double noundef %25, double noundef %28)
  br i1 %29, label %30, label %32

30:                                               ; preds = %19
  tail call void @_ZN11alglib_impl18sparseresizematrixEPNS_12sparsematrixEPNS_8ae_stateE(ptr noundef nonnull %0, ptr noundef %4)
  %31 = load i64, ptr %20, align 8, !tbaa !16
  br label %32

32:                                               ; preds = %30, %19
  %.0 = phi i64 [ %31, %30 ], [ %21, %19 ]
  %33 = tail call noundef i64 @_ZN11alglib_implL11sparse_hashElllPNS_8ae_stateE(i64 noundef %1, i64 noundef %2, i64 noundef %.0, ptr noundef %4)
  %34 = getelementptr inbounds i8, ptr %0, i64 120
  %35 = load ptr, ptr %34, align 8, !tbaa !20
  %36 = shl nsw i64 %33, 1
  %37 = getelementptr inbounds i64, ptr %35, i64 %36
  %38 = load i64, ptr %37, align 8, !tbaa !21
  %39 = icmp eq i64 %38, -1
  br i1 %39, label %._crit_edge, label %.lr.ph

._crit_edge:                                      ; preds = %73, %32
  %.063.lcssa = phi i64 [ %33, %32 ], [ %77, %73 ]
  %.062.lcssa = phi i64 [ -1, %32 ], [ %.1, %73 ]
  %.not = icmp eq i64 %.062.lcssa, -1
  %spec.select = select i1 %.not, i64 %.063.lcssa, i64 %.062.lcssa
  %40 = getelementptr inbounds i8, ptr %0, i64 56
  %41 = load ptr, ptr %40, align 8, !tbaa !20
  %42 = getelementptr inbounds double, ptr %41, i64 %spec.select
  store double %3, ptr %42, align 8, !tbaa !17
  %43 = load ptr, ptr %34, align 8, !tbaa !20
  %44 = shl nsw i64 %spec.select, 1
  %45 = getelementptr inbounds i64, ptr %43, i64 %44
  store i64 %1, ptr %45, align 8, !tbaa !21
  %46 = load ptr, ptr %34, align 8, !tbaa !20
  %47 = or disjoint i64 %44, 1
  %48 = getelementptr inbounds i64, ptr %46, i64 %47
  store i64 %2, ptr %48, align 8, !tbaa !21
  br i1 %.not, label %49, label %82

49:                                               ; preds = %._crit_edge
  %50 = load i64, ptr %26, align 8, !tbaa !19
  %51 = add nsw i64 %50, -1
  store i64 %51, ptr %26, align 8, !tbaa !19
  br label %82

.lr.ph:                                           ; preds = %32, %73
  %52 = phi i64 [ %80, %73 ], [ %38, %32 ]
  %53 = phi i64 [ %78, %73 ], [ %36, %32 ]
  %.06273 = phi i64 [ %.1, %73 ], [ -1, %32 ]
  %.06372 = phi i64 [ %77, %73 ], [ %33, %32 ]
  %54 = icmp eq i64 %52, %1
  br i1 %54, label %55, label %73

55:                                               ; preds = %.lr.ph
  %56 = or disjoint i64 %53, 1
  %57 = getelementptr inbounds i64, ptr %35, i64 %56
  %58 = load i64, ptr %57, align 8, !tbaa !21
  %59 = icmp eq i64 %58, %2
  br i1 %59, label %60, label %73

60:                                               ; preds = %55
  %61 = getelementptr inbounds i8, ptr %0, i64 56
  %62 = load ptr, ptr %61, align 8, !tbaa !20
  %63 = getelementptr inbounds double, ptr %62, i64 %.06372
  %64 = load double, ptr %63, align 8, !tbaa !17
  %65 = fadd double %64, %3
  store double %65, ptr %63, align 8, !tbaa !17
  %66 = load ptr, ptr %61, align 8, !tbaa !20
  %67 = getelementptr inbounds double, ptr %66, i64 %.06372
  %68 = load double, ptr %67, align 8, !tbaa !17
  %69 = tail call noundef zeroext i1 @_ZN11alglib_impl8ae_fp_eqEdd(double noundef %68, double noundef 0.000000e+00)
  br i1 %69, label %70, label %82

70:                                               ; preds = %60
  %71 = load ptr, ptr %34, align 8, !tbaa !20
  %72 = getelementptr inbounds i64, ptr %71, i64 %53
  store i64 -2, ptr %72, align 8, !tbaa !21
  br label %82

73:                                               ; preds = %55, %.lr.ph
  %74 = icmp eq i64 %.06273, -1
  %75 = icmp eq i64 %52, -2
  %spec.select66 = select i1 %75, i64 %.06372, i64 -1
  %.1 = select i1 %74, i64 %spec.select66, i64 %.06273
  %76 = add nsw i64 %.06372, 1
  %77 = srem i64 %76, %.0
  %78 = shl nsw i64 %77, 1
  %79 = getelementptr inbounds i64, ptr %35, i64 %78
  %80 = load i64, ptr %79, align 8, !tbaa !21
  %81 = icmp eq i64 %80, -1
  br i1 %81, label %._crit_edge, label %.lr.ph, !llvm.loop !22

82:                                               ; preds = %60, %70, %._crit_edge, %49, %5
  ret void
}

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN11alglib_impl18sparseresizematrixEPNS_12sparsematrixEPNS_8ae_stateE(ptr noundef, ptr noundef) local_unnamed_addr #1

declare noundef zeroext i1 @_ZN11alglib_impl11ae_isfiniteEdPNS_8ae_stateE(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 noundef zeroext i1 @_ZN11alglib_impl16ae_fp_greater_eqEdd(double noundef, double noundef) local_unnamed_addr #0

; Function Attrs: mustprogress uwtable
declare hidden noundef i64 @_ZN11alglib_implL11sparse_hashElllPNS_8ae_stateE(i64 noundef, i64 noundef, i64 noundef, ptr noundef) local_unnamed_addr #1

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, !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 = !{!6, !8, i64 360}
!17 = !{!18, !18, i64 0}
!18 = !{!"double", !9, i64 0}
!19 = !{!6, !8, i64 344}
!20 = !{!9, !9, i64 0}
!21 = !{!8, !8, i64 0}
!22 = distinct !{!22, !23}
!23 = !{!"llvm.loop.mustprogress"}


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