; 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::unordered_map.10" = type { %"class.std::_Hashtable.11" }
%"class.std::_Hashtable.11" = 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 }
%"class.std::set" = type { %"class.std::_Rb_tree" }
%"class.std::_Rb_tree" = type { %"struct.std::_Rb_tree<int, int, std::_Identity<int>, std::less<int>>::_Rb_tree_impl" }
%"struct.std::_Rb_tree<int, int, std::_Identity<int>, std::less<int>>::_Rb_tree_impl" = type { [8 x i8], %"struct.std::_Rb_tree_header" }
%"struct.std::_Rb_tree_header" = type { %"struct.std::_Rb_tree_node_base", i64 }
%"struct.std::_Rb_tree_node_base" = type { i32, ptr, ptr, ptr }
%"class.maliput::utility::mesh::GeoFace" = type { %"class.std::vector.91", %"class.std::vector.96" }
%"class.std::vector.91" = type { %"struct.std::_Vector_base.92" }
%"struct.std::_Vector_base.92" = type { %"struct.std::_Vector_base<maliput::utility::mesh::GeoVertex, std::allocator<maliput::utility::mesh::GeoVertex>>::_Vector_impl" }
%"struct.std::_Vector_base<maliput::utility::mesh::GeoVertex, std::allocator<maliput::utility::mesh::GeoVertex>>::_Vector_impl" = type { %"struct.std::_Vector_base<maliput::utility::mesh::GeoVertex, std::allocator<maliput::utility::mesh::GeoVertex>>::_Vector_impl_data" }
%"struct.std::_Vector_base<maliput::utility::mesh::GeoVertex, std::allocator<maliput::utility::mesh::GeoVertex>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::vector.96" = type { %"struct.std::_Vector_base.97" }
%"struct.std::_Vector_base.97" = type { %"struct.std::_Vector_base<maliput::utility::mesh::GeoNormal, std::allocator<maliput::utility::mesh::GeoNormal>>::_Vector_impl" }
%"struct.std::_Vector_base<maliput::utility::mesh::GeoNormal, std::allocator<maliput::utility::mesh::GeoNormal>>::_Vector_impl" = type { %"struct.std::_Vector_base<maliput::utility::mesh::GeoNormal, std::allocator<maliput::utility::mesh::GeoNormal>>::_Vector_impl_data" }
%"struct.std::_Vector_base<maliput::utility::mesh::GeoNormal, std::allocator<maliput::utility::mesh::GeoNormal>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.maliput::utility::mesh::GeoMesh" = type { %"class.maliput::utility::mesh::UniqueIndexer", %"class.maliput::utility::mesh::UniqueIndexer.53", %"class.std::vector" }
%"class.maliput::utility::mesh::UniqueIndexer" = type { %"class.std::unordered_map.33", %"class.std::vector.48" }
%"class.std::unordered_map.33" = type { %"class.std::_Hashtable.34" }
%"class.std::_Hashtable.34" = type { ptr, i64, %"struct.std::__detail::_Hash_node_base", i64, %"struct.std::__detail::_Prime_rehash_policy", ptr }
%"class.std::vector.48" = type { %"struct.std::_Vector_base.49" }
%"struct.std::_Vector_base.49" = type { %"struct.std::_Vector_base<const maliput::utility::mesh::GeoVertex *, std::allocator<const maliput::utility::mesh::GeoVertex *>>::_Vector_impl" }
%"struct.std::_Vector_base<const maliput::utility::mesh::GeoVertex *, std::allocator<const maliput::utility::mesh::GeoVertex *>>::_Vector_impl" = type { %"struct.std::_Vector_base<const maliput::utility::mesh::GeoVertex *, std::allocator<const maliput::utility::mesh::GeoVertex *>>::_Vector_impl_data" }
%"struct.std::_Vector_base<const maliput::utility::mesh::GeoVertex *, std::allocator<const maliput::utility::mesh::GeoVertex *>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.maliput::utility::mesh::UniqueIndexer.53" = type { %"class.std::unordered_map.54", %"class.std::vector.69" }
%"class.std::unordered_map.54" = type { %"class.std::_Hashtable.55" }
%"class.std::_Hashtable.55" = type { ptr, i64, %"struct.std::__detail::_Hash_node_base", i64, %"struct.std::__detail::_Prime_rehash_policy", ptr }
%"class.std::vector.69" = type { %"struct.std::_Vector_base.70" }
%"struct.std::_Vector_base.70" = type { %"struct.std::_Vector_base<const maliput::utility::mesh::GeoNormal *, std::allocator<const maliput::utility::mesh::GeoNormal *>>::_Vector_impl" }
%"struct.std::_Vector_base<const maliput::utility::mesh::GeoNormal *, std::allocator<const maliput::utility::mesh::GeoNormal *>>::_Vector_impl" = type { %"struct.std::_Vector_base<const maliput::utility::mesh::GeoNormal *, std::allocator<const maliput::utility::mesh::GeoNormal *>>::_Vector_impl_data" }
%"struct.std::_Vector_base<const maliput::utility::mesh::GeoNormal *, std::allocator<const maliput::utility::mesh::GeoNormal *>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<maliput::utility::mesh::IndexFace, std::allocator<maliput::utility::mesh::IndexFace>>::_Vector_impl" }
%"struct.std::_Vector_base<maliput::utility::mesh::IndexFace, std::allocator<maliput::utility::mesh::IndexFace>>::_Vector_impl" = type { %"struct.std::_Vector_base<maliput::utility::mesh::IndexFace, std::allocator<maliput::utility::mesh::IndexFace>>::_Vector_impl_data" }
%"struct.std::_Vector_base<maliput::utility::mesh::IndexFace, std::allocator<maliput::utility::mesh::IndexFace>>::_Vector_impl_data" = type { ptr, ptr, ptr }

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

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

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

declare i32 @__gxx_personality_v0(...)

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN7maliput7utility4mesh34AggregateAdjacentCoplanarMeshFacesERKNS1_7GeoMeshEiRKSt13unordered_mapIiSt6vectorINS1_13FaceEdgeIndexESaIS7_EESt4hashIiESt8equal_toIiESaISt4pairIKiS9_EEEdPSt3setIiSt4lessIiESaIiEE(ptr dead_on_unwind noalias writable sret(%"class.std::set") align 8, ptr noundef nonnull align 8 dereferenceable(184), i32 noundef, ptr noundef nonnull align 8 dereferenceable(56), double noundef, ptr noundef) #2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(24) ptr @_ZNK7maliput7utility4mesh7GeoMesh5facesEv(ptr noundef nonnull align 8 dereferenceable(184)) #1 align 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)) #2 align 2

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN7maliput7utility4mesh14MergeMeshFacesERKNS1_7GeoMeshERKSt3setIiSt4lessIiESaIiEERKSt13unordered_mapIiSt6vectorINS1_13FaceEdgeIndexESaISE_EESt4hashIiESt8equal_toIiESaISt4pairIKiSG_EEEd(ptr dead_on_unwind noalias writable sret(%"class.maliput::utility::mesh::GeoFace") align 8, ptr noundef nonnull align 8 dereferenceable(184), ptr noundef nonnull align 8 dereferenceable(48), ptr noundef nonnull align 8 dereferenceable(56), double noundef) #2

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN7maliput7utility4mesh17SimplifyMeshFacesERKNS1_7GeoMeshEd(ptr dead_on_unwind noalias writable sret(%"class.maliput::utility::mesh::GeoMesh") align 8 %0, ptr noundef nonnull align 8 dereferenceable(184) %1, double noundef %2) #2 personality ptr @__gxx_personality_v0 {
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca double, align 8
  %7 = alloca i1, align 1
  %8 = alloca %"class.std::set", align 8
  %9 = alloca %"class.std::unordered_map.10", align 8
  %10 = alloca ptr, align 8
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca %"class.std::set", align 8
  %15 = alloca %"class.maliput::utility::mesh::GeoFace", align 8
  store ptr %0, ptr %4, align 8
  store ptr %1, ptr %5, align 8, !tbaa !5
  store double %2, ptr %6, align 8, !tbaa !9
  store i1 false, ptr %7, align 1
  call void @_ZN7maliput7utility4mesh7GeoMeshC2Ev(ptr noundef nonnull align 8 dereferenceable(184) %0)
  call void @llvm.lifetime.start.p0(i64 48, ptr %8) #4
  call void @_ZNSt3setIiSt4lessIiESaIiEEC2Ev(ptr noundef nonnull align 8 dereferenceable(48) %8) #4
  call void @llvm.lifetime.start.p0(i64 56, ptr %9) #4
  %16 = load ptr, ptr %5, align 8, !tbaa !5
  %17 = invoke noundef nonnull align 8 dereferenceable(24) ptr @_ZNK7maliput7utility4mesh7GeoMesh5facesEv(ptr noundef nonnull align 8 dereferenceable(184) %16)
          to label %18 unwind label %30

18:                                               ; preds = %3
  invoke void @_ZN7maliput7utility4mesh23ComputeFaceAdjacencyMapERKSt6vectorINS1_9IndexFaceESaIS3_EE(ptr dead_on_unwind writable sret(%"class.std::unordered_map.10") align 8 %9, ptr noundef nonnull align 8 dereferenceable(24) %17)
          to label %19 unwind label %30

19:                                               ; preds = %18
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #4
  %20 = load ptr, ptr %5, align 8, !tbaa !5
  %21 = invoke noundef nonnull align 8 dereferenceable(24) ptr @_ZNK7maliput7utility4mesh7GeoMesh5facesEv(ptr noundef nonnull align 8 dereferenceable(184) %20)
          to label %22 unwind label %34

22:                                               ; preds = %19
  %23 = call noundef i64 @_ZNKSt6vectorIN7maliput7utility4mesh9IndexFaceESaIS3_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %21) #4
  %24 = trunc i64 %23 to i32
  store i32 %24, ptr %12, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #4
  store i32 0, ptr %13, align 4, !tbaa !11
  br label %25

25:                                               ; preds = %56, %22
  %26 = load i32, ptr %13, align 4, !tbaa !11
  %27 = load i32, ptr %12, align 4, !tbaa !11
  %28 = icmp slt i32 %26, %27
  br i1 %28, label %38, label %29

29:                                               ; preds = %25
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #4
  br label %74

30:                                               ; preds = %18, %3
  %31 = landingpad { ptr, i32 }
          cleanup
  %32 = extractvalue { ptr, i32 } %31, 0
  store ptr %32, ptr %10, align 8
  %33 = extractvalue { ptr, i32 } %31, 1
  store i32 %33, ptr %11, align 4
  br label %77

34:                                               ; preds = %19
  %35 = landingpad { ptr, i32 }
          cleanup
  %36 = extractvalue { ptr, i32 } %35, 0
  store ptr %36, ptr %10, align 8
  %37 = extractvalue { ptr, i32 } %35, 1
  store i32 %37, ptr %11, align 4
  br label %76

38:                                               ; preds = %25
  %39 = invoke noundef i64 @_ZNKSt3setIiSt4lessIiESaIiEE5countERKi(ptr noundef nonnull align 8 dereferenceable(48) %8, ptr noundef nonnull align 4 dereferenceable(4) %13)
          to label %40 unwind label %43

40:                                               ; preds = %38
  %41 = icmp ugt i64 %39, 0
  br i1 %41, label %42, label %47

42:                                               ; preds = %40
  br label %56

43:                                               ; preds = %38
  %44 = landingpad { ptr, i32 }
          cleanup
  %45 = extractvalue { ptr, i32 } %44, 0
  store ptr %45, ptr %10, align 8
  %46 = extractvalue { ptr, i32 } %44, 1
  store i32 %46, ptr %11, align 4
  br label %73

47:                                               ; preds = %40
  call void @llvm.lifetime.start.p0(i64 48, ptr %14) #4
  %48 = load ptr, ptr %5, align 8, !tbaa !5
  %49 = load i32, ptr %13, align 4, !tbaa !11
  %50 = load double, ptr %6, align 8, !tbaa !9
  invoke void @_ZN7maliput7utility4mesh34AggregateAdjacentCoplanarMeshFacesERKNS1_7GeoMeshEiRKSt13unordered_mapIiSt6vectorINS1_13FaceEdgeIndexESaIS7_EESt4hashIiESt8equal_toIiESaISt4pairIKiS9_EEEdPSt3setIiSt4lessIiESaIiEE(ptr dead_on_unwind writable sret(%"class.std::set") align 8 %14, ptr noundef nonnull align 8 dereferenceable(184) %48, i32 noundef %49, ptr noundef nonnull align 8 dereferenceable(56) %9, double noundef %50, ptr noundef %8)
          to label %51 unwind label %59

51:                                               ; preds = %47
  call void @llvm.lifetime.start.p0(i64 48, ptr %15) #4
  %52 = load ptr, ptr %5, align 8, !tbaa !5
  %53 = load double, ptr %6, align 8, !tbaa !9
  invoke void @_ZN7maliput7utility4mesh14MergeMeshFacesERKNS1_7GeoMeshERKSt3setIiSt4lessIiESaIiEERKSt13unordered_mapIiSt6vectorINS1_13FaceEdgeIndexESaISE_EESt4hashIiESt8equal_toIiESaISt4pairIKiSG_EEEd(ptr dead_on_unwind writable sret(%"class.maliput::utility::mesh::GeoFace") align 8 %15, ptr noundef nonnull align 8 dereferenceable(184) %52, ptr noundef nonnull align 8 dereferenceable(48) %14, ptr noundef nonnull align 8 dereferenceable(56) %9, double noundef %53)
          to label %54 unwind label %63

54:                                               ; preds = %51
  invoke void @_ZN7maliput7utility4mesh7GeoMesh8PushFaceERKNS1_7GeoFaceE(ptr noundef nonnull align 8 dereferenceable(184) %0, ptr noundef nonnull align 8 dereferenceable(48) %15)
          to label %55 unwind label %67

55:                                               ; preds = %54
  call void @_ZN7maliput7utility4mesh7GeoFaceD2Ev(ptr noundef nonnull align 8 dereferenceable(48) %15) #4
  call void @llvm.lifetime.end.p0(i64 48, ptr %15) #4
  call void @_ZNSt3setIiSt4lessIiESaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(48) %14) #4
  call void @llvm.lifetime.end.p0(i64 48, ptr %14) #4
  br label %56

56:                                               ; preds = %55, %42
  %57 = load i32, ptr %13, align 4, !tbaa !11
  %58 = add nsw i32 %57, 1
  store i32 %58, ptr %13, align 4, !tbaa !11
  br label %25, !llvm.loop !13

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

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

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

71:                                               ; preds = %67, %63
  call void @llvm.lifetime.end.p0(i64 48, ptr %15) #4
  call void @_ZNSt3setIiSt4lessIiESaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(48) %14) #4
  br label %72

72:                                               ; preds = %71, %59
  call void @llvm.lifetime.end.p0(i64 48, ptr %14) #4
  br label %73

73:                                               ; preds = %72, %43
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #4
  br label %76

74:                                               ; preds = %29
  store i1 true, ptr %7, align 1
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #4
  call void @_ZNSt13unordered_mapIiSt6vectorIN7maliput7utility4mesh13FaceEdgeIndexESaIS4_EESt4hashIiESt8equal_toIiESaISt4pairIKiS6_EEED2Ev(ptr noundef nonnull align 8 dereferenceable(56) %9) #4
  call void @llvm.lifetime.end.p0(i64 56, ptr %9) #4
  call void @_ZNSt3setIiSt4lessIiESaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(48) %8) #4
  call void @llvm.lifetime.end.p0(i64 48, ptr %8) #4
  %75 = load i1, ptr %7, align 1
  br i1 %75, label %79, label %78

76:                                               ; preds = %73, %34
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #4
  call void @_ZNSt13unordered_mapIiSt6vectorIN7maliput7utility4mesh13FaceEdgeIndexESaIS4_EESt4hashIiESt8equal_toIiESaISt4pairIKiS6_EEED2Ev(ptr noundef nonnull align 8 dereferenceable(56) %9) #4
  br label %77

77:                                               ; preds = %76, %30
  call void @llvm.lifetime.end.p0(i64 56, ptr %9) #4
  call void @_ZNSt3setIiSt4lessIiESaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(48) %8) #4
  call void @llvm.lifetime.end.p0(i64 48, ptr %8) #4
  call void @_ZN7maliput7utility4mesh7GeoMeshD2Ev(ptr noundef nonnull align 8 dereferenceable(184) %0) #4
  br label %80

78:                                               ; preds = %74
  call void @_ZN7maliput7utility4mesh7GeoMeshD2Ev(ptr noundef nonnull align 8 dereferenceable(184) %0) #4
  br label %79

79:                                               ; preds = %78, %74
  ret void

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

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

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN7maliput7utility4mesh7GeoMeshD2Ev(ptr noundef nonnull align 8 dereferenceable(184)) unnamed_addr #3 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 = { 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 #4 = { 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 = !{!"double", !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"

%"class.std::unordered_map.10" = type { %"class.std::_Hashtable.11" }
%"class.std::_Hashtable.11" = 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 }
%"class.std::set" = type { %"class.std::_Rb_tree" }
%"class.std::_Rb_tree" = type { %"struct.std::_Rb_tree<int, int, std::_Identity<int>, std::less<int>>::_Rb_tree_impl" }
%"struct.std::_Rb_tree<int, int, std::_Identity<int>, std::less<int>>::_Rb_tree_impl" = type { [8 x i8], %"struct.std::_Rb_tree_header" }
%"struct.std::_Rb_tree_header" = type { %"struct.std::_Rb_tree_node_base", i64 }
%"struct.std::_Rb_tree_node_base" = type { i32, ptr, ptr, ptr }
%"class.maliput::utility::mesh::GeoFace" = type { %"class.std::vector.91", %"class.std::vector.96" }
%"class.std::vector.91" = type { %"struct.std::_Vector_base.92" }
%"struct.std::_Vector_base.92" = type { %"struct.std::_Vector_base<maliput::utility::mesh::GeoVertex, std::allocator<maliput::utility::mesh::GeoVertex>>::_Vector_impl" }
%"struct.std::_Vector_base<maliput::utility::mesh::GeoVertex, std::allocator<maliput::utility::mesh::GeoVertex>>::_Vector_impl" = type { %"struct.std::_Vector_base<maliput::utility::mesh::GeoVertex, std::allocator<maliput::utility::mesh::GeoVertex>>::_Vector_impl_data" }
%"struct.std::_Vector_base<maliput::utility::mesh::GeoVertex, std::allocator<maliput::utility::mesh::GeoVertex>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::vector.96" = type { %"struct.std::_Vector_base.97" }
%"struct.std::_Vector_base.97" = type { %"struct.std::_Vector_base<maliput::utility::mesh::GeoNormal, std::allocator<maliput::utility::mesh::GeoNormal>>::_Vector_impl" }
%"struct.std::_Vector_base<maliput::utility::mesh::GeoNormal, std::allocator<maliput::utility::mesh::GeoNormal>>::_Vector_impl" = type { %"struct.std::_Vector_base<maliput::utility::mesh::GeoNormal, std::allocator<maliput::utility::mesh::GeoNormal>>::_Vector_impl_data" }
%"struct.std::_Vector_base<maliput::utility::mesh::GeoNormal, std::allocator<maliput::utility::mesh::GeoNormal>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.maliput::utility::mesh::GeoMesh" = type { %"class.maliput::utility::mesh::UniqueIndexer", %"class.maliput::utility::mesh::UniqueIndexer.53", %"class.std::vector" }
%"class.maliput::utility::mesh::UniqueIndexer" = type { %"class.std::unordered_map.33", %"class.std::vector.48" }
%"class.std::unordered_map.33" = type { %"class.std::_Hashtable.34" }
%"class.std::_Hashtable.34" = type { ptr, i64, %"struct.std::__detail::_Hash_node_base", i64, %"struct.std::__detail::_Prime_rehash_policy", ptr }
%"class.std::vector.48" = type { %"struct.std::_Vector_base.49" }
%"struct.std::_Vector_base.49" = type { %"struct.std::_Vector_base<const maliput::utility::mesh::GeoVertex *, std::allocator<const maliput::utility::mesh::GeoVertex *>>::_Vector_impl" }
%"struct.std::_Vector_base<const maliput::utility::mesh::GeoVertex *, std::allocator<const maliput::utility::mesh::GeoVertex *>>::_Vector_impl" = type { %"struct.std::_Vector_base<const maliput::utility::mesh::GeoVertex *, std::allocator<const maliput::utility::mesh::GeoVertex *>>::_Vector_impl_data" }
%"struct.std::_Vector_base<const maliput::utility::mesh::GeoVertex *, std::allocator<const maliput::utility::mesh::GeoVertex *>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.maliput::utility::mesh::UniqueIndexer.53" = type { %"class.std::unordered_map.54", %"class.std::vector.69" }
%"class.std::unordered_map.54" = type { %"class.std::_Hashtable.55" }
%"class.std::_Hashtable.55" = type { ptr, i64, %"struct.std::__detail::_Hash_node_base", i64, %"struct.std::__detail::_Prime_rehash_policy", ptr }
%"class.std::vector.69" = type { %"struct.std::_Vector_base.70" }
%"struct.std::_Vector_base.70" = type { %"struct.std::_Vector_base<const maliput::utility::mesh::GeoNormal *, std::allocator<const maliput::utility::mesh::GeoNormal *>>::_Vector_impl" }
%"struct.std::_Vector_base<const maliput::utility::mesh::GeoNormal *, std::allocator<const maliput::utility::mesh::GeoNormal *>>::_Vector_impl" = type { %"struct.std::_Vector_base<const maliput::utility::mesh::GeoNormal *, std::allocator<const maliput::utility::mesh::GeoNormal *>>::_Vector_impl_data" }
%"struct.std::_Vector_base<const maliput::utility::mesh::GeoNormal *, std::allocator<const maliput::utility::mesh::GeoNormal *>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<maliput::utility::mesh::IndexFace, std::allocator<maliput::utility::mesh::IndexFace>>::_Vector_impl" }
%"struct.std::_Vector_base<maliput::utility::mesh::IndexFace, std::allocator<maliput::utility::mesh::IndexFace>>::_Vector_impl" = type { %"struct.std::_Vector_base<maliput::utility::mesh::IndexFace, std::allocator<maliput::utility::mesh::IndexFace>>::_Vector_impl_data" }
%"struct.std::_Vector_base<maliput::utility::mesh::IndexFace, std::allocator<maliput::utility::mesh::IndexFace>>::_Vector_impl_data" = type { ptr, ptr, ptr }

; 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 nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #0

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

declare i32 @__gxx_personality_v0(...)

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN7maliput7utility4mesh34AggregateAdjacentCoplanarMeshFacesERKNS1_7GeoMeshEiRKSt13unordered_mapIiSt6vectorINS1_13FaceEdgeIndexESaIS7_EESt4hashIiESt8equal_toIiESaISt4pairIKiS9_EEEdPSt3setIiSt4lessIiESaIiEE(ptr dead_on_unwind noalias writable sret(%"class.std::set") align 8, ptr noundef nonnull align 8 dereferenceable(184), i32 noundef, ptr noundef nonnull align 8 dereferenceable(56), double noundef, ptr noundef) local_unnamed_addr #2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(24) ptr @_ZNK7maliput7utility4mesh7GeoMesh5facesEv(ptr noundef nonnull align 8 dereferenceable(184)) local_unnamed_addr #1 align 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)) local_unnamed_addr #2 align 2

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN7maliput7utility4mesh14MergeMeshFacesERKNS1_7GeoMeshERKSt3setIiSt4lessIiESaIiEERKSt13unordered_mapIiSt6vectorINS1_13FaceEdgeIndexESaISE_EESt4hashIiESt8equal_toIiESaISt4pairIKiSG_EEEd(ptr dead_on_unwind noalias writable sret(%"class.maliput::utility::mesh::GeoFace") align 8, ptr noundef nonnull align 8 dereferenceable(184), ptr noundef nonnull align 8 dereferenceable(48), ptr noundef nonnull align 8 dereferenceable(56), double noundef) local_unnamed_addr #2

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN7maliput7utility4mesh17SimplifyMeshFacesERKNS1_7GeoMeshEd(ptr dead_on_unwind noalias nonnull writable sret(%"class.maliput::utility::mesh::GeoMesh") align 8 %0, ptr noundef nonnull align 8 dereferenceable(184) %1, double noundef %2) local_unnamed_addr #2 personality ptr @__gxx_personality_v0 {
  %4 = alloca %"class.std::set", align 8
  %5 = alloca %"class.std::unordered_map.10", align 8
  %6 = alloca i32, align 4
  %7 = alloca %"class.std::set", align 8
  %8 = alloca %"class.maliput::utility::mesh::GeoFace", align 8
  tail call void @_ZN7maliput7utility4mesh7GeoMeshC2Ev(ptr noundef nonnull align 8 dereferenceable(184) %0)
  call void @llvm.lifetime.start.p0(i64 48, ptr nonnull %4) #4
  call void @_ZNSt3setIiSt4lessIiESaIiEEC2Ev(ptr noundef nonnull align 8 dereferenceable(48) %4) #4
  call void @llvm.lifetime.start.p0(i64 56, ptr nonnull %5) #4
  %9 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNK7maliput7utility4mesh7GeoMesh5facesEv(ptr noundef nonnull align 8 dereferenceable(184) %1)
  invoke void @_ZN7maliput7utility4mesh23ComputeFaceAdjacencyMapERKSt6vectorINS1_9IndexFaceESaIS3_EE(ptr dead_on_unwind nonnull writable sret(%"class.std::unordered_map.10") align 8 %5, ptr noundef nonnull align 8 dereferenceable(24) %9)
          to label %10 unwind label %15

10:                                               ; preds = %3
  %11 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNK7maliput7utility4mesh7GeoMesh5facesEv(ptr noundef nonnull align 8 dereferenceable(184) %1)
  %12 = call noundef i64 @_ZNKSt6vectorIN7maliput7utility4mesh9IndexFaceESaIS3_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %11) #4
  %13 = trunc i64 %12 to i32
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %6) #4
  store i32 0, ptr %6, align 4, !tbaa !5
  %14 = icmp sgt i32 %13, 0
  br i1 %14, label %.lr.ph, label %._crit_edge

._crit_edge:                                      ; preds = %26, %10
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %6) #4
  call void @_ZNSt13unordered_mapIiSt6vectorIN7maliput7utility4mesh13FaceEdgeIndexESaIS4_EESt4hashIiESt8equal_toIiESaISt4pairIKiS6_EEED2Ev(ptr noundef nonnull align 8 dereferenceable(56) %5) #4
  call void @llvm.lifetime.end.p0(i64 56, ptr nonnull %5) #4
  call void @_ZNSt3setIiSt4lessIiESaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(48) %4) #4
  call void @llvm.lifetime.end.p0(i64 48, ptr nonnull %4) #4
  ret void

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

.lr.ph:                                           ; preds = %10, %26
  %17 = invoke noundef i64 @_ZNKSt3setIiSt4lessIiESaIiEE5countERKi(ptr noundef nonnull align 8 dereferenceable(48) %4, ptr noundef nonnull align 4 dereferenceable(4) %6)
          to label %18 unwind label %19

18:                                               ; preds = %.lr.ph
  %.not = icmp eq i64 %17, 0
  br i1 %.not, label %21, label %26

19:                                               ; preds = %.lr.ph
  %20 = landingpad { ptr, i32 }
          cleanup
  br label %38

21:                                               ; preds = %18
  call void @llvm.lifetime.start.p0(i64 48, ptr nonnull %7) #4
  %22 = load i32, ptr %6, align 4, !tbaa !5
  invoke void @_ZN7maliput7utility4mesh34AggregateAdjacentCoplanarMeshFacesERKNS1_7GeoMeshEiRKSt13unordered_mapIiSt6vectorINS1_13FaceEdgeIndexESaIS7_EESt4hashIiESt8equal_toIiESaISt4pairIKiS9_EEEdPSt3setIiSt4lessIiESaIiEE(ptr dead_on_unwind nonnull writable sret(%"class.std::set") align 8 %7, ptr noundef nonnull align 8 dereferenceable(184) %1, i32 noundef %22, ptr noundef nonnull align 8 dereferenceable(56) %5, double noundef %2, ptr noundef nonnull %4)
          to label %23 unwind label %30

23:                                               ; preds = %21
  call void @llvm.lifetime.start.p0(i64 48, ptr nonnull %8) #4
  invoke void @_ZN7maliput7utility4mesh14MergeMeshFacesERKNS1_7GeoMeshERKSt3setIiSt4lessIiESaIiEERKSt13unordered_mapIiSt6vectorINS1_13FaceEdgeIndexESaISE_EESt4hashIiESt8equal_toIiESaISt4pairIKiSG_EEEd(ptr dead_on_unwind nonnull writable sret(%"class.maliput::utility::mesh::GeoFace") align 8 %8, ptr noundef nonnull align 8 dereferenceable(184) %1, ptr noundef nonnull align 8 dereferenceable(48) %7, ptr noundef nonnull align 8 dereferenceable(56) %5, double noundef %2)
          to label %24 unwind label %32

24:                                               ; preds = %23
  invoke void @_ZN7maliput7utility4mesh7GeoMesh8PushFaceERKNS1_7GeoFaceE(ptr noundef nonnull align 8 dereferenceable(184) %0, ptr noundef nonnull align 8 dereferenceable(48) %8)
          to label %25 unwind label %34

25:                                               ; preds = %24
  call void @_ZN7maliput7utility4mesh7GeoFaceD2Ev(ptr noundef nonnull align 8 dereferenceable(48) %8) #4
  call void @llvm.lifetime.end.p0(i64 48, ptr nonnull %8) #4
  call void @_ZNSt3setIiSt4lessIiESaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(48) %7) #4
  call void @llvm.lifetime.end.p0(i64 48, ptr nonnull %7) #4
  br label %26

26:                                               ; preds = %18, %25
  %27 = load i32, ptr %6, align 4, !tbaa !5
  %28 = add nsw i32 %27, 1
  store i32 %28, ptr %6, align 4, !tbaa !5
  %29 = icmp slt i32 %28, %13
  br i1 %29, label %.lr.ph, label %._crit_edge, !llvm.loop !9

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

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

34:                                               ; preds = %24
  %35 = landingpad { ptr, i32 }
          cleanup
  call void @_ZN7maliput7utility4mesh7GeoFaceD2Ev(ptr noundef nonnull align 8 dereferenceable(48) %8) #4
  br label %36

36:                                               ; preds = %34, %32
  %.pn = phi { ptr, i32 } [ %35, %34 ], [ %33, %32 ]
  call void @llvm.lifetime.end.p0(i64 48, ptr nonnull %8) #4
  call void @_ZNSt3setIiSt4lessIiESaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(48) %7) #4
  br label %37

37:                                               ; preds = %36, %30
  %.pn.pn = phi { ptr, i32 } [ %.pn, %36 ], [ %31, %30 ]
  call void @llvm.lifetime.end.p0(i64 48, ptr nonnull %7) #4
  br label %38

38:                                               ; preds = %37, %19
  %.pn.pn.pn = phi { ptr, i32 } [ %.pn.pn, %37 ], [ %20, %19 ]
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %6) #4
  call void @_ZNSt13unordered_mapIiSt6vectorIN7maliput7utility4mesh13FaceEdgeIndexESaIS4_EESt4hashIiESt8equal_toIiESaISt4pairIKiS6_EEED2Ev(ptr noundef nonnull align 8 dereferenceable(56) %5) #4
  br label %39

39:                                               ; preds = %38, %15
  %.pn.pn.pn.pn = phi { ptr, i32 } [ %.pn.pn.pn, %38 ], [ %16, %15 ]
  call void @llvm.lifetime.end.p0(i64 56, ptr nonnull %5) #4
  call void @_ZNSt3setIiSt4lessIiESaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(48) %4) #4
  call void @llvm.lifetime.end.p0(i64 48, ptr nonnull %4) #4
  call void @_ZN7maliput7utility4mesh7GeoMeshD2Ev(ptr noundef nonnull align 8 dereferenceable(184) %0) #4
  resume { ptr, i32 } %.pn.pn.pn.pn
}

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN7maliput7utility4mesh7GeoMesh8PushFaceERKNS1_7GeoFaceE(ptr noundef nonnull align 8 dereferenceable(184), ptr noundef nonnull align 8 dereferenceable(48)) local_unnamed_addr #2 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN7maliput7utility4mesh7GeoMeshD2Ev(ptr noundef nonnull align 8 dereferenceable(184)) unnamed_addr #3 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 = { 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 #4 = { 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 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}


; Effective O3 passes: GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,PostOrderFunctionAttrsPass,SROAPass,SimplifyCFGPass,TailCallElimPass