; 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_matrix" = type { i64, i64, i64, i64, i8, %"struct.alglib_impl::ae_dyn_block", %union.anon.1 }
%"struct.alglib_impl::ae_dyn_block" = type { ptr, ptr, ptr, ptr }
%union.anon.1 = 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_vector" = type { i64, i64, i8, %"struct.alglib_impl::ae_dyn_block", %union.anon.0 }
%union.anon.0 = 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.21 = external hidden unnamed_addr constant [23 x i8], align 1
@.str.22 = external hidden unnamed_addr constant [24 x i8], align 1
@.str.23 = external hidden unnamed_addr constant [24 x i8], align 1
@.str.24 = external hidden unnamed_addr constant [38 x i8], align 1
@.str.25 = external hidden unnamed_addr constant [29 x i8], align 1
@.str.26 = external hidden unnamed_addr constant [33 x i8], align 1
@.str.27 = external hidden unnamed_addr constant [54 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 void @_ZN11alglib_impl17kdtreebuildtaggedEPNS_9ae_matrixEPNS_9ae_vectorEllllPNS_6kdtreeEPNS_8ae_stateE(ptr noundef %0, ptr noundef %1, i64 noundef %2, i64 noundef %3, i64 noundef %4, i64 noundef %5, ptr noundef %6, ptr noundef %7) #2 {
  %9 = alloca ptr, align 8
  %10 = alloca ptr, align 8
  %11 = alloca i64, align 8
  %12 = alloca i64, align 8
  %13 = alloca i64, align 8
  %14 = alloca i64, align 8
  %15 = alloca ptr, align 8
  %16 = alloca ptr, align 8
  %17 = alloca i64, align 8
  %18 = alloca i64, align 8
  %19 = alloca i64, align 8
  %20 = alloca i64, align 8
  %21 = alloca i32, align 4
  store ptr %0, ptr %9, align 8, !tbaa !5
  store ptr %1, ptr %10, align 8, !tbaa !5
  store i64 %2, ptr %11, align 8, !tbaa !9
  store i64 %3, ptr %12, align 8, !tbaa !9
  store i64 %4, ptr %13, align 8, !tbaa !9
  store i64 %5, ptr %14, align 8, !tbaa !9
  store ptr %6, ptr %15, align 8, !tbaa !5
  store ptr %7, ptr %16, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #3
  %22 = load ptr, ptr %15, align 8, !tbaa !5
  call void @_ZN11alglib_impl13_kdtree_clearEPv(ptr noundef %22)
  %23 = load i64, ptr %11, align 8, !tbaa !9
  %24 = icmp sge i64 %23, 0
  %25 = load ptr, ptr %16, align 8, !tbaa !5
  call void @_ZN11alglib_impl9ae_assertEbPKcPNS_8ae_stateE(i1 noundef zeroext %24, ptr noundef @.str.21, ptr noundef %25)
  %26 = load i64, ptr %12, align 8, !tbaa !9
  %27 = icmp sge i64 %26, 1
  %28 = load ptr, ptr %16, align 8, !tbaa !5
  call void @_ZN11alglib_impl9ae_assertEbPKcPNS_8ae_stateE(i1 noundef zeroext %27, ptr noundef @.str.22, ptr noundef %28)
  %29 = load i64, ptr %13, align 8, !tbaa !9
  %30 = icmp sge i64 %29, 0
  %31 = load ptr, ptr %16, align 8, !tbaa !5
  call void @_ZN11alglib_impl9ae_assertEbPKcPNS_8ae_stateE(i1 noundef zeroext %30, ptr noundef @.str.23, ptr noundef %31)
  %32 = load i64, ptr %14, align 8, !tbaa !9
  %33 = icmp sge i64 %32, 0
  br i1 %33, label %34, label %37

34:                                               ; preds = %8
  %35 = load i64, ptr %14, align 8, !tbaa !9
  %36 = icmp sle i64 %35, 2
  br label %37

37:                                               ; preds = %34, %8
  %38 = phi i1 [ false, %8 ], [ %36, %34 ]
  %39 = load ptr, ptr %16, align 8, !tbaa !5
  call void @_ZN11alglib_impl9ae_assertEbPKcPNS_8ae_stateE(i1 noundef zeroext %38, ptr noundef @.str.24, ptr noundef %39)
  %40 = load ptr, ptr %9, align 8, !tbaa !5
  %41 = getelementptr inbounds %"struct.alglib_impl::ae_matrix", ptr %40, i32 0, i32 0
  %42 = load i64, ptr %41, align 8, !tbaa !11
  %43 = load i64, ptr %11, align 8, !tbaa !9
  %44 = icmp sge i64 %42, %43
  %45 = load ptr, ptr %16, align 8, !tbaa !5
  call void @_ZN11alglib_impl9ae_assertEbPKcPNS_8ae_stateE(i1 noundef zeroext %44, ptr noundef @.str.25, ptr noundef %45)
  %46 = load ptr, ptr %9, align 8, !tbaa !5
  %47 = getelementptr inbounds %"struct.alglib_impl::ae_matrix", ptr %46, i32 0, i32 1
  %48 = load i64, ptr %47, align 8, !tbaa !15
  %49 = load i64, ptr %12, align 8, !tbaa !9
  %50 = load i64, ptr %13, align 8, !tbaa !9
  %51 = add nsw i64 %49, %50
  %52 = icmp sge i64 %48, %51
  br i1 %52, label %56, label %53

53:                                               ; preds = %37
  %54 = load i64, ptr %11, align 8, !tbaa !9
  %55 = icmp eq i64 %54, 0
  br label %56

56:                                               ; preds = %53, %37
  %57 = phi i1 [ true, %37 ], [ %55, %53 ]
  %58 = load ptr, ptr %16, align 8, !tbaa !5
  call void @_ZN11alglib_impl9ae_assertEbPKcPNS_8ae_stateE(i1 noundef zeroext %57, ptr noundef @.str.26, ptr noundef %58)
  %59 = load ptr, ptr %9, align 8, !tbaa !5
  %60 = load i64, ptr %11, align 8, !tbaa !9
  %61 = load i64, ptr %12, align 8, !tbaa !9
  %62 = load i64, ptr %13, align 8, !tbaa !9
  %63 = add nsw i64 %61, %62
  %64 = load ptr, ptr %16, align 8, !tbaa !5
  %65 = call noundef zeroext i1 @_ZN11alglib_impl20apservisfinitematrixEPNS_9ae_matrixEllPNS_8ae_stateE(ptr noundef %59, i64 noundef %60, i64 noundef %63, ptr noundef %64)
  %66 = load ptr, ptr %16, align 8, !tbaa !5
  call void @_ZN11alglib_impl9ae_assertEbPKcPNS_8ae_stateE(i1 noundef zeroext %65, ptr noundef @.str.27, ptr noundef %66)
  %67 = load i64, ptr %11, align 8, !tbaa !9
  %68 = load ptr, ptr %15, align 8, !tbaa !5
  %69 = getelementptr inbounds %"struct.alglib_impl::kdtree", ptr %68, i32 0, i32 0
  store i64 %67, ptr %69, align 8, !tbaa !16
  %70 = load i64, ptr %12, align 8, !tbaa !9
  %71 = load ptr, ptr %15, align 8, !tbaa !5
  %72 = getelementptr inbounds %"struct.alglib_impl::kdtree", ptr %71, i32 0, i32 1
  store i64 %70, ptr %72, align 8, !tbaa !21
  %73 = load i64, ptr %13, align 8, !tbaa !9
  %74 = load ptr, ptr %15, align 8, !tbaa !5
  %75 = getelementptr inbounds %"struct.alglib_impl::kdtree", ptr %74, i32 0, i32 2
  store i64 %73, ptr %75, align 8, !tbaa !22
  %76 = load i64, ptr %14, align 8, !tbaa !9
  %77 = load ptr, ptr %15, align 8, !tbaa !5
  %78 = getelementptr inbounds %"struct.alglib_impl::kdtree", ptr %77, i32 0, i32 3
  store i64 %76, ptr %78, align 8, !tbaa !23
  %79 = load ptr, ptr %15, align 8, !tbaa !5
  %80 = getelementptr inbounds %"struct.alglib_impl::kdtree", ptr %79, i32 0, i32 10
  %81 = getelementptr inbounds %"struct.alglib_impl::kdtreerequestbuffer", ptr %80, i32 0, i32 7
  store i64 0, ptr %81, align 8, !tbaa !24
  %82 = load i64, ptr %11, align 8, !tbaa !9
  %83 = icmp eq i64 %82, 0
  br i1 %83, label %84, label %85

84:                                               ; preds = %56
  store i32 1, ptr %21, align 4
  br label %301

85:                                               ; preds = %56
  %86 = load ptr, ptr %15, align 8, !tbaa !5
  %87 = load i64, ptr %12, align 8, !tbaa !9
  %88 = load i64, ptr %13, align 8, !tbaa !9
  %89 = load ptr, ptr %16, align 8, !tbaa !5
  call void @_ZN11alglib_implL45nearestneighbor_kdtreeallocdatasetindependentEPNS_6kdtreeEllPNS_8ae_stateE(ptr noundef %86, i64 noundef %87, i64 noundef %88, ptr noundef %89)
  %90 = load ptr, ptr %15, align 8, !tbaa !5
  %91 = load i64, ptr %11, align 8, !tbaa !9
  %92 = load i64, ptr %12, align 8, !tbaa !9
  %93 = load i64, ptr %13, align 8, !tbaa !9
  %94 = load ptr, ptr %16, align 8, !tbaa !5
  call void @_ZN11alglib_implL43nearestneighbor_kdtreeallocdatasetdependentEPNS_6kdtreeElllPNS_8ae_stateE(ptr noundef %90, i64 noundef %91, i64 noundef %92, i64 noundef %93, ptr noundef %94)
  %95 = load ptr, ptr %15, align 8, !tbaa !5
  %96 = load ptr, ptr %15, align 8, !tbaa !5
  %97 = getelementptr inbounds %"struct.alglib_impl::kdtree", ptr %96, i32 0, i32 10
  %98 = load ptr, ptr %16, align 8, !tbaa !5
  call void @_ZN11alglib_impl25kdtreecreaterequestbufferEPNS_6kdtreeEPNS_19kdtreerequestbufferEPNS_8ae_stateE(ptr noundef %95, ptr noundef %97, ptr noundef %98)
  store i64 0, ptr %17, align 8, !tbaa !9
  br label %99

99:                                               ; preds = %158, %85
  %100 = load i64, ptr %17, align 8, !tbaa !9
  %101 = load i64, ptr %11, align 8, !tbaa !9
  %102 = sub nsw i64 %101, 1
  %103 = icmp sle i64 %100, %102
  br i1 %103, label %104, label %161

104:                                              ; preds = %99
  %105 = load ptr, ptr %15, align 8, !tbaa !5
  %106 = getelementptr inbounds %"struct.alglib_impl::kdtree", ptr %105, i32 0, i32 4
  %107 = getelementptr inbounds %"struct.alglib_impl::ae_matrix", ptr %106, i32 0, i32 6
  %108 = load ptr, ptr %107, align 8, !tbaa !25
  %109 = load i64, ptr %17, align 8, !tbaa !9
  %110 = getelementptr inbounds ptr, ptr %108, i64 %109
  %111 = load ptr, ptr %110, align 8, !tbaa !5
  %112 = getelementptr inbounds double, ptr %111, i64 0
  %113 = load ptr, ptr %9, align 8, !tbaa !5
  %114 = getelementptr inbounds %"struct.alglib_impl::ae_matrix", ptr %113, i32 0, i32 6
  %115 = load ptr, ptr %114, align 8, !tbaa !25
  %116 = load i64, ptr %17, align 8, !tbaa !9
  %117 = getelementptr inbounds ptr, ptr %115, i64 %116
  %118 = load ptr, ptr %117, align 8, !tbaa !5
  %119 = getelementptr inbounds double, ptr %118, i64 0
  %120 = load i64, ptr %12, align 8, !tbaa !9
  %121 = sub nsw i64 %120, 1
  %122 = call noundef i64 @_ZN11alglib_impl8ae_v_lenEll(i64 noundef 0, i64 noundef %121)
  call void @_ZN11alglib_impl9ae_v_moveEPdlPKdll(ptr noundef %112, i64 noundef 1, ptr noundef %119, i64 noundef 1, i64 noundef %122)
  %123 = load ptr, ptr %15, align 8, !tbaa !5
  %124 = getelementptr inbounds %"struct.alglib_impl::kdtree", ptr %123, i32 0, i32 4
  %125 = getelementptr inbounds %"struct.alglib_impl::ae_matrix", ptr %124, i32 0, i32 6
  %126 = load ptr, ptr %125, align 8, !tbaa !25
  %127 = load i64, ptr %17, align 8, !tbaa !9
  %128 = getelementptr inbounds ptr, ptr %126, i64 %127
  %129 = load ptr, ptr %128, align 8, !tbaa !5
  %130 = load i64, ptr %12, align 8, !tbaa !9
  %131 = getelementptr inbounds double, ptr %129, i64 %130
  %132 = load ptr, ptr %9, align 8, !tbaa !5
  %133 = getelementptr inbounds %"struct.alglib_impl::ae_matrix", ptr %132, i32 0, i32 6
  %134 = load ptr, ptr %133, align 8, !tbaa !25
  %135 = load i64, ptr %17, align 8, !tbaa !9
  %136 = getelementptr inbounds ptr, ptr %134, i64 %135
  %137 = load ptr, ptr %136, align 8, !tbaa !5
  %138 = getelementptr inbounds double, ptr %137, i64 0
  %139 = load i64, ptr %12, align 8, !tbaa !9
  %140 = load i64, ptr %12, align 8, !tbaa !9
  %141 = mul nsw i64 2, %140
  %142 = load i64, ptr %13, align 8, !tbaa !9
  %143 = add nsw i64 %141, %142
  %144 = sub nsw i64 %143, 1
  %145 = call noundef i64 @_ZN11alglib_impl8ae_v_lenEll(i64 noundef %139, i64 noundef %144)
  call void @_ZN11alglib_impl9ae_v_moveEPdlPKdll(ptr noundef %131, i64 noundef 1, ptr noundef %138, i64 noundef 1, i64 noundef %145)
  %146 = load ptr, ptr %10, align 8, !tbaa !5
  %147 = getelementptr inbounds %"struct.alglib_impl::ae_vector", ptr %146, i32 0, i32 4
  %148 = load ptr, ptr %147, align 8, !tbaa !25
  %149 = load i64, ptr %17, align 8, !tbaa !9
  %150 = getelementptr inbounds i64, ptr %148, i64 %149
  %151 = load i64, ptr %150, align 8, !tbaa !9
  %152 = load ptr, ptr %15, align 8, !tbaa !5
  %153 = getelementptr inbounds %"struct.alglib_impl::kdtree", ptr %152, i32 0, i32 5
  %154 = getelementptr inbounds %"struct.alglib_impl::ae_vector", ptr %153, i32 0, i32 4
  %155 = load ptr, ptr %154, align 8, !tbaa !25
  %156 = load i64, ptr %17, align 8, !tbaa !9
  %157 = getelementptr inbounds i64, ptr %155, i64 %156
  store i64 %151, ptr %157, align 8, !tbaa !9
  br label %158

158:                                              ; preds = %104
  %159 = load i64, ptr %17, align 8, !tbaa !9
  %160 = add nsw i64 %159, 1
  store i64 %160, ptr %17, align 8, !tbaa !9
  br label %99, !llvm.loop !26

161:                                              ; preds = %99
  %162 = load ptr, ptr %15, align 8, !tbaa !5
  %163 = getelementptr inbounds %"struct.alglib_impl::kdtree", ptr %162, i32 0, i32 6
  %164 = getelementptr inbounds %"struct.alglib_impl::ae_vector", ptr %163, i32 0, i32 4
  %165 = load ptr, ptr %164, align 8, !tbaa !25
  %166 = getelementptr inbounds double, ptr %165, i64 0
  %167 = load ptr, ptr %15, align 8, !tbaa !5
  %168 = getelementptr inbounds %"struct.alglib_impl::kdtree", ptr %167, i32 0, i32 4
  %169 = getelementptr inbounds %"struct.alglib_impl::ae_matrix", ptr %168, i32 0, i32 6
  %170 = load ptr, ptr %169, align 8, !tbaa !25
  %171 = getelementptr inbounds ptr, ptr %170, i64 0
  %172 = load ptr, ptr %171, align 8, !tbaa !5
  %173 = getelementptr inbounds double, ptr %172, i64 0
  %174 = load i64, ptr %12, align 8, !tbaa !9
  %175 = sub nsw i64 %174, 1
  %176 = call noundef i64 @_ZN11alglib_impl8ae_v_lenEll(i64 noundef 0, i64 noundef %175)
  call void @_ZN11alglib_impl9ae_v_moveEPdlPKdll(ptr noundef %166, i64 noundef 1, ptr noundef %173, i64 noundef 1, i64 noundef %176)
  %177 = load ptr, ptr %15, align 8, !tbaa !5
  %178 = getelementptr inbounds %"struct.alglib_impl::kdtree", ptr %177, i32 0, i32 7
  %179 = getelementptr inbounds %"struct.alglib_impl::ae_vector", ptr %178, i32 0, i32 4
  %180 = load ptr, ptr %179, align 8, !tbaa !25
  %181 = getelementptr inbounds double, ptr %180, i64 0
  %182 = load ptr, ptr %15, align 8, !tbaa !5
  %183 = getelementptr inbounds %"struct.alglib_impl::kdtree", ptr %182, i32 0, i32 4
  %184 = getelementptr inbounds %"struct.alglib_impl::ae_matrix", ptr %183, i32 0, i32 6
  %185 = load ptr, ptr %184, align 8, !tbaa !25
  %186 = getelementptr inbounds ptr, ptr %185, i64 0
  %187 = load ptr, ptr %186, align 8, !tbaa !5
  %188 = getelementptr inbounds double, ptr %187, i64 0
  %189 = load i64, ptr %12, align 8, !tbaa !9
  %190 = sub nsw i64 %189, 1
  %191 = call noundef i64 @_ZN11alglib_impl8ae_v_lenEll(i64 noundef 0, i64 noundef %190)
  call void @_ZN11alglib_impl9ae_v_moveEPdlPKdll(ptr noundef %181, i64 noundef 1, ptr noundef %188, i64 noundef 1, i64 noundef %191)
  store i64 1, ptr %17, align 8, !tbaa !9
  br label %192

192:                                              ; preds = %258, %161
  %193 = load i64, ptr %17, align 8, !tbaa !9
  %194 = load i64, ptr %11, align 8, !tbaa !9
  %195 = sub nsw i64 %194, 1
  %196 = icmp sle i64 %193, %195
  br i1 %196, label %197, label %261

197:                                              ; preds = %192
  store i64 0, ptr %18, align 8, !tbaa !9
  br label %198

198:                                              ; preds = %254, %197
  %199 = load i64, ptr %18, align 8, !tbaa !9
  %200 = load i64, ptr %12, align 8, !tbaa !9
  %201 = sub nsw i64 %200, 1
  %202 = icmp sle i64 %199, %201
  br i1 %202, label %203, label %257

203:                                              ; preds = %198
  %204 = load ptr, ptr %15, align 8, !tbaa !5
  %205 = getelementptr inbounds %"struct.alglib_impl::kdtree", ptr %204, i32 0, i32 6
  %206 = getelementptr inbounds %"struct.alglib_impl::ae_vector", ptr %205, i32 0, i32 4
  %207 = load ptr, ptr %206, align 8, !tbaa !25
  %208 = load i64, ptr %18, align 8, !tbaa !9
  %209 = getelementptr inbounds double, ptr %207, i64 %208
  %210 = load double, ptr %209, align 8, !tbaa !28
  %211 = load ptr, ptr %15, align 8, !tbaa !5
  %212 = getelementptr inbounds %"struct.alglib_impl::kdtree", ptr %211, i32 0, i32 4
  %213 = getelementptr inbounds %"struct.alglib_impl::ae_matrix", ptr %212, i32 0, i32 6
  %214 = load ptr, ptr %213, align 8, !tbaa !25
  %215 = load i64, ptr %17, align 8, !tbaa !9
  %216 = getelementptr inbounds ptr, ptr %214, i64 %215
  %217 = load ptr, ptr %216, align 8, !tbaa !5
  %218 = load i64, ptr %18, align 8, !tbaa !9
  %219 = getelementptr inbounds double, ptr %217, i64 %218
  %220 = load double, ptr %219, align 8, !tbaa !28
  %221 = load ptr, ptr %16, align 8, !tbaa !5
  %222 = call noundef double @_ZN11alglib_impl10ae_minrealEddPNS_8ae_stateE(double noundef %210, double noundef %220, ptr noundef %221)
  %223 = load ptr, ptr %15, align 8, !tbaa !5
  %224 = getelementptr inbounds %"struct.alglib_impl::kdtree", ptr %223, i32 0, i32 6
  %225 = getelementptr inbounds %"struct.alglib_impl::ae_vector", ptr %224, i32 0, i32 4
  %226 = load ptr, ptr %225, align 8, !tbaa !25
  %227 = load i64, ptr %18, align 8, !tbaa !9
  %228 = getelementptr inbounds double, ptr %226, i64 %227
  store double %222, ptr %228, align 8, !tbaa !28
  %229 = load ptr, ptr %15, align 8, !tbaa !5
  %230 = getelementptr inbounds %"struct.alglib_impl::kdtree", ptr %229, i32 0, i32 7
  %231 = getelementptr inbounds %"struct.alglib_impl::ae_vector", ptr %230, i32 0, i32 4
  %232 = load ptr, ptr %231, align 8, !tbaa !25
  %233 = load i64, ptr %18, align 8, !tbaa !9
  %234 = getelementptr inbounds double, ptr %232, i64 %233
  %235 = load double, ptr %234, align 8, !tbaa !28
  %236 = load ptr, ptr %15, align 8, !tbaa !5
  %237 = getelementptr inbounds %"struct.alglib_impl::kdtree", ptr %236, i32 0, i32 4
  %238 = getelementptr inbounds %"struct.alglib_impl::ae_matrix", ptr %237, i32 0, i32 6
  %239 = load ptr, ptr %238, align 8, !tbaa !25
  %240 = load i64, ptr %17, align 8, !tbaa !9
  %241 = getelementptr inbounds ptr, ptr %239, i64 %240
  %242 = load ptr, ptr %241, align 8, !tbaa !5
  %243 = load i64, ptr %18, align 8, !tbaa !9
  %244 = getelementptr inbounds double, ptr %242, i64 %243
  %245 = load double, ptr %244, align 8, !tbaa !28
  %246 = load ptr, ptr %16, align 8, !tbaa !5
  %247 = call noundef double @_ZN11alglib_impl10ae_maxrealEddPNS_8ae_stateE(double noundef %235, double noundef %245, ptr noundef %246)
  %248 = load ptr, ptr %15, align 8, !tbaa !5
  %249 = getelementptr inbounds %"struct.alglib_impl::kdtree", ptr %248, i32 0, i32 7
  %250 = getelementptr inbounds %"struct.alglib_impl::ae_vector", ptr %249, i32 0, i32 4
  %251 = load ptr, ptr %250, align 8, !tbaa !25
  %252 = load i64, ptr %18, align 8, !tbaa !9
  %253 = getelementptr inbounds double, ptr %251, i64 %252
  store double %247, ptr %253, align 8, !tbaa !28
  br label %254

254:                                              ; preds = %203
  %255 = load i64, ptr %18, align 8, !tbaa !9
  %256 = add nsw i64 %255, 1
  store i64 %256, ptr %18, align 8, !tbaa !9
  br label %198, !llvm.loop !29

257:                                              ; preds = %198
  br label %258

258:                                              ; preds = %257
  %259 = load i64, ptr %17, align 8, !tbaa !9
  %260 = add nsw i64 %259, 1
  store i64 %260, ptr %17, align 8, !tbaa !9
  br label %192, !llvm.loop !30

261:                                              ; preds = %192
  store i64 0, ptr %19, align 8, !tbaa !9
  store i64 0, ptr %20, align 8, !tbaa !9
  %262 = load ptr, ptr %15, align 8, !tbaa !5
  %263 = getelementptr inbounds %"struct.alglib_impl::kdtree", ptr %262, i32 0, i32 10
  %264 = getelementptr inbounds %"struct.alglib_impl::kdtreerequestbuffer", ptr %263, i32 0, i32 11
  %265 = getelementptr inbounds %"struct.alglib_impl::ae_vector", ptr %264, i32 0, i32 4
  %266 = load ptr, ptr %265, align 8, !tbaa !25
  %267 = getelementptr inbounds double, ptr %266, i64 0
  %268 = load ptr, ptr %15, align 8, !tbaa !5
  %269 = getelementptr inbounds %"struct.alglib_impl::kdtree", ptr %268, i32 0, i32 6
  %270 = getelementptr inbounds %"struct.alglib_impl::ae_vector", ptr %269, i32 0, i32 4
  %271 = load ptr, ptr %270, align 8, !tbaa !25
  %272 = getelementptr inbounds double, ptr %271, i64 0
  %273 = load i64, ptr %12, align 8, !tbaa !9
  %274 = sub nsw i64 %273, 1
  %275 = call noundef i64 @_ZN11alglib_impl8ae_v_lenEll(i64 noundef 0, i64 noundef %274)
  call void @_ZN11alglib_impl9ae_v_moveEPdlPKdll(ptr noundef %267, i64 noundef 1, ptr noundef %272, i64 noundef 1, i64 noundef %275)
  %276 = load ptr, ptr %15, align 8, !tbaa !5
  %277 = getelementptr inbounds %"struct.alglib_impl::kdtree", ptr %276, i32 0, i32 10
  %278 = getelementptr inbounds %"struct.alglib_impl::kdtreerequestbuffer", ptr %277, i32 0, i32 12
  %279 = getelementptr inbounds %"struct.alglib_impl::ae_vector", ptr %278, i32 0, i32 4
  %280 = load ptr, ptr %279, align 8, !tbaa !25
  %281 = getelementptr inbounds double, ptr %280, i64 0
  %282 = load ptr, ptr %15, align 8, !tbaa !5
  %283 = getelementptr inbounds %"struct.alglib_impl::kdtree", ptr %282, i32 0, i32 7
  %284 = getelementptr inbounds %"struct.alglib_impl::ae_vector", ptr %283, i32 0, i32 4
  %285 = load ptr, ptr %284, align 8, !tbaa !25
  %286 = getelementptr inbounds double, ptr %285, i64 0
  %287 = load i64, ptr %12, align 8, !tbaa !9
  %288 = sub nsw i64 %287, 1
  %289 = call noundef i64 @_ZN11alglib_impl8ae_v_lenEll(i64 noundef 0, i64 noundef %288)
  call void @_ZN11alglib_impl9ae_v_moveEPdlPKdll(ptr noundef %281, i64 noundef 1, ptr noundef %286, i64 noundef 1, i64 noundef %289)
  %290 = load ptr, ptr %15, align 8, !tbaa !5
  %291 = load i64, ptr %11, align 8, !tbaa !9
  %292 = load ptr, ptr %16, align 8, !tbaa !5
  call void @_ZN11alglib_implL37nearestneighbor_kdtreegeneratetreerecEPNS_6kdtreeEPlS2_lllPNS_8ae_stateE(ptr noundef %290, ptr noundef %19, ptr noundef %20, i64 noundef 0, i64 noundef %291, i64 noundef 8, ptr noundef %292)
  %293 = load ptr, ptr %15, align 8, !tbaa !5
  %294 = getelementptr inbounds %"struct.alglib_impl::kdtree", ptr %293, i32 0, i32 8
  %295 = load i64, ptr %19, align 8, !tbaa !9
  %296 = load ptr, ptr %16, align 8, !tbaa !5
  call void @_ZN11alglib_impl13ivectorresizeEPNS_9ae_vectorElPNS_8ae_stateE(ptr noundef %294, i64 noundef %295, ptr noundef %296)
  %297 = load ptr, ptr %15, align 8, !tbaa !5
  %298 = getelementptr inbounds %"struct.alglib_impl::kdtree", ptr %297, i32 0, i32 9
  %299 = load i64, ptr %20, align 8, !tbaa !9
  %300 = load ptr, ptr %16, align 8, !tbaa !5
  call void @_ZN11alglib_impl13rvectorresizeEPNS_9ae_vectorElPNS_8ae_stateE(ptr noundef %298, i64 noundef %299, ptr noundef %300)
  store i32 0, ptr %21, align 4
  br label %301

301:                                              ; preds = %261, %84
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #3
  %302 = load i32, ptr %21, align 4
  switch i32 %302, label %304 [
    i32 0, label %303
    i32 1, label %303
  ]

303:                                              ; preds = %301, %301
  ret void

304:                                              ; preds = %301
  unreachable
}

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN11alglib_impl13_kdtree_clearEPv(ptr noundef) #2

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

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

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

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

declare noundef i64 @_ZN11alglib_impl8ae_v_lenEll(i64 noundef, i64 noundef) #1

declare noundef double @_ZN11alglib_impl10ae_minrealEddPNS_8ae_stateE(double noundef, double noundef, ptr noundef) #1

declare noundef double @_ZN11alglib_impl10ae_maxrealEddPNS_8ae_stateE(double noundef, double noundef, ptr noundef) #1

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

declare void @_ZN11alglib_impl13ivectorresizeEPNS_9ae_vectorElPNS_8ae_stateE(ptr noundef, i64 noundef, ptr noundef) #1

declare void @_ZN11alglib_impl13rvectorresizeEPNS_9ae_vectorElPNS_8ae_stateE(ptr noundef, i64 noundef, ptr noundef) #1

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


; 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.21 = external hidden unnamed_addr constant [23 x i8], align 1
@.str.22 = external hidden unnamed_addr constant [24 x i8], align 1
@.str.23 = external hidden unnamed_addr constant [24 x i8], align 1
@.str.24 = external hidden unnamed_addr constant [38 x i8], align 1
@.str.25 = external hidden unnamed_addr constant [29 x i8], align 1
@.str.26 = external hidden unnamed_addr constant [33 x i8], align 1
@.str.27 = external hidden unnamed_addr constant [54 x i8], align 1

; 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 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) local_unnamed_addr #1

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN11alglib_impl17kdtreebuildtaggedEPNS_9ae_matrixEPNS_9ae_vectorEllllPNS_6kdtreeEPNS_8ae_stateE(ptr noundef %0, ptr nocapture noundef readonly %1, i64 noundef %2, i64 noundef %3, i64 noundef %4, i64 noundef %5, ptr noundef %6, ptr noundef %7) local_unnamed_addr #2 {
  %9 = alloca i64, align 8
  %10 = alloca i64, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %9) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %10) #3
  tail call void @_ZN11alglib_impl13_kdtree_clearEPv(ptr noundef %6)
  %11 = icmp sgt i64 %2, -1
  tail call void @_ZN11alglib_impl9ae_assertEbPKcPNS_8ae_stateE(i1 noundef zeroext %11, ptr noundef nonnull @.str.21, ptr noundef %7)
  %12 = icmp sgt i64 %3, 0
  tail call void @_ZN11alglib_impl9ae_assertEbPKcPNS_8ae_stateE(i1 noundef zeroext %12, ptr noundef nonnull @.str.22, ptr noundef %7)
  %13 = icmp sgt i64 %4, -1
  tail call void @_ZN11alglib_impl9ae_assertEbPKcPNS_8ae_stateE(i1 noundef zeroext %13, ptr noundef nonnull @.str.23, ptr noundef %7)
  %14 = icmp ult i64 %5, 3
  tail call void @_ZN11alglib_impl9ae_assertEbPKcPNS_8ae_stateE(i1 noundef zeroext %14, ptr noundef nonnull @.str.24, ptr noundef %7)
  %15 = load i64, ptr %0, align 8, !tbaa !5
  %16 = icmp sge i64 %15, %2
  tail call void @_ZN11alglib_impl9ae_assertEbPKcPNS_8ae_stateE(i1 noundef zeroext %16, ptr noundef nonnull @.str.25, ptr noundef %7)
  %17 = getelementptr inbounds i8, ptr %0, i64 8
  %18 = load i64, ptr %17, align 8, !tbaa !13
  %19 = add nsw i64 %4, %3
  %20 = icmp sge i64 %18, %19
  %21 = icmp eq i64 %2, 0
  %22 = or i1 %21, %20
  tail call void @_ZN11alglib_impl9ae_assertEbPKcPNS_8ae_stateE(i1 noundef zeroext %22, ptr noundef nonnull @.str.26, ptr noundef %7)
  %23 = tail call noundef zeroext i1 @_ZN11alglib_impl20apservisfinitematrixEPNS_9ae_matrixEllPNS_8ae_stateE(ptr noundef nonnull %0, i64 noundef %2, i64 noundef %19, ptr noundef %7)
  tail call void @_ZN11alglib_impl9ae_assertEbPKcPNS_8ae_stateE(i1 noundef zeroext %23, ptr noundef nonnull @.str.27, ptr noundef %7)
  store i64 %2, ptr %6, align 8, !tbaa !14
  %24 = getelementptr inbounds i8, ptr %6, i64 8
  store i64 %3, ptr %24, align 8, !tbaa !19
  %25 = getelementptr inbounds i8, ptr %6, i64 16
  store i64 %4, ptr %25, align 8, !tbaa !20
  %26 = getelementptr inbounds i8, ptr %6, i64 24
  store i64 %5, ptr %26, align 8, !tbaa !21
  %27 = getelementptr inbounds i8, ptr %6, i64 656
  store i64 0, ptr %27, align 8, !tbaa !22
  br i1 %21, label %108, label %28

28:                                               ; preds = %8
  %29 = getelementptr inbounds i8, ptr %6, i64 432
  tail call void @_ZN11alglib_implL45nearestneighbor_kdtreeallocdatasetindependentEPNS_6kdtreeEllPNS_8ae_stateE(ptr noundef nonnull %6, i64 noundef %3, i64 noundef %4, ptr noundef %7)
  tail call void @_ZN11alglib_implL43nearestneighbor_kdtreeallocdatasetdependentEPNS_6kdtreeElllPNS_8ae_stateE(ptr noundef nonnull %6, i64 noundef %2, i64 noundef %3, i64 noundef %4, ptr noundef %7)
  tail call void @_ZN11alglib_impl25kdtreecreaterequestbufferEPNS_6kdtreeEPNS_19kdtreerequestbufferEPNS_8ae_stateE(ptr noundef nonnull %6, ptr noundef nonnull %29, ptr noundef %7)
  %.not.not111 = icmp sgt i64 %2, 0
  br i1 %.not.not111, label %.lr.ph, label %.._crit_edge_crit_edge

.._crit_edge_crit_edge:                           ; preds = %28
  %.pre = add nsw i64 %3, -1
  br label %._crit_edge

.lr.ph:                                           ; preds = %28
  %30 = getelementptr inbounds i8, ptr %6, i64 104
  %31 = getelementptr inbounds i8, ptr %0, i64 72
  %32 = add nsw i64 %3, -1
  %33 = shl nsw i64 %3, 1
  %34 = add i64 %4, -1
  %35 = add i64 %34, %33
  %36 = getelementptr inbounds i8, ptr %1, i64 56
  %37 = getelementptr inbounds i8, ptr %6, i64 168
  br label %38

38:                                               ; preds = %.lr.ph, %38
  %.0106112 = phi i64 [ 0, %.lr.ph ], [ %59, %38 ]
  %39 = load ptr, ptr %30, align 8, !tbaa !23
  %40 = getelementptr inbounds ptr, ptr %39, i64 %.0106112
  %41 = load ptr, ptr %40, align 8, !tbaa !24
  %42 = load ptr, ptr %31, align 8, !tbaa !23
  %43 = getelementptr inbounds ptr, ptr %42, i64 %.0106112
  %44 = load ptr, ptr %43, align 8, !tbaa !24
  %45 = tail call noundef i64 @_ZN11alglib_impl8ae_v_lenEll(i64 noundef 0, i64 noundef %32)
  tail call void @_ZN11alglib_impl9ae_v_moveEPdlPKdll(ptr noundef %41, i64 noundef 1, ptr noundef %44, i64 noundef 1, i64 noundef %45)
  %46 = load ptr, ptr %30, align 8, !tbaa !23
  %47 = getelementptr inbounds ptr, ptr %46, i64 %.0106112
  %48 = load ptr, ptr %47, align 8, !tbaa !24
  %49 = getelementptr inbounds double, ptr %48, i64 %3
  %50 = load ptr, ptr %31, align 8, !tbaa !23
  %51 = getelementptr inbounds ptr, ptr %50, i64 %.0106112
  %52 = load ptr, ptr %51, align 8, !tbaa !24
  %53 = tail call noundef i64 @_ZN11alglib_impl8ae_v_lenEll(i64 noundef %3, i64 noundef %35)
  tail call void @_ZN11alglib_impl9ae_v_moveEPdlPKdll(ptr noundef %49, i64 noundef 1, ptr noundef %52, i64 noundef 1, i64 noundef %53)
  %54 = load ptr, ptr %36, align 8, !tbaa !23
  %55 = getelementptr inbounds i64, ptr %54, i64 %.0106112
  %56 = load i64, ptr %55, align 8, !tbaa !25
  %57 = load ptr, ptr %37, align 8, !tbaa !23
  %58 = getelementptr inbounds i64, ptr %57, i64 %.0106112
  store i64 %56, ptr %58, align 8, !tbaa !25
  %59 = add nuw nsw i64 %.0106112, 1
  %exitcond.not = icmp eq i64 %59, %2
  br i1 %exitcond.not, label %._crit_edge, label %38, !llvm.loop !26

._crit_edge:                                      ; preds = %38, %.._crit_edge_crit_edge
  %.pre-phi = phi i64 [ %.pre, %.._crit_edge_crit_edge ], [ %32, %38 ]
  %60 = getelementptr inbounds i8, ptr %6, i64 232
  %61 = load ptr, ptr %60, align 8, !tbaa !23
  %62 = getelementptr inbounds i8, ptr %6, i64 104
  %63 = load ptr, ptr %62, align 8, !tbaa !23
  %64 = load ptr, ptr %63, align 8, !tbaa !24
  %65 = tail call noundef i64 @_ZN11alglib_impl8ae_v_lenEll(i64 noundef 0, i64 noundef %.pre-phi)
  tail call void @_ZN11alglib_impl9ae_v_moveEPdlPKdll(ptr noundef %61, i64 noundef 1, ptr noundef %64, i64 noundef 1, i64 noundef %65)
  %66 = getelementptr inbounds i8, ptr %6, i64 296
  %67 = load ptr, ptr %66, align 8, !tbaa !23
  %68 = load ptr, ptr %62, align 8, !tbaa !23
  %69 = load ptr, ptr %68, align 8, !tbaa !24
  %70 = tail call noundef i64 @_ZN11alglib_impl8ae_v_lenEll(i64 noundef 0, i64 noundef %.pre-phi)
  tail call void @_ZN11alglib_impl9ae_v_moveEPdlPKdll(ptr noundef %67, i64 noundef 1, ptr noundef %69, i64 noundef 1, i64 noundef %70)
  %.not.not109117 = icmp sgt i64 %2, 1
  %brmerge.not = and i1 %.not.not109117, %12
  br i1 %brmerge.not, label %.preheader.us, label %._crit_edge119

.preheader.us:                                    ; preds = %._crit_edge, %._crit_edge116.us
  %.1118.us = phi i64 [ %95, %._crit_edge116.us ], [ 1, %._crit_edge ]
  br label %71

71:                                               ; preds = %.preheader.us, %71
  %.0114.us = phi i64 [ 0, %.preheader.us ], [ %94, %71 ]
  %72 = load ptr, ptr %60, align 8, !tbaa !23
  %73 = getelementptr inbounds double, ptr %72, i64 %.0114.us
  %74 = load double, ptr %73, align 8, !tbaa !28
  %75 = load ptr, ptr %62, align 8, !tbaa !23
  %76 = getelementptr inbounds ptr, ptr %75, i64 %.1118.us
  %77 = load ptr, ptr %76, align 8, !tbaa !24
  %78 = getelementptr inbounds double, ptr %77, i64 %.0114.us
  %79 = load double, ptr %78, align 8, !tbaa !28
  %80 = tail call noundef double @_ZN11alglib_impl10ae_minrealEddPNS_8ae_stateE(double noundef %74, double noundef %79, ptr noundef %7)
  %81 = load ptr, ptr %60, align 8, !tbaa !23
  %82 = getelementptr inbounds double, ptr %81, i64 %.0114.us
  store double %80, ptr %82, align 8, !tbaa !28
  %83 = load ptr, ptr %66, align 8, !tbaa !23
  %84 = getelementptr inbounds double, ptr %83, i64 %.0114.us
  %85 = load double, ptr %84, align 8, !tbaa !28
  %86 = load ptr, ptr %62, align 8, !tbaa !23
  %87 = getelementptr inbounds ptr, ptr %86, i64 %.1118.us
  %88 = load ptr, ptr %87, align 8, !tbaa !24
  %89 = getelementptr inbounds double, ptr %88, i64 %.0114.us
  %90 = load double, ptr %89, align 8, !tbaa !28
  %91 = tail call noundef double @_ZN11alglib_impl10ae_maxrealEddPNS_8ae_stateE(double noundef %85, double noundef %90, ptr noundef %7)
  %92 = load ptr, ptr %66, align 8, !tbaa !23
  %93 = getelementptr inbounds double, ptr %92, i64 %.0114.us
  store double %91, ptr %93, align 8, !tbaa !28
  %94 = add nuw nsw i64 %.0114.us, 1
  %exitcond121.not = icmp eq i64 %94, %3
  br i1 %exitcond121.not, label %._crit_edge116.us, label %71, !llvm.loop !29

._crit_edge116.us:                                ; preds = %71
  %95 = add nuw nsw i64 %.1118.us, 1
  %exitcond122.not = icmp eq i64 %95, %2
  br i1 %exitcond122.not, label %._crit_edge119, label %.preheader.us, !llvm.loop !30

._crit_edge119:                                   ; preds = %._crit_edge116.us, %._crit_edge
  store i64 0, ptr %9, align 8, !tbaa !25
  store i64 0, ptr %10, align 8, !tbaa !25
  %96 = getelementptr inbounds i8, ptr %6, i64 912
  %97 = load ptr, ptr %96, align 8, !tbaa !23
  %98 = load ptr, ptr %60, align 8, !tbaa !23
  %99 = tail call noundef i64 @_ZN11alglib_impl8ae_v_lenEll(i64 noundef 0, i64 noundef %.pre-phi)
  tail call void @_ZN11alglib_impl9ae_v_moveEPdlPKdll(ptr noundef %97, i64 noundef 1, ptr noundef %98, i64 noundef 1, i64 noundef %99)
  %100 = getelementptr inbounds i8, ptr %6, i64 976
  %101 = load ptr, ptr %100, align 8, !tbaa !23
  %102 = load ptr, ptr %66, align 8, !tbaa !23
  %103 = tail call noundef i64 @_ZN11alglib_impl8ae_v_lenEll(i64 noundef 0, i64 noundef %.pre-phi)
  tail call void @_ZN11alglib_impl9ae_v_moveEPdlPKdll(ptr noundef %101, i64 noundef 1, ptr noundef %102, i64 noundef 1, i64 noundef %103)
  call void @_ZN11alglib_implL37nearestneighbor_kdtreegeneratetreerecEPNS_6kdtreeEPlS2_lllPNS_8ae_stateE(ptr noundef nonnull %6, ptr noundef nonnull %9, ptr noundef nonnull %10, i64 noundef 0, i64 noundef %2, i64 noundef 8, ptr noundef %7)
  %104 = getelementptr inbounds i8, ptr %6, i64 304
  %105 = load i64, ptr %9, align 8, !tbaa !25
  call void @_ZN11alglib_impl13ivectorresizeEPNS_9ae_vectorElPNS_8ae_stateE(ptr noundef nonnull %104, i64 noundef %105, ptr noundef %7)
  %106 = getelementptr inbounds i8, ptr %6, i64 368
  %107 = load i64, ptr %10, align 8, !tbaa !25
  call void @_ZN11alglib_impl13rvectorresizeEPNS_9ae_vectorElPNS_8ae_stateE(ptr noundef nonnull %106, i64 noundef %107, ptr noundef %7)
  br label %108

108:                                              ; preds = %8, %._crit_edge119
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %10) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %9) #3
  ret void
}

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN11alglib_impl25kdtreecreaterequestbufferEPNS_6kdtreeEPNS_19kdtreerequestbufferEPNS_8ae_stateE(ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN11alglib_impl13_kdtree_clearEPv(ptr noundef) local_unnamed_addr #2

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

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

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

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

declare noundef i64 @_ZN11alglib_impl8ae_v_lenEll(i64 noundef, i64 noundef) local_unnamed_addr #1

declare noundef double @_ZN11alglib_impl10ae_minrealEddPNS_8ae_stateE(double noundef, double noundef, ptr noundef) local_unnamed_addr #1

declare noundef double @_ZN11alglib_impl10ae_maxrealEddPNS_8ae_stateE(double noundef, double noundef, ptr noundef) local_unnamed_addr #1

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

declare void @_ZN11alglib_impl13ivectorresizeEPNS_9ae_vectorElPNS_8ae_stateE(ptr noundef, i64 noundef, ptr noundef) local_unnamed_addr #1

declare void @_ZN11alglib_impl13rvectorresizeEPNS_9ae_vectorElPNS_8ae_stateE(ptr noundef, i64 noundef, ptr noundef) local_unnamed_addr #1

attributes #0 = { mustprogress 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, !7, i64 0}
!6 = !{!"_ZTSN11alglib_impl9ae_matrixE", !7, i64 0, !7, i64 8, !7, i64 16, !7, i64 24, !10, i64 32, !11, i64 40, !8, i64 72}
!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 = !{!6, !7, i64 8}
!14 = !{!15, !7, i64 0}
!15 = !{!"_ZTSN11alglib_impl6kdtreeE", !7, i64 0, !7, i64 8, !7, i64 16, !7, i64 24, !6, i64 32, !16, i64 112, !16, i64 176, !16, i64 240, !16, i64 304, !16, i64 368, !17, i64 432, !7, i64 992}
!16 = !{!"_ZTSN11alglib_impl9ae_vectorE", !7, i64 0, !7, i64 8, !10, i64 16, !11, i64 24, !8, i64 56}
!17 = !{!"_ZTSN11alglib_impl19kdtreerequestbufferE", !16, i64 0, !16, i64 64, !16, i64 128, !7, i64 192, !18, i64 200, !10, i64 208, !18, i64 216, !7, i64 224, !16, i64 232, !16, i64 296, !16, i64 360, !16, i64 424, !16, i64 488, !18, i64 552}
!18 = !{!"double", !8, i64 0}
!19 = !{!15, !7, i64 8}
!20 = !{!15, !7, i64 16}
!21 = !{!15, !7, i64 24}
!22 = !{!15, !7, i64 656}
!23 = !{!8, !8, i64 0}
!24 = !{!12, !12, i64 0}
!25 = !{!7, !7, i64 0}
!26 = distinct !{!26, !27}
!27 = !{!"llvm.loop.mustprogress"}
!28 = !{!18, !18, i64 0}
!29 = distinct !{!29, !27}
!30 = distinct !{!30, !27}


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