; LLVM IR from maliput/maliput :: src/maliput/api/rules (compare)

; 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::common::ComparisonResult.2" = type { %"class.std::optional" }
%"class.std::optional" = type { %"struct.std::_Optional_base" }
%"struct.std::_Optional_base" = type { %"struct.std::_Optional_payload" }
%"struct.std::_Optional_payload" = type { %"struct.std::_Optional_payload.base", [7 x i8] }
%"struct.std::_Optional_payload.base" = type { %"struct.std::_Optional_payload_base.base" }
%"struct.std::_Optional_payload_base.base" = type <{ %"union.std::_Optional_payload_base<std::__cxx11::basic_string<char>>::_Storage", i8 }>
%"union.std::_Optional_payload_base<std::__cxx11::basic_string<char>>::_Storage" = 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] }
%"struct.maliput::common::ComparisonResult.145" = type { %"class.std::optional" }
%"class.maliput::common::ComparisonResultCollector" = type { i32, i32, %"class.std::__cxx11::basic_string" }
%"struct.maliput::common::ComparisonResult.151" = type { %"class.std::optional" }

@.str = external hidden unnamed_addr constant [82 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [57 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [9 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [9 x i8], align 1
@.str.49 = external hidden unnamed_addr constant [48 x i8], align 1
@.str.50 = external hidden unnamed_addr constant [8 x i8], align 1
@.str.51 = external hidden unnamed_addr constant [8 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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN7maliput6common25ComparisonResultCollector9AddResultImEEvPKciS4_NS0_16ComparisonResultIT_EE(ptr noundef nonnull align 8 dereferenceable(40), ptr noundef, i32 noundef, ptr noundef, ptr noundef) #2 align 2

declare void @_ZN7maliput3api7IsEqualEPKcS2_mm(ptr dead_on_unwind writable sret(%"struct.maliput::common::ComparisonResult.2") align 8, ptr noundef, ptr noundef, i64 noundef, i64 noundef) #3

declare i32 @__gxx_personality_v0(...)

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNK7maliput6common25ComparisonResultCollector6resultB5cxx11Ev(ptr dead_on_unwind noalias writable sret(%"class.std::optional") align 8, ptr noundef nonnull align 8 dereferenceable(40)) #2 align 2

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

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN7maliput3api5rules7IsEqualERKSt6vectorINS0_22TypeSpecificIdentifierINS1_14RightOfWayRuleEEESaIS5_EES9_(ptr dead_on_unwind noalias writable sret(%"struct.maliput::common::ComparisonResult.145") align 8 %0, ptr noundef nonnull align 8 dereferenceable(24) %1, ptr noundef nonnull align 8 dereferenceable(24) %2) #2 personality ptr @__gxx_personality_v0 {
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca %"class.maliput::common::ComparisonResultCollector", align 8
  %8 = alloca %"struct.maliput::common::ComparisonResult.2", align 8
  %9 = alloca ptr, align 8
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca i64, align 8
  %13 = alloca i64, align 8
  %14 = alloca i32, align 4
  %15 = alloca %"struct.maliput::common::ComparisonResult.151", align 8
  store ptr %0, ptr %4, align 8
  store ptr %1, ptr %5, align 8, !tbaa !5
  store ptr %2, ptr %6, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 40, ptr %7) #5
  call void @_ZN7maliput6common25ComparisonResultCollectorC2Ev(ptr noundef nonnull align 8 dereferenceable(40) %7) #5
  %16 = load ptr, ptr %5, align 8, !tbaa !5
  %17 = call noundef i64 @_ZNKSt6vectorIN7maliput3api22TypeSpecificIdentifierINS1_5rules14RightOfWayRuleEEESaIS5_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %16) #5
  %18 = load ptr, ptr %6, align 8, !tbaa !5
  %19 = call noundef i64 @_ZNKSt6vectorIN7maliput3api22TypeSpecificIdentifierINS1_5rules14RightOfWayRuleEEESaIS5_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %18) #5
  invoke void @_ZN7maliput3api7IsEqualEPKcS2_mm(ptr dead_on_unwind writable sret(%"struct.maliput::common::ComparisonResult.2") align 8 %8, ptr noundef @.str.2, ptr noundef @.str.3, i64 noundef %17, i64 noundef %19)
          to label %20 unwind label %35

20:                                               ; preds = %3
  invoke void @_ZN7maliput6common25ComparisonResultCollector9AddResultImEEvPKciS4_NS0_16ComparisonResultIT_EE(ptr noundef nonnull align 8 dereferenceable(40) %7, ptr noundef @.str, i32 noundef 235, ptr noundef @.str.1, ptr noundef %8)
          to label %21 unwind label %39

21:                                               ; preds = %20
  call void @_ZN7maliput6common16ComparisonResultImED2Ev(ptr noundef nonnull align 8 dereferenceable(40) %8) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #5
  %22 = load ptr, ptr %5, align 8, !tbaa !5
  %23 = call noundef i64 @_ZNKSt6vectorIN7maliput3api22TypeSpecificIdentifierINS1_5rules14RightOfWayRuleEEESaIS5_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %22) #5
  store i64 %23, ptr %12, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #5
  %24 = load ptr, ptr %6, align 8, !tbaa !5
  %25 = call noundef i64 @_ZNKSt6vectorIN7maliput3api22TypeSpecificIdentifierINS1_5rules14RightOfWayRuleEEESaIS5_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %24) #5
  store i64 %25, ptr %13, align 8, !tbaa !9
  %26 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minImERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %12, ptr noundef nonnull align 8 dereferenceable(8) %13)
          to label %27 unwind label %43

27:                                               ; preds = %21
  %28 = load i64, ptr %26, align 8, !tbaa !9
  %29 = trunc i64 %28 to i32
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #5
  store i32 %29, ptr %11, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #5
  store i32 0, ptr %14, align 4, !tbaa !11
  br label %30

30:                                               ; preds = %60, %27
  %31 = load i32, ptr %14, align 4, !tbaa !11
  %32 = load i32, ptr %11, align 4, !tbaa !11
  %33 = icmp slt i32 %31, %32
  br i1 %33, label %47, label %34

34:                                               ; preds = %30
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #5
  br label %72

35:                                               ; preds = %3
  %36 = landingpad { ptr, i32 }
          cleanup
  %37 = extractvalue { ptr, i32 } %36, 0
  store ptr %37, ptr %9, align 8
  %38 = extractvalue { ptr, i32 } %36, 1
  store i32 %38, ptr %10, align 4
  br label %80

39:                                               ; preds = %20
  %40 = landingpad { ptr, i32 }
          cleanup
  %41 = extractvalue { ptr, i32 } %40, 0
  store ptr %41, ptr %9, align 8
  %42 = extractvalue { ptr, i32 } %40, 1
  store i32 %42, ptr %10, align 4
  call void @_ZN7maliput6common16ComparisonResultImED2Ev(ptr noundef nonnull align 8 dereferenceable(40) %8) #5
  br label %80

43:                                               ; preds = %21
  %44 = landingpad { ptr, i32 }
          cleanup
  %45 = extractvalue { ptr, i32 } %44, 0
  store ptr %45, ptr %9, align 8
  %46 = extractvalue { ptr, i32 } %44, 1
  store i32 %46, ptr %10, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #5
  br label %79

47:                                               ; preds = %30
  %48 = load ptr, ptr %5, align 8, !tbaa !5
  %49 = load i32, ptr %14, align 4, !tbaa !11
  %50 = sext i32 %49 to i64
  %51 = invoke noundef nonnull align 8 dereferenceable(32) ptr @_ZNKSt6vectorIN7maliput3api22TypeSpecificIdentifierINS1_5rules14RightOfWayRuleEEESaIS5_EE2atEm(ptr noundef nonnull align 8 dereferenceable(24) %48, i64 noundef %50)
          to label %52 unwind label %63

52:                                               ; preds = %47
  %53 = load ptr, ptr %6, align 8, !tbaa !5
  %54 = load i32, ptr %14, align 4, !tbaa !11
  %55 = sext i32 %54 to i64
  %56 = invoke noundef nonnull align 8 dereferenceable(32) ptr @_ZNKSt6vectorIN7maliput3api22TypeSpecificIdentifierINS1_5rules14RightOfWayRuleEEESaIS5_EE2atEm(ptr noundef nonnull align 8 dereferenceable(24) %53, i64 noundef %55)
          to label %57 unwind label %63

57:                                               ; preds = %52
  invoke void @_ZN7maliput3api7IsEqualINS0_5rules14RightOfWayRuleEEENS_6common16ComparisonResultINS0_22TypeSpecificIdentifierIT_EEEEPKcSB_RKS8_SD_(ptr dead_on_unwind writable sret(%"struct.maliput::common::ComparisonResult.151") align 8 %15, ptr noundef @.str.50, ptr noundef @.str.51, ptr noundef nonnull align 8 dereferenceable(32) %51, ptr noundef nonnull align 8 dereferenceable(32) %56)
          to label %58 unwind label %63

58:                                               ; preds = %57
  invoke void @_ZN7maliput6common25ComparisonResultCollector9AddResultINS_3api22TypeSpecificIdentifierINS3_5rules14RightOfWayRuleEEEEEvPKciS9_NS0_16ComparisonResultIT_EE(ptr noundef nonnull align 8 dereferenceable(40) %7, ptr noundef @.str, i32 noundef 238, ptr noundef @.str.49, ptr noundef %15)
          to label %59 unwind label %67

59:                                               ; preds = %58
  call void @_ZN7maliput6common16ComparisonResultINS_3api22TypeSpecificIdentifierINS2_5rules14RightOfWayRuleEEEED2Ev(ptr noundef nonnull align 8 dereferenceable(40) %15) #5
  br label %60

60:                                               ; preds = %59
  %61 = load i32, ptr %14, align 4, !tbaa !11
  %62 = add nsw i32 %61, 1
  store i32 %62, ptr %14, align 4, !tbaa !11
  br label %30, !llvm.loop !13

63:                                               ; preds = %57, %52, %47
  %64 = landingpad { ptr, i32 }
          cleanup
  %65 = extractvalue { ptr, i32 } %64, 0
  store ptr %65, ptr %9, align 8
  %66 = extractvalue { ptr, i32 } %64, 1
  store i32 %66, ptr %10, align 4
  br label %71

67:                                               ; preds = %58
  %68 = landingpad { ptr, i32 }
          cleanup
  %69 = extractvalue { ptr, i32 } %68, 0
  store ptr %69, ptr %9, align 8
  %70 = extractvalue { ptr, i32 } %68, 1
  store i32 %70, ptr %10, align 4
  call void @_ZN7maliput6common16ComparisonResultINS_3api22TypeSpecificIdentifierINS2_5rules14RightOfWayRuleEEEED2Ev(ptr noundef nonnull align 8 dereferenceable(40) %15) #5
  br label %71

71:                                               ; preds = %67, %63
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #5
  br label %79

72:                                               ; preds = %34
  %73 = getelementptr inbounds %"struct.maliput::common::ComparisonResult.145", ptr %0, i32 0, i32 0
  invoke void @_ZNK7maliput6common25ComparisonResultCollector6resultB5cxx11Ev(ptr dead_on_unwind writable sret(%"class.std::optional") align 8 %73, ptr noundef nonnull align 8 dereferenceable(40) %7)
          to label %74 unwind label %75

74:                                               ; preds = %72
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #5
  call void @_ZN7maliput6common25ComparisonResultCollectorD2Ev(ptr noundef nonnull align 8 dereferenceable(40) %7) #5
  call void @llvm.lifetime.end.p0(i64 40, ptr %7) #5
  ret void

75:                                               ; preds = %72
  %76 = landingpad { ptr, i32 }
          cleanup
  %77 = extractvalue { ptr, i32 } %76, 0
  store ptr %77, ptr %9, align 8
  %78 = extractvalue { ptr, i32 } %76, 1
  store i32 %78, ptr %10, align 4
  br label %79

79:                                               ; preds = %75, %71, %43
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #5
  br label %80

80:                                               ; preds = %79, %39, %35
  call void @_ZN7maliput6common25ComparisonResultCollectorD2Ev(ptr noundef nonnull align 8 dereferenceable(40) %7) #5
  call void @llvm.lifetime.end.p0(i64 40, ptr %7) #5
  br label %81

81:                                               ; preds = %80
  %82 = load ptr, ptr %9, align 8
  %83 = load i32, ptr %10, align 4
  %84 = insertvalue { ptr, i32 } poison, ptr %82, 0
  %85 = insertvalue { ptr, i32 } %84, i32 %83, 1
  resume { ptr, i32 } %85
}

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN7maliput6common25ComparisonResultCollector9AddResultINS_3api22TypeSpecificIdentifierINS3_5rules14RightOfWayRuleEEEEEvPKciS9_NS0_16ComparisonResultIT_EE(ptr noundef nonnull align 8 dereferenceable(40), ptr noundef, i32 noundef, ptr noundef, ptr noundef) #2 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN7maliput3api7IsEqualINS0_5rules14RightOfWayRuleEEENS_6common16ComparisonResultINS0_22TypeSpecificIdentifierIT_EEEEPKcSB_RKS8_SD_(ptr dead_on_unwind noalias writable sret(%"struct.maliput::common::ComparisonResult.151") align 8, ptr noundef, ptr noundef, ptr noundef nonnull align 8 dereferenceable(32), ptr noundef nonnull align 8 dereferenceable(32)) #2

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

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

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


; 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::common::ComparisonResult.2" = type { %"class.std::optional" }
%"class.std::optional" = type { %"struct.std::_Optional_base" }
%"struct.std::_Optional_base" = type { %"struct.std::_Optional_payload" }
%"struct.std::_Optional_payload" = type { %"struct.std::_Optional_payload.base", [7 x i8] }
%"struct.std::_Optional_payload.base" = type { %"struct.std::_Optional_payload_base.base" }
%"struct.std::_Optional_payload_base.base" = type <{ %"union.std::_Optional_payload_base<std::__cxx11::basic_string<char>>::_Storage", i8 }>
%"union.std::_Optional_payload_base<std::__cxx11::basic_string<char>>::_Storage" = 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] }
%"struct.maliput::common::ComparisonResult.145" = type { %"class.std::optional" }
%"class.maliput::common::ComparisonResultCollector" = type { i32, i32, %"class.std::__cxx11::basic_string" }
%"struct.maliput::common::ComparisonResult.151" = type { %"class.std::optional" }

@.str = external hidden unnamed_addr constant [82 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [57 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [9 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [9 x i8], align 1
@.str.49 = external hidden unnamed_addr constant [48 x i8], align 1
@.str.50 = external hidden unnamed_addr constant [8 x i8], align 1
@.str.51 = external hidden unnamed_addr constant [8 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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN7maliput6common25ComparisonResultCollector9AddResultImEEvPKciS4_NS0_16ComparisonResultIT_EE(ptr noundef nonnull align 8 dereferenceable(40), ptr noundef, i32 noundef, ptr noundef, ptr noundef) local_unnamed_addr #2 align 2

declare void @_ZN7maliput3api7IsEqualEPKcS2_mm(ptr dead_on_unwind writable sret(%"struct.maliput::common::ComparisonResult.2") align 8, ptr noundef, ptr noundef, i64 noundef, i64 noundef) local_unnamed_addr #3

declare i32 @__gxx_personality_v0(...)

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNK7maliput6common25ComparisonResultCollector6resultB5cxx11Ev(ptr dead_on_unwind noalias writable sret(%"class.std::optional") align 8, ptr noundef nonnull align 8 dereferenceable(40)) local_unnamed_addr #2 align 2

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

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN7maliput3api5rules7IsEqualERKSt6vectorINS0_22TypeSpecificIdentifierINS1_14RightOfWayRuleEEESaIS5_EES9_(ptr dead_on_unwind noalias writable sret(%"struct.maliput::common::ComparisonResult.145") align 8 %0, ptr noundef nonnull align 8 dereferenceable(24) %1, ptr noundef nonnull align 8 dereferenceable(24) %2) local_unnamed_addr #2 personality ptr @__gxx_personality_v0 {
  %4 = alloca %"class.maliput::common::ComparisonResultCollector", align 8
  %5 = alloca %"struct.maliput::common::ComparisonResult.2", align 8
  %6 = alloca i64, align 8
  %7 = alloca i64, align 8
  %8 = alloca %"struct.maliput::common::ComparisonResult.151", align 8
  call void @llvm.lifetime.start.p0(i64 40, ptr nonnull %4) #5
  call void @_ZN7maliput6common25ComparisonResultCollectorC2Ev(ptr noundef nonnull align 8 dereferenceable(40) %4) #5
  %9 = call noundef i64 @_ZNKSt6vectorIN7maliput3api22TypeSpecificIdentifierINS1_5rules14RightOfWayRuleEEESaIS5_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %1) #5
  %10 = call noundef i64 @_ZNKSt6vectorIN7maliput3api22TypeSpecificIdentifierINS1_5rules14RightOfWayRuleEEESaIS5_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %2) #5
  invoke void @_ZN7maliput3api7IsEqualEPKcS2_mm(ptr dead_on_unwind nonnull writable sret(%"struct.maliput::common::ComparisonResult.2") align 8 %5, ptr noundef nonnull @.str.2, ptr noundef nonnull @.str.3, i64 noundef %9, i64 noundef %10)
          to label %11 unwind label %19

11:                                               ; preds = %3
  invoke void @_ZN7maliput6common25ComparisonResultCollector9AddResultImEEvPKciS4_NS0_16ComparisonResultIT_EE(ptr noundef nonnull align 8 dereferenceable(40) %4, ptr noundef nonnull @.str, i32 noundef 235, ptr noundef nonnull @.str.1, ptr noundef nonnull %5)
          to label %12 unwind label %21

12:                                               ; preds = %11
  call void @_ZN7maliput6common16ComparisonResultImED2Ev(ptr noundef nonnull align 8 dereferenceable(40) %5) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #5
  %13 = call noundef i64 @_ZNKSt6vectorIN7maliput3api22TypeSpecificIdentifierINS1_5rules14RightOfWayRuleEEESaIS5_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %1) #5
  store i64 %13, ptr %6, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %7) #5
  %14 = call noundef i64 @_ZNKSt6vectorIN7maliput3api22TypeSpecificIdentifierINS1_5rules14RightOfWayRuleEEESaIS5_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %2) #5
  store i64 %14, ptr %7, align 8, !tbaa !5
  %15 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minImERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %6, ptr noundef nonnull align 8 dereferenceable(8) %7)
  %16 = load i64, ptr %15, align 8, !tbaa !5
  %17 = trunc i64 %16 to i32
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #5
  %18 = icmp sgt i32 %17, 0
  br i1 %18, label %.lr.ph.preheader, label %._crit_edge

.lr.ph.preheader:                                 ; preds = %12
  %wide.trip.count = and i64 %16, 2147483647
  br label %.lr.ph

._crit_edge:                                      ; preds = %28, %12
  invoke void @_ZNK7maliput6common25ComparisonResultCollector6resultB5cxx11Ev(ptr dead_on_unwind writable sret(%"class.std::optional") align 8 %0, ptr noundef nonnull align 8 dereferenceable(40) %4)
          to label %33 unwind label %34

19:                                               ; preds = %3
  %20 = landingpad { ptr, i32 }
          cleanup
  br label %36

21:                                               ; preds = %11
  %22 = landingpad { ptr, i32 }
          cleanup
  call void @_ZN7maliput6common16ComparisonResultImED2Ev(ptr noundef nonnull align 8 dereferenceable(40) %5) #5
  br label %36

.lr.ph:                                           ; preds = %.lr.ph.preheader, %28
  %indvars.iv = phi i64 [ 0, %.lr.ph.preheader ], [ %indvars.iv.next, %28 ]
  %23 = invoke noundef nonnull align 8 dereferenceable(32) ptr @_ZNKSt6vectorIN7maliput3api22TypeSpecificIdentifierINS1_5rules14RightOfWayRuleEEESaIS5_EE2atEm(ptr noundef nonnull align 8 dereferenceable(24) %1, i64 noundef %indvars.iv)
          to label %24 unwind label %29

24:                                               ; preds = %.lr.ph
  %25 = invoke noundef nonnull align 8 dereferenceable(32) ptr @_ZNKSt6vectorIN7maliput3api22TypeSpecificIdentifierINS1_5rules14RightOfWayRuleEEESaIS5_EE2atEm(ptr noundef nonnull align 8 dereferenceable(24) %2, i64 noundef %indvars.iv)
          to label %26 unwind label %29

26:                                               ; preds = %24
  invoke void @_ZN7maliput3api7IsEqualINS0_5rules14RightOfWayRuleEEENS_6common16ComparisonResultINS0_22TypeSpecificIdentifierIT_EEEEPKcSB_RKS8_SD_(ptr dead_on_unwind nonnull writable sret(%"struct.maliput::common::ComparisonResult.151") align 8 %8, ptr noundef nonnull @.str.50, ptr noundef nonnull @.str.51, ptr noundef nonnull align 8 dereferenceable(32) %23, ptr noundef nonnull align 8 dereferenceable(32) %25)
          to label %27 unwind label %29

27:                                               ; preds = %26
  invoke void @_ZN7maliput6common25ComparisonResultCollector9AddResultINS_3api22TypeSpecificIdentifierINS3_5rules14RightOfWayRuleEEEEEvPKciS9_NS0_16ComparisonResultIT_EE(ptr noundef nonnull align 8 dereferenceable(40) %4, ptr noundef nonnull @.str, i32 noundef 238, ptr noundef nonnull @.str.49, ptr noundef nonnull %8)
          to label %28 unwind label %31

28:                                               ; preds = %27
  call void @_ZN7maliput6common16ComparisonResultINS_3api22TypeSpecificIdentifierINS2_5rules14RightOfWayRuleEEEED2Ev(ptr noundef nonnull align 8 dereferenceable(40) %8) #5
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
  br i1 %exitcond.not, label %._crit_edge, label %.lr.ph, !llvm.loop !9

29:                                               ; preds = %26, %24, %.lr.ph
  %30 = landingpad { ptr, i32 }
          cleanup
  br label %36

31:                                               ; preds = %27
  %32 = landingpad { ptr, i32 }
          cleanup
  call void @_ZN7maliput6common16ComparisonResultINS_3api22TypeSpecificIdentifierINS2_5rules14RightOfWayRuleEEEED2Ev(ptr noundef nonnull align 8 dereferenceable(40) %8) #5
  br label %36

33:                                               ; preds = %._crit_edge
  call void @_ZN7maliput6common25ComparisonResultCollectorD2Ev(ptr noundef nonnull align 8 dereferenceable(40) %4) #5
  call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %4) #5
  ret void

34:                                               ; preds = %._crit_edge
  %35 = landingpad { ptr, i32 }
          cleanup
  br label %36

36:                                               ; preds = %34, %31, %29, %21, %19
  %.pn.pn.pn = phi { ptr, i32 } [ %22, %21 ], [ %20, %19 ], [ %35, %34 ], [ %32, %31 ], [ %30, %29 ]
  call void @_ZN7maliput6common25ComparisonResultCollectorD2Ev(ptr noundef nonnull align 8 dereferenceable(40) %4) #5
  call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %4) #5
  resume { ptr, i32 } %.pn.pn.pn
}

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN7maliput6common25ComparisonResultCollector9AddResultINS_3api22TypeSpecificIdentifierINS3_5rules14RightOfWayRuleEEEEEvPKciS9_NS0_16ComparisonResultIT_EE(ptr noundef nonnull align 8 dereferenceable(40), ptr noundef, i32 noundef, ptr noundef, ptr noundef) local_unnamed_addr #2 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN7maliput3api7IsEqualINS0_5rules14RightOfWayRuleEEENS_6common16ComparisonResultINS0_22TypeSpecificIdentifierIT_EEEEPKcSB_RKS8_SD_(ptr dead_on_unwind noalias writable sret(%"struct.maliput::common::ComparisonResult.151") align 8, ptr noundef, ptr noundef, ptr noundef nonnull align 8 dereferenceable(32), ptr noundef nonnull align 8 dereferenceable(32)) local_unnamed_addr #2

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

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

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { "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 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 = { 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 = !{!"long", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}


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