; LLVM IR from doyubkim/fluid-engine-dev :: src/jet/surface_set3.ll (ZNK3jet11SurfaceSet318closestNormalLocalERKNS_6VectorIdLm3EEE)

; 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.jet::Vector" = type { double, double, double }
%class.anon.11 = type { i8 }
%"class.std::initializer_list" = type { ptr, i64 }
%"struct.jet::NearestNeighborQueryResult3" = type { ptr, double }
%"class.std::function" = type { %"class.std::_Function_base", ptr }
%"class.std::_Function_base" = type { %"union.std::_Any_data", ptr }
%"union.std::_Any_data" = type { %"union.std::_Nocopy_types" }
%"union.std::_Nocopy_types" = type { { i64, i64 } }
%"class.__gnu_cxx::__normal_iterator.10" = type { ptr }
%"class.std::shared_ptr" = type { %"class.std::__shared_ptr" }
%"class.std::__shared_ptr" = type { ptr, %"class.std::__shared_count" }
%"class.std::__shared_count" = type { ptr }
%"class.jet::SurfaceSet3" = type <{ %"class.jet::Surface3.base", [7 x i8], %"class.std::vector", %"class.std::vector", %"class.jet::Bvh3", i8, [7 x i8] }>
%"class.jet::Surface3.base" = type <{ ptr, %"class.jet::Transform3", i8 }>
%"class.jet::Transform3" = type { %"class.jet::Vector", %"class.jet::Quaternion", %"class.jet::Matrix", %"class.jet::Matrix" }
%"class.jet::Quaternion" = type { double, double, double, double }
%"class.jet::Matrix" = type { %"struct.std::array" }
%"struct.std::array" = type { [9 x double] }
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<std::shared_ptr<jet::Surface3>, std::allocator<std::shared_ptr<jet::Surface3>>>::_Vector_impl" }
%"struct.std::_Vector_base<std::shared_ptr<jet::Surface3>, std::allocator<std::shared_ptr<jet::Surface3>>>::_Vector_impl" = type { %"struct.std::_Vector_base<std::shared_ptr<jet::Surface3>, std::allocator<std::shared_ptr<jet::Surface3>>>::_Vector_impl_data" }
%"struct.std::_Vector_base<std::shared_ptr<jet::Surface3>, std::allocator<std::shared_ptr<jet::Surface3>>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.jet::Bvh3" = type { %"class.jet::IntersectionQueryEngine3", %"class.jet::NearestNeighborQueryEngine3", %"class.jet::BoundingBox", %"class.std::vector", %"class.std::vector.0", %"class.std::vector.5" }
%"class.jet::IntersectionQueryEngine3" = type { ptr }
%"class.jet::NearestNeighborQueryEngine3" = type { ptr }
%"class.jet::BoundingBox" = type { %"class.jet::Vector", %"class.jet::Vector" }
%"class.std::vector.0" = type { %"struct.std::_Vector_base.1" }
%"struct.std::_Vector_base.1" = type { %"struct.std::_Vector_base<jet::BoundingBox<double, 3>, std::allocator<jet::BoundingBox<double, 3>>>::_Vector_impl" }
%"struct.std::_Vector_base<jet::BoundingBox<double, 3>, std::allocator<jet::BoundingBox<double, 3>>>::_Vector_impl" = type { %"struct.std::_Vector_base<jet::BoundingBox<double, 3>, std::allocator<jet::BoundingBox<double, 3>>>::_Vector_impl_data" }
%"struct.std::_Vector_base<jet::BoundingBox<double, 3>, std::allocator<jet::BoundingBox<double, 3>>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::vector.5" = type { %"struct.std::_Vector_base.6" }
%"struct.std::_Vector_base.6" = type { %"struct.std::_Vector_base<jet::Bvh3<std::shared_ptr<jet::Surface3>>::Node, std::allocator<jet::Bvh3<std::shared_ptr<jet::Surface3>>::Node>>::_Vector_impl" }
%"struct.std::_Vector_base<jet::Bvh3<std::shared_ptr<jet::Surface3>>::Node, std::allocator<jet::Bvh3<std::shared_ptr<jet::Surface3>>::Node>>::_Vector_impl" = type { %"struct.std::_Vector_base<jet::Bvh3<std::shared_ptr<jet::Surface3>>::Node, std::allocator<jet::Bvh3<std::shared_ptr<jet::Surface3>>::Node>>::_Vector_impl_data" }
%"struct.std::_Vector_base<jet::Bvh3<std::shared_ptr<jet::Surface3>>::Node, std::allocator<jet::Bvh3<std::shared_ptr<jet::Surface3>>::Node>>::_Vector_impl_data" = type { ptr, ptr, ptr }

@constinit.1 = external hidden constant [3 x double], align 8

; 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

declare i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt10shared_ptrIN3jet8Surface3EEC2ERKS2_(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(16)) unnamed_addr #1 align 2

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

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

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

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZN9__gnu_cxxneIPKSt10shared_ptrIN3jet8Surface3EESt6vectorIS4_SaIS4_EEEEbRKNS_17__normal_iteratorIT_T0_EESF_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) #3

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

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

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #4

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local { ptr, double } @_ZNK3jet4Bvh3ISt10shared_ptrINS_8Surface3EEE7nearestERKNS_6VectorIdLm3EEERKSt8functionIFdRKS3_S8_EE(ptr noundef nonnull align 8 dereferenceable(136), ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(32)) unnamed_addr #5 align 2

declare void @_ZNK3jet8Surface312closestPointERKNS_6VectorIdLm3EEE(ptr dead_on_unwind writable sret(%"class.jet::Vector") align 8, ptr noundef nonnull align 8 dereferenceable(209), ptr noundef nonnull align 8 dereferenceable(24)) #6

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZNK3jet11SurfaceSet318closestNormalLocalERKNS_6VectorIdLm3EEE(ptr dead_on_unwind noalias writable sret(%"class.jet::Vector") align 8 %0, ptr noundef nonnull align 8 dereferenceable(408) %1, ptr noundef nonnull align 8 dereferenceable(24) %2) unnamed_addr #2 align 2 personality ptr @__gxx_personality_v0 {
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca %class.anon.11, align 1
  %8 = alloca %"class.jet::Vector", align 8
  %9 = alloca %"class.std::initializer_list", align 8
  %10 = alloca [3 x double], align 8
  %11 = alloca %"struct.jet::NearestNeighborQueryResult3", align 8
  %12 = alloca %"class.std::function", align 8
  %13 = alloca ptr, align 8
  %14 = alloca i32, align 4
  %15 = alloca i32, align 4
  %16 = alloca double, align 8
  %17 = alloca ptr, align 8
  %18 = alloca %"class.__gnu_cxx::__normal_iterator.10", align 8
  %19 = alloca %"class.__gnu_cxx::__normal_iterator.10", align 8
  %20 = alloca %"class.std::shared_ptr", align 8
  %21 = alloca %"class.jet::Vector", align 8
  %22 = alloca double, align 8
  %23 = alloca %"class.jet::Vector", align 8
  store ptr %0, ptr %4, align 8
  store ptr %1, ptr %5, align 8, !tbaa !5
  store ptr %2, ptr %6, align 8, !tbaa !5
  %24 = load ptr, ptr %5, align 8
  call void @_ZNK3jet11SurfaceSet38buildBvhEv(ptr noundef nonnull align 8 dereferenceable(408) %24)
  call void @llvm.lifetime.start.p0(i64 1, ptr %7) #7
  call void @llvm.lifetime.start.p0(i64 24, ptr %8) #7
  call void @llvm.lifetime.start.p0(i64 16, ptr %9) #7
  call void @llvm.lifetime.start.p0(i64 24, ptr %10) #7
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %10, ptr align 8 @constinit.1, i64 24, i1 false), !tbaa.struct !9
  %25 = getelementptr inbounds %"class.std::initializer_list", ptr %9, i32 0, i32 0
  store ptr %10, ptr %25, align 8, !tbaa !11
  %26 = getelementptr inbounds %"class.std::initializer_list", ptr %9, i32 0, i32 1
  store i64 3, ptr %26, align 8, !tbaa !14
  call void @_ZN3jet6VectorIdLm3EEC2IdEERKSt16initializer_listIT_E(ptr noundef nonnull align 8 dereferenceable(24) %8, ptr noundef nonnull align 8 dereferenceable(16) %9)
  call void @llvm.lifetime.end.p0(i64 24, ptr %10) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr %9) #7
  call void @llvm.lifetime.start.p0(i64 16, ptr %11) #7
  %27 = getelementptr inbounds %"class.jet::SurfaceSet3", ptr %24, i32 0, i32 4
  %28 = load ptr, ptr %6, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 32, ptr %12) #7
  call void @"_ZNSt8functionIFdRKSt10shared_ptrIN3jet8Surface3EERKNS1_6VectorIdLm3EEEEEC2IRKZNKS1_11SurfaceSet318closestNormalLocalES9_E3$_0vEEOT_"(ptr noundef nonnull align 8 dereferenceable(32) %12, ptr noundef nonnull align 1 dereferenceable(1) %7) #7
  %29 = invoke { ptr, double } @_ZNK3jet4Bvh3ISt10shared_ptrINS_8Surface3EEE7nearestERKNS_6VectorIdLm3EEERKSt8functionIFdRKS3_S8_EE(ptr noundef nonnull align 8 dereferenceable(136) %27, ptr noundef nonnull align 8 dereferenceable(24) %28, ptr noundef nonnull align 8 dereferenceable(32) %12)
          to label %30 unwind label %43

30:                                               ; preds = %3
  %31 = getelementptr inbounds { ptr, double }, ptr %11, i32 0, i32 0
  %32 = extractvalue { ptr, double } %29, 0
  store ptr %32, ptr %31, align 8
  %33 = getelementptr inbounds { ptr, double }, ptr %11, i32 0, i32 1
  %34 = extractvalue { ptr, double } %29, 1
  store double %34, ptr %33, align 8
  call void @_ZNSt14_Function_baseD2Ev(ptr noundef nonnull align 8 dereferenceable(32) %12) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr %12) #7
  %35 = getelementptr inbounds %"struct.jet::NearestNeighborQueryResult3", ptr %11, i32 0, i32 0
  %36 = load ptr, ptr %35, align 8, !tbaa !15
  %37 = icmp ne ptr %36, null
  br i1 %37, label %38, label %47

38:                                               ; preds = %30
  %39 = getelementptr inbounds %"struct.jet::NearestNeighborQueryResult3", ptr %11, i32 0, i32 0
  %40 = load ptr, ptr %39, align 8, !tbaa !15
  %41 = call noundef ptr @_ZNKSt19__shared_ptr_accessIN3jet8Surface3ELN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) %40) #7
  %42 = load ptr, ptr %6, align 8, !tbaa !5
  call void @_ZNK3jet8Surface313closestNormalERKNS_6VectorIdLm3EEE(ptr dead_on_unwind writable sret(%"class.jet::Vector") align 8 %0, ptr noundef nonnull align 8 dereferenceable(209) %41, ptr noundef nonnull align 8 dereferenceable(24) %42)
  store i32 1, ptr %15, align 4
  br label %96

43:                                               ; preds = %3
  %44 = landingpad { ptr, i32 }
          cleanup
  %45 = extractvalue { ptr, i32 } %44, 0
  store ptr %45, ptr %13, align 8
  %46 = extractvalue { ptr, i32 } %44, 1
  store i32 %46, ptr %14, align 4
  call void @_ZNSt14_Function_baseD2Ev(ptr noundef nonnull align 8 dereferenceable(32) %12) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr %12) #7
  br label %97

47:                                               ; preds = %30
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #7
  %48 = getelementptr inbounds %"struct.jet::NearestNeighborQueryResult3", ptr %11, i32 0, i32 1
  %49 = load double, ptr %48, align 8, !tbaa !18
  store double %49, ptr %16, align 8, !tbaa !19
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #7
  %50 = getelementptr inbounds %"class.jet::SurfaceSet3", ptr %24, i32 0, i32 3
  store ptr %50, ptr %17, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #7
  %51 = load ptr, ptr %17, align 8, !tbaa !5
  %52 = call ptr @_ZNKSt6vectorISt10shared_ptrIN3jet8Surface3EESaIS3_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %51) #7
  %53 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator.10", ptr %18, i32 0, i32 0
  store ptr %52, ptr %53, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #7
  %54 = load ptr, ptr %17, align 8, !tbaa !5
  %55 = call ptr @_ZNKSt6vectorISt10shared_ptrIN3jet8Surface3EESaIS3_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %54) #7
  %56 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator.10", ptr %19, i32 0, i32 0
  store ptr %55, ptr %56, align 8
  br label %57

57:                                               ; preds = %91, %47
  %58 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPKSt10shared_ptrIN3jet8Surface3EESt6vectorIS4_SaIS4_EEEEbRKNS_17__normal_iteratorIT_T0_EESF_(ptr noundef nonnull align 8 dereferenceable(8) %18, ptr noundef nonnull align 8 dereferenceable(8) %19) #7
  br i1 %58, label %60, label %59

59:                                               ; preds = %57
  store i32 2, ptr %15, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #7
  br label %95

60:                                               ; preds = %57
  call void @llvm.lifetime.start.p0(i64 16, ptr %20) #7
  %61 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPKSt10shared_ptrIN3jet8Surface3EESt6vectorIS4_SaIS4_EEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %18) #7
  call void @_ZNSt10shared_ptrIN3jet8Surface3EEC2ERKS2_(ptr noundef nonnull align 8 dereferenceable(16) %20, ptr noundef nonnull align 8 dereferenceable(16) %61) #7
  call void @llvm.lifetime.start.p0(i64 24, ptr %21) #7
  %62 = call noundef ptr @_ZNKSt19__shared_ptr_accessIN3jet8Surface3ELN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) %20) #7
  %63 = load ptr, ptr %6, align 8, !tbaa !5
  invoke void @_ZNK3jet8Surface312closestPointERKNS_6VectorIdLm3EEE(ptr dead_on_unwind writable sret(%"class.jet::Vector") align 8 %21, ptr noundef nonnull align 8 dereferenceable(209) %62, ptr noundef nonnull align 8 dereferenceable(24) %63)
          to label %64 unwind label %78

64:                                               ; preds = %60
  call void @llvm.lifetime.start.p0(i64 8, ptr %22) #7
  %65 = load ptr, ptr %6, align 8, !tbaa !5
  %66 = invoke noundef double @_ZNK3jet6VectorIdLm3EE10distanceToERKS1_(ptr noundef nonnull align 8 dereferenceable(24) %21, ptr noundef nonnull align 8 dereferenceable(24) %65)
          to label %67 unwind label %82

67:                                               ; preds = %64
  store double %66, ptr %22, align 8, !tbaa !19
  %68 = load double, ptr %22, align 8, !tbaa !19
  %69 = load double, ptr %16, align 8, !tbaa !19
  %70 = fcmp olt double %68, %69
  br i1 %70, label %71, label %90

71:                                               ; preds = %67
  %72 = load double, ptr %22, align 8, !tbaa !19
  store double %72, ptr %16, align 8, !tbaa !19
  call void @llvm.lifetime.start.p0(i64 24, ptr %23) #7
  %73 = call noundef ptr @_ZNKSt19__shared_ptr_accessIN3jet8Surface3ELN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) %20) #7
  %74 = load ptr, ptr %6, align 8, !tbaa !5
  invoke void @_ZNK3jet8Surface313closestNormalERKNS_6VectorIdLm3EEE(ptr dead_on_unwind writable sret(%"class.jet::Vector") align 8 %23, ptr noundef nonnull align 8 dereferenceable(209) %73, ptr noundef nonnull align 8 dereferenceable(24) %74)
          to label %75 unwind label %86

75:                                               ; preds = %71
  %76 = invoke noundef nonnull align 8 dereferenceable(24) ptr @_ZN3jet6VectorIdLm3EEaSERKS1_(ptr noundef nonnull align 8 dereferenceable(24) %8, ptr noundef nonnull align 8 dereferenceable(24) %23)
          to label %77 unwind label %86

77:                                               ; preds = %75
  call void @llvm.lifetime.end.p0(i64 24, ptr %23) #7
  br label %90

78:                                               ; preds = %60
  %79 = landingpad { ptr, i32 }
          cleanup
  %80 = extractvalue { ptr, i32 } %79, 0
  store ptr %80, ptr %13, align 8
  %81 = extractvalue { ptr, i32 } %79, 1
  store i32 %81, ptr %14, align 4
  br label %94

82:                                               ; preds = %64
  %83 = landingpad { ptr, i32 }
          cleanup
  %84 = extractvalue { ptr, i32 } %83, 0
  store ptr %84, ptr %13, align 8
  %85 = extractvalue { ptr, i32 } %83, 1
  store i32 %85, ptr %14, align 4
  br label %93

86:                                               ; preds = %75, %71
  %87 = landingpad { ptr, i32 }
          cleanup
  %88 = extractvalue { ptr, i32 } %87, 0
  store ptr %88, ptr %13, align 8
  %89 = extractvalue { ptr, i32 } %87, 1
  store i32 %89, ptr %14, align 4
  call void @llvm.lifetime.end.p0(i64 24, ptr %23) #7
  br label %93

90:                                               ; preds = %77, %67
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr %21) #7
  call void @_ZNSt12__shared_ptrIN3jet8Surface3ELN9__gnu_cxx12_Lock_policyE2EED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %20) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr %20) #7
  br label %91

91:                                               ; preds = %90
  %92 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPKSt10shared_ptrIN3jet8Surface3EESt6vectorIS4_SaIS4_EEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %18) #7
  br label %57

93:                                               ; preds = %86, %82
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #7
  br label %94

94:                                               ; preds = %93, %78
  call void @llvm.lifetime.end.p0(i64 24, ptr %21) #7
  call void @_ZNSt12__shared_ptrIN3jet8Surface3ELN9__gnu_cxx12_Lock_policyE2EED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %20) #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 8, ptr %18) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #7
  br label %97

95:                                               ; preds = %59
  call void @_ZN3jet6VectorIdLm3EEC2ERKS1_(ptr noundef nonnull align 8 dereferenceable(24) %0, ptr noundef nonnull align 8 dereferenceable(24) %8)
  store i32 1, ptr %15, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #7
  br label %96

96:                                               ; preds = %95, %38
  call void @llvm.lifetime.end.p0(i64 16, ptr %11) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr %8) #7
  call void @llvm.lifetime.end.p0(i64 1, ptr %7) #7
  ret void

97:                                               ; preds = %94, %43
  call void @llvm.lifetime.end.p0(i64 16, ptr %11) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr %8) #7
  call void @llvm.lifetime.end.p0(i64 1, ptr %7) #7
  br label %98

98:                                               ; preds = %97
  %99 = load ptr, ptr %13, align 8
  %100 = load i32, ptr %14, align 4
  %101 = insertvalue { ptr, i32 } poison, ptr %99, 0
  %102 = insertvalue { ptr, i32 } %101, i32 %100, 1
  resume { ptr, i32 } %102
}

; Function Attrs: mustprogress nounwind uwtable
declare hidden void @"_ZNSt8functionIFdRKSt10shared_ptrIN3jet8Surface3EERKNS1_6VectorIdLm3EEEEEC2IRKZNKS1_11SurfaceSet318closestNormalLocalES9_E3$_0vEEOT_"(ptr noundef nonnull align 8 dereferenceable(32), ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #1 align 2

declare void @_ZNK3jet8Surface313closestNormalERKNS_6VectorIdLm3EEE(ptr dead_on_unwind writable sret(%"class.jet::Vector") align 8, ptr noundef nonnull align 8 dereferenceable(209), ptr noundef nonnull align 8 dereferenceable(24)) #6

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

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

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

!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 = !{i64 0, i64 24, !10}
!10 = !{!7, !7, i64 0}
!11 = !{!12, !6, i64 0}
!12 = !{!"_ZTSSt16initializer_listIdE", !6, i64 0, !13, i64 8}
!13 = !{!"long", !7, i64 0}
!14 = !{!12, !13, i64 8}
!15 = !{!16, !6, i64 0}
!16 = !{!"_ZTSN3jet27NearestNeighborQueryResult3ISt10shared_ptrINS_8Surface3EEEE", !6, i64 0, !17, i64 8}
!17 = !{!"double", !7, i64 0}
!18 = !{!16, !17, i64 8}
!19 = !{!17, !17, i64 0}


; Optimized IR (opt -passes='default<O3>'):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%"class.jet::Vector" = type { double, double, double }
%class.anon.11 = type { i8 }
%"class.std::initializer_list" = type { ptr, i64 }
%"class.std::function" = type { %"class.std::_Function_base", ptr }
%"class.std::_Function_base" = type { %"union.std::_Any_data", ptr }
%"union.std::_Any_data" = type { %"union.std::_Nocopy_types" }
%"union.std::_Nocopy_types" = type { { i64, i64 } }
%"class.__gnu_cxx::__normal_iterator.10" = type { ptr }
%"class.std::shared_ptr" = type { %"class.std::__shared_ptr" }
%"class.std::__shared_ptr" = type { ptr, %"class.std::__shared_count" }
%"class.std::__shared_count" = type { ptr }

@constinit.1 = external hidden local_unnamed_addr constant [3 x double], align 8

; 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

declare i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt10shared_ptrIN3jet8Surface3EEC2ERKS2_(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(16)) unnamed_addr #1 align 2

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

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

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

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZN9__gnu_cxxneIPKSt10shared_ptrIN3jet8Surface3EESt6vectorIS4_SaIS4_EEEEbRKNS_17__normal_iteratorIT_T0_EESF_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #3

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

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

; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #4

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local { ptr, double } @_ZNK3jet4Bvh3ISt10shared_ptrINS_8Surface3EEE7nearestERKNS_6VectorIdLm3EEERKSt8functionIFdRKS3_S8_EE(ptr noundef nonnull align 8 dereferenceable(136), ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(32)) unnamed_addr #5 align 2

declare void @_ZNK3jet8Surface312closestPointERKNS_6VectorIdLm3EEE(ptr dead_on_unwind writable sret(%"class.jet::Vector") align 8, ptr noundef nonnull align 8 dereferenceable(209), ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #6

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZNK3jet11SurfaceSet318closestNormalLocalERKNS_6VectorIdLm3EEE(ptr dead_on_unwind noalias writable sret(%"class.jet::Vector") align 8 %0, ptr noundef nonnull align 8 dereferenceable(408) %1, ptr noundef nonnull align 8 dereferenceable(24) %2) unnamed_addr #2 align 2 personality ptr @__gxx_personality_v0 {
  %4 = alloca %class.anon.11, align 1
  %5 = alloca %"class.jet::Vector", align 8
  %6 = alloca %"class.std::initializer_list", align 8
  %7 = alloca [3 x double], align 8
  %8 = alloca %"class.std::function", align 8
  %9 = alloca %"class.__gnu_cxx::__normal_iterator.10", align 8
  %10 = alloca %"class.__gnu_cxx::__normal_iterator.10", align 8
  %11 = alloca %"class.std::shared_ptr", align 8
  %12 = alloca %"class.jet::Vector", align 8
  %13 = alloca %"class.jet::Vector", align 8
  tail call void @_ZNK3jet11SurfaceSet38buildBvhEv(ptr noundef nonnull align 8 dereferenceable(408) %1)
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %4) #7
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %5) #7
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %6) #7
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %7) #7
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(24) %7, ptr noundef nonnull align 8 dereferenceable(24) @constinit.1, i64 24, i1 false), !tbaa.struct !5
  store ptr %7, ptr %6, align 8, !tbaa !9
  %14 = getelementptr inbounds i8, ptr %6, i64 8
  store i64 3, ptr %14, align 8, !tbaa !13
  call void @_ZN3jet6VectorIdLm3EEC2IdEERKSt16initializer_listIT_E(ptr noundef nonnull align 8 dereferenceable(24) %5, ptr noundef nonnull align 8 dereferenceable(16) %6)
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %7) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %6) #7
  %15 = getelementptr inbounds i8, ptr %1, i64 264
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %8) #7
  call void @"_ZNSt8functionIFdRKSt10shared_ptrIN3jet8Surface3EERKNS1_6VectorIdLm3EEEEEC2IRKZNKS1_11SurfaceSet318closestNormalLocalES9_E3$_0vEEOT_"(ptr noundef nonnull align 8 dereferenceable(32) %8, ptr noundef nonnull align 1 dereferenceable(1) %4) #7
  %16 = invoke { ptr, double } @_ZNK3jet4Bvh3ISt10shared_ptrINS_8Surface3EEE7nearestERKNS_6VectorIdLm3EEERKSt8functionIFdRKS3_S8_EE(ptr noundef nonnull align 8 dereferenceable(136) %15, ptr noundef nonnull align 8 dereferenceable(24) %2, ptr noundef nonnull align 8 dereferenceable(32) %8)
          to label %17 unwind label %21

17:                                               ; preds = %3
  %18 = extractvalue { ptr, double } %16, 0
  call void @_ZNSt14_Function_baseD2Ev(ptr noundef nonnull align 8 dereferenceable(32) %8) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %8) #7
  %.not = icmp eq ptr %18, null
  br i1 %.not, label %23, label %19

19:                                               ; preds = %17
  %20 = call noundef ptr @_ZNKSt19__shared_ptr_accessIN3jet8Surface3ELN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) %18) #7
  call void @_ZNK3jet8Surface313closestNormalERKNS_6VectorIdLm3EEE(ptr dead_on_unwind writable sret(%"class.jet::Vector") align 8 %0, ptr noundef nonnull align 8 dereferenceable(209) %20, ptr noundef nonnull align 8 dereferenceable(24) %2)
  br label %50

21:                                               ; preds = %3
  %22 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt14_Function_baseD2Ev(ptr noundef nonnull align 8 dereferenceable(32) %8) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %8) #7
  br label %51

23:                                               ; preds = %17
  %24 = getelementptr inbounds i8, ptr %1, i64 240
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %9) #7
  %25 = call ptr @_ZNKSt6vectorISt10shared_ptrIN3jet8Surface3EESaIS3_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %24) #7
  store ptr %25, ptr %9, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %10) #7
  %26 = call ptr @_ZNKSt6vectorISt10shared_ptrIN3jet8Surface3EESaIS3_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %24) #7
  store ptr %26, ptr %10, align 8
  %27 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPKSt10shared_ptrIN3jet8Surface3EESt6vectorIS4_SaIS4_EEEEbRKNS_17__normal_iteratorIT_T0_EESF_(ptr noundef nonnull align 8 dereferenceable(8) %9, ptr noundef nonnull align 8 dereferenceable(8) %10) #7
  br i1 %27, label %.lr.ph.preheader, label %._crit_edge

.lr.ph.preheader:                                 ; preds = %23
  %28 = extractvalue { ptr, double } %16, 1
  br label %.lr.ph

._crit_edge:                                      ; preds = %46, %23
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %10) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %9) #7
  call void @_ZN3jet6VectorIdLm3EEC2ERKS1_(ptr noundef nonnull align 8 dereferenceable(24) %0, ptr noundef nonnull align 8 dereferenceable(24) %5)
  br label %50

.lr.ph:                                           ; preds = %.lr.ph.preheader, %46
  %.01623 = phi double [ %.117, %46 ], [ %28, %.lr.ph.preheader ]
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %11) #7
  %29 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPKSt10shared_ptrIN3jet8Surface3EESt6vectorIS4_SaIS4_EEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %9) #7
  call void @_ZNSt10shared_ptrIN3jet8Surface3EEC2ERKS2_(ptr noundef nonnull align 8 dereferenceable(16) %11, ptr noundef nonnull align 8 dereferenceable(16) %29) #7
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %12) #7
  %30 = call noundef ptr @_ZNKSt19__shared_ptr_accessIN3jet8Surface3ELN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) %11) #7
  invoke void @_ZNK3jet8Surface312closestPointERKNS_6VectorIdLm3EEE(ptr dead_on_unwind nonnull writable sret(%"class.jet::Vector") align 8 %12, ptr noundef nonnull align 8 dereferenceable(209) %30, ptr noundef nonnull align 8 dereferenceable(24) %2)
          to label %31 unwind label %40

31:                                               ; preds = %.lr.ph
  %32 = invoke noundef double @_ZNK3jet6VectorIdLm3EE10distanceToERKS1_(ptr noundef nonnull align 8 dereferenceable(24) %12, ptr noundef nonnull align 8 dereferenceable(24) %2)
          to label %33 unwind label %42

33:                                               ; preds = %31
  %34 = fcmp olt double %32, %.01623
  br i1 %34, label %35, label %46

35:                                               ; preds = %33
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %13) #7
  %36 = call noundef ptr @_ZNKSt19__shared_ptr_accessIN3jet8Surface3ELN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) %11) #7
  invoke void @_ZNK3jet8Surface313closestNormalERKNS_6VectorIdLm3EEE(ptr dead_on_unwind nonnull writable sret(%"class.jet::Vector") align 8 %13, ptr noundef nonnull align 8 dereferenceable(209) %36, ptr noundef nonnull align 8 dereferenceable(24) %2)
          to label %37 unwind label %44

37:                                               ; preds = %35
  %38 = invoke noundef nonnull align 8 dereferenceable(24) ptr @_ZN3jet6VectorIdLm3EEaSERKS1_(ptr noundef nonnull align 8 dereferenceable(24) %5, ptr noundef nonnull align 8 dereferenceable(24) %13)
          to label %39 unwind label %44

39:                                               ; preds = %37
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %13) #7
  br label %46

40:                                               ; preds = %.lr.ph
  %41 = landingpad { ptr, i32 }
          cleanup
  br label %49

42:                                               ; preds = %31
  %43 = landingpad { ptr, i32 }
          cleanup
  br label %49

44:                                               ; preds = %37, %35
  %45 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %13) #7
  br label %49

46:                                               ; preds = %39, %33
  %.117 = phi double [ %32, %39 ], [ %.01623, %33 ]
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %12) #7
  call void @_ZNSt12__shared_ptrIN3jet8Surface3ELN9__gnu_cxx12_Lock_policyE2EED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %11) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %11) #7
  %47 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPKSt10shared_ptrIN3jet8Surface3EESt6vectorIS4_SaIS4_EEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %9) #7
  %48 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPKSt10shared_ptrIN3jet8Surface3EESt6vectorIS4_SaIS4_EEEEbRKNS_17__normal_iteratorIT_T0_EESF_(ptr noundef nonnull align 8 dereferenceable(8) %9, ptr noundef nonnull align 8 dereferenceable(8) %10) #7
  br i1 %48, label %.lr.ph, label %._crit_edge

49:                                               ; preds = %42, %44, %40
  %.pn.pn = phi { ptr, i32 } [ %41, %40 ], [ %45, %44 ], [ %43, %42 ]
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %12) #7
  call void @_ZNSt12__shared_ptrIN3jet8Surface3ELN9__gnu_cxx12_Lock_policyE2EED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %11) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %11) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %10) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %9) #7
  br label %51

50:                                               ; preds = %._crit_edge, %19
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %5) #7
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %4) #7
  ret void

51:                                               ; preds = %49, %21
  %.pn.pn.pn = phi { ptr, i32 } [ %.pn.pn, %49 ], [ %22, %21 ]
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %5) #7
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %4) #7
  resume { ptr, i32 } %.pn.pn.pn
}

; Function Attrs: mustprogress nounwind uwtable
declare hidden void @"_ZNSt8functionIFdRKSt10shared_ptrIN3jet8Surface3EERKNS1_6VectorIdLm3EEEEEC2IRKZNKS1_11SurfaceSet318closestNormalLocalES9_E3$_0vEEOT_"(ptr noundef nonnull align 8 dereferenceable(32), ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #1 align 2

declare void @_ZNK3jet8Surface313closestNormalERKNS_6VectorIdLm3EEE(ptr dead_on_unwind writable sret(%"class.jet::Vector") align 8, ptr noundef nonnull align 8 dereferenceable(209), ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #6

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

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

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

!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 = !{i64 0, i64 24, !6}
!6 = !{!7, !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !11, i64 0}
!10 = !{!"_ZTSSt16initializer_listIdE", !11, i64 0, !12, i64 8}
!11 = !{!"any pointer", !7, i64 0}
!12 = !{!"long", !7, i64 0}
!13 = !{!10, !12, i64 8}


; Effective O3 passes: EarlyCSEPass,GlobalOptPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,SROAPass,SimplifyCFGPass,TailCallElimPass