; LLVM IR from venumb/ZSPACE :: cpp/depends/alglib/cpp/tests/test_c.ll (Z17hqrnddiscretetestbPN11alglib_impl8ae_stateE)

; 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 }
%union.anon = type { ptr }
%"struct.alglib_impl::hqrndstate" = type { i64, i64, i64 }

@.str.22 = external hidden unnamed_addr constant [34 x i8], align 1
@.str.23 = external hidden unnamed_addr constant [54 x i8], align 1
@.str.24 = external hidden unnamed_addr constant [36 x i8], align 1
@.str.25 = external hidden unnamed_addr constant [32 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

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

; 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_impl14ae_vector_initEPNS_9ae_vectorEllPNS_8ae_stateEb(ptr noundef, i64 noundef, i64 noundef, ptr noundef, i1 noundef zeroext) #1

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

declare noundef i64 @_ZN11alglib_impl16ae_randomintegerElPNS_8ae_stateE(i64 noundef, ptr noundef) #1

declare i32 @printf(ptr noundef, ...) #1

declare void @_ZN11alglib_impl14ae_frame_leaveEPNS_8ae_stateE(ptr noundef) #1

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

declare noundef double @_ZN11alglib_impl13ae_randomrealEPNS_8ae_stateE(ptr noundef) #1

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

declare void @_ZN11alglib_impl16_hqrndstate_initEPvPNS_8ae_stateEb(ptr noundef, ptr noundef, i1 noundef zeroext) #1

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

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

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

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

; Function Attrs: mustprogress uwtable
define dso_local noundef zeroext i1 @_Z17hqrnddiscretetestbPN11alglib_impl8ae_stateE(i1 noundef zeroext %0, ptr noundef %1) #4 {
  %3 = alloca i1, align 1
  %4 = alloca i8, align 1
  %5 = alloca ptr, align 8
  %6 = alloca %"struct.alglib_impl::ae_frame", align 8
  %7 = alloca %"struct.alglib_impl::ae_vector", align 8
  %8 = alloca double, align 8
  %9 = alloca double, align 8
  %10 = alloca double, align 8
  %11 = alloca double, align 8
  %12 = alloca double, align 8
  %13 = alloca i64, align 8
  %14 = alloca i64, align 8
  %15 = alloca i64, align 8
  %16 = alloca i64, align 8
  %17 = alloca i64, align 8
  %18 = alloca i64, align 8
  %19 = alloca %"struct.alglib_impl::ae_vector", align 8
  %20 = alloca %"struct.alglib_impl::hqrndstate", align 8
  %21 = alloca i8, align 1
  %22 = alloca i32, align 4
  %23 = zext i1 %0 to i8
  store i8 %23, ptr %4, align 1, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 32, ptr %6) #5
  call void @llvm.lifetime.start.p0(i64 64, ptr %7) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #5
  call void @llvm.lifetime.start.p0(i64 64, ptr %19) #5
  call void @llvm.lifetime.start.p0(i64 24, ptr %20) #5
  call void @llvm.lifetime.start.p0(i64 1, ptr %21) #5
  %24 = load ptr, ptr %5, align 8, !tbaa !9
  call void @_ZN11alglib_impl13ae_frame_makeEPNS_8ae_stateEPNS_8ae_frameE(ptr noundef %24, ptr noundef %6)
  call void @llvm.memset.p0.i64(ptr align 8 %7, i8 0, i64 64, i1 false)
  call void @llvm.memset.p0.i64(ptr align 8 %19, i8 0, i64 64, i1 false)
  call void @llvm.memset.p0.i64(ptr align 8 %20, i8 0, i64 24, i1 false)
  %25 = load ptr, ptr %5, align 8, !tbaa !9
  call void @_ZN11alglib_impl14ae_vector_initEPNS_9ae_vectorEllPNS_8ae_stateEb(ptr noundef %7, i64 noundef 0, i64 noundef 3, ptr noundef %25, i1 noundef zeroext true)
  %26 = load ptr, ptr %5, align 8, !tbaa !9
  call void @_ZN11alglib_impl14ae_vector_initEPNS_9ae_vectorEllPNS_8ae_stateEb(ptr noundef %19, i64 noundef 0, i64 noundef 2, ptr noundef %26, i1 noundef zeroext true)
  %27 = load ptr, ptr %5, align 8, !tbaa !9
  call void @_ZN11alglib_impl16_hqrndstate_initEPvPNS_8ae_stateEb(ptr noundef %20, ptr noundef %27, i1 noundef zeroext true)
  store double 1.000000e+02, ptr %11, align 8, !tbaa !11
  store double -1.000000e+02, ptr %12, align 8, !tbaa !11
  store i64 100000, ptr %18, align 8, !tbaa !13
  store double 1.000000e+01, ptr %9, align 8, !tbaa !11
  store i64 1, ptr %17, align 8, !tbaa !13
  br label %28

28:                                               ; preds = %224, %2
  %29 = load i64, ptr %17, align 8, !tbaa !13
  %30 = icmp sle i64 %29, 5
  br i1 %30, label %31, label %227

31:                                               ; preds = %28
  %32 = load i64, ptr %18, align 8, !tbaa !13
  %33 = sitofp i64 %32 to double
  %34 = load i64, ptr %17, align 8, !tbaa !13
  %35 = sitofp i64 %34 to double
  %36 = fdiv double 1.000000e+00, %35
  %37 = fmul double %33, %36
  %38 = load i64, ptr %17, align 8, !tbaa !13
  %39 = sitofp i64 %38 to double
  %40 = fdiv double 1.000000e+00, %39
  %41 = fsub double 1.000000e+00, %40
  %42 = fmul double %37, %41
  %43 = load ptr, ptr %5, align 8, !tbaa !9
  %44 = call noundef double @_ZN11alglib_impl7ae_sqrtEdPNS_8ae_stateE(double noundef %42, ptr noundef %43)
  store double %44, ptr %8, align 8, !tbaa !11
  %45 = load i64, ptr %17, align 8, !tbaa !13
  %46 = load ptr, ptr %5, align 8, !tbaa !9
  call void @_ZN11alglib_impl20ae_vector_set_lengthEPNS_9ae_vectorElPNS_8ae_stateE(ptr noundef %19, i64 noundef %45, ptr noundef %46)
  store i64 0, ptr %13, align 8, !tbaa !13
  br label %47

47:                                               ; preds = %57, %31
  %48 = load i64, ptr %13, align 8, !tbaa !13
  %49 = load i64, ptr %17, align 8, !tbaa !13
  %50 = sub nsw i64 %49, 1
  %51 = icmp sle i64 %48, %50
  br i1 %51, label %52, label %60

52:                                               ; preds = %47
  %53 = getelementptr inbounds %"struct.alglib_impl::ae_vector", ptr %19, i32 0, i32 4
  %54 = load ptr, ptr %53, align 8, !tbaa !15
  %55 = load i64, ptr %13, align 8, !tbaa !13
  %56 = getelementptr inbounds i64, ptr %54, i64 %55
  store i64 0, ptr %56, align 8, !tbaa !13
  br label %57

57:                                               ; preds = %52
  %58 = load i64, ptr %13, align 8, !tbaa !13
  %59 = add nsw i64 %58, 1
  store i64 %59, ptr %13, align 8, !tbaa !13
  br label %47, !llvm.loop !16

60:                                               ; preds = %47
  %61 = load i64, ptr %17, align 8, !tbaa !13
  %62 = load ptr, ptr %5, align 8, !tbaa !9
  call void @_ZN11alglib_impl20ae_vector_set_lengthEPNS_9ae_vectorElPNS_8ae_stateE(ptr noundef %7, i64 noundef %61, ptr noundef %62)
  %63 = load double, ptr %11, align 8, !tbaa !11
  %64 = load double, ptr %12, align 8, !tbaa !11
  %65 = fsub double %63, %64
  %66 = load ptr, ptr %5, align 8, !tbaa !9
  %67 = call noundef double @_ZN11alglib_impl13ae_randomrealEPNS_8ae_stateE(ptr noundef %66)
  %68 = load double, ptr %12, align 8, !tbaa !11
  %69 = call double @llvm.fmuladd.f64(double %65, double %67, double %68)
  %70 = getelementptr inbounds %"struct.alglib_impl::ae_vector", ptr %7, i32 0, i32 4
  %71 = load ptr, ptr %70, align 8, !tbaa !15
  %72 = getelementptr inbounds double, ptr %71, i64 0
  store double %69, ptr %72, align 8, !tbaa !11
  store i64 1, ptr %13, align 8, !tbaa !13
  br label %73

73:                                               ; preds = %94, %60
  %74 = load i64, ptr %13, align 8, !tbaa !13
  %75 = load i64, ptr %17, align 8, !tbaa !13
  %76 = sub nsw i64 %75, 1
  %77 = icmp sle i64 %74, %76
  br i1 %77, label %78, label %97

78:                                               ; preds = %73
  %79 = getelementptr inbounds %"struct.alglib_impl::ae_vector", ptr %7, i32 0, i32 4
  %80 = load ptr, ptr %79, align 8, !tbaa !15
  %81 = load i64, ptr %13, align 8, !tbaa !13
  %82 = sub nsw i64 %81, 1
  %83 = getelementptr inbounds double, ptr %80, i64 %82
  %84 = load double, ptr %83, align 8, !tbaa !11
  %85 = load double, ptr %11, align 8, !tbaa !11
  %86 = load ptr, ptr %5, align 8, !tbaa !9
  %87 = call noundef double @_ZN11alglib_impl13ae_randomrealEPNS_8ae_stateE(ptr noundef %86)
  %88 = call double @llvm.fmuladd.f64(double %85, double %87, double %84)
  %89 = fadd double %88, 1.000000e-03
  %90 = getelementptr inbounds %"struct.alglib_impl::ae_vector", ptr %7, i32 0, i32 4
  %91 = load ptr, ptr %90, align 8, !tbaa !15
  %92 = load i64, ptr %13, align 8, !tbaa !13
  %93 = getelementptr inbounds double, ptr %91, i64 %92
  store double %89, ptr %93, align 8, !tbaa !11
  br label %94

94:                                               ; preds = %78
  %95 = load i64, ptr %13, align 8, !tbaa !13
  %96 = add nsw i64 %95, 1
  store i64 %96, ptr %13, align 8, !tbaa !13
  br label %73, !llvm.loop !18

97:                                               ; preds = %73
  %98 = load ptr, ptr %5, align 8, !tbaa !9
  %99 = call noundef i64 @_ZN11alglib_impl16ae_randomintegerElPNS_8ae_stateE(i64 noundef 32000, ptr noundef %98)
  %100 = add nsw i64 1, %99
  store i64 %100, ptr %15, align 8, !tbaa !13
  %101 = load ptr, ptr %5, align 8, !tbaa !9
  %102 = call noundef i64 @_ZN11alglib_impl16ae_randomintegerElPNS_8ae_stateE(i64 noundef 32000, ptr noundef %101)
  %103 = add nsw i64 1, %102
  store i64 %103, ptr %16, align 8, !tbaa !13
  %104 = load i64, ptr %15, align 8, !tbaa !13
  %105 = load i64, ptr %16, align 8, !tbaa !13
  %106 = load ptr, ptr %5, align 8, !tbaa !9
  call void @_ZN11alglib_impl9hqrndseedEllPNS_10hqrndstateEPNS_8ae_stateE(i64 noundef %104, i64 noundef %105, ptr noundef %20, ptr noundef %106)
  store i64 0, ptr %13, align 8, !tbaa !13
  br label %107

107:                                              ; preds = %145, %97
  %108 = load i64, ptr %13, align 8, !tbaa !13
  %109 = load i64, ptr %18, align 8, !tbaa !13
  %110 = sub nsw i64 %109, 1
  %111 = icmp sle i64 %108, %110
  br i1 %111, label %112, label %148

112:                                              ; preds = %107
  %113 = load i64, ptr %17, align 8, !tbaa !13
  %114 = load ptr, ptr %5, align 8, !tbaa !9
  %115 = call noundef double @_ZN11alglib_impl13hqrnddiscreteEPNS_10hqrndstateEPNS_9ae_vectorElPNS_8ae_stateE(ptr noundef %20, ptr noundef %7, i64 noundef %113, ptr noundef %114)
  store double %115, ptr %10, align 8, !tbaa !11
  store i64 0, ptr %14, align 8, !tbaa !13
  br label %116

116:                                              ; preds = %141, %112
  %117 = load i64, ptr %14, align 8, !tbaa !13
  %118 = load i64, ptr %17, align 8, !tbaa !13
  %119 = sub nsw i64 %118, 1
  %120 = icmp sle i64 %117, %119
  br i1 %120, label %121, label %144

121:                                              ; preds = %116
  %122 = load double, ptr %10, align 8, !tbaa !11
  %123 = getelementptr inbounds %"struct.alglib_impl::ae_vector", ptr %7, i32 0, i32 4
  %124 = load ptr, ptr %123, align 8, !tbaa !15
  %125 = load i64, ptr %14, align 8, !tbaa !13
  %126 = getelementptr inbounds double, ptr %124, i64 %125
  %127 = load double, ptr %126, align 8, !tbaa !11
  %128 = call noundef zeroext i1 @_ZN11alglib_impl8ae_fp_eqEdd(double noundef %122, double noundef %127)
  br i1 %128, label %129, label %140

129:                                              ; preds = %121
  %130 = getelementptr inbounds %"struct.alglib_impl::ae_vector", ptr %19, i32 0, i32 4
  %131 = load ptr, ptr %130, align 8, !tbaa !15
  %132 = load i64, ptr %14, align 8, !tbaa !13
  %133 = getelementptr inbounds i64, ptr %131, i64 %132
  %134 = load i64, ptr %133, align 8, !tbaa !13
  %135 = add nsw i64 %134, 1
  %136 = getelementptr inbounds %"struct.alglib_impl::ae_vector", ptr %19, i32 0, i32 4
  %137 = load ptr, ptr %136, align 8, !tbaa !15
  %138 = load i64, ptr %14, align 8, !tbaa !13
  %139 = getelementptr inbounds i64, ptr %137, i64 %138
  store i64 %135, ptr %139, align 8, !tbaa !13
  br label %144

140:                                              ; preds = %121
  br label %141

141:                                              ; preds = %140
  %142 = load i64, ptr %14, align 8, !tbaa !13
  %143 = add nsw i64 %142, 1
  store i64 %143, ptr %14, align 8, !tbaa !13
  br label %116, !llvm.loop !19

144:                                              ; preds = %129, %116
  br label %145

145:                                              ; preds = %144
  %146 = load i64, ptr %13, align 8, !tbaa !13
  %147 = add nsw i64 %146, 1
  store i64 %147, ptr %13, align 8, !tbaa !13
  br label %107, !llvm.loop !20

148:                                              ; preds = %107
  store i64 0, ptr %13, align 8, !tbaa !13
  br label %149

149:                                              ; preds = %215, %148
  %150 = load i64, ptr %13, align 8, !tbaa !13
  %151 = load i64, ptr %17, align 8, !tbaa !13
  %152 = sub nsw i64 %151, 1
  %153 = icmp sle i64 %150, %152
  br i1 %153, label %154, label %218

154:                                              ; preds = %149
  %155 = getelementptr inbounds %"struct.alglib_impl::ae_vector", ptr %19, i32 0, i32 4
  %156 = load ptr, ptr %155, align 8, !tbaa !15
  %157 = load i64, ptr %13, align 8, !tbaa !13
  %158 = getelementptr inbounds i64, ptr %156, i64 %157
  %159 = load i64, ptr %158, align 8, !tbaa !13
  %160 = sitofp i64 %159 to double
  %161 = load i64, ptr %18, align 8, !tbaa !13
  %162 = sitofp i64 %161 to double
  %163 = load i64, ptr %17, align 8, !tbaa !13
  %164 = sitofp i64 %163 to double
  %165 = fdiv double %162, %164
  %166 = load double, ptr %9, align 8, !tbaa !11
  %167 = load double, ptr %8, align 8, !tbaa !11
  %168 = fneg double %166
  %169 = call double @llvm.fmuladd.f64(double %168, double %167, double %165)
  %170 = call noundef zeroext i1 @_ZN11alglib_impl10ae_fp_lessEdd(double noundef %160, double noundef %169)
  br i1 %170, label %187, label %171

171:                                              ; preds = %154
  %172 = getelementptr inbounds %"struct.alglib_impl::ae_vector", ptr %19, i32 0, i32 4
  %173 = load ptr, ptr %172, align 8, !tbaa !15
  %174 = load i64, ptr %13, align 8, !tbaa !13
  %175 = getelementptr inbounds i64, ptr %173, i64 %174
  %176 = load i64, ptr %175, align 8, !tbaa !13
  %177 = sitofp i64 %176 to double
  %178 = load i64, ptr %18, align 8, !tbaa !13
  %179 = sitofp i64 %178 to double
  %180 = load i64, ptr %17, align 8, !tbaa !13
  %181 = sitofp i64 %180 to double
  %182 = fdiv double %179, %181
  %183 = load double, ptr %9, align 8, !tbaa !11
  %184 = load double, ptr %8, align 8, !tbaa !11
  %185 = call double @llvm.fmuladd.f64(double %183, double %184, double %182)
  %186 = call noundef zeroext i1 @_ZN11alglib_impl13ae_fp_greaterEdd(double noundef %177, double noundef %185)
  br i1 %186, label %187, label %214

187:                                              ; preds = %171, %154
  %188 = load i8, ptr %4, align 1, !tbaa !5, !range !21, !noundef !22
  %189 = trunc i8 %188 to i1
  br i1 %189, label %210, label %190

190:                                              ; preds = %187
  %191 = call i32 (ptr, ...) @printf(ptr noundef @.str.22)
  %192 = load i64, ptr %13, align 8, !tbaa !13
  %193 = trunc i64 %192 to i32
  %194 = getelementptr inbounds %"struct.alglib_impl::ae_vector", ptr %19, i32 0, i32 4
  %195 = load ptr, ptr %194, align 8, !tbaa !15
  %196 = load i64, ptr %13, align 8, !tbaa !13
  %197 = getelementptr inbounds i64, ptr %195, i64 %196
  %198 = load i64, ptr %197, align 8, !tbaa !13
  %199 = trunc i64 %198 to i32
  %200 = load i64, ptr %18, align 8, !tbaa !13
  %201 = sitofp i64 %200 to double
  %202 = load i64, ptr %17, align 8, !tbaa !13
  %203 = sitofp i64 %202 to double
  %204 = fdiv double %201, %203
  %205 = load double, ptr %9, align 8, !tbaa !11
  %206 = load double, ptr %8, align 8, !tbaa !11
  %207 = fmul double %205, %206
  %208 = call i32 (ptr, ...) @printf(ptr noundef @.str.23, i32 noundef %193, i32 noundef %199, double noundef %204, double noundef %207)
  %209 = call i32 (ptr, ...) @printf(ptr noundef @.str.24)
  br label %210

210:                                              ; preds = %190, %187
  store i8 1, ptr %21, align 1, !tbaa !5
  %211 = load ptr, ptr %5, align 8, !tbaa !9
  call void @_ZN11alglib_impl14ae_frame_leaveEPNS_8ae_stateE(ptr noundef %211)
  %212 = load i8, ptr %21, align 1, !tbaa !5, !range !21, !noundef !22
  %213 = trunc i8 %212 to i1
  store i1 %213, ptr %3, align 1
  store i32 1, ptr %22, align 4
  br label %231

214:                                              ; preds = %171
  br label %215

215:                                              ; preds = %214
  %216 = load i64, ptr %13, align 8, !tbaa !13
  %217 = add nsw i64 %216, 1
  store i64 %217, ptr %13, align 8, !tbaa !13
  br label %149, !llvm.loop !23

218:                                              ; preds = %149
  %219 = load i8, ptr %4, align 1, !tbaa !5, !range !21, !noundef !22
  %220 = trunc i8 %219 to i1
  br i1 %220, label %223, label %221

221:                                              ; preds = %218
  %222 = call i32 (ptr, ...) @printf(ptr noundef @.str.25)
  br label %223

223:                                              ; preds = %221, %218
  br label %224

224:                                              ; preds = %223
  %225 = load i64, ptr %17, align 8, !tbaa !13
  %226 = add nsw i64 %225, 1
  store i64 %226, ptr %17, align 8, !tbaa !13
  br label %28, !llvm.loop !24

227:                                              ; preds = %28
  store i8 0, ptr %21, align 1, !tbaa !5
  %228 = load ptr, ptr %5, align 8, !tbaa !9
  call void @_ZN11alglib_impl14ae_frame_leaveEPNS_8ae_stateE(ptr noundef %228)
  %229 = load i8, ptr %21, align 1, !tbaa !5, !range !21, !noundef !22
  %230 = trunc i8 %229 to i1
  store i1 %230, ptr %3, align 1
  store i32 1, ptr %22, align 4
  br label %231

231:                                              ; preds = %227, %210
  call void @llvm.lifetime.end.p0(i64 1, ptr %21) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr %20) #5
  call void @llvm.lifetime.end.p0(i64 64, ptr %19) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #5
  call void @llvm.lifetime.end.p0(i64 64, ptr %7) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr %6) #5
  %232 = load i1, ptr %3, align 1
  ret i1 %232
}

declare noundef double @_ZN11alglib_impl13hqrnddiscreteEPNS_10hqrndstateEPNS_9ae_vectorElPNS_8ae_stateE(ptr noundef, ptr noundef, i64 noundef, ptr noundef) #1

declare noundef zeroext i1 @_ZN11alglib_impl8ae_fp_eqEdd(double noundef, double noundef) #1

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #3 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #4 = { 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 #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 = !{!"bool", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"any pointer", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"double", !7, i64 0}
!13 = !{!14, !14, i64 0}
!14 = !{!"long", !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 = !{i8 0, i8 2}
!22 = !{}
!23 = distinct !{!23, !17}
!24 = distinct !{!24, !17}


; 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 }
%union.anon = type { ptr }
%"struct.alglib_impl::hqrndstate" = type { i64, i64, i64 }

@.str.22 = external hidden unnamed_addr constant [34 x i8], align 1
@.str.23 = external hidden unnamed_addr constant [54 x i8], align 1
@.str.24 = external hidden unnamed_addr constant [36 x i8], align 1
@.str.25 = external hidden unnamed_addr constant [32 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

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

; 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_impl14ae_vector_initEPNS_9ae_vectorEllPNS_8ae_stateEb(ptr noundef, i64 noundef, i64 noundef, ptr noundef, i1 noundef zeroext) local_unnamed_addr #1

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

declare noundef i64 @_ZN11alglib_impl16ae_randomintegerElPNS_8ae_stateE(i64 noundef, ptr noundef) local_unnamed_addr #1

; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3

declare void @_ZN11alglib_impl14ae_frame_leaveEPNS_8ae_stateE(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

declare noundef double @_ZN11alglib_impl13ae_randomrealEPNS_8ae_stateE(ptr noundef) local_unnamed_addr #1

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

declare void @_ZN11alglib_impl16_hqrndstate_initEPvPNS_8ae_stateEb(ptr noundef, ptr noundef, i1 noundef zeroext) local_unnamed_addr #1

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

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

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

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

; Function Attrs: mustprogress uwtable
define dso_local noundef zeroext i1 @_Z17hqrnddiscretetestbPN11alglib_impl8ae_stateE(i1 noundef zeroext %0, ptr noundef %1) local_unnamed_addr #5 {
  %3 = alloca %"struct.alglib_impl::ae_frame", align 8
  %4 = alloca %"struct.alglib_impl::ae_vector", align 8
  %5 = alloca %"struct.alglib_impl::ae_vector", align 8
  %6 = alloca %"struct.alglib_impl::hqrndstate", align 8
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %3) #6
  call void @llvm.lifetime.start.p0(i64 64, ptr nonnull %4) #6
  call void @llvm.lifetime.start.p0(i64 64, ptr nonnull %5) #6
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %6) #6
  call void @_ZN11alglib_impl13ae_frame_makeEPNS_8ae_stateEPNS_8ae_frameE(ptr noundef %1, ptr noundef nonnull %3)
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(64) %4, i8 0, i64 64, i1 false)
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(64) %5, i8 0, i64 64, i1 false)
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(24) %6, i8 0, i64 24, i1 false)
  call void @_ZN11alglib_impl14ae_vector_initEPNS_9ae_vectorEllPNS_8ae_stateEb(ptr noundef nonnull %4, i64 noundef 0, i64 noundef 3, ptr noundef %1, i1 noundef zeroext true)
  call void @_ZN11alglib_impl14ae_vector_initEPNS_9ae_vectorEllPNS_8ae_stateEb(ptr noundef nonnull %5, i64 noundef 0, i64 noundef 2, ptr noundef %1, i1 noundef zeroext true)
  call void @_ZN11alglib_impl16_hqrndstate_initEPvPNS_8ae_stateEb(ptr noundef nonnull %6, ptr noundef %1, i1 noundef zeroext true)
  %7 = getelementptr inbounds i8, ptr %5, i64 56
  %8 = getelementptr inbounds i8, ptr %4, i64 56
  br label %9

9:                                                ; preds = %2, %94
  %10 = phi i1 [ true, %2 ], [ %96, %94 ]
  %.07190 = phi i64 [ 1, %2 ], [ %95, %94 ]
  %11 = uitofp nneg i64 %.07190 to double
  %12 = fdiv double 1.000000e+00, %11
  %13 = fmul double %12, 1.000000e+05
  %14 = fsub double 1.000000e+00, %12
  %15 = fmul double %13, %14
  %16 = call noundef double @_ZN11alglib_impl7ae_sqrtEdPNS_8ae_stateE(double noundef %15, ptr noundef %1)
  call void @_ZN11alglib_impl20ae_vector_set_lengthEPNS_9ae_vectorElPNS_8ae_stateE(ptr noundef nonnull %5, i64 noundef %.07190, ptr noundef %1)
  %17 = load ptr, ptr %7, align 8, !tbaa !5
  store i64 0, ptr %17, align 8, !tbaa !8
  %exitcond.not = icmp eq i64 %.07190, 1
  br i1 %exitcond.not, label %30, label %18, !llvm.loop !10

18:                                               ; preds = %9
  %19 = load ptr, ptr %7, align 8, !tbaa !5
  %20 = getelementptr inbounds i8, ptr %19, i64 8
  store i64 0, ptr %20, align 8, !tbaa !8
  %exitcond.not.1 = icmp eq i64 %.07190, 2
  br i1 %exitcond.not.1, label %30, label %21, !llvm.loop !10

21:                                               ; preds = %18
  %22 = load ptr, ptr %7, align 8, !tbaa !5
  %23 = getelementptr inbounds i8, ptr %22, i64 16
  store i64 0, ptr %23, align 8, !tbaa !8
  %exitcond.not.2 = icmp eq i64 %.07190, 3
  br i1 %exitcond.not.2, label %30, label %24, !llvm.loop !10

24:                                               ; preds = %21
  %25 = load ptr, ptr %7, align 8, !tbaa !5
  %26 = getelementptr inbounds i8, ptr %25, i64 24
  store i64 0, ptr %26, align 8, !tbaa !8
  %exitcond.not.3 = icmp eq i64 %.07190, 4
  br i1 %exitcond.not.3, label %30, label %27, !llvm.loop !10

27:                                               ; preds = %24
  %28 = load ptr, ptr %7, align 8, !tbaa !5
  %29 = getelementptr inbounds i8, ptr %28, i64 32
  store i64 0, ptr %29, align 8, !tbaa !8
  br label %30

30:                                               ; preds = %27, %24, %21, %18, %9
  call void @_ZN11alglib_impl20ae_vector_set_lengthEPNS_9ae_vectorElPNS_8ae_stateE(ptr noundef nonnull %4, i64 noundef %.07190, ptr noundef %1)
  %31 = call noundef double @_ZN11alglib_impl13ae_randomrealEPNS_8ae_stateE(ptr noundef %1)
  %32 = call double @llvm.fmuladd.f64(double %31, double 2.000000e+02, double -1.000000e+02)
  %33 = load ptr, ptr %8, align 8, !tbaa !5
  store double %32, ptr %33, align 8, !tbaa !12
  %.not.not7585 = icmp ugt i64 %.07190, 1
  br i1 %.not.not7585, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %30, %.lr.ph
  %.186 = phi i64 [ %43, %.lr.ph ], [ 1, %30 ]
  %34 = load ptr, ptr %8, align 8, !tbaa !5
  %35 = getelementptr double, ptr %34, i64 %.186
  %36 = getelementptr i8, ptr %35, i64 -8
  %37 = load double, ptr %36, align 8, !tbaa !12
  %38 = call noundef double @_ZN11alglib_impl13ae_randomrealEPNS_8ae_stateE(ptr noundef %1)
  %39 = call double @llvm.fmuladd.f64(double %38, double 1.000000e+02, double %37)
  %40 = fadd double %39, 1.000000e-03
  %41 = load ptr, ptr %8, align 8, !tbaa !5
  %42 = getelementptr inbounds double, ptr %41, i64 %.186
  store double %40, ptr %42, align 8, !tbaa !12
  %43 = add nuw nsw i64 %.186, 1
  %exitcond99.not = icmp eq i64 %43, %.07190
  br i1 %exitcond99.not, label %._crit_edge, label %.lr.ph, !llvm.loop !14

._crit_edge:                                      ; preds = %.lr.ph, %30
  %44 = call noundef i64 @_ZN11alglib_impl16ae_randomintegerElPNS_8ae_stateE(i64 noundef 32000, ptr noundef %1)
  %45 = add nsw i64 %44, 1
  %46 = call noundef i64 @_ZN11alglib_impl16ae_randomintegerElPNS_8ae_stateE(i64 noundef 32000, ptr noundef %1)
  %47 = add nsw i64 %46, 1
  call void @_ZN11alglib_impl9hqrndseedEllPNS_10hqrndstateEPNS_8ae_stateE(i64 noundef %45, i64 noundef %47, ptr noundef nonnull %6, ptr noundef %1)
  br label %51

.preheader:                                       ; preds = %.loopexit
  %48 = fdiv double 1.000000e+05, %11
  %49 = call double @llvm.fmuladd.f64(double %16, double -1.000000e+01, double %48)
  %50 = call double @llvm.fmuladd.f64(double %16, double 1.000000e+01, double %48)
  br label %66

51:                                               ; preds = %._crit_edge, %.loopexit
  %.288 = phi i64 [ 0, %._crit_edge ], [ %65, %.loopexit ]
  %52 = call noundef double @_ZN11alglib_impl13hqrnddiscreteEPNS_10hqrndstateEPNS_9ae_vectorElPNS_8ae_stateE(ptr noundef nonnull %6, ptr noundef nonnull %4, i64 noundef %.07190, ptr noundef %1)
  br label %53

53:                                               ; preds = %51, %63
  %.07387 = phi i64 [ 0, %51 ], [ %64, %63 ]
  %54 = load ptr, ptr %8, align 8, !tbaa !5
  %55 = getelementptr inbounds double, ptr %54, i64 %.07387
  %56 = load double, ptr %55, align 8, !tbaa !12
  %57 = call noundef zeroext i1 @_ZN11alglib_impl8ae_fp_eqEdd(double noundef %52, double noundef %56)
  br i1 %57, label %58, label %63

58:                                               ; preds = %53
  %59 = load ptr, ptr %7, align 8, !tbaa !5
  %60 = getelementptr inbounds i64, ptr %59, i64 %.07387
  %61 = load i64, ptr %60, align 8, !tbaa !8
  %62 = add nsw i64 %61, 1
  store i64 %62, ptr %60, align 8, !tbaa !8
  br label %.loopexit

63:                                               ; preds = %53
  %64 = add nuw nsw i64 %.07387, 1
  %exitcond100.not = icmp eq i64 %64, %.07190
  br i1 %exitcond100.not, label %.loopexit, label %53, !llvm.loop !15

.loopexit:                                        ; preds = %63, %58
  %65 = add nuw nsw i64 %.288, 1
  %exitcond101.not = icmp eq i64 %65, 100000
  br i1 %exitcond101.not, label %.preheader, label %51, !llvm.loop !16

66:                                               ; preds = %.preheader, %89
  %.389 = phi i64 [ 0, %.preheader ], [ %90, %89 ]
  %67 = load ptr, ptr %7, align 8, !tbaa !5
  %68 = getelementptr inbounds i64, ptr %67, i64 %.389
  %69 = load i64, ptr %68, align 8, !tbaa !8
  %70 = sitofp i64 %69 to double
  %71 = call noundef zeroext i1 @_ZN11alglib_impl10ae_fp_lessEdd(double noundef %70, double noundef %49)
  br i1 %71, label %78, label %72

72:                                               ; preds = %66
  %73 = load ptr, ptr %7, align 8, !tbaa !5
  %74 = getelementptr inbounds i64, ptr %73, i64 %.389
  %75 = load i64, ptr %74, align 8, !tbaa !8
  %76 = sitofp i64 %75 to double
  %77 = call noundef zeroext i1 @_ZN11alglib_impl13ae_fp_greaterEdd(double noundef %76, double noundef %50)
  br i1 %77, label %78, label %89

78:                                               ; preds = %72, %66
  br i1 %0, label %.loopexit112, label %79

79:                                               ; preds = %78
  %80 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.22)
  %81 = trunc i64 %.389 to i32
  %82 = load ptr, ptr %7, align 8, !tbaa !5
  %83 = getelementptr inbounds i64, ptr %82, i64 %.389
  %84 = load i64, ptr %83, align 8, !tbaa !8
  %85 = trunc i64 %84 to i32
  %86 = fmul double %16, 1.000000e+01
  %87 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.23, i32 noundef %81, i32 noundef %85, double noundef %48, double noundef %86)
  %88 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.24)
  br label %.loopexit112

89:                                               ; preds = %72
  %90 = add nuw nsw i64 %.389, 1
  %exitcond102.not = icmp eq i64 %90, %.07190
  br i1 %exitcond102.not, label %91, label %66, !llvm.loop !17

91:                                               ; preds = %89
  br i1 %0, label %94, label %92

92:                                               ; preds = %91
  %93 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.25)
  br label %94

94:                                               ; preds = %91, %92
  %95 = add nuw nsw i64 %.07190, 1
  %96 = icmp ult i64 %.07190, 5
  %exitcond103.not = icmp eq i64 %95, 6
  br i1 %exitcond103.not, label %.loopexit112, label %9, !llvm.loop !18

.loopexit112:                                     ; preds = %94, %78, %79
  %97 = phi i1 [ %10, %79 ], [ %10, %78 ], [ %96, %94 ]
  call void @_ZN11alglib_impl14ae_frame_leaveEPNS_8ae_stateE(ptr noundef %1)
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %6) #6
  call void @llvm.lifetime.end.p0(i64 64, ptr nonnull %5) #6
  call void @llvm.lifetime.end.p0(i64 64, ptr nonnull %4) #6
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %3) #6
  ret i1 %97
}

declare noundef double @_ZN11alglib_impl13hqrnddiscreteEPNS_10hqrndstateEPNS_9ae_vectorElPNS_8ae_stateE(ptr noundef, ptr noundef, i64 noundef, ptr noundef) local_unnamed_addr #1

declare noundef zeroext i1 @_ZN11alglib_impl8ae_fp_eqEdd(double noundef, double noundef) local_unnamed_addr #1

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #3 = { nofree nounwind "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 = { 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 #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 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C++ TBAA"}
!8 = !{!9, !9, i64 0}
!9 = !{!"long", !6, i64 0}
!10 = distinct !{!10, !11}
!11 = !{!"llvm.loop.mustprogress"}
!12 = !{!13, !13, i64 0}
!13 = !{!"double", !6, i64 0}
!14 = distinct !{!14, !11}
!15 = distinct !{!15, !11}
!16 = distinct !{!16, !11}
!17 = distinct !{!17, !11}
!18 = distinct !{!18, !11}


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