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

; 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: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #1

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

declare void @_ZN11alglib_impl20ae_vector_set_lengthEPNS_9ae_vectorElPNS_8ae_stateE(ptr noundef, i64 noundef, 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 i64 @_ZN11alglib_impl8ae_v_lenEll(i64 noundef, i64 noundef) #2

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

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

declare void @_ZN11alglib_impl14ae_frame_leaveEPNS_8ae_stateE(ptr noundef) #2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN11alglib_impl15heapsortdpointsEPNS_9ae_vectorES1_S1_lPNS_8ae_stateE(ptr noundef %0, ptr noundef %1, ptr noundef %2, i64 noundef %3, ptr noundef %4) #3 {
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca i64, 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 %"struct.alglib_impl::ae_vector", align 8
  %15 = alloca %"struct.alglib_impl::ae_vector", align 8
  %16 = alloca i64, align 8
  store ptr %0, ptr %6, align 8, !tbaa !5
  store ptr %1, ptr %7, align 8, !tbaa !5
  store ptr %2, ptr %8, align 8, !tbaa !5
  store i64 %3, ptr %9, align 8, !tbaa !9
  store ptr %4, ptr %10, align 8, !tbaa !5
  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 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
  %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 %13, i8 0, i64 64, i1 false)
  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)
  %18 = load ptr, ptr %10, align 8, !tbaa !5
  call void @_ZN11alglib_impl14ae_vector_initEPNS_9ae_vectorEllPNS_8ae_stateEb(ptr noundef %12, i64 noundef 0, i64 noundef 3, ptr noundef %18, i1 noundef zeroext true)
  %19 = load ptr, ptr %10, align 8, !tbaa !5
  call void @_ZN11alglib_impl14ae_vector_initEPNS_9ae_vectorEllPNS_8ae_stateEb(ptr noundef %13, i64 noundef 0, i64 noundef 2, ptr noundef %19, i1 noundef zeroext true)
  %20 = load ptr, ptr %10, align 8, !tbaa !5
  call void @_ZN11alglib_impl14ae_vector_initEPNS_9ae_vectorEllPNS_8ae_stateEb(ptr noundef %14, i64 noundef 0, i64 noundef 3, ptr noundef %20, i1 noundef zeroext true)
  %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 2, ptr noundef %21, i1 noundef zeroext true)
  %22 = load i64, ptr %9, align 8, !tbaa !9
  %23 = load ptr, ptr %10, align 8, !tbaa !5
  call void @_ZN11alglib_impl20ae_vector_set_lengthEPNS_9ae_vectorElPNS_8ae_stateE(ptr noundef %13, i64 noundef %22, ptr noundef %23)
  %24 = load i64, ptr %9, align 8, !tbaa !9
  %25 = load ptr, ptr %10, align 8, !tbaa !5
  call void @_ZN11alglib_impl20ae_vector_set_lengthEPNS_9ae_vectorElPNS_8ae_stateE(ptr noundef %12, i64 noundef %24, ptr noundef %25)
  store i64 0, ptr %16, align 8, !tbaa !9
  br label %26

26:                                               ; preds = %37, %5
  %27 = load i64, ptr %16, align 8, !tbaa !9
  %28 = load i64, ptr %9, align 8, !tbaa !9
  %29 = sub nsw i64 %28, 1
  %30 = icmp sle i64 %27, %29
  br i1 %30, label %31, label %40

31:                                               ; preds = %26
  %32 = load i64, ptr %16, align 8, !tbaa !9
  %33 = getelementptr inbounds %"struct.alglib_impl::ae_vector", ptr %13, i32 0, i32 4
  %34 = load ptr, ptr %33, align 8, !tbaa !11
  %35 = load i64, ptr %16, align 8, !tbaa !9
  %36 = getelementptr inbounds i64, ptr %34, i64 %35
  store i64 %32, ptr %36, align 8, !tbaa !9
  br label %37

37:                                               ; preds = %31
  %38 = load i64, ptr %16, align 8, !tbaa !9
  %39 = add nsw i64 %38, 1
  store i64 %39, ptr %16, align 8, !tbaa !9
  br label %26, !llvm.loop !12

40:                                               ; preds = %26
  %41 = load ptr, ptr %6, align 8, !tbaa !5
  %42 = load i64, ptr %9, align 8, !tbaa !9
  %43 = load ptr, ptr %10, align 8, !tbaa !5
  call void @_ZN11alglib_impl12tagsortfastiEPNS_9ae_vectorES1_S1_S1_lPNS_8ae_stateE(ptr noundef %41, ptr noundef %13, ptr noundef %14, ptr noundef %15, i64 noundef %42, ptr noundef %43)
  store i64 0, ptr %16, align 8, !tbaa !9
  br label %44

44:                                               ; preds = %64, %40
  %45 = load i64, ptr %16, align 8, !tbaa !9
  %46 = load i64, ptr %9, align 8, !tbaa !9
  %47 = sub nsw i64 %46, 1
  %48 = icmp sle i64 %45, %47
  br i1 %48, label %49, label %67

49:                                               ; preds = %44
  %50 = load ptr, ptr %7, align 8, !tbaa !5
  %51 = getelementptr inbounds %"struct.alglib_impl::ae_vector", ptr %50, i32 0, i32 4
  %52 = load ptr, ptr %51, align 8, !tbaa !11
  %53 = getelementptr inbounds %"struct.alglib_impl::ae_vector", ptr %13, i32 0, i32 4
  %54 = load ptr, ptr %53, align 8, !tbaa !11
  %55 = load i64, ptr %16, align 8, !tbaa !9
  %56 = getelementptr inbounds i64, ptr %54, i64 %55
  %57 = load i64, ptr %56, align 8, !tbaa !9
  %58 = getelementptr inbounds double, ptr %52, i64 %57
  %59 = load double, ptr %58, align 8, !tbaa !14
  %60 = getelementptr inbounds %"struct.alglib_impl::ae_vector", ptr %12, i32 0, i32 4
  %61 = load ptr, ptr %60, align 8, !tbaa !11
  %62 = load i64, ptr %16, align 8, !tbaa !9
  %63 = getelementptr inbounds double, ptr %61, i64 %62
  store double %59, ptr %63, align 8, !tbaa !14
  br label %64

64:                                               ; preds = %49
  %65 = load i64, ptr %16, align 8, !tbaa !9
  %66 = add nsw i64 %65, 1
  store i64 %66, ptr %16, align 8, !tbaa !9
  br label %44, !llvm.loop !16

67:                                               ; preds = %44
  %68 = load ptr, ptr %7, align 8, !tbaa !5
  %69 = getelementptr inbounds %"struct.alglib_impl::ae_vector", ptr %68, i32 0, i32 4
  %70 = load ptr, ptr %69, align 8, !tbaa !11
  %71 = getelementptr inbounds double, ptr %70, i64 0
  %72 = getelementptr inbounds %"struct.alglib_impl::ae_vector", ptr %12, i32 0, i32 4
  %73 = load ptr, ptr %72, align 8, !tbaa !11
  %74 = getelementptr inbounds double, ptr %73, i64 0
  %75 = load i64, ptr %9, align 8, !tbaa !9
  %76 = sub nsw i64 %75, 1
  %77 = call noundef i64 @_ZN11alglib_impl8ae_v_lenEll(i64 noundef 0, i64 noundef %76)
  call void @_ZN11alglib_impl9ae_v_moveEPdlPKdll(ptr noundef %71, i64 noundef 1, ptr noundef %74, i64 noundef 1, i64 noundef %77)
  store i64 0, ptr %16, align 8, !tbaa !9
  br label %78

78:                                               ; preds = %98, %67
  %79 = load i64, ptr %16, align 8, !tbaa !9
  %80 = load i64, ptr %9, align 8, !tbaa !9
  %81 = sub nsw i64 %80, 1
  %82 = icmp sle i64 %79, %81
  br i1 %82, label %83, label %101

83:                                               ; preds = %78
  %84 = load ptr, ptr %8, align 8, !tbaa !5
  %85 = getelementptr inbounds %"struct.alglib_impl::ae_vector", ptr %84, i32 0, i32 4
  %86 = load ptr, ptr %85, align 8, !tbaa !11
  %87 = getelementptr inbounds %"struct.alglib_impl::ae_vector", ptr %13, i32 0, i32 4
  %88 = load ptr, ptr %87, align 8, !tbaa !11
  %89 = load i64, ptr %16, align 8, !tbaa !9
  %90 = getelementptr inbounds i64, ptr %88, i64 %89
  %91 = load i64, ptr %90, align 8, !tbaa !9
  %92 = getelementptr inbounds double, ptr %86, i64 %91
  %93 = load double, ptr %92, align 8, !tbaa !14
  %94 = getelementptr inbounds %"struct.alglib_impl::ae_vector", ptr %12, i32 0, i32 4
  %95 = load ptr, ptr %94, align 8, !tbaa !11
  %96 = load i64, ptr %16, align 8, !tbaa !9
  %97 = getelementptr inbounds double, ptr %95, i64 %96
  store double %93, ptr %97, align 8, !tbaa !14
  br label %98

98:                                               ; preds = %83
  %99 = load i64, ptr %16, align 8, !tbaa !9
  %100 = add nsw i64 %99, 1
  store i64 %100, ptr %16, align 8, !tbaa !9
  br label %78, !llvm.loop !17

101:                                              ; preds = %78
  %102 = load ptr, ptr %8, align 8, !tbaa !5
  %103 = getelementptr inbounds %"struct.alglib_impl::ae_vector", ptr %102, i32 0, i32 4
  %104 = load ptr, ptr %103, align 8, !tbaa !11
  %105 = getelementptr inbounds double, ptr %104, i64 0
  %106 = getelementptr inbounds %"struct.alglib_impl::ae_vector", ptr %12, i32 0, i32 4
  %107 = load ptr, ptr %106, align 8, !tbaa !11
  %108 = getelementptr inbounds double, ptr %107, i64 0
  %109 = load i64, ptr %9, align 8, !tbaa !9
  %110 = sub nsw i64 %109, 1
  %111 = call noundef i64 @_ZN11alglib_impl8ae_v_lenEll(i64 noundef 0, i64 noundef %110)
  call void @_ZN11alglib_impl9ae_v_moveEPdlPKdll(ptr noundef %105, i64 noundef 1, ptr noundef %108, i64 noundef 1, i64 noundef %111)
  %112 = load ptr, ptr %10, align 8, !tbaa !5
  call void @_ZN11alglib_impl14ae_frame_leaveEPNS_8ae_stateE(ptr noundef %112)
  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 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
  ret void
}

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

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { nocallback nofree nounwind willreturn memory(argmem: write) }
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 uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nounwind }

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"long", !7, i64 0}
!11 = !{!7, !7, i64 0}
!12 = distinct !{!12, !13}
!13 = !{!"llvm.loop.mustprogress"}
!14 = !{!15, !15, i64 0}
!15 = !{!"double", !7, i64 0}
!16 = distinct !{!16, !13}
!17 = distinct !{!17, !13}


; 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 nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #1

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

declare void @_ZN11alglib_impl20ae_vector_set_lengthEPNS_9ae_vectorElPNS_8ae_stateE(ptr noundef, i64 noundef, 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 i64 @_ZN11alglib_impl8ae_v_lenEll(i64 noundef, i64 noundef) local_unnamed_addr #2

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

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

declare void @_ZN11alglib_impl14ae_frame_leaveEPNS_8ae_stateE(ptr noundef) local_unnamed_addr #2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN11alglib_impl15heapsortdpointsEPNS_9ae_vectorES1_S1_lPNS_8ae_stateE(ptr noundef %0, ptr nocapture noundef readonly %1, ptr nocapture noundef readonly %2, i64 noundef %3, ptr noundef %4) local_unnamed_addr #3 {
  %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
  %9 = alloca %"struct.alglib_impl::ae_vector", align 8
  %10 = alloca %"struct.alglib_impl::ae_vector", align 8
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %6) #4
  call void @llvm.lifetime.start.p0(i64 64, ptr nonnull %7) #4
  call void @llvm.lifetime.start.p0(i64 64, ptr nonnull %8) #4
  call void @llvm.lifetime.start.p0(i64 64, ptr nonnull %9) #4
  call void @llvm.lifetime.start.p0(i64 64, ptr nonnull %10) #4
  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 @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(64) %9, i8 0, i64 64, i1 false)
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(64) %10, i8 0, i64 64, i1 false)
  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 2, ptr noundef %4, 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 %4, i1 noundef zeroext true)
  call void @_ZN11alglib_impl14ae_vector_initEPNS_9ae_vectorEllPNS_8ae_stateEb(ptr noundef nonnull %10, i64 noundef 0, i64 noundef 2, ptr noundef %4, i1 noundef zeroext true)
  call void @_ZN11alglib_impl20ae_vector_set_lengthEPNS_9ae_vectorElPNS_8ae_stateE(ptr noundef nonnull %8, i64 noundef %3, ptr noundef %4)
  call void @_ZN11alglib_impl20ae_vector_set_lengthEPNS_9ae_vectorElPNS_8ae_stateE(ptr noundef nonnull %7, i64 noundef %3, ptr noundef %4)
  %.not.not36 = icmp sgt i64 %3, 0
  br i1 %.not.not36, label %.lr.ph, label %._crit_edge.thread

._crit_edge.thread:                               ; preds = %5
  call void @_ZN11alglib_impl12tagsortfastiEPNS_9ae_vectorES1_S1_S1_lPNS_8ae_stateE(ptr noundef %0, ptr noundef nonnull %8, ptr noundef nonnull %9, ptr noundef nonnull %10, i64 noundef %3, ptr noundef %4)
  br label %._crit_edge42

.lr.ph:                                           ; preds = %5
  %11 = getelementptr inbounds i8, ptr %8, i64 56
  %xtraiter = and i64 %3, 3
  %12 = icmp ult i64 %3, 4
  br i1 %12, label %._crit_edge.unr-lcssa, label %.lr.ph.new

.lr.ph.new:                                       ; preds = %.lr.ph
  %unroll_iter = and i64 %3, 9223372036854775804
  br label %13

13:                                               ; preds = %13, %.lr.ph.new
  %.037 = phi i64 [ 0, %.lr.ph.new ], [ %25, %13 ]
  %niter = phi i64 [ 0, %.lr.ph.new ], [ %niter.next.3, %13 ]
  %14 = load ptr, ptr %11, align 8, !tbaa !5
  %15 = getelementptr inbounds i64, ptr %14, i64 %.037
  store i64 %.037, ptr %15, align 8, !tbaa !8
  %16 = or disjoint i64 %.037, 1
  %17 = load ptr, ptr %11, align 8, !tbaa !5
  %18 = getelementptr inbounds i64, ptr %17, i64 %16
  store i64 %16, ptr %18, align 8, !tbaa !8
  %19 = or disjoint i64 %.037, 2
  %20 = load ptr, ptr %11, align 8, !tbaa !5
  %21 = getelementptr inbounds i64, ptr %20, i64 %19
  store i64 %19, ptr %21, align 8, !tbaa !8
  %22 = or disjoint i64 %.037, 3
  %23 = load ptr, ptr %11, align 8, !tbaa !5
  %24 = getelementptr inbounds i64, ptr %23, i64 %22
  store i64 %22, ptr %24, align 8, !tbaa !8
  %25 = add nuw nsw i64 %.037, 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 %._crit_edge.unr-lcssa, label %13, !llvm.loop !10

._crit_edge.unr-lcssa:                            ; preds = %13, %.lr.ph
  %.037.unr = phi i64 [ 0, %.lr.ph ], [ %25, %13 ]
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br i1 %lcmp.mod.not, label %._crit_edge, label %.epil.preheader

.epil.preheader:                                  ; preds = %._crit_edge.unr-lcssa, %.epil.preheader
  %.037.epil = phi i64 [ %28, %.epil.preheader ], [ %.037.unr, %._crit_edge.unr-lcssa ]
  %epil.iter = phi i64 [ %epil.iter.next, %.epil.preheader ], [ 0, %._crit_edge.unr-lcssa ]
  %26 = load ptr, ptr %11, align 8, !tbaa !5
  %27 = getelementptr inbounds i64, ptr %26, i64 %.037.epil
  store i64 %.037.epil, ptr %27, align 8, !tbaa !8
  %28 = add nuw nsw i64 %.037.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 %._crit_edge, label %.epil.preheader, !llvm.loop !12

._crit_edge:                                      ; preds = %.epil.preheader, %._crit_edge.unr-lcssa
  call void @_ZN11alglib_impl12tagsortfastiEPNS_9ae_vectorES1_S1_S1_lPNS_8ae_stateE(ptr noundef %0, ptr noundef nonnull %8, ptr noundef nonnull %9, ptr noundef nonnull %10, i64 noundef %3, ptr noundef %4)
  br i1 %.not.not36, label %.lr.ph41, label %._crit_edge42

.lr.ph41:                                         ; preds = %._crit_edge
  %29 = getelementptr inbounds i8, ptr %1, i64 56
  %30 = getelementptr inbounds i8, ptr %8, i64 56
  %31 = getelementptr inbounds i8, ptr %7, i64 56
  %xtraiter51 = and i64 %3, 1
  %32 = icmp eq i64 %3, 1
  br i1 %32, label %._crit_edge42.loopexit.unr-lcssa, label %.lr.ph41.new

.lr.ph41.new:                                     ; preds = %.lr.ph41
  %unroll_iter54 = and i64 %3, 9223372036854775806
  br label %33

33:                                               ; preds = %33, %.lr.ph41.new
  %.139 = phi i64 [ 0, %.lr.ph41.new ], [ %51, %33 ]
  %niter55 = phi i64 [ 0, %.lr.ph41.new ], [ %niter55.next.1, %33 ]
  %34 = load ptr, ptr %29, align 8, !tbaa !5
  %35 = load ptr, ptr %30, align 8, !tbaa !5
  %36 = getelementptr inbounds i64, ptr %35, i64 %.139
  %37 = load i64, ptr %36, align 8, !tbaa !8
  %38 = getelementptr inbounds double, ptr %34, i64 %37
  %39 = load double, ptr %38, align 8, !tbaa !14
  %40 = load ptr, ptr %31, align 8, !tbaa !5
  %41 = getelementptr inbounds double, ptr %40, i64 %.139
  store double %39, ptr %41, align 8, !tbaa !14
  %42 = or disjoint i64 %.139, 1
  %43 = load ptr, ptr %29, align 8, !tbaa !5
  %44 = load ptr, ptr %30, align 8, !tbaa !5
  %45 = getelementptr inbounds i64, ptr %44, i64 %42
  %46 = load i64, ptr %45, align 8, !tbaa !8
  %47 = getelementptr inbounds double, ptr %43, i64 %46
  %48 = load double, ptr %47, align 8, !tbaa !14
  %49 = load ptr, ptr %31, align 8, !tbaa !5
  %50 = getelementptr inbounds double, ptr %49, i64 %42
  store double %48, ptr %50, align 8, !tbaa !14
  %51 = add nuw nsw i64 %.139, 2
  %niter55.next.1 = add i64 %niter55, 2
  %niter55.ncmp.1 = icmp eq i64 %niter55.next.1, %unroll_iter54
  br i1 %niter55.ncmp.1, label %._crit_edge42.loopexit.unr-lcssa, label %33, !llvm.loop !16

._crit_edge42.loopexit.unr-lcssa:                 ; preds = %33, %.lr.ph41
  %.139.unr = phi i64 [ 0, %.lr.ph41 ], [ %51, %33 ]
  %lcmp.mod53.not = icmp eq i64 %xtraiter51, 0
  br i1 %lcmp.mod53.not, label %._crit_edge42, label %._crit_edge42.loopexit.epilog-lcssa

._crit_edge42.loopexit.epilog-lcssa:              ; preds = %._crit_edge42.loopexit.unr-lcssa
  %52 = load ptr, ptr %29, align 8, !tbaa !5
  %53 = load ptr, ptr %30, align 8, !tbaa !5
  %54 = getelementptr inbounds i64, ptr %53, i64 %.139.unr
  %55 = load i64, ptr %54, align 8, !tbaa !8
  %56 = getelementptr inbounds double, ptr %52, i64 %55
  %57 = load double, ptr %56, align 8, !tbaa !14
  %58 = load ptr, ptr %31, align 8, !tbaa !5
  %59 = getelementptr inbounds double, ptr %58, i64 %.139.unr
  store double %57, ptr %59, align 8, !tbaa !14
  br label %._crit_edge42

._crit_edge42:                                    ; preds = %._crit_edge42.loopexit.epilog-lcssa, %._crit_edge42.loopexit.unr-lcssa, %._crit_edge.thread, %._crit_edge
  %60 = add nsw i64 %3, -1
  %61 = getelementptr inbounds i8, ptr %1, i64 56
  %62 = load ptr, ptr %61, align 8, !tbaa !5
  %63 = getelementptr inbounds i8, ptr %7, i64 56
  %64 = load ptr, ptr %63, align 8, !tbaa !5
  %65 = call noundef i64 @_ZN11alglib_impl8ae_v_lenEll(i64 noundef 0, i64 noundef %60)
  call void @_ZN11alglib_impl9ae_v_moveEPdlPKdll(ptr noundef %62, i64 noundef 1, ptr noundef %64, i64 noundef 1, i64 noundef %65)
  br i1 %.not.not36, label %.lr.ph46, label %._crit_edge47

.lr.ph46:                                         ; preds = %._crit_edge42
  %66 = getelementptr inbounds i8, ptr %2, i64 56
  %67 = getelementptr inbounds i8, ptr %8, i64 56
  %xtraiter57 = and i64 %3, 1
  %68 = icmp eq i64 %3, 1
  br i1 %68, label %._crit_edge47.loopexit.unr-lcssa, label %.lr.ph46.new

.lr.ph46.new:                                     ; preds = %.lr.ph46
  %unroll_iter60 = and i64 %3, 9223372036854775806
  br label %69

69:                                               ; preds = %69, %.lr.ph46.new
  %.244 = phi i64 [ 0, %.lr.ph46.new ], [ %87, %69 ]
  %niter61 = phi i64 [ 0, %.lr.ph46.new ], [ %niter61.next.1, %69 ]
  %70 = load ptr, ptr %66, align 8, !tbaa !5
  %71 = load ptr, ptr %67, align 8, !tbaa !5
  %72 = getelementptr inbounds i64, ptr %71, i64 %.244
  %73 = load i64, ptr %72, align 8, !tbaa !8
  %74 = getelementptr inbounds double, ptr %70, i64 %73
  %75 = load double, ptr %74, align 8, !tbaa !14
  %76 = load ptr, ptr %63, align 8, !tbaa !5
  %77 = getelementptr inbounds double, ptr %76, i64 %.244
  store double %75, ptr %77, align 8, !tbaa !14
  %78 = or disjoint i64 %.244, 1
  %79 = load ptr, ptr %66, align 8, !tbaa !5
  %80 = load ptr, ptr %67, align 8, !tbaa !5
  %81 = getelementptr inbounds i64, ptr %80, i64 %78
  %82 = load i64, ptr %81, align 8, !tbaa !8
  %83 = getelementptr inbounds double, ptr %79, i64 %82
  %84 = load double, ptr %83, align 8, !tbaa !14
  %85 = load ptr, ptr %63, align 8, !tbaa !5
  %86 = getelementptr inbounds double, ptr %85, i64 %78
  store double %84, ptr %86, align 8, !tbaa !14
  %87 = add nuw nsw i64 %.244, 2
  %niter61.next.1 = add i64 %niter61, 2
  %niter61.ncmp.1 = icmp eq i64 %niter61.next.1, %unroll_iter60
  br i1 %niter61.ncmp.1, label %._crit_edge47.loopexit.unr-lcssa, label %69, !llvm.loop !17

._crit_edge47.loopexit.unr-lcssa:                 ; preds = %69, %.lr.ph46
  %.244.unr = phi i64 [ 0, %.lr.ph46 ], [ %87, %69 ]
  %lcmp.mod59.not = icmp eq i64 %xtraiter57, 0
  br i1 %lcmp.mod59.not, label %._crit_edge47, label %._crit_edge47.loopexit.epilog-lcssa

._crit_edge47.loopexit.epilog-lcssa:              ; preds = %._crit_edge47.loopexit.unr-lcssa
  %88 = load ptr, ptr %66, align 8, !tbaa !5
  %89 = load ptr, ptr %67, align 8, !tbaa !5
  %90 = getelementptr inbounds i64, ptr %89, i64 %.244.unr
  %91 = load i64, ptr %90, align 8, !tbaa !8
  %92 = getelementptr inbounds double, ptr %88, i64 %91
  %93 = load double, ptr %92, align 8, !tbaa !14
  %94 = load ptr, ptr %63, align 8, !tbaa !5
  %95 = getelementptr inbounds double, ptr %94, i64 %.244.unr
  store double %93, ptr %95, align 8, !tbaa !14
  br label %._crit_edge47

._crit_edge47:                                    ; preds = %._crit_edge47.loopexit.epilog-lcssa, %._crit_edge47.loopexit.unr-lcssa, %._crit_edge42
  %96 = getelementptr inbounds i8, ptr %2, i64 56
  %97 = load ptr, ptr %96, align 8, !tbaa !5
  %98 = load ptr, ptr %63, align 8, !tbaa !5
  %99 = call noundef i64 @_ZN11alglib_impl8ae_v_lenEll(i64 noundef 0, i64 noundef %60)
  call void @_ZN11alglib_impl9ae_v_moveEPdlPKdll(ptr noundef %97, i64 noundef 1, ptr noundef %98, i64 noundef 1, i64 noundef %99)
  call void @_ZN11alglib_impl14ae_frame_leaveEPNS_8ae_stateE(ptr noundef %4)
  call void @llvm.lifetime.end.p0(i64 64, ptr nonnull %10) #4
  call void @llvm.lifetime.end.p0(i64 64, ptr nonnull %9) #4
  call void @llvm.lifetime.end.p0(i64 64, ptr nonnull %8) #4
  call void @llvm.lifetime.end.p0(i64 64, ptr nonnull %7) #4
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %6) #4
  ret void
}

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

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
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 uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nounwind }

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C++ TBAA"}
!8 = !{!9, !9, i64 0}
!9 = !{!"long", !6, i64 0}
!10 = distinct !{!10, !11}
!11 = !{!"llvm.loop.mustprogress"}
!12 = distinct !{!12, !13}
!13 = !{!"llvm.loop.unroll.disable"}
!14 = !{!15, !15, i64 0}
!15 = !{!"double", !6, i64 0}
!16 = distinct !{!16, !11}
!17 = distinct !{!17, !11}


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