; LLVM IR from mickypaganini/SSI2016-jet-clustering :: spartyjet-4.0.2_mac/ExternalTools (AngularCorrelation)

; 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.ACF = type { %struct.functiondata, %"class.std::vector", %"class.std::vector.14", i32, i32, double }
%struct.functiondata = type { [500 x double], [500 x double] }
%"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.14" = type { %"struct.std::_Vector_base.15" }
%"struct.std::_Vector_base.15" = type { %"struct.std::_Vector_base<particlepair, std::allocator<particlepair>>::_Vector_impl" }
%"struct.std::_Vector_base<particlepair, std::allocator<particlepair>>::_Vector_impl" = type { %"struct.std::_Vector_base<particlepair, std::allocator<particlepair>>::_Vector_impl_data" }
%"struct.std::_Vector_base<particlepair, std::allocator<particlepair>>::_Vector_impl_data" = type { ptr, ptr, ptr }

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

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

; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1

declare i32 @__gxx_personality_v0(...)

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

; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZNKSt6vectorIN7fastjet9PseudoJetESaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24)) #0 align 2

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(88) ptr @_ZNSt6vectorIN7fastjet9PseudoJetESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) #0 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN3ACF12ConstructACFEbd(ptr noundef nonnull align 8 dereferenceable(8064), i1 noundef zeroext, double noundef) #2 align 2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN3ACFC2ESt6vectorIN7fastjet9PseudoJetESaIS2_EEb(ptr noundef nonnull align 8 dereferenceable(8064) %0, ptr noundef %1, i1 noundef zeroext %2) unnamed_addr #2 align 2 personality ptr @__gxx_personality_v0 {
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca i8, align 1
  %7 = alloca i32, align 4
  %8 = alloca ptr, align 8
  %9 = alloca i32, align 4
  store ptr %0, ptr %4, align 8, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !5
  %10 = zext i1 %2 to i8
  store i8 %10, ptr %6, align 1, !tbaa !9
  %11 = load ptr, ptr %4, align 8
  %12 = getelementptr inbounds %class.ACF, ptr %11, i32 0, i32 0
  %13 = getelementptr inbounds %class.ACF, ptr %11, i32 0, i32 1
  call void @_ZNSt6vectorIN7fastjet9PseudoJetESaIS1_EEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %13) #3
  %14 = getelementptr inbounds %class.ACF, ptr %11, i32 0, i32 2
  call void @_ZNSt6vectorI12particlepairSaIS0_EEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %14) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #3
  store i32 0, ptr %7, align 4, !tbaa !11
  br label %15

15:                                               ; preds = %27, %3
  %16 = load i32, ptr %7, align 4, !tbaa !11
  %17 = call noundef i64 @_ZNKSt6vectorIN7fastjet9PseudoJetESaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %1) #3
  %18 = trunc i64 %17 to i32
  %19 = icmp slt i32 %16, %18
  br i1 %19, label %21, label %20

20:                                               ; preds = %15
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #3
  br label %34

21:                                               ; preds = %15
  %22 = getelementptr inbounds %class.ACF, ptr %11, i32 0, i32 1
  %23 = load i32, ptr %7, align 4, !tbaa !11
  %24 = sext i32 %23 to i64
  %25 = call noundef nonnull align 8 dereferenceable(88) ptr @_ZNSt6vectorIN7fastjet9PseudoJetESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %1, i64 noundef %24) #3
  invoke void @_ZNSt6vectorIN7fastjet9PseudoJetESaIS1_EE9push_backERKS1_(ptr noundef nonnull align 8 dereferenceable(24) %22, ptr noundef nonnull align 8 dereferenceable(88) %25)
          to label %26 unwind label %30

26:                                               ; preds = %21
  br label %27

27:                                               ; preds = %26
  %28 = load i32, ptr %7, align 4, !tbaa !11
  %29 = add nsw i32 %28, 1
  store i32 %29, ptr %7, align 4, !tbaa !11
  br label %15, !llvm.loop !13

30:                                               ; preds = %21
  %31 = landingpad { ptr, i32 }
          cleanup
  %32 = extractvalue { ptr, i32 } %31, 0
  store ptr %32, ptr %8, align 8
  %33 = extractvalue { ptr, i32 } %31, 1
  store i32 %33, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #3
  br label %46

34:                                               ; preds = %20
  %35 = getelementptr inbounds %class.ACF, ptr %11, i32 0, i32 1
  %36 = call noundef i64 @_ZNKSt6vectorIN7fastjet9PseudoJetESaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %35) #3
  %37 = trunc i64 %36 to i32
  %38 = getelementptr inbounds %class.ACF, ptr %11, i32 0, i32 3
  store i32 %37, ptr %38, align 8, !tbaa !15
  %39 = load i8, ptr %6, align 1, !tbaa !9, !range !27, !noundef !28
  %40 = trunc i8 %39 to i1
  invoke void @_ZN3ACF12ConstructACFEbd(ptr noundef nonnull align 8 dereferenceable(8064) %11, i1 noundef zeroext %40, double noundef 0.000000e+00)
          to label %41 unwind label %42

41:                                               ; preds = %34
  ret void

42:                                               ; preds = %34
  %43 = landingpad { ptr, i32 }
          cleanup
  %44 = extractvalue { ptr, i32 } %43, 0
  store ptr %44, ptr %8, align 8
  %45 = extractvalue { ptr, i32 } %43, 1
  store i32 %45, ptr %9, align 4
  br label %46

46:                                               ; preds = %42, %30
  call void @_ZNSt6vectorI12particlepairSaIS0_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %14) #3
  call void @_ZNSt6vectorIN7fastjet9PseudoJetESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %13) #3
  br label %47

47:                                               ; preds = %46
  %48 = load ptr, ptr %8, align 8
  %49 = load i32, ptr %9, align 4
  %50 = insertvalue { ptr, i32 } poison, ptr %48, 0
  %51 = insertvalue { ptr, i32 } %50, i32 %49, 1
  resume { ptr, i32 } %51
}

attributes #0 = { 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 #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { 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 = !{!"bool", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"int", !7, i64 0}
!13 = distinct !{!13, !14}
!14 = !{!"llvm.loop.mustprogress"}
!15 = !{!16, !12, i64 8048}
!16 = !{!"_ZTS3ACF", !17, i64 0, !18, i64 8000, !22, i64 8024, !12, i64 8048, !12, i64 8052, !26, i64 8056}
!17 = !{!"_ZTS12functiondata", !7, i64 0, !7, i64 4000}
!18 = !{!"_ZTSSt6vectorIN7fastjet9PseudoJetESaIS1_EE", !19, i64 0}
!19 = !{!"_ZTSSt12_Vector_baseIN7fastjet9PseudoJetESaIS1_EE", !20, i64 0}
!20 = !{!"_ZTSNSt12_Vector_baseIN7fastjet9PseudoJetESaIS1_EE12_Vector_implE", !21, i64 0}
!21 = !{!"_ZTSNSt12_Vector_baseIN7fastjet9PseudoJetESaIS1_EE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!22 = !{!"_ZTSSt6vectorI12particlepairSaIS0_EE", !23, i64 0}
!23 = !{!"_ZTSSt12_Vector_baseI12particlepairSaIS0_EE", !24, i64 0}
!24 = !{!"_ZTSNSt12_Vector_baseI12particlepairSaIS0_EE12_Vector_implE", !25, i64 0}
!25 = !{!"_ZTSNSt12_Vector_baseI12particlepairSaIS0_EE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!26 = !{!"double", !7, i64 0}
!27 = !{i8 0, i8 2}
!28 = !{}


; 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 nounwind uwtable
declare dso_local void @_ZNSt6vectorIN7fastjet9PseudoJetESaIS1_EEC2Ev(ptr noundef nonnull align 8 dereferenceable(24)) unnamed_addr #0 align 2

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

declare i32 @__gxx_personality_v0(...)

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZNKSt6vectorIN7fastjet9PseudoJetESaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #0 align 2

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN3ACF12ConstructACFEbd(ptr noundef nonnull align 8 dereferenceable(8064), i1 noundef zeroext, double noundef) local_unnamed_addr #1 align 2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN3ACFC2ESt6vectorIN7fastjet9PseudoJetESaIS2_EEb(ptr noundef nonnull align 8 dereferenceable(8064) %0, ptr noundef %1, i1 noundef zeroext %2) unnamed_addr #1 align 2 personality ptr @__gxx_personality_v0 {
  %4 = getelementptr inbounds i8, ptr %0, i64 8000
  tail call void @_ZNSt6vectorIN7fastjet9PseudoJetESaIS1_EEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %4) #2
  %5 = getelementptr inbounds i8, ptr %0, i64 8024
  tail call void @_ZNSt6vectorI12particlepairSaIS0_EEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %5) #2
  %6 = tail call noundef i64 @_ZNKSt6vectorIN7fastjet9PseudoJetESaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %1) #2
  %7 = trunc i64 %6 to i32
  %8 = icmp sgt i32 %7, 0
  br i1 %8, label %.lr.ph, label %._crit_edge

._crit_edge:                                      ; preds = %13, %3
  %9 = tail call noundef i64 @_ZNKSt6vectorIN7fastjet9PseudoJetESaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %4) #2
  %10 = trunc i64 %9 to i32
  %11 = getelementptr inbounds i8, ptr %0, i64 8048
  store i32 %10, ptr %11, align 8, !tbaa !5
  invoke void @_ZN3ACF12ConstructACFEbd(ptr noundef nonnull align 8 dereferenceable(8064) %0, i1 noundef zeroext %2, double noundef 0.000000e+00)
          to label %19 unwind label %20

.lr.ph:                                           ; preds = %3, %13
  %indvars.iv = phi i64 [ %indvars.iv.next, %13 ], [ 0, %3 ]
  %12 = tail call noundef nonnull align 8 dereferenceable(88) ptr @_ZNSt6vectorIN7fastjet9PseudoJetESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %1, i64 noundef %indvars.iv) #2
  invoke void @_ZNSt6vectorIN7fastjet9PseudoJetESaIS1_EE9push_backERKS1_(ptr noundef nonnull align 8 dereferenceable(24) %4, ptr noundef nonnull align 8 dereferenceable(88) %12)
          to label %13 unwind label %17

13:                                               ; preds = %.lr.ph
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %14 = tail call noundef i64 @_ZNKSt6vectorIN7fastjet9PseudoJetESaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %1) #2
  %sext = shl i64 %14, 32
  %15 = ashr exact i64 %sext, 32
  %16 = icmp slt i64 %indvars.iv.next, %15
  br i1 %16, label %.lr.ph, label %._crit_edge, !llvm.loop !21

17:                                               ; preds = %.lr.ph
  %18 = landingpad { ptr, i32 }
          cleanup
  br label %22

19:                                               ; preds = %._crit_edge
  ret void

20:                                               ; preds = %._crit_edge
  %21 = landingpad { ptr, i32 }
          cleanup
  br label %22

22:                                               ; preds = %20, %17
  %.pn = phi { ptr, i32 } [ %18, %17 ], [ %21, %20 ]
  tail call void @_ZNSt6vectorI12particlepairSaIS0_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %5) #2
  tail call void @_ZNSt6vectorIN7fastjet9PseudoJetESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %4) #2
  resume { ptr, i32 } %.pn
}

attributes #0 = { 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 #1 = { 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 #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, !19, i64 8048}
!6 = !{!"_ZTS3ACF", !7, i64 0, !10, i64 8000, !15, i64 8024, !19, i64 8048, !19, i64 8052, !20, i64 8056}
!7 = !{!"_ZTS12functiondata", !8, i64 0, !8, i64 4000}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!"_ZTSSt6vectorIN7fastjet9PseudoJetESaIS1_EE", !11, i64 0}
!11 = !{!"_ZTSSt12_Vector_baseIN7fastjet9PseudoJetESaIS1_EE", !12, i64 0}
!12 = !{!"_ZTSNSt12_Vector_baseIN7fastjet9PseudoJetESaIS1_EE12_Vector_implE", !13, i64 0}
!13 = !{!"_ZTSNSt12_Vector_baseIN7fastjet9PseudoJetESaIS1_EE17_Vector_impl_dataE", !14, i64 0, !14, i64 8, !14, i64 16}
!14 = !{!"any pointer", !8, i64 0}
!15 = !{!"_ZTSSt6vectorI12particlepairSaIS0_EE", !16, i64 0}
!16 = !{!"_ZTSSt12_Vector_baseI12particlepairSaIS0_EE", !17, i64 0}
!17 = !{!"_ZTSNSt12_Vector_baseI12particlepairSaIS0_EE12_Vector_implE", !18, i64 0}
!18 = !{!"_ZTSNSt12_Vector_baseI12particlepairSaIS0_EE17_Vector_impl_dataE", !14, i64 0, !14, i64 8, !14, i64 16}
!19 = !{!"int", !8, i64 0}
!20 = !{!"double", !8, i64 0}
!21 = distinct !{!21, !22}
!22 = !{!"llvm.loop.mustprogress"}


; Effective O3 passes: EarlyCSEPass,GlobalOptPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,SROAPass,SimplifyCFGPass,TailCallElimPass