; LLVM IR from Yinxiaoli/iros2015_folding :: src/folding_planner_cmake/project/2dregistration_v2 (mesh2d)

; 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.__gnu_cxx::__normal_iterator" = type { ptr }
%"class.__gnu_cxx::__normal_iterator.30" = type { ptr }
%"class.__gnu_cxx::__normal_iterator.31" = type { ptr }
%struct.SMesh = type <{ %"class.std::vector", %"class.std::vector.0", %"class.std::vector.5", %"class.std::map", i32, [4 x i8] }>
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<SVertex *, std::allocator<SVertex *>>::_Vector_impl" }
%"struct.std::_Vector_base<SVertex *, std::allocator<SVertex *>>::_Vector_impl" = type { %"struct.std::_Vector_base<SVertex *, std::allocator<SVertex *>>::_Vector_impl_data" }
%"struct.std::_Vector_base<SVertex *, std::allocator<SVertex *>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::vector.0" = type { %"struct.std::_Vector_base.1" }
%"struct.std::_Vector_base.1" = type { %"struct.std::_Vector_base<SHalfEdge *, std::allocator<SHalfEdge *>>::_Vector_impl" }
%"struct.std::_Vector_base<SHalfEdge *, std::allocator<SHalfEdge *>>::_Vector_impl" = type { %"struct.std::_Vector_base<SHalfEdge *, std::allocator<SHalfEdge *>>::_Vector_impl_data" }
%"struct.std::_Vector_base<SHalfEdge *, std::allocator<SHalfEdge *>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::vector.5" = type { %"struct.std::_Vector_base.6" }
%"struct.std::_Vector_base.6" = type { %"struct.std::_Vector_base<SFace *, std::allocator<SFace *>>::_Vector_impl" }
%"struct.std::_Vector_base<SFace *, std::allocator<SFace *>>::_Vector_impl" = type { %"struct.std::_Vector_base<SFace *, std::allocator<SFace *>>::_Vector_impl_data" }
%"struct.std::_Vector_base<SFace *, std::allocator<SFace *>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::map" = type { %"class.std::_Rb_tree" }
%"class.std::_Rb_tree" = type { %"struct.std::_Rb_tree<SVertexPair, std::pair<const SVertexPair, SHalfEdge *>, std::_Select1st<std::pair<const SVertexPair, SHalfEdge *>>, std::less<SVertexPair>>::_Rb_tree_impl" }
%"struct.std::_Rb_tree<SVertexPair, std::pair<const SVertexPair, SHalfEdge *>, std::_Select1st<std::pair<const SVertexPair, SHalfEdge *>>, std::less<SVertexPair>>::_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 }
%struct.SVertex = type { ptr, i8, i32, i8, i8 }
%struct.SHalfEdge = type { ptr, ptr, ptr, ptr, ptr, i32, i32, i8, i8 }
%struct.SFace = type { ptr, i32, i8, i8 }

; 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 ptr @_ZNSt6vectorIP7SVertexSaIS1_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24)) #1 align 2

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

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local ptr @_ZN9__gnu_cxx17__normal_iteratorIPP7SVertexSt6vectorIS2_SaIS2_EEEppEi(ptr noundef nonnull align 8 dereferenceable(8), i32 noundef) #1 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_Z9markEdgesP5SMesh(ptr noundef) #1

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

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

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local ptr @_ZN9__gnu_cxx17__normal_iteratorIPP9SHalfEdgeSt6vectorIS2_SaIS2_EEEppEi(ptr noundef nonnull align 8 dereferenceable(8), i32 noundef) #1 align 2

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

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

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local ptr @_ZN9__gnu_cxx17__normal_iteratorIPP5SFaceSt6vectorIS2_SaIS2_EEEppEi(ptr noundef nonnull align 8 dereferenceable(8), i32 noundef) #1 align 2

; Function Attrs: mustprogress nounwind uwtable
define dso_local void @_Z15resetElementIDsP5SMeshPii(ptr noundef %0, ptr noundef %1, i32 noundef %2) #1 {
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %10 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %11 = alloca i32, align 4
  %12 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %13 = alloca i32, align 4
  %14 = alloca %"class.__gnu_cxx::__normal_iterator.30", align 8
  %15 = alloca %"class.__gnu_cxx::__normal_iterator.30", align 8
  %16 = alloca %"class.__gnu_cxx::__normal_iterator.30", align 8
  %17 = alloca %"class.__gnu_cxx::__normal_iterator.31", align 8
  %18 = alloca %"class.__gnu_cxx::__normal_iterator.31", align 8
  %19 = alloca %"class.__gnu_cxx::__normal_iterator.31", align 8
  store ptr %0, ptr %4, align 8, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !5
  store i32 %2, ptr %6, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #3
  store i32 0, ptr %7, align 4, !tbaa !9
  br label %20

20:                                               ; preds = %30, %3
  %21 = load i32, ptr %7, align 4, !tbaa !9
  %22 = load i32, ptr %6, align 4, !tbaa !9
  %23 = icmp slt i32 %21, %22
  br i1 %23, label %25, label %24

24:                                               ; preds = %20
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #3
  br label %33

25:                                               ; preds = %20
  %26 = load ptr, ptr %5, align 8, !tbaa !5
  %27 = load i32, ptr %7, align 4, !tbaa !9
  %28 = sext i32 %27 to i64
  %29 = getelementptr inbounds i32, ptr %26, i64 %28
  store i32 -1, ptr %29, align 4, !tbaa !9
  br label %30

30:                                               ; preds = %25
  %31 = load i32, ptr %7, align 4, !tbaa !9
  %32 = add nsw i32 %31, 1
  store i32 %32, ptr %7, align 4, !tbaa !9
  br label %20, !llvm.loop !11

33:                                               ; preds = %24
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #3
  store i32 0, ptr %8, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #3
  %34 = load ptr, ptr %4, align 8, !tbaa !5
  %35 = getelementptr inbounds %struct.SMesh, ptr %34, i32 0, i32 0
  %36 = call ptr @_ZNSt6vectorIP7SVertexSaIS1_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %35) #3
  %37 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %9, i32 0, i32 0
  store ptr %36, ptr %37, align 8
  br label %38

38:                                               ; preds = %67, %33
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #3
  %39 = load ptr, ptr %4, align 8, !tbaa !5
  %40 = getelementptr inbounds %struct.SMesh, ptr %39, i32 0, i32 0
  %41 = call ptr @_ZNSt6vectorIP7SVertexSaIS1_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %40) #3
  %42 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %10, i32 0, i32 0
  store ptr %41, ptr %42, align 8
  %43 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPP7SVertexSt6vectorIS2_SaIS2_EEEEbRKNS_17__normal_iteratorIT_T0_EESC_(ptr noundef nonnull align 8 dereferenceable(8) %9, ptr noundef nonnull align 8 dereferenceable(8) %10) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #3
  br i1 %43, label %44, label %70

44:                                               ; preds = %38
  %45 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPP7SVertexSt6vectorIS2_SaIS2_EEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %9) #3
  %46 = load ptr, ptr %45, align 8, !tbaa !5
  %47 = getelementptr inbounds %struct.SVertex, ptr %46, i32 0, i32 3
  %48 = load i8, ptr %47, align 8, !tbaa !13, !range !16, !noundef !17
  %49 = trunc i8 %48 to i1
  br i1 %49, label %51, label %50

50:                                               ; preds = %44
  br label %67

51:                                               ; preds = %44
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #3
  %52 = load i32, ptr %8, align 4, !tbaa !9
  store i32 %52, ptr %11, align 4, !tbaa !9
  %53 = load i32, ptr %8, align 4, !tbaa !9
  %54 = load ptr, ptr %5, align 8, !tbaa !5
  %55 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPP7SVertexSt6vectorIS2_SaIS2_EEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %9) #3
  %56 = load ptr, ptr %55, align 8, !tbaa !5
  %57 = getelementptr inbounds %struct.SVertex, ptr %56, i32 0, i32 2
  %58 = load i32, ptr %57, align 4, !tbaa !18
  %59 = sext i32 %58 to i64
  %60 = getelementptr inbounds i32, ptr %54, i64 %59
  store i32 %53, ptr %60, align 4, !tbaa !9
  %61 = load i32, ptr %11, align 4, !tbaa !9
  %62 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPP7SVertexSt6vectorIS2_SaIS2_EEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %9) #3
  %63 = load ptr, ptr %62, align 8, !tbaa !5
  %64 = getelementptr inbounds %struct.SVertex, ptr %63, i32 0, i32 2
  store i32 %61, ptr %64, align 4, !tbaa !18
  %65 = load i32, ptr %8, align 4, !tbaa !9
  %66 = add nsw i32 %65, 1
  store i32 %66, ptr %8, align 4, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #3
  br label %67

67:                                               ; preds = %51, %50
  %68 = call ptr @_ZN9__gnu_cxx17__normal_iteratorIPP7SVertexSt6vectorIS2_SaIS2_EEEppEi(ptr noundef nonnull align 8 dereferenceable(8) %9, i32 noundef 0) #3
  %69 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %12, i32 0, i32 0
  store ptr %68, ptr %69, align 8
  br label %38, !llvm.loop !19

70:                                               ; preds = %38
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #3
  store i32 0, ptr %13, align 4, !tbaa !9
  store i32 0, ptr %8, align 4, !tbaa !9
  %71 = load ptr, ptr %4, align 8, !tbaa !5
  call void @_Z9markEdgesP5SMesh(ptr noundef %71)
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #3
  %72 = load ptr, ptr %4, align 8, !tbaa !5
  %73 = getelementptr inbounds %struct.SMesh, ptr %72, i32 0, i32 1
  %74 = call ptr @_ZNSt6vectorIP9SHalfEdgeSaIS1_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %73) #3
  %75 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator.30", ptr %14, i32 0, i32 0
  store ptr %74, ptr %75, align 8
  br label %76

76:                                               ; preds = %123, %70
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #3
  %77 = load ptr, ptr %4, align 8, !tbaa !5
  %78 = getelementptr inbounds %struct.SMesh, ptr %77, i32 0, i32 1
  %79 = call ptr @_ZNSt6vectorIP9SHalfEdgeSaIS1_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %78) #3
  %80 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator.30", ptr %15, i32 0, i32 0
  store ptr %79, ptr %80, align 8
  %81 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPP9SHalfEdgeSt6vectorIS2_SaIS2_EEEEbRKNS_17__normal_iteratorIT_T0_EESC_(ptr noundef nonnull align 8 dereferenceable(8) %14, ptr noundef nonnull align 8 dereferenceable(8) %15) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #3
  br i1 %81, label %82, label %126

82:                                               ; preds = %76
  %83 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPP9SHalfEdgeSt6vectorIS2_SaIS2_EEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %14) #3
  %84 = load ptr, ptr %83, align 8, !tbaa !5
  %85 = getelementptr inbounds %struct.SHalfEdge, ptr %84, i32 0, i32 7
  %86 = load i8, ptr %85, align 8, !tbaa !20, !range !16, !noundef !17
  %87 = trunc i8 %86 to i1
  br i1 %87, label %89, label %88

88:                                               ; preds = %82
  br label %123

89:                                               ; preds = %82
  %90 = load i32, ptr %13, align 4, !tbaa !9
  %91 = add nsw i32 %90, 1
  store i32 %91, ptr %13, align 4, !tbaa !9
  %92 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPP9SHalfEdgeSt6vectorIS2_SaIS2_EEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %14) #3
  %93 = load ptr, ptr %92, align 8, !tbaa !5
  %94 = getelementptr inbounds %struct.SHalfEdge, ptr %93, i32 0, i32 5
  store i32 %90, ptr %94, align 8, !tbaa !22
  %95 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPP9SHalfEdgeSt6vectorIS2_SaIS2_EEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %14) #3
  %96 = load ptr, ptr %95, align 8, !tbaa !5
  %97 = getelementptr inbounds %struct.SHalfEdge, ptr %96, i32 0, i32 8
  %98 = load i8, ptr %97, align 1, !tbaa !23, !range !16, !noundef !17
  %99 = trunc i8 %98 to i1
  br i1 %99, label %100, label %122

100:                                              ; preds = %89
  %101 = load i32, ptr %8, align 4, !tbaa !9
  %102 = add nsw i32 %101, 1
  store i32 %102, ptr %8, align 4, !tbaa !9
  %103 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPP9SHalfEdgeSt6vectorIS2_SaIS2_EEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %14) #3
  %104 = load ptr, ptr %103, align 8, !tbaa !5
  %105 = getelementptr inbounds %struct.SHalfEdge, ptr %104, i32 0, i32 6
  store i32 %101, ptr %105, align 4, !tbaa !24
  %106 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPP9SHalfEdgeSt6vectorIS2_SaIS2_EEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %14) #3
  %107 = load ptr, ptr %106, align 8, !tbaa !5
  %108 = getelementptr inbounds %struct.SHalfEdge, ptr %107, i32 0, i32 0
  %109 = load ptr, ptr %108, align 8, !tbaa !25
  %110 = icmp ne ptr %109, null
  br i1 %110, label %111, label %121

111:                                              ; preds = %100
  %112 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPP9SHalfEdgeSt6vectorIS2_SaIS2_EEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %14) #3
  %113 = load ptr, ptr %112, align 8, !tbaa !5
  %114 = getelementptr inbounds %struct.SHalfEdge, ptr %113, i32 0, i32 6
  %115 = load i32, ptr %114, align 4, !tbaa !24
  %116 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPP9SHalfEdgeSt6vectorIS2_SaIS2_EEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %14) #3
  %117 = load ptr, ptr %116, align 8, !tbaa !5
  %118 = getelementptr inbounds %struct.SHalfEdge, ptr %117, i32 0, i32 0
  %119 = load ptr, ptr %118, align 8, !tbaa !25
  %120 = getelementptr inbounds %struct.SHalfEdge, ptr %119, i32 0, i32 6
  store i32 %115, ptr %120, align 4, !tbaa !24
  br label %121

121:                                              ; preds = %111, %100
  br label %122

122:                                              ; preds = %121, %89
  br label %123

123:                                              ; preds = %122, %88
  %124 = call ptr @_ZN9__gnu_cxx17__normal_iteratorIPP9SHalfEdgeSt6vectorIS2_SaIS2_EEEppEi(ptr noundef nonnull align 8 dereferenceable(8) %14, i32 noundef 0) #3
  %125 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator.30", ptr %16, i32 0, i32 0
  store ptr %124, ptr %125, align 8
  br label %76, !llvm.loop !26

126:                                              ; preds = %76
  %127 = load i32, ptr %8, align 4, !tbaa !9
  %128 = load ptr, ptr %4, align 8, !tbaa !5
  %129 = getelementptr inbounds %struct.SMesh, ptr %128, i32 0, i32 4
  store i32 %127, ptr %129, align 8, !tbaa !27
  store i32 0, ptr %8, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #3
  %130 = load ptr, ptr %4, align 8, !tbaa !5
  %131 = getelementptr inbounds %struct.SMesh, ptr %130, i32 0, i32 2
  %132 = call ptr @_ZNSt6vectorIP5SFaceSaIS1_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %131) #3
  %133 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator.31", ptr %17, i32 0, i32 0
  store ptr %132, ptr %133, align 8
  br label %134

134:                                              ; preds = %153, %126
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #3
  %135 = load ptr, ptr %4, align 8, !tbaa !5
  %136 = getelementptr inbounds %struct.SMesh, ptr %135, i32 0, i32 2
  %137 = call ptr @_ZNSt6vectorIP5SFaceSaIS1_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %136) #3
  %138 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator.31", ptr %18, i32 0, i32 0
  store ptr %137, ptr %138, align 8
  %139 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPP5SFaceSt6vectorIS2_SaIS2_EEEEbRKNS_17__normal_iteratorIT_T0_EESC_(ptr noundef nonnull align 8 dereferenceable(8) %17, ptr noundef nonnull align 8 dereferenceable(8) %18) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #3
  br i1 %139, label %140, label %156

140:                                              ; preds = %134
  %141 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPP5SFaceSt6vectorIS2_SaIS2_EEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %17) #3
  %142 = load ptr, ptr %141, align 8, !tbaa !5
  %143 = getelementptr inbounds %struct.SFace, ptr %142, i32 0, i32 2
  %144 = load i8, ptr %143, align 4, !tbaa !50, !range !16, !noundef !17
  %145 = trunc i8 %144 to i1
  br i1 %145, label %147, label %146

146:                                              ; preds = %140
  br label %153

147:                                              ; preds = %140
  %148 = load i32, ptr %8, align 4, !tbaa !9
  %149 = add nsw i32 %148, 1
  store i32 %149, ptr %8, align 4, !tbaa !9
  %150 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPP5SFaceSt6vectorIS2_SaIS2_EEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %17) #3
  %151 = load ptr, ptr %150, align 8, !tbaa !5
  %152 = getelementptr inbounds %struct.SFace, ptr %151, i32 0, i32 1
  store i32 %148, ptr %152, align 8, !tbaa !52
  br label %153

153:                                              ; preds = %147, %146
  %154 = call ptr @_ZN9__gnu_cxx17__normal_iteratorIPP5SFaceSt6vectorIS2_SaIS2_EEEppEi(ptr noundef nonnull align 8 dereferenceable(8) %17, i32 noundef 0) #3
  %155 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator.31", ptr %19, i32 0, i32 0
  store ptr %154, ptr %155, align 8
  br label %134, !llvm.loop !53

156:                                              ; preds = %134
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #3
  ret void
}

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 = { 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 #3 = { 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 = !{!"int", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = !{!14, !15, i64 16}
!14 = !{!"_ZTS7SVertex", !6, i64 0, !15, i64 8, !10, i64 12, !15, i64 16, !15, i64 17}
!15 = !{!"bool", !7, i64 0}
!16 = !{i8 0, i8 2}
!17 = !{}
!18 = !{!14, !10, i64 12}
!19 = distinct !{!19, !12}
!20 = !{!21, !15, i64 48}
!21 = !{!"_ZTS9SHalfEdge", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !10, i64 40, !10, i64 44, !15, i64 48, !15, i64 49}
!22 = !{!21, !10, i64 40}
!23 = !{!21, !15, i64 49}
!24 = !{!21, !10, i64 44}
!25 = !{!21, !6, i64 0}
!26 = distinct !{!26, !12}
!27 = !{!28, !10, i64 120}
!28 = !{!"_ZTS5SMesh", !29, i64 0, !33, i64 24, !37, i64 48, !41, i64 72, !10, i64 120}
!29 = !{!"_ZTSSt6vectorIP7SVertexSaIS1_EE", !30, i64 0}
!30 = !{!"_ZTSSt12_Vector_baseIP7SVertexSaIS1_EE", !31, i64 0}
!31 = !{!"_ZTSNSt12_Vector_baseIP7SVertexSaIS1_EE12_Vector_implE", !32, i64 0}
!32 = !{!"_ZTSNSt12_Vector_baseIP7SVertexSaIS1_EE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!33 = !{!"_ZTSSt6vectorIP9SHalfEdgeSaIS1_EE", !34, i64 0}
!34 = !{!"_ZTSSt12_Vector_baseIP9SHalfEdgeSaIS1_EE", !35, i64 0}
!35 = !{!"_ZTSNSt12_Vector_baseIP9SHalfEdgeSaIS1_EE12_Vector_implE", !36, i64 0}
!36 = !{!"_ZTSNSt12_Vector_baseIP9SHalfEdgeSaIS1_EE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!37 = !{!"_ZTSSt6vectorIP5SFaceSaIS1_EE", !38, i64 0}
!38 = !{!"_ZTSSt12_Vector_baseIP5SFaceSaIS1_EE", !39, i64 0}
!39 = !{!"_ZTSNSt12_Vector_baseIP5SFaceSaIS1_EE12_Vector_implE", !40, i64 0}
!40 = !{!"_ZTSNSt12_Vector_baseIP5SFaceSaIS1_EE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!41 = !{!"_ZTSSt3mapI11SVertexPairP9SHalfEdgeSt4lessIS0_ESaISt4pairIKS0_S2_EEE", !42, i64 0}
!42 = !{!"_ZTSSt8_Rb_treeI11SVertexPairSt4pairIKS0_P9SHalfEdgeESt10_Select1stIS5_ESt4lessIS0_ESaIS5_EE", !43, i64 0}
!43 = !{!"_ZTSNSt8_Rb_treeI11SVertexPairSt4pairIKS0_P9SHalfEdgeESt10_Select1stIS5_ESt4lessIS0_ESaIS5_EE13_Rb_tree_implIS9_Lb1EEE", !44, i64 0, !46, i64 8}
!44 = !{!"_ZTSSt20_Rb_tree_key_compareISt4lessI11SVertexPairEE", !45, i64 0}
!45 = !{!"_ZTSSt4lessI11SVertexPairE"}
!46 = !{!"_ZTSSt15_Rb_tree_header", !47, i64 0, !49, i64 32}
!47 = !{!"_ZTSSt18_Rb_tree_node_base", !48, i64 0, !6, i64 8, !6, i64 16, !6, i64 24}
!48 = !{!"_ZTSSt14_Rb_tree_color", !7, i64 0}
!49 = !{!"long", !7, i64 0}
!50 = !{!51, !15, i64 12}
!51 = !{!"_ZTS5SFace", !6, i64 0, !10, i64 8, !15, i64 12, !15, i64 13}
!52 = !{!51, !10, i64 8}
!53 = distinct !{!53, !12}


; 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.__gnu_cxx::__normal_iterator" = type { ptr }
%"class.__gnu_cxx::__normal_iterator.30" = type { ptr }
%"class.__gnu_cxx::__normal_iterator.31" = type { 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 ptr @_ZNSt6vectorIP7SVertexSaIS1_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #1 align 2

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

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local ptr @_ZN9__gnu_cxx17__normal_iteratorIPP7SVertexSt6vectorIS2_SaIS2_EEEppEi(ptr noundef nonnull align 8 dereferenceable(8), i32 noundef) local_unnamed_addr #1 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_Z9markEdgesP5SMesh(ptr noundef) local_unnamed_addr #1

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

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

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local ptr @_ZN9__gnu_cxx17__normal_iteratorIPP9SHalfEdgeSt6vectorIS2_SaIS2_EEEppEi(ptr noundef nonnull align 8 dereferenceable(8), i32 noundef) local_unnamed_addr #1 align 2

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

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

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local ptr @_ZN9__gnu_cxx17__normal_iteratorIPP5SFaceSt6vectorIS2_SaIS2_EEEppEi(ptr noundef nonnull align 8 dereferenceable(8), i32 noundef) local_unnamed_addr #1 align 2

; Function Attrs: mustprogress nounwind uwtable
define dso_local void @_Z15resetElementIDsP5SMeshPii(ptr noundef %0, ptr nocapture noundef writeonly %1, i32 noundef %2) local_unnamed_addr #1 {
  %4 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %5 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %6 = alloca %"class.__gnu_cxx::__normal_iterator.30", align 8
  %7 = alloca %"class.__gnu_cxx::__normal_iterator.30", align 8
  %8 = alloca %"class.__gnu_cxx::__normal_iterator.31", align 8
  %9 = alloca %"class.__gnu_cxx::__normal_iterator.31", align 8
  %10 = icmp sgt i32 %2, 0
  br i1 %10, label %.lr.ph.preheader, label %._crit_edge

.lr.ph.preheader:                                 ; preds = %3
  %11 = zext nneg i32 %2 to i64
  %12 = shl nuw nsw i64 %11, 2
  tail call void @llvm.memset.p0.i64(ptr align 4 %1, i8 -1, i64 %12, i1 false), !tbaa !5
  br label %._crit_edge

._crit_edge:                                      ; preds = %.lr.ph.preheader, %3
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #4
  %13 = tail call ptr @_ZNSt6vectorIP7SVertexSaIS1_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %0) #4
  store ptr %13, ptr %4, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #4
  %14 = tail call ptr @_ZNSt6vectorIP7SVertexSaIS1_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %0) #4
  store ptr %14, ptr %5, align 8
  %15 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPP7SVertexSt6vectorIS2_SaIS2_EEEEbRKNS_17__normal_iteratorIT_T0_EESC_(ptr noundef nonnull align 8 dereferenceable(8) %4, ptr noundef nonnull align 8 dereferenceable(8) %5) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #4
  br i1 %15, label %.lr.ph29, label %._crit_edge30

.lr.ph29:                                         ; preds = %._crit_edge, %32
  %.02327 = phi i32 [ %.1, %32 ], [ 0, %._crit_edge ]
  %16 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPP7SVertexSt6vectorIS2_SaIS2_EEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %4) #4
  %17 = load ptr, ptr %16, align 8, !tbaa !9
  %18 = getelementptr inbounds i8, ptr %17, i64 16
  %19 = load i8, ptr %18, align 8, !tbaa !11, !range !14, !noundef !15
  %20 = trunc nuw i8 %19 to i1
  br i1 %20, label %21, label %32

21:                                               ; preds = %.lr.ph29
  %22 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPP7SVertexSt6vectorIS2_SaIS2_EEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %4) #4
  %23 = load ptr, ptr %22, align 8, !tbaa !9
  %24 = getelementptr inbounds i8, ptr %23, i64 12
  %25 = load i32, ptr %24, align 4, !tbaa !16
  %26 = sext i32 %25 to i64
  %27 = getelementptr inbounds i32, ptr %1, i64 %26
  store i32 %.02327, ptr %27, align 4, !tbaa !5
  %28 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPP7SVertexSt6vectorIS2_SaIS2_EEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %4) #4
  %29 = load ptr, ptr %28, align 8, !tbaa !9
  %30 = getelementptr inbounds i8, ptr %29, i64 12
  store i32 %.02327, ptr %30, align 4, !tbaa !16
  %31 = add nsw i32 %.02327, 1
  br label %32

32:                                               ; preds = %.lr.ph29, %21
  %.1 = phi i32 [ %31, %21 ], [ %.02327, %.lr.ph29 ]
  %33 = call ptr @_ZN9__gnu_cxx17__normal_iteratorIPP7SVertexSt6vectorIS2_SaIS2_EEEppEi(ptr noundef nonnull align 8 dereferenceable(8) %4, i32 noundef 0) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #4
  %34 = call ptr @_ZNSt6vectorIP7SVertexSaIS1_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %0) #4
  store ptr %34, ptr %5, align 8
  %35 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPP7SVertexSt6vectorIS2_SaIS2_EEEEbRKNS_17__normal_iteratorIT_T0_EESC_(ptr noundef nonnull align 8 dereferenceable(8) %4, ptr noundef nonnull align 8 dereferenceable(8) %5) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #4
  br i1 %35, label %.lr.ph29, label %._crit_edge30, !llvm.loop !17

._crit_edge30:                                    ; preds = %32, %._crit_edge
  call void @_Z9markEdgesP5SMesh(ptr noundef nonnull %0)
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #4
  %36 = getelementptr inbounds i8, ptr %0, i64 24
  %37 = call ptr @_ZNSt6vectorIP9SHalfEdgeSaIS1_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %36) #4
  store ptr %37, ptr %6, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %7) #4
  %38 = call ptr @_ZNSt6vectorIP9SHalfEdgeSaIS1_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %36) #4
  store ptr %38, ptr %7, align 8
  %39 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPP9SHalfEdgeSt6vectorIS2_SaIS2_EEEEbRKNS_17__normal_iteratorIT_T0_EESC_(ptr noundef nonnull align 8 dereferenceable(8) %6, ptr noundef nonnull align 8 dereferenceable(8) %7) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #4
  br i1 %39, label %.lr.ph34, label %._crit_edge35

.lr.ph34:                                         ; preds = %._crit_edge30, %72
  %.232 = phi i32 [ %.3, %72 ], [ 0, %._crit_edge30 ]
  %.02431 = phi i32 [ %.125, %72 ], [ 0, %._crit_edge30 ]
  %40 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPP9SHalfEdgeSt6vectorIS2_SaIS2_EEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %6) #4
  %41 = load ptr, ptr %40, align 8, !tbaa !9
  %42 = getelementptr inbounds i8, ptr %41, i64 48
  %43 = load i8, ptr %42, align 8, !tbaa !19, !range !14, !noundef !15
  %44 = trunc nuw i8 %43 to i1
  br i1 %44, label %45, label %72

45:                                               ; preds = %.lr.ph34
  %46 = add nsw i32 %.02431, 1
  %47 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPP9SHalfEdgeSt6vectorIS2_SaIS2_EEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %6) #4
  %48 = load ptr, ptr %47, align 8, !tbaa !9
  %49 = getelementptr inbounds i8, ptr %48, i64 40
  store i32 %.02431, ptr %49, align 8, !tbaa !21
  %50 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPP9SHalfEdgeSt6vectorIS2_SaIS2_EEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %6) #4
  %51 = load ptr, ptr %50, align 8, !tbaa !9
  %52 = getelementptr inbounds i8, ptr %51, i64 49
  %53 = load i8, ptr %52, align 1, !tbaa !22, !range !14, !noundef !15
  %54 = trunc nuw i8 %53 to i1
  br i1 %54, label %55, label %72

55:                                               ; preds = %45
  %56 = add nsw i32 %.232, 1
  %57 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPP9SHalfEdgeSt6vectorIS2_SaIS2_EEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %6) #4
  %58 = load ptr, ptr %57, align 8, !tbaa !9
  %59 = getelementptr inbounds i8, ptr %58, i64 44
  store i32 %.232, ptr %59, align 4, !tbaa !23
  %60 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPP9SHalfEdgeSt6vectorIS2_SaIS2_EEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %6) #4
  %61 = load ptr, ptr %60, align 8, !tbaa !9
  %62 = load ptr, ptr %61, align 8, !tbaa !24
  %.not = icmp eq ptr %62, null
  br i1 %.not, label %72, label %63

63:                                               ; preds = %55
  %64 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPP9SHalfEdgeSt6vectorIS2_SaIS2_EEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %6) #4
  %65 = load ptr, ptr %64, align 8, !tbaa !9
  %66 = getelementptr inbounds i8, ptr %65, i64 44
  %67 = load i32, ptr %66, align 4, !tbaa !23
  %68 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPP9SHalfEdgeSt6vectorIS2_SaIS2_EEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %6) #4
  %69 = load ptr, ptr %68, align 8, !tbaa !9
  %70 = load ptr, ptr %69, align 8, !tbaa !24
  %71 = getelementptr inbounds i8, ptr %70, i64 44
  store i32 %67, ptr %71, align 4, !tbaa !23
  br label %72

72:                                               ; preds = %45, %63, %55, %.lr.ph34
  %.125 = phi i32 [ %46, %63 ], [ %46, %55 ], [ %46, %45 ], [ %.02431, %.lr.ph34 ]
  %.3 = phi i32 [ %56, %63 ], [ %56, %55 ], [ %.232, %45 ], [ %.232, %.lr.ph34 ]
  %73 = call ptr @_ZN9__gnu_cxx17__normal_iteratorIPP9SHalfEdgeSt6vectorIS2_SaIS2_EEEppEi(ptr noundef nonnull align 8 dereferenceable(8) %6, i32 noundef 0) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %7) #4
  %74 = call ptr @_ZNSt6vectorIP9SHalfEdgeSaIS1_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %36) #4
  store ptr %74, ptr %7, align 8
  %75 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPP9SHalfEdgeSt6vectorIS2_SaIS2_EEEEbRKNS_17__normal_iteratorIT_T0_EESC_(ptr noundef nonnull align 8 dereferenceable(8) %6, ptr noundef nonnull align 8 dereferenceable(8) %7) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #4
  br i1 %75, label %.lr.ph34, label %._crit_edge35, !llvm.loop !25

._crit_edge35:                                    ; preds = %72, %._crit_edge30
  %.2.lcssa = phi i32 [ 0, %._crit_edge30 ], [ %.3, %72 ]
  %76 = getelementptr inbounds i8, ptr %0, i64 120
  store i32 %.2.lcssa, ptr %76, align 8, !tbaa !26
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %8) #4
  %77 = getelementptr inbounds i8, ptr %0, i64 48
  %78 = call ptr @_ZNSt6vectorIP5SFaceSaIS1_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %77) #4
  store ptr %78, ptr %8, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %9) #4
  %79 = call ptr @_ZNSt6vectorIP5SFaceSaIS1_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %77) #4
  store ptr %79, ptr %9, align 8
  %80 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPP5SFaceSt6vectorIS2_SaIS2_EEEEbRKNS_17__normal_iteratorIT_T0_EESC_(ptr noundef nonnull align 8 dereferenceable(8) %8, ptr noundef nonnull align 8 dereferenceable(8) %9) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %9) #4
  br i1 %80, label %.lr.ph38, label %._crit_edge39

.lr.ph38:                                         ; preds = %._crit_edge35, %91
  %.436 = phi i32 [ %.5, %91 ], [ 0, %._crit_edge35 ]
  %81 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPP5SFaceSt6vectorIS2_SaIS2_EEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %8) #4
  %82 = load ptr, ptr %81, align 8, !tbaa !9
  %83 = getelementptr inbounds i8, ptr %82, i64 12
  %84 = load i8, ptr %83, align 4, !tbaa !49, !range !14, !noundef !15
  %85 = trunc nuw i8 %84 to i1
  br i1 %85, label %86, label %91

86:                                               ; preds = %.lr.ph38
  %87 = add nsw i32 %.436, 1
  %88 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPP5SFaceSt6vectorIS2_SaIS2_EEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %8) #4
  %89 = load ptr, ptr %88, align 8, !tbaa !9
  %90 = getelementptr inbounds i8, ptr %89, i64 8
  store i32 %.436, ptr %90, align 8, !tbaa !51
  br label %91

91:                                               ; preds = %.lr.ph38, %86
  %.5 = phi i32 [ %87, %86 ], [ %.436, %.lr.ph38 ]
  %92 = call ptr @_ZN9__gnu_cxx17__normal_iteratorIPP5SFaceSt6vectorIS2_SaIS2_EEEppEi(ptr noundef nonnull align 8 dereferenceable(8) %8, i32 noundef 0) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %9) #4
  %93 = call ptr @_ZNSt6vectorIP5SFaceSaIS1_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %77) #4
  store ptr %93, ptr %9, align 8
  %94 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPP5SFaceSt6vectorIS2_SaIS2_EEEEbRKNS_17__normal_iteratorIT_T0_EESC_(ptr noundef nonnull align 8 dereferenceable(8) %8, ptr noundef nonnull align 8 dereferenceable(8) %9) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %9) #4
  br i1 %94, label %.lr.ph38, label %._crit_edge39, !llvm.loop !52

._crit_edge39:                                    ; preds = %91, %._crit_edge35
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #4
  ret void
}

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #3

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 = { 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 #3 = { nocallback nofree nounwind willreturn memory(argmem: write) }
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 = !{!10, !10, i64 0}
!10 = !{!"any pointer", !7, i64 0}
!11 = !{!12, !13, i64 16}
!12 = !{!"_ZTS7SVertex", !10, i64 0, !13, i64 8, !6, i64 12, !13, i64 16, !13, i64 17}
!13 = !{!"bool", !7, i64 0}
!14 = !{i8 0, i8 2}
!15 = !{}
!16 = !{!12, !6, i64 12}
!17 = distinct !{!17, !18}
!18 = !{!"llvm.loop.mustprogress"}
!19 = !{!20, !13, i64 48}
!20 = !{!"_ZTS9SHalfEdge", !10, i64 0, !10, i64 8, !10, i64 16, !10, i64 24, !10, i64 32, !6, i64 40, !6, i64 44, !13, i64 48, !13, i64 49}
!21 = !{!20, !6, i64 40}
!22 = !{!20, !13, i64 49}
!23 = !{!20, !6, i64 44}
!24 = !{!20, !10, i64 0}
!25 = distinct !{!25, !18}
!26 = !{!27, !6, i64 120}
!27 = !{!"_ZTS5SMesh", !28, i64 0, !32, i64 24, !36, i64 48, !40, i64 72, !6, i64 120}
!28 = !{!"_ZTSSt6vectorIP7SVertexSaIS1_EE", !29, i64 0}
!29 = !{!"_ZTSSt12_Vector_baseIP7SVertexSaIS1_EE", !30, i64 0}
!30 = !{!"_ZTSNSt12_Vector_baseIP7SVertexSaIS1_EE12_Vector_implE", !31, i64 0}
!31 = !{!"_ZTSNSt12_Vector_baseIP7SVertexSaIS1_EE17_Vector_impl_dataE", !10, i64 0, !10, i64 8, !10, i64 16}
!32 = !{!"_ZTSSt6vectorIP9SHalfEdgeSaIS1_EE", !33, i64 0}
!33 = !{!"_ZTSSt12_Vector_baseIP9SHalfEdgeSaIS1_EE", !34, i64 0}
!34 = !{!"_ZTSNSt12_Vector_baseIP9SHalfEdgeSaIS1_EE12_Vector_implE", !35, i64 0}
!35 = !{!"_ZTSNSt12_Vector_baseIP9SHalfEdgeSaIS1_EE17_Vector_impl_dataE", !10, i64 0, !10, i64 8, !10, i64 16}
!36 = !{!"_ZTSSt6vectorIP5SFaceSaIS1_EE", !37, i64 0}
!37 = !{!"_ZTSSt12_Vector_baseIP5SFaceSaIS1_EE", !38, i64 0}
!38 = !{!"_ZTSNSt12_Vector_baseIP5SFaceSaIS1_EE12_Vector_implE", !39, i64 0}
!39 = !{!"_ZTSNSt12_Vector_baseIP5SFaceSaIS1_EE17_Vector_impl_dataE", !10, i64 0, !10, i64 8, !10, i64 16}
!40 = !{!"_ZTSSt3mapI11SVertexPairP9SHalfEdgeSt4lessIS0_ESaISt4pairIKS0_S2_EEE", !41, i64 0}
!41 = !{!"_ZTSSt8_Rb_treeI11SVertexPairSt4pairIKS0_P9SHalfEdgeESt10_Select1stIS5_ESt4lessIS0_ESaIS5_EE", !42, i64 0}
!42 = !{!"_ZTSNSt8_Rb_treeI11SVertexPairSt4pairIKS0_P9SHalfEdgeESt10_Select1stIS5_ESt4lessIS0_ESaIS5_EE13_Rb_tree_implIS9_Lb1EEE", !43, i64 0, !45, i64 8}
!43 = !{!"_ZTSSt20_Rb_tree_key_compareISt4lessI11SVertexPairEE", !44, i64 0}
!44 = !{!"_ZTSSt4lessI11SVertexPairE"}
!45 = !{!"_ZTSSt15_Rb_tree_header", !46, i64 0, !48, i64 32}
!46 = !{!"_ZTSSt18_Rb_tree_node_base", !47, i64 0, !10, i64 8, !10, i64 16, !10, i64 24}
!47 = !{!"_ZTSSt14_Rb_tree_color", !7, i64 0}
!48 = !{!"long", !7, i64 0}
!49 = !{!50, !13, i64 12}
!50 = !{!"_ZTS5SFace", !10, i64 0, !6, i64 8, !13, i64 12, !13, i64 13}
!51 = !{!50, !6, i64 8}
!52 = distinct !{!52, !18}


; Effective O3 passes: EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LoopIdiomRecognizePass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,PostOrderFunctionAttrsPass,SROAPass,SimplifyCFGPass,TailCallElimPass