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

; 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.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::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::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 }
%"class.aabb::AABB" = type { %"class.std::vector", %"class.std::vector", %"class.std::vector", double }

@.str.1 = external hidden unnamed_addr constant [84 x i8], align 1
@.str.17 = external hidden unnamed_addr constant [20 x i8], align 1
@.str.18 = external hidden unnamed_addr constant [21 x i8], align 1
@.str.29 = external hidden unnamed_addr constant [32 x i8], align 1
@__PRETTY_FUNCTION__._ZNK4aabb4Tree17validateStructureEj = external hidden unnamed_addr constant [55 x i8], align 1
@.str.30 = external hidden unnamed_addr constant [18 x i8], align 1
@.str.31 = external hidden unnamed_addr constant [19 x i8], align 1
@.str.32 = external hidden unnamed_addr constant [24 x i8], align 1
@.str.33 = external hidden unnamed_addr constant [27 x i8], align 1
@.str.34 = external hidden unnamed_addr constant [28 x i8], align 1

; Function Attrs: noreturn nounwind
declare void @__assert_fail(ptr noundef, ptr noundef, i32 noundef, 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: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZNK4aabb4Node6isLeafEv(ptr noundef nonnull align 8 dereferenceable(104)) #2 align 2

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZNK4aabb4Tree17validateStructureEj(ptr noundef nonnull align 8 dereferenceable(233) %0, i32 noundef %1) #3 align 2 {
  %3 = alloca ptr, align 8
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  store ptr %0, ptr %3, align 8, !tbaa !5
  store i32 %1, ptr %4, align 4, !tbaa !9
  %8 = load ptr, ptr %3, align 8
  %9 = load i32, ptr %4, align 4, !tbaa !9
  %10 = icmp eq i32 %9, -1
  br i1 %10, label %11, label %12

11:                                               ; preds = %2
  br label %116

12:                                               ; preds = %2
  %13 = load i32, ptr %4, align 4, !tbaa !9
  %14 = getelementptr inbounds %"class.aabb::Tree", ptr %8, i32 0, i32 0
  %15 = load i32, ptr %14, align 8, !tbaa !11
  %16 = icmp eq i32 %13, %15
  br i1 %16, label %17, label %29

17:                                               ; preds = %12
  %18 = getelementptr inbounds %"class.aabb::Tree", ptr %8, i32 0, i32 2
  %19 = load i32, ptr %4, align 4, !tbaa !9
  %20 = zext i32 %19 to i64
  %21 = call noundef nonnull align 8 dereferenceable(104) ptr @_ZNKSt6vectorIN4aabb4NodeESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %18, i64 noundef %20) #4
  %22 = getelementptr inbounds %"struct.aabb::Node", ptr %21, i32 0, i32 1
  %23 = load i32, ptr %22, align 8, !tbaa !35
  %24 = icmp eq i32 %23, -1
  br i1 %24, label %25, label %26

25:                                               ; preds = %17
  br label %28

26:                                               ; preds = %17
  call void @__assert_fail(ptr noundef @.str.29, ptr noundef @.str.1, i32 noundef 1134, ptr noundef @__PRETTY_FUNCTION__._ZNK4aabb4Tree17validateStructureEj) #5
  unreachable

27:                                               ; No predecessors!
  br label %28

28:                                               ; preds = %27, %25
  br label %29

29:                                               ; preds = %28, %12
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #4
  %30 = getelementptr inbounds %"class.aabb::Tree", ptr %8, i32 0, i32 2
  %31 = load i32, ptr %4, align 4, !tbaa !9
  %32 = zext i32 %31 to i64
  %33 = call noundef nonnull align 8 dereferenceable(104) ptr @_ZNKSt6vectorIN4aabb4NodeESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %30, i64 noundef %32) #4
  %34 = getelementptr inbounds %"struct.aabb::Node", ptr %33, i32 0, i32 3
  %35 = load i32, ptr %34, align 8, !tbaa !38
  store i32 %35, ptr %5, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #4
  %36 = getelementptr inbounds %"class.aabb::Tree", ptr %8, i32 0, i32 2
  %37 = load i32, ptr %4, align 4, !tbaa !9
  %38 = zext i32 %37 to i64
  %39 = call noundef nonnull align 8 dereferenceable(104) ptr @_ZNKSt6vectorIN4aabb4NodeESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %36, i64 noundef %38) #4
  %40 = getelementptr inbounds %"struct.aabb::Node", ptr %39, i32 0, i32 4
  %41 = load i32, ptr %40, align 4, !tbaa !39
  store i32 %41, ptr %6, align 4, !tbaa !9
  %42 = getelementptr inbounds %"class.aabb::Tree", ptr %8, i32 0, i32 2
  %43 = load i32, ptr %4, align 4, !tbaa !9
  %44 = zext i32 %43 to i64
  %45 = call noundef nonnull align 8 dereferenceable(104) ptr @_ZNKSt6vectorIN4aabb4NodeESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %42, i64 noundef %44) #4
  %46 = call noundef zeroext i1 @_ZNK4aabb4Node6isLeafEv(ptr noundef nonnull align 8 dereferenceable(104) %45)
  br i1 %46, label %47, label %71

47:                                               ; preds = %29
  %48 = load i32, ptr %5, align 4, !tbaa !9
  %49 = icmp eq i32 %48, -1
  br i1 %49, label %50, label %51

50:                                               ; preds = %47
  br label %53

51:                                               ; preds = %47
  call void @__assert_fail(ptr noundef @.str.30, ptr noundef @.str.1, i32 noundef 1141, ptr noundef @__PRETTY_FUNCTION__._ZNK4aabb4Tree17validateStructureEj) #5
  unreachable

52:                                               ; No predecessors!
  br label %53

53:                                               ; preds = %52, %50
  %54 = load i32, ptr %6, align 4, !tbaa !9
  %55 = icmp eq i32 %54, -1
  br i1 %55, label %56, label %57

56:                                               ; preds = %53
  br label %59

57:                                               ; preds = %53
  call void @__assert_fail(ptr noundef @.str.31, ptr noundef @.str.1, i32 noundef 1142, ptr noundef @__PRETTY_FUNCTION__._ZNK4aabb4Tree17validateStructureEj) #5
  unreachable

58:                                               ; No predecessors!
  br label %59

59:                                               ; preds = %58, %56
  %60 = getelementptr inbounds %"class.aabb::Tree", ptr %8, i32 0, i32 2
  %61 = load i32, ptr %4, align 4, !tbaa !9
  %62 = zext i32 %61 to i64
  %63 = call noundef nonnull align 8 dereferenceable(104) ptr @_ZNKSt6vectorIN4aabb4NodeESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %60, i64 noundef %62) #4
  %64 = getelementptr inbounds %"struct.aabb::Node", ptr %63, i32 0, i32 5
  %65 = load i32, ptr %64, align 8, !tbaa !40
  %66 = icmp eq i32 %65, 0
  br i1 %66, label %67, label %68

67:                                               ; preds = %59
  br label %70

68:                                               ; preds = %59
  call void @__assert_fail(ptr noundef @.str.32, ptr noundef @.str.1, i32 noundef 1143, ptr noundef @__PRETTY_FUNCTION__._ZNK4aabb4Tree17validateStructureEj) #5
  unreachable

69:                                               ; No predecessors!
  br label %70

70:                                               ; preds = %69, %67
  store i32 1, ptr %7, align 4
  br label %114

71:                                               ; preds = %29
  %72 = load i32, ptr %5, align 4, !tbaa !9
  %73 = getelementptr inbounds %"class.aabb::Tree", ptr %8, i32 0, i32 4
  %74 = load i32, ptr %73, align 4, !tbaa !41
  %75 = icmp ult i32 %72, %74
  br i1 %75, label %76, label %77

76:                                               ; preds = %71
  br label %79

77:                                               ; preds = %71
  call void @__assert_fail(ptr noundef @.str.17, ptr noundef @.str.1, i32 noundef 1147, ptr noundef @__PRETTY_FUNCTION__._ZNK4aabb4Tree17validateStructureEj) #5
  unreachable

78:                                               ; No predecessors!
  br label %79

79:                                               ; preds = %78, %76
  %80 = load i32, ptr %6, align 4, !tbaa !9
  %81 = getelementptr inbounds %"class.aabb::Tree", ptr %8, i32 0, i32 4
  %82 = load i32, ptr %81, align 4, !tbaa !41
  %83 = icmp ult i32 %80, %82
  br i1 %83, label %84, label %85

84:                                               ; preds = %79
  br label %87

85:                                               ; preds = %79
  call void @__assert_fail(ptr noundef @.str.18, ptr noundef @.str.1, i32 noundef 1148, ptr noundef @__PRETTY_FUNCTION__._ZNK4aabb4Tree17validateStructureEj) #5
  unreachable

86:                                               ; No predecessors!
  br label %87

87:                                               ; preds = %86, %84
  %88 = getelementptr inbounds %"class.aabb::Tree", ptr %8, i32 0, i32 2
  %89 = load i32, ptr %5, align 4, !tbaa !9
  %90 = zext i32 %89 to i64
  %91 = call noundef nonnull align 8 dereferenceable(104) ptr @_ZNKSt6vectorIN4aabb4NodeESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %88, i64 noundef %90) #4
  %92 = getelementptr inbounds %"struct.aabb::Node", ptr %91, i32 0, i32 1
  %93 = load i32, ptr %92, align 8, !tbaa !35
  %94 = load i32, ptr %4, align 4, !tbaa !9
  %95 = icmp eq i32 %93, %94
  br i1 %95, label %96, label %97

96:                                               ; preds = %87
  br label %99

97:                                               ; preds = %87
  call void @__assert_fail(ptr noundef @.str.33, ptr noundef @.str.1, i32 noundef 1150, ptr noundef @__PRETTY_FUNCTION__._ZNK4aabb4Tree17validateStructureEj) #5
  unreachable

98:                                               ; No predecessors!
  br label %99

99:                                               ; preds = %98, %96
  %100 = getelementptr inbounds %"class.aabb::Tree", ptr %8, i32 0, i32 2
  %101 = load i32, ptr %6, align 4, !tbaa !9
  %102 = zext i32 %101 to i64
  %103 = call noundef nonnull align 8 dereferenceable(104) ptr @_ZNKSt6vectorIN4aabb4NodeESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %100, i64 noundef %102) #4
  %104 = getelementptr inbounds %"struct.aabb::Node", ptr %103, i32 0, i32 1
  %105 = load i32, ptr %104, align 8, !tbaa !35
  %106 = load i32, ptr %4, align 4, !tbaa !9
  %107 = icmp eq i32 %105, %106
  br i1 %107, label %108, label %109

108:                                              ; preds = %99
  br label %111

109:                                              ; preds = %99
  call void @__assert_fail(ptr noundef @.str.34, ptr noundef @.str.1, i32 noundef 1151, ptr noundef @__PRETTY_FUNCTION__._ZNK4aabb4Tree17validateStructureEj) #5
  unreachable

110:                                              ; No predecessors!
  br label %111

111:                                              ; preds = %110, %108
  %112 = load i32, ptr %5, align 4, !tbaa !9
  call void @_ZNK4aabb4Tree17validateStructureEj(ptr noundef nonnull align 8 dereferenceable(233) %8, i32 noundef %112)
  %113 = load i32, ptr %6, align 4, !tbaa !9
  call void @_ZNK4aabb4Tree17validateStructureEj(ptr noundef nonnull align 8 dereferenceable(233) %8, i32 noundef %113)
  store i32 0, ptr %7, align 4
  br label %114

114:                                              ; preds = %111, %70
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #4
  %115 = load i32, ptr %7, align 4
  switch i32 %115, label %117 [
    i32 0, label %116
    i32 1, label %116
  ]

116:                                              ; preds = %114, %114, %11
  ret void

117:                                              ; preds = %114
  unreachable
}

attributes #0 = { noreturn 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 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { 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 = { nounwind }
attributes #5 = { noreturn nounwind }

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

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


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

@.str.1 = external hidden unnamed_addr constant [84 x i8], align 1
@.str.17 = external hidden unnamed_addr constant [20 x i8], align 1
@.str.18 = external hidden unnamed_addr constant [21 x i8], align 1
@.str.29 = external hidden unnamed_addr constant [32 x i8], align 1
@__PRETTY_FUNCTION__._ZNK4aabb4Tree17validateStructureEj = external hidden unnamed_addr constant [55 x i8], align 1
@.str.30 = external hidden unnamed_addr constant [18 x i8], align 1
@.str.31 = external hidden unnamed_addr constant [19 x i8], align 1
@.str.32 = external hidden unnamed_addr constant [24 x i8], align 1
@.str.33 = external hidden unnamed_addr constant [27 x i8], align 1
@.str.34 = external hidden unnamed_addr constant [28 x i8], align 1

; Function Attrs: noreturn nounwind
declare void @__assert_fail(ptr noundef, ptr noundef, i32 noundef, ptr noundef) local_unnamed_addr #0

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

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

; Function Attrs: mustprogress nounwind uwtable
define dso_local void @_ZNK4aabb4Tree17validateStructureEj(ptr noundef nonnull align 8 dereferenceable(233) %0, i32 noundef %1) local_unnamed_addr #1 align 2 {
  %3 = icmp eq i32 %1, -1
  br i1 %3, label %.loopexit, label %.lr.ph

.lr.ph:                                           ; preds = %2
  %4 = getelementptr inbounds i8, ptr %0, i64 8
  %5 = getelementptr inbounds i8, ptr %0, i64 36
  br label %6

6:                                                ; preds = %tailrecurse, %.lr.ph
  %.tr2040 = phi i32 [ %1, %.lr.ph ], [ %21, %tailrecurse ]
  %7 = load i32, ptr %0, align 8, !tbaa !5
  %8 = icmp eq i32 %7, %.tr2040
  %9 = zext i32 %.tr2040 to i64
  br i1 %8, label %10, label %._crit_edge

10:                                               ; preds = %6
  %11 = tail call noundef nonnull align 8 dereferenceable(104) ptr @_ZNKSt6vectorIN4aabb4NodeESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %4, i64 noundef %9) #2
  %12 = getelementptr inbounds i8, ptr %11, i64 80
  %13 = load i32, ptr %12, align 8, !tbaa !33
  %14 = icmp eq i32 %13, -1
  br i1 %14, label %._crit_edge, label %15

15:                                               ; preds = %10
  tail call void @__assert_fail(ptr noundef nonnull @.str.29, ptr noundef nonnull @.str.1, i32 noundef 1134, ptr noundef nonnull @__PRETTY_FUNCTION__._ZNK4aabb4Tree17validateStructureEj) #3
  unreachable

._crit_edge:                                      ; preds = %6, %10
  %16 = tail call noundef nonnull align 8 dereferenceable(104) ptr @_ZNKSt6vectorIN4aabb4NodeESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %4, i64 noundef %9) #2
  %17 = getelementptr inbounds i8, ptr %16, i64 88
  %18 = load i32, ptr %17, align 8, !tbaa !36
  %19 = tail call noundef nonnull align 8 dereferenceable(104) ptr @_ZNKSt6vectorIN4aabb4NodeESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %4, i64 noundef %9) #2
  %20 = getelementptr inbounds i8, ptr %19, i64 92
  %21 = load i32, ptr %20, align 4, !tbaa !37
  %22 = tail call noundef nonnull align 8 dereferenceable(104) ptr @_ZNKSt6vectorIN4aabb4NodeESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %4, i64 noundef %9) #2
  %23 = tail call noundef zeroext i1 @_ZNK4aabb4Node6isLeafEv(ptr noundef nonnull align 8 dereferenceable(104) %22)
  br i1 %23, label %24, label %36

24:                                               ; preds = %._crit_edge
  %25 = icmp eq i32 %18, -1
  br i1 %25, label %27, label %26

26:                                               ; preds = %24
  tail call void @__assert_fail(ptr noundef nonnull @.str.30, ptr noundef nonnull @.str.1, i32 noundef 1141, ptr noundef nonnull @__PRETTY_FUNCTION__._ZNK4aabb4Tree17validateStructureEj) #3
  unreachable

27:                                               ; preds = %24
  %28 = icmp eq i32 %21, -1
  br i1 %28, label %30, label %29

29:                                               ; preds = %27
  tail call void @__assert_fail(ptr noundef nonnull @.str.31, ptr noundef nonnull @.str.1, i32 noundef 1142, ptr noundef nonnull @__PRETTY_FUNCTION__._ZNK4aabb4Tree17validateStructureEj) #3
  unreachable

30:                                               ; preds = %27
  %31 = tail call noundef nonnull align 8 dereferenceable(104) ptr @_ZNKSt6vectorIN4aabb4NodeESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %4, i64 noundef %9) #2
  %32 = getelementptr inbounds i8, ptr %31, i64 96
  %33 = load i32, ptr %32, align 8, !tbaa !38
  %34 = icmp eq i32 %33, 0
  br i1 %34, label %.loopexit, label %35

35:                                               ; preds = %30
  tail call void @__assert_fail(ptr noundef nonnull @.str.32, ptr noundef nonnull @.str.1, i32 noundef 1143, ptr noundef nonnull @__PRETTY_FUNCTION__._ZNK4aabb4Tree17validateStructureEj) #3
  unreachable

36:                                               ; preds = %._crit_edge
  %37 = load i32, ptr %5, align 4, !tbaa !39
  %38 = icmp ult i32 %18, %37
  br i1 %38, label %40, label %39

39:                                               ; preds = %36
  tail call void @__assert_fail(ptr noundef nonnull @.str.17, ptr noundef nonnull @.str.1, i32 noundef 1147, ptr noundef nonnull @__PRETTY_FUNCTION__._ZNK4aabb4Tree17validateStructureEj) #3
  unreachable

40:                                               ; preds = %36
  %41 = icmp ult i32 %21, %37
  br i1 %41, label %43, label %42

42:                                               ; preds = %40
  tail call void @__assert_fail(ptr noundef nonnull @.str.18, ptr noundef nonnull @.str.1, i32 noundef 1148, ptr noundef nonnull @__PRETTY_FUNCTION__._ZNK4aabb4Tree17validateStructureEj) #3
  unreachable

43:                                               ; preds = %40
  %44 = zext i32 %18 to i64
  %45 = tail call noundef nonnull align 8 dereferenceable(104) ptr @_ZNKSt6vectorIN4aabb4NodeESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %4, i64 noundef %44) #2
  %46 = getelementptr inbounds i8, ptr %45, i64 80
  %47 = load i32, ptr %46, align 8, !tbaa !33
  %48 = icmp eq i32 %47, %.tr2040
  br i1 %48, label %50, label %49

49:                                               ; preds = %43
  tail call void @__assert_fail(ptr noundef nonnull @.str.33, ptr noundef nonnull @.str.1, i32 noundef 1150, ptr noundef nonnull @__PRETTY_FUNCTION__._ZNK4aabb4Tree17validateStructureEj) #3
  unreachable

50:                                               ; preds = %43
  %51 = zext i32 %21 to i64
  %52 = tail call noundef nonnull align 8 dereferenceable(104) ptr @_ZNKSt6vectorIN4aabb4NodeESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %4, i64 noundef %51) #2
  %53 = getelementptr inbounds i8, ptr %52, i64 80
  %54 = load i32, ptr %53, align 8, !tbaa !33
  %55 = icmp eq i32 %54, %.tr2040
  br i1 %55, label %tailrecurse, label %56

56:                                               ; preds = %50
  tail call void @__assert_fail(ptr noundef nonnull @.str.34, ptr noundef nonnull @.str.1, i32 noundef 1151, ptr noundef nonnull @__PRETTY_FUNCTION__._ZNK4aabb4Tree17validateStructureEj) #3
  unreachable

tailrecurse:                                      ; preds = %50
  tail call void @_ZNK4aabb4Tree17validateStructureEj(ptr noundef nonnull align 8 dereferenceable(233) %0, i32 noundef %18)
  br label %6

.loopexit:                                        ; preds = %2, %30
  ret void
}

attributes #0 = { noreturn 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 nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { nounwind }
attributes #3 = { noreturn nounwind }

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

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


; Effective O3 passes: EarlyCSEPass,GVNPass,GlobalOptPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LICMPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,PostOrderFunctionAttrsPass,SROAPass,SimplifyCFGPass,TailCallElimPass