; LLVM IR from atlantis13579/Riemann :: Src/CollisionPrimitive (TriangleMesh)

; 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 }
%"struct.Riemann::LeafNode" = type { i32 }
%"class.Riemann::Sphere3" = type { %"class.Maths::TVector3", float }
%"struct.Riemann::TriMeshSweepOption" = type { i8, i8, float }
%"class.Riemann::StaticMesh" = type { i32, i32, %"class.std::vector", %"class.std::vector.0", %"class.std::vector", %"class.std::vector", %"class.Maths::TAABB3", i8, %"class.std::__cxx11::basic_string", ptr, ptr }
%"class.std::vector.0" = type { %"struct.std::_Vector_base.1" }
%"struct.std::_Vector_base.1" = type { %"struct.std::_Vector_base<unsigned short, std::allocator<unsigned short>>::_Vector_impl" }
%"struct.std::_Vector_base<unsigned short, std::allocator<unsigned short>>::_Vector_impl" = type { %"struct.std::_Vector_base<unsigned short, std::allocator<unsigned short>>::_Vector_impl_data" }
%"struct.std::_Vector_base<unsigned short, std::allocator<unsigned short>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<Maths::TVector3<float>, std::allocator<Maths::TVector3<float>>>::_Vector_impl" }
%"struct.std::_Vector_base<Maths::TVector3<float>, std::allocator<Maths::TVector3<float>>>::_Vector_impl" = type { %"struct.std::_Vector_base<Maths::TVector3<float>, std::allocator<Maths::TVector3<float>>>::_Vector_impl_data" }
%"struct.std::_Vector_base<Maths::TVector3<float>, std::allocator<Maths::TVector3<float>>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.Maths::TAABB3" = type { %"class.Maths::TVector3", %"class.Maths::TVector3" }
%"class.std::__cxx11::basic_string" = type { %"struct.std::__cxx11::basic_string<char>::_Alloc_hider", i64, %union.anon }
%"struct.std::__cxx11::basic_string<char>::_Alloc_hider" = type { ptr }
%union.anon = type { i64, [8 x i8] }
%"struct.Riemann::TriMeshSweepResult" = type { float, %"class.Maths::TVector3", %"class.Maths::TVector3", i32, i32 }

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

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

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

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNK7Riemann10StaticMesh14GetVertIndicesEjRjS1_S1_(ptr noundef nonnull align 8 dereferenceable(184), i32 noundef, ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) #1 align 2

; Function Attrs: mustprogress uwtable
define dso_local noundef zeroext i1 @_ZN7Riemann12TriangleMesh14SphereSweepTriEjRKN5Maths8TVector3IfEES5_fRKNS_18TriMeshSweepOptionEPNS_18TriMeshSweepResultE(ptr noundef nonnull align 8 dereferenceable(192) %0, i32 noundef %1, ptr noundef nonnull align 4 dereferenceable(12) %2, ptr noundef nonnull align 4 dereferenceable(12) %3, float noundef %4, ptr noundef nonnull align 4 dereferenceable(8) %5, ptr noundef %6) #1 align 2 {
  %8 = alloca i1, align 1
  %9 = alloca ptr, align 8
  %10 = alloca i32, align 4
  %11 = alloca ptr, align 8
  %12 = alloca ptr, align 8
  %13 = alloca float, align 4
  %14 = alloca ptr, align 8
  %15 = alloca ptr, align 8
  %16 = alloca i8, align 1
  %17 = alloca i8, align 1
  %18 = alloca float, align 4
  %19 = alloca i8, align 1
  %20 = alloca i8, align 1
  %21 = alloca %"class.Maths::TVector3", align 4
  %22 = alloca float, align 4
  %23 = alloca float, align 4
  %24 = alloca float, align 4
  %25 = alloca %"class.Maths::TVector3", align 4
  %26 = alloca i32, align 4
  %27 = alloca [3 x %"class.Maths::TVector3"], align 16
  %28 = alloca %"struct.Riemann::LeafNode", align 4
  %29 = alloca i32, align 4
  %30 = alloca i32, align 4
  %31 = alloca %"class.Riemann::Sphere3", align 4
  %32 = alloca i32, align 4
  %33 = alloca i32, align 4
  %34 = alloca i32, align 4
  %35 = alloca i32, align 4
  %36 = alloca i32, align 4
  %37 = alloca i32, align 4
  %38 = alloca ptr, align 8
  %39 = alloca ptr, align 8
  %40 = alloca ptr, align 8
  %41 = alloca %"class.Maths::TVector3", align 4
  %42 = alloca float, align 4
  %43 = alloca float, align 4
  %44 = alloca %"class.Maths::TVector3", align 4
  %45 = alloca %"class.Maths::TVector3", align 4
  %46 = alloca float, align 4
  %47 = alloca %"class.Maths::TVector3", align 4
  store ptr %0, ptr %9, align 8, !tbaa !5
  store i32 %1, ptr %10, align 4, !tbaa !9
  store ptr %2, ptr %11, align 8, !tbaa !5
  store ptr %3, ptr %12, align 8, !tbaa !5
  store float %4, ptr %13, align 4, !tbaa !11
  store ptr %5, ptr %14, align 8, !tbaa !5
  store ptr %6, ptr %15, align 8, !tbaa !5
  %48 = load ptr, ptr %9, align 8
  call void @llvm.lifetime.start.p0(i64 1, ptr %16) #6
  store i8 1, ptr %16, align 1, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 1, ptr %17) #6
  %49 = load ptr, ptr %14, align 8, !tbaa !5
  %50 = getelementptr inbounds %"struct.Riemann::TriMeshSweepOption", ptr %49, i32 0, i32 0
  %51 = load i8, ptr %50, align 4, !tbaa !15, !range !17, !noundef !18
  %52 = trunc i8 %51 to i1
  %53 = zext i1 %52 to i8
  store i8 %53, ptr %17, align 1, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #6
  %54 = load ptr, ptr %14, align 8, !tbaa !5
  %55 = getelementptr inbounds %"struct.Riemann::TriMeshSweepOption", ptr %54, i32 0, i32 2
  %56 = load float, ptr %55, align 4, !tbaa !19
  store float %56, ptr %18, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 1, ptr %19) #6
  %57 = load ptr, ptr %14, align 8, !tbaa !5
  %58 = getelementptr inbounds %"struct.Riemann::TriMeshSweepOption", ptr %57, i32 0, i32 1
  %59 = load i8, ptr %58, align 1, !tbaa !20, !range !17, !noundef !18
  %60 = trunc i8 %59 to i1
  %61 = xor i1 %60, true
  %62 = zext i1 %61 to i8
  store i8 %62, ptr %19, align 1, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 1, ptr %20) #6
  store i8 0, ptr %20, align 1, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 12, ptr %21) #6
  %63 = load ptr, ptr %11, align 8, !tbaa !5
  call void @_ZN5Maths8TVector3IfEC2ERKS1_(ptr noundef nonnull align 4 dereferenceable(12) %21, ptr noundef nonnull align 4 dereferenceable(12) %63)
  call void @llvm.lifetime.start.p0(i64 4, ptr %22) #6
  %64 = load float, ptr %18, align 4, !tbaa !11
  store float %64, ptr %22, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %23) #6
  %65 = load ptr, ptr %12, align 8, !tbaa !5
  %66 = call noundef float @_ZNK5Maths8TVector3IfE3DotERKS1_(ptr noundef nonnull align 4 dereferenceable(12) %21, ptr noundef nonnull align 4 dereferenceable(12) %65)
  store float %66, ptr %23, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %24) #6
  store float 2.000000e+00, ptr %24, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 12, ptr %25) #6
  call void @_ZN5Maths8TVector3IfE4ZeroEv(ptr dead_on_unwind writable sret(%"class.Maths::TVector3") align 4 %25)
  call void @llvm.lifetime.start.p0(i64 4, ptr %26) #6
  store i32 -1, ptr %26, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 36, ptr %27) #6
  %67 = getelementptr inbounds [3 x %"class.Maths::TVector3"], ptr %27, i32 0, i32 0
  %68 = getelementptr inbounds %"class.Maths::TVector3", ptr %67, i64 3
  br label %69

69:                                               ; preds = %69, %7
  %70 = phi ptr [ %67, %7 ], [ %71, %69 ]
  call void @_ZN5Maths8TVector3IfEC2Ev(ptr noundef nonnull align 4 dereferenceable(12) %70)
  %71 = getelementptr inbounds %"class.Maths::TVector3", ptr %70, i64 1
  %72 = icmp eq ptr %71, %68
  br i1 %72, label %73, label %69

73:                                               ; preds = %69
  call void @llvm.lifetime.start.p0(i64 4, ptr %28) #6
  %74 = load i32, ptr %10, align 4, !tbaa !9
  call void @_ZN7Riemann8LeafNodeC2Ej(ptr noundef nonnull align 4 dereferenceable(4) %28, i32 noundef %74)
  call void @llvm.lifetime.start.p0(i64 4, ptr %29) #6
  %75 = call noundef i32 @_ZNK7Riemann8LeafNode15GetNumTrianglesEv(ptr noundef nonnull align 4 dereferenceable(4) %28)
  store i32 %75, ptr %29, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %30) #6
  %76 = call noundef i32 @_ZNK7Riemann8LeafNode16GetTriangleIndexEv(ptr noundef nonnull align 4 dereferenceable(4) %28)
  store i32 %76, ptr %30, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 16, ptr %31) #6
  %77 = load ptr, ptr %11, align 8, !tbaa !5
  %78 = load float, ptr %13, align 4, !tbaa !11
  call void @_ZN7Riemann7Sphere3C2ERKN5Maths8TVector3IfEEf(ptr noundef nonnull align 4 dereferenceable(16) %31, ptr noundef nonnull align 4 dereferenceable(12) %77, float noundef %78)
  call void @llvm.lifetime.start.p0(i64 4, ptr %32) #6
  store i32 0, ptr %32, align 4, !tbaa !9
  br label %79

79:                                               ; preds = %191, %73
  %80 = load i32, ptr %32, align 4, !tbaa !9
  %81 = load i32, ptr %29, align 4, !tbaa !9
  %82 = icmp slt i32 %80, %81
  br i1 %82, label %84, label %83

83:                                               ; preds = %79
  store i32 2, ptr %33, align 4
  br label %194

84:                                               ; preds = %79
  %85 = load ptr, ptr %15, align 8, !tbaa !5
  call void @_ZN7Riemann18TriMeshSweepResult12AddTestCountEi(ptr noundef nonnull align 4 dereferenceable(36) %85, i32 noundef 1)
  call void @llvm.lifetime.start.p0(i64 4, ptr %34) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %35) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %36) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %37) #6
  %86 = load i32, ptr %30, align 4, !tbaa !9
  %87 = load i32, ptr %32, align 4, !tbaa !9
  %88 = add i32 %86, %87
  store i32 %88, ptr %37, align 4, !tbaa !9
  %89 = load i32, ptr %37, align 4, !tbaa !9
  call void @_ZNK7Riemann10StaticMesh14GetVertIndicesEjRjS1_S1_(ptr noundef nonnull align 8 dereferenceable(184) %48, i32 noundef %89, ptr noundef nonnull align 4 dereferenceable(4) %34, ptr noundef nonnull align 4 dereferenceable(4) %35, ptr noundef nonnull align 4 dereferenceable(4) %36)
  call void @llvm.lifetime.start.p0(i64 8, ptr %38) #6
  %90 = getelementptr inbounds %"class.Riemann::StaticMesh", ptr %48, i32 0, i32 9
  %91 = load ptr, ptr %90, align 8, !tbaa !21
  %92 = load i32, ptr %34, align 4, !tbaa !9
  %93 = zext i32 %92 to i64
  %94 = getelementptr inbounds %"class.Maths::TVector3", ptr %91, i64 %93
  store ptr %94, ptr %38, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %39) #6
  %95 = getelementptr inbounds %"class.Riemann::StaticMesh", ptr %48, i32 0, i32 9
  %96 = load ptr, ptr %95, align 8, !tbaa !21
  %97 = load i32, ptr %35, align 4, !tbaa !9
  %98 = zext i32 %97 to i64
  %99 = getelementptr inbounds %"class.Maths::TVector3", ptr %96, i64 %98
  store ptr %99, ptr %39, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %40) #6
  %100 = getelementptr inbounds %"class.Riemann::StaticMesh", ptr %48, i32 0, i32 9
  %101 = load ptr, ptr %100, align 8, !tbaa !21
  %102 = load i32, ptr %36, align 4, !tbaa !9
  %103 = zext i32 %102 to i64
  %104 = getelementptr inbounds %"class.Maths::TVector3", ptr %101, i64 %103
  store ptr %104, ptr %40, align 8, !tbaa !5
  %105 = load ptr, ptr %12, align 8, !tbaa !5
  %106 = load float, ptr %22, align 4, !tbaa !11
  %107 = load float, ptr %13, align 4, !tbaa !11
  %108 = load ptr, ptr %38, align 8, !tbaa !5
  %109 = load ptr, ptr %39, align 8, !tbaa !5
  %110 = load ptr, ptr %40, align 8, !tbaa !5
  %111 = call noundef zeroext i1 @_ZN7RiemannL13cullTriangle1ERKN5Maths8TVector3IfEES4_ffS4_S4_S4_(ptr noundef nonnull align 4 dereferenceable(12) %21, ptr noundef nonnull align 4 dereferenceable(12) %105, float noundef %106, float noundef %107, ptr noundef nonnull align 4 dereferenceable(12) %108, ptr noundef nonnull align 4 dereferenceable(12) %109, ptr noundef nonnull align 4 dereferenceable(12) %110)
  br i1 %111, label %113, label %112

112:                                              ; preds = %84
  store i32 4, ptr %33, align 4
  br label %188

113:                                              ; preds = %84
  %114 = load ptr, ptr %12, align 8, !tbaa !5
  %115 = load float, ptr %13, align 4, !tbaa !11
  %116 = load float, ptr %22, align 4, !tbaa !11
  %117 = load float, ptr %23, align 4, !tbaa !11
  %118 = load ptr, ptr %38, align 8, !tbaa !5
  %119 = load ptr, ptr %39, align 8, !tbaa !5
  %120 = load ptr, ptr %40, align 8, !tbaa !5
  %121 = call noundef zeroext i1 @_ZN7RiemannL13cullTriangle2ERKN5Maths8TVector3IfEEfffS4_S4_S4_(ptr noundef nonnull align 4 dereferenceable(12) %114, float noundef %115, float noundef %116, float noundef %117, ptr noundef nonnull align 4 dereferenceable(12) %118, ptr noundef nonnull align 4 dereferenceable(12) %119, ptr noundef nonnull align 4 dereferenceable(12) %120)
  br i1 %121, label %123, label %122

122:                                              ; preds = %113
  store i32 4, ptr %33, align 4
  br label %188

123:                                              ; preds = %113
  call void @llvm.lifetime.start.p0(i64 12, ptr %41) #6
  %124 = load ptr, ptr %38, align 8, !tbaa !5
  %125 = load ptr, ptr %39, align 8, !tbaa !5
  %126 = load ptr, ptr %40, align 8, !tbaa !5
  call void @_ZN7Riemann9Triangle315CalculateNormalERKN5Maths8TVector3IfEES5_S5_b(ptr dead_on_unwind writable sret(%"class.Maths::TVector3") align 4 %41, ptr noundef nonnull align 4 dereferenceable(12) %124, ptr noundef nonnull align 4 dereferenceable(12) %125, ptr noundef nonnull align 4 dereferenceable(12) %126, i1 noundef zeroext false)
  call void @llvm.lifetime.start.p0(i64 4, ptr %42) #6
  %127 = call noundef float @_ZNK5Maths8TVector3IfE6LengthEv(ptr noundef nonnull align 4 dereferenceable(12) %41)
  store float %127, ptr %42, align 4, !tbaa !11
  %128 = load float, ptr %42, align 4, !tbaa !11
  %129 = fcmp oeq float %128, 0.000000e+00
  br i1 %129, label %130, label %131

130:                                              ; preds = %123
  store i32 4, ptr %33, align 4
  br label %187

131:                                              ; preds = %123
  %132 = load float, ptr %42, align 4, !tbaa !11
  call void @_ZN5Maths8TVector3IfEdVEf(ptr noundef nonnull align 4 dereferenceable(12) %41, float noundef %132)
  call void @llvm.lifetime.start.p0(i64 4, ptr %43) #6
  call void @llvm.lifetime.start.p0(i64 12, ptr %44) #6
  call void @_ZN5Maths8TVector3IfEC2Ev(ptr noundef nonnull align 4 dereferenceable(12) %44)
  call void @llvm.lifetime.start.p0(i64 12, ptr %45) #6
  call void @_ZN5Maths8TVector3IfEC2Ev(ptr noundef nonnull align 4 dereferenceable(12) %45)
  %133 = load ptr, ptr %12, align 8, !tbaa !5
  %134 = load ptr, ptr %38, align 8, !tbaa !5
  %135 = load ptr, ptr %39, align 8, !tbaa !5
  %136 = load ptr, ptr %40, align 8, !tbaa !5
  %137 = call noundef zeroext i1 @_ZNK7Riemann7Sphere313SweepTriangleERKN5Maths8TVector3IfEES5_S5_S5_PS3_S6_Pf(ptr noundef nonnull align 4 dereferenceable(16) %31, ptr noundef nonnull align 4 dereferenceable(12) %133, ptr noundef nonnull align 4 dereferenceable(12) %134, ptr noundef nonnull align 4 dereferenceable(12) %135, ptr noundef nonnull align 4 dereferenceable(12) %136, ptr noundef %44, ptr noundef %45, ptr noundef %43)
  br i1 %137, label %139, label %138

138:                                              ; preds = %131
  store i32 4, ptr %33, align 4
  br label %186

139:                                              ; preds = %131
  %140 = load float, ptr %43, align 4, !tbaa !11
  %141 = load float, ptr %18, align 4, !tbaa !11
  %142 = fcmp ogt float %140, %141
  br i1 %142, label %143, label %144

143:                                              ; preds = %139
  store i32 4, ptr %33, align 4
  br label %186

144:                                              ; preds = %139
  call void @llvm.lifetime.start.p0(i64 4, ptr %46) #6
  %145 = load ptr, ptr %12, align 8, !tbaa !5
  %146 = call noundef float @_ZN7Riemann9Triangle321ComputeAlignmentValueERKN5Maths8TVector3IfEES5_(ptr noundef nonnull align 4 dereferenceable(12) %41, ptr noundef nonnull align 4 dereferenceable(12) %145)
  store float %146, ptr %46, align 4, !tbaa !11
  %147 = load float, ptr %43, align 4, !tbaa !11
  %148 = load float, ptr %46, align 4, !tbaa !11
  %149 = load float, ptr %22, align 4, !tbaa !11
  %150 = load float, ptr %24, align 4, !tbaa !11
  %151 = call noundef zeroext i1 @_ZN7Riemann9Triangle316IsBetterTriangleEffff(float noundef %147, float noundef %148, float noundef %149, float noundef %150)
  br i1 %151, label %153, label %152

152:                                              ; preds = %144
  store i32 4, ptr %33, align 4
  br label %185

153:                                              ; preds = %144
  %154 = load float, ptr %43, align 4, !tbaa !11
  %155 = fcmp oeq float %154, 0.000000e+00
  br i1 %155, label %156, label %167

156:                                              ; preds = %153
  %157 = load ptr, ptr %11, align 8, !tbaa !5
  %158 = load ptr, ptr %15, align 8, !tbaa !5
  %159 = getelementptr inbounds %"struct.Riemann::TriMeshSweepResult", ptr %158, i32 0, i32 1
  %160 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZN5Maths8TVector3IfEaSERKS1_(ptr noundef nonnull align 4 dereferenceable(12) %159, ptr noundef nonnull align 4 dereferenceable(12) %157)
  call void @llvm.lifetime.start.p0(i64 12, ptr %47) #6
  %161 = load ptr, ptr %12, align 8, !tbaa !5
  call void @_ZNK5Maths8TVector3IfEngEv(ptr dead_on_unwind writable sret(%"class.Maths::TVector3") align 4 %47, ptr noundef nonnull align 4 dereferenceable(12) %161)
  %162 = load ptr, ptr %15, align 8, !tbaa !5
  %163 = getelementptr inbounds %"struct.Riemann::TriMeshSweepResult", ptr %162, i32 0, i32 2
  %164 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZN5Maths8TVector3IfEaSERKS1_(ptr noundef nonnull align 4 dereferenceable(12) %163, ptr noundef nonnull align 4 dereferenceable(12) %47)
  call void @llvm.lifetime.end.p0(i64 12, ptr %47) #6
  %165 = load ptr, ptr %15, align 8, !tbaa !5
  %166 = getelementptr inbounds %"struct.Riemann::TriMeshSweepResult", ptr %165, i32 0, i32 0
  store float 0.000000e+00, ptr %166, align 4, !tbaa !36
  store i1 true, ptr %8, align 1
  store i32 1, ptr %33, align 4
  br label %185

167:                                              ; preds = %153
  %168 = load i32, ptr %32, align 4, !tbaa !9
  store i32 %168, ptr %26, align 4, !tbaa !9
  %169 = load float, ptr %43, align 4, !tbaa !11
  store float %169, ptr %22, align 4, !tbaa !11
  %170 = load float, ptr %46, align 4, !tbaa !11
  store float %170, ptr %24, align 4, !tbaa !11
  %171 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZN5Maths8TVector3IfEaSERKS1_(ptr noundef nonnull align 4 dereferenceable(12) %25, ptr noundef nonnull align 4 dereferenceable(12) %41)
  %172 = load ptr, ptr %38, align 8, !tbaa !5
  %173 = getelementptr inbounds [3 x %"class.Maths::TVector3"], ptr %27, i64 0, i64 0
  %174 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZN5Maths8TVector3IfEaSERKS1_(ptr noundef nonnull align 4 dereferenceable(12) %173, ptr noundef nonnull align 4 dereferenceable(12) %172)
  %175 = load ptr, ptr %39, align 8, !tbaa !5
  %176 = getelementptr inbounds [3 x %"class.Maths::TVector3"], ptr %27, i64 0, i64 1
  %177 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZN5Maths8TVector3IfEaSERKS1_(ptr noundef nonnull align 4 dereferenceable(12) %176, ptr noundef nonnull align 4 dereferenceable(12) %175)
  %178 = load ptr, ptr %40, align 8, !tbaa !5
  %179 = getelementptr inbounds [3 x %"class.Maths::TVector3"], ptr %27, i64 0, i64 2
  %180 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZN5Maths8TVector3IfEaSERKS1_(ptr noundef nonnull align 4 dereferenceable(12) %179, ptr noundef nonnull align 4 dereferenceable(12) %178)
  %181 = load i8, ptr %19, align 1, !tbaa !13, !range !17, !noundef !18
  %182 = trunc i8 %181 to i1
  br i1 %182, label %183, label %184

183:                                              ; preds = %167
  store i32 2, ptr %33, align 4
  br label %185

184:                                              ; preds = %167
  store i32 0, ptr %33, align 4
  br label %185

185:                                              ; preds = %184, %183, %156, %152
  call void @llvm.lifetime.end.p0(i64 4, ptr %46) #6
  br label %186

186:                                              ; preds = %185, %143, %138
  call void @llvm.lifetime.end.p0(i64 12, ptr %45) #6
  call void @llvm.lifetime.end.p0(i64 12, ptr %44) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %43) #6
  br label %187

187:                                              ; preds = %186, %130
  call void @llvm.lifetime.end.p0(i64 4, ptr %42) #6
  call void @llvm.lifetime.end.p0(i64 12, ptr %41) #6
  br label %188

188:                                              ; preds = %187, %122, %112
  call void @llvm.lifetime.end.p0(i64 8, ptr %40) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %39) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %38) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %37) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %36) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %35) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %34) #6
  %189 = load i32, ptr %33, align 4
  switch i32 %189, label %194 [
    i32 0, label %190
    i32 4, label %191
  ]

190:                                              ; preds = %188
  br label %191

191:                                              ; preds = %190, %188
  %192 = load i32, ptr %32, align 4, !tbaa !9
  %193 = add nsw i32 %192, 1
  store i32 %193, ptr %32, align 4, !tbaa !9
  br label %79, !llvm.loop !38

194:                                              ; preds = %188, %83
  call void @llvm.lifetime.end.p0(i64 4, ptr %32) #6
  %195 = load i32, ptr %33, align 4
  switch i32 %195, label %207 [
    i32 2, label %196
  ]

196:                                              ; preds = %194
  %197 = load i32, ptr %26, align 4, !tbaa !9
  %198 = icmp slt i32 %197, 0
  br i1 %198, label %199, label %200

199:                                              ; preds = %196
  store i1 false, ptr %8, align 1
  store i32 1, ptr %33, align 4
  br label %207

200:                                              ; preds = %196
  %201 = load ptr, ptr %12, align 8, !tbaa !5
  %202 = load float, ptr %22, align 4, !tbaa !11
  %203 = getelementptr inbounds [3 x %"class.Maths::TVector3"], ptr %27, i64 0, i64 0
  %204 = getelementptr inbounds [3 x %"class.Maths::TVector3"], ptr %27, i64 0, i64 1
  %205 = getelementptr inbounds [3 x %"class.Maths::TVector3"], ptr %27, i64 0, i64 2
  %206 = load ptr, ptr %15, align 8, !tbaa !5
  call void @_ZN7RiemannL32computeSphereTriangleSweepResultERKN5Maths8TVector3IfEES4_fS4_S4_S4_PNS_18TriMeshSweepResultE(ptr noundef nonnull align 4 dereferenceable(12) %21, ptr noundef nonnull align 4 dereferenceable(12) %201, float noundef %202, ptr noundef nonnull align 4 dereferenceable(12) %203, ptr noundef nonnull align 4 dereferenceable(12) %204, ptr noundef nonnull align 4 dereferenceable(12) %205, ptr noundef %206)
  store i1 true, ptr %8, align 1
  store i32 1, ptr %33, align 4
  br label %207

207:                                              ; preds = %200, %199, %194
  call void @llvm.lifetime.end.p0(i64 16, ptr %31) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %30) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %29) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %28) #6
  call void @llvm.lifetime.end.p0(i64 36, ptr %27) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %26) #6
  call void @llvm.lifetime.end.p0(i64 12, ptr %25) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %24) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %23) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %22) #6
  call void @llvm.lifetime.end.p0(i64 12, ptr %21) #6
  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 4, ptr %18) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr %17) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr %16) #6
  %208 = load i1, ptr %8, align 1
  ret i1 %208
}

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN5Maths8TVector3IfE4ZeroEv(ptr dead_on_unwind noalias writable sret(%"class.Maths::TVector3") align 4) #1 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

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

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

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef float @_ZNK5Maths8TVector3IfE6LengthEv(ptr noundef nonnull align 4 dereferenceable(12)) #3 align 2

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

declare noundef zeroext i1 @_ZNK7Riemann7Sphere313SweepTriangleERKN5Maths8TVector3IfEES5_S5_S5_PS3_S6_Pf(ptr noundef nonnull align 4 dereferenceable(16), ptr noundef nonnull align 4 dereferenceable(12), ptr noundef nonnull align 4 dereferenceable(12), ptr noundef nonnull align 4 dereferenceable(12), ptr noundef nonnull align 4 dereferenceable(12), ptr noundef, ptr noundef, ptr noundef) #4

; Function Attrs: mustprogress uwtable
declare dso_local noundef float @_ZN7Riemann9Triangle321ComputeAlignmentValueERKN5Maths8TVector3IfEES5_(ptr noundef nonnull align 4 dereferenceable(12), ptr noundef nonnull align 4 dereferenceable(12)) #1 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZN7Riemann9Triangle316IsBetterTriangleEffff(float noundef, float noundef, float noundef, float noundef) #1 align 2

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

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

; Function Attrs: mustprogress uwtable
declare hidden void @_ZN7RiemannL32computeSphereTriangleSweepResultERKN5Maths8TVector3IfEES4_fS4_S4_S4_PNS_18TriMeshSweepResultE(ptr noundef nonnull align 4 dereferenceable(12), ptr noundef nonnull align 4 dereferenceable(12), float noundef, ptr noundef nonnull align 4 dereferenceable(12), ptr noundef nonnull align 4 dereferenceable(12), ptr noundef nonnull align 4 dereferenceable(12), ptr noundef) #1

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

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"float", !7, i64 0}
!13 = !{!14, !14, i64 0}
!14 = !{!"bool", !7, i64 0}
!15 = !{!16, !14, i64 0}
!16 = !{!"_ZTSN7Riemann18TriMeshSweepOptionE", !14, i64 0, !14, i64 1, !12, i64 4}
!17 = !{i8 0, i8 2}
!18 = !{}
!19 = !{!16, !12, i64 4}
!20 = !{!16, !14, i64 1}
!21 = !{!22, !6, i64 168}
!22 = !{!"_ZTSN7Riemann10StaticMeshE", !10, i64 0, !10, i64 4, !23, i64 8, !27, i64 32, !23, i64 56, !23, i64 80, !31, i64 104, !7, i64 128, !33, i64 136, !6, i64 168, !6, i64 176}
!23 = !{!"_ZTSSt6vectorIN5Maths8TVector3IfEESaIS2_EE", !24, i64 0}
!24 = !{!"_ZTSSt12_Vector_baseIN5Maths8TVector3IfEESaIS2_EE", !25, i64 0}
!25 = !{!"_ZTSNSt12_Vector_baseIN5Maths8TVector3IfEESaIS2_EE12_Vector_implE", !26, i64 0}
!26 = !{!"_ZTSNSt12_Vector_baseIN5Maths8TVector3IfEESaIS2_EE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!27 = !{!"_ZTSSt6vectorItSaItEE", !28, i64 0}
!28 = !{!"_ZTSSt12_Vector_baseItSaItEE", !29, i64 0}
!29 = !{!"_ZTSNSt12_Vector_baseItSaItEE12_Vector_implE", !30, i64 0}
!30 = !{!"_ZTSNSt12_Vector_baseItSaItEE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!31 = !{!"_ZTSN5Maths6TAABB3IfEE", !32, i64 0, !32, i64 12}
!32 = !{!"_ZTSN5Maths8TVector3IfEE", !12, i64 0, !12, i64 4, !12, i64 8}
!33 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE", !34, i64 0, !35, i64 8, !7, i64 16}
!34 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_Alloc_hiderE", !6, i64 0}
!35 = !{!"long", !7, i64 0}
!36 = !{!37, !12, i64 0}
!37 = !{!"_ZTSN7Riemann18TriMeshSweepResultE", !12, i64 0, !32, i64 4, !32, i64 16, !10, i64 28, !10, i64 32}
!38 = distinct !{!38, !39}
!39 = !{!"llvm.loop.mustprogress"}


; 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 }
%"struct.Riemann::LeafNode" = type { i32 }
%"class.Riemann::Sphere3" = type { %"class.Maths::TVector3", float }

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

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

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

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

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

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

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

; Function Attrs: mustprogress uwtable
define dso_local noundef zeroext i1 @_ZN7Riemann12TriangleMesh14SphereSweepTriEjRKN5Maths8TVector3IfEES5_fRKNS_18TriMeshSweepOptionEPNS_18TriMeshSweepResultE(ptr noundef nonnull align 8 dereferenceable(192) %0, i32 noundef %1, ptr noundef nonnull align 4 dereferenceable(12) %2, ptr noundef nonnull align 4 dereferenceable(12) %3, float noundef %4, ptr nocapture noundef nonnull readonly align 4 dereferenceable(8) %5, ptr noundef %6) local_unnamed_addr #1 align 2 {
  %8 = alloca %"class.Maths::TVector3", align 4
  %9 = alloca %"class.Maths::TVector3", align 4
  %10 = alloca [3 x %"class.Maths::TVector3"], align 16
  %11 = alloca %"struct.Riemann::LeafNode", align 4
  %12 = alloca %"class.Riemann::Sphere3", align 4
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  %15 = alloca i32, align 4
  %16 = alloca %"class.Maths::TVector3", align 4
  %17 = alloca float, align 4
  %18 = alloca %"class.Maths::TVector3", align 4
  %19 = alloca %"class.Maths::TVector3", align 4
  %20 = alloca %"class.Maths::TVector3", align 4
  %21 = getelementptr inbounds i8, ptr %5, i64 4
  %22 = load float, ptr %21, align 4, !tbaa !5
  %23 = getelementptr inbounds i8, ptr %5, i64 1
  %24 = load i8, ptr %23, align 1, !tbaa !11, !range !12, !noundef !13
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %8) #6
  call void @_ZN5Maths8TVector3IfEC2ERKS1_(ptr noundef nonnull align 4 dereferenceable(12) %8, ptr noundef nonnull align 4 dereferenceable(12) %2)
  %25 = call noundef float @_ZNK5Maths8TVector3IfE3DotERKS1_(ptr noundef nonnull align 4 dereferenceable(12) %8, ptr noundef nonnull align 4 dereferenceable(12) %3)
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %9) #6
  call void @_ZN5Maths8TVector3IfE4ZeroEv(ptr dead_on_unwind nonnull writable sret(%"class.Maths::TVector3") align 4 %9)
  call void @llvm.lifetime.start.p0(i64 36, ptr nonnull %10) #6
  call void @_ZN5Maths8TVector3IfEC2Ev(ptr noundef nonnull align 4 dereferenceable(12) %10)
  %.ptr.1 = getelementptr inbounds i8, ptr %10, i64 12
  call void @_ZN5Maths8TVector3IfEC2Ev(ptr noundef nonnull align 4 dereferenceable(12) %.ptr.1)
  %.ptr.2 = getelementptr inbounds i8, ptr %10, i64 24
  call void @_ZN5Maths8TVector3IfEC2Ev(ptr noundef nonnull align 4 dereferenceable(12) %.ptr.2)
  %26 = trunc nuw i8 %24 to i1
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %11) #6
  call void @_ZN7Riemann8LeafNodeC2Ej(ptr noundef nonnull align 4 dereferenceable(4) %11, i32 noundef %1)
  %27 = call noundef i32 @_ZNK7Riemann8LeafNode15GetNumTrianglesEv(ptr noundef nonnull align 4 dereferenceable(4) %11)
  %28 = call noundef i32 @_ZNK7Riemann8LeafNode16GetTriangleIndexEv(ptr noundef nonnull align 4 dereferenceable(4) %11)
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %12) #6
  call void @_ZN7Riemann7Sphere3C2ERKN5Maths8TVector3IfEEf(ptr noundef nonnull align 4 dereferenceable(16) %12, ptr noundef nonnull align 4 dereferenceable(12) %2, float noundef %4)
  %29 = icmp sgt i32 %27, 0
  br i1 %29, label %.lr.ph, label %._crit_edge.thread

.lr.ph:                                           ; preds = %7
  %30 = getelementptr inbounds i8, ptr %0, i64 168
  br label %31

31:                                               ; preds = %.lr.ph, %65
  %.061133 = phi float [ %22, %.lr.ph ], [ %.46594, %65 ]
  %.067132 = phi float [ 2.000000e+00, %.lr.ph ], [ %.47193, %65 ]
  %.072131 = phi i32 [ -1, %.lr.ph ], [ %.47692, %65 ]
  %.078129 = phi i32 [ 0, %.lr.ph ], [ %66, %65 ]
  call void @_ZN7Riemann18TriMeshSweepResult12AddTestCountEi(ptr noundef nonnull align 4 dereferenceable(36) %6, i32 noundef 1)
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %13) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %14) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %15) #6
  %32 = add i32 %.078129, %28
  call void @_ZNK7Riemann10StaticMesh14GetVertIndicesEjRjS1_S1_(ptr noundef nonnull align 8 dereferenceable(184) %0, i32 noundef %32, ptr noundef nonnull align 4 dereferenceable(4) %13, ptr noundef nonnull align 4 dereferenceable(4) %14, ptr noundef nonnull align 4 dereferenceable(4) %15)
  %33 = load ptr, ptr %30, align 8, !tbaa !14
  %34 = load i32, ptr %13, align 4, !tbaa !31
  %35 = zext i32 %34 to i64
  %36 = getelementptr inbounds %"class.Maths::TVector3", ptr %33, i64 %35
  %37 = load i32, ptr %14, align 4, !tbaa !31
  %38 = zext i32 %37 to i64
  %39 = getelementptr inbounds %"class.Maths::TVector3", ptr %33, i64 %38
  %40 = load i32, ptr %15, align 4, !tbaa !31
  %41 = zext i32 %40 to i64
  %42 = getelementptr inbounds %"class.Maths::TVector3", ptr %33, i64 %41
  %43 = call noundef zeroext i1 @_ZN7RiemannL13cullTriangle1ERKN5Maths8TVector3IfEES4_ffS4_S4_S4_(ptr noundef nonnull align 4 dereferenceable(12) %8, ptr noundef nonnull align 4 dereferenceable(12) %3, float noundef %.061133, float noundef %4, ptr noundef nonnull align 4 dereferenceable(12) %36, ptr noundef nonnull align 4 dereferenceable(12) %39, ptr noundef nonnull align 4 dereferenceable(12) %42)
  br i1 %43, label %44, label %.thread

44:                                               ; preds = %31
  %45 = call noundef zeroext i1 @_ZN7RiemannL13cullTriangle2ERKN5Maths8TVector3IfEEfffS4_S4_S4_(ptr noundef nonnull align 4 dereferenceable(12) %3, float noundef %4, float noundef %.061133, float noundef %25, ptr noundef nonnull align 4 dereferenceable(12) %36, ptr noundef nonnull align 4 dereferenceable(12) %39, ptr noundef nonnull align 4 dereferenceable(12) %42)
  br i1 %45, label %46, label %.thread

46:                                               ; preds = %44
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %16) #6
  call void @_ZN7Riemann9Triangle315CalculateNormalERKN5Maths8TVector3IfEES5_S5_b(ptr dead_on_unwind nonnull writable sret(%"class.Maths::TVector3") align 4 %16, ptr noundef nonnull align 4 dereferenceable(12) %36, ptr noundef nonnull align 4 dereferenceable(12) %39, ptr noundef nonnull align 4 dereferenceable(12) %42, i1 noundef zeroext false)
  %47 = call noundef float @_ZNK5Maths8TVector3IfE6LengthEv(ptr noundef nonnull align 4 dereferenceable(12) %16)
  %48 = fcmp oeq float %47, 0.000000e+00
  br i1 %48, label %.thread95, label %49

.thread95:                                        ; preds = %46
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %16) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %15) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %14) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %13) #6
  br label %65

49:                                               ; preds = %46
  call void @_ZN5Maths8TVector3IfEdVEf(ptr noundef nonnull align 4 dereferenceable(12) %16, float noundef %47)
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %17) #6
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %18) #6
  call void @_ZN5Maths8TVector3IfEC2Ev(ptr noundef nonnull align 4 dereferenceable(12) %18)
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %19) #6
  call void @_ZN5Maths8TVector3IfEC2Ev(ptr noundef nonnull align 4 dereferenceable(12) %19)
  %50 = call noundef zeroext i1 @_ZNK7Riemann7Sphere313SweepTriangleERKN5Maths8TVector3IfEES5_S5_S5_PS3_S6_Pf(ptr noundef nonnull align 4 dereferenceable(16) %12, ptr noundef nonnull align 4 dereferenceable(12) %3, 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 nonnull %18, ptr noundef nonnull %19, ptr noundef nonnull %17)
  %51 = load float, ptr %17, align 4
  %52 = fcmp ule float %51, %22
  %or.cond.not = select i1 %50, i1 %52, i1 false
  br i1 %or.cond.not, label %53, label %.thread101

53:                                               ; preds = %49
  %54 = call noundef float @_ZN7Riemann9Triangle321ComputeAlignmentValueERKN5Maths8TVector3IfEES5_(ptr noundef nonnull align 4 dereferenceable(12) %16, ptr noundef nonnull align 4 dereferenceable(12) %3)
  %55 = load float, ptr %17, align 4, !tbaa !32
  %56 = call noundef zeroext i1 @_ZN7Riemann9Triangle316IsBetterTriangleEffff(float noundef %55, float noundef %54, float noundef %.061133, float noundef %.067132)
  br i1 %56, label %57, label %.thread101

57:                                               ; preds = %53
  %58 = load float, ptr %17, align 4, !tbaa !32
  %59 = fcmp oeq float %58, 0.000000e+00
  br i1 %59, label %67, label %60

60:                                               ; preds = %57
  %61 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZN5Maths8TVector3IfEaSERKS1_(ptr noundef nonnull align 4 dereferenceable(12) %9, ptr noundef nonnull align 4 dereferenceable(12) %16)
  %62 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZN5Maths8TVector3IfEaSERKS1_(ptr noundef nonnull align 4 dereferenceable(12) %10, ptr noundef nonnull align 4 dereferenceable(12) %36)
  %63 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZN5Maths8TVector3IfEaSERKS1_(ptr noundef nonnull align 4 dereferenceable(12) %.ptr.1, ptr noundef nonnull align 4 dereferenceable(12) %39)
  %64 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZN5Maths8TVector3IfEaSERKS1_(ptr noundef nonnull align 4 dereferenceable(12) %.ptr.2, ptr noundef nonnull align 4 dereferenceable(12) %42)
  br i1 %26, label %.thread101, label %.thread119

.thread119:                                       ; preds = %60
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %19) #6
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %18) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %17) #6
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %16) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %15) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %14) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %13) #6
  br label %73

.thread:                                          ; preds = %31, %44
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %15) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %14) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %13) #6
  br label %65

.thread101:                                       ; preds = %49, %53, %60
  %.274.ph = phi i32 [ %.072131, %53 ], [ %.072131, %49 ], [ %.078129, %60 ]
  %.269.ph = phi float [ %.067132, %53 ], [ %.067132, %49 ], [ %54, %60 ]
  %.263.ph = phi float [ %.061133, %53 ], [ %.061133, %49 ], [ %58, %60 ]
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %19) #6
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %18) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %17) #6
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %16) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %15) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %14) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %13) #6
  br label %65

65:                                               ; preds = %.thread101, %.thread95, %.thread
  %.46594 = phi float [ %.061133, %.thread ], [ %.061133, %.thread95 ], [ %.263.ph, %.thread101 ]
  %.47193 = phi float [ %.067132, %.thread ], [ %.067132, %.thread95 ], [ %.269.ph, %.thread101 ]
  %.47692 = phi i32 [ %.072131, %.thread ], [ %.072131, %.thread95 ], [ %.274.ph, %.thread101 ]
  %66 = add nuw nsw i32 %.078129, 1
  %exitcond.not = icmp eq i32 %66, %27
  br i1 %exitcond.not, label %._crit_edge, label %31, !llvm.loop !33

67:                                               ; preds = %57
  %68 = getelementptr inbounds i8, ptr %6, i64 4
  %69 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZN5Maths8TVector3IfEaSERKS1_(ptr noundef nonnull align 4 dereferenceable(12) %68, ptr noundef nonnull align 4 dereferenceable(12) %2)
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %20) #6
  call void @_ZNK5Maths8TVector3IfEngEv(ptr dead_on_unwind nonnull writable sret(%"class.Maths::TVector3") align 4 %20, ptr noundef nonnull align 4 dereferenceable(12) %3)
  %70 = getelementptr inbounds i8, ptr %6, i64 16
  %71 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZN5Maths8TVector3IfEaSERKS1_(ptr noundef nonnull align 4 dereferenceable(12) %70, ptr noundef nonnull align 4 dereferenceable(12) %20)
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %20) #6
  store float 0.000000e+00, ptr %6, align 4, !tbaa !35
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %19) #6
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %18) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %17) #6
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %16) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %15) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %14) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %13) #6
  br label %._crit_edge.thread

._crit_edge:                                      ; preds = %65
  %72 = icmp slt i32 %.47692, 0
  br i1 %72, label %._crit_edge.thread, label %73

73:                                               ; preds = %.thread119, %._crit_edge
  %.566112122 = phi float [ %58, %.thread119 ], [ %.46594, %._crit_edge ]
  call void @_ZN7RiemannL32computeSphereTriangleSweepResultERKN5Maths8TVector3IfEES4_fS4_S4_S4_PNS_18TriMeshSweepResultE(ptr noundef nonnull align 4 dereferenceable(12) %8, ptr noundef nonnull align 4 dereferenceable(12) %3, float noundef %.566112122, ptr noundef nonnull align 4 dereferenceable(12) %10, ptr noundef nonnull align 4 dereferenceable(12) %.ptr.1, ptr noundef nonnull align 4 dereferenceable(12) %.ptr.2, ptr noundef nonnull %6)
  br label %._crit_edge.thread

._crit_edge.thread:                               ; preds = %7, %67, %._crit_edge, %73
  %.6 = phi i1 [ true, %73 ], [ true, %67 ], [ false, %._crit_edge ], [ false, %7 ]
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %12) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %11) #6
  call void @llvm.lifetime.end.p0(i64 36, ptr nonnull %10) #6
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %9) #6
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %8) #6
  ret i1 %.6
}

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN5Maths8TVector3IfE4ZeroEv(ptr dead_on_unwind noalias writable sret(%"class.Maths::TVector3") align 4) local_unnamed_addr #1 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

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

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

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef float @_ZNK5Maths8TVector3IfE6LengthEv(ptr noundef nonnull align 4 dereferenceable(12)) local_unnamed_addr #3 align 2

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

declare noundef zeroext i1 @_ZNK7Riemann7Sphere313SweepTriangleERKN5Maths8TVector3IfEES5_S5_S5_PS3_S6_Pf(ptr noundef nonnull align 4 dereferenceable(16), ptr noundef nonnull align 4 dereferenceable(12), ptr noundef nonnull align 4 dereferenceable(12), ptr noundef nonnull align 4 dereferenceable(12), ptr noundef nonnull align 4 dereferenceable(12), ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #4

; Function Attrs: mustprogress uwtable
declare dso_local noundef float @_ZN7Riemann9Triangle321ComputeAlignmentValueERKN5Maths8TVector3IfEES5_(ptr noundef nonnull align 4 dereferenceable(12), ptr noundef nonnull align 4 dereferenceable(12)) local_unnamed_addr #1 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZN7Riemann9Triangle316IsBetterTriangleEffff(float noundef, float noundef, float noundef, float noundef) local_unnamed_addr #1 align 2

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

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

; Function Attrs: mustprogress uwtable
declare hidden void @_ZN7RiemannL32computeSphereTriangleSweepResultERKN5Maths8TVector3IfEES4_fS4_S4_S4_PNS_18TriMeshSweepResultE(ptr noundef nonnull align 4 dereferenceable(12), ptr noundef nonnull align 4 dereferenceable(12), float noundef, 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 #1

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #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 = { "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 = { inlinehint mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { 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, !10, i64 4}
!6 = !{!"_ZTSN7Riemann18TriMeshSweepOptionE", !7, i64 0, !7, i64 1, !10, i64 4}
!7 = !{!"bool", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!"float", !8, i64 0}
!11 = !{!6, !7, i64 1}
!12 = !{i8 0, i8 2}
!13 = !{}
!14 = !{!15, !21, i64 168}
!15 = !{!"_ZTSN7Riemann10StaticMeshE", !16, i64 0, !16, i64 4, !17, i64 8, !22, i64 32, !17, i64 56, !17, i64 80, !26, i64 104, !8, i64 128, !28, i64 136, !21, i64 168, !21, i64 176}
!16 = !{!"int", !8, i64 0}
!17 = !{!"_ZTSSt6vectorIN5Maths8TVector3IfEESaIS2_EE", !18, i64 0}
!18 = !{!"_ZTSSt12_Vector_baseIN5Maths8TVector3IfEESaIS2_EE", !19, i64 0}
!19 = !{!"_ZTSNSt12_Vector_baseIN5Maths8TVector3IfEESaIS2_EE12_Vector_implE", !20, i64 0}
!20 = !{!"_ZTSNSt12_Vector_baseIN5Maths8TVector3IfEESaIS2_EE17_Vector_impl_dataE", !21, i64 0, !21, i64 8, !21, i64 16}
!21 = !{!"any pointer", !8, i64 0}
!22 = !{!"_ZTSSt6vectorItSaItEE", !23, i64 0}
!23 = !{!"_ZTSSt12_Vector_baseItSaItEE", !24, i64 0}
!24 = !{!"_ZTSNSt12_Vector_baseItSaItEE12_Vector_implE", !25, i64 0}
!25 = !{!"_ZTSNSt12_Vector_baseItSaItEE17_Vector_impl_dataE", !21, i64 0, !21, i64 8, !21, i64 16}
!26 = !{!"_ZTSN5Maths6TAABB3IfEE", !27, i64 0, !27, i64 12}
!27 = !{!"_ZTSN5Maths8TVector3IfEE", !10, i64 0, !10, i64 4, !10, i64 8}
!28 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE", !29, i64 0, !30, i64 8, !8, i64 16}
!29 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_Alloc_hiderE", !21, i64 0}
!30 = !{!"long", !8, i64 0}
!31 = !{!16, !16, i64 0}
!32 = !{!10, !10, i64 0}
!33 = distinct !{!33, !34}
!34 = !{!"llvm.loop.mustprogress"}
!35 = !{!36, !10, i64 0}
!36 = !{!"_ZTSN7Riemann18TriMeshSweepResultE", !10, i64 0, !27, i64 4, !27, i64 16, !16, i64 28, !16, i64 32}


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