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

; 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::GhostedAreaSpec" = type { double, double, i32, double, double, double, double, i8, %"class.fastjet::Selector", double, double, double, i32, i32, i32, %"class.std::vector" }
%"class.fastjet::Selector" = type { ptr, %"class.fastjet::SharedPtr" }
%"class.fastjet::SharedPtr" = type { ptr }
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl" = type { %"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" = type { ptr, ptr, ptr }

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN7fastjet15GhostedAreaSpec11_initializeEv(ptr noundef nonnull align 8 dereferenceable(144) %0) #0 align 2 {
  %2 = alloca ptr, align 8
  store ptr %0, ptr %2, align 8, !tbaa !5
  %3 = load ptr, ptr %2, align 8
  %4 = getelementptr inbounds %"class.fastjet::GhostedAreaSpec", ptr %3, i32 0, i32 3
  %5 = load double, ptr %4, align 8, !tbaa !9
  %6 = call double @sqrt(double noundef %5) #4
  %7 = getelementptr inbounds %"class.fastjet::GhostedAreaSpec", ptr %3, i32 0, i32 11
  store double %6, ptr %7, align 8, !tbaa !20
  %8 = getelementptr inbounds %"class.fastjet::GhostedAreaSpec", ptr %3, i32 0, i32 11
  %9 = load double, ptr %8, align 8, !tbaa !20
  %10 = getelementptr inbounds %"class.fastjet::GhostedAreaSpec", ptr %3, i32 0, i32 10
  store double %9, ptr %10, align 8, !tbaa !21
  %11 = getelementptr inbounds %"class.fastjet::GhostedAreaSpec", ptr %3, i32 0, i32 7
  %12 = load i8, ptr %11, align 8, !tbaa !22, !range !23, !noundef !24
  %13 = trunc i8 %12 to i1
  br i1 %13, label %14, label %55

14:                                               ; preds = %1
  %15 = getelementptr inbounds %"class.fastjet::GhostedAreaSpec", ptr %3, i32 0, i32 10
  %16 = load double, ptr %15, align 8, !tbaa !21
  %17 = fdiv double 0x401921FB54442D18, %16
  %18 = call double @llvm.ceil.f64(double %17)
  %19 = fptosi double %18 to i32
  %20 = getelementptr inbounds %"class.fastjet::GhostedAreaSpec", ptr %3, i32 0, i32 13
  store i32 %19, ptr %20, align 4, !tbaa !25
  %21 = getelementptr inbounds %"class.fastjet::GhostedAreaSpec", ptr %3, i32 0, i32 13
  %22 = load i32, ptr %21, align 4, !tbaa !25
  %23 = sitofp i32 %22 to double
  %24 = fdiv double 0x401921FB54442D18, %23
  %25 = getelementptr inbounds %"class.fastjet::GhostedAreaSpec", ptr %3, i32 0, i32 10
  store double %24, ptr %25, align 8, !tbaa !21
  %26 = getelementptr inbounds %"class.fastjet::GhostedAreaSpec", ptr %3, i32 0, i32 0
  %27 = load double, ptr %26, align 8, !tbaa !26
  %28 = getelementptr inbounds %"class.fastjet::GhostedAreaSpec", ptr %3, i32 0, i32 11
  %29 = load double, ptr %28, align 8, !tbaa !20
  %30 = fdiv double %27, %29
  %31 = call double @llvm.ceil.f64(double %30)
  %32 = fptosi double %31 to i32
  %33 = getelementptr inbounds %"class.fastjet::GhostedAreaSpec", ptr %3, i32 0, i32 14
  store i32 %32, ptr %33, align 8, !tbaa !27
  %34 = getelementptr inbounds %"class.fastjet::GhostedAreaSpec", ptr %3, i32 0, i32 0
  %35 = load double, ptr %34, align 8, !tbaa !26
  %36 = getelementptr inbounds %"class.fastjet::GhostedAreaSpec", ptr %3, i32 0, i32 14
  %37 = load i32, ptr %36, align 8, !tbaa !27
  %38 = sitofp i32 %37 to double
  %39 = fdiv double %35, %38
  %40 = getelementptr inbounds %"class.fastjet::GhostedAreaSpec", ptr %3, i32 0, i32 11
  store double %39, ptr %40, align 8, !tbaa !20
  %41 = getelementptr inbounds %"class.fastjet::GhostedAreaSpec", ptr %3, i32 0, i32 10
  %42 = load double, ptr %41, align 8, !tbaa !21
  %43 = getelementptr inbounds %"class.fastjet::GhostedAreaSpec", ptr %3, i32 0, i32 11
  %44 = load double, ptr %43, align 8, !tbaa !20
  %45 = fmul double %42, %44
  %46 = getelementptr inbounds %"class.fastjet::GhostedAreaSpec", ptr %3, i32 0, i32 9
  store double %45, ptr %46, align 8, !tbaa !28
  %47 = getelementptr inbounds %"class.fastjet::GhostedAreaSpec", ptr %3, i32 0, i32 14
  %48 = load i32, ptr %47, align 8, !tbaa !27
  %49 = mul nsw i32 2, %48
  %50 = add nsw i32 %49, 1
  %51 = getelementptr inbounds %"class.fastjet::GhostedAreaSpec", ptr %3, i32 0, i32 13
  %52 = load i32, ptr %51, align 4, !tbaa !25
  %53 = mul nsw i32 %50, %52
  %54 = getelementptr inbounds %"class.fastjet::GhostedAreaSpec", ptr %3, i32 0, i32 12
  store i32 %53, ptr %54, align 8, !tbaa !29
  br label %95

55:                                               ; preds = %1
  %56 = getelementptr inbounds %"class.fastjet::GhostedAreaSpec", ptr %3, i32 0, i32 10
  %57 = load double, ptr %56, align 8, !tbaa !21
  %58 = fdiv double 0x401921FB54442D18, %57
  %59 = fadd double %58, 5.000000e-01
  %60 = fptosi double %59 to i32
  %61 = getelementptr inbounds %"class.fastjet::GhostedAreaSpec", ptr %3, i32 0, i32 13
  store i32 %60, ptr %61, align 4, !tbaa !25
  %62 = getelementptr inbounds %"class.fastjet::GhostedAreaSpec", ptr %3, i32 0, i32 13
  %63 = load i32, ptr %62, align 4, !tbaa !25
  %64 = sitofp i32 %63 to double
  %65 = fdiv double 0x401921FB54442D18, %64
  %66 = getelementptr inbounds %"class.fastjet::GhostedAreaSpec", ptr %3, i32 0, i32 10
  store double %65, ptr %66, align 8, !tbaa !21
  %67 = getelementptr inbounds %"class.fastjet::GhostedAreaSpec", ptr %3, i32 0, i32 0
  %68 = load double, ptr %67, align 8, !tbaa !26
  %69 = getelementptr inbounds %"class.fastjet::GhostedAreaSpec", ptr %3, i32 0, i32 11
  %70 = load double, ptr %69, align 8, !tbaa !20
  %71 = fdiv double %68, %70
  %72 = fadd double %71, 5.000000e-01
  %73 = fptosi double %72 to i32
  %74 = getelementptr inbounds %"class.fastjet::GhostedAreaSpec", ptr %3, i32 0, i32 14
  store i32 %73, ptr %74, align 8, !tbaa !27
  %75 = getelementptr inbounds %"class.fastjet::GhostedAreaSpec", ptr %3, i32 0, i32 0
  %76 = load double, ptr %75, align 8, !tbaa !26
  %77 = getelementptr inbounds %"class.fastjet::GhostedAreaSpec", ptr %3, i32 0, i32 14
  %78 = load i32, ptr %77, align 8, !tbaa !27
  %79 = sitofp i32 %78 to double
  %80 = fdiv double %76, %79
  %81 = getelementptr inbounds %"class.fastjet::GhostedAreaSpec", ptr %3, i32 0, i32 11
  store double %80, ptr %81, align 8, !tbaa !20
  %82 = getelementptr inbounds %"class.fastjet::GhostedAreaSpec", ptr %3, i32 0, i32 10
  %83 = load double, ptr %82, align 8, !tbaa !21
  %84 = getelementptr inbounds %"class.fastjet::GhostedAreaSpec", ptr %3, i32 0, i32 11
  %85 = load double, ptr %84, align 8, !tbaa !20
  %86 = fmul double %83, %85
  %87 = getelementptr inbounds %"class.fastjet::GhostedAreaSpec", ptr %3, i32 0, i32 9
  store double %86, ptr %87, align 8, !tbaa !28
  %88 = getelementptr inbounds %"class.fastjet::GhostedAreaSpec", ptr %3, i32 0, i32 14
  %89 = load i32, ptr %88, align 8, !tbaa !27
  %90 = mul nsw i32 2, %89
  %91 = getelementptr inbounds %"class.fastjet::GhostedAreaSpec", ptr %3, i32 0, i32 13
  %92 = load i32, ptr %91, align 4, !tbaa !25
  %93 = mul nsw i32 %90, %92
  %94 = getelementptr inbounds %"class.fastjet::GhostedAreaSpec", ptr %3, i32 0, i32 12
  store i32 %93, ptr %94, align 8, !tbaa !29
  br label %95

95:                                               ; preds = %55, %14
  call void @_ZN7fastjet15GhostedAreaSpec17checkpoint_randomEv(ptr noundef nonnull align 8 dereferenceable(144) %3)
  ret void
}

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

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

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

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 = { 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 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
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 = { 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, !11, i64 24}
!10 = !{!"_ZTSN7fastjet15GhostedAreaSpecE", !11, i64 0, !11, i64 8, !12, i64 16, !11, i64 24, !11, i64 32, !11, i64 40, !11, i64 48, !13, i64 56, !14, i64 64, !11, i64 80, !11, i64 88, !11, i64 96, !12, i64 104, !12, i64 108, !12, i64 112, !16, i64 120}
!11 = !{!"double", !7, i64 0}
!12 = !{!"int", !7, i64 0}
!13 = !{!"bool", !7, i64 0}
!14 = !{!"_ZTSN7fastjet8SelectorE", !15, i64 8}
!15 = !{!"_ZTSN7fastjet9SharedPtrINS_14SelectorWorkerEEE", !6, i64 0}
!16 = !{!"_ZTSSt6vectorIiSaIiEE", !17, i64 0}
!17 = !{!"_ZTSSt12_Vector_baseIiSaIiEE", !18, i64 0}
!18 = !{!"_ZTSNSt12_Vector_baseIiSaIiEE12_Vector_implE", !19, i64 0}
!19 = !{!"_ZTSNSt12_Vector_baseIiSaIiEE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!20 = !{!10, !11, i64 96}
!21 = !{!10, !11, i64 88}
!22 = !{!10, !13, i64 56}
!23 = !{i8 0, i8 2}
!24 = !{}
!25 = !{!10, !12, i64 108}
!26 = !{!10, !11, i64 0}
!27 = !{!10, !12, i64 112}
!28 = !{!10, !11, i64 80}
!29 = !{!10, !12, i64 104}


; 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 uwtable
define dso_local void @_ZN7fastjet15GhostedAreaSpec11_initializeEv(ptr noundef nonnull align 8 dereferenceable(144) %0) local_unnamed_addr #0 align 2 {
  %2 = getelementptr inbounds i8, ptr %0, i64 24
  %3 = load double, ptr %2, align 8, !tbaa !5
  %4 = tail call double @sqrt(double noundef %3) #4
  %5 = getelementptr inbounds i8, ptr %0, i64 56
  %6 = load i8, ptr %5, align 8, !tbaa !19, !range !20, !noundef !21
  %7 = trunc nuw i8 %6 to i1
  %8 = load double, ptr %0, align 8, !tbaa !22
  %9 = insertelement <2 x double> <double 0x401921FB54442D18, double poison>, double %8, i64 1
  %10 = insertelement <2 x double> poison, double %4, i64 0
  %11 = shufflevector <2 x double> %10, <2 x double> poison, <2 x i32> zeroinitializer
  %12 = fdiv <2 x double> %9, %11
  br i1 %7, label %13, label %25

13:                                               ; preds = %1
  %14 = tail call <2 x double> @llvm.ceil.v2f64(<2 x double> %12)
  %15 = fptosi <2 x double> %14 to <2 x i32>
  %16 = sitofp <2 x i32> %15 to <2 x double>
  %17 = fdiv <2 x double> %9, %16
  %shift = shufflevector <2 x double> %17, <2 x double> poison, <2 x i32> <i32 1, i32 poison>
  %18 = fmul <2 x double> %17, %shift
  %19 = extractelement <2 x double> %18, i64 0
  %20 = extractelement <2 x i32> %15, i64 1
  %21 = shl nsw i32 %20, 1
  %22 = or disjoint i32 %21, 1
  %23 = extractelement <2 x i32> %15, i64 0
  %24 = mul nsw i32 %22, %23
  br label %36

25:                                               ; preds = %1
  %26 = fadd <2 x double> %12, <double 5.000000e-01, double 5.000000e-01>
  %27 = fptosi <2 x double> %26 to <2 x i32>
  %28 = sitofp <2 x i32> %27 to <2 x double>
  %29 = fdiv <2 x double> %9, %28
  %shift6 = shufflevector <2 x double> %29, <2 x double> poison, <2 x i32> <i32 1, i32 poison>
  %30 = fmul <2 x double> %29, %shift6
  %31 = extractelement <2 x double> %30, i64 0
  %32 = extractelement <2 x i32> %27, i64 0
  %33 = shl i32 %32, 1
  %34 = extractelement <2 x i32> %27, i64 1
  %35 = mul i32 %33, %34
  br label %36

36:                                               ; preds = %25, %13
  %.sink1 = phi double [ %19, %13 ], [ %31, %25 ]
  %.sink = phi i32 [ %24, %13 ], [ %35, %25 ]
  %37 = phi <2 x double> [ %17, %13 ], [ %29, %25 ]
  %38 = phi <2 x i32> [ %15, %13 ], [ %27, %25 ]
  %39 = getelementptr inbounds i8, ptr %0, i64 88
  %40 = getelementptr inbounds i8, ptr %0, i64 108
  store <2 x i32> %38, ptr %40, align 4
  store <2 x double> %37, ptr %39, align 8
  %41 = getelementptr inbounds i8, ptr %0, i64 80
  store double %.sink1, ptr %41, align 8
  %42 = getelementptr inbounds i8, ptr %0, i64 104
  store i32 %.sink, ptr %42, align 8
  tail call void @_ZN7fastjet15GhostedAreaSpec17checkpoint_randomEv(ptr noundef nonnull align 8 dereferenceable(144) %0)
  ret void
}

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN7fastjet15GhostedAreaSpec17checkpoint_randomEv(ptr noundef nonnull align 8 dereferenceable(144)) local_unnamed_addr #2 align 2

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare <2 x double> @llvm.ceil.v2f64(<2 x double>) #3

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 = { 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 #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 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #4 = { 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, !7, i64 24}
!6 = !{!"_ZTSN7fastjet15GhostedAreaSpecE", !7, i64 0, !7, i64 8, !10, i64 16, !7, i64 24, !7, i64 32, !7, i64 40, !7, i64 48, !11, i64 56, !12, i64 64, !7, i64 80, !7, i64 88, !7, i64 96, !10, i64 104, !10, i64 108, !10, i64 112, !15, i64 120}
!7 = !{!"double", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!"int", !8, i64 0}
!11 = !{!"bool", !8, i64 0}
!12 = !{!"_ZTSN7fastjet8SelectorE", !13, i64 8}
!13 = !{!"_ZTSN7fastjet9SharedPtrINS_14SelectorWorkerEEE", !14, i64 0}
!14 = !{!"any pointer", !8, i64 0}
!15 = !{!"_ZTSSt6vectorIiSaIiEE", !16, i64 0}
!16 = !{!"_ZTSSt12_Vector_baseIiSaIiEE", !17, i64 0}
!17 = !{!"_ZTSNSt12_Vector_baseIiSaIiEE12_Vector_implE", !18, i64 0}
!18 = !{!"_ZTSNSt12_Vector_baseIiSaIiEE17_Vector_impl_dataE", !14, i64 0, !14, i64 8, !14, i64 16}
!19 = !{!6, !11, i64 56}
!20 = !{i8 0, i8 2}
!21 = !{}
!22 = !{!6, !7, i64 0}


; Effective O3 passes: DSEPass,EarlyCSEPass,GlobalDCEPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,MergedLoadStoreMotionPass,ReassociatePass,SLPVectorizerPass,SROAPass,SimplifyCFGPass,TailCallElimPass,VectorCombinePass