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

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

@.str.44 = external hidden unnamed_addr constant [33 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 noundef zeroext i1 @_ZN11alglib_impl13ae_fp_less_eqEdd(double noundef, double noundef) #1

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

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

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

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

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

; Function Attrs: mustprogress uwtable
define dso_local noundef double @_ZN11alglib_impl19squantilecountergetEPNS_16squantilecounterEdPNS_8ae_stateE(ptr noundef %0, double noundef %1, ptr noundef %2) #3 {
  %4 = alloca double, align 8
  %5 = alloca ptr, align 8
  %6 = alloca double, align 8
  %7 = alloca ptr, align 8
  %8 = alloca i64, align 8
  %9 = alloca i64, align 8
  %10 = alloca i64, align 8
  %11 = alloca i64, align 8
  %12 = alloca double, align 8
  %13 = alloca i64, align 8
  %14 = alloca i64, align 8
  %15 = alloca double, align 8
  %16 = alloca i32, align 4
  store ptr %0, ptr %5, align 8, !tbaa !5
  store double %1, ptr %6, align 8, !tbaa !9
  store ptr %2, ptr %7, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #4
  %17 = load double, ptr %6, align 8, !tbaa !9
  %18 = call noundef zeroext i1 @_ZN11alglib_impl16ae_fp_greater_eqEdd(double noundef %17, double noundef 0.000000e+00)
  br i1 %18, label %19, label %22

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

22:                                               ; preds = %19, %3
  %23 = phi i1 [ false, %3 ], [ %21, %19 ]
  %24 = load ptr, ptr %7, align 8, !tbaa !5
  call void @_ZN11alglib_impl9ae_assertEbPKcPNS_8ae_stateE(i1 noundef zeroext %23, ptr noundef @.str.44, ptr noundef %24)
  %25 = load ptr, ptr %5, align 8, !tbaa !5
  %26 = getelementptr inbounds %"struct.alglib_impl::squantilecounter", ptr %25, i32 0, i32 0
  %27 = load i64, ptr %26, align 8, !tbaa !11
  %28 = icmp eq i64 %27, 0
  br i1 %28, label %29, label %34

29:                                               ; preds = %22
  %30 = load ptr, ptr %5, align 8, !tbaa !5
  %31 = getelementptr inbounds %"struct.alglib_impl::squantilecounter", ptr %30, i32 0, i32 2
  %32 = load double, ptr %31, align 8, !tbaa !17
  store double %32, ptr %15, align 8, !tbaa !9
  %33 = load double, ptr %15, align 8, !tbaa !9
  store double %33, ptr %4, align 8
  store i32 1, ptr %16, align 4
  br label %152

34:                                               ; preds = %22
  %35 = load ptr, ptr %5, align 8, !tbaa !5
  %36 = getelementptr inbounds %"struct.alglib_impl::squantilecounter", ptr %35, i32 0, i32 0
  %37 = load i64, ptr %36, align 8, !tbaa !11
  %38 = icmp eq i64 %37, 1
  br i1 %38, label %39, label %47

39:                                               ; preds = %34
  %40 = load ptr, ptr %5, align 8, !tbaa !5
  %41 = getelementptr inbounds %"struct.alglib_impl::squantilecounter", ptr %40, i32 0, i32 1
  %42 = getelementptr inbounds %"struct.alglib_impl::ae_vector", ptr %41, i32 0, i32 4
  %43 = load ptr, ptr %42, align 8, !tbaa !18
  %44 = getelementptr inbounds double, ptr %43, i64 0
  %45 = load double, ptr %44, align 8, !tbaa !9
  store double %45, ptr %15, align 8, !tbaa !9
  %46 = load double, ptr %15, align 8, !tbaa !9
  store double %46, ptr %4, align 8
  store i32 1, ptr %16, align 4
  br label %152

47:                                               ; preds = %34
  %48 = load double, ptr %6, align 8, !tbaa !9
  %49 = load ptr, ptr %5, align 8, !tbaa !5
  %50 = getelementptr inbounds %"struct.alglib_impl::squantilecounter", ptr %49, i32 0, i32 0
  %51 = load i64, ptr %50, align 8, !tbaa !11
  %52 = sub nsw i64 %51, 1
  %53 = sitofp i64 %52 to double
  %54 = fmul double %48, %53
  %55 = load ptr, ptr %7, align 8, !tbaa !5
  %56 = call noundef i64 @_ZN11alglib_impl8ae_roundEdPNS_8ae_stateE(double noundef %54, ptr noundef %55)
  store i64 %56, ptr %10, align 8, !tbaa !19
  store i64 0, ptr %8, align 8, !tbaa !19
  %57 = load ptr, ptr %5, align 8, !tbaa !5
  %58 = getelementptr inbounds %"struct.alglib_impl::squantilecounter", ptr %57, i32 0, i32 0
  %59 = load i64, ptr %58, align 8, !tbaa !11
  %60 = sub nsw i64 %59, 1
  store i64 %60, ptr %9, align 8, !tbaa !19
  br label %61

61:                                               ; preds = %149, %47
  %62 = load i64, ptr %8, align 8, !tbaa !19
  %63 = load i64, ptr %9, align 8, !tbaa !19
  %64 = icmp eq i64 %62, %63
  br i1 %64, label %65, label %73

65:                                               ; preds = %61
  %66 = load ptr, ptr %5, align 8, !tbaa !5
  %67 = getelementptr inbounds %"struct.alglib_impl::squantilecounter", ptr %66, i32 0, i32 1
  %68 = getelementptr inbounds %"struct.alglib_impl::ae_vector", ptr %67, i32 0, i32 4
  %69 = load ptr, ptr %68, align 8, !tbaa !18
  %70 = load i64, ptr %8, align 8, !tbaa !19
  %71 = getelementptr inbounds double, ptr %69, i64 %70
  %72 = load double, ptr %71, align 8, !tbaa !9
  store double %72, ptr %15, align 8, !tbaa !9
  br label %150

73:                                               ; preds = %61
  %74 = load i64, ptr %8, align 8, !tbaa !19
  %75 = load i64, ptr %9, align 8, !tbaa !19
  %76 = load i64, ptr %8, align 8, !tbaa !19
  %77 = sub nsw i64 %75, %76
  %78 = sdiv i64 %77, 2
  %79 = add nsw i64 %74, %78
  store i64 %79, ptr %11, align 8, !tbaa !19
  %80 = load ptr, ptr %5, align 8, !tbaa !5
  %81 = getelementptr inbounds %"struct.alglib_impl::squantilecounter", ptr %80, i32 0, i32 1
  %82 = getelementptr inbounds %"struct.alglib_impl::ae_vector", ptr %81, i32 0, i32 4
  %83 = load ptr, ptr %82, align 8, !tbaa !18
  %84 = load i64, ptr %11, align 8, !tbaa !19
  %85 = getelementptr inbounds double, ptr %83, i64 %84
  %86 = load double, ptr %85, align 8, !tbaa !9
  store double %86, ptr %12, align 8, !tbaa !9
  %87 = load ptr, ptr %5, align 8, !tbaa !5
  %88 = getelementptr inbounds %"struct.alglib_impl::squantilecounter", ptr %87, i32 0, i32 1
  %89 = load i64, ptr %11, align 8, !tbaa !19
  %90 = load i64, ptr %9, align 8, !tbaa !19
  %91 = load ptr, ptr %7, align 8, !tbaa !5
  call void @_ZN11alglib_impl12swapelementsEPNS_9ae_vectorEllPNS_8ae_stateE(ptr noundef %88, i64 noundef %89, i64 noundef %90, ptr noundef %91)
  %92 = load i64, ptr %8, align 8, !tbaa !19
  store i64 %92, ptr %13, align 8, !tbaa !19
  %93 = load i64, ptr %8, align 8, !tbaa !19
  store i64 %93, ptr %14, align 8, !tbaa !19
  br label %94

94:                                               ; preds = %118, %73
  %95 = load i64, ptr %14, align 8, !tbaa !19
  %96 = load i64, ptr %9, align 8, !tbaa !19
  %97 = sub nsw i64 %96, 1
  %98 = icmp sle i64 %95, %97
  br i1 %98, label %99, label %121

99:                                               ; preds = %94
  %100 = load ptr, ptr %5, align 8, !tbaa !5
  %101 = getelementptr inbounds %"struct.alglib_impl::squantilecounter", ptr %100, i32 0, i32 1
  %102 = getelementptr inbounds %"struct.alglib_impl::ae_vector", ptr %101, i32 0, i32 4
  %103 = load ptr, ptr %102, align 8, !tbaa !18
  %104 = load i64, ptr %14, align 8, !tbaa !19
  %105 = getelementptr inbounds double, ptr %103, i64 %104
  %106 = load double, ptr %105, align 8, !tbaa !9
  %107 = load double, ptr %12, align 8, !tbaa !9
  %108 = call noundef zeroext i1 @_ZN11alglib_impl10ae_fp_lessEdd(double noundef %106, double noundef %107)
  br i1 %108, label %109, label %117

109:                                              ; preds = %99
  %110 = load ptr, ptr %5, align 8, !tbaa !5
  %111 = getelementptr inbounds %"struct.alglib_impl::squantilecounter", ptr %110, i32 0, i32 1
  %112 = load i64, ptr %13, align 8, !tbaa !19
  %113 = load i64, ptr %14, align 8, !tbaa !19
  %114 = load ptr, ptr %7, align 8, !tbaa !5
  call void @_ZN11alglib_impl12swapelementsEPNS_9ae_vectorEllPNS_8ae_stateE(ptr noundef %111, i64 noundef %112, i64 noundef %113, ptr noundef %114)
  %115 = load i64, ptr %13, align 8, !tbaa !19
  %116 = add nsw i64 %115, 1
  store i64 %116, ptr %13, align 8, !tbaa !19
  br label %117

117:                                              ; preds = %109, %99
  br label %118

118:                                              ; preds = %117
  %119 = load i64, ptr %14, align 8, !tbaa !19
  %120 = add nsw i64 %119, 1
  store i64 %120, ptr %14, align 8, !tbaa !19
  br label %94, !llvm.loop !20

121:                                              ; preds = %94
  %122 = load ptr, ptr %5, align 8, !tbaa !5
  %123 = getelementptr inbounds %"struct.alglib_impl::squantilecounter", ptr %122, i32 0, i32 1
  %124 = load i64, ptr %13, align 8, !tbaa !19
  %125 = load i64, ptr %9, align 8, !tbaa !19
  %126 = load ptr, ptr %7, align 8, !tbaa !5
  call void @_ZN11alglib_impl12swapelementsEPNS_9ae_vectorEllPNS_8ae_stateE(ptr noundef %123, i64 noundef %124, i64 noundef %125, ptr noundef %126)
  %127 = load i64, ptr %13, align 8, !tbaa !19
  store i64 %127, ptr %11, align 8, !tbaa !19
  %128 = load i64, ptr %11, align 8, !tbaa !19
  %129 = load i64, ptr %10, align 8, !tbaa !19
  %130 = icmp eq i64 %128, %129
  br i1 %130, label %131, label %139

131:                                              ; preds = %121
  %132 = load ptr, ptr %5, align 8, !tbaa !5
  %133 = getelementptr inbounds %"struct.alglib_impl::squantilecounter", ptr %132, i32 0, i32 1
  %134 = getelementptr inbounds %"struct.alglib_impl::ae_vector", ptr %133, i32 0, i32 4
  %135 = load ptr, ptr %134, align 8, !tbaa !18
  %136 = load i64, ptr %10, align 8, !tbaa !19
  %137 = getelementptr inbounds double, ptr %135, i64 %136
  %138 = load double, ptr %137, align 8, !tbaa !9
  store double %138, ptr %15, align 8, !tbaa !9
  br label %150

139:                                              ; preds = %121
  %140 = load i64, ptr %10, align 8, !tbaa !19
  %141 = load i64, ptr %11, align 8, !tbaa !19
  %142 = icmp slt i64 %140, %141
  br i1 %142, label %143, label %146

143:                                              ; preds = %139
  %144 = load i64, ptr %11, align 8, !tbaa !19
  %145 = sub nsw i64 %144, 1
  store i64 %145, ptr %9, align 8, !tbaa !19
  br label %149

146:                                              ; preds = %139
  %147 = load i64, ptr %11, align 8, !tbaa !19
  %148 = add nsw i64 %147, 1
  store i64 %148, ptr %8, align 8, !tbaa !19
  br label %149

149:                                              ; preds = %146, %143
  br label %61, !llvm.loop !22

150:                                              ; preds = %131, %65
  %151 = load double, ptr %15, align 8, !tbaa !9
  store double %151, ptr %4, align 8
  store i32 1, ptr %16, align 4
  br label %152

152:                                              ; preds = %150, %39, %29
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #4
  %153 = load double, ptr %4, align 8
  ret double %153
}

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 nounwind 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 = { 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 = !{!"double", !7, i64 0}
!11 = !{!12, !13, i64 0}
!12 = !{!"_ZTSN11alglib_impl16squantilecounterE", !13, i64 0, !14, i64 8, !10, i64 72}
!13 = !{!"long", !7, i64 0}
!14 = !{!"_ZTSN11alglib_impl9ae_vectorE", !13, i64 0, !13, i64 8, !15, i64 16, !16, i64 24, !7, i64 56}
!15 = !{!"bool", !7, i64 0}
!16 = !{!"_ZTSN11alglib_impl12ae_dyn_blockE", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24}
!17 = !{!12, !10, i64 72}
!18 = !{!7, !7, i64 0}
!19 = !{!13, !13, i64 0}
!20 = distinct !{!20, !21}
!21 = !{!"llvm.loop.mustprogress"}
!22 = distinct !{!22, !21}


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

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

declare void @_ZN11alglib_impl9ae_assertEbPKcPNS_8ae_stateE(i1 noundef zeroext, ptr 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 i64 @_ZN11alglib_impl8ae_roundEdPNS_8ae_stateE(double noundef, ptr noundef) local_unnamed_addr #0

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

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

; Function Attrs: mustprogress uwtable
define dso_local noundef double @_ZN11alglib_impl19squantilecountergetEPNS_16squantilecounterEdPNS_8ae_stateE(ptr noundef %0, double noundef %1, ptr noundef %2) local_unnamed_addr #2 {
  %4 = tail call noundef zeroext i1 @_ZN11alglib_impl16ae_fp_greater_eqEdd(double noundef %1, double noundef 0.000000e+00)
  br i1 %4, label %5, label %7

5:                                                ; preds = %3
  %6 = tail call noundef zeroext i1 @_ZN11alglib_impl13ae_fp_less_eqEdd(double noundef %1, double noundef 1.000000e+00)
  br label %7

7:                                                ; preds = %5, %3
  %8 = phi i1 [ false, %3 ], [ %6, %5 ]
  tail call void @_ZN11alglib_impl9ae_assertEbPKcPNS_8ae_stateE(i1 noundef zeroext %8, ptr noundef nonnull @.str.44, ptr noundef %2)
  %9 = load i64, ptr %0, align 8, !tbaa !5
  switch i64 %9, label %15 [
    i64 0, label %10
    i64 1, label %12
  ]

10:                                               ; preds = %7
  %11 = getelementptr inbounds i8, ptr %0, i64 72
  br label %52

12:                                               ; preds = %7
  %13 = getelementptr inbounds i8, ptr %0, i64 64
  %14 = load ptr, ptr %13, align 8, !tbaa !15
  br label %52

15:                                               ; preds = %7
  %16 = add nsw i64 %9, -1
  %17 = sitofp i64 %16 to double
  %18 = fmul double %17, %1
  %19 = tail call noundef i64 @_ZN11alglib_impl8ae_roundEdPNS_8ae_stateE(double noundef %18, ptr noundef %2)
  %20 = load i64, ptr %0, align 8, !tbaa !5
  %21 = add nsw i64 %20, -1
  %22 = icmp eq i64 %21, 0
  br i1 %22, label %._crit_edge71, label %.lr.ph70

.lr.ph70:                                         ; preds = %15
  %23 = getelementptr inbounds i8, ptr %0, i64 8
  %24 = getelementptr inbounds i8, ptr %0, i64 64
  br label %28

._crit_edge71:                                    ; preds = %47, %15
  %.056.lcssa = phi i64 [ 0, %15 ], [ %.159, %47 ]
  %25 = getelementptr inbounds i8, ptr %0, i64 64
  %26 = load ptr, ptr %25, align 8, !tbaa !15
  %27 = getelementptr inbounds double, ptr %26, i64 %.056.lcssa
  br label %52

28:                                               ; preds = %.lr.ph70, %47
  %.05668 = phi i64 [ 0, %.lr.ph70 ], [ %.157, %47 ]
  %.05867 = phi i64 [ %21, %.lr.ph70 ], [ %.159, %47 ]
  %29 = sub nsw i64 %.05867, %.05668
  %30 = sdiv i64 %29, 2
  %31 = add nsw i64 %30, %.05668
  %32 = load ptr, ptr %24, align 8, !tbaa !15
  %33 = getelementptr inbounds double, ptr %32, i64 %31
  %34 = load double, ptr %33, align 8, !tbaa !16
  tail call void @_ZN11alglib_impl12swapelementsEPNS_9ae_vectorEllPNS_8ae_stateE(ptr noundef nonnull %23, i64 noundef %31, i64 noundef %.05867, ptr noundef %2)
  %.not.not64 = icmp slt i64 %.05668, %.05867
  br i1 %.not.not64, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %28, %41
  %.05366 = phi i64 [ %42, %41 ], [ %.05668, %28 ]
  %.05465 = phi i64 [ %.1, %41 ], [ %.05668, %28 ]
  %35 = load ptr, ptr %24, align 8, !tbaa !15
  %36 = getelementptr inbounds double, ptr %35, i64 %.05366
  %37 = load double, ptr %36, align 8, !tbaa !16
  %38 = tail call noundef zeroext i1 @_ZN11alglib_impl10ae_fp_lessEdd(double noundef %37, double noundef %34)
  br i1 %38, label %39, label %41

39:                                               ; preds = %.lr.ph
  tail call void @_ZN11alglib_impl12swapelementsEPNS_9ae_vectorEllPNS_8ae_stateE(ptr noundef nonnull %23, i64 noundef %.05465, i64 noundef %.05366, ptr noundef %2)
  %40 = add nsw i64 %.05465, 1
  br label %41

41:                                               ; preds = %.lr.ph, %39
  %.1 = phi i64 [ %40, %39 ], [ %.05465, %.lr.ph ]
  %42 = add i64 %.05366, 1
  %exitcond.not = icmp eq i64 %42, %.05867
  br i1 %exitcond.not, label %._crit_edge, label %.lr.ph, !llvm.loop !17

._crit_edge:                                      ; preds = %41, %28
  %.054.lcssa = phi i64 [ %.05668, %28 ], [ %.1, %41 ]
  tail call void @_ZN11alglib_impl12swapelementsEPNS_9ae_vectorEllPNS_8ae_stateE(ptr noundef nonnull %23, i64 noundef %.054.lcssa, i64 noundef %.05867, ptr noundef %2)
  %43 = icmp eq i64 %.054.lcssa, %19
  br i1 %43, label %44, label %47

44:                                               ; preds = %._crit_edge
  %45 = load ptr, ptr %24, align 8, !tbaa !15
  %46 = getelementptr inbounds double, ptr %45, i64 %19
  br label %52

47:                                               ; preds = %._crit_edge
  %48 = icmp slt i64 %19, %.054.lcssa
  %49 = add nsw i64 %.054.lcssa, -1
  %50 = add nsw i64 %.054.lcssa, 1
  %.159 = select i1 %48, i64 %49, i64 %.05867
  %.157 = select i1 %48, i64 %.05668, i64 %50
  %51 = icmp eq i64 %.157, %.159
  br i1 %51, label %._crit_edge71, label %28, !llvm.loop !19

52:                                               ; preds = %._crit_edge71, %44, %12, %10
  %.055.in = phi ptr [ %11, %10 ], [ %14, %12 ], [ %27, %._crit_edge71 ], [ %46, %44 ]
  %.055 = load double, ptr %.055.in, align 8, !tbaa !16
  ret double %.055
}

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


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