; 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_impl22gqgenerategausshermiteElPlPNS_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 %117

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 = load ptr, ptr %10, align 8, !tbaa !9
  %47 = call noundef double @_ZN11alglib_impl7ae_atanEdPNS_8ae_stateE(double noundef 1.000000e+00, ptr noundef %46)
  %48 = fmul double 4.000000e+00, %47
  %49 = load ptr, ptr %10, align 8, !tbaa !9
  %50 = call noundef double @_ZN11alglib_impl7ae_sqrtEdPNS_8ae_stateE(double noundef %48, ptr noundef %49)
  %51 = getelementptr inbounds %"struct.alglib_impl::ae_vector", ptr %13, i32 0, i32 4
  %52 = load ptr, ptr %51, align 8, !tbaa !11
  %53 = getelementptr inbounds double, ptr %52, i64 0
  store double %50, ptr %53, align 8, !tbaa !12
  %54 = load i64, ptr %6, align 8, !tbaa !5
  %55 = icmp sgt i64 %54, 1
  br i1 %55, label %56, label %74

56:                                               ; preds = %45
  store i64 1, ptr %14, align 8, !tbaa !5
  br label %57

57:                                               ; preds = %70, %56
  %58 = load i64, ptr %14, align 8, !tbaa !5
  %59 = load i64, ptr %6, align 8, !tbaa !5
  %60 = sub nsw i64 %59, 1
  %61 = icmp sle i64 %58, %60
  br i1 %61, label %62, label %73

62:                                               ; preds = %57
  %63 = load i64, ptr %14, align 8, !tbaa !5
  %64 = sitofp i64 %63 to double
  %65 = fmul double 5.000000e-01, %64
  %66 = getelementptr inbounds %"struct.alglib_impl::ae_vector", ptr %13, i32 0, i32 4
  %67 = load ptr, ptr %66, align 8, !tbaa !11
  %68 = load i64, ptr %14, align 8, !tbaa !5
  %69 = getelementptr inbounds double, ptr %67, i64 %68
  store double %65, ptr %69, align 8, !tbaa !12
  br label %70

70:                                               ; preds = %62
  %71 = load i64, ptr %14, align 8, !tbaa !5
  %72 = add nsw i64 %71, 1
  store i64 %72, ptr %14, align 8, !tbaa !5
  br label %57, !llvm.loop !16

73:                                               ; preds = %57
  br label %74

74:                                               ; preds = %73, %45
  %75 = getelementptr inbounds %"struct.alglib_impl::ae_vector", ptr %13, i32 0, i32 4
  %76 = load ptr, ptr %75, align 8, !tbaa !11
  %77 = getelementptr inbounds double, ptr %76, i64 0
  %78 = load double, ptr %77, align 8, !tbaa !12
  %79 = load i64, ptr %6, align 8, !tbaa !5
  %80 = load ptr, ptr %7, align 8, !tbaa !9
  %81 = load ptr, ptr %8, align 8, !tbaa !9
  %82 = load ptr, ptr %9, align 8, !tbaa !9
  %83 = 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 %78, i64 noundef %79, ptr noundef %80, ptr noundef %81, ptr noundef %82, ptr noundef %83)
  %84 = load ptr, ptr %7, align 8, !tbaa !9
  %85 = load i64, ptr %84, align 8, !tbaa !5
  %86 = icmp sgt i64 %85, 0
  br i1 %86, label %87, label %115

87:                                               ; preds = %74
  store i64 0, ptr %14, align 8, !tbaa !5
  br label %88

88:                                               ; preds = %111, %87
  %89 = load i64, ptr %14, align 8, !tbaa !5
  %90 = load i64, ptr %6, align 8, !tbaa !5
  %91 = sub nsw i64 %90, 2
  %92 = icmp sle i64 %89, %91
  br i1 %92, label %93, label %114

93:                                               ; preds = %88
  %94 = load ptr, ptr %8, align 8, !tbaa !9
  %95 = getelementptr inbounds %"struct.alglib_impl::ae_vector", ptr %94, i32 0, i32 4
  %96 = load ptr, ptr %95, align 8, !tbaa !11
  %97 = load i64, ptr %14, align 8, !tbaa !5
  %98 = getelementptr inbounds double, ptr %96, i64 %97
  %99 = load double, ptr %98, align 8, !tbaa !12
  %100 = load ptr, ptr %8, align 8, !tbaa !9
  %101 = getelementptr inbounds %"struct.alglib_impl::ae_vector", ptr %100, i32 0, i32 4
  %102 = load ptr, ptr %101, align 8, !tbaa !11
  %103 = load i64, ptr %14, align 8, !tbaa !5
  %104 = add nsw i64 %103, 1
  %105 = getelementptr inbounds double, ptr %102, i64 %104
  %106 = load double, ptr %105, align 8, !tbaa !12
  %107 = call noundef zeroext i1 @_ZN11alglib_impl16ae_fp_greater_eqEdd(double noundef %99, double noundef %106)
  br i1 %107, label %108, label %110

108:                                              ; preds = %93
  %109 = load ptr, ptr %7, align 8, !tbaa !9
  store i64 -4, ptr %109, align 8, !tbaa !5
  br label %110

110:                                              ; preds = %108, %93
  br label %111

111:                                              ; preds = %110
  %112 = load i64, ptr %14, align 8, !tbaa !5
  %113 = add nsw i64 %112, 1
  store i64 %113, ptr %14, align 8, !tbaa !5
  br label %88, !llvm.loop !17

114:                                              ; preds = %88
  br label %115

115:                                              ; preds = %114, %74
  %116 = load ptr, ptr %10, align 8, !tbaa !9
  call void @_ZN11alglib_impl14ae_frame_leaveEPNS_8ae_stateE(ptr noundef %116)
  store i32 0, ptr %15, align 4
  br label %117

117:                                              ; preds = %115, %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
  %118 = load i32, ptr %15, align 4
  switch i32 %118, label %120 [
    i32 0, label %119
    i32 1, label %119
  ]

119:                                              ; preds = %117, %117
  ret void

120:                                              ; preds = %117
  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_impl7ae_sqrtEdPNS_8ae_stateE(double noundef, ptr noundef) #3

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

declare noundef double @_ZN11alglib_impl7ae_atanEdPNS_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 = !{!"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_impl22gqgenerategausshermiteElPlPNS_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
  %13 = add nsw i64 %0, -1
  %xtraiter = and i64 %0, 3
  %14 = icmp ult i64 %0, 4
  br i1 %14, label %.unr-lcssa, label %.new

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

15:                                               ; preds = %15, %.new
  %.045 = phi i64 [ 0, %.new ], [ %27, %15 ]
  %niter = phi i64 [ 0, %.new ], [ %niter.next.3, %15 ]
  %16 = load ptr, ptr %12, align 8, !tbaa !9
  %17 = getelementptr inbounds double, ptr %16, i64 %.045
  store double 0.000000e+00, ptr %17, align 8, !tbaa !10
  %18 = or disjoint i64 %.045, 1
  %19 = load ptr, ptr %12, align 8, !tbaa !9
  %20 = getelementptr inbounds double, ptr %19, i64 %18
  store double 0.000000e+00, ptr %20, align 8, !tbaa !10
  %21 = or disjoint i64 %.045, 2
  %22 = load ptr, ptr %12, align 8, !tbaa !9
  %23 = getelementptr inbounds double, ptr %22, i64 %21
  store double 0.000000e+00, ptr %23, align 8, !tbaa !10
  %24 = or disjoint i64 %.045, 3
  %25 = load ptr, ptr %12, align 8, !tbaa !9
  %26 = getelementptr inbounds double, ptr %25, i64 %24
  store double 0.000000e+00, ptr %26, align 8, !tbaa !10
  %27 = add nuw nsw i64 %.045, 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 %15, !llvm.loop !12

.unr-lcssa:                                       ; preds = %15, %11
  %.045.unr = phi i64 [ 0, %11 ], [ %27, %15 ]
  %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
  %.045.epil = phi i64 [ %30, %.epil.preheader ], [ %.045.unr, %.unr-lcssa ]
  %epil.iter = phi i64 [ %epil.iter.next, %.epil.preheader ], [ 0, %.unr-lcssa ]
  %28 = load ptr, ptr %12, align 8, !tbaa !9
  %29 = getelementptr inbounds double, ptr %28, i64 %.045.epil
  store double 0.000000e+00, ptr %29, align 8, !tbaa !10
  %30 = add nuw nsw i64 %.045.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
  %31 = call noundef double @_ZN11alglib_impl7ae_atanEdPNS_8ae_stateE(double noundef 1.000000e+00, ptr noundef %4)
  %32 = fmul double %31, 4.000000e+00
  %33 = call noundef double @_ZN11alglib_impl7ae_sqrtEdPNS_8ae_stateE(double noundef %32, ptr noundef %4)
  %34 = getelementptr inbounds i8, ptr %8, i64 56
  %35 = load ptr, ptr %34, align 8, !tbaa !9
  store double %33, ptr %35, align 8, !tbaa !10
  %.not41.not46.not = icmp eq i64 %0, 1
  br i1 %.not41.not46.not, label %.loopexit44, label %.lr.ph.preheader

.lr.ph.preheader:                                 ; preds = %.epilog-lcssa
  %36 = add nsw i64 %0, -2
  %xtraiter53 = and i64 %13, 3
  %37 = icmp ult i64 %36, 3
  br i1 %37, label %.loopexit44.loopexit.unr-lcssa, label %.lr.ph.preheader.new

.lr.ph.preheader.new:                             ; preds = %.lr.ph.preheader
  %unroll_iter56 = and i64 %13, -4
  br label %.lr.ph

.lr.ph:                                           ; preds = %.lr.ph, %.lr.ph.preheader.new
  %.147 = phi i64 [ 1, %.lr.ph.preheader.new ], [ %57, %.lr.ph ]
  %niter57 = phi i64 [ 0, %.lr.ph.preheader.new ], [ %niter57.next.3, %.lr.ph ]
  %38 = uitofp nneg i64 %.147 to double
  %39 = fmul double %38, 5.000000e-01
  %40 = load ptr, ptr %34, align 8, !tbaa !9
  %41 = getelementptr inbounds double, ptr %40, i64 %.147
  store double %39, ptr %41, align 8, !tbaa !10
  %42 = add nuw nsw i64 %.147, 1
  %43 = uitofp nneg i64 %42 to double
  %44 = fmul double %43, 5.000000e-01
  %45 = load ptr, ptr %34, align 8, !tbaa !9
  %46 = getelementptr inbounds double, ptr %45, i64 %42
  store double %44, ptr %46, align 8, !tbaa !10
  %47 = add nuw nsw i64 %.147, 2
  %48 = uitofp nneg i64 %47 to double
  %49 = fmul double %48, 5.000000e-01
  %50 = load ptr, ptr %34, align 8, !tbaa !9
  %51 = getelementptr inbounds double, ptr %50, i64 %47
  store double %49, ptr %51, align 8, !tbaa !10
  %52 = add nuw nsw i64 %.147, 3
  %53 = uitofp nneg i64 %52 to double
  %54 = fmul double %53, 5.000000e-01
  %55 = load ptr, ptr %34, align 8, !tbaa !9
  %56 = getelementptr inbounds double, ptr %55, i64 %52
  store double %54, ptr %56, align 8, !tbaa !10
  %57 = add nuw nsw i64 %.147, 4
  %niter57.next.3 = add i64 %niter57, 4
  %niter57.ncmp.3 = icmp eq i64 %niter57.next.3, %unroll_iter56
  br i1 %niter57.ncmp.3, label %.loopexit44.loopexit.unr-lcssa, label %.lr.ph, !llvm.loop !16

.loopexit44.loopexit.unr-lcssa:                   ; preds = %.lr.ph, %.lr.ph.preheader
  %.147.unr = phi i64 [ 1, %.lr.ph.preheader ], [ %57, %.lr.ph ]
  %lcmp.mod55.not = icmp eq i64 %xtraiter53, 0
  br i1 %lcmp.mod55.not, label %.loopexit44, label %.lr.ph.epil

.lr.ph.epil:                                      ; preds = %.loopexit44.loopexit.unr-lcssa, %.lr.ph.epil
  %.147.epil = phi i64 [ %62, %.lr.ph.epil ], [ %.147.unr, %.loopexit44.loopexit.unr-lcssa ]
  %epil.iter54 = phi i64 [ %epil.iter54.next, %.lr.ph.epil ], [ 0, %.loopexit44.loopexit.unr-lcssa ]
  %58 = uitofp nneg i64 %.147.epil to double
  %59 = fmul double %58, 5.000000e-01
  %60 = load ptr, ptr %34, align 8, !tbaa !9
  %61 = getelementptr inbounds double, ptr %60, i64 %.147.epil
  store double %59, ptr %61, align 8, !tbaa !10
  %62 = add nuw nsw i64 %.147.epil, 1
  %epil.iter54.next = add i64 %epil.iter54, 1
  %epil.iter54.cmp.not = icmp eq i64 %epil.iter54.next, %xtraiter53
  br i1 %epil.iter54.cmp.not, label %.loopexit44, label %.lr.ph.epil, !llvm.loop !17

.loopexit44:                                      ; preds = %.loopexit44.loopexit.unr-lcssa, %.lr.ph.epil, %.epilog-lcssa
  %63 = load ptr, ptr %34, align 8, !tbaa !9
  %64 = load double, ptr %63, 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 %64, i64 noundef %0, ptr noundef nonnull %1, ptr noundef %2, ptr noundef %3, ptr noundef %4)
  %65 = load i64, ptr %1, align 8, !tbaa !5
  %66 = icmp slt i64 %65, 1
  %brmerge = or i1 %66, %.not41.not46.not
  br i1 %brmerge, label %.loopexit, label %.lr.ph50

.lr.ph50:                                         ; preds = %.loopexit44
  %67 = getelementptr inbounds i8, ptr %2, i64 56
  %68 = call i64 @llvm.smax.i64(i64 %0, i64 2)
  %69 = add nsw i64 %68, -2
  br label %70

70:                                               ; preds = %.lr.ph50, %79
  %.249 = phi i64 [ 0, %.lr.ph50 ], [ %74, %79 ]
  %71 = load ptr, ptr %67, align 8, !tbaa !9
  %72 = getelementptr inbounds double, ptr %71, i64 %.249
  %73 = load double, ptr %72, align 8, !tbaa !10
  %74 = add nuw nsw i64 %.249, 1
  %75 = getelementptr inbounds double, ptr %71, i64 %74
  %76 = load double, ptr %75, align 8, !tbaa !10
  %77 = call noundef zeroext i1 @_ZN11alglib_impl16ae_fp_greater_eqEdd(double noundef %73, double noundef %76)
  br i1 %77, label %78, label %79

78:                                               ; preds = %70
  store i64 -4, ptr %1, align 8, !tbaa !5
  br label %79

79:                                               ; preds = %70, %78
  %exitcond52.not = icmp eq i64 %.249, %69
  br i1 %exitcond52.not, label %.loopexit, label %70, !llvm.loop !18

.loopexit:                                        ; preds = %79, %.loopexit44, %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_impl7ae_sqrtEdPNS_8ae_stateE(double noundef, ptr 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_impl7ae_atanEdPNS_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, !15}
!15 = !{!"llvm.loop.unroll.disable"}
!16 = distinct !{!16, !13}
!17 = distinct !{!17, !15}
!18 = distinct !{!18, !13}


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