; LLVM IR from Dimandragon/non-parametric-dsp :: alglib-cpp/src (statistics)

; Unoptimized IR (clang -disable-llvm-passes):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%"struct.alglib_impl::ae_frame" = type { %"struct.alglib_impl::ae_dyn_block" }
%"struct.alglib_impl::ae_dyn_block" = type { ptr, ptr, ptr, ptr }
%"struct.alglib_impl::ae_vector" = type { i64, i64, i8, %"struct.alglib_impl::ae_dyn_block", %union.anon.0 }
%union.anon.0 = type { ptr }

@.str.12 = external hidden unnamed_addr constant [18 x i8], align 1
@.str.13 = external hidden unnamed_addr constant [27 x i8], align 1
@.str.14 = external hidden unnamed_addr constant [37 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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN11alglib_impl12samplemedianEPKNS_9ae_vectorElPdPNS_8ae_stateE(ptr noundef %0, i64 noundef %1, ptr noundef %2, ptr noundef %3) #1 {
  %5 = alloca ptr, align 8
  %6 = alloca i64, align 8
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca %"struct.alglib_impl::ae_frame", align 8
  %10 = alloca %"struct.alglib_impl::ae_vector", align 8
  %11 = alloca i64, align 8
  %12 = alloca i64, align 8
  %13 = alloca i64, align 8
  %14 = alloca i64, align 8
  %15 = alloca i64, align 8
  %16 = alloca i64, align 8
  %17 = alloca double, align 8
  %18 = alloca double, align 8
  %19 = alloca i32, align 4
  store ptr %0, ptr %5, align 8, !tbaa !5
  store i64 %1, ptr %6, align 8, !tbaa !9
  store ptr %2, ptr %7, align 8, !tbaa !5
  store ptr %3, ptr %8, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 32, ptr %9) #4
  call void @llvm.lifetime.start.p0(i64 64, ptr %10) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #4
  %20 = load ptr, ptr %8, align 8, !tbaa !5
  call void @_ZN11alglib_impl13ae_frame_makeEPNS_8ae_stateEPNS_8ae_frameE(ptr noundef %20, ptr noundef %9)
  call void @llvm.memset.p0.i64(ptr align 8 %10, i8 0, i64 64, i1 false)
  %21 = load ptr, ptr %5, align 8, !tbaa !5
  %22 = load ptr, ptr %8, align 8, !tbaa !5
  call void @_ZN11alglib_impl19ae_vector_init_copyEPNS_9ae_vectorEPKS0_PNS_8ae_stateEb(ptr noundef %10, ptr noundef %21, ptr noundef %22, i1 noundef zeroext true)
  %23 = load ptr, ptr %7, align 8, !tbaa !5
  store double 0.000000e+00, ptr %23, align 8, !tbaa !11
  %24 = load i64, ptr %6, align 8, !tbaa !9
  %25 = icmp sge i64 %24, 0
  %26 = load ptr, ptr %8, align 8, !tbaa !5
  call void @_ZN11alglib_impl9ae_assertEbPKcPNS_8ae_stateE(i1 noundef zeroext %25, ptr noundef @.str.12, ptr noundef %26)
  %27 = getelementptr inbounds %"struct.alglib_impl::ae_vector", ptr %10, i32 0, i32 0
  %28 = load i64, ptr %27, align 8, !tbaa !13
  %29 = load i64, ptr %6, align 8, !tbaa !9
  %30 = icmp sge i64 %28, %29
  %31 = load ptr, ptr %8, align 8, !tbaa !5
  call void @_ZN11alglib_impl9ae_assertEbPKcPNS_8ae_stateE(i1 noundef zeroext %30, ptr noundef @.str.13, ptr noundef %31)
  %32 = load i64, ptr %6, align 8, !tbaa !9
  %33 = load ptr, ptr %8, align 8, !tbaa !5
  %34 = call noundef zeroext i1 @_ZN11alglib_impl14isfinitevectorEPKNS_9ae_vectorElPNS_8ae_stateE(ptr noundef %10, i64 noundef %32, ptr noundef %33)
  %35 = load ptr, ptr %8, align 8, !tbaa !5
  call void @_ZN11alglib_impl9ae_assertEbPKcPNS_8ae_stateE(i1 noundef zeroext %34, ptr noundef @.str.14, ptr noundef %35)
  %36 = load ptr, ptr %7, align 8, !tbaa !5
  store double 0.000000e+00, ptr %36, align 8, !tbaa !11
  %37 = load i64, ptr %6, align 8, !tbaa !9
  %38 = icmp sle i64 %37, 0
  br i1 %38, label %39, label %41

39:                                               ; preds = %4
  %40 = load ptr, ptr %8, align 8, !tbaa !5
  call void @_ZN11alglib_impl14ae_frame_leaveEPNS_8ae_stateE(ptr noundef %40)
  store i32 1, ptr %19, align 4
  br label %387

41:                                               ; preds = %4
  %42 = load i64, ptr %6, align 8, !tbaa !9
  %43 = icmp eq i64 %42, 1
  br i1 %43, label %44, label %51

44:                                               ; preds = %41
  %45 = getelementptr inbounds %"struct.alglib_impl::ae_vector", ptr %10, i32 0, i32 4
  %46 = load ptr, ptr %45, align 8, !tbaa !17
  %47 = getelementptr inbounds double, ptr %46, i64 0
  %48 = load double, ptr %47, align 8, !tbaa !11
  %49 = load ptr, ptr %7, align 8, !tbaa !5
  store double %48, ptr %49, align 8, !tbaa !11
  %50 = load ptr, ptr %8, align 8, !tbaa !5
  call void @_ZN11alglib_impl14ae_frame_leaveEPNS_8ae_stateE(ptr noundef %50)
  store i32 1, ptr %19, align 4
  br label %387

51:                                               ; preds = %41
  %52 = load i64, ptr %6, align 8, !tbaa !9
  %53 = icmp eq i64 %52, 2
  br i1 %53, label %54, label %67

54:                                               ; preds = %51
  %55 = getelementptr inbounds %"struct.alglib_impl::ae_vector", ptr %10, i32 0, i32 4
  %56 = load ptr, ptr %55, align 8, !tbaa !17
  %57 = getelementptr inbounds double, ptr %56, i64 0
  %58 = load double, ptr %57, align 8, !tbaa !11
  %59 = getelementptr inbounds %"struct.alglib_impl::ae_vector", ptr %10, i32 0, i32 4
  %60 = load ptr, ptr %59, align 8, !tbaa !17
  %61 = getelementptr inbounds double, ptr %60, i64 1
  %62 = load double, ptr %61, align 8, !tbaa !11
  %63 = fadd double %58, %62
  %64 = fmul double 5.000000e-01, %63
  %65 = load ptr, ptr %7, align 8, !tbaa !5
  store double %64, ptr %65, align 8, !tbaa !11
  %66 = load ptr, ptr %8, align 8, !tbaa !5
  call void @_ZN11alglib_impl14ae_frame_leaveEPNS_8ae_stateE(ptr noundef %66)
  store i32 1, ptr %19, align 4
  br label %387

67:                                               ; preds = %51
  store i64 0, ptr %14, align 8, !tbaa !9
  %68 = load i64, ptr %6, align 8, !tbaa !9
  %69 = sub nsw i64 %68, 1
  store i64 %69, ptr %12, align 8, !tbaa !9
  %70 = load i64, ptr %6, align 8, !tbaa !9
  %71 = sub nsw i64 %70, 1
  %72 = sdiv i64 %71, 2
  store i64 %72, ptr %16, align 8, !tbaa !9
  br label %73

73:                                               ; preds = %331, %67
  %74 = load i64, ptr %12, align 8, !tbaa !9
  %75 = load i64, ptr %14, align 8, !tbaa !9
  %76 = add nsw i64 %75, 1
  %77 = icmp sle i64 %74, %76
  br i1 %77, label %78, label %116

78:                                               ; preds = %73
  %79 = load i64, ptr %12, align 8, !tbaa !9
  %80 = load i64, ptr %14, align 8, !tbaa !9
  %81 = add nsw i64 %80, 1
  %82 = icmp eq i64 %79, %81
  br i1 %82, label %83, label %115

83:                                               ; preds = %78
  %84 = getelementptr inbounds %"struct.alglib_impl::ae_vector", ptr %10, i32 0, i32 4
  %85 = load ptr, ptr %84, align 8, !tbaa !17
  %86 = load i64, ptr %12, align 8, !tbaa !9
  %87 = getelementptr inbounds double, ptr %85, i64 %86
  %88 = load double, ptr %87, align 8, !tbaa !11
  %89 = getelementptr inbounds %"struct.alglib_impl::ae_vector", ptr %10, i32 0, i32 4
  %90 = load ptr, ptr %89, align 8, !tbaa !17
  %91 = load i64, ptr %14, align 8, !tbaa !9
  %92 = getelementptr inbounds double, ptr %90, i64 %91
  %93 = load double, ptr %92, align 8, !tbaa !11
  %94 = call noundef zeroext i1 @_ZN11alglib_impl10ae_fp_lessEdd(double noundef %88, double noundef %93)
  br i1 %94, label %95, label %115

95:                                               ; preds = %83
  %96 = getelementptr inbounds %"struct.alglib_impl::ae_vector", ptr %10, i32 0, i32 4
  %97 = load ptr, ptr %96, align 8, !tbaa !17
  %98 = load i64, ptr %14, align 8, !tbaa !9
  %99 = getelementptr inbounds double, ptr %97, i64 %98
  %100 = load double, ptr %99, align 8, !tbaa !11
  store double %100, ptr %18, align 8, !tbaa !11
  %101 = getelementptr inbounds %"struct.alglib_impl::ae_vector", ptr %10, i32 0, i32 4
  %102 = load ptr, ptr %101, align 8, !tbaa !17
  %103 = load i64, ptr %12, align 8, !tbaa !9
  %104 = getelementptr inbounds double, ptr %102, i64 %103
  %105 = load double, ptr %104, align 8, !tbaa !11
  %106 = getelementptr inbounds %"struct.alglib_impl::ae_vector", ptr %10, i32 0, i32 4
  %107 = load ptr, ptr %106, align 8, !tbaa !17
  %108 = load i64, ptr %14, align 8, !tbaa !9
  %109 = getelementptr inbounds double, ptr %107, i64 %108
  store double %105, ptr %109, align 8, !tbaa !11
  %110 = load double, ptr %18, align 8, !tbaa !11
  %111 = getelementptr inbounds %"struct.alglib_impl::ae_vector", ptr %10, i32 0, i32 4
  %112 = load ptr, ptr %111, align 8, !tbaa !17
  %113 = load i64, ptr %12, align 8, !tbaa !9
  %114 = getelementptr inbounds double, ptr %112, i64 %113
  store double %110, ptr %114, align 8, !tbaa !11
  br label %115

115:                                              ; preds = %95, %83, %78
  br label %332

116:                                              ; preds = %73
  %117 = load i64, ptr %14, align 8, !tbaa !9
  %118 = load i64, ptr %12, align 8, !tbaa !9
  %119 = add nsw i64 %117, %118
  %120 = sdiv i64 %119, 2
  store i64 %120, ptr %15, align 8, !tbaa !9
  %121 = getelementptr inbounds %"struct.alglib_impl::ae_vector", ptr %10, i32 0, i32 4
  %122 = load ptr, ptr %121, align 8, !tbaa !17
  %123 = load i64, ptr %15, align 8, !tbaa !9
  %124 = getelementptr inbounds double, ptr %122, i64 %123
  %125 = load double, ptr %124, align 8, !tbaa !11
  store double %125, ptr %18, align 8, !tbaa !11
  %126 = getelementptr inbounds %"struct.alglib_impl::ae_vector", ptr %10, i32 0, i32 4
  %127 = load ptr, ptr %126, align 8, !tbaa !17
  %128 = load i64, ptr %14, align 8, !tbaa !9
  %129 = add nsw i64 %128, 1
  %130 = getelementptr inbounds double, ptr %127, i64 %129
  %131 = load double, ptr %130, align 8, !tbaa !11
  %132 = getelementptr inbounds %"struct.alglib_impl::ae_vector", ptr %10, i32 0, i32 4
  %133 = load ptr, ptr %132, align 8, !tbaa !17
  %134 = load i64, ptr %15, align 8, !tbaa !9
  %135 = getelementptr inbounds double, ptr %133, i64 %134
  store double %131, ptr %135, align 8, !tbaa !11
  %136 = load double, ptr %18, align 8, !tbaa !11
  %137 = getelementptr inbounds %"struct.alglib_impl::ae_vector", ptr %10, i32 0, i32 4
  %138 = load ptr, ptr %137, align 8, !tbaa !17
  %139 = load i64, ptr %14, align 8, !tbaa !9
  %140 = add nsw i64 %139, 1
  %141 = getelementptr inbounds double, ptr %138, i64 %140
  store double %136, ptr %141, align 8, !tbaa !11
  %142 = getelementptr inbounds %"struct.alglib_impl::ae_vector", ptr %10, i32 0, i32 4
  %143 = load ptr, ptr %142, align 8, !tbaa !17
  %144 = load i64, ptr %14, align 8, !tbaa !9
  %145 = getelementptr inbounds double, ptr %143, i64 %144
  %146 = load double, ptr %145, align 8, !tbaa !11
  %147 = getelementptr inbounds %"struct.alglib_impl::ae_vector", ptr %10, i32 0, i32 4
  %148 = load ptr, ptr %147, align 8, !tbaa !17
  %149 = load i64, ptr %12, align 8, !tbaa !9
  %150 = getelementptr inbounds double, ptr %148, i64 %149
  %151 = load double, ptr %150, align 8, !tbaa !11
  %152 = call noundef zeroext i1 @_ZN11alglib_impl13ae_fp_greaterEdd(double noundef %146, double noundef %151)
  br i1 %152, label %153, label %173

153:                                              ; preds = %116
  %154 = getelementptr inbounds %"struct.alglib_impl::ae_vector", ptr %10, i32 0, i32 4
  %155 = load ptr, ptr %154, align 8, !tbaa !17
  %156 = load i64, ptr %14, align 8, !tbaa !9
  %157 = getelementptr inbounds double, ptr %155, i64 %156
  %158 = load double, ptr %157, align 8, !tbaa !11
  store double %158, ptr %18, align 8, !tbaa !11
  %159 = getelementptr inbounds %"struct.alglib_impl::ae_vector", ptr %10, i32 0, i32 4
  %160 = load ptr, ptr %159, align 8, !tbaa !17
  %161 = load i64, ptr %12, align 8, !tbaa !9
  %162 = getelementptr inbounds double, ptr %160, i64 %161
  %163 = load double, ptr %162, align 8, !tbaa !11
  %164 = getelementptr inbounds %"struct.alglib_impl::ae_vector", ptr %10, i32 0, i32 4
  %165 = load ptr, ptr %164, align 8, !tbaa !17
  %166 = load i64, ptr %14, align 8, !tbaa !9
  %167 = getelementptr inbounds double, ptr %165, i64 %166
  store double %163, ptr %167, align 8, !tbaa !11
  %168 = load double, ptr %18, align 8, !tbaa !11
  %169 = getelementptr inbounds %"struct.alglib_impl::ae_vector", ptr %10, i32 0, i32 4
  %170 = load ptr, ptr %169, align 8, !tbaa !17
  %171 = load i64, ptr %12, align 8, !tbaa !9
  %172 = getelementptr inbounds double, ptr %170, i64 %171
  store double %168, ptr %172, align 8, !tbaa !11
  br label %173

173:                                              ; preds = %153, %116
  %174 = getelementptr inbounds %"struct.alglib_impl::ae_vector", ptr %10, i32 0, i32 4
  %175 = load ptr, ptr %174, align 8, !tbaa !17
  %176 = load i64, ptr %14, align 8, !tbaa !9
  %177 = add nsw i64 %176, 1
  %178 = getelementptr inbounds double, ptr %175, i64 %177
  %179 = load double, ptr %178, align 8, !tbaa !11
  %180 = getelementptr inbounds %"struct.alglib_impl::ae_vector", ptr %10, i32 0, i32 4
  %181 = load ptr, ptr %180, align 8, !tbaa !17
  %182 = load i64, ptr %12, align 8, !tbaa !9
  %183 = getelementptr inbounds double, ptr %181, i64 %182
  %184 = load double, ptr %183, align 8, !tbaa !11
  %185 = call noundef zeroext i1 @_ZN11alglib_impl13ae_fp_greaterEdd(double noundef %179, double noundef %184)
  br i1 %185, label %186, label %208

186:                                              ; preds = %173
  %187 = getelementptr inbounds %"struct.alglib_impl::ae_vector", ptr %10, i32 0, i32 4
  %188 = load ptr, ptr %187, align 8, !tbaa !17
  %189 = load i64, ptr %14, align 8, !tbaa !9
  %190 = add nsw i64 %189, 1
  %191 = getelementptr inbounds double, ptr %188, i64 %190
  %192 = load double, ptr %191, align 8, !tbaa !11
  store double %192, ptr %18, align 8, !tbaa !11
  %193 = getelementptr inbounds %"struct.alglib_impl::ae_vector", ptr %10, i32 0, i32 4
  %194 = load ptr, ptr %193, align 8, !tbaa !17
  %195 = load i64, ptr %12, align 8, !tbaa !9
  %196 = getelementptr inbounds double, ptr %194, i64 %195
  %197 = load double, ptr %196, align 8, !tbaa !11
  %198 = getelementptr inbounds %"struct.alglib_impl::ae_vector", ptr %10, i32 0, i32 4
  %199 = load ptr, ptr %198, align 8, !tbaa !17
  %200 = load i64, ptr %14, align 8, !tbaa !9
  %201 = add nsw i64 %200, 1
  %202 = getelementptr inbounds double, ptr %199, i64 %201
  store double %197, ptr %202, align 8, !tbaa !11
  %203 = load double, ptr %18, align 8, !tbaa !11
  %204 = getelementptr inbounds %"struct.alglib_impl::ae_vector", ptr %10, i32 0, i32 4
  %205 = load ptr, ptr %204, align 8, !tbaa !17
  %206 = load i64, ptr %12, align 8, !tbaa !9
  %207 = getelementptr inbounds double, ptr %205, i64 %206
  store double %203, ptr %207, align 8, !tbaa !11
  br label %208

208:                                              ; preds = %186, %173
  %209 = getelementptr inbounds %"struct.alglib_impl::ae_vector", ptr %10, i32 0, i32 4
  %210 = load ptr, ptr %209, align 8, !tbaa !17
  %211 = load i64, ptr %14, align 8, !tbaa !9
  %212 = getelementptr inbounds double, ptr %210, i64 %211
  %213 = load double, ptr %212, align 8, !tbaa !11
  %214 = getelementptr inbounds %"struct.alglib_impl::ae_vector", ptr %10, i32 0, i32 4
  %215 = load ptr, ptr %214, align 8, !tbaa !17
  %216 = load i64, ptr %14, align 8, !tbaa !9
  %217 = add nsw i64 %216, 1
  %218 = getelementptr inbounds double, ptr %215, i64 %217
  %219 = load double, ptr %218, align 8, !tbaa !11
  %220 = call noundef zeroext i1 @_ZN11alglib_impl13ae_fp_greaterEdd(double noundef %213, double noundef %219)
  br i1 %220, label %221, label %243

221:                                              ; preds = %208
  %222 = getelementptr inbounds %"struct.alglib_impl::ae_vector", ptr %10, i32 0, i32 4
  %223 = load ptr, ptr %222, align 8, !tbaa !17
  %224 = load i64, ptr %14, align 8, !tbaa !9
  %225 = getelementptr inbounds double, ptr %223, i64 %224
  %226 = load double, ptr %225, align 8, !tbaa !11
  store double %226, ptr %18, align 8, !tbaa !11
  %227 = getelementptr inbounds %"struct.alglib_impl::ae_vector", ptr %10, i32 0, i32 4
  %228 = load ptr, ptr %227, align 8, !tbaa !17
  %229 = load i64, ptr %14, align 8, !tbaa !9
  %230 = add nsw i64 %229, 1
  %231 = getelementptr inbounds double, ptr %228, i64 %230
  %232 = load double, ptr %231, align 8, !tbaa !11
  %233 = getelementptr inbounds %"struct.alglib_impl::ae_vector", ptr %10, i32 0, i32 4
  %234 = load ptr, ptr %233, align 8, !tbaa !17
  %235 = load i64, ptr %14, align 8, !tbaa !9
  %236 = getelementptr inbounds double, ptr %234, i64 %235
  store double %232, ptr %236, align 8, !tbaa !11
  %237 = load double, ptr %18, align 8, !tbaa !11
  %238 = getelementptr inbounds %"struct.alglib_impl::ae_vector", ptr %10, i32 0, i32 4
  %239 = load ptr, ptr %238, align 8, !tbaa !17
  %240 = load i64, ptr %14, align 8, !tbaa !9
  %241 = add nsw i64 %240, 1
  %242 = getelementptr inbounds double, ptr %239, i64 %241
  store double %237, ptr %242, align 8, !tbaa !11
  br label %243

243:                                              ; preds = %221, %208
  %244 = load i64, ptr %14, align 8, !tbaa !9
  %245 = add nsw i64 %244, 1
  store i64 %245, ptr %11, align 8, !tbaa !9
  %246 = load i64, ptr %12, align 8, !tbaa !9
  store i64 %246, ptr %13, align 8, !tbaa !9
  %247 = getelementptr inbounds %"struct.alglib_impl::ae_vector", ptr %10, i32 0, i32 4
  %248 = load ptr, ptr %247, align 8, !tbaa !17
  %249 = load i64, ptr %14, align 8, !tbaa !9
  %250 = add nsw i64 %249, 1
  %251 = getelementptr inbounds double, ptr %248, i64 %250
  %252 = load double, ptr %251, align 8, !tbaa !11
  store double %252, ptr %17, align 8, !tbaa !11
  br label %253

253:                                              ; preds = %282, %243
  br label %254

254:                                              ; preds = %257, %253
  %255 = load i64, ptr %11, align 8, !tbaa !9
  %256 = add nsw i64 %255, 1
  store i64 %256, ptr %11, align 8, !tbaa !9
  br label %257

257:                                              ; preds = %254
  %258 = getelementptr inbounds %"struct.alglib_impl::ae_vector", ptr %10, i32 0, i32 4
  %259 = load ptr, ptr %258, align 8, !tbaa !17
  %260 = load i64, ptr %11, align 8, !tbaa !9
  %261 = getelementptr inbounds double, ptr %259, i64 %260
  %262 = load double, ptr %261, align 8, !tbaa !11
  %263 = load double, ptr %17, align 8, !tbaa !11
  %264 = call noundef zeroext i1 @_ZN11alglib_impl10ae_fp_lessEdd(double noundef %262, double noundef %263)
  br i1 %264, label %254, label %265, !llvm.loop !18

265:                                              ; preds = %257
  br label %266

266:                                              ; preds = %269, %265
  %267 = load i64, ptr %13, align 8, !tbaa !9
  %268 = sub nsw i64 %267, 1
  store i64 %268, ptr %13, align 8, !tbaa !9
  br label %269

269:                                              ; preds = %266
  %270 = getelementptr inbounds %"struct.alglib_impl::ae_vector", ptr %10, i32 0, i32 4
  %271 = load ptr, ptr %270, align 8, !tbaa !17
  %272 = load i64, ptr %13, align 8, !tbaa !9
  %273 = getelementptr inbounds double, ptr %271, i64 %272
  %274 = load double, ptr %273, align 8, !tbaa !11
  %275 = load double, ptr %17, align 8, !tbaa !11
  %276 = call noundef zeroext i1 @_ZN11alglib_impl13ae_fp_greaterEdd(double noundef %274, double noundef %275)
  br i1 %276, label %266, label %277, !llvm.loop !20

277:                                              ; preds = %269
  %278 = load i64, ptr %13, align 8, !tbaa !9
  %279 = load i64, ptr %11, align 8, !tbaa !9
  %280 = icmp slt i64 %278, %279
  br i1 %280, label %281, label %282

281:                                              ; preds = %277
  br label %302

282:                                              ; preds = %277
  %283 = getelementptr inbounds %"struct.alglib_impl::ae_vector", ptr %10, i32 0, i32 4
  %284 = load ptr, ptr %283, align 8, !tbaa !17
  %285 = load i64, ptr %11, align 8, !tbaa !9
  %286 = getelementptr inbounds double, ptr %284, i64 %285
  %287 = load double, ptr %286, align 8, !tbaa !11
  store double %287, ptr %18, align 8, !tbaa !11
  %288 = getelementptr inbounds %"struct.alglib_impl::ae_vector", ptr %10, i32 0, i32 4
  %289 = load ptr, ptr %288, align 8, !tbaa !17
  %290 = load i64, ptr %13, align 8, !tbaa !9
  %291 = getelementptr inbounds double, ptr %289, i64 %290
  %292 = load double, ptr %291, align 8, !tbaa !11
  %293 = getelementptr inbounds %"struct.alglib_impl::ae_vector", ptr %10, i32 0, i32 4
  %294 = load ptr, ptr %293, align 8, !tbaa !17
  %295 = load i64, ptr %11, align 8, !tbaa !9
  %296 = getelementptr inbounds double, ptr %294, i64 %295
  store double %292, ptr %296, align 8, !tbaa !11
  %297 = load double, ptr %18, align 8, !tbaa !11
  %298 = getelementptr inbounds %"struct.alglib_impl::ae_vector", ptr %10, i32 0, i32 4
  %299 = load ptr, ptr %298, align 8, !tbaa !17
  %300 = load i64, ptr %13, align 8, !tbaa !9
  %301 = getelementptr inbounds double, ptr %299, i64 %300
  store double %297, ptr %301, align 8, !tbaa !11
  br label %253, !llvm.loop !21

302:                                              ; preds = %281
  %303 = getelementptr inbounds %"struct.alglib_impl::ae_vector", ptr %10, i32 0, i32 4
  %304 = load ptr, ptr %303, align 8, !tbaa !17
  %305 = load i64, ptr %13, align 8, !tbaa !9
  %306 = getelementptr inbounds double, ptr %304, i64 %305
  %307 = load double, ptr %306, align 8, !tbaa !11
  %308 = getelementptr inbounds %"struct.alglib_impl::ae_vector", ptr %10, i32 0, i32 4
  %309 = load ptr, ptr %308, align 8, !tbaa !17
  %310 = load i64, ptr %14, align 8, !tbaa !9
  %311 = add nsw i64 %310, 1
  %312 = getelementptr inbounds double, ptr %309, i64 %311
  store double %307, ptr %312, align 8, !tbaa !11
  %313 = load double, ptr %17, align 8, !tbaa !11
  %314 = getelementptr inbounds %"struct.alglib_impl::ae_vector", ptr %10, i32 0, i32 4
  %315 = load ptr, ptr %314, align 8, !tbaa !17
  %316 = load i64, ptr %13, align 8, !tbaa !9
  %317 = getelementptr inbounds double, ptr %315, i64 %316
  store double %313, ptr %317, align 8, !tbaa !11
  %318 = load i64, ptr %13, align 8, !tbaa !9
  %319 = load i64, ptr %16, align 8, !tbaa !9
  %320 = icmp sge i64 %318, %319
  br i1 %320, label %321, label %324

321:                                              ; preds = %302
  %322 = load i64, ptr %13, align 8, !tbaa !9
  %323 = sub nsw i64 %322, 1
  store i64 %323, ptr %12, align 8, !tbaa !9
  br label %324

324:                                              ; preds = %321, %302
  %325 = load i64, ptr %13, align 8, !tbaa !9
  %326 = load i64, ptr %16, align 8, !tbaa !9
  %327 = icmp sle i64 %325, %326
  br i1 %327, label %328, label %330

328:                                              ; preds = %324
  %329 = load i64, ptr %11, align 8, !tbaa !9
  store i64 %329, ptr %14, align 8, !tbaa !9
  br label %330

330:                                              ; preds = %328, %324
  br label %331

331:                                              ; preds = %330
  br label %73, !llvm.loop !22

332:                                              ; preds = %115
  %333 = load i64, ptr %6, align 8, !tbaa !9
  %334 = srem i64 %333, 2
  %335 = icmp eq i64 %334, 1
  br i1 %335, label %336, label %344

336:                                              ; preds = %332
  %337 = getelementptr inbounds %"struct.alglib_impl::ae_vector", ptr %10, i32 0, i32 4
  %338 = load ptr, ptr %337, align 8, !tbaa !17
  %339 = load i64, ptr %16, align 8, !tbaa !9
  %340 = getelementptr inbounds double, ptr %338, i64 %339
  %341 = load double, ptr %340, align 8, !tbaa !11
  %342 = load ptr, ptr %7, align 8, !tbaa !5
  store double %341, ptr %342, align 8, !tbaa !11
  %343 = load ptr, ptr %8, align 8, !tbaa !5
  call void @_ZN11alglib_impl14ae_frame_leaveEPNS_8ae_stateE(ptr noundef %343)
  store i32 1, ptr %19, align 4
  br label %387

344:                                              ; preds = %332
  %345 = getelementptr inbounds %"struct.alglib_impl::ae_vector", ptr %10, i32 0, i32 4
  %346 = load ptr, ptr %345, align 8, !tbaa !17
  %347 = load i64, ptr %6, align 8, !tbaa !9
  %348 = sub nsw i64 %347, 1
  %349 = getelementptr inbounds double, ptr %346, i64 %348
  %350 = load double, ptr %349, align 8, !tbaa !11
  store double %350, ptr %17, align 8, !tbaa !11
  %351 = load i64, ptr %16, align 8, !tbaa !9
  %352 = add nsw i64 %351, 1
  store i64 %352, ptr %11, align 8, !tbaa !9
  br label %353

353:                                              ; preds = %373, %344
  %354 = load i64, ptr %11, align 8, !tbaa !9
  %355 = load i64, ptr %6, align 8, !tbaa !9
  %356 = sub nsw i64 %355, 1
  %357 = icmp sle i64 %354, %356
  br i1 %357, label %358, label %376

358:                                              ; preds = %353
  %359 = getelementptr inbounds %"struct.alglib_impl::ae_vector", ptr %10, i32 0, i32 4
  %360 = load ptr, ptr %359, align 8, !tbaa !17
  %361 = load i64, ptr %11, align 8, !tbaa !9
  %362 = getelementptr inbounds double, ptr %360, i64 %361
  %363 = load double, ptr %362, align 8, !tbaa !11
  %364 = load double, ptr %17, align 8, !tbaa !11
  %365 = call noundef zeroext i1 @_ZN11alglib_impl10ae_fp_lessEdd(double noundef %363, double noundef %364)
  br i1 %365, label %366, label %372

366:                                              ; preds = %358
  %367 = getelementptr inbounds %"struct.alglib_impl::ae_vector", ptr %10, i32 0, i32 4
  %368 = load ptr, ptr %367, align 8, !tbaa !17
  %369 = load i64, ptr %11, align 8, !tbaa !9
  %370 = getelementptr inbounds double, ptr %368, i64 %369
  %371 = load double, ptr %370, align 8, !tbaa !11
  store double %371, ptr %17, align 8, !tbaa !11
  br label %372

372:                                              ; preds = %366, %358
  br label %373

373:                                              ; preds = %372
  %374 = load i64, ptr %11, align 8, !tbaa !9
  %375 = add nsw i64 %374, 1
  store i64 %375, ptr %11, align 8, !tbaa !9
  br label %353, !llvm.loop !23

376:                                              ; preds = %353
  %377 = getelementptr inbounds %"struct.alglib_impl::ae_vector", ptr %10, i32 0, i32 4
  %378 = load ptr, ptr %377, align 8, !tbaa !17
  %379 = load i64, ptr %16, align 8, !tbaa !9
  %380 = getelementptr inbounds double, ptr %378, i64 %379
  %381 = load double, ptr %380, align 8, !tbaa !11
  %382 = load double, ptr %17, align 8, !tbaa !11
  %383 = fadd double %381, %382
  %384 = fmul double 5.000000e-01, %383
  %385 = load ptr, ptr %7, align 8, !tbaa !5
  store double %384, ptr %385, align 8, !tbaa !11
  %386 = load ptr, ptr %8, align 8, !tbaa !5
  call void @_ZN11alglib_impl14ae_frame_leaveEPNS_8ae_stateE(ptr noundef %386)
  store i32 0, ptr %19, align 4
  br label %387

387:                                              ; preds = %376, %336, %54, %44, %39
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #4
  call void @llvm.lifetime.end.p0(i64 64, ptr %10) #4
  call void @llvm.lifetime.end.p0(i64 32, ptr %9) #4
  %388 = load i32, ptr %19, align 4
  switch i32 %388, label %390 [
    i32 0, label %389
    i32 1, label %389
  ]

389:                                              ; preds = %387, %387
  ret void

390:                                              ; preds = %387
  unreachable
}

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

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

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

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

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #3

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

declare void @_ZN11alglib_impl14ae_frame_leaveEPNS_8ae_stateE(ptr noundef) #2

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

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { "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 = { nocallback nofree nounwind willreturn memory(argmem: write) }
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 = !{!"double", !7, i64 0}
!13 = !{!14, !10, i64 0}
!14 = !{!"_ZTSN11alglib_impl9ae_vectorE", !10, i64 0, !10, i64 8, !15, i64 16, !16, i64 24, !7, i64 56}
!15 = !{!"bool", !7, i64 0}
!16 = !{!"_ZTSN11alglib_impl12ae_dyn_blockE", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24}
!17 = !{!7, !7, i64 0}
!18 = distinct !{!18, !19}
!19 = !{!"llvm.loop.mustprogress"}
!20 = distinct !{!20, !19}
!21 = distinct !{!21, !19}
!22 = distinct !{!22, !19}
!23 = distinct !{!23, !19}


; Optimized IR (opt -passes='default<O3>'):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%"struct.alglib_impl::ae_frame" = type { %"struct.alglib_impl::ae_dyn_block" }
%"struct.alglib_impl::ae_dyn_block" = type { ptr, ptr, ptr, ptr }
%"struct.alglib_impl::ae_vector" = type { i64, i64, i8, %"struct.alglib_impl::ae_dyn_block", %union.anon.0 }
%union.anon.0 = type { ptr }

@.str.12 = external hidden unnamed_addr constant [18 x i8], align 1
@.str.13 = external hidden unnamed_addr constant [27 x i8], align 1
@.str.14 = external hidden unnamed_addr constant [37 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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN11alglib_impl12samplemedianEPKNS_9ae_vectorElPdPNS_8ae_stateE(ptr noundef %0, i64 noundef %1, ptr nocapture noundef writeonly %2, ptr noundef %3) local_unnamed_addr #1 {
  %5 = alloca %"struct.alglib_impl::ae_frame", align 8
  %6 = alloca %"struct.alglib_impl::ae_vector", align 8
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %5) #4
  call void @llvm.lifetime.start.p0(i64 64, ptr nonnull %6) #4
  call void @_ZN11alglib_impl13ae_frame_makeEPNS_8ae_stateEPNS_8ae_frameE(ptr noundef %3, ptr noundef nonnull %5)
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(64) %6, i8 0, i64 64, i1 false)
  call void @_ZN11alglib_impl19ae_vector_init_copyEPNS_9ae_vectorEPKS0_PNS_8ae_stateEb(ptr noundef nonnull %6, ptr noundef %0, ptr noundef %3, i1 noundef zeroext true)
  store double 0.000000e+00, ptr %2, align 8, !tbaa !5
  %7 = icmp sgt i64 %1, -1
  call void @_ZN11alglib_impl9ae_assertEbPKcPNS_8ae_stateE(i1 noundef zeroext %7, ptr noundef nonnull @.str.12, ptr noundef %3)
  %8 = load i64, ptr %6, align 8, !tbaa !9
  %9 = icmp sge i64 %8, %1
  call void @_ZN11alglib_impl9ae_assertEbPKcPNS_8ae_stateE(i1 noundef zeroext %9, ptr noundef nonnull @.str.13, ptr noundef %3)
  %10 = call noundef zeroext i1 @_ZN11alglib_impl14isfinitevectorEPKNS_9ae_vectorElPNS_8ae_stateE(ptr noundef nonnull %6, i64 noundef %1, ptr noundef %3)
  call void @_ZN11alglib_impl9ae_assertEbPKcPNS_8ae_stateE(i1 noundef zeroext %10, ptr noundef nonnull @.str.14, ptr noundef %3)
  store double 0.000000e+00, ptr %2, align 8, !tbaa !5
  %11 = icmp slt i64 %1, 1
  br i1 %11, label %157, label %12

12:                                               ; preds = %4
  switch i64 %1, label %.lr.ph [
    i64 1, label %13
    i64 2, label %17
  ]

13:                                               ; preds = %12
  %14 = getelementptr inbounds i8, ptr %6, i64 56
  %15 = load ptr, ptr %14, align 8, !tbaa !15
  %16 = load double, ptr %15, align 8, !tbaa !5
  br label %.sink.split

17:                                               ; preds = %12
  %18 = getelementptr inbounds i8, ptr %6, i64 56
  %19 = load ptr, ptr %18, align 8, !tbaa !15
  %20 = load double, ptr %19, align 8, !tbaa !5
  %21 = getelementptr inbounds i8, ptr %19, i64 8
  %22 = load double, ptr %21, align 8, !tbaa !5
  %23 = fadd double %20, %22
  %24 = fmul double %23, 5.000000e-01
  br label %.sink.split

.lr.ph:                                           ; preds = %12
  %25 = add nsw i64 %1, -1
  %26 = lshr i64 %25, 1
  %27 = getelementptr inbounds i8, ptr %6, i64 56
  br label %45

._crit_edge:                                      ; preds = %125
  %28 = icmp eq i64 %spec.select, %132
  br i1 %28, label %29, label %133

29:                                               ; preds = %._crit_edge
  %30 = getelementptr inbounds i8, ptr %6, i64 56
  %31 = load ptr, ptr %30, align 8, !tbaa !15
  %32 = getelementptr inbounds double, ptr %31, i64 %spec.select
  %33 = load double, ptr %32, align 8, !tbaa !5
  %34 = getelementptr inbounds double, ptr %31, i64 %.1107
  %35 = load double, ptr %34, align 8, !tbaa !5
  %36 = call noundef zeroext i1 @_ZN11alglib_impl10ae_fp_lessEdd(double noundef %33, double noundef %35)
  br i1 %36, label %37, label %133

37:                                               ; preds = %29
  %38 = load ptr, ptr %30, align 8, !tbaa !15
  %39 = getelementptr inbounds double, ptr %38, i64 %.1107
  %40 = load double, ptr %39, align 8, !tbaa !5
  %41 = getelementptr inbounds double, ptr %38, i64 %spec.select
  %42 = load double, ptr %41, align 8, !tbaa !5
  store double %42, ptr %39, align 8, !tbaa !5
  %43 = load ptr, ptr %30, align 8, !tbaa !15
  %44 = getelementptr inbounds double, ptr %43, i64 %spec.select
  store double %40, ptr %44, align 8, !tbaa !5
  br label %133

45:                                               ; preds = %.lr.ph, %125
  %46 = phi i64 [ 1, %.lr.ph ], [ %132, %125 ]
  %.0104126 = phi i64 [ %25, %.lr.ph ], [ %spec.select, %125 ]
  %.0106125 = phi i64 [ 0, %.lr.ph ], [ %.1107, %125 ]
  %47 = add nsw i64 %.0104126, %.0106125
  %48 = sdiv i64 %47, 2
  %49 = load ptr, ptr %27, align 8, !tbaa !15
  %50 = getelementptr inbounds double, ptr %49, i64 %48
  %51 = load double, ptr %50, align 8, !tbaa !5
  %52 = getelementptr inbounds double, ptr %49, i64 %46
  %53 = load double, ptr %52, align 8, !tbaa !5
  store double %53, ptr %50, align 8, !tbaa !5
  %54 = load ptr, ptr %27, align 8, !tbaa !15
  %55 = getelementptr inbounds double, ptr %54, i64 %46
  store double %51, ptr %55, align 8, !tbaa !5
  %56 = load ptr, ptr %27, align 8, !tbaa !15
  %57 = getelementptr inbounds double, ptr %56, i64 %.0106125
  %58 = load double, ptr %57, align 8, !tbaa !5
  %59 = getelementptr inbounds double, ptr %56, i64 %.0104126
  %60 = load double, ptr %59, align 8, !tbaa !5
  %61 = call noundef zeroext i1 @_ZN11alglib_impl13ae_fp_greaterEdd(double noundef %58, double noundef %60)
  br i1 %61, label %62, label %70

62:                                               ; preds = %45
  %63 = load ptr, ptr %27, align 8, !tbaa !15
  %64 = getelementptr inbounds double, ptr %63, i64 %.0106125
  %65 = load double, ptr %64, align 8, !tbaa !5
  %66 = getelementptr inbounds double, ptr %63, i64 %.0104126
  %67 = load double, ptr %66, align 8, !tbaa !5
  store double %67, ptr %64, align 8, !tbaa !5
  %68 = load ptr, ptr %27, align 8, !tbaa !15
  %69 = getelementptr inbounds double, ptr %68, i64 %.0104126
  store double %65, ptr %69, align 8, !tbaa !5
  br label %70

70:                                               ; preds = %62, %45
  %71 = load ptr, ptr %27, align 8, !tbaa !15
  %72 = getelementptr inbounds double, ptr %71, i64 %46
  %73 = load double, ptr %72, align 8, !tbaa !5
  %74 = getelementptr inbounds double, ptr %71, i64 %.0104126
  %75 = load double, ptr %74, align 8, !tbaa !5
  %76 = call noundef zeroext i1 @_ZN11alglib_impl13ae_fp_greaterEdd(double noundef %73, double noundef %75)
  br i1 %76, label %77, label %85

77:                                               ; preds = %70
  %78 = load ptr, ptr %27, align 8, !tbaa !15
  %79 = getelementptr inbounds double, ptr %78, i64 %46
  %80 = load double, ptr %79, align 8, !tbaa !5
  %81 = getelementptr inbounds double, ptr %78, i64 %.0104126
  %82 = load double, ptr %81, align 8, !tbaa !5
  store double %82, ptr %79, align 8, !tbaa !5
  %83 = load ptr, ptr %27, align 8, !tbaa !15
  %84 = getelementptr inbounds double, ptr %83, i64 %.0104126
  store double %80, ptr %84, align 8, !tbaa !5
  br label %85

85:                                               ; preds = %77, %70
  %86 = load ptr, ptr %27, align 8, !tbaa !15
  %87 = getelementptr inbounds double, ptr %86, i64 %.0106125
  %88 = load double, ptr %87, align 8, !tbaa !5
  %89 = getelementptr inbounds double, ptr %86, i64 %46
  %90 = load double, ptr %89, align 8, !tbaa !5
  %91 = call noundef zeroext i1 @_ZN11alglib_impl13ae_fp_greaterEdd(double noundef %88, double noundef %90)
  br i1 %91, label %92, label %100

92:                                               ; preds = %85
  %93 = load ptr, ptr %27, align 8, !tbaa !15
  %94 = getelementptr inbounds double, ptr %93, i64 %.0106125
  %95 = load double, ptr %94, align 8, !tbaa !5
  %96 = getelementptr inbounds double, ptr %93, i64 %46
  %97 = load double, ptr %96, align 8, !tbaa !5
  store double %97, ptr %94, align 8, !tbaa !5
  %98 = load ptr, ptr %27, align 8, !tbaa !15
  %99 = getelementptr inbounds double, ptr %98, i64 %46
  store double %95, ptr %99, align 8, !tbaa !5
  br label %100

100:                                              ; preds = %92, %85
  %101 = load ptr, ptr %27, align 8, !tbaa !15
  %102 = getelementptr inbounds double, ptr %101, i64 %46
  %103 = load double, ptr %102, align 8, !tbaa !5
  br label %104

104:                                              ; preds = %118, %100
  %.0108 = phi i64 [ %.0104126, %100 ], [ %111, %118 ]
  %.0102 = phi i64 [ %46, %100 ], [ %106, %118 ]
  br label %105

105:                                              ; preds = %105, %104
  %.1103 = phi i64 [ %.0102, %104 ], [ %106, %105 ]
  %106 = add nsw i64 %.1103, 1
  %107 = load ptr, ptr %27, align 8, !tbaa !15
  %108 = getelementptr inbounds double, ptr %107, i64 %106
  %109 = load double, ptr %108, align 8, !tbaa !5
  %110 = call noundef zeroext i1 @_ZN11alglib_impl10ae_fp_lessEdd(double noundef %109, double noundef %103)
  br i1 %110, label %105, label %.preheader, !llvm.loop !16

.preheader:                                       ; preds = %105, %.preheader
  %.1109 = phi i64 [ %111, %.preheader ], [ %.0108, %105 ]
  %111 = add nsw i64 %.1109, -1
  %112 = load ptr, ptr %27, align 8, !tbaa !15
  %113 = getelementptr inbounds double, ptr %112, i64 %111
  %114 = load double, ptr %113, align 8, !tbaa !5
  %115 = call noundef zeroext i1 @_ZN11alglib_impl13ae_fp_greaterEdd(double noundef %114, double noundef %103)
  br i1 %115, label %.preheader, label %116, !llvm.loop !18

116:                                              ; preds = %.preheader
  %.not117 = icmp sgt i64 %.1109, %106
  %117 = load ptr, ptr %27, align 8, !tbaa !15
  br i1 %.not117, label %118, label %125

118:                                              ; preds = %116
  %119 = getelementptr inbounds double, ptr %117, i64 %106
  %120 = load double, ptr %119, align 8, !tbaa !5
  %121 = getelementptr inbounds double, ptr %117, i64 %111
  %122 = load double, ptr %121, align 8, !tbaa !5
  store double %122, ptr %119, align 8, !tbaa !5
  %123 = load ptr, ptr %27, align 8, !tbaa !15
  %124 = getelementptr inbounds double, ptr %123, i64 %111
  store double %120, ptr %124, align 8, !tbaa !5
  br label %104, !llvm.loop !19

125:                                              ; preds = %116
  %126 = getelementptr inbounds double, ptr %117, i64 %111
  %127 = load double, ptr %126, align 8, !tbaa !5
  %128 = getelementptr inbounds double, ptr %117, i64 %46
  store double %127, ptr %128, align 8, !tbaa !5
  %129 = load ptr, ptr %27, align 8, !tbaa !15
  %130 = getelementptr inbounds double, ptr %129, i64 %111
  store double %103, ptr %130, align 8, !tbaa !5
  %.not118.not = icmp sgt i64 %.1109, %26
  %131 = add nsw i64 %.1109, -2
  %spec.select = select i1 %.not118.not, i64 %131, i64 %.0104126
  %.not119 = icmp sgt i64 %111, %26
  %.1107 = select i1 %.not119, i64 %.0106125, i64 %106
  %132 = add nsw i64 %.1107, 1
  %.not = icmp sgt i64 %spec.select, %132
  br i1 %.not, label %45, label %._crit_edge, !llvm.loop !20

133:                                              ; preds = %._crit_edge, %29, %37
  %134 = and i64 %1, 1
  %.not120 = icmp eq i64 %134, 0
  %135 = getelementptr inbounds i8, ptr %6, i64 56
  %136 = load ptr, ptr %135, align 8, !tbaa !15
  br i1 %.not120, label %140, label %137

137:                                              ; preds = %133
  %138 = getelementptr inbounds double, ptr %136, i64 %26
  %139 = load double, ptr %138, align 8, !tbaa !5
  br label %.sink.split

140:                                              ; preds = %133
  %141 = getelementptr inbounds double, ptr %136, i64 %25
  %142 = load double, ptr %141, align 8, !tbaa !5
  %.not121.not130.not = icmp eq i64 %1, 1
  br i1 %.not121.not130.not, label %._crit_edge135, label %.lr.ph134

.lr.ph134:                                        ; preds = %140, %151
  %.2132.in = phi i64 [ %.2132, %151 ], [ %26, %140 ]
  %.0131 = phi double [ %.1, %151 ], [ %142, %140 ]
  %.2132 = add nuw nsw i64 %.2132.in, 1
  %143 = load ptr, ptr %135, align 8, !tbaa !15
  %144 = getelementptr inbounds double, ptr %143, i64 %.2132
  %145 = load double, ptr %144, align 8, !tbaa !5
  %146 = call noundef zeroext i1 @_ZN11alglib_impl10ae_fp_lessEdd(double noundef %145, double noundef %.0131)
  br i1 %146, label %147, label %151

147:                                              ; preds = %.lr.ph134
  %148 = load ptr, ptr %135, align 8, !tbaa !15
  %149 = getelementptr inbounds double, ptr %148, i64 %.2132
  %150 = load double, ptr %149, align 8, !tbaa !5
  br label %151

151:                                              ; preds = %.lr.ph134, %147
  %.1 = phi double [ %150, %147 ], [ %.0131, %.lr.ph134 ]
  %.not121.not = icmp slt i64 %.2132, %25
  br i1 %.not121.not, label %.lr.ph134, label %._crit_edge135.loopexit, !llvm.loop !21

._crit_edge135.loopexit:                          ; preds = %151
  %.pre = load ptr, ptr %135, align 8, !tbaa !15
  br label %._crit_edge135

._crit_edge135:                                   ; preds = %._crit_edge135.loopexit, %140
  %152 = phi ptr [ %136, %140 ], [ %.pre, %._crit_edge135.loopexit ]
  %.0.lcssa = phi double [ %142, %140 ], [ %.1, %._crit_edge135.loopexit ]
  %153 = getelementptr inbounds double, ptr %152, i64 %26
  %154 = load double, ptr %153, align 8, !tbaa !5
  %155 = fadd double %.0.lcssa, %154
  %156 = fmul double %155, 5.000000e-01
  br label %.sink.split

.sink.split:                                      ; preds = %13, %17, %137, %._crit_edge135
  %.sink = phi double [ %156, %._crit_edge135 ], [ %139, %137 ], [ %24, %17 ], [ %16, %13 ]
  store double %.sink, ptr %2, align 8, !tbaa !5
  br label %157

157:                                              ; preds = %.sink.split, %4
  call void @_ZN11alglib_impl14ae_frame_leaveEPNS_8ae_stateE(ptr noundef %3)
  call void @llvm.lifetime.end.p0(i64 64, ptr nonnull %6) #4
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %5) #4
  ret void
}

declare void @_ZN11alglib_impl9ae_assertEbPKcPNS_8ae_stateE(i1 noundef zeroext, ptr noundef, 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 noundef zeroext i1 @_ZN11alglib_impl10ae_fp_lessEdd(double noundef, double noundef) local_unnamed_addr #2

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

; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #3

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

declare void @_ZN11alglib_impl14ae_frame_leaveEPNS_8ae_stateE(ptr noundef) local_unnamed_addr #2

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

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { "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 nocallback nofree nounwind willreturn memory(argmem: write) }
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 = !{!"double", !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", !14, i64 0, !14, i64 8, !14, i64 16, !14, i64 24}
!14 = !{!"any pointer", !7, i64 0}
!15 = !{!7, !7, i64 0}
!16 = distinct !{!16, !17}
!17 = !{!"llvm.loop.mustprogress"}
!18 = distinct !{!18, !17}
!19 = distinct !{!19, !17}
!20 = distinct !{!20, !17}
!21 = distinct !{!21, !17}


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