; LLVM IR from mickypaganini/SSI2016-jet-clustering :: spartyjet-4.0.2_mac/JetTools (cyl_geom)

; 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.SpartyJet::point_t" = type { %"struct.std::pair" }
%"struct.std::pair" = type { float, float }
%"struct.std::_List_iterator" = type { ptr }
%"class.SpartyJet::line_t" = type <{ float, float, float, i8, [3 x i8] }>

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN9SpartyJet12testHullLineERNSt7__cxx114listINS_7point_tESaIS2_EEES2_(ptr noundef nonnull align 8 dereferenceable(24) %0, <2 x float> %1) #0 {
  %3 = alloca %"class.SpartyJet::point_t", align 4
  %4 = alloca ptr, align 8
  %5 = alloca %"struct.std::_List_iterator", align 8
  %6 = alloca %"struct.std::_List_iterator", align 8
  %7 = alloca %"struct.std::_List_iterator", align 8
  %8 = alloca %"struct.std::_List_iterator", align 8
  %9 = alloca %"class.SpartyJet::line_t", align 4
  %10 = alloca %"class.SpartyJet::point_t", align 4
  %11 = alloca %"class.SpartyJet::point_t", align 4
  %12 = alloca %"class.SpartyJet::point_t", align 4
  %13 = getelementptr inbounds %"class.SpartyJet::point_t", ptr %3, i32 0, i32 0
  store <2 x float> %1, ptr %13, align 4
  store ptr %0, ptr %4, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #6
  %14 = load ptr, ptr %4, align 8, !tbaa !5
  %15 = call ptr @_ZNSt7__cxx114listIN9SpartyJet7point_tESaIS2_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %14) #6
  %16 = getelementptr inbounds %"struct.std::_List_iterator", ptr %5, i32 0, i32 0
  store ptr %15, ptr %16, align 8
  %17 = call ptr @_ZNSt14_List_iteratorIN9SpartyJet7point_tEEmmEi(ptr noundef nonnull align 8 dereferenceable(8) %5, i32 noundef 0) #6
  %18 = getelementptr inbounds %"struct.std::_List_iterator", ptr %6, i32 0, i32 0
  store ptr %17, ptr %18, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #6
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %7, ptr align 8 %5, i64 8, i1 false), !tbaa.struct !9
  %19 = call ptr @_ZNSt14_List_iteratorIN9SpartyJet7point_tEEmmEi(ptr noundef nonnull align 8 dereferenceable(8) %7, i32 noundef 0) #6
  %20 = getelementptr inbounds %"struct.std::_List_iterator", ptr %8, i32 0, i32 0
  store ptr %19, ptr %20, align 8
  call void @llvm.lifetime.start.p0(i64 16, ptr %9) #6
  %21 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNKSt14_List_iteratorIN9SpartyJet7point_tEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %7) #6
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %10, ptr align 4 %21, i64 8, i1 false)
  %22 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNKSt14_List_iteratorIN9SpartyJet7point_tEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %5) #6
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %11, ptr align 4 %22, i64 8, i1 false)
  %23 = getelementptr inbounds %"class.SpartyJet::point_t", ptr %10, i32 0, i32 0
  %24 = load <2 x float>, ptr %23, align 4
  %25 = getelementptr inbounds %"class.SpartyJet::point_t", ptr %11, i32 0, i32 0
  %26 = load <2 x float>, ptr %25, align 4
  call void @_ZN9SpartyJet6line_tC2ENS_7point_tES1_(ptr noundef nonnull align 4 dereferenceable(13) %9, <2 x float> %24, <2 x float> %26)
  %27 = call noundef zeroext i1 @_ZN9SpartyJet6line_t7is_leftERNS_7point_tE(ptr noundef nonnull align 4 dereferenceable(13) %9, ptr noundef nonnull align 4 dereferenceable(8) %3)
  br i1 %27, label %37, label %28

28:                                               ; preds = %2
  %29 = load ptr, ptr %4, align 8, !tbaa !5
  %30 = call noundef i64 @_ZNKSt7__cxx114listIN9SpartyJet7point_tESaIS2_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %29) #6
  %31 = icmp ugt i64 %30, 2
  br i1 %31, label %32, label %37

32:                                               ; preds = %28
  %33 = load ptr, ptr %4, align 8, !tbaa !5
  call void @_ZNSt7__cxx114listIN9SpartyJet7point_tESaIS2_EE8pop_backEv(ptr noundef nonnull align 8 dereferenceable(24) %33) #6
  %34 = load ptr, ptr %4, align 8, !tbaa !5
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %12, ptr align 4 %3, i64 8, i1 false)
  %35 = getelementptr inbounds %"class.SpartyJet::point_t", ptr %12, i32 0, i32 0
  %36 = load <2 x float>, ptr %35, align 4
  call void @_ZN9SpartyJet12testHullLineERNSt7__cxx114listINS_7point_tESaIS2_EEES2_(ptr noundef nonnull align 8 dereferenceable(24) %34, <2 x float> %36)
  br label %39

37:                                               ; preds = %28, %2
  %38 = load ptr, ptr %4, align 8, !tbaa !5
  call void @_ZNSt7__cxx114listIN9SpartyJet7point_tESaIS2_EE9push_backERKS2_(ptr noundef nonnull align 8 dereferenceable(24) %38, ptr noundef nonnull align 4 dereferenceable(8) %3)
  br label %39

39:                                               ; preds = %37, %32
  call void @llvm.lifetime.end.p0(i64 16, ptr %9) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #6
  ret void
}

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local ptr @_ZNSt7__cxx114listIN9SpartyJet7point_tESaIS2_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24)) #2 align 2

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

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #3

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(8) ptr @_ZNKSt14_List_iteratorIN9SpartyJet7point_tEEdeEv(ptr noundef nonnull align 8 dereferenceable(8)) #2 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN9SpartyJet6line_tC2ENS_7point_tES1_(ptr noundef nonnull align 4 dereferenceable(13), <2 x float>, <2 x float>) unnamed_addr #4 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZN9SpartyJet6line_t7is_leftERNS_7point_tE(ptr noundef nonnull align 4 dereferenceable(13), ptr noundef nonnull align 4 dereferenceable(8)) #5 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZNKSt7__cxx114listIN9SpartyJet7point_tESaIS2_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24)) #2 align 2

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt7__cxx114listIN9SpartyJet7point_tESaIS2_EE9push_backERKS2_(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 4 dereferenceable(8)) #5 align 2

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

attributes #0 = { mustprogress uwtable "min-legal-vector-width"="64" "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 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { 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 #3 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #4 = { inlinehint mustprogress nounwind uwtable "min-legal-vector-width"="64" "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 #5 = { 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 #6 = { 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 = !{i64 0, i64 8, !5}


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

%"class.SpartyJet::point_t" = type { %"struct.std::pair" }
%"struct.std::pair" = type { float, float }
%"struct.std::_List_iterator" = type { ptr }
%"class.SpartyJet::line_t" = type <{ float, float, float, i8, [3 x i8] }>

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN9SpartyJet12testHullLineERNSt7__cxx114listINS_7point_tESaIS2_EEES2_(ptr noundef nonnull align 8 dereferenceable(24) %0, <2 x float> %1) local_unnamed_addr #0 {
  %3 = alloca %"class.SpartyJet::point_t", align 8
  %4 = alloca %"struct.std::_List_iterator", align 8
  %5 = alloca %"struct.std::_List_iterator", align 8
  %6 = alloca %"class.SpartyJet::line_t", align 4
  store <2 x float> %1, ptr %3, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #5
  %7 = tail call ptr @_ZNSt7__cxx114listIN9SpartyJet7point_tESaIS2_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %0) #5
  store ptr %7, ptr %4, align 8
  %8 = call ptr @_ZNSt14_List_iteratorIN9SpartyJet7point_tEEmmEi(ptr noundef nonnull align 8 dereferenceable(8) %4, i32 noundef 0) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #5
  %9 = load i64, ptr %4, align 8, !tbaa !5
  store i64 %9, ptr %5, align 8, !tbaa !5
  %10 = call ptr @_ZNSt14_List_iteratorIN9SpartyJet7point_tEEmmEi(ptr noundef nonnull align 8 dereferenceable(8) %5, i32 noundef 0) #5
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %6) #5
  %11 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNKSt14_List_iteratorIN9SpartyJet7point_tEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %5) #5
  %.sroa.02.0.copyload = load <2 x float>, ptr %11, align 4
  %12 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNKSt14_List_iteratorIN9SpartyJet7point_tEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %4) #5
  %.sroa.01.0.copyload = load <2 x float>, ptr %12, align 4
  call void @_ZN9SpartyJet6line_tC2ENS_7point_tES1_(ptr noundef nonnull align 4 dereferenceable(13) %6, <2 x float> %.sroa.02.0.copyload, <2 x float> %.sroa.01.0.copyload)
  %13 = call noundef zeroext i1 @_ZN9SpartyJet6line_t7is_leftERNS_7point_tE(ptr noundef nonnull align 4 dereferenceable(13) %6, ptr noundef nonnull align 4 dereferenceable(8) %3)
  br i1 %13, label %18, label %14

14:                                               ; preds = %2
  %15 = call noundef i64 @_ZNKSt7__cxx114listIN9SpartyJet7point_tESaIS2_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %0) #5
  %16 = icmp ugt i64 %15, 2
  br i1 %16, label %17, label %18

17:                                               ; preds = %14
  call void @_ZNSt7__cxx114listIN9SpartyJet7point_tESaIS2_EE8pop_backEv(ptr noundef nonnull align 8 dereferenceable(24) %0) #5
  %.sroa.0.0.copyload = load <2 x float>, ptr %3, align 8
  call void @_ZN9SpartyJet12testHullLineERNSt7__cxx114listINS_7point_tESaIS2_EEES2_(ptr noundef nonnull align 8 dereferenceable(24) %0, <2 x float> %.sroa.0.0.copyload)
  br label %19

18:                                               ; preds = %14, %2
  call void @_ZNSt7__cxx114listIN9SpartyJet7point_tESaIS2_EE9push_backERKS2_(ptr noundef nonnull align 8 dereferenceable(24) %0, ptr noundef nonnull align 4 dereferenceable(8) %3)
  br label %19

19:                                               ; preds = %18, %17
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %6) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #5
  ret void
}

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local ptr @_ZNSt7__cxx114listIN9SpartyJet7point_tESaIS2_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #2 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local ptr @_ZNSt14_List_iteratorIN9SpartyJet7point_tEEmmEi(ptr noundef nonnull align 8 dereferenceable(8), i32 noundef) local_unnamed_addr #2 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(8) ptr @_ZNKSt14_List_iteratorIN9SpartyJet7point_tEEdeEv(ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #2 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN9SpartyJet6line_tC2ENS_7point_tES1_(ptr noundef nonnull align 4 dereferenceable(13), <2 x float>, <2 x float>) unnamed_addr #3 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZN9SpartyJet6line_t7is_leftERNS_7point_tE(ptr noundef nonnull align 4 dereferenceable(13), ptr noundef nonnull align 4 dereferenceable(8)) local_unnamed_addr #4 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZNKSt7__cxx114listIN9SpartyJet7point_tESaIS2_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #2 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt7__cxx114listIN9SpartyJet7point_tESaIS2_EE8pop_backEv(ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #2 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt7__cxx114listIN9SpartyJet7point_tESaIS2_EE9push_backERKS2_(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 4 dereferenceable(8)) local_unnamed_addr #4 align 2

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

attributes #0 = { mustprogress uwtable "min-legal-vector-width"="64" "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 nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { 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 #3 = { inlinehint mustprogress nounwind uwtable "min-legal-vector-width"="64" "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 = { 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 #5 = { 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"}


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