; LLVM IR from Godot-Machine-Learning/Godot_MachineLearning :: lsr.ll (ZN24simple_linear_regressionC2Ev)

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

%class.simple_linear_regression = type { %class.DataIOClass, %class.ITrainPredict, i32, %"class.std::vector", %"class.std::vector", %"class.std::vector", %"class.std::vector", i8, double, double, double, double, double, double, %"class.std::future", %"class.std::mutex" }
%class.DataIOClass = type { ptr, %"class.std::vector", %"class.std::vector.3", %"class.std::vector" }
%"class.std::vector.3" = type { %"struct.std::_Vector_base.4" }
%"struct.std::_Vector_base.4" = type { %"struct.std::_Vector_base<std::vector<double>, std::allocator<std::vector<double>>>::_Vector_impl" }
%"struct.std::_Vector_base<std::vector<double>, std::allocator<std::vector<double>>>::_Vector_impl" = type { %"struct.std::_Vector_base<std::vector<double>, std::allocator<std::vector<double>>>::_Vector_impl_data" }
%"struct.std::_Vector_base<std::vector<double>, std::allocator<std::vector<double>>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%class.ITrainPredict = type { ptr, %"class.std::function" }
%"class.std::function" = type { %"class.std::_Function_base", ptr }
%"class.std::_Function_base" = type { %"union.std::_Any_data", ptr }
%"union.std::_Any_data" = type { %"union.std::_Nocopy_types" }
%"union.std::_Nocopy_types" = type { { i64, i64 } }
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<double, std::allocator<double>>::_Vector_impl" }
%"struct.std::_Vector_base<double, std::allocator<double>>::_Vector_impl" = type { %"struct.std::_Vector_base<double, std::allocator<double>>::_Vector_impl_data" }
%"struct.std::_Vector_base<double, std::allocator<double>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::future" = type { %"class.std::__basic_future" }
%"class.std::__basic_future" = type { %"class.std::shared_ptr" }
%"class.std::shared_ptr" = type { %"class.std::__shared_ptr" }
%"class.std::__shared_ptr" = type { ptr, %"class.std::__shared_count" }
%"class.std::__shared_count" = type { ptr }
%"class.std::mutex" = type { %"class.std::__mutex_base" }
%"class.std::__mutex_base" = type { %union.pthread_mutex_t }
%union.pthread_mutex_t = type { %struct.__pthread_mutex_s }
%struct.__pthread_mutex_s = type { i32, i32, i32, i32, i32, i16, i16, %struct.__pthread_internal_list }
%struct.__pthread_internal_list = type { ptr, ptr }

@_ZTV24simple_linear_regression = external dso_local unnamed_addr constant { [6 x ptr], [4 x ptr] }, align 8

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN24simple_linear_regressionC2Ev(ptr noundef nonnull align 8 dereferenceable(336) %0) unnamed_addr #0 align 2 {
  %2 = alloca ptr, align 8
  store ptr %0, ptr %2, align 8, !tbaa !5
  %3 = load ptr, ptr %2, align 8
  call void @_ZN11DataIOClassC2Ev(ptr noundef nonnull align 8 dereferenceable(80) %3)
  %4 = getelementptr inbounds i8, ptr %3, i64 80
  call void @_ZN13ITrainPredictC2Ev(ptr noundef nonnull align 8 dereferenceable(40) %4) #3
  store ptr getelementptr inbounds inrange(-16, 32) ({ [6 x ptr], [4 x ptr] }, ptr @_ZTV24simple_linear_regression, i32 0, i32 0, i32 2), ptr %3, align 8, !tbaa !9
  %5 = getelementptr inbounds i8, ptr %3, i64 80
  store ptr getelementptr inbounds inrange(-16, 16) ({ [6 x ptr], [4 x ptr] }, ptr @_ZTV24simple_linear_regression, i32 0, i32 1, i32 2), ptr %5, align 8, !tbaa !9
  %6 = getelementptr inbounds %class.simple_linear_regression, ptr %3, i32 0, i32 2
  store i32 0, ptr %6, align 8, !tbaa !11
  %7 = getelementptr inbounds %class.simple_linear_regression, ptr %3, i32 0, i32 3
  call void @_ZNSt6vectorIdSaIdEEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %7) #3
  %8 = getelementptr inbounds %class.simple_linear_regression, ptr %3, i32 0, i32 4
  call void @_ZNSt6vectorIdSaIdEEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %8) #3
  %9 = getelementptr inbounds %class.simple_linear_regression, ptr %3, i32 0, i32 5
  call void @_ZNSt6vectorIdSaIdEEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %9) #3
  %10 = getelementptr inbounds %class.simple_linear_regression, ptr %3, i32 0, i32 6
  call void @_ZNSt6vectorIdSaIdEEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %10) #3
  %11 = getelementptr inbounds %class.simple_linear_regression, ptr %3, i32 0, i32 8
  store double 0.000000e+00, ptr %11, align 8, !tbaa !35
  %12 = getelementptr inbounds %class.simple_linear_regression, ptr %3, i32 0, i32 9
  store double 0.000000e+00, ptr %12, align 8, !tbaa !36
  %13 = getelementptr inbounds %class.simple_linear_regression, ptr %3, i32 0, i32 10
  store double 0.000000e+00, ptr %13, align 8, !tbaa !37
  %14 = getelementptr inbounds %class.simple_linear_regression, ptr %3, i32 0, i32 11
  store double 0.000000e+00, ptr %14, align 8, !tbaa !38
  %15 = getelementptr inbounds %class.simple_linear_regression, ptr %3, i32 0, i32 12
  store double 0.000000e+00, ptr %15, align 8, !tbaa !39
  %16 = getelementptr inbounds %class.simple_linear_regression, ptr %3, i32 0, i32 13
  store double 0.000000e+00, ptr %16, align 8, !tbaa !40
  %17 = getelementptr inbounds %class.simple_linear_regression, ptr %3, i32 0, i32 14
  call void @_ZNSt6futureIvEC2Ev(ptr noundef nonnull align 8 dereferenceable(16) %17) #3
  %18 = getelementptr inbounds %class.simple_linear_regression, ptr %3, i32 0, i32 15
  call void @_ZNSt5mutexC2Ev(ptr noundef nonnull align 8 dereferenceable(40) %18) #3
  %19 = getelementptr inbounds %class.simple_linear_regression, ptr %3, i32 0, i32 7
  store i8 1, ptr %19, align 8, !tbaa !41
  ret void
}

declare void @_ZN11DataIOClassC2Ev(ptr noundef nonnull align 8 dereferenceable(80)) unnamed_addr #1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN13ITrainPredictC2Ev(ptr noundef nonnull align 8 dereferenceable(40)) unnamed_addr #2 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt6vectorIdSaIdEEC2Ev(ptr noundef nonnull align 8 dereferenceable(24)) unnamed_addr #2 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt6futureIvEC2Ev(ptr noundef nonnull align 8 dereferenceable(16)) unnamed_addr #2 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt5mutexC2Ev(ptr noundef nonnull align 8 dereferenceable(40)) unnamed_addr #2 align 2

attributes #0 = { 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 #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 = { 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 = !{!"vtable pointer", !8, i64 0}
!11 = !{!12, !25, i64 120}
!12 = !{!"_ZTS24simple_linear_regression", !13, i64 0, !22, i64 80, !25, i64 120, !14, i64 128, !14, i64 152, !14, i64 176, !14, i64 200, !26, i64 224, !27, i64 232, !27, i64 240, !27, i64 248, !27, i64 256, !27, i64 264, !27, i64 272, !28, i64 280, !33, i64 296}
!13 = !{!"_ZTS11DataIOClass", !14, i64 8, !18, i64 32, !14, i64 56}
!14 = !{!"_ZTSSt6vectorIdSaIdEE", !15, i64 0}
!15 = !{!"_ZTSSt12_Vector_baseIdSaIdEE", !16, i64 0}
!16 = !{!"_ZTSNSt12_Vector_baseIdSaIdEE12_Vector_implE", !17, i64 0}
!17 = !{!"_ZTSNSt12_Vector_baseIdSaIdEE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!18 = !{!"_ZTSSt6vectorIS_IdSaIdEESaIS1_EE", !19, i64 0}
!19 = !{!"_ZTSSt12_Vector_baseISt6vectorIdSaIdEESaIS2_EE", !20, i64 0}
!20 = !{!"_ZTSNSt12_Vector_baseISt6vectorIdSaIdEESaIS2_EE12_Vector_implE", !21, i64 0}
!21 = !{!"_ZTSNSt12_Vector_baseISt6vectorIdSaIdEESaIS2_EE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!22 = !{!"_ZTS13ITrainPredict", !23, i64 8}
!23 = !{!"_ZTSSt8functionIFvbEE", !24, i64 0, !6, i64 24}
!24 = !{!"_ZTSSt14_Function_base", !7, i64 0, !6, i64 16}
!25 = !{!"int", !7, i64 0}
!26 = !{!"bool", !7, i64 0}
!27 = !{!"double", !7, i64 0}
!28 = !{!"_ZTSSt6futureIvE", !29, i64 0}
!29 = !{!"_ZTSSt14__basic_futureIvE", !30, i64 0}
!30 = !{!"_ZTSSt10shared_ptrINSt13__future_base13_State_baseV2EE", !31, i64 0}
!31 = !{!"_ZTSSt12__shared_ptrINSt13__future_base13_State_baseV2ELN9__gnu_cxx12_Lock_policyE2EE", !6, i64 0, !32, i64 8}
!32 = !{!"_ZTSSt14__shared_countILN9__gnu_cxx12_Lock_policyE2EE", !6, i64 0}
!33 = !{!"_ZTSSt5mutex", !34, i64 0}
!34 = !{!"_ZTSSt12__mutex_base", !7, i64 0}
!35 = !{!12, !27, i64 232}
!36 = !{!12, !27, i64 240}
!37 = !{!12, !27, i64 248}
!38 = !{!12, !27, i64 256}
!39 = !{!12, !27, i64 264}
!40 = !{!12, !27, i64 272}
!41 = !{!12, !26, i64 224}


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

@_ZTV24simple_linear_regression = external dso_local unnamed_addr constant { [6 x ptr], [4 x ptr] }, align 8

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN24simple_linear_regressionC2Ev(ptr noundef nonnull align 8 dereferenceable(336) %0) unnamed_addr #0 align 2 {
  tail call void @_ZN11DataIOClassC2Ev(ptr noundef nonnull align 8 dereferenceable(80) %0)
  %2 = getelementptr inbounds i8, ptr %0, i64 80
  tail call void @_ZN13ITrainPredictC2Ev(ptr noundef nonnull align 8 dereferenceable(40) %2) #4
  store ptr getelementptr inbounds inrange(-16, 32) (i8, ptr @_ZTV24simple_linear_regression, i64 16), ptr %0, align 8, !tbaa !5
  store ptr getelementptr inbounds inrange(-16, 16) (i8, ptr @_ZTV24simple_linear_regression, i64 64), ptr %2, align 8, !tbaa !5
  %3 = getelementptr inbounds i8, ptr %0, i64 120
  store i32 0, ptr %3, align 8, !tbaa !8
  %4 = getelementptr inbounds i8, ptr %0, i64 128
  tail call void @_ZNSt6vectorIdSaIdEEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %4) #4
  %5 = getelementptr inbounds i8, ptr %0, i64 152
  tail call void @_ZNSt6vectorIdSaIdEEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %5) #4
  %6 = getelementptr inbounds i8, ptr %0, i64 176
  tail call void @_ZNSt6vectorIdSaIdEEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %6) #4
  %7 = getelementptr inbounds i8, ptr %0, i64 200
  tail call void @_ZNSt6vectorIdSaIdEEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %7) #4
  %8 = getelementptr inbounds i8, ptr %0, i64 232
  %9 = getelementptr inbounds i8, ptr %0, i64 280
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(48) %8, i8 0, i64 48, i1 false)
  tail call void @_ZNSt6futureIvEC2Ev(ptr noundef nonnull align 8 dereferenceable(16) %9) #4
  %10 = getelementptr inbounds i8, ptr %0, i64 296
  tail call void @_ZNSt5mutexC2Ev(ptr noundef nonnull align 8 dereferenceable(40) %10) #4
  %11 = getelementptr inbounds i8, ptr %0, i64 224
  store i8 1, ptr %11, align 8, !tbaa !34
  ret void
}

declare void @_ZN11DataIOClassC2Ev(ptr noundef nonnull align 8 dereferenceable(80)) unnamed_addr #1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN13ITrainPredictC2Ev(ptr noundef nonnull align 8 dereferenceable(40)) unnamed_addr #2 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt6vectorIdSaIdEEC2Ev(ptr noundef nonnull align 8 dereferenceable(24)) unnamed_addr #2 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt6futureIvEC2Ev(ptr noundef nonnull align 8 dereferenceable(16)) unnamed_addr #2 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt5mutexC2Ev(ptr noundef nonnull align 8 dereferenceable(40)) unnamed_addr #2 align 2

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #3

attributes #0 = { 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 #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 = { nocallback nofree nounwind willreturn memory(argmem: write) }
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 = !{!"vtable pointer", !7, i64 0}
!7 = !{!"Simple C++ TBAA"}
!8 = !{!9, !24, i64 120}
!9 = !{!"_ZTS24simple_linear_regression", !10, i64 0, !21, i64 80, !24, i64 120, !11, i64 128, !11, i64 152, !11, i64 176, !11, i64 200, !25, i64 224, !26, i64 232, !26, i64 240, !26, i64 248, !26, i64 256, !26, i64 264, !26, i64 272, !27, i64 280, !32, i64 296}
!10 = !{!"_ZTS11DataIOClass", !11, i64 8, !17, i64 32, !11, i64 56}
!11 = !{!"_ZTSSt6vectorIdSaIdEE", !12, i64 0}
!12 = !{!"_ZTSSt12_Vector_baseIdSaIdEE", !13, i64 0}
!13 = !{!"_ZTSNSt12_Vector_baseIdSaIdEE12_Vector_implE", !14, i64 0}
!14 = !{!"_ZTSNSt12_Vector_baseIdSaIdEE17_Vector_impl_dataE", !15, i64 0, !15, i64 8, !15, i64 16}
!15 = !{!"any pointer", !16, i64 0}
!16 = !{!"omnipotent char", !7, i64 0}
!17 = !{!"_ZTSSt6vectorIS_IdSaIdEESaIS1_EE", !18, i64 0}
!18 = !{!"_ZTSSt12_Vector_baseISt6vectorIdSaIdEESaIS2_EE", !19, i64 0}
!19 = !{!"_ZTSNSt12_Vector_baseISt6vectorIdSaIdEESaIS2_EE12_Vector_implE", !20, i64 0}
!20 = !{!"_ZTSNSt12_Vector_baseISt6vectorIdSaIdEESaIS2_EE17_Vector_impl_dataE", !15, i64 0, !15, i64 8, !15, i64 16}
!21 = !{!"_ZTS13ITrainPredict", !22, i64 8}
!22 = !{!"_ZTSSt8functionIFvbEE", !23, i64 0, !15, i64 24}
!23 = !{!"_ZTSSt14_Function_base", !16, i64 0, !15, i64 16}
!24 = !{!"int", !16, i64 0}
!25 = !{!"bool", !16, i64 0}
!26 = !{!"double", !16, i64 0}
!27 = !{!"_ZTSSt6futureIvE", !28, i64 0}
!28 = !{!"_ZTSSt14__basic_futureIvE", !29, i64 0}
!29 = !{!"_ZTSSt10shared_ptrINSt13__future_base13_State_baseV2EE", !30, i64 0}
!30 = !{!"_ZTSSt12__shared_ptrINSt13__future_base13_State_baseV2ELN9__gnu_cxx12_Lock_policyE2EE", !15, i64 0, !31, i64 8}
!31 = !{!"_ZTSSt14__shared_countILN9__gnu_cxx12_Lock_policyE2EE", !15, i64 0}
!32 = !{!"_ZTSSt5mutex", !33, i64 0}
!33 = !{!"_ZTSSt12__mutex_base", !16, i64 0}
!34 = !{!9, !25, i64 224}


; Effective O3 passes: EarlyCSEPass,InstCombinePass,MemCpyOptPass,SROAPass,TailCallElimPass