; LLVM IR from gazebosim/gz-physics :: tpe/lib/src/aabb_tree/AABB.ll (ZN4aabb4Tree5queryEjRKNS_4AABBE)

; Unoptimized IR (clang -disable-llvm-passes):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%"class.std::vector.16" = type { %"struct.std::_Vector_base.17" }
%"struct.std::_Vector_base.17" = type { %"struct.std::_Vector_base<unsigned int, std::allocator<unsigned int>>::_Vector_impl" }
%"struct.std::_Vector_base<unsigned int, std::allocator<unsigned int>>::_Vector_impl" = type { %"struct.std::_Vector_base<unsigned int, std::allocator<unsigned int>>::_Vector_impl_data" }
%"struct.std::_Vector_base<unsigned int, std::allocator<unsigned int>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.aabb::AABB" = type { %"class.std::vector", %"class.std::vector", %"class.std::vector", double }
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<double, std::allocator<double>>::_Vector_impl" }
%"struct.std::_Vector_base<double, std::allocator<double>>::_Vector_impl" = type { %"struct.std::_Vector_base<double, std::allocator<double>>::_Vector_impl_data" }
%"struct.std::_Vector_base<double, std::allocator<double>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::allocator" = type { i8 }
%"class.aabb::Tree" = type <{ i32, [4 x i8], %"class.std::vector.0", i32, i32, i32, i32, i8, [7 x i8], double, %"class.std::vector.5", %"class.std::vector", %"class.std::vector", %"class.std::vector", %"class.std::unordered_map", i8, [7 x i8] }>
%"class.std::vector.0" = type { %"struct.std::_Vector_base.1" }
%"struct.std::_Vector_base.1" = type { %"struct.std::_Vector_base<aabb::Node, std::allocator<aabb::Node>>::_Vector_impl" }
%"struct.std::_Vector_base<aabb::Node, std::allocator<aabb::Node>>::_Vector_impl" = type { %"struct.std::_Vector_base<aabb::Node, std::allocator<aabb::Node>>::_Vector_impl_data" }
%"struct.std::_Vector_base<aabb::Node, std::allocator<aabb::Node>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::vector.5" = type { %"struct.std::_Bvector_base" }
%"struct.std::_Bvector_base" = type { %"struct.std::_Bvector_base<std::allocator<bool>>::_Bvector_impl" }
%"struct.std::_Bvector_base<std::allocator<bool>>::_Bvector_impl" = type { %"struct.std::_Bvector_base<std::allocator<bool>>::_Bvector_impl_data" }
%"struct.std::_Bvector_base<std::allocator<bool>>::_Bvector_impl_data" = type { %"struct.std::_Bit_iterator", %"struct.std::_Bit_iterator", ptr }
%"struct.std::_Bit_iterator" = type { %"struct.std::_Bit_iterator_base.base", [4 x i8] }
%"struct.std::_Bit_iterator_base.base" = type <{ ptr, i32 }>
%"class.std::unordered_map" = type { %"class.std::_Hashtable" }
%"class.std::_Hashtable" = type { ptr, i64, %"struct.std::__detail::_Hash_node_base", i64, %"struct.std::__detail::_Prime_rehash_policy", ptr }
%"struct.std::__detail::_Hash_node_base" = type { ptr }
%"struct.std::__detail::_Prime_rehash_policy" = type { float, i64 }
%"struct.aabb::Node" = type { %"class.aabb::AABB", i32, i32, i32, i32, i32, i32 }

declare i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt6vectorIdSaIdEED2Ev(ptr noundef nonnull align 8 dereferenceable(24)) unnamed_addr #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 noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIdSaIdEEixEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) #0 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 noundef nonnull align 8 dereferenceable(8) ptr @_ZNKSt6vectorIdSaIdEEixEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) #0 align 2

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

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

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

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN4aabb4AABBD2Ev(ptr noundef nonnull align 8 dereferenceable(80)) unnamed_addr #3 align 2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN4aabb4Tree5queryEjRKNS_4AABBE(ptr dead_on_unwind noalias writable sret(%"class.std::vector.16") align 8 %0, ptr noundef nonnull align 8 dereferenceable(233) %1, i32 noundef %2, ptr noundef nonnull align 8 dereferenceable(80) %3) #2 align 2 personality ptr @__gxx_personality_v0 {
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca i32, align 4
  %8 = alloca ptr, align 8
  %9 = alloca %"class.std::vector.16", align 8
  %10 = alloca ptr, align 8
  %11 = alloca i32, align 4
  %12 = alloca i1, align 1
  %13 = alloca i32, align 4
  %14 = alloca %"class.aabb::AABB", align 8
  %15 = alloca i32, align 4
  %16 = alloca %"class.std::vector", align 8
  %17 = alloca %"class.std::allocator", align 1
  %18 = alloca %"class.std::vector", align 8
  %19 = alloca %"class.std::allocator", align 1
  %20 = alloca i32, align 4
  %21 = alloca i8, align 1
  %22 = alloca i32, align 4
  store ptr %0, ptr %5, align 8
  store ptr %1, ptr %6, align 8, !tbaa !5
  store i32 %2, ptr %7, align 4, !tbaa !9
  store ptr %3, ptr %8, align 8, !tbaa !5
  %23 = load ptr, ptr %6, align 8
  call void @llvm.lifetime.start.p0(i64 24, ptr %9) #5
  call void @_ZNSt6vectorIjSaIjEEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %9) #5
  invoke void @_ZNSt6vectorIjSaIjEE7reserveEm(ptr noundef nonnull align 8 dereferenceable(24) %9, i64 noundef 256)
          to label %24 unwind label %42

24:                                               ; preds = %4
  %25 = getelementptr inbounds %"class.aabb::Tree", ptr %23, i32 0, i32 0
  invoke void @_ZNSt6vectorIjSaIjEE9push_backERKj(ptr noundef nonnull align 8 dereferenceable(24) %9, ptr noundef nonnull align 4 dereferenceable(4) %25)
          to label %26 unwind label %42

26:                                               ; preds = %24
  store i1 false, ptr %12, align 1
  call void @_ZNSt6vectorIjSaIjEEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %0) #5
  br label %27

27:                                               ; preds = %191, %189, %26
  %28 = call noundef i64 @_ZNKSt6vectorIjSaIjEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %9) #5
  %29 = icmp ugt i64 %28, 0
  br i1 %29, label %30, label %194

30:                                               ; preds = %27
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #5
  %31 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIjSaIjEE4backEv(ptr noundef nonnull align 8 dereferenceable(24) %9) #5
  %32 = load i32, ptr %31, align 4, !tbaa !9
  store i32 %32, ptr %13, align 4, !tbaa !9
  call void @_ZNSt6vectorIjSaIjEE8pop_backEv(ptr noundef nonnull align 8 dereferenceable(24) %9) #5
  call void @llvm.lifetime.start.p0(i64 80, ptr %14) #5
  %33 = getelementptr inbounds %"class.aabb::Tree", ptr %23, i32 0, i32 2
  %34 = load i32, ptr %13, align 4, !tbaa !9
  %35 = zext i32 %34 to i64
  %36 = call noundef nonnull align 8 dereferenceable(104) ptr @_ZNSt6vectorIN4aabb4NodeESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %33, i64 noundef %35) #5
  %37 = getelementptr inbounds %"struct.aabb::Node", ptr %36, i32 0, i32 0
  invoke void @_ZN4aabb4AABBC2ERKS0_(ptr noundef nonnull align 8 dereferenceable(80) %14, ptr noundef nonnull align 8 dereferenceable(80) %37)
          to label %38 unwind label %46

38:                                               ; preds = %30
  %39 = load i32, ptr %13, align 4, !tbaa !9
  %40 = icmp eq i32 %39, -1
  br i1 %40, label %41, label %50

41:                                               ; preds = %38
  store i32 2, ptr %15, align 4
  br label %189, !llvm.loop !11

42:                                               ; preds = %24, %4
  %43 = landingpad { ptr, i32 }
          cleanup
  %44 = extractvalue { ptr, i32 } %43, 0
  store ptr %44, ptr %10, align 8
  %45 = extractvalue { ptr, i32 } %43, 1
  store i32 %45, ptr %11, align 4
  br label %198

46:                                               ; preds = %30
  %47 = landingpad { ptr, i32 }
          cleanup
  %48 = extractvalue { ptr, i32 } %47, 0
  store ptr %48, ptr %10, align 8
  %49 = extractvalue { ptr, i32 } %47, 1
  store i32 %49, ptr %11, align 4
  br label %193

50:                                               ; preds = %38
  %51 = getelementptr inbounds %"class.aabb::Tree", ptr %23, i32 0, i32 7
  %52 = load i8, ptr %51, align 8, !tbaa !13, !range !37, !noundef !38
  %53 = trunc i8 %52 to i1
  br i1 %53, label %54, label %141

54:                                               ; preds = %50
  call void @llvm.lifetime.start.p0(i64 24, ptr %16) #5
  %55 = getelementptr inbounds %"class.aabb::Tree", ptr %23, i32 0, i32 6
  %56 = load i32, ptr %55, align 4, !tbaa !39
  %57 = zext i32 %56 to i64
  call void @llvm.lifetime.start.p0(i64 1, ptr %17) #5
  call void @_ZNSaIdEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %17) #5
  invoke void @_ZNSt6vectorIdSaIdEEC2EmRKS0_(ptr noundef nonnull align 8 dereferenceable(24) %16, i64 noundef %57, ptr noundef nonnull align 1 dereferenceable(1) %17)
          to label %58 unwind label %69

58:                                               ; preds = %54
  call void @_ZNSt15__new_allocatorIdED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %17) #5
  call void @llvm.lifetime.end.p0(i64 1, ptr %17) #5
  call void @llvm.lifetime.start.p0(i64 24, ptr %18) #5
  %59 = getelementptr inbounds %"class.aabb::Tree", ptr %23, i32 0, i32 6
  %60 = load i32, ptr %59, align 4, !tbaa !39
  %61 = zext i32 %60 to i64
  call void @llvm.lifetime.start.p0(i64 1, ptr %19) #5
  call void @_ZNSaIdEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %19) #5
  invoke void @_ZNSt6vectorIdSaIdEEC2EmRKS0_(ptr noundef nonnull align 8 dereferenceable(24) %18, i64 noundef %61, ptr noundef nonnull align 1 dereferenceable(1) %19)
          to label %62 unwind label %73

62:                                               ; preds = %58
  call void @_ZNSt15__new_allocatorIdED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %19) #5
  call void @llvm.lifetime.end.p0(i64 1, ptr %19) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %20) #5
  store i32 0, ptr %20, align 4, !tbaa !9
  br label %63

63:                                               ; preds = %93, %62
  %64 = load i32, ptr %20, align 4, !tbaa !9
  %65 = getelementptr inbounds %"class.aabb::Tree", ptr %23, i32 0, i32 6
  %66 = load i32, ptr %65, align 4, !tbaa !39
  %67 = icmp ult i32 %64, %66
  br i1 %67, label %77, label %68

68:                                               ; preds = %63
  store i32 4, ptr %15, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #5
  br label %96

69:                                               ; preds = %54
  %70 = landingpad { ptr, i32 }
          cleanup
  %71 = extractvalue { ptr, i32 } %70, 0
  store ptr %71, ptr %10, align 8
  %72 = extractvalue { ptr, i32 } %70, 1
  store i32 %72, ptr %11, align 4
  call void @_ZNSt15__new_allocatorIdED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %17) #5
  call void @llvm.lifetime.end.p0(i64 1, ptr %17) #5
  br label %140

73:                                               ; preds = %58
  %74 = landingpad { ptr, i32 }
          cleanup
  %75 = extractvalue { ptr, i32 } %74, 0
  store ptr %75, ptr %10, align 8
  %76 = extractvalue { ptr, i32 } %74, 1
  store i32 %76, ptr %11, align 4
  call void @_ZNSt15__new_allocatorIdED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %19) #5
  call void @llvm.lifetime.end.p0(i64 1, ptr %19) #5
  br label %139

77:                                               ; preds = %63
  %78 = getelementptr inbounds %"class.aabb::AABB", ptr %14, i32 0, i32 2
  %79 = load i32, ptr %20, align 4, !tbaa !9
  %80 = zext i32 %79 to i64
  %81 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIdSaIdEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %78, i64 noundef %80) #5
  %82 = load double, ptr %81, align 8, !tbaa !40
  %83 = load ptr, ptr %8, align 8, !tbaa !5
  %84 = getelementptr inbounds %"class.aabb::AABB", ptr %83, i32 0, i32 2
  %85 = load i32, ptr %20, align 4, !tbaa !9
  %86 = zext i32 %85 to i64
  %87 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNKSt6vectorIdSaIdEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %84, i64 noundef %86) #5
  %88 = load double, ptr %87, align 8, !tbaa !40
  %89 = fsub double %82, %88
  %90 = load i32, ptr %20, align 4, !tbaa !9
  %91 = zext i32 %90 to i64
  %92 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIdSaIdEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %16, i64 noundef %91) #5
  store double %89, ptr %92, align 8, !tbaa !40
  br label %93

93:                                               ; preds = %77
  %94 = load i32, ptr %20, align 4, !tbaa !9
  %95 = add i32 %94, 1
  store i32 %95, ptr %20, align 4, !tbaa !9
  br label %63, !llvm.loop !41

96:                                               ; preds = %68
  call void @llvm.lifetime.start.p0(i64 1, ptr %21) #5
  %97 = invoke noundef zeroext i1 @_ZN4aabb4Tree12minimumImageERSt6vectorIdSaIdEES4_(ptr noundef nonnull align 8 dereferenceable(233) %23, ptr noundef nonnull align 8 dereferenceable(24) %16, ptr noundef nonnull align 8 dereferenceable(24) %18)
          to label %98 unwind label %109

98:                                               ; preds = %96
  %99 = zext i1 %97 to i8
  store i8 %99, ptr %21, align 1, !tbaa !42
  %100 = load i8, ptr %21, align 1, !tbaa !42, !range !37, !noundef !38
  %101 = trunc i8 %100 to i1
  br i1 %101, label %102, label %138

102:                                              ; preds = %98
  call void @llvm.lifetime.start.p0(i64 4, ptr %22) #5
  store i32 0, ptr %22, align 4, !tbaa !9
  br label %103

103:                                              ; preds = %134, %102
  %104 = load i32, ptr %22, align 4, !tbaa !9
  %105 = getelementptr inbounds %"class.aabb::Tree", ptr %23, i32 0, i32 6
  %106 = load i32, ptr %105, align 4, !tbaa !39
  %107 = icmp ult i32 %104, %106
  br i1 %107, label %113, label %108

108:                                              ; preds = %103
  store i32 7, ptr %15, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %22) #5
  br label %137

109:                                              ; preds = %96
  %110 = landingpad { ptr, i32 }
          cleanup
  %111 = extractvalue { ptr, i32 } %110, 0
  store ptr %111, ptr %10, align 8
  %112 = extractvalue { ptr, i32 } %110, 1
  store i32 %112, ptr %11, align 4
  call void @llvm.lifetime.end.p0(i64 1, ptr %21) #5
  call void @_ZNSt6vectorIdSaIdEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %18) #5
  br label %139

113:                                              ; preds = %103
  %114 = load i32, ptr %22, align 4, !tbaa !9
  %115 = zext i32 %114 to i64
  %116 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIdSaIdEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %18, i64 noundef %115) #5
  %117 = load double, ptr %116, align 8, !tbaa !40
  %118 = getelementptr inbounds %"class.aabb::AABB", ptr %14, i32 0, i32 0
  %119 = load i32, ptr %22, align 4, !tbaa !9
  %120 = zext i32 %119 to i64
  %121 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIdSaIdEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %118, i64 noundef %120) #5
  %122 = load double, ptr %121, align 8, !tbaa !40
  %123 = fadd double %122, %117
  store double %123, ptr %121, align 8, !tbaa !40
  %124 = load i32, ptr %22, align 4, !tbaa !9
  %125 = zext i32 %124 to i64
  %126 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIdSaIdEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %18, i64 noundef %125) #5
  %127 = load double, ptr %126, align 8, !tbaa !40
  %128 = getelementptr inbounds %"class.aabb::AABB", ptr %14, i32 0, i32 1
  %129 = load i32, ptr %22, align 4, !tbaa !9
  %130 = zext i32 %129 to i64
  %131 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIdSaIdEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %128, i64 noundef %130) #5
  %132 = load double, ptr %131, align 8, !tbaa !40
  %133 = fadd double %132, %127
  store double %133, ptr %131, align 8, !tbaa !40
  br label %134

134:                                              ; preds = %113
  %135 = load i32, ptr %22, align 4, !tbaa !9
  %136 = add i32 %135, 1
  store i32 %136, ptr %22, align 4, !tbaa !9
  br label %103, !llvm.loop !43

137:                                              ; preds = %108
  br label %138

138:                                              ; preds = %137, %98
  call void @llvm.lifetime.end.p0(i64 1, ptr %21) #5
  call void @_ZNSt6vectorIdSaIdEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %18) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr %18) #5
  call void @_ZNSt6vectorIdSaIdEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %16) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr %16) #5
  br label %141

139:                                              ; preds = %109, %73
  call void @llvm.lifetime.end.p0(i64 24, ptr %18) #5
  call void @_ZNSt6vectorIdSaIdEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %16) #5
  br label %140

140:                                              ; preds = %139, %69
  call void @llvm.lifetime.end.p0(i64 24, ptr %16) #5
  br label %192

141:                                              ; preds = %138, %50
  %142 = load ptr, ptr %8, align 8, !tbaa !5
  %143 = getelementptr inbounds %"class.aabb::Tree", ptr %23, i32 0, i32 15
  %144 = load i8, ptr %143, align 8, !tbaa !44, !range !37, !noundef !38
  %145 = trunc i8 %144 to i1
  %146 = call noundef zeroext i1 @_ZNK4aabb4AABB8overlapsERKS0_b(ptr noundef nonnull align 8 dereferenceable(80) %142, ptr noundef nonnull align 8 dereferenceable(80) %14, i1 noundef zeroext %145)
  br i1 %146, label %147, label %188

147:                                              ; preds = %141
  %148 = getelementptr inbounds %"class.aabb::Tree", ptr %23, i32 0, i32 2
  %149 = load i32, ptr %13, align 4, !tbaa !9
  %150 = zext i32 %149 to i64
  %151 = call noundef nonnull align 8 dereferenceable(104) ptr @_ZNSt6vectorIN4aabb4NodeESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %148, i64 noundef %150) #5
  %152 = call noundef zeroext i1 @_ZNK4aabb4Node6isLeafEv(ptr noundef nonnull align 8 dereferenceable(104) %151)
  br i1 %152, label %153, label %174

153:                                              ; preds = %147
  %154 = getelementptr inbounds %"class.aabb::Tree", ptr %23, i32 0, i32 2
  %155 = load i32, ptr %13, align 4, !tbaa !9
  %156 = zext i32 %155 to i64
  %157 = call noundef nonnull align 8 dereferenceable(104) ptr @_ZNSt6vectorIN4aabb4NodeESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %154, i64 noundef %156) #5
  %158 = getelementptr inbounds %"struct.aabb::Node", ptr %157, i32 0, i32 6
  %159 = load i32, ptr %158, align 4, !tbaa !45
  %160 = load i32, ptr %7, align 4, !tbaa !9
  %161 = icmp ne i32 %159, %160
  br i1 %161, label %162, label %173

162:                                              ; preds = %153
  %163 = getelementptr inbounds %"class.aabb::Tree", ptr %23, i32 0, i32 2
  %164 = load i32, ptr %13, align 4, !tbaa !9
  %165 = zext i32 %164 to i64
  %166 = call noundef nonnull align 8 dereferenceable(104) ptr @_ZNSt6vectorIN4aabb4NodeESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %163, i64 noundef %165) #5
  %167 = getelementptr inbounds %"struct.aabb::Node", ptr %166, i32 0, i32 6
  invoke void @_ZNSt6vectorIjSaIjEE9push_backERKj(ptr noundef nonnull align 8 dereferenceable(24) %0, ptr noundef nonnull align 4 dereferenceable(4) %167)
          to label %168 unwind label %169

168:                                              ; preds = %162
  br label %173

169:                                              ; preds = %180, %174, %162
  %170 = landingpad { ptr, i32 }
          cleanup
  %171 = extractvalue { ptr, i32 } %170, 0
  store ptr %171, ptr %10, align 8
  %172 = extractvalue { ptr, i32 } %170, 1
  store i32 %172, ptr %11, align 4
  br label %192

173:                                              ; preds = %168, %153
  br label %187

174:                                              ; preds = %147
  %175 = getelementptr inbounds %"class.aabb::Tree", ptr %23, i32 0, i32 2
  %176 = load i32, ptr %13, align 4, !tbaa !9
  %177 = zext i32 %176 to i64
  %178 = call noundef nonnull align 8 dereferenceable(104) ptr @_ZNSt6vectorIN4aabb4NodeESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %175, i64 noundef %177) #5
  %179 = getelementptr inbounds %"struct.aabb::Node", ptr %178, i32 0, i32 3
  invoke void @_ZNSt6vectorIjSaIjEE9push_backERKj(ptr noundef nonnull align 8 dereferenceable(24) %9, ptr noundef nonnull align 4 dereferenceable(4) %179)
          to label %180 unwind label %169

180:                                              ; preds = %174
  %181 = getelementptr inbounds %"class.aabb::Tree", ptr %23, i32 0, i32 2
  %182 = load i32, ptr %13, align 4, !tbaa !9
  %183 = zext i32 %182 to i64
  %184 = call noundef nonnull align 8 dereferenceable(104) ptr @_ZNSt6vectorIN4aabb4NodeESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %181, i64 noundef %183) #5
  %185 = getelementptr inbounds %"struct.aabb::Node", ptr %184, i32 0, i32 4
  invoke void @_ZNSt6vectorIjSaIjEE9push_backERKj(ptr noundef nonnull align 8 dereferenceable(24) %9, ptr noundef nonnull align 4 dereferenceable(4) %185)
          to label %186 unwind label %169

186:                                              ; preds = %180
  br label %187

187:                                              ; preds = %186, %173
  br label %188

188:                                              ; preds = %187, %141
  store i32 0, ptr %15, align 4
  br label %189

189:                                              ; preds = %188, %41
  call void @_ZN4aabb4AABBD2Ev(ptr noundef nonnull align 8 dereferenceable(80) %14) #5
  call void @llvm.lifetime.end.p0(i64 80, ptr %14) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #5
  %190 = load i32, ptr %15, align 4
  switch i32 %190, label %204 [
    i32 0, label %191
    i32 2, label %27
  ]

191:                                              ; preds = %189
  br label %27, !llvm.loop !11

192:                                              ; preds = %169, %140
  call void @_ZN4aabb4AABBD2Ev(ptr noundef nonnull align 8 dereferenceable(80) %14) #5
  br label %193

193:                                              ; preds = %192, %46
  call void @llvm.lifetime.end.p0(i64 80, ptr %14) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #5
  call void @_ZNSt6vectorIjSaIjEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %0) #5
  br label %198

194:                                              ; preds = %27
  store i1 true, ptr %12, align 1
  store i32 1, ptr %15, align 4
  %195 = load i1, ptr %12, align 1
  br i1 %195, label %197, label %196

196:                                              ; preds = %194
  call void @_ZNSt6vectorIjSaIjEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %0) #5
  br label %197

197:                                              ; preds = %196, %194
  call void @_ZNSt6vectorIjSaIjEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %9) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr %9) #5
  ret void

198:                                              ; preds = %193, %42
  call void @_ZNSt6vectorIjSaIjEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %9) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr %9) #5
  br label %199

199:                                              ; preds = %198
  %200 = load ptr, ptr %10, align 8
  %201 = load i32, ptr %11, align 4
  %202 = insertvalue { ptr, i32 } poison, ptr %200, 0
  %203 = insertvalue { ptr, i32 } %202, i32 %201, 1
  resume { ptr, i32 } %203

204:                                              ; preds = %189
  unreachable
}

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

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

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

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

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN4aabb4AABBC2ERKS0_(ptr noundef nonnull align 8 dereferenceable(80), ptr noundef nonnull align 8 dereferenceable(80)) unnamed_addr #4 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZN4aabb4Tree12minimumImageERSt6vectorIdSaIdEES4_(ptr noundef nonnull align 8 dereferenceable(233), ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(24)) #2 align 2

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt15__new_allocatorIdED2Ev(ptr noundef nonnull align 1 dereferenceable(1)) 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 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { 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 #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 = { 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 = !{!14, !19, i64 48}
!14 = !{!"_ZTSN4aabb4TreeE", !10, i64 0, !15, i64 8, !10, i64 32, !10, i64 36, !10, i64 40, !10, i64 44, !19, i64 48, !20, i64 56, !21, i64 64, !27, i64 104, !27, i64 128, !27, i64 152, !31, i64 176, !19, i64 232}
!15 = !{!"_ZTSSt6vectorIN4aabb4NodeESaIS1_EE", !16, i64 0}
!16 = !{!"_ZTSSt12_Vector_baseIN4aabb4NodeESaIS1_EE", !17, i64 0}
!17 = !{!"_ZTSNSt12_Vector_baseIN4aabb4NodeESaIS1_EE12_Vector_implE", !18, i64 0}
!18 = !{!"_ZTSNSt12_Vector_baseIN4aabb4NodeESaIS1_EE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!19 = !{!"bool", !7, i64 0}
!20 = !{!"double", !7, i64 0}
!21 = !{!"_ZTSSt6vectorIbSaIbEE", !22, i64 0}
!22 = !{!"_ZTSSt13_Bvector_baseISaIbEE", !23, i64 0}
!23 = !{!"_ZTSNSt13_Bvector_baseISaIbEE13_Bvector_implE", !24, i64 0}
!24 = !{!"_ZTSNSt13_Bvector_baseISaIbEE18_Bvector_impl_dataE", !25, i64 0, !25, i64 16, !6, i64 32}
!25 = !{!"_ZTSSt13_Bit_iterator", !26, i64 0}
!26 = !{!"_ZTSSt18_Bit_iterator_base", !6, i64 0, !10, i64 8}
!27 = !{!"_ZTSSt6vectorIdSaIdEE", !28, i64 0}
!28 = !{!"_ZTSSt12_Vector_baseIdSaIdEE", !29, i64 0}
!29 = !{!"_ZTSNSt12_Vector_baseIdSaIdEE12_Vector_implE", !30, i64 0}
!30 = !{!"_ZTSNSt12_Vector_baseIdSaIdEE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!31 = !{!"_ZTSSt13unordered_mapIjjSt4hashIjESt8equal_toIjESaISt4pairIKjjEEE", !32, i64 0}
!32 = !{!"_ZTSSt10_HashtableIjSt4pairIKjjESaIS2_ENSt8__detail10_Select1stESt8equal_toIjESt4hashIjENS4_18_Mod_range_hashingENS4_20_Default_ranged_hashENS4_20_Prime_rehash_policyENS4_17_Hashtable_traitsILb0ELb0ELb1EEEE", !6, i64 0, !33, i64 8, !34, i64 16, !33, i64 24, !35, i64 32, !6, i64 48}
!33 = !{!"long", !7, i64 0}
!34 = !{!"_ZTSNSt8__detail15_Hash_node_baseE", !6, i64 0}
!35 = !{!"_ZTSNSt8__detail20_Prime_rehash_policyE", !36, i64 0, !33, i64 8}
!36 = !{!"float", !7, i64 0}
!37 = !{i8 0, i8 2}
!38 = !{}
!39 = !{!14, !10, i64 44}
!40 = !{!20, !20, i64 0}
!41 = distinct !{!41, !12}
!42 = !{!19, !19, i64 0}
!43 = distinct !{!43, !12}
!44 = !{!14, !19, i64 232}
!45 = !{!46, !10, i64 100}
!46 = !{!"_ZTSN4aabb4NodeE", !47, i64 0, !10, i64 80, !10, i64 84, !10, i64 88, !10, i64 92, !10, i64 96, !10, i64 100}
!47 = !{!"_ZTSN4aabb4AABBE", !27, i64 0, !27, i64 24, !27, i64 48, !20, i64 72}


; Optimized IR (opt -passes='default<O3>'):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%"class.std::vector.16" = type { %"struct.std::_Vector_base.17" }
%"struct.std::_Vector_base.17" = type { %"struct.std::_Vector_base<unsigned int, std::allocator<unsigned int>>::_Vector_impl" }
%"struct.std::_Vector_base<unsigned int, std::allocator<unsigned int>>::_Vector_impl" = type { %"struct.std::_Vector_base<unsigned int, std::allocator<unsigned int>>::_Vector_impl_data" }
%"struct.std::_Vector_base<unsigned int, std::allocator<unsigned int>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.aabb::AABB" = type { %"class.std::vector", %"class.std::vector", %"class.std::vector", double }
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<double, std::allocator<double>>::_Vector_impl" }
%"struct.std::_Vector_base<double, std::allocator<double>>::_Vector_impl" = type { %"struct.std::_Vector_base<double, std::allocator<double>>::_Vector_impl_data" }
%"struct.std::_Vector_base<double, std::allocator<double>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::allocator" = type { i8 }

declare i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt6vectorIdSaIdEED2Ev(ptr noundef nonnull align 8 dereferenceable(24)) 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 noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIdSaIdEEixEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) local_unnamed_addr #0 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 noundef nonnull align 8 dereferenceable(8) ptr @_ZNKSt6vectorIdSaIdEEixEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) local_unnamed_addr #0 align 2

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

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

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

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN4aabb4AABBD2Ev(ptr noundef nonnull align 8 dereferenceable(80)) unnamed_addr #3 align 2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN4aabb4Tree5queryEjRKNS_4AABBE(ptr dead_on_unwind noalias writable sret(%"class.std::vector.16") align 8 %0, ptr noundef nonnull align 8 dereferenceable(233) %1, i32 noundef %2, ptr noundef nonnull align 8 dereferenceable(80) %3) local_unnamed_addr #2 align 2 personality ptr @__gxx_personality_v0 {
  %5 = alloca %"class.std::vector.16", align 8
  %6 = alloca %"class.aabb::AABB", align 8
  %7 = alloca %"class.std::vector", align 8
  %8 = alloca %"class.std::allocator", align 1
  %9 = alloca %"class.std::vector", align 8
  %10 = alloca %"class.std::allocator", align 1
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %5) #5
  call void @_ZNSt6vectorIjSaIjEEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %5) #5
  invoke void @_ZNSt6vectorIjSaIjEE7reserveEm(ptr noundef nonnull align 8 dereferenceable(24) %5, i64 noundef 256)
          to label %11 unwind label %28

11:                                               ; preds = %4
  invoke void @_ZNSt6vectorIjSaIjEE9push_backERKj(ptr noundef nonnull align 8 dereferenceable(24) %5, ptr noundef nonnull align 4 dereferenceable(4) %1)
          to label %12 unwind label %28

12:                                               ; preds = %11
  call void @_ZNSt6vectorIjSaIjEEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %0) #5
  %13 = call noundef i64 @_ZNKSt6vectorIjSaIjEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %5) #5
  %.not42 = icmp eq i64 %13, 0
  br i1 %.not42, label %._crit_edge45, label %.lr.ph44

.lr.ph44:                                         ; preds = %12
  %14 = getelementptr inbounds i8, ptr %1, i64 8
  %15 = getelementptr inbounds i8, ptr %1, i64 48
  %16 = getelementptr inbounds i8, ptr %1, i64 44
  %17 = getelementptr inbounds i8, ptr %6, i64 48
  %18 = getelementptr inbounds i8, ptr %3, i64 48
  %19 = getelementptr inbounds i8, ptr %6, i64 24
  %20 = getelementptr inbounds i8, ptr %1, i64 232
  br label %21

21:                                               ; preds = %.lr.ph44, %95
  %22 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIjSaIjEE4backEv(ptr noundef nonnull align 8 dereferenceable(24) %5) #5
  %23 = load i32, ptr %22, align 4, !tbaa !5
  call void @_ZNSt6vectorIjSaIjEE8pop_backEv(ptr noundef nonnull align 8 dereferenceable(24) %5) #5
  call void @llvm.lifetime.start.p0(i64 80, ptr nonnull %6) #5
  %24 = zext i32 %23 to i64
  %25 = call noundef nonnull align 8 dereferenceable(104) ptr @_ZNSt6vectorIN4aabb4NodeESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %14, i64 noundef %24) #5
  invoke void @_ZN4aabb4AABBC2ERKS0_(ptr noundef nonnull align 8 dereferenceable(80) %6, ptr noundef nonnull align 8 dereferenceable(80) %25)
          to label %26 unwind label %30

26:                                               ; preds = %21
  %27 = icmp eq i32 %23, -1
  br i1 %27, label %95, label %32, !llvm.loop !9

28:                                               ; preds = %11, %4
  %29 = landingpad { ptr, i32 }
          cleanup
  br label %99

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

32:                                               ; preds = %26
  %33 = load i8, ptr %15, align 8, !tbaa !11, !range !36, !noundef !37
  %34 = trunc nuw i8 %33 to i1
  br i1 %34, label %35, label %77

35:                                               ; preds = %32
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %7) #5
  %36 = load i32, ptr %16, align 4, !tbaa !38
  %37 = zext i32 %36 to i64
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %8) #5
  call void @_ZNSaIdEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %8) #5
  invoke void @_ZNSt6vectorIdSaIdEEC2EmRKS0_(ptr noundef nonnull align 8 dereferenceable(24) %7, i64 noundef %37, ptr noundef nonnull align 1 dereferenceable(1) %8)
          to label %38 unwind label %44

38:                                               ; preds = %35
  call void @_ZNSt15__new_allocatorIdED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %8) #5
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %8) #5
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %9) #5
  %39 = load i32, ptr %16, align 4, !tbaa !38
  %40 = zext i32 %39 to i64
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %10) #5
  call void @_ZNSaIdEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %10) #5
  invoke void @_ZNSt6vectorIdSaIdEEC2EmRKS0_(ptr noundef nonnull align 8 dereferenceable(24) %9, i64 noundef %40, ptr noundef nonnull align 1 dereferenceable(1) %10)
          to label %41 unwind label %46

41:                                               ; preds = %38
  call void @_ZNSt15__new_allocatorIdED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %10) #5
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %10) #5
  %42 = load i32, ptr %16, align 4, !tbaa !38
  %.not47 = icmp eq i32 %42, 0
  br i1 %.not47, label %._crit_edge, label %.lr.ph

._crit_edge:                                      ; preds = %.lr.ph, %41
  %43 = invoke noundef zeroext i1 @_ZN4aabb4Tree12minimumImageERSt6vectorIdSaIdEES4_(ptr noundef nonnull align 8 dereferenceable(233) %1, ptr noundef nonnull align 8 dereferenceable(24) %7, ptr noundef nonnull align 8 dereferenceable(24) %9)
          to label %57 unwind label %60

44:                                               ; preds = %35
  %45 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt15__new_allocatorIdED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %8) #5
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %8) #5
  br label %76

46:                                               ; preds = %38
  %47 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt15__new_allocatorIdED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %10) #5
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %10) #5
  br label %75

.lr.ph:                                           ; preds = %41, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ 0, %41 ]
  %48 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIdSaIdEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %17, i64 noundef %indvars.iv) #5
  %49 = load double, ptr %48, align 8, !tbaa !39
  %50 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNKSt6vectorIdSaIdEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %18, i64 noundef %indvars.iv) #5
  %51 = load double, ptr %50, align 8, !tbaa !39
  %52 = fsub double %49, %51
  %53 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIdSaIdEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %7, i64 noundef %indvars.iv) #5
  store double %52, ptr %53, align 8, !tbaa !39
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %54 = load i32, ptr %16, align 4, !tbaa !38
  %55 = zext i32 %54 to i64
  %56 = icmp ult i64 %indvars.iv.next, %55
  br i1 %56, label %.lr.ph, label %._crit_edge, !llvm.loop !40

57:                                               ; preds = %._crit_edge
  %58 = load i32, ptr %16, align 4
  %59 = icmp ne i32 %58, 0
  %or.cond = select i1 %43, i1 %59, i1 false
  br i1 %or.cond, label %.lr.ph41, label %.loopexit

60:                                               ; preds = %._crit_edge
  %61 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt6vectorIdSaIdEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %9) #5
  br label %75

.lr.ph41:                                         ; preds = %57, %.lr.ph41
  %indvars.iv49 = phi i64 [ %indvars.iv.next50, %.lr.ph41 ], [ 0, %57 ]
  %62 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIdSaIdEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %9, i64 noundef %indvars.iv49) #5
  %63 = load double, ptr %62, align 8, !tbaa !39
  %64 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIdSaIdEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %6, i64 noundef %indvars.iv49) #5
  %65 = load double, ptr %64, align 8, !tbaa !39
  %66 = fadd double %63, %65
  store double %66, ptr %64, align 8, !tbaa !39
  %67 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIdSaIdEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %9, i64 noundef %indvars.iv49) #5
  %68 = load double, ptr %67, align 8, !tbaa !39
  %69 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIdSaIdEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %19, i64 noundef %indvars.iv49) #5
  %70 = load double, ptr %69, align 8, !tbaa !39
  %71 = fadd double %68, %70
  store double %71, ptr %69, align 8, !tbaa !39
  %indvars.iv.next50 = add nuw nsw i64 %indvars.iv49, 1
  %72 = load i32, ptr %16, align 4, !tbaa !38
  %73 = zext i32 %72 to i64
  %74 = icmp ult i64 %indvars.iv.next50, %73
  br i1 %74, label %.lr.ph41, label %.loopexit, !llvm.loop !41

.loopexit:                                        ; preds = %.lr.ph41, %57
  call void @_ZNSt6vectorIdSaIdEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %9) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %9) #5
  call void @_ZNSt6vectorIdSaIdEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %7) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %7) #5
  br label %77

75:                                               ; preds = %60, %46
  %.pn = phi { ptr, i32 } [ %61, %60 ], [ %47, %46 ]
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %9) #5
  call void @_ZNSt6vectorIdSaIdEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %7) #5
  br label %76

76:                                               ; preds = %75, %44
  %.pn.pn = phi { ptr, i32 } [ %.pn, %75 ], [ %45, %44 ]
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %7) #5
  br label %97

77:                                               ; preds = %.loopexit, %32
  %78 = load i8, ptr %20, align 8, !tbaa !42, !range !36, !noundef !37
  %79 = trunc nuw i8 %78 to i1
  %80 = call noundef zeroext i1 @_ZNK4aabb4AABB8overlapsERKS0_b(ptr noundef nonnull align 8 dereferenceable(80) %3, ptr noundef nonnull align 8 dereferenceable(80) %6, i1 noundef zeroext %79)
  br i1 %80, label %81, label %95

81:                                               ; preds = %77
  %82 = call noundef nonnull align 8 dereferenceable(104) ptr @_ZNSt6vectorIN4aabb4NodeESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %14, i64 noundef %24) #5
  %83 = call noundef zeroext i1 @_ZNK4aabb4Node6isLeafEv(ptr noundef nonnull align 8 dereferenceable(104) %82)
  %84 = call noundef nonnull align 8 dereferenceable(104) ptr @_ZNSt6vectorIN4aabb4NodeESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %14, i64 noundef %24) #5
  br i1 %83, label %85, label %90

85:                                               ; preds = %81
  %86 = getelementptr inbounds i8, ptr %84, i64 100
  %87 = load i32, ptr %86, align 4, !tbaa !43
  %.not34 = icmp eq i32 %87, %2
  br i1 %.not34, label %95, label %.invoke

88:                                               ; preds = %.invoke, %90
  %89 = landingpad { ptr, i32 }
          cleanup
  br label %97

90:                                               ; preds = %81
  %91 = getelementptr inbounds i8, ptr %84, i64 88
  invoke void @_ZNSt6vectorIjSaIjEE9push_backERKj(ptr noundef nonnull align 8 dereferenceable(24) %5, ptr noundef nonnull align 4 dereferenceable(4) %91)
          to label %.invoke unwind label %88

.invoke:                                          ; preds = %90, %85
  %.sink52 = phi i64 [ 100, %85 ], [ 92, %90 ]
  %92 = phi ptr [ %0, %85 ], [ %5, %90 ]
  %93 = call noundef nonnull align 8 dereferenceable(104) ptr @_ZNSt6vectorIN4aabb4NodeESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %14, i64 noundef %24) #5
  %94 = getelementptr inbounds i8, ptr %93, i64 %.sink52
  invoke void @_ZNSt6vectorIjSaIjEE9push_backERKj(ptr noundef nonnull align 8 dereferenceable(24) %92, ptr noundef nonnull align 4 dereferenceable(4) %94)
          to label %95 unwind label %88

95:                                               ; preds = %.invoke, %77, %85, %26
  call void @_ZN4aabb4AABBD2Ev(ptr noundef nonnull align 8 dereferenceable(80) %6) #5
  call void @llvm.lifetime.end.p0(i64 80, ptr nonnull %6) #5
  %96 = call noundef i64 @_ZNKSt6vectorIjSaIjEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %5) #5
  %.not = icmp eq i64 %96, 0
  br i1 %.not, label %._crit_edge45, label %21

97:                                               ; preds = %88, %76
  %.pn35 = phi { ptr, i32 } [ %89, %88 ], [ %.pn.pn, %76 ]
  call void @_ZN4aabb4AABBD2Ev(ptr noundef nonnull align 8 dereferenceable(80) %6) #5
  br label %98

98:                                               ; preds = %97, %30
  %.pn35.pn = phi { ptr, i32 } [ %.pn35, %97 ], [ %31, %30 ]
  call void @llvm.lifetime.end.p0(i64 80, ptr nonnull %6) #5
  call void @_ZNSt6vectorIjSaIjEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %0) #5
  br label %99

._crit_edge45:                                    ; preds = %95, %12
  call void @_ZNSt6vectorIjSaIjEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %5) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %5) #5
  ret void

99:                                               ; preds = %98, %28
  %.pn35.pn.pn = phi { ptr, i32 } [ %.pn35.pn, %98 ], [ %29, %28 ]
  call void @_ZNSt6vectorIjSaIjEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %5) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %5) #5
  resume { ptr, i32 } %.pn35.pn.pn
}

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

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

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

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

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN4aabb4AABBC2ERKS0_(ptr noundef nonnull align 8 dereferenceable(80), ptr noundef nonnull align 8 dereferenceable(80)) unnamed_addr #4 align 2

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt15__new_allocatorIdED2Ev(ptr noundef nonnull align 1 dereferenceable(1)) 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 uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { inlinehint mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { inlinehint mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { nounwind }

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = !{!12, !18, i64 48}
!12 = !{!"_ZTSN4aabb4TreeE", !6, i64 0, !13, i64 8, !6, i64 32, !6, i64 36, !6, i64 40, !6, i64 44, !18, i64 48, !19, i64 56, !20, i64 64, !26, i64 104, !26, i64 128, !26, i64 152, !30, i64 176, !18, i64 232}
!13 = !{!"_ZTSSt6vectorIN4aabb4NodeESaIS1_EE", !14, i64 0}
!14 = !{!"_ZTSSt12_Vector_baseIN4aabb4NodeESaIS1_EE", !15, i64 0}
!15 = !{!"_ZTSNSt12_Vector_baseIN4aabb4NodeESaIS1_EE12_Vector_implE", !16, i64 0}
!16 = !{!"_ZTSNSt12_Vector_baseIN4aabb4NodeESaIS1_EE17_Vector_impl_dataE", !17, i64 0, !17, i64 8, !17, i64 16}
!17 = !{!"any pointer", !7, i64 0}
!18 = !{!"bool", !7, i64 0}
!19 = !{!"double", !7, i64 0}
!20 = !{!"_ZTSSt6vectorIbSaIbEE", !21, i64 0}
!21 = !{!"_ZTSSt13_Bvector_baseISaIbEE", !22, i64 0}
!22 = !{!"_ZTSNSt13_Bvector_baseISaIbEE13_Bvector_implE", !23, i64 0}
!23 = !{!"_ZTSNSt13_Bvector_baseISaIbEE18_Bvector_impl_dataE", !24, i64 0, !24, i64 16, !17, i64 32}
!24 = !{!"_ZTSSt13_Bit_iterator", !25, i64 0}
!25 = !{!"_ZTSSt18_Bit_iterator_base", !17, i64 0, !6, i64 8}
!26 = !{!"_ZTSSt6vectorIdSaIdEE", !27, i64 0}
!27 = !{!"_ZTSSt12_Vector_baseIdSaIdEE", !28, i64 0}
!28 = !{!"_ZTSNSt12_Vector_baseIdSaIdEE12_Vector_implE", !29, i64 0}
!29 = !{!"_ZTSNSt12_Vector_baseIdSaIdEE17_Vector_impl_dataE", !17, i64 0, !17, i64 8, !17, i64 16}
!30 = !{!"_ZTSSt13unordered_mapIjjSt4hashIjESt8equal_toIjESaISt4pairIKjjEEE", !31, i64 0}
!31 = !{!"_ZTSSt10_HashtableIjSt4pairIKjjESaIS2_ENSt8__detail10_Select1stESt8equal_toIjESt4hashIjENS4_18_Mod_range_hashingENS4_20_Default_ranged_hashENS4_20_Prime_rehash_policyENS4_17_Hashtable_traitsILb0ELb0ELb1EEEE", !17, i64 0, !32, i64 8, !33, i64 16, !32, i64 24, !34, i64 32, !17, i64 48}
!32 = !{!"long", !7, i64 0}
!33 = !{!"_ZTSNSt8__detail15_Hash_node_baseE", !17, i64 0}
!34 = !{!"_ZTSNSt8__detail20_Prime_rehash_policyE", !35, i64 0, !32, i64 8}
!35 = !{!"float", !7, i64 0}
!36 = !{i8 0, i8 2}
!37 = !{}
!38 = !{!12, !6, i64 44}
!39 = !{!19, !19, i64 0}
!40 = distinct !{!40, !10}
!41 = distinct !{!41, !10}
!42 = !{!12, !18, i64 232}
!43 = !{!44, !6, i64 100}
!44 = !{!"_ZTSN4aabb4NodeE", !45, i64 0, !6, i64 80, !6, i64 84, !6, i64 88, !6, i64 92, !6, i64 96, !6, i64 100}
!45 = !{!"_ZTSN4aabb4AABBE", !26, i64 0, !26, i64 24, !26, i64 48, !19, i64 72}


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