; 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.Riemann::TriangleMesh" = type { %"class.Riemann::StaticMesh", ptr }
%"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.Maths::TVector3" = type { float, float, float }
%"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::TriMeshHitResult" = type { float, %"class.Maths::TVector3", i32, i32 }
%"struct.Riemann::MeshBVH4" = type { %"class.Maths::TVector4", %"class.Maths::TVector4", ptr, [6 x float], i32, i32, i32, i32, i32, i32, ptr }
%"class.Maths::TVector4" = type { float, float, float, float }
%"struct.Riemann::TriMeshHitOption" = type { i8, i8, float }
%"struct.Riemann::BVHNodeBatch" = type { [4 x float], [4 x float], [4 x float], [4 x float], [4 x float], [4 x float], [4 x i32] }

@.str = external hidden unnamed_addr constant [16 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [95 x i8], align 1
@__PRETTY_FUNCTION__._ZNK7Riemann12TriangleMesh12IntersectRayERKN5Maths8TVector3IfEES5_RKNS_16TriMeshHitOptionEPNS_16TriMeshHitResultE = external hidden unnamed_addr constant [127 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [40 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [20 x i8], align 1

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

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZNK7Riemann12TriangleMesh15RayIntersectTriEjRKN5Maths8TVector3IfEES5_RKNS_16TriMeshHitOptionEPNS_16TriMeshHitResultE(ptr noundef nonnull align 8 dereferenceable(192), i32 noundef, ptr noundef nonnull align 4 dereferenceable(12), ptr noundef nonnull align 4 dereferenceable(12), ptr noundef nonnull align 4 dereferenceable(8), ptr noundef) #1 align 2

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

; Function Attrs: mustprogress uwtable
define dso_local noundef zeroext i1 @_ZNK7Riemann12TriangleMesh12IntersectRayERKN5Maths8TVector3IfEES5_RKNS_16TriMeshHitOptionEPNS_16TriMeshHitResultE(ptr noundef nonnull align 8 dereferenceable(192) %0, ptr noundef nonnull align 4 dereferenceable(12) %1, ptr noundef nonnull align 4 dereferenceable(12) %2, ptr noundef nonnull align 4 dereferenceable(8) %3, ptr noundef %4) #3 align 2 {
  %6 = alloca i1, align 1
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca ptr, align 8
  %10 = alloca ptr, align 8
  %11 = alloca ptr, align 8
  %12 = alloca <4 x float>, align 16
  %13 = alloca <4 x float>, align 16
  %14 = alloca <4 x float>, align 16
  %15 = alloca i32, align 4
  %16 = alloca [128 x i32], align 16
  %17 = alloca ptr, align 8
  %18 = alloca float, align 4
  %19 = alloca ptr, align 8
  %20 = alloca <4 x float>, align 16
  %21 = alloca <4 x float>, align 16
  %22 = alloca <4 x float>, align 16
  %23 = alloca <4 x float>, align 16
  %24 = alloca <4 x float>, align 16
  %25 = alloca <4 x float>, align 16
  %26 = alloca <4 x float>, align 16
  %27 = alloca <4 x float>, align 16
  %28 = alloca <4 x float>, align 16
  %29 = alloca <4 x float>, align 16
  %30 = alloca <4 x float>, align 16
  %31 = alloca <4 x float>, align 16
  %32 = alloca <4 x float>, align 16
  %33 = alloca i32, align 4
  %34 = alloca i32, align 4
  %35 = alloca [4 x i32], align 16
  %36 = alloca i32, align 4
  %37 = alloca i8, align 1
  %38 = alloca i32, align 4
  %39 = alloca ptr, align 8
  %40 = alloca <4 x float>, align 16
  %41 = alloca <4 x float>, align 16
  %42 = alloca <4 x float>, align 16
  %43 = alloca <4 x float>, align 16
  %44 = alloca <4 x float>, align 16
  %45 = alloca <4 x float>, align 16
  %46 = alloca <4 x float>, align 16
  %47 = alloca <4 x float>, align 16
  %48 = alloca <4 x float>, align 16
  %49 = alloca <4 x float>, align 16
  %50 = alloca <4 x float>, align 16
  %51 = alloca <4 x float>, align 16
  %52 = alloca <4 x float>, align 16
  %53 = alloca <4 x float>, align 16
  %54 = alloca <4 x float>, align 16
  %55 = alloca <4 x float>, align 16
  %56 = alloca <4 x float>, align 16
  %57 = alloca <4 x float>, align 16
  %58 = alloca <4 x float>, align 16
  %59 = alloca <4 x float>, align 16
  %60 = alloca <4 x float>, align 16
  %61 = alloca <4 x float>, align 16
  %62 = alloca ptr, align 8
  store ptr %0, ptr %7, align 8, !tbaa !5
  store ptr %1, ptr %8, align 8, !tbaa !5
  store ptr %2, ptr %9, align 8, !tbaa !5
  store ptr %3, ptr %10, align 8, !tbaa !5
  store ptr %4, ptr %11, align 8, !tbaa !5
  %63 = load ptr, ptr %7, align 8
  %64 = getelementptr inbounds %"class.Riemann::TriangleMesh", ptr %63, i32 0, i32 1
  %65 = load ptr, ptr %64, align 8, !tbaa !9
  %66 = icmp eq ptr %65, null
  br i1 %66, label %67, label %68

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

68:                                               ; preds = %5
  %69 = load ptr, ptr %11, align 8, !tbaa !5
  %70 = getelementptr inbounds %"struct.Riemann::TriMeshHitResult", ptr %69, i32 0, i32 0
  store float 0x47EFFFFFE0000000, ptr %70, align 4, !tbaa !27
  call void @llvm.lifetime.start.p0(i64 16, ptr %12) #7
  %71 = call noundef <4 x float> @_Z13U128_LoadXYZWjjjj(i32 noundef -2147483648, i32 noundef -2147483648, i32 noundef -2147483648, i32 noundef -2147483648)
  store <4 x float> %71, ptr %12, align 16, !tbaa !29
  call void @llvm.lifetime.start.p0(i64 16, ptr %13) #7
  %72 = call noundef <4 x float> @_Z9F128_Loadf(float noundef 0x3E112E0BE0000000)
  store <4 x float> %72, ptr %13, align 16, !tbaa !29
  call void @llvm.lifetime.start.p0(i64 16, ptr %14) #7
  %73 = call noundef <4 x float> @_Z9F128_Loadf(float noundef 2.000000e+00)
  store <4 x float> %73, ptr %14, align 16, !tbaa !29
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #7
  store i32 128, ptr %15, align 4, !tbaa !30
  call void @llvm.lifetime.start.p0(i64 512, ptr %16) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #7
  %74 = getelementptr inbounds [128 x i32], ptr %16, i64 0, i64 0
  %75 = getelementptr inbounds i32, ptr %74, i64 1
  store ptr %75, ptr %17, align 8, !tbaa !5
  %76 = getelementptr inbounds %"class.Riemann::TriangleMesh", ptr %63, i32 0, i32 1
  %77 = load ptr, ptr %76, align 8, !tbaa !9
  %78 = getelementptr inbounds %"struct.Riemann::MeshBVH4", ptr %77, i32 0, i32 10
  %79 = load ptr, ptr %78, align 8, !tbaa !31
  %80 = icmp ne ptr %79, null
  br i1 %80, label %81, label %82

81:                                               ; preds = %68
  br label %84

82:                                               ; preds = %68
  call void @__assert_fail(ptr noundef @.str, ptr noundef @.str.1, i32 noundef 426, ptr noundef @__PRETTY_FUNCTION__._ZNK7Riemann12TriangleMesh12IntersectRayERKN5Maths8TVector3IfEES5_RKNS_16TriMeshHitOptionEPNS_16TriMeshHitResultE) #8
  unreachable

83:                                               ; No predecessors!
  br label %84

84:                                               ; preds = %83, %81
  %85 = getelementptr inbounds %"class.Riemann::TriangleMesh", ptr %63, i32 0, i32 1
  %86 = load ptr, ptr %85, align 8, !tbaa !9
  %87 = getelementptr inbounds %"struct.Riemann::MeshBVH4", ptr %86, i32 0, i32 10
  %88 = load ptr, ptr %87, align 8, !tbaa !31
  %89 = ptrtoint ptr %88 to i64
  %90 = and i64 %89, 127
  %91 = icmp eq i64 %90, 0
  br i1 %91, label %92, label %93

92:                                               ; preds = %84
  br label %95

93:                                               ; preds = %84
  call void @__assert_fail(ptr noundef @.str.2, ptr noundef @.str.1, i32 noundef 427, ptr noundef @__PRETTY_FUNCTION__._ZNK7Riemann12TriangleMesh12IntersectRayERKN5Maths8TVector3IfEES5_RKNS_16TriMeshHitOptionEPNS_16TriMeshHitResultE) #8
  unreachable

94:                                               ; No predecessors!
  br label %95

95:                                               ; preds = %94, %92
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #7
  %96 = load ptr, ptr %10, align 8, !tbaa !5
  %97 = getelementptr inbounds %"struct.Riemann::TriMeshHitOption", ptr %96, i32 0, i32 2
  %98 = load float, ptr %97, align 4, !tbaa !34
  store float %98, ptr %18, align 4, !tbaa !37
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #7
  %99 = getelementptr inbounds %"class.Riemann::TriangleMesh", ptr %63, i32 0, i32 1
  %100 = load ptr, ptr %99, align 8, !tbaa !9
  %101 = getelementptr inbounds %"struct.Riemann::MeshBVH4", ptr %100, i32 0, i32 10
  %102 = load ptr, ptr %101, align 8, !tbaa !31
  store ptr %102, ptr %19, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 16, ptr %20) #7
  %103 = load float, ptr %18, align 4, !tbaa !37
  %104 = call noundef <4 x float> @_Z9F128_Loadf(float noundef %103)
  store <4 x float> %104, ptr %20, align 16, !tbaa !29
  call void @llvm.lifetime.start.p0(i64 16, ptr %21) #7
  %105 = load ptr, ptr %8, align 8, !tbaa !5
  %106 = call noundef <4 x float> @_Z18F128_Load_Vector3dRKN5Maths8TVector3IfEE(ptr noundef nonnull align 4 dereferenceable(12) %105)
  store <4 x float> %106, ptr %21, align 16, !tbaa !29
  call void @llvm.lifetime.start.p0(i64 16, ptr %22) #7
  %107 = load ptr, ptr %9, align 8, !tbaa !5
  %108 = call noundef <4 x float> @_Z18F128_Load_Vector3dRKN5Maths8TVector3IfEE(ptr noundef nonnull align 4 dereferenceable(12) %107)
  store <4 x float> %108, ptr %22, align 16, !tbaa !29
  call void @llvm.lifetime.start.p0(i64 16, ptr %23) #7
  %109 = load <4 x float>, ptr %22, align 16, !tbaa !29
  %110 = call noundef <4 x float> @_Z25U128_ReinterpretFrom_F128Dv4_f(<4 x float> noundef %109)
  %111 = load <4 x float>, ptr %12, align 16, !tbaa !29
  %112 = call noundef <4 x float> @_Z8U128_ANDDv4_fS_(<4 x float> noundef %110, <4 x float> noundef %111)
  store <4 x float> %112, ptr %23, align 16, !tbaa !29
  call void @llvm.lifetime.start.p0(i64 16, ptr %24) #7
  %113 = load <4 x float>, ptr %22, align 16, !tbaa !29
  %114 = call noundef <4 x float> @_Z8F128_AbsDv4_f(<4 x float> noundef %113)
  store <4 x float> %114, ptr %24, align 16, !tbaa !29
  call void @llvm.lifetime.start.p0(i64 16, ptr %25) #7
  %115 = load <4 x float>, ptr %23, align 16, !tbaa !29
  %116 = load <4 x float>, ptr %24, align 16, !tbaa !29
  %117 = load <4 x float>, ptr %13, align 16, !tbaa !29
  %118 = call noundef <4 x float> @_Z8F128_MaxDv4_fS_(<4 x float> noundef %116, <4 x float> noundef %117)
  %119 = call noundef <4 x float> @_Z25U128_ReinterpretFrom_F128Dv4_f(<4 x float> noundef %118)
  %120 = call noundef <4 x float> @_Z7U128_ORDv4_fS_(<4 x float> noundef %115, <4 x float> noundef %119)
  %121 = call noundef <4 x float> @_Z25F128_ReinterpretFrom_U128Dv4_f(<4 x float> noundef %120)
  store <4 x float> %121, ptr %25, align 16, !tbaa !29
  %122 = load <4 x float>, ptr %25, align 16, !tbaa !29
  store <4 x float> %122, ptr %22, align 16, !tbaa !29
  %123 = load <4 x float>, ptr %25, align 16, !tbaa !29
  %124 = call noundef <4 x float> @_Z14F128_RecipFastDv4_f(<4 x float> noundef %123)
  store <4 x float> %124, ptr %25, align 16, !tbaa !29
  %125 = load <4 x float>, ptr %25, align 16, !tbaa !29
  %126 = load <4 x float>, ptr %22, align 16, !tbaa !29
  %127 = load <4 x float>, ptr %25, align 16, !tbaa !29
  %128 = load <4 x float>, ptr %14, align 16, !tbaa !29
  %129 = call noundef <4 x float> @_Z12F128_NegMSubDv4_fS_S_(<4 x float> noundef %126, <4 x float> noundef %127, <4 x float> noundef %128)
  %130 = call noundef <4 x float> @_Z8F128_MulDv4_fS_(<4 x float> noundef %125, <4 x float> noundef %129)
  store <4 x float> %130, ptr %25, align 16, !tbaa !29
  call void @llvm.lifetime.start.p0(i64 16, ptr %26) #7
  %131 = load <4 x float>, ptr %25, align 16, !tbaa !29
  %132 = load <4 x float>, ptr %21, align 16, !tbaa !29
  %133 = call noundef <4 x float> @_Z9F128_Zerov()
  %134 = call noundef <4 x float> @_Z12F128_NegMSubDv4_fS_S_(<4 x float> noundef %131, <4 x float> noundef %132, <4 x float> noundef %133)
  store <4 x float> %134, ptr %26, align 16, !tbaa !29
  call void @llvm.lifetime.start.p0(i64 16, ptr %27) #7
  %135 = load <4 x float>, ptr %25, align 16, !tbaa !29
  %136 = call noundef <4 x float> @_Z17F128_SplatElementILi0EEDv4_fS0_(<4 x float> noundef %135)
  store <4 x float> %136, ptr %27, align 16, !tbaa !29
  call void @llvm.lifetime.start.p0(i64 16, ptr %28) #7
  %137 = load <4 x float>, ptr %25, align 16, !tbaa !29
  %138 = call noundef <4 x float> @_Z17F128_SplatElementILi1EEDv4_fS0_(<4 x float> noundef %137)
  store <4 x float> %138, ptr %28, align 16, !tbaa !29
  call void @llvm.lifetime.start.p0(i64 16, ptr %29) #7
  %139 = load <4 x float>, ptr %25, align 16, !tbaa !29
  %140 = call noundef <4 x float> @_Z17F128_SplatElementILi2EEDv4_fS0_(<4 x float> noundef %139)
  store <4 x float> %140, ptr %29, align 16, !tbaa !29
  call void @llvm.lifetime.start.p0(i64 16, ptr %30) #7
  %141 = load <4 x float>, ptr %26, align 16, !tbaa !29
  %142 = call noundef <4 x float> @_Z17F128_SplatElementILi0EEDv4_fS0_(<4 x float> noundef %141)
  store <4 x float> %142, ptr %30, align 16, !tbaa !29
  call void @llvm.lifetime.start.p0(i64 16, ptr %31) #7
  %143 = load <4 x float>, ptr %26, align 16, !tbaa !29
  %144 = call noundef <4 x float> @_Z17F128_SplatElementILi1EEDv4_fS0_(<4 x float> noundef %143)
  store <4 x float> %144, ptr %31, align 16, !tbaa !29
  call void @llvm.lifetime.start.p0(i64 16, ptr %32) #7
  %145 = load <4 x float>, ptr %26, align 16, !tbaa !29
  %146 = call noundef <4 x float> @_Z17F128_SplatElementILi2EEDv4_fS0_(<4 x float> noundef %145)
  store <4 x float> %146, ptr %32, align 16, !tbaa !29
  %147 = getelementptr inbounds %"class.Riemann::TriangleMesh", ptr %63, i32 0, i32 1
  %148 = load ptr, ptr %147, align 8, !tbaa !9
  %149 = getelementptr inbounds %"struct.Riemann::MeshBVH4", ptr %148, i32 0, i32 5
  %150 = load i32, ptr %149, align 4, !tbaa !38
  %151 = icmp ugt i32 %150, 0
  br i1 %151, label %152, label %153

152:                                              ; preds = %95
  br label %155

153:                                              ; preds = %95
  call void @__assert_fail(ptr noundef @.str.3, ptr noundef @.str.1, i32 noundef 460, ptr noundef @__PRETTY_FUNCTION__._ZNK7Riemann12TriangleMesh12IntersectRayERKN5Maths8TVector3IfEES5_RKNS_16TriMeshHitOptionEPNS_16TriMeshHitResultE) #8
  unreachable

154:                                              ; No predecessors!
  br label %155

155:                                              ; preds = %154, %152
  call void @llvm.lifetime.start.p0(i64 4, ptr %33) #7
  store i32 0, ptr %33, align 4, !tbaa !30
  call void @llvm.lifetime.start.p0(i64 4, ptr %34) #7
  %156 = getelementptr inbounds %"class.Riemann::TriangleMesh", ptr %63, i32 0, i32 1
  %157 = load ptr, ptr %156, align 8, !tbaa !9
  %158 = getelementptr inbounds %"struct.Riemann::MeshBVH4", ptr %157, i32 0, i32 5
  %159 = load i32, ptr %158, align 4, !tbaa !38
  %160 = sub i32 %159, 1
  store i32 %160, ptr %34, align 4, !tbaa !30
  br label %161

161:                                              ; preds = %175, %155
  %162 = load i32, ptr %34, align 4, !tbaa !30
  %163 = icmp sge i32 %162, 0
  br i1 %163, label %165, label %164

164:                                              ; preds = %161
  call void @llvm.lifetime.end.p0(i64 4, ptr %34) #7
  br label %178

165:                                              ; preds = %161
  %166 = load i32, ptr %34, align 4, !tbaa !30
  %167 = sext i32 %166 to i64
  %168 = mul i64 %167, 112
  %169 = trunc i64 %168 to i32
  %170 = load ptr, ptr %17, align 8, !tbaa !5
  %171 = load i32, ptr %33, align 4, !tbaa !30
  %172 = add i32 %171, 1
  store i32 %172, ptr %33, align 4, !tbaa !30
  %173 = zext i32 %171 to i64
  %174 = getelementptr inbounds i32, ptr %170, i64 %173
  store i32 %169, ptr %174, align 4, !tbaa !30
  br label %175

175:                                              ; preds = %165
  %176 = load i32, ptr %34, align 4, !tbaa !30
  %177 = add nsw i32 %176, -1
  store i32 %177, ptr %34, align 4, !tbaa !30
  br label %161, !llvm.loop !39

178:                                              ; preds = %164
  call void @llvm.lifetime.start.p0(i64 16, ptr %35) #7
  br label %179

179:                                              ; preds = %385, %383, %178
  %180 = load i32, ptr %33, align 4, !tbaa !30
  %181 = icmp ne i32 %180, 0
  br i1 %181, label %182, label %386

182:                                              ; preds = %179
  call void @llvm.lifetime.start.p0(i64 4, ptr %36) #7
  %183 = load ptr, ptr %17, align 8, !tbaa !5
  %184 = load i32, ptr %33, align 4, !tbaa !30
  %185 = add i32 %184, -1
  store i32 %185, ptr %33, align 4, !tbaa !30
  %186 = zext i32 %185 to i64
  %187 = getelementptr inbounds i32, ptr %183, i64 %186
  %188 = load i32, ptr %187, align 4, !tbaa !30
  store i32 %188, ptr %36, align 4, !tbaa !30
  %189 = load i32, ptr %36, align 4, !tbaa !30
  %190 = and i32 %189, 1
  %191 = icmp ne i32 %190, 0
  br i1 %191, label %192, label %225

192:                                              ; preds = %182
  %193 = load i32, ptr %36, align 4, !tbaa !30
  %194 = add i32 %193, -1
  store i32 %194, ptr %36, align 4, !tbaa !30
  call void @llvm.lifetime.start.p0(i64 1, ptr %37) #7
  %195 = load i32, ptr %36, align 4, !tbaa !30
  %196 = load ptr, ptr %8, align 8, !tbaa !5
  %197 = load ptr, ptr %9, align 8, !tbaa !5
  %198 = load ptr, ptr %10, align 8, !tbaa !5
  %199 = load ptr, ptr %11, align 8, !tbaa !5
  %200 = call noundef zeroext i1 @_ZNK7Riemann12TriangleMesh15RayIntersectTriEjRKN5Maths8TVector3IfEES5_RKNS_16TriMeshHitOptionEPNS_16TriMeshHitResultE(ptr noundef nonnull align 8 dereferenceable(192) %63, i32 noundef %195, ptr noundef nonnull align 4 dereferenceable(12) %196, ptr noundef nonnull align 4 dereferenceable(12) %197, ptr noundef nonnull align 4 dereferenceable(8) %198, ptr noundef %199)
  %201 = zext i1 %200 to i8
  store i8 %201, ptr %37, align 1, !tbaa !41
  %202 = load i8, ptr %37, align 1, !tbaa !41, !range !42, !noundef !43
  %203 = trunc i8 %202 to i1
  br i1 %203, label %204, label %223

204:                                              ; preds = %192
  %205 = load ptr, ptr %10, align 8, !tbaa !5
  %206 = getelementptr inbounds %"struct.Riemann::TriMeshHitOption", ptr %205, i32 0, i32 0
  %207 = load i8, ptr %206, align 4, !tbaa !44, !range !42, !noundef !43
  %208 = trunc i8 %207 to i1
  br i1 %208, label %210, label %209

209:                                              ; preds = %204
  store i1 true, ptr %6, align 1
  store i32 1, ptr %38, align 4
  br label %224

210:                                              ; preds = %204
  %211 = load ptr, ptr %11, align 8, !tbaa !5
  %212 = getelementptr inbounds %"struct.Riemann::TriMeshHitResult", ptr %211, i32 0, i32 0
  %213 = load float, ptr %212, align 4, !tbaa !27
  %214 = load float, ptr %18, align 4, !tbaa !37
  %215 = fcmp olt float %213, %214
  br i1 %215, label %216, label %222

216:                                              ; preds = %210
  %217 = load ptr, ptr %11, align 8, !tbaa !5
  %218 = getelementptr inbounds %"struct.Riemann::TriMeshHitResult", ptr %217, i32 0, i32 0
  %219 = load float, ptr %218, align 4, !tbaa !27
  store float %219, ptr %18, align 4, !tbaa !37
  %220 = load float, ptr %18, align 4, !tbaa !37
  %221 = call noundef <4 x float> @_Z9F128_Loadf(float noundef %220)
  store <4 x float> %221, ptr %20, align 16, !tbaa !29
  br label %222

222:                                              ; preds = %216, %210
  br label %223

223:                                              ; preds = %222, %192
  store i32 5, ptr %38, align 4
  br label %224, !llvm.loop !45

224:                                              ; preds = %223, %209
  call void @llvm.lifetime.end.p0(i64 1, ptr %37) #7
  br label %383

225:                                              ; preds = %182
  %226 = load ptr, ptr %11, align 8, !tbaa !5
  call void @_ZN7Riemann16TriMeshHitResult12AddTestCountEi(ptr noundef nonnull align 4 dereferenceable(24) %226, i32 noundef 2)
  call void @llvm.lifetime.start.p0(i64 8, ptr %39) #7
  %227 = load ptr, ptr %19, align 8, !tbaa !5
  %228 = load i32, ptr %36, align 4, !tbaa !30
  %229 = zext i32 %228 to i64
  %230 = getelementptr inbounds i8, ptr %227, i64 %229
  store ptr %230, ptr %39, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 16, ptr %40) #7
  %231 = load ptr, ptr %39, align 8, !tbaa !5
  %232 = getelementptr inbounds %"struct.Riemann::BVHNodeBatch", ptr %231, i32 0, i32 0
  %233 = getelementptr inbounds [4 x float], ptr %232, i64 0, i64 0
  %234 = call noundef <4 x float> @_Z10F128_LoadAPKf(ptr noundef %233)
  store <4 x float> %234, ptr %40, align 16, !tbaa !29
  call void @llvm.lifetime.start.p0(i64 16, ptr %41) #7
  %235 = load ptr, ptr %39, align 8, !tbaa !5
  %236 = getelementptr inbounds %"struct.Riemann::BVHNodeBatch", ptr %235, i32 0, i32 1
  %237 = getelementptr inbounds [4 x float], ptr %236, i64 0, i64 0
  %238 = call noundef <4 x float> @_Z10F128_LoadAPKf(ptr noundef %237)
  store <4 x float> %238, ptr %41, align 16, !tbaa !29
  call void @llvm.lifetime.start.p0(i64 16, ptr %42) #7
  %239 = load ptr, ptr %39, align 8, !tbaa !5
  %240 = getelementptr inbounds %"struct.Riemann::BVHNodeBatch", ptr %239, i32 0, i32 2
  %241 = getelementptr inbounds [4 x float], ptr %240, i64 0, i64 0
  %242 = call noundef <4 x float> @_Z10F128_LoadAPKf(ptr noundef %241)
  store <4 x float> %242, ptr %42, align 16, !tbaa !29
  call void @llvm.lifetime.start.p0(i64 16, ptr %43) #7
  %243 = load ptr, ptr %39, align 8, !tbaa !5
  %244 = getelementptr inbounds %"struct.Riemann::BVHNodeBatch", ptr %243, i32 0, i32 3
  %245 = getelementptr inbounds [4 x float], ptr %244, i64 0, i64 0
  %246 = call noundef <4 x float> @_Z10F128_LoadAPKf(ptr noundef %245)
  store <4 x float> %246, ptr %43, align 16, !tbaa !29
  call void @llvm.lifetime.start.p0(i64 16, ptr %44) #7
  %247 = load ptr, ptr %39, align 8, !tbaa !5
  %248 = getelementptr inbounds %"struct.Riemann::BVHNodeBatch", ptr %247, i32 0, i32 4
  %249 = getelementptr inbounds [4 x float], ptr %248, i64 0, i64 0
  %250 = call noundef <4 x float> @_Z10F128_LoadAPKf(ptr noundef %249)
  store <4 x float> %250, ptr %44, align 16, !tbaa !29
  call void @llvm.lifetime.start.p0(i64 16, ptr %45) #7
  %251 = load ptr, ptr %39, align 8, !tbaa !5
  %252 = getelementptr inbounds %"struct.Riemann::BVHNodeBatch", ptr %251, i32 0, i32 5
  %253 = getelementptr inbounds [4 x float], ptr %252, i64 0, i64 0
  %254 = call noundef <4 x float> @_Z10F128_LoadAPKf(ptr noundef %253)
  store <4 x float> %254, ptr %45, align 16, !tbaa !29
  call void @llvm.lifetime.start.p0(i64 16, ptr %46) #7
  %255 = load <4 x float>, ptr %40, align 16, !tbaa !29
  %256 = load <4 x float>, ptr %43, align 16, !tbaa !29
  %257 = call noundef <4 x float> @_Z12F128_GreaterDv4_fS_(<4 x float> noundef %255, <4 x float> noundef %256)
  %258 = call noundef <4 x float> @_Z14U128_Load_B128Dv4_f(<4 x float> noundef %257)
  store <4 x float> %258, ptr %46, align 16, !tbaa !29
  call void @llvm.lifetime.start.p0(i64 16, ptr %47) #7
  %259 = load <4 x float>, ptr %40, align 16, !tbaa !29
  %260 = load <4 x float>, ptr %27, align 16, !tbaa !29
  %261 = load <4 x float>, ptr %30, align 16, !tbaa !29
  %262 = call noundef <4 x float> @_Z9F128_MAddDv4_fS_S_(<4 x float> noundef %259, <4 x float> noundef %260, <4 x float> noundef %261)
  store <4 x float> %262, ptr %47, align 16, !tbaa !29
  call void @llvm.lifetime.start.p0(i64 16, ptr %48) #7
  %263 = load <4 x float>, ptr %41, align 16, !tbaa !29
  %264 = load <4 x float>, ptr %28, align 16, !tbaa !29
  %265 = load <4 x float>, ptr %31, align 16, !tbaa !29
  %266 = call noundef <4 x float> @_Z9F128_MAddDv4_fS_S_(<4 x float> noundef %263, <4 x float> noundef %264, <4 x float> noundef %265)
  store <4 x float> %266, ptr %48, align 16, !tbaa !29
  call void @llvm.lifetime.start.p0(i64 16, ptr %49) #7
  %267 = load <4 x float>, ptr %42, align 16, !tbaa !29
  %268 = load <4 x float>, ptr %29, align 16, !tbaa !29
  %269 = load <4 x float>, ptr %32, align 16, !tbaa !29
  %270 = call noundef <4 x float> @_Z9F128_MAddDv4_fS_S_(<4 x float> noundef %267, <4 x float> noundef %268, <4 x float> noundef %269)
  store <4 x float> %270, ptr %49, align 16, !tbaa !29
  call void @llvm.lifetime.start.p0(i64 16, ptr %50) #7
  %271 = load <4 x float>, ptr %43, align 16, !tbaa !29
  %272 = load <4 x float>, ptr %27, align 16, !tbaa !29
  %273 = load <4 x float>, ptr %30, align 16, !tbaa !29
  %274 = call noundef <4 x float> @_Z9F128_MAddDv4_fS_S_(<4 x float> noundef %271, <4 x float> noundef %272, <4 x float> noundef %273)
  store <4 x float> %274, ptr %50, align 16, !tbaa !29
  call void @llvm.lifetime.start.p0(i64 16, ptr %51) #7
  %275 = load <4 x float>, ptr %44, align 16, !tbaa !29
  %276 = load <4 x float>, ptr %28, align 16, !tbaa !29
  %277 = load <4 x float>, ptr %31, align 16, !tbaa !29
  %278 = call noundef <4 x float> @_Z9F128_MAddDv4_fS_S_(<4 x float> noundef %275, <4 x float> noundef %276, <4 x float> noundef %277)
  store <4 x float> %278, ptr %51, align 16, !tbaa !29
  call void @llvm.lifetime.start.p0(i64 16, ptr %52) #7
  %279 = load <4 x float>, ptr %45, align 16, !tbaa !29
  %280 = load <4 x float>, ptr %29, align 16, !tbaa !29
  %281 = load <4 x float>, ptr %32, align 16, !tbaa !29
  %282 = call noundef <4 x float> @_Z9F128_MAddDv4_fS_S_(<4 x float> noundef %279, <4 x float> noundef %280, <4 x float> noundef %281)
  store <4 x float> %282, ptr %52, align 16, !tbaa !29
  call void @llvm.lifetime.start.p0(i64 16, ptr %53) #7
  %283 = load <4 x float>, ptr %47, align 16, !tbaa !29
  %284 = load <4 x float>, ptr %50, align 16, !tbaa !29
  %285 = call noundef <4 x float> @_Z8F128_MinDv4_fS_(<4 x float> noundef %283, <4 x float> noundef %284)
  store <4 x float> %285, ptr %53, align 16, !tbaa !29
  call void @llvm.lifetime.start.p0(i64 16, ptr %54) #7
  %286 = load <4 x float>, ptr %47, align 16, !tbaa !29
  %287 = load <4 x float>, ptr %50, align 16, !tbaa !29
  %288 = call noundef <4 x float> @_Z8F128_MaxDv4_fS_(<4 x float> noundef %286, <4 x float> noundef %287)
  store <4 x float> %288, ptr %54, align 16, !tbaa !29
  call void @llvm.lifetime.start.p0(i64 16, ptr %55) #7
  %289 = load <4 x float>, ptr %48, align 16, !tbaa !29
  %290 = load <4 x float>, ptr %51, align 16, !tbaa !29
  %291 = call noundef <4 x float> @_Z8F128_MinDv4_fS_(<4 x float> noundef %289, <4 x float> noundef %290)
  store <4 x float> %291, ptr %55, align 16, !tbaa !29
  call void @llvm.lifetime.start.p0(i64 16, ptr %56) #7
  %292 = load <4 x float>, ptr %48, align 16, !tbaa !29
  %293 = load <4 x float>, ptr %51, align 16, !tbaa !29
  %294 = call noundef <4 x float> @_Z8F128_MaxDv4_fS_(<4 x float> noundef %292, <4 x float> noundef %293)
  store <4 x float> %294, ptr %56, align 16, !tbaa !29
  call void @llvm.lifetime.start.p0(i64 16, ptr %57) #7
  %295 = load <4 x float>, ptr %49, align 16, !tbaa !29
  %296 = load <4 x float>, ptr %52, align 16, !tbaa !29
  %297 = call noundef <4 x float> @_Z8F128_MinDv4_fS_(<4 x float> noundef %295, <4 x float> noundef %296)
  store <4 x float> %297, ptr %57, align 16, !tbaa !29
  call void @llvm.lifetime.start.p0(i64 16, ptr %58) #7
  %298 = load <4 x float>, ptr %49, align 16, !tbaa !29
  %299 = load <4 x float>, ptr %52, align 16, !tbaa !29
  %300 = call noundef <4 x float> @_Z8F128_MaxDv4_fS_(<4 x float> noundef %298, <4 x float> noundef %299)
  store <4 x float> %300, ptr %58, align 16, !tbaa !29
  call void @llvm.lifetime.start.p0(i64 16, ptr %59) #7
  %301 = load <4 x float>, ptr %53, align 16, !tbaa !29
  %302 = load <4 x float>, ptr %55, align 16, !tbaa !29
  %303 = call noundef <4 x float> @_Z8F128_MaxDv4_fS_(<4 x float> noundef %301, <4 x float> noundef %302)
  %304 = load <4 x float>, ptr %57, align 16, !tbaa !29
  %305 = call noundef <4 x float> @_Z8F128_MaxDv4_fS_(<4 x float> noundef %303, <4 x float> noundef %304)
  store <4 x float> %305, ptr %59, align 16, !tbaa !29
  call void @llvm.lifetime.start.p0(i64 16, ptr %60) #7
  %306 = load <4 x float>, ptr %54, align 16, !tbaa !29
  %307 = load <4 x float>, ptr %56, align 16, !tbaa !29
  %308 = call noundef <4 x float> @_Z8F128_MinDv4_fS_(<4 x float> noundef %306, <4 x float> noundef %307)
  %309 = load <4 x float>, ptr %58, align 16, !tbaa !29
  %310 = call noundef <4 x float> @_Z8F128_MinDv4_fS_(<4 x float> noundef %308, <4 x float> noundef %309)
  store <4 x float> %310, ptr %60, align 16, !tbaa !29
  %311 = load <4 x float>, ptr %46, align 16, !tbaa !29
  %312 = load <4 x float>, ptr %13, align 16, !tbaa !29
  %313 = load <4 x float>, ptr %60, align 16, !tbaa !29
  %314 = call noundef <4 x float> @_Z12F128_GreaterDv4_fS_(<4 x float> noundef %312, <4 x float> noundef %313)
  %315 = call noundef <4 x float> @_Z14U128_Load_B128Dv4_f(<4 x float> noundef %314)
  %316 = call noundef <4 x float> @_Z7U128_ORDv4_fS_(<4 x float> noundef %311, <4 x float> noundef %315)
  store <4 x float> %316, ptr %46, align 16, !tbaa !29
  %317 = load <4 x float>, ptr %46, align 16, !tbaa !29
  %318 = load <4 x float>, ptr %59, align 16, !tbaa !29
  %319 = load <4 x float>, ptr %20, align 16, !tbaa !29
  %320 = call noundef <4 x float> @_Z12F128_GreaterDv4_fS_(<4 x float> noundef %318, <4 x float> noundef %319)
  %321 = call noundef <4 x float> @_Z14U128_Load_B128Dv4_f(<4 x float> noundef %320)
  %322 = call noundef <4 x float> @_Z7U128_ORDv4_fS_(<4 x float> noundef %317, <4 x float> noundef %321)
  store <4 x float> %322, ptr %46, align 16, !tbaa !29
  call void @llvm.lifetime.start.p0(i64 16, ptr %61) #7
  %323 = load <4 x float>, ptr %59, align 16, !tbaa !29
  %324 = load <4 x float>, ptr %60, align 16, !tbaa !29
  %325 = call noundef <4 x float> @_Z12F128_GreaterDv4_fS_(<4 x float> noundef %323, <4 x float> noundef %324)
  %326 = call noundef <4 x float> @_Z14U128_Load_B128Dv4_f(<4 x float> noundef %325)
  store <4 x float> %326, ptr %61, align 16, !tbaa !29
  %327 = load <4 x float>, ptr %61, align 16, !tbaa !29
  %328 = load <4 x float>, ptr %46, align 16, !tbaa !29
  %329 = call noundef <4 x float> @_Z7U128_ORDv4_fS_(<4 x float> noundef %327, <4 x float> noundef %328)
  store <4 x float> %329, ptr %61, align 16, !tbaa !29
  %330 = load <4 x float>, ptr %61, align 16, !tbaa !29
  %331 = getelementptr inbounds [4 x i32], ptr %35, i64 0, i64 0
  call void @_Z12U128_StoreAADv4_fPS_(<4 x float> noundef %330, ptr noundef %331)
  call void @llvm.lifetime.start.p0(i64 8, ptr %62) #7
  %332 = load ptr, ptr %39, align 8, !tbaa !5
  %333 = getelementptr inbounds %"struct.Riemann::BVHNodeBatch", ptr %332, i32 0, i32 6
  %334 = getelementptr inbounds [4 x i32], ptr %333, i64 0, i64 0
  store ptr %334, ptr %62, align 8, !tbaa !5
  %335 = load ptr, ptr %62, align 8, !tbaa !5
  %336 = getelementptr inbounds i32, ptr %335, i64 0
  %337 = load i32, ptr %336, align 4, !tbaa !30
  %338 = load ptr, ptr %17, align 8, !tbaa !5
  %339 = load i32, ptr %33, align 4, !tbaa !30
  %340 = zext i32 %339 to i64
  %341 = getelementptr inbounds i32, ptr %338, i64 %340
  store i32 %337, ptr %341, align 4, !tbaa !30
  %342 = getelementptr inbounds [4 x i32], ptr %35, i64 0, i64 0
  %343 = load i32, ptr %342, align 16, !tbaa !30
  %344 = add i32 1, %343
  %345 = load i32, ptr %33, align 4, !tbaa !30
  %346 = add i32 %345, %344
  store i32 %346, ptr %33, align 4, !tbaa !30
  %347 = load ptr, ptr %62, align 8, !tbaa !5
  %348 = getelementptr inbounds i32, ptr %347, i64 1
  %349 = load i32, ptr %348, align 4, !tbaa !30
  %350 = load ptr, ptr %17, align 8, !tbaa !5
  %351 = load i32, ptr %33, align 4, !tbaa !30
  %352 = zext i32 %351 to i64
  %353 = getelementptr inbounds i32, ptr %350, i64 %352
  store i32 %349, ptr %353, align 4, !tbaa !30
  %354 = getelementptr inbounds [4 x i32], ptr %35, i64 0, i64 1
  %355 = load i32, ptr %354, align 4, !tbaa !30
  %356 = add i32 1, %355
  %357 = load i32, ptr %33, align 4, !tbaa !30
  %358 = add i32 %357, %356
  store i32 %358, ptr %33, align 4, !tbaa !30
  %359 = load ptr, ptr %62, align 8, !tbaa !5
  %360 = getelementptr inbounds i32, ptr %359, i64 2
  %361 = load i32, ptr %360, align 4, !tbaa !30
  %362 = load ptr, ptr %17, align 8, !tbaa !5
  %363 = load i32, ptr %33, align 4, !tbaa !30
  %364 = zext i32 %363 to i64
  %365 = getelementptr inbounds i32, ptr %362, i64 %364
  store i32 %361, ptr %365, align 4, !tbaa !30
  %366 = getelementptr inbounds [4 x i32], ptr %35, i64 0, i64 2
  %367 = load i32, ptr %366, align 8, !tbaa !30
  %368 = add i32 1, %367
  %369 = load i32, ptr %33, align 4, !tbaa !30
  %370 = add i32 %369, %368
  store i32 %370, ptr %33, align 4, !tbaa !30
  %371 = load ptr, ptr %62, align 8, !tbaa !5
  %372 = getelementptr inbounds i32, ptr %371, i64 3
  %373 = load i32, ptr %372, align 4, !tbaa !30
  %374 = load ptr, ptr %17, align 8, !tbaa !5
  %375 = load i32, ptr %33, align 4, !tbaa !30
  %376 = zext i32 %375 to i64
  %377 = getelementptr inbounds i32, ptr %374, i64 %376
  store i32 %373, ptr %377, align 4, !tbaa !30
  %378 = getelementptr inbounds [4 x i32], ptr %35, i64 0, i64 3
  %379 = load i32, ptr %378, align 4, !tbaa !30
  %380 = add i32 1, %379
  %381 = load i32, ptr %33, align 4, !tbaa !30
  %382 = add i32 %381, %380
  store i32 %382, ptr %33, align 4, !tbaa !30
  call void @llvm.lifetime.end.p0(i64 8, ptr %62) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr %61) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr %60) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr %59) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr %58) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr %57) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr %56) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr %55) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr %54) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr %53) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr %52) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr %51) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr %50) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr %49) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr %48) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr %47) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr %46) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr %45) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr %44) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr %43) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr %42) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr %41) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr %40) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %39) #7
  store i32 0, ptr %38, align 4
  br label %383

383:                                              ; preds = %225, %224
  call void @llvm.lifetime.end.p0(i64 4, ptr %36) #7
  %384 = load i32, ptr %38, align 4
  switch i32 %384, label %391 [
    i32 0, label %385
    i32 5, label %179
  ]

385:                                              ; preds = %383
  br label %179, !llvm.loop !45

386:                                              ; preds = %179
  %387 = load ptr, ptr %11, align 8, !tbaa !5
  %388 = getelementptr inbounds %"struct.Riemann::TriMeshHitResult", ptr %387, i32 0, i32 0
  %389 = load float, ptr %388, align 4, !tbaa !27
  %390 = fcmp une float %389, 0x47EFFFFFE0000000
  store i1 %390, ptr %6, align 1
  store i32 1, ptr %38, align 4
  br label %391

391:                                              ; preds = %386, %383
  call void @llvm.lifetime.end.p0(i64 16, ptr %35) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %33) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr %32) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr %31) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr %30) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr %29) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr %28) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr %27) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr %26) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr %25) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr %24) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr %23) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr %22) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr %21) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr %20) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #7
  call void @llvm.lifetime.end.p0(i64 512, ptr %16) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr %14) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr %13) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr %12) #7
  br label %392

392:                                              ; preds = %391, %67
  %393 = load i1, ptr %6, align 1
  ret i1 %393
}

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef <4 x float> @_Z13U128_LoadXYZWjjjj(i32 noundef, i32 noundef, i32 noundef, i32 noundef) #4

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef <4 x float> @_Z9F128_Loadf(float noundef) #5

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef <4 x float> @_Z18F128_Load_Vector3dRKN5Maths8TVector3IfEE(ptr noundef nonnull align 4 dereferenceable(12)) #5

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef <4 x float> @_Z8U128_ANDDv4_fS_(<4 x float> noundef, <4 x float> noundef) #5

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef <4 x float> @_Z25U128_ReinterpretFrom_F128Dv4_f(<4 x float> noundef) #4

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef <4 x float> @_Z8F128_AbsDv4_f(<4 x float> noundef) #5

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef <4 x float> @_Z25F128_ReinterpretFrom_U128Dv4_f(<4 x float> noundef) #4

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef <4 x float> @_Z7U128_ORDv4_fS_(<4 x float> noundef, <4 x float> noundef) #5

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef <4 x float> @_Z8F128_MaxDv4_fS_(<4 x float> noundef, <4 x float> noundef) #5

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef <4 x float> @_Z14F128_RecipFastDv4_f(<4 x float> noundef) #5

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef <4 x float> @_Z8F128_MulDv4_fS_(<4 x float> noundef, <4 x float> noundef) #5

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef <4 x float> @_Z12F128_NegMSubDv4_fS_S_(<4 x float> noundef, <4 x float> noundef, <4 x float> noundef) #5

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef <4 x float> @_Z9F128_Zerov() #4

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef <4 x float> @_Z17F128_SplatElementILi0EEDv4_fS0_(<4 x float> noundef) #5

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef <4 x float> @_Z17F128_SplatElementILi1EEDv4_fS0_(<4 x float> noundef) #5

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef <4 x float> @_Z17F128_SplatElementILi2EEDv4_fS0_(<4 x float> noundef) #5

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef <4 x float> @_Z10F128_LoadAPKf(ptr noundef) #5

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef <4 x float> @_Z14U128_Load_B128Dv4_f(<4 x float> noundef) #4

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef <4 x float> @_Z12F128_GreaterDv4_fS_(<4 x float> noundef, <4 x float> noundef) #5

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef <4 x float> @_Z9F128_MAddDv4_fS_S_(<4 x float> noundef, <4 x float> noundef, <4 x float> noundef) #5

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef <4 x float> @_Z8F128_MinDv4_fS_(<4 x float> noundef, <4 x float> noundef) #5

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_Z12U128_StoreAADv4_fPS_(<4 x float> noundef, ptr noundef) #4

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 = { mustprogress uwtable "min-legal-vector-width"="128" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { inlinehint mustprogress nounwind uwtable "min-legal-vector-width"="128" "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"="128" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { noreturn nounwind "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 #7 = { nounwind }
attributes #8 = { 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 184}
!10 = !{!"_ZTSN7Riemann12TriangleMeshE", !11, i64 0, !6, i64 184}
!11 = !{!"_ZTSN7Riemann10StaticMeshE", !12, i64 0, !12, i64 4, !13, i64 8, !17, i64 32, !13, i64 56, !13, i64 80, !21, i64 104, !7, i64 128, !24, i64 136, !6, i64 168, !6, i64 176}
!12 = !{!"int", !7, i64 0}
!13 = !{!"_ZTSSt6vectorIN5Maths8TVector3IfEESaIS2_EE", !14, i64 0}
!14 = !{!"_ZTSSt12_Vector_baseIN5Maths8TVector3IfEESaIS2_EE", !15, i64 0}
!15 = !{!"_ZTSNSt12_Vector_baseIN5Maths8TVector3IfEESaIS2_EE12_Vector_implE", !16, i64 0}
!16 = !{!"_ZTSNSt12_Vector_baseIN5Maths8TVector3IfEESaIS2_EE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!17 = !{!"_ZTSSt6vectorItSaItEE", !18, i64 0}
!18 = !{!"_ZTSSt12_Vector_baseItSaItEE", !19, i64 0}
!19 = !{!"_ZTSNSt12_Vector_baseItSaItEE12_Vector_implE", !20, i64 0}
!20 = !{!"_ZTSNSt12_Vector_baseItSaItEE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!21 = !{!"_ZTSN5Maths6TAABB3IfEE", !22, i64 0, !22, i64 12}
!22 = !{!"_ZTSN5Maths8TVector3IfEE", !23, i64 0, !23, i64 4, !23, i64 8}
!23 = !{!"float", !7, i64 0}
!24 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE", !25, i64 0, !26, i64 8, !7, i64 16}
!25 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_Alloc_hiderE", !6, i64 0}
!26 = !{!"long", !7, i64 0}
!27 = !{!28, !23, i64 0}
!28 = !{!"_ZTSN7Riemann16TriMeshHitResultE", !23, i64 0, !22, i64 4, !12, i64 16, !12, i64 20}
!29 = !{!7, !7, i64 0}
!30 = !{!12, !12, i64 0}
!31 = !{!32, !6, i64 88}
!32 = !{!"_ZTSN7Riemann8MeshBVH4E", !33, i64 0, !33, i64 16, !6, i64 32, !7, i64 40, !12, i64 64, !12, i64 68, !12, i64 72, !12, i64 76, !12, i64 80, !12, i64 84, !6, i64 88}
!33 = !{!"_ZTSN5Maths8TVector4IfEE", !23, i64 0, !23, i64 4, !23, i64 8, !23, i64 12}
!34 = !{!35, !23, i64 4}
!35 = !{!"_ZTSN7Riemann16TriMeshHitOptionE", !36, i64 0, !36, i64 1, !23, i64 4}
!36 = !{!"bool", !7, i64 0}
!37 = !{!23, !23, i64 0}
!38 = !{!32, !12, i64 68}
!39 = distinct !{!39, !40}
!40 = !{!"llvm.loop.mustprogress"}
!41 = !{!36, !36, i64 0}
!42 = !{i8 0, i8 2}
!43 = !{}
!44 = !{!35, !36, i64 0}
!45 = distinct !{!45, !40}


; 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"

@.str = external hidden unnamed_addr constant [16 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [95 x i8], align 1
@__PRETTY_FUNCTION__._ZNK7Riemann12TriangleMesh12IntersectRayERKN5Maths8TVector3IfEES5_RKNS_16TriMeshHitOptionEPNS_16TriMeshHitResultE = external hidden unnamed_addr constant [127 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [40 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [20 x i8], align 1

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

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZNK7Riemann12TriangleMesh15RayIntersectTriEjRKN5Maths8TVector3IfEES5_RKNS_16TriMeshHitOptionEPNS_16TriMeshHitResultE(ptr noundef nonnull align 8 dereferenceable(192), i32 noundef, ptr noundef nonnull align 4 dereferenceable(12), ptr noundef nonnull align 4 dereferenceable(12), ptr noundef nonnull align 4 dereferenceable(8), ptr noundef) local_unnamed_addr #1 align 2

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

; Function Attrs: mustprogress uwtable
define dso_local noundef zeroext i1 @_ZNK7Riemann12TriangleMesh12IntersectRayERKN5Maths8TVector3IfEES5_RKNS_16TriMeshHitOptionEPNS_16TriMeshHitResultE(ptr noundef nonnull align 8 dereferenceable(192) %0, ptr noundef nonnull align 4 dereferenceable(12) %1, ptr noundef nonnull align 4 dereferenceable(12) %2, ptr noundef nonnull align 4 dereferenceable(8) %3, ptr noundef %4) local_unnamed_addr #3 align 2 {
  %6 = alloca [128 x i32], align 16
  %7 = alloca [4 x i32], align 16
  %8 = getelementptr inbounds i8, ptr %0, i64 184
  %9 = load ptr, ptr %8, align 8, !tbaa !5
  %10 = icmp eq ptr %9, null
  br i1 %10, label %151, label %11

11:                                               ; preds = %5
  store float 0x47EFFFFFE0000000, ptr %4, align 4, !tbaa !26
  %12 = tail call noundef <4 x float> @_Z13U128_LoadXYZWjjjj(i32 noundef -2147483648, i32 noundef -2147483648, i32 noundef -2147483648, i32 noundef -2147483648)
  %13 = tail call noundef <4 x float> @_Z9F128_Loadf(float noundef 0x3E112E0BE0000000)
  %14 = tail call noundef <4 x float> @_Z9F128_Loadf(float noundef 2.000000e+00)
  call void @llvm.lifetime.start.p0(i64 512, ptr nonnull %6) #7
  %15 = getelementptr inbounds i8, ptr %6, i64 4
  %16 = load ptr, ptr %8, align 8, !tbaa !5
  %17 = getelementptr inbounds i8, ptr %16, i64 88
  %18 = load ptr, ptr %17, align 8, !tbaa !28
  %.not = icmp eq ptr %18, null
  br i1 %.not, label %19, label %20

19:                                               ; preds = %11
  tail call void @__assert_fail(ptr noundef nonnull @.str, ptr noundef nonnull @.str.1, i32 noundef 426, ptr noundef nonnull @__PRETTY_FUNCTION__._ZNK7Riemann12TriangleMesh12IntersectRayERKN5Maths8TVector3IfEES5_RKNS_16TriMeshHitOptionEPNS_16TriMeshHitResultE) #8
  unreachable

20:                                               ; preds = %11
  %21 = ptrtoint ptr %18 to i64
  %22 = and i64 %21, 127
  %23 = icmp eq i64 %22, 0
  br i1 %23, label %25, label %24

24:                                               ; preds = %20
  tail call void @__assert_fail(ptr noundef nonnull @.str.2, ptr noundef nonnull @.str.1, i32 noundef 427, ptr noundef nonnull @__PRETTY_FUNCTION__._ZNK7Riemann12TriangleMesh12IntersectRayERKN5Maths8TVector3IfEES5_RKNS_16TriMeshHitOptionEPNS_16TriMeshHitResultE) #8
  unreachable

25:                                               ; preds = %20
  %26 = getelementptr inbounds i8, ptr %3, i64 4
  %27 = load float, ptr %26, align 4, !tbaa !31
  %28 = tail call noundef <4 x float> @_Z9F128_Loadf(float noundef %27)
  %29 = tail call noundef <4 x float> @_Z18F128_Load_Vector3dRKN5Maths8TVector3IfEE(ptr noundef nonnull align 4 dereferenceable(12) %1)
  %30 = tail call noundef <4 x float> @_Z18F128_Load_Vector3dRKN5Maths8TVector3IfEE(ptr noundef nonnull align 4 dereferenceable(12) %2)
  %31 = tail call noundef <4 x float> @_Z25U128_ReinterpretFrom_F128Dv4_f(<4 x float> noundef %30)
  %32 = tail call noundef <4 x float> @_Z8U128_ANDDv4_fS_(<4 x float> noundef %31, <4 x float> noundef %12)
  %33 = tail call noundef <4 x float> @_Z8F128_AbsDv4_f(<4 x float> noundef %30)
  %34 = tail call noundef <4 x float> @_Z8F128_MaxDv4_fS_(<4 x float> noundef %33, <4 x float> noundef %13)
  %35 = tail call noundef <4 x float> @_Z25U128_ReinterpretFrom_F128Dv4_f(<4 x float> noundef %34)
  %36 = tail call noundef <4 x float> @_Z7U128_ORDv4_fS_(<4 x float> noundef %32, <4 x float> noundef %35)
  %37 = tail call noundef <4 x float> @_Z25F128_ReinterpretFrom_U128Dv4_f(<4 x float> noundef %36)
  %38 = tail call noundef <4 x float> @_Z14F128_RecipFastDv4_f(<4 x float> noundef %37)
  %39 = tail call noundef <4 x float> @_Z12F128_NegMSubDv4_fS_S_(<4 x float> noundef %37, <4 x float> noundef %38, <4 x float> noundef %14)
  %40 = tail call noundef <4 x float> @_Z8F128_MulDv4_fS_(<4 x float> noundef %38, <4 x float> noundef %39)
  %41 = tail call noundef <4 x float> @_Z9F128_Zerov()
  %42 = tail call noundef <4 x float> @_Z12F128_NegMSubDv4_fS_S_(<4 x float> noundef %40, <4 x float> noundef %29, <4 x float> noundef %41)
  %43 = tail call noundef <4 x float> @_Z17F128_SplatElementILi0EEDv4_fS0_(<4 x float> noundef %40)
  %44 = tail call noundef <4 x float> @_Z17F128_SplatElementILi1EEDv4_fS0_(<4 x float> noundef %40)
  %45 = tail call noundef <4 x float> @_Z17F128_SplatElementILi2EEDv4_fS0_(<4 x float> noundef %40)
  %46 = tail call noundef <4 x float> @_Z17F128_SplatElementILi0EEDv4_fS0_(<4 x float> noundef %42)
  %47 = tail call noundef <4 x float> @_Z17F128_SplatElementILi1EEDv4_fS0_(<4 x float> noundef %42)
  %48 = tail call noundef <4 x float> @_Z17F128_SplatElementILi2EEDv4_fS0_(<4 x float> noundef %42)
  %49 = load ptr, ptr %8, align 8, !tbaa !5
  %50 = getelementptr inbounds i8, ptr %49, i64 68
  %51 = load i32, ptr %50, align 4, !tbaa !34
  %.not141 = icmp eq i32 %51, 0
  br i1 %.not141, label %59, label %.preheader

.preheader:                                       ; preds = %25
  %.0135148 = add i32 %51, -1
  %52 = icmp sgt i32 %.0135148, -1
  br i1 %52, label %.lr.ph.preheader, label %._crit_edge.thread

._crit_edge.thread:                               ; preds = %.preheader
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %7) #7
  br label %._crit_edge157

.lr.ph.preheader:                                 ; preds = %.preheader
  %wide.trip.count = zext i32 %51 to i64
  %min.iters.check = icmp ult i32 %51, 8
  br i1 %min.iters.check, label %.lr.ph.preheader163, label %vector.ph

.lr.ph.preheader163:                              ; preds = %middle.block, %.lr.ph.preheader
  %indvars.iv.ph = phi i64 [ 0, %.lr.ph.preheader ], [ %n.vec, %middle.block ]
  %.0135150.ph = phi i32 [ %.0135148, %.lr.ph.preheader ], [ %ind.end, %middle.block ]
  br label %.lr.ph

vector.ph:                                        ; preds = %.lr.ph.preheader
  %n.vec = and i64 %wide.trip.count, 4294967288
  %.cast = trunc nuw i64 %n.vec to i32
  %ind.end = sub i32 %.0135148, %.cast
  %.splatinsert = insertelement <4 x i32> poison, i32 %.0135148, i64 0
  %.splat = shufflevector <4 x i32> %.splatinsert, <4 x i32> poison, <4 x i32> zeroinitializer
  %induction = add nsw <4 x i32> %.splat, <i32 0, i32 -1, i32 -2, i32 -3>
  br label %vector.body

vector.body:                                      ; preds = %vector.body, %vector.ph
  %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
  %vec.ind = phi <4 x i32> [ %induction, %vector.ph ], [ %vec.ind.next, %vector.body ]
  %53 = mul <4 x i32> %vec.ind, <i32 112, i32 112, i32 112, i32 112>
  %54 = mul <4 x i32> %vec.ind, <i32 112, i32 112, i32 112, i32 112>
  %55 = add <4 x i32> %54, <i32 -448, i32 -448, i32 -448, i32 -448>
  %56 = getelementptr inbounds i32, ptr %15, i64 %index
  %57 = getelementptr inbounds i8, ptr %56, i64 16
  store <4 x i32> %53, ptr %56, align 4, !tbaa !35
  store <4 x i32> %55, ptr %57, align 4, !tbaa !35
  %index.next = add nuw i64 %index, 8
  %vec.ind.next = add <4 x i32> %vec.ind, <i32 -8, i32 -8, i32 -8, i32 -8>
  %58 = icmp eq i64 %index.next, %n.vec
  br i1 %58, label %middle.block, label %vector.body, !llvm.loop !36

middle.block:                                     ; preds = %vector.body
  %cmp.n = icmp eq i64 %n.vec, %wide.trip.count
  br i1 %cmp.n, label %._crit_edge, label %.lr.ph.preheader163

59:                                               ; preds = %25
  tail call void @__assert_fail(ptr noundef nonnull @.str.3, ptr noundef nonnull @.str.1, i32 noundef 460, ptr noundef nonnull @__PRETTY_FUNCTION__._ZNK7Riemann12TriangleMesh12IntersectRayERKN5Maths8TVector3IfEES5_RKNS_16TriMeshHitOptionEPNS_16TriMeshHitResultE) #8
  unreachable

._crit_edge:                                      ; preds = %.lr.ph, %middle.block
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %7) #7
  %60 = getelementptr inbounds i8, ptr %7, i64 4
  %61 = getelementptr inbounds i8, ptr %7, i64 8
  %62 = getelementptr inbounds i8, ptr %7, i64 12
  br label %65

.lr.ph:                                           ; preds = %.lr.ph.preheader163, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ %indvars.iv.ph, %.lr.ph.preheader163 ]
  %.0135150 = phi i32 [ %.0135, %.lr.ph ], [ %.0135150.ph, %.lr.ph.preheader163 ]
  %63 = mul i32 %.0135150, 112
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %64 = getelementptr inbounds i32, ptr %15, i64 %indvars.iv
  store i32 %63, ptr %64, align 4, !tbaa !35
  %.0135 = add nsw i32 %.0135150, -1
  %exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
  br i1 %exitcond.not, label %._crit_edge, label %.lr.ph, !llvm.loop !40

65:                                               ; preds = %._crit_edge, %148
  %.0124154 = phi float [ %27, %._crit_edge ], [ %.3127, %148 ]
  %.0128153 = phi <4 x float> [ %28, %._crit_edge ], [ %.3131, %148 ]
  %.1133152 = phi i32 [ %51, %._crit_edge ], [ %.2134, %148 ]
  %66 = add i32 %.1133152, -1
  %67 = zext i32 %66 to i64
  %68 = getelementptr inbounds i32, ptr %15, i64 %67
  %69 = load i32, ptr %68, align 4, !tbaa !35
  %70 = and i32 %69, 1
  %.not143 = icmp eq i32 %70, 0
  br i1 %.not143, label %82, label %71

71:                                               ; preds = %65
  %72 = add nsw i32 %69, -1
  %73 = call noundef zeroext i1 @_ZNK7Riemann12TriangleMesh15RayIntersectTriEjRKN5Maths8TVector3IfEES5_RKNS_16TriMeshHitOptionEPNS_16TriMeshHitResultE(ptr noundef nonnull align 8 dereferenceable(192) %0, i32 noundef %72, ptr noundef nonnull align 4 dereferenceable(12) %1, ptr noundef nonnull align 4 dereferenceable(12) %2, ptr noundef nonnull align 4 dereferenceable(8) %3, ptr noundef nonnull %4)
  br i1 %73, label %74, label %148, !llvm.loop !41

74:                                               ; preds = %71
  %75 = load i8, ptr %3, align 4, !tbaa !42, !range !43, !noundef !44
  %76 = trunc nuw i8 %75 to i1
  br i1 %76, label %77, label %.thread

77:                                               ; preds = %74
  %78 = load float, ptr %4, align 4, !tbaa !26
  %79 = fcmp olt float %78, %.0124154
  br i1 %79, label %80, label %148, !llvm.loop !41

80:                                               ; preds = %77
  %81 = call noundef <4 x float> @_Z9F128_Loadf(float noundef %78)
  br label %148, !llvm.loop !41

82:                                               ; preds = %65
  call void @_ZN7Riemann16TriMeshHitResult12AddTestCountEi(ptr noundef nonnull align 4 dereferenceable(24) %4, i32 noundef 2)
  %83 = zext i32 %69 to i64
  %84 = getelementptr inbounds i8, ptr %18, i64 %83
  %85 = call noundef <4 x float> @_Z10F128_LoadAPKf(ptr noundef nonnull %84)
  %86 = getelementptr inbounds i8, ptr %84, i64 16
  %87 = call noundef <4 x float> @_Z10F128_LoadAPKf(ptr noundef nonnull %86)
  %88 = getelementptr inbounds i8, ptr %84, i64 32
  %89 = call noundef <4 x float> @_Z10F128_LoadAPKf(ptr noundef nonnull %88)
  %90 = getelementptr inbounds i8, ptr %84, i64 48
  %91 = call noundef <4 x float> @_Z10F128_LoadAPKf(ptr noundef nonnull %90)
  %92 = getelementptr inbounds i8, ptr %84, i64 64
  %93 = call noundef <4 x float> @_Z10F128_LoadAPKf(ptr noundef nonnull %92)
  %94 = getelementptr inbounds i8, ptr %84, i64 80
  %95 = call noundef <4 x float> @_Z10F128_LoadAPKf(ptr noundef nonnull %94)
  %96 = call noundef <4 x float> @_Z12F128_GreaterDv4_fS_(<4 x float> noundef %85, <4 x float> noundef %91)
  %97 = call noundef <4 x float> @_Z14U128_Load_B128Dv4_f(<4 x float> noundef %96)
  %98 = call noundef <4 x float> @_Z9F128_MAddDv4_fS_S_(<4 x float> noundef %85, <4 x float> noundef %43, <4 x float> noundef %46)
  %99 = call noundef <4 x float> @_Z9F128_MAddDv4_fS_S_(<4 x float> noundef %87, <4 x float> noundef %44, <4 x float> noundef %47)
  %100 = call noundef <4 x float> @_Z9F128_MAddDv4_fS_S_(<4 x float> noundef %89, <4 x float> noundef %45, <4 x float> noundef %48)
  %101 = call noundef <4 x float> @_Z9F128_MAddDv4_fS_S_(<4 x float> noundef %91, <4 x float> noundef %43, <4 x float> noundef %46)
  %102 = call noundef <4 x float> @_Z9F128_MAddDv4_fS_S_(<4 x float> noundef %93, <4 x float> noundef %44, <4 x float> noundef %47)
  %103 = call noundef <4 x float> @_Z9F128_MAddDv4_fS_S_(<4 x float> noundef %95, <4 x float> noundef %45, <4 x float> noundef %48)
  %104 = call noundef <4 x float> @_Z8F128_MinDv4_fS_(<4 x float> noundef %98, <4 x float> noundef %101)
  %105 = call noundef <4 x float> @_Z8F128_MaxDv4_fS_(<4 x float> noundef %98, <4 x float> noundef %101)
  %106 = call noundef <4 x float> @_Z8F128_MinDv4_fS_(<4 x float> noundef %99, <4 x float> noundef %102)
  %107 = call noundef <4 x float> @_Z8F128_MaxDv4_fS_(<4 x float> noundef %99, <4 x float> noundef %102)
  %108 = call noundef <4 x float> @_Z8F128_MinDv4_fS_(<4 x float> noundef %100, <4 x float> noundef %103)
  %109 = call noundef <4 x float> @_Z8F128_MaxDv4_fS_(<4 x float> noundef %100, <4 x float> noundef %103)
  %110 = call noundef <4 x float> @_Z8F128_MaxDv4_fS_(<4 x float> noundef %104, <4 x float> noundef %106)
  %111 = call noundef <4 x float> @_Z8F128_MaxDv4_fS_(<4 x float> noundef %110, <4 x float> noundef %108)
  %112 = call noundef <4 x float> @_Z8F128_MinDv4_fS_(<4 x float> noundef %105, <4 x float> noundef %107)
  %113 = call noundef <4 x float> @_Z8F128_MinDv4_fS_(<4 x float> noundef %112, <4 x float> noundef %109)
  %114 = call noundef <4 x float> @_Z12F128_GreaterDv4_fS_(<4 x float> noundef %13, <4 x float> noundef %113)
  %115 = call noundef <4 x float> @_Z14U128_Load_B128Dv4_f(<4 x float> noundef %114)
  %116 = call noundef <4 x float> @_Z7U128_ORDv4_fS_(<4 x float> noundef %97, <4 x float> noundef %115)
  %117 = call noundef <4 x float> @_Z12F128_GreaterDv4_fS_(<4 x float> noundef %111, <4 x float> noundef %.0128153)
  %118 = call noundef <4 x float> @_Z14U128_Load_B128Dv4_f(<4 x float> noundef %117)
  %119 = call noundef <4 x float> @_Z7U128_ORDv4_fS_(<4 x float> noundef %116, <4 x float> noundef %118)
  %120 = call noundef <4 x float> @_Z12F128_GreaterDv4_fS_(<4 x float> noundef %111, <4 x float> noundef %113)
  %121 = call noundef <4 x float> @_Z14U128_Load_B128Dv4_f(<4 x float> noundef %120)
  %122 = call noundef <4 x float> @_Z7U128_ORDv4_fS_(<4 x float> noundef %121, <4 x float> noundef %119)
  call void @_Z12U128_StoreAADv4_fPS_(<4 x float> noundef %122, ptr noundef nonnull %7)
  %123 = getelementptr inbounds i8, ptr %84, i64 96
  %124 = load i32, ptr %123, align 4, !tbaa !35
  store i32 %124, ptr %68, align 4, !tbaa !35
  %125 = load i32, ptr %7, align 16, !tbaa !35
  %126 = add i32 %125, %.1133152
  %127 = getelementptr inbounds i8, ptr %84, i64 100
  %128 = load i32, ptr %127, align 4, !tbaa !35
  %129 = zext i32 %126 to i64
  %130 = getelementptr inbounds i32, ptr %15, i64 %129
  store i32 %128, ptr %130, align 4, !tbaa !35
  %131 = load i32, ptr %60, align 4, !tbaa !35
  %132 = add i32 %126, 1
  %133 = add i32 %132, %131
  %134 = getelementptr inbounds i8, ptr %84, i64 104
  %135 = load i32, ptr %134, align 4, !tbaa !35
  %136 = zext i32 %133 to i64
  %137 = getelementptr inbounds i32, ptr %15, i64 %136
  store i32 %135, ptr %137, align 4, !tbaa !35
  %138 = load i32, ptr %61, align 8, !tbaa !35
  %139 = add i32 %133, 1
  %140 = add i32 %139, %138
  %141 = getelementptr inbounds i8, ptr %84, i64 108
  %142 = load i32, ptr %141, align 4, !tbaa !35
  %143 = zext i32 %140 to i64
  %144 = getelementptr inbounds i32, ptr %15, i64 %143
  store i32 %142, ptr %144, align 4, !tbaa !35
  %145 = load i32, ptr %62, align 4, !tbaa !35
  %146 = add i32 %140, 1
  %147 = add i32 %146, %145
  br label %148

148:                                              ; preds = %77, %80, %71, %82
  %.2134 = phi i32 [ %147, %82 ], [ %66, %71 ], [ %66, %80 ], [ %66, %77 ]
  %.3131 = phi <4 x float> [ %.0128153, %82 ], [ %.0128153, %71 ], [ %81, %80 ], [ %.0128153, %77 ]
  %.3127 = phi float [ %.0124154, %82 ], [ %.0124154, %71 ], [ %78, %80 ], [ %.0124154, %77 ]
  %.not142 = icmp eq i32 %.2134, 0
  br i1 %.not142, label %._crit_edge157, label %65

._crit_edge157:                                   ; preds = %148, %._crit_edge.thread
  %149 = load float, ptr %4, align 4, !tbaa !26
  %150 = fcmp une float %149, 0x47EFFFFFE0000000
  br label %.thread

.thread:                                          ; preds = %74, %._crit_edge157
  %.3 = phi i1 [ %150, %._crit_edge157 ], [ true, %74 ]
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %7) #7
  call void @llvm.lifetime.end.p0(i64 512, ptr nonnull %6) #7
  br label %151

151:                                              ; preds = %5, %.thread
  %.4 = phi i1 [ %.3, %.thread ], [ false, %5 ]
  ret i1 %.4
}

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef <4 x float> @_Z13U128_LoadXYZWjjjj(i32 noundef, i32 noundef, i32 noundef, i32 noundef) local_unnamed_addr #4

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef <4 x float> @_Z9F128_Loadf(float noundef) local_unnamed_addr #5

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef <4 x float> @_Z18F128_Load_Vector3dRKN5Maths8TVector3IfEE(ptr noundef nonnull align 4 dereferenceable(12)) local_unnamed_addr #5

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef <4 x float> @_Z8U128_ANDDv4_fS_(<4 x float> noundef, <4 x float> noundef) local_unnamed_addr #5

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef <4 x float> @_Z25U128_ReinterpretFrom_F128Dv4_f(<4 x float> noundef) local_unnamed_addr #4

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef <4 x float> @_Z8F128_AbsDv4_f(<4 x float> noundef) local_unnamed_addr #5

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef <4 x float> @_Z25F128_ReinterpretFrom_U128Dv4_f(<4 x float> noundef) local_unnamed_addr #4

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef <4 x float> @_Z7U128_ORDv4_fS_(<4 x float> noundef, <4 x float> noundef) local_unnamed_addr #5

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef <4 x float> @_Z8F128_MaxDv4_fS_(<4 x float> noundef, <4 x float> noundef) local_unnamed_addr #5

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef <4 x float> @_Z14F128_RecipFastDv4_f(<4 x float> noundef) local_unnamed_addr #5

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef <4 x float> @_Z8F128_MulDv4_fS_(<4 x float> noundef, <4 x float> noundef) local_unnamed_addr #5

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef <4 x float> @_Z12F128_NegMSubDv4_fS_S_(<4 x float> noundef, <4 x float> noundef, <4 x float> noundef) local_unnamed_addr #5

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef <4 x float> @_Z9F128_Zerov() local_unnamed_addr #4

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef <4 x float> @_Z17F128_SplatElementILi0EEDv4_fS0_(<4 x float> noundef) local_unnamed_addr #5

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef <4 x float> @_Z17F128_SplatElementILi1EEDv4_fS0_(<4 x float> noundef) local_unnamed_addr #5

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef <4 x float> @_Z17F128_SplatElementILi2EEDv4_fS0_(<4 x float> noundef) local_unnamed_addr #5

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef <4 x float> @_Z10F128_LoadAPKf(ptr noundef) local_unnamed_addr #5

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef <4 x float> @_Z14U128_Load_B128Dv4_f(<4 x float> noundef) local_unnamed_addr #4

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef <4 x float> @_Z12F128_GreaterDv4_fS_(<4 x float> noundef, <4 x float> noundef) local_unnamed_addr #5

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef <4 x float> @_Z9F128_MAddDv4_fS_S_(<4 x float> noundef, <4 x float> noundef, <4 x float> noundef) local_unnamed_addr #5

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef <4 x float> @_Z8F128_MinDv4_fS_(<4 x float> noundef, <4 x float> noundef) local_unnamed_addr #5

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_Z12U128_StoreAADv4_fPS_(<4 x float> noundef, ptr noundef) local_unnamed_addr #4

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 = { mustprogress uwtable "min-legal-vector-width"="128" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { inlinehint mustprogress nounwind uwtable "min-legal-vector-width"="128" "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"="128" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { noreturn nounwind "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 #7 = { nounwind }
attributes #8 = { 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, !15, i64 184}
!6 = !{!"_ZTSN7Riemann12TriangleMeshE", !7, i64 0, !15, i64 184}
!7 = !{!"_ZTSN7Riemann10StaticMeshE", !8, i64 0, !8, i64 4, !11, i64 8, !16, i64 32, !11, i64 56, !11, i64 80, !20, i64 104, !9, i64 128, !23, i64 136, !15, i64 168, !15, i64 176}
!8 = !{!"int", !9, i64 0}
!9 = !{!"omnipotent char", !10, i64 0}
!10 = !{!"Simple C++ TBAA"}
!11 = !{!"_ZTSSt6vectorIN5Maths8TVector3IfEESaIS2_EE", !12, i64 0}
!12 = !{!"_ZTSSt12_Vector_baseIN5Maths8TVector3IfEESaIS2_EE", !13, i64 0}
!13 = !{!"_ZTSNSt12_Vector_baseIN5Maths8TVector3IfEESaIS2_EE12_Vector_implE", !14, i64 0}
!14 = !{!"_ZTSNSt12_Vector_baseIN5Maths8TVector3IfEESaIS2_EE17_Vector_impl_dataE", !15, i64 0, !15, i64 8, !15, i64 16}
!15 = !{!"any pointer", !9, i64 0}
!16 = !{!"_ZTSSt6vectorItSaItEE", !17, i64 0}
!17 = !{!"_ZTSSt12_Vector_baseItSaItEE", !18, i64 0}
!18 = !{!"_ZTSNSt12_Vector_baseItSaItEE12_Vector_implE", !19, i64 0}
!19 = !{!"_ZTSNSt12_Vector_baseItSaItEE17_Vector_impl_dataE", !15, i64 0, !15, i64 8, !15, i64 16}
!20 = !{!"_ZTSN5Maths6TAABB3IfEE", !21, i64 0, !21, i64 12}
!21 = !{!"_ZTSN5Maths8TVector3IfEE", !22, i64 0, !22, i64 4, !22, i64 8}
!22 = !{!"float", !9, i64 0}
!23 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE", !24, i64 0, !25, i64 8, !9, i64 16}
!24 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_Alloc_hiderE", !15, i64 0}
!25 = !{!"long", !9, i64 0}
!26 = !{!27, !22, i64 0}
!27 = !{!"_ZTSN7Riemann16TriMeshHitResultE", !22, i64 0, !21, i64 4, !8, i64 16, !8, i64 20}
!28 = !{!29, !15, i64 88}
!29 = !{!"_ZTSN7Riemann8MeshBVH4E", !30, i64 0, !30, i64 16, !15, i64 32, !9, i64 40, !8, i64 64, !8, i64 68, !8, i64 72, !8, i64 76, !8, i64 80, !8, i64 84, !15, i64 88}
!30 = !{!"_ZTSN5Maths8TVector4IfEE", !22, i64 0, !22, i64 4, !22, i64 8, !22, i64 12}
!31 = !{!32, !22, i64 4}
!32 = !{!"_ZTSN7Riemann16TriMeshHitOptionE", !33, i64 0, !33, i64 1, !22, i64 4}
!33 = !{!"bool", !9, i64 0}
!34 = !{!29, !8, i64 68}
!35 = !{!8, !8, i64 0}
!36 = distinct !{!36, !37, !38, !39}
!37 = !{!"llvm.loop.mustprogress"}
!38 = !{!"llvm.loop.isvectorized", i32 1}
!39 = !{!"llvm.loop.unroll.runtime.disable"}
!40 = distinct !{!40, !37, !39, !38}
!41 = distinct !{!41, !37}
!42 = !{!32, !33, i64 0}
!43 = !{i8 0, i8 2}
!44 = !{}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LCSSAPass,LICMPass,LoopLoadEliminationPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,LoopVectorizePass,ReassociatePass,SROAPass,SimplifyCFGPass,TailCallElimPass