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

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

@.str.429 = external hidden unnamed_addr constant [57 x i8], align 1

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN11alglib_impl26clusterizerseparatedbydistEPNS_9ahcreportEdPlPNS_9ae_vectorES4_PNS_8ae_stateE(ptr noundef %0, double noundef %1, ptr noundef %2, ptr noundef %3, ptr noundef %4, ptr noundef %5) #1 {
  %7 = alloca ptr, align 8
  %8 = alloca double, align 8
  %9 = alloca ptr, align 8
  %10 = alloca ptr, align 8
  %11 = alloca ptr, align 8
  %12 = alloca ptr, align 8
  store ptr %0, ptr %7, align 8, !tbaa !5
  store double %1, ptr %8, align 8, !tbaa !9
  store ptr %2, ptr %9, align 8, !tbaa !5
  store ptr %3, ptr %10, align 8, !tbaa !5
  store ptr %4, ptr %11, align 8, !tbaa !5
  store ptr %5, ptr %12, align 8, !tbaa !5
  %13 = load ptr, ptr %9, align 8, !tbaa !5
  store i64 0, ptr %13, align 8, !tbaa !11
  %14 = load ptr, ptr %10, align 8, !tbaa !5
  call void @_ZN11alglib_impl15ae_vector_clearEPNS_9ae_vectorE(ptr noundef %14)
  %15 = load ptr, ptr %11, align 8, !tbaa !5
  call void @_ZN11alglib_impl15ae_vector_clearEPNS_9ae_vectorE(ptr noundef %15)
  %16 = load double, ptr %8, align 8, !tbaa !9
  %17 = load ptr, ptr %12, align 8, !tbaa !5
  %18 = call noundef zeroext i1 @_ZN11alglib_impl11ae_isfiniteEdPNS_8ae_stateE(double noundef %16, ptr noundef %17)
  br i1 %18, label %19, label %22

19:                                               ; preds = %6
  %20 = load double, ptr %8, align 8, !tbaa !9
  %21 = call noundef zeroext i1 @_ZN11alglib_impl16ae_fp_greater_eqEdd(double noundef %20, double noundef 0.000000e+00)
  br label %22

22:                                               ; preds = %19, %6
  %23 = phi i1 [ false, %6 ], [ %21, %19 ]
  %24 = load ptr, ptr %12, align 8, !tbaa !5
  call void @_ZN11alglib_impl9ae_assertEbPKcPNS_8ae_stateE(i1 noundef zeroext %23, ptr noundef @.str.429, ptr noundef %24)
  %25 = load ptr, ptr %9, align 8, !tbaa !5
  store i64 1, ptr %25, align 8, !tbaa !11
  br label %26

26:                                               ; preds = %51, %22
  %27 = load ptr, ptr %9, align 8, !tbaa !5
  %28 = load i64, ptr %27, align 8, !tbaa !11
  %29 = load ptr, ptr %7, align 8, !tbaa !5
  %30 = getelementptr inbounds %"struct.alglib_impl::ahcreport", ptr %29, i32 0, i32 1
  %31 = load i64, ptr %30, align 8, !tbaa !13
  %32 = icmp slt i64 %28, %31
  br i1 %32, label %33, label %49

33:                                               ; preds = %26
  %34 = load ptr, ptr %7, align 8, !tbaa !5
  %35 = getelementptr inbounds %"struct.alglib_impl::ahcreport", ptr %34, i32 0, i32 6
  %36 = getelementptr inbounds %"struct.alglib_impl::ae_vector", ptr %35, i32 0, i32 4
  %37 = load ptr, ptr %36, align 8, !tbaa !19
  %38 = load ptr, ptr %7, align 8, !tbaa !5
  %39 = getelementptr inbounds %"struct.alglib_impl::ahcreport", ptr %38, i32 0, i32 1
  %40 = load i64, ptr %39, align 8, !tbaa !13
  %41 = sub nsw i64 %40, 1
  %42 = load ptr, ptr %9, align 8, !tbaa !5
  %43 = load i64, ptr %42, align 8, !tbaa !11
  %44 = sub nsw i64 %41, %43
  %45 = getelementptr inbounds double, ptr %37, i64 %44
  %46 = load double, ptr %45, align 8, !tbaa !9
  %47 = load double, ptr %8, align 8, !tbaa !9
  %48 = call noundef zeroext i1 @_ZN11alglib_impl16ae_fp_greater_eqEdd(double noundef %46, double noundef %47)
  br label %49

49:                                               ; preds = %33, %26
  %50 = phi i1 [ false, %26 ], [ %48, %33 ]
  br i1 %50, label %51, label %56

51:                                               ; preds = %49
  %52 = load ptr, ptr %9, align 8, !tbaa !5
  %53 = load i64, ptr %52, align 8, !tbaa !11
  %54 = add nsw i64 %53, 1
  %55 = load ptr, ptr %9, align 8, !tbaa !5
  store i64 %54, ptr %55, align 8, !tbaa !11
  br label %26, !llvm.loop !20

56:                                               ; preds = %49
  %57 = load ptr, ptr %7, align 8, !tbaa !5
  %58 = load ptr, ptr %9, align 8, !tbaa !5
  %59 = load i64, ptr %58, align 8, !tbaa !11
  %60 = load ptr, ptr %10, align 8, !tbaa !5
  %61 = load ptr, ptr %11, align 8, !tbaa !5
  %62 = load ptr, ptr %12, align 8, !tbaa !5
  call void @_ZN11alglib_impl23clusterizergetkclustersEPNS_9ahcreportElPNS_9ae_vectorES3_PNS_8ae_stateE(ptr noundef %57, i64 noundef %59, ptr noundef %60, ptr noundef %61, ptr noundef %62)
  ret void
}

declare void @_ZN11alglib_impl15ae_vector_clearEPNS_9ae_vectorE(ptr noundef) #0

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

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

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, !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 = !{!"double", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"long", !7, i64 0}
!13 = !{!14, !12, i64 8}
!14 = !{!"_ZTSN11alglib_impl9ahcreportE", !12, i64 0, !12, i64 8, !15, i64 16, !18, i64 80, !18, i64 160, !18, i64 240, !15, i64 320}
!15 = !{!"_ZTSN11alglib_impl9ae_vectorE", !12, i64 0, !12, 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 = !{!"_ZTSN11alglib_impl9ae_matrixE", !12, i64 0, !12, i64 8, !12, i64 16, !12, i64 24, !16, i64 32, !17, i64 40, !7, i64 72}
!19 = !{!7, !7, i64 0}
!20 = distinct !{!20, !21}
!21 = !{!"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.429 = external hidden unnamed_addr constant [57 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 uwtable
declare dso_local void @_ZN11alglib_impl23clusterizergetkclustersEPNS_9ahcreportElPNS_9ae_vectorES3_PNS_8ae_stateE(ptr noundef, i64 noundef, ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #1

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN11alglib_impl26clusterizerseparatedbydistEPNS_9ahcreportEdPlPNS_9ae_vectorES4_PNS_8ae_stateE(ptr noundef %0, double noundef %1, ptr nocapture noundef %2, ptr noundef %3, ptr noundef %4, ptr noundef %5) local_unnamed_addr #1 {
  store i64 0, ptr %2, align 8, !tbaa !5
  tail call void @_ZN11alglib_impl15ae_vector_clearEPNS_9ae_vectorE(ptr noundef %3)
  tail call void @_ZN11alglib_impl15ae_vector_clearEPNS_9ae_vectorE(ptr noundef %4)
  %7 = tail call noundef zeroext i1 @_ZN11alglib_impl11ae_isfiniteEdPNS_8ae_stateE(double noundef %1, ptr noundef %5)
  br i1 %7, label %8, label %10

8:                                                ; preds = %6
  %9 = tail call noundef zeroext i1 @_ZN11alglib_impl16ae_fp_greater_eqEdd(double noundef %1, double noundef 0.000000e+00)
  br label %10

10:                                               ; preds = %8, %6
  %11 = phi i1 [ false, %6 ], [ %9, %8 ]
  tail call void @_ZN11alglib_impl9ae_assertEbPKcPNS_8ae_stateE(i1 noundef zeroext %11, ptr noundef nonnull @.str.429, ptr noundef %5)
  %12 = getelementptr inbounds i8, ptr %0, i64 8
  store i64 1, ptr %2, align 8, !tbaa !5
  %13 = load i64, ptr %12, align 8, !tbaa !9
  %14 = icmp sgt i64 %13, 1
  br i1 %14, label %.lr.ph, label %.critedge

.lr.ph:                                           ; preds = %10
  %15 = getelementptr inbounds i8, ptr %0, i64 376
  br label %16

16:                                               ; preds = %.lr.ph, %24
  %17 = phi i64 [ %13, %.lr.ph ], [ %26, %24 ]
  %storemerge22 = phi i64 [ 1, %.lr.ph ], [ %25, %24 ]
  %18 = load ptr, ptr %15, align 8, !tbaa !16
  %19 = xor i64 %storemerge22, -1
  %20 = getelementptr double, ptr %18, i64 %17
  %21 = getelementptr double, ptr %20, i64 %19
  %22 = load double, ptr %21, align 8, !tbaa !17
  %23 = tail call noundef zeroext i1 @_ZN11alglib_impl16ae_fp_greater_eqEdd(double noundef %22, double noundef %1)
  %.pre.pre = load i64, ptr %2, align 8, !tbaa !5
  br i1 %23, label %24, label %.critedge

24:                                               ; preds = %16
  %25 = add nsw i64 %.pre.pre, 1
  store i64 %25, ptr %2, align 8, !tbaa !5
  %26 = load i64, ptr %12, align 8, !tbaa !9
  %27 = icmp slt i64 %25, %26
  br i1 %27, label %16, label %.critedge, !llvm.loop !19

.critedge:                                        ; preds = %16, %24, %10
  %28 = phi i64 [ 1, %10 ], [ %.pre.pre, %16 ], [ %25, %24 ]
  tail call void @_ZN11alglib_impl23clusterizergetkclustersEPNS_9ahcreportElPNS_9ae_vectorES3_PNS_8ae_stateE(ptr noundef nonnull %0, i64 noundef %28, ptr noundef %3, ptr noundef %4, ptr noundef %5)
  ret void
}

declare void @_ZN11alglib_impl15ae_vector_clearEPNS_9ae_vectorE(ptr noundef) local_unnamed_addr #0

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

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

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


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,InstCombinePass,JumpThreadingPass,LICMPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,PostOrderFunctionAttrsPass,SROAPass,SimplifyCFGPass,TailCallElimPass