; 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" }
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<maliput::api::RoadPositionResult, std::allocator<maliput::api::RoadPositionResult>>::_Vector_impl" }
%"struct.std::_Vector_base<maliput::api::RoadPositionResult, std::allocator<maliput::api::RoadPositionResult>>::_Vector_impl" = type { %"struct.std::_Vector_base<maliput::api::RoadPositionResult, std::allocator<maliput::api::RoadPositionResult>>::_Vector_impl_data" }
%"struct.std::_Vector_base<maliput::api::RoadPositionResult, std::allocator<maliput::api::RoadPositionResult>>::_Vector_impl_data" = type { ptr, ptr, 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 }
%"struct.maliput::api::RoadPositionResult" = type { %"struct.maliput::api::RoadPosition", %"class.maliput::api::InertialPosition", double }
%"struct.maliput::api::RoadPosition" = type { ptr, %"class.maliput::api::LanePosition" }

@.str.18 = external hidden unnamed_addr constant [95 x i8], align 1
@.str.19 = external hidden unnamed_addr constant [16 x i8], align 1
@__func__._ZNK7maliput13geometry_base14KDTreeStrategy19DoFindRoadPositionsERKNS_3api16InertialPositionEd = external hidden unnamed_addr constant [20 x i8], align 1

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

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: 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) #1

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

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)) #3

; 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 #4 align 2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZNK7maliput13geometry_base14KDTreeStrategy19DoFindRoadPositionsERKNS_3api16InertialPositionEd(ptr dead_on_unwind noalias writable sret(%"class.std::vector") align 8 %0, ptr noundef nonnull align 8 dereferenceable(32) %1, ptr noundef nonnull align 8 dereferenceable(24) %2, double noundef %3) unnamed_addr #5 align 2 personality ptr @__gxx_personality_v0 {
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca double, align 8
  %9 = alloca %"class.std::deque.45", align 8
  %10 = alloca i1, align 1
  %11 = alloca ptr, align 8
  %12 = alloca %"struct.std::_Deque_iterator.51", align 8
  %13 = alloca %"struct.std::_Deque_iterator.51", align 8
  %14 = alloca ptr, align 8
  %15 = alloca ptr, align 8
  %16 = alloca i32, align 4
  %17 = alloca %"struct.maliput::api::LanePositionResult", align 8
  %18 = alloca %"struct.maliput::api::RoadPositionResult", align 8
  store ptr %0, ptr %5, align 8
  store ptr %1, ptr %6, align 8, !tbaa !5
  store ptr %2, ptr %7, align 8, !tbaa !5
  store double %3, ptr %8, align 8, !tbaa !9
  %19 = load ptr, ptr %6, align 8
  call void @llvm.lifetime.start.p0(i64 80, ptr %9) #6
  %20 = load ptr, ptr %7, align 8, !tbaa !5
  %21 = load double, ptr %8, align 8, !tbaa !9
  call void @_ZNK7maliput13geometry_base14KDTreeStrategy12ClosestLanesERKNS_3api16InertialPositionEd(ptr dead_on_unwind writable sret(%"class.std::deque.45") align 8 %9, ptr noundef nonnull align 8 dereferenceable(32) %19, ptr noundef nonnull align 8 dereferenceable(24) %20, double noundef %21)
  store i1 false, ptr %10, align 1
  call void @_ZNSt6vectorIN7maliput3api18RoadPositionResultESaIS2_EEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %0) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #6
  store ptr %9, ptr %11, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 32, ptr %12) #6
  %22 = load ptr, ptr %11, align 8, !tbaa !5
  call void @_ZNKSt5dequeIPKN7maliput3api4LaneESaIS4_EE5beginEv(ptr dead_on_unwind writable sret(%"struct.std::_Deque_iterator.51") align 8 %12, ptr noundef nonnull align 8 dereferenceable(80) %22) #6
  call void @llvm.lifetime.start.p0(i64 32, ptr %13) #6
  %23 = load ptr, ptr %11, align 8, !tbaa !5
  call void @_ZNKSt5dequeIPKN7maliput3api4LaneESaIS4_EE3endEv(ptr dead_on_unwind writable sret(%"struct.std::_Deque_iterator.51") align 8 %13, ptr noundef nonnull align 8 dereferenceable(80) %23) #6
  br label %24

24:                                               ; preds = %71, %4
  %25 = call noundef zeroext i1 @_ZStneRKSt15_Deque_iteratorIPKN7maliput3api4LaneERKS4_PS5_ESA_(ptr noundef nonnull align 8 dereferenceable(32) %12, ptr noundef nonnull align 8 dereferenceable(32) %13) #6
  br i1 %25, label %27, label %26

26:                                               ; preds = %24
  call void @llvm.lifetime.end.p0(i64 32, ptr %13) #6
  call void @llvm.lifetime.end.p0(i64 32, ptr %12) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #6
  br label %75

27:                                               ; preds = %24
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #6
  %28 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNKSt15_Deque_iteratorIPKN7maliput3api4LaneERKS4_PS5_EdeEv(ptr noundef nonnull align 8 dereferenceable(32) %12) #6
  store ptr %28, ptr %14, align 8, !tbaa !5
  br label %29

29:                                               ; preds = %27
  %30 = load ptr, ptr %14, align 8, !tbaa !5
  %31 = load ptr, ptr %30, align 8, !tbaa !5
  %32 = icmp ne ptr %31, null
  br i1 %32, label %39, label %33

33:                                               ; preds = %29
  invoke void @_ZN7maliput6common8internal5ThrowEPKcS3_S3_i(ptr noundef @.str.19, ptr noundef @__func__._ZNK7maliput13geometry_base14KDTreeStrategy19DoFindRoadPositionsERKNS_3api16InertialPositionEd, ptr noundef @.str.18, i32 noundef 73) #7
          to label %34 unwind label %35

34:                                               ; preds = %33
  unreachable

35:                                               ; preds = %33
  %36 = landingpad { ptr, i32 }
          cleanup
  %37 = extractvalue { ptr, i32 } %36, 0
  store ptr %37, ptr %15, align 8
  %38 = extractvalue { ptr, i32 } %36, 1
  store i32 %38, ptr %16, align 4
  br label %74

39:                                               ; preds = %29
  br label %40

40:                                               ; preds = %39
  br label %41

41:                                               ; preds = %40
  call void @llvm.lifetime.start.p0(i64 56, ptr %17) #6
  %42 = load ptr, ptr %14, align 8, !tbaa !5
  %43 = load ptr, ptr %42, align 8, !tbaa !5
  %44 = load ptr, ptr %7, align 8, !tbaa !5
  invoke void @_ZNK7maliput3api4Lane14ToLanePositionERKNS0_16InertialPositionE(ptr dead_on_unwind writable sret(%"struct.maliput::api::LanePositionResult") align 8 %17, ptr noundef nonnull align 8 dereferenceable(8) %43, ptr noundef nonnull align 8 dereferenceable(24) %44)
          to label %45 unwind label %62

45:                                               ; preds = %41
  %46 = getelementptr inbounds %"struct.maliput::api::LanePositionResult", ptr %17, i32 0, i32 2
  %47 = load double, ptr %46, align 8, !tbaa !11
  %48 = load double, ptr %8, align 8, !tbaa !9
  %49 = fcmp ole double %47, %48
  br i1 %49, label %50, label %70

50:                                               ; preds = %45
  call void @llvm.lifetime.start.p0(i64 64, ptr %18) #6
  %51 = getelementptr inbounds %"struct.maliput::api::RoadPositionResult", ptr %18, i32 0, i32 0
  %52 = load ptr, ptr %14, align 8, !tbaa !5
  %53 = load ptr, ptr %52, align 8, !tbaa !5
  %54 = getelementptr inbounds %"struct.maliput::api::LanePositionResult", ptr %17, i32 0, i32 0
  invoke void @_ZN7maliput3api12RoadPositionC2EPKNS0_4LaneERKNS0_12LanePositionE(ptr noundef nonnull align 8 dereferenceable(32) %51, ptr noundef %53, ptr noundef nonnull align 8 dereferenceable(24) %54)
          to label %55 unwind label %66

55:                                               ; preds = %50
  %56 = getelementptr inbounds %"struct.maliput::api::RoadPositionResult", ptr %18, i32 0, i32 1
  %57 = getelementptr inbounds %"struct.maliput::api::LanePositionResult", ptr %17, i32 0, i32 1
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %56, ptr align 8 %57, i64 24, i1 false)
  %58 = getelementptr inbounds %"struct.maliput::api::RoadPositionResult", ptr %18, i32 0, i32 2
  %59 = getelementptr inbounds %"struct.maliput::api::LanePositionResult", ptr %17, i32 0, i32 2
  %60 = load double, ptr %59, align 8, !tbaa !11
  store double %60, ptr %58, align 8, !tbaa !18
  invoke void @_ZNSt6vectorIN7maliput3api18RoadPositionResultESaIS2_EE9push_backEOS2_(ptr noundef nonnull align 8 dereferenceable(24) %0, ptr noundef nonnull align 8 dereferenceable(64) %18)
          to label %61 unwind label %66

61:                                               ; preds = %55
  call void @llvm.lifetime.end.p0(i64 64, ptr %18) #6
  br label %70

62:                                               ; preds = %41
  %63 = landingpad { ptr, i32 }
          cleanup
  %64 = extractvalue { ptr, i32 } %63, 0
  store ptr %64, ptr %15, align 8
  %65 = extractvalue { ptr, i32 } %63, 1
  store i32 %65, ptr %16, align 4
  br label %73

66:                                               ; preds = %55, %50
  %67 = landingpad { ptr, i32 }
          cleanup
  %68 = extractvalue { ptr, i32 } %67, 0
  store ptr %68, ptr %15, align 8
  %69 = extractvalue { ptr, i32 } %67, 1
  store i32 %69, ptr %16, align 4
  call void @llvm.lifetime.end.p0(i64 64, ptr %18) #6
  br label %73

70:                                               ; preds = %61, %45
  call void @llvm.lifetime.end.p0(i64 56, ptr %17) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #6
  br label %71

71:                                               ; preds = %70
  %72 = call noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt15_Deque_iteratorIPKN7maliput3api4LaneERKS4_PS5_EppEv(ptr noundef nonnull align 8 dereferenceable(32) %12) #6
  br label %24

73:                                               ; preds = %66, %62
  call void @llvm.lifetime.end.p0(i64 56, ptr %17) #6
  br label %74

74:                                               ; preds = %73, %35
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #6
  call void @llvm.lifetime.end.p0(i64 32, ptr %13) #6
  call void @llvm.lifetime.end.p0(i64 32, ptr %12) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #6
  call void @_ZNSt6vectorIN7maliput3api18RoadPositionResultESaIS2_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %0) #6
  call void @_ZNSt5dequeIPKN7maliput3api4LaneESaIS4_EED2Ev(ptr noundef nonnull align 8 dereferenceable(80) %9) #6
  call void @llvm.lifetime.end.p0(i64 80, ptr %9) #6
  br label %79

75:                                               ; preds = %26
  store i1 true, ptr %10, align 1
  %76 = load i1, ptr %10, align 1
  br i1 %76, label %78, label %77

77:                                               ; preds = %75
  call void @_ZNSt6vectorIN7maliput3api18RoadPositionResultESaIS2_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %0) #6
  br label %78

78:                                               ; preds = %77, %75
  call void @_ZNSt5dequeIPKN7maliput3api4LaneESaIS4_EED2Ev(ptr noundef nonnull align 8 dereferenceable(80) %9) #6
  call void @llvm.lifetime.end.p0(i64 80, ptr %9) #6
  ret void

79:                                               ; preds = %74
  %80 = load ptr, ptr %15, align 8
  %81 = load i32, ptr %16, align 4
  %82 = insertvalue { ptr, i32 } poison, ptr %80, 0
  %83 = insertvalue { ptr, i32 } %82, i32 %81, 1
  resume { ptr, i32 } %83
}

; 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 @_ZNSt6vectorIN7maliput3api18RoadPositionResultESaIS2_EEC2Ev(ptr noundef nonnull align 8 dereferenceable(24)) unnamed_addr #4 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)) #4 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)) #4 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)) #4

; 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)) #4 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt6vectorIN7maliput3api18RoadPositionResultESaIS2_EE9push_backEOS2_(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(64)) #5 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)) #4 align 2

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

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

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { 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 #3 = { "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 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 #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 = { nounwind }
attributes #7 = { 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, !10, i64 0}
!10 = !{!"double", !7, i64 0}
!11 = !{!12, !10, i64 48}
!12 = !{!"_ZTSN7maliput3api18LanePositionResultE", !13, i64 0, !17, i64 24, !10, i64 48}
!13 = !{!"_ZTSN7maliput3api12LanePositionE", !14, i64 0}
!14 = !{!"_ZTSN7maliput4math7Vector3E", !15, i64 0}
!15 = !{!"_ZTSN7maliput4math10VectorBaseILm3ENS0_7Vector3EEE", !16, i64 0}
!16 = !{!"_ZTSSt5arrayIdLm3EE", !7, i64 0}
!17 = !{!"_ZTSN7maliput3api16InertialPositionE", !14, i64 0}
!18 = !{!19, !10, i64 56}
!19 = !{!"_ZTSN7maliput3api18RoadPositionResultE", !20, i64 0, !17, i64 32, !10, i64 56}
!20 = !{!"_ZTSN7maliput3api12RoadPositionE", !6, i64 0, !13, 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" }
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<maliput::api::RoadPositionResult, std::allocator<maliput::api::RoadPositionResult>>::_Vector_impl" }
%"struct.std::_Vector_base<maliput::api::RoadPositionResult, std::allocator<maliput::api::RoadPositionResult>>::_Vector_impl" = type { %"struct.std::_Vector_base<maliput::api::RoadPositionResult, std::allocator<maliput::api::RoadPositionResult>>::_Vector_impl_data" }
%"struct.std::_Vector_base<maliput::api::RoadPositionResult, std::allocator<maliput::api::RoadPositionResult>>::_Vector_impl_data" = type { ptr, ptr, 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 }
%"struct.maliput::api::RoadPositionResult" = type { %"struct.maliput::api::RoadPosition", %"class.maliput::api::InertialPosition", double }
%"struct.maliput::api::RoadPosition" = type { ptr, %"class.maliput::api::LanePosition" }

@.str.18 = external hidden unnamed_addr constant [95 x i8], align 1
@.str.19 = external hidden unnamed_addr constant [16 x i8], align 1
@__func__._ZNK7maliput13geometry_base14KDTreeStrategy19DoFindRoadPositionsERKNS_3api16InertialPositionEd = external hidden unnamed_addr constant [20 x i8], align 1

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

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 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) #1

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

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 #3

; 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 #4 align 2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZNK7maliput13geometry_base14KDTreeStrategy19DoFindRoadPositionsERKNS_3api16InertialPositionEd(ptr dead_on_unwind noalias writable sret(%"class.std::vector") align 8 %0, ptr noundef nonnull align 8 dereferenceable(32) %1, ptr noundef nonnull align 8 dereferenceable(24) %2, double noundef %3) unnamed_addr #5 align 2 personality ptr @__gxx_personality_v0 {
  %5 = alloca %"class.std::deque.45", align 8
  %6 = alloca %"struct.std::_Deque_iterator.51", align 8
  %7 = alloca %"struct.std::_Deque_iterator.51", align 8
  %8 = alloca %"struct.maliput::api::LanePositionResult", align 8
  %9 = alloca %"struct.maliput::api::RoadPositionResult", align 8
  call void @llvm.lifetime.start.p0(i64 80, ptr nonnull %5) #6
  call void @_ZNK7maliput13geometry_base14KDTreeStrategy12ClosestLanesERKNS_3api16InertialPositionEd(ptr dead_on_unwind nonnull writable sret(%"class.std::deque.45") align 8 %5, ptr noundef nonnull align 8 dereferenceable(32) %1, ptr noundef nonnull align 8 dereferenceable(24) %2, double noundef %3)
  call void @_ZNSt6vectorIN7maliput3api18RoadPositionResultESaIS2_EEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %0) #6
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %6) #6
  call void @_ZNKSt5dequeIPKN7maliput3api4LaneESaIS4_EE5beginEv(ptr dead_on_unwind nonnull writable sret(%"struct.std::_Deque_iterator.51") align 8 %6, ptr noundef nonnull align 8 dereferenceable(80) %5) #6
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %7) #6
  call void @_ZNKSt5dequeIPKN7maliput3api4LaneESaIS4_EE3endEv(ptr dead_on_unwind nonnull writable sret(%"struct.std::_Deque_iterator.51") align 8 %7, ptr noundef nonnull align 8 dereferenceable(80) %5) #6
  %10 = call noundef zeroext i1 @_ZStneRKSt15_Deque_iteratorIPKN7maliput3api4LaneERKS4_PS5_ESA_(ptr noundef nonnull align 8 dereferenceable(32) %6, ptr noundef nonnull align 8 dereferenceable(32) %7) #6
  br i1 %10, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %4
  %11 = getelementptr inbounds i8, ptr %8, i64 48
  %12 = getelementptr inbounds i8, ptr %9, i64 32
  %13 = getelementptr inbounds i8, ptr %8, i64 24
  %14 = getelementptr inbounds i8, ptr %9, i64 56
  br label %15

._crit_edge:                                      ; preds = %34, %4
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %7) #6
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %6) #6
  call void @_ZNSt5dequeIPKN7maliput3api4LaneESaIS4_EED2Ev(ptr noundef nonnull align 8 dereferenceable(80) %5) #6
  call void @llvm.lifetime.end.p0(i64 80, ptr nonnull %5) #6
  ret void

15:                                               ; preds = %.lr.ph, %34
  %16 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNKSt15_Deque_iteratorIPKN7maliput3api4LaneERKS4_PS5_EdeEv(ptr noundef nonnull align 8 dereferenceable(32) %6) #6
  %17 = load ptr, ptr %16, align 8, !tbaa !5
  %.not = icmp eq ptr %17, null
  br i1 %.not, label %18, label %22

18:                                               ; preds = %15
  invoke void @_ZN7maliput6common8internal5ThrowEPKcS3_S3_i(ptr noundef nonnull @.str.19, ptr noundef nonnull @__func__._ZNK7maliput13geometry_base14KDTreeStrategy19DoFindRoadPositionsERKNS_3api16InertialPositionEd, ptr noundef nonnull @.str.18, i32 noundef 73) #7
          to label %19 unwind label %20

19:                                               ; preds = %18
  unreachable

20:                                               ; preds = %18
  %21 = landingpad { ptr, i32 }
          cleanup
  br label %38

22:                                               ; preds = %15
  call void @llvm.lifetime.start.p0(i64 56, ptr nonnull %8) #6
  invoke void @_ZNK7maliput3api4Lane14ToLanePositionERKNS0_16InertialPositionE(ptr dead_on_unwind nonnull writable sret(%"struct.maliput::api::LanePositionResult") align 8 %8, ptr noundef nonnull align 8 dereferenceable(8) %17, ptr noundef nonnull align 8 dereferenceable(24) %2)
          to label %23 unwind label %30

23:                                               ; preds = %22
  %24 = load double, ptr %11, align 8, !tbaa !9
  %25 = fcmp ugt double %24, %3
  br i1 %25, label %34, label %26

26:                                               ; preds = %23
  call void @llvm.lifetime.start.p0(i64 64, ptr nonnull %9) #6
  %27 = load ptr, ptr %16, align 8, !tbaa !5
  call void @_ZN7maliput3api12RoadPositionC2EPKNS0_4LaneERKNS0_12LanePositionE(ptr noundef nonnull align 8 dereferenceable(32) %9, ptr noundef %27, ptr noundef nonnull align 8 dereferenceable(24) %8)
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(24) %12, ptr noundef nonnull align 8 dereferenceable(24) %13, i64 24, i1 false)
  %28 = load double, ptr %11, align 8, !tbaa !9
  store double %28, ptr %14, align 8, !tbaa !17
  invoke void @_ZNSt6vectorIN7maliput3api18RoadPositionResultESaIS2_EE9push_backEOS2_(ptr noundef nonnull align 8 dereferenceable(24) %0, ptr noundef nonnull align 8 dereferenceable(64) %9)
          to label %29 unwind label %32

29:                                               ; preds = %26
  call void @llvm.lifetime.end.p0(i64 64, ptr nonnull %9) #6
  br label %34

30:                                               ; preds = %22
  %31 = landingpad { ptr, i32 }
          cleanup
  br label %37

32:                                               ; preds = %26
  %33 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 64, ptr nonnull %9) #6
  br label %37

34:                                               ; preds = %29, %23
  call void @llvm.lifetime.end.p0(i64 56, ptr nonnull %8) #6
  %35 = call noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt15_Deque_iteratorIPKN7maliput3api4LaneERKS4_PS5_EppEv(ptr noundef nonnull align 8 dereferenceable(32) %6) #6
  %36 = call noundef zeroext i1 @_ZStneRKSt15_Deque_iteratorIPKN7maliput3api4LaneERKS4_PS5_ESA_(ptr noundef nonnull align 8 dereferenceable(32) %6, ptr noundef nonnull align 8 dereferenceable(32) %7) #6
  br i1 %36, label %15, label %._crit_edge

37:                                               ; preds = %32, %30
  %.pn = phi { ptr, i32 } [ %33, %32 ], [ %31, %30 ]
  call void @llvm.lifetime.end.p0(i64 56, ptr nonnull %8) #6
  br label %38

38:                                               ; preds = %37, %20
  %.pn.pn = phi { ptr, i32 } [ %.pn, %37 ], [ %21, %20 ]
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %7) #6
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %6) #6
  call void @_ZNSt6vectorIN7maliput3api18RoadPositionResultESaIS2_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %0) #6
  call void @_ZNSt5dequeIPKN7maliput3api4LaneESaIS4_EED2Ev(ptr noundef nonnull align 8 dereferenceable(80) %5) #6
  call void @llvm.lifetime.end.p0(i64 80, ptr nonnull %5) #6
  resume { ptr, i32 } %.pn.pn
}

; 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 @_ZNSt6vectorIN7maliput3api18RoadPositionResultESaIS2_EEC2Ev(ptr noundef nonnull align 8 dereferenceable(24)) unnamed_addr #4 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 #4 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 #4 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 #4

; 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 #4 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt6vectorIN7maliput3api18RoadPositionResultESaIS2_EE9push_backEOS2_(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(64)) local_unnamed_addr #5 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 #4 align 2

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

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

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { 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 #3 = { "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 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 #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 = { nounwind }
attributes #7 = { 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, !16, i64 48}
!10 = !{!"_ZTSN7maliput3api18LanePositionResultE", !11, i64 0, !15, i64 24, !16, i64 48}
!11 = !{!"_ZTSN7maliput3api12LanePositionE", !12, i64 0}
!12 = !{!"_ZTSN7maliput4math7Vector3E", !13, i64 0}
!13 = !{!"_ZTSN7maliput4math10VectorBaseILm3ENS0_7Vector3EEE", !14, i64 0}
!14 = !{!"_ZTSSt5arrayIdLm3EE", !7, i64 0}
!15 = !{!"_ZTSN7maliput3api16InertialPositionE", !12, i64 0}
!16 = !{!"double", !7, i64 0}
!17 = !{!18, !16, i64 56}
!18 = !{!"_ZTSN7maliput3api18RoadPositionResultE", !19, i64 0, !15, i64 32, !16, i64 56}
!19 = !{!"_ZTSN7maliput3api12RoadPositionE", !6, i64 0, !11, i64 8}


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