; 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::ae_vector" = type { i64, i64, i8, %"struct.alglib_impl::ae_dyn_block", %union.anon.0 }
%union.anon.0 = type { ptr }
%"struct.alglib_impl::hqrndstate" = type { i64, i64, i64 }
%"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.226 = external hidden unnamed_addr constant [46 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: mustprogress uwtable
define dso_local void @_ZN11alglib_impl32rmatrixrndorthogonalfromtherightEPNS_9ae_matrixEllPNS_8ae_stateE(ptr noundef %0, i64 noundef %1, i64 noundef %2, ptr noundef %3) #3 {
  %5 = alloca ptr, align 8
  %6 = alloca i64, align 8
  %7 = alloca i64, align 8
  %8 = alloca ptr, align 8
  %9 = alloca %"struct.alglib_impl::ae_frame", align 8
  %10 = alloca double, align 8
  %11 = alloca double, align 8
  %12 = alloca i64, align 8
  %13 = alloca i64, align 8
  %14 = alloca double, align 8
  %15 = alloca double, align 8
  %16 = alloca %"struct.alglib_impl::ae_vector", align 8
  %17 = alloca %"struct.alglib_impl::ae_vector", align 8
  %18 = alloca %"struct.alglib_impl::hqrndstate", align 8
  %19 = alloca i32, align 4
  store ptr %0, ptr %5, align 8, !tbaa !5
  store i64 %1, ptr %6, align 8, !tbaa !9
  store i64 %2, ptr %7, align 8, !tbaa !9
  store ptr %3, ptr %8, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 32, ptr %9) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #4
  call void @llvm.lifetime.start.p0(i64 64, ptr %16) #4
  call void @llvm.lifetime.start.p0(i64 64, ptr %17) #4
  call void @llvm.lifetime.start.p0(i64 24, ptr %18) #4
  %20 = load ptr, ptr %8, align 8, !tbaa !5
  call void @_ZN11alglib_impl13ae_frame_makeEPNS_8ae_stateEPNS_8ae_frameE(ptr noundef %20, ptr noundef %9)
  call void @llvm.memset.p0.i64(ptr align 8 %16, i8 0, i64 64, i1 false)
  call void @llvm.memset.p0.i64(ptr align 8 %17, i8 0, i64 64, i1 false)
  call void @llvm.memset.p0.i64(ptr align 8 %18, i8 0, i64 24, i1 false)
  %21 = load ptr, ptr %8, align 8, !tbaa !5
  call void @_ZN11alglib_impl14ae_vector_initEPNS_9ae_vectorEllPNS_8ae_stateEb(ptr noundef %16, i64 noundef 0, i64 noundef 3, ptr noundef %21, i1 noundef zeroext true)
  %22 = load ptr, ptr %8, align 8, !tbaa !5
  call void @_ZN11alglib_impl14ae_vector_initEPNS_9ae_vectorEllPNS_8ae_stateEb(ptr noundef %17, i64 noundef 0, i64 noundef 3, ptr noundef %22, i1 noundef zeroext true)
  %23 = load ptr, ptr %8, align 8, !tbaa !5
  call void @_ZN11alglib_impl16_hqrndstate_initEPvPNS_8ae_stateEb(ptr noundef %18, ptr noundef %23, i1 noundef zeroext true)
  %24 = load i64, ptr %7, align 8, !tbaa !9
  %25 = icmp sge i64 %24, 1
  br i1 %25, label %26, label %29

26:                                               ; preds = %4
  %27 = load i64, ptr %6, align 8, !tbaa !9
  %28 = icmp sge i64 %27, 1
  br label %29

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

34:                                               ; preds = %29
  %35 = load ptr, ptr %8, align 8, !tbaa !5
  %36 = call noundef i64 @_ZN11alglib_impl16ae_randomintegerElPNS_8ae_stateE(i64 noundef 2, ptr noundef %35)
  %37 = mul nsw i64 2, %36
  %38 = sub nsw i64 %37, 1
  %39 = sitofp i64 %38 to double
  store double %39, ptr %10, align 8, !tbaa !11
  store i64 0, ptr %13, align 8, !tbaa !9
  br label %40

40:                                               ; preds = %63, %34
  %41 = load i64, ptr %13, align 8, !tbaa !9
  %42 = load i64, ptr %6, align 8, !tbaa !9
  %43 = sub nsw i64 %42, 1
  %44 = icmp sle i64 %41, %43
  br i1 %44, label %45, label %66

45:                                               ; preds = %40
  %46 = load ptr, ptr %5, align 8, !tbaa !5
  %47 = getelementptr inbounds %"struct.alglib_impl::ae_matrix", ptr %46, i32 0, i32 6
  %48 = load ptr, ptr %47, align 8, !tbaa !13
  %49 = load i64, ptr %13, align 8, !tbaa !9
  %50 = getelementptr inbounds ptr, ptr %48, i64 %49
  %51 = load ptr, ptr %50, align 8, !tbaa !5
  %52 = getelementptr inbounds double, ptr %51, i64 0
  %53 = load double, ptr %52, align 8, !tbaa !11
  %54 = load double, ptr %10, align 8, !tbaa !11
  %55 = fmul double %53, %54
  %56 = load ptr, ptr %5, align 8, !tbaa !5
  %57 = getelementptr inbounds %"struct.alglib_impl::ae_matrix", ptr %56, i32 0, i32 6
  %58 = load ptr, ptr %57, align 8, !tbaa !13
  %59 = load i64, ptr %13, align 8, !tbaa !9
  %60 = getelementptr inbounds ptr, ptr %58, i64 %59
  %61 = load ptr, ptr %60, align 8, !tbaa !5
  %62 = getelementptr inbounds double, ptr %61, i64 0
  store double %55, ptr %62, align 8, !tbaa !11
  br label %63

63:                                               ; preds = %45
  %64 = load i64, ptr %13, align 8, !tbaa !9
  %65 = add nsw i64 %64, 1
  store i64 %65, ptr %13, align 8, !tbaa !9
  br label %40, !llvm.loop !14

66:                                               ; preds = %40
  %67 = load ptr, ptr %8, align 8, !tbaa !5
  call void @_ZN11alglib_impl14ae_frame_leaveEPNS_8ae_stateE(ptr noundef %67)
  store i32 1, ptr %19, align 4
  br label %169

68:                                               ; preds = %29
  %69 = load i64, ptr %6, align 8, !tbaa !9
  %70 = load ptr, ptr %8, align 8, !tbaa !5
  call void @_ZN11alglib_impl20ae_vector_set_lengthEPNS_9ae_vectorElPNS_8ae_stateE(ptr noundef %16, i64 noundef %69, ptr noundef %70)
  %71 = load i64, ptr %7, align 8, !tbaa !9
  %72 = add nsw i64 %71, 1
  %73 = load ptr, ptr %8, align 8, !tbaa !5
  call void @_ZN11alglib_impl20ae_vector_set_lengthEPNS_9ae_vectorElPNS_8ae_stateE(ptr noundef %17, i64 noundef %72, ptr noundef %73)
  %74 = load ptr, ptr %8, align 8, !tbaa !5
  call void @_ZN11alglib_impl14hqrndrandomizeEPNS_10hqrndstateEPNS_8ae_stateE(ptr noundef %18, ptr noundef %74)
  store i64 2, ptr %12, align 8, !tbaa !9
  br label %75

75:                                               ; preds = %135, %68
  %76 = load i64, ptr %12, align 8, !tbaa !9
  %77 = load i64, ptr %7, align 8, !tbaa !9
  %78 = icmp sle i64 %76, %77
  br i1 %78, label %79, label %138

79:                                               ; preds = %75
  br label %80

80:                                               ; preds = %116, %79
  store i64 1, ptr %13, align 8, !tbaa !9
  br label %81

81:                                               ; preds = %103, %80
  %82 = load i64, ptr %13, align 8, !tbaa !9
  %83 = load i64, ptr %12, align 8, !tbaa !9
  %84 = icmp sle i64 %82, %83
  br i1 %84, label %85, label %106

85:                                               ; preds = %81
  %86 = load ptr, ptr %8, align 8, !tbaa !5
  call void @_ZN11alglib_impl12hqrndnormal2EPNS_10hqrndstateEPdS2_PNS_8ae_stateE(ptr noundef %18, ptr noundef %14, ptr noundef %15, ptr noundef %86)
  %87 = load double, ptr %14, align 8, !tbaa !11
  %88 = getelementptr inbounds %"struct.alglib_impl::ae_vector", ptr %17, i32 0, i32 4
  %89 = load ptr, ptr %88, align 8, !tbaa !13
  %90 = load i64, ptr %13, align 8, !tbaa !9
  %91 = getelementptr inbounds double, ptr %89, i64 %90
  store double %87, ptr %91, align 8, !tbaa !11
  %92 = load i64, ptr %13, align 8, !tbaa !9
  %93 = add nsw i64 %92, 1
  %94 = load i64, ptr %12, align 8, !tbaa !9
  %95 = icmp sle i64 %93, %94
  br i1 %95, label %96, label %103

96:                                               ; preds = %85
  %97 = load double, ptr %15, align 8, !tbaa !11
  %98 = getelementptr inbounds %"struct.alglib_impl::ae_vector", ptr %17, i32 0, i32 4
  %99 = load ptr, ptr %98, align 8, !tbaa !13
  %100 = load i64, ptr %13, align 8, !tbaa !9
  %101 = add nsw i64 %100, 1
  %102 = getelementptr inbounds double, ptr %99, i64 %101
  store double %97, ptr %102, align 8, !tbaa !11
  br label %103

103:                                              ; preds = %96, %85
  %104 = load i64, ptr %13, align 8, !tbaa !9
  %105 = add nsw i64 %104, 2
  store i64 %105, ptr %13, align 8, !tbaa !9
  br label %81, !llvm.loop !16

106:                                              ; preds = %81
  %107 = getelementptr inbounds %"struct.alglib_impl::ae_vector", ptr %17, i32 0, i32 4
  %108 = load ptr, ptr %107, align 8, !tbaa !13
  %109 = getelementptr inbounds double, ptr %108, i64 1
  %110 = getelementptr inbounds %"struct.alglib_impl::ae_vector", ptr %17, i32 0, i32 4
  %111 = load ptr, ptr %110, align 8, !tbaa !13
  %112 = getelementptr inbounds double, ptr %111, i64 1
  %113 = load i64, ptr %12, align 8, !tbaa !9
  %114 = call noundef i64 @_ZN11alglib_impl8ae_v_lenEll(i64 noundef 1, i64 noundef %113)
  %115 = call noundef double @_ZN11alglib_impl15ae_v_dotproductEPKdlS1_ll(ptr noundef %109, i64 noundef 1, ptr noundef %112, i64 noundef 1, i64 noundef %114)
  store double %115, ptr %11, align 8, !tbaa !11
  br label %116

116:                                              ; preds = %106
  %117 = load double, ptr %11, align 8, !tbaa !11
  %118 = call noundef zeroext i1 @_ZN11alglib_impl8ae_fp_eqEdd(double noundef %117, double noundef 0.000000e+00)
  br i1 %118, label %80, label %119, !llvm.loop !17

119:                                              ; preds = %116
  %120 = load i64, ptr %12, align 8, !tbaa !9
  %121 = load ptr, ptr %8, align 8, !tbaa !5
  call void @_ZN11alglib_impl18generatereflectionEPNS_9ae_vectorElPdPNS_8ae_stateE(ptr noundef %17, i64 noundef %120, ptr noundef %10, ptr noundef %121)
  %122 = getelementptr inbounds %"struct.alglib_impl::ae_vector", ptr %17, i32 0, i32 4
  %123 = load ptr, ptr %122, align 8, !tbaa !13
  %124 = getelementptr inbounds double, ptr %123, i64 1
  store double 1.000000e+00, ptr %124, align 8, !tbaa !11
  %125 = load ptr, ptr %5, align 8, !tbaa !5
  %126 = load double, ptr %10, align 8, !tbaa !11
  %127 = load i64, ptr %6, align 8, !tbaa !9
  %128 = sub nsw i64 %127, 1
  %129 = load i64, ptr %7, align 8, !tbaa !9
  %130 = load i64, ptr %12, align 8, !tbaa !9
  %131 = sub nsw i64 %129, %130
  %132 = load i64, ptr %7, align 8, !tbaa !9
  %133 = sub nsw i64 %132, 1
  %134 = load ptr, ptr %8, align 8, !tbaa !5
  call void @_ZN11alglib_impl27applyreflectionfromtherightEPNS_9ae_matrixEdPNS_9ae_vectorEllllS3_PNS_8ae_stateE(ptr noundef %125, double noundef %126, ptr noundef %17, i64 noundef 0, i64 noundef %128, i64 noundef %131, i64 noundef %133, ptr noundef %16, ptr noundef %134)
  br label %135

135:                                              ; preds = %119
  %136 = load i64, ptr %12, align 8, !tbaa !9
  %137 = add nsw i64 %136, 1
  store i64 %137, ptr %12, align 8, !tbaa !9
  br label %75, !llvm.loop !18

138:                                              ; preds = %75
  store i64 0, ptr %13, align 8, !tbaa !9
  br label %139

139:                                              ; preds = %164, %138
  %140 = load i64, ptr %13, align 8, !tbaa !9
  %141 = load i64, ptr %7, align 8, !tbaa !9
  %142 = sub nsw i64 %141, 1
  %143 = icmp sle i64 %140, %142
  br i1 %143, label %144, label %167

144:                                              ; preds = %139
  %145 = load ptr, ptr %8, align 8, !tbaa !5
  %146 = call noundef i64 @_ZN11alglib_impl13hqrnduniformiEPNS_10hqrndstateElPNS_8ae_stateE(ptr noundef %18, i64 noundef 2, ptr noundef %145)
  %147 = mul nsw i64 2, %146
  %148 = sub nsw i64 %147, 1
  %149 = sitofp i64 %148 to double
  store double %149, ptr %10, align 8, !tbaa !11
  %150 = load ptr, ptr %5, align 8, !tbaa !5
  %151 = getelementptr inbounds %"struct.alglib_impl::ae_matrix", ptr %150, i32 0, i32 6
  %152 = load ptr, ptr %151, align 8, !tbaa !13
  %153 = getelementptr inbounds ptr, ptr %152, i64 0
  %154 = load ptr, ptr %153, align 8, !tbaa !5
  %155 = load i64, ptr %13, align 8, !tbaa !9
  %156 = getelementptr inbounds double, ptr %154, i64 %155
  %157 = load ptr, ptr %5, align 8, !tbaa !5
  %158 = getelementptr inbounds %"struct.alglib_impl::ae_matrix", ptr %157, i32 0, i32 2
  %159 = load i64, ptr %158, align 8, !tbaa !19
  %160 = load i64, ptr %6, align 8, !tbaa !9
  %161 = sub nsw i64 %160, 1
  %162 = call noundef i64 @_ZN11alglib_impl8ae_v_lenEll(i64 noundef 0, i64 noundef %161)
  %163 = load double, ptr %10, align 8, !tbaa !11
  call void @_ZN11alglib_impl9ae_v_muldEPdlld(ptr noundef %156, i64 noundef %159, i64 noundef %162, double noundef %163)
  br label %164

164:                                              ; preds = %144
  %165 = load i64, ptr %13, align 8, !tbaa !9
  %166 = add nsw i64 %165, 1
  store i64 %166, ptr %13, align 8, !tbaa !9
  br label %139, !llvm.loop !23

167:                                              ; preds = %139
  %168 = load ptr, ptr %8, align 8, !tbaa !5
  call void @_ZN11alglib_impl14ae_frame_leaveEPNS_8ae_stateE(ptr noundef %168)
  store i32 0, ptr %19, align 4
  br label %169

169:                                              ; preds = %167, %66
  call void @llvm.lifetime.end.p0(i64 24, ptr %18) #4
  call void @llvm.lifetime.end.p0(i64 64, ptr %17) #4
  call void @llvm.lifetime.end.p0(i64 64, ptr %16) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #4
  call void @llvm.lifetime.end.p0(i64 32, ptr %9) #4
  %170 = load i32, ptr %19, align 4
  switch i32 %170, label %172 [
    i32 0, label %171
    i32 1, label %171
  ]

171:                                              ; preds = %169, %169
  ret void

172:                                              ; preds = %169
  unreachable
}

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

declare noundef double @_ZN11alglib_impl15ae_v_dotproductEPKdlS1_ll(ptr noundef, i64 noundef, ptr noundef, i64 noundef, i64 noundef) #2

declare noundef i64 @_ZN11alglib_impl8ae_v_lenEll(i64 noundef, i64 noundef) #2

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

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

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

declare void @_ZN11alglib_impl14ae_frame_leaveEPNS_8ae_stateE(ptr noundef) #2

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

declare void @_ZN11alglib_impl9ae_v_muldEPdlld(ptr noundef, i64 noundef, i64 noundef, double noundef) #2

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

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 i64 @_ZN11alglib_impl13hqrnduniformiEPNS_10hqrndstateElPNS_8ae_stateE(ptr noundef, i64 noundef, ptr noundef) #2

declare void @_ZN11alglib_impl12hqrndnormal2EPNS_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 = { 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 = { nounwind }

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"long", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"double", !7, i64 0}
!13 = !{!7, !7, i64 0}
!14 = distinct !{!14, !15}
!15 = !{!"llvm.loop.mustprogress"}
!16 = distinct !{!16, !15}
!17 = distinct !{!17, !15}
!18 = distinct !{!18, !15}
!19 = !{!20, !10, i64 16}
!20 = !{!"_ZTSN11alglib_impl9ae_matrixE", !10, i64 0, !10, i64 8, !10, i64 16, !10, i64 24, !21, i64 32, !22, i64 40, !7, i64 72}
!21 = !{!"bool", !7, i64 0}
!22 = !{!"_ZTSN11alglib_impl12ae_dyn_blockE", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24}
!23 = distinct !{!23, !15}


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

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

@.str.226 = external hidden unnamed_addr constant [46 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_impl32rmatrixrndorthogonalfromtherightEPNS_9ae_matrixEllPNS_8ae_stateE(ptr noundef %0, i64 noundef %1, i64 noundef %2, ptr noundef %3) local_unnamed_addr #3 {
  %5 = alloca %"struct.alglib_impl::ae_frame", align 8
  %6 = alloca double, align 8
  %7 = alloca double, align 8
  %8 = alloca double, align 8
  %9 = alloca %"struct.alglib_impl::ae_vector", align 8
  %10 = alloca %"struct.alglib_impl::ae_vector", align 8
  %11 = alloca %"struct.alglib_impl::hqrndstate", align 8
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %5) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %7) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %8) #4
  call void @llvm.lifetime.start.p0(i64 64, ptr nonnull %9) #4
  call void @llvm.lifetime.start.p0(i64 64, ptr nonnull %10) #4
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %11) #4
  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(64) %9, i8 0, i64 64, i1 false)
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(64) %10, i8 0, i64 64, i1 false)
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(24) %11, i8 0, i64 24, i1 false)
  call void @_ZN11alglib_impl14ae_vector_initEPNS_9ae_vectorEllPNS_8ae_stateEb(ptr noundef nonnull %9, i64 noundef 0, i64 noundef 3, ptr noundef %3, i1 noundef zeroext true)
  call void @_ZN11alglib_impl14ae_vector_initEPNS_9ae_vectorEllPNS_8ae_stateEb(ptr noundef nonnull %10, i64 noundef 0, i64 noundef 3, ptr noundef %3, i1 noundef zeroext true)
  call void @_ZN11alglib_impl16_hqrndstate_initEPvPNS_8ae_stateEb(ptr noundef nonnull %11, ptr noundef %3, i1 noundef zeroext true)
  %12 = icmp sgt i64 %2, 0
  %13 = icmp sgt i64 %1, 0
  %14 = and i1 %13, %12
  call void @_ZN11alglib_impl9ae_assertEbPKcPNS_8ae_stateE(i1 noundef zeroext %14, ptr noundef nonnull @.str.226, ptr noundef %3)
  %15 = icmp eq i64 %2, 1
  br i1 %15, label %16, label %48

16:                                               ; preds = %4
  %17 = call noundef i64 @_ZN11alglib_impl16ae_randomintegerElPNS_8ae_stateE(i64 noundef 2, ptr noundef %3)
  %18 = shl nsw i64 %17, 1
  %19 = add nsw i64 %18, -1
  %20 = sitofp i64 %19 to double
  br i1 %13, label %.lr.ph67, label %._crit_edge68

.lr.ph67:                                         ; preds = %16
  %21 = getelementptr inbounds i8, ptr %0, i64 72
  %xtraiter = and i64 %1, 3
  %22 = icmp ult i64 %1, 4
  br i1 %22, label %._crit_edge68.loopexit.unr-lcssa, label %.lr.ph67.new

.lr.ph67.new:                                     ; preds = %.lr.ph67
  %unroll_iter = and i64 %1, 9223372036854775804
  br label %23

23:                                               ; preds = %23, %.lr.ph67.new
  %.065 = phi i64 [ 0, %.lr.ph67.new ], [ %47, %23 ]
  %niter = phi i64 [ 0, %.lr.ph67.new ], [ %niter.next.3, %23 ]
  %24 = load ptr, ptr %21, align 8, !tbaa !5
  %25 = getelementptr inbounds ptr, ptr %24, i64 %.065
  %26 = load ptr, ptr %25, align 8, !tbaa !8
  %27 = load double, ptr %26, align 8, !tbaa !10
  %28 = fmul double %27, %20
  store double %28, ptr %26, align 8, !tbaa !10
  %29 = or disjoint i64 %.065, 1
  %30 = load ptr, ptr %21, align 8, !tbaa !5
  %31 = getelementptr inbounds ptr, ptr %30, i64 %29
  %32 = load ptr, ptr %31, align 8, !tbaa !8
  %33 = load double, ptr %32, align 8, !tbaa !10
  %34 = fmul double %33, %20
  store double %34, ptr %32, align 8, !tbaa !10
  %35 = or disjoint i64 %.065, 2
  %36 = load ptr, ptr %21, align 8, !tbaa !5
  %37 = getelementptr inbounds ptr, ptr %36, i64 %35
  %38 = load ptr, ptr %37, align 8, !tbaa !8
  %39 = load double, ptr %38, align 8, !tbaa !10
  %40 = fmul double %39, %20
  store double %40, ptr %38, align 8, !tbaa !10
  %41 = or disjoint i64 %.065, 3
  %42 = load ptr, ptr %21, align 8, !tbaa !5
  %43 = getelementptr inbounds ptr, ptr %42, i64 %41
  %44 = load ptr, ptr %43, align 8, !tbaa !8
  %45 = load double, ptr %44, align 8, !tbaa !10
  %46 = fmul double %45, %20
  store double %46, ptr %44, align 8, !tbaa !10
  %47 = add nuw nsw i64 %.065, 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_edge68.loopexit.unr-lcssa, label %23, !llvm.loop !12

48:                                               ; preds = %4
  call void @_ZN11alglib_impl20ae_vector_set_lengthEPNS_9ae_vectorElPNS_8ae_stateE(ptr noundef nonnull %9, i64 noundef %1, ptr noundef %3)
  %49 = add i64 %2, 1
  call void @_ZN11alglib_impl20ae_vector_set_lengthEPNS_9ae_vectorElPNS_8ae_stateE(ptr noundef nonnull %10, i64 noundef %49, ptr noundef %3)
  call void @_ZN11alglib_impl14hqrndrandomizeEPNS_10hqrndstateEPNS_8ae_stateE(ptr noundef nonnull %11, ptr noundef %3)
  %.not60 = icmp slt i64 %2, 2
  br i1 %.not60, label %._crit_edge68, label %.preheader58.lr.ph

.preheader58.lr.ph:                               ; preds = %48
  %50 = getelementptr inbounds i8, ptr %10, i64 56
  %51 = add nsw i64 %1, -1
  %52 = add nsw i64 %2, -1
  br label %.preheader58

.preheader58:                                     ; preds = %.preheader58.lr.ph, %73
  %.05161 = phi i64 [ 2, %.preheader58.lr.ph ], [ %78, %73 ]
  br label %56

.preheader:                                       ; preds = %73
  br i1 %12, label %.lr.ph, label %._crit_edge68

.lr.ph:                                           ; preds = %.preheader
  %53 = getelementptr inbounds i8, ptr %0, i64 72
  %54 = getelementptr inbounds i8, ptr %0, i64 16
  %55 = add nsw i64 %1, -1
  br label %79

56:                                               ; preds = %.backedge, %.preheader58
  %.159 = phi i64 [ 1, %.preheader58 ], [ %.159.be, %.backedge ]
  call void @_ZN11alglib_impl12hqrndnormal2EPNS_10hqrndstateEPdS2_PNS_8ae_stateE(ptr noundef nonnull %11, ptr noundef nonnull %7, ptr noundef nonnull %8, ptr noundef %3)
  %57 = load double, ptr %7, align 8, !tbaa !10
  %58 = load ptr, ptr %50, align 8, !tbaa !5
  %59 = getelementptr inbounds double, ptr %58, i64 %.159
  store double %57, ptr %59, align 8, !tbaa !10
  %.not56.not = icmp ult i64 %.159, %.05161
  br i1 %.not56.not, label %60, label %65

60:                                               ; preds = %56
  %61 = load double, ptr %8, align 8, !tbaa !10
  %62 = load ptr, ptr %50, align 8, !tbaa !5
  %63 = getelementptr inbounds double, ptr %62, i64 %.159
  %64 = getelementptr inbounds i8, ptr %63, i64 8
  store double %61, ptr %64, align 8, !tbaa !10
  br label %65

65:                                               ; preds = %60, %56
  %66 = add nuw nsw i64 %.159, 2
  %.not55 = icmp ugt i64 %66, %.05161
  br i1 %.not55, label %67, label %.backedge

.backedge:                                        ; preds = %65, %67
  %.159.be = phi i64 [ %66, %65 ], [ 1, %67 ]
  br label %56, !llvm.loop !14

67:                                               ; preds = %65
  %68 = load ptr, ptr %50, align 8, !tbaa !5
  %69 = getelementptr inbounds i8, ptr %68, i64 8
  %70 = call noundef i64 @_ZN11alglib_impl8ae_v_lenEll(i64 noundef 1, i64 noundef %.05161)
  %71 = call noundef double @_ZN11alglib_impl15ae_v_dotproductEPKdlS1_ll(ptr noundef nonnull %69, i64 noundef 1, ptr noundef nonnull %69, i64 noundef 1, i64 noundef %70)
  %72 = call noundef zeroext i1 @_ZN11alglib_impl8ae_fp_eqEdd(double noundef %71, double noundef 0.000000e+00)
  br i1 %72, label %.backedge, label %73

73:                                               ; preds = %67
  call void @_ZN11alglib_impl18generatereflectionEPNS_9ae_vectorElPdPNS_8ae_stateE(ptr noundef nonnull %10, i64 noundef %.05161, ptr noundef nonnull %6, ptr noundef %3)
  %74 = load ptr, ptr %50, align 8, !tbaa !5
  %75 = getelementptr inbounds i8, ptr %74, i64 8
  store double 1.000000e+00, ptr %75, align 8, !tbaa !10
  %76 = load double, ptr %6, align 8, !tbaa !10
  %77 = sub nsw i64 %2, %.05161
  call void @_ZN11alglib_impl27applyreflectionfromtherightEPNS_9ae_matrixEdPNS_9ae_vectorEllllS3_PNS_8ae_stateE(ptr noundef %0, double noundef %76, ptr noundef nonnull %10, i64 noundef 0, i64 noundef %51, i64 noundef %77, i64 noundef %52, ptr noundef nonnull %9, ptr noundef %3)
  %78 = add nuw i64 %.05161, 1
  %exitcond.not = icmp eq i64 %.05161, %2
  br i1 %exitcond.not, label %.preheader, label %.preheader58, !llvm.loop !15

79:                                               ; preds = %.lr.ph, %79
  %.263 = phi i64 [ 0, %.lr.ph ], [ %90, %79 ]
  %80 = call noundef i64 @_ZN11alglib_impl13hqrnduniformiEPNS_10hqrndstateElPNS_8ae_stateE(ptr noundef nonnull %11, i64 noundef 2, ptr noundef %3)
  %81 = shl nsw i64 %80, 1
  %82 = add nsw i64 %81, -1
  %83 = sitofp i64 %82 to double
  store double %83, ptr %6, align 8, !tbaa !10
  %84 = load ptr, ptr %53, align 8, !tbaa !5
  %85 = load ptr, ptr %84, align 8, !tbaa !8
  %86 = getelementptr inbounds double, ptr %85, i64 %.263
  %87 = load i64, ptr %54, align 8, !tbaa !16
  %88 = call noundef i64 @_ZN11alglib_impl8ae_v_lenEll(i64 noundef 0, i64 noundef %55)
  %89 = load double, ptr %6, align 8, !tbaa !10
  call void @_ZN11alglib_impl9ae_v_muldEPdlld(ptr noundef %86, i64 noundef %87, i64 noundef %88, double noundef %89)
  %90 = add nuw nsw i64 %.263, 1
  %exitcond69.not = icmp eq i64 %90, %2
  br i1 %exitcond69.not, label %._crit_edge68, label %79, !llvm.loop !21

._crit_edge68.loopexit.unr-lcssa:                 ; preds = %23, %.lr.ph67
  %.065.unr = phi i64 [ 0, %.lr.ph67 ], [ %47, %23 ]
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br i1 %lcmp.mod.not, label %._crit_edge68, label %.epil.preheader

.epil.preheader:                                  ; preds = %._crit_edge68.loopexit.unr-lcssa, %.epil.preheader
  %.065.epil = phi i64 [ %96, %.epil.preheader ], [ %.065.unr, %._crit_edge68.loopexit.unr-lcssa ]
  %epil.iter = phi i64 [ %epil.iter.next, %.epil.preheader ], [ 0, %._crit_edge68.loopexit.unr-lcssa ]
  %91 = load ptr, ptr %21, align 8, !tbaa !5
  %92 = getelementptr inbounds ptr, ptr %91, i64 %.065.epil
  %93 = load ptr, ptr %92, align 8, !tbaa !8
  %94 = load double, ptr %93, align 8, !tbaa !10
  %95 = fmul double %94, %20
  store double %95, ptr %93, align 8, !tbaa !10
  %96 = add nuw nsw i64 %.065.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_edge68, label %.epil.preheader, !llvm.loop !22

._crit_edge68:                                    ; preds = %79, %._crit_edge68.loopexit.unr-lcssa, %.epil.preheader, %.preheader, %48, %16
  call void @_ZN11alglib_impl14ae_frame_leaveEPNS_8ae_stateE(ptr noundef %3)
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %11) #4
  call void @llvm.lifetime.end.p0(i64 64, ptr nonnull %10) #4
  call void @llvm.lifetime.end.p0(i64 64, ptr nonnull %9) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #4
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %5) #4
  ret void
}

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

declare noundef double @_ZN11alglib_impl15ae_v_dotproductEPKdlS1_ll(ptr noundef, i64 noundef, ptr noundef, i64 noundef, i64 noundef) local_unnamed_addr #2

declare noundef i64 @_ZN11alglib_impl8ae_v_lenEll(i64 noundef, i64 noundef) local_unnamed_addr #2

declare void @_ZN11alglib_impl13ae_frame_makeEPNS_8ae_stateEPNS_8ae_frameE(ptr noundef, ptr noundef) local_unnamed_addr #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 #2

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

declare void @_ZN11alglib_impl14ae_frame_leaveEPNS_8ae_stateE(ptr noundef) local_unnamed_addr #2

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

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

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

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 i64 @_ZN11alglib_impl13hqrnduniformiEPNS_10hqrndstateElPNS_8ae_stateE(ptr noundef, i64 noundef, ptr noundef) local_unnamed_addr #2

declare void @_ZN11alglib_impl12hqrndnormal2EPNS_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 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 = { 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, !18, i64 16}
!17 = !{!"_ZTSN11alglib_impl9ae_matrixE", !18, i64 0, !18, i64 8, !18, i64 16, !18, i64 24, !19, i64 32, !20, i64 40, !6, i64 72}
!18 = !{!"long", !6, i64 0}
!19 = !{!"bool", !6, i64 0}
!20 = !{!"_ZTSN11alglib_impl12ae_dyn_blockE", !9, i64 0, !9, i64 8, !9, i64 16, !9, i64 24}
!21 = distinct !{!21, !13}
!22 = distinct !{!22, !23}
!23 = !{!"llvm.loop.unroll.disable"}


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