; 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] }
%"struct.Riemann::SweepResult" = type <{ i8, [3 x i8], float, float, %"class.Maths::TVector3", %"class.Maths::TVector3", [4 x i8], ptr, %"class.std::vector.0", i32, [4 x i8] }>
%"class.Maths::TVector3" = type { float, float, float }
%"class.std::vector.0" = type { %"struct.std::_Vector_base.1" }
%"struct.std::_Vector_base.1" = type { %"struct.std::_Vector_base<Riemann::Geometry *, std::allocator<Riemann::Geometry *>>::_Vector_impl" }
%"struct.std::_Vector_base<Riemann::Geometry *, std::allocator<Riemann::Geometry *>>::_Vector_impl" = type { %"struct.std::_Vector_base<Riemann::Geometry *, std::allocator<Riemann::Geometry *>>::_Vector_impl_data" }
%"struct.std::_Vector_base<Riemann::Geometry *, std::allocator<Riemann::Geometry *>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"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" }
%"struct.Riemann::SweepOption" = type { i32, i8, float, %"struct.Riemann::CollisionData", ptr }
%"struct.Riemann::CollisionData" = type { i32, i32, i32, 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__._ZNK7Riemann15DynamicAABBTree5SweepEPKNS_8GeometryERKN5Maths8TVector3IfEEPKNS_11SweepOptionEPNS_11SweepResultE = external hidden unnamed_addr constant [114 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: mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZNKSt6vectorIPN7Riemann8GeometryESaIS2_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24)) #1 align 2

; Function Attrs: mustprogress uwtable
define dso_local noundef zeroext i1 @_ZNK7Riemann15DynamicAABBTree5SweepEPKNS_8GeometryERKN5Maths8TVector3IfEEPKNS_11SweepOptionEPNS_11SweepResultE(ptr noundef nonnull align 8 dereferenceable(44) %0, ptr noundef %1, ptr noundef nonnull align 4 dereferenceable(12) %2, ptr noundef %3, ptr noundef %4) #4 align 2 {
  %6 = alloca i1, align 1
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca ptr, align 8
  %10 = alloca ptr, align 8
  %11 = alloca ptr, align 8
  %12 = alloca float, align 4
  %13 = alloca float, align 4
  %14 = alloca ptr, align 8
  %15 = alloca i32, align 4
  %16 = alloca %"class.Riemann::StaticStack.5", align 4
  %17 = alloca ptr, align 8
  %18 = alloca ptr, align 8
  %19 = alloca i8, align 1
  %20 = alloca i8, align 1
  store ptr %0, ptr %7, align 8, !tbaa !5
  store ptr %1, ptr %8, align 8, !tbaa !5
  store ptr %2, ptr %9, align 8, !tbaa !5
  store ptr %3, ptr %10, align 8, !tbaa !5
  store ptr %4, ptr %11, align 8, !tbaa !5
  %21 = load ptr, ptr %7, align 8
  %22 = load ptr, ptr %11, align 8, !tbaa !5
  %23 = getelementptr inbounds %"struct.Riemann::SweepResult", ptr %22, i32 0, i32 0
  store i8 0, ptr %23, align 8, !tbaa !9
  %24 = load ptr, ptr %11, align 8, !tbaa !5
  %25 = getelementptr inbounds %"struct.Riemann::SweepResult", ptr %24, i32 0, i32 9
  store i32 0, ptr %25, align 8, !tbaa !19
  %26 = load ptr, ptr %11, align 8, !tbaa !5
  %27 = getelementptr inbounds %"struct.Riemann::SweepResult", ptr %26, i32 0, i32 3
  store float 0x47EFFFFFE0000000, ptr %27, align 8, !tbaa !20
  %28 = load ptr, ptr %11, align 8, !tbaa !5
  %29 = getelementptr inbounds %"struct.Riemann::SweepResult", ptr %28, i32 0, i32 7
  store ptr null, ptr %29, align 8, !tbaa !21
  %30 = getelementptr inbounds %"class.Riemann::DynamicAABBTree", ptr %21, i32 0, i32 0
  %31 = load i32, ptr %30, align 8, !tbaa !22
  %32 = icmp eq i32 %31, -1
  br i1 %32, label %33, label %34

33:                                               ; preds = %5
  store i1 false, ptr %6, align 1
  br label %236

34:                                               ; preds = %5
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #6
  %35 = getelementptr inbounds %"class.Riemann::DynamicAABBTree", ptr %21, i32 0, i32 2
  %36 = getelementptr inbounds %"class.Riemann::DynamicAABBTree", ptr %21, i32 0, i32 0
  %37 = load i32, ptr %36, align 8, !tbaa !22
  %38 = sext i32 %37 to i64
  %39 = call noundef nonnull align 8 dereferenceable(49) ptr @_ZNKSt6vectorIN7Riemann15DynamicAABBTree4NodeESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %35, i64 noundef %38) #6
  store ptr %39, ptr %14, align 8, !tbaa !5
  %40 = load ptr, ptr %14, align 8, !tbaa !5
  %41 = icmp eq ptr %40, null
  br i1 %41, label %58, label %42

42:                                               ; preds = %34
  %43 = load ptr, ptr %8, align 8, !tbaa !5
  %44 = load ptr, ptr %9, align 8, !tbaa !5
  %45 = load ptr, ptr %14, align 8, !tbaa !5
  %46 = getelementptr inbounds %"struct.Riemann::DynamicAABBTree::Node", ptr %45, i32 0, i32 1
  %47 = getelementptr inbounds %"class.Maths::TAABB3", ptr %46, i32 0, i32 0
  %48 = load ptr, ptr %14, align 8, !tbaa !5
  %49 = getelementptr inbounds %"struct.Riemann::DynamicAABBTree::Node", ptr %48, i32 0, i32 1
  %50 = getelementptr inbounds %"class.Maths::TAABB3", ptr %49, i32 0, i32 1
  %51 = call noundef zeroext i1 @_ZNK7Riemann8Geometry13SweepTestFastERKN5Maths8TVector3IfEES5_S5_Pf(ptr noundef nonnull align 8 dereferenceable(204) %43, ptr noundef nonnull align 4 dereferenceable(12) %44, ptr noundef nonnull align 4 dereferenceable(12) %47, ptr noundef nonnull align 4 dereferenceable(12) %50, ptr noundef %12)
  br i1 %51, label %52, label %58

52:                                               ; preds = %42
  %53 = load float, ptr %12, align 4, !tbaa !28
  %54 = load ptr, ptr %10, align 8, !tbaa !5
  %55 = getelementptr inbounds %"struct.Riemann::SweepOption", ptr %54, i32 0, i32 2
  %56 = load float, ptr %55, align 8, !tbaa !29
  %57 = fcmp oge float %53, %56
  br i1 %57, label %58, label %59

58:                                               ; preds = %52, %42, %34
  store i1 false, ptr %6, align 1
  store i32 1, ptr %15, align 4
  br label %235

59:                                               ; preds = %52
  call void @llvm.lifetime.start.p0(i64 132, ptr %16) #6
  call void @_ZN7Riemann11StaticStackIiLi32EEC2Ev(ptr noundef nonnull align 4 dereferenceable(132) %16)
  %60 = getelementptr inbounds %"class.Riemann::DynamicAABBTree", ptr %21, i32 0, i32 0
  %61 = load i32, ptr %60, align 8, !tbaa !22
  call void @_ZN7Riemann11StaticStackIiLi32EE4pushEi(ptr noundef nonnull align 4 dereferenceable(132) %16, i32 noundef %61)
  br label %62

62:                                               ; preds = %221, %59
  %63 = call noundef zeroext i1 @_ZNK7Riemann11StaticStackIiLi32EE5emptyEv(ptr noundef nonnull align 4 dereferenceable(132) %16)
  %64 = xor i1 %63, true
  br i1 %64, label %65, label %222

65:                                               ; preds = %62
  %66 = getelementptr inbounds %"class.Riemann::DynamicAABBTree", ptr %21, i32 0, i32 2
  %67 = call noundef i32 @_ZN7Riemann11StaticStackIiLi32EE3popEv(ptr noundef nonnull align 4 dereferenceable(132) %16)
  %68 = sext i32 %67 to i64
  %69 = call noundef nonnull align 8 dereferenceable(49) ptr @_ZNKSt6vectorIN7Riemann15DynamicAABBTree4NodeESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %66, i64 noundef %68) #6
  store ptr %69, ptr %14, align 8, !tbaa !5
  br label %70

70:                                               ; preds = %219, %65
  %71 = load ptr, ptr %14, align 8, !tbaa !5
  %72 = icmp ne ptr %71, null
  br i1 %72, label %73, label %221

73:                                               ; preds = %70
  %74 = load ptr, ptr %14, align 8, !tbaa !5
  %75 = call noundef zeroext i1 @_ZNK7Riemann15DynamicAABBTree4Node6IsLeafEv(ptr noundef nonnull align 8 dereferenceable(49) %74)
  br i1 %75, label %76, label %93

76:                                               ; preds = %73
  %77 = load ptr, ptr %8, align 8, !tbaa !5
  %78 = load ptr, ptr %9, align 8, !tbaa !5
  %79 = load ptr, ptr %14, align 8, !tbaa !5
  %80 = getelementptr inbounds %"struct.Riemann::DynamicAABBTree::Node", ptr %79, i32 0, i32 5
  %81 = load ptr, ptr %80, align 8, !tbaa !33
  %82 = load ptr, ptr %10, align 8, !tbaa !5
  %83 = load ptr, ptr %11, align 8, !tbaa !5
  %84 = call noundef zeroext i1 @_ZN7RiemannL13SweepGeometryEPKNS_8GeometryERKN5Maths8TVector3IfEEPvPKNS_11SweepOptionEPNS_11SweepResultE(ptr noundef %77, ptr noundef nonnull align 4 dereferenceable(12) %78, ptr noundef %81, ptr noundef %82, ptr noundef %83)
  br i1 %84, label %85, label %92

85:                                               ; preds = %76
  %86 = load ptr, ptr %10, align 8, !tbaa !5
  %87 = getelementptr inbounds %"struct.Riemann::SweepOption", ptr %86, i32 0, i32 0
  %88 = load i32, ptr %87, align 8, !tbaa !36
  %89 = icmp eq i32 %88, 1
  br i1 %89, label %90, label %91

90:                                               ; preds = %85
  store i1 true, ptr %6, align 1
  store i32 1, ptr %15, align 4
  br label %234

91:                                               ; preds = %85
  br label %92

92:                                               ; preds = %91, %76
  br label %221

93:                                               ; preds = %73
  %94 = load ptr, ptr %14, align 8, !tbaa !5
  %95 = getelementptr inbounds %"struct.Riemann::DynamicAABBTree::Node", ptr %94, i32 0, i32 2
  %96 = load i32, ptr %95, align 4, !tbaa !37
  %97 = icmp ne i32 %96, -1
  br i1 %97, label %98, label %103

98:                                               ; preds = %93
  %99 = load ptr, ptr %14, align 8, !tbaa !5
  %100 = getelementptr inbounds %"struct.Riemann::DynamicAABBTree::Node", ptr %99, i32 0, i32 3
  %101 = load i32, ptr %100, align 8, !tbaa !38
  %102 = icmp ne i32 %101, -1
  br label %103

103:                                              ; preds = %98, %93
  %104 = phi i1 [ false, %93 ], [ %102, %98 ]
  br i1 %104, label %105, label %106

105:                                              ; preds = %103
  br label %108

106:                                              ; preds = %103
  call void @__assert_fail(ptr noundef @.str, ptr noundef @.str.1, i32 noundef 315, ptr noundef @__PRETTY_FUNCTION__._ZNK7Riemann15DynamicAABBTree5SweepEPKNS_8GeometryERKN5Maths8TVector3IfEEPKNS_11SweepOptionEPNS_11SweepResultE) #7
  unreachable

107:                                              ; No predecessors!
  br label %108

108:                                              ; preds = %107, %105
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #6
  %109 = getelementptr inbounds %"class.Riemann::DynamicAABBTree", ptr %21, i32 0, i32 2
  %110 = load ptr, ptr %14, align 8, !tbaa !5
  %111 = getelementptr inbounds %"struct.Riemann::DynamicAABBTree::Node", ptr %110, i32 0, i32 2
  %112 = load i32, ptr %111, align 4, !tbaa !37
  %113 = sext i32 %112 to i64
  %114 = call noundef nonnull align 8 dereferenceable(49) ptr @_ZNKSt6vectorIN7Riemann15DynamicAABBTree4NodeESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %109, i64 noundef %113) #6
  store ptr %114, ptr %17, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #6
  %115 = getelementptr inbounds %"class.Riemann::DynamicAABBTree", ptr %21, i32 0, i32 2
  %116 = load ptr, ptr %14, align 8, !tbaa !5
  %117 = getelementptr inbounds %"struct.Riemann::DynamicAABBTree::Node", ptr %116, i32 0, i32 3
  %118 = load i32, ptr %117, align 8, !tbaa !38
  %119 = sext i32 %118 to i64
  %120 = call noundef nonnull align 8 dereferenceable(49) ptr @_ZNKSt6vectorIN7Riemann15DynamicAABBTree4NodeESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %115, i64 noundef %119) #6
  store ptr %120, ptr %18, align 8, !tbaa !5
  %121 = load ptr, ptr %11, align 8, !tbaa !5
  call void @_ZN7Riemann11SweepResult12AddTestCountEi(ptr noundef nonnull align 8 dereferenceable(76) %121, i32 noundef 2)
  call void @llvm.lifetime.start.p0(i64 1, ptr %19) #6
  %122 = load ptr, ptr %8, align 8, !tbaa !5
  %123 = load ptr, ptr %9, align 8, !tbaa !5
  %124 = load ptr, ptr %17, align 8, !tbaa !5
  %125 = getelementptr inbounds %"struct.Riemann::DynamicAABBTree::Node", ptr %124, i32 0, i32 1
  %126 = getelementptr inbounds %"class.Maths::TAABB3", ptr %125, i32 0, i32 0
  %127 = load ptr, ptr %17, align 8, !tbaa !5
  %128 = getelementptr inbounds %"struct.Riemann::DynamicAABBTree::Node", ptr %127, i32 0, i32 1
  %129 = getelementptr inbounds %"class.Maths::TAABB3", ptr %128, i32 0, i32 1
  %130 = call noundef zeroext i1 @_ZNK7Riemann8Geometry13SweepTestFastERKN5Maths8TVector3IfEES5_S5_Pf(ptr noundef nonnull align 8 dereferenceable(204) %122, ptr noundef nonnull align 4 dereferenceable(12) %123, ptr noundef nonnull align 4 dereferenceable(12) %126, ptr noundef nonnull align 4 dereferenceable(12) %129, ptr noundef %12)
  %131 = zext i1 %130 to i8
  store i8 %131, ptr %19, align 1, !tbaa !39
  call void @llvm.lifetime.start.p0(i64 1, ptr %20) #6
  %132 = load ptr, ptr %8, align 8, !tbaa !5
  %133 = load ptr, ptr %9, align 8, !tbaa !5
  %134 = load ptr, ptr %18, align 8, !tbaa !5
  %135 = getelementptr inbounds %"struct.Riemann::DynamicAABBTree::Node", ptr %134, i32 0, i32 1
  %136 = getelementptr inbounds %"class.Maths::TAABB3", ptr %135, i32 0, i32 0
  %137 = load ptr, ptr %18, align 8, !tbaa !5
  %138 = getelementptr inbounds %"struct.Riemann::DynamicAABBTree::Node", ptr %137, i32 0, i32 1
  %139 = getelementptr inbounds %"class.Maths::TAABB3", ptr %138, i32 0, i32 1
  %140 = call noundef zeroext i1 @_ZNK7Riemann8Geometry13SweepTestFastERKN5Maths8TVector3IfEES5_S5_Pf(ptr noundef nonnull align 8 dereferenceable(204) %132, ptr noundef nonnull align 4 dereferenceable(12) %133, ptr noundef nonnull align 4 dereferenceable(12) %136, ptr noundef nonnull align 4 dereferenceable(12) %139, ptr noundef %13)
  %141 = zext i1 %140 to i8
  store i8 %141, ptr %20, align 1, !tbaa !39
  %142 = load ptr, ptr %10, align 8, !tbaa !5
  %143 = getelementptr inbounds %"struct.Riemann::SweepOption", ptr %142, i32 0, i32 0
  %144 = load i32, ptr %143, align 8, !tbaa !36
  %145 = icmp ne i32 %144, 2
  br i1 %145, label %146, label %181

146:                                              ; preds = %108
  %147 = load i8, ptr %19, align 1, !tbaa !39, !range !40, !noundef !41
  %148 = trunc i8 %147 to i1
  br i1 %148, label %149, label %161

149:                                              ; preds = %146
  %150 = load float, ptr %12, align 4, !tbaa !28
  %151 = load ptr, ptr %11, align 8, !tbaa !5
  %152 = getelementptr inbounds %"struct.Riemann::SweepResult", ptr %151, i32 0, i32 3
  %153 = load float, ptr %152, align 8, !tbaa !20
  %154 = fcmp olt float %150, %153
  br i1 %154, label %155, label %161

155:                                              ; preds = %149
  %156 = load float, ptr %12, align 4, !tbaa !28
  %157 = load ptr, ptr %10, align 8, !tbaa !5
  %158 = getelementptr inbounds %"struct.Riemann::SweepOption", ptr %157, i32 0, i32 2
  %159 = load float, ptr %158, align 8, !tbaa !29
  %160 = fcmp olt float %156, %159
  br label %161

161:                                              ; preds = %155, %149, %146
  %162 = phi i1 [ false, %149 ], [ false, %146 ], [ %160, %155 ]
  %163 = zext i1 %162 to i8
  store i8 %163, ptr %19, align 1, !tbaa !39
  %164 = load i8, ptr %20, align 1, !tbaa !39, !range !40, !noundef !41
  %165 = trunc i8 %164 to i1
  br i1 %165, label %166, label %178

166:                                              ; preds = %161
  %167 = load float, ptr %13, align 4, !tbaa !28
  %168 = load ptr, ptr %11, align 8, !tbaa !5
  %169 = getelementptr inbounds %"struct.Riemann::SweepResult", ptr %168, i32 0, i32 3
  %170 = load float, ptr %169, align 8, !tbaa !20
  %171 = fcmp olt float %167, %170
  br i1 %171, label %172, label %178

172:                                              ; preds = %166
  %173 = load float, ptr %13, align 4, !tbaa !28
  %174 = load ptr, ptr %10, align 8, !tbaa !5
  %175 = getelementptr inbounds %"struct.Riemann::SweepOption", ptr %174, i32 0, i32 2
  %176 = load float, ptr %175, align 8, !tbaa !29
  %177 = fcmp olt float %173, %176
  br label %178

178:                                              ; preds = %172, %166, %161
  %179 = phi i1 [ false, %166 ], [ false, %161 ], [ %177, %172 ]
  %180 = zext i1 %179 to i8
  store i8 %180, ptr %20, align 1, !tbaa !39
  br label %181

181:                                              ; preds = %178, %108
  %182 = call noundef zeroext i1 @_ZNK7Riemann11StaticStackIiLi32EE4fullEv(ptr noundef nonnull align 4 dereferenceable(132) %16)
  %183 = xor i1 %182, true
  br i1 %183, label %184, label %185

184:                                              ; preds = %181
  br label %187

185:                                              ; preds = %181
  call void @__assert_fail(ptr noundef @.str.2, ptr noundef @.str.1, i32 noundef 330, ptr noundef @__PRETTY_FUNCTION__._ZNK7Riemann15DynamicAABBTree5SweepEPKNS_8GeometryERKN5Maths8TVector3IfEEPKNS_11SweepOptionEPNS_11SweepResultE) #7
  unreachable

186:                                              ; No predecessors!
  br label %187

187:                                              ; preds = %186, %184
  %188 = load i8, ptr %19, align 1, !tbaa !39, !range !40, !noundef !41
  %189 = trunc i8 %188 to i1
  br i1 %189, label %190, label %208

190:                                              ; preds = %187
  %191 = load i8, ptr %20, align 1, !tbaa !39, !range !40, !noundef !41
  %192 = trunc i8 %191 to i1
  br i1 %192, label %193, label %208

193:                                              ; preds = %190
  %194 = load float, ptr %12, align 4, !tbaa !28
  %195 = load float, ptr %13, align 4, !tbaa !28
  %196 = fcmp olt float %194, %195
  br i1 %196, label %197, label %202

197:                                              ; preds = %193
  %198 = load ptr, ptr %14, align 8, !tbaa !5
  %199 = getelementptr inbounds %"struct.Riemann::DynamicAABBTree::Node", ptr %198, i32 0, i32 3
  %200 = load i32, ptr %199, align 8, !tbaa !38
  call void @_ZN7Riemann11StaticStackIiLi32EE4pushEi(ptr noundef nonnull align 4 dereferenceable(132) %16, i32 noundef %200)
  %201 = load ptr, ptr %17, align 8, !tbaa !5
  store ptr %201, ptr %14, align 8, !tbaa !5
  br label %207

202:                                              ; preds = %193
  %203 = load ptr, ptr %14, align 8, !tbaa !5
  %204 = getelementptr inbounds %"struct.Riemann::DynamicAABBTree::Node", ptr %203, i32 0, i32 2
  %205 = load i32, ptr %204, align 4, !tbaa !37
  call void @_ZN7Riemann11StaticStackIiLi32EE4pushEi(ptr noundef nonnull align 4 dereferenceable(132) %16, i32 noundef %205)
  %206 = load ptr, ptr %18, align 8, !tbaa !5
  store ptr %206, ptr %14, align 8, !tbaa !5
  br label %207

207:                                              ; preds = %202, %197
  store i32 4, ptr %15, align 4
  br label %219, !llvm.loop !42

208:                                              ; preds = %190, %187
  %209 = load i8, ptr %19, align 1, !tbaa !39, !range !40, !noundef !41
  %210 = trunc i8 %209 to i1
  br i1 %210, label %211, label %213

211:                                              ; preds = %208
  %212 = load ptr, ptr %17, align 8, !tbaa !5
  store ptr %212, ptr %14, align 8, !tbaa !5
  store i32 4, ptr %15, align 4
  br label %219, !llvm.loop !42

213:                                              ; preds = %208
  %214 = load i8, ptr %20, align 1, !tbaa !39, !range !40, !noundef !41
  %215 = trunc i8 %214 to i1
  br i1 %215, label %216, label %218

216:                                              ; preds = %213
  %217 = load ptr, ptr %18, align 8, !tbaa !5
  store ptr %217, ptr %14, align 8, !tbaa !5
  store i32 4, ptr %15, align 4
  br label %219, !llvm.loop !42

218:                                              ; preds = %213
  store i32 5, ptr %15, align 4
  br label %219

219:                                              ; preds = %218, %216, %211, %207
  call void @llvm.lifetime.end.p0(i64 1, ptr %20) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr %19) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #6
  %220 = load i32, ptr %15, align 4
  switch i32 %220, label %238 [
    i32 4, label %70
    i32 5, label %221
  ]

221:                                              ; preds = %219, %92, %70
  br label %62, !llvm.loop !44

222:                                              ; preds = %62
  %223 = load ptr, ptr %11, align 8, !tbaa !5
  %224 = getelementptr inbounds %"struct.Riemann::SweepResult", ptr %223, i32 0, i32 0
  %225 = load i8, ptr %224, align 8, !tbaa !9, !range !40, !noundef !41
  %226 = trunc i8 %225 to i1
  br i1 %226, label %232, label %227

227:                                              ; preds = %222
  %228 = load ptr, ptr %11, align 8, !tbaa !5
  %229 = getelementptr inbounds %"struct.Riemann::SweepResult", ptr %228, i32 0, i32 8
  %230 = call noundef i64 @_ZNKSt6vectorIPN7Riemann8GeometryESaIS2_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %229) #6
  %231 = icmp ugt i64 %230, 0
  br i1 %231, label %232, label %233

232:                                              ; preds = %227, %222
  store i1 true, ptr %6, align 1
  store i32 1, ptr %15, align 4
  br label %234

233:                                              ; preds = %227
  store i1 false, ptr %6, align 1
  store i32 1, ptr %15, align 4
  br label %234

234:                                              ; preds = %233, %232, %90
  call void @llvm.lifetime.end.p0(i64 132, ptr %16) #6
  br label %235

235:                                              ; preds = %234, %58
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #6
  br label %236

236:                                              ; preds = %235, %33
  %237 = load i1, ptr %6, align 1
  ret i1 %237

238:                                              ; preds = %219
  unreachable
}

declare noundef zeroext i1 @_ZNK7Riemann8Geometry13SweepTestFastERKN5Maths8TVector3IfEES5_S5_Pf(ptr noundef nonnull align 8 dereferenceable(204), ptr noundef nonnull align 4 dereferenceable(12), ptr noundef nonnull align 4 dereferenceable(12), ptr noundef nonnull align 4 dereferenceable(12), ptr noundef) #5

; Function Attrs: mustprogress uwtable
declare hidden noundef zeroext i1 @_ZN7RiemannL13SweepGeometryEPKNS_8GeometryERKN5Maths8TVector3IfEEPvPKNS_11SweepOptionEPNS_11SweepResultE(ptr noundef, ptr noundef nonnull align 4 dereferenceable(12), ptr noundef, ptr noundef, ptr noundef) #4

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN7Riemann11SweepResult12AddTestCountEi(ptr noundef nonnull align 8 dereferenceable(76), i32 noundef) #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 = { "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 = { nounwind }
attributes #7 = { 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 = !{!"_ZTSN7Riemann11SweepResultE", !11, i64 0, !12, i64 4, !12, i64 8, !13, i64 12, !13, i64 24, !6, i64 40, !14, i64 48, !18, i64 72}
!11 = !{!"bool", !7, i64 0}
!12 = !{!"float", !7, i64 0}
!13 = !{!"_ZTSN5Maths8TVector3IfEE", !12, i64 0, !12, i64 4, !12, i64 8}
!14 = !{!"_ZTSSt6vectorIPN7Riemann8GeometryESaIS2_EE", !15, i64 0}
!15 = !{!"_ZTSSt12_Vector_baseIPN7Riemann8GeometryESaIS2_EE", !16, i64 0}
!16 = !{!"_ZTSNSt12_Vector_baseIPN7Riemann8GeometryESaIS2_EE12_Vector_implE", !17, i64 0}
!17 = !{!"_ZTSNSt12_Vector_baseIPN7Riemann8GeometryESaIS2_EE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!18 = !{!"int", !7, i64 0}
!19 = !{!10, !18, i64 72}
!20 = !{!10, !12, i64 8}
!21 = !{!10, !6, i64 40}
!22 = !{!23, !18, i64 0}
!23 = !{!"_ZTSN7Riemann15DynamicAABBTreeE", !18, i64 0, !24, i64 8, !18, i64 32, !18, i64 36, !18, i64 40}
!24 = !{!"_ZTSSt6vectorIN7Riemann15DynamicAABBTree4NodeESaIS2_EE", !25, i64 0}
!25 = !{!"_ZTSSt12_Vector_baseIN7Riemann15DynamicAABBTree4NodeESaIS2_EE", !26, i64 0}
!26 = !{!"_ZTSNSt12_Vector_baseIN7Riemann15DynamicAABBTree4NodeESaIS2_EE12_Vector_implE", !27, i64 0}
!27 = !{!"_ZTSNSt12_Vector_baseIN7Riemann15DynamicAABBTree4NodeESaIS2_EE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!28 = !{!12, !12, i64 0}
!29 = !{!30, !12, i64 8}
!30 = !{!"_ZTSN7Riemann11SweepOptionE", !31, i64 0, !11, i64 4, !12, i64 8, !32, i64 12, !6, i64 32}
!31 = !{!"_ZTSN7Riemann11SweepOption9SweepTypeE", !7, i64 0}
!32 = !{!"_ZTSN7Riemann13CollisionDataE", !18, i64 0, !18, i64 4, !18, i64 8, !18, i64 12}
!33 = !{!34, !6, i64 40}
!34 = !{!"_ZTSN7Riemann15DynamicAABBTree4NodeE", !7, i64 0, !35, i64 4, !18, i64 28, !18, i64 32, !18, i64 36, !6, i64 40, !11, i64 48}
!35 = !{!"_ZTSN5Maths6TAABB3IfEE", !13, i64 0, !13, i64 12}
!36 = !{!30, !31, i64 0}
!37 = !{!34, !18, i64 28}
!38 = !{!34, !18, i64 32}
!39 = !{!11, !11, i64 0}
!40 = !{i8 0, i8 2}
!41 = !{}
!42 = distinct !{!42, !43}
!43 = !{!"llvm.loop.mustprogress"}
!44 = distinct !{!44, !43}


; 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__._ZNK7Riemann15DynamicAABBTree5SweepEPKNS_8GeometryERKN5Maths8TVector3IfEEPKNS_11SweepOptionEPNS_11SweepResultE = external hidden unnamed_addr constant [114 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: mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZNKSt6vectorIPN7Riemann8GeometryESaIS2_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #1 align 2

; Function Attrs: mustprogress uwtable
define dso_local noundef zeroext i1 @_ZNK7Riemann15DynamicAABBTree5SweepEPKNS_8GeometryERKN5Maths8TVector3IfEEPKNS_11SweepOptionEPNS_11SweepResultE(ptr noundef nonnull align 8 dereferenceable(44) %0, ptr noundef %1, ptr noundef nonnull align 4 dereferenceable(12) %2, ptr noundef %3, ptr noundef %4) local_unnamed_addr #4 align 2 {
  %6 = alloca float, align 4
  %7 = alloca float, align 4
  %8 = alloca %"class.Riemann::StaticStack.5", align 4
  store i8 0, ptr %4, align 8, !tbaa !5
  %9 = getelementptr inbounds i8, ptr %4, i64 72
  store i32 0, ptr %9, align 8, !tbaa !18
  %10 = getelementptr inbounds i8, ptr %4, i64 8
  store float 0x47EFFFFFE0000000, ptr %10, align 8, !tbaa !19
  %11 = getelementptr inbounds i8, ptr %4, i64 40
  store ptr null, ptr %11, align 8, !tbaa !20
  %12 = load i32, ptr %0, align 8, !tbaa !21
  %13 = icmp eq i32 %12, -1
  br i1 %13, label %91, label %14

14:                                               ; preds = %5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %6) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %7) #6
  %15 = getelementptr inbounds i8, ptr %0, i64 8
  %16 = sext i32 %12 to i64
  %17 = tail call noundef nonnull align 8 dereferenceable(49) ptr @_ZNKSt6vectorIN7Riemann15DynamicAABBTree4NodeESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %15, i64 noundef %16) #6
  %18 = getelementptr inbounds i8, ptr %17, i64 4
  %19 = getelementptr inbounds i8, ptr %17, i64 16
  %20 = call noundef zeroext i1 @_ZNK7Riemann8Geometry13SweepTestFastERKN5Maths8TVector3IfEES5_S5_Pf(ptr noundef nonnull align 8 dereferenceable(204) %1, ptr noundef nonnull align 4 dereferenceable(12) %2, ptr noundef nonnull align 4 dereferenceable(12) %18, ptr noundef nonnull align 4 dereferenceable(12) %19, ptr noundef nonnull %6)
  br i1 %20, label %21, label %90

21:                                               ; preds = %14
  %22 = load float, ptr %6, align 4, !tbaa !27
  %23 = getelementptr inbounds i8, ptr %3, i64 8
  %24 = load float, ptr %23, align 8, !tbaa !28
  %25 = fcmp ult float %22, %24
  br i1 %25, label %26, label %90

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

.lr.ph:                                           ; preds = %26, %.loopexit
  %29 = call noundef i32 @_ZN7Riemann11StaticStackIiLi32EE3popEv(ptr noundef nonnull align 4 dereferenceable(132) %8)
  %30 = sext i32 %29 to i64
  %31 = call noundef nonnull align 8 dereferenceable(49) ptr @_ZNKSt6vectorIN7Riemann15DynamicAABBTree4NodeESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %15, i64 noundef %30) #6
  %32 = call noundef zeroext i1 @_ZNK7Riemann15DynamicAABBTree4Node6IsLeafEv(ptr noundef nonnull align 8 dereferenceable(49) %31)
  br i1 %32, label %._crit_edge80, label %.lr.ph79

._crit_edge80:                                    ; preds = %.backedge, %.lr.ph
  %.054.lcssa = phi ptr [ %31, %.lr.ph ], [ %.054.be, %.backedge ]
  %33 = getelementptr inbounds i8, ptr %.054.lcssa, i64 40
  %34 = load ptr, ptr %33, align 8, !tbaa !32
  %35 = call noundef zeroext i1 @_ZN7RiemannL13SweepGeometryEPKNS_8GeometryERKN5Maths8TVector3IfEEPvPKNS_11SweepOptionEPNS_11SweepResultE(ptr noundef nonnull %1, ptr noundef nonnull align 4 dereferenceable(12) %2, ptr noundef %34, ptr noundef %3, ptr noundef nonnull %4)
  br i1 %35, label %36, label %.loopexit

36:                                               ; preds = %._crit_edge80
  %37 = load i32, ptr %3, align 8, !tbaa !35
  %38 = icmp eq i32 %37, 1
  br i1 %38, label %.loopexit65, label %.loopexit

.lr.ph79:                                         ; preds = %.lr.ph, %.backedge
  %.05478 = phi ptr [ %.054.be, %.backedge ], [ %31, %.lr.ph ]
  %39 = getelementptr inbounds i8, ptr %.05478, i64 28
  %40 = load i32, ptr %39, align 4, !tbaa !36
  %.not61 = icmp eq i32 %40, -1
  br i1 %.not61, label %.critedge, label %41

41:                                               ; preds = %.lr.ph79
  %42 = getelementptr inbounds i8, ptr %.05478, i64 32
  %43 = load i32, ptr %42, align 8, !tbaa !37
  %.not62 = icmp eq i32 %43, -1
  br i1 %.not62, label %.critedge, label %44

.critedge:                                        ; preds = %.lr.ph79, %41
  call void @__assert_fail(ptr noundef nonnull @.str, ptr noundef nonnull @.str.1, i32 noundef 315, ptr noundef nonnull @__PRETTY_FUNCTION__._ZNK7Riemann15DynamicAABBTree5SweepEPKNS_8GeometryERKN5Maths8TVector3IfEEPKNS_11SweepOptionEPNS_11SweepResultE) #7
  unreachable

44:                                               ; preds = %41
  %45 = sext i32 %40 to i64
  %46 = call noundef nonnull align 8 dereferenceable(49) ptr @_ZNKSt6vectorIN7Riemann15DynamicAABBTree4NodeESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %15, i64 noundef %45) #6
  %47 = load i32, ptr %42, align 8, !tbaa !37
  %48 = sext i32 %47 to i64
  %49 = call noundef nonnull align 8 dereferenceable(49) ptr @_ZNKSt6vectorIN7Riemann15DynamicAABBTree4NodeESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %15, i64 noundef %48) #6
  call void @_ZN7Riemann11SweepResult12AddTestCountEi(ptr noundef nonnull align 8 dereferenceable(76) %4, i32 noundef 2)
  %50 = getelementptr inbounds i8, ptr %46, i64 4
  %51 = getelementptr inbounds i8, ptr %46, i64 16
  %52 = call noundef zeroext i1 @_ZNK7Riemann8Geometry13SweepTestFastERKN5Maths8TVector3IfEES5_S5_Pf(ptr noundef nonnull align 8 dereferenceable(204) %1, ptr noundef nonnull align 4 dereferenceable(12) %2, ptr noundef nonnull align 4 dereferenceable(12) %50, ptr noundef nonnull align 4 dereferenceable(12) %51, ptr noundef nonnull %6)
  %53 = getelementptr inbounds i8, ptr %49, i64 4
  %54 = getelementptr inbounds i8, ptr %49, i64 16
  %55 = call noundef zeroext i1 @_ZNK7Riemann8Geometry13SweepTestFastERKN5Maths8TVector3IfEES5_S5_Pf(ptr noundef nonnull align 8 dereferenceable(204) %1, ptr noundef nonnull align 4 dereferenceable(12) %2, ptr noundef nonnull align 4 dereferenceable(12) %53, ptr noundef nonnull align 4 dereferenceable(12) %54, ptr noundef nonnull %7)
  %56 = load i32, ptr %3, align 8, !tbaa !35
  %.not63 = icmp eq i32 %56, 2
  br i1 %.not63, label %74, label %57

57:                                               ; preds = %44
  br i1 %52, label %58, label %65

58:                                               ; preds = %57
  %59 = load float, ptr %6, align 4, !tbaa !27
  %60 = load float, ptr %10, align 8, !tbaa !19
  %61 = fcmp olt float %59, %60
  br i1 %61, label %62, label %65

62:                                               ; preds = %58
  %63 = load float, ptr %23, align 8, !tbaa !28
  %64 = fcmp olt float %59, %63
  br label %65

65:                                               ; preds = %62, %58, %57
  %66 = phi i1 [ false, %58 ], [ false, %57 ], [ %64, %62 ]
  br i1 %55, label %67, label %74

67:                                               ; preds = %65
  %68 = load float, ptr %7, align 4, !tbaa !27
  %69 = load float, ptr %10, align 8, !tbaa !19
  %70 = fcmp olt float %68, %69
  br i1 %70, label %71, label %74

71:                                               ; preds = %67
  %72 = load float, ptr %23, align 8, !tbaa !28
  %73 = fcmp olt float %68, %72
  br label %74

74:                                               ; preds = %65, %67, %71, %44
  %.052.in = phi i1 [ %52, %44 ], [ %66, %71 ], [ %66, %67 ], [ %66, %65 ]
  %.0.in = phi i1 [ %55, %44 ], [ %73, %71 ], [ false, %67 ], [ false, %65 ]
  %75 = call noundef zeroext i1 @_ZNK7Riemann11StaticStackIiLi32EE4fullEv(ptr noundef nonnull align 4 dereferenceable(132) %8)
  br i1 %75, label %76, label %77

76:                                               ; preds = %74
  call void @__assert_fail(ptr noundef nonnull @.str.2, ptr noundef nonnull @.str.1, i32 noundef 330, ptr noundef nonnull @__PRETTY_FUNCTION__._ZNK7Riemann15DynamicAABBTree5SweepEPKNS_8GeometryERKN5Maths8TVector3IfEEPKNS_11SweepOptionEPNS_11SweepResultE) #7
  unreachable

77:                                               ; preds = %74
  %78 = select i1 %.052.in, i1 %.0.in, i1 false
  br i1 %78, label %.backedge.sink.split, label %82

.backedge.sink.split:                             ; preds = %77
  %79 = load float, ptr %6, align 4, !tbaa !27
  %80 = load float, ptr %7, align 4, !tbaa !27
  %81 = fcmp olt float %79, %80
  %. = select i1 %81, ptr %42, ptr %39
  %.81 = select i1 %81, ptr %46, ptr %49
  %.sink = load i32, ptr %., align 4, !tbaa !38
  call void @_ZN7Riemann11StaticStackIiLi32EE4pushEi(ptr noundef nonnull align 4 dereferenceable(132) %8, i32 noundef %.sink)
  br label %.backedge

82:                                               ; preds = %77
  %..054 = select i1 %.0.in, ptr %49, ptr %.05478
  %spec.select = select i1 %.052.in, i1 true, i1 %.0.in
  %spec.select64 = select i1 %.052.in, ptr %46, ptr %..054
  br i1 %spec.select, label %.backedge, label %.loopexit

.backedge:                                        ; preds = %.backedge.sink.split, %82
  %.054.be = phi ptr [ %spec.select64, %82 ], [ %.81, %.backedge.sink.split ]
  %83 = call noundef zeroext i1 @_ZNK7Riemann15DynamicAABBTree4Node6IsLeafEv(ptr noundef nonnull align 8 dereferenceable(49) %.054.be)
  br i1 %83, label %._crit_edge80, label %.lr.ph79

.loopexit:                                        ; preds = %82, %._crit_edge80, %36
  %84 = call noundef zeroext i1 @_ZNK7Riemann11StaticStackIiLi32EE5emptyEv(ptr noundef nonnull align 4 dereferenceable(132) %8)
  br i1 %84, label %._crit_edge, label %.lr.ph, !llvm.loop !39

._crit_edge:                                      ; preds = %.loopexit, %26
  %85 = load i8, ptr %4, align 8, !tbaa !5, !range !41, !noundef !42
  %86 = trunc nuw i8 %85 to i1
  br i1 %86, label %.loopexit65, label %87

87:                                               ; preds = %._crit_edge
  %88 = getelementptr inbounds i8, ptr %4, i64 48
  %89 = call noundef i64 @_ZNKSt6vectorIPN7Riemann8GeometryESaIS2_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %88) #6
  %.not = icmp ne i64 %89, 0
  br label %.loopexit65

.loopexit65:                                      ; preds = %36, %87, %._crit_edge
  %.053 = phi i1 [ true, %._crit_edge ], [ %.not, %87 ], [ true, %36 ]
  call void @llvm.lifetime.end.p0(i64 132, ptr nonnull %8) #6
  br label %90

90:                                               ; preds = %14, %21, %.loopexit65
  %.1 = phi i1 [ %.053, %.loopexit65 ], [ false, %21 ], [ false, %14 ]
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %7) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %6) #6
  br label %91

91:                                               ; preds = %5, %90
  %.2 = phi i1 [ %.1, %90 ], [ false, %5 ]
  ret i1 %.2
}

declare noundef zeroext i1 @_ZNK7Riemann8Geometry13SweepTestFastERKN5Maths8TVector3IfEES5_S5_Pf(ptr noundef nonnull align 8 dereferenceable(204), ptr noundef nonnull align 4 dereferenceable(12), ptr noundef nonnull align 4 dereferenceable(12), ptr noundef nonnull align 4 dereferenceable(12), ptr noundef) local_unnamed_addr #5

; Function Attrs: mustprogress uwtable
declare hidden noundef zeroext i1 @_ZN7RiemannL13SweepGeometryEPKNS_8GeometryERKN5Maths8TVector3IfEEPvPKNS_11SweepOptionEPNS_11SweepResultE(ptr noundef, ptr noundef nonnull align 4 dereferenceable(12), ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #4

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN7Riemann11SweepResult12AddTestCountEi(ptr noundef nonnull align 8 dereferenceable(76), i32 noundef) 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 = { "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 = { nounwind }
attributes #7 = { 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 = !{!"_ZTSN7Riemann11SweepResultE", !7, i64 0, !10, i64 4, !10, i64 8, !11, i64 12, !11, i64 24, !12, i64 40, !13, i64 48, !17, i64 72}
!7 = !{!"bool", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!"float", !8, i64 0}
!11 = !{!"_ZTSN5Maths8TVector3IfEE", !10, i64 0, !10, i64 4, !10, i64 8}
!12 = !{!"any pointer", !8, i64 0}
!13 = !{!"_ZTSSt6vectorIPN7Riemann8GeometryESaIS2_EE", !14, i64 0}
!14 = !{!"_ZTSSt12_Vector_baseIPN7Riemann8GeometryESaIS2_EE", !15, i64 0}
!15 = !{!"_ZTSNSt12_Vector_baseIPN7Riemann8GeometryESaIS2_EE12_Vector_implE", !16, i64 0}
!16 = !{!"_ZTSNSt12_Vector_baseIPN7Riemann8GeometryESaIS2_EE17_Vector_impl_dataE", !12, i64 0, !12, i64 8, !12, i64 16}
!17 = !{!"int", !8, i64 0}
!18 = !{!6, !17, i64 72}
!19 = !{!6, !10, i64 8}
!20 = !{!6, !12, i64 40}
!21 = !{!22, !17, i64 0}
!22 = !{!"_ZTSN7Riemann15DynamicAABBTreeE", !17, i64 0, !23, i64 8, !17, i64 32, !17, i64 36, !17, i64 40}
!23 = !{!"_ZTSSt6vectorIN7Riemann15DynamicAABBTree4NodeESaIS2_EE", !24, i64 0}
!24 = !{!"_ZTSSt12_Vector_baseIN7Riemann15DynamicAABBTree4NodeESaIS2_EE", !25, i64 0}
!25 = !{!"_ZTSNSt12_Vector_baseIN7Riemann15DynamicAABBTree4NodeESaIS2_EE12_Vector_implE", !26, i64 0}
!26 = !{!"_ZTSNSt12_Vector_baseIN7Riemann15DynamicAABBTree4NodeESaIS2_EE17_Vector_impl_dataE", !12, i64 0, !12, i64 8, !12, i64 16}
!27 = !{!10, !10, i64 0}
!28 = !{!29, !10, i64 8}
!29 = !{!"_ZTSN7Riemann11SweepOptionE", !30, i64 0, !7, i64 4, !10, i64 8, !31, i64 12, !12, i64 32}
!30 = !{!"_ZTSN7Riemann11SweepOption9SweepTypeE", !8, i64 0}
!31 = !{!"_ZTSN7Riemann13CollisionDataE", !17, i64 0, !17, i64 4, !17, i64 8, !17, i64 12}
!32 = !{!33, !12, i64 40}
!33 = !{!"_ZTSN7Riemann15DynamicAABBTree4NodeE", !8, i64 0, !34, i64 4, !17, i64 28, !17, i64 32, !17, i64 36, !12, i64 40, !7, i64 48}
!34 = !{!"_ZTSN5Maths6TAABB3IfEE", !11, i64 0, !11, i64 12}
!35 = !{!29, !30, i64 0}
!36 = !{!33, !17, i64 28}
!37 = !{!33, !17, i64 32}
!38 = !{!17, !17, i64 0}
!39 = distinct !{!39, !40}
!40 = !{!"llvm.loop.mustprogress"}
!41 = !{i8 0, i8 2}
!42 = !{}


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