; LLVM IR from CRAFT-THU/BSim :: src/synapse/static/StaticSynapse.ll (ZN13StaticSynapseC2ERKS_)

; 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.StaticSynapse = type { %class.SynapseBase.base, float, float, %"class.std::__cxx11::list" }
%class.SynapseBase.base = type <{ %class.Base, ptr, float, i32, i8 }>
%class.Base = type { ptr, i32, i32 }
%"class.std::__cxx11::list" = type { %"class.std::__cxx11::_List_base" }
%"class.std::__cxx11::_List_base" = type { %"struct.std::__cxx11::_List_base<int, std::allocator<int>>::_List_impl" }
%"struct.std::__cxx11::_List_base<int, std::allocator<int>>::_List_impl" = type { %"struct.std::__detail::_List_node_header" }
%"struct.std::__detail::_List_node_header" = type { %"struct.std::__detail::_List_node_base", i64 }
%"struct.std::__detail::_List_node_base" = type { ptr, ptr }
%class.SynapseBase = type <{ %class.Base, ptr, float, i32, i8, [7 x i8] }>

@_ZTV13StaticSynapse = external dso_local unnamed_addr constant { [13 x ptr] }, align 8

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN11SynapseBaseC2Eifi(ptr noundef nonnull align 8 dereferenceable(33), i32 noundef, float noundef, i32 noundef) unnamed_addr #0 align 2

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN13StaticSynapseC2ERKS_(ptr noundef nonnull align 8 dereferenceable(72) %0, ptr noundef nonnull align 8 dereferenceable(72) %1) unnamed_addr #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
  call void @_ZN11SynapseBaseC2Eifi(ptr noundef nonnull align 8 dereferenceable(33) %5, i32 noundef 0, float noundef 0.000000e+00, i32 noundef 0)
  store ptr getelementptr inbounds inrange(-16, 88) ({ [13 x ptr] }, ptr @_ZTV13StaticSynapse, i32 0, i32 0, i32 2), ptr %5, align 8, !tbaa !9
  %6 = getelementptr inbounds %class.StaticSynapse, ptr %5, i32 0, i32 3
  call void @_ZNSt7__cxx114listIiSaIiEEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %6) #2
  %7 = load ptr, ptr %4, align 8, !tbaa !5
  %8 = getelementptr inbounds %class.SynapseBase, ptr %7, i32 0, i32 2
  %9 = load float, ptr %8, align 8, !tbaa !11
  %10 = getelementptr inbounds %class.SynapseBase, ptr %5, i32 0, i32 2
  store float %9, ptr %10, align 8, !tbaa !11
  %11 = load ptr, ptr %4, align 8, !tbaa !5
  %12 = getelementptr inbounds %class.StaticSynapse, ptr %11, i32 0, i32 1
  %13 = load float, ptr %12, align 4, !tbaa !17
  %14 = getelementptr inbounds %class.StaticSynapse, ptr %5, i32 0, i32 1
  store float %13, ptr %14, align 4, !tbaa !17
  %15 = load ptr, ptr %4, align 8, !tbaa !5
  %16 = getelementptr inbounds %class.StaticSynapse, ptr %15, i32 0, i32 2
  %17 = load float, ptr %16, align 8, !tbaa !25
  %18 = getelementptr inbounds %class.StaticSynapse, ptr %5, i32 0, i32 2
  store float %17, ptr %18, align 8, !tbaa !25
  %19 = getelementptr inbounds %class.SynapseBase, ptr %5, i32 0, i32 4
  store i8 0, ptr %19, align 8, !tbaa !26
  ret void
}

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 = { 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 = { 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, !15, i64 24}
!12 = !{!"_ZTS11SynapseBase", !13, i64 0, !6, i64 16, !15, i64 24, !14, i64 28, !16, i64 32}
!13 = !{!"_ZTS4Base", !14, i64 8, !14, i64 12}
!14 = !{!"int", !7, i64 0}
!15 = !{!"float", !7, i64 0}
!16 = !{!"bool", !7, i64 0}
!17 = !{!18, !15, i64 36}
!18 = !{!"_ZTS13StaticSynapse", !12, i64 0, !15, i64 36, !15, i64 40, !19, i64 48}
!19 = !{!"_ZTSNSt7__cxx114listIiSaIiEEE", !20, i64 0}
!20 = !{!"_ZTSNSt7__cxx1110_List_baseIiSaIiEEE", !21, i64 0}
!21 = !{!"_ZTSNSt7__cxx1110_List_baseIiSaIiEE10_List_implE", !22, i64 0}
!22 = !{!"_ZTSNSt8__detail17_List_node_headerE", !23, i64 0, !24, i64 16}
!23 = !{!"_ZTSNSt8__detail15_List_node_baseE", !6, i64 0, !6, i64 8}
!24 = !{!"long", !7, i64 0}
!25 = !{!18, !15, i64 40}
!26 = !{!12, !16, i64 32}


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

@_ZTV13StaticSynapse = external dso_local unnamed_addr constant { [13 x ptr] }, align 8

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN11SynapseBaseC2Eifi(ptr noundef nonnull align 8 dereferenceable(33), i32 noundef, float noundef, i32 noundef) unnamed_addr #0 align 2

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN13StaticSynapseC2ERKS_(ptr noundef nonnull align 8 dereferenceable(72) %0, ptr nocapture noundef nonnull readonly align 8 dereferenceable(72) %1) unnamed_addr #0 align 2 {
  tail call void @_ZN11SynapseBaseC2Eifi(ptr noundef nonnull align 8 dereferenceable(33) %0, i32 noundef 0, float noundef 0.000000e+00, i32 noundef 0)
  store ptr getelementptr inbounds inrange(-16, 88) (i8, ptr @_ZTV13StaticSynapse, i64 16), ptr %0, align 8, !tbaa !5
  %3 = getelementptr inbounds i8, ptr %0, i64 48
  tail call void @_ZNSt7__cxx114listIiSaIiEEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %3) #2
  %4 = getelementptr inbounds i8, ptr %1, i64 24
  %5 = load float, ptr %4, align 8, !tbaa !8
  %6 = getelementptr inbounds i8, ptr %0, i64 24
  store float %5, ptr %6, align 8, !tbaa !8
  %7 = getelementptr inbounds i8, ptr %1, i64 36
  %8 = getelementptr inbounds i8, ptr %0, i64 36
  %9 = load <2 x float>, ptr %7, align 4, !tbaa !16
  store <2 x float> %9, ptr %8, align 4, !tbaa !16
  %10 = getelementptr inbounds i8, ptr %0, i64 32
  store i8 0, ptr %10, align 8, !tbaa !17
  ret void
}

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 = { 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 = { 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, !14, i64 24}
!9 = !{!"_ZTS11SynapseBase", !10, i64 0, !13, i64 16, !14, i64 24, !11, i64 28, !15, i64 32}
!10 = !{!"_ZTS4Base", !11, i64 8, !11, i64 12}
!11 = !{!"int", !12, i64 0}
!12 = !{!"omnipotent char", !7, i64 0}
!13 = !{!"any pointer", !12, i64 0}
!14 = !{!"float", !12, i64 0}
!15 = !{!"bool", !12, i64 0}
!16 = !{!14, !14, i64 0}
!17 = !{!9, !15, i64 32}


; Effective O3 passes: InstCombinePass,PostOrderFunctionAttrsPass,SLPVectorizerPass,SROAPass,TailCallElimPass