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

24:                                               ; preds = %5
  %25 = load ptr, ptr %7, align 8, !tbaa !9
  store i64 -1, ptr %25, align 8, !tbaa !5
  %26 = load ptr, ptr %10, align 8, !tbaa !9
  call void @_ZN11alglib_impl14ae_frame_leaveEPNS_8ae_stateE(ptr noundef %26)
  store i32 1, ptr %15, align 4
  br label %130

27:                                               ; preds = %5
  %28 = load i64, ptr %6, align 8, !tbaa !5
  %29 = load ptr, ptr %10, align 8, !tbaa !9
  call void @_ZN11alglib_impl20ae_vector_set_lengthEPNS_9ae_vectorElPNS_8ae_stateE(ptr noundef %12, i64 noundef %28, ptr noundef %29)
  %30 = load i64, ptr %6, align 8, !tbaa !5
  %31 = load ptr, ptr %10, align 8, !tbaa !9
  call void @_ZN11alglib_impl20ae_vector_set_lengthEPNS_9ae_vectorElPNS_8ae_stateE(ptr noundef %13, i64 noundef %30, ptr noundef %31)
  store i64 0, ptr %14, align 8, !tbaa !5
  br label %32

32:                                               ; preds = %42, %27
  %33 = load i64, ptr %14, align 8, !tbaa !5
  %34 = load i64, ptr %6, align 8, !tbaa !5
  %35 = sub nsw i64 %34, 1
  %36 = icmp sle i64 %33, %35
  br i1 %36, label %37, label %45

37:                                               ; preds = %32
  %38 = getelementptr inbounds %"struct.alglib_impl::ae_vector", ptr %12, i32 0, i32 4
  %39 = load ptr, ptr %38, align 8, !tbaa !11
  %40 = load i64, ptr %14, align 8, !tbaa !5
  %41 = getelementptr inbounds double, ptr %39, i64 %40
  store double 0.000000e+00, ptr %41, align 8, !tbaa !12
  br label %42

42:                                               ; preds = %37
  %43 = load i64, ptr %14, align 8, !tbaa !5
  %44 = add nsw i64 %43, 1
  store i64 %44, ptr %14, align 8, !tbaa !5
  br label %32, !llvm.loop !14

45:                                               ; preds = %32
  %46 = getelementptr inbounds %"struct.alglib_impl::ae_vector", ptr %13, i32 0, i32 4
  %47 = load ptr, ptr %46, align 8, !tbaa !11
  %48 = getelementptr inbounds double, ptr %47, i64 0
  store double 2.000000e+00, ptr %48, align 8, !tbaa !12
  store i64 1, ptr %14, align 8, !tbaa !5
  br label %49

49:                                               ; preds = %66, %45
  %50 = load i64, ptr %14, align 8, !tbaa !5
  %51 = load i64, ptr %6, align 8, !tbaa !5
  %52 = sub nsw i64 %51, 1
  %53 = icmp sle i64 %50, %52
  br i1 %53, label %54, label %69

54:                                               ; preds = %49
  %55 = load i64, ptr %14, align 8, !tbaa !5
  %56 = sitofp i64 %55 to double
  %57 = load ptr, ptr %10, align 8, !tbaa !9
  %58 = call noundef double @_ZN11alglib_impl6ae_sqrEdPNS_8ae_stateE(double noundef %56, ptr noundef %57)
  %59 = fdiv double 1.000000e+00, %58
  %60 = fsub double 4.000000e+00, %59
  %61 = fdiv double 1.000000e+00, %60
  %62 = getelementptr inbounds %"struct.alglib_impl::ae_vector", ptr %13, i32 0, i32 4
  %63 = load ptr, ptr %62, align 8, !tbaa !11
  %64 = load i64, ptr %14, align 8, !tbaa !5
  %65 = getelementptr inbounds double, ptr %63, i64 %64
  store double %61, ptr %65, align 8, !tbaa !12
  br label %66

66:                                               ; preds = %54
  %67 = load i64, ptr %14, align 8, !tbaa !5
  %68 = add nsw i64 %67, 1
  store i64 %68, ptr %14, align 8, !tbaa !5
  br label %49, !llvm.loop !16

69:                                               ; preds = %49
  %70 = getelementptr inbounds %"struct.alglib_impl::ae_vector", ptr %13, i32 0, i32 4
  %71 = load ptr, ptr %70, align 8, !tbaa !11
  %72 = getelementptr inbounds double, ptr %71, i64 0
  %73 = load double, ptr %72, align 8, !tbaa !12
  %74 = load i64, ptr %6, align 8, !tbaa !5
  %75 = load ptr, ptr %7, align 8, !tbaa !9
  %76 = load ptr, ptr %8, align 8, !tbaa !9
  %77 = load ptr, ptr %9, align 8, !tbaa !9
  %78 = load ptr, ptr %10, align 8, !tbaa !9
  call void @_ZN11alglib_impl13gqgeneraterecEPNS_9ae_vectorES1_dlPlS1_S1_PNS_8ae_stateE(ptr noundef %12, ptr noundef %13, double noundef %73, i64 noundef %74, ptr noundef %75, ptr noundef %76, ptr noundef %77, ptr noundef %78)
  %79 = load ptr, ptr %7, align 8, !tbaa !9
  %80 = load i64, ptr %79, align 8, !tbaa !5
  %81 = icmp sgt i64 %80, 0
  br i1 %81, label %82, label %128

82:                                               ; preds = %69
  %83 = load ptr, ptr %8, align 8, !tbaa !9
  %84 = getelementptr inbounds %"struct.alglib_impl::ae_vector", ptr %83, i32 0, i32 4
  %85 = load ptr, ptr %84, align 8, !tbaa !11
  %86 = getelementptr inbounds double, ptr %85, i64 0
  %87 = load double, ptr %86, align 8, !tbaa !12
  %88 = call noundef zeroext i1 @_ZN11alglib_impl10ae_fp_lessEdd(double noundef %87, double noundef -1.000000e+00)
  br i1 %88, label %98, label %89

89:                                               ; preds = %82
  %90 = load ptr, ptr %8, align 8, !tbaa !9
  %91 = getelementptr inbounds %"struct.alglib_impl::ae_vector", ptr %90, i32 0, i32 4
  %92 = load ptr, ptr %91, align 8, !tbaa !11
  %93 = load i64, ptr %6, align 8, !tbaa !5
  %94 = sub nsw i64 %93, 1
  %95 = getelementptr inbounds double, ptr %92, i64 %94
  %96 = load double, ptr %95, align 8, !tbaa !12
  %97 = call noundef zeroext i1 @_ZN11alglib_impl13ae_fp_greaterEdd(double noundef %96, double noundef 1.000000e+00)
  br i1 %97, label %98, label %100

98:                                               ; preds = %89, %82
  %99 = load ptr, ptr %7, align 8, !tbaa !9
  store i64 -4, ptr %99, align 8, !tbaa !5
  br label %100

100:                                              ; preds = %98, %89
  store i64 0, ptr %14, align 8, !tbaa !5
  br label %101

101:                                              ; preds = %124, %100
  %102 = load i64, ptr %14, align 8, !tbaa !5
  %103 = load i64, ptr %6, align 8, !tbaa !5
  %104 = sub nsw i64 %103, 2
  %105 = icmp sle i64 %102, %104
  br i1 %105, label %106, label %127

106:                                              ; preds = %101
  %107 = load ptr, ptr %8, align 8, !tbaa !9
  %108 = getelementptr inbounds %"struct.alglib_impl::ae_vector", ptr %107, i32 0, i32 4
  %109 = load ptr, ptr %108, align 8, !tbaa !11
  %110 = load i64, ptr %14, align 8, !tbaa !5
  %111 = getelementptr inbounds double, ptr %109, i64 %110
  %112 = load double, ptr %111, align 8, !tbaa !12
  %113 = load ptr, ptr %8, align 8, !tbaa !9
  %114 = getelementptr inbounds %"struct.alglib_impl::ae_vector", ptr %113, i32 0, i32 4
  %115 = load ptr, ptr %114, align 8, !tbaa !11
  %116 = load i64, ptr %14, align 8, !tbaa !5
  %117 = add nsw i64 %116, 1
  %118 = getelementptr inbounds double, ptr %115, i64 %117
  %119 = load double, ptr %118, align 8, !tbaa !12
  %120 = call noundef zeroext i1 @_ZN11alglib_impl16ae_fp_greater_eqEdd(double noundef %112, double noundef %119)
  br i1 %120, label %121, label %123

121:                                              ; preds = %106
  %122 = load ptr, ptr %7, align 8, !tbaa !9
  store i64 -4, ptr %122, align 8, !tbaa !5
  br label %123

123:                                              ; preds = %121, %106
  br label %124

124:                                              ; preds = %123
  %125 = load i64, ptr %14, align 8, !tbaa !5
  %126 = add nsw i64 %125, 1
  store i64 %126, ptr %14, align 8, !tbaa !5
  br label %101, !llvm.loop !17

127:                                              ; preds = %101
  br label %128

128:                                              ; preds = %127, %69
  %129 = load ptr, ptr %10, align 8, !tbaa !9
  call void @_ZN11alglib_impl14ae_frame_leaveEPNS_8ae_stateE(ptr noundef %129)
  store i32 0, ptr %15, align 4
  br label %130

130:                                              ; preds = %128, %24
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #4
  call void @llvm.lifetime.end.p0(i64 64, ptr %13) #4
  call void @llvm.lifetime.end.p0(i64 64, ptr %12) #4
  call void @llvm.lifetime.end.p0(i64 32, ptr %11) #4
  %131 = load i32, ptr %15, align 4
  switch i32 %131, label %133 [
    i32 0, label %132
    i32 1, label %132
  ]

132:                                              ; preds = %130, %130
  ret void

133:                                              ; preds = %130
  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 double @_ZN11alglib_impl6ae_sqrEdPNS_8ae_stateE(double noundef, ptr noundef) #3

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

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 = !{!"any pointer", !7, i64 0}
!11 = !{!7, !7, i64 0}
!12 = !{!13, !13, i64 0}
!13 = !{!"double", !7, i64 0}
!14 = distinct !{!14, !15}
!15 = !{!"llvm.loop.mustprogress"}
!16 = distinct !{!16, !15}
!17 = distinct !{!17, !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_impl23gqgenerategausslegendreElPlPNS_9ae_vectorES2_PNS_8ae_stateE(i64 noundef %0, ptr noundef %1, ptr noundef %2, ptr noundef %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)
  store i64 0, ptr %1, align 8, !tbaa !5
  call void @_ZN11alglib_impl15ae_vector_clearEPNS_9ae_vectorE(ptr noundef %2)
  call void @_ZN11alglib_impl15ae_vector_clearEPNS_9ae_vectorE(ptr noundef %3)
  call void @_ZN11alglib_impl14ae_vector_initEPNS_9ae_vectorEllPNS_8ae_stateEb(ptr noundef nonnull %7, i64 noundef 0, i64 noundef 3, ptr noundef %4, i1 noundef zeroext true)
  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 slt i64 %0, 1
  br i1 %9, label %10, label %11

10:                                               ; preds = %5
  store i64 -1, ptr %1, align 8, !tbaa !5
  br label %.loopexit

11:                                               ; preds = %5
  call void @_ZN11alglib_impl20ae_vector_set_lengthEPNS_9ae_vectorElPNS_8ae_stateE(ptr noundef nonnull %7, i64 noundef %0, ptr noundef %4)
  call void @_ZN11alglib_impl20ae_vector_set_lengthEPNS_9ae_vectorElPNS_8ae_stateE(ptr noundef nonnull %8, i64 noundef %0, ptr noundef %4)
  %12 = getelementptr inbounds i8, ptr %7, i64 56
  %xtraiter = and i64 %0, 3
  %13 = icmp ult i64 %0, 4
  br i1 %13, label %.unr-lcssa, label %.new

.new:                                             ; preds = %11
  %unroll_iter = and i64 %0, 9223372036854775804
  br label %14

14:                                               ; preds = %14, %.new
  %.044 = phi i64 [ 0, %.new ], [ %26, %14 ]
  %niter = phi i64 [ 0, %.new ], [ %niter.next.3, %14 ]
  %15 = load ptr, ptr %12, align 8, !tbaa !9
  %16 = getelementptr inbounds double, ptr %15, i64 %.044
  store double 0.000000e+00, ptr %16, align 8, !tbaa !10
  %17 = or disjoint i64 %.044, 1
  %18 = load ptr, ptr %12, align 8, !tbaa !9
  %19 = getelementptr inbounds double, ptr %18, i64 %17
  store double 0.000000e+00, ptr %19, align 8, !tbaa !10
  %20 = or disjoint i64 %.044, 2
  %21 = load ptr, ptr %12, align 8, !tbaa !9
  %22 = getelementptr inbounds double, ptr %21, i64 %20
  store double 0.000000e+00, ptr %22, align 8, !tbaa !10
  %23 = or disjoint i64 %.044, 3
  %24 = load ptr, ptr %12, align 8, !tbaa !9
  %25 = getelementptr inbounds double, ptr %24, i64 %23
  store double 0.000000e+00, ptr %25, align 8, !tbaa !10
  %26 = add nuw nsw i64 %.044, 4
  %niter.next.3 = add i64 %niter, 4
  %niter.ncmp.3 = icmp eq i64 %niter.next.3, %unroll_iter
  br i1 %niter.ncmp.3, label %.unr-lcssa, label %14, !llvm.loop !12

.unr-lcssa:                                       ; preds = %14, %11
  %.044.unr = phi i64 [ 0, %11 ], [ %26, %14 ]
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br i1 %lcmp.mod.not, label %.epilog-lcssa, label %.epil.preheader

.epil.preheader:                                  ; preds = %.unr-lcssa, %.epil.preheader
  %.044.epil = phi i64 [ %29, %.epil.preheader ], [ %.044.unr, %.unr-lcssa ]
  %epil.iter = phi i64 [ %epil.iter.next, %.epil.preheader ], [ 0, %.unr-lcssa ]
  %27 = load ptr, ptr %12, align 8, !tbaa !9
  %28 = getelementptr inbounds double, ptr %27, i64 %.044.epil
  store double 0.000000e+00, ptr %28, align 8, !tbaa !10
  %29 = add nuw nsw i64 %.044.epil, 1
  %epil.iter.next = add i64 %epil.iter, 1
  %epil.iter.cmp.not = icmp eq i64 %epil.iter.next, %xtraiter
  br i1 %epil.iter.cmp.not, label %.epilog-lcssa, label %.epil.preheader, !llvm.loop !14

.epilog-lcssa:                                    ; preds = %.epil.preheader, %.unr-lcssa
  %30 = getelementptr inbounds i8, ptr %8, i64 56
  %31 = load ptr, ptr %30, align 8, !tbaa !9
  store double 2.000000e+00, ptr %31, align 8, !tbaa !10
  %.not.not4345.not = icmp eq i64 %0, 1
  br i1 %.not.not4345.not, label %._crit_edge, label %.lr.ph

.lr.ph:                                           ; preds = %.epilog-lcssa, %.lr.ph
  %.146 = phi i64 [ %39, %.lr.ph ], [ 1, %.epilog-lcssa ]
  %32 = uitofp nneg i64 %.146 to double
  %33 = call noundef double @_ZN11alglib_impl6ae_sqrEdPNS_8ae_stateE(double noundef %32, ptr noundef %4)
  %34 = fdiv double 1.000000e+00, %33
  %35 = fsub double 4.000000e+00, %34
  %36 = fdiv double 1.000000e+00, %35
  %37 = load ptr, ptr %30, align 8, !tbaa !9
  %38 = getelementptr inbounds double, ptr %37, i64 %.146
  store double %36, ptr %38, align 8, !tbaa !10
  %39 = add nuw nsw i64 %.146, 1
  %exitcond52.not = icmp eq i64 %39, %0
  br i1 %exitcond52.not, label %._crit_edge, label %.lr.ph, !llvm.loop !16

._crit_edge:                                      ; preds = %.lr.ph, %.epilog-lcssa
  %40 = load ptr, ptr %30, align 8, !tbaa !9
  %41 = load double, ptr %40, align 8, !tbaa !10
  call void @_ZN11alglib_impl13gqgeneraterecEPNS_9ae_vectorES1_dlPlS1_S1_PNS_8ae_stateE(ptr noundef nonnull %7, ptr noundef nonnull %8, double noundef %41, i64 noundef %0, ptr noundef nonnull %1, ptr noundef %2, ptr noundef %3, ptr noundef %4)
  %42 = load i64, ptr %1, align 8, !tbaa !5
  %43 = icmp sgt i64 %42, 0
  br i1 %43, label %44, label %.loopexit

44:                                               ; preds = %._crit_edge
  %45 = getelementptr inbounds i8, ptr %2, i64 56
  %46 = load ptr, ptr %45, align 8, !tbaa !9
  %47 = load double, ptr %46, align 8, !tbaa !10
  %48 = call noundef zeroext i1 @_ZN11alglib_impl10ae_fp_lessEdd(double noundef %47, double noundef -1.000000e+00)
  br i1 %48, label %55, label %49

49:                                               ; preds = %44
  %50 = load ptr, ptr %45, align 8, !tbaa !9
  %51 = getelementptr double, ptr %50, i64 %0
  %52 = getelementptr i8, ptr %51, i64 -8
  %53 = load double, ptr %52, align 8, !tbaa !10
  %54 = call noundef zeroext i1 @_ZN11alglib_impl13ae_fp_greaterEdd(double noundef %53, double noundef 1.000000e+00)
  br i1 %54, label %55, label %56

55:                                               ; preds = %49, %44
  store i64 -4, ptr %1, align 8, !tbaa !5
  br label %56

56:                                               ; preds = %55, %49
  br i1 %.not.not4345.not, label %.loopexit, label %.lr.ph50.preheader

.lr.ph50.preheader:                               ; preds = %56
  %57 = call i64 @llvm.smax.i64(i64 %0, i64 2)
  %58 = add nsw i64 %57, -2
  br label %.lr.ph50

.lr.ph50:                                         ; preds = %.lr.ph50.preheader, %67
  %.248 = phi i64 [ %62, %67 ], [ 0, %.lr.ph50.preheader ]
  %59 = load ptr, ptr %45, align 8, !tbaa !9
  %60 = getelementptr inbounds double, ptr %59, i64 %.248
  %61 = load double, ptr %60, align 8, !tbaa !10
  %62 = add nuw nsw i64 %.248, 1
  %63 = getelementptr inbounds double, ptr %59, i64 %62
  %64 = load double, ptr %63, align 8, !tbaa !10
  %65 = call noundef zeroext i1 @_ZN11alglib_impl16ae_fp_greater_eqEdd(double noundef %61, double noundef %64)
  br i1 %65, label %66, label %67

66:                                               ; preds = %.lr.ph50
  store i64 -4, ptr %1, align 8, !tbaa !5
  br label %67

67:                                               ; preds = %.lr.ph50, %66
  %exitcond53.not = icmp eq i64 %.248, %58
  br i1 %exitcond53.not, label %.loopexit, label %.lr.ph50, !llvm.loop !17

.loopexit:                                        ; preds = %67, %._crit_edge, %56, %10
  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
}

; 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 double @_ZN11alglib_impl6ae_sqrEdPNS_8ae_stateE(double noundef, ptr noundef) local_unnamed_addr #3

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

; 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, !15}
!15 = !{!"llvm.loop.unroll.disable"}
!16 = distinct !{!16, !13}
!17 = distinct !{!17, !13}


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