; 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.70" = type { %"class.std::optional" }
%"struct.maliput::common::ComparisonResult.81" = type { %"class.std::optional" }
%"class.maliput::common::ComparisonResultCollector" = type { i32, i32, %"class.std::__cxx11::basic_string" }

@.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.20 = external hidden unnamed_addr constant [20 x i8], align 1

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

; 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: mustprogress uwtable
declare dso_local void @_ZN7maliput3api5rules7IsEqualERKNS1_9PhaseRing9NextPhaseES5_(ptr dead_on_unwind noalias writable sret(%"struct.maliput::common::ComparisonResult.70") align 8, ptr noundef nonnull align 8 dereferenceable(48), ptr noundef nonnull align 8 dereferenceable(48)) #2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN7maliput3api5rules7IsEqualERKSt6vectorINS1_9PhaseRing9NextPhaseESaIS4_EES8_(ptr dead_on_unwind noalias writable sret(%"struct.maliput::common::ComparisonResult.81") 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 i64, align 8
  %12 = alloca %"struct.maliput::common::ComparisonResult.70", 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
  %13 = load ptr, ptr %5, align 8, !tbaa !5
  %14 = call noundef i64 @_ZNKSt6vectorIN7maliput3api5rules9PhaseRing9NextPhaseESaIS4_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %13) #5
  %15 = load ptr, ptr %6, align 8, !tbaa !5
  %16 = call noundef i64 @_ZNKSt6vectorIN7maliput3api5rules9PhaseRing9NextPhaseESaIS4_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %15) #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 %14, i64 noundef %16)
          to label %17 unwind label %31

17:                                               ; preds = %3
  invoke void @_ZN7maliput6common25ComparisonResultCollector9AddResultImEEvPKciS4_NS0_16ComparisonResultIT_EE(ptr noundef nonnull align 8 dereferenceable(40) %7, ptr noundef @.str, i32 noundef 96, ptr noundef @.str.1, ptr noundef %8)
          to label %18 unwind label %35

18:                                               ; preds = %17
  call void @_ZN7maliput6common16ComparisonResultImED2Ev(ptr noundef nonnull align 8 dereferenceable(40) %8) #5
  %19 = load ptr, ptr %5, align 8, !tbaa !5
  %20 = call noundef i64 @_ZNKSt6vectorIN7maliput3api5rules9PhaseRing9NextPhaseESaIS4_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %19) #5
  %21 = load ptr, ptr %6, align 8, !tbaa !5
  %22 = call noundef i64 @_ZNKSt6vectorIN7maliput3api5rules9PhaseRing9NextPhaseESaIS4_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %21) #5
  %23 = icmp eq i64 %20, %22
  br i1 %23, label %24, label %61

24:                                               ; preds = %18
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #5
  store i64 0, ptr %11, align 8, !tbaa !9
  br label %25

25:                                               ; preds = %48, %24
  %26 = load i64, ptr %11, align 8, !tbaa !9
  %27 = load ptr, ptr %5, align 8, !tbaa !5
  %28 = call noundef i64 @_ZNKSt6vectorIN7maliput3api5rules9PhaseRing9NextPhaseESaIS4_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %27) #5
  %29 = icmp ult i64 %26, %28
  br i1 %29, label %39, label %30

30:                                               ; preds = %25
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #5
  br label %60

31:                                               ; preds = %61, %3
  %32 = landingpad { ptr, i32 }
          cleanup
  %33 = extractvalue { ptr, i32 } %32, 0
  store ptr %33, ptr %9, align 8
  %34 = extractvalue { ptr, i32 } %32, 1
  store i32 %34, ptr %10, align 4
  br label %64

35:                                               ; preds = %17
  %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
  call void @_ZN7maliput6common16ComparisonResultImED2Ev(ptr noundef nonnull align 8 dereferenceable(40) %8) #5
  br label %64

39:                                               ; preds = %25
  %40 = load ptr, ptr %5, align 8, !tbaa !5
  %41 = load i64, ptr %11, align 8, !tbaa !9
  %42 = call noundef nonnull align 8 dereferenceable(48) ptr @_ZNKSt6vectorIN7maliput3api5rules9PhaseRing9NextPhaseESaIS4_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %40, i64 noundef %41) #5
  %43 = load ptr, ptr %6, align 8, !tbaa !5
  %44 = load i64, ptr %11, align 8, !tbaa !9
  %45 = call noundef nonnull align 8 dereferenceable(48) ptr @_ZNKSt6vectorIN7maliput3api5rules9PhaseRing9NextPhaseESaIS4_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %43, i64 noundef %44) #5
  invoke void @_ZN7maliput3api5rules7IsEqualERKNS1_9PhaseRing9NextPhaseES5_(ptr dead_on_unwind writable sret(%"struct.maliput::common::ComparisonResult.70") align 8 %12, ptr noundef nonnull align 8 dereferenceable(48) %42, ptr noundef nonnull align 8 dereferenceable(48) %45)
          to label %46 unwind label %51

46:                                               ; preds = %39
  invoke void @_ZN7maliput6common25ComparisonResultCollector9AddResultINS_3api5rules9PhaseRing9NextPhaseEEEvPKciS8_NS0_16ComparisonResultIT_EE(ptr noundef nonnull align 8 dereferenceable(40) %7, ptr noundef @.str, i32 noundef 99, ptr noundef @.str.20, ptr noundef %12)
          to label %47 unwind label %55

47:                                               ; preds = %46
  call void @_ZN7maliput6common16ComparisonResultINS_3api5rules9PhaseRing9NextPhaseEED2Ev(ptr noundef nonnull align 8 dereferenceable(40) %12) #5
  br label %48

48:                                               ; preds = %47
  %49 = load i64, ptr %11, align 8, !tbaa !9
  %50 = add i64 %49, 1
  store i64 %50, ptr %11, align 8, !tbaa !9
  br label %25, !llvm.loop !11

51:                                               ; preds = %39
  %52 = landingpad { ptr, i32 }
          cleanup
  %53 = extractvalue { ptr, i32 } %52, 0
  store ptr %53, ptr %9, align 8
  %54 = extractvalue { ptr, i32 } %52, 1
  store i32 %54, ptr %10, align 4
  br label %59

55:                                               ; preds = %46
  %56 = landingpad { ptr, i32 }
          cleanup
  %57 = extractvalue { ptr, i32 } %56, 0
  store ptr %57, ptr %9, align 8
  %58 = extractvalue { ptr, i32 } %56, 1
  store i32 %58, ptr %10, align 4
  call void @_ZN7maliput6common16ComparisonResultINS_3api5rules9PhaseRing9NextPhaseEED2Ev(ptr noundef nonnull align 8 dereferenceable(40) %12) #5
  br label %59

59:                                               ; preds = %55, %51
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #5
  br label %64

60:                                               ; preds = %30
  br label %61

61:                                               ; preds = %60, %18
  %62 = getelementptr inbounds %"struct.maliput::common::ComparisonResult.81", ptr %0, i32 0, i32 0
  invoke void @_ZNK7maliput6common25ComparisonResultCollector6resultB5cxx11Ev(ptr dead_on_unwind writable sret(%"class.std::optional") align 8 %62, ptr noundef nonnull align 8 dereferenceable(40) %7)
          to label %63 unwind label %31

63:                                               ; preds = %61
  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

64:                                               ; preds = %59, %35, %31
  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 %65

65:                                               ; preds = %64
  %66 = load ptr, ptr %9, align 8
  %67 = load i32, ptr %10, align 4
  %68 = insertvalue { ptr, i32 } poison, ptr %66, 0
  %69 = insertvalue { ptr, i32 } %68, i32 %67, 1
  resume { ptr, i32 } %69
}

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

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN7maliput6common16ComparisonResultINS_3api5rules9PhaseRing9NextPhaseEED2Ev(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 = distinct !{!11, !12}
!12 = !{!"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.70" = type { %"class.std::optional" }
%"struct.maliput::common::ComparisonResult.81" = type { %"class.std::optional" }
%"class.maliput::common::ComparisonResultCollector" = type { i32, i32, %"class.std::__cxx11::basic_string" }

@.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.20 = external hidden unnamed_addr constant [20 x i8], align 1

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

; 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: mustprogress uwtable
declare dso_local void @_ZN7maliput3api5rules7IsEqualERKNS1_9PhaseRing9NextPhaseES5_(ptr dead_on_unwind noalias writable sret(%"struct.maliput::common::ComparisonResult.70") align 8, ptr noundef nonnull align 8 dereferenceable(48), ptr noundef nonnull align 8 dereferenceable(48)) local_unnamed_addr #2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN7maliput3api5rules7IsEqualERKSt6vectorINS1_9PhaseRing9NextPhaseESaIS4_EES8_(ptr dead_on_unwind noalias writable sret(%"struct.maliput::common::ComparisonResult.81") 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 %"struct.maliput::common::ComparisonResult.70", 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
  %7 = call noundef i64 @_ZNKSt6vectorIN7maliput3api5rules9PhaseRing9NextPhaseESaIS4_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %1) #5
  %8 = call noundef i64 @_ZNKSt6vectorIN7maliput3api5rules9PhaseRing9NextPhaseESaIS4_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 %7, i64 noundef %8)
          to label %9 unwind label %15

9:                                                ; preds = %3
  invoke void @_ZN7maliput6common25ComparisonResultCollector9AddResultImEEvPKciS4_NS0_16ComparisonResultIT_EE(ptr noundef nonnull align 8 dereferenceable(40) %4, ptr noundef nonnull @.str, i32 noundef 96, ptr noundef nonnull @.str.1, ptr noundef nonnull %5)
          to label %10 unwind label %17

10:                                               ; preds = %9
  call void @_ZN7maliput6common16ComparisonResultImED2Ev(ptr noundef nonnull align 8 dereferenceable(40) %5) #5
  %11 = call noundef i64 @_ZNKSt6vectorIN7maliput3api5rules9PhaseRing9NextPhaseESaIS4_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %1) #5
  %12 = call noundef i64 @_ZNKSt6vectorIN7maliput3api5rules9PhaseRing9NextPhaseESaIS4_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %2) #5
  %13 = icmp eq i64 %11, %12
  br i1 %13, label %.preheader, label %.loopexit

.preheader:                                       ; preds = %10
  %14 = call noundef i64 @_ZNKSt6vectorIN7maliput3api5rules9PhaseRing9NextPhaseESaIS4_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %1) #5
  %.not = icmp eq i64 %14, 0
  br i1 %.not, label %.loopexit, label %.lr.ph

15:                                               ; preds = %.loopexit, %3
  %16 = landingpad { ptr, i32 }
          cleanup
  br label %31

17:                                               ; preds = %9
  %18 = landingpad { ptr, i32 }
          cleanup
  call void @_ZN7maliput6common16ComparisonResultImED2Ev(ptr noundef nonnull align 8 dereferenceable(40) %5) #5
  br label %31

.lr.ph:                                           ; preds = %.preheader, %22
  %.017 = phi i64 [ %23, %22 ], [ 0, %.preheader ]
  %19 = call noundef nonnull align 8 dereferenceable(48) ptr @_ZNKSt6vectorIN7maliput3api5rules9PhaseRing9NextPhaseESaIS4_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %1, i64 noundef %.017) #5
  %20 = call noundef nonnull align 8 dereferenceable(48) ptr @_ZNKSt6vectorIN7maliput3api5rules9PhaseRing9NextPhaseESaIS4_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %2, i64 noundef %.017) #5
  invoke void @_ZN7maliput3api5rules7IsEqualERKNS1_9PhaseRing9NextPhaseES5_(ptr dead_on_unwind nonnull writable sret(%"struct.maliput::common::ComparisonResult.70") align 8 %6, ptr noundef nonnull align 8 dereferenceable(48) %19, ptr noundef nonnull align 8 dereferenceable(48) %20)
          to label %21 unwind label %26

21:                                               ; preds = %.lr.ph
  invoke void @_ZN7maliput6common25ComparisonResultCollector9AddResultINS_3api5rules9PhaseRing9NextPhaseEEEvPKciS8_NS0_16ComparisonResultIT_EE(ptr noundef nonnull align 8 dereferenceable(40) %4, ptr noundef nonnull @.str, i32 noundef 99, ptr noundef nonnull @.str.20, ptr noundef nonnull %6)
          to label %22 unwind label %28

22:                                               ; preds = %21
  call void @_ZN7maliput6common16ComparisonResultINS_3api5rules9PhaseRing9NextPhaseEED2Ev(ptr noundef nonnull align 8 dereferenceable(40) %6) #5
  %23 = add nuw i64 %.017, 1
  %24 = call noundef i64 @_ZNKSt6vectorIN7maliput3api5rules9PhaseRing9NextPhaseESaIS4_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %1) #5
  %25 = icmp ult i64 %23, %24
  br i1 %25, label %.lr.ph, label %.loopexit, !llvm.loop !5

26:                                               ; preds = %.lr.ph
  %27 = landingpad { ptr, i32 }
          cleanup
  br label %31

28:                                               ; preds = %21
  %29 = landingpad { ptr, i32 }
          cleanup
  call void @_ZN7maliput6common16ComparisonResultINS_3api5rules9PhaseRing9NextPhaseEED2Ev(ptr noundef nonnull align 8 dereferenceable(40) %6) #5
  br label %31

.loopexit:                                        ; preds = %22, %.preheader, %10
  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 %30 unwind label %15

30:                                               ; preds = %.loopexit
  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

31:                                               ; preds = %26, %28, %17, %15
  %.pn.pn = phi { ptr, i32 } [ %16, %15 ], [ %18, %17 ], [ %29, %28 ], [ %27, %26 ]
  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
}

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN7maliput6common25ComparisonResultCollector9AddResultINS_3api5rules9PhaseRing9NextPhaseEEEvPKciS8_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 nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(48) ptr @_ZNKSt6vectorIN7maliput3api5rules9PhaseRing9NextPhaseESaIS4_EEixEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) local_unnamed_addr #1 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN7maliput6common16ComparisonResultINS_3api5rules9PhaseRing9NextPhaseEED2Ev(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 = distinct !{!5, !6}
!6 = !{!"llvm.loop.mustprogress"}


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