; 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::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::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::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.206 = external hidden unnamed_addr constant [50 x i8], align 1
@.str.207 = external hidden unnamed_addr constant [51 x i8], align 1
@.str.208 = external hidden unnamed_addr constant [54 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_impl18mlpallerrorssubsetEPNS_20multilayerperceptronEPNS_9ae_matrixElPNS_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 = getelementptr inbounds %"struct.alglib_impl::ae_matrix", ptr %19, i32 0, i32 0
  %21 = load i64, ptr %20, align 8, !tbaa !11
  %22 = load i64, ptr %10, align 8, !tbaa !9
  %23 = icmp sge i64 %21, %22
  %24 = load ptr, ptr %14, align 8, !tbaa !5
  call void @_ZN11alglib_impl9ae_assertEbPKcPNS_8ae_stateE(i1 noundef zeroext %23, ptr noundef @.str.206, ptr noundef %24)
  %25 = load i64, ptr %10, align 8, !tbaa !9
  %26 = icmp sgt i64 %25, 0
  br i1 %26, label %27, label %55

27:                                               ; preds = %7
  %28 = load ptr, ptr %8, align 8, !tbaa !5
  %29 = load ptr, ptr %14, align 8, !tbaa !5
  %30 = call noundef zeroext i1 @_ZN11alglib_impl12mlpissoftmaxEPNS_20multilayerperceptronEPNS_8ae_stateE(ptr noundef %28, ptr noundef %29)
  br i1 %30, label %31, label %41

31:                                               ; preds = %27
  %32 = load ptr, ptr %9, align 8, !tbaa !5
  %33 = getelementptr inbounds %"struct.alglib_impl::ae_matrix", ptr %32, i32 0, i32 1
  %34 = load i64, ptr %33, align 8, !tbaa !15
  %35 = load ptr, ptr %8, align 8, !tbaa !5
  %36 = load ptr, ptr %14, align 8, !tbaa !5
  %37 = call noundef i64 @_ZN11alglib_impl17mlpgetinputscountEPNS_20multilayerperceptronEPNS_8ae_stateE(ptr noundef %35, ptr noundef %36)
  %38 = add nsw i64 %37, 1
  %39 = icmp sge i64 %34, %38
  %40 = load ptr, ptr %14, align 8, !tbaa !5
  call void @_ZN11alglib_impl9ae_assertEbPKcPNS_8ae_stateE(i1 noundef zeroext %39, ptr noundef @.str.207, ptr noundef %40)
  br label %54

41:                                               ; preds = %27
  %42 = load ptr, ptr %9, align 8, !tbaa !5
  %43 = getelementptr inbounds %"struct.alglib_impl::ae_matrix", ptr %42, i32 0, i32 1
  %44 = load i64, ptr %43, align 8, !tbaa !15
  %45 = load ptr, ptr %8, align 8, !tbaa !5
  %46 = load ptr, ptr %14, align 8, !tbaa !5
  %47 = call noundef i64 @_ZN11alglib_impl17mlpgetinputscountEPNS_20multilayerperceptronEPNS_8ae_stateE(ptr noundef %45, ptr noundef %46)
  %48 = load ptr, ptr %8, align 8, !tbaa !5
  %49 = load ptr, ptr %14, align 8, !tbaa !5
  %50 = call noundef i64 @_ZN11alglib_impl18mlpgetoutputscountEPNS_20multilayerperceptronEPNS_8ae_stateE(ptr noundef %48, ptr noundef %49)
  %51 = add nsw i64 %47, %50
  %52 = icmp sge i64 %44, %51
  %53 = load ptr, ptr %14, align 8, !tbaa !5
  call void @_ZN11alglib_impl9ae_assertEbPKcPNS_8ae_stateE(i1 noundef zeroext %52, ptr noundef @.str.208, ptr noundef %53)
  br label %54

54:                                               ; preds = %41, %31
  br label %55

55:                                               ; preds = %54, %7
  %56 = load i64, ptr %12, align 8, !tbaa !9
  %57 = icmp sge i64 %56, 0
  br i1 %57, label %58, label %60

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

60:                                               ; preds = %55
  store i64 0, ptr %15, align 8, !tbaa !9
  %61 = load i64, ptr %10, align 8, !tbaa !9
  store i64 %61, ptr %16, align 8, !tbaa !9
  store i64 0, ptr %17, align 8, !tbaa !9
  br label %62

62:                                               ; preds = %60, %58
  %63 = load ptr, ptr %8, align 8, !tbaa !5
  %64 = load ptr, ptr %9, align 8, !tbaa !5
  %65 = load ptr, ptr %8, align 8, !tbaa !5
  %66 = getelementptr inbounds %"struct.alglib_impl::multilayerperceptron", ptr %65, i32 0, i32 23
  %67 = load i64, ptr %10, align 8, !tbaa !9
  %68 = load ptr, ptr %11, align 8, !tbaa !5
  %69 = load i64, ptr %15, align 8, !tbaa !9
  %70 = load i64, ptr %16, align 8, !tbaa !9
  %71 = load i64, ptr %17, align 8, !tbaa !9
  %72 = load ptr, ptr %8, align 8, !tbaa !5
  %73 = getelementptr inbounds %"struct.alglib_impl::multilayerperceptron", ptr %72, i32 0, i32 20
  %74 = load ptr, ptr %13, align 8, !tbaa !5
  %75 = 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 %63, ptr noundef %64, ptr noundef %66, i64 noundef %67, i64 noundef 0, ptr noundef %68, i64 noundef %69, i64 noundef %70, i64 noundef %71, ptr noundef %73, ptr noundef %74, ptr noundef %75)
  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
}

; 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}
!11 = !{!12, !10, i64 0}
!12 = !{!"_ZTSN11alglib_impl9ae_matrixE", !10, i64 0, !10, i64 8, !10, i64 16, !10, i64 24, !13, i64 32, !14, i64 40, !7, i64 72}
!13 = !{!"bool", !7, i64 0}
!14 = !{!"_ZTSN11alglib_impl12ae_dyn_blockE", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24}
!15 = !{!12, !10, i64 8}


; 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.206 = external hidden unnamed_addr constant [50 x i8], align 1
@.str.207 = external hidden unnamed_addr constant [51 x i8], align 1
@.str.208 = external hidden unnamed_addr constant [54 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_impl18mlpallerrorssubsetEPNS_20multilayerperceptronEPNS_9ae_matrixElPNS_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 = load i64, ptr %1, align 8, !tbaa !5
  %9 = icmp sge i64 %8, %2
  tail call void @_ZN11alglib_impl9ae_assertEbPKcPNS_8ae_stateE(i1 noundef zeroext %9, ptr noundef nonnull @.str.206, ptr noundef %6)
  %10 = icmp sgt i64 %2, 0
  br i1 %10, label %11, label %22

11:                                               ; preds = %7
  %12 = tail call noundef zeroext i1 @_ZN11alglib_impl12mlpissoftmaxEPNS_20multilayerperceptronEPNS_8ae_stateE(ptr noundef %0, ptr noundef %6)
  %13 = getelementptr inbounds i8, ptr %1, i64 8
  %14 = load i64, ptr %13, align 8, !tbaa !13
  %15 = tail call noundef i64 @_ZN11alglib_impl17mlpgetinputscountEPNS_20multilayerperceptronEPNS_8ae_stateE(ptr noundef %0, ptr noundef %6)
  br i1 %12, label %16, label %18

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

18:                                               ; preds = %11
  %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.208, ptr noundef %6)
  br label %22

22:                                               ; preds = %16, %18, %7
  %23 = icmp sgt i64 %4, -1
  %. = select i1 %23, i64 %4, i64 %2
  %.33 = zext i1 %23 to i64
  %24 = getelementptr inbounds i8, ptr %0, i64 1528
  %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 %1, ptr noundef nonnull %24, i64 noundef %2, i64 noundef 0, ptr noundef %3, i64 noundef 0, i64 noundef %., i64 noundef %.33, ptr noundef nonnull %25, ptr noundef %5, ptr noundef %6)
  ret void
}

; 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)"}
!5 = !{!6, !7, i64 0}
!6 = !{!"_ZTSN11alglib_impl9ae_matrixE", !7, i64 0, !7, i64 8, !7, i64 16, !7, i64 24, !10, i64 32, !11, i64 40, !8, i64 72}
!7 = !{!"long", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!"bool", !8, i64 0}
!11 = !{!"_ZTSN11alglib_impl12ae_dyn_blockE", !12, i64 0, !12, i64 8, !12, i64 16, !12, i64 24}
!12 = !{!"any pointer", !8, i64 0}
!13 = !{!6, !7, i64 8}


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