; LLVM IR from erayzesen/QuarkPhysics :: QuarkPhysics/extensions/qspatialhashing.ll (ZN15QSpatialHashing8GetPairsEv)

; 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.QAABB = type { %struct.QVector, %struct.QVector, %struct.QVector, float }
%struct.QVector = type { float, float }
%"struct.std::__detail::_Node_iterator.49" = type { %"struct.std::__detail::_Node_iterator_base.50" }
%"struct.std::__detail::_Node_iterator_base.50" = type { ptr }
%"class.__gnu_cxx::__normal_iterator" = type { ptr }
%"struct.std::pair.53" = type { ptr, ptr }
%"struct.std::__detail::_Node_iterator.55" = type { %"struct.std::__detail::_Node_iterator_base.56" }
%"struct.std::__detail::_Node_iterator_base.56" = type { ptr }
%"struct.std::pair.57" = type <{ %"struct.std::__detail::_Node_iterator.55", i8, [7 x i8] }>
%class.QBroadPhase = type { ptr, %"class.std::unordered_set", ptr }
%"class.std::unordered_set" = 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 }
%class.QSpatialHashing = type { %class.QBroadPhase, float, float, %"class.std::unordered_map", %"class.std::unordered_map.17" }
%"class.std::unordered_map" = type { %"class.std::_Hashtable.2" }
%"class.std::_Hashtable.2" = type { ptr, i64, %"struct.std::__detail::_Hash_node_base", i64, %"struct.std::__detail::_Prime_rehash_policy", ptr }
%"class.std::unordered_map.17" = type { %"class.std::_Hashtable.18" }
%"class.std::_Hashtable.18" = type { ptr, i64, %"struct.std::__detail::_Hash_node_base", i64, %"struct.std::__detail::_Prime_rehash_policy", ptr }
%"struct.std::pair.51" = type { %"struct.std::pair.46", %"class.std::vector" }
%"struct.std::pair.46" = type { i32, i32 }
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<QBody *, std::allocator<QBody *>>::_Vector_impl" }
%"struct.std::_Vector_base<QBody *, std::allocator<QBody *>>::_Vector_impl" = type { %"struct.std::_Vector_base<QBody *, std::allocator<QBody *>>::_Vector_impl_data" }
%"struct.std::_Vector_base<QBody *, std::allocator<QBody *>>::_Vector_impl_data" = type { ptr, ptr, ptr }

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

; 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 void @_ZNK5QBody7GetAABBEv(ptr dead_on_unwind noalias writable sret(%class.QAABB) align 4, ptr noundef nonnull align 8 dereferenceable(293)) #0 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local <2 x float> @_ZN5QAABB6GetMinEv(ptr noundef nonnull align 4 dereferenceable(28)) #2 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local <2 x float> @_ZN5QAABB6GetMaxEv(ptr noundef nonnull align 4 dereferenceable(28)) #2 align 2

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

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

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

; Function Attrs: mustprogress uwtable
define dso_local noundef nonnull align 8 dereferenceable(56) ptr @_ZN15QSpatialHashing8GetPairsEv(ptr noundef nonnull align 8 dereferenceable(192) %0) unnamed_addr #3 align 2 {
  %2 = alloca ptr, align 8
  %3 = alloca ptr, align 8
  %4 = alloca %"struct.std::__detail::_Node_iterator.49", align 8
  %5 = alloca %"struct.std::__detail::_Node_iterator.49", align 8
  %6 = alloca i32, align 4
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca i64, align 8
  %10 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %11 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %12 = alloca i64, align 8
  %13 = alloca ptr, align 8
  %14 = alloca i64, align 8
  %15 = alloca ptr, align 8
  %16 = alloca %"struct.std::pair.53", align 8
  %17 = alloca %"struct.std::__detail::_Node_iterator.55", align 8
  %18 = alloca %"struct.std::__detail::_Node_iterator.55", align 8
  %19 = alloca %struct.QVector, align 4
  %20 = alloca %class.QAABB, align 4
  %21 = alloca %struct.QVector, align 4
  %22 = alloca %class.QAABB, align 4
  %23 = alloca %struct.QVector, align 4
  %24 = alloca %class.QAABB, align 4
  %25 = alloca %struct.QVector, align 4
  %26 = alloca %class.QAABB, align 4
  %27 = alloca %struct.QVector, align 4
  %28 = alloca %class.QAABB, align 4
  %29 = alloca %struct.QVector, align 4
  %30 = alloca %class.QAABB, align 4
  %31 = alloca %"struct.std::pair.57", align 8
  store ptr %0, ptr %2, align 8, !tbaa !5
  %32 = load ptr, ptr %2, align 8
  %33 = getelementptr inbounds %class.QBroadPhase, ptr %32, i32 0, i32 1
  call void @_ZNSt13unordered_setISt4pairIP5QBodyS2_ENS1_12BodyPairHashENS1_13BodyPairEqualESaIS3_EE5clearEv(ptr noundef nonnull align 8 dereferenceable(56) %33) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %3) #6
  %34 = getelementptr inbounds %class.QSpatialHashing, ptr %32, i32 0, i32 3
  store ptr %34, ptr %3, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %4) #6
  %35 = load ptr, ptr %3, align 8, !tbaa !5
  %36 = call ptr @_ZNSt13unordered_mapISt4pairIiiESt6vectorIP5QBodySaIS4_EEN15QSpatialHashing8PairHashESt8equal_toIS1_ESaIS0_IKS1_S6_EEE5beginEv(ptr noundef nonnull align 8 dereferenceable(56) %35) #6
  %37 = getelementptr inbounds %"struct.std::__detail::_Node_iterator.49", ptr %4, i32 0, i32 0
  %38 = getelementptr inbounds %"struct.std::__detail::_Node_iterator_base.50", ptr %37, i32 0, i32 0
  store ptr %36, ptr %38, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #6
  %39 = load ptr, ptr %3, align 8, !tbaa !5
  %40 = call ptr @_ZNSt13unordered_mapISt4pairIiiESt6vectorIP5QBodySaIS4_EEN15QSpatialHashing8PairHashESt8equal_toIS1_ESaIS0_IKS1_S6_EEE3endEv(ptr noundef nonnull align 8 dereferenceable(56) %39) #6
  %41 = getelementptr inbounds %"struct.std::__detail::_Node_iterator.49", ptr %5, i32 0, i32 0
  %42 = getelementptr inbounds %"struct.std::__detail::_Node_iterator_base.50", ptr %41, i32 0, i32 0
  store ptr %40, ptr %42, align 8
  br label %43

43:                                               ; preds = %164, %1
  %44 = call noundef zeroext i1 @_ZNSt8__detailneERKNS_19_Node_iterator_baseISt4pairIKS1_IiiESt6vectorIP5QBodySaIS6_EEELb1EEESC_(ptr noundef nonnull align 8 dereferenceable(8) %4, ptr noundef nonnull align 8 dereferenceable(8) %5) #6
  br i1 %44, label %46, label %45

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

46:                                               ; preds = %43
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #6
  %47 = call noundef nonnull align 8 dereferenceable(32) ptr @_ZNKSt8__detail14_Node_iteratorISt4pairIKS1_IiiESt6vectorIP5QBodySaIS6_EEELb0ELb1EEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %4) #6
  store ptr %47, ptr %7, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #6
  %48 = load ptr, ptr %7, align 8, !tbaa !5
  %49 = getelementptr inbounds %"struct.std::pair.51", ptr %48, i32 0, i32 1
  store ptr %49, ptr %8, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #6
  %50 = load ptr, ptr %8, align 8, !tbaa !5
  %51 = call noundef i64 @_ZNKSt6vectorIP5QBodySaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %50) #6
  store i64 %51, ptr %9, align 8, !tbaa !9
  %52 = load i64, ptr %9, align 8, !tbaa !9
  %53 = icmp ule i64 %52, 1
  br i1 %53, label %54, label %55

54:                                               ; preds = %46
  store i32 3, ptr %6, align 4
  br label %158

55:                                               ; preds = %46
  %56 = load ptr, ptr %8, align 8, !tbaa !5
  %57 = call ptr @_ZNSt6vectorIP5QBodySaIS1_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %56) #6
  %58 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %10, i32 0, i32 0
  store ptr %57, ptr %58, align 8
  %59 = load ptr, ptr %8, align 8, !tbaa !5
  %60 = call ptr @_ZNSt6vectorIP5QBodySaIS1_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %59) #6
  %61 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %11, i32 0, i32 0
  store ptr %60, ptr %61, align 8
  %62 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %10, i32 0, i32 0
  %63 = load ptr, ptr %62, align 8
  %64 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %11, i32 0, i32 0
  %65 = load ptr, ptr %64, align 8
  call void @_ZSt4sortIN9__gnu_cxx17__normal_iteratorIPP5QBodySt6vectorIS3_SaIS3_EEEEPFbPKS2_SA_EEvT_SD_T0_(ptr %63, ptr %65, ptr noundef @_ZN15QSpatialHashing20SortBodiesHorizontalEPK5QBodyS2_)
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #6
  store i64 0, ptr %12, align 8, !tbaa !9
  br label %66

66:                                               ; preds = %154, %55
  %67 = load i64, ptr %12, align 8, !tbaa !9
  %68 = load i64, ptr %9, align 8, !tbaa !9
  %69 = sub i64 %68, 1
  %70 = icmp ult i64 %67, %69
  br i1 %70, label %72, label %71

71:                                               ; preds = %66
  store i32 4, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #6
  br label %157

72:                                               ; preds = %66
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #6
  %73 = load ptr, ptr %8, align 8, !tbaa !5
  %74 = load i64, ptr %12, align 8, !tbaa !9
  %75 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIP5QBodySaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %73, i64 noundef %74) #6
  %76 = load ptr, ptr %75, align 8, !tbaa !5
  store ptr %76, ptr %13, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #6
  %77 = load i64, ptr %12, align 8, !tbaa !9
  %78 = add i64 %77, 1
  store i64 %78, ptr %14, align 8, !tbaa !9
  br label %79

79:                                               ; preds = %149, %72
  %80 = load i64, ptr %14, align 8, !tbaa !9
  %81 = load i64, ptr %9, align 8, !tbaa !9
  %82 = icmp ult i64 %80, %81
  br i1 %82, label %84, label %83

83:                                               ; preds = %79
  store i32 7, ptr %6, align 4
  br label %152

84:                                               ; preds = %79
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #6
  %85 = load ptr, ptr %8, align 8, !tbaa !5
  %86 = load i64, ptr %14, align 8, !tbaa !9
  %87 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIP5QBodySaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %85, i64 noundef %86) #6
  %88 = load ptr, ptr %87, align 8, !tbaa !5
  store ptr %88, ptr %15, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 16, ptr %16) #6
  call void @_ZNSt4pairIP5QBodyS1_EC2IRS1_S4_TnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS6_S7_EEEbE4typeELb1EEEOS6_OS7_(ptr noundef nonnull align 8 dereferenceable(16) %16, ptr noundef nonnull align 8 dereferenceable(8) %13, ptr noundef nonnull align 8 dereferenceable(8) %15)
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #6
  %89 = getelementptr inbounds %class.QBroadPhase, ptr %32, i32 0, i32 1
  %90 = call ptr @_ZNSt13unordered_setISt4pairIP5QBodyS2_ENS1_12BodyPairHashENS1_13BodyPairEqualESaIS3_EE4findERKS3_(ptr noundef nonnull align 8 dereferenceable(56) %89, ptr noundef nonnull align 8 dereferenceable(16) %16)
  %91 = getelementptr inbounds %"struct.std::__detail::_Node_iterator.55", ptr %17, i32 0, i32 0
  %92 = getelementptr inbounds %"struct.std::__detail::_Node_iterator_base.56", ptr %91, i32 0, i32 0
  store ptr %90, ptr %92, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #6
  %93 = getelementptr inbounds %class.QBroadPhase, ptr %32, i32 0, i32 1
  %94 = call ptr @_ZNSt13unordered_setISt4pairIP5QBodyS2_ENS1_12BodyPairHashENS1_13BodyPairEqualESaIS3_EE3endEv(ptr noundef nonnull align 8 dereferenceable(56) %93) #6
  %95 = getelementptr inbounds %"struct.std::__detail::_Node_iterator.55", ptr %18, i32 0, i32 0
  %96 = getelementptr inbounds %"struct.std::__detail::_Node_iterator_base.56", ptr %95, i32 0, i32 0
  store ptr %94, ptr %96, align 8
  %97 = call noundef zeroext i1 @_ZNSt8__detailneERKNS_19_Node_iterator_baseISt4pairIP5QBodyS3_ELb1EEES7_(ptr noundef nonnull align 8 dereferenceable(8) %17, ptr noundef nonnull align 8 dereferenceable(8) %18) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #6
  br i1 %97, label %98, label %99

98:                                               ; preds = %84
  store i32 9, ptr %6, align 4
  br label %146

99:                                               ; preds = %84
  %100 = load ptr, ptr %13, align 8, !tbaa !5
  %101 = load ptr, ptr %15, align 8, !tbaa !5
  %102 = call noundef zeroext i1 @_ZN11QBroadPhase16BodiesCanCollideEP5QBodyS1_(ptr noundef nonnull align 8 dereferenceable(72) %32, ptr noundef %100, ptr noundef %101)
  br i1 %102, label %104, label %103

103:                                              ; preds = %99
  store i32 9, ptr %6, align 4
  br label %146

104:                                              ; preds = %99
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #6
  call void @llvm.lifetime.start.p0(i64 28, ptr %20) #6
  %105 = load ptr, ptr %13, align 8, !tbaa !5
  call void @_ZNK5QBody7GetAABBEv(ptr dead_on_unwind writable sret(%class.QAABB) align 4 %20, ptr noundef nonnull align 8 dereferenceable(293) %105)
  %106 = call <2 x float> @_ZN5QAABB6GetMaxEv(ptr noundef nonnull align 4 dereferenceable(28) %20)
  store <2 x float> %106, ptr %19, align 4
  %107 = getelementptr inbounds %struct.QVector, ptr %19, i32 0, i32 0
  %108 = load float, ptr %107, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %21) #6
  call void @llvm.lifetime.start.p0(i64 28, ptr %22) #6
  %109 = load ptr, ptr %15, align 8, !tbaa !5
  call void @_ZNK5QBody7GetAABBEv(ptr dead_on_unwind writable sret(%class.QAABB) align 4 %22, ptr noundef nonnull align 8 dereferenceable(293) %109)
  %110 = call <2 x float> @_ZN5QAABB6GetMinEv(ptr noundef nonnull align 4 dereferenceable(28) %22)
  store <2 x float> %110, ptr %21, align 4
  %111 = getelementptr inbounds %struct.QVector, ptr %21, i32 0, i32 0
  %112 = load float, ptr %111, align 4, !tbaa !11
  %113 = fcmp oge float %108, %112
  call void @llvm.lifetime.end.p0(i64 28, ptr %22) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #6
  call void @llvm.lifetime.end.p0(i64 28, ptr %20) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #6
  br i1 %113, label %114, label %144

114:                                              ; preds = %104
  call void @llvm.lifetime.start.p0(i64 8, ptr %23) #6
  call void @llvm.lifetime.start.p0(i64 28, ptr %24) #6
  %115 = load ptr, ptr %13, align 8, !tbaa !5
  call void @_ZNK5QBody7GetAABBEv(ptr dead_on_unwind writable sret(%class.QAABB) align 4 %24, ptr noundef nonnull align 8 dereferenceable(293) %115)
  %116 = call <2 x float> @_ZN5QAABB6GetMinEv(ptr noundef nonnull align 4 dereferenceable(28) %24)
  store <2 x float> %116, ptr %23, align 4
  %117 = getelementptr inbounds %struct.QVector, ptr %23, i32 0, i32 1
  %118 = load float, ptr %117, align 4, !tbaa !14
  call void @llvm.lifetime.start.p0(i64 8, ptr %25) #6
  call void @llvm.lifetime.start.p0(i64 28, ptr %26) #6
  %119 = load ptr, ptr %15, align 8, !tbaa !5
  call void @_ZNK5QBody7GetAABBEv(ptr dead_on_unwind writable sret(%class.QAABB) align 4 %26, ptr noundef nonnull align 8 dereferenceable(293) %119)
  %120 = call <2 x float> @_ZN5QAABB6GetMaxEv(ptr noundef nonnull align 4 dereferenceable(28) %26)
  store <2 x float> %120, ptr %25, align 4
  %121 = getelementptr inbounds %struct.QVector, ptr %25, i32 0, i32 1
  %122 = load float, ptr %121, align 4, !tbaa !14
  %123 = fcmp ole float %118, %122
  call void @llvm.lifetime.start.p0(i64 8, ptr %27) #6
  call void @llvm.lifetime.start.p0(i64 28, ptr %28) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %29) #6
  call void @llvm.lifetime.start.p0(i64 28, ptr %30) #6
  br i1 %123, label %124, label %134

124:                                              ; preds = %114
  %125 = load ptr, ptr %13, align 8, !tbaa !5
  call void @_ZNK5QBody7GetAABBEv(ptr dead_on_unwind writable sret(%class.QAABB) align 4 %28, ptr noundef nonnull align 8 dereferenceable(293) %125)
  %126 = call <2 x float> @_ZN5QAABB6GetMaxEv(ptr noundef nonnull align 4 dereferenceable(28) %28)
  store <2 x float> %126, ptr %27, align 4
  %127 = getelementptr inbounds %struct.QVector, ptr %27, i32 0, i32 1
  %128 = load float, ptr %127, align 4, !tbaa !14
  %129 = load ptr, ptr %15, align 8, !tbaa !5
  call void @_ZNK5QBody7GetAABBEv(ptr dead_on_unwind writable sret(%class.QAABB) align 4 %30, ptr noundef nonnull align 8 dereferenceable(293) %129)
  %130 = call <2 x float> @_ZN5QAABB6GetMinEv(ptr noundef nonnull align 4 dereferenceable(28) %30)
  store <2 x float> %130, ptr %29, align 4
  %131 = getelementptr inbounds %struct.QVector, ptr %29, i32 0, i32 1
  %132 = load float, ptr %131, align 4, !tbaa !14
  %133 = fcmp oge float %128, %132
  br label %134

134:                                              ; preds = %124, %114
  %135 = phi i1 [ false, %114 ], [ %133, %124 ]
  call void @llvm.lifetime.end.p0(i64 28, ptr %30) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %29) #6
  call void @llvm.lifetime.end.p0(i64 28, ptr %28) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %27) #6
  call void @llvm.lifetime.end.p0(i64 28, ptr %26) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %25) #6
  call void @llvm.lifetime.end.p0(i64 28, ptr %24) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %23) #6
  br i1 %135, label %136, label %143

136:                                              ; preds = %134
  %137 = getelementptr inbounds %class.QBroadPhase, ptr %32, i32 0, i32 1
  %138 = call { ptr, i8 } @_ZNSt13unordered_setISt4pairIP5QBodyS2_ENS1_12BodyPairHashENS1_13BodyPairEqualESaIS3_EE6insertERKS3_(ptr noundef nonnull align 8 dereferenceable(56) %137, ptr noundef nonnull align 8 dereferenceable(16) %16)
  %139 = getelementptr inbounds { ptr, i8 }, ptr %31, i32 0, i32 0
  %140 = extractvalue { ptr, i8 } %138, 0
  store ptr %140, ptr %139, align 8
  %141 = getelementptr inbounds { ptr, i8 }, ptr %31, i32 0, i32 1
  %142 = extractvalue { ptr, i8 } %138, 1
  store i8 %142, ptr %141, align 8
  br label %143

143:                                              ; preds = %136, %134
  br label %145

144:                                              ; preds = %104
  store i32 7, ptr %6, align 4
  br label %146

145:                                              ; preds = %143
  store i32 0, ptr %6, align 4
  br label %146

146:                                              ; preds = %145, %144, %103, %98
  call void @llvm.lifetime.end.p0(i64 16, ptr %16) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #6
  %147 = load i32, ptr %6, align 4
  switch i32 %147, label %152 [
    i32 0, label %148
    i32 9, label %149
  ]

148:                                              ; preds = %146
  br label %149

149:                                              ; preds = %148, %146
  %150 = load i64, ptr %14, align 8, !tbaa !9
  %151 = add i64 %150, 1
  store i64 %151, ptr %14, align 8, !tbaa !9
  br label %79, !llvm.loop !15

152:                                              ; preds = %146, %83
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #6
  br label %153

153:                                              ; preds = %152
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #6
  br label %154

154:                                              ; preds = %153
  %155 = load i64, ptr %12, align 8, !tbaa !9
  %156 = add i64 %155, 1
  store i64 %156, ptr %12, align 8, !tbaa !9
  br label %66, !llvm.loop !17

157:                                              ; preds = %71
  store i32 0, ptr %6, align 4
  br label %158

158:                                              ; preds = %157, %54
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #6
  %159 = load i32, ptr %6, align 4
  switch i32 %159, label %161 [
    i32 0, label %160
  ]

160:                                              ; preds = %158
  store i32 0, ptr %6, align 4
  br label %161

161:                                              ; preds = %160, %158
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #6
  %162 = load i32, ptr %6, align 4
  switch i32 %162, label %168 [
    i32 0, label %163
    i32 3, label %164
  ]

163:                                              ; preds = %161
  br label %164

164:                                              ; preds = %163, %161
  %165 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt8__detail14_Node_iteratorISt4pairIKS1_IiiESt6vectorIP5QBodySaIS6_EEELb0ELb1EEppEv(ptr noundef nonnull align 8 dereferenceable(8) %4) #6
  br label %43

166:                                              ; preds = %45
  %167 = getelementptr inbounds %class.QBroadPhase, ptr %32, i32 0, i32 1
  ret ptr %167

168:                                              ; preds = %161
  unreachable
}

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

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

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

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZSt4sortIN9__gnu_cxx17__normal_iteratorIPP5QBodySt6vectorIS3_SaIS3_EEEEPFbPKS2_SA_EEvT_SD_T0_(ptr, ptr, ptr noundef) #4

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZN15QSpatialHashing20SortBodiesHorizontalEPK5QBodyS2_(ptr noundef, ptr noundef) #2 align 2

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local ptr @_ZNSt13unordered_setISt4pairIP5QBodyS2_ENS1_12BodyPairHashENS1_13BodyPairEqualESaIS3_EE4findERKS3_(ptr noundef nonnull align 8 dereferenceable(56), ptr noundef nonnull align 8 dereferenceable(16)) #5 align 2

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

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

; Function Attrs: mustprogress uwtable
declare dso_local { ptr, i8 } @_ZNSt13unordered_setISt4pairIP5QBodyS2_ENS1_12BodyPairHashENS1_13BodyPairEqualESaIS3_EE6insertERKS3_(ptr noundef nonnull align 8 dereferenceable(56), ptr noundef nonnull align 8 dereferenceable(16)) #5 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt8__detail14_Node_iteratorISt4pairIKS1_IiiESt6vectorIP5QBodySaIS6_EEELb0ELb1EEppEv(ptr noundef nonnull align 8 dereferenceable(8)) #0 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 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { 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 #3 = { 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 #4 = { inlinehint 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 = { 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 = !{!10, !10, i64 0}
!10 = !{!"long", !7, i64 0}
!11 = !{!12, !13, i64 0}
!12 = !{!"_ZTS7QVector", !13, i64 0, !13, i64 4}
!13 = !{!"float", !7, i64 0}
!14 = !{!12, !13, i64 4}
!15 = distinct !{!15, !16}
!16 = !{!"llvm.loop.mustprogress"}
!17 = distinct !{!17, !16}


; 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.QAABB = type { %struct.QVector, %struct.QVector, %struct.QVector, float }
%struct.QVector = type { float, float }
%"struct.std::__detail::_Node_iterator.49" = type { %"struct.std::__detail::_Node_iterator_base.50" }
%"struct.std::__detail::_Node_iterator_base.50" = type { ptr }
%"struct.std::pair.53" = type { ptr, ptr }
%"struct.std::__detail::_Node_iterator.55" = type { %"struct.std::__detail::_Node_iterator_base.56" }
%"struct.std::__detail::_Node_iterator_base.56" = type { ptr }

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

; 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 void @_ZNK5QBody7GetAABBEv(ptr dead_on_unwind noalias writable sret(%class.QAABB) align 4, ptr noundef nonnull align 8 dereferenceable(293)) local_unnamed_addr #0 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local <2 x float> @_ZN5QAABB6GetMinEv(ptr noundef nonnull align 4 dereferenceable(28)) local_unnamed_addr #2 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local <2 x float> @_ZN5QAABB6GetMaxEv(ptr noundef nonnull align 4 dereferenceable(28)) 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) #1

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

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

; Function Attrs: mustprogress uwtable
define dso_local noundef nonnull align 8 dereferenceable(56) ptr @_ZN15QSpatialHashing8GetPairsEv(ptr noundef nonnull align 8 dereferenceable(192) %0) unnamed_addr #3 align 2 {
  %2 = alloca %"struct.std::__detail::_Node_iterator.49", align 8
  %3 = alloca %"struct.std::__detail::_Node_iterator.49", align 8
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca %"struct.std::pair.53", align 8
  %7 = alloca %"struct.std::__detail::_Node_iterator.55", align 8
  %8 = alloca %"struct.std::__detail::_Node_iterator.55", align 8
  %9 = alloca %class.QAABB, align 4
  %10 = alloca %class.QAABB, align 4
  %11 = alloca %class.QAABB, align 4
  %12 = alloca %class.QAABB, align 4
  %13 = alloca %class.QAABB, align 4
  %14 = alloca %class.QAABB, align 4
  %15 = getelementptr inbounds i8, ptr %0, i64 8
  tail call void @_ZNSt13unordered_setISt4pairIP5QBodyS2_ENS1_12BodyPairHashENS1_13BodyPairEqualESaIS3_EE5clearEv(ptr noundef nonnull align 8 dereferenceable(56) %15) #6
  %16 = getelementptr inbounds i8, ptr %0, i64 80
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %2) #6
  %17 = tail call ptr @_ZNSt13unordered_mapISt4pairIiiESt6vectorIP5QBodySaIS4_EEN15QSpatialHashing8PairHashESt8equal_toIS1_ESaIS0_IKS1_S6_EEE5beginEv(ptr noundef nonnull align 8 dereferenceable(56) %16) #6
  store ptr %17, ptr %2, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #6
  %18 = tail call ptr @_ZNSt13unordered_mapISt4pairIiiESt6vectorIP5QBodySaIS4_EEN15QSpatialHashing8PairHashESt8equal_toIS1_ESaIS0_IKS1_S6_EEE3endEv(ptr noundef nonnull align 8 dereferenceable(56) %16) #6
  store ptr %18, ptr %3, align 8
  %19 = call noundef zeroext i1 @_ZNSt8__detailneERKNS_19_Node_iterator_baseISt4pairIKS1_IiiESt6vectorIP5QBodySaIS6_EEELb1EEESC_(ptr noundef nonnull align 8 dereferenceable(8) %2, ptr noundef nonnull align 8 dereferenceable(8) %3) #6
  br i1 %19, label %.lr.ph36, label %._crit_edge

._crit_edge:                                      ; preds = %.loopexit32, %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 ptr %15

.lr.ph36:                                         ; preds = %1, %.loopexit32
  %20 = call noundef nonnull align 8 dereferenceable(32) ptr @_ZNKSt8__detail14_Node_iteratorISt4pairIKS1_IiiESt6vectorIP5QBodySaIS6_EEELb0ELb1EEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %2) #6
  %21 = getelementptr inbounds i8, ptr %20, i64 8
  %22 = call noundef i64 @_ZNKSt6vectorIP5QBodySaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %21) #6
  %23 = icmp ult i64 %22, 2
  br i1 %23, label %.loopexit32, label %.lr.ph35.preheader

.lr.ph35.preheader:                               ; preds = %.lr.ph36
  %24 = call ptr @_ZNSt6vectorIP5QBodySaIS1_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %21) #6
  %25 = call ptr @_ZNSt6vectorIP5QBodySaIS1_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %21) #6
  call void @_ZSt4sortIN9__gnu_cxx17__normal_iteratorIPP5QBodySt6vectorIS3_SaIS3_EEEEPFbPKS2_SA_EEvT_SD_T0_(ptr %24, ptr %25, ptr noundef nonnull @_ZN15QSpatialHashing20SortBodiesHorizontalEPK5QBodyS2_)
  %26 = add i64 %22, -2
  br label %.lr.ph.preheader

.lr.ph.preheader:                                 ; preds = %.loopexit, %.lr.ph35.preheader
  %.02834 = phi i64 [ %29, %.loopexit ], [ 0, %.lr.ph35.preheader ]
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #6
  %27 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIP5QBodySaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %21, i64 noundef %.02834) #6
  %28 = load ptr, ptr %27, align 8, !tbaa !5
  store ptr %28, ptr %4, align 8, !tbaa !5
  %29 = add nuw i64 %.02834, 1
  br label %.lr.ph

.lr.ph:                                           ; preds = %.lr.ph.preheader, %62
  %.02933 = phi i64 [ %63, %62 ], [ %29, %.lr.ph.preheader ]
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #6
  %30 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIP5QBodySaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %21, i64 noundef %.02933) #6
  %31 = load ptr, ptr %30, align 8, !tbaa !5
  store ptr %31, ptr %5, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %6) #6
  call void @_ZNSt4pairIP5QBodyS1_EC2IRS1_S4_TnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS6_S7_EEEbE4typeELb1EEEOS6_OS7_(ptr noundef nonnull align 8 dereferenceable(16) %6, ptr noundef nonnull align 8 dereferenceable(8) %4, ptr noundef nonnull align 8 dereferenceable(8) %5)
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %7) #6
  %32 = call ptr @_ZNSt13unordered_setISt4pairIP5QBodyS2_ENS1_12BodyPairHashENS1_13BodyPairEqualESaIS3_EE4findERKS3_(ptr noundef nonnull align 8 dereferenceable(56) %15, ptr noundef nonnull align 8 dereferenceable(16) %6)
  store ptr %32, ptr %7, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %8) #6
  %33 = call ptr @_ZNSt13unordered_setISt4pairIP5QBodyS2_ENS1_12BodyPairHashENS1_13BodyPairEqualESaIS3_EE3endEv(ptr noundef nonnull align 8 dereferenceable(56) %15) #6
  store ptr %33, ptr %8, align 8
  %34 = call noundef zeroext i1 @_ZNSt8__detailneERKNS_19_Node_iterator_baseISt4pairIP5QBodyS3_ELb1EEES7_(ptr noundef nonnull align 8 dereferenceable(8) %7, ptr noundef nonnull align 8 dereferenceable(8) %8) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #6
  br i1 %34, label %62, label %35

35:                                               ; preds = %.lr.ph
  %36 = load ptr, ptr %4, align 8, !tbaa !5
  %37 = load ptr, ptr %5, align 8, !tbaa !5
  %38 = call noundef zeroext i1 @_ZN11QBroadPhase16BodiesCanCollideEP5QBodyS1_(ptr noundef nonnull align 8 dereferenceable(72) %0, ptr noundef %36, ptr noundef %37)
  br i1 %38, label %39, label %62

39:                                               ; preds = %35
  call void @llvm.lifetime.start.p0(i64 28, ptr nonnull %9) #6
  %40 = load ptr, ptr %4, align 8, !tbaa !5
  call void @_ZNK5QBody7GetAABBEv(ptr dead_on_unwind nonnull writable sret(%class.QAABB) align 4 %9, ptr noundef nonnull align 8 dereferenceable(293) %40)
  %41 = call <2 x float> @_ZN5QAABB6GetMaxEv(ptr noundef nonnull align 4 dereferenceable(28) %9)
  %.sroa.06.0.vec.extract = extractelement <2 x float> %41, i64 0
  call void @llvm.lifetime.start.p0(i64 28, ptr nonnull %10) #6
  %42 = load ptr, ptr %5, align 8, !tbaa !5
  call void @_ZNK5QBody7GetAABBEv(ptr dead_on_unwind nonnull writable sret(%class.QAABB) align 4 %10, ptr noundef nonnull align 8 dereferenceable(293) %42)
  %43 = call <2 x float> @_ZN5QAABB6GetMinEv(ptr noundef nonnull align 4 dereferenceable(28) %10)
  %.sroa.05.0.vec.extract = extractelement <2 x float> %43, i64 0
  %44 = fcmp ult float %.sroa.06.0.vec.extract, %.sroa.05.0.vec.extract
  call void @llvm.lifetime.end.p0(i64 28, ptr nonnull %10) #6
  call void @llvm.lifetime.end.p0(i64 28, ptr nonnull %9) #6
  br i1 %44, label %61, label %45

45:                                               ; preds = %39
  call void @llvm.lifetime.start.p0(i64 28, ptr nonnull %11) #6
  %46 = load ptr, ptr %4, align 8, !tbaa !5
  call void @_ZNK5QBody7GetAABBEv(ptr dead_on_unwind nonnull writable sret(%class.QAABB) align 4 %11, ptr noundef nonnull align 8 dereferenceable(293) %46)
  %47 = call <2 x float> @_ZN5QAABB6GetMinEv(ptr noundef nonnull align 4 dereferenceable(28) %11)
  call void @llvm.lifetime.start.p0(i64 28, ptr nonnull %12) #6
  %48 = load ptr, ptr %5, align 8, !tbaa !5
  call void @_ZNK5QBody7GetAABBEv(ptr dead_on_unwind nonnull writable sret(%class.QAABB) align 4 %12, ptr noundef nonnull align 8 dereferenceable(293) %48)
  %49 = call <2 x float> @_ZN5QAABB6GetMaxEv(ptr noundef nonnull align 4 dereferenceable(28) %12)
  %50 = fcmp ugt <2 x float> %47, %49
  %51 = extractelement <2 x i1> %50, i64 1
  call void @llvm.lifetime.start.p0(i64 28, ptr nonnull %13) #6
  call void @llvm.lifetime.start.p0(i64 28, ptr nonnull %14) #6
  br i1 %51, label %.critedge, label %52

52:                                               ; preds = %45
  %53 = load ptr, ptr %4, align 8, !tbaa !5
  call void @_ZNK5QBody7GetAABBEv(ptr dead_on_unwind nonnull writable sret(%class.QAABB) align 4 %13, ptr noundef nonnull align 8 dereferenceable(293) %53)
  %54 = call <2 x float> @_ZN5QAABB6GetMaxEv(ptr noundef nonnull align 4 dereferenceable(28) %13)
  %55 = load ptr, ptr %5, align 8, !tbaa !5
  call void @_ZNK5QBody7GetAABBEv(ptr dead_on_unwind nonnull writable sret(%class.QAABB) align 4 %14, ptr noundef nonnull align 8 dereferenceable(293) %55)
  %56 = call <2 x float> @_ZN5QAABB6GetMinEv(ptr noundef nonnull align 4 dereferenceable(28) %14)
  %57 = fcmp ult <2 x float> %54, %56
  %58 = extractelement <2 x i1> %57, i64 1
  call void @llvm.lifetime.end.p0(i64 28, ptr nonnull %14) #6
  call void @llvm.lifetime.end.p0(i64 28, ptr nonnull %13) #6
  call void @llvm.lifetime.end.p0(i64 28, ptr nonnull %12) #6
  call void @llvm.lifetime.end.p0(i64 28, ptr nonnull %11) #6
  br i1 %58, label %62, label %59

59:                                               ; preds = %52
  %60 = call { ptr, i8 } @_ZNSt13unordered_setISt4pairIP5QBodyS2_ENS1_12BodyPairHashENS1_13BodyPairEqualESaIS3_EE6insertERKS3_(ptr noundef nonnull align 8 dereferenceable(56) %15, ptr noundef nonnull align 8 dereferenceable(16) %6)
  br label %62

.critedge:                                        ; preds = %45
  call void @llvm.lifetime.end.p0(i64 28, ptr nonnull %14) #6
  call void @llvm.lifetime.end.p0(i64 28, ptr nonnull %13) #6
  call void @llvm.lifetime.end.p0(i64 28, ptr nonnull %12) #6
  call void @llvm.lifetime.end.p0(i64 28, ptr nonnull %11) #6
  br label %62

61:                                               ; preds = %39
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %6) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #6
  br label %.loopexit

62:                                               ; preds = %.lr.ph, %35, %52, %59, %.critedge
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %6) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #6
  %63 = add nuw i64 %.02933, 1
  %64 = icmp ult i64 %63, %22
  br i1 %64, label %.lr.ph, label %.loopexit, !llvm.loop !9

.loopexit:                                        ; preds = %62, %61
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #6
  %exitcond.not = icmp eq i64 %.02834, %26
  br i1 %exitcond.not, label %.loopexit32, label %.lr.ph.preheader, !llvm.loop !11

.loopexit32:                                      ; preds = %.loopexit, %.lr.ph36
  %65 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt8__detail14_Node_iteratorISt4pairIKS1_IiiESt6vectorIP5QBodySaIS6_EEELb0ELb1EEppEv(ptr noundef nonnull align 8 dereferenceable(8) %2) #6
  %66 = call noundef zeroext i1 @_ZNSt8__detailneERKNS_19_Node_iterator_baseISt4pairIKS1_IiiESt6vectorIP5QBodySaIS6_EEELb1EEESC_(ptr noundef nonnull align 8 dereferenceable(8) %2, ptr noundef nonnull align 8 dereferenceable(8) %3) #6
  br i1 %66, label %.lr.ph36, label %._crit_edge
}

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

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

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

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZSt4sortIN9__gnu_cxx17__normal_iteratorIPP5QBodySt6vectorIS3_SaIS3_EEEEPFbPKS2_SA_EEvT_SD_T0_(ptr, ptr, ptr noundef) local_unnamed_addr #4

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZN15QSpatialHashing20SortBodiesHorizontalEPK5QBodyS2_(ptr noundef, ptr noundef) #2 align 2

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local ptr @_ZNSt13unordered_setISt4pairIP5QBodyS2_ENS1_12BodyPairHashENS1_13BodyPairEqualESaIS3_EE4findERKS3_(ptr noundef nonnull align 8 dereferenceable(56), ptr noundef nonnull align 8 dereferenceable(16)) local_unnamed_addr #5 align 2

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

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

; Function Attrs: mustprogress uwtable
declare dso_local { ptr, i8 } @_ZNSt13unordered_setISt4pairIP5QBodyS2_ENS1_12BodyPairHashENS1_13BodyPairEqualESaIS3_EE6insertERKS3_(ptr noundef nonnull align 8 dereferenceable(56), ptr noundef nonnull align 8 dereferenceable(16)) local_unnamed_addr #5 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt8__detail14_Node_iteratorISt4pairIKS1_IiiESt6vectorIP5QBodySaIS6_EEELb0ELb1EEppEv(ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #0 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 nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { 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 #3 = { 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 #4 = { inlinehint 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 = { 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 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}


; Effective O3 passes: EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LICMPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,SCCPPass,SROAPass,SimplifyCFGPass,TailCallElimPass,VectorCombinePass