; 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.173 = external hidden unnamed_addr constant [43 x i8], align 1
@.str.174 = external hidden unnamed_addr constant [44 x i8], align 1
@.str.175 = external hidden unnamed_addr constant [47 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 noundef double @_ZN11alglib_impl11mlpavgerrorEPNS_20multilayerperceptronEPNS_9ae_matrixElPNS_8ae_stateE(ptr noundef %0, ptr noundef %1, i64 noundef %2, ptr noundef %3) #3 {
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca i64, align 8
  %8 = alloca ptr, align 8
  %9 = alloca double, align 8
  store ptr %0, ptr %5, align 8, !tbaa !5
  store ptr %1, ptr %6, align 8, !tbaa !5
  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 8, ptr %9) #4
  %10 = load ptr, ptr %6, align 8, !tbaa !5
  %11 = getelementptr inbounds %"struct.alglib_impl::ae_matrix", ptr %10, i32 0, i32 0
  %12 = load i64, ptr %11, align 8, !tbaa !11
  %13 = load i64, ptr %7, align 8, !tbaa !9
  %14 = icmp sge i64 %12, %13
  %15 = load ptr, ptr %8, align 8, !tbaa !5
  call void @_ZN11alglib_impl9ae_assertEbPKcPNS_8ae_stateE(i1 noundef zeroext %14, ptr noundef @.str.173, ptr noundef %15)
  %16 = load i64, ptr %7, align 8, !tbaa !9
  %17 = icmp sgt i64 %16, 0
  br i1 %17, label %18, label %46

18:                                               ; preds = %4
  %19 = load ptr, ptr %5, align 8, !tbaa !5
  %20 = load ptr, ptr %8, align 8, !tbaa !5
  %21 = call noundef zeroext i1 @_ZN11alglib_impl12mlpissoftmaxEPNS_20multilayerperceptronEPNS_8ae_stateE(ptr noundef %19, ptr noundef %20)
  br i1 %21, label %22, label %32

22:                                               ; preds = %18
  %23 = load ptr, ptr %6, align 8, !tbaa !5
  %24 = getelementptr inbounds %"struct.alglib_impl::ae_matrix", ptr %23, i32 0, i32 1
  %25 = load i64, ptr %24, align 8, !tbaa !15
  %26 = load ptr, ptr %5, align 8, !tbaa !5
  %27 = load ptr, ptr %8, align 8, !tbaa !5
  %28 = call noundef i64 @_ZN11alglib_impl17mlpgetinputscountEPNS_20multilayerperceptronEPNS_8ae_stateE(ptr noundef %26, ptr noundef %27)
  %29 = add nsw i64 %28, 1
  %30 = icmp sge i64 %25, %29
  %31 = load ptr, ptr %8, align 8, !tbaa !5
  call void @_ZN11alglib_impl9ae_assertEbPKcPNS_8ae_stateE(i1 noundef zeroext %30, ptr noundef @.str.174, ptr noundef %31)
  br label %45

32:                                               ; preds = %18
  %33 = load ptr, ptr %6, align 8, !tbaa !5
  %34 = getelementptr inbounds %"struct.alglib_impl::ae_matrix", ptr %33, i32 0, i32 1
  %35 = load i64, ptr %34, align 8, !tbaa !15
  %36 = load ptr, ptr %5, align 8, !tbaa !5
  %37 = load ptr, ptr %8, align 8, !tbaa !5
  %38 = call noundef i64 @_ZN11alglib_impl17mlpgetinputscountEPNS_20multilayerperceptronEPNS_8ae_stateE(ptr noundef %36, ptr noundef %37)
  %39 = load ptr, ptr %5, align 8, !tbaa !5
  %40 = load ptr, ptr %8, align 8, !tbaa !5
  %41 = call noundef i64 @_ZN11alglib_impl18mlpgetoutputscountEPNS_20multilayerperceptronEPNS_8ae_stateE(ptr noundef %39, ptr noundef %40)
  %42 = add nsw i64 %38, %41
  %43 = icmp sge i64 %35, %42
  %44 = load ptr, ptr %8, align 8, !tbaa !5
  call void @_ZN11alglib_impl9ae_assertEbPKcPNS_8ae_stateE(i1 noundef zeroext %43, ptr noundef @.str.175, ptr noundef %44)
  br label %45

45:                                               ; preds = %32, %22
  br label %46

46:                                               ; preds = %45, %4
  %47 = load ptr, ptr %5, align 8, !tbaa !5
  %48 = load ptr, ptr %6, align 8, !tbaa !5
  %49 = load ptr, ptr %5, align 8, !tbaa !5
  %50 = getelementptr inbounds %"struct.alglib_impl::multilayerperceptron", ptr %49, i32 0, i32 23
  %51 = load i64, ptr %7, align 8, !tbaa !9
  %52 = load ptr, ptr %5, align 8, !tbaa !5
  %53 = getelementptr inbounds %"struct.alglib_impl::multilayerperceptron", ptr %52, i32 0, i32 24
  %54 = load i64, ptr %7, align 8, !tbaa !9
  %55 = load ptr, ptr %5, align 8, !tbaa !5
  %56 = getelementptr inbounds %"struct.alglib_impl::multilayerperceptron", ptr %55, i32 0, i32 20
  %57 = load ptr, ptr %5, align 8, !tbaa !5
  %58 = getelementptr inbounds %"struct.alglib_impl::multilayerperceptron", ptr %57, i32 0, i32 18
  %59 = load ptr, ptr %8, align 8, !tbaa !5
  call void @_ZN11alglib_impl13mlpallerrorsxEPNS_20multilayerperceptronEPNS_9ae_matrixEPNS_12sparsematrixEllPNS_9ae_vectorElllPNS_14ae_shared_poolEPNS_11modelerrorsEPNS_8ae_stateE(ptr noundef %47, ptr noundef %48, ptr noundef %50, i64 noundef %51, i64 noundef 0, ptr noundef %53, i64 noundef 0, i64 noundef %54, i64 noundef 0, ptr noundef %56, ptr noundef %58, ptr noundef %59)
  %60 = load ptr, ptr %5, align 8, !tbaa !5
  %61 = getelementptr inbounds %"struct.alglib_impl::multilayerperceptron", ptr %60, i32 0, i32 18
  %62 = getelementptr inbounds %"struct.alglib_impl::modelerrors", ptr %61, i32 0, i32 3
  %63 = load double, ptr %62, align 8, !tbaa !16
  store double %63, ptr %9, align 8, !tbaa !24
  %64 = load double, ptr %9, align 8, !tbaa !24
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #4
  ret double %64
}

; 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

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}
!16 = !{!17, !20, i64 1080}
!17 = !{!"_ZTSN11alglib_impl20multilayerperceptronE", !10, i64 0, !10, i64 8, !18, i64 16, !18, i64 80, !18, i64 144, !18, i64 208, !18, i64 272, !18, i64 336, !18, i64 400, !18, i64 464, !18, i64 528, !18, i64 592, !18, i64 656, !18, i64 720, !12, i64 784, !18, i64 864, !18, i64 928, !18, i64 992, !19, i64 1056, !18, i64 1096, !21, i64 1160, !21, i64 1304, !12, i64 1448, !23, i64 1528, !18, i64 1896, !21, i64 1960}
!18 = !{!"_ZTSN11alglib_impl9ae_vectorE", !10, i64 0, !10, i64 8, !13, i64 16, !14, i64 24, !7, i64 56}
!19 = !{!"_ZTSN11alglib_impl11modelerrorsE", !20, i64 0, !20, i64 8, !20, i64 16, !20, i64 24, !20, i64 32}
!20 = !{!"double", !7, i64 0}
!21 = !{!"_ZTSN11alglib_impl14ae_shared_poolE", !22, i64 0, !6, i64 48, !6, i64 56, !6, i64 64, !6, i64 72, !10, i64 80, !6, i64 88, !6, i64 96, !6, i64 104, !14, i64 112}
!22 = !{!"_ZTSN11alglib_impl7ae_lockE", !6, i64 0, !14, i64 8, !13, i64 40}
!23 = !{!"_ZTSN11alglib_impl12sparsematrixE", !18, i64 0, !18, i64 64, !18, i64 128, !18, i64 192, !18, i64 256, !10, i64 320, !10, i64 328, !10, i64 336, !10, i64 344, !10, i64 352, !10, i64 360}
!24 = !{!20, !20, 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.173 = external hidden unnamed_addr constant [43 x i8], align 1
@.str.174 = external hidden unnamed_addr constant [44 x i8], align 1
@.str.175 = external hidden unnamed_addr constant [47 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 noundef double @_ZN11alglib_impl11mlpavgerrorEPNS_20multilayerperceptronEPNS_9ae_matrixElPNS_8ae_stateE(ptr noundef %0, ptr noundef %1, i64 noundef %2, ptr noundef %3) local_unnamed_addr #2 {
  %5 = load i64, ptr %1, align 8, !tbaa !5
  %6 = icmp sge i64 %5, %2
  tail call void @_ZN11alglib_impl9ae_assertEbPKcPNS_8ae_stateE(i1 noundef zeroext %6, ptr noundef nonnull @.str.173, ptr noundef %3)
  %7 = icmp sgt i64 %2, 0
  br i1 %7, label %8, label %19

8:                                                ; preds = %4
  %9 = tail call noundef zeroext i1 @_ZN11alglib_impl12mlpissoftmaxEPNS_20multilayerperceptronEPNS_8ae_stateE(ptr noundef %0, ptr noundef %3)
  %10 = getelementptr inbounds i8, ptr %1, i64 8
  %11 = load i64, ptr %10, align 8, !tbaa !13
  %12 = tail call noundef i64 @_ZN11alglib_impl17mlpgetinputscountEPNS_20multilayerperceptronEPNS_8ae_stateE(ptr noundef %0, ptr noundef %3)
  br i1 %9, label %13, label %15

13:                                               ; preds = %8
  %14 = icmp sgt i64 %11, %12
  tail call void @_ZN11alglib_impl9ae_assertEbPKcPNS_8ae_stateE(i1 noundef zeroext %14, ptr noundef nonnull @.str.174, ptr noundef %3)
  br label %19

15:                                               ; preds = %8
  %16 = tail call noundef i64 @_ZN11alglib_impl18mlpgetoutputscountEPNS_20multilayerperceptronEPNS_8ae_stateE(ptr noundef %0, ptr noundef %3)
  %17 = add nsw i64 %16, %12
  %18 = icmp sge i64 %11, %17
  tail call void @_ZN11alglib_impl9ae_assertEbPKcPNS_8ae_stateE(i1 noundef zeroext %18, ptr noundef nonnull @.str.175, ptr noundef %3)
  br label %19

19:                                               ; preds = %13, %15, %4
  %20 = getelementptr inbounds i8, ptr %0, i64 1528
  %21 = getelementptr inbounds i8, ptr %0, i64 1896
  %22 = getelementptr inbounds i8, ptr %0, i64 1160
  %23 = getelementptr inbounds i8, ptr %0, i64 1056
  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 %20, i64 noundef %2, i64 noundef 0, ptr noundef nonnull %21, i64 noundef 0, i64 noundef %2, i64 noundef 0, ptr noundef nonnull %22, ptr noundef nonnull %23, ptr noundef %3)
  %24 = getelementptr inbounds i8, ptr %0, i64 1080
  %25 = load double, ptr %24, align 8, !tbaa !14
  ret double %25
}

; 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

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}
!14 = !{!15, !18, i64 1080}
!15 = !{!"_ZTSN11alglib_impl20multilayerperceptronE", !7, i64 0, !7, i64 8, !16, i64 16, !16, i64 80, !16, i64 144, !16, i64 208, !16, i64 272, !16, i64 336, !16, i64 400, !16, i64 464, !16, i64 528, !16, i64 592, !16, i64 656, !16, i64 720, !6, i64 784, !16, i64 864, !16, i64 928, !16, i64 992, !17, i64 1056, !16, i64 1096, !19, i64 1160, !19, i64 1304, !6, i64 1448, !21, i64 1528, !16, i64 1896, !19, i64 1960}
!16 = !{!"_ZTSN11alglib_impl9ae_vectorE", !7, i64 0, !7, i64 8, !10, i64 16, !11, i64 24, !8, i64 56}
!17 = !{!"_ZTSN11alglib_impl11modelerrorsE", !18, i64 0, !18, i64 8, !18, i64 16, !18, i64 24, !18, i64 32}
!18 = !{!"double", !8, i64 0}
!19 = !{!"_ZTSN11alglib_impl14ae_shared_poolE", !20, i64 0, !12, i64 48, !12, i64 56, !12, i64 64, !12, i64 72, !7, i64 80, !12, i64 88, !12, i64 96, !12, i64 104, !11, i64 112}
!20 = !{!"_ZTSN11alglib_impl7ae_lockE", !12, i64 0, !11, i64 8, !10, i64 40}
!21 = !{!"_ZTSN11alglib_impl12sparsematrixE", !16, i64 0, !16, i64 64, !16, i64 128, !16, i64 192, !16, i64 256, !7, i64 320, !7, i64 328, !7, i64 336, !7, i64 344, !7, i64 352, !7, i64 360}


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