; LLVM IR from atlantis13579/Riemann :: Test/Test_Collision.ll (Z15TestDynamicAABBv)

; 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.Maths::TVector3" = type { float, float, float }
%"class.Riemann::DynamicAABBTree" = type <{ i32, [4 x i8], %"class.std::vector.0", i32, i32, i32, [4 x i8] }>
%"class.std::vector.0" = type { %"struct.std::_Vector_base.1" }
%"struct.std::_Vector_base.1" = type { %"struct.std::_Vector_base<Riemann::DynamicAABBTree::Node, std::allocator<Riemann::DynamicAABBTree::Node>>::_Vector_impl" }
%"struct.std::_Vector_base<Riemann::DynamicAABBTree::Node, std::allocator<Riemann::DynamicAABBTree::Node>>::_Vector_impl" = type { %"struct.std::_Vector_base<Riemann::DynamicAABBTree::Node, std::allocator<Riemann::DynamicAABBTree::Node>>::_Vector_impl_data" }
%"struct.std::_Vector_base<Riemann::DynamicAABBTree::Node, std::allocator<Riemann::DynamicAABBTree::Node>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::vector.5" = type { %"struct.std::_Vector_base.6" }
%"struct.std::_Vector_base.6" = type { %"struct.std::_Vector_base<Actor, std::allocator<Actor>>::_Vector_impl" }
%"struct.std::_Vector_base<Actor, std::allocator<Actor>>::_Vector_impl" = type { %"struct.std::_Vector_base<Actor, std::allocator<Actor>>::_Vector_impl_data" }
%"struct.std::_Vector_base<Actor, std::allocator<Actor>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.Maths::Quaternion" = type { float, float, float, float }
%struct.Actor = type <{ ptr, i32, [4 x i8] }>

@.str.1 = external hidden unnamed_addr constant [27 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [79 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [25 x i8], align 1

declare i32 @printf(ptr noundef, ...) #0

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_Z10BreakPointPKcl(ptr noundef, i64 noundef) #2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN5Maths8TVector3IfE5UnitYEv(ptr dead_on_unwind noalias writable sret(%"class.Maths::TVector3") align 4) #3 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN5Maths8TVector3IfE3OneEv(ptr dead_on_unwind noalias writable sret(%"class.Maths::TVector3") align 4) #3 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN5Maths8TVector3IfE6RandomEv(ptr dead_on_unwind noalias writable sret(%"class.Maths::TVector3") align 4) #3 align 2

declare i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress uwtable
define dso_local void @_Z15TestDynamicAABBv() #3 personality ptr @__gxx_personality_v0 {
  %1 = alloca %"class.Riemann::DynamicAABBTree", align 8
  %2 = alloca %"class.std::vector.5", align 8
  %3 = alloca i32, align 4
  %4 = alloca ptr, align 8
  %5 = alloca %"class.Maths::TVector3", align 4
  %6 = alloca %"class.Maths::TVector3", align 4
  %7 = alloca ptr, align 8
  %8 = alloca i32, align 4
  %9 = alloca %"class.Maths::TVector3", align 4
  %10 = alloca %"class.Maths::Quaternion", align 4
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca i64, align 8
  %15 = alloca i32, align 4
  %16 = alloca %"class.Maths::TVector3", align 4
  %17 = alloca %"class.Maths::TVector3", align 4
  %18 = alloca %"class.Maths::TVector3", align 4
  %19 = call i32 (ptr, ...) @printf(ptr noundef @.str.5)
  call void @llvm.lifetime.start.p0(i64 48, ptr %1) #7
  call void @_ZN7Riemann15DynamicAABBTreeC1Ev(ptr noundef nonnull align 8 dereferenceable(44) %1)
  call void @llvm.lifetime.start.p0(i64 24, ptr %2) #7
  call void @_ZNSt6vectorIZ15TestDynamicAABBvE5ActorSaIS0_EEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %2) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #7
  store i32 0, ptr %3, align 4, !tbaa !5
  br label %20

20:                                               ; preds = %64, %0
  %21 = load i32, ptr %3, align 4, !tbaa !5
  %22 = icmp slt i32 %21, 128
  br i1 %22, label %24, label %23

23:                                               ; preds = %20
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #7
  br label %68

24:                                               ; preds = %20
  call void @llvm.lifetime.start.p0(i64 8, ptr %4) #7
  call void @llvm.lifetime.start.p0(i64 12, ptr %5) #7
  call void @llvm.lifetime.start.p0(i64 12, ptr %6) #7
  invoke void @_ZN5Maths8TVector3IfE6RandomEv(ptr dead_on_unwind writable sret(%"class.Maths::TVector3") align 4 %6)
          to label %25 unwind label %43

25:                                               ; preds = %24
  invoke void @_ZNK5Maths8TVector3IfEmlEf(ptr dead_on_unwind writable sret(%"class.Maths::TVector3") align 4 %5, ptr noundef nonnull align 4 dereferenceable(12) %6, float noundef 1.000000e+01)
          to label %26 unwind label %43

26:                                               ; preds = %25
  call void @llvm.lifetime.start.p0(i64 12, ptr %9) #7
  invoke void @_ZN5Maths8TVector3IfE3OneEv(ptr dead_on_unwind writable sret(%"class.Maths::TVector3") align 4 %9)
          to label %27 unwind label %47

27:                                               ; preds = %26
  call void @llvm.lifetime.start.p0(i64 16, ptr %10) #7
  invoke void @_ZN5Maths10Quaternion3OneEv(ptr dead_on_unwind writable sret(%"class.Maths::Quaternion") align 4 %10)
          to label %28 unwind label %51

28:                                               ; preds = %27
  %29 = invoke noundef ptr @_ZN7Riemann15GeometryFactory9CreateOBBERKN5Maths8TVector3IfEES5_RKNS1_10QuaternionE(ptr noundef nonnull align 4 dereferenceable(12) %5, ptr noundef nonnull align 4 dereferenceable(12) %9, ptr noundef nonnull align 4 dereferenceable(16) %10)
          to label %30 unwind label %51

30:                                               ; preds = %28
  call void @llvm.lifetime.end.p0(i64 16, ptr %10) #7
  call void @llvm.lifetime.end.p0(i64 12, ptr %9) #7
  call void @llvm.lifetime.end.p0(i64 12, ptr %6) #7
  call void @llvm.lifetime.end.p0(i64 12, ptr %5) #7
  store ptr %29, ptr %4, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #7
  %31 = load ptr, ptr %4, align 8, !tbaa !9
  %32 = invoke noundef nonnull align 4 dereferenceable(24) ptr @_ZNK7Riemann8Geometry28GetBoundingVolume_WorldSpaceEv(ptr noundef nonnull align 8 dereferenceable(204) %31)
          to label %33 unwind label %57

33:                                               ; preds = %30
  %34 = load ptr, ptr %4, align 8, !tbaa !9
  %35 = invoke noundef i32 @_ZN7Riemann15DynamicAABBTree3AddERKN5Maths6TAABB3IfEEPv(ptr noundef nonnull align 8 dereferenceable(44) %1, ptr noundef nonnull align 4 dereferenceable(24) %32, ptr noundef %34)
          to label %36 unwind label %57

36:                                               ; preds = %33
  store i32 %35, ptr %11, align 4, !tbaa !5
  %37 = invoke noundef zeroext i1 @_ZNK7Riemann15DynamicAABBTree8ValidateEv(ptr noundef nonnull align 8 dereferenceable(44) %1)
          to label %38 unwind label %57

38:                                               ; preds = %36
  br i1 %37, label %61, label %39

39:                                               ; preds = %38
  %40 = invoke i32 (ptr, ...) @printf(ptr noundef @.str.1, ptr noundef @.str.2, i32 noundef 157)
          to label %41 unwind label %57

41:                                               ; preds = %39
  invoke void @_Z10BreakPointPKcl(ptr noundef @.str.2, i64 noundef 157)
          to label %42 unwind label %57

42:                                               ; preds = %41
  br label %61

43:                                               ; preds = %25, %24
  %44 = landingpad { ptr, i32 }
          cleanup
  %45 = extractvalue { ptr, i32 } %44, 0
  store ptr %45, ptr %7, align 8
  %46 = extractvalue { ptr, i32 } %44, 1
  store i32 %46, ptr %8, align 4
  br label %56

47:                                               ; preds = %26
  %48 = landingpad { ptr, i32 }
          cleanup
  %49 = extractvalue { ptr, i32 } %48, 0
  store ptr %49, ptr %7, align 8
  %50 = extractvalue { ptr, i32 } %48, 1
  store i32 %50, ptr %8, align 4
  br label %55

51:                                               ; preds = %28, %27
  %52 = landingpad { ptr, i32 }
          cleanup
  %53 = extractvalue { ptr, i32 } %52, 0
  store ptr %53, ptr %7, align 8
  %54 = extractvalue { ptr, i32 } %52, 1
  store i32 %54, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 16, ptr %10) #7
  br label %55

55:                                               ; preds = %51, %47
  call void @llvm.lifetime.end.p0(i64 12, ptr %9) #7
  br label %56

56:                                               ; preds = %55, %43
  call void @llvm.lifetime.end.p0(i64 12, ptr %6) #7
  call void @llvm.lifetime.end.p0(i64 12, ptr %5) #7
  br label %67

57:                                               ; preds = %61, %41, %39, %36, %33, %30
  %58 = landingpad { ptr, i32 }
          cleanup
  %59 = extractvalue { ptr, i32 } %58, 0
  store ptr %59, ptr %7, align 8
  %60 = extractvalue { ptr, i32 } %58, 1
  store i32 %60, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #7
  br label %67

61:                                               ; preds = %42, %38
  %62 = invoke noundef nonnull align 8 dereferenceable(12) ptr @_ZNSt6vectorIZ15TestDynamicAABBvE5ActorSaIS0_EE12emplace_backIJRPN7Riemann8GeometryERiEEERS0_DpOT_(ptr noundef nonnull align 8 dereferenceable(24) %2, ptr noundef nonnull align 8 dereferenceable(8) %4, ptr noundef nonnull align 4 dereferenceable(4) %11)
          to label %63 unwind label %57

63:                                               ; preds = %61
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #7
  br label %64

64:                                               ; preds = %63
  %65 = load i32, ptr %3, align 4, !tbaa !5
  %66 = add nsw i32 %65, 1
  store i32 %66, ptr %3, align 4, !tbaa !5
  br label %20, !llvm.loop !11

67:                                               ; preds = %57, %56
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #7
  br label %180

68:                                               ; preds = %23
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #7
  store i32 0, ptr %12, align 4, !tbaa !5
  br label %69

69:                                               ; preds = %171, %68
  %70 = load i32, ptr %12, align 4, !tbaa !5
  %71 = icmp slt i32 %70, 1000
  br i1 %71, label %73, label %72

72:                                               ; preds = %69
  store i32 5, ptr %13, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #7
  br label %174

73:                                               ; preds = %69
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #7
  store i64 0, ptr %14, align 8, !tbaa !13
  br label %74

74:                                               ; preds = %166, %73
  %75 = load i64, ptr %14, align 8, !tbaa !13
  %76 = call noundef i64 @_ZNKSt6vectorIZ15TestDynamicAABBvE5ActorSaIS0_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %2) #7
  %77 = icmp ult i64 %75, %76
  br i1 %77, label %79, label %78

78:                                               ; preds = %74
  store i32 8, ptr %13, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #7
  br label %170

79:                                               ; preds = %74
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #7
  %80 = invoke noundef i32 @_ZN5Maths9RandomIntEii(i32 noundef 0, i32 noundef 5)
          to label %81 unwind label %106

81:                                               ; preds = %79
  store i32 %80, ptr %15, align 4, !tbaa !5
  %82 = load i64, ptr %14, align 8, !tbaa !13
  %83 = call noundef nonnull align 8 dereferenceable(12) ptr @_ZNSt6vectorIZ15TestDynamicAABBvE5ActorSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %2, i64 noundef %82) #7
  %84 = getelementptr inbounds %struct.Actor, ptr %83, i32 0, i32 1
  %85 = load i32, ptr %84, align 8, !tbaa !15
  %86 = icmp eq i32 %85, -1
  br i1 %86, label %87, label %111

87:                                               ; preds = %81
  %88 = load i32, ptr %15, align 4, !tbaa !5
  %89 = icmp eq i32 %88, 0
  br i1 %89, label %90, label %110

90:                                               ; preds = %87
  %91 = load i64, ptr %14, align 8, !tbaa !13
  %92 = call noundef nonnull align 8 dereferenceable(12) ptr @_ZNSt6vectorIZ15TestDynamicAABBvE5ActorSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %2, i64 noundef %91) #7
  %93 = getelementptr inbounds %struct.Actor, ptr %92, i32 0, i32 0
  %94 = load ptr, ptr %93, align 8, !tbaa !17
  %95 = invoke noundef nonnull align 4 dereferenceable(24) ptr @_ZNK7Riemann8Geometry28GetBoundingVolume_WorldSpaceEv(ptr noundef nonnull align 8 dereferenceable(204) %94)
          to label %96 unwind label %106

96:                                               ; preds = %90
  %97 = load i64, ptr %14, align 8, !tbaa !13
  %98 = call noundef nonnull align 8 dereferenceable(12) ptr @_ZNSt6vectorIZ15TestDynamicAABBvE5ActorSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %2, i64 noundef %97) #7
  %99 = getelementptr inbounds %struct.Actor, ptr %98, i32 0, i32 0
  %100 = load ptr, ptr %99, align 8, !tbaa !17
  %101 = invoke noundef i32 @_ZN7Riemann15DynamicAABBTree3AddERKN5Maths6TAABB3IfEEPv(ptr noundef nonnull align 8 dereferenceable(44) %1, ptr noundef nonnull align 4 dereferenceable(24) %95, ptr noundef %100)
          to label %102 unwind label %106

102:                                              ; preds = %96
  %103 = load i64, ptr %14, align 8, !tbaa !13
  %104 = call noundef nonnull align 8 dereferenceable(12) ptr @_ZNSt6vectorIZ15TestDynamicAABBvE5ActorSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %2, i64 noundef %103) #7
  %105 = getelementptr inbounds %struct.Actor, ptr %104, i32 0, i32 1
  store i32 %101, ptr %105, align 8, !tbaa !15
  br label %110

106:                                              ; preds = %163, %161, %158, %135, %130, %114, %96, %90, %79
  %107 = landingpad { ptr, i32 }
          cleanup
  %108 = extractvalue { ptr, i32 } %107, 0
  store ptr %108, ptr %7, align 8
  %109 = extractvalue { ptr, i32 } %107, 1
  store i32 %109, ptr %8, align 4
  br label %169

110:                                              ; preds = %102, %87
  br label %158

111:                                              ; preds = %81
  %112 = load i32, ptr %15, align 4, !tbaa !5
  %113 = icmp eq i32 %112, 0
  br i1 %113, label %114, label %123

114:                                              ; preds = %111
  %115 = load i64, ptr %14, align 8, !tbaa !13
  %116 = call noundef nonnull align 8 dereferenceable(12) ptr @_ZNSt6vectorIZ15TestDynamicAABBvE5ActorSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %2, i64 noundef %115) #7
  %117 = getelementptr inbounds %struct.Actor, ptr %116, i32 0, i32 1
  %118 = load i32, ptr %117, align 8, !tbaa !15
  invoke void @_ZN7Riemann15DynamicAABBTree6RemoveEi(ptr noundef nonnull align 8 dereferenceable(44) %1, i32 noundef %118)
          to label %119 unwind label %106

119:                                              ; preds = %114
  %120 = load i64, ptr %14, align 8, !tbaa !13
  %121 = call noundef nonnull align 8 dereferenceable(12) ptr @_ZNSt6vectorIZ15TestDynamicAABBvE5ActorSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %2, i64 noundef %120) #7
  %122 = getelementptr inbounds %struct.Actor, ptr %121, i32 0, i32 1
  store i32 -1, ptr %122, align 8, !tbaa !15
  br label %157

123:                                              ; preds = %111
  %124 = load i64, ptr %14, align 8, !tbaa !13
  %125 = call noundef nonnull align 8 dereferenceable(12) ptr @_ZNSt6vectorIZ15TestDynamicAABBvE5ActorSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %2, i64 noundef %124) #7
  %126 = getelementptr inbounds %struct.Actor, ptr %125, i32 0, i32 0
  %127 = load ptr, ptr %126, align 8, !tbaa !17
  call void @llvm.lifetime.start.p0(i64 12, ptr %16) #7
  call void @llvm.lifetime.start.p0(i64 12, ptr %17) #7
  invoke void @_ZN5Maths8TVector3IfE6RandomEv(ptr dead_on_unwind writable sret(%"class.Maths::TVector3") align 4 %17)
          to label %128 unwind label %149

128:                                              ; preds = %123
  invoke void @_ZNK5Maths8TVector3IfEmlEf(ptr dead_on_unwind writable sret(%"class.Maths::TVector3") align 4 %16, ptr noundef nonnull align 4 dereferenceable(12) %17, float noundef 1.000000e+01)
          to label %129 unwind label %149

129:                                              ; preds = %128
  invoke void @_ZN7Riemann8Geometry16SetWorldPositionERKN5Maths8TVector3IfEE(ptr noundef nonnull align 8 dereferenceable(204) %127, ptr noundef nonnull align 4 dereferenceable(12) %16)
          to label %130 unwind label %149

130:                                              ; preds = %129
  call void @llvm.lifetime.end.p0(i64 12, ptr %17) #7
  call void @llvm.lifetime.end.p0(i64 12, ptr %16) #7
  %131 = load i64, ptr %14, align 8, !tbaa !13
  %132 = call noundef nonnull align 8 dereferenceable(12) ptr @_ZNSt6vectorIZ15TestDynamicAABBvE5ActorSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %2, i64 noundef %131) #7
  %133 = getelementptr inbounds %struct.Actor, ptr %132, i32 0, i32 0
  %134 = load ptr, ptr %133, align 8, !tbaa !17
  invoke void @_ZN7Riemann8Geometry20UpdateBoundingVolumeEv(ptr noundef nonnull align 8 dereferenceable(204) %134)
          to label %135 unwind label %106

135:                                              ; preds = %130
  %136 = load i64, ptr %14, align 8, !tbaa !13
  %137 = call noundef nonnull align 8 dereferenceable(12) ptr @_ZNSt6vectorIZ15TestDynamicAABBvE5ActorSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %2, i64 noundef %136) #7
  %138 = getelementptr inbounds %struct.Actor, ptr %137, i32 0, i32 1
  %139 = load i32, ptr %138, align 8, !tbaa !15
  %140 = load i64, ptr %14, align 8, !tbaa !13
  %141 = call noundef nonnull align 8 dereferenceable(12) ptr @_ZNSt6vectorIZ15TestDynamicAABBvE5ActorSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %2, i64 noundef %140) #7
  %142 = getelementptr inbounds %struct.Actor, ptr %141, i32 0, i32 0
  %143 = load ptr, ptr %142, align 8, !tbaa !17
  %144 = invoke noundef nonnull align 4 dereferenceable(24) ptr @_ZNK7Riemann8Geometry28GetBoundingVolume_WorldSpaceEv(ptr noundef nonnull align 8 dereferenceable(204) %143)
          to label %145 unwind label %106

145:                                              ; preds = %135
  call void @llvm.lifetime.start.p0(i64 12, ptr %18) #7
  invoke void @_ZN5Maths8TVector3IfE5UnitYEv(ptr dead_on_unwind writable sret(%"class.Maths::TVector3") align 4 %18)
          to label %146 unwind label %153

146:                                              ; preds = %145
  %147 = invoke noundef zeroext i1 @_ZN7Riemann15DynamicAABBTree6UpdateEiRKN5Maths6TAABB3IfEERKNS1_8TVector3IfEE(ptr noundef nonnull align 8 dereferenceable(44) %1, i32 noundef %139, ptr noundef nonnull align 4 dereferenceable(24) %144, ptr noundef nonnull align 4 dereferenceable(12) %18)
          to label %148 unwind label %153

148:                                              ; preds = %146
  call void @llvm.lifetime.end.p0(i64 12, ptr %18) #7
  br label %157

149:                                              ; preds = %129, %128, %123
  %150 = landingpad { ptr, i32 }
          cleanup
  %151 = extractvalue { ptr, i32 } %150, 0
  store ptr %151, ptr %7, align 8
  %152 = extractvalue { ptr, i32 } %150, 1
  store i32 %152, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 12, ptr %17) #7
  call void @llvm.lifetime.end.p0(i64 12, ptr %16) #7
  br label %169

153:                                              ; preds = %146, %145
  %154 = landingpad { ptr, i32 }
          cleanup
  %155 = extractvalue { ptr, i32 } %154, 0
  store ptr %155, ptr %7, align 8
  %156 = extractvalue { ptr, i32 } %154, 1
  store i32 %156, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 12, ptr %18) #7
  br label %169

157:                                              ; preds = %148, %119
  br label %158

158:                                              ; preds = %157, %110
  %159 = invoke noundef zeroext i1 @_ZNK7Riemann15DynamicAABBTree8ValidateEv(ptr noundef nonnull align 8 dereferenceable(44) %1)
          to label %160 unwind label %106

160:                                              ; preds = %158
  br i1 %159, label %165, label %161

161:                                              ; preds = %160
  %162 = invoke i32 (ptr, ...) @printf(ptr noundef @.str.1, ptr noundef @.str.2, i32 noundef 189)
          to label %163 unwind label %106

163:                                              ; preds = %161
  invoke void @_Z10BreakPointPKcl(ptr noundef @.str.2, i64 noundef 189)
          to label %164 unwind label %106

164:                                              ; preds = %163
  br label %165

165:                                              ; preds = %164, %160
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #7
  br label %166

166:                                              ; preds = %165
  %167 = load i64, ptr %14, align 8, !tbaa !13
  %168 = add i64 %167, 1
  store i64 %168, ptr %14, align 8, !tbaa !13
  br label %74, !llvm.loop !18

169:                                              ; preds = %153, %149, %106
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #7
  br label %180

170:                                              ; preds = %78
  br label %171

171:                                              ; preds = %170
  %172 = load i32, ptr %12, align 4, !tbaa !5
  %173 = add nsw i32 %172, 1
  store i32 %173, ptr %12, align 4, !tbaa !5
  br label %69, !llvm.loop !19

174:                                              ; preds = %72
  invoke void @_ZN7Riemann15DynamicAABBTree7RebuildEv(ptr noundef nonnull align 8 dereferenceable(44) %1)
          to label %175 unwind label %176

175:                                              ; preds = %174
  store i32 1, ptr %13, align 4
  call void @_ZNSt6vectorIZ15TestDynamicAABBvE5ActorSaIS0_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %2) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr %2) #7
  call void @_ZN7Riemann15DynamicAABBTreeD1Ev(ptr noundef nonnull align 8 dereferenceable(44) %1) #7
  call void @llvm.lifetime.end.p0(i64 48, ptr %1) #7
  ret void

176:                                              ; preds = %174
  %177 = landingpad { ptr, i32 }
          cleanup
  %178 = extractvalue { ptr, i32 } %177, 0
  store ptr %178, ptr %7, align 8
  %179 = extractvalue { ptr, i32 } %177, 1
  store i32 %179, ptr %8, align 4
  br label %180

180:                                              ; preds = %176, %169, %67
  call void @_ZNSt6vectorIZ15TestDynamicAABBvE5ActorSaIS0_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %2) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr %2) #7
  call void @_ZN7Riemann15DynamicAABBTreeD1Ev(ptr noundef nonnull align 8 dereferenceable(44) %1) #7
  call void @llvm.lifetime.end.p0(i64 48, ptr %1) #7
  br label %181

181:                                              ; preds = %180
  %182 = load ptr, ptr %7, align 8
  %183 = load i32, ptr %8, align 4
  %184 = insertvalue { ptr, i32 } poison, ptr %182, 0
  %185 = insertvalue { ptr, i32 } %184, i32 %183, 1
  resume { ptr, i32 } %185
}

declare void @_ZN7Riemann15DynamicAABBTreeC1Ev(ptr noundef nonnull align 8 dereferenceable(44)) unnamed_addr #0

; Function Attrs: mustprogress nounwind uwtable
declare hidden void @_ZNSt6vectorIZ15TestDynamicAABBvE5ActorSaIS0_EEC2Ev(ptr noundef nonnull align 8 dereferenceable(24)) unnamed_addr #4 align 2

declare noundef ptr @_ZN7Riemann15GeometryFactory9CreateOBBERKN5Maths8TVector3IfEES5_RKNS1_10QuaternionE(ptr noundef nonnull align 4 dereferenceable(12), ptr noundef nonnull align 4 dereferenceable(12), ptr noundef nonnull align 4 dereferenceable(16)) #0

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZNK5Maths8TVector3IfEmlEf(ptr dead_on_unwind noalias writable sret(%"class.Maths::TVector3") align 4, ptr noundef nonnull align 4 dereferenceable(12), float noundef) #5 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN5Maths10Quaternion3OneEv(ptr dead_on_unwind noalias writable sret(%"class.Maths::Quaternion") align 4) #3 align 2

declare noundef i32 @_ZN7Riemann15DynamicAABBTree3AddERKN5Maths6TAABB3IfEEPv(ptr noundef nonnull align 8 dereferenceable(44), ptr noundef nonnull align 4 dereferenceable(24), ptr noundef) #0

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

declare noundef zeroext i1 @_ZNK7Riemann15DynamicAABBTree8ValidateEv(ptr noundef nonnull align 8 dereferenceable(44)) #0

; Function Attrs: mustprogress uwtable
declare hidden noundef nonnull align 8 dereferenceable(12) ptr @_ZNSt6vectorIZ15TestDynamicAABBvE5ActorSaIS0_EE12emplace_backIJRPN7Riemann8GeometryERiEEERS0_DpOT_(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 4 dereferenceable(4)) #3 align 2

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef i32 @_ZN5Maths9RandomIntEii(i32 noundef, i32 noundef) #5

; Function Attrs: mustprogress nounwind uwtable
declare hidden noundef nonnull align 8 dereferenceable(12) ptr @_ZNSt6vectorIZ15TestDynamicAABBvE5ActorSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) #4 align 2

declare void @_ZN7Riemann15DynamicAABBTree6RemoveEi(ptr noundef nonnull align 8 dereferenceable(44), i32 noundef) #0

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN7Riemann8Geometry16SetWorldPositionERKN5Maths8TVector3IfEE(ptr noundef nonnull align 8 dereferenceable(204), ptr noundef nonnull align 4 dereferenceable(12)) #5 align 2

declare void @_ZN7Riemann8Geometry20UpdateBoundingVolumeEv(ptr noundef nonnull align 8 dereferenceable(204)) #0

declare noundef zeroext i1 @_ZN7Riemann15DynamicAABBTree6UpdateEiRKN5Maths6TAABB3IfEERKNS1_8TVector3IfEE(ptr noundef nonnull align 8 dereferenceable(44), i32 noundef, ptr noundef nonnull align 4 dereferenceable(24), ptr noundef nonnull align 4 dereferenceable(12)) #0

declare void @_ZN7Riemann15DynamicAABBTree7RebuildEv(ptr noundef nonnull align 8 dereferenceable(44)) #0

; Function Attrs: mustprogress nounwind uwtable
declare hidden void @_ZNSt6vectorIZ15TestDynamicAABBvE5ActorSaIS0_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24)) unnamed_addr #4 align 2

; Function Attrs: nounwind
declare void @_ZN7Riemann15DynamicAABBTreeD1Ev(ptr noundef nonnull align 8 dereferenceable(44)) unnamed_addr #6

attributes #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 = { 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 #3 = { 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 #4 = { 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 = { 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 #6 = { nounwind "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 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"any pointer", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = !{!14, !14, i64 0}
!14 = !{!"long", !7, i64 0}
!15 = !{!16, !6, i64 8}
!16 = !{!"_ZTSZ15TestDynamicAABBvE5Actor", !10, i64 0, !6, i64 8}
!17 = !{!16, !10, i64 0}
!18 = distinct !{!18, !12}
!19 = distinct !{!19, !12}


; 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.Maths::TVector3" = type { float, float, float }
%"class.Riemann::DynamicAABBTree" = type <{ i32, [4 x i8], %"class.std::vector.0", i32, i32, i32, [4 x i8] }>
%"class.std::vector.0" = type { %"struct.std::_Vector_base.1" }
%"struct.std::_Vector_base.1" = type { %"struct.std::_Vector_base<Riemann::DynamicAABBTree::Node, std::allocator<Riemann::DynamicAABBTree::Node>>::_Vector_impl" }
%"struct.std::_Vector_base<Riemann::DynamicAABBTree::Node, std::allocator<Riemann::DynamicAABBTree::Node>>::_Vector_impl" = type { %"struct.std::_Vector_base<Riemann::DynamicAABBTree::Node, std::allocator<Riemann::DynamicAABBTree::Node>>::_Vector_impl_data" }
%"struct.std::_Vector_base<Riemann::DynamicAABBTree::Node, std::allocator<Riemann::DynamicAABBTree::Node>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::vector.5" = type { %"struct.std::_Vector_base.6" }
%"struct.std::_Vector_base.6" = type { %"struct.std::_Vector_base<Actor, std::allocator<Actor>>::_Vector_impl" }
%"struct.std::_Vector_base<Actor, std::allocator<Actor>>::_Vector_impl" = type { %"struct.std::_Vector_base<Actor, std::allocator<Actor>>::_Vector_impl_data" }
%"struct.std::_Vector_base<Actor, std::allocator<Actor>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.Maths::Quaternion" = type { float, float, float, float }

@.str.1 = external hidden unnamed_addr constant [27 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [79 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [25 x i8], align 1

; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #0

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_Z10BreakPointPKcl(ptr noundef, i64 noundef) local_unnamed_addr #2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN5Maths8TVector3IfE5UnitYEv(ptr dead_on_unwind noalias writable sret(%"class.Maths::TVector3") align 4) local_unnamed_addr #3 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN5Maths8TVector3IfE3OneEv(ptr dead_on_unwind noalias writable sret(%"class.Maths::TVector3") align 4) local_unnamed_addr #3 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN5Maths8TVector3IfE6RandomEv(ptr dead_on_unwind noalias writable sret(%"class.Maths::TVector3") align 4) local_unnamed_addr #3 align 2

declare i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress uwtable
define dso_local void @_Z15TestDynamicAABBv() local_unnamed_addr #3 personality ptr @__gxx_personality_v0 {
  %1 = alloca %"class.Riemann::DynamicAABBTree", align 8
  %2 = alloca %"class.std::vector.5", align 8
  %3 = alloca ptr, align 8
  %4 = alloca %"class.Maths::TVector3", align 4
  %5 = alloca %"class.Maths::TVector3", align 4
  %6 = alloca %"class.Maths::TVector3", align 4
  %7 = alloca %"class.Maths::Quaternion", align 4
  %8 = alloca i32, align 4
  %9 = alloca %"class.Maths::TVector3", align 4
  %10 = alloca %"class.Maths::TVector3", align 4
  %11 = alloca %"class.Maths::TVector3", align 4
  %12 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.5)
  call void @llvm.lifetime.start.p0(i64 48, ptr nonnull %1) #8
  call void @_ZN7Riemann15DynamicAABBTreeC1Ev(ptr noundef nonnull align 8 dereferenceable(44) %1)
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %2) #8
  call void @_ZNSt6vectorIZ15TestDynamicAABBvE5ActorSaIS0_EEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %2) #8
  br label %13

13:                                               ; preds = %0, %40
  %.035 = phi i32 [ 0, %0 ], [ %41, %40 ]
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #8
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %4) #8
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %5) #8
  invoke void @_ZN5Maths8TVector3IfE6RandomEv(ptr dead_on_unwind nonnull writable sret(%"class.Maths::TVector3") align 4 %5)
          to label %14 unwind label %28

14:                                               ; preds = %13
  invoke void @_ZNK5Maths8TVector3IfEmlEf(ptr dead_on_unwind nonnull writable sret(%"class.Maths::TVector3") align 4 %4, ptr noundef nonnull align 4 dereferenceable(12) %5, float noundef 1.000000e+01)
          to label %15 unwind label %28

15:                                               ; preds = %14
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %6) #8
  invoke void @_ZN5Maths8TVector3IfE3OneEv(ptr dead_on_unwind nonnull writable sret(%"class.Maths::TVector3") align 4 %6)
          to label %16 unwind label %30

16:                                               ; preds = %15
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %7) #8
  invoke void @_ZN5Maths10Quaternion3OneEv(ptr dead_on_unwind nonnull writable sret(%"class.Maths::Quaternion") align 4 %7)
          to label %17 unwind label %32

17:                                               ; preds = %16
  %18 = invoke noundef ptr @_ZN7Riemann15GeometryFactory9CreateOBBERKN5Maths8TVector3IfEES5_RKNS1_10QuaternionE(ptr noundef nonnull align 4 dereferenceable(12) %4, ptr noundef nonnull align 4 dereferenceable(12) %6, ptr noundef nonnull align 4 dereferenceable(16) %7)
          to label %19 unwind label %32

19:                                               ; preds = %17
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %7) #8
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %6) #8
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %5) #8
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %4) #8
  store ptr %18, ptr %3, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %8) #8
  %20 = call noundef nonnull align 4 dereferenceable(24) ptr @_ZNK7Riemann8Geometry28GetBoundingVolume_WorldSpaceEv(ptr noundef nonnull align 8 dereferenceable(204) %18)
  %21 = load ptr, ptr %3, align 8, !tbaa !5
  %22 = invoke noundef i32 @_ZN7Riemann15DynamicAABBTree3AddERKN5Maths6TAABB3IfEEPv(ptr noundef nonnull align 8 dereferenceable(44) %1, ptr noundef nonnull align 4 dereferenceable(24) %20, ptr noundef %21)
          to label %23 unwind label %36

23:                                               ; preds = %19
  store i32 %22, ptr %8, align 4, !tbaa !9
  %24 = invoke noundef zeroext i1 @_ZNK7Riemann15DynamicAABBTree8ValidateEv(ptr noundef nonnull align 8 dereferenceable(44) %1)
          to label %25 unwind label %36

25:                                               ; preds = %23
  br i1 %24, label %38, label %26

26:                                               ; preds = %25
  %27 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, ptr noundef nonnull @.str.2, i32 noundef 157)
  call void @_Z10BreakPointPKcl(ptr noundef nonnull @.str.2, i64 noundef 157)
  br label %38

28:                                               ; preds = %14, %13
  %29 = landingpad { ptr, i32 }
          cleanup
  br label %35

30:                                               ; preds = %15
  %31 = landingpad { ptr, i32 }
          cleanup
  br label %34

32:                                               ; preds = %17, %16
  %33 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %7) #8
  br label %34

34:                                               ; preds = %32, %30
  %.pn28 = phi { ptr, i32 } [ %33, %32 ], [ %31, %30 ]
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %6) #8
  br label %35

35:                                               ; preds = %34, %28
  %.pn28.pn = phi { ptr, i32 } [ %.pn28, %34 ], [ %29, %28 ]
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %5) #8
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %4) #8
  br label %42

36:                                               ; preds = %38, %23, %19
  %37 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %8) #8
  br label %42

38:                                               ; preds = %26, %25
  %39 = invoke noundef nonnull align 8 dereferenceable(12) ptr @_ZNSt6vectorIZ15TestDynamicAABBvE5ActorSaIS0_EE12emplace_backIJRPN7Riemann8GeometryERiEEERS0_DpOT_(ptr noundef nonnull align 8 dereferenceable(24) %2, ptr noundef nonnull align 8 dereferenceable(8) %3, ptr noundef nonnull align 4 dereferenceable(4) %8)
          to label %40 unwind label %36

40:                                               ; preds = %38
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %8) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #8
  %41 = add nuw nsw i32 %.035, 1
  %exitcond.not = icmp eq i32 %41, 128
  br i1 %exitcond.not, label %.preheader, label %13, !llvm.loop !11

42:                                               ; preds = %36, %35
  %.pn31 = phi { ptr, i32 } [ %37, %36 ], [ %.pn28.pn, %35 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #8
  br label %107

.preheader:                                       ; preds = %40, %._crit_edge
  %.02037 = phi i32 [ %45, %._crit_edge ], [ 0, %40 ]
  %43 = call noundef i64 @_ZNKSt6vectorIZ15TestDynamicAABBvE5ActorSaIS0_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %2) #8
  %.not = icmp eq i64 %43, 0
  br i1 %.not, label %._crit_edge, label %.lr.ph

44:                                               ; preds = %._crit_edge
  invoke void @_ZN7Riemann15DynamicAABBTree7RebuildEv(ptr noundef nonnull align 8 dereferenceable(44) %1)
          to label %104 unwind label %105

._crit_edge:                                      ; preds = %100, %.preheader
  %45 = add nuw nsw i32 %.02037, 1
  %exitcond38.not = icmp eq i32 %45, 1000
  br i1 %exitcond38.not, label %44, label %.preheader, !llvm.loop !13

.lr.ph:                                           ; preds = %.preheader, %100
  %.01936 = phi i64 [ %101, %100 ], [ 0, %.preheader ]
  %46 = invoke noundef i32 @_ZN5Maths9RandomIntEii(i32 noundef 0, i32 noundef 5)
          to label %47 unwind label %64

47:                                               ; preds = %.lr.ph
  %48 = call noundef nonnull align 8 dereferenceable(12) ptr @_ZNSt6vectorIZ15TestDynamicAABBvE5ActorSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %2, i64 noundef %.01936) #8
  %49 = getelementptr inbounds i8, ptr %48, i64 8
  %50 = load i32, ptr %49, align 8, !tbaa !14
  %51 = icmp eq i32 %50, -1
  %52 = icmp eq i32 %46, 0
  br i1 %51, label %53, label %66

53:                                               ; preds = %47
  br i1 %52, label %54, label %95

54:                                               ; preds = %53
  %55 = call noundef nonnull align 8 dereferenceable(12) ptr @_ZNSt6vectorIZ15TestDynamicAABBvE5ActorSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %2, i64 noundef %.01936) #8
  %56 = load ptr, ptr %55, align 8, !tbaa !16
  %57 = call noundef nonnull align 4 dereferenceable(24) ptr @_ZNK7Riemann8Geometry28GetBoundingVolume_WorldSpaceEv(ptr noundef nonnull align 8 dereferenceable(204) %56)
  %58 = call noundef nonnull align 8 dereferenceable(12) ptr @_ZNSt6vectorIZ15TestDynamicAABBvE5ActorSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %2, i64 noundef %.01936) #8
  %59 = load ptr, ptr %58, align 8, !tbaa !16
  %60 = invoke noundef i32 @_ZN7Riemann15DynamicAABBTree3AddERKN5Maths6TAABB3IfEEPv(ptr noundef nonnull align 8 dereferenceable(44) %1, ptr noundef nonnull align 4 dereferenceable(24) %57, ptr noundef %59)
          to label %61 unwind label %64

61:                                               ; preds = %54
  %62 = call noundef nonnull align 8 dereferenceable(12) ptr @_ZNSt6vectorIZ15TestDynamicAABBvE5ActorSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %2, i64 noundef %.01936) #8
  %63 = getelementptr inbounds i8, ptr %62, i64 8
  store i32 %60, ptr %63, align 8, !tbaa !14
  br label %95

64:                                               ; preds = %95, %78, %68, %54, %.lr.ph
  %65 = landingpad { ptr, i32 }
          cleanup
  br label %107

66:                                               ; preds = %47
  %67 = call noundef nonnull align 8 dereferenceable(12) ptr @_ZNSt6vectorIZ15TestDynamicAABBvE5ActorSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %2, i64 noundef %.01936) #8
  br i1 %52, label %68, label %74

68:                                               ; preds = %66
  %69 = getelementptr inbounds i8, ptr %67, i64 8
  %70 = load i32, ptr %69, align 8, !tbaa !14
  invoke void @_ZN7Riemann15DynamicAABBTree6RemoveEi(ptr noundef nonnull align 8 dereferenceable(44) %1, i32 noundef %70)
          to label %71 unwind label %64

71:                                               ; preds = %68
  %72 = call noundef nonnull align 8 dereferenceable(12) ptr @_ZNSt6vectorIZ15TestDynamicAABBvE5ActorSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %2, i64 noundef %.01936) #8
  %73 = getelementptr inbounds i8, ptr %72, i64 8
  store i32 -1, ptr %73, align 8, !tbaa !14
  br label %95

74:                                               ; preds = %66
  %75 = load ptr, ptr %67, align 8, !tbaa !16
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %9) #8
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %10) #8
  invoke void @_ZN5Maths8TVector3IfE6RandomEv(ptr dead_on_unwind nonnull writable sret(%"class.Maths::TVector3") align 4 %10)
          to label %76 unwind label %91

76:                                               ; preds = %74
  invoke void @_ZNK5Maths8TVector3IfEmlEf(ptr dead_on_unwind nonnull writable sret(%"class.Maths::TVector3") align 4 %9, ptr noundef nonnull align 4 dereferenceable(12) %10, float noundef 1.000000e+01)
          to label %77 unwind label %91

77:                                               ; preds = %76
  invoke void @_ZN7Riemann8Geometry16SetWorldPositionERKN5Maths8TVector3IfEE(ptr noundef nonnull align 8 dereferenceable(204) %75, ptr noundef nonnull align 4 dereferenceable(12) %9)
          to label %78 unwind label %91

78:                                               ; preds = %77
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %10) #8
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %9) #8
  %79 = call noundef nonnull align 8 dereferenceable(12) ptr @_ZNSt6vectorIZ15TestDynamicAABBvE5ActorSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %2, i64 noundef %.01936) #8
  %80 = load ptr, ptr %79, align 8, !tbaa !16
  invoke void @_ZN7Riemann8Geometry20UpdateBoundingVolumeEv(ptr noundef nonnull align 8 dereferenceable(204) %80)
          to label %81 unwind label %64

81:                                               ; preds = %78
  %82 = call noundef nonnull align 8 dereferenceable(12) ptr @_ZNSt6vectorIZ15TestDynamicAABBvE5ActorSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %2, i64 noundef %.01936) #8
  %83 = getelementptr inbounds i8, ptr %82, i64 8
  %84 = load i32, ptr %83, align 8, !tbaa !14
  %85 = call noundef nonnull align 8 dereferenceable(12) ptr @_ZNSt6vectorIZ15TestDynamicAABBvE5ActorSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %2, i64 noundef %.01936) #8
  %86 = load ptr, ptr %85, align 8, !tbaa !16
  %87 = call noundef nonnull align 4 dereferenceable(24) ptr @_ZNK7Riemann8Geometry28GetBoundingVolume_WorldSpaceEv(ptr noundef nonnull align 8 dereferenceable(204) %86)
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %11) #8
  invoke void @_ZN5Maths8TVector3IfE5UnitYEv(ptr dead_on_unwind nonnull writable sret(%"class.Maths::TVector3") align 4 %11)
          to label %88 unwind label %93

88:                                               ; preds = %81
  %89 = invoke noundef zeroext i1 @_ZN7Riemann15DynamicAABBTree6UpdateEiRKN5Maths6TAABB3IfEERKNS1_8TVector3IfEE(ptr noundef nonnull align 8 dereferenceable(44) %1, i32 noundef %84, ptr noundef nonnull align 4 dereferenceable(24) %87, ptr noundef nonnull align 4 dereferenceable(12) %11)
          to label %90 unwind label %93

90:                                               ; preds = %88
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %11) #8
  br label %95

91:                                               ; preds = %77, %76, %74
  %92 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %10) #8
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %9) #8
  br label %107

93:                                               ; preds = %88, %81
  %94 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %11) #8
  br label %107

95:                                               ; preds = %71, %90, %53, %61
  %96 = invoke noundef zeroext i1 @_ZNK7Riemann15DynamicAABBTree8ValidateEv(ptr noundef nonnull align 8 dereferenceable(44) %1)
          to label %97 unwind label %64

97:                                               ; preds = %95
  br i1 %96, label %100, label %98

98:                                               ; preds = %97
  %99 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, ptr noundef nonnull @.str.2, i32 noundef 189)
  call void @_Z10BreakPointPKcl(ptr noundef nonnull @.str.2, i64 noundef 189)
  br label %100

100:                                              ; preds = %98, %97
  %101 = add nuw i64 %.01936, 1
  %102 = call noundef i64 @_ZNKSt6vectorIZ15TestDynamicAABBvE5ActorSaIS0_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %2) #8
  %103 = icmp ult i64 %101, %102
  br i1 %103, label %.lr.ph, label %._crit_edge, !llvm.loop !17

104:                                              ; preds = %44
  call void @_ZNSt6vectorIZ15TestDynamicAABBvE5ActorSaIS0_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %2) #8
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %2) #8
  call void @_ZN7Riemann15DynamicAABBTreeD1Ev(ptr noundef nonnull align 8 dereferenceable(44) %1) #8
  call void @llvm.lifetime.end.p0(i64 48, ptr nonnull %1) #8
  ret void

105:                                              ; preds = %44
  %106 = landingpad { ptr, i32 }
          cleanup
  br label %107

107:                                              ; preds = %64, %91, %93, %105, %42
  %.pn31.pn = phi { ptr, i32 } [ %.pn31, %42 ], [ %106, %105 ], [ %65, %64 ], [ %94, %93 ], [ %92, %91 ]
  call void @_ZNSt6vectorIZ15TestDynamicAABBvE5ActorSaIS0_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %2) #8
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %2) #8
  call void @_ZN7Riemann15DynamicAABBTreeD1Ev(ptr noundef nonnull align 8 dereferenceable(44) %1) #8
  call void @llvm.lifetime.end.p0(i64 48, ptr nonnull %1) #8
  resume { ptr, i32 } %.pn31.pn
}

declare void @_ZN7Riemann15DynamicAABBTreeC1Ev(ptr noundef nonnull align 8 dereferenceable(44)) unnamed_addr #4

; Function Attrs: mustprogress nounwind uwtable
declare hidden void @_ZNSt6vectorIZ15TestDynamicAABBvE5ActorSaIS0_EEC2Ev(ptr noundef nonnull align 8 dereferenceable(24)) unnamed_addr #5 align 2

declare noundef ptr @_ZN7Riemann15GeometryFactory9CreateOBBERKN5Maths8TVector3IfEES5_RKNS1_10QuaternionE(ptr noundef nonnull align 4 dereferenceable(12), ptr noundef nonnull align 4 dereferenceable(12), ptr noundef nonnull align 4 dereferenceable(16)) local_unnamed_addr #4

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZNK5Maths8TVector3IfEmlEf(ptr dead_on_unwind noalias writable sret(%"class.Maths::TVector3") align 4, ptr noundef nonnull align 4 dereferenceable(12), float noundef) local_unnamed_addr #6 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN5Maths10Quaternion3OneEv(ptr dead_on_unwind noalias writable sret(%"class.Maths::Quaternion") align 4) local_unnamed_addr #3 align 2

declare noundef i32 @_ZN7Riemann15DynamicAABBTree3AddERKN5Maths6TAABB3IfEEPv(ptr noundef nonnull align 8 dereferenceable(44), ptr noundef nonnull align 4 dereferenceable(24), ptr noundef) local_unnamed_addr #4

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

declare noundef zeroext i1 @_ZNK7Riemann15DynamicAABBTree8ValidateEv(ptr noundef nonnull align 8 dereferenceable(44)) local_unnamed_addr #4

; Function Attrs: mustprogress uwtable
declare hidden noundef nonnull align 8 dereferenceable(12) ptr @_ZNSt6vectorIZ15TestDynamicAABBvE5ActorSaIS0_EE12emplace_backIJRPN7Riemann8GeometryERiEEERS0_DpOT_(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #3 align 2

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef i32 @_ZN5Maths9RandomIntEii(i32 noundef, i32 noundef) local_unnamed_addr #6

; Function Attrs: mustprogress nounwind uwtable
declare hidden noundef nonnull align 8 dereferenceable(12) ptr @_ZNSt6vectorIZ15TestDynamicAABBvE5ActorSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) local_unnamed_addr #5 align 2

declare void @_ZN7Riemann15DynamicAABBTree6RemoveEi(ptr noundef nonnull align 8 dereferenceable(44), i32 noundef) local_unnamed_addr #4

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

declare void @_ZN7Riemann8Geometry20UpdateBoundingVolumeEv(ptr noundef nonnull align 8 dereferenceable(204)) local_unnamed_addr #4

declare noundef zeroext i1 @_ZN7Riemann15DynamicAABBTree6UpdateEiRKN5Maths6TAABB3IfEERKNS1_8TVector3IfEE(ptr noundef nonnull align 8 dereferenceable(44), i32 noundef, ptr noundef nonnull align 4 dereferenceable(24), ptr noundef nonnull align 4 dereferenceable(12)) local_unnamed_addr #4

declare void @_ZN7Riemann15DynamicAABBTree7RebuildEv(ptr noundef nonnull align 8 dereferenceable(44)) local_unnamed_addr #4

; Function Attrs: mustprogress nounwind uwtable
declare hidden void @_ZNSt6vectorIZ15TestDynamicAABBvE5ActorSaIS0_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24)) unnamed_addr #5 align 2

; Function Attrs: nounwind
declare void @_ZN7Riemann15DynamicAABBTreeD1Ev(ptr noundef nonnull align 8 dereferenceable(44)) unnamed_addr #7

attributes #0 = { nofree nounwind "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 = { 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 #3 = { 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 #4 = { "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 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 #6 = { 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 #7 = { nounwind "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 #8 = { 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 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = distinct !{!13, !12}
!14 = !{!15, !10, i64 8}
!15 = !{!"_ZTSZ15TestDynamicAABBvE5Actor", !6, i64 0, !10, i64 8}
!16 = !{!15, !6, i64 0}
!17 = distinct !{!17, !12}


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