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

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

43:                                               ; preds = %9
  %44 = load ptr, ptr %15, align 8, !tbaa !5
  store i64 -1, ptr %44, align 8, !tbaa !11
  %45 = load ptr, ptr %18, align 8, !tbaa !5
  call void @_ZN11alglib_impl14ae_frame_leaveEPNS_8ae_stateE(ptr noundef %45)
  store i32 1, ptr %29, align 4
  br label %209

46:                                               ; preds = %9
  %47 = load ptr, ptr %15, align 8, !tbaa !5
  store i64 1, ptr %47, align 8, !tbaa !11
  %48 = load i64, ptr %14, align 8, !tbaa !11
  %49 = sub nsw i64 %48, 1
  store i64 %49, ptr %14, align 8, !tbaa !11
  %50 = load i64, ptr %14, align 8, !tbaa !11
  %51 = add nsw i64 %50, 1
  %52 = load ptr, ptr %18, align 8, !tbaa !5
  call void @_ZN11alglib_impl20ae_vector_set_lengthEPNS_9ae_vectorElPNS_8ae_stateE(ptr noundef %23, i64 noundef %51, ptr noundef %52)
  %53 = load i64, ptr %14, align 8, !tbaa !11
  %54 = load ptr, ptr %18, align 8, !tbaa !5
  call void @_ZN11alglib_impl20ae_vector_set_lengthEPNS_9ae_vectorElPNS_8ae_stateE(ptr noundef %24, i64 noundef %53, ptr noundef %54)
  store i64 1, ptr %22, align 8, !tbaa !11
  br label %55

55:                                               ; preds = %96, %46
  %56 = load i64, ptr %22, align 8, !tbaa !11
  %57 = load i64, ptr %14, align 8, !tbaa !11
  %58 = icmp sle i64 %56, %57
  br i1 %58, label %59, label %99

59:                                               ; preds = %55
  %60 = load ptr, ptr %10, align 8, !tbaa !5
  %61 = getelementptr inbounds %"struct.alglib_impl::ae_vector", ptr %60, i32 0, i32 4
  %62 = load ptr, ptr %61, align 8, !tbaa !13
  %63 = load i64, ptr %22, align 8, !tbaa !11
  %64 = sub nsw i64 %63, 1
  %65 = getelementptr inbounds double, ptr %62, i64 %64
  %66 = load double, ptr %65, align 8, !tbaa !9
  %67 = getelementptr inbounds %"struct.alglib_impl::ae_vector", ptr %23, i32 0, i32 4
  %68 = load ptr, ptr %67, align 8, !tbaa !13
  %69 = load i64, ptr %22, align 8, !tbaa !11
  %70 = sub nsw i64 %69, 1
  %71 = getelementptr inbounds double, ptr %68, i64 %70
  store double %66, ptr %71, align 8, !tbaa !9
  %72 = load ptr, ptr %11, align 8, !tbaa !5
  %73 = getelementptr inbounds %"struct.alglib_impl::ae_vector", ptr %72, i32 0, i32 4
  %74 = load ptr, ptr %73, align 8, !tbaa !13
  %75 = load i64, ptr %22, align 8, !tbaa !11
  %76 = getelementptr inbounds double, ptr %74, i64 %75
  %77 = load double, ptr %76, align 8, !tbaa !9
  %78 = call noundef zeroext i1 @_ZN11alglib_impl13ae_fp_less_eqEdd(double noundef %77, double noundef 0.000000e+00)
  br i1 %78, label %79, label %82

79:                                               ; preds = %59
  %80 = load ptr, ptr %15, align 8, !tbaa !5
  store i64 -2, ptr %80, align 8, !tbaa !11
  %81 = load ptr, ptr %18, align 8, !tbaa !5
  call void @_ZN11alglib_impl14ae_frame_leaveEPNS_8ae_stateE(ptr noundef %81)
  store i32 1, ptr %29, align 4
  br label %209

82:                                               ; preds = %59
  %83 = load ptr, ptr %11, align 8, !tbaa !5
  %84 = getelementptr inbounds %"struct.alglib_impl::ae_vector", ptr %83, i32 0, i32 4
  %85 = load ptr, ptr %84, align 8, !tbaa !13
  %86 = load i64, ptr %22, align 8, !tbaa !11
  %87 = getelementptr inbounds double, ptr %85, i64 %86
  %88 = load double, ptr %87, align 8, !tbaa !9
  %89 = load ptr, ptr %18, align 8, !tbaa !5
  %90 = call noundef double @_ZN11alglib_impl7ae_sqrtEdPNS_8ae_stateE(double noundef %88, ptr noundef %89)
  %91 = getelementptr inbounds %"struct.alglib_impl::ae_vector", ptr %24, i32 0, i32 4
  %92 = load ptr, ptr %91, align 8, !tbaa !13
  %93 = load i64, ptr %22, align 8, !tbaa !11
  %94 = sub nsw i64 %93, 1
  %95 = getelementptr inbounds double, ptr %92, i64 %94
  store double %90, ptr %95, align 8, !tbaa !9
  br label %96

96:                                               ; preds = %82
  %97 = load i64, ptr %22, align 8, !tbaa !11
  %98 = add nsw i64 %97, 1
  store i64 %98, ptr %22, align 8, !tbaa !11
  br label %55, !llvm.loop !14

99:                                               ; preds = %55
  %100 = load ptr, ptr %11, 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 !13
  %103 = getelementptr inbounds double, ptr %102, i64 0
  store double 0.000000e+00, ptr %103, align 8, !tbaa !9
  store double 0.000000e+00, ptr %26, align 8, !tbaa !9
  store double 1.000000e+00, ptr %27, align 8, !tbaa !9
  store i64 1, ptr %22, align 8, !tbaa !11
  br label %104

104:                                              ; preds = %132, %99
  %105 = load i64, ptr %22, align 8, !tbaa !11
  %106 = load i64, ptr %14, align 8, !tbaa !11
  %107 = icmp sle i64 %105, %106
  br i1 %107, label %108, label %135

108:                                              ; preds = %104
  %109 = load double, ptr %13, align 8, !tbaa !9
  %110 = load ptr, ptr %10, align 8, !tbaa !5
  %111 = getelementptr inbounds %"struct.alglib_impl::ae_vector", ptr %110, i32 0, i32 4
  %112 = load ptr, ptr %111, align 8, !tbaa !13
  %113 = load i64, ptr %22, align 8, !tbaa !11
  %114 = sub nsw i64 %113, 1
  %115 = getelementptr inbounds double, ptr %112, i64 %114
  %116 = load double, ptr %115, align 8, !tbaa !9
  %117 = fsub double %109, %116
  %118 = load double, ptr %27, align 8, !tbaa !9
  %119 = load ptr, ptr %11, align 8, !tbaa !5
  %120 = getelementptr inbounds %"struct.alglib_impl::ae_vector", ptr %119, i32 0, i32 4
  %121 = load ptr, ptr %120, align 8, !tbaa !13
  %122 = load i64, ptr %22, align 8, !tbaa !11
  %123 = sub nsw i64 %122, 1
  %124 = getelementptr inbounds double, ptr %121, i64 %123
  %125 = load double, ptr %124, align 8, !tbaa !9
  %126 = load double, ptr %26, align 8, !tbaa !9
  %127 = fmul double %125, %126
  %128 = fneg double %127
  %129 = call double @llvm.fmuladd.f64(double %117, double %118, double %128)
  store double %129, ptr %28, align 8, !tbaa !9
  %130 = load double, ptr %27, align 8, !tbaa !9
  store double %130, ptr %26, align 8, !tbaa !9
  %131 = load double, ptr %28, align 8, !tbaa !9
  store double %131, ptr %27, align 8, !tbaa !9
  br label %132

132:                                              ; preds = %108
  %133 = load i64, ptr %22, align 8, !tbaa !11
  %134 = add nsw i64 %133, 1
  store i64 %134, ptr %22, align 8, !tbaa !11
  br label %104, !llvm.loop !16

135:                                              ; preds = %104
  %136 = load double, ptr %13, align 8, !tbaa !9
  %137 = load ptr, ptr %11, align 8, !tbaa !5
  %138 = getelementptr inbounds %"struct.alglib_impl::ae_vector", ptr %137, i32 0, i32 4
  %139 = load ptr, ptr %138, align 8, !tbaa !13
  %140 = load i64, ptr %14, align 8, !tbaa !11
  %141 = getelementptr inbounds double, ptr %139, i64 %140
  %142 = load double, ptr %141, align 8, !tbaa !9
  %143 = load double, ptr %26, align 8, !tbaa !9
  %144 = fmul double %142, %143
  %145 = load double, ptr %27, align 8, !tbaa !9
  %146 = fdiv double %144, %145
  %147 = fsub double %136, %146
  %148 = getelementptr inbounds %"struct.alglib_impl::ae_vector", ptr %23, i32 0, i32 4
  %149 = load ptr, ptr %148, align 8, !tbaa !13
  %150 = load i64, ptr %14, align 8, !tbaa !11
  %151 = getelementptr inbounds double, ptr %149, i64 %150
  store double %147, ptr %151, align 8, !tbaa !9
  %152 = load i64, ptr %14, align 8, !tbaa !11
  %153 = add nsw i64 %152, 1
  %154 = load ptr, ptr %18, align 8, !tbaa !5
  %155 = call noundef zeroext i1 @_ZN11alglib_impl12smatrixtdevdEPNS_9ae_vectorES1_llPNS_9ae_matrixEPNS_8ae_stateE(ptr noundef %23, ptr noundef %24, i64 noundef %153, i64 noundef 3, ptr noundef %25, ptr noundef %154)
  br i1 %155, label %159, label %156

156:                                              ; preds = %135
  %157 = load ptr, ptr %15, align 8, !tbaa !5
  store i64 -3, ptr %157, align 8, !tbaa !11
  %158 = load ptr, ptr %18, align 8, !tbaa !5
  call void @_ZN11alglib_impl14ae_frame_leaveEPNS_8ae_stateE(ptr noundef %158)
  store i32 1, ptr %29, align 4
  br label %209

159:                                              ; preds = %135
  %160 = load ptr, ptr %16, align 8, !tbaa !5
  %161 = load i64, ptr %14, align 8, !tbaa !11
  %162 = add nsw i64 %161, 1
  %163 = load ptr, ptr %18, align 8, !tbaa !5
  call void @_ZN11alglib_impl20ae_vector_set_lengthEPNS_9ae_vectorElPNS_8ae_stateE(ptr noundef %160, i64 noundef %162, ptr noundef %163)
  %164 = load ptr, ptr %17, align 8, !tbaa !5
  %165 = load i64, ptr %14, align 8, !tbaa !11
  %166 = add nsw i64 %165, 1
  %167 = load ptr, ptr %18, align 8, !tbaa !5
  call void @_ZN11alglib_impl20ae_vector_set_lengthEPNS_9ae_vectorElPNS_8ae_stateE(ptr noundef %164, i64 noundef %166, ptr noundef %167)
  store i64 1, ptr %22, align 8, !tbaa !11
  br label %168

168:                                              ; preds = %204, %159
  %169 = load i64, ptr %22, align 8, !tbaa !11
  %170 = load i64, ptr %14, align 8, !tbaa !11
  %171 = add nsw i64 %170, 1
  %172 = icmp sle i64 %169, %171
  br i1 %172, label %173, label %207

173:                                              ; preds = %168
  %174 = getelementptr inbounds %"struct.alglib_impl::ae_vector", ptr %23, i32 0, i32 4
  %175 = load ptr, ptr %174, align 8, !tbaa !13
  %176 = load i64, ptr %22, align 8, !tbaa !11
  %177 = sub nsw i64 %176, 1
  %178 = getelementptr inbounds double, ptr %175, i64 %177
  %179 = load double, ptr %178, align 8, !tbaa !9
  %180 = load ptr, ptr %16, align 8, !tbaa !5
  %181 = getelementptr inbounds %"struct.alglib_impl::ae_vector", ptr %180, i32 0, i32 4
  %182 = load ptr, ptr %181, align 8, !tbaa !13
  %183 = load i64, ptr %22, align 8, !tbaa !11
  %184 = sub nsw i64 %183, 1
  %185 = getelementptr inbounds double, ptr %182, i64 %184
  store double %179, ptr %185, align 8, !tbaa !9
  %186 = load double, ptr %12, align 8, !tbaa !9
  %187 = getelementptr inbounds %"struct.alglib_impl::ae_matrix", ptr %25, i32 0, i32 6
  %188 = load ptr, ptr %187, align 8, !tbaa !13
  %189 = getelementptr inbounds ptr, ptr %188, i64 0
  %190 = load ptr, ptr %189, align 8, !tbaa !5
  %191 = load i64, ptr %22, align 8, !tbaa !11
  %192 = sub nsw i64 %191, 1
  %193 = getelementptr inbounds double, ptr %190, i64 %192
  %194 = load double, ptr %193, align 8, !tbaa !9
  %195 = load ptr, ptr %18, align 8, !tbaa !5
  %196 = call noundef double @_ZN11alglib_impl6ae_sqrEdPNS_8ae_stateE(double noundef %194, ptr noundef %195)
  %197 = fmul double %186, %196
  %198 = load ptr, ptr %17, align 8, !tbaa !5
  %199 = getelementptr inbounds %"struct.alglib_impl::ae_vector", ptr %198, i32 0, i32 4
  %200 = load ptr, ptr %199, align 8, !tbaa !13
  %201 = load i64, ptr %22, align 8, !tbaa !11
  %202 = sub nsw i64 %201, 1
  %203 = getelementptr inbounds double, ptr %200, i64 %202
  store double %197, ptr %203, align 8, !tbaa !9
  br label %204

204:                                              ; preds = %173
  %205 = load i64, ptr %22, align 8, !tbaa !11
  %206 = add nsw i64 %205, 1
  store i64 %206, ptr %22, align 8, !tbaa !11
  br label %168, !llvm.loop !17

207:                                              ; preds = %168
  %208 = load ptr, ptr %18, align 8, !tbaa !5
  call void @_ZN11alglib_impl14ae_frame_leaveEPNS_8ae_stateE(ptr noundef %208)
  store i32 0, ptr %29, align 4
  br label %209

209:                                              ; preds = %207, %156, %79, %43
  call void @llvm.lifetime.end.p0(i64 8, ptr %28) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %27) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %26) #5
  call void @llvm.lifetime.end.p0(i64 80, ptr %25) #5
  call void @llvm.lifetime.end.p0(i64 64, ptr %24) #5
  call void @llvm.lifetime.end.p0(i64 64, ptr %23) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #5
  call void @llvm.lifetime.end.p0(i64 64, ptr %21) #5
  call void @llvm.lifetime.end.p0(i64 64, ptr %20) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr %19) #5
  %210 = load i32, ptr %29, align 4
  switch i32 %210, label %212 [
    i32 0, label %211
    i32 1, label %211
  ]

211:                                              ; preds = %209, %209
  ret void

212:                                              ; preds = %209
  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_matrix_initEPNS_9ae_matrixElllPNS_8ae_stateEb(ptr noundef, i64 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_impl7ae_sqrtEdPNS_8ae_stateE(double noundef, ptr noundef) #3

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

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

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

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

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 = !{!"any pointer", !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 = !{!"long", !7, i64 0}
!13 = !{!7, !7, i64 0}
!14 = distinct !{!14, !15}
!15 = !{!"llvm.loop.mustprogress"}
!16 = distinct !{!16, !15}
!17 = distinct !{!17, !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 }
%"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 }

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

17:                                               ; preds = %9
  store i64 1, ptr %5, align 8, !tbaa !5
  %18 = add nsw i64 %4, -1
  call void @_ZN11alglib_impl20ae_vector_set_lengthEPNS_9ae_vectorElPNS_8ae_stateE(ptr noundef nonnull %13, i64 noundef %4, ptr noundef %8)
  call void @_ZN11alglib_impl20ae_vector_set_lengthEPNS_9ae_vectorElPNS_8ae_stateE(ptr noundef nonnull %14, i64 noundef %18, ptr noundef %8)
  %19 = getelementptr inbounds i8, ptr %11, i64 56
  %20 = getelementptr inbounds i8, ptr %13, i64 56
  %21 = getelementptr inbounds i8, ptr %12, i64 56
  %22 = getelementptr inbounds i8, ptr %14, i64 56
  br label %23

23:                                               ; preds = %17, %34
  %.07579 = phi i64 [ 1, %17 ], [ %41, %34 ]
  %24 = load ptr, ptr %19, align 8, !tbaa !9
  %25 = add nsw i64 %.07579, -1
  %26 = getelementptr inbounds double, ptr %24, i64 %25
  %27 = load double, ptr %26, align 8, !tbaa !10
  %28 = load ptr, ptr %20, align 8, !tbaa !9
  %29 = getelementptr inbounds double, ptr %28, i64 %25
  store double %27, ptr %29, align 8, !tbaa !10
  %30 = load ptr, ptr %21, align 8, !tbaa !9
  %31 = getelementptr inbounds double, ptr %30, i64 %.07579
  %32 = load double, ptr %31, align 8, !tbaa !10
  %33 = call noundef zeroext i1 @_ZN11alglib_impl13ae_fp_less_eqEdd(double noundef %32, double noundef 0.000000e+00)
  br i1 %33, label %._crit_edge89.sink.split, label %34

34:                                               ; preds = %23
  %35 = load ptr, ptr %21, align 8, !tbaa !9
  %36 = getelementptr inbounds double, ptr %35, i64 %.07579
  %37 = load double, ptr %36, align 8, !tbaa !10
  %38 = call noundef double @_ZN11alglib_impl7ae_sqrtEdPNS_8ae_stateE(double noundef %37, ptr noundef %8)
  %39 = load ptr, ptr %22, align 8, !tbaa !9
  %40 = getelementptr inbounds double, ptr %39, i64 %25
  store double %38, ptr %40, align 8, !tbaa !10
  %41 = add nuw nsw i64 %.07579, 1
  %exitcond.not = icmp eq i64 %41, %4
  br i1 %exitcond.not, label %.lr.ph, label %23, !llvm.loop !12

.lr.ph:                                           ; preds = %34
  %42 = load ptr, ptr %21, align 8, !tbaa !9
  store double 0.000000e+00, ptr %42, align 8, !tbaa !10
  %43 = load ptr, ptr %19, align 8, !tbaa !9
  %44 = load ptr, ptr %21, align 8, !tbaa !9
  %45 = add nsw i64 %4, -1
  %xtraiter = and i64 %45, 1
  %46 = icmp eq i64 %4, 2
  br i1 %46, label %._crit_edge.unr-lcssa, label %.lr.ph.new

.lr.ph.new:                                       ; preds = %.lr.ph
  %unroll_iter = and i64 %45, -2
  br label %47

47:                                               ; preds = %47, %.lr.ph.new
  %.083 = phi double [ 1.000000e+00, %.lr.ph.new ], [ %64, %47 ]
  %.07482 = phi double [ 0.000000e+00, %.lr.ph.new ], [ %56, %47 ]
  %.181 = phi i64 [ 1, %.lr.ph.new ], [ %65, %47 ]
  %niter = phi i64 [ 0, %.lr.ph.new ], [ %niter.next.1, %47 ]
  %48 = add nsw i64 %.181, -1
  %49 = getelementptr inbounds double, ptr %43, i64 %48
  %50 = load double, ptr %49, align 8, !tbaa !10
  %51 = fsub double %3, %50
  %52 = getelementptr inbounds double, ptr %44, i64 %48
  %53 = load double, ptr %52, align 8, !tbaa !10
  %54 = fneg double %53
  %55 = fmul double %.07482, %54
  %56 = call double @llvm.fmuladd.f64(double %51, double %.083, double %55)
  %57 = getelementptr inbounds double, ptr %43, i64 %.181
  %58 = load double, ptr %57, align 8, !tbaa !10
  %59 = fsub double %3, %58
  %60 = getelementptr inbounds double, ptr %44, i64 %.181
  %61 = load double, ptr %60, align 8, !tbaa !10
  %62 = fneg double %61
  %63 = fmul double %.083, %62
  %64 = call double @llvm.fmuladd.f64(double %59, double %56, double %63)
  %65 = add nuw nsw i64 %.181, 2
  %niter.next.1 = add nuw i64 %niter, 2
  %niter.ncmp.1 = icmp eq i64 %niter.next.1, %unroll_iter
  br i1 %niter.ncmp.1, label %._crit_edge.unr-lcssa.loopexit, label %47, !llvm.loop !14

._crit_edge.unr-lcssa.loopexit:                   ; preds = %47
  %66 = add nuw nsw i64 %.181, 1
  br label %._crit_edge.unr-lcssa

._crit_edge.unr-lcssa:                            ; preds = %._crit_edge.unr-lcssa.loopexit, %.lr.ph
  %.083.lcssa.ph = phi double [ poison, %.lr.ph ], [ %56, %._crit_edge.unr-lcssa.loopexit ]
  %.lcssa.ph = phi double [ poison, %.lr.ph ], [ %64, %._crit_edge.unr-lcssa.loopexit ]
  %.083.unr = phi double [ 1.000000e+00, %.lr.ph ], [ %64, %._crit_edge.unr-lcssa.loopexit ]
  %.07482.unr = phi double [ 0.000000e+00, %.lr.ph ], [ %56, %._crit_edge.unr-lcssa.loopexit ]
  %.181.unr = phi i64 [ 0, %.lr.ph ], [ %66, %._crit_edge.unr-lcssa.loopexit ]
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br i1 %lcmp.mod.not, label %._crit_edge, label %._crit_edge.epilog-lcssa

._crit_edge.epilog-lcssa:                         ; preds = %._crit_edge.unr-lcssa
  %67 = getelementptr inbounds double, ptr %43, i64 %.181.unr
  %68 = load double, ptr %67, align 8, !tbaa !10
  %69 = fsub double %3, %68
  %70 = getelementptr inbounds double, ptr %44, i64 %.181.unr
  %71 = load double, ptr %70, align 8, !tbaa !10
  %72 = fneg double %71
  %73 = fmul double %.07482.unr, %72
  %74 = call double @llvm.fmuladd.f64(double %69, double %.083.unr, double %73)
  br label %._crit_edge

._crit_edge:                                      ; preds = %._crit_edge.unr-lcssa, %._crit_edge.epilog-lcssa
  %.083.lcssa = phi double [ %.083.lcssa.ph, %._crit_edge.unr-lcssa ], [ %.083.unr, %._crit_edge.epilog-lcssa ]
  %.lcssa = phi double [ %.lcssa.ph, %._crit_edge.unr-lcssa ], [ %74, %._crit_edge.epilog-lcssa ]
  %.phi.trans.insert = getelementptr inbounds double, ptr %44, i64 %18
  %.pre93 = load double, ptr %.phi.trans.insert, align 8, !tbaa !10
  %75 = fmul double %.083.lcssa, %.pre93
  %76 = fdiv double %75, %.lcssa
  %77 = fsub double %3, %76
  %78 = load ptr, ptr %20, align 8, !tbaa !9
  %79 = getelementptr inbounds double, ptr %78, i64 %18
  store double %77, ptr %79, align 8, !tbaa !10
  %80 = call noundef zeroext i1 @_ZN11alglib_impl12smatrixtdevdEPNS_9ae_vectorES1_llPNS_9ae_matrixEPNS_8ae_stateE(ptr noundef nonnull %13, ptr noundef nonnull %14, i64 noundef %4, i64 noundef 3, ptr noundef nonnull %15, ptr noundef %8)
  br i1 %80, label %.lr.ph88, label %._crit_edge89.sink.split

.lr.ph88:                                         ; preds = %._crit_edge
  call void @_ZN11alglib_impl20ae_vector_set_lengthEPNS_9ae_vectorElPNS_8ae_stateE(ptr noundef %6, i64 noundef %4, ptr noundef %8)
  call void @_ZN11alglib_impl20ae_vector_set_lengthEPNS_9ae_vectorElPNS_8ae_stateE(ptr noundef %7, i64 noundef %4, ptr noundef %8)
  %81 = getelementptr inbounds i8, ptr %6, i64 56
  %82 = getelementptr inbounds i8, ptr %15, i64 72
  %83 = getelementptr inbounds i8, ptr %7, i64 56
  %smax = call i64 @llvm.smax.i64(i64 %4, i64 1)
  br label %84

84:                                               ; preds = %.lr.ph88, %84
  %.286 = phi i64 [ 1, %.lr.ph88 ], [ %99, %84 ]
  %85 = load ptr, ptr %20, align 8, !tbaa !9
  %86 = add nsw i64 %.286, -1
  %87 = getelementptr inbounds double, ptr %85, i64 %86
  %88 = load double, ptr %87, align 8, !tbaa !10
  %89 = load ptr, ptr %81, align 8, !tbaa !9
  %90 = getelementptr inbounds double, ptr %89, i64 %86
  store double %88, ptr %90, align 8, !tbaa !10
  %91 = load ptr, ptr %82, align 8, !tbaa !9
  %92 = load ptr, ptr %91, align 8, !tbaa !15
  %93 = getelementptr inbounds double, ptr %92, i64 %86
  %94 = load double, ptr %93, align 8, !tbaa !10
  %95 = call noundef double @_ZN11alglib_impl6ae_sqrEdPNS_8ae_stateE(double noundef %94, ptr noundef %8)
  %96 = fmul double %95, %2
  %97 = load ptr, ptr %83, align 8, !tbaa !9
  %98 = getelementptr inbounds double, ptr %97, i64 %86
  store double %96, ptr %98, align 8, !tbaa !10
  %99 = add nuw i64 %.286, 1
  %exitcond92.not = icmp eq i64 %.286, %smax
  br i1 %exitcond92.not, label %._crit_edge89, label %84, !llvm.loop !17

._crit_edge89.sink.split:                         ; preds = %23, %._crit_edge, %9
  %.sink = phi i64 [ -1, %9 ], [ -3, %._crit_edge ], [ -2, %23 ]
  store i64 %.sink, ptr %5, align 8, !tbaa !5
  br label %._crit_edge89

._crit_edge89:                                    ; preds = %84, %._crit_edge89.sink.split
  call void @_ZN11alglib_impl14ae_frame_leaveEPNS_8ae_stateE(ptr noundef %8)
  call void @llvm.lifetime.end.p0(i64 80, ptr nonnull %15) #6
  call void @llvm.lifetime.end.p0(i64 64, ptr nonnull %14) #6
  call void @llvm.lifetime.end.p0(i64 64, ptr nonnull %13) #6
  call void @llvm.lifetime.end.p0(i64 64, ptr nonnull %12) #6
  call void @llvm.lifetime.end.p0(i64 64, ptr nonnull %11) #6
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %10) #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_matrix_initEPNS_9ae_matrixElllPNS_8ae_stateEb(ptr noundef, i64 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_impl7ae_sqrtEdPNS_8ae_stateE(double noundef, ptr noundef) local_unnamed_addr #3

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

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

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

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

; 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}
!15 = !{!16, !16, i64 0}
!16 = !{!"any pointer", !7, i64 0}
!17 = distinct !{!17, !13}


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