; LLVM IR from maliput/maliput :: src/maliput/geometry_base (kd_tree_strategy)

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

%"struct.maliput::api::LanePositionResult" = type { %"class.maliput::api::LanePosition", %"class.maliput::api::InertialPosition", double }
%"class.maliput::api::LanePosition" = type { %"class.maliput::math::Vector3" }
%"class.maliput::math::Vector3" = type { %"class.maliput::math::VectorBase" }
%"class.maliput::math::VectorBase" = type { %"struct.std::array" }
%"struct.std::array" = type { [3 x double] }
%"class.maliput::api::InertialPosition" = type { %"class.maliput::math::Vector3" }
%"struct.maliput::api::RoadPositionResult" = type { %"struct.maliput::api::RoadPosition", %"class.maliput::api::InertialPosition", double }
%"struct.maliput::api::RoadPosition" = type { ptr, %"class.maliput::api::LanePosition" }
%"class.maliput::geometry_base::KDTreeStrategy::MaliputPoint" = type { %"class.maliput::math::Vector3", %"class.std::optional" }
%"class.std::optional" = type { %"struct.std::_Optional_base" }
%"struct.std::_Optional_base" = type { %"struct.std::_Optional_payload" }
%"struct.std::_Optional_payload" = type { %"struct.std::_Optional_payload_base.base", [7 x i8] }
%"struct.std::_Optional_payload_base.base" = type <{ %"union.std::_Optional_payload_base<const maliput::api::Lane *>::_Storage", i8 }>
%"union.std::_Optional_payload_base<const maliput::api::Lane *>::_Storage" = type { ptr }
%"class.std::deque.45" = type { %"class.std::_Deque_base.46" }
%"class.std::_Deque_base.46" = type { %"struct.std::_Deque_base<const maliput::api::Lane *, std::allocator<const maliput::api::Lane *>>::_Deque_impl" }
%"struct.std::_Deque_base<const maliput::api::Lane *, std::allocator<const maliput::api::Lane *>>::_Deque_impl" = type { %"struct.std::_Deque_base<const maliput::api::Lane *, std::allocator<const maliput::api::Lane *>>::_Deque_impl_data" }
%"struct.std::_Deque_base<const maliput::api::Lane *, std::allocator<const maliput::api::Lane *>>::_Deque_impl_data" = type { ptr, i64, %"struct.std::_Deque_iterator.50", %"struct.std::_Deque_iterator.50" }
%"struct.std::_Deque_iterator.50" = type { ptr, ptr, ptr, ptr }
%"struct.std::_Deque_iterator.51" = type { ptr, ptr, ptr, ptr }
%"class.maliput::geometry_base::KDTreeStrategy" = type { %"class.maliput::geometry_base::StrategyBase", %"class.std::unique_ptr", double }
%"class.maliput::geometry_base::StrategyBase" = type { ptr, ptr }
%"class.std::unique_ptr" = type { %"struct.std::__uniq_ptr_data" }
%"struct.std::__uniq_ptr_data" = type { %"class.std::__uniq_ptr_impl" }
%"class.std::__uniq_ptr_impl" = type { %"class.std::tuple" }
%"class.std::tuple" = type { %"struct.std::_Tuple_impl" }
%"struct.std::_Tuple_impl" = type { %"struct.std::_Head_base.21" }
%"struct.std::_Head_base.21" = type { ptr }

@.str.18 = external hidden unnamed_addr constant [95 x i8], align 1
@.str.19 = external hidden unnamed_addr constant [16 x i8], align 1
@.str.20 = external hidden unnamed_addr constant [37 x i8], align 1
@__func__._ZNK7maliput13geometry_base14KDTreeStrategy11ClosestLaneERKNS_3api16InertialPositionE = external hidden unnamed_addr constant [12 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

declare i32 @__gxx_personality_v0(...)

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(24) ptr @_ZNK7maliput3api16InertialPosition3xyzEv(ptr noundef nonnull align 8 dereferenceable(24)) #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) #2

; Function Attrs: noreturn
declare void @_ZN7maliput6common8internal5ThrowEPKcS3_S3_i(ptr noundef, ptr noundef, ptr noundef, i32 noundef) #3

declare void @_ZNK7maliput3api4Lane14ToLanePositionERKNS0_16InertialPositionE(ptr dead_on_unwind writable sret(%"struct.maliput::api::LanePositionResult") align 8, ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(24)) #4

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZNK7maliput13geometry_base14KDTreeStrategy11ClosestLaneERKNS_3api16InertialPositionE(ptr dead_on_unwind noalias writable sret(%"struct.maliput::api::RoadPositionResult") align 8 %0, ptr noundef nonnull align 8 dereferenceable(32) %1, ptr noundef nonnull align 8 dereferenceable(24) %2) #5 align 2 personality ptr @__gxx_personality_v0 {
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca %"class.maliput::geometry_base::KDTreeStrategy::MaliputPoint", align 8
  %7 = alloca %"class.maliput::geometry_base::KDTreeStrategy::MaliputPoint", align 8
  %8 = alloca double, align 8
  %9 = alloca %"class.maliput::math::Vector3", align 8
  %10 = alloca %"class.std::deque.45", align 8
  %11 = alloca %"class.std::optional", align 8
  %12 = alloca ptr, align 8
  %13 = alloca i32, align 4
  %14 = alloca ptr, align 8
  %15 = alloca %"class.std::optional", align 8
  %16 = alloca %"struct.maliput::api::LanePositionResult", align 8
  %17 = alloca ptr, align 8
  %18 = alloca %"struct.std::_Deque_iterator.51", align 8
  %19 = alloca %"struct.std::_Deque_iterator.51", align 8
  %20 = alloca ptr, align 8
  %21 = alloca %"struct.maliput::api::LanePositionResult", align 8
  %22 = alloca %"struct.maliput::api::RoadPositionResult", align 8
  store ptr %1, ptr %4, align 8, !tbaa !5
  store ptr %2, ptr %5, align 8, !tbaa !5
  %23 = load ptr, ptr %4, align 8
  call void @llvm.lifetime.start.p0(i64 40, ptr %6) #8
  %24 = getelementptr inbounds %"class.maliput::geometry_base::KDTreeStrategy", ptr %23, i32 0, i32 1
  %25 = call noundef ptr @_ZNKSt10unique_ptrIN7maliput4math8KDTree3DINS0_13geometry_base14KDTreeStrategy12MaliputPointENS1_7details15SquaredDistanceIS5_Lm3EEENS6_7NodeCmpILm3EEEEESt14default_deleteISB_EEptEv(ptr noundef nonnull align 8 dereferenceable(8) %24) #8
  call void @llvm.lifetime.start.p0(i64 40, ptr %7) #8
  %26 = load ptr, ptr %5, align 8, !tbaa !5
  %27 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNK7maliput3api16InertialPosition3xyzEv(ptr noundef nonnull align 8 dereferenceable(24) %26)
  call void @_ZN7maliput13geometry_base14KDTreeStrategy12MaliputPointC2ERKNS_4math7Vector3E(ptr noundef nonnull align 8 dereferenceable(40) %7, ptr noundef nonnull align 8 dereferenceable(24) %27)
  %28 = call noundef nonnull align 8 dereferenceable(40) ptr @_ZNK7maliput4math7details10KDTreeBaseINS0_8KDTree3DINS_13geometry_base14KDTreeStrategy12MaliputPointENS1_15SquaredDistanceIS6_Lm3EEENS1_7NodeCmpILm3EEEEES6_Lm3ENS0_14AxisAlignedBoxES8_SA_E13nearest_pointERKS6_(ptr noundef nonnull align 8 dereferenceable(88) %25, ptr noundef nonnull align 8 dereferenceable(40) %7)
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %6, ptr align 8 %28, i64 40, i1 false)
  call void @llvm.lifetime.end.p0(i64 40, ptr %7) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #8
  call void @llvm.lifetime.start.p0(i64 24, ptr %9) #8
  %29 = load ptr, ptr %5, align 8, !tbaa !5
  %30 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNK7maliput3api16InertialPosition3xyzEv(ptr noundef nonnull align 8 dereferenceable(24) %29)
  call void @_ZNK7maliput4math10VectorBaseILm3ENS0_7Vector3EEmiERKS3_(ptr dead_on_unwind writable sret(%"class.maliput::math::Vector3") align 8 %9, ptr noundef nonnull align 8 dereferenceable(24) %30, ptr noundef nonnull align 8 dereferenceable(24) %6)
  %31 = call noundef double @_ZNK7maliput4math10VectorBaseILm3ENS0_7Vector3EE4normEv(ptr noundef nonnull align 8 dereferenceable(24) %9)
  %32 = getelementptr inbounds %"class.maliput::geometry_base::KDTreeStrategy", ptr %23, i32 0, i32 2
  %33 = load double, ptr %32, align 8, !tbaa !9
  %34 = call double @llvm.fmuladd.f64(double 2.000000e+00, double %33, double %31)
  call void @llvm.lifetime.end.p0(i64 24, ptr %9) #8
  store double %34, ptr %8, align 8, !tbaa !19
  call void @llvm.lifetime.start.p0(i64 80, ptr %10) #8
  %35 = load ptr, ptr %5, align 8, !tbaa !5
  %36 = load double, ptr %8, align 8, !tbaa !19
  call void @_ZNK7maliput13geometry_base14KDTreeStrategy12ClosestLanesERKNS_3api16InertialPositionEd(ptr dead_on_unwind writable sret(%"class.std::deque.45") align 8 %10, ptr noundef nonnull align 8 dereferenceable(32) %23, ptr noundef nonnull align 8 dereferenceable(24) %35, double noundef %36)
  br label %37

37:                                               ; preds = %3
  call void @llvm.lifetime.start.p0(i64 16, ptr %11) #8
  %38 = invoke { ptr, i8 } @_ZNK7maliput13geometry_base14KDTreeStrategy12MaliputPoint8get_laneEv(ptr noundef nonnull align 8 dereferenceable(40) %6)
          to label %39 unwind label %50

39:                                               ; preds = %37
  %40 = getelementptr inbounds %"class.std::optional", ptr %11, i32 0, i32 0
  %41 = getelementptr inbounds %"struct.std::_Optional_base", ptr %40, i32 0, i32 0
  %42 = getelementptr inbounds { ptr, i8 }, ptr %41, i32 0, i32 0
  %43 = extractvalue { ptr, i8 } %38, 0
  store ptr %43, ptr %42, align 8
  %44 = getelementptr inbounds { ptr, i8 }, ptr %41, i32 0, i32 1
  %45 = extractvalue { ptr, i8 } %38, 1
  store i8 %45, ptr %44, align 8
  %46 = call noundef zeroext i1 @_ZNKSt8optionalIPKN7maliput3api4LaneEE9has_valueEv(ptr noundef nonnull align 8 dereferenceable(16) %11) #8
  %47 = xor i1 %46, true
  call void @llvm.lifetime.end.p0(i64 16, ptr %11) #8
  br i1 %47, label %48, label %58

48:                                               ; preds = %39
  invoke void @_ZN7maliput6common8internal5ThrowEPKcS3_S3_i(ptr noundef @.str.20, ptr noundef @__func__._ZNK7maliput13geometry_base14KDTreeStrategy11ClosestLaneERKNS_3api16InertialPositionE, ptr noundef @.str.18, i32 noundef 93) #9
          to label %49 unwind label %54

49:                                               ; preds = %48
  unreachable

50:                                               ; preds = %37
  %51 = landingpad { ptr, i32 }
          cleanup
  %52 = extractvalue { ptr, i32 } %51, 0
  store ptr %52, ptr %12, align 8
  %53 = extractvalue { ptr, i32 } %51, 1
  store i32 %53, ptr %13, align 4
  call void @llvm.lifetime.end.p0(i64 16, ptr %11) #8
  br label %147

54:                                               ; preds = %48
  %55 = landingpad { ptr, i32 }
          cleanup
  %56 = extractvalue { ptr, i32 } %55, 0
  store ptr %56, ptr %12, align 8
  %57 = extractvalue { ptr, i32 } %55, 1
  store i32 %57, ptr %13, align 4
  br label %147

58:                                               ; preds = %39
  br label %59

59:                                               ; preds = %58
  br label %60

60:                                               ; preds = %59
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #8
  call void @llvm.lifetime.start.p0(i64 16, ptr %15) #8
  %61 = invoke { ptr, i8 } @_ZNK7maliput13geometry_base14KDTreeStrategy12MaliputPoint8get_laneEv(ptr noundef nonnull align 8 dereferenceable(40) %6)
          to label %62 unwind label %89

62:                                               ; preds = %60
  %63 = getelementptr inbounds %"class.std::optional", ptr %15, i32 0, i32 0
  %64 = getelementptr inbounds %"struct.std::_Optional_base", ptr %63, i32 0, i32 0
  %65 = getelementptr inbounds { ptr, i8 }, ptr %64, i32 0, i32 0
  %66 = extractvalue { ptr, i8 } %61, 0
  store ptr %66, ptr %65, align 8
  %67 = getelementptr inbounds { ptr, i8 }, ptr %64, i32 0, i32 1
  %68 = extractvalue { ptr, i8 } %61, 1
  store i8 %68, ptr %67, align 8
  %69 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNOSt8optionalIPKN7maliput3api4LaneEE5valueEv(ptr noundef nonnull align 8 dereferenceable(16) %15)
          to label %70 unwind label %89

70:                                               ; preds = %62
  %71 = load ptr, ptr %69, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 16, ptr %15) #8
  store ptr %71, ptr %14, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 56, ptr %16) #8
  %72 = load ptr, ptr %14, align 8, !tbaa !5
  %73 = load ptr, ptr %5, align 8, !tbaa !5
  invoke void @_ZNK7maliput3api4Lane14ToLanePositionERKNS0_16InertialPositionE(ptr dead_on_unwind writable sret(%"struct.maliput::api::LanePositionResult") align 8 %16, ptr noundef nonnull align 8 dereferenceable(8) %72, ptr noundef nonnull align 8 dereferenceable(24) %73)
          to label %74 unwind label %93

74:                                               ; preds = %70
  %75 = getelementptr inbounds %"struct.maliput::api::RoadPositionResult", ptr %0, i32 0, i32 0
  %76 = load ptr, ptr %14, align 8, !tbaa !5
  %77 = getelementptr inbounds %"struct.maliput::api::LanePositionResult", ptr %16, i32 0, i32 0
  invoke void @_ZN7maliput3api12RoadPositionC2EPKNS0_4LaneERKNS0_12LanePositionE(ptr noundef nonnull align 8 dereferenceable(32) %75, ptr noundef %76, ptr noundef nonnull align 8 dereferenceable(24) %77)
          to label %78 unwind label %93

78:                                               ; preds = %74
  %79 = getelementptr inbounds %"struct.maliput::api::RoadPositionResult", ptr %0, i32 0, i32 1
  %80 = getelementptr inbounds %"struct.maliput::api::LanePositionResult", ptr %16, i32 0, i32 1
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %79, ptr align 8 %80, i64 24, i1 false)
  %81 = getelementptr inbounds %"struct.maliput::api::RoadPositionResult", ptr %0, i32 0, i32 2
  %82 = getelementptr inbounds %"struct.maliput::api::LanePositionResult", ptr %16, i32 0, i32 2
  %83 = load double, ptr %82, align 8, !tbaa !20
  store double %83, ptr %81, align 8, !tbaa !27
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #8
  store ptr %10, ptr %17, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 32, ptr %18) #8
  %84 = load ptr, ptr %17, align 8, !tbaa !5
  call void @_ZNKSt5dequeIPKN7maliput3api4LaneESaIS4_EE5beginEv(ptr dead_on_unwind writable sret(%"struct.std::_Deque_iterator.51") align 8 %18, ptr noundef nonnull align 8 dereferenceable(80) %84) #8
  call void @llvm.lifetime.start.p0(i64 32, ptr %19) #8
  %85 = load ptr, ptr %17, align 8, !tbaa !5
  call void @_ZNKSt5dequeIPKN7maliput3api4LaneESaIS4_EE3endEv(ptr dead_on_unwind writable sret(%"struct.std::_Deque_iterator.51") align 8 %19, ptr noundef nonnull align 8 dereferenceable(80) %85) #8
  br label %86

86:                                               ; preds = %140, %78
  %87 = call noundef zeroext i1 @_ZStneRKSt15_Deque_iteratorIPKN7maliput3api4LaneERKS4_PS5_ESA_(ptr noundef nonnull align 8 dereferenceable(32) %18, ptr noundef nonnull align 8 dereferenceable(32) %19) #8
  br i1 %87, label %97, label %88

88:                                               ; preds = %86
  call void @llvm.lifetime.end.p0(i64 32, ptr %19) #8
  call void @llvm.lifetime.end.p0(i64 32, ptr %18) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #8
  br label %144

89:                                               ; preds = %62, %60
  %90 = landingpad { ptr, i32 }
          cleanup
  %91 = extractvalue { ptr, i32 } %90, 0
  store ptr %91, ptr %12, align 8
  %92 = extractvalue { ptr, i32 } %90, 1
  store i32 %92, ptr %13, align 4
  call void @llvm.lifetime.end.p0(i64 16, ptr %15) #8
  br label %146

93:                                               ; preds = %74, %70
  %94 = landingpad { ptr, i32 }
          cleanup
  %95 = extractvalue { ptr, i32 } %94, 0
  store ptr %95, ptr %12, align 8
  %96 = extractvalue { ptr, i32 } %94, 1
  store i32 %96, ptr %13, align 4
  br label %145

97:                                               ; preds = %86
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #8
  %98 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNKSt15_Deque_iteratorIPKN7maliput3api4LaneERKS4_PS5_EdeEv(ptr noundef nonnull align 8 dereferenceable(32) %18) #8
  store ptr %98, ptr %20, align 8, !tbaa !5
  br label %99

99:                                               ; preds = %97
  %100 = load ptr, ptr %20, align 8, !tbaa !5
  %101 = load ptr, ptr %100, align 8, !tbaa !5
  %102 = icmp ne ptr %101, null
  br i1 %102, label %109, label %103

103:                                              ; preds = %99
  invoke void @_ZN7maliput6common8internal5ThrowEPKcS3_S3_i(ptr noundef @.str.19, ptr noundef @__func__._ZNK7maliput13geometry_base14KDTreeStrategy11ClosestLaneERKNS_3api16InertialPositionE, ptr noundef @.str.18, i32 noundef 101) #9
          to label %104 unwind label %105

104:                                              ; preds = %103
  unreachable

105:                                              ; preds = %103
  %106 = landingpad { ptr, i32 }
          cleanup
  %107 = extractvalue { ptr, i32 } %106, 0
  store ptr %107, ptr %12, align 8
  %108 = extractvalue { ptr, i32 } %106, 1
  store i32 %108, ptr %13, align 4
  br label %143

109:                                              ; preds = %99
  br label %110

110:                                              ; preds = %109
  br label %111

111:                                              ; preds = %110
  call void @llvm.lifetime.start.p0(i64 56, ptr %21) #8
  %112 = load ptr, ptr %20, align 8, !tbaa !5
  %113 = load ptr, ptr %112, align 8, !tbaa !5
  %114 = load ptr, ptr %5, align 8, !tbaa !5
  invoke void @_ZNK7maliput3api4Lane14ToLanePositionERKNS0_16InertialPositionE(ptr dead_on_unwind writable sret(%"struct.maliput::api::LanePositionResult") align 8 %21, ptr noundef nonnull align 8 dereferenceable(8) %113, ptr noundef nonnull align 8 dereferenceable(24) %114)
          to label %115 unwind label %131

115:                                              ; preds = %111
  call void @llvm.lifetime.start.p0(i64 64, ptr %22) #8
  %116 = getelementptr inbounds %"struct.maliput::api::RoadPositionResult", ptr %22, i32 0, i32 0
  %117 = load ptr, ptr %20, align 8, !tbaa !5
  %118 = load ptr, ptr %117, align 8, !tbaa !5
  %119 = getelementptr inbounds %"struct.maliput::api::LanePositionResult", ptr %21, i32 0, i32 0
  invoke void @_ZN7maliput3api12RoadPositionC2EPKNS0_4LaneERKNS0_12LanePositionE(ptr noundef nonnull align 8 dereferenceable(32) %116, ptr noundef %118, ptr noundef nonnull align 8 dereferenceable(24) %119)
          to label %120 unwind label %135

120:                                              ; preds = %115
  %121 = getelementptr inbounds %"struct.maliput::api::RoadPositionResult", ptr %22, i32 0, i32 1
  %122 = getelementptr inbounds %"struct.maliput::api::LanePositionResult", ptr %21, i32 0, i32 1
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %121, ptr align 8 %122, i64 24, i1 false)
  %123 = getelementptr inbounds %"struct.maliput::api::RoadPositionResult", ptr %22, i32 0, i32 2
  %124 = getelementptr inbounds %"struct.maliput::api::LanePositionResult", ptr %21, i32 0, i32 2
  %125 = load double, ptr %124, align 8, !tbaa !20
  store double %125, ptr %123, align 8, !tbaa !27
  %126 = invoke noundef zeroext i1 @_ZN7maliput13geometry_base29IsNewRoadPositionResultCloserERKNS_3api18RoadPositionResultES4_(ptr noundef nonnull align 8 dereferenceable(64) %22, ptr noundef nonnull align 8 dereferenceable(64) %0)
          to label %127 unwind label %135

127:                                              ; preds = %120
  br i1 %126, label %128, label %139

128:                                              ; preds = %127
  %129 = invoke noundef nonnull align 8 dereferenceable(64) ptr @_ZN7maliput3api18RoadPositionResultaSERKS1_(ptr noundef nonnull align 8 dereferenceable(64) %0, ptr noundef nonnull align 8 dereferenceable(64) %22)
          to label %130 unwind label %135

130:                                              ; preds = %128
  br label %139

131:                                              ; preds = %111
  %132 = landingpad { ptr, i32 }
          cleanup
  %133 = extractvalue { ptr, i32 } %132, 0
  store ptr %133, ptr %12, align 8
  %134 = extractvalue { ptr, i32 } %132, 1
  store i32 %134, ptr %13, align 4
  br label %142

135:                                              ; preds = %128, %120, %115
  %136 = landingpad { ptr, i32 }
          cleanup
  %137 = extractvalue { ptr, i32 } %136, 0
  store ptr %137, ptr %12, align 8
  %138 = extractvalue { ptr, i32 } %136, 1
  store i32 %138, ptr %13, align 4
  call void @llvm.lifetime.end.p0(i64 64, ptr %22) #8
  br label %142

139:                                              ; preds = %130, %127
  call void @llvm.lifetime.end.p0(i64 64, ptr %22) #8
  call void @llvm.lifetime.end.p0(i64 56, ptr %21) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #8
  br label %140

140:                                              ; preds = %139
  %141 = call noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt15_Deque_iteratorIPKN7maliput3api4LaneERKS4_PS5_EppEv(ptr noundef nonnull align 8 dereferenceable(32) %18) #8
  br label %86

142:                                              ; preds = %135, %131
  call void @llvm.lifetime.end.p0(i64 56, ptr %21) #8
  br label %143

143:                                              ; preds = %142, %105
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #8
  call void @llvm.lifetime.end.p0(i64 32, ptr %19) #8
  call void @llvm.lifetime.end.p0(i64 32, ptr %18) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #8
  br label %145

144:                                              ; preds = %88
  call void @llvm.lifetime.end.p0(i64 56, ptr %16) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #8
  call void @_ZNSt5dequeIPKN7maliput3api4LaneESaIS4_EED2Ev(ptr noundef nonnull align 8 dereferenceable(80) %10) #8
  call void @llvm.lifetime.end.p0(i64 80, ptr %10) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #8
  call void @llvm.lifetime.end.p0(i64 40, ptr %6) #8
  ret void

145:                                              ; preds = %143, %93
  call void @llvm.lifetime.end.p0(i64 56, ptr %16) #8
  br label %146

146:                                              ; preds = %145, %89
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #8
  br label %147

147:                                              ; preds = %146, %54, %50
  call void @_ZNSt5dequeIPKN7maliput3api4LaneESaIS4_EED2Ev(ptr noundef nonnull align 8 dereferenceable(80) %10) #8
  call void @llvm.lifetime.end.p0(i64 80, ptr %10) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #8
  call void @llvm.lifetime.end.p0(i64 40, ptr %6) #8
  br label %148

148:                                              ; preds = %147
  %149 = load ptr, ptr %12, align 8
  %150 = load i32, ptr %13, align 4
  %151 = insertvalue { ptr, i32 } poison, ptr %149, 0
  %152 = insertvalue { ptr, i32 } %151, i32 %150, 1
  resume { ptr, i32 } %152
}

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNK7maliput13geometry_base14KDTreeStrategy12ClosestLanesERKNS_3api16InertialPositionEd(ptr dead_on_unwind noalias writable sret(%"class.std::deque.45") align 8, ptr noundef nonnull align 8 dereferenceable(32), ptr noundef nonnull align 8 dereferenceable(24), double noundef) #5 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNKSt5dequeIPKN7maliput3api4LaneESaIS4_EE5beginEv(ptr dead_on_unwind noalias writable sret(%"struct.std::_Deque_iterator.51") align 8, ptr noundef nonnull align 8 dereferenceable(80)) #1 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNKSt5dequeIPKN7maliput3api4LaneESaIS4_EE3endEv(ptr dead_on_unwind noalias writable sret(%"struct.std::_Deque_iterator.51") align 8, ptr noundef nonnull align 8 dereferenceable(80)) #1 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZStneRKSt15_Deque_iteratorIPKN7maliput3api4LaneERKS4_PS5_ESA_(ptr noundef nonnull align 8 dereferenceable(32), ptr noundef nonnull align 8 dereferenceable(32)) #1

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

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef nonnull align 8 dereferenceable(40) ptr @_ZNK7maliput4math7details10KDTreeBaseINS0_8KDTree3DINS_13geometry_base14KDTreeStrategy12MaliputPointENS1_15SquaredDistanceIS6_Lm3EEENS1_7NodeCmpILm3EEEEES6_Lm3ENS0_14AxisAlignedBoxES8_SA_E13nearest_pointERKS6_(ptr noundef nonnull align 8 dereferenceable(88), ptr noundef nonnull align 8 dereferenceable(40)) #5 align 2

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

declare void @_ZNK7maliput4math10VectorBaseILm3ENS0_7Vector3EEmiERKS3_(ptr dead_on_unwind writable sret(%"class.maliput::math::Vector3") align 8, ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(24)) #4

declare noundef double @_ZNK7maliput4math10VectorBaseILm3ENS0_7Vector3EE4normEv(ptr noundef nonnull align 8 dereferenceable(24)) #4

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare double @llvm.fmuladd.f64(double, double, double) #6

; Function Attrs: mustprogress nounwind uwtable
declare dso_local { ptr, i8 } @_ZNK7maliput13geometry_base14KDTreeStrategy12MaliputPoint8get_laneEv(ptr noundef nonnull align 8 dereferenceable(40)) #1 align 2

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

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

declare noundef zeroext i1 @_ZN7maliput13geometry_base29IsNewRoadPositionResultCloserERKNS_3api18RoadPositionResultES4_(ptr noundef nonnull align 8 dereferenceable(64), ptr noundef nonnull align 8 dereferenceable(64)) #4

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef nonnull align 8 dereferenceable(64) ptr @_ZN7maliput3api18RoadPositionResultaSERKS1_(ptr noundef nonnull align 8 dereferenceable(64), ptr noundef nonnull align 8 dereferenceable(64)) #7 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 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { noreturn "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { 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 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #7 = { 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 #8 = { nounwind }
attributes #9 = { noreturn }

!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, !18, i64 24}
!10 = !{!"_ZTSN7maliput13geometry_base14KDTreeStrategyE", !11, i64 0, !12, i64 16, !18, i64 24}
!11 = !{!"_ZTSN7maliput13geometry_base12StrategyBaseE", !6, i64 8}
!12 = !{!"_ZTSSt10unique_ptrIN7maliput4math8KDTree3DINS0_13geometry_base14KDTreeStrategy12MaliputPointENS1_7details15SquaredDistanceIS5_Lm3EEENS6_7NodeCmpILm3EEEEESt14default_deleteISB_EE", !13, i64 0}
!13 = !{!"_ZTSSt15__uniq_ptr_dataIN7maliput4math8KDTree3DINS0_13geometry_base14KDTreeStrategy12MaliputPointENS1_7details15SquaredDistanceIS5_Lm3EEENS6_7NodeCmpILm3EEEEESt14default_deleteISB_ELb1ELb1EE", !14, i64 0}
!14 = !{!"_ZTSSt15__uniq_ptr_implIN7maliput4math8KDTree3DINS0_13geometry_base14KDTreeStrategy12MaliputPointENS1_7details15SquaredDistanceIS5_Lm3EEENS6_7NodeCmpILm3EEEEESt14default_deleteISB_EE", !15, i64 0}
!15 = !{!"_ZTSSt5tupleIJPN7maliput4math8KDTree3DINS0_13geometry_base14KDTreeStrategy12MaliputPointENS1_7details15SquaredDistanceIS5_Lm3EEENS6_7NodeCmpILm3EEEEESt14default_deleteISB_EEE", !16, i64 0}
!16 = !{!"_ZTSSt11_Tuple_implILm0EJPN7maliput4math8KDTree3DINS0_13geometry_base14KDTreeStrategy12MaliputPointENS1_7details15SquaredDistanceIS5_Lm3EEENS6_7NodeCmpILm3EEEEESt14default_deleteISB_EEE", !17, i64 0}
!17 = !{!"_ZTSSt10_Head_baseILm0EPN7maliput4math8KDTree3DINS0_13geometry_base14KDTreeStrategy12MaliputPointENS1_7details15SquaredDistanceIS5_Lm3EEENS6_7NodeCmpILm3EEEEELb0EE", !6, i64 0}
!18 = !{!"double", !7, i64 0}
!19 = !{!18, !18, i64 0}
!20 = !{!21, !18, i64 48}
!21 = !{!"_ZTSN7maliput3api18LanePositionResultE", !22, i64 0, !26, i64 24, !18, i64 48}
!22 = !{!"_ZTSN7maliput3api12LanePositionE", !23, i64 0}
!23 = !{!"_ZTSN7maliput4math7Vector3E", !24, i64 0}
!24 = !{!"_ZTSN7maliput4math10VectorBaseILm3ENS0_7Vector3EEE", !25, i64 0}
!25 = !{!"_ZTSSt5arrayIdLm3EE", !7, i64 0}
!26 = !{!"_ZTSN7maliput3api16InertialPositionE", !23, i64 0}
!27 = !{!28, !18, i64 56}
!28 = !{!"_ZTSN7maliput3api18RoadPositionResultE", !29, i64 0, !26, i64 32, !18, i64 56}
!29 = !{!"_ZTSN7maliput3api12RoadPositionE", !6, i64 0, !22, i64 8}


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

%"struct.maliput::api::LanePositionResult" = type { %"class.maliput::api::LanePosition", %"class.maliput::api::InertialPosition", double }
%"class.maliput::api::LanePosition" = type { %"class.maliput::math::Vector3" }
%"class.maliput::math::Vector3" = type { %"class.maliput::math::VectorBase" }
%"class.maliput::math::VectorBase" = type { %"struct.std::array" }
%"struct.std::array" = type { [3 x double] }
%"class.maliput::api::InertialPosition" = type { %"class.maliput::math::Vector3" }
%"struct.maliput::api::RoadPositionResult" = type { %"struct.maliput::api::RoadPosition", %"class.maliput::api::InertialPosition", double }
%"struct.maliput::api::RoadPosition" = type { ptr, %"class.maliput::api::LanePosition" }
%"class.maliput::geometry_base::KDTreeStrategy::MaliputPoint" = type { %"class.maliput::math::Vector3", %"class.std::optional" }
%"class.std::optional" = type { %"struct.std::_Optional_base" }
%"struct.std::_Optional_base" = type { %"struct.std::_Optional_payload" }
%"struct.std::_Optional_payload" = type { %"struct.std::_Optional_payload_base.base", [7 x i8] }
%"struct.std::_Optional_payload_base.base" = type <{ %"union.std::_Optional_payload_base<const maliput::api::Lane *>::_Storage", i8 }>
%"union.std::_Optional_payload_base<const maliput::api::Lane *>::_Storage" = type { ptr }
%"class.std::deque.45" = type { %"class.std::_Deque_base.46" }
%"class.std::_Deque_base.46" = type { %"struct.std::_Deque_base<const maliput::api::Lane *, std::allocator<const maliput::api::Lane *>>::_Deque_impl" }
%"struct.std::_Deque_base<const maliput::api::Lane *, std::allocator<const maliput::api::Lane *>>::_Deque_impl" = type { %"struct.std::_Deque_base<const maliput::api::Lane *, std::allocator<const maliput::api::Lane *>>::_Deque_impl_data" }
%"struct.std::_Deque_base<const maliput::api::Lane *, std::allocator<const maliput::api::Lane *>>::_Deque_impl_data" = type { ptr, i64, %"struct.std::_Deque_iterator.50", %"struct.std::_Deque_iterator.50" }
%"struct.std::_Deque_iterator.50" = type { ptr, ptr, ptr, ptr }
%"struct.std::_Deque_iterator.51" = type { ptr, ptr, ptr, ptr }

@.str.18 = external hidden unnamed_addr constant [95 x i8], align 1
@.str.19 = external hidden unnamed_addr constant [16 x i8], align 1
@.str.20 = external hidden unnamed_addr constant [37 x i8], align 1
@__func__._ZNK7maliput13geometry_base14KDTreeStrategy11ClosestLaneERKNS_3api16InertialPositionE = external hidden unnamed_addr constant [12 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

declare i32 @__gxx_personality_v0(...)

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(24) ptr @_ZNK7maliput3api16InertialPosition3xyzEv(ptr noundef nonnull align 8 dereferenceable(24)) 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) #2

; Function Attrs: noreturn
declare void @_ZN7maliput6common8internal5ThrowEPKcS3_S3_i(ptr noundef, ptr noundef, ptr noundef, i32 noundef) local_unnamed_addr #3

declare void @_ZNK7maliput3api4Lane14ToLanePositionERKNS0_16InertialPositionE(ptr dead_on_unwind writable sret(%"struct.maliput::api::LanePositionResult") align 8, ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #4

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZNK7maliput13geometry_base14KDTreeStrategy11ClosestLaneERKNS_3api16InertialPositionE(ptr dead_on_unwind noalias writable sret(%"struct.maliput::api::RoadPositionResult") align 8 %0, ptr noundef nonnull align 8 dereferenceable(32) %1, ptr noundef nonnull align 8 dereferenceable(24) %2) local_unnamed_addr #5 align 2 personality ptr @__gxx_personality_v0 {
  %4 = alloca %"class.maliput::geometry_base::KDTreeStrategy::MaliputPoint", align 8
  %5 = alloca %"class.maliput::geometry_base::KDTreeStrategy::MaliputPoint", align 8
  %6 = alloca %"class.maliput::math::Vector3", align 8
  %7 = alloca %"class.std::deque.45", align 8
  %8 = alloca %"class.std::optional", align 8
  %9 = alloca %"class.std::optional", align 8
  %10 = alloca %"struct.maliput::api::LanePositionResult", align 8
  %11 = alloca %"struct.std::_Deque_iterator.51", align 8
  %12 = alloca %"struct.std::_Deque_iterator.51", align 8
  %13 = alloca %"struct.maliput::api::LanePositionResult", align 8
  %14 = alloca %"struct.maliput::api::RoadPositionResult", align 8
  call void @llvm.lifetime.start.p0(i64 40, ptr nonnull %4) #8
  %15 = getelementptr inbounds i8, ptr %1, i64 16
  %16 = tail call noundef ptr @_ZNKSt10unique_ptrIN7maliput4math8KDTree3DINS0_13geometry_base14KDTreeStrategy12MaliputPointENS1_7details15SquaredDistanceIS5_Lm3EEENS6_7NodeCmpILm3EEEEESt14default_deleteISB_EEptEv(ptr noundef nonnull align 8 dereferenceable(8) %15) #8
  call void @llvm.lifetime.start.p0(i64 40, ptr nonnull %5) #8
  %17 = tail call noundef nonnull align 8 dereferenceable(24) ptr @_ZNK7maliput3api16InertialPosition3xyzEv(ptr noundef nonnull align 8 dereferenceable(24) %2)
  call void @_ZN7maliput13geometry_base14KDTreeStrategy12MaliputPointC2ERKNS_4math7Vector3E(ptr noundef nonnull align 8 dereferenceable(40) %5, ptr noundef nonnull align 8 dereferenceable(24) %17)
  %18 = call noundef nonnull align 8 dereferenceable(40) ptr @_ZNK7maliput4math7details10KDTreeBaseINS0_8KDTree3DINS_13geometry_base14KDTreeStrategy12MaliputPointENS1_15SquaredDistanceIS6_Lm3EEENS1_7NodeCmpILm3EEEEES6_Lm3ENS0_14AxisAlignedBoxES8_SA_E13nearest_pointERKS6_(ptr noundef nonnull align 8 dereferenceable(88) %16, ptr noundef nonnull align 8 dereferenceable(40) %5)
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(40) %4, ptr noundef nonnull align 8 dereferenceable(40) %18, i64 40, i1 false)
  call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %5) #8
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %6) #8
  %19 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNK7maliput3api16InertialPosition3xyzEv(ptr noundef nonnull align 8 dereferenceable(24) %2)
  call void @_ZNK7maliput4math10VectorBaseILm3ENS0_7Vector3EEmiERKS3_(ptr dead_on_unwind nonnull writable sret(%"class.maliput::math::Vector3") align 8 %6, ptr noundef nonnull align 8 dereferenceable(24) %19, ptr noundef nonnull align 8 dereferenceable(24) %4)
  %20 = call noundef double @_ZNK7maliput4math10VectorBaseILm3ENS0_7Vector3EE4normEv(ptr noundef nonnull align 8 dereferenceable(24) %6)
  %21 = getelementptr inbounds i8, ptr %1, i64 24
  %22 = load double, ptr %21, align 8, !tbaa !5
  %23 = call double @llvm.fmuladd.f64(double %22, double 2.000000e+00, double %20)
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %6) #8
  call void @llvm.lifetime.start.p0(i64 80, ptr nonnull %7) #8
  call void @_ZNK7maliput13geometry_base14KDTreeStrategy12ClosestLanesERKNS_3api16InertialPositionEd(ptr dead_on_unwind nonnull writable sret(%"class.std::deque.45") align 8 %7, ptr noundef nonnull align 8 dereferenceable(32) %1, ptr noundef nonnull align 8 dereferenceable(24) %2, double noundef %23)
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %8) #8
  %24 = call { ptr, i8 } @_ZNK7maliput13geometry_base14KDTreeStrategy12MaliputPoint8get_laneEv(ptr noundef nonnull align 8 dereferenceable(40) %4)
  %25 = extractvalue { ptr, i8 } %24, 0
  store ptr %25, ptr %8, align 8
  %26 = getelementptr inbounds i8, ptr %8, i64 8
  %27 = extractvalue { ptr, i8 } %24, 1
  store i8 %27, ptr %26, align 8
  %28 = call noundef zeroext i1 @_ZNKSt8optionalIPKN7maliput3api4LaneEE9has_valueEv(ptr noundef nonnull align 8 dereferenceable(16) %8) #8
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %8) #8
  br i1 %28, label %33, label %29

29:                                               ; preds = %3
  invoke void @_ZN7maliput6common8internal5ThrowEPKcS3_S3_i(ptr noundef nonnull @.str.20, ptr noundef nonnull @__func__._ZNK7maliput13geometry_base14KDTreeStrategy11ClosestLaneERKNS_3api16InertialPositionE, ptr noundef nonnull @.str.18, i32 noundef 93) #9
          to label %30 unwind label %31

30:                                               ; preds = %29
  unreachable

31:                                               ; preds = %29
  %32 = landingpad { ptr, i32 }
          cleanup
  br label %81

33:                                               ; preds = %3
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %9) #8
  %34 = call { ptr, i8 } @_ZNK7maliput13geometry_base14KDTreeStrategy12MaliputPoint8get_laneEv(ptr noundef nonnull align 8 dereferenceable(40) %4)
  %35 = extractvalue { ptr, i8 } %34, 0
  store ptr %35, ptr %9, align 8
  %36 = getelementptr inbounds i8, ptr %9, i64 8
  %37 = extractvalue { ptr, i8 } %34, 1
  store i8 %37, ptr %36, align 8
  %38 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNOSt8optionalIPKN7maliput3api4LaneEE5valueEv(ptr noundef nonnull align 8 dereferenceable(16) %9)
          to label %39 unwind label %52

39:                                               ; preds = %33
  %40 = load ptr, ptr %38, align 8, !tbaa !18
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %9) #8
  call void @llvm.lifetime.start.p0(i64 56, ptr nonnull %10) #8
  invoke void @_ZNK7maliput3api4Lane14ToLanePositionERKNS0_16InertialPositionE(ptr dead_on_unwind nonnull writable sret(%"struct.maliput::api::LanePositionResult") align 8 %10, ptr noundef nonnull align 8 dereferenceable(8) %40, ptr noundef nonnull align 8 dereferenceable(24) %2)
          to label %41 unwind label %54

41:                                               ; preds = %39
  call void @_ZN7maliput3api12RoadPositionC2EPKNS0_4LaneERKNS0_12LanePositionE(ptr noundef nonnull align 8 dereferenceable(32) %0, ptr noundef nonnull %40, ptr noundef nonnull align 8 dereferenceable(24) %10)
  %42 = getelementptr inbounds i8, ptr %0, i64 32
  %43 = getelementptr inbounds i8, ptr %10, i64 24
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(24) %42, ptr noundef nonnull align 8 dereferenceable(24) %43, i64 24, i1 false)
  %44 = getelementptr inbounds i8, ptr %0, i64 56
  %45 = getelementptr inbounds i8, ptr %10, i64 48
  %46 = load double, ptr %45, align 8, !tbaa !19
  store double %46, ptr %44, align 8, !tbaa !26
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %11) #8
  call void @_ZNKSt5dequeIPKN7maliput3api4LaneESaIS4_EE5beginEv(ptr dead_on_unwind nonnull writable sret(%"struct.std::_Deque_iterator.51") align 8 %11, ptr noundef nonnull align 8 dereferenceable(80) %7) #8
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %12) #8
  call void @_ZNKSt5dequeIPKN7maliput3api4LaneESaIS4_EE3endEv(ptr dead_on_unwind nonnull writable sret(%"struct.std::_Deque_iterator.51") align 8 %12, ptr noundef nonnull align 8 dereferenceable(80) %7) #8
  %47 = call noundef zeroext i1 @_ZStneRKSt15_Deque_iteratorIPKN7maliput3api4LaneERKS4_PS5_ESA_(ptr noundef nonnull align 8 dereferenceable(32) %11, ptr noundef nonnull align 8 dereferenceable(32) %12) #8
  br i1 %47, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %41
  %48 = getelementptr inbounds i8, ptr %14, i64 32
  %49 = getelementptr inbounds i8, ptr %13, i64 24
  %50 = getelementptr inbounds i8, ptr %14, i64 56
  %51 = getelementptr inbounds i8, ptr %13, i64 48
  br label %56

._crit_edge:                                      ; preds = %75, %41
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %12) #8
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %11) #8
  call void @llvm.lifetime.end.p0(i64 56, ptr nonnull %10) #8
  call void @_ZNSt5dequeIPKN7maliput3api4LaneESaIS4_EED2Ev(ptr noundef nonnull align 8 dereferenceable(80) %7) #8
  call void @llvm.lifetime.end.p0(i64 80, ptr nonnull %7) #8
  call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %4) #8
  ret void

52:                                               ; preds = %33
  %53 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %9) #8
  br label %81

54:                                               ; preds = %39
  %55 = landingpad { ptr, i32 }
          cleanup
  br label %80

56:                                               ; preds = %.lr.ph, %75
  %57 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNKSt15_Deque_iteratorIPKN7maliput3api4LaneERKS4_PS5_EdeEv(ptr noundef nonnull align 8 dereferenceable(32) %11) #8
  %58 = load ptr, ptr %57, align 8, !tbaa !18
  %.not = icmp eq ptr %58, null
  br i1 %.not, label %59, label %63

59:                                               ; preds = %56
  invoke void @_ZN7maliput6common8internal5ThrowEPKcS3_S3_i(ptr noundef nonnull @.str.19, ptr noundef nonnull @__func__._ZNK7maliput13geometry_base14KDTreeStrategy11ClosestLaneERKNS_3api16InertialPositionE, ptr noundef nonnull @.str.18, i32 noundef 101) #9
          to label %60 unwind label %61

60:                                               ; preds = %59
  unreachable

61:                                               ; preds = %59
  %62 = landingpad { ptr, i32 }
          cleanup
  br label %79

63:                                               ; preds = %56
  call void @llvm.lifetime.start.p0(i64 56, ptr nonnull %13) #8
  invoke void @_ZNK7maliput3api4Lane14ToLanePositionERKNS0_16InertialPositionE(ptr dead_on_unwind nonnull writable sret(%"struct.maliput::api::LanePositionResult") align 8 %13, ptr noundef nonnull align 8 dereferenceable(8) %58, ptr noundef nonnull align 8 dereferenceable(24) %2)
          to label %64 unwind label %71

64:                                               ; preds = %63
  call void @llvm.lifetime.start.p0(i64 64, ptr nonnull %14) #8
  %65 = load ptr, ptr %57, align 8, !tbaa !18
  call void @_ZN7maliput3api12RoadPositionC2EPKNS0_4LaneERKNS0_12LanePositionE(ptr noundef nonnull align 8 dereferenceable(32) %14, ptr noundef %65, ptr noundef nonnull align 8 dereferenceable(24) %13)
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(24) %48, ptr noundef nonnull align 8 dereferenceable(24) %49, i64 24, i1 false)
  %66 = load double, ptr %51, align 8, !tbaa !19
  store double %66, ptr %50, align 8, !tbaa !26
  %67 = invoke noundef zeroext i1 @_ZN7maliput13geometry_base29IsNewRoadPositionResultCloserERKNS_3api18RoadPositionResultES4_(ptr noundef nonnull align 8 dereferenceable(64) %14, ptr noundef nonnull align 8 dereferenceable(64) %0)
          to label %68 unwind label %73

68:                                               ; preds = %64
  br i1 %67, label %69, label %75

69:                                               ; preds = %68
  %70 = invoke noundef nonnull align 8 dereferenceable(64) ptr @_ZN7maliput3api18RoadPositionResultaSERKS1_(ptr noundef nonnull align 8 dereferenceable(64) %0, ptr noundef nonnull align 8 dereferenceable(64) %14)
          to label %75 unwind label %73

71:                                               ; preds = %63
  %72 = landingpad { ptr, i32 }
          cleanup
  br label %78

73:                                               ; preds = %69, %64
  %74 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 64, ptr nonnull %14) #8
  br label %78

75:                                               ; preds = %69, %68
  call void @llvm.lifetime.end.p0(i64 64, ptr nonnull %14) #8
  call void @llvm.lifetime.end.p0(i64 56, ptr nonnull %13) #8
  %76 = call noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt15_Deque_iteratorIPKN7maliput3api4LaneERKS4_PS5_EppEv(ptr noundef nonnull align 8 dereferenceable(32) %11) #8
  %77 = call noundef zeroext i1 @_ZStneRKSt15_Deque_iteratorIPKN7maliput3api4LaneERKS4_PS5_ESA_(ptr noundef nonnull align 8 dereferenceable(32) %11, ptr noundef nonnull align 8 dereferenceable(32) %12) #8
  br i1 %77, label %56, label %._crit_edge

78:                                               ; preds = %73, %71
  %.pn = phi { ptr, i32 } [ %74, %73 ], [ %72, %71 ]
  call void @llvm.lifetime.end.p0(i64 56, ptr nonnull %13) #8
  br label %79

79:                                               ; preds = %78, %61
  %.pn.pn = phi { ptr, i32 } [ %.pn, %78 ], [ %62, %61 ]
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %12) #8
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %11) #8
  br label %80

80:                                               ; preds = %79, %54
  %.pn.pn.pn = phi { ptr, i32 } [ %.pn.pn, %79 ], [ %55, %54 ]
  call void @llvm.lifetime.end.p0(i64 56, ptr nonnull %10) #8
  br label %81

81:                                               ; preds = %52, %80, %31
  %.pn24 = phi { ptr, i32 } [ %32, %31 ], [ %.pn.pn.pn, %80 ], [ %53, %52 ]
  call void @_ZNSt5dequeIPKN7maliput3api4LaneESaIS4_EED2Ev(ptr noundef nonnull align 8 dereferenceable(80) %7) #8
  call void @llvm.lifetime.end.p0(i64 80, ptr nonnull %7) #8
  call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %4) #8
  resume { ptr, i32 } %.pn24
}

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNK7maliput13geometry_base14KDTreeStrategy12ClosestLanesERKNS_3api16InertialPositionEd(ptr dead_on_unwind noalias writable sret(%"class.std::deque.45") align 8, ptr noundef nonnull align 8 dereferenceable(32), ptr noundef nonnull align 8 dereferenceable(24), double noundef) local_unnamed_addr #5 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNKSt5dequeIPKN7maliput3api4LaneESaIS4_EE5beginEv(ptr dead_on_unwind noalias writable sret(%"struct.std::_Deque_iterator.51") align 8, ptr noundef nonnull align 8 dereferenceable(80)) local_unnamed_addr #1 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNKSt5dequeIPKN7maliput3api4LaneESaIS4_EE3endEv(ptr dead_on_unwind noalias writable sret(%"struct.std::_Deque_iterator.51") align 8, ptr noundef nonnull align 8 dereferenceable(80)) local_unnamed_addr #1 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZStneRKSt15_Deque_iteratorIPKN7maliput3api4LaneERKS4_PS5_ESA_(ptr noundef nonnull align 8 dereferenceable(32), ptr noundef nonnull align 8 dereferenceable(32)) local_unnamed_addr #1

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

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef nonnull align 8 dereferenceable(40) ptr @_ZNK7maliput4math7details10KDTreeBaseINS0_8KDTree3DINS_13geometry_base14KDTreeStrategy12MaliputPointENS1_15SquaredDistanceIS6_Lm3EEENS1_7NodeCmpILm3EEEEES6_Lm3ENS0_14AxisAlignedBoxES8_SA_E13nearest_pointERKS6_(ptr noundef nonnull align 8 dereferenceable(88), ptr noundef nonnull align 8 dereferenceable(40)) local_unnamed_addr #5 align 2

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

declare void @_ZNK7maliput4math10VectorBaseILm3ENS0_7Vector3EEmiERKS3_(ptr dead_on_unwind writable sret(%"class.maliput::math::Vector3") align 8, ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #4

declare noundef double @_ZNK7maliput4math10VectorBaseILm3ENS0_7Vector3EE4normEv(ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #4

; Function Attrs: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare double @llvm.fmuladd.f64(double, double, double) #6

; Function Attrs: mustprogress nounwind uwtable
declare dso_local { ptr, i8 } @_ZNK7maliput13geometry_base14KDTreeStrategy12MaliputPoint8get_laneEv(ptr noundef nonnull align 8 dereferenceable(40)) local_unnamed_addr #1 align 2

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

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

declare noundef zeroext i1 @_ZN7maliput13geometry_base29IsNewRoadPositionResultCloserERKNS_3api18RoadPositionResultES4_(ptr noundef nonnull align 8 dereferenceable(64), ptr noundef nonnull align 8 dereferenceable(64)) local_unnamed_addr #4

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef nonnull align 8 dereferenceable(64) ptr @_ZN7maliput3api18RoadPositionResultaSERKS1_(ptr noundef nonnull align 8 dereferenceable(64), ptr noundef nonnull align 8 dereferenceable(64)) local_unnamed_addr #7 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 nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { noreturn "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { 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 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #7 = { 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 #8 = { nounwind }
attributes #9 = { noreturn }

!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, !17, i64 24}
!6 = !{!"_ZTSN7maliput13geometry_base14KDTreeStrategyE", !7, i64 0, !11, i64 16, !17, i64 24}
!7 = !{!"_ZTSN7maliput13geometry_base12StrategyBaseE", !8, i64 8}
!8 = !{!"any pointer", !9, i64 0}
!9 = !{!"omnipotent char", !10, i64 0}
!10 = !{!"Simple C++ TBAA"}
!11 = !{!"_ZTSSt10unique_ptrIN7maliput4math8KDTree3DINS0_13geometry_base14KDTreeStrategy12MaliputPointENS1_7details15SquaredDistanceIS5_Lm3EEENS6_7NodeCmpILm3EEEEESt14default_deleteISB_EE", !12, i64 0}
!12 = !{!"_ZTSSt15__uniq_ptr_dataIN7maliput4math8KDTree3DINS0_13geometry_base14KDTreeStrategy12MaliputPointENS1_7details15SquaredDistanceIS5_Lm3EEENS6_7NodeCmpILm3EEEEESt14default_deleteISB_ELb1ELb1EE", !13, i64 0}
!13 = !{!"_ZTSSt15__uniq_ptr_implIN7maliput4math8KDTree3DINS0_13geometry_base14KDTreeStrategy12MaliputPointENS1_7details15SquaredDistanceIS5_Lm3EEENS6_7NodeCmpILm3EEEEESt14default_deleteISB_EE", !14, i64 0}
!14 = !{!"_ZTSSt5tupleIJPN7maliput4math8KDTree3DINS0_13geometry_base14KDTreeStrategy12MaliputPointENS1_7details15SquaredDistanceIS5_Lm3EEENS6_7NodeCmpILm3EEEEESt14default_deleteISB_EEE", !15, i64 0}
!15 = !{!"_ZTSSt11_Tuple_implILm0EJPN7maliput4math8KDTree3DINS0_13geometry_base14KDTreeStrategy12MaliputPointENS1_7details15SquaredDistanceIS5_Lm3EEENS6_7NodeCmpILm3EEEEESt14default_deleteISB_EEE", !16, i64 0}
!16 = !{!"_ZTSSt10_Head_baseILm0EPN7maliput4math8KDTree3DINS0_13geometry_base14KDTreeStrategy12MaliputPointENS1_7details15SquaredDistanceIS5_Lm3EEENS6_7NodeCmpILm3EEEEELb0EE", !8, i64 0}
!17 = !{!"double", !9, i64 0}
!18 = !{!8, !8, i64 0}
!19 = !{!20, !17, i64 48}
!20 = !{!"_ZTSN7maliput3api18LanePositionResultE", !21, i64 0, !25, i64 24, !17, i64 48}
!21 = !{!"_ZTSN7maliput3api12LanePositionE", !22, i64 0}
!22 = !{!"_ZTSN7maliput4math7Vector3E", !23, i64 0}
!23 = !{!"_ZTSN7maliput4math10VectorBaseILm3ENS0_7Vector3EEE", !24, i64 0}
!24 = !{!"_ZTSSt5arrayIdLm3EE", !9, i64 0}
!25 = !{!"_ZTSN7maliput3api16InertialPositionE", !22, i64 0}
!26 = !{!27, !17, i64 56}
!27 = !{!"_ZTSN7maliput3api18RoadPositionResultE", !28, i64 0, !25, i64 32, !17, i64 56}
!28 = !{!"_ZTSN7maliput3api12RoadPositionE", !8, i64 0, !21, i64 8}


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