; LLVM IR from sp-nitech/SPTK :: third_party/REAPER/core/track.ll (ZN4sptk6reaper5Track8FillFromERKS1_)

; 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.sptk::reaper::Track" = type { i32, i32, %"class.sptk::reaper::FloatMatrix", %"class.std::vector", i8, float }
%"class.sptk::reaper::FloatMatrix" = type { ptr, i32, i32 }
%"class.std::vector" = type { %"struct.std::_Bvector_base" }
%"struct.std::_Bvector_base" = type { %"struct.std::_Bvector_base<std::allocator<bool>>::_Bvector_impl" }
%"struct.std::_Bvector_base<std::allocator<bool>>::_Bvector_impl" = type { %"struct.std::_Bvector_base<std::allocator<bool>>::_Bvector_impl_data" }
%"struct.std::_Bvector_base<std::allocator<bool>>::_Bvector_impl_data" = type { %"struct.std::_Bit_iterator", %"struct.std::_Bit_iterator", ptr }
%"struct.std::_Bit_iterator" = type { %"struct.std::_Bit_iterator_base.base", [4 x i8] }
%"struct.std::_Bit_iterator_base.base" = type <{ ptr, i32 }>

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN4sptk6reaper5Track8FillFromERKS1_(ptr noundef nonnull align 8 dereferenceable(72) %0, ptr noundef nonnull align 8 dereferenceable(72) %1) #0 align 2 {
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  store ptr %0, ptr %3, align 8, !tbaa !5
  store ptr %1, ptr %4, align 8, !tbaa !5
  %5 = load ptr, ptr %3, align 8
  %6 = load ptr, ptr %4, align 8, !tbaa !5
  %7 = getelementptr inbounds %"class.sptk::reaper::Track", ptr %6, i32 0, i32 0
  %8 = load i32, ptr %7, align 8, !tbaa !9
  %9 = getelementptr inbounds %"class.sptk::reaper::Track", ptr %5, i32 0, i32 0
  store i32 %8, ptr %9, align 8, !tbaa !9
  %10 = load ptr, ptr %4, align 8, !tbaa !5
  %11 = getelementptr inbounds %"class.sptk::reaper::Track", ptr %10, i32 0, i32 1
  %12 = load i32, ptr %11, align 4, !tbaa !21
  %13 = getelementptr inbounds %"class.sptk::reaper::Track", ptr %5, i32 0, i32 1
  store i32 %12, ptr %13, align 4, !tbaa !21
  %14 = load ptr, ptr %4, align 8, !tbaa !5
  %15 = getelementptr inbounds %"class.sptk::reaper::Track", ptr %14, i32 0, i32 5
  %16 = load float, ptr %15, align 4, !tbaa !22
  %17 = getelementptr inbounds %"class.sptk::reaper::Track", ptr %5, i32 0, i32 5
  store float %16, ptr %17, align 4, !tbaa !22
  %18 = load ptr, ptr %4, align 8, !tbaa !5
  %19 = getelementptr inbounds %"class.sptk::reaper::Track", ptr %18, i32 0, i32 2
  %20 = getelementptr inbounds %"class.sptk::reaper::Track", ptr %5, i32 0, i32 2
  call void @_ZN4sptk6reaper11FloatMatrixaSERKS1_(ptr noundef nonnull align 8 dereferenceable(16) %20, ptr noundef nonnull align 8 dereferenceable(16) %19)
  %21 = load ptr, ptr %4, align 8, !tbaa !5
  %22 = getelementptr inbounds %"class.sptk::reaper::Track", ptr %21, i32 0, i32 3
  %23 = getelementptr inbounds %"class.sptk::reaper::Track", ptr %5, i32 0, i32 3
  %24 = call noundef nonnull align 8 dereferenceable(40) ptr @_ZNSt6vectorIbSaIbEEaSERKS1_(ptr noundef nonnull align 8 dereferenceable(40) %23, ptr noundef nonnull align 8 dereferenceable(40) %22)
  %25 = load ptr, ptr %4, align 8, !tbaa !5
  %26 = getelementptr inbounds %"class.sptk::reaper::Track", ptr %25, i32 0, i32 4
  %27 = load i8, ptr %26, align 8, !tbaa !23, !range !24, !noundef !25
  %28 = trunc i8 %27 to i1
  %29 = getelementptr inbounds %"class.sptk::reaper::Track", ptr %5, i32 0, i32 4
  %30 = zext i1 %28 to i8
  store i8 %30, ptr %29, align 8, !tbaa !23
  ret void
}

declare void @_ZN4sptk6reaper11FloatMatrixaSERKS1_(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(16)) #1

; Function Attrs: mustprogress uwtable
declare dso_local noundef nonnull align 8 dereferenceable(40) ptr @_ZNSt6vectorIbSaIbEEaSERKS1_(ptr noundef nonnull align 8 dereferenceable(40), ptr noundef nonnull align 8 dereferenceable(40)) #0 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" }

!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, !11, i64 0}
!10 = !{!"_ZTSN4sptk6reaper5TrackE", !11, i64 0, !11, i64 4, !12, i64 8, !13, i64 24, !19, i64 64, !20, i64 68}
!11 = !{!"int", !7, i64 0}
!12 = !{!"_ZTSN4sptk6reaper11FloatMatrixE", !6, i64 0, !11, i64 8, !11, i64 12}
!13 = !{!"_ZTSSt6vectorIbSaIbEE", !14, i64 0}
!14 = !{!"_ZTSSt13_Bvector_baseISaIbEE", !15, i64 0}
!15 = !{!"_ZTSNSt13_Bvector_baseISaIbEE13_Bvector_implE", !16, i64 0}
!16 = !{!"_ZTSNSt13_Bvector_baseISaIbEE18_Bvector_impl_dataE", !17, i64 0, !17, i64 16, !6, i64 32}
!17 = !{!"_ZTSSt13_Bit_iterator", !18, i64 0}
!18 = !{!"_ZTSSt18_Bit_iterator_base", !6, i64 0, !11, i64 8}
!19 = !{!"bool", !7, i64 0}
!20 = !{!"float", !7, i64 0}
!21 = !{!10, !11, i64 4}
!22 = !{!10, !20, i64 68}
!23 = !{!10, !19, i64 64}
!24 = !{i8 0, i8 2}
!25 = !{}


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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN4sptk6reaper5Track8FillFromERKS1_(ptr noundef nonnull align 8 dereferenceable(72) %0, ptr noundef nonnull align 8 dereferenceable(72) %1) local_unnamed_addr #0 align 2 {
  %3 = load <2 x i32>, ptr %1, align 8, !tbaa !5
  store <2 x i32> %3, ptr %0, align 8, !tbaa !5
  %4 = getelementptr inbounds i8, ptr %1, i64 68
  %5 = load float, ptr %4, align 4, !tbaa !9
  %6 = getelementptr inbounds i8, ptr %0, i64 68
  store float %5, ptr %6, align 4, !tbaa !9
  %7 = getelementptr inbounds i8, ptr %1, i64 8
  %8 = getelementptr inbounds i8, ptr %0, i64 8
  tail call void @_ZN4sptk6reaper11FloatMatrixaSERKS1_(ptr noundef nonnull align 8 dereferenceable(16) %8, ptr noundef nonnull align 8 dereferenceable(16) %7)
  %9 = getelementptr inbounds i8, ptr %1, i64 24
  %10 = getelementptr inbounds i8, ptr %0, i64 24
  %11 = tail call noundef nonnull align 8 dereferenceable(40) ptr @_ZNSt6vectorIbSaIbEEaSERKS1_(ptr noundef nonnull align 8 dereferenceable(40) %10, ptr noundef nonnull align 8 dereferenceable(40) %9)
  %12 = getelementptr inbounds i8, ptr %1, i64 64
  %13 = load i8, ptr %12, align 8, !tbaa !21, !range !22, !noundef !23
  %14 = getelementptr inbounds i8, ptr %0, i64 64
  store i8 %13, ptr %14, align 8, !tbaa !21
  ret void
}

declare void @_ZN4sptk6reaper11FloatMatrixaSERKS1_(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(16)) local_unnamed_addr #1

; Function Attrs: mustprogress uwtable
declare dso_local noundef nonnull align 8 dereferenceable(40) ptr @_ZNSt6vectorIbSaIbEEaSERKS1_(ptr noundef nonnull align 8 dereferenceable(40), ptr noundef nonnull align 8 dereferenceable(40)) local_unnamed_addr #0 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" }

!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 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !20, i64 68}
!10 = !{!"_ZTSN4sptk6reaper5TrackE", !6, i64 0, !6, i64 4, !11, i64 8, !13, i64 24, !19, i64 64, !20, i64 68}
!11 = !{!"_ZTSN4sptk6reaper11FloatMatrixE", !12, i64 0, !6, i64 8, !6, i64 12}
!12 = !{!"any pointer", !7, i64 0}
!13 = !{!"_ZTSSt6vectorIbSaIbEE", !14, i64 0}
!14 = !{!"_ZTSSt13_Bvector_baseISaIbEE", !15, i64 0}
!15 = !{!"_ZTSNSt13_Bvector_baseISaIbEE13_Bvector_implE", !16, i64 0}
!16 = !{!"_ZTSNSt13_Bvector_baseISaIbEE18_Bvector_impl_dataE", !17, i64 0, !17, i64 16, !12, i64 32}
!17 = !{!"_ZTSSt13_Bit_iterator", !18, i64 0}
!18 = !{!"_ZTSSt18_Bit_iterator_base", !12, i64 0, !6, i64 8}
!19 = !{!"bool", !7, i64 0}
!20 = !{!"float", !7, i64 0}
!21 = !{!10, !19, i64 64}
!22 = !{i8 0, i8 2}
!23 = !{}


; Effective O3 passes: EarlyCSEPass,GlobalOptPass,IPSCCPPass,InstCombinePass,SLPVectorizerPass,SROAPass,TailCallElimPass