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

@.str.4 = external hidden unnamed_addr constant [130 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [30 x i8], align 1
@__PRETTY_FUNCTION__._ZN7fastjet9PseudoJet22reset_momentum_PtYPhiMEdddd = external hidden unnamed_addr constant [80 x i8], align 1

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

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

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN7fastjet9PseudoJet18set_cached_rap_phiEdd(ptr noundef nonnull align 8 dereferenceable(88), double noundef, double noundef) #3 align 2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN7fastjet9PseudoJet22reset_momentum_PtYPhiMEdddd(ptr noundef nonnull align 8 dereferenceable(88) %0, double noundef %1, double noundef %2, double noundef %3, double noundef %4) #4 align 2 {
  %6 = alloca ptr, align 8
  %7 = alloca double, align 8
  %8 = alloca double, align 8
  %9 = alloca double, align 8
  %10 = alloca double, align 8
  %11 = alloca double, align 8
  %12 = alloca double, align 8
  %13 = alloca double, align 8
  %14 = alloca double, align 8
  %15 = alloca double, align 8
  %16 = alloca double, align 8
  store ptr %0, ptr %6, align 8, !tbaa !5
  store double %1, ptr %7, align 8, !tbaa !9
  store double %2, ptr %8, align 8, !tbaa !9
  store double %3, ptr %9, align 8, !tbaa !9
  store double %4, ptr %10, align 8, !tbaa !9
  %17 = load ptr, ptr %6, align 8
  %18 = load double, ptr %9, align 8, !tbaa !9
  %19 = fcmp olt double %18, 0x402921FB54442D18
  br i1 %19, label %20, label %23

20:                                               ; preds = %5
  %21 = load double, ptr %9, align 8, !tbaa !9
  %22 = fcmp ogt double %21, 0xC01921FB54442D18
  br label %23

23:                                               ; preds = %20, %5
  %24 = phi i1 [ false, %5 ], [ %22, %20 ]
  br i1 %24, label %25, label %26

25:                                               ; preds = %23
  br label %28

26:                                               ; preds = %23
  call void @__assert_fail(ptr noundef @.str.5, ptr noundef @.str.4, i32 noundef 324, ptr noundef @__PRETTY_FUNCTION__._ZN7fastjet9PseudoJet22reset_momentum_PtYPhiMEdddd) #7
  unreachable

27:                                               ; No predecessors!
  br label %28

28:                                               ; preds = %27, %25
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #8
  %29 = load double, ptr %10, align 8, !tbaa !9
  %30 = fcmp oeq double %29, 0.000000e+00
  br i1 %30, label %31, label %33

31:                                               ; preds = %28
  %32 = load double, ptr %7, align 8, !tbaa !9
  br label %41

33:                                               ; preds = %28
  %34 = load double, ptr %7, align 8, !tbaa !9
  %35 = load double, ptr %7, align 8, !tbaa !9
  %36 = load double, ptr %10, align 8, !tbaa !9
  %37 = load double, ptr %10, align 8, !tbaa !9
  %38 = fmul double %36, %37
  %39 = call double @llvm.fmuladd.f64(double %34, double %35, double %38)
  %40 = call double @sqrt(double noundef %39) #8
  br label %41

41:                                               ; preds = %33, %31
  %42 = phi double [ %32, %31 ], [ %40, %33 ]
  store double %42, ptr %11, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #8
  %43 = load double, ptr %8, align 8, !tbaa !9
  %44 = call double @exp(double noundef %43) #8
  store double %44, ptr %12, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #8
  %45 = load double, ptr %11, align 8, !tbaa !9
  %46 = load double, ptr %12, align 8, !tbaa !9
  %47 = fdiv double %45, %46
  store double %47, ptr %13, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #8
  %48 = load double, ptr %11, align 8, !tbaa !9
  %49 = load double, ptr %12, align 8, !tbaa !9
  %50 = fmul double %48, %49
  store double %50, ptr %14, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #8
  %51 = load double, ptr %7, align 8, !tbaa !9
  %52 = load double, ptr %9, align 8, !tbaa !9
  %53 = call double @cos(double noundef %52) #8
  %54 = fmul double %51, %53
  store double %54, ptr %15, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #8
  %55 = load double, ptr %7, align 8, !tbaa !9
  %56 = load double, ptr %9, align 8, !tbaa !9
  %57 = call double @sin(double noundef %56) #8
  %58 = fmul double %55, %57
  store double %58, ptr %16, align 8, !tbaa !9
  %59 = load double, ptr %15, align 8, !tbaa !9
  %60 = load double, ptr %16, align 8, !tbaa !9
  %61 = load double, ptr %14, align 8, !tbaa !9
  %62 = load double, ptr %13, align 8, !tbaa !9
  %63 = fsub double %61, %62
  %64 = fmul double 5.000000e-01, %63
  %65 = load double, ptr %14, align 8, !tbaa !9
  %66 = load double, ptr %13, align 8, !tbaa !9
  %67 = fadd double %65, %66
  %68 = fmul double 5.000000e-01, %67
  call void @_ZN7fastjet9PseudoJet14reset_momentumEdddd(ptr noundef nonnull align 8 dereferenceable(88) %17, double noundef %59, double noundef %60, double noundef %64, double noundef %68)
  %69 = load double, ptr %8, align 8, !tbaa !9
  %70 = load double, ptr %9, align 8, !tbaa !9
  call void @_ZN7fastjet9PseudoJet18set_cached_rap_phiEdd(ptr noundef nonnull align 8 dereferenceable(88) %17, double noundef %69, double noundef %70)
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #8
  ret void
}

; Function Attrs: nounwind
declare double @sqrt(double noundef) #5

; Function Attrs: nounwind
declare double @exp(double noundef) #5

; Function Attrs: nounwind
declare double @cos(double noundef) #5

; Function Attrs: nounwind
declare double @sin(double noundef) #5

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN7fastjet9PseudoJet14reset_momentumEdddd(ptr noundef nonnull align 8 dereferenceable(88), double noundef, double noundef, double noundef, double noundef) #6 align 2

attributes #0 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { 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 #3 = { 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 #4 = { 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 #5 = { 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 #6 = { 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 #7 = { noreturn nounwind }
attributes #8 = { 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}


; 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.4 = external hidden unnamed_addr constant [130 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [30 x i8], align 1
@__PRETTY_FUNCTION__._ZN7fastjet9PseudoJet22reset_momentum_PtYPhiMEdddd = external hidden unnamed_addr constant [80 x i8], align 1

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN7fastjet9PseudoJet18set_cached_rap_phiEdd(ptr noundef nonnull align 8 dereferenceable(88), double noundef, double noundef) local_unnamed_addr #2 align 2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN7fastjet9PseudoJet22reset_momentum_PtYPhiMEdddd(ptr noundef nonnull align 8 dereferenceable(88) %0, double noundef %1, double noundef %2, double noundef %3, double noundef %4) local_unnamed_addr #3 align 2 {
  %6 = fcmp olt double %3, 0x402921FB54442D18
  %7 = fcmp ogt double %3, 0xC01921FB54442D18
  %8 = and i1 %6, %7
  br i1 %8, label %10, label %9

9:                                                ; preds = %5
  tail call void @__assert_fail(ptr noundef nonnull @.str.5, ptr noundef nonnull @.str.4, i32 noundef 324, ptr noundef nonnull @__PRETTY_FUNCTION__._ZN7fastjet9PseudoJet22reset_momentum_PtYPhiMEdddd) #7
  unreachable

10:                                               ; preds = %5
  %11 = fcmp oeq double %4, 0.000000e+00
  %12 = fmul double %4, %4
  %13 = tail call double @llvm.fmuladd.f64(double %1, double %1, double %12)
  %sqrt = tail call double @llvm.sqrt.f64(double %13)
  %14 = select i1 %11, double %1, double %sqrt
  %15 = tail call double @exp(double noundef %2) #8
  %16 = fdiv double %14, %15
  %17 = fmul double %14, %15
  %18 = tail call double @cos(double noundef %3) #8
  %19 = fmul double %18, %1
  %20 = tail call double @sin(double noundef %3) #8
  %21 = fmul double %20, %1
  %22 = fsub double %17, %16
  %23 = fmul double %22, 5.000000e-01
  %24 = fadd double %17, %16
  %25 = fmul double %24, 5.000000e-01
  tail call void @_ZN7fastjet9PseudoJet14reset_momentumEdddd(ptr noundef nonnull align 8 dereferenceable(88) %0, double noundef %19, double noundef %21, double noundef %23, double noundef %25)
  tail call void @_ZN7fastjet9PseudoJet18set_cached_rap_phiEdd(ptr noundef nonnull align 8 dereferenceable(88) %0, double noundef %2, double noundef %3)
  ret void
}

; Function Attrs: mustprogress nofree nounwind willreturn memory(write)
declare double @exp(double noundef) local_unnamed_addr #4

; Function Attrs: mustprogress nofree nounwind willreturn memory(write)
declare double @cos(double noundef) local_unnamed_addr #4

; Function Attrs: mustprogress nofree nounwind willreturn memory(write)
declare double @sin(double noundef) local_unnamed_addr #4

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN7fastjet9PseudoJet14reset_momentumEdddd(ptr noundef nonnull align 8 dereferenceable(88), double noundef, double noundef, double noundef, double noundef) local_unnamed_addr #5 align 2

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

attributes #0 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }
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 = { 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 = { mustprogress nofree nounwind willreturn memory(write) "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 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 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #7 = { noreturn nounwind }
attributes #8 = { 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)"}


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