; LLVM IR from mickypaganini/SSI2016-jet-clustering :: spartyjet-4.0.2_mac/External/fastjet-3.0.0/src (ClusterSequence)

; 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.fastjet::ClusterSequence" = type <{ ptr, %"class.fastjet::JetDefinition", %"class.std::vector", %"class.std::vector.1", i8, [3 x i8], i32, double, double, double, double, i32, i32, %"class.fastjet::SharedPtr.6", i32, i8, i8, [2 x i8], %"class.fastjet::SharedPtr.7", %"class.std::vector.8", double, double, double, double, i32, i32, i32, [4 x i8] }>
%"class.fastjet::JetDefinition" = type { i32, double, double, i32, ptr, %"class.fastjet::SharedPtr", %"class.fastjet::JetDefinition::DefaultRecombiner", ptr, %"class.fastjet::SharedPtr.0" }
%"class.fastjet::SharedPtr" = type { ptr }
%"class.fastjet::JetDefinition::DefaultRecombiner" = type <{ %"class.fastjet::JetDefinition::Recombiner", i32, [4 x i8] }>
%"class.fastjet::JetDefinition::Recombiner" = 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<fastjet::PseudoJet, std::allocator<fastjet::PseudoJet>>::_Vector_impl" }
%"struct.std::_Vector_base<fastjet::PseudoJet, std::allocator<fastjet::PseudoJet>>::_Vector_impl" = type { %"struct.std::_Vector_base<fastjet::PseudoJet, std::allocator<fastjet::PseudoJet>>::_Vector_impl_data" }
%"struct.std::_Vector_base<fastjet::PseudoJet, std::allocator<fastjet::PseudoJet>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::vector.1" = type { %"struct.std::_Vector_base.2" }
%"struct.std::_Vector_base.2" = type { %"struct.std::_Vector_base<fastjet::ClusterSequence::history_element, std::allocator<fastjet::ClusterSequence::history_element>>::_Vector_impl" }
%"struct.std::_Vector_base<fastjet::ClusterSequence::history_element, std::allocator<fastjet::ClusterSequence::history_element>>::_Vector_impl" = type { %"struct.std::_Vector_base<fastjet::ClusterSequence::history_element, std::allocator<fastjet::ClusterSequence::history_element>>::_Vector_impl_data" }
%"struct.std::_Vector_base<fastjet::ClusterSequence::history_element, std::allocator<fastjet::ClusterSequence::history_element>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.fastjet::SharedPtr.6" = type { ptr }
%"class.fastjet::SharedPtr.7" = type { ptr }
%"class.std::vector.8" = type { %"struct.std::_Vector_base.9" }
%"struct.std::_Vector_base.9" = type { %"struct.std::_Vector_base<fastjet::ClusterSequence::Tile, std::allocator<fastjet::ClusterSequence::Tile>>::_Vector_impl" }
%"struct.std::_Vector_base<fastjet::ClusterSequence::Tile, std::allocator<fastjet::ClusterSequence::Tile>>::_Vector_impl" = type { %"struct.std::_Vector_base<fastjet::ClusterSequence::Tile, std::allocator<fastjet::ClusterSequence::Tile>>::_Vector_impl_data" }
%"struct.std::_Vector_base<fastjet::ClusterSequence::Tile, std::allocator<fastjet::ClusterSequence::Tile>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"struct.fastjet::ClusterSequence::history_element" = type { i32, i32, i32, i32, double, double }

@.str.2 = external hidden unnamed_addr constant [136 x i8], align 1
@.str.52 = external hidden unnamed_addr constant [11 x i8], align 1
@__PRETTY_FUNCTION__._ZNK7fastjet15ClusterSequence20exclusive_dmerge_maxERKi = external hidden unnamed_addr constant [73 x i8], align 1

; Function Attrs: noreturn nounwind
declare void @__assert_fail(ptr noundef, ptr noundef, i32 noundef, ptr noundef) #0

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(32) ptr @_ZNKSt6vectorIN7fastjet15ClusterSequence15history_elementESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) #1 align 2

; Function Attrs: mustprogress nounwind uwtable
define dso_local noundef double @_ZNK7fastjet15ClusterSequence20exclusive_dmerge_maxERKi(ptr noundef nonnull align 8 dereferenceable(276) %0, ptr noundef nonnull align 4 dereferenceable(4) %1) #1 align 2 {
  %3 = alloca double, align 8
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  store ptr %0, ptr %4, align 8, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !5
  %6 = load ptr, ptr %4, align 8
  %7 = load ptr, ptr %5, align 8, !tbaa !5
  %8 = load i32, ptr %7, align 4, !tbaa !9
  %9 = icmp sge i32 %8, 0
  br i1 %9, label %10, label %11

10:                                               ; preds = %2
  br label %13

11:                                               ; preds = %2
  call void @__assert_fail(ptr noundef @.str.52, ptr noundef @.str.2, i32 noundef 728, ptr noundef @__PRETTY_FUNCTION__._ZNK7fastjet15ClusterSequence20exclusive_dmerge_maxERKi) #2
  unreachable

12:                                               ; No predecessors!
  br label %13

13:                                               ; preds = %12, %10
  %14 = load ptr, ptr %5, align 8, !tbaa !5
  %15 = load i32, ptr %14, align 4, !tbaa !9
  %16 = getelementptr inbounds %"class.fastjet::ClusterSequence", ptr %6, i32 0, i32 6
  %17 = load i32, ptr %16, align 4, !tbaa !11
  %18 = icmp sge i32 %15, %17
  br i1 %18, label %19, label %20

19:                                               ; preds = %13
  store double 0.000000e+00, ptr %3, align 8
  br label %33

20:                                               ; preds = %13
  %21 = getelementptr inbounds %"class.fastjet::ClusterSequence", ptr %6, i32 0, i32 3
  %22 = getelementptr inbounds %"class.fastjet::ClusterSequence", ptr %6, i32 0, i32 6
  %23 = load i32, ptr %22, align 4, !tbaa !11
  %24 = mul nsw i32 2, %23
  %25 = load ptr, ptr %5, align 8, !tbaa !5
  %26 = load i32, ptr %25, align 4, !tbaa !9
  %27 = sub nsw i32 %24, %26
  %28 = sub nsw i32 %27, 1
  %29 = sext i32 %28 to i64
  %30 = call noundef nonnull align 8 dereferenceable(32) ptr @_ZNKSt6vectorIN7fastjet15ClusterSequence15history_elementESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %21, i64 noundef %29) #3
  %31 = getelementptr inbounds %"struct.fastjet::ClusterSequence::history_element", ptr %30, i32 0, i32 5
  %32 = load double, ptr %31, align 8, !tbaa !37
  store double %32, ptr %3, align 8
  br label %33

33:                                               ; preds = %20, %19
  %34 = load double, ptr %3, align 8
  ret double %34
}

attributes #0 = { noreturn 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 #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 = { noreturn nounwind }
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 = !{!"int", !7, i64 0}
!11 = !{!12, !10, i64 140}
!12 = !{!"_ZTSN7fastjet15ClusterSequenceE", !13, i64 8, !22, i64 88, !26, i64 112, !30, i64 136, !10, i64 140, !15, i64 144, !15, i64 152, !15, i64 160, !15, i64 168, !16, i64 176, !14, i64 180, !31, i64 184, !10, i64 192, !30, i64 196, !30, i64 197, !32, i64 200, !33, i64 208, !15, i64 232, !15, i64 240, !15, i64 248, !15, i64 256, !10, i64 264, !10, i64 268, !10, i64 272}
!13 = !{!"_ZTSN7fastjet13JetDefinitionE", !14, i64 0, !15, i64 8, !15, i64 16, !16, i64 24, !6, i64 32, !17, i64 40, !18, i64 48, !6, i64 64, !21, i64 72}
!14 = !{!"_ZTSN7fastjet12JetAlgorithmE", !7, i64 0}
!15 = !{!"double", !7, i64 0}
!16 = !{!"_ZTSN7fastjet8StrategyE", !7, i64 0}
!17 = !{!"_ZTSN7fastjet9SharedPtrIKNS_13JetDefinition6PluginEEE", !6, i64 0}
!18 = !{!"_ZTSN7fastjet13JetDefinition17DefaultRecombinerE", !19, i64 0, !20, i64 8}
!19 = !{!"_ZTSN7fastjet13JetDefinition10RecombinerE"}
!20 = !{!"_ZTSN7fastjet19RecombinationSchemeE", !7, i64 0}
!21 = !{!"_ZTSN7fastjet9SharedPtrIKNS_13JetDefinition10RecombinerEEE", !6, i64 0}
!22 = !{!"_ZTSSt6vectorIN7fastjet9PseudoJetESaIS1_EE", !23, i64 0}
!23 = !{!"_ZTSSt12_Vector_baseIN7fastjet9PseudoJetESaIS1_EE", !24, i64 0}
!24 = !{!"_ZTSNSt12_Vector_baseIN7fastjet9PseudoJetESaIS1_EE12_Vector_implE", !25, i64 0}
!25 = !{!"_ZTSNSt12_Vector_baseIN7fastjet9PseudoJetESaIS1_EE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!26 = !{!"_ZTSSt6vectorIN7fastjet15ClusterSequence15history_elementESaIS2_EE", !27, i64 0}
!27 = !{!"_ZTSSt12_Vector_baseIN7fastjet15ClusterSequence15history_elementESaIS2_EE", !28, i64 0}
!28 = !{!"_ZTSNSt12_Vector_baseIN7fastjet15ClusterSequence15history_elementESaIS2_EE12_Vector_implE", !29, i64 0}
!29 = !{!"_ZTSNSt12_Vector_baseIN7fastjet15ClusterSequence15history_elementESaIS2_EE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!30 = !{!"bool", !7, i64 0}
!31 = !{!"_ZTSN7fastjet9SharedPtrINS_22PseudoJetStructureBaseEEE", !6, i64 0}
!32 = !{!"_ZTSN7fastjet9SharedPtrINS_15ClusterSequence6ExtrasEEE", !6, i64 0}
!33 = !{!"_ZTSSt6vectorIN7fastjet15ClusterSequence4TileESaIS2_EE", !34, i64 0}
!34 = !{!"_ZTSSt12_Vector_baseIN7fastjet15ClusterSequence4TileESaIS2_EE", !35, i64 0}
!35 = !{!"_ZTSNSt12_Vector_baseIN7fastjet15ClusterSequence4TileESaIS2_EE12_Vector_implE", !36, i64 0}
!36 = !{!"_ZTSNSt12_Vector_baseIN7fastjet15ClusterSequence4TileESaIS2_EE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!37 = !{!38, !15, i64 24}
!38 = !{!"_ZTSN7fastjet15ClusterSequence15history_elementE", !10, i64 0, !10, i64 4, !10, i64 8, !10, i64 12, !15, i64 16, !15, i64 24}


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

@.str.2 = external hidden unnamed_addr constant [136 x i8], align 1
@.str.52 = external hidden unnamed_addr constant [11 x i8], align 1
@__PRETTY_FUNCTION__._ZNK7fastjet15ClusterSequence20exclusive_dmerge_maxERKi = external hidden unnamed_addr constant [73 x i8], align 1

; Function Attrs: noreturn nounwind
declare void @__assert_fail(ptr noundef, ptr noundef, i32 noundef, ptr noundef) local_unnamed_addr #0

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(32) ptr @_ZNKSt6vectorIN7fastjet15ClusterSequence15history_elementESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) local_unnamed_addr #1 align 2

; Function Attrs: mustprogress nounwind uwtable
define dso_local noundef double @_ZNK7fastjet15ClusterSequence20exclusive_dmerge_maxERKi(ptr noundef nonnull align 8 dereferenceable(276) %0, ptr nocapture noundef nonnull readonly align 4 dereferenceable(4) %1) local_unnamed_addr #1 align 2 {
  %3 = load i32, ptr %1, align 4, !tbaa !5
  %4 = icmp sgt i32 %3, -1
  br i1 %4, label %6, label %5

5:                                                ; preds = %2
  tail call void @__assert_fail(ptr noundef nonnull @.str.52, ptr noundef nonnull @.str.2, i32 noundef 728, ptr noundef nonnull @__PRETTY_FUNCTION__._ZNK7fastjet15ClusterSequence20exclusive_dmerge_maxERKi) #2
  unreachable

6:                                                ; preds = %2
  %7 = getelementptr inbounds i8, ptr %0, i64 140
  %8 = load i32, ptr %7, align 4, !tbaa !9
  %.not = icmp slt i32 %3, %8
  br i1 %.not, label %9, label %18

9:                                                ; preds = %6
  %10 = getelementptr inbounds i8, ptr %0, i64 112
  %11 = shl nuw nsw i32 %8, 1
  %12 = xor i32 %3, -1
  %13 = add nsw i32 %11, %12
  %14 = sext i32 %13 to i64
  %15 = tail call noundef nonnull align 8 dereferenceable(32) ptr @_ZNKSt6vectorIN7fastjet15ClusterSequence15history_elementESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %10, i64 noundef %14) #3
  %16 = getelementptr inbounds i8, ptr %15, i64 24
  %17 = load double, ptr %16, align 8, !tbaa !36
  br label %18

18:                                               ; preds = %6, %9
  %.0 = phi double [ %17, %9 ], [ 0.000000e+00, %6 ]
  ret double %.0
}

attributes #0 = { noreturn 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 #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 = { noreturn nounwind }
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 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !6, i64 140}
!10 = !{!"_ZTSN7fastjet15ClusterSequenceE", !11, i64 8, !21, i64 88, !25, i64 112, !29, i64 136, !6, i64 140, !13, i64 144, !13, i64 152, !13, i64 160, !13, i64 168, !14, i64 176, !12, i64 180, !30, i64 184, !6, i64 192, !29, i64 196, !29, i64 197, !31, i64 200, !32, i64 208, !13, i64 232, !13, i64 240, !13, i64 248, !13, i64 256, !6, i64 264, !6, i64 268, !6, i64 272}
!11 = !{!"_ZTSN7fastjet13JetDefinitionE", !12, i64 0, !13, i64 8, !13, i64 16, !14, i64 24, !15, i64 32, !16, i64 40, !17, i64 48, !15, i64 64, !20, i64 72}
!12 = !{!"_ZTSN7fastjet12JetAlgorithmE", !7, i64 0}
!13 = !{!"double", !7, i64 0}
!14 = !{!"_ZTSN7fastjet8StrategyE", !7, i64 0}
!15 = !{!"any pointer", !7, i64 0}
!16 = !{!"_ZTSN7fastjet9SharedPtrIKNS_13JetDefinition6PluginEEE", !15, i64 0}
!17 = !{!"_ZTSN7fastjet13JetDefinition17DefaultRecombinerE", !18, i64 0, !19, i64 8}
!18 = !{!"_ZTSN7fastjet13JetDefinition10RecombinerE"}
!19 = !{!"_ZTSN7fastjet19RecombinationSchemeE", !7, i64 0}
!20 = !{!"_ZTSN7fastjet9SharedPtrIKNS_13JetDefinition10RecombinerEEE", !15, i64 0}
!21 = !{!"_ZTSSt6vectorIN7fastjet9PseudoJetESaIS1_EE", !22, i64 0}
!22 = !{!"_ZTSSt12_Vector_baseIN7fastjet9PseudoJetESaIS1_EE", !23, i64 0}
!23 = !{!"_ZTSNSt12_Vector_baseIN7fastjet9PseudoJetESaIS1_EE12_Vector_implE", !24, i64 0}
!24 = !{!"_ZTSNSt12_Vector_baseIN7fastjet9PseudoJetESaIS1_EE17_Vector_impl_dataE", !15, i64 0, !15, i64 8, !15, i64 16}
!25 = !{!"_ZTSSt6vectorIN7fastjet15ClusterSequence15history_elementESaIS2_EE", !26, i64 0}
!26 = !{!"_ZTSSt12_Vector_baseIN7fastjet15ClusterSequence15history_elementESaIS2_EE", !27, i64 0}
!27 = !{!"_ZTSNSt12_Vector_baseIN7fastjet15ClusterSequence15history_elementESaIS2_EE12_Vector_implE", !28, i64 0}
!28 = !{!"_ZTSNSt12_Vector_baseIN7fastjet15ClusterSequence15history_elementESaIS2_EE17_Vector_impl_dataE", !15, i64 0, !15, i64 8, !15, i64 16}
!29 = !{!"bool", !7, i64 0}
!30 = !{!"_ZTSN7fastjet9SharedPtrINS_22PseudoJetStructureBaseEEE", !15, i64 0}
!31 = !{!"_ZTSN7fastjet9SharedPtrINS_15ClusterSequence6ExtrasEEE", !15, i64 0}
!32 = !{!"_ZTSSt6vectorIN7fastjet15ClusterSequence4TileESaIS2_EE", !33, i64 0}
!33 = !{!"_ZTSSt12_Vector_baseIN7fastjet15ClusterSequence4TileESaIS2_EE", !34, i64 0}
!34 = !{!"_ZTSNSt12_Vector_baseIN7fastjet15ClusterSequence4TileESaIS2_EE12_Vector_implE", !35, i64 0}
!35 = !{!"_ZTSNSt12_Vector_baseIN7fastjet15ClusterSequence4TileESaIS2_EE17_Vector_impl_dataE", !15, i64 0, !15, i64 8, !15, i64 16}
!36 = !{!37, !13, i64 24}
!37 = !{!"_ZTSN7fastjet15ClusterSequence15history_elementE", !6, i64 0, !6, i64 4, !6, i64 8, !6, i64 12, !13, i64 16, !13, i64 24}


; Effective O3 passes: EarlyCSEPass,GlobalOptPass,IPSCCPPass,InstCombinePass,PostOrderFunctionAttrsPass,ReassociatePass,SROAPass,SimplifyCFGPass,TailCallElimPass