; LLVM IR from mickypaganini/SSI2016-jet-clustering :: spartyjet-4.0.2_mac/JetCore/Jet.ll (ZN9SpartyJet3Jet12set_defaultsEv)

; 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.SpartyJet::Jet" = type { %"class.fastjet::PseudoJet", i8, i32, ptr, %"class.std::vector" }
%"class.fastjet::PseudoJet" = type { ptr, %"class.fastjet::SharedPtr", %"class.fastjet::SharedPtr.0", double, double, double, double, double, double, double, i32, i32 }
%"class.fastjet::SharedPtr" = type { ptr }
%"class.fastjet::SharedPtr.0" = type { ptr }
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<SpartyJet::Jet *, std::allocator<SpartyJet::Jet *>>::_Vector_impl" }
%"struct.std::_Vector_base<SpartyJet::Jet *, std::allocator<SpartyJet::Jet *>>::_Vector_impl" = type { %"struct.std::_Vector_base<SpartyJet::Jet *, std::allocator<SpartyJet::Jet *>>::_Vector_impl_data" }
%"struct.std::_Vector_base<SpartyJet::Jet *, std::allocator<SpartyJet::Jet *>>::_Vector_impl_data" = type { ptr, ptr, ptr }

declare i32 @__gxx_personality_v0(...)

; Function Attrs: nobuiltin allocsize(0)
declare noundef nonnull ptr @_Znwm(i64 noundef) #0

; Function Attrs: nobuiltin nounwind
declare void @_ZdlPvm(ptr noundef, i64 noundef) #1

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN9SpartyJet15HistoryProviderINS_14HistoryElementEE6setJetEPNS_3JetE(ptr noundef nonnull align 8 dereferenceable(80), ptr noundef) #2 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN7fastjet9PseudoJet13set_user_infoEPNS0_12UserInfoBaseE(ptr noundef nonnull align 8 dereferenceable(88), ptr noundef) #2 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN9SpartyJet17SpartyJetUserInfoC2EPNS_3JetE(ptr noundef nonnull align 8 dereferenceable(17), ptr noundef) unnamed_addr #2 align 2

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN9SpartyJet3Jet12set_defaultsEv(ptr noundef nonnull align 8 dereferenceable(128) %0) #2 align 2 personality ptr @__gxx_personality_v0 {
  %2 = alloca ptr, align 8
  %3 = alloca ptr, align 8
  %4 = alloca i32, align 4
  store ptr %0, ptr %2, align 8, !tbaa !5
  %5 = load ptr, ptr %2, align 8
  %6 = getelementptr inbounds %"class.SpartyJet::Jet", ptr %5, i32 0, i32 1
  store i8 0, ptr %6, align 8, !tbaa !9
  %7 = getelementptr inbounds %"class.SpartyJet::Jet", ptr %5, i32 0, i32 2
  store i32 0, ptr %7, align 4, !tbaa !21
  %8 = call noalias noundef nonnull ptr @_Znwm(i64 noundef 80) #3
  invoke void @_ZN9SpartyJet14HistoryElementC2Ev(ptr noundef nonnull align 8 dereferenceable(80) %8)
          to label %9 unwind label %15

9:                                                ; preds = %1
  %10 = getelementptr inbounds %"class.SpartyJet::Jet", ptr %5, i32 0, i32 3
  store ptr %8, ptr %10, align 8, !tbaa !22
  %11 = getelementptr inbounds %"class.SpartyJet::Jet", ptr %5, i32 0, i32 3
  %12 = load ptr, ptr %11, align 8, !tbaa !22
  call void @_ZN9SpartyJet15HistoryProviderINS_14HistoryElementEE6setJetEPNS_3JetE(ptr noundef nonnull align 8 dereferenceable(80) %12, ptr noundef %5)
  %13 = call noalias noundef nonnull ptr @_Znwm(i64 noundef 24) #3
  invoke void @_ZN9SpartyJet17SpartyJetUserInfoC2EPNS_3JetE(ptr noundef nonnull align 8 dereferenceable(17) %13, ptr noundef %5)
          to label %14 unwind label %19

14:                                               ; preds = %9
  call void @_ZN7fastjet9PseudoJet13set_user_infoEPNS0_12UserInfoBaseE(ptr noundef nonnull align 8 dereferenceable(88) %5, ptr noundef %13)
  ret void

15:                                               ; preds = %1
  %16 = landingpad { ptr, i32 }
          cleanup
  %17 = extractvalue { ptr, i32 } %16, 0
  store ptr %17, ptr %3, align 8
  %18 = extractvalue { ptr, i32 } %16, 1
  store i32 %18, ptr %4, align 4
  call void @_ZdlPvm(ptr noundef %8, i64 noundef 80) #4
  br label %23

19:                                               ; preds = %9
  %20 = landingpad { ptr, i32 }
          cleanup
  %21 = extractvalue { ptr, i32 } %20, 0
  store ptr %21, ptr %3, align 8
  %22 = extractvalue { ptr, i32 } %20, 1
  store i32 %22, ptr %4, align 4
  call void @_ZdlPvm(ptr noundef %13, i64 noundef 24) #4
  br label %23

23:                                               ; preds = %19, %15
  %24 = load ptr, ptr %3, align 8
  %25 = load i32, ptr %4, align 4
  %26 = insertvalue { ptr, i32 } poison, ptr %24, 0
  %27 = insertvalue { ptr, i32 } %26, i32 %25, 1
  resume { ptr, i32 } %27
}

attributes #0 = { nobuiltin allocsize(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 = { nobuiltin nounwind "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" }
attributes #3 = { builtin allocsize(0) }
attributes #4 = { builtin 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, !16, i64 88}
!10 = !{!"_ZTSN9SpartyJet3JetE", !11, i64 0, !16, i64 88, !15, i64 92, !6, i64 96, !17, i64 104}
!11 = !{!"_ZTSN7fastjet9PseudoJetE", !12, i64 8, !13, i64 16, !14, i64 24, !14, i64 32, !14, i64 40, !14, i64 48, !14, i64 56, !14, i64 64, !14, i64 72, !15, i64 80, !15, i64 84}
!12 = !{!"_ZTSN7fastjet9SharedPtrINS_22PseudoJetStructureBaseEEE", !6, i64 0}
!13 = !{!"_ZTSN7fastjet9SharedPtrINS_9PseudoJet12UserInfoBaseEEE", !6, i64 0}
!14 = !{!"double", !7, i64 0}
!15 = !{!"int", !7, i64 0}
!16 = !{!"bool", !7, i64 0}
!17 = !{!"_ZTSSt6vectorIPN9SpartyJet3JetESaIS2_EE", !18, i64 0}
!18 = !{!"_ZTSSt12_Vector_baseIPN9SpartyJet3JetESaIS2_EE", !19, i64 0}
!19 = !{!"_ZTSNSt12_Vector_baseIPN9SpartyJet3JetESaIS2_EE12_Vector_implE", !20, i64 0}
!20 = !{!"_ZTSNSt12_Vector_baseIPN9SpartyJet3JetESaIS2_EE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!21 = !{!10, !15, i64 92}
!22 = !{!10, !6, i64 96}


; 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 i32 @__gxx_personality_v0(...)

; Function Attrs: nobuiltin allocsize(0)
declare noundef nonnull ptr @_Znwm(i64 noundef) local_unnamed_addr #0

; Function Attrs: nobuiltin nounwind
declare void @_ZdlPvm(ptr noundef, i64 noundef) local_unnamed_addr #1

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN9SpartyJet15HistoryProviderINS_14HistoryElementEE6setJetEPNS_3JetE(ptr noundef nonnull align 8 dereferenceable(80), ptr noundef) local_unnamed_addr #2 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN7fastjet9PseudoJet13set_user_infoEPNS0_12UserInfoBaseE(ptr noundef nonnull align 8 dereferenceable(88), ptr noundef) local_unnamed_addr #2 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN9SpartyJet17SpartyJetUserInfoC2EPNS_3JetE(ptr noundef nonnull align 8 dereferenceable(17), ptr noundef) unnamed_addr #2 align 2

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN9SpartyJet3Jet12set_defaultsEv(ptr noundef nonnull align 8 dereferenceable(128) %0) local_unnamed_addr #2 align 2 personality ptr @__gxx_personality_v0 {
  %2 = getelementptr inbounds i8, ptr %0, i64 88
  store i8 0, ptr %2, align 8, !tbaa !5
  %3 = getelementptr inbounds i8, ptr %0, i64 92
  store i32 0, ptr %3, align 4, !tbaa !20
  %4 = tail call noalias noundef nonnull dereferenceable(80) ptr @_Znwm(i64 noundef 80) #3
  invoke void @_ZN9SpartyJet14HistoryElementC2Ev(ptr noundef nonnull align 8 dereferenceable(80) %4)
          to label %5 unwind label %9

5:                                                ; preds = %1
  %6 = getelementptr inbounds i8, ptr %0, i64 96
  store ptr %4, ptr %6, align 8, !tbaa !21
  tail call void @_ZN9SpartyJet15HistoryProviderINS_14HistoryElementEE6setJetEPNS_3JetE(ptr noundef nonnull align 8 dereferenceable(80) %4, ptr noundef nonnull %0)
  %7 = tail call noalias noundef nonnull dereferenceable(24) ptr @_Znwm(i64 noundef 24) #3
  invoke void @_ZN9SpartyJet17SpartyJetUserInfoC2EPNS_3JetE(ptr noundef nonnull align 8 dereferenceable(17) %7, ptr noundef nonnull %0)
          to label %8 unwind label %11

8:                                                ; preds = %5
  tail call void @_ZN7fastjet9PseudoJet13set_user_infoEPNS0_12UserInfoBaseE(ptr noundef nonnull align 8 dereferenceable(88) %0, ptr noundef nonnull %7)
  ret void

9:                                                ; preds = %1
  %10 = landingpad { ptr, i32 }
          cleanup
  tail call void @_ZdlPvm(ptr noundef nonnull %4, i64 noundef 80) #4
  br label %13

11:                                               ; preds = %5
  %12 = landingpad { ptr, i32 }
          cleanup
  tail call void @_ZdlPvm(ptr noundef nonnull %7, i64 noundef 24) #4
  br label %13

13:                                               ; preds = %11, %9
  %.pn = phi { ptr, i32 } [ %12, %11 ], [ %10, %9 ]
  resume { ptr, i32 } %.pn
}

attributes #0 = { nobuiltin allocsize(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 = { nobuiltin nounwind "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" }
attributes #3 = { builtin allocsize(0) }
attributes #4 = { builtin 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, !15, i64 88}
!6 = !{!"_ZTSN9SpartyJet3JetE", !7, i64 0, !15, i64 88, !14, i64 92, !9, i64 96, !16, i64 104}
!7 = !{!"_ZTSN7fastjet9PseudoJetE", !8, i64 8, !12, i64 16, !13, i64 24, !13, i64 32, !13, i64 40, !13, i64 48, !13, i64 56, !13, i64 64, !13, i64 72, !14, i64 80, !14, i64 84}
!8 = !{!"_ZTSN7fastjet9SharedPtrINS_22PseudoJetStructureBaseEEE", !9, i64 0}
!9 = !{!"any pointer", !10, i64 0}
!10 = !{!"omnipotent char", !11, i64 0}
!11 = !{!"Simple C++ TBAA"}
!12 = !{!"_ZTSN7fastjet9SharedPtrINS_9PseudoJet12UserInfoBaseEEE", !9, i64 0}
!13 = !{!"double", !10, i64 0}
!14 = !{!"int", !10, i64 0}
!15 = !{!"bool", !10, i64 0}
!16 = !{!"_ZTSSt6vectorIPN9SpartyJet3JetESaIS2_EE", !17, i64 0}
!17 = !{!"_ZTSSt12_Vector_baseIPN9SpartyJet3JetESaIS2_EE", !18, i64 0}
!18 = !{!"_ZTSNSt12_Vector_baseIPN9SpartyJet3JetESaIS2_EE12_Vector_implE", !19, i64 0}
!19 = !{!"_ZTSNSt12_Vector_baseIPN9SpartyJet3JetESaIS2_EE17_Vector_impl_dataE", !9, i64 0, !9, i64 8, !9, i64 16}
!20 = !{!6, !14, i64 92}
!21 = !{!6, !9, i64 96}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GlobalOptPass,InstCombinePass,SROAPass,TailCallElimPass