; LLVM IR from maliput/maliput :: src/maliput/routing (phase)

; 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::routing::PhasePositionResult" = type { i32, %"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.90" = type { %"struct.std::_Vector_base.91" }
%"struct.std::_Vector_base.91" = 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.__gnu_cxx::__normal_iterator" = type { ptr }
%"class.std::back_insert_iterator" = type { ptr }
%class.anon.95 = type { ptr, ptr, ptr }
%"class.maliput::routing::Phase" = type { i32, double, %"class.std::vector.0", %"class.std::vector.0", %"class.std::vector", ptr }
%"class.std::vector.0" = type { %"struct.std::_Vector_base.1" }
%"struct.std::_Vector_base.1" = type { %"struct.std::_Vector_base<maliput::api::RoadPosition, std::allocator<maliput::api::RoadPosition>>::_Vector_impl" }
%"struct.std::_Vector_base<maliput::api::RoadPosition, std::allocator<maliput::api::RoadPosition>>::_Vector_impl" = type { %"struct.std::_Vector_base<maliput::api::RoadPosition, std::allocator<maliput::api::RoadPosition>>::_Vector_impl_data" }
%"struct.std::_Vector_base<maliput::api::RoadPosition, std::allocator<maliput::api::RoadPosition>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<maliput::api::LaneSRange, std::allocator<maliput::api::LaneSRange>>::_Vector_impl" }
%"struct.std::_Vector_base<maliput::api::LaneSRange, std::allocator<maliput::api::LaneSRange>>::_Vector_impl" = type { %"struct.std::_Vector_base<maliput::api::LaneSRange, std::allocator<maliput::api::LaneSRange>>::_Vector_impl_data" }
%"struct.std::_Vector_base<maliput::api::LaneSRange, std::allocator<maliput::api::LaneSRange>>::_Vector_impl_data" = type { 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" }

; 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) #0

declare i32 @__gxx_personality_v0(...)

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

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

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZNK7maliput7routing5Phase17FindPhasePositionERKNS_3api16InertialPositionE(ptr dead_on_unwind noalias writable sret(%"struct.maliput::routing::PhasePositionResult") align 8 %0, ptr noundef nonnull align 8 dereferenceable(96) %1, ptr noundef nonnull align 8 dereferenceable(24) %2) #3 align 2 personality ptr @__gxx_personality_v0 {
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca %"class.std::vector.90", align 8
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca i32, align 4
  %10 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %11 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %12 = alloca %"class.std::back_insert_iterator", align 8
  %13 = alloca %class.anon.95, align 8
  %14 = alloca %"class.std::back_insert_iterator", align 8
  %15 = alloca i64, align 8
  %16 = alloca i64, align 8
  store ptr %1, ptr %4, align 8, !tbaa !5
  store ptr %2, ptr %5, align 8, !tbaa !5
  %17 = load ptr, ptr %4, align 8
  call void @llvm.lifetime.start.p0(i64 24, ptr %6) #6
  call void @_ZNSt6vectorIN7maliput3api18RoadPositionResultESaIS2_EEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %6) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #6
  %18 = getelementptr inbounds %"class.maliput::routing::Phase", ptr %17, i32 0, i32 5
  %19 = load ptr, ptr %18, align 8, !tbaa !9
  %20 = invoke noundef ptr @_ZNK7maliput3api11RoadNetwork13road_geometryEv(ptr noundef nonnull align 8 dereferenceable(88) %19)
          to label %21 unwind label %52

21:                                               ; preds = %3
  store ptr %20, ptr %7, align 8, !tbaa !5
  %22 = getelementptr inbounds %"class.maliput::routing::Phase", ptr %17, i32 0, i32 4
  %23 = call ptr @_ZNKSt6vectorIN7maliput3api10LaneSRangeESaIS2_EE6cbeginEv(ptr noundef nonnull align 8 dereferenceable(24) %22) #6
  %24 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %10, i32 0, i32 0
  store ptr %23, ptr %24, align 8
  %25 = getelementptr inbounds %"class.maliput::routing::Phase", ptr %17, i32 0, i32 4
  %26 = call ptr @_ZNKSt6vectorIN7maliput3api10LaneSRangeESaIS2_EE4cendEv(ptr noundef nonnull align 8 dereferenceable(24) %25) #6
  %27 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %11, i32 0, i32 0
  store ptr %26, ptr %27, align 8
  %28 = invoke ptr @_ZSt13back_inserterISt6vectorIN7maliput3api18RoadPositionResultESaIS3_EEESt20back_insert_iteratorIT_ERS7_(ptr noundef nonnull align 8 dereferenceable(24) %6)
          to label %29 unwind label %52

29:                                               ; preds = %21
  %30 = getelementptr inbounds %"class.std::back_insert_iterator", ptr %12, i32 0, i32 0
  store ptr %28, ptr %30, align 8
  %31 = getelementptr inbounds %class.anon.95, ptr %13, i32 0, i32 0
  %32 = load ptr, ptr %7, align 8, !tbaa !5
  store ptr %32, ptr %31, align 8, !tbaa !21
  %33 = getelementptr inbounds %class.anon.95, ptr %13, i32 0, i32 1
  %34 = load ptr, ptr %5, align 8, !tbaa !5
  store ptr %34, ptr %33, align 8, !tbaa !5
  %35 = getelementptr inbounds %class.anon.95, ptr %13, i32 0, i32 2
  %36 = getelementptr inbounds %"class.maliput::routing::Phase", ptr %17, i32 0, i32 1
  store ptr %36, ptr %35, align 8, !tbaa !5
  %37 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %10, i32 0, i32 0
  %38 = load ptr, ptr %37, align 8
  %39 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %11, i32 0, i32 0
  %40 = load ptr, ptr %39, align 8
  %41 = getelementptr inbounds %"class.std::back_insert_iterator", ptr %12, i32 0, i32 0
  %42 = load ptr, ptr %41, align 8
  %43 = invoke ptr @"_ZSt9transformIN9__gnu_cxx17__normal_iteratorIPKN7maliput3api10LaneSRangeESt6vectorIS4_SaIS4_EEEESt20back_insert_iteratorIS7_INS3_18RoadPositionResultESaISC_EEEZNKS2_7routing5Phase17FindPhasePositionERKNS3_16InertialPositionEE3$_0ET0_T_SN_SM_T1_"(ptr %38, ptr %40, ptr %42, ptr noundef byval(%class.anon.95) align 8 %13)
          to label %44 unwind label %52

44:                                               ; preds = %29
  %45 = getelementptr inbounds %"class.std::back_insert_iterator", ptr %14, i32 0, i32 0
  store ptr %43, ptr %45, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #6
  store i64 0, ptr %15, align 8, !tbaa !23
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #6
  store i64 1, ptr %16, align 8, !tbaa !23
  br label %46

46:                                               ; preds = %69, %44
  %47 = load i64, ptr %16, align 8, !tbaa !23
  %48 = getelementptr inbounds %"class.maliput::routing::Phase", ptr %17, i32 0, i32 4
  %49 = call noundef i64 @_ZNKSt6vectorIN7maliput3api10LaneSRangeESaIS2_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %48) #6
  %50 = icmp ult i64 %47, %49
  br i1 %50, label %56, label %51

51:                                               ; preds = %46
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #6
  br label %76

52:                                               ; preds = %29, %21, %3
  %53 = landingpad { ptr, i32 }
          cleanup
  %54 = extractvalue { ptr, i32 } %53, 0
  store ptr %54, ptr %8, align 8
  %55 = extractvalue { ptr, i32 } %53, 1
  store i32 %55, ptr %9, align 4
  br label %94

56:                                               ; preds = %46
  %57 = load i64, ptr %16, align 8, !tbaa !23
  %58 = call noundef nonnull align 8 dereferenceable(64) ptr @_ZNSt6vectorIN7maliput3api18RoadPositionResultESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %6, i64 noundef %57) #6
  %59 = load i64, ptr %15, align 8, !tbaa !23
  %60 = call noundef nonnull align 8 dereferenceable(64) ptr @_ZNSt6vectorIN7maliput3api18RoadPositionResultESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %6, i64 noundef %59) #6
  %61 = invoke noundef zeroext i1 @_ZN7maliput13geometry_base29IsNewRoadPositionResultCloserERKNS_3api18RoadPositionResultES4_(ptr noundef nonnull align 8 dereferenceable(64) %58, ptr noundef nonnull align 8 dereferenceable(64) %60)
          to label %62 unwind label %72

62:                                               ; preds = %56
  br i1 %61, label %63, label %65

63:                                               ; preds = %62
  %64 = load i64, ptr %16, align 8, !tbaa !23
  br label %67

65:                                               ; preds = %62
  %66 = load i64, ptr %15, align 8, !tbaa !23
  br label %67

67:                                               ; preds = %65, %63
  %68 = phi i64 [ %64, %63 ], [ %66, %65 ]
  store i64 %68, ptr %15, align 8, !tbaa !23
  br label %69

69:                                               ; preds = %67
  %70 = load i64, ptr %16, align 8, !tbaa !23
  %71 = add i64 %70, 1
  store i64 %71, ptr %16, align 8, !tbaa !23
  br label %46, !llvm.loop !25

72:                                               ; preds = %56
  %73 = landingpad { ptr, i32 }
          cleanup
  %74 = extractvalue { ptr, i32 } %73, 0
  store ptr %74, ptr %8, align 8
  %75 = extractvalue { ptr, i32 } %73, 1
  store i32 %75, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #6
  br label %94

76:                                               ; preds = %51
  %77 = getelementptr inbounds %"struct.maliput::routing::PhasePositionResult", ptr %0, i32 0, i32 0
  %78 = load i64, ptr %15, align 8, !tbaa !23
  %79 = trunc i64 %78 to i32
  store i32 %79, ptr %77, align 8, !tbaa !27
  %80 = getelementptr inbounds %"struct.maliput::routing::PhasePositionResult", ptr %0, i32 0, i32 1
  %81 = load i64, ptr %15, align 8, !tbaa !23
  %82 = call noundef nonnull align 8 dereferenceable(64) ptr @_ZNSt6vectorIN7maliput3api18RoadPositionResultESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %6, i64 noundef %81) #6
  %83 = getelementptr inbounds %"struct.maliput::api::RoadPositionResult", ptr %82, i32 0, i32 0
  %84 = getelementptr inbounds %"struct.maliput::api::RoadPosition", ptr %83, i32 0, i32 1
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %80, ptr align 8 %84, i64 24, i1 false)
  %85 = getelementptr inbounds %"struct.maliput::routing::PhasePositionResult", ptr %0, i32 0, i32 2
  %86 = load i64, ptr %15, align 8, !tbaa !23
  %87 = call noundef nonnull align 8 dereferenceable(64) ptr @_ZNSt6vectorIN7maliput3api18RoadPositionResultESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %6, i64 noundef %86) #6
  %88 = getelementptr inbounds %"struct.maliput::api::RoadPositionResult", ptr %87, i32 0, i32 1
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %85, ptr align 8 %88, i64 24, i1 false)
  %89 = getelementptr inbounds %"struct.maliput::routing::PhasePositionResult", ptr %0, i32 0, i32 3
  %90 = load i64, ptr %15, align 8, !tbaa !23
  %91 = call noundef nonnull align 8 dereferenceable(64) ptr @_ZNSt6vectorIN7maliput3api18RoadPositionResultESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %6, i64 noundef %90) #6
  %92 = getelementptr inbounds %"struct.maliput::api::RoadPositionResult", ptr %91, i32 0, i32 2
  %93 = load double, ptr %92, align 8, !tbaa !34
  store double %93, ptr %89, align 8, !tbaa !37
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #6
  call void @_ZNSt6vectorIN7maliput3api18RoadPositionResultESaIS2_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %6) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr %6) #6
  ret void

94:                                               ; preds = %72, %52
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #6
  call void @_ZNSt6vectorIN7maliput3api18RoadPositionResultESaIS2_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %6) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr %6) #6
  br label %95

95:                                               ; preds = %94
  %96 = load ptr, ptr %8, align 8
  %97 = load i32, ptr %9, align 4
  %98 = insertvalue { ptr, i32 } poison, ptr %96, 0
  %99 = insertvalue { ptr, i32 } %98, i32 %97, 1
  resume { ptr, i32 } %99
}

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

; Function Attrs: mustprogress uwtable
declare hidden ptr @"_ZSt9transformIN9__gnu_cxx17__normal_iteratorIPKN7maliput3api10LaneSRangeESt6vectorIS4_SaIS4_EEEESt20back_insert_iteratorIS7_INS3_18RoadPositionResultESaISC_EEEZNKS2_7routing5Phase17FindPhasePositionERKNS3_16InertialPositionEE3$_0ET0_T_SN_SM_T1_"(ptr, ptr, ptr, ptr noundef byval(%class.anon.95) align 8) #3

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local ptr @_ZSt13back_inserterISt6vectorIN7maliput3api18RoadPositionResultESaIS3_EEESt20back_insert_iteratorIT_ERS7_(ptr noundef nonnull align 8 dereferenceable(24)) #4

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

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

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

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

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !6, i64 88}
!10 = !{!"_ZTSN7maliput7routing5PhaseE", !11, i64 0, !12, i64 8, !13, i64 16, !13, i64 40, !17, i64 64, !6, i64 88}
!11 = !{!"int", !7, i64 0}
!12 = !{!"double", !7, i64 0}
!13 = !{!"_ZTSSt6vectorIN7maliput3api12RoadPositionESaIS2_EE", !14, i64 0}
!14 = !{!"_ZTSSt12_Vector_baseIN7maliput3api12RoadPositionESaIS2_EE", !15, i64 0}
!15 = !{!"_ZTSNSt12_Vector_baseIN7maliput3api12RoadPositionESaIS2_EE12_Vector_implE", !16, i64 0}
!16 = !{!"_ZTSNSt12_Vector_baseIN7maliput3api12RoadPositionESaIS2_EE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!17 = !{!"_ZTSSt6vectorIN7maliput3api10LaneSRangeESaIS2_EE", !18, i64 0}
!18 = !{!"_ZTSSt12_Vector_baseIN7maliput3api10LaneSRangeESaIS2_EE", !19, i64 0}
!19 = !{!"_ZTSNSt12_Vector_baseIN7maliput3api10LaneSRangeESaIS2_EE12_Vector_implE", !20, i64 0}
!20 = !{!"_ZTSNSt12_Vector_baseIN7maliput3api10LaneSRangeESaIS2_EE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!21 = !{!22, !6, i64 0}
!22 = !{!"_ZTSZNK7maliput7routing5Phase17FindPhasePositionERKNS_3api16InertialPositionEE3$_0", !6, i64 0, !6, i64 8, !6, i64 16}
!23 = !{!24, !24, i64 0}
!24 = !{!"long", !7, i64 0}
!25 = distinct !{!25, !26}
!26 = !{!"llvm.loop.mustprogress"}
!27 = !{!28, !11, i64 0}
!28 = !{!"_ZTSN7maliput7routing19PhasePositionResultE", !11, i64 0, !29, i64 8, !33, i64 32, !12, i64 56}
!29 = !{!"_ZTSN7maliput3api12LanePositionE", !30, i64 0}
!30 = !{!"_ZTSN7maliput4math7Vector3E", !31, i64 0}
!31 = !{!"_ZTSN7maliput4math10VectorBaseILm3ENS0_7Vector3EEE", !32, i64 0}
!32 = !{!"_ZTSSt5arrayIdLm3EE", !7, i64 0}
!33 = !{!"_ZTSN7maliput3api16InertialPositionE", !30, i64 0}
!34 = !{!35, !12, i64 56}
!35 = !{!"_ZTSN7maliput3api18RoadPositionResultE", !36, i64 0, !33, i64 32, !12, i64 56}
!36 = !{!"_ZTSN7maliput3api12RoadPositionE", !6, i64 0, !29, i64 8}
!37 = !{!28, !12, i64 56}


; 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::routing::PhasePositionResult" = type { i32, %"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.90" = type { %"struct.std::_Vector_base.91" }
%"struct.std::_Vector_base.91" = 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.anon.95 = type { ptr, ptr, ptr }

; 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) #0

declare i32 @__gxx_personality_v0(...)

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

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

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZNK7maliput7routing5Phase17FindPhasePositionERKNS_3api16InertialPositionE(ptr dead_on_unwind noalias nocapture writable writeonly sret(%"struct.maliput::routing::PhasePositionResult") align 8 %0, ptr noundef nonnull align 8 dereferenceable(96) %1, ptr noundef nonnull align 8 dereferenceable(24) %2) local_unnamed_addr #3 align 2 personality ptr @__gxx_personality_v0 {
  %4 = alloca %"class.std::vector.90", align 8
  %5 = alloca %class.anon.95, align 8
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %4) #6
  call void @_ZNSt6vectorIN7maliput3api18RoadPositionResultESaIS2_EEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %4) #6
  %6 = getelementptr inbounds i8, ptr %1, i64 88
  %7 = load ptr, ptr %6, align 8, !tbaa !5
  %8 = call noundef ptr @_ZNK7maliput3api11RoadNetwork13road_geometryEv(ptr noundef nonnull align 8 dereferenceable(88) %7)
  %9 = getelementptr inbounds i8, ptr %1, i64 64
  %10 = call ptr @_ZNKSt6vectorIN7maliput3api10LaneSRangeESaIS2_EE6cbeginEv(ptr noundef nonnull align 8 dereferenceable(24) %9) #6
  %11 = call ptr @_ZNKSt6vectorIN7maliput3api10LaneSRangeESaIS2_EE4cendEv(ptr noundef nonnull align 8 dereferenceable(24) %9) #6
  %12 = invoke ptr @_ZSt13back_inserterISt6vectorIN7maliput3api18RoadPositionResultESaIS3_EEESt20back_insert_iteratorIT_ERS7_(ptr noundef nonnull align 8 dereferenceable(24) %4)
          to label %13 unwind label %31

13:                                               ; preds = %3
  store ptr %8, ptr %5, align 8, !tbaa !20
  %14 = getelementptr inbounds i8, ptr %5, i64 8
  store ptr %2, ptr %14, align 8, !tbaa !22
  %15 = getelementptr inbounds i8, ptr %5, i64 16
  %16 = getelementptr inbounds i8, ptr %1, i64 8
  store ptr %16, ptr %15, align 8, !tbaa !22
  %17 = invoke ptr @"_ZSt9transformIN9__gnu_cxx17__normal_iteratorIPKN7maliput3api10LaneSRangeESt6vectorIS4_SaIS4_EEEESt20back_insert_iteratorIS7_INS3_18RoadPositionResultESaISC_EEEZNKS2_7routing5Phase17FindPhasePositionERKNS3_16InertialPositionEE3$_0ET0_T_SN_SM_T1_"(ptr %10, ptr %11, ptr %12, ptr noundef nonnull byval(%class.anon.95) align 8 %5)
          to label %.preheader unwind label %31

.preheader:                                       ; preds = %13
  %18 = call noundef i64 @_ZNKSt6vectorIN7maliput3api10LaneSRangeESaIS2_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %9) #6
  %19 = icmp ugt i64 %18, 1
  br i1 %19, label %.lr.ph, label %._crit_edge

._crit_edge:                                      ; preds = %36, %.preheader
  %.017.lcssa = phi i64 [ 0, %.preheader ], [ %37, %36 ]
  %20 = trunc i64 %.017.lcssa to i32
  store i32 %20, ptr %0, align 8, !tbaa !23
  %21 = getelementptr inbounds i8, ptr %0, i64 8
  %22 = call noundef nonnull align 8 dereferenceable(64) ptr @_ZNSt6vectorIN7maliput3api18RoadPositionResultESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %4, i64 noundef %.017.lcssa) #6
  %23 = getelementptr inbounds i8, ptr %22, i64 8
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(24) %21, ptr noundef nonnull align 8 dereferenceable(24) %23, i64 24, i1 false)
  %24 = getelementptr inbounds i8, ptr %0, i64 32
  %25 = call noundef nonnull align 8 dereferenceable(64) ptr @_ZNSt6vectorIN7maliput3api18RoadPositionResultESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %4, i64 noundef %.017.lcssa) #6
  %26 = getelementptr inbounds i8, ptr %25, i64 32
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(24) %24, ptr noundef nonnull align 8 dereferenceable(24) %26, i64 24, i1 false)
  %27 = getelementptr inbounds i8, ptr %0, i64 56
  %28 = call noundef nonnull align 8 dereferenceable(64) ptr @_ZNSt6vectorIN7maliput3api18RoadPositionResultESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %4, i64 noundef %.017.lcssa) #6
  %29 = getelementptr inbounds i8, ptr %28, i64 56
  %30 = load double, ptr %29, align 8, !tbaa !30
  store double %30, ptr %27, align 8, !tbaa !33
  call void @_ZNSt6vectorIN7maliput3api18RoadPositionResultESaIS2_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %4) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %4) #6
  ret void

31:                                               ; preds = %13, %3
  %32 = landingpad { ptr, i32 }
          cleanup
  br label %43

.lr.ph:                                           ; preds = %.preheader, %36
  %.023 = phi i64 [ %38, %36 ], [ 1, %.preheader ]
  %.01722 = phi i64 [ %37, %36 ], [ 0, %.preheader ]
  %33 = call noundef nonnull align 8 dereferenceable(64) ptr @_ZNSt6vectorIN7maliput3api18RoadPositionResultESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %4, i64 noundef %.023) #6
  %34 = call noundef nonnull align 8 dereferenceable(64) ptr @_ZNSt6vectorIN7maliput3api18RoadPositionResultESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %4, i64 noundef %.01722) #6
  %35 = invoke noundef zeroext i1 @_ZN7maliput13geometry_base29IsNewRoadPositionResultCloserERKNS_3api18RoadPositionResultES4_(ptr noundef nonnull align 8 dereferenceable(64) %33, ptr noundef nonnull align 8 dereferenceable(64) %34)
          to label %36 unwind label %41

36:                                               ; preds = %.lr.ph
  %37 = select i1 %35, i64 %.023, i64 %.01722
  %38 = add nuw i64 %.023, 1
  %39 = call noundef i64 @_ZNKSt6vectorIN7maliput3api10LaneSRangeESaIS2_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %9) #6
  %40 = icmp ult i64 %38, %39
  br i1 %40, label %.lr.ph, label %._crit_edge, !llvm.loop !34

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

43:                                               ; preds = %41, %31
  %.pn = phi { ptr, i32 } [ %42, %41 ], [ %32, %31 ]
  call void @_ZNSt6vectorIN7maliput3api18RoadPositionResultESaIS2_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %4) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %4) #6
  resume { ptr, i32 } %.pn
}

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

; Function Attrs: mustprogress uwtable
declare hidden ptr @"_ZSt9transformIN9__gnu_cxx17__normal_iteratorIPKN7maliput3api10LaneSRangeESt6vectorIS4_SaIS4_EEEESt20back_insert_iteratorIS7_INS3_18RoadPositionResultESaISC_EEEZNKS2_7routing5Phase17FindPhasePositionERKNS3_16InertialPositionEE3$_0ET0_T_SN_SM_T1_"(ptr, ptr, ptr, ptr noundef byval(%class.anon.95) align 8) local_unnamed_addr #3

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local ptr @_ZSt13back_inserterISt6vectorIN7maliput3api18RoadPositionResultESaIS3_EEESt20back_insert_iteratorIT_ERS7_(ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #4

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

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

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

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

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !15, i64 88}
!6 = !{!"_ZTSN7maliput7routing5PhaseE", !7, i64 0, !10, i64 8, !11, i64 16, !11, i64 40, !16, i64 64, !15, i64 88}
!7 = !{!"int", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!"double", !8, i64 0}
!11 = !{!"_ZTSSt6vectorIN7maliput3api12RoadPositionESaIS2_EE", !12, i64 0}
!12 = !{!"_ZTSSt12_Vector_baseIN7maliput3api12RoadPositionESaIS2_EE", !13, i64 0}
!13 = !{!"_ZTSNSt12_Vector_baseIN7maliput3api12RoadPositionESaIS2_EE12_Vector_implE", !14, i64 0}
!14 = !{!"_ZTSNSt12_Vector_baseIN7maliput3api12RoadPositionESaIS2_EE17_Vector_impl_dataE", !15, i64 0, !15, i64 8, !15, i64 16}
!15 = !{!"any pointer", !8, i64 0}
!16 = !{!"_ZTSSt6vectorIN7maliput3api10LaneSRangeESaIS2_EE", !17, i64 0}
!17 = !{!"_ZTSSt12_Vector_baseIN7maliput3api10LaneSRangeESaIS2_EE", !18, i64 0}
!18 = !{!"_ZTSNSt12_Vector_baseIN7maliput3api10LaneSRangeESaIS2_EE12_Vector_implE", !19, i64 0}
!19 = !{!"_ZTSNSt12_Vector_baseIN7maliput3api10LaneSRangeESaIS2_EE17_Vector_impl_dataE", !15, i64 0, !15, i64 8, !15, i64 16}
!20 = !{!21, !15, i64 0}
!21 = !{!"_ZTSZNK7maliput7routing5Phase17FindPhasePositionERKNS_3api16InertialPositionEE3$_0", !15, i64 0, !15, i64 8, !15, i64 16}
!22 = !{!15, !15, i64 0}
!23 = !{!24, !7, i64 0}
!24 = !{!"_ZTSN7maliput7routing19PhasePositionResultE", !7, i64 0, !25, i64 8, !29, i64 32, !10, i64 56}
!25 = !{!"_ZTSN7maliput3api12LanePositionE", !26, i64 0}
!26 = !{!"_ZTSN7maliput4math7Vector3E", !27, i64 0}
!27 = !{!"_ZTSN7maliput4math10VectorBaseILm3ENS0_7Vector3EEE", !28, i64 0}
!28 = !{!"_ZTSSt5arrayIdLm3EE", !8, i64 0}
!29 = !{!"_ZTSN7maliput3api16InertialPositionE", !26, i64 0}
!30 = !{!31, !10, i64 56}
!31 = !{!"_ZTSN7maliput3api18RoadPositionResultE", !32, i64 0, !29, i64 32, !10, i64 56}
!32 = !{!"_ZTSN7maliput3api12RoadPositionE", !15, i64 0, !25, i64 8}
!33 = !{!24, !10, i64 56}
!34 = distinct !{!34, !35}
!35 = !{!"llvm.loop.mustprogress"}


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