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

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

%"class.Maths::TVector3" = type { float, float, float }
%"class.Maths::TAABB3" = type { %"class.Maths::TVector3", %"class.Maths::TVector3" }
%"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 }

@.str.1 = external hidden unnamed_addr constant [89 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [39 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [25 x i8], align 1
@__PRETTY_FUNCTION__._ZN7Riemann15DynamicAABBTree6UpdateEiRKN5Maths6TAABB3IfEERKNS1_8TVector3IfEE = external hidden unnamed_addr constant [74 x i8], align 1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(49) ptr @_ZNSt6vectorIN7Riemann15DynamicAABBTree4NodeESaIS2_EEixEm(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.start.p0(i64 immarg, ptr nocapture) #1

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

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN5Maths8TVector3IfEC2Efff(ptr noundef nonnull align 4 dereferenceable(12), float noundef, float noundef, float noundef) unnamed_addr #2 align 2

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN7Riemann15DynamicAABBTree10InsertLeafEi(ptr noundef nonnull align 8 dereferenceable(44), i32 noundef) #5 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN7Riemann15DynamicAABBTree10RemoveLeafEi(ptr noundef nonnull align 8 dereferenceable(44), i32 noundef) #5 align 2

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

25:                                               ; preds = %4
  %26 = load i32, ptr %7, align 4, !tbaa !9
  %27 = getelementptr inbounds %"class.Riemann::DynamicAABBTree", ptr %22, i32 0, i32 4
  %28 = load i32, ptr %27, align 4, !tbaa !11
  %29 = icmp slt i32 %26, %28
  br label %30

30:                                               ; preds = %25, %4
  %31 = phi i1 [ false, %4 ], [ %29, %25 ]
  br i1 %31, label %32, label %33

32:                                               ; preds = %30
  br label %35

33:                                               ; preds = %30
  call void @__assert_fail(ptr noundef @.str.3, ptr noundef @.str.1, i32 noundef 462, ptr noundef @__PRETTY_FUNCTION__._ZN7Riemann15DynamicAABBTree6UpdateEiRKN5Maths6TAABB3IfEERKNS1_8TVector3IfEE) #6
  unreachable

34:                                               ; No predecessors!
  br label %35

35:                                               ; preds = %34, %32
  %36 = getelementptr inbounds %"class.Riemann::DynamicAABBTree", ptr %22, i32 0, i32 2
  %37 = load i32, ptr %7, align 4, !tbaa !9
  %38 = sext i32 %37 to i64
  %39 = call noundef nonnull align 8 dereferenceable(49) ptr @_ZNSt6vectorIN7Riemann15DynamicAABBTree4NodeESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %36, i64 noundef %38) #7
  %40 = call noundef zeroext i1 @_ZNK7Riemann15DynamicAABBTree4Node6IsLeafEv(ptr noundef nonnull align 8 dereferenceable(49) %39)
  br i1 %40, label %41, label %42

41:                                               ; preds = %35
  br label %44

42:                                               ; preds = %35
  call void @__assert_fail(ptr noundef @.str.4, ptr noundef @.str.1, i32 noundef 463, ptr noundef @__PRETTY_FUNCTION__._ZN7Riemann15DynamicAABBTree6UpdateEiRKN5Maths6TAABB3IfEERKNS1_8TVector3IfEE) #6
  unreachable

43:                                               ; No predecessors!
  br label %44

44:                                               ; preds = %43, %41
  call void @llvm.lifetime.start.p0(i64 12, ptr %10) #7
  call void @_ZN5Maths8TVector3IfEC2Efff(ptr noundef nonnull align 4 dereferenceable(12) %10, float noundef 0x3FB99999A0000000, float noundef 0x3FB99999A0000000, float noundef 0x3FB99999A0000000)
  call void @llvm.lifetime.start.p0(i64 24, ptr %11) #7
  call void @llvm.lifetime.start.p0(i64 12, ptr %12) #7
  %45 = load ptr, ptr %8, align 8, !tbaa !5
  %46 = getelementptr inbounds %"class.Maths::TAABB3", ptr %45, i32 0, i32 0
  call void @_ZNK5Maths8TVector3IfEmiERKS1_(ptr dead_on_unwind writable sret(%"class.Maths::TVector3") align 4 %12, ptr noundef nonnull align 4 dereferenceable(12) %46, ptr noundef nonnull align 4 dereferenceable(12) %10)
  call void @llvm.lifetime.start.p0(i64 12, ptr %13) #7
  %47 = load ptr, ptr %8, align 8, !tbaa !5
  %48 = getelementptr inbounds %"class.Maths::TAABB3", ptr %47, i32 0, i32 1
  call void @_ZNK5Maths8TVector3IfEplERKS1_(ptr dead_on_unwind writable sret(%"class.Maths::TVector3") align 4 %13, ptr noundef nonnull align 4 dereferenceable(12) %48, ptr noundef nonnull align 4 dereferenceable(12) %10)
  call void @_ZN5Maths6TAABB3IfEC2ERKNS_8TVector3IfEES5_(ptr noundef nonnull align 4 dereferenceable(24) %11, ptr noundef nonnull align 4 dereferenceable(12) %12, ptr noundef nonnull align 4 dereferenceable(12) %13)
  call void @llvm.lifetime.end.p0(i64 12, ptr %13) #7
  call void @llvm.lifetime.end.p0(i64 12, ptr %12) #7
  call void @llvm.lifetime.start.p0(i64 12, ptr %14) #7
  %49 = load ptr, ptr %9, align 8, !tbaa !5
  call void @_ZN5MathsmlIfEENS_8TVector3IT_EES2_RKS3_(ptr dead_on_unwind writable sret(%"class.Maths::TVector3") align 4 %14, float noundef 4.000000e+00, ptr noundef nonnull align 4 dereferenceable(12) %49)
  %50 = getelementptr inbounds %"class.Maths::TVector3", ptr %14, i32 0, i32 0
  %51 = load float, ptr %50, align 4, !tbaa !17
  %52 = fcmp olt float %51, 0.000000e+00
  br i1 %52, label %53, label %60

53:                                               ; preds = %44
  %54 = getelementptr inbounds %"class.Maths::TVector3", ptr %14, i32 0, i32 0
  %55 = load float, ptr %54, align 4, !tbaa !17
  %56 = getelementptr inbounds %"class.Maths::TAABB3", ptr %11, i32 0, i32 0
  %57 = getelementptr inbounds %"class.Maths::TVector3", ptr %56, i32 0, i32 0
  %58 = load float, ptr %57, align 4, !tbaa !20
  %59 = fadd float %58, %55
  store float %59, ptr %57, align 4, !tbaa !20
  br label %67

60:                                               ; preds = %44
  %61 = getelementptr inbounds %"class.Maths::TVector3", ptr %14, i32 0, i32 0
  %62 = load float, ptr %61, align 4, !tbaa !17
  %63 = getelementptr inbounds %"class.Maths::TAABB3", ptr %11, i32 0, i32 1
  %64 = getelementptr inbounds %"class.Maths::TVector3", ptr %63, i32 0, i32 0
  %65 = load float, ptr %64, align 4, !tbaa !22
  %66 = fadd float %65, %62
  store float %66, ptr %64, align 4, !tbaa !22
  br label %67

67:                                               ; preds = %60, %53
  %68 = getelementptr inbounds %"class.Maths::TVector3", ptr %14, i32 0, i32 1
  %69 = load float, ptr %68, align 4, !tbaa !23
  %70 = fcmp olt float %69, 0.000000e+00
  br i1 %70, label %71, label %78

71:                                               ; preds = %67
  %72 = getelementptr inbounds %"class.Maths::TVector3", ptr %14, i32 0, i32 1
  %73 = load float, ptr %72, align 4, !tbaa !23
  %74 = getelementptr inbounds %"class.Maths::TAABB3", ptr %11, i32 0, i32 0
  %75 = getelementptr inbounds %"class.Maths::TVector3", ptr %74, i32 0, i32 1
  %76 = load float, ptr %75, align 4, !tbaa !24
  %77 = fadd float %76, %73
  store float %77, ptr %75, align 4, !tbaa !24
  br label %85

78:                                               ; preds = %67
  %79 = getelementptr inbounds %"class.Maths::TVector3", ptr %14, i32 0, i32 1
  %80 = load float, ptr %79, align 4, !tbaa !23
  %81 = getelementptr inbounds %"class.Maths::TAABB3", ptr %11, i32 0, i32 1
  %82 = getelementptr inbounds %"class.Maths::TVector3", ptr %81, i32 0, i32 1
  %83 = load float, ptr %82, align 4, !tbaa !25
  %84 = fadd float %83, %80
  store float %84, ptr %82, align 4, !tbaa !25
  br label %85

85:                                               ; preds = %78, %71
  %86 = getelementptr inbounds %"class.Maths::TVector3", ptr %14, i32 0, i32 2
  %87 = load float, ptr %86, align 4, !tbaa !26
  %88 = fcmp olt float %87, 0.000000e+00
  br i1 %88, label %89, label %96

89:                                               ; preds = %85
  %90 = getelementptr inbounds %"class.Maths::TVector3", ptr %14, i32 0, i32 2
  %91 = load float, ptr %90, align 4, !tbaa !26
  %92 = getelementptr inbounds %"class.Maths::TAABB3", ptr %11, i32 0, i32 0
  %93 = getelementptr inbounds %"class.Maths::TVector3", ptr %92, i32 0, i32 2
  %94 = load float, ptr %93, align 4, !tbaa !27
  %95 = fadd float %94, %91
  store float %95, ptr %93, align 4, !tbaa !27
  br label %103

96:                                               ; preds = %85
  %97 = getelementptr inbounds %"class.Maths::TVector3", ptr %14, i32 0, i32 2
  %98 = load float, ptr %97, align 4, !tbaa !26
  %99 = getelementptr inbounds %"class.Maths::TAABB3", ptr %11, i32 0, i32 1
  %100 = getelementptr inbounds %"class.Maths::TVector3", ptr %99, i32 0, i32 2
  %101 = load float, ptr %100, align 4, !tbaa !28
  %102 = fadd float %101, %98
  store float %102, ptr %100, align 4, !tbaa !28
  br label %103

103:                                              ; preds = %96, %89
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #7
  %104 = getelementptr inbounds %"class.Riemann::DynamicAABBTree", ptr %22, i32 0, i32 2
  %105 = load i32, ptr %7, align 4, !tbaa !9
  %106 = sext i32 %105 to i64
  %107 = call noundef nonnull align 8 dereferenceable(49) ptr @_ZNSt6vectorIN7Riemann15DynamicAABBTree4NodeESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %104, i64 noundef %106) #7
  %108 = getelementptr inbounds %"struct.Riemann::DynamicAABBTree::Node", ptr %107, i32 0, i32 1
  store ptr %108, ptr %15, align 8, !tbaa !5
  %109 = load ptr, ptr %15, align 8, !tbaa !5
  %110 = load ptr, ptr %8, align 8, !tbaa !5
  %111 = call noundef zeroext i1 @_ZNK5Maths6TAABB3IfE8IsInsideERKS1_(ptr noundef nonnull align 4 dereferenceable(24) %109, ptr noundef nonnull align 4 dereferenceable(24) %110)
  br i1 %111, label %112, label %122

112:                                              ; preds = %103
  call void @llvm.lifetime.start.p0(i64 24, ptr %16) #7
  call void @llvm.lifetime.start.p0(i64 12, ptr %17) #7
  %113 = getelementptr inbounds %"class.Maths::TAABB3", ptr %11, i32 0, i32 0
  call void @llvm.lifetime.start.p0(i64 12, ptr %18) #7
  call void @_ZN5MathsmlIfEENS_8TVector3IT_EES2_RKS3_(ptr dead_on_unwind writable sret(%"class.Maths::TVector3") align 4 %18, float noundef 4.000000e+00, ptr noundef nonnull align 4 dereferenceable(12) %10)
  call void @_ZNK5Maths8TVector3IfEmiERKS1_(ptr dead_on_unwind writable sret(%"class.Maths::TVector3") align 4 %17, ptr noundef nonnull align 4 dereferenceable(12) %113, ptr noundef nonnull align 4 dereferenceable(12) %18)
  call void @llvm.lifetime.start.p0(i64 12, ptr %19) #7
  %114 = getelementptr inbounds %"class.Maths::TAABB3", ptr %11, i32 0, i32 1
  call void @llvm.lifetime.start.p0(i64 12, ptr %20) #7
  call void @_ZN5MathsmlIfEENS_8TVector3IT_EES2_RKS3_(ptr dead_on_unwind writable sret(%"class.Maths::TVector3") align 4 %20, float noundef 4.000000e+00, ptr noundef nonnull align 4 dereferenceable(12) %10)
  call void @_ZNK5Maths8TVector3IfEplERKS1_(ptr dead_on_unwind writable sret(%"class.Maths::TVector3") align 4 %19, ptr noundef nonnull align 4 dereferenceable(12) %114, ptr noundef nonnull align 4 dereferenceable(12) %20)
  call void @_ZN5Maths6TAABB3IfEC2ERKNS_8TVector3IfEES5_(ptr noundef nonnull align 4 dereferenceable(24) %16, ptr noundef nonnull align 4 dereferenceable(12) %17, ptr noundef nonnull align 4 dereferenceable(12) %19)
  call void @llvm.lifetime.end.p0(i64 12, ptr %20) #7
  call void @llvm.lifetime.end.p0(i64 12, ptr %19) #7
  call void @llvm.lifetime.end.p0(i64 12, ptr %18) #7
  call void @llvm.lifetime.end.p0(i64 12, ptr %17) #7
  %115 = load ptr, ptr %15, align 8, !tbaa !5
  %116 = call noundef zeroext i1 @_ZNK5Maths6TAABB3IfE8IsInsideERKS1_(ptr noundef nonnull align 4 dereferenceable(24) %16, ptr noundef nonnull align 4 dereferenceable(24) %115)
  br i1 %116, label %117, label %118

117:                                              ; preds = %112
  store i1 false, ptr %5, align 1
  store i32 1, ptr %21, align 4
  br label %119

118:                                              ; preds = %112
  store i32 0, ptr %21, align 4
  br label %119

119:                                              ; preds = %118, %117
  call void @llvm.lifetime.end.p0(i64 24, ptr %16) #7
  %120 = load i32, ptr %21, align 4
  switch i32 %120, label %136 [
    i32 0, label %121
  ]

121:                                              ; preds = %119
  br label %122

122:                                              ; preds = %121, %103
  %123 = load i32, ptr %7, align 4, !tbaa !9
  call void @_ZN7Riemann15DynamicAABBTree10RemoveLeafEi(ptr noundef nonnull align 8 dereferenceable(44) %22, i32 noundef %123)
  %124 = getelementptr inbounds %"class.Riemann::DynamicAABBTree", ptr %22, i32 0, i32 2
  %125 = load i32, ptr %7, align 4, !tbaa !9
  %126 = sext i32 %125 to i64
  %127 = call noundef nonnull align 8 dereferenceable(49) ptr @_ZNSt6vectorIN7Riemann15DynamicAABBTree4NodeESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %124, i64 noundef %126) #7
  %128 = getelementptr inbounds %"struct.Riemann::DynamicAABBTree::Node", ptr %127, i32 0, i32 1
  %129 = call noundef nonnull align 4 dereferenceable(24) ptr @_ZN5Maths6TAABB3IfEaSERKS1_(ptr noundef nonnull align 4 dereferenceable(24) %128, ptr noundef nonnull align 4 dereferenceable(24) %11)
  %130 = load i32, ptr %7, align 4, !tbaa !9
  call void @_ZN7Riemann15DynamicAABBTree10InsertLeafEi(ptr noundef nonnull align 8 dereferenceable(44) %22, i32 noundef %130)
  %131 = getelementptr inbounds %"class.Riemann::DynamicAABBTree", ptr %22, i32 0, i32 2
  %132 = load i32, ptr %7, align 4, !tbaa !9
  %133 = sext i32 %132 to i64
  %134 = call noundef nonnull align 8 dereferenceable(49) ptr @_ZNSt6vectorIN7Riemann15DynamicAABBTree4NodeESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %131, i64 noundef %133) #7
  %135 = getelementptr inbounds %"struct.Riemann::DynamicAABBTree::Node", ptr %134, i32 0, i32 6
  store i8 1, ptr %135, align 8, !tbaa !29
  store i1 true, ptr %5, align 1
  store i32 1, ptr %21, align 4
  br label %136

136:                                              ; preds = %122, %119
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #7
  call void @llvm.lifetime.end.p0(i64 12, ptr %14) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr %11) #7
  call void @llvm.lifetime.end.p0(i64 12, ptr %10) #7
  %137 = load i1, ptr %5, align 1
  ret i1 %137
}

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

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

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

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

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"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 36}
!12 = !{!"_ZTSN7Riemann15DynamicAABBTreeE", !10, i64 0, !13, i64 8, !10, i64 32, !10, i64 36, !10, i64 40}
!13 = !{!"_ZTSSt6vectorIN7Riemann15DynamicAABBTree4NodeESaIS2_EE", !14, i64 0}
!14 = !{!"_ZTSSt12_Vector_baseIN7Riemann15DynamicAABBTree4NodeESaIS2_EE", !15, i64 0}
!15 = !{!"_ZTSNSt12_Vector_baseIN7Riemann15DynamicAABBTree4NodeESaIS2_EE12_Vector_implE", !16, i64 0}
!16 = !{!"_ZTSNSt12_Vector_baseIN7Riemann15DynamicAABBTree4NodeESaIS2_EE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!17 = !{!18, !19, i64 0}
!18 = !{!"_ZTSN5Maths8TVector3IfEE", !19, i64 0, !19, i64 4, !19, i64 8}
!19 = !{!"float", !7, i64 0}
!20 = !{!21, !19, i64 0}
!21 = !{!"_ZTSN5Maths6TAABB3IfEE", !18, i64 0, !18, i64 12}
!22 = !{!21, !19, i64 12}
!23 = !{!18, !19, i64 4}
!24 = !{!21, !19, i64 4}
!25 = !{!21, !19, i64 16}
!26 = !{!18, !19, i64 8}
!27 = !{!21, !19, i64 8}
!28 = !{!21, !19, i64 20}
!29 = !{!30, !31, i64 48}
!30 = !{!"_ZTSN7Riemann15DynamicAABBTree4NodeE", !7, i64 0, !21, i64 4, !10, i64 28, !10, i64 32, !10, i64 36, !6, i64 40, !31, i64 48}
!31 = !{!"bool", !7, i64 0}


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

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

@.str.1 = external hidden unnamed_addr constant [89 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [39 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [25 x i8], align 1
@__PRETTY_FUNCTION__._ZN7Riemann15DynamicAABBTree6UpdateEiRKN5Maths6TAABB3IfEERKNS1_8TVector3IfEE = external hidden unnamed_addr constant [74 x i8], align 1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(49) ptr @_ZNSt6vectorIN7Riemann15DynamicAABBTree4NodeESaIS2_EEixEm(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.start.p0(i64 immarg, ptr nocapture) #1

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

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN5Maths8TVector3IfEC2Efff(ptr noundef nonnull align 4 dereferenceable(12), float noundef, float noundef, float noundef) unnamed_addr #2 align 2

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN7Riemann15DynamicAABBTree10InsertLeafEi(ptr noundef nonnull align 8 dereferenceable(44), i32 noundef) local_unnamed_addr #5 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN7Riemann15DynamicAABBTree10RemoveLeafEi(ptr noundef nonnull align 8 dereferenceable(44), i32 noundef) local_unnamed_addr #5 align 2

; Function Attrs: mustprogress uwtable
define dso_local noundef zeroext i1 @_ZN7Riemann15DynamicAABBTree6UpdateEiRKN5Maths6TAABB3IfEERKNS1_8TVector3IfEE(ptr noundef nonnull align 8 dereferenceable(44) %0, i32 noundef %1, ptr noundef nonnull align 4 dereferenceable(24) %2, ptr noundef nonnull align 4 dereferenceable(12) %3) local_unnamed_addr #5 align 2 {
  %5 = alloca %"class.Maths::TVector3", align 4
  %6 = alloca %"class.Maths::TAABB3", align 4
  %7 = alloca %"class.Maths::TVector3", align 4
  %8 = alloca %"class.Maths::TVector3", align 4
  %9 = alloca %"class.Maths::TVector3", align 4
  %10 = alloca %"class.Maths::TAABB3", align 4
  %11 = alloca %"class.Maths::TVector3", align 4
  %12 = alloca %"class.Maths::TVector3", align 4
  %13 = alloca %"class.Maths::TVector3", align 4
  %14 = alloca %"class.Maths::TVector3", align 4
  %15 = icmp sgt i32 %1, -1
  %16 = getelementptr inbounds i8, ptr %0, i64 36
  %17 = load i32, ptr %16, align 4
  %18 = icmp sgt i32 %17, %1
  %or.cond = select i1 %15, i1 %18, i1 false
  br i1 %or.cond, label %19, label %.critedge

.critedge:                                        ; preds = %4
  tail call void @__assert_fail(ptr noundef nonnull @.str.3, ptr noundef nonnull @.str.1, i32 noundef 462, ptr noundef nonnull @__PRETTY_FUNCTION__._ZN7Riemann15DynamicAABBTree6UpdateEiRKN5Maths6TAABB3IfEERKNS1_8TVector3IfEE) #6
  unreachable

19:                                               ; preds = %4
  %20 = getelementptr inbounds i8, ptr %0, i64 8
  %21 = zext nneg i32 %1 to i64
  %22 = tail call noundef nonnull align 8 dereferenceable(49) ptr @_ZNSt6vectorIN7Riemann15DynamicAABBTree4NodeESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %20, i64 noundef %21) #7
  %23 = tail call noundef zeroext i1 @_ZNK7Riemann15DynamicAABBTree4Node6IsLeafEv(ptr noundef nonnull align 8 dereferenceable(49) %22)
  br i1 %23, label %25, label %24

24:                                               ; preds = %19
  tail call void @__assert_fail(ptr noundef nonnull @.str.4, ptr noundef nonnull @.str.1, i32 noundef 463, ptr noundef nonnull @__PRETTY_FUNCTION__._ZN7Riemann15DynamicAABBTree6UpdateEiRKN5Maths6TAABB3IfEERKNS1_8TVector3IfEE) #6
  unreachable

25:                                               ; preds = %19
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %5) #7
  call void @_ZN5Maths8TVector3IfEC2Efff(ptr noundef nonnull align 4 dereferenceable(12) %5, float noundef 0x3FB99999A0000000, float noundef 0x3FB99999A0000000, float noundef 0x3FB99999A0000000)
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %6) #7
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %7) #7
  call void @_ZNK5Maths8TVector3IfEmiERKS1_(ptr dead_on_unwind nonnull writable sret(%"class.Maths::TVector3") align 4 %7, ptr noundef nonnull align 4 dereferenceable(12) %2, ptr noundef nonnull align 4 dereferenceable(12) %5)
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %8) #7
  %26 = getelementptr inbounds i8, ptr %2, i64 12
  call void @_ZNK5Maths8TVector3IfEplERKS1_(ptr dead_on_unwind nonnull writable sret(%"class.Maths::TVector3") align 4 %8, ptr noundef nonnull align 4 dereferenceable(12) %26, ptr noundef nonnull align 4 dereferenceable(12) %5)
  call void @_ZN5Maths6TAABB3IfEC2ERKNS_8TVector3IfEES5_(ptr noundef nonnull align 4 dereferenceable(24) %6, ptr noundef nonnull align 4 dereferenceable(12) %7, ptr noundef nonnull align 4 dereferenceable(12) %8)
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %8) #7
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %7) #7
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %9) #7
  call void @_ZN5MathsmlIfEENS_8TVector3IT_EES2_RKS3_(ptr dead_on_unwind nonnull writable sret(%"class.Maths::TVector3") align 4 %9, float noundef 4.000000e+00, ptr noundef nonnull align 4 dereferenceable(12) %3)
  %27 = load float, ptr %9, align 4, !tbaa !5
  %28 = fcmp olt float %27, 0.000000e+00
  br i1 %28, label %29, label %32

29:                                               ; preds = %25
  %30 = load float, ptr %6, align 4, !tbaa !10
  %31 = fadd float %27, %30
  store float %31, ptr %6, align 4, !tbaa !10
  br label %36

32:                                               ; preds = %25
  %33 = getelementptr inbounds i8, ptr %6, i64 12
  %34 = load float, ptr %33, align 4, !tbaa !12
  %35 = fadd float %27, %34
  store float %35, ptr %33, align 4, !tbaa !12
  br label %36

36:                                               ; preds = %32, %29
  %37 = getelementptr inbounds i8, ptr %9, i64 4
  %38 = load float, ptr %37, align 4, !tbaa !13
  %39 = fcmp olt float %38, 0.000000e+00
  %..sroa.sel.v = select i1 %39, i64 4, i64 16
  %..sroa.sel = getelementptr inbounds i8, ptr %6, i64 %..sroa.sel.v
  %40 = load float, ptr %..sroa.sel, align 4, !tbaa !14
  %41 = fadd float %38, %40
  store float %41, ptr %..sroa.sel, align 4, !tbaa !14
  %42 = getelementptr inbounds i8, ptr %9, i64 8
  %43 = load float, ptr %42, align 4, !tbaa !15
  %44 = fcmp olt float %43, 0.000000e+00
  %.sink31.sroa.sel.v = select i1 %44, i64 8, i64 20
  %.sink31.sroa.sel = getelementptr inbounds i8, ptr %6, i64 %.sink31.sroa.sel.v
  %45 = load float, ptr %.sink31.sroa.sel, align 4, !tbaa !14
  %46 = fadd float %43, %45
  store float %46, ptr %.sink31.sroa.sel, align 4, !tbaa !14
  %47 = call noundef nonnull align 8 dereferenceable(49) ptr @_ZNSt6vectorIN7Riemann15DynamicAABBTree4NodeESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %20, i64 noundef %21) #7
  %48 = getelementptr inbounds i8, ptr %47, i64 4
  %49 = call noundef zeroext i1 @_ZNK5Maths6TAABB3IfE8IsInsideERKS1_(ptr noundef nonnull align 4 dereferenceable(24) %48, ptr noundef nonnull align 4 dereferenceable(24) %2)
  br i1 %49, label %50, label %53

50:                                               ; preds = %36
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %10) #7
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %11) #7
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %12) #7
  call void @_ZN5MathsmlIfEENS_8TVector3IT_EES2_RKS3_(ptr dead_on_unwind nonnull writable sret(%"class.Maths::TVector3") align 4 %12, float noundef 4.000000e+00, ptr noundef nonnull align 4 dereferenceable(12) %5)
  call void @_ZNK5Maths8TVector3IfEmiERKS1_(ptr dead_on_unwind nonnull writable sret(%"class.Maths::TVector3") align 4 %11, ptr noundef nonnull align 4 dereferenceable(12) %6, ptr noundef nonnull align 4 dereferenceable(12) %12)
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %13) #7
  %51 = getelementptr inbounds i8, ptr %6, i64 12
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %14) #7
  call void @_ZN5MathsmlIfEENS_8TVector3IT_EES2_RKS3_(ptr dead_on_unwind nonnull writable sret(%"class.Maths::TVector3") align 4 %14, float noundef 4.000000e+00, ptr noundef nonnull align 4 dereferenceable(12) %5)
  call void @_ZNK5Maths8TVector3IfEplERKS1_(ptr dead_on_unwind nonnull writable sret(%"class.Maths::TVector3") align 4 %13, ptr noundef nonnull align 4 dereferenceable(12) %51, ptr noundef nonnull align 4 dereferenceable(12) %14)
  call void @_ZN5Maths6TAABB3IfEC2ERKNS_8TVector3IfEES5_(ptr noundef nonnull align 4 dereferenceable(24) %10, ptr noundef nonnull align 4 dereferenceable(12) %11, ptr noundef nonnull align 4 dereferenceable(12) %13)
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %14) #7
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %13) #7
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %12) #7
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %11) #7
  %52 = call noundef zeroext i1 @_ZNK5Maths6TAABB3IfE8IsInsideERKS1_(ptr noundef nonnull align 4 dereferenceable(24) %10, ptr noundef nonnull align 4 dereferenceable(24) %48)
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %10) #7
  br i1 %52, label %59, label %53

53:                                               ; preds = %50, %36
  call void @_ZN7Riemann15DynamicAABBTree10RemoveLeafEi(ptr noundef nonnull align 8 dereferenceable(44) %0, i32 noundef %1)
  %54 = call noundef nonnull align 8 dereferenceable(49) ptr @_ZNSt6vectorIN7Riemann15DynamicAABBTree4NodeESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %20, i64 noundef %21) #7
  %55 = getelementptr inbounds i8, ptr %54, i64 4
  %56 = call noundef nonnull align 4 dereferenceable(24) ptr @_ZN5Maths6TAABB3IfEaSERKS1_(ptr noundef nonnull align 4 dereferenceable(24) %55, ptr noundef nonnull align 4 dereferenceable(24) %6)
  call void @_ZN7Riemann15DynamicAABBTree10InsertLeafEi(ptr noundef nonnull align 8 dereferenceable(44) %0, i32 noundef %1)
  %57 = call noundef nonnull align 8 dereferenceable(49) ptr @_ZNSt6vectorIN7Riemann15DynamicAABBTree4NodeESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %20, i64 noundef %21) #7
  %58 = getelementptr inbounds i8, ptr %57, i64 48
  store i8 1, ptr %58, align 8, !tbaa !16
  br label %59

59:                                               ; preds = %50, %53
  %.1 = phi i1 [ true, %53 ], [ false, %50 ]
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %9) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %6) #7
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %5) #7
  ret i1 %.1
}

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

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

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

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

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

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !7, i64 0}
!6 = !{!"_ZTSN5Maths8TVector3IfEE", !7, i64 0, !7, i64 4, !7, i64 8}
!7 = !{!"float", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!11, !7, i64 0}
!11 = !{!"_ZTSN5Maths6TAABB3IfEE", !6, i64 0, !6, i64 12}
!12 = !{!11, !7, i64 12}
!13 = !{!6, !7, i64 4}
!14 = !{!7, !7, i64 0}
!15 = !{!6, !7, i64 8}
!16 = !{!17, !20, i64 48}
!17 = !{!"_ZTSN7Riemann15DynamicAABBTree4NodeE", !8, i64 0, !11, i64 4, !18, i64 28, !18, i64 32, !18, i64 36, !19, i64 40, !20, i64 48}
!18 = !{!"int", !8, i64 0}
!19 = !{!"any pointer", !8, i64 0}
!20 = !{!"bool", !8, i64 0}


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