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

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

; Function Attrs: mustprogress nounwind uwtable
define dso_local void @_ZN7fastjet9PseudoJetmLEd(ptr noundef nonnull align 8 dereferenceable(88) %0, double noundef %1) #0 align 2 {
  %3 = alloca ptr, align 8
  %4 = alloca double, align 8
  store ptr %0, ptr %3, align 8, !tbaa !5
  store double %1, ptr %4, align 8, !tbaa !9
  %5 = load ptr, ptr %3, align 8
  %6 = load double, ptr %4, align 8, !tbaa !9
  %7 = getelementptr inbounds %"class.fastjet::PseudoJet", ptr %5, i32 0, i32 3
  %8 = load double, ptr %7, align 8, !tbaa !11
  %9 = fmul double %8, %6
  store double %9, ptr %7, align 8, !tbaa !11
  %10 = load double, ptr %4, align 8, !tbaa !9
  %11 = getelementptr inbounds %"class.fastjet::PseudoJet", ptr %5, i32 0, i32 4
  %12 = load double, ptr %11, align 8, !tbaa !16
  %13 = fmul double %12, %10
  store double %13, ptr %11, align 8, !tbaa !16
  %14 = load double, ptr %4, align 8, !tbaa !9
  %15 = getelementptr inbounds %"class.fastjet::PseudoJet", ptr %5, i32 0, i32 5
  %16 = load double, ptr %15, align 8, !tbaa !17
  %17 = fmul double %16, %14
  store double %17, ptr %15, align 8, !tbaa !17
  %18 = load double, ptr %4, align 8, !tbaa !9
  %19 = getelementptr inbounds %"class.fastjet::PseudoJet", ptr %5, i32 0, i32 6
  %20 = load double, ptr %19, align 8, !tbaa !18
  %21 = fmul double %20, %18
  store double %21, ptr %19, align 8, !tbaa !18
  %22 = load double, ptr %4, align 8, !tbaa !9
  %23 = load double, ptr %4, align 8, !tbaa !9
  %24 = fmul double %22, %23
  %25 = getelementptr inbounds %"class.fastjet::PseudoJet", ptr %5, i32 0, i32 9
  %26 = load double, ptr %25, align 8, !tbaa !19
  %27 = fmul double %26, %24
  store double %27, ptr %25, align 8, !tbaa !19
  ret void
}

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

!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}
!19 = !{!12, !10, i64 72}


; 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 nofree norecurse nosync nounwind willreturn memory(argmem: readwrite) uwtable
define dso_local void @_ZN7fastjet9PseudoJetmLEd(ptr nocapture noundef nonnull align 8 dereferenceable(88) %0, double noundef %1) local_unnamed_addr #0 align 2 {
  %3 = getelementptr inbounds i8, ptr %0, i64 24
  %4 = load <2 x double>, ptr %3, align 8, !tbaa !5
  %5 = insertelement <2 x double> poison, double %1, i64 0
  %6 = shufflevector <2 x double> %5, <2 x double> poison, <2 x i32> zeroinitializer
  %7 = fmul <2 x double> %4, %6
  store <2 x double> %7, ptr %3, align 8, !tbaa !5
  %8 = getelementptr inbounds i8, ptr %0, i64 40
  %9 = load <2 x double>, ptr %8, align 8, !tbaa !5
  %10 = fmul <2 x double> %9, %6
  store <2 x double> %10, ptr %8, align 8, !tbaa !5
  %11 = fmul double %1, %1
  %12 = getelementptr inbounds i8, ptr %0, i64 72
  %13 = load double, ptr %12, align 8, !tbaa !9
  %14 = fmul double %11, %13
  store double %14, ptr %12, align 8, !tbaa !9
  ret void
}

attributes #0 = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: readwrite) 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" }

!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 = !{!"double", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !6, i64 72}
!10 = !{!"_ZTSN7fastjet9PseudoJetE", !11, i64 8, !13, i64 16, !6, i64 24, !6, i64 32, !6, i64 40, !6, i64 48, !6, i64 56, !6, i64 64, !6, i64 72, !14, i64 80, !14, i64 84}
!11 = !{!"_ZTSN7fastjet9SharedPtrINS_22PseudoJetStructureBaseEEE", !12, i64 0}
!12 = !{!"any pointer", !7, i64 0}
!13 = !{!"_ZTSN7fastjet9SharedPtrINS_9PseudoJet12UserInfoBaseEEE", !12, i64 0}
!14 = !{!"int", !7, i64 0}


; Effective O3 passes: GlobalOptPass,InstCombinePass,PostOrderFunctionAttrsPass,ReassociatePass,SLPVectorizerPass,SROAPass