; 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::Site" = type { %"class.fastjet::VPoint", i32, i32 }
%"class.fastjet::VPoint" = type { double, double }
%"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 uwtable
define dso_local void @_ZN7fastjet23VoronoiDiagramGenerator5derefEPNS_4SiteE(ptr noundef nonnull align 8 dereferenceable(352) %0, ptr noundef %1) #1 align 2 {
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  store ptr %0, ptr %3, align 8, !tbaa !5
  store ptr %1, ptr %4, align 8, !tbaa !5
  %5 = load ptr, ptr %3, align 8
  %6 = load ptr, ptr %4, align 8, !tbaa !5
  %7 = getelementptr inbounds %"class.fastjet::Site", ptr %6, i32 0, i32 2
  %8 = load i32, ptr %7, align 4, !tbaa !9
  %9 = sub nsw i32 %8, 1
  store i32 %9, ptr %7, align 4, !tbaa !9
  %10 = load ptr, ptr %4, align 8, !tbaa !5
  %11 = getelementptr inbounds %"class.fastjet::Site", ptr %10, i32 0, i32 2
  %12 = load i32, ptr %11, align 4, !tbaa !9
  %13 = icmp eq i32 %12, 0
  br i1 %13, label %14, label %17

14:                                               ; preds = %2
  %15 = load ptr, ptr %4, align 8, !tbaa !5
  %16 = getelementptr inbounds %"class.fastjet::VoronoiDiagramGenerator", ptr %5, i32 0, i32 22
  call void @_ZN7fastjet23VoronoiDiagramGenerator8makefreeEPNS_8FreenodeEPNS_8FreelistE(ptr noundef nonnull align 8 dereferenceable(352) %5, ptr noundef %15, ptr noundef %16)
  br label %17

17:                                               ; preds = %14, %2
  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" }
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, !13, i64 20}
!10 = !{!"_ZTSN7fastjet4SiteE", !11, i64 0, !13, i64 16, !13, i64 20}
!11 = !{!"_ZTSN7fastjet6VPointE", !12, i64 0, !12, i64 8}
!12 = !{!"double", !7, i64 0}
!13 = !{!"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
define dso_local void @_ZN7fastjet23VoronoiDiagramGenerator5derefEPNS_4SiteE(ptr noundef nonnull align 8 dereferenceable(352) %0, ptr noundef %1) local_unnamed_addr #0 align 2 {
  %3 = getelementptr inbounds i8, ptr %1, i64 20
  %4 = load i32, ptr %3, align 4, !tbaa !5
  %5 = add nsw i32 %4, -1
  store i32 %5, ptr %3, align 4, !tbaa !5
  %6 = icmp eq i32 %5, 0
  br i1 %6, label %7, label %9

7:                                                ; preds = %2
  %8 = getelementptr inbounds i8, ptr %0, i64 152
  tail call void @_ZN7fastjet23VoronoiDiagramGenerator8makefreeEPNS_8FreenodeEPNS_8FreelistE(ptr noundef nonnull align 8 dereferenceable(352) %0, ptr noundef nonnull %1, ptr noundef nonnull %8)
  br label %9

9:                                                ; preds = %7, %2
  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, !11, i64 20}
!6 = !{!"_ZTSN7fastjet4SiteE", !7, i64 0, !11, i64 16, !11, i64 20}
!7 = !{!"_ZTSN7fastjet6VPointE", !8, i64 0, !8, i64 8}
!8 = !{!"double", !9, i64 0}
!9 = !{!"omnipotent char", !10, i64 0}
!10 = !{!"Simple C++ TBAA"}
!11 = !{!"int", !9, i64 0}


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