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

; Unoptimized IR (clang -disable-llvm-passes):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%"class.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<maliput::routing::Route::LaneSRangeIndex>::_Storage", i8 }>
%"union.std::_Optional_payload_base<maliput::routing::Route::LaneSRangeIndex>::_Storage" = type { %"struct.maliput::routing::Route::LaneSRangeIndex" }
%"struct.maliput::routing::Route::LaneSRangeIndex" = type { i64, i64 }
%"class.__gnu_cxx::__normal_iterator.114" = type { ptr }
%class.anon.115 = type { ptr, %"class.maliput::api::LaneSRange" }
%"class.maliput::api::LaneSRange" = type { %"class.maliput::api::TypeSpecificIdentifier", %"class.maliput::api::SRange" }
%"class.maliput::api::TypeSpecificIdentifier" = type { %"class.std::__cxx11::basic_string" }
%"class.std::__cxx11::basic_string" = type { %"struct.std::__cxx11::basic_string<char>::_Alloc_hider", i64, %union.anon }
%"struct.std::__cxx11::basic_string<char>::_Alloc_hider" = type { ptr }
%union.anon = type { i64, [8 x i8] }
%"class.maliput::api::SRange" = type { double, double }
%"struct.std::nullopt_t" = type { i8 }
%"class.maliput::routing::Route" = type { %"class.std::vector", %"class.std::unordered_map", ptr }
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<maliput::routing::Phase, std::allocator<maliput::routing::Phase>>::_Vector_impl" }
%"struct.std::_Vector_base<maliput::routing::Phase, std::allocator<maliput::routing::Phase>>::_Vector_impl" = type { %"struct.std::_Vector_base<maliput::routing::Phase, std::allocator<maliput::routing::Phase>>::_Vector_impl_data" }
%"struct.std::_Vector_base<maliput::routing::Phase, std::allocator<maliput::routing::Phase>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::unordered_map" = type { %"class.std::_Hashtable" }
%"class.std::_Hashtable" = type { ptr, i64, %"struct.std::__detail::_Hash_node_base", i64, %"struct.std::__detail::_Prime_rehash_policy", ptr }
%"struct.std::__detail::_Hash_node_base" = type { ptr }
%"struct.std::__detail::_Prime_rehash_policy" = type { float, i64 }

@.str.1 = external hidden unnamed_addr constant [78 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [17 x i8], align 1
@__func__._ZNK7maliput7routing5Route23FindStraightPredecessorERKNS1_15LaneSRangeIndexE = external hidden unnamed_addr constant [24 x i8], align 1

; Function Attrs: noreturn
declare void @_ZN7maliput6common8internal5ThrowEPKcS3_S3_i(ptr noundef, ptr noundef, ptr noundef, i32 noundef) #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 nonnull align 8 dereferenceable(24) ptr @_ZNK7maliput7routing5Phase13lane_s_rangesEv(ptr noundef nonnull align 8 dereferenceable(96)) #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: 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) #3

; Function Attrs: mustprogress uwtable
define dso_local void @_ZNK7maliput7routing5Route23FindStraightPredecessorERKNS1_15LaneSRangeIndexE(ptr dead_on_unwind noalias writable sret(%"class.std::optional") align 8 %0, ptr noundef nonnull align 8 dereferenceable(88) %1, ptr noundef nonnull align 8 dereferenceable(16) %2) #4 align 2 personality ptr @__gxx_personality_v0 {
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca i64, align 8
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca %"class.__gnu_cxx::__normal_iterator.114", align 8
  %10 = alloca %"class.__gnu_cxx::__normal_iterator.114", align 8
  %11 = alloca %"class.__gnu_cxx::__normal_iterator.114", align 8
  %12 = alloca %class.anon.115, align 8
  %13 = alloca ptr, align 8
  %14 = alloca i32, align 4
  %15 = alloca %"class.__gnu_cxx::__normal_iterator.114", align 8
  %16 = alloca %"struct.std::nullopt_t", align 1
  %17 = alloca i32, align 4
  %18 = alloca i64, align 8
  %19 = alloca %"class.__gnu_cxx::__normal_iterator.114", align 8
  %20 = alloca %"class.__gnu_cxx::__normal_iterator.114", align 8
  %21 = alloca %"struct.maliput::routing::Route::LaneSRangeIndex", align 8
  store ptr %1, ptr %4, align 8, !tbaa !5
  store ptr %2, ptr %5, align 8, !tbaa !5
  %22 = load ptr, ptr %4, align 8
  br label %23

23:                                               ; preds = %3
  %24 = load ptr, ptr %5, align 8, !tbaa !5
  %25 = getelementptr inbounds %"struct.maliput::routing::Route::LaneSRangeIndex", ptr %24, i32 0, i32 0
  %26 = load i64, ptr %25, align 8, !tbaa !9
  %27 = icmp ugt i64 %26, 0
  br i1 %27, label %29, label %28

28:                                               ; preds = %23
  call void @_ZN7maliput6common8internal5ThrowEPKcS3_S3_i(ptr noundef @.str.10, ptr noundef @__func__._ZNK7maliput7routing5Route23FindStraightPredecessorERKNS1_15LaneSRangeIndexE, ptr noundef @.str.1, i32 noundef 320) #7
  unreachable

29:                                               ; preds = %23
  br label %30

30:                                               ; preds = %29
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #8
  %31 = load ptr, ptr %5, align 8, !tbaa !5
  %32 = getelementptr inbounds %"struct.maliput::routing::Route::LaneSRangeIndex", ptr %31, i32 0, i32 0
  %33 = load i64, ptr %32, align 8, !tbaa !9
  %34 = sub i64 %33, 1
  store i64 %34, ptr %6, align 8, !tbaa !12
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #8
  %35 = getelementptr inbounds %"class.maliput::routing::Route", ptr %22, i32 0, i32 0
  %36 = load i64, ptr %6, align 8, !tbaa !12
  %37 = call noundef nonnull align 8 dereferenceable(96) ptr @_ZNKSt6vectorIN7maliput7routing5PhaseESaIS2_EE2atEm(ptr noundef nonnull align 8 dereferenceable(24) %35, i64 noundef %36)
  store ptr %37, ptr %7, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #8
  %38 = load ptr, ptr %5, align 8, !tbaa !5
  %39 = getelementptr inbounds %"struct.maliput::routing::Route::LaneSRangeIndex", ptr %38, i32 0, i32 0
  %40 = load i64, ptr %39, align 8, !tbaa !9
  %41 = trunc i64 %40 to i32
  %42 = load ptr, ptr %5, align 8, !tbaa !5
  %43 = getelementptr inbounds %"struct.maliput::routing::Route::LaneSRangeIndex", ptr %42, i32 0, i32 1
  %44 = load i64, ptr %43, align 8, !tbaa !13
  %45 = trunc i64 %44 to i32
  %46 = call noundef nonnull align 8 dereferenceable(48) ptr @_ZNK7maliput7routing5Route13GetLaneSRangeEii(ptr noundef nonnull align 8 dereferenceable(88) %22, i32 noundef %41, i32 noundef %45)
  store ptr %46, ptr %8, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #8
  %47 = load ptr, ptr %7, align 8, !tbaa !5
  %48 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNK7maliput7routing5Phase13lane_s_rangesEv(ptr noundef nonnull align 8 dereferenceable(96) %47)
  %49 = call ptr @_ZNKSt6vectorIN7maliput3api10LaneSRangeESaIS2_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %48) #8
  %50 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator.114", ptr %10, i32 0, i32 0
  store ptr %49, ptr %50, align 8
  %51 = load ptr, ptr %7, align 8, !tbaa !5
  %52 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNK7maliput7routing5Phase13lane_s_rangesEv(ptr noundef nonnull align 8 dereferenceable(96) %51)
  %53 = call ptr @_ZNKSt6vectorIN7maliput3api10LaneSRangeESaIS2_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %52) #8
  %54 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator.114", ptr %11, i32 0, i32 0
  store ptr %53, ptr %54, align 8
  %55 = getelementptr inbounds %class.anon.115, ptr %12, i32 0, i32 0
  store ptr %22, ptr %55, align 8, !tbaa !14
  %56 = getelementptr inbounds %class.anon.115, ptr %12, i32 0, i32 1
  %57 = load ptr, ptr %8, align 8, !tbaa !5
  call void @_ZN7maliput3api10LaneSRangeC2ERKS1_(ptr noundef nonnull align 8 dereferenceable(48) %56, ptr noundef nonnull align 8 dereferenceable(48) %57)
  %58 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator.114", ptr %10, i32 0, i32 0
  %59 = load ptr, ptr %58, align 8
  %60 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator.114", ptr %11, i32 0, i32 0
  %61 = load ptr, ptr %60, align 8
  %62 = invoke ptr @"_ZSt7find_ifIN9__gnu_cxx17__normal_iteratorIPKN7maliput3api10LaneSRangeESt6vectorIS4_SaIS4_EEEEZNKS2_7routing5Route23FindStraightPredecessorERKNSC_15LaneSRangeIndexEE3$_0ET_SH_SH_T0_"(ptr %59, ptr %61, ptr noundef %12)
          to label %63 unwind label %71

63:                                               ; preds = %30
  %64 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator.114", ptr %9, i32 0, i32 0
  store ptr %62, ptr %64, align 8
  call void @"_ZZNK7maliput7routing5Route23FindStraightPredecessorERKNS1_15LaneSRangeIndexEEN3$_0D2Ev"(ptr noundef nonnull align 8 dereferenceable(56) %12) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #8
  %65 = load ptr, ptr %7, align 8, !tbaa !5
  %66 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNK7maliput7routing5Phase13lane_s_rangesEv(ptr noundef nonnull align 8 dereferenceable(96) %65)
  %67 = call ptr @_ZNKSt6vectorIN7maliput3api10LaneSRangeESaIS2_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %66) #8
  %68 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator.114", ptr %15, i32 0, i32 0
  store ptr %67, ptr %68, align 8
  %69 = call noundef zeroext i1 @_ZN9__gnu_cxxeqIPKN7maliput3api10LaneSRangeESt6vectorIS3_SaIS3_EEEEbRKNS_17__normal_iteratorIT_T0_EESE_(ptr noundef nonnull align 8 dereferenceable(8) %9, ptr noundef nonnull align 8 dereferenceable(8) %15) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #8
  br i1 %69, label %70, label %75

70:                                               ; preds = %63
  call void @_ZNSt8optionalIN7maliput7routing5Route15LaneSRangeIndexEEC2ESt9nullopt_t(ptr noundef nonnull align 8 dereferenceable(24) %0) #8
  store i32 1, ptr %17, align 4
  br label %89

71:                                               ; preds = %30
  %72 = landingpad { ptr, i32 }
          cleanup
  %73 = extractvalue { ptr, i32 } %72, 0
  store ptr %73, ptr %13, align 8
  %74 = extractvalue { ptr, i32 } %72, 1
  store i32 %74, ptr %14, align 4
  call void @"_ZZNK7maliput7routing5Route23FindStraightPredecessorERKNS1_15LaneSRangeIndexEEN3$_0D2Ev"(ptr noundef nonnull align 8 dereferenceable(56) %12) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #8
  br label %90

75:                                               ; preds = %63
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #8
  %76 = load ptr, ptr %7, align 8, !tbaa !5
  %77 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNK7maliput7routing5Phase13lane_s_rangesEv(ptr noundef nonnull align 8 dereferenceable(96) %76)
  %78 = call ptr @_ZNKSt6vectorIN7maliput3api10LaneSRangeESaIS2_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %77) #8
  %79 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator.114", ptr %19, i32 0, i32 0
  store ptr %78, ptr %79, align 8
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %20, ptr align 8 %9, i64 8, i1 false), !tbaa.struct !22
  %80 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator.114", ptr %19, i32 0, i32 0
  %81 = load ptr, ptr %80, align 8
  %82 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator.114", ptr %20, i32 0, i32 0
  %83 = load ptr, ptr %82, align 8
  %84 = call noundef i64 @_ZSt8distanceIN9__gnu_cxx17__normal_iteratorIPKN7maliput3api10LaneSRangeESt6vectorIS4_SaIS4_EEEEENSt15iterator_traitsIT_E15difference_typeESC_SC_(ptr %81, ptr %83)
  store i64 %84, ptr %18, align 8, !tbaa !12
  call void @llvm.lifetime.start.p0(i64 16, ptr %21) #8
  %85 = getelementptr inbounds %"struct.maliput::routing::Route::LaneSRangeIndex", ptr %21, i32 0, i32 0
  %86 = load i64, ptr %6, align 8, !tbaa !12
  store i64 %86, ptr %85, align 8, !tbaa !9
  %87 = getelementptr inbounds %"struct.maliput::routing::Route::LaneSRangeIndex", ptr %21, i32 0, i32 1
  %88 = load i64, ptr %18, align 8, !tbaa !12
  store i64 %88, ptr %87, align 8, !tbaa !13
  call void @_ZNSt8optionalIN7maliput7routing5Route15LaneSRangeIndexEEC2IS3_TnNSt9enable_ifIX7__and_vISt6__not_ISt7is_sameIS4_NSt9remove_cvINSt16remove_referenceIT_E4typeEE4typeEEES7_IS8_ISt10in_place_tSF_EESt16is_constructibleIS3_JSB_EESt14is_convertibleISB_S3_EEEbE4typeELb1EEEOSB_(ptr noundef nonnull align 8 dereferenceable(24) %0, ptr noundef nonnull align 8 dereferenceable(16) %21) #8
  call void @llvm.lifetime.end.p0(i64 16, ptr %21) #8
  store i32 1, ptr %17, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #8
  br label %89

89:                                               ; preds = %75, %70
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #8
  ret void

90:                                               ; preds = %71
  %91 = load ptr, ptr %13, align 8
  %92 = load i32, ptr %14, align 4
  %93 = insertvalue { ptr, i32 } poison, ptr %91, 0
  %94 = insertvalue { ptr, i32 } %93, i32 %92, 1
  resume { ptr, i32 } %94
}

; Function Attrs: mustprogress uwtable
declare dso_local noundef nonnull align 8 dereferenceable(48) ptr @_ZNK7maliput7routing5Route13GetLaneSRangeEii(ptr noundef nonnull align 8 dereferenceable(88), i32 noundef, i32 noundef) #4 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN7maliput3api10LaneSRangeC2ERKS1_(ptr noundef nonnull align 8 dereferenceable(48), ptr noundef nonnull align 8 dereferenceable(48)) unnamed_addr #4 align 2

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare hidden ptr @"_ZSt7find_ifIN9__gnu_cxx17__normal_iteratorIPKN7maliput3api10LaneSRangeESt6vectorIS4_SaIS4_EEEEZNKS2_7routing5Route23FindStraightPredecessorERKNSC_15LaneSRangeIndexEE3$_0ET_SH_SH_T0_"(ptr, ptr, ptr noundef) #5

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare hidden void @"_ZZNK7maliput7routing5Route23FindStraightPredecessorERKNS1_15LaneSRangeIndexEEN3$_0D2Ev"(ptr noundef nonnull align 8 dereferenceable(56)) unnamed_addr #6 align 2

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef i64 @_ZSt8distanceIN9__gnu_cxx17__normal_iteratorIPKN7maliput3api10LaneSRangeESt6vectorIS4_SaIS4_EEEEENSt15iterator_traitsIT_E15difference_typeESC_SC_(ptr, ptr) #5

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

attributes #0 = { 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 #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 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #4 = { 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 = { inlinehint mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { inlinehint mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #7 = { noreturn }
attributes #8 = { 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, !11, i64 0}
!10 = !{!"_ZTSN7maliput7routing5Route15LaneSRangeIndexE", !11, i64 0, !11, i64 8}
!11 = !{!"long", !7, i64 0}
!12 = !{!11, !11, i64 0}
!13 = !{!10, !11, i64 8}
!14 = !{!15, !6, i64 0}
!15 = !{!"_ZTSZNK7maliput7routing5Route23FindStraightPredecessorERKNS1_15LaneSRangeIndexEE3$_0", !6, i64 0, !16, i64 8}
!16 = !{!"_ZTSN7maliput3api10LaneSRangeE", !17, i64 0, !20, i64 32}
!17 = !{!"_ZTSN7maliput3api22TypeSpecificIdentifierINS0_4LaneEEE", !18, i64 0}
!18 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE", !19, i64 0, !11, i64 8, !7, i64 16}
!19 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_Alloc_hiderE", !6, i64 0}
!20 = !{!"_ZTSN7maliput3api6SRangeE", !21, i64 0, !21, i64 8}
!21 = !{!"double", !7, i64 0}
!22 = !{i64 0, i64 8, !5}


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

%"class.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<maliput::routing::Route::LaneSRangeIndex>::_Storage", i8 }>
%"union.std::_Optional_payload_base<maliput::routing::Route::LaneSRangeIndex>::_Storage" = type { %"struct.maliput::routing::Route::LaneSRangeIndex" }
%"struct.maliput::routing::Route::LaneSRangeIndex" = type { i64, i64 }
%"class.__gnu_cxx::__normal_iterator.114" = type { ptr }
%class.anon.115 = type { ptr, %"class.maliput::api::LaneSRange" }
%"class.maliput::api::LaneSRange" = type { %"class.maliput::api::TypeSpecificIdentifier", %"class.maliput::api::SRange" }
%"class.maliput::api::TypeSpecificIdentifier" = type { %"class.std::__cxx11::basic_string" }
%"class.std::__cxx11::basic_string" = type { %"struct.std::__cxx11::basic_string<char>::_Alloc_hider", i64, %union.anon }
%"struct.std::__cxx11::basic_string<char>::_Alloc_hider" = type { ptr }
%union.anon = type { i64, [8 x i8] }
%"class.maliput::api::SRange" = type { double, double }

@.str.1 = external hidden unnamed_addr constant [78 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [17 x i8], align 1
@__func__._ZNK7maliput7routing5Route23FindStraightPredecessorERKNS1_15LaneSRangeIndexE = external hidden unnamed_addr constant [24 x i8], align 1

; Function Attrs: noreturn
declare void @_ZN7maliput6common8internal5ThrowEPKcS3_S3_i(ptr noundef, ptr noundef, ptr noundef, i32 noundef) local_unnamed_addr #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 nonnull align 8 dereferenceable(24) ptr @_ZNK7maliput7routing5Phase13lane_s_rangesEv(ptr noundef nonnull align 8 dereferenceable(96)) 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 uwtable
define dso_local void @_ZNK7maliput7routing5Route23FindStraightPredecessorERKNS1_15LaneSRangeIndexE(ptr dead_on_unwind noalias writable sret(%"class.std::optional") align 8 %0, ptr noundef nonnull align 8 dereferenceable(88) %1, ptr nocapture noundef nonnull readonly align 8 dereferenceable(16) %2) local_unnamed_addr #3 align 2 personality ptr @__gxx_personality_v0 {
  %4 = alloca %"class.__gnu_cxx::__normal_iterator.114", align 8
  %5 = alloca %class.anon.115, align 8
  %6 = alloca %"class.__gnu_cxx::__normal_iterator.114", align 8
  %7 = alloca %"struct.maliput::routing::Route::LaneSRangeIndex", align 8
  %8 = load i64, ptr %2, align 8, !tbaa !5
  %.not = icmp eq i64 %8, 0
  br i1 %.not, label %9, label %10

9:                                                ; preds = %3
  tail call void @_ZN7maliput6common8internal5ThrowEPKcS3_S3_i(ptr noundef nonnull @.str.10, ptr noundef nonnull @__func__._ZNK7maliput7routing5Route23FindStraightPredecessorERKNS1_15LaneSRangeIndexE, ptr noundef nonnull @.str.1, i32 noundef 320) #6
  unreachable

10:                                               ; preds = %3
  %11 = add i64 %8, -1
  %12 = tail call noundef nonnull align 8 dereferenceable(96) ptr @_ZNKSt6vectorIN7maliput7routing5PhaseESaIS2_EE2atEm(ptr noundef nonnull align 8 dereferenceable(24) %1, i64 noundef %11)
  %13 = load i64, ptr %2, align 8, !tbaa !5
  %14 = trunc i64 %13 to i32
  %15 = getelementptr inbounds i8, ptr %2, i64 8
  %16 = load i64, ptr %15, align 8, !tbaa !10
  %17 = trunc i64 %16 to i32
  %18 = tail call noundef nonnull align 8 dereferenceable(48) ptr @_ZNK7maliput7routing5Route13GetLaneSRangeEii(ptr noundef nonnull align 8 dereferenceable(88) %1, i32 noundef %14, i32 noundef %17)
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #7
  %19 = tail call noundef nonnull align 8 dereferenceable(24) ptr @_ZNK7maliput7routing5Phase13lane_s_rangesEv(ptr noundef nonnull align 8 dereferenceable(96) %12)
  %20 = tail call ptr @_ZNKSt6vectorIN7maliput3api10LaneSRangeESaIS2_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %19) #7
  %21 = tail call noundef nonnull align 8 dereferenceable(24) ptr @_ZNK7maliput7routing5Phase13lane_s_rangesEv(ptr noundef nonnull align 8 dereferenceable(96) %12)
  %22 = tail call ptr @_ZNKSt6vectorIN7maliput3api10LaneSRangeESaIS2_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %21) #7
  store ptr %1, ptr %5, align 8, !tbaa !11
  %23 = getelementptr inbounds i8, ptr %5, i64 8
  call void @_ZN7maliput3api10LaneSRangeC2ERKS1_(ptr noundef nonnull align 8 dereferenceable(48) %23, ptr noundef nonnull align 8 dereferenceable(48) %18)
  %24 = invoke ptr @"_ZSt7find_ifIN9__gnu_cxx17__normal_iteratorIPKN7maliput3api10LaneSRangeESt6vectorIS4_SaIS4_EEEEZNKS2_7routing5Route23FindStraightPredecessorERKNSC_15LaneSRangeIndexEE3$_0ET_SH_SH_T0_"(ptr %20, ptr %22, ptr noundef nonnull %5)
          to label %25 unwind label %30

25:                                               ; preds = %10
  store ptr %24, ptr %4, align 8
  call void @"_ZZNK7maliput7routing5Route23FindStraightPredecessorERKNS1_15LaneSRangeIndexEEN3$_0D2Ev"(ptr noundef nonnull align 8 dereferenceable(56) %5) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #7
  %26 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNK7maliput7routing5Phase13lane_s_rangesEv(ptr noundef nonnull align 8 dereferenceable(96) %12)
  %27 = call ptr @_ZNKSt6vectorIN7maliput3api10LaneSRangeESaIS2_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %26) #7
  store ptr %27, ptr %6, align 8
  %28 = call noundef zeroext i1 @_ZN9__gnu_cxxeqIPKN7maliput3api10LaneSRangeESt6vectorIS3_SaIS3_EEEEbRKNS_17__normal_iteratorIT_T0_EESE_(ptr noundef nonnull align 8 dereferenceable(8) %4, ptr noundef nonnull align 8 dereferenceable(8) %6) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #7
  br i1 %28, label %29, label %32

29:                                               ; preds = %25
  call void @_ZNSt8optionalIN7maliput7routing5Route15LaneSRangeIndexEEC2ESt9nullopt_t(ptr noundef nonnull align 8 dereferenceable(24) %0) #7
  br label %37

30:                                               ; preds = %10
  %31 = landingpad { ptr, i32 }
          cleanup
  call void @"_ZZNK7maliput7routing5Route23FindStraightPredecessorERKNS1_15LaneSRangeIndexEEN3$_0D2Ev"(ptr noundef nonnull align 8 dereferenceable(56) %5) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #7
  resume { ptr, i32 } %31

32:                                               ; preds = %25
  %33 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNK7maliput7routing5Phase13lane_s_rangesEv(ptr noundef nonnull align 8 dereferenceable(96) %12)
  %34 = call ptr @_ZNKSt6vectorIN7maliput3api10LaneSRangeESaIS2_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %33) #7
  %.sroa.0.0.copyload = load ptr, ptr %4, align 8, !tbaa !20
  %35 = call noundef i64 @_ZSt8distanceIN9__gnu_cxx17__normal_iteratorIPKN7maliput3api10LaneSRangeESt6vectorIS4_SaIS4_EEEEENSt15iterator_traitsIT_E15difference_typeESC_SC_(ptr %34, ptr %.sroa.0.0.copyload)
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %7) #7
  store i64 %11, ptr %7, align 8, !tbaa !5
  %36 = getelementptr inbounds i8, ptr %7, i64 8
  store i64 %35, ptr %36, align 8, !tbaa !10
  call void @_ZNSt8optionalIN7maliput7routing5Route15LaneSRangeIndexEEC2IS3_TnNSt9enable_ifIX7__and_vISt6__not_ISt7is_sameIS4_NSt9remove_cvINSt16remove_referenceIT_E4typeEE4typeEEES7_IS8_ISt10in_place_tSF_EESt16is_constructibleIS3_JSB_EESt14is_convertibleISB_S3_EEEbE4typeELb1EEEOSB_(ptr noundef nonnull align 8 dereferenceable(24) %0, ptr noundef nonnull align 8 dereferenceable(16) %7) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %7) #7
  br label %37

37:                                               ; preds = %32, %29
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #7
  ret void
}

; Function Attrs: mustprogress uwtable
declare dso_local noundef nonnull align 8 dereferenceable(48) ptr @_ZNK7maliput7routing5Route13GetLaneSRangeEii(ptr noundef nonnull align 8 dereferenceable(88), i32 noundef, i32 noundef) local_unnamed_addr #3 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN7maliput3api10LaneSRangeC2ERKS1_(ptr noundef nonnull align 8 dereferenceable(48), ptr noundef nonnull align 8 dereferenceable(48)) unnamed_addr #3 align 2

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare hidden ptr @"_ZSt7find_ifIN9__gnu_cxx17__normal_iteratorIPKN7maliput3api10LaneSRangeESt6vectorIS4_SaIS4_EEEEZNKS2_7routing5Route23FindStraightPredecessorERKNSC_15LaneSRangeIndexEE3$_0ET_SH_SH_T0_"(ptr, ptr, ptr noundef) local_unnamed_addr #4

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare hidden void @"_ZZNK7maliput7routing5Route23FindStraightPredecessorERKNS1_15LaneSRangeIndexEEN3$_0D2Ev"(ptr noundef nonnull align 8 dereferenceable(56)) unnamed_addr #5 align 2

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef i64 @_ZSt8distanceIN9__gnu_cxx17__normal_iteratorIPKN7maliput3api10LaneSRangeESt6vectorIS4_SaIS4_EEEEENSt15iterator_traitsIT_E15difference_typeESC_SC_(ptr, ptr) local_unnamed_addr #4

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

attributes #0 = { 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 #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 = { inlinehint mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { noreturn }
attributes #7 = { nounwind }

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !7, i64 0}
!6 = !{!"_ZTSN7maliput7routing5Route15LaneSRangeIndexE", !7, i64 0, !7, i64 8}
!7 = !{!"long", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!6, !7, i64 8}
!11 = !{!12, !13, i64 0}
!12 = !{!"_ZTSZNK7maliput7routing5Route23FindStraightPredecessorERKNS1_15LaneSRangeIndexEE3$_0", !13, i64 0, !14, i64 8}
!13 = !{!"any pointer", !8, i64 0}
!14 = !{!"_ZTSN7maliput3api10LaneSRangeE", !15, i64 0, !18, i64 32}
!15 = !{!"_ZTSN7maliput3api22TypeSpecificIdentifierINS0_4LaneEEE", !16, i64 0}
!16 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE", !17, i64 0, !7, i64 8, !8, i64 16}
!17 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_Alloc_hiderE", !13, i64 0}
!18 = !{!"_ZTSN7maliput3api6SRangeE", !19, i64 0, !19, i64 8}
!19 = !{!"double", !8, i64 0}
!20 = !{!13, !13, i64 0}


; Effective O3 passes: EarlyCSEPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,PostOrderFunctionAttrsPass,SROAPass,SimplifyCFGPass,TailCallElimPass