; LLVM IR from SourangshuGhosh/Fluid-Simulation-for-Computer-Graphics :: src (spatialpointgrid)

; 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.std::vector.24" = type { %"struct.std::_Vector_base.25" }
%"struct.std::_Vector_base.25" = type { %"struct.std::_Vector_base<std::vector<GridPointReference>, std::allocator<std::vector<GridPointReference>>>::_Vector_impl" }
%"struct.std::_Vector_base<std::vector<GridPointReference>, std::allocator<std::vector<GridPointReference>>>::_Vector_impl" = type { %"struct.std::_Vector_base<std::vector<GridPointReference>, std::allocator<std::vector<GridPointReference>>>::_Vector_impl_data" }
%"struct.std::_Vector_base<std::vector<GridPointReference>, std::allocator<std::vector<GridPointReference>>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%struct.GridPoint = type { %"class.vmath::vec3", %struct.GridPointReference }
%"class.vmath::vec3" = type { float, float, float }
%struct.GridPointReference = type { i32 }
%"class.std::vector.10" = type { %"struct.std::_Vector_base.11" }
%"struct.std::_Vector_base.11" = type { %"struct.std::_Vector_base<vmath::vec3, std::allocator<vmath::vec3>>::_Vector_impl" }
%"struct.std::_Vector_base<vmath::vec3, std::allocator<vmath::vec3>>::_Vector_impl" = type { %"struct.std::_Vector_base<vmath::vec3, std::allocator<vmath::vec3>>::_Vector_impl_data" }
%"struct.std::_Vector_base<vmath::vec3, std::allocator<vmath::vec3>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%class.SpatialPointGrid = type { i32, i32, i32, double, %"class.std::vector", %"class.std::vector.0", %class.Array3d, %class.AABB }
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<GridPoint, std::allocator<GridPoint>>::_Vector_impl" }
%"struct.std::_Vector_base<GridPoint, std::allocator<GridPoint>>::_Vector_impl" = type { %"struct.std::_Vector_base<GridPoint, std::allocator<GridPoint>>::_Vector_impl_data" }
%"struct.std::_Vector_base<GridPoint, std::allocator<GridPoint>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::vector.0" = type { %"struct.std::_Vector_base.1" }
%"struct.std::_Vector_base.1" = type { %"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl" = type { %"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%class.Array3d = type { i32, i32, i32, ptr, i8, %"struct.SpatialPointGrid::CellNode", i32 }
%"struct.SpatialPointGrid::CellNode" = type { i32, i32 }
%class.AABB = type { %"class.vmath::vec3", double, double, double }

declare i32 @__gxx_personality_v0(...)

; 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 @_ZNSt6vectorIN5vmath4vec3ESaIS1_EEC2Ev(ptr noundef nonnull align 8 dereferenceable(24)) unnamed_addr #1 align 2

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt6vectorIN5vmath4vec3ESaIS1_EE9push_backERKS1_(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 4 dereferenceable(12)) #2 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 nounwind uwtable
declare dso_local void @_ZNSt6vectorIN5vmath4vec3ESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24)) unnamed_addr #1 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(16) ptr @_ZNSt6vectorI9GridPointSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) #1 align 2

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN9GridPointD2Ev(ptr noundef nonnull align 4 dereferenceable(16)) unnamed_addr #4 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN9GridPointC2Ev(ptr noundef nonnull align 4 dereferenceable(16)) unnamed_addr #2 align 2

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN16SpatialPointGrid27getConnectedPointComponentsEdRSt6vectorIS0_IN5vmath4vec3ESaIS2_EESaIS4_EE(ptr noundef nonnull align 8 dereferenceable(152) %0, double noundef %1, ptr noundef nonnull align 8 dereferenceable(24) %2) #2 align 2 personality ptr @__gxx_personality_v0 {
  %4 = alloca ptr, align 8
  %5 = alloca double, align 8
  %6 = alloca ptr, align 8
  %7 = alloca %"class.std::vector.24", align 8
  %8 = alloca ptr, align 8
  %9 = alloca i32, align 4
  %10 = alloca %struct.GridPoint, align 4
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca %"class.std::vector.10", align 8
  %14 = alloca i32, align 4
  %15 = alloca i32, align 4
  store ptr %0, ptr %4, align 8, !tbaa !5
  store double %1, ptr %5, align 8, !tbaa !9
  store ptr %2, ptr %6, align 8, !tbaa !5
  %16 = load ptr, ptr %4, align 8
  call void @llvm.lifetime.start.p0(i64 24, ptr %7) #5
  call void @_ZNSt6vectorIS_I18GridPointReferenceSaIS0_EESaIS2_EEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %7) #5
  %17 = load double, ptr %5, align 8, !tbaa !9
  invoke void @_ZN16SpatialPointGrid36getConnectedPointReferenceComponentsEdRSt6vectorIS0_I18GridPointReferenceSaIS1_EESaIS3_EE(ptr noundef nonnull align 8 dereferenceable(152) %16, double noundef %17, ptr noundef nonnull align 8 dereferenceable(24) %7)
          to label %18 unwind label %26

18:                                               ; preds = %3
  call void @llvm.lifetime.start.p0(i64 16, ptr %10) #5
  invoke void @_ZN9GridPointC2Ev(ptr noundef nonnull align 4 dereferenceable(16) %10)
          to label %19 unwind label %30

19:                                               ; preds = %18
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #5
  store i32 0, ptr %11, align 4, !tbaa !11
  br label %20

20:                                               ; preds = %82, %19
  %21 = load i32, ptr %11, align 4, !tbaa !11
  %22 = zext i32 %21 to i64
  %23 = call noundef i64 @_ZNKSt6vectorIS_I18GridPointReferenceSaIS0_EESaIS2_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %7) #5
  %24 = icmp ult i64 %22, %23
  br i1 %24, label %34, label %25

25:                                               ; preds = %20
  store i32 2, ptr %12, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #5
  br label %86

26:                                               ; preds = %3
  %27 = landingpad { ptr, i32 }
          cleanup
  %28 = extractvalue { ptr, i32 } %27, 0
  store ptr %28, ptr %8, align 8
  %29 = extractvalue { ptr, i32 } %27, 1
  store i32 %29, ptr %9, align 4
  br label %88

30:                                               ; preds = %18
  %31 = landingpad { ptr, i32 }
          cleanup
  %32 = extractvalue { ptr, i32 } %31, 0
  store ptr %32, ptr %8, align 8
  %33 = extractvalue { ptr, i32 } %31, 1
  store i32 %33, ptr %9, align 4
  br label %87

34:                                               ; preds = %20
  call void @llvm.lifetime.start.p0(i64 24, ptr %13) #5
  call void @_ZNSt6vectorIN5vmath4vec3ESaIS1_EEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %13) #5
  %35 = load i32, ptr %11, align 4, !tbaa !11
  %36 = zext i32 %35 to i64
  %37 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorIS_I18GridPointReferenceSaIS0_EESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %7, i64 noundef %36) #5
  %38 = call noundef i64 @_ZNKSt6vectorI18GridPointReferenceSaIS0_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %37) #5
  invoke void @_ZNSt6vectorIN5vmath4vec3ESaIS1_EE7reserveEm(ptr noundef nonnull align 8 dereferenceable(24) %13, i64 noundef %38)
          to label %39 unwind label %49

39:                                               ; preds = %34
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #5
  store i32 0, ptr %14, align 4, !tbaa !11
  br label %40

40:                                               ; preds = %72, %39
  %41 = load i32, ptr %14, align 4, !tbaa !11
  %42 = zext i32 %41 to i64
  %43 = load i32, ptr %11, align 4, !tbaa !11
  %44 = zext i32 %43 to i64
  %45 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorIS_I18GridPointReferenceSaIS0_EESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %7, i64 noundef %44) #5
  %46 = call noundef i64 @_ZNKSt6vectorI18GridPointReferenceSaIS0_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %45) #5
  %47 = icmp ult i64 %42, %46
  br i1 %47, label %53, label %48

48:                                               ; preds = %40
  store i32 5, ptr %12, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #5
  br label %79

49:                                               ; preds = %79, %34
  %50 = landingpad { ptr, i32 }
          cleanup
  %51 = extractvalue { ptr, i32 } %50, 0
  store ptr %51, ptr %8, align 8
  %52 = extractvalue { ptr, i32 } %50, 1
  store i32 %52, ptr %9, align 4
  br label %85

53:                                               ; preds = %40
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #5
  %54 = load i32, ptr %11, align 4, !tbaa !11
  %55 = zext i32 %54 to i64
  %56 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorIS_I18GridPointReferenceSaIS0_EESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %7, i64 noundef %55) #5
  %57 = load i32, ptr %14, align 4, !tbaa !11
  %58 = zext i32 %57 to i64
  %59 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorI18GridPointReferenceSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %56, i64 noundef %58) #5
  %60 = getelementptr inbounds %struct.GridPointReference, ptr %59, i32 0, i32 0
  %61 = load i32, ptr %60, align 4, !tbaa !13
  store i32 %61, ptr %15, align 4, !tbaa !11
  %62 = getelementptr inbounds %class.SpatialPointGrid, ptr %16, i32 0, i32 4
  %63 = getelementptr inbounds %class.SpatialPointGrid, ptr %16, i32 0, i32 5
  %64 = load i32, ptr %15, align 4, !tbaa !11
  %65 = sext i32 %64 to i64
  %66 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %63, i64 noundef %65) #5
  %67 = load i32, ptr %66, align 4, !tbaa !11
  %68 = sext i32 %67 to i64
  %69 = call noundef nonnull align 4 dereferenceable(16) ptr @_ZNSt6vectorI9GridPointSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %62, i64 noundef %68) #5
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %10, ptr align 4 %69, i64 16, i1 false), !tbaa.struct !15
  %70 = getelementptr inbounds %struct.GridPoint, ptr %10, i32 0, i32 0
  invoke void @_ZNSt6vectorIN5vmath4vec3ESaIS1_EE9push_backERKS1_(ptr noundef nonnull align 8 dereferenceable(24) %13, ptr noundef nonnull align 4 dereferenceable(12) %70)
          to label %71 unwind label %75

71:                                               ; preds = %53
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #5
  br label %72

72:                                               ; preds = %71
  %73 = load i32, ptr %14, align 4, !tbaa !11
  %74 = add i32 %73, 1
  store i32 %74, ptr %14, align 4, !tbaa !11
  br label %40, !llvm.loop !18

75:                                               ; preds = %53
  %76 = landingpad { ptr, i32 }
          cleanup
  %77 = extractvalue { ptr, i32 } %76, 0
  store ptr %77, ptr %8, align 8
  %78 = extractvalue { ptr, i32 } %76, 1
  store i32 %78, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #5
  br label %85

79:                                               ; preds = %48
  %80 = load ptr, ptr %6, align 8, !tbaa !5
  invoke void @_ZNSt6vectorIS_IN5vmath4vec3ESaIS1_EESaIS3_EE9push_backERKS3_(ptr noundef nonnull align 8 dereferenceable(24) %80, ptr noundef nonnull align 8 dereferenceable(24) %13)
          to label %81 unwind label %49

81:                                               ; preds = %79
  call void @_ZNSt6vectorIN5vmath4vec3ESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %13) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr %13) #5
  br label %82

82:                                               ; preds = %81
  %83 = load i32, ptr %11, align 4, !tbaa !11
  %84 = add i32 %83, 1
  store i32 %84, ptr %11, align 4, !tbaa !11
  br label %20, !llvm.loop !20

85:                                               ; preds = %75, %49
  call void @_ZNSt6vectorIN5vmath4vec3ESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %13) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr %13) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #5
  call void @_ZN9GridPointD2Ev(ptr noundef nonnull align 4 dereferenceable(16) %10) #5
  br label %87

86:                                               ; preds = %25
  call void @_ZN9GridPointD2Ev(ptr noundef nonnull align 4 dereferenceable(16) %10) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr %10) #5
  call void @_ZNSt6vectorIS_I18GridPointReferenceSaIS0_EESaIS2_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %7) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr %7) #5
  ret void

87:                                               ; preds = %85, %30
  call void @llvm.lifetime.end.p0(i64 16, ptr %10) #5
  br label %88

88:                                               ; preds = %87, %26
  call void @_ZNSt6vectorIS_I18GridPointReferenceSaIS0_EESaIS2_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %7) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr %7) #5
  br label %89

89:                                               ; preds = %88
  %90 = load ptr, ptr %8, align 8
  %91 = load i32, ptr %9, align 4
  %92 = insertvalue { ptr, i32 } poison, ptr %90, 0
  %93 = insertvalue { ptr, i32 } %92, i32 %91, 1
  resume { ptr, i32 } %93
}

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN16SpatialPointGrid36getConnectedPointReferenceComponentsEdRSt6vectorIS0_I18GridPointReferenceSaIS1_EESaIS3_EE(ptr noundef nonnull align 8 dereferenceable(152), double noundef, ptr noundef nonnull align 8 dereferenceable(24)) #2 align 2

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

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

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

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

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 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #4 = { inlinehint 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 #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"}
!9 = !{!10, !10, i64 0}
!10 = !{!"double", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"int", !7, i64 0}
!13 = !{!14, !12, i64 0}
!14 = !{!"_ZTS18GridPointReference", !12, i64 0}
!15 = !{i64 0, i64 4, !16, i64 4, i64 4, !16, i64 8, i64 4, !16, i64 12, i64 4, !11}
!16 = !{!17, !17, i64 0}
!17 = !{!"float", !7, i64 0}
!18 = distinct !{!18, !19}
!19 = !{!"llvm.loop.mustprogress"}
!20 = distinct !{!20, !19}


; 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.std::vector.24" = type { %"struct.std::_Vector_base.25" }
%"struct.std::_Vector_base.25" = type { %"struct.std::_Vector_base<std::vector<GridPointReference>, std::allocator<std::vector<GridPointReference>>>::_Vector_impl" }
%"struct.std::_Vector_base<std::vector<GridPointReference>, std::allocator<std::vector<GridPointReference>>>::_Vector_impl" = type { %"struct.std::_Vector_base<std::vector<GridPointReference>, std::allocator<std::vector<GridPointReference>>>::_Vector_impl_data" }
%"struct.std::_Vector_base<std::vector<GridPointReference>, std::allocator<std::vector<GridPointReference>>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%struct.GridPoint = type { %"class.vmath::vec3", %struct.GridPointReference }
%"class.vmath::vec3" = type { float, float, float }
%struct.GridPointReference = type { i32 }
%"class.std::vector.10" = type { %"struct.std::_Vector_base.11" }
%"struct.std::_Vector_base.11" = type { %"struct.std::_Vector_base<vmath::vec3, std::allocator<vmath::vec3>>::_Vector_impl" }
%"struct.std::_Vector_base<vmath::vec3, std::allocator<vmath::vec3>>::_Vector_impl" = type { %"struct.std::_Vector_base<vmath::vec3, std::allocator<vmath::vec3>>::_Vector_impl_data" }
%"struct.std::_Vector_base<vmath::vec3, std::allocator<vmath::vec3>>::_Vector_impl_data" = type { ptr, ptr, ptr }

declare i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress 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 @_ZNSt6vectorIN5vmath4vec3ESaIS1_EEC2Ev(ptr noundef nonnull align 8 dereferenceable(24)) unnamed_addr #1 align 2

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

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

; Function Attrs: mustprogress 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 @_ZNSt6vectorIN5vmath4vec3ESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24)) unnamed_addr #1 align 2

; Function Attrs: mustprogress 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(16) ptr @_ZNSt6vectorI9GridPointSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) local_unnamed_addr #1 align 2

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN9GridPointD2Ev(ptr noundef nonnull align 4 dereferenceable(16)) unnamed_addr #4 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN9GridPointC2Ev(ptr noundef nonnull align 4 dereferenceable(16)) unnamed_addr #2 align 2

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN16SpatialPointGrid27getConnectedPointComponentsEdRSt6vectorIS0_IN5vmath4vec3ESaIS2_EESaIS4_EE(ptr noundef nonnull align 8 dereferenceable(152) %0, double noundef %1, ptr noundef nonnull align 8 dereferenceable(24) %2) local_unnamed_addr #2 align 2 personality ptr @__gxx_personality_v0 {
  %4 = alloca %"class.std::vector.24", align 8
  %5 = alloca %struct.GridPoint, align 4
  %6 = alloca %"class.std::vector.10", align 8
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %4) #5
  call void @_ZNSt6vectorIS_I18GridPointReferenceSaIS0_EESaIS2_EEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %4) #5
  invoke void @_ZN16SpatialPointGrid36getConnectedPointReferenceComponentsEdRSt6vectorIS0_I18GridPointReferenceSaIS1_EESaIS3_EE(ptr noundef nonnull align 8 dereferenceable(152) %0, double noundef %1, ptr noundef nonnull align 8 dereferenceable(24) %4)
          to label %7 unwind label %11

7:                                                ; preds = %3
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %5) #5
  invoke void @_ZN9GridPointC2Ev(ptr noundef nonnull align 4 dereferenceable(16) %5)
          to label %.preheader23 unwind label %13

.preheader23:                                     ; preds = %7
  %8 = call noundef i64 @_ZNKSt6vectorIS_I18GridPointReferenceSaIS0_EESaIS2_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %4) #5
  %.not = icmp eq i64 %8, 0
  br i1 %.not, label %._crit_edge27, label %.lr.ph26

.lr.ph26:                                         ; preds = %.preheader23
  %9 = getelementptr inbounds i8, ptr %0, i64 24
  %10 = getelementptr inbounds i8, ptr %0, i64 48
  br label %15

._crit_edge27:                                    ; preds = %40, %.preheader23
  call void @_ZN9GridPointD2Ev(ptr noundef nonnull align 4 dereferenceable(16) %5) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %5) #5
  call void @_ZNSt6vectorIS_I18GridPointReferenceSaIS0_EESaIS2_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %4) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %4) #5
  ret void

11:                                               ; preds = %3
  %12 = landingpad { ptr, i32 }
          cleanup
  br label %47

13:                                               ; preds = %7
  %14 = landingpad { ptr, i32 }
          cleanup
  br label %46

15:                                               ; preds = %.lr.ph26, %40
  %16 = phi i64 [ 0, %.lr.ph26 ], [ %42, %40 ]
  %.01425 = phi i32 [ 0, %.lr.ph26 ], [ %41, %40 ]
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %6) #5
  call void @_ZNSt6vectorIN5vmath4vec3ESaIS1_EEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %6) #5
  %17 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorIS_I18GridPointReferenceSaIS0_EESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %4, i64 noundef %16) #5
  %18 = call noundef i64 @_ZNKSt6vectorI18GridPointReferenceSaIS0_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %17) #5
  invoke void @_ZNSt6vectorIN5vmath4vec3ESaIS1_EE7reserveEm(ptr noundef nonnull align 8 dereferenceable(24) %6, i64 noundef %18)
          to label %.preheader unwind label %21

.preheader:                                       ; preds = %15
  %19 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorIS_I18GridPointReferenceSaIS0_EESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %4, i64 noundef %16) #5
  %20 = call noundef i64 @_ZNKSt6vectorI18GridPointReferenceSaIS0_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %19) #5
  %.not28 = icmp eq i64 %20, 0
  br i1 %.not28, label %._crit_edge, label %.lr.ph

._crit_edge:                                      ; preds = %32, %.preheader
  invoke void @_ZNSt6vectorIS_IN5vmath4vec3ESaIS1_EESaIS3_EE9push_backERKS3_(ptr noundef nonnull align 8 dereferenceable(24) %2, ptr noundef nonnull align 8 dereferenceable(24) %6)
          to label %40 unwind label %21

21:                                               ; preds = %._crit_edge, %15
  %22 = landingpad { ptr, i32 }
          cleanup
  br label %45

.lr.ph:                                           ; preds = %.preheader, %32
  %23 = phi i64 [ %34, %32 ], [ 0, %.preheader ]
  %.01324 = phi i32 [ %33, %32 ], [ 0, %.preheader ]
  %24 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorIS_I18GridPointReferenceSaIS0_EESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %4, i64 noundef %16) #5
  %25 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorI18GridPointReferenceSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %24, i64 noundef %23) #5
  %26 = load i32, ptr %25, align 4, !tbaa !5
  %27 = sext i32 %26 to i64
  %28 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %10, i64 noundef %27) #5
  %29 = load i32, ptr %28, align 4, !tbaa !10
  %30 = sext i32 %29 to i64
  %31 = call noundef nonnull align 4 dereferenceable(16) ptr @_ZNSt6vectorI9GridPointSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %9, i64 noundef %30) #5
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(16) %5, ptr noundef nonnull align 4 dereferenceable(16) %31, i64 16, i1 false), !tbaa.struct !11
  invoke void @_ZNSt6vectorIN5vmath4vec3ESaIS1_EE9push_backERKS1_(ptr noundef nonnull align 8 dereferenceable(24) %6, ptr noundef nonnull align 4 dereferenceable(12) %5)
          to label %32 unwind label %38

32:                                               ; preds = %.lr.ph
  %33 = add i32 %.01324, 1
  %34 = zext i32 %33 to i64
  %35 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorIS_I18GridPointReferenceSaIS0_EESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %4, i64 noundef %16) #5
  %36 = call noundef i64 @_ZNKSt6vectorI18GridPointReferenceSaIS0_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %35) #5
  %37 = icmp ugt i64 %36, %34
  br i1 %37, label %.lr.ph, label %._crit_edge, !llvm.loop !14

38:                                               ; preds = %.lr.ph
  %39 = landingpad { ptr, i32 }
          cleanup
  br label %45

40:                                               ; preds = %._crit_edge
  call void @_ZNSt6vectorIN5vmath4vec3ESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %6) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %6) #5
  %41 = add i32 %.01425, 1
  %42 = zext i32 %41 to i64
  %43 = call noundef i64 @_ZNKSt6vectorIS_I18GridPointReferenceSaIS0_EESaIS2_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %4) #5
  %44 = icmp ugt i64 %43, %42
  br i1 %44, label %15, label %._crit_edge27, !llvm.loop !16

45:                                               ; preds = %38, %21
  %.pn = phi { ptr, i32 } [ %39, %38 ], [ %22, %21 ]
  call void @_ZNSt6vectorIN5vmath4vec3ESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %6) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %6) #5
  call void @_ZN9GridPointD2Ev(ptr noundef nonnull align 4 dereferenceable(16) %5) #5
  br label %46

46:                                               ; preds = %45, %13
  %.pn.pn = phi { ptr, i32 } [ %.pn, %45 ], [ %14, %13 ]
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %5) #5
  br label %47

47:                                               ; preds = %46, %11
  %.pn.pn.pn = phi { ptr, i32 } [ %.pn.pn, %46 ], [ %12, %11 ]
  call void @_ZNSt6vectorIS_I18GridPointReferenceSaIS0_EESaIS2_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %4) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %4) #5
  resume { ptr, i32 } %.pn.pn.pn
}

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

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

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

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

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

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

attributes #0 = { mustprogress 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 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #4 = { inlinehint 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 #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, !7, i64 0}
!6 = !{!"_ZTS18GridPointReference", !7, i64 0}
!7 = !{!"int", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!7, !7, i64 0}
!11 = !{i64 0, i64 4, !12, i64 4, i64 4, !12, i64 8, i64 4, !12, i64 12, i64 4, !10}
!12 = !{!13, !13, i64 0}
!13 = !{!"float", !8, i64 0}
!14 = distinct !{!14, !15}
!15 = !{!"llvm.loop.mustprogress"}
!16 = distinct !{!16, !15}


; Effective O3 passes: EarlyCSEPass,GlobalOptPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LICMPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,SROAPass,SimplifyCFGPass