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

; 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::VoronoiDiagramGenerator" = type { ptr, i32, ptr, %"class.fastjet::Freelist", ptr, ptr, i32, i32, i32, i32, i32, double, double, double, double, double, double, ptr, i32, i32, i32, i32, %"class.fastjet::Freelist", ptr, i32, %"class.fastjet::Freelist", i32, ptr, i32, i32, i32, i32, double, double, double, double, double, i32, double, double, double, double, ptr, ptr, ptr, ptr, double }
%"class.fastjet::Freelist" = type { ptr, i32 }

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN7fastjet23VoronoiDiagramGenerator8freeinitEPNS_8FreelistEi(ptr noundef nonnull align 8 dereferenceable(352), ptr noundef, i32 noundef) #1 align 2

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN7fastjet23VoronoiDiagramGenerator8geominitEv(ptr noundef nonnull align 8 dereferenceable(352) %0) #2 align 2 {
  %2 = alloca ptr, align 8
  %3 = alloca double, align 8
  store ptr %0, ptr %2, align 8, !tbaa !5
  %4 = load ptr, ptr %2, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %3) #4
  %5 = getelementptr inbounds %"class.fastjet::VoronoiDiagramGenerator", ptr %4, i32 0, i32 25
  call void @_ZN7fastjet23VoronoiDiagramGenerator8freeinitEPNS_8FreelistEi(ptr noundef nonnull align 8 dereferenceable(352) %4, ptr noundef %5, i32 noundef 64)
  %6 = getelementptr inbounds %"class.fastjet::VoronoiDiagramGenerator", ptr %4, i32 0, i32 21
  store i32 0, ptr %6, align 4, !tbaa !9
  %7 = getelementptr inbounds %"class.fastjet::VoronoiDiagramGenerator", ptr %4, i32 0, i32 24
  store i32 0, ptr %7, align 8, !tbaa !14
  %8 = getelementptr inbounds %"class.fastjet::VoronoiDiagramGenerator", ptr %4, i32 0, i32 18
  %9 = load i32, ptr %8, align 8, !tbaa !15
  %10 = sitofp i32 %9 to double
  %11 = fadd double %10, 4.000000e+00
  store double %11, ptr %3, align 8, !tbaa !16
  %12 = load double, ptr %3, align 8, !tbaa !16
  %13 = call double @sqrt(double noundef %12) #4
  %14 = fptosi double %13 to i32
  %15 = getelementptr inbounds %"class.fastjet::VoronoiDiagramGenerator", ptr %4, i32 0, i32 20
  store i32 %14, ptr %15, align 8, !tbaa !17
  %16 = getelementptr inbounds %"class.fastjet::VoronoiDiagramGenerator", ptr %4, i32 0, i32 14
  %17 = load double, ptr %16, align 8, !tbaa !18
  %18 = getelementptr inbounds %"class.fastjet::VoronoiDiagramGenerator", ptr %4, i32 0, i32 13
  %19 = load double, ptr %18, align 8, !tbaa !19
  %20 = fsub double %17, %19
  %21 = getelementptr inbounds %"class.fastjet::VoronoiDiagramGenerator", ptr %4, i32 0, i32 16
  store double %20, ptr %21, align 8, !tbaa !20
  %22 = getelementptr inbounds %"class.fastjet::VoronoiDiagramGenerator", ptr %4, i32 0, i32 12
  %23 = load double, ptr %22, align 8, !tbaa !21
  %24 = getelementptr inbounds %"class.fastjet::VoronoiDiagramGenerator", ptr %4, i32 0, i32 11
  %25 = load double, ptr %24, align 8, !tbaa !22
  %26 = fsub double %23, %25
  %27 = getelementptr inbounds %"class.fastjet::VoronoiDiagramGenerator", ptr %4, i32 0, i32 15
  store double %26, ptr %27, align 8, !tbaa !23
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #4
  ret void
}

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

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 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 = { 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 = { 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 148}
!10 = !{!"_ZTSN7fastjet23VoronoiDiagramGeneratorE", !6, i64 0, !11, i64 8, !6, i64 16, !12, i64 24, !6, i64 40, !6, i64 48, !11, i64 56, !11, i64 60, !11, i64 64, !11, i64 68, !11, i64 72, !13, i64 80, !13, i64 88, !13, i64 96, !13, i64 104, !13, i64 112, !13, i64 120, !6, i64 128, !11, i64 136, !11, i64 140, !11, i64 144, !11, i64 148, !12, i64 152, !6, i64 168, !11, i64 176, !12, i64 184, !11, i64 200, !6, i64 208, !11, i64 216, !11, i64 220, !11, i64 224, !11, i64 228, !13, i64 232, !13, i64 240, !13, i64 248, !13, i64 256, !13, i64 264, !11, i64 272, !13, i64 280, !13, i64 288, !13, i64 296, !13, i64 304, !6, i64 312, !6, i64 320, !6, i64 328, !6, i64 336, !13, i64 344}
!11 = !{!"int", !7, i64 0}
!12 = !{!"_ZTSN7fastjet8FreelistE", !6, i64 0, !11, i64 8}
!13 = !{!"double", !7, i64 0}
!14 = !{!10, !11, i64 176}
!15 = !{!10, !11, i64 136}
!16 = !{!13, !13, i64 0}
!17 = !{!10, !11, i64 144}
!18 = !{!10, !13, i64 104}
!19 = !{!10, !13, i64 96}
!20 = !{!10, !13, i64 120}
!21 = !{!10, !13, i64 88}
!22 = !{!10, !13, i64 80}
!23 = !{!10, !13, i64 112}


; 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 nounwind uwtable
declare dso_local void @_ZN7fastjet23VoronoiDiagramGenerator8freeinitEPNS_8FreelistEi(ptr noundef nonnull align 8 dereferenceable(352), ptr noundef, i32 noundef) local_unnamed_addr #0 align 2

; Function Attrs: mustprogress nounwind uwtable
define dso_local void @_ZN7fastjet23VoronoiDiagramGenerator8geominitEv(ptr noundef nonnull align 8 dereferenceable(352) %0) local_unnamed_addr #0 align 2 {
  %2 = getelementptr inbounds i8, ptr %0, i64 184
  tail call void @_ZN7fastjet23VoronoiDiagramGenerator8freeinitEPNS_8FreelistEi(ptr noundef nonnull align 8 dereferenceable(352) %0, ptr noundef nonnull %2, i32 noundef 64)
  %3 = getelementptr inbounds i8, ptr %0, i64 148
  store i32 0, ptr %3, align 4, !tbaa !5
  %4 = getelementptr inbounds i8, ptr %0, i64 176
  store i32 0, ptr %4, align 8, !tbaa !13
  %5 = getelementptr inbounds i8, ptr %0, i64 136
  %6 = load i32, ptr %5, align 8, !tbaa !14
  %7 = sitofp i32 %6 to double
  %8 = fadd double %7, 4.000000e+00
  %9 = tail call double @sqrt(double noundef %8) #2
  %10 = fptosi double %9 to i32
  %11 = getelementptr inbounds i8, ptr %0, i64 144
  store i32 %10, ptr %11, align 8, !tbaa !15
  %12 = getelementptr inbounds i8, ptr %0, i64 104
  %13 = load double, ptr %12, align 8, !tbaa !16
  %14 = getelementptr inbounds i8, ptr %0, i64 96
  %15 = load double, ptr %14, align 8, !tbaa !17
  %16 = getelementptr inbounds i8, ptr %0, i64 88
  %17 = load <2 x double>, ptr %16, align 8
  %18 = getelementptr inbounds i8, ptr %0, i64 80
  %19 = load <2 x double>, ptr %18, align 8
  %20 = getelementptr inbounds i8, ptr %0, i64 112
  %21 = insertelement <2 x double> %17, double %13, i64 1
  %22 = insertelement <2 x double> %19, double %15, i64 1
  %23 = fsub <2 x double> %21, %22
  store <2 x double> %23, ptr %20, align 8, !tbaa !18
  ret void
}

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

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" }
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 = { 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, !10, i64 148}
!6 = !{!"_ZTSN7fastjet23VoronoiDiagramGeneratorE", !7, i64 0, !10, i64 8, !7, i64 16, !11, i64 24, !7, i64 40, !7, i64 48, !10, i64 56, !10, i64 60, !10, i64 64, !10, i64 68, !10, i64 72, !12, i64 80, !12, i64 88, !12, i64 96, !12, i64 104, !12, i64 112, !12, i64 120, !7, i64 128, !10, i64 136, !10, i64 140, !10, i64 144, !10, i64 148, !11, i64 152, !7, i64 168, !10, i64 176, !11, i64 184, !10, i64 200, !7, i64 208, !10, i64 216, !10, i64 220, !10, i64 224, !10, i64 228, !12, i64 232, !12, i64 240, !12, i64 248, !12, i64 256, !12, i64 264, !10, i64 272, !12, i64 280, !12, i64 288, !12, i64 296, !12, i64 304, !7, i64 312, !7, i64 320, !7, i64 328, !7, i64 336, !12, i64 344}
!7 = !{!"any pointer", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!"int", !8, i64 0}
!11 = !{!"_ZTSN7fastjet8FreelistE", !7, i64 0, !10, i64 8}
!12 = !{!"double", !8, i64 0}
!13 = !{!6, !10, i64 176}
!14 = !{!6, !10, i64 136}
!15 = !{!6, !10, i64 144}
!16 = !{!6, !12, i64 104}
!17 = !{!6, !12, i64 96}
!18 = !{!12, !12, i64 0}


; Effective O3 passes: GlobalOptPass,InferFunctionAttrsPass,InstCombinePass,PostOrderFunctionAttrsPass,SLPVectorizerPass,SROAPass,TailCallElimPass,VectorCombinePass