; 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::Edge" = type { double, double, double, [2 x ptr], [2 x ptr], i32 }
%"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: mustprogress nounwind uwtable
declare dso_local void @_ZN7fastjet23VoronoiDiagramGenerator8makefreeEPNS_8FreenodeEPNS_8FreelistE(ptr noundef nonnull align 8 dereferenceable(352), ptr noundef, ptr noundef) #0 align 2

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN7fastjet23VoronoiDiagramGenerator8endpointEPNS_4EdgeEiPNS_4SiteE(ptr noundef nonnull align 8 dereferenceable(352) %0, ptr noundef %1, i32 noundef %2, ptr noundef %3) #1 align 2 {
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca i32, align 4
  %8 = alloca ptr, align 8
  store ptr %0, ptr %5, align 8, !tbaa !5
  store ptr %1, ptr %6, align 8, !tbaa !5
  store i32 %2, ptr %7, align 4, !tbaa !9
  store ptr %3, ptr %8, align 8, !tbaa !5
  %9 = load ptr, ptr %5, align 8
  %10 = load ptr, ptr %8, align 8, !tbaa !5
  %11 = load ptr, ptr %6, align 8, !tbaa !5
  %12 = getelementptr inbounds %"class.fastjet::Edge", ptr %11, i32 0, i32 3
  %13 = load i32, ptr %7, align 4, !tbaa !9
  %14 = sext i32 %13 to i64
  %15 = getelementptr inbounds [2 x ptr], ptr %12, i64 0, i64 %14
  store ptr %10, ptr %15, align 8, !tbaa !5
  %16 = load ptr, ptr %8, align 8, !tbaa !5
  call void @_ZN7fastjet23VoronoiDiagramGenerator3refEPNS_4SiteE(ptr noundef nonnull align 8 dereferenceable(352) %9, ptr noundef %16)
  %17 = load ptr, ptr %6, align 8, !tbaa !5
  %18 = getelementptr inbounds %"class.fastjet::Edge", ptr %17, i32 0, i32 3
  %19 = load i32, ptr %7, align 4, !tbaa !9
  %20 = sub nsw i32 1, %19
  %21 = sext i32 %20 to i64
  %22 = getelementptr inbounds [2 x ptr], ptr %18, i64 0, i64 %21
  %23 = load ptr, ptr %22, align 8, !tbaa !5
  %24 = icmp eq ptr %23, null
  br i1 %24, label %25, label %26

25:                                               ; preds = %4
  br label %38

26:                                               ; preds = %4
  %27 = load ptr, ptr %6, align 8, !tbaa !5
  call void @_ZN7fastjet23VoronoiDiagramGenerator9clip_lineEPNS_4EdgeE(ptr noundef nonnull align 8 dereferenceable(352) %9, ptr noundef %27)
  %28 = load ptr, ptr %6, align 8, !tbaa !5
  %29 = getelementptr inbounds %"class.fastjet::Edge", ptr %28, i32 0, i32 4
  %30 = getelementptr inbounds [2 x ptr], ptr %29, i64 0, i64 0
  %31 = load ptr, ptr %30, align 8, !tbaa !5
  call void @_ZN7fastjet23VoronoiDiagramGenerator5derefEPNS_4SiteE(ptr noundef nonnull align 8 dereferenceable(352) %9, ptr noundef %31)
  %32 = load ptr, ptr %6, align 8, !tbaa !5
  %33 = getelementptr inbounds %"class.fastjet::Edge", ptr %32, i32 0, i32 4
  %34 = getelementptr inbounds [2 x ptr], ptr %33, i64 0, i64 1
  %35 = load ptr, ptr %34, align 8, !tbaa !5
  call void @_ZN7fastjet23VoronoiDiagramGenerator5derefEPNS_4SiteE(ptr noundef nonnull align 8 dereferenceable(352) %9, ptr noundef %35)
  %36 = load ptr, ptr %6, align 8, !tbaa !5
  %37 = getelementptr inbounds %"class.fastjet::VoronoiDiagramGenerator", ptr %9, i32 0, i32 25
  call void @_ZN7fastjet23VoronoiDiagramGenerator8makefreeEPNS_8FreenodeEPNS_8FreelistE(ptr noundef nonnull align 8 dereferenceable(352) %9, ptr noundef %36, ptr noundef %37)
  br label %38

38:                                               ; preds = %26, %25
  ret void
}

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

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

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 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 = !{!"int", !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"

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN7fastjet23VoronoiDiagramGenerator8endpointEPNS_4EdgeEiPNS_4SiteE(ptr noundef nonnull align 8 dereferenceable(352) %0, ptr noundef %1, i32 noundef %2, ptr noundef %3) local_unnamed_addr #1 align 2 {
  %5 = getelementptr inbounds i8, ptr %1, i64 24
  %6 = sext i32 %2 to i64
  %7 = getelementptr inbounds [2 x ptr], ptr %5, i64 0, i64 %6
  store ptr %3, ptr %7, align 8, !tbaa !5
  tail call void @_ZN7fastjet23VoronoiDiagramGenerator3refEPNS_4SiteE(ptr noundef nonnull align 8 dereferenceable(352) %0, ptr noundef %3)
  %8 = sub nsw i32 1, %2
  %9 = sext i32 %8 to i64
  %10 = getelementptr inbounds [2 x ptr], ptr %5, i64 0, i64 %9
  %11 = load ptr, ptr %10, align 8, !tbaa !5
  %12 = icmp eq ptr %11, null
  br i1 %12, label %19, label %13

13:                                               ; preds = %4
  tail call void @_ZN7fastjet23VoronoiDiagramGenerator9clip_lineEPNS_4EdgeE(ptr noundef nonnull align 8 dereferenceable(352) %0, ptr noundef nonnull %1)
  %14 = getelementptr inbounds i8, ptr %1, i64 40
  %15 = load ptr, ptr %14, align 8, !tbaa !5
  tail call void @_ZN7fastjet23VoronoiDiagramGenerator5derefEPNS_4SiteE(ptr noundef nonnull align 8 dereferenceable(352) %0, ptr noundef %15)
  %16 = getelementptr inbounds i8, ptr %1, i64 48
  %17 = load ptr, ptr %16, align 8, !tbaa !5
  tail call void @_ZN7fastjet23VoronoiDiagramGenerator5derefEPNS_4SiteE(ptr noundef nonnull align 8 dereferenceable(352) %0, ptr noundef %17)
  %18 = getelementptr inbounds i8, ptr %0, i64 184
  tail call void @_ZN7fastjet23VoronoiDiagramGenerator8makefreeEPNS_8FreenodeEPNS_8FreelistE(ptr noundef nonnull align 8 dereferenceable(352) %0, ptr noundef nonnull %1, ptr noundef nonnull %18)
  br label %19

19:                                               ; preds = %4, %13
  ret void
}

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

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

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


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