; 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.Riemann::StaticStack.5" = type { i32, [32 x i32] }
%"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 }
%"class.Maths::TAABB3" = type { %"class.Maths::TVector3", %"class.Maths::TVector3" }
%"class.Maths::TVector3" = type { float, float, float }

@.str = external hidden unnamed_addr constant [35 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [89 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [14 x i8], align 1
@__PRETTY_FUNCTION__._ZNK7Riemann15DynamicAABBTree5QueryERKN5Maths6TAABB3IfEEPSt6vectorIPvSaIS7_EE = external hidden unnamed_addr constant [80 x i8], align 1

; 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: mustprogress nounwind uwtable
declare dso_local void @_ZN7Riemann11StaticStackIiLi32EEC2Ev(ptr noundef nonnull align 4 dereferenceable(132)) unnamed_addr #1 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN7Riemann11StaticStackIiLi32EE4pushEi(ptr noundef nonnull align 4 dereferenceable(132), i32 noundef) #1 align 2

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZN7Riemann11StaticStackIiLi32EE3popEv(ptr noundef nonnull align 4 dereferenceable(132)) #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: noreturn nounwind
declare void @__assert_fail(ptr noundef, ptr noundef, i32 noundef, ptr noundef) #3

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

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

; Function Attrs: mustprogress uwtable
define dso_local noundef zeroext i1 @_ZNK7Riemann15DynamicAABBTree5QueryERKN5Maths6TAABB3IfEEPSt6vectorIPvSaIS7_EE(ptr noundef nonnull align 8 dereferenceable(44) %0, ptr noundef nonnull align 4 dereferenceable(24) %1, ptr noundef %2) #4 align 2 {
  %4 = alloca i1, align 1
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca i32, align 4
  %10 = alloca %"class.Riemann::StaticStack.5", align 4
  %11 = alloca i32, align 4
  %12 = alloca ptr, align 8
  %13 = alloca ptr, align 8
  %14 = alloca ptr, align 8
  %15 = alloca i8, align 1
  %16 = alloca i8, align 1
  store ptr %0, ptr %5, align 8, !tbaa !5
  store ptr %1, ptr %6, align 8, !tbaa !5
  store ptr %2, ptr %7, align 8, !tbaa !5
  %17 = load ptr, ptr %5, align 8
  %18 = load ptr, ptr %7, align 8, !tbaa !5
  call void @_ZNSt6vectorIPvSaIS0_EE5clearEv(ptr noundef nonnull align 8 dereferenceable(24) %18) #5
  %19 = getelementptr inbounds %"class.Riemann::DynamicAABBTree", ptr %17, i32 0, i32 0
  %20 = load i32, ptr %19, align 8, !tbaa !9
  %21 = icmp eq i32 %20, -1
  br i1 %21, label %22, label %23

22:                                               ; preds = %3
  store i1 false, ptr %4, align 1
  br label %144

23:                                               ; preds = %3
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #5
  %24 = getelementptr inbounds %"class.Riemann::DynamicAABBTree", ptr %17, i32 0, i32 2
  %25 = getelementptr inbounds %"class.Riemann::DynamicAABBTree", ptr %17, i32 0, i32 0
  %26 = load i32, ptr %25, align 8, !tbaa !9
  %27 = sext i32 %26 to i64
  %28 = call noundef nonnull align 8 dereferenceable(49) ptr @_ZNKSt6vectorIN7Riemann15DynamicAABBTree4NodeESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %24, i64 noundef %27) #5
  store ptr %28, ptr %8, align 8, !tbaa !5
  %29 = load ptr, ptr %8, align 8, !tbaa !5
  %30 = icmp eq ptr %29, null
  br i1 %30, label %40, label %31

31:                                               ; preds = %23
  %32 = load ptr, ptr %6, align 8, !tbaa !5
  %33 = load ptr, ptr %8, align 8, !tbaa !5
  %34 = getelementptr inbounds %"struct.Riemann::DynamicAABBTree::Node", ptr %33, i32 0, i32 1
  %35 = getelementptr inbounds %"class.Maths::TAABB3", ptr %34, i32 0, i32 0
  %36 = load ptr, ptr %8, align 8, !tbaa !5
  %37 = getelementptr inbounds %"struct.Riemann::DynamicAABBTree::Node", ptr %36, i32 0, i32 1
  %38 = getelementptr inbounds %"class.Maths::TAABB3", ptr %37, i32 0, i32 1
  %39 = call noundef zeroext i1 @_ZNK5Maths6TAABB3IfE9IntersectERKNS_8TVector3IfEES5_(ptr noundef nonnull align 4 dereferenceable(24) %32, ptr noundef nonnull align 4 dereferenceable(12) %35, ptr noundef nonnull align 4 dereferenceable(12) %38)
  br i1 %39, label %41, label %40

40:                                               ; preds = %31, %23
  store i1 false, ptr %4, align 1
  store i32 1, ptr %9, align 4
  br label %143

41:                                               ; preds = %31
  call void @llvm.lifetime.start.p0(i64 132, ptr %10) #5
  call void @_ZN7Riemann11StaticStackIiLi32EEC2Ev(ptr noundef nonnull align 4 dereferenceable(132) %10)
  %42 = getelementptr inbounds %"class.Riemann::DynamicAABBTree", ptr %17, i32 0, i32 0
  %43 = load i32, ptr %42, align 8, !tbaa !9
  call void @_ZN7Riemann11StaticStackIiLi32EE4pushEi(ptr noundef nonnull align 4 dereferenceable(132) %10, i32 noundef %43)
  br label %44

44:                                               ; preds = %138, %41
  %45 = call noundef zeroext i1 @_ZNK7Riemann11StaticStackIiLi32EE5emptyEv(ptr noundef nonnull align 4 dereferenceable(132) %10)
  %46 = xor i1 %45, true
  br i1 %46, label %47, label %139

47:                                               ; preds = %44
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #5
  %48 = call noundef i32 @_ZN7Riemann11StaticStackIiLi32EE3popEv(ptr noundef nonnull align 4 dereferenceable(132) %10)
  store i32 %48, ptr %11, align 4, !tbaa !16
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #5
  %49 = getelementptr inbounds %"class.Riemann::DynamicAABBTree", ptr %17, i32 0, i32 2
  %50 = load i32, ptr %11, align 4, !tbaa !16
  %51 = sext i32 %50 to i64
  %52 = call noundef nonnull align 8 dereferenceable(49) ptr @_ZNKSt6vectorIN7Riemann15DynamicAABBTree4NodeESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %49, i64 noundef %51) #5
  store ptr %52, ptr %12, align 8, !tbaa !5
  br label %53

53:                                               ; preds = %136, %47
  %54 = load ptr, ptr %12, align 8, !tbaa !5
  %55 = icmp ne ptr %54, null
  br i1 %55, label %56, label %138

56:                                               ; preds = %53
  %57 = load ptr, ptr %12, align 8, !tbaa !5
  %58 = call noundef zeroext i1 @_ZNK7Riemann15DynamicAABBTree4Node6IsLeafEv(ptr noundef nonnull align 8 dereferenceable(49) %57)
  br i1 %58, label %59, label %63

59:                                               ; preds = %56
  %60 = load ptr, ptr %7, align 8, !tbaa !5
  %61 = load ptr, ptr %12, align 8, !tbaa !5
  %62 = getelementptr inbounds %"struct.Riemann::DynamicAABBTree::Node", ptr %61, i32 0, i32 5
  call void @_ZNSt6vectorIPvSaIS0_EE9push_backERKS0_(ptr noundef nonnull align 8 dereferenceable(24) %60, ptr noundef nonnull align 8 dereferenceable(8) %62)
  br label %138

63:                                               ; preds = %56
  %64 = load ptr, ptr %12, align 8, !tbaa !5
  %65 = getelementptr inbounds %"struct.Riemann::DynamicAABBTree::Node", ptr %64, i32 0, i32 2
  %66 = load i32, ptr %65, align 4, !tbaa !17
  %67 = icmp ne i32 %66, -1
  br i1 %67, label %68, label %73

68:                                               ; preds = %63
  %69 = load ptr, ptr %12, align 8, !tbaa !5
  %70 = getelementptr inbounds %"struct.Riemann::DynamicAABBTree::Node", ptr %69, i32 0, i32 3
  %71 = load i32, ptr %70, align 8, !tbaa !23
  %72 = icmp ne i32 %71, -1
  br label %73

73:                                               ; preds = %68, %63
  %74 = phi i1 [ false, %63 ], [ %72, %68 ]
  br i1 %74, label %75, label %76

75:                                               ; preds = %73
  br label %78

76:                                               ; preds = %73
  call void @__assert_fail(ptr noundef @.str, ptr noundef @.str.1, i32 noundef 400, ptr noundef @__PRETTY_FUNCTION__._ZNK7Riemann15DynamicAABBTree5QueryERKN5Maths6TAABB3IfEEPSt6vectorIPvSaIS7_EE) #6
  unreachable

77:                                               ; No predecessors!
  br label %78

78:                                               ; preds = %77, %75
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #5
  %79 = getelementptr inbounds %"class.Riemann::DynamicAABBTree", ptr %17, i32 0, i32 2
  %80 = load ptr, ptr %12, align 8, !tbaa !5
  %81 = getelementptr inbounds %"struct.Riemann::DynamicAABBTree::Node", ptr %80, i32 0, i32 2
  %82 = load i32, ptr %81, align 4, !tbaa !17
  %83 = sext i32 %82 to i64
  %84 = call noundef nonnull align 8 dereferenceable(49) ptr @_ZNKSt6vectorIN7Riemann15DynamicAABBTree4NodeESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %79, i64 noundef %83) #5
  store ptr %84, ptr %13, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #5
  %85 = getelementptr inbounds %"class.Riemann::DynamicAABBTree", ptr %17, i32 0, i32 2
  %86 = load ptr, ptr %12, align 8, !tbaa !5
  %87 = getelementptr inbounds %"struct.Riemann::DynamicAABBTree::Node", ptr %86, i32 0, i32 3
  %88 = load i32, ptr %87, align 8, !tbaa !23
  %89 = sext i32 %88 to i64
  %90 = call noundef nonnull align 8 dereferenceable(49) ptr @_ZNKSt6vectorIN7Riemann15DynamicAABBTree4NodeESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %85, i64 noundef %89) #5
  store ptr %90, ptr %14, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 1, ptr %15) #5
  %91 = load ptr, ptr %6, align 8, !tbaa !5
  %92 = load ptr, ptr %13, align 8, !tbaa !5
  %93 = getelementptr inbounds %"struct.Riemann::DynamicAABBTree::Node", ptr %92, i32 0, i32 1
  %94 = getelementptr inbounds %"class.Maths::TAABB3", ptr %93, i32 0, i32 0
  %95 = load ptr, ptr %13, align 8, !tbaa !5
  %96 = getelementptr inbounds %"struct.Riemann::DynamicAABBTree::Node", ptr %95, i32 0, i32 1
  %97 = getelementptr inbounds %"class.Maths::TAABB3", ptr %96, i32 0, i32 1
  %98 = call noundef zeroext i1 @_ZNK5Maths6TAABB3IfE9IntersectERKNS_8TVector3IfEES5_(ptr noundef nonnull align 4 dereferenceable(24) %91, ptr noundef nonnull align 4 dereferenceable(12) %94, ptr noundef nonnull align 4 dereferenceable(12) %97)
  %99 = zext i1 %98 to i8
  store i8 %99, ptr %15, align 1, !tbaa !24
  call void @llvm.lifetime.start.p0(i64 1, ptr %16) #5
  %100 = load ptr, ptr %6, align 8, !tbaa !5
  %101 = load ptr, ptr %14, align 8, !tbaa !5
  %102 = getelementptr inbounds %"struct.Riemann::DynamicAABBTree::Node", ptr %101, i32 0, i32 1
  %103 = getelementptr inbounds %"class.Maths::TAABB3", ptr %102, i32 0, i32 0
  %104 = load ptr, ptr %14, align 8, !tbaa !5
  %105 = getelementptr inbounds %"struct.Riemann::DynamicAABBTree::Node", ptr %104, i32 0, i32 1
  %106 = getelementptr inbounds %"class.Maths::TAABB3", ptr %105, i32 0, i32 1
  %107 = call noundef zeroext i1 @_ZNK5Maths6TAABB3IfE9IntersectERKNS_8TVector3IfEES5_(ptr noundef nonnull align 4 dereferenceable(24) %100, ptr noundef nonnull align 4 dereferenceable(12) %103, ptr noundef nonnull align 4 dereferenceable(12) %106)
  %108 = zext i1 %107 to i8
  store i8 %108, ptr %16, align 1, !tbaa !24
  %109 = call noundef zeroext i1 @_ZNK7Riemann11StaticStackIiLi32EE4fullEv(ptr noundef nonnull align 4 dereferenceable(132) %10)
  %110 = xor i1 %109, true
  br i1 %110, label %111, label %112

111:                                              ; preds = %78
  br label %114

112:                                              ; preds = %78
  call void @__assert_fail(ptr noundef @.str.2, ptr noundef @.str.1, i32 noundef 407, ptr noundef @__PRETTY_FUNCTION__._ZNK7Riemann15DynamicAABBTree5QueryERKN5Maths6TAABB3IfEEPSt6vectorIPvSaIS7_EE) #6
  unreachable

113:                                              ; No predecessors!
  br label %114

114:                                              ; preds = %113, %111
  %115 = load i8, ptr %15, align 1, !tbaa !24, !range !25, !noundef !26
  %116 = trunc i8 %115 to i1
  br i1 %116, label %117, label %125

117:                                              ; preds = %114
  %118 = load i8, ptr %16, align 1, !tbaa !24, !range !25, !noundef !26
  %119 = trunc i8 %118 to i1
  br i1 %119, label %120, label %125

120:                                              ; preds = %117
  %121 = load ptr, ptr %12, align 8, !tbaa !5
  %122 = getelementptr inbounds %"struct.Riemann::DynamicAABBTree::Node", ptr %121, i32 0, i32 3
  %123 = load i32, ptr %122, align 8, !tbaa !23
  call void @_ZN7Riemann11StaticStackIiLi32EE4pushEi(ptr noundef nonnull align 4 dereferenceable(132) %10, i32 noundef %123)
  %124 = load ptr, ptr %13, align 8, !tbaa !5
  store ptr %124, ptr %12, align 8, !tbaa !5
  store i32 4, ptr %9, align 4
  br label %136, !llvm.loop !27

125:                                              ; preds = %117, %114
  %126 = load i8, ptr %15, align 1, !tbaa !24, !range !25, !noundef !26
  %127 = trunc i8 %126 to i1
  br i1 %127, label %128, label %130

128:                                              ; preds = %125
  %129 = load ptr, ptr %13, align 8, !tbaa !5
  store ptr %129, ptr %12, align 8, !tbaa !5
  store i32 4, ptr %9, align 4
  br label %136, !llvm.loop !27

130:                                              ; preds = %125
  %131 = load i8, ptr %16, align 1, !tbaa !24, !range !25, !noundef !26
  %132 = trunc i8 %131 to i1
  br i1 %132, label %133, label %135

133:                                              ; preds = %130
  %134 = load ptr, ptr %14, align 8, !tbaa !5
  store ptr %134, ptr %12, align 8, !tbaa !5
  store i32 4, ptr %9, align 4
  br label %136, !llvm.loop !27

135:                                              ; preds = %130
  store i32 5, ptr %9, align 4
  br label %136

136:                                              ; preds = %135, %133, %128, %120
  call void @llvm.lifetime.end.p0(i64 1, ptr %16) #5
  call void @llvm.lifetime.end.p0(i64 1, ptr %15) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #5
  %137 = load i32, ptr %9, align 4
  switch i32 %137, label %146 [
    i32 4, label %53
    i32 5, label %138
  ]

138:                                              ; preds = %136, %59, %53
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #5
  br label %44, !llvm.loop !29

139:                                              ; preds = %44
  %140 = load ptr, ptr %7, align 8, !tbaa !5
  %141 = call noundef zeroext i1 @_ZNKSt6vectorIPvSaIS0_EE5emptyEv(ptr noundef nonnull align 8 dereferenceable(24) %140) #5
  %142 = xor i1 %141, true
  store i1 %142, ptr %4, align 1
  store i32 1, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 132, ptr %10) #5
  br label %143

143:                                              ; preds = %139, %40
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #5
  br label %144

144:                                              ; preds = %143, %22
  %145 = load i1, ptr %4, align 1
  ret i1 %145

146:                                              ; preds = %136
  unreachable
}

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZNKSt6vectorIPvSaIS0_EE5emptyEv(ptr noundef nonnull align 8 dereferenceable(24)) #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 = { 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 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { nounwind }
attributes #6 = { 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, !11, i64 0}
!10 = !{!"_ZTSN7Riemann15DynamicAABBTreeE", !11, i64 0, !12, i64 8, !11, i64 32, !11, i64 36, !11, i64 40}
!11 = !{!"int", !7, i64 0}
!12 = !{!"_ZTSSt6vectorIN7Riemann15DynamicAABBTree4NodeESaIS2_EE", !13, i64 0}
!13 = !{!"_ZTSSt12_Vector_baseIN7Riemann15DynamicAABBTree4NodeESaIS2_EE", !14, i64 0}
!14 = !{!"_ZTSNSt12_Vector_baseIN7Riemann15DynamicAABBTree4NodeESaIS2_EE12_Vector_implE", !15, i64 0}
!15 = !{!"_ZTSNSt12_Vector_baseIN7Riemann15DynamicAABBTree4NodeESaIS2_EE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!16 = !{!11, !11, i64 0}
!17 = !{!18, !11, i64 28}
!18 = !{!"_ZTSN7Riemann15DynamicAABBTree4NodeE", !7, i64 0, !19, i64 4, !11, i64 28, !11, i64 32, !11, i64 36, !6, i64 40, !22, i64 48}
!19 = !{!"_ZTSN5Maths6TAABB3IfEE", !20, i64 0, !20, i64 12}
!20 = !{!"_ZTSN5Maths8TVector3IfEE", !21, i64 0, !21, i64 4, !21, i64 8}
!21 = !{!"float", !7, i64 0}
!22 = !{!"bool", !7, i64 0}
!23 = !{!18, !11, i64 32}
!24 = !{!22, !22, i64 0}
!25 = !{i8 0, i8 2}
!26 = !{}
!27 = distinct !{!27, !28}
!28 = !{!"llvm.loop.mustprogress"}
!29 = distinct !{!29, !28}


; 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.Riemann::StaticStack.5" = type { i32, [32 x i32] }

@.str = external hidden unnamed_addr constant [35 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [89 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [14 x i8], align 1
@__PRETTY_FUNCTION__._ZNK7Riemann15DynamicAABBTree5QueryERKN5Maths6TAABB3IfEEPSt6vectorIPvSaIS7_EE = external hidden unnamed_addr constant [80 x i8], align 1

; 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: mustprogress nounwind uwtable
declare dso_local void @_ZN7Riemann11StaticStackIiLi32EEC2Ev(ptr noundef nonnull align 4 dereferenceable(132)) unnamed_addr #1 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN7Riemann11StaticStackIiLi32EE4pushEi(ptr noundef nonnull align 4 dereferenceable(132), i32 noundef) local_unnamed_addr #1 align 2

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZN7Riemann11StaticStackIiLi32EE3popEv(ptr noundef nonnull align 4 dereferenceable(132)) 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: noreturn nounwind
declare void @__assert_fail(ptr noundef, ptr noundef, i32 noundef, ptr noundef) local_unnamed_addr #3

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

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

; Function Attrs: mustprogress uwtable
define dso_local noundef zeroext i1 @_ZNK7Riemann15DynamicAABBTree5QueryERKN5Maths6TAABB3IfEEPSt6vectorIPvSaIS7_EE(ptr noundef nonnull align 8 dereferenceable(44) %0, ptr noundef nonnull align 4 dereferenceable(24) %1, ptr noundef nonnull %2) local_unnamed_addr #4 align 2 {
  %4 = alloca %"class.Riemann::StaticStack.5", align 4
  tail call void @_ZNSt6vectorIPvSaIS0_EE5clearEv(ptr noundef nonnull align 8 dereferenceable(24) %2) #5
  %5 = load i32, ptr %0, align 8, !tbaa !5
  %6 = icmp eq i32 %5, -1
  br i1 %6, label %49, label %7

7:                                                ; preds = %3
  %8 = getelementptr inbounds i8, ptr %0, i64 8
  %9 = sext i32 %5 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) #5
  %11 = getelementptr inbounds i8, ptr %10, i64 4
  %12 = getelementptr inbounds i8, ptr %10, i64 16
  %13 = tail call noundef zeroext i1 @_ZNK5Maths6TAABB3IfE9IntersectERKNS_8TVector3IfEES5_(ptr noundef nonnull align 4 dereferenceable(24) %1, ptr noundef nonnull align 4 dereferenceable(12) %11, ptr noundef nonnull align 4 dereferenceable(12) %12)
  br i1 %13, label %14, label %49

14:                                               ; preds = %7
  call void @llvm.lifetime.start.p0(i64 132, ptr nonnull %4) #5
  call void @_ZN7Riemann11StaticStackIiLi32EEC2Ev(ptr noundef nonnull align 4 dereferenceable(132) %4)
  %15 = load i32, ptr %0, align 8, !tbaa !5
  call void @_ZN7Riemann11StaticStackIiLi32EE4pushEi(ptr noundef nonnull align 4 dereferenceable(132) %4, i32 noundef %15)
  %16 = call noundef zeroext i1 @_ZNK7Riemann11StaticStackIiLi32EE5emptyEv(ptr noundef nonnull align 4 dereferenceable(132) %4)
  br i1 %16, label %._crit_edge, label %.lr.ph

.lr.ph:                                           ; preds = %14, %.loopexit
  %17 = call noundef i32 @_ZN7Riemann11StaticStackIiLi32EE3popEv(ptr noundef nonnull align 4 dereferenceable(132) %4)
  %18 = sext i32 %17 to i64
  %19 = call noundef nonnull align 8 dereferenceable(49) ptr @_ZNKSt6vectorIN7Riemann15DynamicAABBTree4NodeESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %8, i64 noundef %18) #5
  %20 = call noundef zeroext i1 @_ZNK7Riemann15DynamicAABBTree4Node6IsLeafEv(ptr noundef nonnull align 8 dereferenceable(49) %19)
  br i1 %20, label %._crit_edge54, label %.lr.ph53

._crit_edge54:                                    ; preds = %.backedge, %.lr.ph
  %.032.lcssa = phi ptr [ %19, %.lr.ph ], [ %.032.be, %.backedge ]
  %21 = getelementptr inbounds i8, ptr %.032.lcssa, i64 40
  call void @_ZNSt6vectorIPvSaIS0_EE9push_backERKS0_(ptr noundef nonnull align 8 dereferenceable(24) %2, ptr noundef nonnull align 8 dereferenceable(8) %21)
  br label %.loopexit

.lr.ph53:                                         ; preds = %.lr.ph, %.backedge
  %.03252 = phi ptr [ %.032.be, %.backedge ], [ %19, %.lr.ph ]
  %22 = getelementptr inbounds i8, ptr %.03252, i64 28
  %23 = load i32, ptr %22, align 4, !tbaa !15
  %.not = icmp eq i32 %23, -1
  br i1 %.not, label %.critedge, label %24

24:                                               ; preds = %.lr.ph53
  %25 = getelementptr inbounds i8, ptr %.03252, i64 32
  %26 = load i32, ptr %25, align 8, !tbaa !21
  %.not36 = icmp eq i32 %26, -1
  br i1 %.not36, label %.critedge, label %27

.critedge:                                        ; preds = %.lr.ph53, %24
  call void @__assert_fail(ptr noundef nonnull @.str, ptr noundef nonnull @.str.1, i32 noundef 400, ptr noundef nonnull @__PRETTY_FUNCTION__._ZNK7Riemann15DynamicAABBTree5QueryERKN5Maths6TAABB3IfEEPSt6vectorIPvSaIS7_EE) #6
  unreachable

27:                                               ; preds = %24
  %28 = sext i32 %23 to i64
  %29 = call noundef nonnull align 8 dereferenceable(49) ptr @_ZNKSt6vectorIN7Riemann15DynamicAABBTree4NodeESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %8, i64 noundef %28) #5
  %30 = load i32, ptr %25, align 8, !tbaa !21
  %31 = sext i32 %30 to i64
  %32 = call noundef nonnull align 8 dereferenceable(49) ptr @_ZNKSt6vectorIN7Riemann15DynamicAABBTree4NodeESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %8, i64 noundef %31) #5
  %33 = getelementptr inbounds i8, ptr %29, i64 4
  %34 = getelementptr inbounds i8, ptr %29, i64 16
  %35 = call noundef zeroext i1 @_ZNK5Maths6TAABB3IfE9IntersectERKNS_8TVector3IfEES5_(ptr noundef nonnull align 4 dereferenceable(24) %1, ptr noundef nonnull align 4 dereferenceable(12) %33, ptr noundef nonnull align 4 dereferenceable(12) %34)
  %36 = getelementptr inbounds i8, ptr %32, i64 4
  %37 = getelementptr inbounds i8, ptr %32, i64 16
  %38 = call noundef zeroext i1 @_ZNK5Maths6TAABB3IfE9IntersectERKNS_8TVector3IfEES5_(ptr noundef nonnull align 4 dereferenceable(24) %1, ptr noundef nonnull align 4 dereferenceable(12) %36, ptr noundef nonnull align 4 dereferenceable(12) %37)
  %39 = call noundef zeroext i1 @_ZNK7Riemann11StaticStackIiLi32EE4fullEv(ptr noundef nonnull align 4 dereferenceable(132) %4)
  br i1 %39, label %40, label %41

40:                                               ; preds = %27
  call void @__assert_fail(ptr noundef nonnull @.str.2, ptr noundef nonnull @.str.1, i32 noundef 407, ptr noundef nonnull @__PRETTY_FUNCTION__._ZNK7Riemann15DynamicAABBTree5QueryERKN5Maths6TAABB3IfEEPSt6vectorIPvSaIS7_EE) #6
  unreachable

41:                                               ; preds = %27
  %brmerge.demorgan = and i1 %35, %38
  br i1 %brmerge.demorgan, label %42, label %44

42:                                               ; preds = %41
  %43 = load i32, ptr %25, align 8, !tbaa !21
  call void @_ZN7Riemann11StaticStackIiLi32EE4pushEi(ptr noundef nonnull align 4 dereferenceable(132) %4, i32 noundef %43)
  br label %.backedge

44:                                               ; preds = %41
  %..032 = select i1 %38, ptr %32, ptr %.03252
  %spec.select = select i1 %35, ptr %29, ptr %..032
  %spec.select39 = or i1 %35, %38
  br i1 %spec.select39, label %.backedge, label %.loopexit

.backedge:                                        ; preds = %44, %42
  %.032.be = phi ptr [ %spec.select, %44 ], [ %29, %42 ]
  %45 = call noundef zeroext i1 @_ZNK7Riemann15DynamicAABBTree4Node6IsLeafEv(ptr noundef nonnull align 8 dereferenceable(49) %.032.be)
  br i1 %45, label %._crit_edge54, label %.lr.ph53

.loopexit:                                        ; preds = %44, %._crit_edge54
  %46 = call noundef zeroext i1 @_ZNK7Riemann11StaticStackIiLi32EE5emptyEv(ptr noundef nonnull align 4 dereferenceable(132) %4)
  br i1 %46, label %._crit_edge, label %.lr.ph, !llvm.loop !22

._crit_edge:                                      ; preds = %.loopexit, %14
  %47 = call noundef zeroext i1 @_ZNKSt6vectorIPvSaIS0_EE5emptyEv(ptr noundef nonnull align 8 dereferenceable(24) %2) #5
  %48 = xor i1 %47, true
  call void @llvm.lifetime.end.p0(i64 132, ptr nonnull %4) #5
  br label %49

49:                                               ; preds = %._crit_edge, %7, %3
  %.1 = phi i1 [ false, %3 ], [ %48, %._crit_edge ], [ false, %7 ]
  ret i1 %.1
}

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZNKSt6vectorIPvSaIS0_EE5emptyEv(ptr noundef nonnull align 8 dereferenceable(24)) 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 = { 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 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { nounwind }
attributes #6 = { 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 = !{!"_ZTSN7Riemann15DynamicAABBTreeE", !7, i64 0, !10, i64 8, !7, i64 32, !7, i64 36, !7, i64 40}
!7 = !{!"int", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!"_ZTSSt6vectorIN7Riemann15DynamicAABBTree4NodeESaIS2_EE", !11, i64 0}
!11 = !{!"_ZTSSt12_Vector_baseIN7Riemann15DynamicAABBTree4NodeESaIS2_EE", !12, i64 0}
!12 = !{!"_ZTSNSt12_Vector_baseIN7Riemann15DynamicAABBTree4NodeESaIS2_EE12_Vector_implE", !13, i64 0}
!13 = !{!"_ZTSNSt12_Vector_baseIN7Riemann15DynamicAABBTree4NodeESaIS2_EE17_Vector_impl_dataE", !14, i64 0, !14, i64 8, !14, i64 16}
!14 = !{!"any pointer", !8, i64 0}
!15 = !{!16, !7, i64 28}
!16 = !{!"_ZTSN7Riemann15DynamicAABBTree4NodeE", !8, i64 0, !17, i64 4, !7, i64 28, !7, i64 32, !7, i64 36, !14, i64 40, !20, i64 48}
!17 = !{!"_ZTSN5Maths6TAABB3IfEE", !18, i64 0, !18, i64 12}
!18 = !{!"_ZTSN5Maths8TVector3IfEE", !19, i64 0, !19, i64 4, !19, i64 8}
!19 = !{!"float", !8, i64 0}
!20 = !{!"bool", !8, i64 0}
!21 = !{!16, !7, i64 32}
!22 = distinct !{!22, !23}
!23 = !{!"llvm.loop.mustprogress"}


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