; 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.223 = 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_impl14cmatrixrndcondEldPNS_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
  call void @llvm.lifetime.start.p0(i64 16, ptr %15) #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.223, 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 %50

38:                                               ; preds = %29
  %39 = load ptr, ptr %8, align 8, !tbaa !11
  call void @_ZN11alglib_impl14hqrndrandomizeEPNS_10hqrndstateEPNS_8ae_stateE(ptr noundef %14, ptr noundef %39)
  %40 = getelementptr inbounds %"struct.alglib_impl::ae_complex", ptr %15, i32 0, i32 0
  %41 = getelementptr inbounds %"struct.alglib_impl::ae_complex", ptr %15, i32 0, i32 1
  %42 = load ptr, ptr %8, align 8, !tbaa !11
  call void @_ZN11alglib_impl10hqrndunit2EPNS_10hqrndstateEPdS2_PNS_8ae_stateE(ptr noundef %14, ptr noundef %40, ptr noundef %41, ptr noundef %42)
  %43 = load ptr, ptr %7, align 8, !tbaa !11
  %44 = getelementptr inbounds %"struct.alglib_impl::ae_matrix", ptr %43, i32 0, i32 6
  %45 = load ptr, ptr %44, align 8, !tbaa !13
  %46 = getelementptr inbounds ptr, ptr %45, i64 0
  %47 = load ptr, ptr %46, align 8, !tbaa !11
  %48 = getelementptr inbounds %"struct.alglib_impl::ae_complex", ptr %47, i64 0
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %48, ptr align 8 %15, i64 16, i1 false), !tbaa.struct !14
  %49 = load ptr, ptr %8, align 8, !tbaa !11
  call void @_ZN11alglib_impl14ae_frame_leaveEPNS_8ae_stateE(ptr noundef %49)
  store i32 1, ptr %16, align 4
  br label %162

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

56:                                               ; preds = %85, %50
  %57 = load i64, ptr %10, align 8, !tbaa !5
  %58 = load i64, ptr %5, align 8, !tbaa !5
  %59 = sub nsw i64 %58, 1
  %60 = icmp sle i64 %57, %59
  br i1 %60, label %61, label %88

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

62:                                               ; preds = %81, %61
  %63 = load i64, ptr %11, align 8, !tbaa !5
  %64 = load i64, ptr %5, align 8, !tbaa !5
  %65 = sub nsw i64 %64, 1
  %66 = icmp sle i64 %63, %65
  br i1 %66, label %67, label %84

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

81:                                               ; preds = %67
  %82 = load i64, ptr %11, align 8, !tbaa !5
  %83 = add nsw i64 %82, 1
  store i64 %83, ptr %11, align 8, !tbaa !5
  br label %62, !llvm.loop !15

84:                                               ; preds = %62
  br label %85

85:                                               ; preds = %84
  %86 = load i64, ptr %10, align 8, !tbaa !5
  %87 = add nsw i64 %86, 1
  store i64 %87, ptr %10, align 8, !tbaa !5
  br label %56, !llvm.loop !17

88:                                               ; preds = %56
  call void @llvm.lifetime.start.p0(i64 16, ptr %18) #6
  %89 = load double, ptr %12, align 8, !tbaa !9
  %90 = load ptr, ptr %8, align 8, !tbaa !11
  %91 = call noundef double @_ZN11alglib_impl6ae_expEdPNS_8ae_stateE(double noundef %89, ptr noundef %90)
  %92 = call { double, double } @_ZN11alglib_impl17ae_complex_from_dEd(double noundef %91)
  %93 = getelementptr inbounds { double, double }, ptr %18, i32 0, i32 0
  %94 = extractvalue { double, double } %92, 0
  store double %94, ptr %93, align 8
  %95 = getelementptr inbounds { double, double }, ptr %18, i32 0, i32 1
  %96 = extractvalue { double, double } %92, 1
  store double %96, ptr %95, align 8
  %97 = load ptr, ptr %7, align 8, !tbaa !11
  %98 = getelementptr inbounds %"struct.alglib_impl::ae_matrix", ptr %97, i32 0, i32 6
  %99 = load ptr, ptr %98, align 8, !tbaa !13
  %100 = getelementptr inbounds ptr, ptr %99, i64 0
  %101 = load ptr, ptr %100, align 8, !tbaa !11
  %102 = getelementptr inbounds %"struct.alglib_impl::ae_complex", ptr %101, i64 0
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %102, 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 %103

103:                                              ; preds = %131, %88
  %104 = load i64, ptr %10, align 8, !tbaa !5
  %105 = load i64, ptr %5, align 8, !tbaa !5
  %106 = sub nsw i64 %105, 2
  %107 = icmp sle i64 %104, %106
  br i1 %107, label %108, label %134

108:                                              ; preds = %103
  call void @llvm.lifetime.start.p0(i64 16, ptr %19) #6
  %109 = load ptr, ptr %8, align 8, !tbaa !11
  %110 = call noundef double @_ZN11alglib_impl13hqrnduniformrEPNS_10hqrndstateEPNS_8ae_stateE(ptr noundef %14, ptr noundef %109)
  %111 = load double, ptr %13, align 8, !tbaa !9
  %112 = load double, ptr %12, align 8, !tbaa !9
  %113 = fsub double %111, %112
  %114 = load double, ptr %12, align 8, !tbaa !9
  %115 = call double @llvm.fmuladd.f64(double %110, double %113, double %114)
  %116 = load ptr, ptr %8, align 8, !tbaa !11
  %117 = call noundef double @_ZN11alglib_impl6ae_expEdPNS_8ae_stateE(double noundef %115, ptr noundef %116)
  %118 = call { double, double } @_ZN11alglib_impl17ae_complex_from_dEd(double noundef %117)
  %119 = getelementptr inbounds { double, double }, ptr %19, i32 0, i32 0
  %120 = extractvalue { double, double } %118, 0
  store double %120, ptr %119, align 8
  %121 = getelementptr inbounds { double, double }, ptr %19, i32 0, i32 1
  %122 = extractvalue { double, double } %118, 1
  store double %122, ptr %121, align 8
  %123 = load ptr, ptr %7, align 8, !tbaa !11
  %124 = getelementptr inbounds %"struct.alglib_impl::ae_matrix", ptr %123, i32 0, i32 6
  %125 = load ptr, ptr %124, align 8, !tbaa !13
  %126 = load i64, ptr %10, align 8, !tbaa !5
  %127 = getelementptr inbounds ptr, ptr %125, i64 %126
  %128 = load ptr, ptr %127, align 8, !tbaa !11
  %129 = load i64, ptr %10, align 8, !tbaa !5
  %130 = getelementptr inbounds %"struct.alglib_impl::ae_complex", ptr %128, i64 %129
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %130, ptr align 8 %19, i64 16, i1 false), !tbaa.struct !14
  call void @llvm.lifetime.end.p0(i64 16, ptr %19) #6
  br label %131

131:                                              ; preds = %108
  %132 = load i64, ptr %10, align 8, !tbaa !5
  %133 = add nsw i64 %132, 1
  store i64 %133, ptr %10, align 8, !tbaa !5
  br label %103, !llvm.loop !18

134:                                              ; preds = %103
  call void @llvm.lifetime.start.p0(i64 16, ptr %20) #6
  %135 = load double, ptr %13, align 8, !tbaa !9
  %136 = load ptr, ptr %8, align 8, !tbaa !11
  %137 = call noundef double @_ZN11alglib_impl6ae_expEdPNS_8ae_stateE(double noundef %135, ptr noundef %136)
  %138 = call { double, double } @_ZN11alglib_impl17ae_complex_from_dEd(double noundef %137)
  %139 = getelementptr inbounds { double, double }, ptr %20, i32 0, i32 0
  %140 = extractvalue { double, double } %138, 0
  store double %140, ptr %139, align 8
  %141 = getelementptr inbounds { double, double }, ptr %20, i32 0, i32 1
  %142 = extractvalue { double, double } %138, 1
  store double %142, ptr %141, align 8
  %143 = load ptr, ptr %7, align 8, !tbaa !11
  %144 = getelementptr inbounds %"struct.alglib_impl::ae_matrix", ptr %143, i32 0, i32 6
  %145 = load ptr, ptr %144, align 8, !tbaa !13
  %146 = load i64, ptr %5, align 8, !tbaa !5
  %147 = sub nsw i64 %146, 1
  %148 = getelementptr inbounds ptr, ptr %145, i64 %147
  %149 = load ptr, ptr %148, align 8, !tbaa !11
  %150 = load i64, ptr %5, align 8, !tbaa !5
  %151 = sub nsw i64 %150, 1
  %152 = getelementptr inbounds %"struct.alglib_impl::ae_complex", ptr %149, i64 %151
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %152, ptr align 8 %20, i64 16, i1 false), !tbaa.struct !14
  call void @llvm.lifetime.end.p0(i64 16, ptr %20) #6
  %153 = load ptr, ptr %7, align 8, !tbaa !11
  %154 = load i64, ptr %5, align 8, !tbaa !5
  %155 = load i64, ptr %5, align 8, !tbaa !5
  %156 = load ptr, ptr %8, align 8, !tbaa !11
  call void @_ZN11alglib_impl31cmatrixrndorthogonalfromtheleftEPNS_9ae_matrixEllPNS_8ae_stateE(ptr noundef %153, i64 noundef %154, i64 noundef %155, ptr noundef %156)
  %157 = load ptr, ptr %7, align 8, !tbaa !11
  %158 = load i64, ptr %5, align 8, !tbaa !5
  %159 = load i64, ptr %5, align 8, !tbaa !5
  %160 = load ptr, ptr %8, align 8, !tbaa !11
  call void @_ZN11alglib_impl32cmatrixrndorthogonalfromtherightEPNS_9ae_matrixEllPNS_8ae_stateE(ptr noundef %157, i64 noundef %158, i64 noundef %159, ptr noundef %160)
  %161 = load ptr, ptr %8, align 8, !tbaa !11
  call void @_ZN11alglib_impl14ae_frame_leaveEPNS_8ae_stateE(ptr noundef %161)
  store i32 0, ptr %16, align 4
  br label %162

162:                                              ; preds = %134, %38
  call void @llvm.lifetime.end.p0(i64 16, ptr %15) #6
  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
  %163 = load i32, ptr %16, align 4
  switch i32 %163, label %165 [
    i32 0, label %164
    i32 1, label %164
  ]

164:                                              ; preds = %162, %162
  ret void

165:                                              ; preds = %162
  unreachable
}

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN11alglib_impl31cmatrixrndorthogonalfromtheleftEPNS_9ae_matrixEllPNS_8ae_stateE(ptr noundef, i64 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 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 void @_ZN11alglib_impl10hqrndunit2EPNS_10hqrndstateEPdS2_PNS_8ae_stateE(ptr noundef, ptr noundef, ptr 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}


; 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.223 = 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 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_impl14cmatrixrndcondEldPNS_9ae_matrixEPNS_8ae_stateE(i64 noundef %0, double noundef %1, ptr noundef %2, ptr noundef %3) local_unnamed_addr #4 {
  %5 = alloca %"struct.alglib_impl::ae_frame", align 8
  %6 = alloca %"struct.alglib_impl::hqrndstate", align 8
  %7 = alloca %"struct.alglib_impl::ae_complex", align 8
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %5) #6
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %6) #6
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %7) #6
  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)
  %8 = icmp sgt i64 %0, 0
  br i1 %8, label %9, label %11

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

11:                                               ; preds = %9, %4
  %12 = phi i1 [ false, %4 ], [ %10, %9 ]
  call void @_ZN11alglib_impl9ae_assertEbPKcPNS_8ae_stateE(i1 noundef zeroext %12, ptr noundef nonnull @.str.223, 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)
  %13 = icmp eq i64 %0, 1
  call void @_ZN11alglib_impl14hqrndrandomizeEPNS_10hqrndstateEPNS_8ae_stateE(ptr noundef nonnull %6, ptr noundef %3)
  br i1 %13, label %14, label %19

14:                                               ; preds = %11
  %15 = getelementptr inbounds i8, ptr %7, i64 8
  call void @_ZN11alglib_impl10hqrndunit2EPNS_10hqrndstateEPdS2_PNS_8ae_stateE(ptr noundef nonnull %6, ptr noundef nonnull %7, ptr noundef nonnull %15, ptr noundef %3)
  %16 = getelementptr inbounds i8, ptr %2, i64 72
  %17 = load ptr, ptr %16, align 8, !tbaa !5
  %18 = load ptr, ptr %17, align 8, !tbaa !8
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %18, ptr noundef nonnull align 8 dereferenceable(16) %7, i64 16, i1 false), !tbaa.struct !10
  br label %60

19:                                               ; preds = %11
  %20 = fdiv double 1.000000e+00, %1
  %21 = call noundef double @_ZN11alglib_impl6ae_logEdPNS_8ae_stateE(double noundef %20, ptr noundef %3)
  br i1 %8, label %.preheader.lr.ph, label %._crit_edge69

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

.preheader.us:                                    ; preds = %._crit_edge.us, %.preheader.lr.ph
  %.068.us = phi i64 [ 0, %.preheader.lr.ph ], [ %32, %._crit_edge.us ]
  br label %23

23:                                               ; preds = %.preheader.us, %23
  %.06066.us = phi i64 [ 0, %.preheader.us ], [ %31, %23 ]
  %24 = call { double, double } @_ZN11alglib_impl17ae_complex_from_iEl(i64 noundef 0)
  %25 = extractvalue { double, double } %24, 0
  %26 = extractvalue { double, double } %24, 1
  %27 = load ptr, ptr %22, align 8, !tbaa !5
  %28 = getelementptr inbounds ptr, ptr %27, i64 %.068.us
  %29 = load ptr, ptr %28, align 8, !tbaa !8
  %30 = getelementptr inbounds %"struct.alglib_impl::ae_complex", ptr %29, i64 %.06066.us
  store double %25, ptr %30, align 8, !tbaa !11
  %.sroa.46.0..sroa_idx.us = getelementptr inbounds i8, ptr %30, i64 8
  store double %26, ptr %.sroa.46.0..sroa_idx.us, align 8, !tbaa !11
  %31 = add nuw nsw i64 %.06066.us, 1
  %exitcond.not = icmp eq i64 %31, %0
  br i1 %exitcond.not, label %._crit_edge.us, label %23, !llvm.loop !13

._crit_edge.us:                                   ; preds = %23
  %32 = add nuw nsw i64 %.068.us, 1
  %exitcond72.not = icmp eq i64 %32, %0
  br i1 %exitcond72.not, label %._crit_edge69, label %.preheader.us, !llvm.loop !15

._crit_edge69:                                    ; preds = %._crit_edge.us, %19
  %33 = add i64 %0, -1
  %34 = call noundef double @_ZN11alglib_impl6ae_expEdPNS_8ae_stateE(double noundef 0.000000e+00, ptr noundef %3)
  %35 = call { double, double } @_ZN11alglib_impl17ae_complex_from_dEd(double noundef %34)
  %36 = extractvalue { double, double } %35, 0
  %37 = extractvalue { double, double } %35, 1
  %38 = getelementptr inbounds i8, ptr %2, i64 72
  %39 = load ptr, ptr %38, align 8, !tbaa !5
  %40 = load ptr, ptr %39, align 8, !tbaa !8
  store double %36, ptr %40, align 8, !tbaa !11
  %.sroa.44.0..sroa_idx = getelementptr inbounds i8, ptr %40, i64 8
  store double %37, ptr %.sroa.44.0..sroa_idx, align 8, !tbaa !11
  %.not70 = icmp slt i64 %0, 3
  br i1 %.not70, label %._crit_edge, label %.lr.ph

.lr.ph:                                           ; preds = %._crit_edge69, %.lr.ph
  %.171 = phi i64 [ %51, %.lr.ph ], [ 1, %._crit_edge69 ]
  %41 = call noundef double @_ZN11alglib_impl13hqrnduniformrEPNS_10hqrndstateEPNS_8ae_stateE(ptr noundef nonnull %6, ptr noundef %3)
  %42 = call double @llvm.fmuladd.f64(double %41, double %21, double 0.000000e+00)
  %43 = call noundef double @_ZN11alglib_impl6ae_expEdPNS_8ae_stateE(double noundef %42, ptr noundef %3)
  %44 = call { double, double } @_ZN11alglib_impl17ae_complex_from_dEd(double noundef %43)
  %45 = extractvalue { double, double } %44, 0
  %46 = extractvalue { double, double } %44, 1
  %47 = load ptr, ptr %38, align 8, !tbaa !5
  %48 = getelementptr inbounds ptr, ptr %47, i64 %.171
  %49 = load ptr, ptr %48, align 8, !tbaa !8
  %50 = getelementptr inbounds %"struct.alglib_impl::ae_complex", ptr %49, i64 %.171
  store double %45, ptr %50, align 8, !tbaa !11
  %.sroa.42.0..sroa_idx = getelementptr inbounds i8, ptr %50, i64 8
  store double %46, ptr %.sroa.42.0..sroa_idx, align 8, !tbaa !11
  %51 = add nuw i64 %.171, 1
  %exitcond73.not = icmp eq i64 %51, %33
  br i1 %exitcond73.not, label %._crit_edge, label %.lr.ph, !llvm.loop !16

._crit_edge:                                      ; preds = %.lr.ph, %._crit_edge69
  %52 = call noundef double @_ZN11alglib_impl6ae_expEdPNS_8ae_stateE(double noundef %21, ptr noundef %3)
  %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 %38, align 8, !tbaa !5
  %57 = getelementptr inbounds ptr, ptr %56, i64 %33
  %58 = load ptr, ptr %57, align 8, !tbaa !8
  %59 = getelementptr inbounds %"struct.alglib_impl::ae_complex", ptr %58, i64 %33
  store double %54, ptr %59, align 8, !tbaa !11
  %.sroa.4.0..sroa_idx = getelementptr inbounds i8, ptr %59, i64 8
  store double %55, ptr %.sroa.4.0..sroa_idx, align 8, !tbaa !11
  call void @_ZN11alglib_impl31cmatrixrndorthogonalfromtheleftEPNS_9ae_matrixEllPNS_8ae_stateE(ptr noundef nonnull %2, i64 noundef %0, i64 noundef %0, ptr noundef %3)
  call void @_ZN11alglib_impl32cmatrixrndorthogonalfromtherightEPNS_9ae_matrixEllPNS_8ae_stateE(ptr noundef nonnull %2, i64 noundef %0, i64 noundef %0, ptr noundef %3)
  br label %60

60:                                               ; preds = %._crit_edge, %14
  call void @_ZN11alglib_impl14ae_frame_leaveEPNS_8ae_stateE(ptr noundef %3)
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %7) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %6) #6
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %5) #6
  ret void
}

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

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

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) #5

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 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 void @_ZN11alglib_impl10hqrndunit2EPNS_10hqrndstateEPdS2_PNS_8ae_stateE(ptr noundef, ptr noundef, ptr 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 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 = { mustprogress 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 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C++ TBAA"}
!8 = !{!9, !9, i64 0}
!9 = !{!"any pointer", !6, i64 0}
!10 = !{i64 0, i64 8, !11, i64 8, i64 8, !11}
!11 = !{!12, !12, i64 0}
!12 = !{!"double", !6, i64 0}
!13 = distinct !{!13, !14}
!14 = !{!"llvm.loop.mustprogress"}
!15 = distinct !{!15, !14}
!16 = distinct !{!16, !14}


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