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

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

declare void @_ZN11alglib_impl23bvectorsetlengthatleastEPNS_9ae_vectorElPNS_8ae_stateE(ptr noundef, i64 noundef, ptr noundef) #0

declare void @_ZN11alglib_impl23rvectorsetlengthatleastEPNS_9ae_vectorElPNS_8ae_stateE(ptr noundef, i64 noundef, ptr noundef) #0

declare void @_ZN11alglib_impl23rmatrixsetlengthatleastEPNS_9ae_matrixEllPNS_8ae_stateE(ptr noundef, i64 noundef, i64 noundef, ptr noundef) #0

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN11alglib_impl9snnlsinitElllPNS_11snnlssolverEPNS_8ae_stateE(i64 noundef %0, i64 noundef %1, i64 noundef %2, ptr noundef %3, ptr noundef %4) #1 {
  %6 = alloca i64, align 8
  %7 = alloca i64, align 8
  %8 = alloca i64, align 8
  %9 = alloca ptr, align 8
  %10 = alloca ptr, align 8
  store i64 %0, ptr %6, align 8, !tbaa !5
  store i64 %1, ptr %7, align 8, !tbaa !5
  store i64 %2, ptr %8, align 8, !tbaa !5
  store ptr %3, ptr %9, align 8, !tbaa !9
  store ptr %4, ptr %10, align 8, !tbaa !9
  %11 = load ptr, ptr %9, align 8, !tbaa !9
  %12 = getelementptr inbounds %"struct.alglib_impl::snnlssolver", ptr %11, i32 0, i32 0
  store i64 0, ptr %12, align 8, !tbaa !11
  %13 = load ptr, ptr %9, align 8, !tbaa !9
  %14 = getelementptr inbounds %"struct.alglib_impl::snnlssolver", ptr %13, i32 0, i32 1
  store i64 0, ptr %14, align 8, !tbaa !18
  %15 = load ptr, ptr %9, align 8, !tbaa !9
  %16 = getelementptr inbounds %"struct.alglib_impl::snnlssolver", ptr %15, i32 0, i32 2
  store i64 0, ptr %16, align 8, !tbaa !19
  %17 = load ptr, ptr %9, align 8, !tbaa !9
  %18 = getelementptr inbounds %"struct.alglib_impl::snnlssolver", ptr %17, i32 0, i32 3
  %19 = load i64, ptr %8, align 8, !tbaa !5
  %20 = load i64, ptr %7, align 8, !tbaa !5
  %21 = load ptr, ptr %10, align 8, !tbaa !9
  call void @_ZN11alglib_impl23rmatrixsetlengthatleastEPNS_9ae_matrixEllPNS_8ae_stateE(ptr noundef %18, i64 noundef %19, i64 noundef %20, ptr noundef %21)
  %22 = load ptr, ptr %9, align 8, !tbaa !9
  %23 = getelementptr inbounds %"struct.alglib_impl::snnlssolver", ptr %22, i32 0, i32 10
  %24 = load i64, ptr %8, align 8, !tbaa !5
  %25 = load i64, ptr %7, align 8, !tbaa !5
  %26 = load ptr, ptr %10, align 8, !tbaa !9
  call void @_ZN11alglib_impl23rmatrixsetlengthatleastEPNS_9ae_matrixEllPNS_8ae_stateE(ptr noundef %23, i64 noundef %24, i64 noundef %25, ptr noundef %26)
  %27 = load ptr, ptr %9, align 8, !tbaa !9
  %28 = getelementptr inbounds %"struct.alglib_impl::snnlssolver", ptr %27, i32 0, i32 4
  %29 = load i64, ptr %8, align 8, !tbaa !5
  %30 = load ptr, ptr %10, align 8, !tbaa !9
  call void @_ZN11alglib_impl23rvectorsetlengthatleastEPNS_9ae_vectorElPNS_8ae_stateE(ptr noundef %28, i64 noundef %29, ptr noundef %30)
  %31 = load ptr, ptr %9, align 8, !tbaa !9
  %32 = getelementptr inbounds %"struct.alglib_impl::snnlssolver", ptr %31, i32 0, i32 5
  %33 = load i64, ptr %6, align 8, !tbaa !5
  %34 = load i64, ptr %7, align 8, !tbaa !5
  %35 = add nsw i64 %33, %34
  %36 = load ptr, ptr %10, align 8, !tbaa !9
  call void @_ZN11alglib_impl23bvectorsetlengthatleastEPNS_9ae_vectorElPNS_8ae_stateE(ptr noundef %32, i64 noundef %35, ptr noundef %36)
  %37 = load ptr, ptr %9, align 8, !tbaa !9
  %38 = getelementptr inbounds %"struct.alglib_impl::snnlssolver", ptr %37, i32 0, i32 6
  store double 0.000000e+00, ptr %38, align 8, !tbaa !20
  %39 = load ptr, ptr %9, align 8, !tbaa !9
  %40 = getelementptr inbounds %"struct.alglib_impl::snnlssolver", ptr %39, i32 0, i32 7
  store i64 0, ptr %40, align 8, !tbaa !21
  ret void
}

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 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, !6, i64 0}
!6 = !{!"long", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"any pointer", !7, i64 0}
!11 = !{!12, !6, i64 0}
!12 = !{!"_ZTSN11alglib_impl11snnlssolverE", !6, i64 0, !6, i64 8, !6, i64 16, !13, i64 24, !16, i64 104, !16, i64 168, !17, i64 232, !6, i64 240, !16, i64 248, !16, i64 312, !13, i64 376, !13, i64 456, !13, i64 536, !16, i64 616, !16, i64 680, !16, i64 744, !16, i64 808, !16, i64 872, !16, i64 936, !16, i64 1000, !16, i64 1064, !16, i64 1128, !16, i64 1192, !16, i64 1256, !16, i64 1320, !16, i64 1384, !16, i64 1448, !16, i64 1512, !16, i64 1576}
!13 = !{!"_ZTSN11alglib_impl9ae_matrixE", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !14, i64 32, !15, i64 40, !7, i64 72}
!14 = !{!"bool", !7, i64 0}
!15 = !{!"_ZTSN11alglib_impl12ae_dyn_blockE", !10, i64 0, !10, i64 8, !10, i64 16, !10, i64 24}
!16 = !{!"_ZTSN11alglib_impl9ae_vectorE", !6, i64 0, !6, i64 8, !14, i64 16, !15, i64 24, !7, i64 56}
!17 = !{!"double", !7, i64 0}
!18 = !{!12, !6, i64 8}
!19 = !{!12, !6, i64 16}
!20 = !{!12, !17, i64 232}
!21 = !{!12, !6, i64 240}


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

declare void @_ZN11alglib_impl23bvectorsetlengthatleastEPNS_9ae_vectorElPNS_8ae_stateE(ptr noundef, i64 noundef, ptr noundef) local_unnamed_addr #0

declare void @_ZN11alglib_impl23rvectorsetlengthatleastEPNS_9ae_vectorElPNS_8ae_stateE(ptr noundef, i64 noundef, ptr noundef) local_unnamed_addr #0

declare void @_ZN11alglib_impl23rmatrixsetlengthatleastEPNS_9ae_matrixEllPNS_8ae_stateE(ptr noundef, i64 noundef, i64 noundef, ptr noundef) local_unnamed_addr #0

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN11alglib_impl9snnlsinitElllPNS_11snnlssolverEPNS_8ae_stateE(i64 noundef %0, i64 noundef %1, i64 noundef %2, ptr noundef %3, ptr noundef %4) local_unnamed_addr #1 {
  %6 = getelementptr inbounds i8, ptr %3, i64 24
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(24) %3, i8 0, i64 24, i1 false)
  tail call void @_ZN11alglib_impl23rmatrixsetlengthatleastEPNS_9ae_matrixEllPNS_8ae_stateE(ptr noundef nonnull %6, i64 noundef %2, i64 noundef %1, ptr noundef %4)
  %7 = getelementptr inbounds i8, ptr %3, i64 376
  tail call void @_ZN11alglib_impl23rmatrixsetlengthatleastEPNS_9ae_matrixEllPNS_8ae_stateE(ptr noundef nonnull %7, i64 noundef %2, i64 noundef %1, ptr noundef %4)
  %8 = getelementptr inbounds i8, ptr %3, i64 104
  tail call void @_ZN11alglib_impl23rvectorsetlengthatleastEPNS_9ae_vectorElPNS_8ae_stateE(ptr noundef nonnull %8, i64 noundef %2, ptr noundef %4)
  %9 = getelementptr inbounds i8, ptr %3, i64 168
  %10 = add nsw i64 %1, %0
  tail call void @_ZN11alglib_impl23bvectorsetlengthatleastEPNS_9ae_vectorElPNS_8ae_stateE(ptr noundef nonnull %9, i64 noundef %10, ptr noundef %4)
  %11 = getelementptr inbounds i8, ptr %3, i64 232
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %11, i8 0, i64 16, i1 false)
  ret void
}

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #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 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 = { nocallback nofree nounwind willreturn memory(argmem: write) }

!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: EarlyCSEPass,GlobalOptPass,InstCombinePass,MemCpyOptPass,ReassociatePass,SROAPass,TailCallElimPass