; 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: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #0

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

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

; Function Attrs: mustprogress nounwind uwtable
define dso_local void @_ZN7fastjet23VoronoiDiagramGenerator8plotinitEv(ptr noundef nonnull align 8 dereferenceable(352) %0) #1 align 2 {
  %2 = alloca ptr, align 8
  %3 = alloca double, align 8
  %4 = alloca double, align 8
  %5 = alloca double, align 8
  store ptr %0, ptr %2, align 8, !tbaa !5
  %6 = load ptr, ptr %2, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %3) #2
  call void @llvm.lifetime.start.p0(i64 8, ptr %4) #2
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #2
  %7 = getelementptr inbounds %"class.fastjet::VoronoiDiagramGenerator", ptr %6, i32 0, i32 14
  %8 = load double, ptr %7, align 8, !tbaa !9
  %9 = getelementptr inbounds %"class.fastjet::VoronoiDiagramGenerator", ptr %6, i32 0, i32 13
  %10 = load double, ptr %9, align 8, !tbaa !14
  %11 = fsub double %8, %10
  store double %11, ptr %4, align 8, !tbaa !15
  %12 = getelementptr inbounds %"class.fastjet::VoronoiDiagramGenerator", ptr %6, i32 0, i32 12
  %13 = load double, ptr %12, align 8, !tbaa !16
  %14 = getelementptr inbounds %"class.fastjet::VoronoiDiagramGenerator", ptr %6, i32 0, i32 11
  %15 = load double, ptr %14, align 8, !tbaa !17
  %16 = fsub double %13, %15
  store double %16, ptr %3, align 8, !tbaa !15
  %17 = load double, ptr %3, align 8, !tbaa !15
  %18 = load double, ptr %4, align 8, !tbaa !15
  %19 = fcmp ogt double %17, %18
  br i1 %19, label %20, label %22

20:                                               ; preds = %1
  %21 = load double, ptr %3, align 8, !tbaa !15
  br label %24

22:                                               ; preds = %1
  %23 = load double, ptr %4, align 8, !tbaa !15
  br label %24

24:                                               ; preds = %22, %20
  %25 = phi double [ %21, %20 ], [ %23, %22 ]
  %26 = fmul double %25, 1.100000e+00
  store double %26, ptr %5, align 8, !tbaa !15
  %27 = getelementptr inbounds %"class.fastjet::VoronoiDiagramGenerator", ptr %6, i32 0, i32 11
  %28 = load double, ptr %27, align 8, !tbaa !17
  %29 = load double, ptr %5, align 8, !tbaa !15
  %30 = load double, ptr %3, align 8, !tbaa !15
  %31 = fsub double %29, %30
  %32 = fdiv double %31, 2.000000e+00
  %33 = fsub double %28, %32
  %34 = getelementptr inbounds %"class.fastjet::VoronoiDiagramGenerator", ptr %6, i32 0, i32 32
  store double %33, ptr %34, align 8, !tbaa !18
  %35 = getelementptr inbounds %"class.fastjet::VoronoiDiagramGenerator", ptr %6, i32 0, i32 12
  %36 = load double, ptr %35, align 8, !tbaa !16
  %37 = load double, ptr %5, align 8, !tbaa !15
  %38 = load double, ptr %3, align 8, !tbaa !15
  %39 = fsub double %37, %38
  %40 = fdiv double %39, 2.000000e+00
  %41 = fadd double %36, %40
  %42 = getelementptr inbounds %"class.fastjet::VoronoiDiagramGenerator", ptr %6, i32 0, i32 33
  store double %41, ptr %42, align 8, !tbaa !19
  %43 = getelementptr inbounds %"class.fastjet::VoronoiDiagramGenerator", ptr %6, i32 0, i32 13
  %44 = load double, ptr %43, align 8, !tbaa !14
  %45 = load double, ptr %5, align 8, !tbaa !15
  %46 = load double, ptr %4, align 8, !tbaa !15
  %47 = fsub double %45, %46
  %48 = fdiv double %47, 2.000000e+00
  %49 = fsub double %44, %48
  %50 = getelementptr inbounds %"class.fastjet::VoronoiDiagramGenerator", ptr %6, i32 0, i32 34
  store double %49, ptr %50, align 8, !tbaa !20
  %51 = getelementptr inbounds %"class.fastjet::VoronoiDiagramGenerator", ptr %6, i32 0, i32 14
  %52 = load double, ptr %51, align 8, !tbaa !9
  %53 = load double, ptr %5, align 8, !tbaa !15
  %54 = load double, ptr %4, align 8, !tbaa !15
  %55 = fsub double %53, %54
  %56 = fdiv double %55, 2.000000e+00
  %57 = fadd double %52, %56
  %58 = getelementptr inbounds %"class.fastjet::VoronoiDiagramGenerator", ptr %6, i32 0, i32 35
  store double %57, ptr %58, align 8, !tbaa !21
  %59 = getelementptr inbounds %"class.fastjet::VoronoiDiagramGenerator", ptr %6, i32 0, i32 33
  %60 = load double, ptr %59, align 8, !tbaa !19
  %61 = getelementptr inbounds %"class.fastjet::VoronoiDiagramGenerator", ptr %6, i32 0, i32 32
  %62 = load double, ptr %61, align 8, !tbaa !18
  %63 = fsub double %60, %62
  %64 = fdiv double %63, 3.500000e+02
  %65 = getelementptr inbounds %"class.fastjet::VoronoiDiagramGenerator", ptr %6, i32 0, i32 36
  store double %64, ptr %65, align 8, !tbaa !22
  call void @_ZN7fastjet23VoronoiDiagramGenerator6openplEv(ptr noundef nonnull align 8 dereferenceable(352) %6)
  %66 = getelementptr inbounds %"class.fastjet::VoronoiDiagramGenerator", ptr %6, i32 0, i32 32
  %67 = load double, ptr %66, align 8, !tbaa !18
  %68 = getelementptr inbounds %"class.fastjet::VoronoiDiagramGenerator", ptr %6, i32 0, i32 34
  %69 = load double, ptr %68, align 8, !tbaa !20
  %70 = getelementptr inbounds %"class.fastjet::VoronoiDiagramGenerator", ptr %6, i32 0, i32 33
  %71 = load double, ptr %70, align 8, !tbaa !19
  %72 = getelementptr inbounds %"class.fastjet::VoronoiDiagramGenerator", ptr %6, i32 0, i32 35
  %73 = load double, ptr %72, align 8, !tbaa !21
  call void @_ZN7fastjet23VoronoiDiagramGenerator5rangeEdddd(ptr noundef nonnull align 8 dereferenceable(352) %6, double noundef %67, double noundef %69, double noundef %71, double noundef %73)
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #2
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #2
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #2
  ret void
}

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 = { 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, !13, i64 104}
!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, !13, i64 96}
!15 = !{!13, !13, i64 0}
!16 = !{!10, !13, i64 88}
!17 = !{!10, !13, i64 80}
!18 = !{!10, !13, i64 232}
!19 = !{!10, !13, i64 240}
!20 = !{!10, !13, i64 248}
!21 = !{!10, !13, i64 256}
!22 = !{!10, !13, i64 264}


; 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 @_ZN7fastjet23VoronoiDiagramGenerator6openplEv(ptr noundef nonnull align 8 dereferenceable(352)) local_unnamed_addr #0 align 2

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

; Function Attrs: mustprogress nounwind uwtable
define dso_local void @_ZN7fastjet23VoronoiDiagramGenerator8plotinitEv(ptr noundef nonnull align 8 dereferenceable(352) %0) local_unnamed_addr #0 align 2 {
  %2 = getelementptr inbounds i8, ptr %0, i64 104
  %3 = load double, ptr %2, align 8, !tbaa !5
  %4 = getelementptr inbounds i8, ptr %0, i64 88
  %5 = getelementptr inbounds i8, ptr %0, i64 80
  %6 = load double, ptr %5, align 8, !tbaa !13
  %7 = getelementptr inbounds i8, ptr %0, i64 232
  %8 = getelementptr inbounds i8, ptr %0, i64 240
  %9 = getelementptr inbounds i8, ptr %0, i64 248
  %10 = load <2 x double>, ptr %4, align 8, !tbaa !14
  %11 = insertelement <2 x double> %10, double %3, i64 1
  %12 = insertelement <2 x double> %10, double %6, i64 0
  %13 = fsub <2 x double> %11, %12
  %14 = extractelement <2 x double> %13, i64 0
  %15 = extractelement <2 x double> %13, i64 1
  %16 = fcmp ogt double %14, %15
  %17 = select i1 %16, double %14, double %15
  %18 = fmul double %17, 1.100000e+00
  %19 = insertelement <2 x double> poison, double %18, i64 0
  %20 = shufflevector <2 x double> %19, <2 x double> poison, <2 x i32> zeroinitializer
  %21 = fsub <2 x double> %20, %13
  %22 = fmul <2 x double> %21, <double 5.000000e-01, double 5.000000e-01>
  %23 = extractelement <2 x double> %22, i64 0
  %24 = fsub double %6, %23
  store double %24, ptr %7, align 8, !tbaa !15
  %25 = fadd <2 x double> %10, %22
  %26 = fsub <2 x double> %10, %22
  %27 = shufflevector <2 x double> %25, <2 x double> %26, <2 x i32> <i32 0, i32 3>
  store <2 x double> %27, ptr %8, align 8, !tbaa !14
  %28 = extractelement <2 x double> %22, i64 1
  %29 = fadd double %3, %28
  %30 = getelementptr inbounds i8, ptr %0, i64 256
  store double %29, ptr %30, align 8, !tbaa !16
  %31 = extractelement <2 x double> %25, i64 0
  %32 = fsub double %31, %24
  %33 = fdiv double %32, 3.500000e+02
  %34 = getelementptr inbounds i8, ptr %0, i64 264
  store double %33, ptr %34, align 8, !tbaa !17
  tail call void @_ZN7fastjet23VoronoiDiagramGenerator6openplEv(ptr noundef nonnull align 8 dereferenceable(352) %0)
  %35 = load double, ptr %7, align 8, !tbaa !15
  %36 = load double, ptr %9, align 8, !tbaa !18
  %37 = load double, ptr %8, align 8, !tbaa !19
  %38 = load double, ptr %30, align 8, !tbaa !16
  tail call void @_ZN7fastjet23VoronoiDiagramGenerator5rangeEdddd(ptr noundef nonnull align 8 dereferenceable(352) %0, double noundef %35, double noundef %36, double noundef %37, double noundef %38)
  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, !12, i64 104}
!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, !12, i64 80}
!14 = !{!12, !12, i64 0}
!15 = !{!6, !12, i64 232}
!16 = !{!6, !12, i64 256}
!17 = !{!6, !12, i64 264}
!18 = !{!6, !12, i64 248}
!19 = !{!6, !12, i64 240}


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