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

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

@.str.1 = external hidden unnamed_addr constant [82 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [14 x i8], align 1
@__PRETTY_FUNCTION__._ZNK7Riemann8AABBTree5SweepEPKNS_8GeometryEPPS1_RKN5Maths8TVector3IfEEPKNS_11SweepOptionEPNS_11SweepResultE = external hidden unnamed_addr constant [120 x i8], align 1

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN7Riemann11StaticStackIjLi32EEC2Ev(ptr noundef nonnull align 4 dereferenceable(132)) unnamed_addr #2 align 2

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

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZNK7Riemann21CacheFriendlyAABBTree6IsLeafEv(ptr noundef nonnull align 4 dereferenceable(28)) #3 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZNK7Riemann21CacheFriendlyAABBTree16GetNumGeometriesEv(ptr noundef nonnull align 4 dereferenceable(28)) #3 align 2

; 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 ptr @_ZN7Riemann21CacheFriendlyAABBTree11GetLeftNodeEPS0_(ptr noundef nonnull align 4 dereferenceable(28), ptr noundef) #3 align 2

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

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(24) ptr @_ZNK7Riemann21CacheFriendlyAABBTree17GetBoundingVolumeEv(ptr noundef nonnull align 4 dereferenceable(28)) #3 align 2

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

; Function Attrs: mustprogress uwtable
define dso_local noundef zeroext i1 @_ZNK7Riemann8AABBTree5SweepEPKNS_8GeometryEPPS1_RKN5Maths8TVector3IfEEPKNS_11SweepOptionEPNS_11SweepResultE(ptr noundef nonnull align 8 dereferenceable(24) %0, ptr noundef %1, ptr noundef %2, ptr noundef nonnull align 4 dereferenceable(12) %3, ptr noundef %4, ptr noundef %5) #4 align 2 {
  %7 = alloca i1, align 1
  %8 = alloca ptr, align 8
  %9 = alloca ptr, align 8
  %10 = alloca ptr, align 8
  %11 = alloca ptr, align 8
  %12 = alloca ptr, align 8
  %13 = alloca ptr, align 8
  %14 = alloca float, align 4
  %15 = alloca float, align 4
  %16 = alloca %"class.Maths::TVector3", align 4
  %17 = alloca ptr, align 8
  %18 = alloca i32, align 4
  %19 = alloca %"class.Riemann::StaticStack", align 4
  %20 = alloca ptr, align 8
  %21 = alloca i32, align 4
  %22 = alloca ptr, align 8
  %23 = alloca i32, align 4
  %24 = alloca ptr, align 8
  %25 = alloca ptr, align 8
  %26 = alloca i8, align 1
  %27 = alloca i8, align 1
  store ptr %0, ptr %8, align 8, !tbaa !5
  store ptr %1, ptr %9, align 8, !tbaa !5
  store ptr %2, ptr %10, align 8, !tbaa !5
  store ptr %3, ptr %11, align 8, !tbaa !5
  store ptr %4, ptr %12, align 8, !tbaa !5
  store ptr %5, ptr %13, align 8, !tbaa !5
  %28 = load ptr, ptr %8, align 8
  %29 = load ptr, ptr %13, align 8, !tbaa !5
  call void @_ZN7Riemann11SweepResult5ResetEv(ptr noundef nonnull align 8 dereferenceable(76) %29)
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #6
  call void @llvm.lifetime.start.p0(i64 12, ptr %16) #6
  call void @_ZN5Maths8TVector3IfEC2Ev(ptr noundef nonnull align 4 dereferenceable(12) %16)
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #6
  %30 = getelementptr inbounds %"class.Riemann::AABBTree", ptr %28, i32 0, i32 2
  %31 = load ptr, ptr %30, align 8, !tbaa !9
  store ptr %31, ptr %17, align 8, !tbaa !5
  %32 = load ptr, ptr %17, align 8, !tbaa !5
  %33 = icmp eq ptr %32, null
  br i1 %33, label %44, label %34

34:                                               ; preds = %6
  %35 = load ptr, ptr %9, align 8, !tbaa !5
  %36 = load ptr, ptr %11, align 8, !tbaa !5
  %37 = load ptr, ptr %17, align 8, !tbaa !5
  %38 = getelementptr inbounds %"struct.Riemann::CacheFriendlyAABBTree", ptr %37, i32 0, i32 0
  %39 = getelementptr inbounds %"class.Maths::TAABB3", ptr %38, i32 0, i32 0
  %40 = load ptr, ptr %17, align 8, !tbaa !5
  %41 = getelementptr inbounds %"struct.Riemann::CacheFriendlyAABBTree", ptr %40, i32 0, i32 0
  %42 = getelementptr inbounds %"class.Maths::TAABB3", ptr %41, i32 0, i32 1
  %43 = call noundef zeroext i1 @_ZNK7Riemann8Geometry13SweepTestFastERKN5Maths8TVector3IfEES5_S5_Pf(ptr noundef nonnull align 8 dereferenceable(204) %35, ptr noundef nonnull align 4 dereferenceable(12) %36, ptr noundef nonnull align 4 dereferenceable(12) %39, ptr noundef nonnull align 4 dereferenceable(12) %42, ptr noundef %14)
  br i1 %43, label %45, label %44

44:                                               ; preds = %34, %6
  store i1 false, ptr %7, align 1
  store i32 1, ptr %18, align 4
  br label %226

45:                                               ; preds = %34
  call void @llvm.lifetime.start.p0(i64 132, ptr %19) #6
  call void @_ZN7Riemann11StaticStackIjLi32EEC2Ev(ptr noundef nonnull align 4 dereferenceable(132) %19)
  call void @_ZN7Riemann11StaticStackIjLi32EE4pushEj(ptr noundef nonnull align 4 dereferenceable(132) %19, i32 noundef 0)
  br label %46

46:                                               ; preds = %212, %45
  %47 = call noundef zeroext i1 @_ZNK7Riemann11StaticStackIjLi32EE5emptyEv(ptr noundef nonnull align 4 dereferenceable(132) %19)
  %48 = xor i1 %47, true
  br i1 %48, label %49, label %213

49:                                               ; preds = %46
  %50 = getelementptr inbounds %"class.Riemann::AABBTree", ptr %28, i32 0, i32 2
  %51 = load ptr, ptr %50, align 8, !tbaa !9
  %52 = call noundef i32 @_ZN7Riemann11StaticStackIjLi32EE3popEv(ptr noundef nonnull align 4 dereferenceable(132) %19)
  %53 = zext i32 %52 to i64
  %54 = getelementptr inbounds %"struct.Riemann::CacheFriendlyAABBTree", ptr %51, i64 %53
  store ptr %54, ptr %17, align 8, !tbaa !5
  br label %55

55:                                               ; preds = %210, %49
  %56 = load ptr, ptr %17, align 8, !tbaa !5
  %57 = icmp ne ptr %56, null
  br i1 %57, label %58, label %212

58:                                               ; preds = %55
  %59 = load ptr, ptr %17, align 8, !tbaa !5
  %60 = call noundef zeroext i1 @_ZNK7Riemann21CacheFriendlyAABBTree6IsLeafEv(ptr noundef nonnull align 4 dereferenceable(28) %59)
  br i1 %60, label %61, label %91

61:                                               ; preds = %58
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #6
  %62 = load ptr, ptr %17, align 8, !tbaa !5
  %63 = getelementptr inbounds %"class.Riemann::AABBTree", ptr %28, i32 0, i32 0
  %64 = load ptr, ptr %63, align 8, !tbaa !12
  %65 = call noundef ptr @_ZNK7Riemann21CacheFriendlyAABBTree18GetGeometryIndicesEPi(ptr noundef nonnull align 4 dereferenceable(28) %62, ptr noundef %64)
  store ptr %65, ptr %20, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %21) #6
  %66 = load ptr, ptr %17, align 8, !tbaa !5
  %67 = call noundef i32 @_ZNK7Riemann21CacheFriendlyAABBTree16GetNumGeometriesEv(ptr noundef nonnull align 4 dereferenceable(28) %66)
  store i32 %67, ptr %21, align 4, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 8, ptr %22) #6
  %68 = load ptr, ptr %17, align 8, !tbaa !5
  %69 = call noundef nonnull align 4 dereferenceable(24) ptr @_ZNK7Riemann21CacheFriendlyAABBTree17GetBoundingVolumeEv(ptr noundef nonnull align 4 dereferenceable(28) %68)
  store ptr %69, ptr %22, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %23) #6
  %70 = load ptr, ptr %9, align 8, !tbaa !5
  %71 = load ptr, ptr %20, align 8, !tbaa !5
  %72 = load i32, ptr %21, align 4, !tbaa !13
  %73 = load ptr, ptr %10, align 8, !tbaa !5
  %74 = load ptr, ptr %11, align 8, !tbaa !5
  %75 = load ptr, ptr %22, align 8, !tbaa !5
  %76 = load ptr, ptr %12, align 8, !tbaa !5
  %77 = load ptr, ptr %13, align 8, !tbaa !5
  %78 = call noundef i32 @_ZN7RiemannL15SweepGeometriesEPKNS_8GeometryEPiiPPS0_RKN5Maths8TVector3IfEERKNS6_6TAABB3IfEEPKNS_11SweepOptionEPNS_11SweepResultE(ptr noundef %70, ptr noundef %71, i32 noundef %72, ptr noundef %73, ptr noundef nonnull align 4 dereferenceable(12) %74, ptr noundef nonnull align 4 dereferenceable(24) %75, ptr noundef %76, ptr noundef %77)
  store i32 %78, ptr %23, align 4, !tbaa !13
  %79 = load i32, ptr %23, align 4, !tbaa !13
  %80 = icmp sge i32 %79, 0
  br i1 %80, label %81, label %88

81:                                               ; preds = %61
  %82 = load ptr, ptr %12, align 8, !tbaa !5
  %83 = getelementptr inbounds %"struct.Riemann::SweepOption", ptr %82, i32 0, i32 0
  %84 = load i32, ptr %83, align 8, !tbaa !14
  %85 = icmp eq i32 %84, 1
  br i1 %85, label %86, label %87

86:                                               ; preds = %81
  store i1 true, ptr %7, align 1
  store i32 1, ptr %18, align 4
  br label %89

87:                                               ; preds = %81
  br label %88

88:                                               ; preds = %87, %61
  store i32 5, ptr %18, align 4
  br label %89

89:                                               ; preds = %88, %86
  call void @llvm.lifetime.end.p0(i64 4, ptr %23) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %21) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #6
  %90 = load i32, ptr %18, align 4
  switch i32 %90, label %225 [
    i32 5, label %212
  ]

91:                                               ; preds = %58
  call void @llvm.lifetime.start.p0(i64 8, ptr %24) #6
  %92 = load ptr, ptr %17, align 8, !tbaa !5
  %93 = getelementptr inbounds %"class.Riemann::AABBTree", ptr %28, i32 0, i32 2
  %94 = load ptr, ptr %93, align 8, !tbaa !9
  %95 = call noundef ptr @_ZN7Riemann21CacheFriendlyAABBTree11GetLeftNodeEPS0_(ptr noundef nonnull align 4 dereferenceable(28) %92, ptr noundef %94)
  store ptr %95, ptr %24, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %25) #6
  %96 = load ptr, ptr %17, align 8, !tbaa !5
  %97 = getelementptr inbounds %"class.Riemann::AABBTree", ptr %28, i32 0, i32 2
  %98 = load ptr, ptr %97, align 8, !tbaa !9
  %99 = call noundef ptr @_ZN7Riemann21CacheFriendlyAABBTree12GetRightNodeEPS0_(ptr noundef nonnull align 4 dereferenceable(28) %96, ptr noundef %98)
  store ptr %99, ptr %25, align 8, !tbaa !5
  %100 = load ptr, ptr %13, align 8, !tbaa !5
  call void @_ZN7Riemann11SweepResult12AddTestCountEi(ptr noundef nonnull align 8 dereferenceable(76) %100, i32 noundef 2)
  call void @llvm.lifetime.start.p0(i64 1, ptr %26) #6
  %101 = load ptr, ptr %9, align 8, !tbaa !5
  %102 = load ptr, ptr %11, align 8, !tbaa !5
  %103 = load ptr, ptr %24, align 8, !tbaa !5
  %104 = getelementptr inbounds %"struct.Riemann::CacheFriendlyAABBTree", ptr %103, i32 0, i32 0
  %105 = getelementptr inbounds %"class.Maths::TAABB3", ptr %104, i32 0, i32 0
  %106 = load ptr, ptr %24, align 8, !tbaa !5
  %107 = getelementptr inbounds %"struct.Riemann::CacheFriendlyAABBTree", ptr %106, i32 0, i32 0
  %108 = getelementptr inbounds %"class.Maths::TAABB3", ptr %107, i32 0, i32 1
  %109 = call noundef zeroext i1 @_ZNK7Riemann8Geometry13SweepTestFastERKN5Maths8TVector3IfEES5_S5_Pf(ptr noundef nonnull align 8 dereferenceable(204) %101, ptr noundef nonnull align 4 dereferenceable(12) %102, ptr noundef nonnull align 4 dereferenceable(12) %105, ptr noundef nonnull align 4 dereferenceable(12) %108, ptr noundef %14)
  %110 = zext i1 %109 to i8
  store i8 %110, ptr %26, align 1, !tbaa !20
  call void @llvm.lifetime.start.p0(i64 1, ptr %27) #6
  %111 = load ptr, ptr %9, align 8, !tbaa !5
  %112 = load ptr, ptr %11, align 8, !tbaa !5
  %113 = load ptr, ptr %25, align 8, !tbaa !5
  %114 = getelementptr inbounds %"struct.Riemann::CacheFriendlyAABBTree", ptr %113, i32 0, i32 0
  %115 = getelementptr inbounds %"class.Maths::TAABB3", ptr %114, i32 0, i32 0
  %116 = load ptr, ptr %25, align 8, !tbaa !5
  %117 = getelementptr inbounds %"struct.Riemann::CacheFriendlyAABBTree", ptr %116, i32 0, i32 0
  %118 = getelementptr inbounds %"class.Maths::TAABB3", ptr %117, i32 0, i32 1
  %119 = call noundef zeroext i1 @_ZNK7Riemann8Geometry13SweepTestFastERKN5Maths8TVector3IfEES5_S5_Pf(ptr noundef nonnull align 8 dereferenceable(204) %111, ptr noundef nonnull align 4 dereferenceable(12) %112, ptr noundef nonnull align 4 dereferenceable(12) %115, ptr noundef nonnull align 4 dereferenceable(12) %118, ptr noundef %15)
  %120 = zext i1 %119 to i8
  store i8 %120, ptr %27, align 1, !tbaa !20
  %121 = load ptr, ptr %12, align 8, !tbaa !5
  %122 = getelementptr inbounds %"struct.Riemann::SweepOption", ptr %121, i32 0, i32 0
  %123 = load i32, ptr %122, align 8, !tbaa !14
  %124 = icmp ne i32 %123, 2
  br i1 %124, label %125, label %160

125:                                              ; preds = %91
  %126 = load i8, ptr %26, align 1, !tbaa !20, !range !21, !noundef !22
  %127 = trunc i8 %126 to i1
  br i1 %127, label %128, label %140

128:                                              ; preds = %125
  %129 = load float, ptr %14, align 4, !tbaa !23
  %130 = load ptr, ptr %13, align 8, !tbaa !5
  %131 = getelementptr inbounds %"struct.Riemann::SweepResult", ptr %130, i32 0, i32 3
  %132 = load float, ptr %131, align 8, !tbaa !24
  %133 = fcmp olt float %129, %132
  br i1 %133, label %134, label %140

134:                                              ; preds = %128
  %135 = load float, ptr %14, align 4, !tbaa !23
  %136 = load ptr, ptr %12, align 8, !tbaa !5
  %137 = getelementptr inbounds %"struct.Riemann::SweepOption", ptr %136, i32 0, i32 2
  %138 = load float, ptr %137, align 8, !tbaa !31
  %139 = fcmp olt float %135, %138
  br label %140

140:                                              ; preds = %134, %128, %125
  %141 = phi i1 [ false, %128 ], [ false, %125 ], [ %139, %134 ]
  %142 = zext i1 %141 to i8
  store i8 %142, ptr %26, align 1, !tbaa !20
  %143 = load i8, ptr %27, align 1, !tbaa !20, !range !21, !noundef !22
  %144 = trunc i8 %143 to i1
  br i1 %144, label %145, label %157

145:                                              ; preds = %140
  %146 = load float, ptr %15, align 4, !tbaa !23
  %147 = load ptr, ptr %13, align 8, !tbaa !5
  %148 = getelementptr inbounds %"struct.Riemann::SweepResult", ptr %147, i32 0, i32 3
  %149 = load float, ptr %148, align 8, !tbaa !24
  %150 = fcmp olt float %146, %149
  br i1 %150, label %151, label %157

151:                                              ; preds = %145
  %152 = load float, ptr %15, align 4, !tbaa !23
  %153 = load ptr, ptr %12, align 8, !tbaa !5
  %154 = getelementptr inbounds %"struct.Riemann::SweepOption", ptr %153, i32 0, i32 2
  %155 = load float, ptr %154, align 8, !tbaa !31
  %156 = fcmp olt float %152, %155
  br label %157

157:                                              ; preds = %151, %145, %140
  %158 = phi i1 [ false, %145 ], [ false, %140 ], [ %156, %151 ]
  %159 = zext i1 %158 to i8
  store i8 %159, ptr %27, align 1, !tbaa !20
  br label %160

160:                                              ; preds = %157, %91
  %161 = call noundef zeroext i1 @_ZNK7Riemann11StaticStackIjLi32EE4fullEv(ptr noundef nonnull align 4 dereferenceable(132) %19)
  %162 = xor i1 %161, true
  br i1 %162, label %163, label %164

163:                                              ; preds = %160
  br label %166

164:                                              ; preds = %160
  call void @__assert_fail(ptr noundef @.str.2, ptr noundef @.str.1, i32 noundef 567, ptr noundef @__PRETTY_FUNCTION__._ZNK7Riemann8AABBTree5SweepEPKNS_8GeometryEPPS1_RKN5Maths8TVector3IfEEPKNS_11SweepOptionEPNS_11SweepResultE) #7
  unreachable

165:                                              ; No predecessors!
  br label %166

166:                                              ; preds = %165, %163
  %167 = load i8, ptr %26, align 1, !tbaa !20, !range !21, !noundef !22
  %168 = trunc i8 %167 to i1
  br i1 %168, label %169, label %197

169:                                              ; preds = %166
  %170 = load i8, ptr %27, align 1, !tbaa !20, !range !21, !noundef !22
  %171 = trunc i8 %170 to i1
  br i1 %171, label %172, label %197

172:                                              ; preds = %169
  %173 = load float, ptr %14, align 4, !tbaa !23
  %174 = load float, ptr %15, align 4, !tbaa !23
  %175 = fcmp olt float %173, %174
  br i1 %175, label %176, label %186

176:                                              ; preds = %172
  %177 = load ptr, ptr %24, align 8, !tbaa !5
  store ptr %177, ptr %17, align 8, !tbaa !5
  %178 = load ptr, ptr %25, align 8, !tbaa !5
  %179 = getelementptr inbounds %"class.Riemann::AABBTree", ptr %28, i32 0, i32 2
  %180 = load ptr, ptr %179, align 8, !tbaa !9
  %181 = ptrtoint ptr %178 to i64
  %182 = ptrtoint ptr %180 to i64
  %183 = sub i64 %181, %182
  %184 = sdiv exact i64 %183, 28
  %185 = trunc i64 %184 to i32
  call void @_ZN7Riemann11StaticStackIjLi32EE4pushEj(ptr noundef nonnull align 4 dereferenceable(132) %19, i32 noundef %185)
  br label %196

186:                                              ; preds = %172
  %187 = load ptr, ptr %25, align 8, !tbaa !5
  store ptr %187, ptr %17, align 8, !tbaa !5
  %188 = load ptr, ptr %24, align 8, !tbaa !5
  %189 = getelementptr inbounds %"class.Riemann::AABBTree", ptr %28, i32 0, i32 2
  %190 = load ptr, ptr %189, align 8, !tbaa !9
  %191 = ptrtoint ptr %188 to i64
  %192 = ptrtoint ptr %190 to i64
  %193 = sub i64 %191, %192
  %194 = sdiv exact i64 %193, 28
  %195 = trunc i64 %194 to i32
  call void @_ZN7Riemann11StaticStackIjLi32EE4pushEj(ptr noundef nonnull align 4 dereferenceable(132) %19, i32 noundef %195)
  br label %196

196:                                              ; preds = %186, %176
  store i32 4, ptr %18, align 4
  br label %210, !llvm.loop !32

197:                                              ; preds = %169, %166
  %198 = load i8, ptr %26, align 1, !tbaa !20, !range !21, !noundef !22
  %199 = trunc i8 %198 to i1
  br i1 %199, label %200, label %202

200:                                              ; preds = %197
  %201 = load ptr, ptr %24, align 8, !tbaa !5
  store ptr %201, ptr %17, align 8, !tbaa !5
  store i32 4, ptr %18, align 4
  br label %210, !llvm.loop !32

202:                                              ; preds = %197
  %203 = load i8, ptr %27, align 1, !tbaa !20, !range !21, !noundef !22
  %204 = trunc i8 %203 to i1
  br i1 %204, label %205, label %207

205:                                              ; preds = %202
  %206 = load ptr, ptr %25, align 8, !tbaa !5
  store ptr %206, ptr %17, align 8, !tbaa !5
  store i32 4, ptr %18, align 4
  br label %210, !llvm.loop !32

207:                                              ; preds = %202
  br label %208

208:                                              ; preds = %207
  br label %209

209:                                              ; preds = %208
  store i32 5, ptr %18, align 4
  br label %210

210:                                              ; preds = %209, %205, %200, %196
  call void @llvm.lifetime.end.p0(i64 1, ptr %27) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr %26) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %25) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %24) #6
  %211 = load i32, ptr %18, align 4
  switch i32 %211, label %228 [
    i32 4, label %55
    i32 5, label %212
  ]

212:                                              ; preds = %210, %89, %55
  br label %46, !llvm.loop !34

213:                                              ; preds = %46
  %214 = load ptr, ptr %13, align 8, !tbaa !5
  %215 = getelementptr inbounds %"struct.Riemann::SweepResult", ptr %214, i32 0, i32 0
  %216 = load i8, ptr %215, align 8, !tbaa !35, !range !21, !noundef !22
  %217 = trunc i8 %216 to i1
  br i1 %217, label %223, label %218

218:                                              ; preds = %213
  %219 = load ptr, ptr %13, align 8, !tbaa !5
  %220 = getelementptr inbounds %"struct.Riemann::SweepResult", ptr %219, i32 0, i32 8
  %221 = call noundef i64 @_ZNKSt6vectorIPN7Riemann8GeometryESaIS2_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %220) #6
  %222 = icmp ugt i64 %221, 0
  br i1 %222, label %223, label %224

223:                                              ; preds = %218, %213
  store i1 true, ptr %7, align 1
  store i32 1, ptr %18, align 4
  br label %225

224:                                              ; preds = %218
  store i1 false, ptr %7, align 1
  store i32 1, ptr %18, align 4
  br label %225

225:                                              ; preds = %224, %223, %89
  call void @llvm.lifetime.end.p0(i64 132, ptr %19) #6
  br label %226

226:                                              ; preds = %225, %44
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #6
  call void @llvm.lifetime.end.p0(i64 12, ptr %16) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #6
  %227 = load i1, ptr %7, align 1
  ret i1 %227

228:                                              ; preds = %210
  unreachable
}

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN5Maths8TVector3IfEC2Ev(ptr noundef nonnull align 4 dereferenceable(12)) unnamed_addr #3 align 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) #5

; Function Attrs: mustprogress uwtable
declare hidden noundef i32 @_ZN7RiemannL15SweepGeometriesEPKNS_8GeometryEPiiPPS0_RKN5Maths8TVector3IfEERKNS6_6TAABB3IfEEPKNS_11SweepOptionEPNS_11SweepResultE(ptr noundef, ptr noundef, i32 noundef, ptr noundef, ptr noundef nonnull align 4 dereferenceable(12), ptr noundef nonnull align 4 dereferenceable(24), ptr noundef, ptr noundef) #4

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN7Riemann11SweepResult12AddTestCountEi(ptr noundef nonnull align 8 dereferenceable(76), i32 noundef) #2 align 2

attributes #0 = { noreturn nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { 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 #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, !6, i64 16}
!10 = !{!"_ZTSN7Riemann8AABBTreeE", !6, i64 0, !11, i64 8, !6, i64 16}
!11 = !{!"int", !7, i64 0}
!12 = !{!10, !6, i64 0}
!13 = !{!11, !11, i64 0}
!14 = !{!15, !16, i64 0}
!15 = !{!"_ZTSN7Riemann11SweepOptionE", !16, i64 0, !17, i64 4, !18, i64 8, !19, i64 12, !6, i64 32}
!16 = !{!"_ZTSN7Riemann11SweepOption9SweepTypeE", !7, i64 0}
!17 = !{!"bool", !7, i64 0}
!18 = !{!"float", !7, i64 0}
!19 = !{!"_ZTSN7Riemann13CollisionDataE", !11, i64 0, !11, i64 4, !11, i64 8, !11, i64 12}
!20 = !{!17, !17, i64 0}
!21 = !{i8 0, i8 2}
!22 = !{}
!23 = !{!18, !18, i64 0}
!24 = !{!25, !18, i64 8}
!25 = !{!"_ZTSN7Riemann11SweepResultE", !17, i64 0, !18, i64 4, !18, i64 8, !26, i64 12, !26, i64 24, !6, i64 40, !27, i64 48, !11, i64 72}
!26 = !{!"_ZTSN5Maths8TVector3IfEE", !18, i64 0, !18, i64 4, !18, i64 8}
!27 = !{!"_ZTSSt6vectorIPN7Riemann8GeometryESaIS2_EE", !28, i64 0}
!28 = !{!"_ZTSSt12_Vector_baseIPN7Riemann8GeometryESaIS2_EE", !29, i64 0}
!29 = !{!"_ZTSNSt12_Vector_baseIPN7Riemann8GeometryESaIS2_EE12_Vector_implE", !30, i64 0}
!30 = !{!"_ZTSNSt12_Vector_baseIPN7Riemann8GeometryESaIS2_EE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!31 = !{!15, !18, i64 8}
!32 = distinct !{!32, !33}
!33 = !{!"llvm.loop.mustprogress"}
!34 = distinct !{!34, !33}
!35 = !{!25, !17, 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.Riemann::StaticStack" = type { i32, [32 x i32] }
%"struct.Riemann::CacheFriendlyAABBTree" = type { %"class.Maths::TAABB3", i32 }
%"class.Maths::TAABB3" = type { %"class.Maths::TVector3", %"class.Maths::TVector3" }

@.str.1 = external hidden unnamed_addr constant [82 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [14 x i8], align 1
@__PRETTY_FUNCTION__._ZNK7Riemann8AABBTree5SweepEPKNS_8GeometryEPPS1_RKN5Maths8TVector3IfEEPKNS_11SweepOptionEPNS_11SweepResultE = external hidden unnamed_addr constant [120 x i8], align 1

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN7Riemann11StaticStackIjLi32EEC2Ev(ptr noundef nonnull align 4 dereferenceable(132)) unnamed_addr #2 align 2

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

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

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZNK7Riemann21CacheFriendlyAABBTree16GetNumGeometriesEv(ptr noundef nonnull align 4 dereferenceable(28)) local_unnamed_addr #3 align 2

; 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 ptr @_ZN7Riemann21CacheFriendlyAABBTree11GetLeftNodeEPS0_(ptr noundef nonnull align 4 dereferenceable(28), ptr noundef) local_unnamed_addr #3 align 2

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

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(24) ptr @_ZNK7Riemann21CacheFriendlyAABBTree17GetBoundingVolumeEv(ptr noundef nonnull align 4 dereferenceable(28)) local_unnamed_addr #3 align 2

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

; Function Attrs: mustprogress uwtable
define dso_local noundef zeroext i1 @_ZNK7Riemann8AABBTree5SweepEPKNS_8GeometryEPPS1_RKN5Maths8TVector3IfEEPKNS_11SweepOptionEPNS_11SweepResultE(ptr nocapture noundef nonnull readonly align 8 dereferenceable(24) %0, ptr noundef %1, ptr noundef %2, ptr noundef nonnull align 4 dereferenceable(12) %3, ptr noundef %4, ptr noundef nonnull %5) local_unnamed_addr #4 align 2 {
  %7 = alloca float, align 4
  %8 = alloca float, align 4
  %9 = alloca %"class.Maths::TVector3", align 4
  %10 = alloca %"class.Riemann::StaticStack", align 4
  tail call void @_ZN7Riemann11SweepResult5ResetEv(ptr noundef nonnull align 8 dereferenceable(76) %5)
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %7) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %8) #6
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %9) #6
  call void @_ZN5Maths8TVector3IfEC2Ev(ptr noundef nonnull align 4 dereferenceable(12) %9)
  %11 = getelementptr inbounds i8, ptr %0, i64 16
  %12 = load ptr, ptr %11, align 8, !tbaa !5
  %13 = icmp eq ptr %12, null
  br i1 %13, label %85, label %14

14:                                               ; preds = %6
  %15 = getelementptr inbounds i8, ptr %12, i64 12
  %16 = call noundef zeroext i1 @_ZNK7Riemann8Geometry13SweepTestFastERKN5Maths8TVector3IfEES5_S5_Pf(ptr noundef nonnull align 8 dereferenceable(204) %1, ptr noundef nonnull align 4 dereferenceable(12) %3, ptr noundef nonnull align 4 dereferenceable(12) %12, ptr noundef nonnull align 4 dereferenceable(12) %15, ptr noundef nonnull %7)
  br i1 %16, label %17, label %85

17:                                               ; preds = %14
  call void @llvm.lifetime.start.p0(i64 132, ptr nonnull %10) #6
  call void @_ZN7Riemann11StaticStackIjLi32EEC2Ev(ptr noundef nonnull align 4 dereferenceable(132) %10)
  call void @_ZN7Riemann11StaticStackIjLi32EE4pushEj(ptr noundef nonnull align 4 dereferenceable(132) %10, i32 noundef 0)
  %18 = call noundef zeroext i1 @_ZNK7Riemann11StaticStackIjLi32EE5emptyEv(ptr noundef nonnull align 4 dereferenceable(132) %10)
  br i1 %18, label %._crit_edge, label %.lr.ph

.lr.ph:                                           ; preds = %17
  %19 = getelementptr inbounds i8, ptr %5, i64 8
  %20 = getelementptr inbounds i8, ptr %4, i64 8
  br label %21

21:                                               ; preds = %.lr.ph, %.critedge
  %22 = load ptr, ptr %11, align 8, !tbaa !5
  %23 = call noundef i32 @_ZN7Riemann11StaticStackIjLi32EE3popEv(ptr noundef nonnull align 4 dereferenceable(132) %10)
  %.not6478 = icmp eq ptr %22, null
  br i1 %.not6478, label %.critedge, label %.lr.ph81

.lr.ph81:                                         ; preds = %21
  %24 = zext i32 %23 to i64
  %25 = getelementptr inbounds %"struct.Riemann::CacheFriendlyAABBTree", ptr %22, i64 %24
  br label %.backedge

.backedge:                                        ; preds = %.backedge.backedge, %.lr.ph81
  %.05679 = phi ptr [ %25, %.lr.ph81 ], [ %.05679.be, %.backedge.backedge ]
  %26 = call noundef zeroext i1 @_ZNK7Riemann21CacheFriendlyAABBTree6IsLeafEv(ptr noundef nonnull align 4 dereferenceable(28) %.05679)
  br i1 %26, label %27, label %37

27:                                               ; preds = %.backedge
  %28 = load ptr, ptr %0, align 8, !tbaa !11
  %29 = call noundef ptr @_ZNK7Riemann21CacheFriendlyAABBTree18GetGeometryIndicesEPi(ptr noundef nonnull align 4 dereferenceable(28) %.05679, ptr noundef %28)
  %30 = call noundef i32 @_ZNK7Riemann21CacheFriendlyAABBTree16GetNumGeometriesEv(ptr noundef nonnull align 4 dereferenceable(28) %.05679)
  %31 = call noundef nonnull align 4 dereferenceable(24) ptr @_ZNK7Riemann21CacheFriendlyAABBTree17GetBoundingVolumeEv(ptr noundef nonnull align 4 dereferenceable(28) %.05679)
  %32 = call noundef i32 @_ZN7RiemannL15SweepGeometriesEPKNS_8GeometryEPiiPPS0_RKN5Maths8TVector3IfEERKNS6_6TAABB3IfEEPKNS_11SweepOptionEPNS_11SweepResultE(ptr noundef nonnull %1, ptr noundef %29, i32 noundef %30, ptr noundef %2, ptr noundef nonnull align 4 dereferenceable(12) %3, ptr noundef nonnull align 4 dereferenceable(24) %31, ptr noundef %4, ptr noundef nonnull %5)
  %33 = icmp sgt i32 %32, -1
  br i1 %33, label %34, label %.critedge

34:                                               ; preds = %27
  %35 = load i32, ptr %4, align 8, !tbaa !12
  %36 = icmp eq i32 %35, 1
  br i1 %36, label %.loopexit, label %.critedge

37:                                               ; preds = %.backedge
  %38 = load ptr, ptr %11, align 8, !tbaa !5
  %39 = call noundef ptr @_ZN7Riemann21CacheFriendlyAABBTree11GetLeftNodeEPS0_(ptr noundef nonnull align 4 dereferenceable(28) %.05679, ptr noundef %38)
  %40 = load ptr, ptr %11, align 8, !tbaa !5
  %41 = call noundef ptr @_ZN7Riemann21CacheFriendlyAABBTree12GetRightNodeEPS0_(ptr noundef nonnull align 4 dereferenceable(28) %.05679, ptr noundef %40)
  call void @_ZN7Riemann11SweepResult12AddTestCountEi(ptr noundef nonnull align 8 dereferenceable(76) %5, i32 noundef 2)
  %42 = getelementptr inbounds i8, ptr %39, i64 12
  %43 = call noundef zeroext i1 @_ZNK7Riemann8Geometry13SweepTestFastERKN5Maths8TVector3IfEES5_S5_Pf(ptr noundef nonnull align 8 dereferenceable(204) %1, ptr noundef nonnull align 4 dereferenceable(12) %3, ptr noundef nonnull align 4 dereferenceable(12) %39, ptr noundef nonnull align 4 dereferenceable(12) %42, ptr noundef nonnull %7)
  %44 = getelementptr inbounds i8, ptr %41, i64 12
  %45 = call noundef zeroext i1 @_ZNK7Riemann8Geometry13SweepTestFastERKN5Maths8TVector3IfEES5_S5_Pf(ptr noundef nonnull align 8 dereferenceable(204) %1, ptr noundef nonnull align 4 dereferenceable(12) %3, ptr noundef nonnull align 4 dereferenceable(12) %41, ptr noundef nonnull align 4 dereferenceable(12) %44, ptr noundef nonnull %8)
  %46 = load i32, ptr %4, align 8, !tbaa !12
  %.not65 = icmp eq i32 %46, 2
  br i1 %.not65, label %64, label %47

47:                                               ; preds = %37
  br i1 %43, label %48, label %55

48:                                               ; preds = %47
  %49 = load float, ptr %7, align 4, !tbaa !18
  %50 = load float, ptr %19, align 8, !tbaa !19
  %51 = fcmp olt float %49, %50
  br i1 %51, label %52, label %55

52:                                               ; preds = %48
  %53 = load float, ptr %20, align 8, !tbaa !26
  %54 = fcmp olt float %49, %53
  br label %55

55:                                               ; preds = %52, %48, %47
  %56 = phi i1 [ false, %48 ], [ false, %47 ], [ %54, %52 ]
  br i1 %45, label %57, label %64

57:                                               ; preds = %55
  %58 = load float, ptr %8, align 4, !tbaa !18
  %59 = load float, ptr %19, align 8, !tbaa !19
  %60 = fcmp olt float %58, %59
  br i1 %60, label %61, label %64

61:                                               ; preds = %57
  %62 = load float, ptr %20, align 8, !tbaa !26
  %63 = fcmp olt float %58, %62
  br label %64

64:                                               ; preds = %55, %57, %61, %37
  %.054.in = phi i1 [ %43, %37 ], [ %56, %61 ], [ %56, %57 ], [ %56, %55 ]
  %.0.in = phi i1 [ %45, %37 ], [ %63, %61 ], [ false, %57 ], [ false, %55 ]
  %65 = call noundef zeroext i1 @_ZNK7Riemann11StaticStackIjLi32EE4fullEv(ptr noundef nonnull align 4 dereferenceable(132) %10)
  br i1 %65, label %66, label %67

66:                                               ; preds = %64
  call void @__assert_fail(ptr noundef nonnull @.str.2, ptr noundef nonnull @.str.1, i32 noundef 567, ptr noundef nonnull @__PRETTY_FUNCTION__._ZNK7Riemann8AABBTree5SweepEPKNS_8GeometryEPPS1_RKN5Maths8TVector3IfEEPKNS_11SweepOptionEPNS_11SweepResultE) #7
  unreachable

67:                                               ; preds = %64
  %68 = select i1 %.054.in, i1 %.0.in, i1 false
  br i1 %68, label %.backedge.sink.split, label %78

.backedge.sink.split:                             ; preds = %67
  %69 = load float, ptr %7, align 4, !tbaa !18
  %70 = load float, ptr %8, align 4, !tbaa !18
  %71 = fcmp olt float %69, %70
  %72 = load ptr, ptr %11, align 8, !tbaa !5
  %73 = ptrtoint ptr %72 to i64
  %. = select i1 %71, ptr %41, ptr %39
  %.75 = select i1 %71, ptr %39, ptr %41
  %74 = ptrtoint ptr %. to i64
  %75 = sub i64 %74, %73
  %76 = sdiv exact i64 %75, 28
  %77 = trunc i64 %76 to i32
  call void @_ZN7Riemann11StaticStackIjLi32EE4pushEj(ptr noundef nonnull align 4 dereferenceable(132) %10, i32 noundef %77)
  br label %.backedge.backedge

.backedge.backedge:                               ; preds = %.backedge.sink.split, %78
  %.05679.be = phi ptr [ %spec.select66, %78 ], [ %.75, %.backedge.sink.split ]
  br label %.backedge

78:                                               ; preds = %67
  %..056 = select i1 %.0.in, ptr %41, ptr %.05679
  %spec.select = select i1 %.054.in, i1 true, i1 %.0.in
  %spec.select66 = select i1 %.054.in, ptr %39, ptr %..056
  br i1 %spec.select, label %.backedge.backedge, label %.critedge

.critedge:                                        ; preds = %78, %21, %27, %34
  %79 = call noundef zeroext i1 @_ZNK7Riemann11StaticStackIjLi32EE5emptyEv(ptr noundef nonnull align 4 dereferenceable(132) %10)
  br i1 %79, label %._crit_edge, label %21, !llvm.loop !27

._crit_edge:                                      ; preds = %.critedge, %17
  %80 = load i8, ptr %5, align 8, !tbaa !29, !range !30, !noundef !31
  %81 = trunc nuw i8 %80 to i1
  br i1 %81, label %.loopexit, label %82

82:                                               ; preds = %._crit_edge
  %83 = getelementptr inbounds i8, ptr %5, i64 48
  %84 = call noundef i64 @_ZNKSt6vectorIPN7Riemann8GeometryESaIS2_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %83) #6
  %.not = icmp ne i64 %84, 0
  br label %.loopexit

.loopexit:                                        ; preds = %34, %82, %._crit_edge
  %.3 = phi i1 [ true, %._crit_edge ], [ %.not, %82 ], [ true, %34 ]
  call void @llvm.lifetime.end.p0(i64 132, ptr nonnull %10) #6
  br label %85

85:                                               ; preds = %6, %14, %.loopexit
  %.4 = phi i1 [ %.3, %.loopexit ], [ false, %14 ], [ false, %6 ]
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %9) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %8) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %7) #6
  ret i1 %.4
}

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN5Maths8TVector3IfEC2Ev(ptr noundef nonnull align 4 dereferenceable(12)) unnamed_addr #3 align 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 i32 @_ZN7RiemannL15SweepGeometriesEPKNS_8GeometryEPiiPPS0_RKN5Maths8TVector3IfEERKNS6_6TAABB3IfEEPKNS_11SweepOptionEPNS_11SweepResultE(ptr noundef, ptr noundef, i32 noundef, ptr noundef, ptr noundef nonnull align 4 dereferenceable(12), ptr noundef nonnull align 4 dereferenceable(24), 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 #2 align 2

attributes #0 = { noreturn nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { 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 #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 16}
!6 = !{!"_ZTSN7Riemann8AABBTreeE", !7, i64 0, !10, i64 8, !7, i64 16}
!7 = !{!"any pointer", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!"int", !8, i64 0}
!11 = !{!6, !7, i64 0}
!12 = !{!13, !14, i64 0}
!13 = !{!"_ZTSN7Riemann11SweepOptionE", !14, i64 0, !15, i64 4, !16, i64 8, !17, i64 12, !7, i64 32}
!14 = !{!"_ZTSN7Riemann11SweepOption9SweepTypeE", !8, i64 0}
!15 = !{!"bool", !8, i64 0}
!16 = !{!"float", !8, i64 0}
!17 = !{!"_ZTSN7Riemann13CollisionDataE", !10, i64 0, !10, i64 4, !10, i64 8, !10, i64 12}
!18 = !{!16, !16, i64 0}
!19 = !{!20, !16, i64 8}
!20 = !{!"_ZTSN7Riemann11SweepResultE", !15, i64 0, !16, i64 4, !16, i64 8, !21, i64 12, !21, i64 24, !7, i64 40, !22, i64 48, !10, i64 72}
!21 = !{!"_ZTSN5Maths8TVector3IfEE", !16, i64 0, !16, i64 4, !16, i64 8}
!22 = !{!"_ZTSSt6vectorIPN7Riemann8GeometryESaIS2_EE", !23, i64 0}
!23 = !{!"_ZTSSt12_Vector_baseIPN7Riemann8GeometryESaIS2_EE", !24, i64 0}
!24 = !{!"_ZTSNSt12_Vector_baseIPN7Riemann8GeometryESaIS2_EE12_Vector_implE", !25, i64 0}
!25 = !{!"_ZTSNSt12_Vector_baseIPN7Riemann8GeometryESaIS2_EE17_Vector_impl_dataE", !7, i64 0, !7, i64 8, !7, i64 16}
!26 = !{!13, !16, i64 8}
!27 = distinct !{!27, !28}
!28 = !{!"llvm.loop.mustprogress"}
!29 = !{!20, !15, i64 0}
!30 = !{i8 0, i8 2}
!31 = !{}


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