; LLVM IR from maliput/maliput :: src/maliput/utility (mesh_simplification)

; 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::vector.83" = type { %"struct.std::_Vector_base.84" }
%"struct.std::_Vector_base.84" = type { %"struct.std::_Vector_base<maliput::utility::mesh::FaceVertexIndex, std::allocator<maliput::utility::mesh::FaceVertexIndex>>::_Vector_impl" }
%"struct.std::_Vector_base<maliput::utility::mesh::FaceVertexIndex, std::allocator<maliput::utility::mesh::FaceVertexIndex>>::_Vector_impl" = type { %"struct.std::_Vector_base<maliput::utility::mesh::FaceVertexIndex, std::allocator<maliput::utility::mesh::FaceVertexIndex>>::_Vector_impl_data" }
%"struct.std::_Vector_base<maliput::utility::mesh::FaceVertexIndex, std::allocator<maliput::utility::mesh::FaceVertexIndex>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"struct.maliput::utility::mesh::FaceEdgeIndex" = type { i32, i32 }
%"struct.maliput::utility::mesh::FaceVertexIndex" = type { i32, i32 }

@.str.1 = external hidden unnamed_addr constant [92 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [81 x i8], align 1
@__func__._ZN7maliput7utility4mesh23ComputeMeshFacesContourERKSt3setIiSt4lessIiESaIiEERKSt13unordered_mapIiSt6vectorINS1_13FaceEdgeIndexESaISB_EESt4hashIiESt8equal_toIiESaISt4pairIKiSD_EEE = external hidden unnamed_addr constant [24 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: noreturn
declare void @_ZN7maliput6common8internal5AbortEPKcS3_S3_i(ptr noundef, ptr noundef, ptr noundef, i32 noundef) #1

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

declare i32 @__gxx_personality_v0(...)

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef i64 @_ZNKSt3setIiSt4lessIiESaIiEE5countERKi(ptr noundef nonnull align 8 dereferenceable(48), ptr noundef nonnull align 4 dereferenceable(4)) #3 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef nonnull align 8 dereferenceable(24) ptr @_ZNKSt13unordered_mapIiSt6vectorIN7maliput7utility4mesh13FaceEdgeIndexESaIS4_EESt4hashIiESt8equal_toIiESaISt4pairIKiS6_EEE2atERSC_(ptr noundef nonnull align 8 dereferenceable(56), ptr noundef nonnull align 4 dereferenceable(4)) #3 align 2

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

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

; Function Attrs: mustprogress uwtable
declare dso_local i64 @_ZN7maliput7utility4mesh22FindOuterFaceEdgeIndexERKSt3setIiSt4lessIiESaIiEERKSt13unordered_mapIiSt6vectorINS1_13FaceEdgeIndexESaISB_EESt4hashIiESt8equal_toIiESaISt4pairIKiSD_EEE(ptr noundef nonnull align 8 dereferenceable(48), ptr noundef nonnull align 8 dereferenceable(56)) #3

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN7maliput7utility4mesh23ComputeMeshFacesContourERKSt3setIiSt4lessIiESaIiEERKSt13unordered_mapIiSt6vectorINS1_13FaceEdgeIndexESaISB_EESt4hashIiESt8equal_toIiESaISt4pairIKiSD_EEE(ptr dead_on_unwind noalias writable sret(%"class.std::vector.83") align 8 %0, ptr noundef nonnull align 8 dereferenceable(48) %1, ptr noundef nonnull align 8 dereferenceable(56) %2) #3 personality ptr @__gxx_personality_v0 {
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca i1, align 1
  %8 = alloca %"struct.maliput::utility::mesh::FaceEdgeIndex", align 4
  %9 = alloca ptr, align 8
  %10 = alloca i32, align 4
  %11 = alloca %"struct.maliput::utility::mesh::FaceEdgeIndex", align 4
  %12 = alloca ptr, align 8
  %13 = alloca ptr, align 8
  %14 = alloca %"struct.maliput::utility::mesh::FaceVertexIndex", align 4
  %15 = alloca i32, align 4
  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
  store i1 false, ptr %7, align 1
  call void @_ZNSt6vectorIN7maliput7utility4mesh15FaceVertexIndexESaIS3_EEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %0) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #6
  %16 = load ptr, ptr %5, align 8, !tbaa !5
  %17 = load ptr, ptr %6, align 8, !tbaa !5
  %18 = invoke i64 @_ZN7maliput7utility4mesh22FindOuterFaceEdgeIndexERKSt3setIiSt4lessIiESaIiEERKSt13unordered_mapIiSt6vectorINS1_13FaceEdgeIndexESaISB_EESt4hashIiESt8equal_toIiESaISt4pairIKiSD_EEE(ptr noundef nonnull align 8 dereferenceable(48) %16, ptr noundef nonnull align 8 dereferenceable(56) %17)
          to label %19 unwind label %28

19:                                               ; preds = %3
  store i64 %18, ptr %8, align 4
  br label %20

20:                                               ; preds = %19
  %21 = load ptr, ptr %5, align 8, !tbaa !5
  %22 = getelementptr inbounds %"struct.maliput::utility::mesh::FaceEdgeIndex", ptr %8, i32 0, i32 0
  %23 = invoke noundef i64 @_ZNKSt3setIiSt4lessIiESaIiEE5countERKi(ptr noundef nonnull align 8 dereferenceable(48) %21, ptr noundef nonnull align 4 dereferenceable(4) %22)
          to label %24 unwind label %28

24:                                               ; preds = %20
  %25 = icmp ugt i64 %23, 0
  br i1 %25, label %32, label %26

26:                                               ; preds = %24
  invoke void @_ZN7maliput6common8internal5AbortEPKcS3_S3_i(ptr noundef @.str.11, ptr noundef @__func__._ZN7maliput7utility4mesh23ComputeMeshFacesContourERKSt3setIiSt4lessIiESaIiEERKSt13unordered_mapIiSt6vectorINS1_13FaceEdgeIndexESaISB_EESt4hashIiESt8equal_toIiESaISt4pairIKiSD_EEE, ptr noundef @.str.1, i32 noundef 182) #7
          to label %27 unwind label %28

27:                                               ; preds = %26
  unreachable

28:                                               ; preds = %26, %20, %3
  %29 = landingpad { ptr, i32 }
          cleanup
  %30 = extractvalue { ptr, i32 } %29, 0
  store ptr %30, ptr %9, align 8
  %31 = extractvalue { ptr, i32 } %29, 1
  store i32 %31, ptr %10, align 4
  br label %102

32:                                               ; preds = %24
  br label %33

33:                                               ; preds = %32
  br label %34

34:                                               ; preds = %33
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #6
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %11, ptr align 4 %8, i64 8, i1 false), !tbaa.struct !9
  br label %35

35:                                               ; preds = %88, %34
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #6
  %36 = load ptr, ptr %6, align 8, !tbaa !5
  %37 = getelementptr inbounds %"struct.maliput::utility::mesh::FaceEdgeIndex", ptr %11, i32 0, i32 0
  %38 = invoke noundef nonnull align 8 dereferenceable(24) ptr @_ZNKSt13unordered_mapIiSt6vectorIN7maliput7utility4mesh13FaceEdgeIndexESaIS4_EESt4hashIiESt8equal_toIiESaISt4pairIKiS6_EEE2atERSC_(ptr noundef nonnull align 8 dereferenceable(56) %36, ptr noundef nonnull align 4 dereferenceable(4) %37)
          to label %39 unwind label %59

39:                                               ; preds = %35
  store ptr %38, ptr %12, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #6
  %40 = load ptr, ptr %12, align 8, !tbaa !5
  %41 = getelementptr inbounds %"struct.maliput::utility::mesh::FaceEdgeIndex", ptr %11, i32 0, i32 1
  %42 = load i32, ptr %41, align 4, !tbaa !12
  %43 = sext i32 %42 to i64
  %44 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNKSt6vectorIN7maliput7utility4mesh13FaceEdgeIndexESaIS3_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %40, i64 noundef %43) #6
  store ptr %44, ptr %13, align 8, !tbaa !5
  %45 = load ptr, ptr %5, align 8, !tbaa !5
  %46 = load ptr, ptr %13, align 8, !tbaa !5
  %47 = getelementptr inbounds %"struct.maliput::utility::mesh::FaceEdgeIndex", ptr %46, i32 0, i32 0
  %48 = invoke noundef i64 @_ZNKSt3setIiSt4lessIiESaIiEE5countERKi(ptr noundef nonnull align 8 dereferenceable(48) %45, ptr noundef nonnull align 4 dereferenceable(4) %47)
          to label %49 unwind label %63

49:                                               ; preds = %39
  %50 = icmp eq i64 %48, 0
  br i1 %50, label %51, label %71

51:                                               ; preds = %49
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #6
  %52 = getelementptr inbounds %"struct.maliput::utility::mesh::FaceVertexIndex", ptr %14, i32 0, i32 0
  %53 = getelementptr inbounds %"struct.maliput::utility::mesh::FaceEdgeIndex", ptr %11, i32 0, i32 0
  %54 = load i32, ptr %53, align 4, !tbaa !14
  store i32 %54, ptr %52, align 4, !tbaa !15
  %55 = getelementptr inbounds %"struct.maliput::utility::mesh::FaceVertexIndex", ptr %14, i32 0, i32 1
  %56 = getelementptr inbounds %"struct.maliput::utility::mesh::FaceEdgeIndex", ptr %11, i32 0, i32 1
  %57 = load i32, ptr %56, align 4, !tbaa !12
  store i32 %57, ptr %55, align 4, !tbaa !17
  invoke void @_ZNSt6vectorIN7maliput7utility4mesh15FaceVertexIndexESaIS3_EE9push_backEOS3_(ptr noundef nonnull align 8 dereferenceable(24) %0, ptr noundef nonnull align 4 dereferenceable(8) %14)
          to label %58 unwind label %67

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

59:                                               ; preds = %35
  %60 = landingpad { ptr, i32 }
          cleanup
  %61 = extractvalue { ptr, i32 } %60, 0
  store ptr %61, ptr %9, align 8
  %62 = extractvalue { ptr, i32 } %60, 1
  store i32 %62, ptr %10, align 4
  br label %96

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

67:                                               ; preds = %51
  %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 @llvm.lifetime.end.p0(i64 8, ptr %14) #6
  br label %95

71:                                               ; preds = %49
  %72 = load ptr, ptr %13, align 8, !tbaa !5
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %11, ptr align 4 %72, i64 8, i1 false), !tbaa.struct !9
  br label %73

73:                                               ; preds = %71, %58
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #6
  %74 = load ptr, ptr %6, align 8, !tbaa !5
  %75 = getelementptr inbounds %"struct.maliput::utility::mesh::FaceEdgeIndex", ptr %11, i32 0, i32 0
  %76 = invoke noundef nonnull align 8 dereferenceable(24) ptr @_ZNKSt13unordered_mapIiSt6vectorIN7maliput7utility4mesh13FaceEdgeIndexESaIS4_EESt4hashIiESt8equal_toIiESaISt4pairIKiS6_EEE2atERSC_(ptr noundef nonnull align 8 dereferenceable(56) %74, ptr noundef nonnull align 4 dereferenceable(4) %75)
          to label %77 unwind label %91

77:                                               ; preds = %73
  %78 = call noundef i64 @_ZNKSt6vectorIN7maliput7utility4mesh13FaceEdgeIndexESaIS3_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %76) #6
  %79 = trunc i64 %78 to i32
  store i32 %79, ptr %15, align 4, !tbaa !10
  %80 = getelementptr inbounds %"struct.maliput::utility::mesh::FaceEdgeIndex", ptr %11, i32 0, i32 1
  %81 = load i32, ptr %80, align 4, !tbaa !12
  %82 = add nsw i32 %81, 1
  %83 = load i32, ptr %15, align 4, !tbaa !10
  %84 = srem i32 %82, %83
  %85 = getelementptr inbounds %"struct.maliput::utility::mesh::FaceEdgeIndex", ptr %11, i32 0, i32 1
  store i32 %84, ptr %85, align 4, !tbaa !12
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #6
  br label %86

86:                                               ; preds = %77
  %87 = invoke noundef zeroext i1 @_ZN7maliput7utility4meshneERKNS1_13FaceEdgeIndexES4_(ptr noundef nonnull align 4 dereferenceable(8) %11, ptr noundef nonnull align 4 dereferenceable(8) %8)
          to label %88 unwind label %97

88:                                               ; preds = %86
  br i1 %87, label %35, label %89, !llvm.loop !18

89:                                               ; preds = %88
  store i1 true, ptr %7, align 1
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #6
  %90 = load i1, ptr %7, align 1
  br i1 %90, label %104, label %103

91:                                               ; preds = %73
  %92 = landingpad { ptr, i32 }
          cleanup
  %93 = extractvalue { ptr, i32 } %92, 0
  store ptr %93, ptr %9, align 8
  %94 = extractvalue { ptr, i32 } %92, 1
  store i32 %94, ptr %10, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #6
  br label %95

95:                                               ; preds = %91, %67, %63
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #6
  br label %96

96:                                               ; preds = %95, %59
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #6
  br label %101

97:                                               ; preds = %86
  %98 = landingpad { ptr, i32 }
          cleanup
  %99 = extractvalue { ptr, i32 } %98, 0
  store ptr %99, ptr %9, align 8
  %100 = extractvalue { ptr, i32 } %98, 1
  store i32 %100, ptr %10, align 4
  br label %101

101:                                              ; preds = %97, %96
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #6
  br label %102

102:                                              ; preds = %101, %28
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #6
  call void @_ZNSt6vectorIN7maliput7utility4mesh15FaceVertexIndexESaIS3_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %0) #6
  br label %105

103:                                              ; preds = %89
  call void @_ZNSt6vectorIN7maliput7utility4mesh15FaceVertexIndexESaIS3_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %0) #6
  br label %104

104:                                              ; preds = %103, %89
  ret void

105:                                              ; preds = %102
  %106 = load ptr, ptr %9, align 8
  %107 = load i32, ptr %10, align 4
  %108 = insertvalue { ptr, i32 } poison, ptr %106, 0
  %109 = insertvalue { ptr, i32 } %108, i32 %107, 1
  resume { ptr, i32 } %109
}

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt6vectorIN7maliput7utility4mesh15FaceVertexIndexESaIS3_EE9push_backEOS3_(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 4 dereferenceable(8)) #3 align 2

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

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

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #2 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
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 = { 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 = { 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 = { nounwind }
attributes #7 = { noreturn }

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{i64 0, i64 4, !10, i64 4, i64 4, !10}
!10 = !{!11, !11, i64 0}
!11 = !{!"int", !7, i64 0}
!12 = !{!13, !11, i64 4}
!13 = !{!"_ZTSN7maliput7utility4mesh13FaceEdgeIndexE", !11, i64 0, !11, i64 4}
!14 = !{!13, !11, i64 0}
!15 = !{!16, !11, i64 0}
!16 = !{!"_ZTSN7maliput7utility4mesh15FaceVertexIndexE", !11, i64 0, !11, i64 4}
!17 = !{!16, !11, i64 4}
!18 = distinct !{!18, !19}
!19 = !{!"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"

%"class.std::vector.83" = type { %"struct.std::_Vector_base.84" }
%"struct.std::_Vector_base.84" = type { %"struct.std::_Vector_base<maliput::utility::mesh::FaceVertexIndex, std::allocator<maliput::utility::mesh::FaceVertexIndex>>::_Vector_impl" }
%"struct.std::_Vector_base<maliput::utility::mesh::FaceVertexIndex, std::allocator<maliput::utility::mesh::FaceVertexIndex>>::_Vector_impl" = type { %"struct.std::_Vector_base<maliput::utility::mesh::FaceVertexIndex, std::allocator<maliput::utility::mesh::FaceVertexIndex>>::_Vector_impl_data" }
%"struct.std::_Vector_base<maliput::utility::mesh::FaceVertexIndex, std::allocator<maliput::utility::mesh::FaceVertexIndex>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"struct.maliput::utility::mesh::FaceEdgeIndex" = type { i32, i32 }
%"struct.maliput::utility::mesh::FaceVertexIndex" = type { i32, i32 }

@.str.1 = external hidden unnamed_addr constant [92 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [81 x i8], align 1
@__func__._ZN7maliput7utility4mesh23ComputeMeshFacesContourERKSt3setIiSt4lessIiESaIiEERKSt13unordered_mapIiSt6vectorINS1_13FaceEdgeIndexESaISB_EESt4hashIiESt8equal_toIiESaISt4pairIKiSD_EEE = external hidden unnamed_addr constant [24 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: noreturn
declare void @_ZN7maliput6common8internal5AbortEPKcS3_S3_i(ptr noundef, ptr noundef, ptr noundef, i32 noundef) local_unnamed_addr #1

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

declare i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress uwtable
declare dso_local noundef i64 @_ZNKSt3setIiSt4lessIiESaIiEE5countERKi(ptr noundef nonnull align 8 dereferenceable(48), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #2 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef nonnull align 8 dereferenceable(24) ptr @_ZNKSt13unordered_mapIiSt6vectorIN7maliput7utility4mesh13FaceEdgeIndexESaIS4_EESt4hashIiESt8equal_toIiESaISt4pairIKiS6_EEE2atERSC_(ptr noundef nonnull align 8 dereferenceable(56), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #2 align 2

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

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

; Function Attrs: mustprogress uwtable
declare dso_local i64 @_ZN7maliput7utility4mesh22FindOuterFaceEdgeIndexERKSt3setIiSt4lessIiESaIiEERKSt13unordered_mapIiSt6vectorINS1_13FaceEdgeIndexESaISB_EESt4hashIiESt8equal_toIiESaISt4pairIKiSD_EEE(ptr noundef nonnull align 8 dereferenceable(48), ptr noundef nonnull align 8 dereferenceable(56)) local_unnamed_addr #2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN7maliput7utility4mesh23ComputeMeshFacesContourERKSt3setIiSt4lessIiESaIiEERKSt13unordered_mapIiSt6vectorINS1_13FaceEdgeIndexESaISB_EESt4hashIiESt8equal_toIiESaISt4pairIKiSD_EEE(ptr dead_on_unwind noalias nonnull writable sret(%"class.std::vector.83") align 8 %0, ptr noundef nonnull align 8 dereferenceable(48) %1, ptr noundef nonnull align 8 dereferenceable(56) %2) local_unnamed_addr #2 personality ptr @__gxx_personality_v0 {
  %4 = alloca %"struct.maliput::utility::mesh::FaceEdgeIndex", align 8
  %5 = alloca %"struct.maliput::utility::mesh::FaceEdgeIndex", align 8
  %6 = alloca %"struct.maliput::utility::mesh::FaceVertexIndex", align 8
  tail call void @_ZNSt6vectorIN7maliput7utility4mesh15FaceVertexIndexESaIS3_EEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %0) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #5
  %7 = invoke i64 @_ZN7maliput7utility4mesh22FindOuterFaceEdgeIndexERKSt3setIiSt4lessIiESaIiEERKSt13unordered_mapIiSt6vectorINS1_13FaceEdgeIndexESaISB_EESt4hashIiESt8equal_toIiESaISt4pairIKiSD_EEE(ptr noundef nonnull align 8 dereferenceable(48) %1, ptr noundef nonnull align 8 dereferenceable(56) %2)
          to label %8 unwind label %13

8:                                                ; preds = %3
  store i64 %7, ptr %4, align 8
  %9 = invoke noundef i64 @_ZNKSt3setIiSt4lessIiESaIiEE5countERKi(ptr noundef nonnull align 8 dereferenceable(48) %1, ptr noundef nonnull align 4 dereferenceable(4) %4)
          to label %10 unwind label %13

10:                                               ; preds = %8
  %.not = icmp eq i64 %9, 0
  br i1 %.not, label %11, label %15

11:                                               ; preds = %10
  invoke void @_ZN7maliput6common8internal5AbortEPKcS3_S3_i(ptr noundef nonnull @.str.11, ptr noundef nonnull @__func__._ZN7maliput7utility4mesh23ComputeMeshFacesContourERKSt3setIiSt4lessIiESaIiEERKSt13unordered_mapIiSt6vectorINS1_13FaceEdgeIndexESaISB_EESt4hashIiESt8equal_toIiESaISt4pairIKiSD_EEE, ptr noundef nonnull @.str.1, i32 noundef 182) #6
          to label %12 unwind label %13

12:                                               ; preds = %11
  unreachable

13:                                               ; preds = %11, %8, %3
  %14 = landingpad { ptr, i32 }
          cleanup
  br label %54

15:                                               ; preds = %10
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #5
  %16 = load i64, ptr %4, align 8
  store i64 %16, ptr %5, align 8
  %17 = getelementptr inbounds i8, ptr %5, i64 4
  br label %18

18:                                               ; preds = %47, %15
  %19 = invoke noundef nonnull align 8 dereferenceable(24) ptr @_ZNKSt13unordered_mapIiSt6vectorIN7maliput7utility4mesh13FaceEdgeIndexESaIS4_EESt4hashIiESt8equal_toIiESaISt4pairIKiS6_EEE2atERSC_(ptr noundef nonnull align 8 dereferenceable(56) %2, ptr noundef nonnull align 4 dereferenceable(4) %5)
          to label %20 unwind label %30

20:                                               ; preds = %18
  %21 = load i32, ptr %17, align 4, !tbaa !5
  %22 = sext i32 %21 to i64
  %23 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNKSt6vectorIN7maliput7utility4mesh13FaceEdgeIndexESaIS3_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %19, i64 noundef %22) #5
  %24 = invoke noundef i64 @_ZNKSt3setIiSt4lessIiESaIiEE5countERKi(ptr noundef nonnull align 8 dereferenceable(48) %1, ptr noundef nonnull align 4 dereferenceable(4) %23)
          to label %25 unwind label %32

25:                                               ; preds = %20
  %26 = icmp eq i64 %24, 0
  br i1 %26, label %27, label %36

27:                                               ; preds = %25
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #5
  %28 = load <2 x i32>, ptr %5, align 8, !tbaa !10
  store <2 x i32> %28, ptr %6, align 8, !tbaa !10
  invoke void @_ZNSt6vectorIN7maliput7utility4mesh15FaceVertexIndexESaIS3_EE9push_backEOS3_(ptr noundef nonnull align 8 dereferenceable(24) %0, ptr noundef nonnull align 4 dereferenceable(8) %6)
          to label %29 unwind label %34

29:                                               ; preds = %27
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #5
  br label %38

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

32:                                               ; preds = %20
  %33 = landingpad { ptr, i32 }
          cleanup
  br label %53

34:                                               ; preds = %27
  %35 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #5
  br label %53

36:                                               ; preds = %25
  %37 = load i64, ptr %23, align 4
  store i64 %37, ptr %5, align 8
  br label %38

38:                                               ; preds = %36, %29
  %39 = invoke noundef nonnull align 8 dereferenceable(24) ptr @_ZNKSt13unordered_mapIiSt6vectorIN7maliput7utility4mesh13FaceEdgeIndexESaIS4_EESt4hashIiESt8equal_toIiESaISt4pairIKiS6_EEE2atERSC_(ptr noundef nonnull align 8 dereferenceable(56) %2, ptr noundef nonnull align 4 dereferenceable(4) %5)
          to label %40 unwind label %49

40:                                               ; preds = %38
  %41 = call noundef i64 @_ZNKSt6vectorIN7maliput7utility4mesh13FaceEdgeIndexESaIS3_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %39) #5
  %42 = trunc i64 %41 to i32
  %43 = load i32, ptr %17, align 4, !tbaa !5
  %44 = add nsw i32 %43, 1
  %45 = srem i32 %44, %42
  store i32 %45, ptr %17, align 4, !tbaa !5
  %46 = invoke noundef zeroext i1 @_ZN7maliput7utility4meshneERKNS1_13FaceEdgeIndexES4_(ptr noundef nonnull align 4 dereferenceable(8) %5, ptr noundef nonnull align 4 dereferenceable(8) %4)
          to label %47 unwind label %51

47:                                               ; preds = %40
  br i1 %46, label %18, label %48, !llvm.loop !11

48:                                               ; preds = %47
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #5
  ret void

49:                                               ; preds = %38
  %50 = landingpad { ptr, i32 }
          cleanup
  br label %53

51:                                               ; preds = %40
  %52 = landingpad { ptr, i32 }
          cleanup
  br label %53

53:                                               ; preds = %30, %49, %34, %32, %51
  %.pn18 = phi { ptr, i32 } [ %52, %51 ], [ %31, %30 ], [ %50, %49 ], [ %35, %34 ], [ %33, %32 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #5
  br label %54

54:                                               ; preds = %53, %13
  %.pn18.pn = phi { ptr, i32 } [ %.pn18, %53 ], [ %14, %13 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #5
  call void @_ZNSt6vectorIN7maliput7utility4mesh15FaceVertexIndexESaIS3_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %0) #5
  resume { ptr, i32 } %.pn18.pn
}

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt6vectorIN7maliput7utility4mesh15FaceVertexIndexESaIS3_EE9push_backEOS3_(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 4 dereferenceable(8)) local_unnamed_addr #2 align 2

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

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

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #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 = { 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 #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 = { nounwind }
attributes #6 = { noreturn }

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !7, i64 4}
!6 = !{!"_ZTSN7maliput7utility4mesh13FaceEdgeIndexE", !7, i64 0, !7, i64 4}
!7 = !{!"int", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!7, !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}


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