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

; 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::multilayerperceptron" = type { i64, i64, %"struct.alglib_impl::ae_vector", %"struct.alglib_impl::ae_vector", %"struct.alglib_impl::ae_vector", %"struct.alglib_impl::ae_vector", %"struct.alglib_impl::ae_vector", %"struct.alglib_impl::ae_vector", %"struct.alglib_impl::ae_vector", %"struct.alglib_impl::ae_vector", %"struct.alglib_impl::ae_vector", %"struct.alglib_impl::ae_vector", %"struct.alglib_impl::ae_vector", %"struct.alglib_impl::ae_vector", %"struct.alglib_impl::ae_matrix", %"struct.alglib_impl::ae_vector", %"struct.alglib_impl::ae_vector", %"struct.alglib_impl::ae_vector", %"struct.alglib_impl::modelerrors", %"struct.alglib_impl::ae_vector", %"struct.alglib_impl::ae_shared_pool", %"struct.alglib_impl::ae_shared_pool", %"struct.alglib_impl::ae_matrix", %"struct.alglib_impl::sparsematrix", %"struct.alglib_impl::ae_vector", %"struct.alglib_impl::ae_shared_pool" }
%"struct.alglib_impl::modelerrors" = type { double, double, double, double, double }
%"struct.alglib_impl::ae_matrix" = type { i64, i64, i64, i64, i8, %"struct.alglib_impl::ae_dyn_block", %union.anon.0 }
%"struct.alglib_impl::ae_dyn_block" = type { ptr, ptr, ptr, ptr }
%union.anon.0 = type { ptr }
%"struct.alglib_impl::sparsematrix" = type { %"struct.alglib_impl::ae_vector", %"struct.alglib_impl::ae_vector", %"struct.alglib_impl::ae_vector", %"struct.alglib_impl::ae_vector", %"struct.alglib_impl::ae_vector", i64, i64, i64, i64, i64, i64 }
%"struct.alglib_impl::ae_vector" = type { i64, i64, i8, %"struct.alglib_impl::ae_dyn_block", %union.anon.1 }
%union.anon.1 = type { ptr }
%"struct.alglib_impl::ae_shared_pool" = type { %"struct.alglib_impl::ae_lock", ptr, ptr, ptr, ptr, i64, ptr, ptr, ptr, %"struct.alglib_impl::ae_dyn_block" }
%"struct.alglib_impl::ae_lock" = type { ptr, %"struct.alglib_impl::ae_dyn_block", i8 }

@.str.209 = external hidden unnamed_addr constant [51 x i8], align 1
@.str.210 = external hidden unnamed_addr constant [56 x i8], align 1
@.str.211 = external hidden unnamed_addr constant [57 x i8], align 1
@.str.212 = external hidden unnamed_addr constant [60 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 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) #1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZN11alglib_impl17mlpgetinputscountEPNS_20multilayerperceptronEPNS_8ae_stateE(ptr noundef, ptr noundef) #2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZN11alglib_impl18mlpgetoutputscountEPNS_20multilayerperceptronEPNS_8ae_stateE(ptr noundef, ptr noundef) #2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZN11alglib_impl12mlpissoftmaxEPNS_20multilayerperceptronEPNS_8ae_stateE(ptr noundef, ptr noundef) #2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN11alglib_impl24mlpallerrorssparsesubsetEPNS_20multilayerperceptronEPNS_12sparsematrixElPNS_9ae_vectorElPNS_11modelerrorsEPNS_8ae_stateE(ptr noundef %0, ptr noundef %1, i64 noundef %2, ptr noundef %3, i64 noundef %4, ptr noundef %5, ptr noundef %6) #3 {
  %8 = alloca ptr, align 8
  %9 = alloca ptr, align 8
  %10 = alloca i64, align 8
  %11 = alloca ptr, align 8
  %12 = alloca i64, align 8
  %13 = alloca ptr, align 8
  %14 = alloca ptr, align 8
  %15 = alloca i64, align 8
  %16 = alloca i64, align 8
  %17 = alloca i64, align 8
  store ptr %0, ptr %8, align 8, !tbaa !5
  store ptr %1, ptr %9, align 8, !tbaa !5
  store i64 %2, ptr %10, align 8, !tbaa !9
  store ptr %3, ptr %11, align 8, !tbaa !5
  store i64 %4, ptr %12, align 8, !tbaa !9
  store ptr %5, ptr %13, align 8, !tbaa !5
  store ptr %6, ptr %14, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #4
  %18 = load ptr, ptr %13, align 8, !tbaa !5
  call void @_ZN11alglib_impl18_modelerrors_clearEPv(ptr noundef %18)
  %19 = load ptr, ptr %9, align 8, !tbaa !5
  %20 = load ptr, ptr %14, align 8, !tbaa !5
  %21 = call noundef zeroext i1 @_ZN11alglib_impl11sparseiscrsEPNS_12sparsematrixEPNS_8ae_stateE(ptr noundef %19, ptr noundef %20)
  %22 = load ptr, ptr %14, align 8, !tbaa !5
  call void @_ZN11alglib_impl9ae_assertEbPKcPNS_8ae_stateE(i1 noundef zeroext %21, ptr noundef @.str.209, ptr noundef %22)
  %23 = load ptr, ptr %9, align 8, !tbaa !5
  %24 = load ptr, ptr %14, align 8, !tbaa !5
  %25 = call noundef i64 @_ZN11alglib_impl14sparsegetnrowsEPNS_12sparsematrixEPNS_8ae_stateE(ptr noundef %23, ptr noundef %24)
  %26 = load i64, ptr %10, align 8, !tbaa !9
  %27 = icmp sge i64 %25, %26
  %28 = load ptr, ptr %14, align 8, !tbaa !5
  call void @_ZN11alglib_impl9ae_assertEbPKcPNS_8ae_stateE(i1 noundef zeroext %27, ptr noundef @.str.210, ptr noundef %28)
  %29 = load i64, ptr %10, align 8, !tbaa !9
  %30 = icmp sgt i64 %29, 0
  br i1 %30, label %31, label %59

31:                                               ; preds = %7
  %32 = load ptr, ptr %8, align 8, !tbaa !5
  %33 = load ptr, ptr %14, align 8, !tbaa !5
  %34 = call noundef zeroext i1 @_ZN11alglib_impl12mlpissoftmaxEPNS_20multilayerperceptronEPNS_8ae_stateE(ptr noundef %32, ptr noundef %33)
  br i1 %34, label %35, label %45

35:                                               ; preds = %31
  %36 = load ptr, ptr %9, align 8, !tbaa !5
  %37 = load ptr, ptr %14, align 8, !tbaa !5
  %38 = call noundef i64 @_ZN11alglib_impl14sparsegetncolsEPNS_12sparsematrixEPNS_8ae_stateE(ptr noundef %36, ptr noundef %37)
  %39 = load ptr, ptr %8, align 8, !tbaa !5
  %40 = load ptr, ptr %14, align 8, !tbaa !5
  %41 = call noundef i64 @_ZN11alglib_impl17mlpgetinputscountEPNS_20multilayerperceptronEPNS_8ae_stateE(ptr noundef %39, ptr noundef %40)
  %42 = add nsw i64 %41, 1
  %43 = icmp sge i64 %38, %42
  %44 = load ptr, ptr %14, align 8, !tbaa !5
  call void @_ZN11alglib_impl9ae_assertEbPKcPNS_8ae_stateE(i1 noundef zeroext %43, ptr noundef @.str.211, ptr noundef %44)
  br label %58

45:                                               ; preds = %31
  %46 = load ptr, ptr %9, align 8, !tbaa !5
  %47 = load ptr, ptr %14, align 8, !tbaa !5
  %48 = call noundef i64 @_ZN11alglib_impl14sparsegetncolsEPNS_12sparsematrixEPNS_8ae_stateE(ptr noundef %46, ptr noundef %47)
  %49 = load ptr, ptr %8, align 8, !tbaa !5
  %50 = load ptr, ptr %14, align 8, !tbaa !5
  %51 = call noundef i64 @_ZN11alglib_impl17mlpgetinputscountEPNS_20multilayerperceptronEPNS_8ae_stateE(ptr noundef %49, ptr noundef %50)
  %52 = load ptr, ptr %8, align 8, !tbaa !5
  %53 = load ptr, ptr %14, align 8, !tbaa !5
  %54 = call noundef i64 @_ZN11alglib_impl18mlpgetoutputscountEPNS_20multilayerperceptronEPNS_8ae_stateE(ptr noundef %52, ptr noundef %53)
  %55 = add nsw i64 %51, %54
  %56 = icmp sge i64 %48, %55
  %57 = load ptr, ptr %14, align 8, !tbaa !5
  call void @_ZN11alglib_impl9ae_assertEbPKcPNS_8ae_stateE(i1 noundef zeroext %56, ptr noundef @.str.212, ptr noundef %57)
  br label %58

58:                                               ; preds = %45, %35
  br label %59

59:                                               ; preds = %58, %7
  %60 = load i64, ptr %12, align 8, !tbaa !9
  %61 = icmp sge i64 %60, 0
  br i1 %61, label %62, label %64

62:                                               ; preds = %59
  store i64 0, ptr %15, align 8, !tbaa !9
  %63 = load i64, ptr %12, align 8, !tbaa !9
  store i64 %63, ptr %16, align 8, !tbaa !9
  store i64 1, ptr %17, align 8, !tbaa !9
  br label %66

64:                                               ; preds = %59
  store i64 0, ptr %15, align 8, !tbaa !9
  %65 = load i64, ptr %10, align 8, !tbaa !9
  store i64 %65, ptr %16, align 8, !tbaa !9
  store i64 0, ptr %17, align 8, !tbaa !9
  br label %66

66:                                               ; preds = %64, %62
  %67 = load ptr, ptr %8, align 8, !tbaa !5
  %68 = load ptr, ptr %8, align 8, !tbaa !5
  %69 = getelementptr inbounds %"struct.alglib_impl::multilayerperceptron", ptr %68, i32 0, i32 22
  %70 = load ptr, ptr %9, align 8, !tbaa !5
  %71 = load i64, ptr %10, align 8, !tbaa !9
  %72 = load ptr, ptr %11, align 8, !tbaa !5
  %73 = load i64, ptr %15, align 8, !tbaa !9
  %74 = load i64, ptr %16, align 8, !tbaa !9
  %75 = load i64, ptr %17, align 8, !tbaa !9
  %76 = load ptr, ptr %8, align 8, !tbaa !5
  %77 = getelementptr inbounds %"struct.alglib_impl::multilayerperceptron", ptr %76, i32 0, i32 20
  %78 = load ptr, ptr %13, align 8, !tbaa !5
  %79 = load ptr, ptr %14, align 8, !tbaa !5
  call void @_ZN11alglib_impl13mlpallerrorsxEPNS_20multilayerperceptronEPNS_9ae_matrixEPNS_12sparsematrixEllPNS_9ae_vectorElllPNS_14ae_shared_poolEPNS_11modelerrorsEPNS_8ae_stateE(ptr noundef %67, ptr noundef %69, ptr noundef %70, i64 noundef %71, i64 noundef 1, ptr noundef %72, i64 noundef %73, i64 noundef %74, i64 noundef %75, ptr noundef %77, ptr noundef %78, ptr noundef %79)
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #4
  ret void
}

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

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

declare noundef zeroext i1 @_ZN11alglib_impl11sparseiscrsEPNS_12sparsematrixEPNS_8ae_stateE(ptr noundef, ptr noundef) #1

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

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

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { mustprogress nounwind 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 #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}


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

@.str.209 = external hidden unnamed_addr constant [51 x i8], align 1
@.str.210 = external hidden unnamed_addr constant [56 x i8], align 1
@.str.211 = external hidden unnamed_addr constant [57 x i8], align 1
@.str.212 = external hidden unnamed_addr constant [60 x i8], align 1

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZN11alglib_impl17mlpgetinputscountEPNS_20multilayerperceptronEPNS_8ae_stateE(ptr noundef, ptr noundef) local_unnamed_addr #1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZN11alglib_impl18mlpgetoutputscountEPNS_20multilayerperceptronEPNS_8ae_stateE(ptr noundef, ptr noundef) local_unnamed_addr #1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZN11alglib_impl12mlpissoftmaxEPNS_20multilayerperceptronEPNS_8ae_stateE(ptr noundef, ptr noundef) local_unnamed_addr #1

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN11alglib_impl24mlpallerrorssparsesubsetEPNS_20multilayerperceptronEPNS_12sparsematrixElPNS_9ae_vectorElPNS_11modelerrorsEPNS_8ae_stateE(ptr noundef %0, ptr noundef %1, i64 noundef %2, ptr noundef %3, i64 noundef %4, ptr noundef %5, ptr noundef %6) local_unnamed_addr #2 {
  tail call void @_ZN11alglib_impl18_modelerrors_clearEPv(ptr noundef %5)
  %8 = tail call noundef zeroext i1 @_ZN11alglib_impl11sparseiscrsEPNS_12sparsematrixEPNS_8ae_stateE(ptr noundef %1, ptr noundef %6)
  tail call void @_ZN11alglib_impl9ae_assertEbPKcPNS_8ae_stateE(i1 noundef zeroext %8, ptr noundef nonnull @.str.209, ptr noundef %6)
  %9 = tail call noundef i64 @_ZN11alglib_impl14sparsegetnrowsEPNS_12sparsematrixEPNS_8ae_stateE(ptr noundef %1, ptr noundef %6)
  %10 = icmp sge i64 %9, %2
  tail call void @_ZN11alglib_impl9ae_assertEbPKcPNS_8ae_stateE(i1 noundef zeroext %10, ptr noundef nonnull @.str.210, ptr noundef %6)
  %11 = icmp sgt i64 %2, 0
  br i1 %11, label %12, label %22

12:                                               ; preds = %7
  %13 = tail call noundef zeroext i1 @_ZN11alglib_impl12mlpissoftmaxEPNS_20multilayerperceptronEPNS_8ae_stateE(ptr noundef %0, ptr noundef %6)
  %14 = tail call noundef i64 @_ZN11alglib_impl14sparsegetncolsEPNS_12sparsematrixEPNS_8ae_stateE(ptr noundef %1, ptr noundef %6)
  %15 = tail call noundef i64 @_ZN11alglib_impl17mlpgetinputscountEPNS_20multilayerperceptronEPNS_8ae_stateE(ptr noundef %0, ptr noundef %6)
  br i1 %13, label %16, label %18

16:                                               ; preds = %12
  %17 = icmp sgt i64 %14, %15
  tail call void @_ZN11alglib_impl9ae_assertEbPKcPNS_8ae_stateE(i1 noundef zeroext %17, ptr noundef nonnull @.str.211, ptr noundef %6)
  br label %22

18:                                               ; preds = %12
  %19 = tail call noundef i64 @_ZN11alglib_impl18mlpgetoutputscountEPNS_20multilayerperceptronEPNS_8ae_stateE(ptr noundef %0, ptr noundef %6)
  %20 = add nsw i64 %19, %15
  %21 = icmp sge i64 %14, %20
  tail call void @_ZN11alglib_impl9ae_assertEbPKcPNS_8ae_stateE(i1 noundef zeroext %21, ptr noundef nonnull @.str.212, ptr noundef %6)
  br label %22

22:                                               ; preds = %16, %18, %7
  %23 = icmp sgt i64 %4, -1
  %. = select i1 %23, i64 %4, i64 %2
  %.39 = zext i1 %23 to i64
  %24 = getelementptr inbounds i8, ptr %0, i64 1448
  %25 = getelementptr inbounds i8, ptr %0, i64 1160
  tail call void @_ZN11alglib_impl13mlpallerrorsxEPNS_20multilayerperceptronEPNS_9ae_matrixEPNS_12sparsematrixEllPNS_9ae_vectorElllPNS_14ae_shared_poolEPNS_11modelerrorsEPNS_8ae_stateE(ptr noundef %0, ptr noundef nonnull %24, ptr noundef %1, i64 noundef %2, i64 noundef 1, ptr noundef %3, i64 noundef 0, i64 noundef %., i64 noundef %.39, ptr noundef nonnull %25, ptr noundef %5, ptr noundef %6)
  ret void
}

declare noundef i64 @_ZN11alglib_impl14sparsegetnrowsEPNS_12sparsematrixEPNS_8ae_stateE(ptr noundef, ptr noundef) local_unnamed_addr #0

declare noundef i64 @_ZN11alglib_impl14sparsegetncolsEPNS_12sparsematrixEPNS_8ae_stateE(ptr noundef, ptr noundef) local_unnamed_addr #0

declare noundef zeroext i1 @_ZN11alglib_impl11sparseiscrsEPNS_12sparsematrixEPNS_8ae_stateE(ptr noundef, ptr noundef) local_unnamed_addr #0

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN11alglib_impl18_modelerrors_clearEPv(ptr noundef) local_unnamed_addr #2

attributes #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 #1 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { mustprogress 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" }

!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)"}


; Effective O3 passes: GlobalOptPass,InferFunctionAttrsPass,InstCombinePass,ReassociatePass,SROAPass,SimplifyCFGPass,TailCallElimPass