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

@.str.2 = external hidden unnamed_addr constant [136 x i8], align 1
@.str.58 = external hidden unnamed_addr constant [34 x i8], align 1
@__PRETTY_FUNCTION__._ZNK7fastjet15ClusterSequence13object_in_jetERKNS_9PseudoJetES3_ = external hidden unnamed_addr constant [89 x i8], align 1

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

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZNK7fastjet9PseudoJet18cluster_hist_indexEv(ptr noundef nonnull align 8 dereferenceable(88)) #2 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZNK7fastjet15ClusterSequence8containsERKNS_9PseudoJetE(ptr noundef nonnull align 8 dereferenceable(276), ptr noundef nonnull align 8 dereferenceable(88)) #3 align 2

; Function Attrs: mustprogress uwtable
define dso_local noundef zeroext i1 @_ZNK7fastjet15ClusterSequence13object_in_jetERKNS_9PseudoJetES3_(ptr noundef nonnull align 8 dereferenceable(276) %0, ptr noundef nonnull align 8 dereferenceable(88) %1, ptr noundef nonnull align 8 dereferenceable(88) %2) #3 align 2 {
  %4 = alloca i1, align 1
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca ptr, align 8
  %10 = alloca i32, align 4
  store ptr %0, ptr %5, align 8, !tbaa !5
  store ptr %1, ptr %6, align 8, !tbaa !5
  store ptr %2, ptr %7, align 8, !tbaa !5
  %11 = load ptr, ptr %5, align 8
  %12 = load ptr, ptr %6, align 8, !tbaa !5
  %13 = call noundef zeroext i1 @_ZNK7fastjet15ClusterSequence8containsERKNS_9PseudoJetE(ptr noundef nonnull align 8 dereferenceable(276) %11, ptr noundef nonnull align 8 dereferenceable(88) %12)
  br i1 %13, label %14, label %17

14:                                               ; preds = %3
  %15 = load ptr, ptr %7, align 8, !tbaa !5
  %16 = call noundef zeroext i1 @_ZNK7fastjet15ClusterSequence8containsERKNS_9PseudoJetE(ptr noundef nonnull align 8 dereferenceable(276) %11, ptr noundef nonnull align 8 dereferenceable(88) %15)
  br label %17

17:                                               ; preds = %14, %3
  %18 = phi i1 [ false, %3 ], [ %16, %14 ]
  br i1 %18, label %19, label %20

19:                                               ; preds = %17
  br label %22

20:                                               ; preds = %17
  call void @__assert_fail(ptr noundef @.str.58, ptr noundef @.str.2, i32 noundef 904, ptr noundef @__PRETTY_FUNCTION__._ZNK7fastjet15ClusterSequence13object_in_jetERKNS_9PseudoJetES3_) #4
  unreachable

21:                                               ; No predecessors!
  br label %22

22:                                               ; preds = %21, %19
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #5
  %23 = load ptr, ptr %6, align 8, !tbaa !5
  store ptr %23, ptr %8, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #5
  br label %24

24:                                               ; preds = %39, %22
  br label %25

25:                                               ; preds = %24
  %26 = load ptr, ptr %8, align 8, !tbaa !5
  %27 = call noundef i32 @_ZNK7fastjet9PseudoJet18cluster_hist_indexEv(ptr noundef nonnull align 8 dereferenceable(88) %26)
  %28 = load ptr, ptr %7, align 8, !tbaa !5
  %29 = call noundef i32 @_ZNK7fastjet9PseudoJet18cluster_hist_indexEv(ptr noundef nonnull align 8 dereferenceable(88) %28)
  %30 = icmp eq i32 %27, %29
  br i1 %30, label %31, label %32

31:                                               ; preds = %25
  store i1 true, ptr %4, align 1
  store i32 1, ptr %10, align 4
  br label %40

32:                                               ; preds = %25
  %33 = load ptr, ptr %8, align 8, !tbaa !5
  %34 = call noundef zeroext i1 @_ZNK7fastjet15ClusterSequence9has_childERKNS_9PseudoJetERPS2_(ptr noundef nonnull align 8 dereferenceable(276) %11, ptr noundef nonnull align 8 dereferenceable(88) %33, ptr noundef nonnull align 8 dereferenceable(8) %9)
  br i1 %34, label %35, label %37

35:                                               ; preds = %32
  %36 = load ptr, ptr %9, align 8, !tbaa !5
  store ptr %36, ptr %8, align 8, !tbaa !5
  br label %38

37:                                               ; preds = %32
  store i1 false, ptr %4, align 1
  store i32 1, ptr %10, align 4
  br label %40

38:                                               ; preds = %35
  br label %39

39:                                               ; preds = %38
  br label %24, !llvm.loop !9

40:                                               ; preds = %37, %31
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #5
  %41 = load i1, ptr %4, align 1
  ret i1 %41
}

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZNK7fastjet15ClusterSequence9has_childERKNS_9PseudoJetERPS2_(ptr noundef nonnull align 8 dereferenceable(276), ptr noundef nonnull align 8 dereferenceable(88), ptr noundef nonnull align 8 dereferenceable(8)) #3 align 2

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #2 = { inlinehint 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 #3 = { 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 #4 = { noreturn nounwind }
attributes #5 = { 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 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}


; 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.58 = external hidden unnamed_addr constant [34 x i8], align 1
@__PRETTY_FUNCTION__._ZNK7fastjet15ClusterSequence13object_in_jetERKNS_9PseudoJetES3_ = external hidden unnamed_addr constant [89 x i8], align 1

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

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZNK7fastjet9PseudoJet18cluster_hist_indexEv(ptr noundef nonnull align 8 dereferenceable(88)) local_unnamed_addr #2 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZNK7fastjet15ClusterSequence8containsERKNS_9PseudoJetE(ptr noundef nonnull align 8 dereferenceable(276), ptr noundef nonnull align 8 dereferenceable(88)) local_unnamed_addr #3 align 2

; Function Attrs: mustprogress uwtable
define dso_local noundef zeroext i1 @_ZNK7fastjet15ClusterSequence13object_in_jetERKNS_9PseudoJetES3_(ptr noundef nonnull align 8 dereferenceable(276) %0, ptr noundef nonnull align 8 dereferenceable(88) %1, ptr noundef nonnull align 8 dereferenceable(88) %2) local_unnamed_addr #3 align 2 {
  %4 = alloca ptr, align 8
  %5 = tail call noundef zeroext i1 @_ZNK7fastjet15ClusterSequence8containsERKNS_9PseudoJetE(ptr noundef nonnull align 8 dereferenceable(276) %0, ptr noundef nonnull align 8 dereferenceable(88) %1)
  br i1 %5, label %6, label %.critedge

6:                                                ; preds = %3
  %7 = tail call noundef zeroext i1 @_ZNK7fastjet15ClusterSequence8containsERKNS_9PseudoJetE(ptr noundef nonnull align 8 dereferenceable(276) %0, ptr noundef nonnull align 8 dereferenceable(88) %2)
  br i1 %7, label %8, label %.critedge

.critedge:                                        ; preds = %3, %6
  tail call void @__assert_fail(ptr noundef nonnull @.str.58, ptr noundef nonnull @.str.2, i32 noundef 904, ptr noundef nonnull @__PRETTY_FUNCTION__._ZNK7fastjet15ClusterSequence13object_in_jetERKNS_9PseudoJetES3_) #4
  unreachable

8:                                                ; preds = %6
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #5
  %9 = tail call noundef i32 @_ZNK7fastjet9PseudoJet18cluster_hist_indexEv(ptr noundef nonnull align 8 dereferenceable(88) %1)
  %10 = tail call noundef i32 @_ZNK7fastjet9PseudoJet18cluster_hist_indexEv(ptr noundef nonnull align 8 dereferenceable(88) %2)
  %11 = icmp eq i32 %9, %10
  br i1 %11, label %._crit_edge, label %.lr.ph

.lr.ph:                                           ; preds = %8, %13
  %.09 = phi ptr [ %14, %13 ], [ %1, %8 ]
  %12 = call noundef zeroext i1 @_ZNK7fastjet15ClusterSequence9has_childERKNS_9PseudoJetERPS2_(ptr noundef nonnull align 8 dereferenceable(276) %0, ptr noundef nonnull align 8 dereferenceable(88) %.09, ptr noundef nonnull align 8 dereferenceable(8) %4)
  br i1 %12, label %13, label %._crit_edge

13:                                               ; preds = %.lr.ph
  %14 = load ptr, ptr %4, align 8, !tbaa !5
  %15 = call noundef i32 @_ZNK7fastjet9PseudoJet18cluster_hist_indexEv(ptr noundef nonnull align 8 dereferenceable(88) %14)
  %16 = call noundef i32 @_ZNK7fastjet9PseudoJet18cluster_hist_indexEv(ptr noundef nonnull align 8 dereferenceable(88) %2)
  %17 = icmp eq i32 %15, %16
  br i1 %17, label %._crit_edge, label %.lr.ph, !llvm.loop !9

._crit_edge:                                      ; preds = %13, %.lr.ph, %8
  %.lcssa = phi i1 [ true, %8 ], [ %12, %.lr.ph ], [ %12, %13 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #5
  ret i1 %.lcssa
}

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZNK7fastjet15ClusterSequence9has_childERKNS_9PseudoJetERPS2_(ptr noundef nonnull align 8 dereferenceable(276), ptr noundef nonnull align 8 dereferenceable(88), ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #3 align 2

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #2 = { inlinehint 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 #3 = { 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 #4 = { noreturn nounwind }
attributes #5 = { 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 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}


; Effective O3 passes: CorrelatedValuePropagationPass,GVNPass,GlobalOptPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,SROAPass,SimplifyCFGPass,TailCallElimPass