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

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

@.str.50 = external hidden unnamed_addr constant [37 x i8], align 1
@.str.51 = external hidden unnamed_addr constant [37 x i8], align 1
@.str.52 = external hidden unnamed_addr constant [58 x i8], align 1
@.str.53 = external hidden unnamed_addr constant [58 x i8], align 1

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

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

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

; Function Attrs: mustprogress uwtable
define dso_local noundef i64 @_ZN11alglib_impl16kdtreetsqueryboxEPNS_6kdtreeEPNS_19kdtreerequestbufferEPNS_9ae_vectorES5_PNS_8ae_stateE(ptr noundef %0, ptr noundef %1, ptr noundef %2, ptr noundef %3, ptr noundef %4) #2 {
  %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 ptr, align 8
  %12 = alloca i64, align 8
  %13 = alloca i64, align 8
  %14 = alloca i32, align 4
  store ptr %0, ptr %7, align 8, !tbaa !5
  store ptr %1, ptr %8, align 8, !tbaa !5
  store ptr %2, ptr %9, align 8, !tbaa !5
  store ptr %3, ptr %10, align 8, !tbaa !5
  store ptr %4, ptr %11, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #3
  %15 = load ptr, ptr %9, align 8, !tbaa !5
  %16 = getelementptr inbounds %"struct.alglib_impl::ae_vector", ptr %15, i32 0, i32 0
  %17 = load i64, ptr %16, align 8, !tbaa !9
  %18 = load ptr, ptr %7, align 8, !tbaa !5
  %19 = getelementptr inbounds %"struct.alglib_impl::kdtree", ptr %18, i32 0, i32 1
  %20 = load i64, ptr %19, align 8, !tbaa !14
  %21 = icmp sge i64 %17, %20
  %22 = load ptr, ptr %11, align 8, !tbaa !5
  call void @_ZN11alglib_impl9ae_assertEbPKcPNS_8ae_stateE(i1 noundef zeroext %21, ptr noundef @.str.50, ptr noundef %22)
  %23 = load ptr, ptr %10, align 8, !tbaa !5
  %24 = getelementptr inbounds %"struct.alglib_impl::ae_vector", ptr %23, i32 0, i32 0
  %25 = load i64, ptr %24, align 8, !tbaa !9
  %26 = load ptr, ptr %7, align 8, !tbaa !5
  %27 = getelementptr inbounds %"struct.alglib_impl::kdtree", ptr %26, i32 0, i32 1
  %28 = load i64, ptr %27, align 8, !tbaa !14
  %29 = icmp sge i64 %25, %28
  %30 = load ptr, ptr %11, align 8, !tbaa !5
  call void @_ZN11alglib_impl9ae_assertEbPKcPNS_8ae_stateE(i1 noundef zeroext %29, ptr noundef @.str.51, ptr noundef %30)
  %31 = load ptr, ptr %9, align 8, !tbaa !5
  %32 = load ptr, ptr %7, align 8, !tbaa !5
  %33 = getelementptr inbounds %"struct.alglib_impl::kdtree", ptr %32, i32 0, i32 1
  %34 = load i64, ptr %33, align 8, !tbaa !14
  %35 = load ptr, ptr %11, align 8, !tbaa !5
  %36 = call noundef zeroext i1 @_ZN11alglib_impl14isfinitevectorEPNS_9ae_vectorElPNS_8ae_stateE(ptr noundef %31, i64 noundef %34, ptr noundef %35)
  %37 = load ptr, ptr %11, align 8, !tbaa !5
  call void @_ZN11alglib_impl9ae_assertEbPKcPNS_8ae_stateE(i1 noundef zeroext %36, ptr noundef @.str.52, ptr noundef %37)
  %38 = load ptr, ptr %10, align 8, !tbaa !5
  %39 = load ptr, ptr %7, align 8, !tbaa !5
  %40 = getelementptr inbounds %"struct.alglib_impl::kdtree", ptr %39, i32 0, i32 1
  %41 = load i64, ptr %40, align 8, !tbaa !14
  %42 = load ptr, ptr %11, align 8, !tbaa !5
  %43 = call noundef zeroext i1 @_ZN11alglib_impl14isfinitevectorEPNS_9ae_vectorElPNS_8ae_stateE(ptr noundef %38, i64 noundef %41, ptr noundef %42)
  %44 = load ptr, ptr %11, align 8, !tbaa !5
  call void @_ZN11alglib_impl9ae_assertEbPKcPNS_8ae_stateE(i1 noundef zeroext %43, ptr noundef @.str.53, ptr noundef %44)
  %45 = load ptr, ptr %7, align 8, !tbaa !5
  %46 = load ptr, ptr %8, align 8, !tbaa !5
  %47 = load ptr, ptr %11, align 8, !tbaa !5
  call void @_ZN11alglib_implL45nearestneighbor_checkrequestbufferconsistencyEPNS_6kdtreeEPNS_19kdtreerequestbufferEPNS_8ae_stateE(ptr noundef %45, ptr noundef %46, ptr noundef %47)
  store i64 0, ptr %12, align 8, !tbaa !19
  br label %48

48:                                               ; preds = %74, %5
  %49 = load i64, ptr %12, align 8, !tbaa !19
  %50 = load ptr, ptr %7, align 8, !tbaa !5
  %51 = getelementptr inbounds %"struct.alglib_impl::kdtree", ptr %50, i32 0, i32 1
  %52 = load i64, ptr %51, align 8, !tbaa !14
  %53 = sub nsw i64 %52, 1
  %54 = icmp sle i64 %49, %53
  br i1 %54, label %55, label %77

55:                                               ; preds = %48
  %56 = load ptr, ptr %9, align 8, !tbaa !5
  %57 = getelementptr inbounds %"struct.alglib_impl::ae_vector", ptr %56, i32 0, i32 4
  %58 = load ptr, ptr %57, align 8, !tbaa !20
  %59 = load i64, ptr %12, align 8, !tbaa !19
  %60 = getelementptr inbounds double, ptr %58, i64 %59
  %61 = load double, ptr %60, align 8, !tbaa !21
  %62 = load ptr, ptr %10, align 8, !tbaa !5
  %63 = getelementptr inbounds %"struct.alglib_impl::ae_vector", ptr %62, i32 0, i32 4
  %64 = load ptr, ptr %63, align 8, !tbaa !20
  %65 = load i64, ptr %12, align 8, !tbaa !19
  %66 = getelementptr inbounds double, ptr %64, i64 %65
  %67 = load double, ptr %66, align 8, !tbaa !21
  %68 = call noundef zeroext i1 @_ZN11alglib_impl13ae_fp_greaterEdd(double noundef %61, double noundef %67)
  br i1 %68, label %69, label %73

69:                                               ; preds = %55
  %70 = load ptr, ptr %8, align 8, !tbaa !5
  %71 = getelementptr inbounds %"struct.alglib_impl::kdtreerequestbuffer", ptr %70, i32 0, i32 7
  store i64 0, ptr %71, align 8, !tbaa !22
  store i64 0, ptr %13, align 8, !tbaa !19
  %72 = load i64, ptr %13, align 8, !tbaa !19
  store i64 %72, ptr %6, align 8
  store i32 1, ptr %14, align 4
  br label %147

73:                                               ; preds = %55
  br label %74

74:                                               ; preds = %73
  %75 = load i64, ptr %12, align 8, !tbaa !19
  %76 = add nsw i64 %75, 1
  store i64 %76, ptr %12, align 8, !tbaa !19
  br label %48, !llvm.loop !23

77:                                               ; preds = %48
  store i64 0, ptr %12, align 8, !tbaa !19
  br label %78

78:                                               ; preds = %134, %77
  %79 = load i64, ptr %12, align 8, !tbaa !19
  %80 = load ptr, ptr %7, align 8, !tbaa !5
  %81 = getelementptr inbounds %"struct.alglib_impl::kdtree", ptr %80, i32 0, i32 1
  %82 = load i64, ptr %81, align 8, !tbaa !14
  %83 = sub nsw i64 %82, 1
  %84 = icmp sle i64 %79, %83
  br i1 %84, label %85, label %137

85:                                               ; preds = %78
  %86 = load ptr, ptr %9, align 8, !tbaa !5
  %87 = getelementptr inbounds %"struct.alglib_impl::ae_vector", ptr %86, i32 0, i32 4
  %88 = load ptr, ptr %87, align 8, !tbaa !20
  %89 = load i64, ptr %12, align 8, !tbaa !19
  %90 = getelementptr inbounds double, ptr %88, i64 %89
  %91 = load double, ptr %90, align 8, !tbaa !21
  %92 = load ptr, ptr %8, align 8, !tbaa !5
  %93 = getelementptr inbounds %"struct.alglib_impl::kdtreerequestbuffer", ptr %92, i32 0, i32 1
  %94 = getelementptr inbounds %"struct.alglib_impl::ae_vector", ptr %93, i32 0, i32 4
  %95 = load ptr, ptr %94, align 8, !tbaa !20
  %96 = load i64, ptr %12, align 8, !tbaa !19
  %97 = getelementptr inbounds double, ptr %95, i64 %96
  store double %91, ptr %97, align 8, !tbaa !21
  %98 = load ptr, ptr %10, align 8, !tbaa !5
  %99 = getelementptr inbounds %"struct.alglib_impl::ae_vector", ptr %98, i32 0, i32 4
  %100 = load ptr, ptr %99, align 8, !tbaa !20
  %101 = load i64, ptr %12, align 8, !tbaa !19
  %102 = getelementptr inbounds double, ptr %100, i64 %101
  %103 = load double, ptr %102, align 8, !tbaa !21
  %104 = load ptr, ptr %8, align 8, !tbaa !5
  %105 = getelementptr inbounds %"struct.alglib_impl::kdtreerequestbuffer", ptr %104, i32 0, i32 2
  %106 = getelementptr inbounds %"struct.alglib_impl::ae_vector", ptr %105, i32 0, i32 4
  %107 = load ptr, ptr %106, align 8, !tbaa !20
  %108 = load i64, ptr %12, align 8, !tbaa !19
  %109 = getelementptr inbounds double, ptr %107, i64 %108
  store double %103, ptr %109, align 8, !tbaa !21
  %110 = load ptr, ptr %9, align 8, !tbaa !5
  %111 = getelementptr inbounds %"struct.alglib_impl::ae_vector", ptr %110, i32 0, i32 4
  %112 = load ptr, ptr %111, align 8, !tbaa !20
  %113 = load i64, ptr %12, align 8, !tbaa !19
  %114 = getelementptr inbounds double, ptr %112, i64 %113
  %115 = load double, ptr %114, align 8, !tbaa !21
  %116 = load ptr, ptr %8, align 8, !tbaa !5
  %117 = getelementptr inbounds %"struct.alglib_impl::kdtreerequestbuffer", ptr %116, i32 0, i32 11
  %118 = getelementptr inbounds %"struct.alglib_impl::ae_vector", ptr %117, i32 0, i32 4
  %119 = load ptr, ptr %118, align 8, !tbaa !20
  %120 = load i64, ptr %12, align 8, !tbaa !19
  %121 = getelementptr inbounds double, ptr %119, i64 %120
  store double %115, ptr %121, align 8, !tbaa !21
  %122 = load ptr, ptr %10, align 8, !tbaa !5
  %123 = getelementptr inbounds %"struct.alglib_impl::ae_vector", ptr %122, i32 0, i32 4
  %124 = load ptr, ptr %123, align 8, !tbaa !20
  %125 = load i64, ptr %12, align 8, !tbaa !19
  %126 = getelementptr inbounds double, ptr %124, i64 %125
  %127 = load double, ptr %126, align 8, !tbaa !21
  %128 = load ptr, ptr %8, align 8, !tbaa !5
  %129 = getelementptr inbounds %"struct.alglib_impl::kdtreerequestbuffer", ptr %128, i32 0, i32 12
  %130 = getelementptr inbounds %"struct.alglib_impl::ae_vector", ptr %129, i32 0, i32 4
  %131 = load ptr, ptr %130, align 8, !tbaa !20
  %132 = load i64, ptr %12, align 8, !tbaa !19
  %133 = getelementptr inbounds double, ptr %131, i64 %132
  store double %127, ptr %133, align 8, !tbaa !21
  br label %134

134:                                              ; preds = %85
  %135 = load i64, ptr %12, align 8, !tbaa !19
  %136 = add nsw i64 %135, 1
  store i64 %136, ptr %12, align 8, !tbaa !19
  br label %78, !llvm.loop !25

137:                                              ; preds = %78
  %138 = load ptr, ptr %8, align 8, !tbaa !5
  %139 = getelementptr inbounds %"struct.alglib_impl::kdtreerequestbuffer", ptr %138, i32 0, i32 7
  store i64 0, ptr %139, align 8, !tbaa !22
  %140 = load ptr, ptr %7, align 8, !tbaa !5
  %141 = load ptr, ptr %8, align 8, !tbaa !5
  %142 = load ptr, ptr %11, align 8, !tbaa !5
  call void @_ZN11alglib_implL33nearestneighbor_kdtreequeryboxrecEPNS_6kdtreeEPNS_19kdtreerequestbufferElPNS_8ae_stateE(ptr noundef %140, ptr noundef %141, i64 noundef 0, ptr noundef %142)
  %143 = load ptr, ptr %8, align 8, !tbaa !5
  %144 = getelementptr inbounds %"struct.alglib_impl::kdtreerequestbuffer", ptr %143, i32 0, i32 7
  %145 = load i64, ptr %144, align 8, !tbaa !22
  store i64 %145, ptr %13, align 8, !tbaa !19
  %146 = load i64, ptr %13, align 8, !tbaa !19
  store i64 %146, ptr %6, align 8
  store i32 1, ptr %14, align 4
  br label %147

147:                                              ; preds = %137, %69
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #3
  %148 = load i64, ptr %6, align 8
  ret i64 %148
}

declare noundef zeroext i1 @_ZN11alglib_impl14isfinitevectorEPNS_9ae_vectorElPNS_8ae_stateE(ptr noundef, i64 noundef, ptr noundef) #1

declare noundef zeroext i1 @_ZN11alglib_impl13ae_fp_greaterEdd(double noundef, double noundef) #1

; Function Attrs: mustprogress uwtable
declare hidden void @_ZN11alglib_implL45nearestneighbor_checkrequestbufferconsistencyEPNS_6kdtreeEPNS_19kdtreerequestbufferEPNS_8ae_stateE(ptr noundef, ptr noundef, ptr noundef) #2

; Function Attrs: mustprogress uwtable
declare hidden void @_ZN11alglib_implL33nearestneighbor_kdtreequeryboxrecEPNS_6kdtreeEPNS_19kdtreerequestbufferElPNS_8ae_stateE(ptr noundef, ptr noundef, i64 noundef, ptr noundef) #2

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { "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 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 #3 = { 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, !11, i64 0}
!10 = !{!"_ZTSN11alglib_impl9ae_vectorE", !11, i64 0, !11, i64 8, !12, i64 16, !13, i64 24, !7, i64 56}
!11 = !{!"long", !7, i64 0}
!12 = !{!"bool", !7, i64 0}
!13 = !{!"_ZTSN11alglib_impl12ae_dyn_blockE", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24}
!14 = !{!15, !11, i64 8}
!15 = !{!"_ZTSN11alglib_impl6kdtreeE", !11, i64 0, !11, i64 8, !11, i64 16, !11, i64 24, !16, i64 32, !10, i64 112, !10, i64 176, !10, i64 240, !10, i64 304, !10, i64 368, !17, i64 432, !11, i64 992}
!16 = !{!"_ZTSN11alglib_impl9ae_matrixE", !11, i64 0, !11, i64 8, !11, i64 16, !11, i64 24, !12, i64 32, !13, i64 40, !7, i64 72}
!17 = !{!"_ZTSN11alglib_impl19kdtreerequestbufferE", !10, i64 0, !10, i64 64, !10, i64 128, !11, i64 192, !18, i64 200, !12, i64 208, !18, i64 216, !11, i64 224, !10, i64 232, !10, i64 296, !10, i64 360, !10, i64 424, !10, i64 488, !18, i64 552}
!18 = !{!"double", !7, i64 0}
!19 = !{!11, !11, i64 0}
!20 = !{!7, !7, i64 0}
!21 = !{!18, !18, i64 0}
!22 = !{!17, !11, i64 224}
!23 = distinct !{!23, !24}
!24 = !{!"llvm.loop.mustprogress"}
!25 = distinct !{!25, !24}


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

@.str.50 = external hidden unnamed_addr constant [37 x i8], align 1
@.str.51 = external hidden unnamed_addr constant [37 x i8], align 1
@.str.52 = external hidden unnamed_addr constant [58 x i8], align 1
@.str.53 = external hidden unnamed_addr constant [58 x i8], align 1

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

; Function Attrs: mustprogress uwtable
define dso_local noundef i64 @_ZN11alglib_impl16kdtreetsqueryboxEPNS_6kdtreeEPNS_19kdtreerequestbufferEPNS_9ae_vectorES5_PNS_8ae_stateE(ptr noundef %0, ptr noundef %1, ptr noundef %2, ptr noundef %3, ptr noundef %4) local_unnamed_addr #1 {
  %6 = load i64, ptr %2, align 8, !tbaa !5
  %7 = getelementptr inbounds i8, ptr %0, i64 8
  %8 = load i64, ptr %7, align 8, !tbaa !13
  %9 = icmp sge i64 %6, %8
  tail call void @_ZN11alglib_impl9ae_assertEbPKcPNS_8ae_stateE(i1 noundef zeroext %9, ptr noundef nonnull @.str.50, ptr noundef %4)
  %10 = load i64, ptr %3, align 8, !tbaa !5
  %11 = load i64, ptr %7, align 8, !tbaa !13
  %12 = icmp sge i64 %10, %11
  tail call void @_ZN11alglib_impl9ae_assertEbPKcPNS_8ae_stateE(i1 noundef zeroext %12, ptr noundef nonnull @.str.51, ptr noundef %4)
  %13 = load i64, ptr %7, align 8, !tbaa !13
  %14 = tail call noundef zeroext i1 @_ZN11alglib_impl14isfinitevectorEPNS_9ae_vectorElPNS_8ae_stateE(ptr noundef nonnull %2, i64 noundef %13, ptr noundef %4)
  tail call void @_ZN11alglib_impl9ae_assertEbPKcPNS_8ae_stateE(i1 noundef zeroext %14, ptr noundef nonnull @.str.52, ptr noundef %4)
  %15 = load i64, ptr %7, align 8, !tbaa !13
  %16 = tail call noundef zeroext i1 @_ZN11alglib_impl14isfinitevectorEPNS_9ae_vectorElPNS_8ae_stateE(ptr noundef nonnull %3, i64 noundef %15, ptr noundef %4)
  tail call void @_ZN11alglib_impl9ae_assertEbPKcPNS_8ae_stateE(i1 noundef zeroext %16, ptr noundef nonnull @.str.53, ptr noundef %4)
  tail call void @_ZN11alglib_implL45nearestneighbor_checkrequestbufferconsistencyEPNS_6kdtreeEPNS_19kdtreerequestbufferEPNS_8ae_stateE(ptr noundef %0, ptr noundef %1, ptr noundef %4)
  %17 = load i64, ptr %7, align 8, !tbaa !13
  %.not.not54 = icmp sgt i64 %17, 0
  br i1 %.not.not54, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %5
  %18 = getelementptr inbounds i8, ptr %2, i64 56
  %19 = getelementptr inbounds i8, ptr %3, i64 56
  br label %29

20:                                               ; preds = %29
  %21 = add nuw nsw i64 %.055, 1
  %22 = load i64, ptr %7, align 8, !tbaa !13
  %.not.not = icmp slt i64 %21, %22
  br i1 %.not.not, label %29, label %.preheader, !llvm.loop !18

.preheader:                                       ; preds = %20
  %.not.not5256 = icmp sgt i64 %22, 0
  br i1 %.not.not5256, label %.lr.ph58, label %._crit_edge

.lr.ph58:                                         ; preds = %.preheader
  %23 = getelementptr inbounds i8, ptr %2, i64 56
  %24 = getelementptr inbounds i8, ptr %1, i64 120
  %25 = getelementptr inbounds i8, ptr %3, i64 56
  %26 = getelementptr inbounds i8, ptr %1, i64 184
  %27 = getelementptr inbounds i8, ptr %1, i64 480
  %28 = getelementptr inbounds i8, ptr %1, i64 544
  br label %39

29:                                               ; preds = %.lr.ph, %20
  %.055 = phi i64 [ 0, %.lr.ph ], [ %21, %20 ]
  %30 = load ptr, ptr %18, align 8, !tbaa !20
  %31 = getelementptr inbounds double, ptr %30, i64 %.055
  %32 = load double, ptr %31, align 8, !tbaa !21
  %33 = load ptr, ptr %19, align 8, !tbaa !20
  %34 = getelementptr inbounds double, ptr %33, i64 %.055
  %35 = load double, ptr %34, align 8, !tbaa !21
  %36 = tail call noundef zeroext i1 @_ZN11alglib_impl13ae_fp_greaterEdd(double noundef %32, double noundef %35)
  br i1 %36, label %37, label %20

37:                                               ; preds = %29
  %38 = getelementptr inbounds i8, ptr %1, i64 224
  store i64 0, ptr %38, align 8, !tbaa !22
  br label %63

39:                                               ; preds = %.lr.ph58, %39
  %.157 = phi i64 [ 0, %.lr.ph58 ], [ %60, %39 ]
  %40 = load ptr, ptr %23, align 8, !tbaa !20
  %41 = getelementptr inbounds double, ptr %40, i64 %.157
  %42 = load double, ptr %41, align 8, !tbaa !21
  %43 = load ptr, ptr %24, align 8, !tbaa !20
  %44 = getelementptr inbounds double, ptr %43, i64 %.157
  store double %42, ptr %44, align 8, !tbaa !21
  %45 = load ptr, ptr %25, align 8, !tbaa !20
  %46 = getelementptr inbounds double, ptr %45, i64 %.157
  %47 = load double, ptr %46, align 8, !tbaa !21
  %48 = load ptr, ptr %26, align 8, !tbaa !20
  %49 = getelementptr inbounds double, ptr %48, i64 %.157
  store double %47, ptr %49, align 8, !tbaa !21
  %50 = load ptr, ptr %23, align 8, !tbaa !20
  %51 = getelementptr inbounds double, ptr %50, i64 %.157
  %52 = load double, ptr %51, align 8, !tbaa !21
  %53 = load ptr, ptr %27, align 8, !tbaa !20
  %54 = getelementptr inbounds double, ptr %53, i64 %.157
  store double %52, ptr %54, align 8, !tbaa !21
  %55 = load ptr, ptr %25, align 8, !tbaa !20
  %56 = getelementptr inbounds double, ptr %55, i64 %.157
  %57 = load double, ptr %56, align 8, !tbaa !21
  %58 = load ptr, ptr %28, align 8, !tbaa !20
  %59 = getelementptr inbounds double, ptr %58, i64 %.157
  store double %57, ptr %59, align 8, !tbaa !21
  %60 = add nuw nsw i64 %.157, 1
  %exitcond.not = icmp eq i64 %60, %22
  br i1 %exitcond.not, label %._crit_edge, label %39, !llvm.loop !23

._crit_edge:                                      ; preds = %39, %5, %.preheader
  %61 = getelementptr inbounds i8, ptr %1, i64 224
  store i64 0, ptr %61, align 8, !tbaa !22
  tail call void @_ZN11alglib_implL33nearestneighbor_kdtreequeryboxrecEPNS_6kdtreeEPNS_19kdtreerequestbufferElPNS_8ae_stateE(ptr noundef %0, ptr noundef %1, i64 noundef 0, ptr noundef %4)
  %62 = load i64, ptr %61, align 8, !tbaa !22
  br label %63

63:                                               ; preds = %._crit_edge, %37
  %.051 = phi i64 [ 0, %37 ], [ %62, %._crit_edge ]
  ret i64 %.051
}

declare noundef zeroext i1 @_ZN11alglib_impl14isfinitevectorEPNS_9ae_vectorElPNS_8ae_stateE(ptr noundef, i64 noundef, ptr noundef) local_unnamed_addr #0

declare noundef zeroext i1 @_ZN11alglib_impl13ae_fp_greaterEdd(double noundef, double noundef) local_unnamed_addr #0

; Function Attrs: mustprogress uwtable
declare hidden void @_ZN11alglib_implL45nearestneighbor_checkrequestbufferconsistencyEPNS_6kdtreeEPNS_19kdtreerequestbufferEPNS_8ae_stateE(ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #1

; Function Attrs: mustprogress uwtable
declare hidden void @_ZN11alglib_implL33nearestneighbor_kdtreequeryboxrecEPNS_6kdtreeEPNS_19kdtreerequestbufferElPNS_8ae_stateE(ptr noundef, ptr noundef, i64 noundef, ptr noundef) local_unnamed_addr #1

attributes #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 #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" }

!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, !7, i64 0}
!6 = !{!"_ZTSN11alglib_impl9ae_vectorE", !7, i64 0, !7, i64 8, !10, i64 16, !11, i64 24, !8, i64 56}
!7 = !{!"long", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!"bool", !8, i64 0}
!11 = !{!"_ZTSN11alglib_impl12ae_dyn_blockE", !12, i64 0, !12, i64 8, !12, i64 16, !12, i64 24}
!12 = !{!"any pointer", !8, i64 0}
!13 = !{!14, !7, i64 8}
!14 = !{!"_ZTSN11alglib_impl6kdtreeE", !7, i64 0, !7, i64 8, !7, i64 16, !7, i64 24, !15, i64 32, !6, i64 112, !6, i64 176, !6, i64 240, !6, i64 304, !6, i64 368, !16, i64 432, !7, i64 992}
!15 = !{!"_ZTSN11alglib_impl9ae_matrixE", !7, i64 0, !7, i64 8, !7, i64 16, !7, i64 24, !10, i64 32, !11, i64 40, !8, i64 72}
!16 = !{!"_ZTSN11alglib_impl19kdtreerequestbufferE", !6, i64 0, !6, i64 64, !6, i64 128, !7, i64 192, !17, i64 200, !10, i64 208, !17, i64 216, !7, i64 224, !6, i64 232, !6, i64 296, !6, i64 360, !6, i64 424, !6, i64 488, !17, i64 552}
!17 = !{!"double", !8, i64 0}
!18 = distinct !{!18, !19}
!19 = !{!"llvm.loop.mustprogress"}
!20 = !{!8, !8, i64 0}
!21 = !{!17, !17, i64 0}
!22 = !{!16, !7, i64 224}
!23 = distinct !{!23, !19}


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