; LLVM IR from Dimandragon/non-parametric-dsp :: 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_shared_pool" = type { %"struct.alglib_impl::ae_lock", ptr, ptr, ptr, ptr, i64, ptr, ptr, %"struct.alglib_impl::ae_dyn_block" }
%"struct.alglib_impl::ae_lock" = type { ptr, %"struct.alglib_impl::ae_dyn_block", i8 }
%"struct.alglib_impl::ae_smart_ptr" = type { ptr, ptr, i8, i8, i64, ptr, ptr, %"struct.alglib_impl::ae_dyn_block" }
%"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::idwmodel" = type { i64, i64, %"struct.alglib_impl::ae_vector", i64, i64, double, double, double, double, double, double, i8, %"struct.alglib_impl::kdtree", i64, %"struct.alglib_impl::ae_vector", %"struct.alglib_impl::idwcalcbuffer" }
%"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, %"struct.alglib_impl::ae_vector" }
%"struct.alglib_impl::idwcalcbuffer" = type { %"struct.alglib_impl::ae_vector", %"struct.alglib_impl::ae_vector", %"struct.alglib_impl::ae_vector", %"struct.alglib_impl::ae_vector", %"struct.alglib_impl::ae_matrix", %"struct.alglib_impl::ae_vector", %"struct.alglib_impl::kdtreerequestbuffer" }

@.str.178 = external hidden unnamed_addr constant [46 x i8], align 1
@.str.179 = external hidden unnamed_addr constant [46 x i8], align 1
@.str.180 = external hidden unnamed_addr constant [30 x i8], align 1
@.str.181 = external hidden unnamed_addr constant [30 x i8], align 1
@.str.182 = external hidden unnamed_addr constant [52 x i8], align 1
@.str.183 = external hidden unnamed_addr constant [52 x i8], align 1
@.str.184 = external hidden unnamed_addr constant [47 x i8], align 1
@.str.185 = external hidden unnamed_addr constant [47 x i8], align 1
@.str.186 = external hidden unnamed_addr constant [33 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 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_impl9ae_assertEbPKcPNS_8ae_stateE(i1 noundef zeroext, ptr noundef, ptr noundef) #2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN11alglib_impl22_idwcalcbuffer_destroyEPv(ptr noundef) #3

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN11alglib_impl24_idwcalcbuffer_init_copyEPvPKvPNS_8ae_stateEb(ptr noundef, ptr noundef, ptr noundef, i1 noundef zeroext) #3

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

declare noundef zeroext i1 @_ZN11alglib_impl14isfinitevectorEPKNS_9ae_vectorElPNS_8ae_stateE(ptr noundef, i64 noundef, ptr noundef) #2

declare void @_ZN11alglib_impl19ae_shared_pool_initEPvPNS_8ae_stateEb(ptr noundef, ptr noundef, i1 noundef zeroext) #2

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

declare noundef double @_ZN11alglib_impl8coalesceEddPNS_8ae_stateE(double noundef, double noundef, ptr noundef) #2

declare noundef zeroext i1 @_ZN11alglib_impl13ae_fp_less_eqEdd(double noundef, double noundef) #2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN11alglib_impl14idwgridcalc2vxEPKNS_8idwmodelEPKNS_9ae_vectorElS5_lS5_bPS3_PNS_8ae_stateE(ptr noundef %0, ptr noundef %1, i64 noundef %2, ptr noundef %3, i64 noundef %4, ptr noundef %5, i1 noundef zeroext %6, ptr noundef %7, ptr noundef %8) #3 {
  %10 = alloca ptr, align 8
  %11 = alloca ptr, align 8
  %12 = alloca i64, align 8
  %13 = alloca ptr, align 8
  %14 = alloca i64, align 8
  %15 = alloca ptr, align 8
  %16 = alloca i8, align 1
  %17 = alloca ptr, align 8
  %18 = alloca ptr, align 8
  %19 = alloca %"struct.alglib_impl::ae_frame", align 8
  %20 = alloca i64, align 8
  %21 = alloca i64, align 8
  %22 = alloca i64, align 8
  %23 = alloca i64, align 8
  %24 = alloca double, align 8
  %25 = alloca i64, align 8
  %26 = alloca double, align 8
  %27 = alloca %"struct.alglib_impl::ae_shared_pool", align 8
  %28 = alloca ptr, align 8
  %29 = alloca %"struct.alglib_impl::ae_smart_ptr", align 8
  %30 = alloca i32, align 4
  store ptr %0, ptr %10, align 8, !tbaa !5
  store ptr %1, ptr %11, align 8, !tbaa !5
  store i64 %2, ptr %12, align 8, !tbaa !9
  store ptr %3, ptr %13, align 8, !tbaa !5
  store i64 %4, ptr %14, align 8, !tbaa !9
  store ptr %5, ptr %15, align 8, !tbaa !5
  %31 = zext i1 %6 to i8
  store i8 %31, ptr %16, align 1, !tbaa !11
  store ptr %7, ptr %17, align 8, !tbaa !5
  store ptr %8, ptr %18, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 32, ptr %19) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %21) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %22) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %23) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %24) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %25) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %26) #4
  call void @llvm.lifetime.start.p0(i64 136, ptr %27) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %28) #4
  call void @llvm.lifetime.start.p0(i64 80, ptr %29) #4
  %32 = load ptr, ptr %18, align 8, !tbaa !5
  call void @_ZN11alglib_impl13ae_frame_makeEPNS_8ae_stateEPNS_8ae_frameE(ptr noundef %32, ptr noundef %19)
  call void @llvm.memset.p0.i64(ptr align 8 %27, i8 0, i64 136, i1 false)
  call void @llvm.memset.p0.i64(ptr align 8 %29, i8 0, i64 80, i1 false)
  %33 = load ptr, ptr %18, align 8, !tbaa !5
  call void @_ZN11alglib_impl19ae_shared_pool_initEPvPNS_8ae_stateEb(ptr noundef %27, ptr noundef %33, i1 noundef zeroext true)
  %34 = load ptr, ptr %18, align 8, !tbaa !5
  call void @_ZN11alglib_impl17ae_smart_ptr_initEPNS_12ae_smart_ptrEPPvPNS_8ae_stateEb(ptr noundef %29, ptr noundef %28, ptr noundef %34, i1 noundef zeroext true)
  %35 = load i64, ptr %12, align 8, !tbaa !9
  %36 = icmp sgt i64 %35, 0
  %37 = load ptr, ptr %18, align 8, !tbaa !5
  call void @_ZN11alglib_impl9ae_assertEbPKcPNS_8ae_stateE(i1 noundef zeroext %36, ptr noundef @.str.178, ptr noundef %37)
  %38 = load i64, ptr %14, align 8, !tbaa !9
  %39 = icmp sgt i64 %38, 0
  %40 = load ptr, ptr %18, align 8, !tbaa !5
  call void @_ZN11alglib_impl9ae_assertEbPKcPNS_8ae_stateE(i1 noundef zeroext %39, ptr noundef @.str.179, ptr noundef %40)
  %41 = load ptr, ptr %11, align 8, !tbaa !5
  %42 = getelementptr inbounds %"struct.alglib_impl::ae_vector", ptr %41, i32 0, i32 0
  %43 = load i64, ptr %42, align 8, !tbaa !13
  %44 = load i64, ptr %12, align 8, !tbaa !9
  %45 = icmp sge i64 %43, %44
  %46 = load ptr, ptr %18, align 8, !tbaa !5
  call void @_ZN11alglib_impl9ae_assertEbPKcPNS_8ae_stateE(i1 noundef zeroext %45, ptr noundef @.str.180, ptr noundef %46)
  %47 = load ptr, ptr %13, align 8, !tbaa !5
  %48 = getelementptr inbounds %"struct.alglib_impl::ae_vector", ptr %47, i32 0, i32 0
  %49 = load i64, ptr %48, align 8, !tbaa !13
  %50 = load i64, ptr %14, align 8, !tbaa !9
  %51 = icmp sge i64 %49, %50
  %52 = load ptr, ptr %18, align 8, !tbaa !5
  call void @_ZN11alglib_impl9ae_assertEbPKcPNS_8ae_stateE(i1 noundef zeroext %51, ptr noundef @.str.181, ptr noundef %52)
  %53 = load ptr, ptr %11, align 8, !tbaa !5
  %54 = load i64, ptr %12, align 8, !tbaa !9
  %55 = load ptr, ptr %18, align 8, !tbaa !5
  %56 = call noundef zeroext i1 @_ZN11alglib_impl14isfinitevectorEPKNS_9ae_vectorElPNS_8ae_stateE(ptr noundef %53, i64 noundef %54, ptr noundef %55)
  %57 = load ptr, ptr %18, align 8, !tbaa !5
  call void @_ZN11alglib_impl9ae_assertEbPKcPNS_8ae_stateE(i1 noundef zeroext %56, ptr noundef @.str.182, ptr noundef %57)
  %58 = load ptr, ptr %13, align 8, !tbaa !5
  %59 = load i64, ptr %14, align 8, !tbaa !9
  %60 = load ptr, ptr %18, align 8, !tbaa !5
  %61 = call noundef zeroext i1 @_ZN11alglib_impl14isfinitevectorEPKNS_9ae_vectorElPNS_8ae_stateE(ptr noundef %58, i64 noundef %59, ptr noundef %60)
  %62 = load ptr, ptr %18, align 8, !tbaa !5
  call void @_ZN11alglib_impl9ae_assertEbPKcPNS_8ae_stateE(i1 noundef zeroext %61, ptr noundef @.str.183, ptr noundef %62)
  store i64 0, ptr %22, align 8, !tbaa !9
  br label %63

63:                                               ; preds = %84, %9
  %64 = load i64, ptr %22, align 8, !tbaa !9
  %65 = load i64, ptr %12, align 8, !tbaa !9
  %66 = sub nsw i64 %65, 2
  %67 = icmp sle i64 %64, %66
  br i1 %67, label %68, label %87

68:                                               ; preds = %63
  %69 = load ptr, ptr %11, align 8, !tbaa !5
  %70 = getelementptr inbounds %"struct.alglib_impl::ae_vector", ptr %69, i32 0, i32 4
  %71 = load ptr, ptr %70, align 8, !tbaa !16
  %72 = load i64, ptr %22, align 8, !tbaa !9
  %73 = getelementptr inbounds double, ptr %71, i64 %72
  %74 = load double, ptr %73, align 8, !tbaa !17
  %75 = load ptr, ptr %11, align 8, !tbaa !5
  %76 = getelementptr inbounds %"struct.alglib_impl::ae_vector", ptr %75, i32 0, i32 4
  %77 = load ptr, ptr %76, align 8, !tbaa !16
  %78 = load i64, ptr %22, align 8, !tbaa !9
  %79 = add nsw i64 %78, 1
  %80 = getelementptr inbounds double, ptr %77, i64 %79
  %81 = load double, ptr %80, align 8, !tbaa !17
  %82 = call noundef zeroext i1 @_ZN11alglib_impl13ae_fp_less_eqEdd(double noundef %74, double noundef %81)
  %83 = load ptr, ptr %18, align 8, !tbaa !5
  call void @_ZN11alglib_impl9ae_assertEbPKcPNS_8ae_stateE(i1 noundef zeroext %82, ptr noundef @.str.184, ptr noundef %83)
  br label %84

84:                                               ; preds = %68
  %85 = load i64, ptr %22, align 8, !tbaa !9
  %86 = add nsw i64 %85, 1
  store i64 %86, ptr %22, align 8, !tbaa !9
  br label %63, !llvm.loop !19

87:                                               ; preds = %63
  store i64 0, ptr %22, align 8, !tbaa !9
  br label %88

88:                                               ; preds = %109, %87
  %89 = load i64, ptr %22, align 8, !tbaa !9
  %90 = load i64, ptr %14, align 8, !tbaa !9
  %91 = sub nsw i64 %90, 2
  %92 = icmp sle i64 %89, %91
  br i1 %92, label %93, label %112

93:                                               ; preds = %88
  %94 = load ptr, ptr %13, align 8, !tbaa !5
  %95 = getelementptr inbounds %"struct.alglib_impl::ae_vector", ptr %94, i32 0, i32 4
  %96 = load ptr, ptr %95, align 8, !tbaa !16
  %97 = load i64, ptr %22, align 8, !tbaa !9
  %98 = getelementptr inbounds double, ptr %96, i64 %97
  %99 = load double, ptr %98, align 8, !tbaa !17
  %100 = load ptr, ptr %13, align 8, !tbaa !5
  %101 = getelementptr inbounds %"struct.alglib_impl::ae_vector", ptr %100, i32 0, i32 4
  %102 = load ptr, ptr %101, align 8, !tbaa !16
  %103 = load i64, ptr %22, align 8, !tbaa !9
  %104 = add nsw i64 %103, 1
  %105 = getelementptr inbounds double, ptr %102, i64 %104
  %106 = load double, ptr %105, align 8, !tbaa !17
  %107 = call noundef zeroext i1 @_ZN11alglib_impl13ae_fp_less_eqEdd(double noundef %99, double noundef %106)
  %108 = load ptr, ptr %18, align 8, !tbaa !5
  call void @_ZN11alglib_impl9ae_assertEbPKcPNS_8ae_stateE(i1 noundef zeroext %107, ptr noundef @.str.185, ptr noundef %108)
  br label %109

109:                                              ; preds = %93
  %110 = load i64, ptr %22, align 8, !tbaa !9
  %111 = add nsw i64 %110, 1
  store i64 %111, ptr %22, align 8, !tbaa !9
  br label %88, !llvm.loop !21

112:                                              ; preds = %88
  %113 = load ptr, ptr %10, align 8, !tbaa !5
  %114 = getelementptr inbounds %"struct.alglib_impl::idwmodel", ptr %113, i32 0, i32 0
  %115 = load i64, ptr %114, align 8, !tbaa !22
  store i64 %115, ptr %20, align 8, !tbaa !9
  %116 = load ptr, ptr %10, align 8, !tbaa !5
  %117 = getelementptr inbounds %"struct.alglib_impl::idwmodel", ptr %116, i32 0, i32 1
  %118 = load i64, ptr %117, align 8, !tbaa !28
  store i64 %118, ptr %21, align 8, !tbaa !9
  %119 = load ptr, ptr %10, align 8, !tbaa !5
  %120 = getelementptr inbounds %"struct.alglib_impl::idwmodel", ptr %119, i32 0, i32 15
  %121 = load ptr, ptr %18, align 8, !tbaa !5
  call void @_ZN11alglib_impl23ae_shared_pool_set_seedEPNS_14ae_shared_poolEPKvlPFvPvS3_PNS_8ae_stateEbEPFvS4_ES6_(ptr noundef %27, ptr noundef %120, i64 noundef 1024, ptr noundef @_ZN11alglib_impl24_idwcalcbuffer_init_copyEPvPKvPNS_8ae_stateEb, ptr noundef @_ZN11alglib_impl22_idwcalcbuffer_destroyEPv, ptr noundef %121)
  %122 = load i64, ptr %21, align 8, !tbaa !9
  %123 = load i64, ptr %12, align 8, !tbaa !9
  %124 = mul nsw i64 %122, %123
  %125 = load i64, ptr %14, align 8, !tbaa !9
  %126 = mul nsw i64 %124, %125
  store i64 %126, ptr %25, align 8, !tbaa !9
  %127 = load ptr, ptr %17, align 8, !tbaa !5
  %128 = load i64, ptr %25, align 8, !tbaa !9
  %129 = load ptr, ptr %18, align 8, !tbaa !5
  call void @_ZN11alglib_impl20ae_vector_set_lengthEPNS_9ae_vectorElPNS_8ae_stateE(ptr noundef %127, i64 noundef %128, ptr noundef %129)
  %130 = load i64, ptr %25, align 8, !tbaa !9
  %131 = load ptr, ptr %17, align 8, !tbaa !5
  %132 = load ptr, ptr %18, align 8, !tbaa !5
  call void @_ZN11alglib_impl5rsetvEldPNS_9ae_vectorEPNS_8ae_stateE(i64 noundef %130, double noundef 0.000000e+00, ptr noundef %131, ptr noundef %132)
  %133 = load i64, ptr %20, align 8, !tbaa !9
  %134 = icmp ne i64 %133, 2
  br i1 %134, label %135, label %137

135:                                              ; preds = %112
  %136 = load ptr, ptr %18, align 8, !tbaa !5
  call void @_ZN11alglib_impl14ae_frame_leaveEPNS_8ae_stateE(ptr noundef %136)
  store i32 1, ptr %30, align 4
  br label %248

137:                                              ; preds = %112
  store double 0.000000e+00, ptr %26, align 8, !tbaa !17
  %138 = load ptr, ptr %10, align 8, !tbaa !5
  %139 = getelementptr inbounds %"struct.alglib_impl::idwmodel", ptr %138, i32 0, i32 3
  %140 = load i64, ptr %139, align 8, !tbaa !29
  %141 = icmp eq i64 %140, 0
  br i1 %141, label %152, label %142

142:                                              ; preds = %137
  %143 = load ptr, ptr %10, align 8, !tbaa !5
  %144 = getelementptr inbounds %"struct.alglib_impl::idwmodel", ptr %143, i32 0, i32 3
  %145 = load i64, ptr %144, align 8, !tbaa !29
  %146 = icmp eq i64 %145, 1
  br i1 %146, label %152, label %147

147:                                              ; preds = %142
  %148 = load ptr, ptr %10, align 8, !tbaa !5
  %149 = getelementptr inbounds %"struct.alglib_impl::idwmodel", ptr %148, i32 0, i32 3
  %150 = load i64, ptr %149, align 8, !tbaa !29
  %151 = icmp eq i64 %150, 2
  br label %152

152:                                              ; preds = %147, %142, %137
  %153 = phi i1 [ true, %142 ], [ true, %137 ], [ %151, %147 ]
  %154 = load ptr, ptr %18, align 8, !tbaa !5
  call void @_ZN11alglib_impl9ae_assertEbPKcPNS_8ae_stateE(i1 noundef zeroext %153, ptr noundef @.str.186, ptr noundef %154)
  %155 = load ptr, ptr %10, align 8, !tbaa !5
  %156 = getelementptr inbounds %"struct.alglib_impl::idwmodel", ptr %155, i32 0, i32 3
  %157 = load i64, ptr %156, align 8, !tbaa !29
  %158 = icmp eq i64 %157, 0
  br i1 %158, label %159, label %173

159:                                              ; preds = %152
  %160 = load double, ptr %26, align 8, !tbaa !17
  %161 = load ptr, ptr %10, align 8, !tbaa !5
  %162 = getelementptr inbounds %"struct.alglib_impl::idwmodel", ptr %161, i32 0, i32 13
  %163 = load i64, ptr %162, align 8, !tbaa !30
  %164 = load i64, ptr %20, align 8, !tbaa !9
  %165 = mul nsw i64 5, %164
  %166 = load i64, ptr %21, align 8, !tbaa !9
  %167 = mul nsw i64 5, %166
  %168 = add nsw i64 %165, %167
  %169 = add nsw i64 %168, 50
  %170 = mul nsw i64 %163, %169
  %171 = sitofp i64 %170 to double
  %172 = fadd double %160, %171
  store double %172, ptr %26, align 8, !tbaa !17
  br label %173

173:                                              ; preds = %159, %152
  %174 = load ptr, ptr %10, align 8, !tbaa !5
  %175 = getelementptr inbounds %"struct.alglib_impl::idwmodel", ptr %174, i32 0, i32 3
  %176 = load i64, ptr %175, align 8, !tbaa !29
  %177 = icmp eq i64 %176, 1
  br i1 %177, label %178, label %192

178:                                              ; preds = %173
  %179 = load ptr, ptr %18, align 8, !tbaa !5
  call void @_ZN11alglib_impl23ae_shared_pool_retrieveEPNS_14ae_shared_poolEPNS_12ae_smart_ptrEPNS_8ae_stateE(ptr noundef %27, ptr noundef %29, ptr noundef %179)
  %180 = load double, ptr %26, align 8, !tbaa !17
  %181 = load ptr, ptr %10, align 8, !tbaa !5
  %182 = getelementptr inbounds %"struct.alglib_impl::idwmodel", ptr %181, i32 0, i32 12
  %183 = load ptr, ptr %28, align 8, !tbaa !5
  %184 = getelementptr inbounds %"struct.alglib_impl::idwcalcbuffer", ptr %183, i32 0, i32 6
  %185 = load ptr, ptr %10, align 8, !tbaa !5
  %186 = getelementptr inbounds %"struct.alglib_impl::idwmodel", ptr %185, i32 0, i32 5
  %187 = load double, ptr %186, align 8, !tbaa !31
  %188 = load ptr, ptr %18, align 8, !tbaa !5
  %189 = call noundef double @_ZN11alglib_impl26kdtreetsapproxrnnquerycostEPKNS_6kdtreeEPNS_19kdtreerequestbufferEdPNS_8ae_stateE(ptr noundef %182, ptr noundef %184, double noundef %187, ptr noundef %188)
  %190 = fadd double %180, %189
  store double %190, ptr %26, align 8, !tbaa !17
  %191 = load ptr, ptr %18, align 8, !tbaa !5
  call void @_ZN11alglib_impl22ae_shared_pool_recycleEPNS_14ae_shared_poolEPNS_12ae_smart_ptrEPNS_8ae_stateE(ptr noundef %27, ptr noundef %29, ptr noundef %191)
  br label %192

192:                                              ; preds = %178, %173
  %193 = load ptr, ptr %10, align 8, !tbaa !5
  %194 = getelementptr inbounds %"struct.alglib_impl::idwmodel", ptr %193, i32 0, i32 3
  %195 = load i64, ptr %194, align 8, !tbaa !29
  %196 = icmp eq i64 %195, 2
  br i1 %196, label %197, label %230

197:                                              ; preds = %192
  %198 = load ptr, ptr %18, align 8, !tbaa !5
  call void @_ZN11alglib_impl23ae_shared_pool_retrieveEPNS_14ae_shared_poolEPNS_12ae_smart_ptrEPNS_8ae_stateE(ptr noundef %27, ptr noundef %29, ptr noundef %198)
  %199 = load ptr, ptr %10, align 8, !tbaa !5
  %200 = getelementptr inbounds %"struct.alglib_impl::idwmodel", ptr %199, i32 0, i32 5
  %201 = load double, ptr %200, align 8, !tbaa !31
  store double %201, ptr %24, align 8, !tbaa !17
  store i64 0, ptr %23, align 8, !tbaa !9
  br label %202

202:                                              ; preds = %225, %197
  %203 = load i64, ptr %23, align 8, !tbaa !9
  %204 = load ptr, ptr %10, align 8, !tbaa !5
  %205 = getelementptr inbounds %"struct.alglib_impl::idwmodel", ptr %204, i32 0, i32 4
  %206 = load i64, ptr %205, align 8, !tbaa !32
  %207 = sub nsw i64 %206, 1
  %208 = icmp sle i64 %203, %207
  br i1 %208, label %209, label %228

209:                                              ; preds = %202
  %210 = load double, ptr %26, align 8, !tbaa !17
  %211 = load ptr, ptr %10, align 8, !tbaa !5
  %212 = getelementptr inbounds %"struct.alglib_impl::idwmodel", ptr %211, i32 0, i32 12
  %213 = load ptr, ptr %28, align 8, !tbaa !5
  %214 = getelementptr inbounds %"struct.alglib_impl::idwcalcbuffer", ptr %213, i32 0, i32 6
  %215 = load double, ptr %24, align 8, !tbaa !17
  %216 = load ptr, ptr %18, align 8, !tbaa !5
  %217 = call noundef double @_ZN11alglib_impl26kdtreetsapproxrnnquerycostEPKNS_6kdtreeEPNS_19kdtreerequestbufferEdPNS_8ae_stateE(ptr noundef %212, ptr noundef %214, double noundef %215, ptr noundef %216)
  %218 = fadd double %217, 5.000000e+01
  %219 = fadd double %210, %218
  store double %219, ptr %26, align 8, !tbaa !17
  %220 = load double, ptr %24, align 8, !tbaa !17
  %221 = load ptr, ptr %10, align 8, !tbaa !5
  %222 = getelementptr inbounds %"struct.alglib_impl::idwmodel", ptr %221, i32 0, i32 6
  %223 = load double, ptr %222, align 8, !tbaa !33
  %224 = fmul double %220, %223
  store double %224, ptr %24, align 8, !tbaa !17
  br label %225

225:                                              ; preds = %209
  %226 = load i64, ptr %23, align 8, !tbaa !9
  %227 = add nsw i64 %226, 1
  store i64 %227, ptr %23, align 8, !tbaa !9
  br label %202, !llvm.loop !34

228:                                              ; preds = %202
  %229 = load ptr, ptr %18, align 8, !tbaa !5
  call void @_ZN11alglib_impl22ae_shared_pool_recycleEPNS_14ae_shared_poolEPNS_12ae_smart_ptrEPNS_8ae_stateE(ptr noundef %27, ptr noundef %29, ptr noundef %229)
  br label %230

230:                                              ; preds = %228, %192
  %231 = load double, ptr %26, align 8, !tbaa !17
  %232 = load ptr, ptr %18, align 8, !tbaa !5
  %233 = call noundef double @_ZN11alglib_impl8coalesceEddPNS_8ae_stateE(double noundef %231, double noundef 5.000000e+01, ptr noundef %232)
  store double %233, ptr %26, align 8, !tbaa !17
  %234 = load ptr, ptr %10, align 8, !tbaa !5
  %235 = load ptr, ptr %11, align 8, !tbaa !5
  %236 = load i64, ptr %12, align 8, !tbaa !9
  %237 = load i64, ptr %12, align 8, !tbaa !9
  %238 = load ptr, ptr %13, align 8, !tbaa !5
  %239 = load i64, ptr %14, align 8, !tbaa !9
  %240 = load i64, ptr %14, align 8, !tbaa !9
  %241 = load ptr, ptr %15, align 8, !tbaa !5
  %242 = load i8, ptr %16, align 1, !tbaa !11, !range !35, !noundef !36
  %243 = trunc i8 %242 to i1
  %244 = load double, ptr %26, align 8, !tbaa !17
  %245 = load ptr, ptr %17, align 8, !tbaa !5
  %246 = load ptr, ptr %18, align 8, !tbaa !5
  call void @_ZN11alglib_implL19idw_idwgridcalc2recEPKNS_8idwmodelEPKNS_9ae_vectorElllS5_lllS5_bPNS_14ae_shared_poolEbdPS3_PNS_8ae_stateE(ptr noundef %234, ptr noundef %235, i64 noundef 0, i64 noundef %236, i64 noundef %237, ptr noundef %238, i64 noundef 0, i64 noundef %239, i64 noundef %240, ptr noundef %241, i1 noundef zeroext %243, ptr noundef %27, i1 noundef zeroext true, double noundef %244, ptr noundef %245, ptr noundef %246)
  %247 = load ptr, ptr %18, align 8, !tbaa !5
  call void @_ZN11alglib_impl14ae_frame_leaveEPNS_8ae_stateE(ptr noundef %247)
  store i32 0, ptr %30, align 4
  br label %248

248:                                              ; preds = %230, %135
  call void @llvm.lifetime.end.p0(i64 80, ptr %29) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %28) #4
  call void @llvm.lifetime.end.p0(i64 136, ptr %27) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %26) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %25) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %24) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %23) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #4
  call void @llvm.lifetime.end.p0(i64 32, ptr %19) #4
  %249 = load i32, ptr %30, align 4
  switch i32 %249, label %251 [
    i32 0, label %250
    i32 1, label %250
  ]

250:                                              ; preds = %248, %248
  ret void

251:                                              ; preds = %248
  unreachable
}

declare void @_ZN11alglib_impl17ae_smart_ptr_initEPNS_12ae_smart_ptrEPPvPNS_8ae_stateEb(ptr noundef, ptr noundef, ptr noundef, i1 noundef zeroext) #2

declare void @_ZN11alglib_impl5rsetvEldPNS_9ae_vectorEPNS_8ae_stateE(i64 noundef, double noundef, ptr noundef, ptr noundef) #2

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

declare noundef double @_ZN11alglib_impl26kdtreetsapproxrnnquerycostEPKNS_6kdtreeEPNS_19kdtreerequestbufferEdPNS_8ae_stateE(ptr noundef, ptr noundef, double noundef, ptr noundef) #2

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

; Function Attrs: mustprogress uwtable
declare hidden void @_ZN11alglib_implL19idw_idwgridcalc2recEPKNS_8idwmodelEPKNS_9ae_vectorElllS5_lllS5_bPNS_14ae_shared_poolEbdPS3_PNS_8ae_stateE(ptr noundef, ptr noundef, i64 noundef, i64 noundef, i64 noundef, ptr noundef, i64 noundef, i64 noundef, i64 noundef, ptr noundef, i1 noundef zeroext, ptr noundef, i1 noundef zeroext, double noundef, ptr noundef, ptr noundef) #3

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 = !{!12, !12, i64 0}
!12 = !{!"bool", !7, i64 0}
!13 = !{!14, !10, i64 0}
!14 = !{!"_ZTSN11alglib_impl9ae_vectorE", !10, i64 0, !10, i64 8, !12, i64 16, !15, i64 24, !7, i64 56}
!15 = !{!"_ZTSN11alglib_impl12ae_dyn_blockE", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24}
!16 = !{!7, !7, i64 0}
!17 = !{!18, !18, i64 0}
!18 = !{!"double", !7, i64 0}
!19 = distinct !{!19, !20}
!20 = !{!"llvm.loop.mustprogress"}
!21 = distinct !{!21, !20}
!22 = !{!23, !10, i64 0}
!23 = !{!"_ZTSN11alglib_impl8idwmodelE", !10, i64 0, !10, i64 8, !14, i64 16, !10, i64 80, !10, i64 88, !18, i64 96, !18, i64 104, !18, i64 112, !18, i64 120, !18, i64 128, !18, i64 136, !12, i64 144, !24, i64 152, !10, i64 1216, !14, i64 1224, !27, i64 1288}
!24 = !{!"_ZTSN11alglib_impl6kdtreeE", !10, i64 0, !10, i64 8, !10, i64 16, !10, i64 24, !25, i64 32, !14, i64 112, !14, i64 176, !14, i64 240, !14, i64 304, !14, i64 368, !26, i64 432, !10, i64 1056}
!25 = !{!"_ZTSN11alglib_impl9ae_matrixE", !10, i64 0, !10, i64 8, !10, i64 16, !10, i64 24, !12, i64 32, !15, i64 40, !7, i64 72}
!26 = !{!"_ZTSN11alglib_impl19kdtreerequestbufferE", !14, i64 0, !14, i64 64, !14, i64 128, !10, i64 192, !18, i64 200, !12, i64 208, !18, i64 216, !10, i64 224, !14, i64 232, !14, i64 296, !14, i64 360, !14, i64 424, !14, i64 488, !18, i64 552, !14, i64 560}
!27 = !{!"_ZTSN11alglib_impl13idwcalcbufferE", !14, i64 0, !14, i64 64, !14, i64 128, !14, i64 192, !25, i64 256, !14, i64 336, !26, i64 400}
!28 = !{!23, !10, i64 8}
!29 = !{!23, !10, i64 80}
!30 = !{!23, !10, i64 1216}
!31 = !{!23, !18, i64 96}
!32 = !{!23, !10, i64 88}
!33 = !{!23, !18, i64 104}
!34 = distinct !{!34, !20}
!35 = !{i8 0, i8 2}
!36 = !{}


; 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_shared_pool" = type { %"struct.alglib_impl::ae_lock", ptr, ptr, ptr, ptr, i64, ptr, ptr, %"struct.alglib_impl::ae_dyn_block" }
%"struct.alglib_impl::ae_lock" = type { ptr, %"struct.alglib_impl::ae_dyn_block", i8 }
%"struct.alglib_impl::ae_smart_ptr" = type { ptr, ptr, i8, i8, i64, ptr, ptr, %"struct.alglib_impl::ae_dyn_block" }

@.str.178 = external hidden unnamed_addr constant [46 x i8], align 1
@.str.179 = external hidden unnamed_addr constant [46 x i8], align 1
@.str.180 = external hidden unnamed_addr constant [30 x i8], align 1
@.str.181 = external hidden unnamed_addr constant [30 x i8], align 1
@.str.182 = external hidden unnamed_addr constant [52 x i8], align 1
@.str.183 = external hidden unnamed_addr constant [52 x i8], align 1
@.str.184 = external hidden unnamed_addr constant [47 x i8], align 1
@.str.185 = external hidden unnamed_addr constant [47 x i8], align 1
@.str.186 = external hidden unnamed_addr constant [33 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 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_impl9ae_assertEbPKcPNS_8ae_stateE(i1 noundef zeroext, ptr noundef, ptr noundef) local_unnamed_addr #2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN11alglib_impl22_idwcalcbuffer_destroyEPv(ptr noundef) #3

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN11alglib_impl24_idwcalcbuffer_init_copyEPvPKvPNS_8ae_stateEb(ptr noundef, ptr noundef, ptr noundef, i1 noundef zeroext) #3

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

declare noundef zeroext i1 @_ZN11alglib_impl14isfinitevectorEPKNS_9ae_vectorElPNS_8ae_stateE(ptr noundef, i64 noundef, ptr noundef) local_unnamed_addr #2

declare void @_ZN11alglib_impl19ae_shared_pool_initEPvPNS_8ae_stateEb(ptr noundef, ptr noundef, i1 noundef zeroext) local_unnamed_addr #2

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

declare noundef double @_ZN11alglib_impl8coalesceEddPNS_8ae_stateE(double noundef, double noundef, ptr noundef) local_unnamed_addr #2

declare noundef zeroext i1 @_ZN11alglib_impl13ae_fp_less_eqEdd(double noundef, double noundef) local_unnamed_addr #2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN11alglib_impl14idwgridcalc2vxEPKNS_8idwmodelEPKNS_9ae_vectorElS5_lS5_bPS3_PNS_8ae_stateE(ptr noundef %0, ptr noundef %1, i64 noundef %2, ptr noundef %3, i64 noundef %4, ptr noundef %5, i1 noundef zeroext %6, ptr noundef %7, ptr noundef %8) local_unnamed_addr #3 {
  %10 = alloca %"struct.alglib_impl::ae_frame", align 8
  %11 = alloca %"struct.alglib_impl::ae_shared_pool", align 8
  %12 = alloca ptr, align 8
  %13 = alloca %"struct.alglib_impl::ae_smart_ptr", align 8
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %10) #4
  call void @llvm.lifetime.start.p0(i64 136, ptr nonnull %11) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %12) #4
  call void @llvm.lifetime.start.p0(i64 80, ptr nonnull %13) #4
  call void @_ZN11alglib_impl13ae_frame_makeEPNS_8ae_stateEPNS_8ae_frameE(ptr noundef %8, ptr noundef nonnull %10)
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(136) %11, i8 0, i64 136, i1 false)
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(80) %13, i8 0, i64 80, i1 false)
  call void @_ZN11alglib_impl19ae_shared_pool_initEPvPNS_8ae_stateEb(ptr noundef nonnull %11, ptr noundef %8, i1 noundef zeroext true)
  call void @_ZN11alglib_impl17ae_smart_ptr_initEPNS_12ae_smart_ptrEPPvPNS_8ae_stateEb(ptr noundef nonnull %13, ptr noundef nonnull %12, ptr noundef %8, i1 noundef zeroext true)
  %14 = icmp sgt i64 %2, 0
  call void @_ZN11alglib_impl9ae_assertEbPKcPNS_8ae_stateE(i1 noundef zeroext %14, ptr noundef nonnull @.str.178, ptr noundef %8)
  %15 = icmp sgt i64 %4, 0
  call void @_ZN11alglib_impl9ae_assertEbPKcPNS_8ae_stateE(i1 noundef zeroext %15, ptr noundef nonnull @.str.179, ptr noundef %8)
  %16 = load i64, ptr %1, align 8, !tbaa !5
  %17 = icmp sge i64 %16, %2
  call void @_ZN11alglib_impl9ae_assertEbPKcPNS_8ae_stateE(i1 noundef zeroext %17, ptr noundef nonnull @.str.180, ptr noundef %8)
  %18 = load i64, ptr %3, align 8, !tbaa !5
  %19 = icmp sge i64 %18, %4
  call void @_ZN11alglib_impl9ae_assertEbPKcPNS_8ae_stateE(i1 noundef zeroext %19, ptr noundef nonnull @.str.181, ptr noundef %8)
  %20 = call noundef zeroext i1 @_ZN11alglib_impl14isfinitevectorEPKNS_9ae_vectorElPNS_8ae_stateE(ptr noundef nonnull %1, i64 noundef %2, ptr noundef %8)
  call void @_ZN11alglib_impl9ae_assertEbPKcPNS_8ae_stateE(i1 noundef zeroext %20, ptr noundef nonnull @.str.182, ptr noundef %8)
  %21 = call noundef zeroext i1 @_ZN11alglib_impl14isfinitevectorEPKNS_9ae_vectorElPNS_8ae_stateE(ptr noundef nonnull %3, i64 noundef %4, ptr noundef %8)
  call void @_ZN11alglib_impl9ae_assertEbPKcPNS_8ae_stateE(i1 noundef zeroext %21, ptr noundef nonnull @.str.183, ptr noundef %8)
  %.not105 = icmp slt i64 %2, 2
  br i1 %.not105, label %.preheader, label %.lr.ph

.lr.ph:                                           ; preds = %9
  %22 = getelementptr inbounds i8, ptr %1, i64 56
  %23 = add nsw i64 %2, -2
  br label %26

.preheader:                                       ; preds = %26, %9
  %.not101107 = icmp slt i64 %4, 2
  br i1 %.not101107, label %._crit_edge, label %.lr.ph109

.lr.ph109:                                        ; preds = %.preheader
  %24 = getelementptr inbounds i8, ptr %3, i64 56
  %25 = add nsw i64 %4, -2
  br label %34

26:                                               ; preds = %.lr.ph, %26
  %.095106 = phi i64 [ 0, %.lr.ph ], [ %30, %26 ]
  %27 = load ptr, ptr %22, align 8, !tbaa !13
  %28 = getelementptr inbounds double, ptr %27, i64 %.095106
  %29 = load double, ptr %28, align 8, !tbaa !14
  %30 = add nuw nsw i64 %.095106, 1
  %31 = getelementptr inbounds double, ptr %27, i64 %30
  %32 = load double, ptr %31, align 8, !tbaa !14
  %33 = call noundef zeroext i1 @_ZN11alglib_impl13ae_fp_less_eqEdd(double noundef %29, double noundef %32)
  call void @_ZN11alglib_impl9ae_assertEbPKcPNS_8ae_stateE(i1 noundef zeroext %33, ptr noundef nonnull @.str.184, ptr noundef %8)
  %exitcond.not = icmp eq i64 %.095106, %23
  br i1 %exitcond.not, label %.preheader, label %26, !llvm.loop !16

34:                                               ; preds = %.lr.ph109, %34
  %.196108 = phi i64 [ 0, %.lr.ph109 ], [ %38, %34 ]
  %35 = load ptr, ptr %24, align 8, !tbaa !13
  %36 = getelementptr inbounds double, ptr %35, i64 %.196108
  %37 = load double, ptr %36, align 8, !tbaa !14
  %38 = add nuw nsw i64 %.196108, 1
  %39 = getelementptr inbounds double, ptr %35, i64 %38
  %40 = load double, ptr %39, align 8, !tbaa !14
  %41 = call noundef zeroext i1 @_ZN11alglib_impl13ae_fp_less_eqEdd(double noundef %37, double noundef %40)
  call void @_ZN11alglib_impl9ae_assertEbPKcPNS_8ae_stateE(i1 noundef zeroext %41, ptr noundef nonnull @.str.185, ptr noundef %8)
  %exitcond117.not = icmp eq i64 %.196108, %25
  br i1 %exitcond117.not, label %._crit_edge, label %34, !llvm.loop !18

._crit_edge:                                      ; preds = %34, %.preheader
  %42 = load i64, ptr %0, align 8, !tbaa !19
  %43 = getelementptr inbounds i8, ptr %0, i64 8
  %44 = load i64, ptr %43, align 8, !tbaa !25
  %45 = getelementptr inbounds i8, ptr %0, i64 1288
  call void @_ZN11alglib_impl23ae_shared_pool_set_seedEPNS_14ae_shared_poolEPKvlPFvPvS3_PNS_8ae_stateEbEPFvS4_ES6_(ptr noundef nonnull %11, ptr noundef nonnull %45, i64 noundef 1024, ptr noundef nonnull @_ZN11alglib_impl24_idwcalcbuffer_init_copyEPvPKvPNS_8ae_stateEb, ptr noundef nonnull @_ZN11alglib_impl22_idwcalcbuffer_destroyEPv, ptr noundef %8)
  %46 = mul i64 %4, %2
  %47 = mul i64 %46, %44
  call void @_ZN11alglib_impl20ae_vector_set_lengthEPNS_9ae_vectorElPNS_8ae_stateE(ptr noundef %7, i64 noundef %47, ptr noundef %8)
  call void @_ZN11alglib_impl5rsetvEldPNS_9ae_vectorEPNS_8ae_stateE(i64 noundef %47, double noundef 0.000000e+00, ptr noundef %7, ptr noundef %8)
  %.not102 = icmp eq i64 %42, 2
  br i1 %.not102, label %switch.edge, label %86

switch.edge:                                      ; preds = %._crit_edge
  %48 = getelementptr inbounds i8, ptr %0, i64 80
  %49 = load i64, ptr %48, align 8, !tbaa !26
  %switch = icmp ult i64 %49, 3
  call void @_ZN11alglib_impl9ae_assertEbPKcPNS_8ae_stateE(i1 noundef zeroext %switch, ptr noundef nonnull @.str.186, ptr noundef %8)
  %50 = load i64, ptr %48, align 8, !tbaa !26
  switch i64 %50, label %thread-pre-split [
    i64 0, label %thread-pre-split.thread
    i64 1, label %57
  ]

thread-pre-split.thread:                          ; preds = %switch.edge
  %51 = getelementptr inbounds i8, ptr %0, i64 1216
  %52 = load i64, ptr %51, align 8, !tbaa !27
  %53 = mul nsw i64 %44, 5
  %54 = add nsw i64 %53, 60
  %55 = mul nsw i64 %52, %54
  %56 = sitofp i64 %55 to double
  br label %84

57:                                               ; preds = %switch.edge
  call void @_ZN11alglib_impl23ae_shared_pool_retrieveEPNS_14ae_shared_poolEPNS_12ae_smart_ptrEPNS_8ae_stateE(ptr noundef nonnull %11, ptr noundef nonnull %13, ptr noundef %8)
  %58 = getelementptr inbounds i8, ptr %0, i64 152
  %59 = load ptr, ptr %12, align 8, !tbaa !28
  %60 = getelementptr inbounds i8, ptr %59, i64 400
  %61 = getelementptr inbounds i8, ptr %0, i64 96
  %62 = load double, ptr %61, align 8, !tbaa !29
  %63 = call noundef double @_ZN11alglib_impl26kdtreetsapproxrnnquerycostEPKNS_6kdtreeEPNS_19kdtreerequestbufferEdPNS_8ae_stateE(ptr noundef nonnull %58, ptr noundef nonnull %60, double noundef %62, ptr noundef %8)
  %64 = fadd double %63, 0.000000e+00
  call void @_ZN11alglib_impl22ae_shared_pool_recycleEPNS_14ae_shared_poolEPNS_12ae_smart_ptrEPNS_8ae_stateE(ptr noundef nonnull %11, ptr noundef nonnull %13, ptr noundef %8)
  %.pr.pre = load i64, ptr %48, align 8, !tbaa !26
  br label %thread-pre-split

thread-pre-split:                                 ; preds = %57, %switch.edge
  %65 = phi i64 [ %50, %switch.edge ], [ %.pr.pre, %57 ]
  %.1 = phi double [ 0.000000e+00, %switch.edge ], [ %64, %57 ]
  %66 = icmp eq i64 %65, 2
  br i1 %66, label %67, label %84

67:                                               ; preds = %thread-pre-split
  call void @_ZN11alglib_impl23ae_shared_pool_retrieveEPNS_14ae_shared_poolEPNS_12ae_smart_ptrEPNS_8ae_stateE(ptr noundef nonnull %11, ptr noundef nonnull %13, ptr noundef %8)
  %68 = getelementptr inbounds i8, ptr %0, i64 88
  %69 = load i64, ptr %68, align 8, !tbaa !30
  %.not103.not110 = icmp sgt i64 %69, 0
  br i1 %.not103.not110, label %.lr.ph115, label %._crit_edge116

.lr.ph115:                                        ; preds = %67
  %70 = getelementptr inbounds i8, ptr %0, i64 96
  %71 = load double, ptr %70, align 8, !tbaa !29
  %72 = getelementptr inbounds i8, ptr %0, i64 152
  %73 = getelementptr inbounds i8, ptr %0, i64 104
  br label %74

74:                                               ; preds = %.lr.ph115, %74
  %.2113 = phi double [ %.1, %.lr.ph115 ], [ %79, %74 ]
  %.097112 = phi double [ %71, %.lr.ph115 ], [ %81, %74 ]
  %.098111 = phi i64 [ 0, %.lr.ph115 ], [ %82, %74 ]
  %75 = load ptr, ptr %12, align 8, !tbaa !28
  %76 = getelementptr inbounds i8, ptr %75, i64 400
  %77 = call noundef double @_ZN11alglib_impl26kdtreetsapproxrnnquerycostEPKNS_6kdtreeEPNS_19kdtreerequestbufferEdPNS_8ae_stateE(ptr noundef nonnull %72, ptr noundef nonnull %76, double noundef %.097112, ptr noundef %8)
  %78 = fadd double %77, 5.000000e+01
  %79 = fadd double %.2113, %78
  %80 = load double, ptr %73, align 8, !tbaa !31
  %81 = fmul double %.097112, %80
  %82 = add nuw nsw i64 %.098111, 1
  %83 = load i64, ptr %68, align 8, !tbaa !30
  %.not103.not = icmp slt i64 %82, %83
  br i1 %.not103.not, label %74, label %._crit_edge116, !llvm.loop !32

._crit_edge116:                                   ; preds = %74, %67
  %.2.lcssa = phi double [ %.1, %67 ], [ %79, %74 ]
  call void @_ZN11alglib_impl22ae_shared_pool_recycleEPNS_14ae_shared_poolEPNS_12ae_smart_ptrEPNS_8ae_stateE(ptr noundef nonnull %11, ptr noundef nonnull %13, ptr noundef %8)
  br label %84

84:                                               ; preds = %thread-pre-split.thread, %._crit_edge116, %thread-pre-split
  %.3 = phi double [ %.2.lcssa, %._crit_edge116 ], [ %.1, %thread-pre-split ], [ %56, %thread-pre-split.thread ]
  %85 = call noundef double @_ZN11alglib_impl8coalesceEddPNS_8ae_stateE(double noundef %.3, double noundef 5.000000e+01, ptr noundef %8)
  call void @_ZN11alglib_implL19idw_idwgridcalc2recEPKNS_8idwmodelEPKNS_9ae_vectorElllS5_lllS5_bPNS_14ae_shared_poolEbdPS3_PNS_8ae_stateE(ptr noundef nonnull %0, ptr noundef nonnull %1, i64 noundef 0, i64 noundef %2, i64 noundef %2, ptr noundef nonnull %3, i64 noundef 0, i64 noundef %4, i64 noundef %4, ptr noundef %5, i1 noundef zeroext %6, ptr noundef nonnull %11, i1 noundef zeroext true, double noundef %85, ptr noundef %7, ptr noundef %8)
  br label %86

86:                                               ; preds = %._crit_edge, %84
  call void @_ZN11alglib_impl14ae_frame_leaveEPNS_8ae_stateE(ptr noundef %8)
  call void @llvm.lifetime.end.p0(i64 80, ptr nonnull %13) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %12) #4
  call void @llvm.lifetime.end.p0(i64 136, ptr nonnull %11) #4
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %10) #4
  ret void
}

declare void @_ZN11alglib_impl17ae_smart_ptr_initEPNS_12ae_smart_ptrEPPvPNS_8ae_stateEb(ptr noundef, ptr noundef, ptr noundef, i1 noundef zeroext) local_unnamed_addr #2

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

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

declare noundef double @_ZN11alglib_impl26kdtreetsapproxrnnquerycostEPKNS_6kdtreeEPNS_19kdtreerequestbufferEdPNS_8ae_stateE(ptr noundef, ptr noundef, double noundef, ptr noundef) local_unnamed_addr #2

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

; Function Attrs: mustprogress uwtable
declare hidden void @_ZN11alglib_implL19idw_idwgridcalc2recEPKNS_8idwmodelEPKNS_9ae_vectorElllS5_lllS5_bPNS_14ae_shared_poolEbdPS3_PNS_8ae_stateE(ptr noundef, ptr noundef, i64 noundef, i64 noundef, i64 noundef, ptr noundef, i64 noundef, i64 noundef, i64 noundef, ptr noundef, i1 noundef zeroext, ptr noundef, i1 noundef zeroext, double noundef, ptr noundef, ptr noundef) local_unnamed_addr #3

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, !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 = !{!8, !8, i64 0}
!14 = !{!15, !15, i64 0}
!15 = !{!"double", !8, i64 0}
!16 = distinct !{!16, !17}
!17 = !{!"llvm.loop.mustprogress"}
!18 = distinct !{!18, !17}
!19 = !{!20, !7, i64 0}
!20 = !{!"_ZTSN11alglib_impl8idwmodelE", !7, i64 0, !7, i64 8, !6, i64 16, !7, i64 80, !7, i64 88, !15, i64 96, !15, i64 104, !15, i64 112, !15, i64 120, !15, i64 128, !15, i64 136, !10, i64 144, !21, i64 152, !7, i64 1216, !6, i64 1224, !24, i64 1288}
!21 = !{!"_ZTSN11alglib_impl6kdtreeE", !7, i64 0, !7, i64 8, !7, i64 16, !7, i64 24, !22, i64 32, !6, i64 112, !6, i64 176, !6, i64 240, !6, i64 304, !6, i64 368, !23, i64 432, !7, i64 1056}
!22 = !{!"_ZTSN11alglib_impl9ae_matrixE", !7, i64 0, !7, i64 8, !7, i64 16, !7, i64 24, !10, i64 32, !11, i64 40, !8, i64 72}
!23 = !{!"_ZTSN11alglib_impl19kdtreerequestbufferE", !6, i64 0, !6, i64 64, !6, i64 128, !7, i64 192, !15, i64 200, !10, i64 208, !15, i64 216, !7, i64 224, !6, i64 232, !6, i64 296, !6, i64 360, !6, i64 424, !6, i64 488, !15, i64 552, !6, i64 560}
!24 = !{!"_ZTSN11alglib_impl13idwcalcbufferE", !6, i64 0, !6, i64 64, !6, i64 128, !6, i64 192, !22, i64 256, !6, i64 336, !23, i64 400}
!25 = !{!20, !7, i64 8}
!26 = !{!20, !7, i64 80}
!27 = !{!20, !7, i64 1216}
!28 = !{!12, !12, i64 0}
!29 = !{!20, !15, i64 96}
!30 = !{!20, !7, i64 88}
!31 = !{!20, !15, i64 104}
!32 = distinct !{!32, !17}


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