; LLVM IR from atlantis13579/Riemann :: Src/Collision/DynamicAABBTree.ll (ZNK7Riemann15DynamicAABBTree13ValidateAABBsEi)

; 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::TAABB3" = type { %"class.Maths::TVector3", %"class.Maths::TVector3" }
%"class.Maths::TVector3" = type { float, float, float }
%"class.Riemann::DynamicAABBTree" = type <{ i32, [4 x i8], %"class.std::vector", i32, i32, i32, [4 x i8] }>
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = 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 }
%"struct.Riemann::DynamicAABBTree::Node" = type <{ %union.anon, %"class.Maths::TAABB3", i32, i32, i32, ptr, i8, [7 x i8] }>
%union.anon = type { i32 }

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

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZNK7Riemann15DynamicAABBTree4Node6IsLeafEv(ptr noundef nonnull align 8 dereferenceable(49)) #2 align 2

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) #2

; Function Attrs: mustprogress uwtable
define dso_local noundef zeroext i1 @_ZNK7Riemann15DynamicAABBTree13ValidateAABBsEi(ptr noundef nonnull align 8 dereferenceable(44) %0, i32 noundef %1) #3 align 2 {
  %3 = alloca i1, align 1
  %4 = alloca ptr, align 8
  %5 = alloca i32, align 4
  %6 = alloca ptr, align 8
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca %"class.Maths::TAABB3", align 4
  store ptr %0, ptr %4, align 8, !tbaa !5
  store i32 %1, ptr %5, align 4, !tbaa !9
  %14 = load ptr, ptr %4, align 8
  %15 = load i32, ptr %5, align 4, !tbaa !9
  %16 = icmp eq i32 %15, -1
  br i1 %16, label %17, label %18

17:                                               ; preds = %2
  store i1 true, ptr %3, align 1
  br label %119

18:                                               ; preds = %2
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #4
  %19 = getelementptr inbounds %"class.Riemann::DynamicAABBTree", ptr %14, i32 0, i32 2
  %20 = load i32, ptr %5, align 4, !tbaa !9
  %21 = sext i32 %20 to i64
  %22 = call noundef nonnull align 8 dereferenceable(49) ptr @_ZNKSt6vectorIN7Riemann15DynamicAABBTree4NodeESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %19, i64 noundef %21) #4
  store ptr %22, ptr %6, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #4
  %23 = load ptr, ptr %6, align 8, !tbaa !5
  %24 = getelementptr inbounds %"struct.Riemann::DynamicAABBTree::Node", ptr %23, i32 0, i32 2
  %25 = load i32, ptr %24, align 4, !tbaa !11
  store i32 %25, ptr %7, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #4
  %26 = load ptr, ptr %6, align 8, !tbaa !5
  %27 = getelementptr inbounds %"struct.Riemann::DynamicAABBTree::Node", ptr %26, i32 0, i32 3
  %28 = load i32, ptr %27, align 8, !tbaa !17
  store i32 %28, ptr %8, align 4, !tbaa !9
  %29 = load ptr, ptr %6, align 8, !tbaa !5
  %30 = call noundef zeroext i1 @_ZNK7Riemann15DynamicAABBTree4Node6IsLeafEv(ptr noundef nonnull align 8 dereferenceable(49) %29)
  br i1 %30, label %31, label %44

31:                                               ; preds = %18
  %32 = load i32, ptr %7, align 4, !tbaa !9
  %33 = icmp ne i32 %32, -1
  br i1 %33, label %42, label %34

34:                                               ; preds = %31
  %35 = load i32, ptr %8, align 4, !tbaa !9
  %36 = icmp ne i32 %35, -1
  br i1 %36, label %42, label %37

37:                                               ; preds = %34
  %38 = load ptr, ptr %6, align 8, !tbaa !5
  %39 = getelementptr inbounds %"struct.Riemann::DynamicAABBTree::Node", ptr %38, i32 0, i32 4
  %40 = load i32, ptr %39, align 4, !tbaa !18
  %41 = icmp ne i32 %40, 0
  br i1 %41, label %42, label %43

42:                                               ; preds = %37, %34, %31
  store i1 false, ptr %3, align 1
  store i32 1, ptr %9, align 4
  br label %118

43:                                               ; preds = %37
  store i1 true, ptr %3, align 1
  store i32 1, ptr %9, align 4
  br label %118

44:                                               ; preds = %18
  %45 = load i32, ptr %7, align 4, !tbaa !9
  %46 = icmp sle i32 0, %45
  br i1 %46, label %47, label %52

47:                                               ; preds = %44
  %48 = load i32, ptr %7, align 4, !tbaa !9
  %49 = getelementptr inbounds %"class.Riemann::DynamicAABBTree", ptr %14, i32 0, i32 4
  %50 = load i32, ptr %49, align 4, !tbaa !19
  %51 = icmp slt i32 %48, %50
  br i1 %51, label %53, label %52

52:                                               ; preds = %47, %44
  store i1 false, ptr %3, align 1
  store i32 1, ptr %9, align 4
  br label %118

53:                                               ; preds = %47
  %54 = load i32, ptr %8, align 4, !tbaa !9
  %55 = icmp sle i32 0, %54
  br i1 %55, label %56, label %61

56:                                               ; preds = %53
  %57 = load i32, ptr %8, align 4, !tbaa !9
  %58 = getelementptr inbounds %"class.Riemann::DynamicAABBTree", ptr %14, i32 0, i32 4
  %59 = load i32, ptr %58, align 4, !tbaa !19
  %60 = icmp slt i32 %57, %59
  br i1 %60, label %62, label %61

61:                                               ; preds = %56, %53
  store i1 false, ptr %3, align 1
  store i32 1, ptr %9, align 4
  br label %118

62:                                               ; preds = %56
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #4
  %63 = getelementptr inbounds %"class.Riemann::DynamicAABBTree", ptr %14, i32 0, i32 2
  %64 = load i32, ptr %7, align 4, !tbaa !9
  %65 = sext i32 %64 to i64
  %66 = call noundef nonnull align 8 dereferenceable(49) ptr @_ZNKSt6vectorIN7Riemann15DynamicAABBTree4NodeESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %63, i64 noundef %65) #4
  %67 = getelementptr inbounds %"struct.Riemann::DynamicAABBTree::Node", ptr %66, i32 0, i32 4
  %68 = load i32, ptr %67, align 4, !tbaa !18
  store i32 %68, ptr %10, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #4
  %69 = getelementptr inbounds %"class.Riemann::DynamicAABBTree", ptr %14, i32 0, i32 2
  %70 = load i32, ptr %8, align 4, !tbaa !9
  %71 = sext i32 %70 to i64
  %72 = call noundef nonnull align 8 dereferenceable(49) ptr @_ZNKSt6vectorIN7Riemann15DynamicAABBTree4NodeESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %69, i64 noundef %71) #4
  %73 = getelementptr inbounds %"struct.Riemann::DynamicAABBTree::Node", ptr %72, i32 0, i32 4
  %74 = load i32, ptr %73, align 4, !tbaa !18
  store i32 %74, ptr %11, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #4
  %75 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %10, ptr noundef nonnull align 4 dereferenceable(4) %11)
  %76 = load i32, ptr %75, align 4, !tbaa !9
  %77 = add nsw i32 1, %76
  store i32 %77, ptr %12, align 4, !tbaa !9
  %78 = load ptr, ptr %6, align 8, !tbaa !5
  %79 = getelementptr inbounds %"struct.Riemann::DynamicAABBTree::Node", ptr %78, i32 0, i32 4
  %80 = load i32, ptr %79, align 4, !tbaa !18
  %81 = load i32, ptr %12, align 4, !tbaa !9
  %82 = icmp ne i32 %80, %81
  br i1 %82, label %83, label %84

83:                                               ; preds = %62
  store i1 false, ptr %3, align 1
  store i32 1, ptr %9, align 4
  br label %117

84:                                               ; preds = %62
  call void @llvm.lifetime.start.p0(i64 24, ptr %13) #4
  %85 = getelementptr inbounds %"class.Riemann::DynamicAABBTree", ptr %14, i32 0, i32 2
  %86 = load i32, ptr %7, align 4, !tbaa !9
  %87 = sext i32 %86 to i64
  %88 = call noundef nonnull align 8 dereferenceable(49) ptr @_ZNKSt6vectorIN7Riemann15DynamicAABBTree4NodeESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %85, i64 noundef %87) #4
  %89 = getelementptr inbounds %"struct.Riemann::DynamicAABBTree::Node", ptr %88, i32 0, i32 1
  %90 = getelementptr inbounds %"class.Riemann::DynamicAABBTree", ptr %14, i32 0, i32 2
  %91 = load i32, ptr %8, align 4, !tbaa !9
  %92 = sext i32 %91 to i64
  %93 = call noundef nonnull align 8 dereferenceable(49) ptr @_ZNKSt6vectorIN7Riemann15DynamicAABBTree4NodeESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %90, i64 noundef %92) #4
  %94 = getelementptr inbounds %"struct.Riemann::DynamicAABBTree::Node", ptr %93, i32 0, i32 1
  call void @_ZN5Maths6TAABB3IfEC2ERKS1_S3_(ptr noundef nonnull align 4 dereferenceable(24) %13, ptr noundef nonnull align 4 dereferenceable(24) %89, ptr noundef nonnull align 4 dereferenceable(24) %94)
  %95 = getelementptr inbounds %"class.Maths::TAABB3", ptr %13, i32 0, i32 0
  %96 = load ptr, ptr %6, align 8, !tbaa !5
  %97 = getelementptr inbounds %"struct.Riemann::DynamicAABBTree::Node", ptr %96, i32 0, i32 1
  %98 = getelementptr inbounds %"class.Maths::TAABB3", ptr %97, i32 0, i32 0
  %99 = call noundef zeroext i1 @_ZNK5Maths8TVector3IfEneERKS1_(ptr noundef nonnull align 4 dereferenceable(12) %95, ptr noundef nonnull align 4 dereferenceable(12) %98)
  br i1 %99, label %100, label %101

100:                                              ; preds = %84
  store i1 false, ptr %3, align 1
  store i32 1, ptr %9, align 4
  br label %116

101:                                              ; preds = %84
  %102 = getelementptr inbounds %"class.Maths::TAABB3", ptr %13, i32 0, i32 1
  %103 = load ptr, ptr %6, align 8, !tbaa !5
  %104 = getelementptr inbounds %"struct.Riemann::DynamicAABBTree::Node", ptr %103, i32 0, i32 1
  %105 = getelementptr inbounds %"class.Maths::TAABB3", ptr %104, i32 0, i32 1
  %106 = call noundef zeroext i1 @_ZNK5Maths8TVector3IfEneERKS1_(ptr noundef nonnull align 4 dereferenceable(12) %102, ptr noundef nonnull align 4 dereferenceable(12) %105)
  br i1 %106, label %107, label %108

107:                                              ; preds = %101
  store i1 false, ptr %3, align 1
  store i32 1, ptr %9, align 4
  br label %116

108:                                              ; preds = %101
  %109 = load i32, ptr %7, align 4, !tbaa !9
  %110 = call noundef zeroext i1 @_ZNK7Riemann15DynamicAABBTree13ValidateAABBsEi(ptr noundef nonnull align 8 dereferenceable(44) %14, i32 noundef %109)
  br i1 %110, label %111, label %114

111:                                              ; preds = %108
  %112 = load i32, ptr %8, align 4, !tbaa !9
  %113 = call noundef zeroext i1 @_ZNK7Riemann15DynamicAABBTree13ValidateAABBsEi(ptr noundef nonnull align 8 dereferenceable(44) %14, i32 noundef %112)
  br label %114

114:                                              ; preds = %111, %108
  %115 = phi i1 [ false, %108 ], [ %113, %111 ]
  store i1 %115, ptr %3, align 1
  store i32 1, ptr %9, align 4
  br label %116

116:                                              ; preds = %114, %107, %100
  call void @llvm.lifetime.end.p0(i64 24, ptr %13) #4
  br label %117

117:                                              ; preds = %116, %83
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #4
  br label %118

118:                                              ; preds = %117, %61, %52, %43, %42
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #4
  br label %119

119:                                              ; preds = %118, %17
  %120 = load i1, ptr %3, align 1
  ret i1 %120
}

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZNK5Maths8TVector3IfEneERKS1_(ptr noundef nonnull align 4 dereferenceable(12), ptr noundef nonnull align 4 dereferenceable(12)) #1 align 2

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { 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 = { 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 28}
!12 = !{!"_ZTSN7Riemann15DynamicAABBTree4NodeE", !7, i64 0, !13, i64 4, !10, i64 28, !10, i64 32, !10, i64 36, !6, i64 40, !16, i64 48}
!13 = !{!"_ZTSN5Maths6TAABB3IfEE", !14, i64 0, !14, i64 12}
!14 = !{!"_ZTSN5Maths8TVector3IfEE", !15, i64 0, !15, i64 4, !15, i64 8}
!15 = !{!"float", !7, i64 0}
!16 = !{!"bool", !7, i64 0}
!17 = !{!12, !10, i64 32}
!18 = !{!12, !10, i64 36}
!19 = !{!20, !10, i64 36}
!20 = !{!"_ZTSN7Riemann15DynamicAABBTreeE", !10, i64 0, !21, i64 8, !10, i64 32, !10, i64 36, !10, i64 40}
!21 = !{!"_ZTSSt6vectorIN7Riemann15DynamicAABBTree4NodeESaIS2_EE", !22, i64 0}
!22 = !{!"_ZTSSt12_Vector_baseIN7Riemann15DynamicAABBTree4NodeESaIS2_EE", !23, i64 0}
!23 = !{!"_ZTSNSt12_Vector_baseIN7Riemann15DynamicAABBTree4NodeESaIS2_EE12_Vector_implE", !24, i64 0}
!24 = !{!"_ZTSNSt12_Vector_baseIN7Riemann15DynamicAABBTree4NodeESaIS2_EE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}


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

%"class.Maths::TAABB3" = type { %"class.Maths::TVector3", %"class.Maths::TVector3" }
%"class.Maths::TVector3" = type { float, float, float }

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

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

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

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #2

; Function Attrs: mustprogress uwtable
define dso_local noundef zeroext i1 @_ZNK7Riemann15DynamicAABBTree13ValidateAABBsEi(ptr noundef nonnull align 8 dereferenceable(44) %0, i32 noundef %1) local_unnamed_addr #3 align 2 {
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca %"class.Maths::TAABB3", align 4
  %6 = icmp eq i32 %1, -1
  br i1 %6, label %61, label %7

7:                                                ; preds = %2
  %8 = getelementptr inbounds i8, ptr %0, i64 8
  %9 = sext i32 %1 to i64
  %10 = tail call noundef nonnull align 8 dereferenceable(49) ptr @_ZNKSt6vectorIN7Riemann15DynamicAABBTree4NodeESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %8, i64 noundef %9) #4
  %11 = getelementptr inbounds i8, ptr %10, i64 28
  %12 = load i32, ptr %11, align 4, !tbaa !5
  %13 = getelementptr inbounds i8, ptr %10, i64 32
  %14 = load i32, ptr %13, align 8, !tbaa !15
  %15 = tail call noundef zeroext i1 @_ZNK7Riemann15DynamicAABBTree4Node6IsLeafEv(ptr noundef nonnull align 8 dereferenceable(49) %10)
  br i1 %15, label %16, label %21

16:                                               ; preds = %7
  %17 = icmp eq i32 %12, -1
  %18 = icmp eq i32 %14, -1
  %or.cond.not34 = select i1 %17, i1 %18, i1 false
  %19 = getelementptr inbounds i8, ptr %10, i64 36
  %20 = load i32, ptr %19, align 4
  %.not28 = icmp eq i32 %20, 0
  %or.cond30 = select i1 %or.cond.not34, i1 %.not28, i1 false
  br label %61

21:                                               ; preds = %7
  %22 = icmp sgt i32 %12, -1
  br i1 %22, label %23, label %61

23:                                               ; preds = %21
  %24 = getelementptr inbounds i8, ptr %0, i64 36
  %25 = load i32, ptr %24, align 4, !tbaa !16
  %26 = icmp slt i32 %12, %25
  br i1 %26, label %27, label %61

27:                                               ; preds = %23
  %28 = icmp sgt i32 %14, -1
  %29 = icmp slt i32 %14, %25
  %or.cond31 = and i1 %28, %29
  br i1 %or.cond31, label %30, label %61

30:                                               ; preds = %27
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #4
  %31 = zext nneg i32 %12 to i64
  %32 = tail call noundef nonnull align 8 dereferenceable(49) ptr @_ZNKSt6vectorIN7Riemann15DynamicAABBTree4NodeESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %8, i64 noundef %31) #4
  %33 = getelementptr inbounds i8, ptr %32, i64 36
  %34 = load i32, ptr %33, align 4, !tbaa !22
  store i32 %34, ptr %3, align 4, !tbaa !23
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %4) #4
  %35 = zext nneg i32 %14 to i64
  %36 = tail call noundef nonnull align 8 dereferenceable(49) ptr @_ZNKSt6vectorIN7Riemann15DynamicAABBTree4NodeESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %8, i64 noundef %35) #4
  %37 = getelementptr inbounds i8, ptr %36, i64 36
  %38 = load i32, ptr %37, align 4, !tbaa !22
  store i32 %38, ptr %4, align 4, !tbaa !23
  %39 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %3, ptr noundef nonnull align 4 dereferenceable(4) %4)
  %40 = load i32, ptr %39, align 4, !tbaa !23
  %41 = add nsw i32 %40, 1
  %42 = getelementptr inbounds i8, ptr %10, i64 36
  %43 = load i32, ptr %42, align 4, !tbaa !22
  %.not = icmp eq i32 %43, %41
  br i1 %.not, label %44, label %60

44:                                               ; preds = %30
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %5) #4
  %45 = call noundef nonnull align 8 dereferenceable(49) ptr @_ZNKSt6vectorIN7Riemann15DynamicAABBTree4NodeESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %8, i64 noundef %31) #4
  %46 = getelementptr inbounds i8, ptr %45, i64 4
  %47 = call noundef nonnull align 8 dereferenceable(49) ptr @_ZNKSt6vectorIN7Riemann15DynamicAABBTree4NodeESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %8, i64 noundef %35) #4
  %48 = getelementptr inbounds i8, ptr %47, i64 4
  call void @_ZN5Maths6TAABB3IfEC2ERKS1_S3_(ptr noundef nonnull align 4 dereferenceable(24) %5, ptr noundef nonnull align 4 dereferenceable(24) %46, ptr noundef nonnull align 4 dereferenceable(24) %48)
  %49 = getelementptr inbounds i8, ptr %10, i64 4
  %50 = call noundef zeroext i1 @_ZNK5Maths8TVector3IfEneERKS1_(ptr noundef nonnull align 4 dereferenceable(12) %5, ptr noundef nonnull align 4 dereferenceable(12) %49)
  br i1 %50, label %59, label %51

51:                                               ; preds = %44
  %52 = getelementptr inbounds i8, ptr %5, i64 12
  %53 = getelementptr inbounds i8, ptr %10, i64 16
  %54 = call noundef zeroext i1 @_ZNK5Maths8TVector3IfEneERKS1_(ptr noundef nonnull align 4 dereferenceable(12) %52, ptr noundef nonnull align 4 dereferenceable(12) %53)
  br i1 %54, label %59, label %55

55:                                               ; preds = %51
  %56 = call noundef zeroext i1 @_ZNK7Riemann15DynamicAABBTree13ValidateAABBsEi(ptr noundef nonnull align 8 dereferenceable(44) %0, i32 noundef %12)
  br i1 %56, label %57, label %59

57:                                               ; preds = %55
  %58 = call noundef zeroext i1 @_ZNK7Riemann15DynamicAABBTree13ValidateAABBsEi(ptr noundef nonnull align 8 dereferenceable(44) %0, i32 noundef %14)
  br label %59

59:                                               ; preds = %55, %57, %51, %44
  %.0 = phi i1 [ false, %44 ], [ false, %51 ], [ false, %55 ], [ %58, %57 ]
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %5) #4
  br label %60

60:                                               ; preds = %30, %59
  %.1 = phi i1 [ %.0, %59 ], [ false, %30 ]
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #4
  br label %61

61:                                               ; preds = %16, %60, %23, %21, %27, %2
  %.3 = phi i1 [ true, %2 ], [ %.1, %60 ], [ false, %23 ], [ false, %21 ], [ false, %27 ], [ %or.cond30, %16 ]
  ret i1 %.3
}

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZNK5Maths8TVector3IfEneERKS1_(ptr noundef nonnull align 4 dereferenceable(12), ptr noundef nonnull align 4 dereferenceable(12)) local_unnamed_addr #1 align 2

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { 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 = { 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, !12, i64 28}
!6 = !{!"_ZTSN7Riemann15DynamicAABBTree4NodeE", !7, i64 0, !9, i64 4, !12, i64 28, !12, i64 32, !12, i64 36, !13, i64 40, !14, i64 48}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!"_ZTSN5Maths6TAABB3IfEE", !10, i64 0, !10, i64 12}
!10 = !{!"_ZTSN5Maths8TVector3IfEE", !11, i64 0, !11, i64 4, !11, i64 8}
!11 = !{!"float", !7, i64 0}
!12 = !{!"int", !7, i64 0}
!13 = !{!"any pointer", !7, i64 0}
!14 = !{!"bool", !7, i64 0}
!15 = !{!6, !12, i64 32}
!16 = !{!17, !12, i64 36}
!17 = !{!"_ZTSN7Riemann15DynamicAABBTreeE", !12, i64 0, !18, i64 8, !12, i64 32, !12, i64 36, !12, i64 40}
!18 = !{!"_ZTSSt6vectorIN7Riemann15DynamicAABBTree4NodeESaIS2_EE", !19, i64 0}
!19 = !{!"_ZTSSt12_Vector_baseIN7Riemann15DynamicAABBTree4NodeESaIS2_EE", !20, i64 0}
!20 = !{!"_ZTSNSt12_Vector_baseIN7Riemann15DynamicAABBTree4NodeESaIS2_EE12_Vector_implE", !21, i64 0}
!21 = !{!"_ZTSNSt12_Vector_baseIN7Riemann15DynamicAABBTree4NodeESaIS2_EE17_Vector_impl_dataE", !13, i64 0, !13, i64 8, !13, i64 16}
!22 = !{!6, !12, i64 36}
!23 = !{!12, !12, i64 0}


; Effective O3 passes: EarlyCSEPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,SROAPass,SimplifyCFGPass,TailCallElimPass