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

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

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

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

; 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_impl23gqgenerategausslaguerreEldPlPNS_9ae_vectorES2_PNS_8ae_stateE(i64 noundef %0, double noundef %1, ptr noundef %2, ptr noundef %3, ptr noundef %4, ptr noundef %5) #1 {
  %7 = alloca i64, 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
  %13 = alloca %"struct.alglib_impl::ae_frame", align 8
  %14 = alloca %"struct.alglib_impl::ae_vector", align 8
  %15 = alloca %"struct.alglib_impl::ae_vector", align 8
  %16 = alloca double, align 8
  %17 = alloca i64, align 8
  %18 = alloca double, align 8
  %19 = alloca i32, align 4
  store i64 %0, ptr %7, align 8, !tbaa !5
  store double %1, ptr %8, align 8, !tbaa !9
  store ptr %2, ptr %9, align 8, !tbaa !11
  store ptr %3, ptr %10, align 8, !tbaa !11
  store ptr %4, ptr %11, align 8, !tbaa !11
  store ptr %5, ptr %12, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 32, ptr %13) #4
  call void @llvm.lifetime.start.p0(i64 64, ptr %14) #4
  call void @llvm.lifetime.start.p0(i64 64, ptr %15) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #4
  %20 = load ptr, ptr %12, align 8, !tbaa !11
  call void @_ZN11alglib_impl13ae_frame_makeEPNS_8ae_stateEPNS_8ae_frameE(ptr noundef %20, ptr noundef %13)
  call void @llvm.memset.p0.i64(ptr align 8 %14, i8 0, i64 64, i1 false)
  call void @llvm.memset.p0.i64(ptr align 8 %15, i8 0, i64 64, i1 false)
  %21 = load ptr, ptr %9, align 8, !tbaa !11
  store i64 0, ptr %21, align 8, !tbaa !5
  %22 = load ptr, ptr %10, align 8, !tbaa !11
  call void @_ZN11alglib_impl15ae_vector_clearEPNS_9ae_vectorE(ptr noundef %22)
  %23 = load ptr, ptr %11, align 8, !tbaa !11
  call void @_ZN11alglib_impl15ae_vector_clearEPNS_9ae_vectorE(ptr noundef %23)
  %24 = load ptr, ptr %12, align 8, !tbaa !11
  call void @_ZN11alglib_impl14ae_vector_initEPNS_9ae_vectorEllPNS_8ae_stateEb(ptr noundef %14, i64 noundef 0, i64 noundef 3, ptr noundef %24, i1 noundef zeroext true)
  %25 = load ptr, ptr %12, align 8, !tbaa !11
  call void @_ZN11alglib_impl14ae_vector_initEPNS_9ae_vectorEllPNS_8ae_stateEb(ptr noundef %15, i64 noundef 0, i64 noundef 3, ptr noundef %25, i1 noundef zeroext true)
  %26 = load i64, ptr %7, align 8, !tbaa !5
  %27 = icmp slt i64 %26, 1
  br i1 %27, label %31, label %28

28:                                               ; preds = %6
  %29 = load double, ptr %8, align 8, !tbaa !9
  %30 = call noundef zeroext i1 @_ZN11alglib_impl13ae_fp_less_eqEdd(double noundef %29, double noundef -1.000000e+00)
  br i1 %30, label %31, label %34

31:                                               ; preds = %28, %6
  %32 = load ptr, ptr %9, align 8, !tbaa !11
  store i64 -1, ptr %32, align 8, !tbaa !5
  %33 = load ptr, ptr %12, align 8, !tbaa !11
  call void @_ZN11alglib_impl14ae_frame_leaveEPNS_8ae_stateE(ptr noundef %33)
  store i32 1, ptr %19, align 4
  br label %148

34:                                               ; preds = %28
  %35 = load i64, ptr %7, align 8, !tbaa !5
  %36 = load ptr, ptr %12, align 8, !tbaa !11
  call void @_ZN11alglib_impl20ae_vector_set_lengthEPNS_9ae_vectorElPNS_8ae_stateE(ptr noundef %14, i64 noundef %35, ptr noundef %36)
  %37 = load i64, ptr %7, align 8, !tbaa !5
  %38 = load ptr, ptr %12, align 8, !tbaa !11
  call void @_ZN11alglib_impl20ae_vector_set_lengthEPNS_9ae_vectorElPNS_8ae_stateE(ptr noundef %15, i64 noundef %37, ptr noundef %38)
  %39 = load double, ptr %8, align 8, !tbaa !9
  %40 = fadd double %39, 1.000000e+00
  %41 = getelementptr inbounds %"struct.alglib_impl::ae_vector", ptr %14, i32 0, i32 4
  %42 = load ptr, ptr %41, align 8, !tbaa !13
  %43 = getelementptr inbounds double, ptr %42, i64 0
  store double %40, ptr %43, align 8, !tbaa !9
  %44 = load double, ptr %8, align 8, !tbaa !9
  %45 = fadd double %44, 1.000000e+00
  %46 = load ptr, ptr %12, align 8, !tbaa !11
  %47 = call noundef double @_ZN11alglib_impl7lngammaEdPdPNS_8ae_stateE(double noundef %45, ptr noundef %18, ptr noundef %46)
  store double %47, ptr %16, align 8, !tbaa !9
  %48 = load double, ptr %16, align 8, !tbaa !9
  %49 = load ptr, ptr %12, align 8, !tbaa !11
  %50 = call noundef double @_ZN11alglib_impl6ae_logEdPNS_8ae_stateE(double noundef 1.000000e+300, ptr noundef %49)
  %51 = call noundef zeroext i1 @_ZN11alglib_impl16ae_fp_greater_eqEdd(double noundef %48, double noundef %50)
  br i1 %51, label %52, label %55

52:                                               ; preds = %34
  %53 = load ptr, ptr %9, align 8, !tbaa !11
  store i64 -4, ptr %53, align 8, !tbaa !5
  %54 = load ptr, ptr %12, align 8, !tbaa !11
  call void @_ZN11alglib_impl14ae_frame_leaveEPNS_8ae_stateE(ptr noundef %54)
  store i32 1, ptr %19, align 4
  br label %148

55:                                               ; preds = %34
  %56 = load double, ptr %16, align 8, !tbaa !9
  %57 = load ptr, ptr %12, align 8, !tbaa !11
  %58 = call noundef double @_ZN11alglib_impl6ae_expEdPNS_8ae_stateE(double noundef %56, ptr noundef %57)
  %59 = getelementptr inbounds %"struct.alglib_impl::ae_vector", ptr %15, i32 0, i32 4
  %60 = load ptr, ptr %59, align 8, !tbaa !13
  %61 = getelementptr inbounds double, ptr %60, i64 0
  store double %58, ptr %61, align 8, !tbaa !9
  %62 = load i64, ptr %7, align 8, !tbaa !5
  %63 = icmp sgt i64 %62, 1
  br i1 %63, label %64, label %96

64:                                               ; preds = %55
  store i64 1, ptr %17, align 8, !tbaa !5
  br label %65

65:                                               ; preds = %92, %64
  %66 = load i64, ptr %17, align 8, !tbaa !5
  %67 = load i64, ptr %7, align 8, !tbaa !5
  %68 = sub nsw i64 %67, 1
  %69 = icmp sle i64 %66, %68
  br i1 %69, label %70, label %95

70:                                               ; preds = %65
  %71 = load i64, ptr %17, align 8, !tbaa !5
  %72 = mul nsw i64 2, %71
  %73 = sitofp i64 %72 to double
  %74 = load double, ptr %8, align 8, !tbaa !9
  %75 = fadd double %73, %74
  %76 = fadd double %75, 1.000000e+00
  %77 = getelementptr inbounds %"struct.alglib_impl::ae_vector", ptr %14, i32 0, i32 4
  %78 = load ptr, ptr %77, align 8, !tbaa !13
  %79 = load i64, ptr %17, align 8, !tbaa !5
  %80 = getelementptr inbounds double, ptr %78, i64 %79
  store double %76, ptr %80, align 8, !tbaa !9
  %81 = load i64, ptr %17, align 8, !tbaa !5
  %82 = sitofp i64 %81 to double
  %83 = load i64, ptr %17, align 8, !tbaa !5
  %84 = sitofp i64 %83 to double
  %85 = load double, ptr %8, align 8, !tbaa !9
  %86 = fadd double %84, %85
  %87 = fmul double %82, %86
  %88 = getelementptr inbounds %"struct.alglib_impl::ae_vector", ptr %15, i32 0, i32 4
  %89 = load ptr, ptr %88, align 8, !tbaa !13
  %90 = load i64, ptr %17, align 8, !tbaa !5
  %91 = getelementptr inbounds double, ptr %89, i64 %90
  store double %87, ptr %91, align 8, !tbaa !9
  br label %92

92:                                               ; preds = %70
  %93 = load i64, ptr %17, align 8, !tbaa !5
  %94 = add nsw i64 %93, 1
  store i64 %94, ptr %17, align 8, !tbaa !5
  br label %65, !llvm.loop !14

95:                                               ; preds = %65
  br label %96

96:                                               ; preds = %95, %55
  %97 = getelementptr inbounds %"struct.alglib_impl::ae_vector", ptr %15, i32 0, i32 4
  %98 = load ptr, ptr %97, align 8, !tbaa !13
  %99 = getelementptr inbounds double, ptr %98, i64 0
  %100 = load double, ptr %99, align 8, !tbaa !9
  %101 = load i64, ptr %7, align 8, !tbaa !5
  %102 = load ptr, ptr %9, align 8, !tbaa !11
  %103 = load ptr, ptr %10, align 8, !tbaa !11
  %104 = load ptr, ptr %11, align 8, !tbaa !11
  %105 = load ptr, ptr %12, align 8, !tbaa !11
  call void @_ZN11alglib_impl13gqgeneraterecEPNS_9ae_vectorES1_dlPlS1_S1_PNS_8ae_stateE(ptr noundef %14, ptr noundef %15, double noundef %100, i64 noundef %101, ptr noundef %102, ptr noundef %103, ptr noundef %104, ptr noundef %105)
  %106 = load ptr, ptr %9, align 8, !tbaa !11
  %107 = load i64, ptr %106, align 8, !tbaa !5
  %108 = icmp sgt i64 %107, 0
  br i1 %108, label %109, label %146

109:                                              ; preds = %96
  %110 = load ptr, ptr %10, align 8, !tbaa !11
  %111 = getelementptr inbounds %"struct.alglib_impl::ae_vector", ptr %110, i32 0, i32 4
  %112 = load ptr, ptr %111, align 8, !tbaa !13
  %113 = getelementptr inbounds double, ptr %112, i64 0
  %114 = load double, ptr %113, align 8, !tbaa !9
  %115 = call noundef zeroext i1 @_ZN11alglib_impl10ae_fp_lessEdd(double noundef %114, double noundef 0.000000e+00)
  br i1 %115, label %116, label %118

116:                                              ; preds = %109
  %117 = load ptr, ptr %9, align 8, !tbaa !11
  store i64 -4, ptr %117, align 8, !tbaa !5
  br label %118

118:                                              ; preds = %116, %109
  store i64 0, ptr %17, align 8, !tbaa !5
  br label %119

119:                                              ; preds = %142, %118
  %120 = load i64, ptr %17, align 8, !tbaa !5
  %121 = load i64, ptr %7, align 8, !tbaa !5
  %122 = sub nsw i64 %121, 2
  %123 = icmp sle i64 %120, %122
  br i1 %123, label %124, label %145

124:                                              ; preds = %119
  %125 = load ptr, ptr %10, align 8, !tbaa !11
  %126 = getelementptr inbounds %"struct.alglib_impl::ae_vector", ptr %125, i32 0, i32 4
  %127 = load ptr, ptr %126, align 8, !tbaa !13
  %128 = load i64, ptr %17, align 8, !tbaa !5
  %129 = getelementptr inbounds double, ptr %127, i64 %128
  %130 = load double, ptr %129, align 8, !tbaa !9
  %131 = load ptr, ptr %10, align 8, !tbaa !11
  %132 = getelementptr inbounds %"struct.alglib_impl::ae_vector", ptr %131, i32 0, i32 4
  %133 = load ptr, ptr %132, align 8, !tbaa !13
  %134 = load i64, ptr %17, align 8, !tbaa !5
  %135 = add nsw i64 %134, 1
  %136 = getelementptr inbounds double, ptr %133, i64 %135
  %137 = load double, ptr %136, align 8, !tbaa !9
  %138 = call noundef zeroext i1 @_ZN11alglib_impl16ae_fp_greater_eqEdd(double noundef %130, double noundef %137)
  br i1 %138, label %139, label %141

139:                                              ; preds = %124
  %140 = load ptr, ptr %9, align 8, !tbaa !11
  store i64 -4, ptr %140, align 8, !tbaa !5
  br label %141

141:                                              ; preds = %139, %124
  br label %142

142:                                              ; preds = %141
  %143 = load i64, ptr %17, align 8, !tbaa !5
  %144 = add nsw i64 %143, 1
  store i64 %144, ptr %17, align 8, !tbaa !5
  br label %119, !llvm.loop !16

145:                                              ; preds = %119
  br label %146

146:                                              ; preds = %145, %96
  %147 = load ptr, ptr %12, align 8, !tbaa !11
  call void @_ZN11alglib_impl14ae_frame_leaveEPNS_8ae_stateE(ptr noundef %147)
  store i32 0, ptr %19, align 4
  br label %148

148:                                              ; preds = %146, %52, %31
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #4
  call void @llvm.lifetime.end.p0(i64 64, ptr %15) #4
  call void @llvm.lifetime.end.p0(i64 64, ptr %14) #4
  call void @llvm.lifetime.end.p0(i64 32, ptr %13) #4
  %149 = load i32, ptr %19, align 4
  switch i32 %149, label %151 [
    i32 0, label %150
    i32 1, label %150
  ]

150:                                              ; preds = %148, %148
  ret void

151:                                              ; preds = %148
  unreachable
}

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

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

declare void @_ZN11alglib_impl15ae_vector_clearEPNS_9ae_vectorE(ptr noundef) #3

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

declare void @_ZN11alglib_impl14ae_frame_leaveEPNS_8ae_stateE(ptr noundef) #3

declare void @_ZN11alglib_impl20ae_vector_set_lengthEPNS_9ae_vectorElPNS_8ae_stateE(ptr noundef, i64 noundef, ptr noundef) #3

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

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

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

declare noundef double @_ZN11alglib_impl6ae_logEdPNS_8ae_stateE(double noundef, ptr noundef) #3

declare noundef double @_ZN11alglib_impl7lngammaEdPdPNS_8ae_stateE(double noundef, ptr noundef, ptr noundef) #3

declare noundef double @_ZN11alglib_impl6ae_expEdPNS_8ae_stateE(double noundef, ptr noundef) #3

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 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #3 = { "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 = !{!"long", !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 = !{!"any pointer", !7, i64 0}
!13 = !{!7, !7, i64 0}
!14 = distinct !{!14, !15}
!15 = !{!"llvm.loop.mustprogress"}
!16 = distinct !{!16, !15}


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

; 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 uwtable
declare dso_local void @_ZN11alglib_impl13gqgeneraterecEPNS_9ae_vectorES1_dlPlS1_S1_PNS_8ae_stateE(ptr noundef, ptr noundef, double noundef, i64 noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #1

; 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_impl23gqgenerategausslaguerreEldPlPNS_9ae_vectorES2_PNS_8ae_stateE(i64 noundef %0, double noundef %1, ptr noundef %2, ptr noundef %3, ptr noundef %4, ptr noundef %5) local_unnamed_addr #1 {
  %7 = alloca %"struct.alglib_impl::ae_frame", align 8
  %8 = alloca %"struct.alglib_impl::ae_vector", align 8
  %9 = alloca %"struct.alglib_impl::ae_vector", align 8
  %10 = alloca double, align 8
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %7) #5
  call void @llvm.lifetime.start.p0(i64 64, ptr nonnull %8) #5
  call void @llvm.lifetime.start.p0(i64 64, ptr nonnull %9) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %10) #5
  call void @_ZN11alglib_impl13ae_frame_makeEPNS_8ae_stateEPNS_8ae_frameE(ptr noundef %5, ptr noundef nonnull %7)
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(64) %8, i8 0, i64 64, i1 false)
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(64) %9, i8 0, i64 64, i1 false)
  store i64 0, ptr %2, align 8, !tbaa !5
  call void @_ZN11alglib_impl15ae_vector_clearEPNS_9ae_vectorE(ptr noundef %3)
  call void @_ZN11alglib_impl15ae_vector_clearEPNS_9ae_vectorE(ptr noundef %4)
  call void @_ZN11alglib_impl14ae_vector_initEPNS_9ae_vectorEllPNS_8ae_stateEb(ptr noundef nonnull %8, i64 noundef 0, i64 noundef 3, ptr noundef %5, i1 noundef zeroext true)
  call void @_ZN11alglib_impl14ae_vector_initEPNS_9ae_vectorEllPNS_8ae_stateEb(ptr noundef nonnull %9, i64 noundef 0, i64 noundef 3, ptr noundef %5, i1 noundef zeroext true)
  %11 = icmp slt i64 %0, 1
  br i1 %11, label %.loopexit.sink.split, label %12

12:                                               ; preds = %6
  %13 = call noundef zeroext i1 @_ZN11alglib_impl13ae_fp_less_eqEdd(double noundef %1, double noundef -1.000000e+00)
  br i1 %13, label %.loopexit.sink.split, label %14

14:                                               ; preds = %12
  call void @_ZN11alglib_impl20ae_vector_set_lengthEPNS_9ae_vectorElPNS_8ae_stateE(ptr noundef nonnull %8, i64 noundef %0, ptr noundef %5)
  call void @_ZN11alglib_impl20ae_vector_set_lengthEPNS_9ae_vectorElPNS_8ae_stateE(ptr noundef nonnull %9, i64 noundef %0, ptr noundef %5)
  %15 = fadd double %1, 1.000000e+00
  %16 = getelementptr inbounds i8, ptr %8, i64 56
  %17 = load ptr, ptr %16, align 8, !tbaa !9
  store double %15, ptr %17, align 8, !tbaa !10
  %18 = call noundef double @_ZN11alglib_impl7lngammaEdPdPNS_8ae_stateE(double noundef %15, ptr noundef nonnull %10, ptr noundef %5)
  %19 = call noundef double @_ZN11alglib_impl6ae_logEdPNS_8ae_stateE(double noundef 1.000000e+300, ptr noundef %5)
  %20 = call noundef zeroext i1 @_ZN11alglib_impl16ae_fp_greater_eqEdd(double noundef %18, double noundef %19)
  br i1 %20, label %.loopexit.sink.split, label %21

21:                                               ; preds = %14
  %22 = call noundef double @_ZN11alglib_impl6ae_expEdPNS_8ae_stateE(double noundef %18, ptr noundef %5)
  %23 = getelementptr inbounds i8, ptr %9, i64 56
  %24 = load ptr, ptr %23, align 8, !tbaa !9
  store double %22, ptr %24, align 8, !tbaa !10
  %.not51.not54.not = icmp eq i64 %0, 1
  br i1 %.not51.not54.not, label %.loopexit53, label %.lr.ph

.lr.ph:                                           ; preds = %21, %.lr.ph
  %.055 = phi i64 [ %36, %.lr.ph ], [ 1, %21 ]
  %25 = shl nuw nsw i64 %.055, 1
  %26 = uitofp nneg i64 %25 to double
  %27 = fadd double %26, %1
  %28 = fadd double %27, 1.000000e+00
  %29 = load ptr, ptr %16, align 8, !tbaa !9
  %30 = getelementptr inbounds double, ptr %29, i64 %.055
  store double %28, ptr %30, align 8, !tbaa !10
  %31 = uitofp nneg i64 %.055 to double
  %32 = fadd double %31, %1
  %33 = fmul double %32, %31
  %34 = load ptr, ptr %23, align 8, !tbaa !9
  %35 = getelementptr inbounds double, ptr %34, i64 %.055
  store double %33, ptr %35, align 8, !tbaa !10
  %36 = add nuw nsw i64 %.055, 1
  %exitcond.not = icmp eq i64 %36, %0
  br i1 %exitcond.not, label %.loopexit53, label %.lr.ph, !llvm.loop !12

.loopexit53:                                      ; preds = %.lr.ph, %21
  %37 = load ptr, ptr %23, align 8, !tbaa !9
  %38 = load double, ptr %37, align 8, !tbaa !10
  call void @_ZN11alglib_impl13gqgeneraterecEPNS_9ae_vectorES1_dlPlS1_S1_PNS_8ae_stateE(ptr noundef nonnull %8, ptr noundef nonnull %9, double noundef %38, i64 noundef %0, ptr noundef nonnull %2, ptr noundef %3, ptr noundef %4, ptr noundef %5)
  %39 = load i64, ptr %2, align 8, !tbaa !5
  %40 = icmp sgt i64 %39, 0
  br i1 %40, label %41, label %.loopexit

41:                                               ; preds = %.loopexit53
  %42 = getelementptr inbounds i8, ptr %3, i64 56
  %43 = load ptr, ptr %42, align 8, !tbaa !9
  %44 = load double, ptr %43, align 8, !tbaa !10
  %45 = call noundef zeroext i1 @_ZN11alglib_impl10ae_fp_lessEdd(double noundef %44, double noundef 0.000000e+00)
  br i1 %45, label %46, label %47

46:                                               ; preds = %41
  store i64 -4, ptr %2, align 8, !tbaa !5
  br label %47

47:                                               ; preds = %46, %41
  br i1 %.not51.not54.not, label %.loopexit, label %.lr.ph58.preheader

.lr.ph58.preheader:                               ; preds = %47
  %48 = call i64 @llvm.smax.i64(i64 %0, i64 2)
  %49 = add nsw i64 %48, -2
  br label %.lr.ph58

.lr.ph58:                                         ; preds = %.lr.ph58.preheader, %58
  %.157 = phi i64 [ %53, %58 ], [ 0, %.lr.ph58.preheader ]
  %50 = load ptr, ptr %42, align 8, !tbaa !9
  %51 = getelementptr inbounds double, ptr %50, i64 %.157
  %52 = load double, ptr %51, align 8, !tbaa !10
  %53 = add nuw nsw i64 %.157, 1
  %54 = getelementptr inbounds double, ptr %50, i64 %53
  %55 = load double, ptr %54, align 8, !tbaa !10
  %56 = call noundef zeroext i1 @_ZN11alglib_impl16ae_fp_greater_eqEdd(double noundef %52, double noundef %55)
  br i1 %56, label %57, label %58

57:                                               ; preds = %.lr.ph58
  store i64 -4, ptr %2, align 8, !tbaa !5
  br label %58

58:                                               ; preds = %.lr.ph58, %57
  %exitcond59.not = icmp eq i64 %.157, %49
  br i1 %exitcond59.not, label %.loopexit, label %.lr.ph58, !llvm.loop !14

.loopexit.sink.split:                             ; preds = %14, %6, %12
  %.sink = phi i64 [ -1, %12 ], [ -1, %6 ], [ -4, %14 ]
  store i64 %.sink, ptr %2, align 8, !tbaa !5
  br label %.loopexit

.loopexit:                                        ; preds = %58, %.loopexit.sink.split, %.loopexit53, %47
  call void @_ZN11alglib_impl14ae_frame_leaveEPNS_8ae_stateE(ptr noundef %5)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %10) #5
  call void @llvm.lifetime.end.p0(i64 64, ptr nonnull %9) #5
  call void @llvm.lifetime.end.p0(i64 64, ptr nonnull %8) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %7) #5
  ret void
}

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

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

declare void @_ZN11alglib_impl15ae_vector_clearEPNS_9ae_vectorE(ptr noundef) local_unnamed_addr #3

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

declare void @_ZN11alglib_impl14ae_frame_leaveEPNS_8ae_stateE(ptr noundef) local_unnamed_addr #3

declare void @_ZN11alglib_impl20ae_vector_set_lengthEPNS_9ae_vectorElPNS_8ae_stateE(ptr noundef, i64 noundef, ptr noundef) local_unnamed_addr #3

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

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

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

declare noundef double @_ZN11alglib_impl6ae_logEdPNS_8ae_stateE(double noundef, ptr noundef) local_unnamed_addr #3

declare noundef double @_ZN11alglib_impl7lngammaEdPdPNS_8ae_stateE(double noundef, ptr noundef, ptr noundef) local_unnamed_addr #3

declare noundef double @_ZN11alglib_impl6ae_expEdPNS_8ae_stateE(double noundef, ptr noundef) local_unnamed_addr #3

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.smax.i64(i64, i64) #4

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 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #3 = { "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 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
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 = !{!"long", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!7, !7, i64 0}
!10 = !{!11, !11, i64 0}
!11 = !{!"double", !7, i64 0}
!12 = distinct !{!12, !13}
!13 = !{!"llvm.loop.mustprogress"}
!14 = distinct !{!14, !13}


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