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

; 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::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 }

@.str.3 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [130 x i8], align 1
@__PRETTY_FUNCTION__._ZN7fastjet9PseudoJet7unboostERKS0_ = external hidden unnamed_addr constant [58 x i8], align 1

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

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

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

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare double @llvm.fmuladd.f64(double, double, double) #2

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

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

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

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

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

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

; Function Attrs: mustprogress uwtable
define dso_local noundef nonnull align 8 dereferenceable(88) ptr @_ZN7fastjet9PseudoJet7unboostERKS0_(ptr noundef nonnull align 8 dereferenceable(88) %0, ptr noundef nonnull align 8 dereferenceable(88) %1) #0 align 2 {
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca double, align 8
  %7 = alloca double, align 8
  %8 = alloca double, align 8
  store ptr %0, ptr %4, align 8, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !5
  %9 = load ptr, ptr %4, align 8
  %10 = load ptr, ptr %5, align 8, !tbaa !5
  %11 = call noundef double @_ZNK7fastjet9PseudoJet2pxEv(ptr noundef nonnull align 8 dereferenceable(88) %10)
  %12 = fcmp oeq double %11, 0.000000e+00
  br i1 %12, label %13, label %22

13:                                               ; preds = %2
  %14 = load ptr, ptr %5, align 8, !tbaa !5
  %15 = call noundef double @_ZNK7fastjet9PseudoJet2pyEv(ptr noundef nonnull align 8 dereferenceable(88) %14)
  %16 = fcmp oeq double %15, 0.000000e+00
  br i1 %16, label %17, label %22

17:                                               ; preds = %13
  %18 = load ptr, ptr %5, align 8, !tbaa !5
  %19 = call noundef double @_ZNK7fastjet9PseudoJet2pzEv(ptr noundef nonnull align 8 dereferenceable(88) %18)
  %20 = fcmp oeq double %19, 0.000000e+00
  br i1 %20, label %21, label %22

21:                                               ; preds = %17
  store ptr %9, ptr %3, align 8
  br label %83

22:                                               ; preds = %17, %13, %2
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #5
  %23 = load ptr, ptr %5, align 8, !tbaa !5
  %24 = call noundef double @_ZNK7fastjet9PseudoJet1mEv(ptr noundef nonnull align 8 dereferenceable(88) %23)
  store double %24, ptr %6, align 8, !tbaa !9
  %25 = load double, ptr %6, align 8, !tbaa !9
  %26 = fcmp une double %25, 0.000000e+00
  br i1 %26, label %27, label %28

27:                                               ; preds = %22
  br label %30

28:                                               ; preds = %22
  call void @__assert_fail(ptr noundef @.str.3, ptr noundef @.str.4, i32 noundef 291, ptr noundef @__PRETTY_FUNCTION__._ZN7fastjet9PseudoJet7unboostERKS0_) #6
  unreachable

29:                                               ; No predecessors!
  br label %30

30:                                               ; preds = %29, %27
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #5
  %31 = call noundef double @_ZNK7fastjet9PseudoJet2pxEv(ptr noundef nonnull align 8 dereferenceable(88) %9)
  %32 = fneg double %31
  %33 = load ptr, ptr %5, align 8, !tbaa !5
  %34 = call noundef double @_ZNK7fastjet9PseudoJet2pxEv(ptr noundef nonnull align 8 dereferenceable(88) %33)
  %35 = call noundef double @_ZNK7fastjet9PseudoJet2pyEv(ptr noundef nonnull align 8 dereferenceable(88) %9)
  %36 = load ptr, ptr %5, align 8, !tbaa !5
  %37 = call noundef double @_ZNK7fastjet9PseudoJet2pyEv(ptr noundef nonnull align 8 dereferenceable(88) %36)
  %38 = fmul double %35, %37
  %39 = fneg double %38
  %40 = call double @llvm.fmuladd.f64(double %32, double %34, double %39)
  %41 = call noundef double @_ZNK7fastjet9PseudoJet2pzEv(ptr noundef nonnull align 8 dereferenceable(88) %9)
  %42 = load ptr, ptr %5, align 8, !tbaa !5
  %43 = call noundef double @_ZNK7fastjet9PseudoJet2pzEv(ptr noundef nonnull align 8 dereferenceable(88) %42)
  %44 = fneg double %41
  %45 = call double @llvm.fmuladd.f64(double %44, double %43, double %40)
  %46 = call noundef double @_ZNK7fastjet9PseudoJet1EEv(ptr noundef nonnull align 8 dereferenceable(88) %9)
  %47 = load ptr, ptr %5, align 8, !tbaa !5
  %48 = call noundef double @_ZNK7fastjet9PseudoJet1EEv(ptr noundef nonnull align 8 dereferenceable(88) %47)
  %49 = call double @llvm.fmuladd.f64(double %46, double %48, double %45)
  %50 = load double, ptr %6, align 8, !tbaa !9
  %51 = fdiv double %49, %50
  store double %51, ptr %7, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #5
  %52 = load double, ptr %7, align 8, !tbaa !9
  %53 = call noundef double @_ZNK7fastjet9PseudoJet1EEv(ptr noundef nonnull align 8 dereferenceable(88) %9)
  %54 = fadd double %52, %53
  %55 = load ptr, ptr %5, align 8, !tbaa !5
  %56 = call noundef double @_ZNK7fastjet9PseudoJet1EEv(ptr noundef nonnull align 8 dereferenceable(88) %55)
  %57 = load double, ptr %6, align 8, !tbaa !9
  %58 = fadd double %56, %57
  %59 = fdiv double %54, %58
  store double %59, ptr %8, align 8, !tbaa !9
  %60 = load double, ptr %8, align 8, !tbaa !9
  %61 = load ptr, ptr %5, align 8, !tbaa !5
  %62 = call noundef double @_ZNK7fastjet9PseudoJet2pxEv(ptr noundef nonnull align 8 dereferenceable(88) %61)
  %63 = getelementptr inbounds %"class.fastjet::PseudoJet", ptr %9, i32 0, i32 3
  %64 = load double, ptr %63, align 8, !tbaa !11
  %65 = fneg double %60
  %66 = call double @llvm.fmuladd.f64(double %65, double %62, double %64)
  store double %66, ptr %63, align 8, !tbaa !11
  %67 = load double, ptr %8, align 8, !tbaa !9
  %68 = load ptr, ptr %5, align 8, !tbaa !5
  %69 = call noundef double @_ZNK7fastjet9PseudoJet2pyEv(ptr noundef nonnull align 8 dereferenceable(88) %68)
  %70 = getelementptr inbounds %"class.fastjet::PseudoJet", ptr %9, i32 0, i32 4
  %71 = load double, ptr %70, align 8, !tbaa !16
  %72 = fneg double %67
  %73 = call double @llvm.fmuladd.f64(double %72, double %69, double %71)
  store double %73, ptr %70, align 8, !tbaa !16
  %74 = load double, ptr %8, align 8, !tbaa !9
  %75 = load ptr, ptr %5, align 8, !tbaa !5
  %76 = call noundef double @_ZNK7fastjet9PseudoJet2pzEv(ptr noundef nonnull align 8 dereferenceable(88) %75)
  %77 = getelementptr inbounds %"class.fastjet::PseudoJet", ptr %9, i32 0, i32 5
  %78 = load double, ptr %77, align 8, !tbaa !17
  %79 = fneg double %74
  %80 = call double @llvm.fmuladd.f64(double %79, double %76, double %78)
  store double %80, ptr %77, align 8, !tbaa !17
  %81 = load double, ptr %7, align 8, !tbaa !9
  %82 = getelementptr inbounds %"class.fastjet::PseudoJet", ptr %9, i32 0, i32 6
  store double %81, ptr %82, align 8, !tbaa !18
  call void @_ZN7fastjet9PseudoJet12_finish_initEv(ptr noundef nonnull align 8 dereferenceable(88) %9)
  store ptr %9, ptr %3, align 8
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #5
  br label %83

83:                                               ; preds = %30, %21
  %84 = load ptr, ptr %3, align 8
  ret ptr %84
}

attributes #0 = { 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 #1 = { 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 #2 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #3 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #4 = { 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 #5 = { nounwind }
attributes #6 = { noreturn 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 = !{!"double", !7, i64 0}
!11 = !{!12, !10, i64 24}
!12 = !{!"_ZTSN7fastjet9PseudoJetE", !13, i64 8, !14, i64 16, !10, i64 24, !10, i64 32, !10, i64 40, !10, i64 48, !10, i64 56, !10, i64 64, !10, i64 72, !15, i64 80, !15, i64 84}
!13 = !{!"_ZTSN7fastjet9SharedPtrINS_22PseudoJetStructureBaseEEE", !6, i64 0}
!14 = !{!"_ZTSN7fastjet9SharedPtrINS_9PseudoJet12UserInfoBaseEEE", !6, i64 0}
!15 = !{!"int", !7, i64 0}
!16 = !{!12, !10, i64 32}
!17 = !{!12, !10, i64 40}
!18 = !{!12, !10, i64 48}


; 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.3 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [130 x i8], align 1
@__PRETTY_FUNCTION__._ZN7fastjet9PseudoJet7unboostERKS0_ = external hidden unnamed_addr constant [58 x i8], align 1

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

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

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

; Function Attrs: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare double @llvm.fmuladd.f64(double, double, double) #2

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

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

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

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

; Function Attrs: mustprogress uwtable
define dso_local noundef nonnull align 8 dereferenceable(88) ptr @_ZN7fastjet9PseudoJet7unboostERKS0_(ptr noundef nonnull returned align 8 dereferenceable(88) %0, ptr noundef nonnull align 8 dereferenceable(88) %1) local_unnamed_addr #0 align 2 {
  %3 = tail call noundef double @_ZNK7fastjet9PseudoJet2pxEv(ptr noundef nonnull align 8 dereferenceable(88) %1)
  %4 = fcmp oeq double %3, 0.000000e+00
  br i1 %4, label %5, label %11

5:                                                ; preds = %2
  %6 = tail call noundef double @_ZNK7fastjet9PseudoJet2pyEv(ptr noundef nonnull align 8 dereferenceable(88) %1)
  %7 = fcmp oeq double %6, 0.000000e+00
  br i1 %7, label %8, label %11

8:                                                ; preds = %5
  %9 = tail call noundef double @_ZNK7fastjet9PseudoJet2pzEv(ptr noundef nonnull align 8 dereferenceable(88) %1)
  %10 = fcmp oeq double %9, 0.000000e+00
  br i1 %10, label %51, label %11

11:                                               ; preds = %8, %5, %2
  %12 = tail call noundef double @_ZNK7fastjet9PseudoJet1mEv(ptr noundef nonnull align 8 dereferenceable(88) %1)
  %13 = fcmp une double %12, 0.000000e+00
  br i1 %13, label %15, label %14

14:                                               ; preds = %11
  tail call void @__assert_fail(ptr noundef nonnull @.str.3, ptr noundef nonnull @.str.4, i32 noundef 291, ptr noundef nonnull @__PRETTY_FUNCTION__._ZN7fastjet9PseudoJet7unboostERKS0_) #4
  unreachable

15:                                               ; preds = %11
  %16 = tail call noundef double @_ZNK7fastjet9PseudoJet2pxEv(ptr noundef nonnull align 8 dereferenceable(88) %0)
  %17 = fneg double %16
  %18 = tail call noundef double @_ZNK7fastjet9PseudoJet2pxEv(ptr noundef nonnull align 8 dereferenceable(88) %1)
  %19 = tail call noundef double @_ZNK7fastjet9PseudoJet2pyEv(ptr noundef nonnull align 8 dereferenceable(88) %0)
  %20 = tail call noundef double @_ZNK7fastjet9PseudoJet2pyEv(ptr noundef nonnull align 8 dereferenceable(88) %1)
  %21 = fneg double %19
  %22 = fmul double %20, %21
  %23 = tail call double @llvm.fmuladd.f64(double %17, double %18, double %22)
  %24 = tail call noundef double @_ZNK7fastjet9PseudoJet2pzEv(ptr noundef nonnull align 8 dereferenceable(88) %0)
  %25 = tail call noundef double @_ZNK7fastjet9PseudoJet2pzEv(ptr noundef nonnull align 8 dereferenceable(88) %1)
  %26 = fneg double %24
  %27 = tail call double @llvm.fmuladd.f64(double %26, double %25, double %23)
  %28 = tail call noundef double @_ZNK7fastjet9PseudoJet1EEv(ptr noundef nonnull align 8 dereferenceable(88) %0)
  %29 = tail call noundef double @_ZNK7fastjet9PseudoJet1EEv(ptr noundef nonnull align 8 dereferenceable(88) %1)
  %30 = tail call double @llvm.fmuladd.f64(double %28, double %29, double %27)
  %31 = fdiv double %30, %12
  %32 = tail call noundef double @_ZNK7fastjet9PseudoJet1EEv(ptr noundef nonnull align 8 dereferenceable(88) %0)
  %33 = fadd double %32, %31
  %34 = tail call noundef double @_ZNK7fastjet9PseudoJet1EEv(ptr noundef nonnull align 8 dereferenceable(88) %1)
  %35 = fadd double %12, %34
  %36 = tail call noundef double @_ZNK7fastjet9PseudoJet2pxEv(ptr noundef nonnull align 8 dereferenceable(88) %1)
  %37 = getelementptr inbounds i8, ptr %0, i64 24
  %38 = load double, ptr %37, align 8, !tbaa !5
  %39 = fneg double %33
  %40 = fdiv double %39, %35
  %41 = tail call double @llvm.fmuladd.f64(double %40, double %36, double %38)
  store double %41, ptr %37, align 8, !tbaa !5
  %42 = tail call noundef double @_ZNK7fastjet9PseudoJet2pyEv(ptr noundef nonnull align 8 dereferenceable(88) %1)
  %43 = getelementptr inbounds i8, ptr %0, i64 32
  %44 = load double, ptr %43, align 8, !tbaa !14
  %45 = tail call double @llvm.fmuladd.f64(double %40, double %42, double %44)
  store double %45, ptr %43, align 8, !tbaa !14
  %46 = tail call noundef double @_ZNK7fastjet9PseudoJet2pzEv(ptr noundef nonnull align 8 dereferenceable(88) %1)
  %47 = getelementptr inbounds i8, ptr %0, i64 40
  %48 = load double, ptr %47, align 8, !tbaa !15
  %49 = tail call double @llvm.fmuladd.f64(double %40, double %46, double %48)
  store double %49, ptr %47, align 8, !tbaa !15
  %50 = getelementptr inbounds i8, ptr %0, i64 48
  store double %31, ptr %50, align 8, !tbaa !16
  tail call void @_ZN7fastjet9PseudoJet12_finish_initEv(ptr noundef nonnull align 8 dereferenceable(88) %0)
  br label %51

51:                                               ; preds = %8, %15
  ret ptr %0
}

attributes #0 = { 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 #1 = { 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 #2 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #3 = { 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 #4 = { noreturn 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, !12, i64 24}
!6 = !{!"_ZTSN7fastjet9PseudoJetE", !7, i64 8, !11, i64 16, !12, i64 24, !12, i64 32, !12, i64 40, !12, i64 48, !12, i64 56, !12, i64 64, !12, i64 72, !13, i64 80, !13, i64 84}
!7 = !{!"_ZTSN7fastjet9SharedPtrINS_22PseudoJetStructureBaseEEE", !8, i64 0}
!8 = !{!"any pointer", !9, i64 0}
!9 = !{!"omnipotent char", !10, i64 0}
!10 = !{!"Simple C++ TBAA"}
!11 = !{!"_ZTSN7fastjet9SharedPtrINS_9PseudoJet12UserInfoBaseEEE", !8, i64 0}
!12 = !{!"double", !9, i64 0}
!13 = !{!"int", !9, i64 0}
!14 = !{!6, !12, i64 32}
!15 = !{!6, !12, i64 40}
!16 = !{!6, !12, i64 48}


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