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

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN11alglib_impl13gqgeneraterecEPNS_9ae_vectorES1_dlPlS1_S1_PNS_8ae_stateE(ptr noundef, ptr noundef, double noundef, i64 noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef) #1

; 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_impl21gqgenerategaussjacobiElddPlPNS_9ae_vectorES2_PNS_8ae_stateE(i64 noundef %0, double noundef %1, double noundef %2, ptr noundef %3, ptr noundef %4, ptr noundef %5, ptr noundef %6) #1 {
  %8 = alloca i64, align 8
  %9 = alloca double, align 8
  %10 = alloca double, align 8
  %11 = alloca ptr, align 8
  %12 = alloca ptr, align 8
  %13 = alloca ptr, align 8
  %14 = alloca ptr, align 8
  %15 = alloca %"struct.alglib_impl::ae_frame", align 8
  %16 = alloca %"struct.alglib_impl::ae_vector", align 8
  %17 = alloca %"struct.alglib_impl::ae_vector", align 8
  %18 = alloca double, align 8
  %19 = alloca double, align 8
  %20 = alloca double, align 8
  %21 = alloca double, align 8
  %22 = alloca i64, align 8
  %23 = alloca double, align 8
  %24 = alloca i32, align 4
  store i64 %0, ptr %8, align 8, !tbaa !5
  store double %1, ptr %9, align 8, !tbaa !9
  store double %2, ptr %10, align 8, !tbaa !9
  store ptr %3, ptr %11, align 8, !tbaa !11
  store ptr %4, ptr %12, align 8, !tbaa !11
  store ptr %5, ptr %13, align 8, !tbaa !11
  store ptr %6, ptr %14, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 32, ptr %15) #5
  call void @llvm.lifetime.start.p0(i64 64, ptr %16) #5
  call void @llvm.lifetime.start.p0(i64 64, ptr %17) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %21) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %22) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %23) #5
  %25 = load ptr, ptr %14, align 8, !tbaa !11
  call void @_ZN11alglib_impl13ae_frame_makeEPNS_8ae_stateEPNS_8ae_frameE(ptr noundef %25, ptr noundef %15)
  call void @llvm.memset.p0.i64(ptr align 8 %16, i8 0, i64 64, i1 false)
  call void @llvm.memset.p0.i64(ptr align 8 %17, i8 0, i64 64, i1 false)
  %26 = load ptr, ptr %11, align 8, !tbaa !11
  store i64 0, ptr %26, align 8, !tbaa !5
  %27 = load ptr, ptr %12, align 8, !tbaa !11
  call void @_ZN11alglib_impl15ae_vector_clearEPNS_9ae_vectorE(ptr noundef %27)
  %28 = load ptr, ptr %13, align 8, !tbaa !11
  call void @_ZN11alglib_impl15ae_vector_clearEPNS_9ae_vectorE(ptr noundef %28)
  %29 = load ptr, ptr %14, align 8, !tbaa !11
  call void @_ZN11alglib_impl14ae_vector_initEPNS_9ae_vectorEllPNS_8ae_stateEb(ptr noundef %16, i64 noundef 0, i64 noundef 3, ptr noundef %29, i1 noundef zeroext true)
  %30 = load ptr, ptr %14, align 8, !tbaa !11
  call void @_ZN11alglib_impl14ae_vector_initEPNS_9ae_vectorEllPNS_8ae_stateEb(ptr noundef %17, i64 noundef 0, i64 noundef 3, ptr noundef %30, i1 noundef zeroext true)
  %31 = load i64, ptr %8, align 8, !tbaa !5
  %32 = icmp slt i64 %31, 1
  br i1 %32, label %39, label %33

33:                                               ; preds = %7
  %34 = load double, ptr %9, align 8, !tbaa !9
  %35 = call noundef zeroext i1 @_ZN11alglib_impl13ae_fp_less_eqEdd(double noundef %34, double noundef -1.000000e+00)
  br i1 %35, label %39, label %36

36:                                               ; preds = %33
  %37 = load double, ptr %10, align 8, !tbaa !9
  %38 = call noundef zeroext i1 @_ZN11alglib_impl13ae_fp_less_eqEdd(double noundef %37, double noundef -1.000000e+00)
  br i1 %38, label %39, label %42

39:                                               ; preds = %36, %33, %7
  %40 = load ptr, ptr %11, align 8, !tbaa !11
  store i64 -1, ptr %40, align 8, !tbaa !5
  %41 = load ptr, ptr %14, align 8, !tbaa !11
  call void @_ZN11alglib_impl14ae_frame_leaveEPNS_8ae_stateE(ptr noundef %41)
  store i32 1, ptr %24, align 4
  br label %276

42:                                               ; preds = %36
  %43 = load i64, ptr %8, align 8, !tbaa !5
  %44 = load ptr, ptr %14, align 8, !tbaa !11
  call void @_ZN11alglib_impl20ae_vector_set_lengthEPNS_9ae_vectorElPNS_8ae_stateE(ptr noundef %16, i64 noundef %43, ptr noundef %44)
  %45 = load i64, ptr %8, align 8, !tbaa !5
  %46 = load ptr, ptr %14, align 8, !tbaa !11
  call void @_ZN11alglib_impl20ae_vector_set_lengthEPNS_9ae_vectorElPNS_8ae_stateE(ptr noundef %17, i64 noundef %45, ptr noundef %46)
  %47 = load double, ptr %9, align 8, !tbaa !9
  %48 = load double, ptr %10, align 8, !tbaa !9
  %49 = fadd double %47, %48
  store double %49, ptr %20, align 8, !tbaa !9
  %50 = load double, ptr %10, align 8, !tbaa !9
  %51 = load double, ptr %9, align 8, !tbaa !9
  %52 = fsub double %50, %51
  %53 = load double, ptr %20, align 8, !tbaa !9
  %54 = fadd double %53, 2.000000e+00
  %55 = fdiv double %52, %54
  %56 = getelementptr inbounds %"struct.alglib_impl::ae_vector", ptr %16, i32 0, i32 4
  %57 = load ptr, ptr %56, align 8, !tbaa !13
  %58 = getelementptr inbounds double, ptr %57, i64 0
  store double %55, ptr %58, align 8, !tbaa !9
  %59 = load double, ptr %20, align 8, !tbaa !9
  %60 = fadd double %59, 1.000000e+00
  %61 = load ptr, ptr %14, align 8, !tbaa !11
  %62 = call noundef double @_ZN11alglib_impl6ae_logEdPNS_8ae_stateE(double noundef 2.000000e+00, ptr noundef %61)
  %63 = load double, ptr %9, align 8, !tbaa !9
  %64 = fadd double %63, 1.000000e+00
  %65 = load ptr, ptr %14, align 8, !tbaa !11
  %66 = call noundef double @_ZN11alglib_impl7lngammaEdPdPNS_8ae_stateE(double noundef %64, ptr noundef %23, ptr noundef %65)
  %67 = call double @llvm.fmuladd.f64(double %60, double %62, double %66)
  %68 = load double, ptr %10, align 8, !tbaa !9
  %69 = fadd double %68, 1.000000e+00
  %70 = load ptr, ptr %14, align 8, !tbaa !11
  %71 = call noundef double @_ZN11alglib_impl7lngammaEdPdPNS_8ae_stateE(double noundef %69, ptr noundef %23, ptr noundef %70)
  %72 = fadd double %67, %71
  %73 = load double, ptr %20, align 8, !tbaa !9
  %74 = fadd double %73, 2.000000e+00
  %75 = load ptr, ptr %14, align 8, !tbaa !11
  %76 = call noundef double @_ZN11alglib_impl7lngammaEdPdPNS_8ae_stateE(double noundef %74, ptr noundef %23, ptr noundef %75)
  %77 = fsub double %72, %76
  store double %77, ptr %21, align 8, !tbaa !9
  %78 = load double, ptr %21, align 8, !tbaa !9
  %79 = load ptr, ptr %14, align 8, !tbaa !11
  %80 = call noundef double @_ZN11alglib_impl6ae_logEdPNS_8ae_stateE(double noundef 1.000000e+300, ptr noundef %79)
  %81 = call noundef zeroext i1 @_ZN11alglib_impl13ae_fp_greaterEdd(double noundef %78, double noundef %80)
  br i1 %81, label %82, label %85

82:                                               ; preds = %42
  %83 = load ptr, ptr %11, align 8, !tbaa !11
  store i64 -4, ptr %83, align 8, !tbaa !5
  %84 = load ptr, ptr %14, align 8, !tbaa !11
  call void @_ZN11alglib_impl14ae_frame_leaveEPNS_8ae_stateE(ptr noundef %84)
  store i32 1, ptr %24, align 4
  br label %276

85:                                               ; preds = %42
  %86 = load double, ptr %21, align 8, !tbaa !9
  %87 = load ptr, ptr %14, align 8, !tbaa !11
  %88 = call noundef double @_ZN11alglib_impl6ae_expEdPNS_8ae_stateE(double noundef %86, ptr noundef %87)
  %89 = getelementptr inbounds %"struct.alglib_impl::ae_vector", ptr %17, i32 0, i32 4
  %90 = load ptr, ptr %89, align 8, !tbaa !13
  %91 = getelementptr inbounds double, ptr %90, i64 0
  store double %88, ptr %91, align 8, !tbaa !9
  %92 = load i64, ptr %8, align 8, !tbaa !5
  %93 = icmp sgt i64 %92, 1
  br i1 %93, label %94, label %215

94:                                               ; preds = %85
  %95 = load double, ptr %9, align 8, !tbaa !9
  %96 = load ptr, ptr %14, align 8, !tbaa !11
  %97 = call noundef double @_ZN11alglib_impl6ae_sqrEdPNS_8ae_stateE(double noundef %95, ptr noundef %96)
  store double %97, ptr %18, align 8, !tbaa !9
  %98 = load double, ptr %10, align 8, !tbaa !9
  %99 = load ptr, ptr %14, align 8, !tbaa !11
  %100 = call noundef double @_ZN11alglib_impl6ae_sqrEdPNS_8ae_stateE(double noundef %98, ptr noundef %99)
  store double %100, ptr %19, align 8, !tbaa !9
  %101 = load double, ptr %19, align 8, !tbaa !9
  %102 = load double, ptr %18, align 8, !tbaa !9
  %103 = fsub double %101, %102
  %104 = load double, ptr %20, align 8, !tbaa !9
  %105 = fadd double %104, 2.000000e+00
  %106 = load double, ptr %20, align 8, !tbaa !9
  %107 = fadd double %106, 4.000000e+00
  %108 = fmul double %105, %107
  %109 = fdiv double %103, %108
  %110 = getelementptr inbounds %"struct.alglib_impl::ae_vector", ptr %16, i32 0, i32 4
  %111 = load ptr, ptr %110, align 8, !tbaa !13
  %112 = getelementptr inbounds double, ptr %111, i64 1
  store double %109, ptr %112, align 8, !tbaa !9
  %113 = load double, ptr %9, align 8, !tbaa !9
  %114 = fadd double %113, 1.000000e+00
  %115 = fmul double 4.000000e+00, %114
  %116 = load double, ptr %10, align 8, !tbaa !9
  %117 = fadd double %116, 1.000000e+00
  %118 = fmul double %115, %117
  %119 = load double, ptr %20, align 8, !tbaa !9
  %120 = fadd double %119, 3.000000e+00
  %121 = load double, ptr %20, align 8, !tbaa !9
  %122 = fadd double %121, 2.000000e+00
  %123 = load ptr, ptr %14, align 8, !tbaa !11
  %124 = call noundef double @_ZN11alglib_impl6ae_sqrEdPNS_8ae_stateE(double noundef %122, ptr noundef %123)
  %125 = fmul double %120, %124
  %126 = fdiv double %118, %125
  %127 = getelementptr inbounds %"struct.alglib_impl::ae_vector", ptr %17, i32 0, i32 4
  %128 = load ptr, ptr %127, align 8, !tbaa !13
  %129 = getelementptr inbounds double, ptr %128, i64 1
  store double %126, ptr %129, align 8, !tbaa !9
  store i64 2, ptr %22, align 8, !tbaa !5
  br label %130

130:                                              ; preds = %211, %94
  %131 = load i64, ptr %22, align 8, !tbaa !5
  %132 = load i64, ptr %8, align 8, !tbaa !5
  %133 = sub nsw i64 %132, 1
  %134 = icmp sle i64 %131, %133
  br i1 %134, label %135, label %214

135:                                              ; preds = %130
  %136 = load double, ptr %19, align 8, !tbaa !9
  %137 = load double, ptr %18, align 8, !tbaa !9
  %138 = fsub double %136, %137
  %139 = fmul double 2.500000e-01, %138
  %140 = load i64, ptr %22, align 8, !tbaa !5
  %141 = load i64, ptr %22, align 8, !tbaa !5
  %142 = mul nsw i64 %140, %141
  %143 = sitofp i64 %142 to double
  %144 = load double, ptr %20, align 8, !tbaa !9
  %145 = fmul double 5.000000e-01, %144
  %146 = load i64, ptr %22, align 8, !tbaa !5
  %147 = sitofp i64 %146 to double
  %148 = fdiv double %145, %147
  %149 = fadd double 1.000000e+00, %148
  %150 = fmul double %143, %149
  %151 = load double, ptr %20, align 8, !tbaa !9
  %152 = fadd double %151, 2.000000e+00
  %153 = fmul double 5.000000e-01, %152
  %154 = load i64, ptr %22, align 8, !tbaa !5
  %155 = sitofp i64 %154 to double
  %156 = fdiv double %153, %155
  %157 = fadd double 1.000000e+00, %156
  %158 = fmul double %150, %157
  %159 = fdiv double %139, %158
  %160 = getelementptr inbounds %"struct.alglib_impl::ae_vector", ptr %16, i32 0, i32 4
  %161 = load ptr, ptr %160, align 8, !tbaa !13
  %162 = load i64, ptr %22, align 8, !tbaa !5
  %163 = getelementptr inbounds double, ptr %161, i64 %162
  store double %159, ptr %163, align 8, !tbaa !9
  %164 = load double, ptr %9, align 8, !tbaa !9
  %165 = load i64, ptr %22, align 8, !tbaa !5
  %166 = sitofp i64 %165 to double
  %167 = fdiv double %164, %166
  %168 = fadd double 1.000000e+00, %167
  %169 = fmul double 2.500000e-01, %168
  %170 = load double, ptr %10, align 8, !tbaa !9
  %171 = load i64, ptr %22, align 8, !tbaa !5
  %172 = sitofp i64 %171 to double
  %173 = fdiv double %170, %172
  %174 = fadd double 1.000000e+00, %173
  %175 = fmul double %169, %174
  %176 = load double, ptr %20, align 8, !tbaa !9
  %177 = load i64, ptr %22, align 8, !tbaa !5
  %178 = sitofp i64 %177 to double
  %179 = fdiv double %176, %178
  %180 = fadd double 1.000000e+00, %179
  %181 = fmul double %175, %180
  %182 = load double, ptr %20, align 8, !tbaa !9
  %183 = fadd double %182, 1.000000e+00
  %184 = fmul double 5.000000e-01, %183
  %185 = load i64, ptr %22, align 8, !tbaa !5
  %186 = sitofp i64 %185 to double
  %187 = fdiv double %184, %186
  %188 = fadd double 1.000000e+00, %187
  %189 = load double, ptr %20, align 8, !tbaa !9
  %190 = fsub double %189, 1.000000e+00
  %191 = fmul double 5.000000e-01, %190
  %192 = load i64, ptr %22, align 8, !tbaa !5
  %193 = sitofp i64 %192 to double
  %194 = fdiv double %191, %193
  %195 = fadd double 1.000000e+00, %194
  %196 = fmul double %188, %195
  %197 = load double, ptr %20, align 8, !tbaa !9
  %198 = fmul double 5.000000e-01, %197
  %199 = load i64, ptr %22, align 8, !tbaa !5
  %200 = sitofp i64 %199 to double
  %201 = fdiv double %198, %200
  %202 = fadd double 1.000000e+00, %201
  %203 = load ptr, ptr %14, align 8, !tbaa !11
  %204 = call noundef double @_ZN11alglib_impl6ae_sqrEdPNS_8ae_stateE(double noundef %202, ptr noundef %203)
  %205 = fmul double %196, %204
  %206 = fdiv double %181, %205
  %207 = getelementptr inbounds %"struct.alglib_impl::ae_vector", ptr %17, i32 0, i32 4
  %208 = load ptr, ptr %207, align 8, !tbaa !13
  %209 = load i64, ptr %22, align 8, !tbaa !5
  %210 = getelementptr inbounds double, ptr %208, i64 %209
  store double %206, ptr %210, align 8, !tbaa !9
  br label %211

211:                                              ; preds = %135
  %212 = load i64, ptr %22, align 8, !tbaa !5
  %213 = add nsw i64 %212, 1
  store i64 %213, ptr %22, align 8, !tbaa !5
  br label %130, !llvm.loop !14

214:                                              ; preds = %130
  br label %215

215:                                              ; preds = %214, %85
  %216 = getelementptr inbounds %"struct.alglib_impl::ae_vector", ptr %17, i32 0, i32 4
  %217 = load ptr, ptr %216, align 8, !tbaa !13
  %218 = getelementptr inbounds double, ptr %217, i64 0
  %219 = load double, ptr %218, align 8, !tbaa !9
  %220 = load i64, ptr %8, align 8, !tbaa !5
  %221 = load ptr, ptr %11, align 8, !tbaa !11
  %222 = load ptr, ptr %12, align 8, !tbaa !11
  %223 = load ptr, ptr %13, align 8, !tbaa !11
  %224 = load ptr, ptr %14, align 8, !tbaa !11
  call void @_ZN11alglib_impl13gqgeneraterecEPNS_9ae_vectorES1_dlPlS1_S1_PNS_8ae_stateE(ptr noundef %16, ptr noundef %17, double noundef %219, i64 noundef %220, ptr noundef %221, ptr noundef %222, ptr noundef %223, ptr noundef %224)
  %225 = load ptr, ptr %11, align 8, !tbaa !11
  %226 = load i64, ptr %225, align 8, !tbaa !5
  %227 = icmp sgt i64 %226, 0
  br i1 %227, label %228, label %274

228:                                              ; preds = %215
  %229 = load ptr, ptr %12, align 8, !tbaa !11
  %230 = getelementptr inbounds %"struct.alglib_impl::ae_vector", ptr %229, i32 0, i32 4
  %231 = load ptr, ptr %230, align 8, !tbaa !13
  %232 = getelementptr inbounds double, ptr %231, i64 0
  %233 = load double, ptr %232, align 8, !tbaa !9
  %234 = call noundef zeroext i1 @_ZN11alglib_impl10ae_fp_lessEdd(double noundef %233, double noundef -1.000000e+00)
  br i1 %234, label %244, label %235

235:                                              ; preds = %228
  %236 = load ptr, ptr %12, align 8, !tbaa !11
  %237 = getelementptr inbounds %"struct.alglib_impl::ae_vector", ptr %236, i32 0, i32 4
  %238 = load ptr, ptr %237, align 8, !tbaa !13
  %239 = load i64, ptr %8, align 8, !tbaa !5
  %240 = sub nsw i64 %239, 1
  %241 = getelementptr inbounds double, ptr %238, i64 %240
  %242 = load double, ptr %241, align 8, !tbaa !9
  %243 = call noundef zeroext i1 @_ZN11alglib_impl13ae_fp_greaterEdd(double noundef %242, double noundef 1.000000e+00)
  br i1 %243, label %244, label %246

244:                                              ; preds = %235, %228
  %245 = load ptr, ptr %11, align 8, !tbaa !11
  store i64 -4, ptr %245, align 8, !tbaa !5
  br label %246

246:                                              ; preds = %244, %235
  store i64 0, ptr %22, align 8, !tbaa !5
  br label %247

247:                                              ; preds = %270, %246
  %248 = load i64, ptr %22, align 8, !tbaa !5
  %249 = load i64, ptr %8, align 8, !tbaa !5
  %250 = sub nsw i64 %249, 2
  %251 = icmp sle i64 %248, %250
  br i1 %251, label %252, label %273

252:                                              ; preds = %247
  %253 = load ptr, ptr %12, align 8, !tbaa !11
  %254 = getelementptr inbounds %"struct.alglib_impl::ae_vector", ptr %253, i32 0, i32 4
  %255 = load ptr, ptr %254, align 8, !tbaa !13
  %256 = load i64, ptr %22, align 8, !tbaa !5
  %257 = getelementptr inbounds double, ptr %255, i64 %256
  %258 = load double, ptr %257, align 8, !tbaa !9
  %259 = load ptr, ptr %12, align 8, !tbaa !11
  %260 = getelementptr inbounds %"struct.alglib_impl::ae_vector", ptr %259, i32 0, i32 4
  %261 = load ptr, ptr %260, align 8, !tbaa !13
  %262 = load i64, ptr %22, align 8, !tbaa !5
  %263 = add nsw i64 %262, 1
  %264 = getelementptr inbounds double, ptr %261, i64 %263
  %265 = load double, ptr %264, align 8, !tbaa !9
  %266 = call noundef zeroext i1 @_ZN11alglib_impl16ae_fp_greater_eqEdd(double noundef %258, double noundef %265)
  br i1 %266, label %267, label %269

267:                                              ; preds = %252
  %268 = load ptr, ptr %11, align 8, !tbaa !11
  store i64 -4, ptr %268, align 8, !tbaa !5
  br label %269

269:                                              ; preds = %267, %252
  br label %270

270:                                              ; preds = %269
  %271 = load i64, ptr %22, align 8, !tbaa !5
  %272 = add nsw i64 %271, 1
  store i64 %272, ptr %22, align 8, !tbaa !5
  br label %247, !llvm.loop !16

273:                                              ; preds = %247
  br label %274

274:                                              ; preds = %273, %215
  %275 = load ptr, ptr %14, align 8, !tbaa !11
  call void @_ZN11alglib_impl14ae_frame_leaveEPNS_8ae_stateE(ptr noundef %275)
  store i32 0, ptr %24, align 4
  br label %276

276:                                              ; preds = %274, %82, %39
  call void @llvm.lifetime.end.p0(i64 8, ptr %23) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #5
  call void @llvm.lifetime.end.p0(i64 64, ptr %17) #5
  call void @llvm.lifetime.end.p0(i64 64, ptr %16) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr %15) #5
  %277 = load i32, ptr %24, align 4
  switch i32 %277, label %279 [
    i32 0, label %278
    i32 1, label %278
  ]

278:                                              ; preds = %276, %276
  ret void

279:                                              ; preds = %276
  unreachable
}

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

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

declare void @_ZN11alglib_impl15ae_vector_clearEPNS_9ae_vectorE(ptr noundef) #3

declare void @_ZN11alglib_impl14ae_vector_initEPNS_9ae_vectorEllPNS_8ae_stateEb(ptr noundef, i64 noundef, i64 noundef, ptr noundef, i1 noundef zeroext) #3

declare void @_ZN11alglib_impl14ae_frame_leaveEPNS_8ae_stateE(ptr noundef) #3

declare void @_ZN11alglib_impl20ae_vector_set_lengthEPNS_9ae_vectorElPNS_8ae_stateE(ptr noundef, i64 noundef, ptr noundef) #3

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

declare noundef double @_ZN11alglib_impl6ae_sqrEdPNS_8ae_stateE(double noundef, ptr noundef) #3

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare double @llvm.fmuladd.f64(double, double, double) #4

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

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

declare noundef zeroext i1 @_ZN11alglib_impl16ae_fp_greater_eqEdd(double noundef, double noundef) #3

declare noundef double @_ZN11alglib_impl6ae_logEdPNS_8ae_stateE(double noundef, ptr noundef) #3

declare noundef double @_ZN11alglib_impl7lngammaEdPdPNS_8ae_stateE(double noundef, ptr noundef, ptr noundef) #3

declare noundef double @_ZN11alglib_impl6ae_expEdPNS_8ae_stateE(double noundef, ptr noundef) #3

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 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #3 = { "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 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #5 = { 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 = !{!"long", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"double", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"any pointer", !7, i64 0}
!13 = !{!7, !7, i64 0}
!14 = distinct !{!14, !15}
!15 = !{!"llvm.loop.mustprogress"}
!16 = distinct !{!16, !15}


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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN11alglib_impl13gqgeneraterecEPNS_9ae_vectorES1_dlPlS1_S1_PNS_8ae_stateE(ptr noundef, ptr noundef, double noundef, i64 noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #1

; 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_impl21gqgenerategaussjacobiElddPlPNS_9ae_vectorES2_PNS_8ae_stateE(i64 noundef %0, double noundef %1, double noundef %2, ptr noundef %3, ptr noundef %4, ptr noundef %5, ptr noundef %6) local_unnamed_addr #1 {
  %8 = alloca %"struct.alglib_impl::ae_frame", align 8
  %9 = alloca %"struct.alglib_impl::ae_vector", align 8
  %10 = alloca %"struct.alglib_impl::ae_vector", align 8
  %11 = alloca double, align 8
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %8) #6
  call void @llvm.lifetime.start.p0(i64 64, ptr nonnull %9) #6
  call void @llvm.lifetime.start.p0(i64 64, ptr nonnull %10) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %11) #6
  call void @_ZN11alglib_impl13ae_frame_makeEPNS_8ae_stateEPNS_8ae_frameE(ptr noundef %6, ptr noundef nonnull %8)
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(64) %9, i8 0, i64 64, i1 false)
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(64) %10, i8 0, i64 64, i1 false)
  store i64 0, ptr %3, align 8, !tbaa !5
  call void @_ZN11alglib_impl15ae_vector_clearEPNS_9ae_vectorE(ptr noundef %4)
  call void @_ZN11alglib_impl15ae_vector_clearEPNS_9ae_vectorE(ptr noundef %5)
  call void @_ZN11alglib_impl14ae_vector_initEPNS_9ae_vectorEllPNS_8ae_stateEb(ptr noundef nonnull %9, i64 noundef 0, i64 noundef 3, ptr noundef %6, i1 noundef zeroext true)
  call void @_ZN11alglib_impl14ae_vector_initEPNS_9ae_vectorEllPNS_8ae_stateEb(ptr noundef nonnull %10, i64 noundef 0, i64 noundef 3, ptr noundef %6, i1 noundef zeroext true)
  %12 = icmp slt i64 %0, 1
  br i1 %12, label %.loopexit.sink.split, label %13

13:                                               ; preds = %7
  %14 = call noundef zeroext i1 @_ZN11alglib_impl13ae_fp_less_eqEdd(double noundef %1, double noundef -1.000000e+00)
  br i1 %14, label %.loopexit.sink.split, label %15

15:                                               ; preds = %13
  %16 = call noundef zeroext i1 @_ZN11alglib_impl13ae_fp_less_eqEdd(double noundef %2, double noundef -1.000000e+00)
  br i1 %16, label %.loopexit.sink.split, label %17

17:                                               ; preds = %15
  call void @_ZN11alglib_impl20ae_vector_set_lengthEPNS_9ae_vectorElPNS_8ae_stateE(ptr noundef nonnull %9, i64 noundef %0, ptr noundef %6)
  call void @_ZN11alglib_impl20ae_vector_set_lengthEPNS_9ae_vectorElPNS_8ae_stateE(ptr noundef nonnull %10, i64 noundef %0, ptr noundef %6)
  %18 = fsub double %2, %1
  %19 = fadd double %1, %2
  %20 = fadd double %19, 2.000000e+00
  %21 = fdiv double %18, %20
  %22 = getelementptr inbounds i8, ptr %9, i64 56
  %23 = load ptr, ptr %22, align 8, !tbaa !9
  store double %21, ptr %23, align 8, !tbaa !10
  %24 = fadd double %19, 1.000000e+00
  %25 = call noundef double @_ZN11alglib_impl6ae_logEdPNS_8ae_stateE(double noundef 2.000000e+00, ptr noundef %6)
  %26 = fadd double %1, 1.000000e+00
  %27 = call noundef double @_ZN11alglib_impl7lngammaEdPdPNS_8ae_stateE(double noundef %26, ptr noundef nonnull %11, ptr noundef %6)
  %28 = call double @llvm.fmuladd.f64(double %24, double %25, double %27)
  %29 = fadd double %2, 1.000000e+00
  %30 = call noundef double @_ZN11alglib_impl7lngammaEdPdPNS_8ae_stateE(double noundef %29, ptr noundef nonnull %11, ptr noundef %6)
  %31 = fadd double %28, %30
  %32 = call noundef double @_ZN11alglib_impl7lngammaEdPdPNS_8ae_stateE(double noundef %20, ptr noundef nonnull %11, ptr noundef %6)
  %33 = fsub double %31, %32
  %34 = call noundef double @_ZN11alglib_impl6ae_logEdPNS_8ae_stateE(double noundef 1.000000e+300, ptr noundef %6)
  %35 = call noundef zeroext i1 @_ZN11alglib_impl13ae_fp_greaterEdd(double noundef %33, double noundef %34)
  br i1 %35, label %.loopexit.sink.split, label %36

36:                                               ; preds = %17
  %37 = call noundef double @_ZN11alglib_impl6ae_expEdPNS_8ae_stateE(double noundef %33, ptr noundef %6)
  %38 = getelementptr inbounds i8, ptr %10, i64 56
  %39 = load ptr, ptr %38, align 8, !tbaa !9
  store double %37, ptr %39, align 8, !tbaa !10
  %.not = icmp eq i64 %0, 1
  br i1 %.not, label %.loopexit95, label %40

40:                                               ; preds = %36
  %41 = call noundef double @_ZN11alglib_impl6ae_sqrEdPNS_8ae_stateE(double noundef %1, ptr noundef %6)
  %42 = call noundef double @_ZN11alglib_impl6ae_sqrEdPNS_8ae_stateE(double noundef %2, ptr noundef %6)
  %43 = fsub double %42, %41
  %44 = fadd double %19, 4.000000e+00
  %45 = fmul double %20, %44
  %46 = fdiv double %43, %45
  %47 = load ptr, ptr %22, align 8, !tbaa !9
  %48 = getelementptr inbounds i8, ptr %47, i64 8
  store double %46, ptr %48, align 8, !tbaa !10
  %49 = fmul double %26, 4.000000e+00
  %50 = fmul double %49, %29
  %51 = fadd double %19, 3.000000e+00
  %52 = call noundef double @_ZN11alglib_impl6ae_sqrEdPNS_8ae_stateE(double noundef %20, ptr noundef %6)
  %53 = fmul double %51, %52
  %54 = fdiv double %50, %53
  %55 = load ptr, ptr %38, align 8, !tbaa !9
  %56 = getelementptr inbounds i8, ptr %55, i64 8
  store double %54, ptr %56, align 8, !tbaa !10
  %.not93.not96 = icmp ugt i64 %0, 2
  br i1 %.not93.not96, label %.lr.ph, label %.loopexit95

.lr.ph:                                           ; preds = %40
  %57 = fmul double %43, 2.500000e-01
  %58 = insertelement <2 x double> poison, double %20, i64 0
  %59 = insertelement <2 x double> %58, double %19, i64 1
  %60 = fmul <2 x double> %59, <double 5.000000e-01, double 5.000000e-01>
  %61 = fmul double %24, 5.000000e-01
  %62 = fadd double %19, -1.000000e+00
  %63 = fmul double %62, 5.000000e-01
  %64 = insertelement <2 x double> poison, double %19, i64 0
  %65 = insertelement <2 x double> %64, double %61, i64 1
  %66 = insertelement <2 x double> poison, double %2, i64 0
  %67 = insertelement <2 x double> %66, double %1, i64 1
  br label %68

68:                                               ; preds = %.lr.ph, %68
  %.097 = phi i64 [ 2, %.lr.ph ], [ %103, %68 ]
  %69 = mul nuw nsw i64 %.097, %.097
  %70 = uitofp nneg i64 %69 to double
  %71 = uitofp nneg i64 %.097 to double
  %72 = insertelement <2 x double> poison, double %71, i64 0
  %73 = shufflevector <2 x double> %72, <2 x double> poison, <2 x i32> zeroinitializer
  %74 = fdiv <2 x double> %60, %73
  %75 = fadd <2 x double> %74, <double 1.000000e+00, double 1.000000e+00>
  %76 = extractelement <2 x double> %75, i64 1
  %77 = fmul double %76, %70
  %78 = extractelement <2 x double> %75, i64 0
  %79 = fmul double %78, %77
  %80 = fdiv double %57, %79
  %81 = load ptr, ptr %22, align 8, !tbaa !9
  %82 = getelementptr inbounds double, ptr %81, i64 %.097
  store double %80, ptr %82, align 8, !tbaa !10
  %83 = fdiv <2 x double> %67, %73
  %84 = fadd <2 x double> %83, <double 1.000000e+00, double 1.000000e+00>
  %85 = extractelement <2 x double> %84, i64 1
  %86 = fmul double %85, 2.500000e-01
  %87 = extractelement <2 x double> %84, i64 0
  %88 = fmul double %87, %86
  %89 = fdiv double %63, %71
  %90 = fadd double %89, 1.000000e+00
  %91 = fdiv <2 x double> %65, %73
  %92 = fadd <2 x double> %91, <double 1.000000e+00, double 1.000000e+00>
  %93 = insertelement <2 x double> poison, double %88, i64 0
  %94 = insertelement <2 x double> %93, double %90, i64 1
  %95 = fmul <2 x double> %92, %94
  %96 = call noundef double @_ZN11alglib_impl6ae_sqrEdPNS_8ae_stateE(double noundef %76, ptr noundef %6)
  %97 = extractelement <2 x double> %95, i64 1
  %98 = fmul double %97, %96
  %99 = extractelement <2 x double> %95, i64 0
  %100 = fdiv double %99, %98
  %101 = load ptr, ptr %38, align 8, !tbaa !9
  %102 = getelementptr inbounds double, ptr %101, i64 %.097
  store double %100, ptr %102, align 8, !tbaa !10
  %103 = add nuw nsw i64 %.097, 1
  %exitcond.not = icmp eq i64 %103, %0
  br i1 %exitcond.not, label %.loopexit95, label %68, !llvm.loop !12

.loopexit95:                                      ; preds = %68, %40, %36
  %104 = load ptr, ptr %38, align 8, !tbaa !9
  %105 = load double, ptr %104, align 8, !tbaa !10
  call void @_ZN11alglib_impl13gqgeneraterecEPNS_9ae_vectorES1_dlPlS1_S1_PNS_8ae_stateE(ptr noundef nonnull %9, ptr noundef nonnull %10, double noundef %105, i64 noundef %0, ptr noundef nonnull %3, ptr noundef %4, ptr noundef %5, ptr noundef %6)
  %106 = load i64, ptr %3, align 8, !tbaa !5
  %107 = icmp sgt i64 %106, 0
  br i1 %107, label %108, label %.loopexit

108:                                              ; preds = %.loopexit95
  %109 = getelementptr inbounds i8, ptr %4, i64 56
  %110 = load ptr, ptr %109, align 8, !tbaa !9
  %111 = load double, ptr %110, align 8, !tbaa !10
  %112 = call noundef zeroext i1 @_ZN11alglib_impl10ae_fp_lessEdd(double noundef %111, double noundef -1.000000e+00)
  br i1 %112, label %119, label %113

113:                                              ; preds = %108
  %114 = load ptr, ptr %109, align 8, !tbaa !9
  %115 = getelementptr double, ptr %114, i64 %0
  %116 = getelementptr i8, ptr %115, i64 -8
  %117 = load double, ptr %116, align 8, !tbaa !10
  %118 = call noundef zeroext i1 @_ZN11alglib_impl13ae_fp_greaterEdd(double noundef %117, double noundef 1.000000e+00)
  br i1 %118, label %119, label %120

119:                                              ; preds = %113, %108
  store i64 -4, ptr %3, align 8, !tbaa !5
  br label %120

120:                                              ; preds = %119, %113
  br i1 %.not, label %.loopexit, label %.lr.ph100.preheader

.lr.ph100.preheader:                              ; preds = %120
  %121 = call i64 @llvm.smax.i64(i64 %0, i64 2)
  %122 = add nsw i64 %121, -2
  br label %.lr.ph100

.lr.ph100:                                        ; preds = %.lr.ph100.preheader, %131
  %.199 = phi i64 [ %126, %131 ], [ 0, %.lr.ph100.preheader ]
  %123 = load ptr, ptr %109, align 8, !tbaa !9
  %124 = getelementptr inbounds double, ptr %123, i64 %.199
  %125 = load double, ptr %124, align 8, !tbaa !10
  %126 = add nuw nsw i64 %.199, 1
  %127 = getelementptr inbounds double, ptr %123, i64 %126
  %128 = load double, ptr %127, align 8, !tbaa !10
  %129 = call noundef zeroext i1 @_ZN11alglib_impl16ae_fp_greater_eqEdd(double noundef %125, double noundef %128)
  br i1 %129, label %130, label %131

130:                                              ; preds = %.lr.ph100
  store i64 -4, ptr %3, align 8, !tbaa !5
  br label %131

131:                                              ; preds = %.lr.ph100, %130
  %exitcond101.not = icmp eq i64 %.199, %122
  br i1 %exitcond101.not, label %.loopexit, label %.lr.ph100, !llvm.loop !14

.loopexit.sink.split:                             ; preds = %17, %7, %13, %15
  %.sink = phi i64 [ -1, %15 ], [ -1, %13 ], [ -1, %7 ], [ -4, %17 ]
  store i64 %.sink, ptr %3, align 8, !tbaa !5
  br label %.loopexit

.loopexit:                                        ; preds = %131, %.loopexit.sink.split, %.loopexit95, %120
  call void @_ZN11alglib_impl14ae_frame_leaveEPNS_8ae_stateE(ptr noundef %6)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %11) #6
  call void @llvm.lifetime.end.p0(i64 64, ptr nonnull %10) #6
  call void @llvm.lifetime.end.p0(i64 64, ptr nonnull %9) #6
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %8) #6
  ret void
}

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

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

declare void @_ZN11alglib_impl15ae_vector_clearEPNS_9ae_vectorE(ptr noundef) local_unnamed_addr #3

declare void @_ZN11alglib_impl14ae_vector_initEPNS_9ae_vectorEllPNS_8ae_stateEb(ptr noundef, i64 noundef, i64 noundef, ptr noundef, i1 noundef zeroext) local_unnamed_addr #3

declare void @_ZN11alglib_impl14ae_frame_leaveEPNS_8ae_stateE(ptr noundef) local_unnamed_addr #3

declare void @_ZN11alglib_impl20ae_vector_set_lengthEPNS_9ae_vectorElPNS_8ae_stateE(ptr noundef, i64 noundef, ptr noundef) local_unnamed_addr #3

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

declare noundef double @_ZN11alglib_impl6ae_sqrEdPNS_8ae_stateE(double noundef, ptr noundef) local_unnamed_addr #3

; Function Attrs: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare double @llvm.fmuladd.f64(double, double, double) #4

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

declare noundef zeroext i1 @_ZN11alglib_impl10ae_fp_lessEdd(double noundef, double noundef) local_unnamed_addr #3

declare noundef zeroext i1 @_ZN11alglib_impl16ae_fp_greater_eqEdd(double noundef, double noundef) local_unnamed_addr #3

declare noundef double @_ZN11alglib_impl6ae_logEdPNS_8ae_stateE(double noundef, ptr noundef) local_unnamed_addr #3

declare noundef double @_ZN11alglib_impl7lngammaEdPdPNS_8ae_stateE(double noundef, ptr noundef, ptr noundef) local_unnamed_addr #3

declare noundef double @_ZN11alglib_impl6ae_expEdPNS_8ae_stateE(double noundef, ptr noundef) local_unnamed_addr #3

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.smax.i64(i64, i64) #5

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 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #3 = { "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 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #5 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #6 = { 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 = !{!"long", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!7, !7, i64 0}
!10 = !{!11, !11, i64 0}
!11 = !{!"double", !7, i64 0}
!12 = distinct !{!12, !13}
!13 = !{!"llvm.loop.mustprogress"}
!14 = distinct !{!14, !13}


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