; LLVM IR from Sonryle/JoePhys :: JoePhys/src/World.ll (ZN5World20ResolveAllCollisionsEv)

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

%"struct.std::__detail::_Node_iterator" = type { %"struct.std::__detail::_Node_iterator_base" }
%"struct.std::__detail::_Node_iterator_base" = type { ptr }
%struct.vec2 = type { float, float }
%struct.World = type <{ %"class.std::vector", %"class.std::unordered_map", i32, i32, %struct.vec2, float, [4 x i8] }>
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<Cluster *, std::allocator<Cluster *>>::_Vector_impl" }
%"struct.std::_Vector_base<Cluster *, std::allocator<Cluster *>>::_Vector_impl" = type { %"struct.std::_Vector_base<Cluster *, std::allocator<Cluster *>>::_Vector_impl_data" }
%"struct.std::_Vector_base<Cluster *, std::allocator<Cluster *>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::unordered_map" = type { %"class.std::_Hashtable" }
%"class.std::_Hashtable" = type { ptr, i64, %"struct.std::__detail::_Hash_node_base", i64, %"struct.std::__detail::_Prime_rehash_policy", ptr }
%"struct.std::__detail::_Hash_node_base" = type { ptr }
%"struct.std::__detail::_Prime_rehash_policy" = type { float, i64 }
%struct.Particle = type { i8, %struct.vec2, %struct.vec2, float, float, float, %struct.vec2, [2 x %struct.vec2] }

; 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: 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) #1

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN5World20ResolveAllCollisionsEv(ptr noundef nonnull align 8 dereferenceable(100) %0) #2 align 2 {
  %2 = alloca ptr, align 8
  %3 = alloca ptr, align 8
  %4 = alloca %"struct.std::__detail::_Node_iterator", align 8
  %5 = alloca %"struct.std::__detail::_Node_iterator", align 8
  %6 = alloca i32, align 4
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca ptr, align 8
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca ptr, align 8
  %13 = alloca ptr, align 8
  %14 = alloca float, align 4
  %15 = alloca %struct.vec2, align 4
  %16 = alloca %struct.vec2, align 4
  %17 = alloca %struct.vec2, align 4
  %18 = alloca float, align 4
  store ptr %0, ptr %2, align 8, !tbaa !5
  %19 = load ptr, ptr %2, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %3) #7
  %20 = getelementptr inbounds %struct.World, ptr %19, i32 0, i32 1
  store ptr %20, ptr %3, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %4) #7
  %21 = load ptr, ptr %3, align 8, !tbaa !5
  %22 = call ptr @_ZNSt13unordered_mapIlSt6vectorIP8ParticleSaIS2_EESt4hashIlESt8equal_toIlESaISt4pairIKlS4_EEE5beginEv(ptr noundef nonnull align 8 dereferenceable(56) %21) #7
  %23 = getelementptr inbounds %"struct.std::__detail::_Node_iterator", ptr %4, i32 0, i32 0
  %24 = getelementptr inbounds %"struct.std::__detail::_Node_iterator_base", ptr %23, i32 0, i32 0
  store ptr %22, ptr %24, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #7
  %25 = load ptr, ptr %3, align 8, !tbaa !5
  %26 = call ptr @_ZNSt13unordered_mapIlSt6vectorIP8ParticleSaIS2_EESt4hashIlESt8equal_toIlESaISt4pairIKlS4_EEE3endEv(ptr noundef nonnull align 8 dereferenceable(56) %25) #7
  %27 = getelementptr inbounds %"struct.std::__detail::_Node_iterator", ptr %5, i32 0, i32 0
  %28 = getelementptr inbounds %"struct.std::__detail::_Node_iterator_base", ptr %27, i32 0, i32 0
  store ptr %26, ptr %28, align 8
  br label %29

29:                                               ; preds = %117, %1
  %30 = call noundef zeroext i1 @_ZNSt8__detailneERKNS_19_Node_iterator_baseISt4pairIKlSt6vectorIP8ParticleSaIS5_EEELb0EEESB_(ptr noundef nonnull align 8 dereferenceable(8) %4, ptr noundef nonnull align 8 dereferenceable(8) %5) #7
  br i1 %30, label %32, label %31

31:                                               ; preds = %29
  store i32 2, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #7
  br label %119

32:                                               ; preds = %29
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #7
  %33 = call noundef nonnull align 8 dereferenceable(32) ptr @_ZNKSt8__detail14_Node_iteratorISt4pairIKlSt6vectorIP8ParticleSaIS5_EEELb0ELb0EEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %4) #7
  store ptr %33, ptr %7, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #7
  %34 = load ptr, ptr %7, align 8, !tbaa !5
  %35 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3getILm0EKlSt6vectorIP8ParticleSaIS3_EEERNSt13tuple_elementIXT_ESt4pairIT0_T1_EE4typeERSA_(ptr noundef nonnull align 8 dereferenceable(32) %34) #7
  store ptr %35, ptr %8, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #7
  %36 = load ptr, ptr %7, align 8, !tbaa !5
  %37 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZSt3getILm1EKlSt6vectorIP8ParticleSaIS3_EEERNSt13tuple_elementIXT_ESt4pairIT0_T1_EE4typeERSA_(ptr noundef nonnull align 8 dereferenceable(32) %36) #7
  store ptr %37, ptr %9, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #7
  store i32 0, ptr %10, align 4, !tbaa !9
  br label %38

38:                                               ; preds = %113, %32
  %39 = load i32, ptr %10, align 4, !tbaa !9
  %40 = sext i32 %39 to i64
  %41 = load ptr, ptr %9, align 8, !tbaa !5
  %42 = call noundef i64 @_ZNKSt6vectorIP8ParticleSaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %41) #7
  %43 = icmp ult i64 %40, %42
  br i1 %43, label %45, label %44

44:                                               ; preds = %38
  store i32 4, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #7
  br label %116

45:                                               ; preds = %38
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #7
  %46 = load i32, ptr %10, align 4, !tbaa !9
  %47 = add nsw i32 %46, 1
  store i32 %47, ptr %11, align 4, !tbaa !9
  br label %48

48:                                               ; preds = %109, %45
  %49 = load i32, ptr %11, align 4, !tbaa !9
  %50 = sext i32 %49 to i64
  %51 = load ptr, ptr %9, align 8, !tbaa !5
  %52 = call noundef i64 @_ZNKSt6vectorIP8ParticleSaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %51) #7
  %53 = icmp ult i64 %50, %52
  br i1 %53, label %55, label %54

54:                                               ; preds = %48
  store i32 7, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #7
  br label %112

55:                                               ; preds = %48
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #7
  %56 = load ptr, ptr %9, align 8, !tbaa !5
  %57 = load i32, ptr %10, align 4, !tbaa !9
  %58 = sext i32 %57 to i64
  %59 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIP8ParticleSaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %56, i64 noundef %58) #7
  %60 = load ptr, ptr %59, align 8, !tbaa !5
  store ptr %60, ptr %12, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #7
  %61 = load ptr, ptr %9, align 8, !tbaa !5
  %62 = load i32, ptr %11, align 4, !tbaa !9
  %63 = sext i32 %62 to i64
  %64 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIP8ParticleSaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %61, i64 noundef %63) #7
  %65 = load ptr, ptr %64, align 8, !tbaa !5
  store ptr %65, ptr %13, align 8, !tbaa !5
  %66 = load ptr, ptr %12, align 8, !tbaa !5
  %67 = load ptr, ptr %13, align 8, !tbaa !5
  %68 = icmp eq ptr %66, %67
  br i1 %68, label %79, label %69

69:                                               ; preds = %55
  %70 = load ptr, ptr %12, align 8, !tbaa !5
  %71 = getelementptr inbounds %struct.Particle, ptr %70, i32 0, i32 0
  %72 = load i8, ptr %71, align 4, !tbaa !11, !range !16, !noundef !17
  %73 = trunc i8 %72 to i1
  br i1 %73, label %74, label %80

74:                                               ; preds = %69
  %75 = load ptr, ptr %13, align 8, !tbaa !5
  %76 = getelementptr inbounds %struct.Particle, ptr %75, i32 0, i32 0
  %77 = load i8, ptr %76, align 4, !tbaa !11, !range !16, !noundef !17
  %78 = trunc i8 %77 to i1
  br i1 %78, label %79, label %80

79:                                               ; preds = %74, %55
  store i32 9, ptr %6, align 4
  br label %106

80:                                               ; preds = %74, %69
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #7
  %81 = load ptr, ptr %12, align 8, !tbaa !5
  %82 = getelementptr inbounds %struct.Particle, ptr %81, i32 0, i32 1
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %16, ptr align 4 %82, i64 8, i1 false), !tbaa.struct !18
  %83 = load ptr, ptr %13, align 8, !tbaa !5
  %84 = getelementptr inbounds %struct.Particle, ptr %83, i32 0, i32 1
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %17, ptr align 4 %84, i64 8, i1 false), !tbaa.struct !18
  %85 = load <2 x float>, ptr %16, align 4
  %86 = load <2 x float>, ptr %17, align 4
  %87 = call <2 x float> @_Zmi4vec2S_(<2 x float> %85, <2 x float> %86)
  store <2 x float> %87, ptr %15, align 4
  %88 = load <2 x float>, ptr %15, align 4
  %89 = call noundef float @_Z13lengthSquared4vec2(<2 x float> %88)
  store float %89, ptr %14, align 4, !tbaa !19
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #7
  %90 = load ptr, ptr %12, align 8, !tbaa !5
  %91 = getelementptr inbounds %struct.Particle, ptr %90, i32 0, i32 4
  %92 = load float, ptr %91, align 4, !tbaa !20
  %93 = load ptr, ptr %13, align 8, !tbaa !5
  %94 = getelementptr inbounds %struct.Particle, ptr %93, i32 0, i32 4
  %95 = load float, ptr %94, align 4, !tbaa !20
  %96 = fadd float %92, %95
  store float %96, ptr %18, align 4, !tbaa !19
  %97 = load float, ptr %14, align 4, !tbaa !19
  %98 = load float, ptr %18, align 4, !tbaa !19
  %99 = load float, ptr %18, align 4, !tbaa !19
  %100 = fmul float %98, %99
  %101 = fcmp olt float %97, %100
  br i1 %101, label %102, label %105

102:                                              ; preds = %80
  %103 = load ptr, ptr %12, align 8, !tbaa !5
  %104 = load ptr, ptr %13, align 8, !tbaa !5
  call void @_ZN8Particle16ResolveCollisionEPS_(ptr noundef nonnull align 4 dereferenceable(56) %103, ptr noundef %104)
  br label %105

105:                                              ; preds = %102, %80
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #7
  store i32 0, ptr %6, align 4
  br label %106

106:                                              ; preds = %105, %79
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #7
  %107 = load i32, ptr %6, align 4
  switch i32 %107, label %120 [
    i32 0, label %108
    i32 9, label %109
  ]

108:                                              ; preds = %106
  br label %109

109:                                              ; preds = %108, %106
  %110 = load i32, ptr %11, align 4, !tbaa !9
  %111 = add nsw i32 %110, 1
  store i32 %111, ptr %11, align 4, !tbaa !9
  br label %48, !llvm.loop !21

112:                                              ; preds = %54
  br label %113

113:                                              ; preds = %112
  %114 = load i32, ptr %10, align 4, !tbaa !9
  %115 = add nsw i32 %114, 1
  store i32 %115, ptr %10, align 4, !tbaa !9
  br label %38, !llvm.loop !23

116:                                              ; preds = %44
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #7
  br label %117

117:                                              ; preds = %116
  %118 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt8__detail14_Node_iteratorISt4pairIKlSt6vectorIP8ParticleSaIS5_EEELb0ELb0EEppEv(ptr noundef nonnull align 8 dereferenceable(8) %4) #7
  br label %29

119:                                              ; preds = %31
  ret void

120:                                              ; preds = %106
  unreachable
}

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZNSt8__detailneERKNS_19_Node_iterator_baseISt4pairIKlSt6vectorIP8ParticleSaIS5_EEELb0EEESB_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) #3

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3getILm0EKlSt6vectorIP8ParticleSaIS3_EEERNSt13tuple_elementIXT_ESt4pairIT0_T1_EE4typeERSA_(ptr noundef nonnull align 8 dereferenceable(32)) #3

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

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef float @_Z13lengthSquared4vec2(<2 x float>) #4

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local <2 x float> @_Zmi4vec2S_(<2 x float>, <2 x float>) #5

declare void @_ZN8Particle16ResolveCollisionEPS_(ptr noundef nonnull align 4 dereferenceable(56), ptr noundef) #6

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

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { 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 #3 = { 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 #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 = { inlinehint 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 #6 = { "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 #7 = { 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 = !{!"int", !7, i64 0}
!11 = !{!12, !13, i64 0}
!12 = !{!"_ZTS8Particle", !13, i64 0, !14, i64 4, !14, i64 12, !15, i64 20, !15, i64 24, !15, i64 28, !14, i64 32, !7, i64 40}
!13 = !{!"bool", !7, i64 0}
!14 = !{!"_ZTS4vec2", !15, i64 0, !15, i64 4}
!15 = !{!"float", !7, i64 0}
!16 = !{i8 0, i8 2}
!17 = !{}
!18 = !{i64 0, i64 4, !19, i64 4, i64 4, !19}
!19 = !{!15, !15, i64 0}
!20 = !{!12, !15, i64 24}
!21 = distinct !{!21, !22}
!22 = !{!"llvm.loop.mustprogress"}
!23 = distinct !{!23, !22}


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

%"struct.std::__detail::_Node_iterator" = type { %"struct.std::__detail::_Node_iterator_base" }
%"struct.std::__detail::_Node_iterator_base" = type { ptr }

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN5World20ResolveAllCollisionsEv(ptr noundef nonnull align 8 dereferenceable(100) %0) local_unnamed_addr #1 align 2 {
  %2 = alloca %"struct.std::__detail::_Node_iterator", align 8
  %3 = alloca %"struct.std::__detail::_Node_iterator", align 8
  %4 = getelementptr inbounds i8, ptr %0, i64 24
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %2) #6
  %5 = tail call ptr @_ZNSt13unordered_mapIlSt6vectorIP8ParticleSaIS2_EESt4hashIlESt8equal_toIlESaISt4pairIKlS4_EEE5beginEv(ptr noundef nonnull align 8 dereferenceable(56) %4) #6
  store ptr %5, ptr %2, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #6
  %6 = tail call ptr @_ZNSt13unordered_mapIlSt6vectorIP8ParticleSaIS2_EESt4hashIlESt8equal_toIlESaISt4pairIKlS4_EEE3endEv(ptr noundef nonnull align 8 dereferenceable(56) %4) #6
  store ptr %6, ptr %3, align 8
  %7 = call noundef zeroext i1 @_ZNSt8__detailneERKNS_19_Node_iterator_baseISt4pairIKlSt6vectorIP8ParticleSaIS5_EEELb0EEESB_(ptr noundef nonnull align 8 dereferenceable(8) %2, ptr noundef nonnull align 8 dereferenceable(8) %3) #6
  br i1 %7, label %.lr.ph39, label %._crit_edge40

._crit_edge40:                                    ; preds = %._crit_edge, %1
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %2) #6
  ret void

.lr.ph39:                                         ; preds = %1, %._crit_edge
  %8 = call noundef nonnull align 8 dereferenceable(32) ptr @_ZNKSt8__detail14_Node_iteratorISt4pairIKlSt6vectorIP8ParticleSaIS5_EEELb0ELb0EEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %2) #6
  %9 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3getILm0EKlSt6vectorIP8ParticleSaIS3_EEERNSt13tuple_elementIXT_ESt4pairIT0_T1_EE4typeERSA_(ptr noundef nonnull align 8 dereferenceable(32) %8) #6
  %10 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZSt3getILm1EKlSt6vectorIP8ParticleSaIS3_EEERNSt13tuple_elementIXT_ESt4pairIT0_T1_EE4typeERSA_(ptr noundef nonnull align 8 dereferenceable(32) %8) #6
  %11 = call noundef i64 @_ZNKSt6vectorIP8ParticleSaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %10) #6
  %.not = icmp eq i64 %11, 0
  br i1 %.not, label %._crit_edge, label %.lr.ph37

.loopexit:                                        ; preds = %42, %.lr.ph37
  %12 = call noundef i64 @_ZNKSt6vectorIP8ParticleSaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %10) #6
  %13 = icmp ugt i64 %12, %indvars.iv.next45
  %indvars.iv.next = add i64 %indvars.iv, 1
  br i1 %13, label %.lr.ph37, label %._crit_edge, !llvm.loop !5

._crit_edge:                                      ; preds = %.loopexit, %.lr.ph39
  %14 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt8__detail14_Node_iteratorISt4pairIKlSt6vectorIP8ParticleSaIS5_EEELb0ELb0EEppEv(ptr noundef nonnull align 8 dereferenceable(8) %2) #6
  %15 = call noundef zeroext i1 @_ZNSt8__detailneERKNS_19_Node_iterator_baseISt4pairIKlSt6vectorIP8ParticleSaIS5_EEELb0EEESB_(ptr noundef nonnull align 8 dereferenceable(8) %2, ptr noundef nonnull align 8 dereferenceable(8) %3) #6
  br i1 %15, label %.lr.ph39, label %._crit_edge40

.lr.ph37:                                         ; preds = %.lr.ph39, %.loopexit
  %indvars.iv44 = phi i64 [ %indvars.iv.next45, %.loopexit ], [ 0, %.lr.ph39 ]
  %indvars.iv = phi i64 [ %indvars.iv.next, %.loopexit ], [ 1, %.lr.ph39 ]
  %indvars.iv.next45 = add nuw nsw i64 %indvars.iv44, 1
  %16 = call noundef i64 @_ZNKSt6vectorIP8ParticleSaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %10) #6
  %17 = icmp ugt i64 %16, %indvars.iv.next45
  br i1 %17, label %.lr.ph, label %.loopexit

.lr.ph:                                           ; preds = %.lr.ph37, %42
  %indvars.iv41 = phi i64 [ %indvars.iv.next42, %42 ], [ %indvars.iv, %.lr.ph37 ]
  %18 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIP8ParticleSaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %10, i64 noundef %indvars.iv44) #6
  %19 = load ptr, ptr %18, align 8, !tbaa !7
  %20 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIP8ParticleSaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %10, i64 noundef %indvars.iv41) #6
  %21 = load ptr, ptr %20, align 8, !tbaa !7
  %22 = icmp eq ptr %19, %21
  br i1 %22, label %42, label %23

23:                                               ; preds = %.lr.ph
  %24 = load i8, ptr %19, align 4, !tbaa !11, !range !16, !noundef !17
  %25 = trunc nuw i8 %24 to i1
  br i1 %25, label %26, label %29

26:                                               ; preds = %23
  %27 = load i8, ptr %21, align 4, !tbaa !11, !range !16, !noundef !17
  %28 = trunc nuw i8 %27 to i1
  br i1 %28, label %42, label %29

29:                                               ; preds = %26, %23
  %30 = getelementptr inbounds i8, ptr %19, i64 4
  %.sroa.02.0.copyload = load <2 x float>, ptr %30, align 4
  %31 = getelementptr inbounds i8, ptr %21, i64 4
  %.sroa.0.0.copyload = load <2 x float>, ptr %31, align 4
  %32 = call <2 x float> @_Zmi4vec2S_(<2 x float> %.sroa.02.0.copyload, <2 x float> %.sroa.0.0.copyload)
  %33 = call noundef float @_Z13lengthSquared4vec2(<2 x float> %32)
  %34 = getelementptr inbounds i8, ptr %19, i64 24
  %35 = load float, ptr %34, align 4, !tbaa !18
  %36 = getelementptr inbounds i8, ptr %21, i64 24
  %37 = load float, ptr %36, align 4, !tbaa !18
  %38 = fadd float %35, %37
  %39 = fmul float %38, %38
  %40 = fcmp olt float %33, %39
  br i1 %40, label %41, label %42

41:                                               ; preds = %29
  call void @_ZN8Particle16ResolveCollisionEPS_(ptr noundef nonnull align 4 dereferenceable(56) %19, ptr noundef nonnull %21)
  br label %42

42:                                               ; preds = %29, %41, %.lr.ph, %26
  %indvars.iv.next42 = add nuw nsw i64 %indvars.iv41, 1
  %43 = call noundef i64 @_ZNKSt6vectorIP8ParticleSaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %10) #6
  %44 = icmp ugt i64 %43, %indvars.iv.next42
  br i1 %44, label %.lr.ph, label %.loopexit, !llvm.loop !19
}

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

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

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

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

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

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

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef float @_Z13lengthSquared4vec2(<2 x float>) local_unnamed_addr #3

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local <2 x float> @_Zmi4vec2S_(<2 x float>, <2 x float>) local_unnamed_addr #4

declare void @_ZN8Particle16ResolveCollisionEPS_(ptr noundef nonnull align 4 dereferenceable(56), ptr noundef) local_unnamed_addr #5

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

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #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 = { inlinehint 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 #5 = { "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 = distinct !{!5, !6}
!6 = !{!"llvm.loop.mustprogress"}
!7 = !{!8, !8, i64 0}
!8 = !{!"any pointer", !9, i64 0}
!9 = !{!"omnipotent char", !10, i64 0}
!10 = !{!"Simple C++ TBAA"}
!11 = !{!12, !13, i64 0}
!12 = !{!"_ZTS8Particle", !13, i64 0, !14, i64 4, !14, i64 12, !15, i64 20, !15, i64 24, !15, i64 28, !14, i64 32, !9, i64 40}
!13 = !{!"bool", !9, i64 0}
!14 = !{!"_ZTS4vec2", !15, i64 0, !15, i64 4}
!15 = !{!"float", !9, i64 0}
!16 = !{i8 0, i8 2}
!17 = !{}
!18 = !{!12, !15, i64 24}
!19 = distinct !{!19, !6}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,SROAPass,SimplifyCFGPass,TailCallElimPass