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

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

@.str.225 = external hidden unnamed_addr constant [28 x i8], align 1

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

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

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

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

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #3

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN11alglib_impl14hmatrixrndcondEldPNS_9ae_matrixEPNS_8ae_stateE(i64 noundef %0, double noundef %1, ptr noundef %2, ptr noundef %3) #4 {
  %5 = alloca i64, align 8
  %6 = alloca double, align 8
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca %"struct.alglib_impl::ae_frame", align 8
  %10 = alloca i64, align 8
  %11 = alloca i64, align 8
  %12 = alloca double, align 8
  %13 = alloca double, align 8
  %14 = alloca %"struct.alglib_impl::hqrndstate", align 8
  %15 = alloca %"struct.alglib_impl::ae_complex", align 8
  %16 = alloca i32, align 4
  %17 = alloca %"struct.alglib_impl::ae_complex", align 8
  %18 = alloca %"struct.alglib_impl::ae_complex", align 8
  %19 = alloca %"struct.alglib_impl::ae_complex", align 8
  %20 = alloca %"struct.alglib_impl::ae_complex", align 8
  store i64 %0, ptr %5, align 8, !tbaa !5
  store double %1, ptr %6, align 8, !tbaa !9
  store ptr %2, ptr %7, align 8, !tbaa !11
  store ptr %3, ptr %8, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 32, ptr %9) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #6
  call void @llvm.lifetime.start.p0(i64 24, ptr %14) #6
  %21 = load ptr, ptr %8, align 8, !tbaa !11
  call void @_ZN11alglib_impl13ae_frame_makeEPNS_8ae_stateEPNS_8ae_frameE(ptr noundef %21, ptr noundef %9)
  call void @llvm.memset.p0.i64(ptr align 8 %14, i8 0, i64 24, i1 false)
  %22 = load ptr, ptr %7, align 8, !tbaa !11
  call void @_ZN11alglib_impl15ae_matrix_clearEPNS_9ae_matrixE(ptr noundef %22)
  %23 = load ptr, ptr %8, align 8, !tbaa !11
  call void @_ZN11alglib_impl16_hqrndstate_initEPvPNS_8ae_stateEb(ptr noundef %14, ptr noundef %23, i1 noundef zeroext true)
  %24 = load i64, ptr %5, align 8, !tbaa !5
  %25 = icmp sge i64 %24, 1
  br i1 %25, label %26, label %29

26:                                               ; preds = %4
  %27 = load double, ptr %6, align 8, !tbaa !9
  %28 = call noundef zeroext i1 @_ZN11alglib_impl16ae_fp_greater_eqEdd(double noundef %27, double noundef 1.000000e+00)
  br label %29

29:                                               ; preds = %26, %4
  %30 = phi i1 [ false, %4 ], [ %28, %26 ]
  %31 = load ptr, ptr %8, align 8, !tbaa !11
  call void @_ZN11alglib_impl9ae_assertEbPKcPNS_8ae_stateE(i1 noundef zeroext %30, ptr noundef @.str.225, ptr noundef %31)
  %32 = load ptr, ptr %7, align 8, !tbaa !11
  %33 = load i64, ptr %5, align 8, !tbaa !5
  %34 = load i64, ptr %5, align 8, !tbaa !5
  %35 = load ptr, ptr %8, align 8, !tbaa !11
  call void @_ZN11alglib_impl20ae_matrix_set_lengthEPNS_9ae_matrixEllPNS_8ae_stateE(ptr noundef %32, i64 noundef %33, i64 noundef %34, ptr noundef %35)
  %36 = load i64, ptr %5, align 8, !tbaa !5
  %37 = icmp eq i64 %36, 1
  br i1 %37, label %38, label %55

38:                                               ; preds = %29
  call void @llvm.lifetime.start.p0(i64 16, ptr %15) #6
  %39 = load ptr, ptr %8, align 8, !tbaa !11
  %40 = call noundef i64 @_ZN11alglib_impl16ae_randomintegerElPNS_8ae_stateE(i64 noundef 2, ptr noundef %39)
  %41 = mul nsw i64 2, %40
  %42 = sub nsw i64 %41, 1
  %43 = call { double, double } @_ZN11alglib_impl17ae_complex_from_iEl(i64 noundef %42)
  %44 = getelementptr inbounds { double, double }, ptr %15, i32 0, i32 0
  %45 = extractvalue { double, double } %43, 0
  store double %45, ptr %44, align 8
  %46 = getelementptr inbounds { double, double }, ptr %15, i32 0, i32 1
  %47 = extractvalue { double, double } %43, 1
  store double %47, ptr %46, align 8
  %48 = load ptr, ptr %7, align 8, !tbaa !11
  %49 = getelementptr inbounds %"struct.alglib_impl::ae_matrix", ptr %48, i32 0, i32 6
  %50 = load ptr, ptr %49, align 8, !tbaa !13
  %51 = getelementptr inbounds ptr, ptr %50, i64 0
  %52 = load ptr, ptr %51, align 8, !tbaa !11
  %53 = getelementptr inbounds %"struct.alglib_impl::ae_complex", ptr %52, i64 0
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %53, ptr align 8 %15, i64 16, i1 false), !tbaa.struct !14
  call void @llvm.lifetime.end.p0(i64 16, ptr %15) #6
  %54 = load ptr, ptr %8, align 8, !tbaa !11
  call void @_ZN11alglib_impl14ae_frame_leaveEPNS_8ae_stateE(ptr noundef %54)
  store i32 1, ptr %16, align 4
  br label %187

55:                                               ; preds = %29
  %56 = load ptr, ptr %8, align 8, !tbaa !11
  call void @_ZN11alglib_impl14hqrndrandomizeEPNS_10hqrndstateEPNS_8ae_stateE(ptr noundef %14, ptr noundef %56)
  store double 0.000000e+00, ptr %12, align 8, !tbaa !9
  %57 = load double, ptr %6, align 8, !tbaa !9
  %58 = fdiv double 1.000000e+00, %57
  %59 = load ptr, ptr %8, align 8, !tbaa !11
  %60 = call noundef double @_ZN11alglib_impl6ae_logEdPNS_8ae_stateE(double noundef %58, ptr noundef %59)
  store double %60, ptr %13, align 8, !tbaa !9
  store i64 0, ptr %10, align 8, !tbaa !5
  br label %61

61:                                               ; preds = %90, %55
  %62 = load i64, ptr %10, align 8, !tbaa !5
  %63 = load i64, ptr %5, align 8, !tbaa !5
  %64 = sub nsw i64 %63, 1
  %65 = icmp sle i64 %62, %64
  br i1 %65, label %66, label %93

66:                                               ; preds = %61
  store i64 0, ptr %11, align 8, !tbaa !5
  br label %67

67:                                               ; preds = %86, %66
  %68 = load i64, ptr %11, align 8, !tbaa !5
  %69 = load i64, ptr %5, align 8, !tbaa !5
  %70 = sub nsw i64 %69, 1
  %71 = icmp sle i64 %68, %70
  br i1 %71, label %72, label %89

72:                                               ; preds = %67
  call void @llvm.lifetime.start.p0(i64 16, ptr %17) #6
  %73 = call { double, double } @_ZN11alglib_impl17ae_complex_from_iEl(i64 noundef 0)
  %74 = getelementptr inbounds { double, double }, ptr %17, i32 0, i32 0
  %75 = extractvalue { double, double } %73, 0
  store double %75, ptr %74, align 8
  %76 = getelementptr inbounds { double, double }, ptr %17, i32 0, i32 1
  %77 = extractvalue { double, double } %73, 1
  store double %77, ptr %76, align 8
  %78 = load ptr, ptr %7, align 8, !tbaa !11
  %79 = getelementptr inbounds %"struct.alglib_impl::ae_matrix", ptr %78, i32 0, i32 6
  %80 = load ptr, ptr %79, align 8, !tbaa !13
  %81 = load i64, ptr %10, align 8, !tbaa !5
  %82 = getelementptr inbounds ptr, ptr %80, i64 %81
  %83 = load ptr, ptr %82, align 8, !tbaa !11
  %84 = load i64, ptr %11, align 8, !tbaa !5
  %85 = getelementptr inbounds %"struct.alglib_impl::ae_complex", ptr %83, i64 %84
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %85, ptr align 8 %17, i64 16, i1 false), !tbaa.struct !14
  call void @llvm.lifetime.end.p0(i64 16, ptr %17) #6
  br label %86

86:                                               ; preds = %72
  %87 = load i64, ptr %11, align 8, !tbaa !5
  %88 = add nsw i64 %87, 1
  store i64 %88, ptr %11, align 8, !tbaa !5
  br label %67, !llvm.loop !15

89:                                               ; preds = %67
  br label %90

90:                                               ; preds = %89
  %91 = load i64, ptr %10, align 8, !tbaa !5
  %92 = add nsw i64 %91, 1
  store i64 %92, ptr %10, align 8, !tbaa !5
  br label %61, !llvm.loop !17

93:                                               ; preds = %61
  call void @llvm.lifetime.start.p0(i64 16, ptr %18) #6
  %94 = load double, ptr %12, align 8, !tbaa !9
  %95 = load ptr, ptr %8, align 8, !tbaa !11
  %96 = call noundef double @_ZN11alglib_impl6ae_expEdPNS_8ae_stateE(double noundef %94, ptr noundef %95)
  %97 = call { double, double } @_ZN11alglib_impl17ae_complex_from_dEd(double noundef %96)
  %98 = getelementptr inbounds { double, double }, ptr %18, i32 0, i32 0
  %99 = extractvalue { double, double } %97, 0
  store double %99, ptr %98, align 8
  %100 = getelementptr inbounds { double, double }, ptr %18, i32 0, i32 1
  %101 = extractvalue { double, double } %97, 1
  store double %101, ptr %100, align 8
  %102 = load ptr, ptr %7, align 8, !tbaa !11
  %103 = getelementptr inbounds %"struct.alglib_impl::ae_matrix", ptr %102, i32 0, i32 6
  %104 = load ptr, ptr %103, align 8, !tbaa !13
  %105 = getelementptr inbounds ptr, ptr %104, i64 0
  %106 = load ptr, ptr %105, align 8, !tbaa !11
  %107 = getelementptr inbounds %"struct.alglib_impl::ae_complex", ptr %106, i64 0
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %107, ptr align 8 %18, i64 16, i1 false), !tbaa.struct !14
  call void @llvm.lifetime.end.p0(i64 16, ptr %18) #6
  store i64 1, ptr %10, align 8, !tbaa !5
  br label %108

108:                                              ; preds = %142, %93
  %109 = load i64, ptr %10, align 8, !tbaa !5
  %110 = load i64, ptr %5, align 8, !tbaa !5
  %111 = sub nsw i64 %110, 2
  %112 = icmp sle i64 %109, %111
  br i1 %112, label %113, label %145

113:                                              ; preds = %108
  call void @llvm.lifetime.start.p0(i64 16, ptr %19) #6
  %114 = load ptr, ptr %8, align 8, !tbaa !11
  %115 = call noundef i64 @_ZN11alglib_impl13hqrnduniformiEPNS_10hqrndstateElPNS_8ae_stateE(ptr noundef %14, i64 noundef 2, ptr noundef %114)
  %116 = mul nsw i64 2, %115
  %117 = sub nsw i64 %116, 1
  %118 = sitofp i64 %117 to double
  %119 = load ptr, ptr %8, align 8, !tbaa !11
  %120 = call noundef double @_ZN11alglib_impl13hqrnduniformrEPNS_10hqrndstateEPNS_8ae_stateE(ptr noundef %14, ptr noundef %119)
  %121 = load double, ptr %13, align 8, !tbaa !9
  %122 = load double, ptr %12, align 8, !tbaa !9
  %123 = fsub double %121, %122
  %124 = load double, ptr %12, align 8, !tbaa !9
  %125 = call double @llvm.fmuladd.f64(double %120, double %123, double %124)
  %126 = load ptr, ptr %8, align 8, !tbaa !11
  %127 = call noundef double @_ZN11alglib_impl6ae_expEdPNS_8ae_stateE(double noundef %125, ptr noundef %126)
  %128 = fmul double %118, %127
  %129 = call { double, double } @_ZN11alglib_impl17ae_complex_from_dEd(double noundef %128)
  %130 = getelementptr inbounds { double, double }, ptr %19, i32 0, i32 0
  %131 = extractvalue { double, double } %129, 0
  store double %131, ptr %130, align 8
  %132 = getelementptr inbounds { double, double }, ptr %19, i32 0, i32 1
  %133 = extractvalue { double, double } %129, 1
  store double %133, ptr %132, align 8
  %134 = load ptr, ptr %7, align 8, !tbaa !11
  %135 = getelementptr inbounds %"struct.alglib_impl::ae_matrix", ptr %134, i32 0, i32 6
  %136 = load ptr, ptr %135, align 8, !tbaa !13
  %137 = load i64, ptr %10, align 8, !tbaa !5
  %138 = getelementptr inbounds ptr, ptr %136, i64 %137
  %139 = load ptr, ptr %138, align 8, !tbaa !11
  %140 = load i64, ptr %10, align 8, !tbaa !5
  %141 = getelementptr inbounds %"struct.alglib_impl::ae_complex", ptr %139, i64 %140
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %141, ptr align 8 %19, i64 16, i1 false), !tbaa.struct !14
  call void @llvm.lifetime.end.p0(i64 16, ptr %19) #6
  br label %142

142:                                              ; preds = %113
  %143 = load i64, ptr %10, align 8, !tbaa !5
  %144 = add nsw i64 %143, 1
  store i64 %144, ptr %10, align 8, !tbaa !5
  br label %108, !llvm.loop !18

145:                                              ; preds = %108
  call void @llvm.lifetime.start.p0(i64 16, ptr %20) #6
  %146 = load double, ptr %13, align 8, !tbaa !9
  %147 = load ptr, ptr %8, align 8, !tbaa !11
  %148 = call noundef double @_ZN11alglib_impl6ae_expEdPNS_8ae_stateE(double noundef %146, ptr noundef %147)
  %149 = call { double, double } @_ZN11alglib_impl17ae_complex_from_dEd(double noundef %148)
  %150 = getelementptr inbounds { double, double }, ptr %20, i32 0, i32 0
  %151 = extractvalue { double, double } %149, 0
  store double %151, ptr %150, align 8
  %152 = getelementptr inbounds { double, double }, ptr %20, i32 0, i32 1
  %153 = extractvalue { double, double } %149, 1
  store double %153, ptr %152, align 8
  %154 = load ptr, ptr %7, align 8, !tbaa !11
  %155 = getelementptr inbounds %"struct.alglib_impl::ae_matrix", ptr %154, i32 0, i32 6
  %156 = load ptr, ptr %155, align 8, !tbaa !13
  %157 = load i64, ptr %5, align 8, !tbaa !5
  %158 = sub nsw i64 %157, 1
  %159 = getelementptr inbounds ptr, ptr %156, i64 %158
  %160 = load ptr, ptr %159, align 8, !tbaa !11
  %161 = load i64, ptr %5, align 8, !tbaa !5
  %162 = sub nsw i64 %161, 1
  %163 = getelementptr inbounds %"struct.alglib_impl::ae_complex", ptr %160, i64 %162
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %163, ptr align 8 %20, i64 16, i1 false), !tbaa.struct !14
  call void @llvm.lifetime.end.p0(i64 16, ptr %20) #6
  %164 = load ptr, ptr %7, align 8, !tbaa !11
  %165 = load i64, ptr %5, align 8, !tbaa !5
  %166 = load ptr, ptr %8, align 8, !tbaa !11
  call void @_ZN11alglib_impl18hmatrixrndmultiplyEPNS_9ae_matrixElPNS_8ae_stateE(ptr noundef %164, i64 noundef %165, ptr noundef %166)
  store i64 0, ptr %10, align 8, !tbaa !5
  br label %167

167:                                              ; preds = %182, %145
  %168 = load i64, ptr %10, align 8, !tbaa !5
  %169 = load i64, ptr %5, align 8, !tbaa !5
  %170 = sub nsw i64 %169, 1
  %171 = icmp sle i64 %168, %170
  br i1 %171, label %172, label %185

172:                                              ; preds = %167
  %173 = load ptr, ptr %7, align 8, !tbaa !11
  %174 = getelementptr inbounds %"struct.alglib_impl::ae_matrix", ptr %173, i32 0, i32 6
  %175 = load ptr, ptr %174, align 8, !tbaa !13
  %176 = load i64, ptr %10, align 8, !tbaa !5
  %177 = getelementptr inbounds ptr, ptr %175, i64 %176
  %178 = load ptr, ptr %177, align 8, !tbaa !11
  %179 = load i64, ptr %10, align 8, !tbaa !5
  %180 = getelementptr inbounds %"struct.alglib_impl::ae_complex", ptr %178, i64 %179
  %181 = getelementptr inbounds %"struct.alglib_impl::ae_complex", ptr %180, i32 0, i32 1
  store double 0.000000e+00, ptr %181, align 8, !tbaa !19
  br label %182

182:                                              ; preds = %172
  %183 = load i64, ptr %10, align 8, !tbaa !5
  %184 = add nsw i64 %183, 1
  store i64 %184, ptr %10, align 8, !tbaa !5
  br label %167, !llvm.loop !21

185:                                              ; preds = %167
  %186 = load ptr, ptr %8, align 8, !tbaa !11
  call void @_ZN11alglib_impl14ae_frame_leaveEPNS_8ae_stateE(ptr noundef %186)
  store i32 0, ptr %16, align 4
  br label %187

187:                                              ; preds = %185, %38
  call void @llvm.lifetime.end.p0(i64 24, ptr %14) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #6
  call void @llvm.lifetime.end.p0(i64 32, ptr %9) #6
  %188 = load i32, ptr %16, align 4
  switch i32 %188, label %190 [
    i32 0, label %189
    i32 1, label %189
  ]

189:                                              ; preds = %187, %187
  ret void

190:                                              ; preds = %187
  unreachable
}

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN11alglib_impl18hmatrixrndmultiplyEPNS_9ae_matrixElPNS_8ae_stateE(ptr noundef, i64 noundef, ptr noundef) #4

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

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

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

declare void @_ZN11alglib_impl14ae_frame_leaveEPNS_8ae_stateE(ptr noundef) #2

declare { double, double } @_ZN11alglib_impl17ae_complex_from_iEl(i64 noundef) #2

declare { double, double } @_ZN11alglib_impl17ae_complex_from_dEd(double noundef) #2

declare void @_ZN11alglib_impl15ae_matrix_clearEPNS_9ae_matrixE(ptr noundef) #2

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

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

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

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

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

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

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

declare noundef i64 @_ZN11alglib_impl13hqrnduniformiEPNS_10hqrndstateElPNS_8ae_stateE(ptr noundef, i64 noundef, ptr noundef) #2

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


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

@.str.225 = external hidden unnamed_addr constant [28 x i8], align 1

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

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

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN11alglib_impl14hmatrixrndcondEldPNS_9ae_matrixEPNS_8ae_stateE(i64 noundef %0, double noundef %1, ptr noundef %2, ptr noundef %3) local_unnamed_addr #3 {
  %5 = alloca %"struct.alglib_impl::ae_frame", align 8
  %6 = alloca %"struct.alglib_impl::hqrndstate", align 8
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %5) #5
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %6) #5
  call void @_ZN11alglib_impl13ae_frame_makeEPNS_8ae_stateEPNS_8ae_frameE(ptr noundef %3, ptr noundef nonnull %5)
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(24) %6, i8 0, i64 24, i1 false)
  call void @_ZN11alglib_impl15ae_matrix_clearEPNS_9ae_matrixE(ptr noundef %2)
  call void @_ZN11alglib_impl16_hqrndstate_initEPvPNS_8ae_stateEb(ptr noundef nonnull %6, ptr noundef %3, i1 noundef zeroext true)
  %7 = icmp sgt i64 %0, 0
  br i1 %7, label %8, label %10

8:                                                ; preds = %4
  %9 = call noundef zeroext i1 @_ZN11alglib_impl16ae_fp_greater_eqEdd(double noundef %1, double noundef 1.000000e+00)
  br label %10

10:                                               ; preds = %8, %4
  %11 = phi i1 [ false, %4 ], [ %9, %8 ]
  call void @_ZN11alglib_impl9ae_assertEbPKcPNS_8ae_stateE(i1 noundef zeroext %11, ptr noundef nonnull @.str.225, ptr noundef %3)
  call void @_ZN11alglib_impl20ae_matrix_set_lengthEPNS_9ae_matrixEllPNS_8ae_stateE(ptr noundef %2, i64 noundef %0, i64 noundef %0, ptr noundef %3)
  %12 = icmp eq i64 %0, 1
  br i1 %12, label %13, label %23

13:                                               ; preds = %10
  %14 = call noundef i64 @_ZN11alglib_impl16ae_randomintegerElPNS_8ae_stateE(i64 noundef 2, ptr noundef %3)
  %15 = shl nsw i64 %14, 1
  %16 = add nsw i64 %15, -1
  %17 = call { double, double } @_ZN11alglib_impl17ae_complex_from_iEl(i64 noundef %16)
  %18 = extractvalue { double, double } %17, 0
  %19 = extractvalue { double, double } %17, 1
  %20 = getelementptr inbounds i8, ptr %2, i64 72
  %21 = load ptr, ptr %20, align 8, !tbaa !5
  %22 = load ptr, ptr %21, align 8, !tbaa !8
  store double %18, ptr %22, align 8, !tbaa !10
  %.sroa.48.0..sroa_idx = getelementptr inbounds i8, ptr %22, i64 8
  store double %19, ptr %.sroa.48.0..sroa_idx, align 8, !tbaa !10
  br label %._crit_edge80

23:                                               ; preds = %10
  call void @_ZN11alglib_impl14hqrndrandomizeEPNS_10hqrndstateEPNS_8ae_stateE(ptr noundef nonnull %6, ptr noundef %3)
  %24 = fdiv double 1.000000e+00, %1
  %25 = call noundef double @_ZN11alglib_impl6ae_logEdPNS_8ae_stateE(double noundef %24, ptr noundef %3)
  br i1 %7, label %.preheader.lr.ph, label %._crit_edge73

.preheader.lr.ph:                                 ; preds = %23
  %26 = getelementptr inbounds i8, ptr %2, i64 72
  br label %.preheader.us

.preheader.us:                                    ; preds = %._crit_edge.us, %.preheader.lr.ph
  %.072.us = phi i64 [ 0, %.preheader.lr.ph ], [ %36, %._crit_edge.us ]
  br label %27

27:                                               ; preds = %.preheader.us, %27
  %.06370.us = phi i64 [ 0, %.preheader.us ], [ %35, %27 ]
  %28 = call { double, double } @_ZN11alglib_impl17ae_complex_from_iEl(i64 noundef 0)
  %29 = extractvalue { double, double } %28, 0
  %30 = extractvalue { double, double } %28, 1
  %31 = load ptr, ptr %26, align 8, !tbaa !5
  %32 = getelementptr inbounds ptr, ptr %31, i64 %.072.us
  %33 = load ptr, ptr %32, align 8, !tbaa !8
  %34 = getelementptr inbounds %"struct.alglib_impl::ae_complex", ptr %33, i64 %.06370.us
  store double %29, ptr %34, align 8, !tbaa !10
  %.sroa.46.0..sroa_idx.us = getelementptr inbounds i8, ptr %34, i64 8
  store double %30, ptr %.sroa.46.0..sroa_idx.us, align 8, !tbaa !10
  %35 = add nuw nsw i64 %.06370.us, 1
  %exitcond.not = icmp eq i64 %35, %0
  br i1 %exitcond.not, label %._crit_edge.us, label %27, !llvm.loop !12

._crit_edge.us:                                   ; preds = %27
  %36 = add nuw nsw i64 %.072.us, 1
  %exitcond81.not = icmp eq i64 %36, %0
  br i1 %exitcond81.not, label %._crit_edge73, label %.preheader.us, !llvm.loop !14

._crit_edge73:                                    ; preds = %._crit_edge.us, %23
  %37 = add i64 %0, -1
  %38 = call noundef double @_ZN11alglib_impl6ae_expEdPNS_8ae_stateE(double noundef 0.000000e+00, ptr noundef %3)
  %39 = call { double, double } @_ZN11alglib_impl17ae_complex_from_dEd(double noundef %38)
  %40 = extractvalue { double, double } %39, 0
  %41 = extractvalue { double, double } %39, 1
  %42 = getelementptr inbounds i8, ptr %2, i64 72
  %43 = load ptr, ptr %42, align 8, !tbaa !5
  %44 = load ptr, ptr %43, align 8, !tbaa !8
  store double %40, ptr %44, align 8, !tbaa !10
  %.sroa.44.0..sroa_idx = getelementptr inbounds i8, ptr %44, i64 8
  store double %41, ptr %.sroa.44.0..sroa_idx, align 8, !tbaa !10
  %.not74 = icmp slt i64 %0, 3
  br i1 %.not74, label %._crit_edge, label %.lr.ph

.lr.ph:                                           ; preds = %._crit_edge73, %.lr.ph
  %.175 = phi i64 [ %60, %.lr.ph ], [ 1, %._crit_edge73 ]
  %45 = call noundef i64 @_ZN11alglib_impl13hqrnduniformiEPNS_10hqrndstateElPNS_8ae_stateE(ptr noundef nonnull %6, i64 noundef 2, ptr noundef %3)
  %46 = shl nsw i64 %45, 1
  %47 = add nsw i64 %46, -1
  %48 = sitofp i64 %47 to double
  %49 = call noundef double @_ZN11alglib_impl13hqrnduniformrEPNS_10hqrndstateEPNS_8ae_stateE(ptr noundef nonnull %6, ptr noundef %3)
  %50 = call double @llvm.fmuladd.f64(double %49, double %25, double 0.000000e+00)
  %51 = call noundef double @_ZN11alglib_impl6ae_expEdPNS_8ae_stateE(double noundef %50, ptr noundef %3)
  %52 = fmul double %51, %48
  %53 = call { double, double } @_ZN11alglib_impl17ae_complex_from_dEd(double noundef %52)
  %54 = extractvalue { double, double } %53, 0
  %55 = extractvalue { double, double } %53, 1
  %56 = load ptr, ptr %42, align 8, !tbaa !5
  %57 = getelementptr inbounds ptr, ptr %56, i64 %.175
  %58 = load ptr, ptr %57, align 8, !tbaa !8
  %59 = getelementptr inbounds %"struct.alglib_impl::ae_complex", ptr %58, i64 %.175
  store double %54, ptr %59, align 8, !tbaa !10
  %.sroa.42.0..sroa_idx = getelementptr inbounds i8, ptr %59, i64 8
  store double %55, ptr %.sroa.42.0..sroa_idx, align 8, !tbaa !10
  %60 = add nuw i64 %.175, 1
  %exitcond82.not = icmp eq i64 %60, %37
  br i1 %exitcond82.not, label %._crit_edge, label %.lr.ph, !llvm.loop !15

._crit_edge:                                      ; preds = %.lr.ph, %._crit_edge73
  %61 = call noundef double @_ZN11alglib_impl6ae_expEdPNS_8ae_stateE(double noundef %25, ptr noundef %3)
  %62 = call { double, double } @_ZN11alglib_impl17ae_complex_from_dEd(double noundef %61)
  %63 = extractvalue { double, double } %62, 0
  %64 = extractvalue { double, double } %62, 1
  %65 = load ptr, ptr %42, align 8, !tbaa !5
  %66 = getelementptr inbounds ptr, ptr %65, i64 %37
  %67 = load ptr, ptr %66, align 8, !tbaa !8
  %68 = getelementptr inbounds %"struct.alglib_impl::ae_complex", ptr %67, i64 %37
  store double %63, ptr %68, align 8, !tbaa !10
  %.sroa.4.0..sroa_idx = getelementptr inbounds i8, ptr %68, i64 8
  store double %64, ptr %.sroa.4.0..sroa_idx, align 8, !tbaa !10
  call void @_ZN11alglib_impl18hmatrixrndmultiplyEPNS_9ae_matrixElPNS_8ae_stateE(ptr noundef nonnull %2, i64 noundef %0, ptr noundef %3)
  br i1 %7, label %.lr.ph79.preheader, label %._crit_edge80

.lr.ph79.preheader:                               ; preds = %._crit_edge
  %xtraiter = and i64 %0, 3
  %69 = icmp ult i64 %0, 4
  br i1 %69, label %._crit_edge80.loopexit.unr-lcssa, label %.lr.ph79.preheader.new

.lr.ph79.preheader.new:                           ; preds = %.lr.ph79.preheader
  %unroll_iter = and i64 %0, 9223372036854775804
  br label %.lr.ph79

.lr.ph79:                                         ; preds = %.lr.ph79, %.lr.ph79.preheader.new
  %.277 = phi i64 [ 0, %.lr.ph79.preheader.new ], [ %89, %.lr.ph79 ]
  %niter = phi i64 [ 0, %.lr.ph79.preheader.new ], [ %niter.next.3, %.lr.ph79 ]
  %70 = load ptr, ptr %42, align 8, !tbaa !5
  %71 = getelementptr inbounds ptr, ptr %70, i64 %.277
  %72 = load ptr, ptr %71, align 8, !tbaa !8
  %73 = getelementptr inbounds %"struct.alglib_impl::ae_complex", ptr %72, i64 %.277, i32 1
  store double 0.000000e+00, ptr %73, align 8, !tbaa !16
  %74 = or disjoint i64 %.277, 1
  %75 = load ptr, ptr %42, align 8, !tbaa !5
  %76 = getelementptr inbounds ptr, ptr %75, i64 %74
  %77 = load ptr, ptr %76, align 8, !tbaa !8
  %78 = getelementptr inbounds %"struct.alglib_impl::ae_complex", ptr %77, i64 %74, i32 1
  store double 0.000000e+00, ptr %78, align 8, !tbaa !16
  %79 = or disjoint i64 %.277, 2
  %80 = load ptr, ptr %42, align 8, !tbaa !5
  %81 = getelementptr inbounds ptr, ptr %80, i64 %79
  %82 = load ptr, ptr %81, align 8, !tbaa !8
  %83 = getelementptr inbounds %"struct.alglib_impl::ae_complex", ptr %82, i64 %79, i32 1
  store double 0.000000e+00, ptr %83, align 8, !tbaa !16
  %84 = or disjoint i64 %.277, 3
  %85 = load ptr, ptr %42, align 8, !tbaa !5
  %86 = getelementptr inbounds ptr, ptr %85, i64 %84
  %87 = load ptr, ptr %86, align 8, !tbaa !8
  %88 = getelementptr inbounds %"struct.alglib_impl::ae_complex", ptr %87, i64 %84, i32 1
  store double 0.000000e+00, ptr %88, align 8, !tbaa !16
  %89 = add nuw nsw i64 %.277, 4
  %niter.next.3 = add i64 %niter, 4
  %niter.ncmp.3 = icmp eq i64 %niter.next.3, %unroll_iter
  br i1 %niter.ncmp.3, label %._crit_edge80.loopexit.unr-lcssa, label %.lr.ph79, !llvm.loop !18

._crit_edge80.loopexit.unr-lcssa:                 ; preds = %.lr.ph79, %.lr.ph79.preheader
  %.277.unr = phi i64 [ 0, %.lr.ph79.preheader ], [ %89, %.lr.ph79 ]
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br i1 %lcmp.mod.not, label %._crit_edge80, label %.lr.ph79.epil

.lr.ph79.epil:                                    ; preds = %._crit_edge80.loopexit.unr-lcssa, %.lr.ph79.epil
  %.277.epil = phi i64 [ %94, %.lr.ph79.epil ], [ %.277.unr, %._crit_edge80.loopexit.unr-lcssa ]
  %epil.iter = phi i64 [ %epil.iter.next, %.lr.ph79.epil ], [ 0, %._crit_edge80.loopexit.unr-lcssa ]
  %90 = load ptr, ptr %42, align 8, !tbaa !5
  %91 = getelementptr inbounds ptr, ptr %90, i64 %.277.epil
  %92 = load ptr, ptr %91, align 8, !tbaa !8
  %93 = getelementptr inbounds %"struct.alglib_impl::ae_complex", ptr %92, i64 %.277.epil, i32 1
  store double 0.000000e+00, ptr %93, align 8, !tbaa !16
  %94 = add nuw nsw i64 %.277.epil, 1
  %epil.iter.next = add i64 %epil.iter, 1
  %epil.iter.cmp.not = icmp eq i64 %epil.iter.next, %xtraiter
  br i1 %epil.iter.cmp.not, label %._crit_edge80, label %.lr.ph79.epil, !llvm.loop !19

._crit_edge80:                                    ; preds = %._crit_edge80.loopexit.unr-lcssa, %.lr.ph79.epil, %._crit_edge, %13
  call void @_ZN11alglib_impl14ae_frame_leaveEPNS_8ae_stateE(ptr noundef %3)
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %6) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %5) #5
  ret void
}

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN11alglib_impl18hmatrixrndmultiplyEPNS_9ae_matrixElPNS_8ae_stateE(ptr noundef, i64 noundef, ptr noundef) local_unnamed_addr #3

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

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

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

declare void @_ZN11alglib_impl14ae_frame_leaveEPNS_8ae_stateE(ptr noundef) local_unnamed_addr #2

declare { double, double } @_ZN11alglib_impl17ae_complex_from_iEl(i64 noundef) local_unnamed_addr #2

declare { double, double } @_ZN11alglib_impl17ae_complex_from_dEd(double noundef) local_unnamed_addr #2

declare void @_ZN11alglib_impl15ae_matrix_clearEPNS_9ae_matrixE(ptr noundef) local_unnamed_addr #2

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

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

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

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

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

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

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

declare noundef i64 @_ZN11alglib_impl13hqrnduniformiEPNS_10hqrndstateElPNS_8ae_stateE(ptr noundef, i64 noundef, ptr noundef) local_unnamed_addr #2

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


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