; LLVM IR from mickypaganini/SSI2016-jet-clustering :: spartyjet-4.0.2_mac/External/fastjet-3.0.0/plugins/SISCone/siscone/siscone/has_7b137628 (9CmomentumE)

; 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.siscone::Cmomentum" = type <{ double, double, double, double, double, double, i32, i32, %"class.siscone::Creference", [4 x i8] }>
%"class.siscone::Creference" = type { [3 x i32] }
%"class.siscone::hash_cones" = type { ptr, i32, i32, double }
%"class.siscone::hash_element" = type { %"class.siscone::Creference", double, double, i8, ptr }

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

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

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN7siscone12hash_elementC2Ev(ptr noundef nonnull align 8 dereferenceable(48)) unnamed_addr #3 align 2

declare i32 @__gxx_personality_v0(...)

declare noundef nonnull align 4 dereferenceable(12) ptr @_ZN7siscone10CreferenceaSERKS0_(ptr noundef nonnull align 4 dereferenceable(12), ptr noundef nonnull align 4 dereferenceable(12)) #4

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZN7sisconeeqERKNS_10CreferenceES2_(ptr noundef nonnull align 4 dereferenceable(12), ptr noundef nonnull align 4 dereferenceable(12)) #5

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_ZN7siscone10hash_cones6insertEPNS_9CmomentumE(ptr noundef nonnull align 8 dereferenceable(24) %0, ptr noundef %1) #6 align 2 personality ptr @__gxx_personality_v0 {
  %3 = alloca i32, align 4
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca i32, align 4
  %8 = alloca ptr, align 8
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  store ptr %0, ptr %4, align 8, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !5
  %11 = load ptr, ptr %4, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #7
  %12 = load ptr, ptr %5, align 8, !tbaa !5
  %13 = getelementptr inbounds %"class.siscone::Cmomentum", ptr %12, i32 0, i32 8
  %14 = getelementptr inbounds %"class.siscone::Creference", ptr %13, i32 0, i32 0
  %15 = getelementptr inbounds [3 x i32], ptr %14, i64 0, i64 0
  %16 = load i32, ptr %15, align 8, !tbaa !9
  %17 = getelementptr inbounds %"class.siscone::hash_cones", ptr %11, i32 0, i32 2
  %18 = load i32, ptr %17, align 4, !tbaa !11
  %19 = and i32 %16, %18
  store i32 %19, ptr %7, align 4, !tbaa !9
  %20 = getelementptr inbounds %"class.siscone::hash_cones", ptr %11, i32 0, i32 0
  %21 = load ptr, ptr %20, align 8, !tbaa !14
  %22 = load i32, ptr %7, align 4, !tbaa !9
  %23 = sext i32 %22 to i64
  %24 = getelementptr inbounds ptr, ptr %21, i64 %23
  %25 = load ptr, ptr %24, align 8, !tbaa !5
  store ptr %25, ptr %6, align 8, !tbaa !5
  br label %26

26:                                               ; preds = %81, %2
  %27 = load ptr, ptr %6, align 8, !tbaa !5
  %28 = icmp eq ptr %27, null
  br i1 %28, label %29, label %70

29:                                               ; preds = %26
  %30 = call noalias noundef nonnull ptr @_Znwm(i64 noundef 48) #8
  invoke void @_ZN7siscone12hash_elementC2Ev(ptr noundef nonnull align 8 dereferenceable(48) %30)
          to label %31 unwind label %66

31:                                               ; preds = %29
  store ptr %30, ptr %6, align 8, !tbaa !5
  %32 = load ptr, ptr %5, align 8, !tbaa !5
  %33 = getelementptr inbounds %"class.siscone::Cmomentum", ptr %32, i32 0, i32 8
  %34 = load ptr, ptr %6, align 8, !tbaa !5
  %35 = getelementptr inbounds %"class.siscone::hash_element", ptr %34, i32 0, i32 0
  %36 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZN7siscone10CreferenceaSERKS0_(ptr noundef nonnull align 4 dereferenceable(12) %35, ptr noundef nonnull align 4 dereferenceable(12) %33)
  %37 = load ptr, ptr %5, align 8, !tbaa !5
  %38 = getelementptr inbounds %"class.siscone::Cmomentum", ptr %37, i32 0, i32 4
  %39 = load double, ptr %38, align 8, !tbaa !15
  %40 = load ptr, ptr %6, align 8, !tbaa !5
  %41 = getelementptr inbounds %"class.siscone::hash_element", ptr %40, i32 0, i32 1
  store double %39, ptr %41, align 8, !tbaa !18
  %42 = load ptr, ptr %5, align 8, !tbaa !5
  %43 = getelementptr inbounds %"class.siscone::Cmomentum", ptr %42, i32 0, i32 5
  %44 = load double, ptr %43, align 8, !tbaa !21
  %45 = load ptr, ptr %6, align 8, !tbaa !5
  %46 = getelementptr inbounds %"class.siscone::hash_element", ptr %45, i32 0, i32 2
  store double %44, ptr %46, align 8, !tbaa !22
  %47 = load ptr, ptr %6, align 8, !tbaa !5
  %48 = getelementptr inbounds %"class.siscone::hash_element", ptr %47, i32 0, i32 3
  store i8 1, ptr %48, align 8, !tbaa !23
  %49 = getelementptr inbounds %"class.siscone::hash_cones", ptr %11, i32 0, i32 0
  %50 = load ptr, ptr %49, align 8, !tbaa !14
  %51 = load i32, ptr %7, align 4, !tbaa !9
  %52 = sext i32 %51 to i64
  %53 = getelementptr inbounds ptr, ptr %50, i64 %52
  %54 = load ptr, ptr %53, align 8, !tbaa !5
  %55 = load ptr, ptr %6, align 8, !tbaa !5
  %56 = getelementptr inbounds %"class.siscone::hash_element", ptr %55, i32 0, i32 4
  store ptr %54, ptr %56, align 8, !tbaa !24
  %57 = load ptr, ptr %6, align 8, !tbaa !5
  %58 = getelementptr inbounds %"class.siscone::hash_cones", ptr %11, i32 0, i32 0
  %59 = load ptr, ptr %58, align 8, !tbaa !14
  %60 = load i32, ptr %7, align 4, !tbaa !9
  %61 = sext i32 %60 to i64
  %62 = getelementptr inbounds ptr, ptr %59, i64 %61
  store ptr %57, ptr %62, align 8, !tbaa !5
  %63 = getelementptr inbounds %"class.siscone::hash_cones", ptr %11, i32 0, i32 1
  %64 = load i32, ptr %63, align 8, !tbaa !25
  %65 = add nsw i32 %64, 1
  store i32 %65, ptr %63, align 8, !tbaa !25
  store i32 0, ptr %3, align 4
  store i32 1, ptr %10, align 4
  br label %83

66:                                               ; preds = %29
  %67 = landingpad { ptr, i32 }
          cleanup
  %68 = extractvalue { ptr, i32 } %67, 0
  store ptr %68, ptr %8, align 8
  %69 = extractvalue { ptr, i32 } %67, 1
  store i32 %69, ptr %9, align 4
  call void @_ZdlPvm(ptr noundef %30, i64 noundef 48) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #7
  br label %85

70:                                               ; preds = %26
  %71 = load ptr, ptr %5, align 8, !tbaa !5
  %72 = getelementptr inbounds %"class.siscone::Cmomentum", ptr %71, i32 0, i32 8
  %73 = load ptr, ptr %6, align 8, !tbaa !5
  %74 = getelementptr inbounds %"class.siscone::hash_element", ptr %73, i32 0, i32 0
  %75 = call noundef zeroext i1 @_ZN7sisconeeqERKNS_10CreferenceES2_(ptr noundef nonnull align 4 dereferenceable(12) %72, ptr noundef nonnull align 4 dereferenceable(12) %74)
  br i1 %75, label %76, label %77

76:                                               ; preds = %70
  store i32 0, ptr %3, align 4
  store i32 1, ptr %10, align 4
  br label %83

77:                                               ; preds = %70
  %78 = load ptr, ptr %6, align 8, !tbaa !5
  %79 = getelementptr inbounds %"class.siscone::hash_element", ptr %78, i32 0, i32 4
  %80 = load ptr, ptr %79, align 8, !tbaa !24
  store ptr %80, ptr %6, align 8, !tbaa !5
  br label %81

81:                                               ; preds = %77
  br i1 true, label %26, label %82, !llvm.loop !26

82:                                               ; preds = %81
  store i32 1, ptr %3, align 4
  store i32 1, ptr %10, align 4
  br label %83

83:                                               ; preds = %82, %76, %31
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #7
  %84 = load i32, ptr %3, align 4
  ret i32 %84

85:                                               ; preds = %66
  %86 = load ptr, ptr %8, align 8
  %87 = load i32, ptr %9, align 4
  %88 = insertvalue { ptr, i32 } poison, ptr %86, 0
  %89 = insertvalue { ptr, i32 } %88, i32 %87, 1
  resume { ptr, i32 } %89
}

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { 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 #3 = { inlinehint 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 = { "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 #5 = { 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 #6 = { 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 #7 = { nounwind }
attributes #8 = { builtin allocsize(0) }
attributes #9 = { 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, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = !{!12, !10, i64 12}
!12 = !{!"_ZTSN7siscone10hash_conesE", !6, i64 0, !10, i64 8, !10, i64 12, !13, i64 16}
!13 = !{!"double", !7, i64 0}
!14 = !{!12, !6, i64 0}
!15 = !{!16, !13, i64 32}
!16 = !{!"_ZTSN7siscone9CmomentumE", !13, i64 0, !13, i64 8, !13, i64 16, !13, i64 24, !13, i64 32, !13, i64 40, !10, i64 48, !10, i64 52, !17, i64 56}
!17 = !{!"_ZTSN7siscone10CreferenceE", !7, i64 0}
!18 = !{!19, !13, i64 16}
!19 = !{!"_ZTSN7siscone12hash_elementE", !17, i64 0, !13, i64 16, !13, i64 24, !20, i64 32, !6, i64 40}
!20 = !{!"bool", !7, i64 0}
!21 = !{!16, !13, i64 40}
!22 = !{!19, !13, i64 24}
!23 = !{!19, !20, i64 32}
!24 = !{!19, !6, i64 40}
!25 = !{!12, !10, i64 8}
!26 = distinct !{!26, !27}
!27 = !{!"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"

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

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

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

declare i32 @__gxx_personality_v0(...)

declare noundef nonnull align 4 dereferenceable(12) ptr @_ZN7siscone10CreferenceaSERKS0_(ptr noundef nonnull align 4 dereferenceable(12), ptr noundef nonnull align 4 dereferenceable(12)) local_unnamed_addr #3

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZN7sisconeeqERKNS_10CreferenceES2_(ptr noundef nonnull align 4 dereferenceable(12), ptr noundef nonnull align 4 dereferenceable(12)) local_unnamed_addr #4

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_ZN7siscone10hash_cones6insertEPNS_9CmomentumE(ptr nocapture noundef nonnull align 8 dereferenceable(24) %0, ptr noundef %1) local_unnamed_addr #5 align 2 personality ptr @__gxx_personality_v0 {
  %3 = getelementptr inbounds i8, ptr %1, i64 56
  %4 = load i32, ptr %3, align 8, !tbaa !5
  %5 = getelementptr inbounds i8, ptr %0, i64 12
  %6 = load i32, ptr %5, align 4, !tbaa !9
  %7 = and i32 %6, %4
  %8 = load ptr, ptr %0, align 8, !tbaa !13
  %9 = sext i32 %7 to i64
  %10 = getelementptr inbounds ptr, ptr %8, i64 %9
  %.02021 = load ptr, ptr %10, align 8, !tbaa !14
  %11 = icmp eq ptr %.02021, null
  br i1 %11, label %._crit_edge, label %.lr.ph

12:                                               ; preds = %.lr.ph
  %13 = getelementptr inbounds i8, ptr %.02022, i64 40
  %.020 = load ptr, ptr %13, align 8, !tbaa !14
  %14 = icmp eq ptr %.020, null
  br i1 %14, label %._crit_edge, label %.lr.ph, !llvm.loop !15

._crit_edge:                                      ; preds = %12, %2
  %15 = tail call noalias noundef nonnull dereferenceable(48) ptr @_Znwm(i64 noundef 48) #6
  invoke void @_ZN7siscone12hash_elementC2Ev(ptr noundef nonnull align 8 dereferenceable(48) %15)
          to label %16 unwind label %29

16:                                               ; preds = %._crit_edge
  %17 = tail call noundef nonnull align 4 dereferenceable(12) ptr @_ZN7siscone10CreferenceaSERKS0_(ptr noundef nonnull align 4 dereferenceable(12) %15, ptr noundef nonnull align 4 dereferenceable(12) %3)
  %18 = getelementptr inbounds i8, ptr %1, i64 32
  %19 = getelementptr inbounds i8, ptr %15, i64 16
  %20 = load <2 x double>, ptr %18, align 8, !tbaa !17
  store <2 x double> %20, ptr %19, align 8, !tbaa !17
  %21 = getelementptr inbounds i8, ptr %15, i64 32
  store i8 1, ptr %21, align 8, !tbaa !18
  %22 = load ptr, ptr %0, align 8, !tbaa !13
  %23 = getelementptr inbounds ptr, ptr %22, i64 %9
  %24 = load ptr, ptr %23, align 8, !tbaa !14
  %25 = getelementptr inbounds i8, ptr %15, i64 40
  store ptr %24, ptr %25, align 8, !tbaa !22
  store ptr %15, ptr %23, align 8, !tbaa !14
  %26 = getelementptr inbounds i8, ptr %0, i64 8
  %27 = load i32, ptr %26, align 8, !tbaa !23
  %28 = add nsw i32 %27, 1
  store i32 %28, ptr %26, align 8, !tbaa !23
  br label %.loopexit

29:                                               ; preds = %._crit_edge
  %30 = landingpad { ptr, i32 }
          cleanup
  tail call void @_ZdlPvm(ptr noundef nonnull %15, i64 noundef 48) #7
  resume { ptr, i32 } %30

.lr.ph:                                           ; preds = %2, %12
  %.02022 = phi ptr [ %.020, %12 ], [ %.02021, %2 ]
  %31 = tail call noundef zeroext i1 @_ZN7sisconeeqERKNS_10CreferenceES2_(ptr noundef nonnull align 4 dereferenceable(12) %3, ptr noundef nonnull align 4 dereferenceable(12) %.02022)
  br i1 %31, label %.loopexit, label %12

.loopexit:                                        ; preds = %.lr.ph, %16
  ret i32 0
}

attributes #0 = { 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 #1 = { 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 #2 = { inlinehint 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 = { "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 = { 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 #5 = { 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 #6 = { builtin allocsize(0) }
attributes #7 = { 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 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !6, i64 12}
!10 = !{!"_ZTSN7siscone10hash_conesE", !11, i64 0, !6, i64 8, !6, i64 12, !12, i64 16}
!11 = !{!"any pointer", !7, i64 0}
!12 = !{!"double", !7, i64 0}
!13 = !{!10, !11, i64 0}
!14 = !{!11, !11, i64 0}
!15 = distinct !{!15, !16}
!16 = !{!"llvm.loop.mustprogress"}
!17 = !{!12, !12, i64 0}
!18 = !{!19, !21, i64 32}
!19 = !{!"_ZTSN7siscone12hash_elementE", !20, i64 0, !12, i64 16, !12, i64 24, !21, i64 32, !11, i64 40}
!20 = !{!"_ZTSN7siscone10CreferenceE", !7, i64 0}
!21 = !{!"bool", !7, i64 0}
!22 = !{!19, !11, i64 40}
!23 = !{!10, !6, i64 8}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GlobalOptPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,PostOrderFunctionAttrsPass,ReassociatePass,SLPVectorizerPass,SROAPass,SimplifyCFGPass,TailCallElimPass