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

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

@.str.15 = external hidden unnamed_addr constant [22 x i8], align 1
@.str.16 = external hidden unnamed_addr constant [31 x i8], align 1
@.str.17 = external hidden unnamed_addr constant [41 x i8], align 1
@.str.18 = external hidden unnamed_addr constant [31 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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN11alglib_impl16samplepercentileEPKNS_9ae_vectorEldPdPNS_8ae_stateE(ptr noundef %0, i64 noundef %1, double noundef %2, ptr noundef %3, ptr noundef %4) #1 {
  %6 = alloca ptr, align 8
  %7 = alloca i64, align 8
  %8 = alloca double, align 8
  %9 = alloca ptr, align 8
  %10 = alloca ptr, align 8
  %11 = alloca %"struct.alglib_impl::ae_frame", align 8
  %12 = alloca %"struct.alglib_impl::ae_vector", align 8
  %13 = alloca i64, align 8
  %14 = alloca double, align 8
  %15 = alloca %"struct.alglib_impl::ae_vector", align 8
  %16 = alloca i32, align 4
  store ptr %0, ptr %6, align 8, !tbaa !5
  store i64 %1, ptr %7, align 8, !tbaa !9
  store double %2, ptr %8, align 8, !tbaa !11
  store ptr %3, ptr %9, align 8, !tbaa !5
  store ptr %4, ptr %10, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 32, ptr %11) #5
  call void @llvm.lifetime.start.p0(i64 64, ptr %12) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #5
  call void @llvm.lifetime.start.p0(i64 64, ptr %15) #5
  %17 = load ptr, ptr %10, align 8, !tbaa !5
  call void @_ZN11alglib_impl13ae_frame_makeEPNS_8ae_stateEPNS_8ae_frameE(ptr noundef %17, ptr noundef %11)
  call void @llvm.memset.p0.i64(ptr align 8 %12, i8 0, i64 64, i1 false)
  call void @llvm.memset.p0.i64(ptr align 8 %15, i8 0, i64 64, i1 false)
  %18 = load ptr, ptr %6, align 8, !tbaa !5
  %19 = load ptr, ptr %10, align 8, !tbaa !5
  call void @_ZN11alglib_impl19ae_vector_init_copyEPNS_9ae_vectorEPKS0_PNS_8ae_stateEb(ptr noundef %12, ptr noundef %18, ptr noundef %19, i1 noundef zeroext true)
  %20 = load ptr, ptr %9, align 8, !tbaa !5
  store double 0.000000e+00, ptr %20, align 8, !tbaa !11
  %21 = load ptr, ptr %10, align 8, !tbaa !5
  call void @_ZN11alglib_impl14ae_vector_initEPNS_9ae_vectorEllPNS_8ae_stateEb(ptr noundef %15, i64 noundef 0, i64 noundef 3, ptr noundef %21, i1 noundef zeroext true)
  %22 = load i64, ptr %7, align 8, !tbaa !9
  %23 = icmp sge i64 %22, 0
  %24 = load ptr, ptr %10, align 8, !tbaa !5
  call void @_ZN11alglib_impl9ae_assertEbPKcPNS_8ae_stateE(i1 noundef zeroext %23, ptr noundef @.str.15, ptr noundef %24)
  %25 = getelementptr inbounds %"struct.alglib_impl::ae_vector", ptr %12, i32 0, i32 0
  %26 = load i64, ptr %25, align 8, !tbaa !13
  %27 = load i64, ptr %7, align 8, !tbaa !9
  %28 = icmp sge i64 %26, %27
  %29 = load ptr, ptr %10, align 8, !tbaa !5
  call void @_ZN11alglib_impl9ae_assertEbPKcPNS_8ae_stateE(i1 noundef zeroext %28, ptr noundef @.str.16, ptr noundef %29)
  %30 = load i64, ptr %7, align 8, !tbaa !9
  %31 = load ptr, ptr %10, align 8, !tbaa !5
  %32 = call noundef zeroext i1 @_ZN11alglib_impl14isfinitevectorEPKNS_9ae_vectorElPNS_8ae_stateE(ptr noundef %12, i64 noundef %30, ptr noundef %31)
  %33 = load ptr, ptr %10, align 8, !tbaa !5
  call void @_ZN11alglib_impl9ae_assertEbPKcPNS_8ae_stateE(i1 noundef zeroext %32, ptr noundef @.str.17, ptr noundef %33)
  %34 = load double, ptr %8, align 8, !tbaa !11
  %35 = load ptr, ptr %10, align 8, !tbaa !5
  %36 = call noundef zeroext i1 @_ZN11alglib_impl11ae_isfiniteEdPNS_8ae_stateE(double noundef %34, ptr noundef %35)
  %37 = load ptr, ptr %10, align 8, !tbaa !5
  call void @_ZN11alglib_impl9ae_assertEbPKcPNS_8ae_stateE(i1 noundef zeroext %36, ptr noundef @.str.18, ptr noundef %37)
  %38 = load double, ptr %8, align 8, !tbaa !11
  %39 = call noundef zeroext i1 @_ZN11alglib_impl16ae_fp_greater_eqEdd(double noundef %38, double noundef 0.000000e+00)
  br i1 %39, label %40, label %43

40:                                               ; preds = %5
  %41 = load double, ptr %8, align 8, !tbaa !11
  %42 = call noundef zeroext i1 @_ZN11alglib_impl13ae_fp_less_eqEdd(double noundef %41, double noundef 1.000000e+00)
  br label %43

43:                                               ; preds = %40, %5
  %44 = phi i1 [ false, %5 ], [ %42, %40 ]
  %45 = load ptr, ptr %10, align 8, !tbaa !5
  call void @_ZN11alglib_impl9ae_assertEbPKcPNS_8ae_stateE(i1 noundef zeroext %44, ptr noundef @.str.18, ptr noundef %45)
  %46 = load i64, ptr %7, align 8, !tbaa !9
  %47 = load ptr, ptr %10, align 8, !tbaa !5
  call void @_ZN11alglib_impl11tagsortfastEPNS_9ae_vectorES1_lPNS_8ae_stateE(ptr noundef %12, ptr noundef %15, i64 noundef %46, ptr noundef %47)
  %48 = load double, ptr %8, align 8, !tbaa !11
  %49 = call noundef zeroext i1 @_ZN11alglib_impl8ae_fp_eqEdd(double noundef %48, double noundef 0.000000e+00)
  br i1 %49, label %50, label %57

50:                                               ; preds = %43
  %51 = getelementptr inbounds %"struct.alglib_impl::ae_vector", ptr %12, i32 0, i32 4
  %52 = load ptr, ptr %51, align 8, !tbaa !17
  %53 = getelementptr inbounds double, ptr %52, i64 0
  %54 = load double, ptr %53, align 8, !tbaa !11
  %55 = load ptr, ptr %9, align 8, !tbaa !5
  store double %54, ptr %55, align 8, !tbaa !11
  %56 = load ptr, ptr %10, align 8, !tbaa !5
  call void @_ZN11alglib_impl14ae_frame_leaveEPNS_8ae_stateE(ptr noundef %56)
  store i32 1, ptr %16, align 4
  br label %102

57:                                               ; preds = %43
  %58 = load double, ptr %8, align 8, !tbaa !11
  %59 = call noundef zeroext i1 @_ZN11alglib_impl8ae_fp_eqEdd(double noundef %58, double noundef 1.000000e+00)
  br i1 %59, label %60, label %69

60:                                               ; preds = %57
  %61 = getelementptr inbounds %"struct.alglib_impl::ae_vector", ptr %12, i32 0, i32 4
  %62 = load ptr, ptr %61, align 8, !tbaa !17
  %63 = load i64, ptr %7, align 8, !tbaa !9
  %64 = sub nsw i64 %63, 1
  %65 = getelementptr inbounds double, ptr %62, i64 %64
  %66 = load double, ptr %65, align 8, !tbaa !11
  %67 = load ptr, ptr %9, align 8, !tbaa !5
  store double %66, ptr %67, align 8, !tbaa !11
  %68 = load ptr, ptr %10, align 8, !tbaa !5
  call void @_ZN11alglib_impl14ae_frame_leaveEPNS_8ae_stateE(ptr noundef %68)
  store i32 1, ptr %16, align 4
  br label %102

69:                                               ; preds = %57
  %70 = load double, ptr %8, align 8, !tbaa !11
  %71 = load i64, ptr %7, align 8, !tbaa !9
  %72 = sub nsw i64 %71, 1
  %73 = sitofp i64 %72 to double
  %74 = fmul double %70, %73
  store double %74, ptr %14, align 8, !tbaa !11
  %75 = load double, ptr %14, align 8, !tbaa !11
  %76 = load ptr, ptr %10, align 8, !tbaa !5
  %77 = call noundef i64 @_ZN11alglib_impl9ae_ifloorEdPNS_8ae_stateE(double noundef %75, ptr noundef %76)
  store i64 %77, ptr %13, align 8, !tbaa !9
  %78 = load double, ptr %14, align 8, !tbaa !11
  %79 = load double, ptr %14, align 8, !tbaa !11
  %80 = load ptr, ptr %10, align 8, !tbaa !5
  %81 = call noundef i64 @_ZN11alglib_impl9ae_ifloorEdPNS_8ae_stateE(double noundef %79, ptr noundef %80)
  %82 = sitofp i64 %81 to double
  %83 = fsub double %78, %82
  store double %83, ptr %14, align 8, !tbaa !11
  %84 = getelementptr inbounds %"struct.alglib_impl::ae_vector", ptr %12, i32 0, i32 4
  %85 = load ptr, ptr %84, align 8, !tbaa !17
  %86 = load i64, ptr %13, align 8, !tbaa !9
  %87 = getelementptr inbounds double, ptr %85, i64 %86
  %88 = load double, ptr %87, align 8, !tbaa !11
  %89 = load double, ptr %14, align 8, !tbaa !11
  %90 = fsub double 1.000000e+00, %89
  %91 = getelementptr inbounds %"struct.alglib_impl::ae_vector", ptr %12, i32 0, i32 4
  %92 = load ptr, ptr %91, align 8, !tbaa !17
  %93 = load i64, ptr %13, align 8, !tbaa !9
  %94 = add nsw i64 %93, 1
  %95 = getelementptr inbounds double, ptr %92, i64 %94
  %96 = load double, ptr %95, align 8, !tbaa !11
  %97 = load double, ptr %14, align 8, !tbaa !11
  %98 = fmul double %96, %97
  %99 = call double @llvm.fmuladd.f64(double %88, double %90, double %98)
  %100 = load ptr, ptr %9, align 8, !tbaa !5
  store double %99, ptr %100, align 8, !tbaa !11
  %101 = load ptr, ptr %10, align 8, !tbaa !5
  call void @_ZN11alglib_impl14ae_frame_leaveEPNS_8ae_stateE(ptr noundef %101)
  store i32 0, ptr %16, align 4
  br label %102

102:                                              ; preds = %69, %60, %50
  call void @llvm.lifetime.end.p0(i64 64, ptr %15) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #5
  call void @llvm.lifetime.end.p0(i64 64, ptr %12) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr %11) #5
  %103 = load i32, ptr %16, align 4
  switch i32 %103, label %105 [
    i32 0, label %104
    i32 1, label %104
  ]

104:                                              ; preds = %102, %102
  ret void

105:                                              ; preds = %102
  unreachable
}

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

declare noundef zeroext i1 @_ZN11alglib_impl14isfinitevectorEPKNS_9ae_vectorElPNS_8ae_stateE(ptr noundef, i64 noundef, ptr noundef) #2

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

declare void @_ZN11alglib_impl13ae_frame_makeEPNS_8ae_stateEPNS_8ae_frameE(ptr noundef, ptr noundef) #2

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #4

declare void @_ZN11alglib_impl19ae_vector_init_copyEPNS_9ae_vectorEPKS0_PNS_8ae_stateEb(ptr noundef, ptr noundef, ptr noundef, i1 noundef zeroext) #2

declare void @_ZN11alglib_impl14ae_frame_leaveEPNS_8ae_stateE(ptr noundef) #2

declare void @_ZN11alglib_impl14ae_vector_initEPNS_9ae_vectorEllPNS_8ae_stateEb(ptr noundef, i64 noundef, i64 noundef, ptr noundef, i1 noundef zeroext) #2

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

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

declare noundef zeroext i1 @_ZN11alglib_impl13ae_fp_less_eqEdd(double noundef, double noundef) #2

declare void @_ZN11alglib_impl11tagsortfastEPNS_9ae_vectorES1_lPNS_8ae_stateE(ptr noundef, ptr noundef, i64 noundef, ptr noundef) #2

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

declare noundef i64 @_ZN11alglib_impl9ae_ifloorEdPNS_8ae_stateE(double noundef, ptr noundef) #2

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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" }
attributes #2 = { "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 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #4 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #5 = { 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 0}
!14 = !{!"_ZTSN11alglib_impl9ae_vectorE", !10, i64 0, !10, 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 = !{!7, !7, i64 0}


; 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"

%"struct.alglib_impl::ae_frame" = type { %"struct.alglib_impl::ae_dyn_block" }
%"struct.alglib_impl::ae_dyn_block" = type { ptr, ptr, ptr, ptr }
%"struct.alglib_impl::ae_vector" = type { i64, i64, i8, %"struct.alglib_impl::ae_dyn_block", %union.anon.0 }
%union.anon.0 = type { ptr }

@.str.15 = external hidden unnamed_addr constant [22 x i8], align 1
@.str.16 = external hidden unnamed_addr constant [31 x i8], align 1
@.str.17 = external hidden unnamed_addr constant [41 x i8], align 1
@.str.18 = external hidden unnamed_addr constant [31 x i8], align 1

; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #0

; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #0

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN11alglib_impl16samplepercentileEPKNS_9ae_vectorEldPdPNS_8ae_stateE(ptr noundef %0, i64 noundef %1, double noundef %2, ptr nocapture noundef writeonly %3, ptr noundef %4) local_unnamed_addr #1 {
  %6 = alloca %"struct.alglib_impl::ae_frame", align 8
  %7 = alloca %"struct.alglib_impl::ae_vector", align 8
  %8 = alloca %"struct.alglib_impl::ae_vector", align 8
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %6) #5
  call void @llvm.lifetime.start.p0(i64 64, ptr nonnull %7) #5
  call void @llvm.lifetime.start.p0(i64 64, ptr nonnull %8) #5
  call void @_ZN11alglib_impl13ae_frame_makeEPNS_8ae_stateEPNS_8ae_frameE(ptr noundef %4, ptr noundef nonnull %6)
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(64) %7, i8 0, i64 64, i1 false)
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(64) %8, i8 0, i64 64, i1 false)
  call void @_ZN11alglib_impl19ae_vector_init_copyEPNS_9ae_vectorEPKS0_PNS_8ae_stateEb(ptr noundef nonnull %7, ptr noundef %0, ptr noundef %4, i1 noundef zeroext true)
  store double 0.000000e+00, ptr %3, align 8, !tbaa !5
  call void @_ZN11alglib_impl14ae_vector_initEPNS_9ae_vectorEllPNS_8ae_stateEb(ptr noundef nonnull %8, i64 noundef 0, i64 noundef 3, ptr noundef %4, i1 noundef zeroext true)
  %9 = icmp sgt i64 %1, -1
  call void @_ZN11alglib_impl9ae_assertEbPKcPNS_8ae_stateE(i1 noundef zeroext %9, ptr noundef nonnull @.str.15, ptr noundef %4)
  %10 = load i64, ptr %7, align 8, !tbaa !9
  %11 = icmp sge i64 %10, %1
  call void @_ZN11alglib_impl9ae_assertEbPKcPNS_8ae_stateE(i1 noundef zeroext %11, ptr noundef nonnull @.str.16, ptr noundef %4)
  %12 = call noundef zeroext i1 @_ZN11alglib_impl14isfinitevectorEPKNS_9ae_vectorElPNS_8ae_stateE(ptr noundef nonnull %7, i64 noundef %1, ptr noundef %4)
  call void @_ZN11alglib_impl9ae_assertEbPKcPNS_8ae_stateE(i1 noundef zeroext %12, ptr noundef nonnull @.str.17, ptr noundef %4)
  %13 = call noundef zeroext i1 @_ZN11alglib_impl11ae_isfiniteEdPNS_8ae_stateE(double noundef %2, ptr noundef %4)
  call void @_ZN11alglib_impl9ae_assertEbPKcPNS_8ae_stateE(i1 noundef zeroext %13, ptr noundef nonnull @.str.18, ptr noundef %4)
  %14 = call noundef zeroext i1 @_ZN11alglib_impl16ae_fp_greater_eqEdd(double noundef %2, double noundef 0.000000e+00)
  br i1 %14, label %15, label %17

15:                                               ; preds = %5
  %16 = call noundef zeroext i1 @_ZN11alglib_impl13ae_fp_less_eqEdd(double noundef %2, double noundef 1.000000e+00)
  br label %17

17:                                               ; preds = %15, %5
  %18 = phi i1 [ false, %5 ], [ %16, %15 ]
  call void @_ZN11alglib_impl9ae_assertEbPKcPNS_8ae_stateE(i1 noundef zeroext %18, ptr noundef nonnull @.str.18, ptr noundef %4)
  call void @_ZN11alglib_impl11tagsortfastEPNS_9ae_vectorES1_lPNS_8ae_stateE(ptr noundef nonnull %7, ptr noundef nonnull %8, i64 noundef %1, ptr noundef %4)
  %19 = call noundef zeroext i1 @_ZN11alglib_impl8ae_fp_eqEdd(double noundef %2, double noundef 0.000000e+00)
  br i1 %19, label %20, label %24

20:                                               ; preds = %17
  %21 = getelementptr inbounds i8, ptr %7, i64 56
  %22 = load ptr, ptr %21, align 8, !tbaa !15
  %23 = load double, ptr %22, align 8, !tbaa !5
  br label %49

24:                                               ; preds = %17
  %25 = call noundef zeroext i1 @_ZN11alglib_impl8ae_fp_eqEdd(double noundef %2, double noundef 1.000000e+00)
  br i1 %25, label %26, label %32

26:                                               ; preds = %24
  %27 = getelementptr inbounds i8, ptr %7, i64 56
  %28 = load ptr, ptr %27, align 8, !tbaa !15
  %29 = getelementptr double, ptr %28, i64 %1
  %30 = getelementptr i8, ptr %29, i64 -8
  %31 = load double, ptr %30, align 8, !tbaa !5
  br label %49

32:                                               ; preds = %24
  %33 = add nsw i64 %1, -1
  %34 = sitofp i64 %33 to double
  %35 = fmul double %34, %2
  %36 = call noundef i64 @_ZN11alglib_impl9ae_ifloorEdPNS_8ae_stateE(double noundef %35, ptr noundef %4)
  %37 = call noundef i64 @_ZN11alglib_impl9ae_ifloorEdPNS_8ae_stateE(double noundef %35, ptr noundef %4)
  %38 = sitofp i64 %37 to double
  %39 = fsub double %35, %38
  %40 = getelementptr inbounds i8, ptr %7, i64 56
  %41 = load ptr, ptr %40, align 8, !tbaa !15
  %42 = getelementptr inbounds double, ptr %41, i64 %36
  %43 = load double, ptr %42, align 8, !tbaa !5
  %44 = fsub double 1.000000e+00, %39
  %45 = getelementptr i8, ptr %42, i64 8
  %46 = load double, ptr %45, align 8, !tbaa !5
  %47 = fmul double %39, %46
  %48 = call double @llvm.fmuladd.f64(double %43, double %44, double %47)
  br label %49

49:                                               ; preds = %32, %26, %20
  %.sink = phi double [ %48, %32 ], [ %31, %26 ], [ %23, %20 ]
  store double %.sink, ptr %3, align 8, !tbaa !5
  call void @_ZN11alglib_impl14ae_frame_leaveEPNS_8ae_stateE(ptr noundef %4)
  call void @llvm.lifetime.end.p0(i64 64, ptr nonnull %8) #5
  call void @llvm.lifetime.end.p0(i64 64, ptr nonnull %7) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %6) #5
  ret void
}

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

declare noundef zeroext i1 @_ZN11alglib_impl14isfinitevectorEPKNS_9ae_vectorElPNS_8ae_stateE(ptr noundef, i64 noundef, ptr noundef) local_unnamed_addr #2

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

declare void @_ZN11alglib_impl13ae_frame_makeEPNS_8ae_stateEPNS_8ae_frameE(ptr noundef, ptr noundef) local_unnamed_addr #2

; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #4

declare void @_ZN11alglib_impl19ae_vector_init_copyEPNS_9ae_vectorEPKS0_PNS_8ae_stateEb(ptr noundef, ptr noundef, ptr noundef, i1 noundef zeroext) local_unnamed_addr #2

declare void @_ZN11alglib_impl14ae_frame_leaveEPNS_8ae_stateE(ptr noundef) local_unnamed_addr #2

declare void @_ZN11alglib_impl14ae_vector_initEPNS_9ae_vectorEllPNS_8ae_stateEb(ptr noundef, i64 noundef, i64 noundef, ptr noundef, i1 noundef zeroext) local_unnamed_addr #2

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

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

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

declare void @_ZN11alglib_impl11tagsortfastEPNS_9ae_vectorES1_lPNS_8ae_stateE(ptr noundef, ptr noundef, i64 noundef, ptr noundef) local_unnamed_addr #2

declare noundef zeroext i1 @_ZN11alglib_impl8ae_fp_eqEdd(double noundef, double noundef) local_unnamed_addr #2

declare noundef i64 @_ZN11alglib_impl9ae_ifloorEdPNS_8ae_stateE(double noundef, ptr noundef) local_unnamed_addr #2

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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" }
attributes #2 = { "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 nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #4 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #5 = { 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 = !{!"double", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !11, i64 0}
!10 = !{!"_ZTSN11alglib_impl9ae_vectorE", !11, i64 0, !11, i64 8, !12, i64 16, !13, i64 24, !7, i64 56}
!11 = !{!"long", !7, i64 0}
!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 = !{!7, !7, i64 0}


; Effective O3 passes: EarlyCSEPass,GlobalOptPass,InferFunctionAttrsPass,InstCombinePass,PostOrderFunctionAttrsPass,ReassociatePass,SROAPass,SimplifyCFGPass