; 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.430 = 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_impl26clusterizerseparatedbycorrEPNS_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 %25

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 -1.000000e+00)
  br i1 %21, label %22, label %25

22:                                               ; preds = %19
  %23 = load double, ptr %8, align 8, !tbaa !9
  %24 = call noundef zeroext i1 @_ZN11alglib_impl13ae_fp_less_eqEdd(double noundef %23, double noundef 1.000000e+00)
  br label %25

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

29:                                               ; preds = %55, %25
  %30 = load ptr, ptr %9, align 8, !tbaa !5
  %31 = load i64, ptr %30, align 8, !tbaa !11
  %32 = load ptr, ptr %7, align 8, !tbaa !5
  %33 = getelementptr inbounds %"struct.alglib_impl::ahcreport", ptr %32, i32 0, i32 1
  %34 = load i64, ptr %33, align 8, !tbaa !13
  %35 = icmp slt i64 %31, %34
  br i1 %35, label %36, label %53

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

53:                                               ; preds = %36, %29
  %54 = phi i1 [ false, %29 ], [ %52, %36 ]
  br i1 %54, label %55, label %60

55:                                               ; preds = %53
  %56 = load ptr, ptr %9, align 8, !tbaa !5
  %57 = load i64, ptr %56, align 8, !tbaa !11
  %58 = add nsw i64 %57, 1
  %59 = load ptr, ptr %9, align 8, !tbaa !5
  store i64 %58, ptr %59, align 8, !tbaa !11
  br label %29, !llvm.loop !20

60:                                               ; preds = %53
  %61 = load ptr, ptr %7, align 8, !tbaa !5
  %62 = load ptr, ptr %9, align 8, !tbaa !5
  %63 = load i64, ptr %62, align 8, !tbaa !11
  %64 = load ptr, ptr %10, align 8, !tbaa !5
  %65 = load ptr, ptr %11, align 8, !tbaa !5
  %66 = load ptr, ptr %12, align 8, !tbaa !5
  call void @_ZN11alglib_impl23clusterizergetkclustersEPNS_9ahcreportElPNS_9ae_vectorES3_PNS_8ae_stateE(ptr noundef %61, i64 noundef %63, ptr noundef %64, ptr noundef %65, ptr noundef %66)
  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

declare noundef zeroext i1 @_ZN11alglib_impl13ae_fp_less_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.430 = 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_impl26clusterizerseparatedbycorrEPNS_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 %12

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

10:                                               ; preds = %8
  %11 = tail call noundef zeroext i1 @_ZN11alglib_impl13ae_fp_less_eqEdd(double noundef %1, double noundef 1.000000e+00)
  br label %12

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

.lr.ph:                                           ; preds = %12
  %17 = getelementptr inbounds i8, ptr %0, i64 376
  %18 = fsub double 1.000000e+00, %1
  br label %19

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

27:                                               ; preds = %19
  %28 = add nsw i64 %.pre.pre, 1
  store i64 %28, ptr %2, align 8, !tbaa !5
  %29 = load i64, ptr %14, align 8, !tbaa !9
  %30 = icmp slt i64 %28, %29
  br i1 %30, label %19, label %.critedge, !llvm.loop !19

.critedge:                                        ; preds = %19, %27, %12
  %31 = phi i64 [ 1, %12 ], [ %.pre.pre, %19 ], [ %28, %27 ]
  tail call void @_ZN11alglib_impl23clusterizergetkclustersEPNS_9ahcreportElPNS_9ae_vectorES3_PNS_8ae_stateE(ptr noundef nonnull %0, i64 noundef %31, 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

declare noundef zeroext i1 @_ZN11alglib_impl13ae_fp_less_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