; LLVM IR from atlantis13579/Riemann :: Src/Geometry (GeometryBoolean)

; 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.Maths::TVector3" = type { float, float, float }
%"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.__gnu_cxx::__normal_iterator.57" = type { ptr }
%"class.Maths::TIndex3" = type { i32, i32, i32 }
%class.anon.58 = type { ptr, ptr, ptr, ptr }
%"struct.Riemann::FEdgeCollapseInfo" = type { i32, i32, %"class.Maths::TIndex2", i8, i32, %"class.Maths::TIndex2", %"class.Maths::TIndex2", %"class.Maths::TIndex2", float }
%"class.Maths::TIndex2" = type { i32, i32 }
%class.anon.59 = type { i8 }
%"struct.std::pair" = type <{ %"struct.std::_Rb_tree_const_iterator", i8, [7 x i8] }>
%"struct.std::_Rb_tree_const_iterator" = type { ptr }
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl" = type { %"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.Riemann::GeometryBoolean" = type { i32, float, i8, i8, i8, i8, i8, float, float, i8, i8, i8, float, i8, float, i32, [2 x ptr], [2 x %"struct.Maths::Transform"], ptr, %"struct.Maths::Transform", %"class.std::vector", %"class.std::set", i8, [7 x i8], %"struct.Riemann::FIndexMapi" }
%"struct.Maths::Transform" = type { %"class.Maths::TVector3", %"class.Maths::Quaternion" }
%"class.Maths::Quaternion" = type { float, float, float, float }
%"struct.Riemann::FIndexMapi" = type <{ %"class.std::map", %"class.std::map", i8, i8, [6 x i8] }>
%"class.std::map" = type { %"class.std::_Rb_tree.3" }
%"class.std::_Rb_tree.3" = type { %"struct.std::_Rb_tree<int, std::pair<const int, int>, std::_Select1st<std::pair<const int, int>>, std::less<int>>::_Rb_tree_impl" }
%"struct.std::_Rb_tree<int, std::pair<const int, int>, std::_Select1st<std::pair<const int, int>>, std::less<int>>::_Rb_tree_impl" = type { [8 x i8], %"struct.std::_Rb_tree_header" }
%"struct.Riemann::DynamicMesh::Edge" = type { %"class.Maths::TIndex2", %"class.Maths::TIndex2" }

@__const._ZN7Riemann21SimplifyAlongNewEdgesEiPPNS_11DynamicMeshEPSt6vectorIiSaIiEERSt3mapIiiSt4lessIiESaISt4pairIKiiEEEPNS_15GeometryBooleanE.Matches = external hidden unnamed_addr constant [2 x i32], align 4
@.str = external hidden unnamed_addr constant [37 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [88 x i8], align 1
@__PRETTY_FUNCTION__._ZN7Riemann21SimplifyAlongNewEdgesEiPPNS_11DynamicMeshEPSt6vectorIiSaIiEERSt3mapIiiSt4lessIiESaISt4pairIKiiEEEPNS_15GeometryBooleanE = external hidden unnamed_addr constant [118 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [20 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [60 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: inlinehint mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZNK7Riemann11DynamicMesh6IsEdgeEi(ptr noundef nonnull align 8 dereferenceable(452), i32 noundef) #1 align 2

declare i32 @__gxx_personality_v0(...)

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZNK7Riemann11DynamicMesh14IsBoundaryEdgeEi(ptr noundef nonnull align 8 dereferenceable(452), i32 noundef) #3 align 2

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

; Function Attrs: mustprogress uwtable
declare dso_local { ptr, i8 } @_ZNSt3setIiSt4lessIiESaIiEE6insertERKi(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 ptr @_ZNSt6vectorIiSaIiEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24)) #4 align 2

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

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZNK5Maths8TVector3IfEmiERKS1_(ptr dead_on_unwind noalias writable sret(%"class.Maths::TVector3") align 4, ptr noundef nonnull align 4 dereferenceable(12), ptr noundef nonnull align 4 dereferenceable(12)) #3 align 2

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN7Riemann21SimplifyAlongNewEdgesEiPPNS_11DynamicMeshEPSt6vectorIiSaIiEERSt3mapIiiSt4lessIiESaISt4pairIKiiEEEPNS_15GeometryBooleanE(i32 noundef %0, ptr noundef %1, ptr noundef %2, ptr noundef nonnull align 8 dereferenceable(48) %3, ptr noundef %4) #2 personality ptr @__gxx_personality_v0 {
  %6 = alloca i32, align 4
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca ptr, align 8
  %10 = alloca ptr, align 8
  %11 = alloca float, align 4
  %12 = alloca [2 x %"class.std::set"], align 16
  %13 = alloca i32, align 4
  %14 = alloca %"class.std::set", align 8
  %15 = alloca %"class.__gnu_cxx::__normal_iterator.57", align 8
  %16 = alloca %"class.__gnu_cxx::__normal_iterator.57", align 8
  %17 = alloca ptr, align 8
  %18 = alloca i32, align 4
  %19 = alloca i32, align 4
  %20 = alloca i32, align 4
  %21 = alloca i32, align 4
  %22 = alloca i32, align 4
  %23 = alloca ptr, align 8
  %24 = alloca %"class.__gnu_cxx::__normal_iterator.57", align 8
  %25 = alloca %"class.__gnu_cxx::__normal_iterator.57", align 8
  %26 = alloca i32, align 4
  %27 = alloca i32, align 4
  %28 = alloca ptr, align 8
  %29 = alloca [2 x i32], align 4
  %30 = alloca i8, align 1
  %31 = alloca i32, align 4
  %32 = alloca ptr, align 8
  %33 = alloca i32, align 4
  %34 = alloca [2 x i8], align 1
  %35 = alloca [2 x [2 x %"class.Maths::TVector3"]], align 16
  %36 = alloca i32, align 4
  %37 = alloca i32, align 4
  %38 = alloca i32, align 4
  %39 = alloca i32, align 4
  %40 = alloca %"class.Maths::TVector3", align 4
  %41 = alloca %"class.Maths::TVector3", align 4
  %42 = alloca %"class.Maths::TVector3", align 4
  %43 = alloca i8, align 1
  %44 = alloca i32, align 4
  %45 = alloca i32, align 4
  %46 = alloca i32, align 4
  %47 = alloca i32, align 4
  %48 = alloca i8, align 1
  %49 = alloca i32, align 4
  %50 = alloca i32, align 4
  %51 = alloca i32, align 4
  %52 = alloca i32, align 4
  %53 = alloca i32, align 4
  %54 = alloca ptr, align 8
  %55 = alloca i32, align 4
  %56 = alloca %"class.Maths::TIndex3", align 4
  %57 = alloca i32, align 4
  %58 = alloca %class.anon.58, align 8
  %59 = alloca %"struct.Riemann::FEdgeCollapseInfo", align 4
  %60 = alloca i32, align 4
  %61 = alloca i32, align 4
  %62 = alloca %class.anon.59, align 1
  %63 = alloca i8, align 1
  %64 = alloca i32, align 4
  %65 = alloca %"struct.std::pair", align 8
  %66 = alloca i32, align 4
  %67 = alloca i32, align 4
  %68 = alloca i8, align 1
  %69 = alloca %"struct.Riemann::FEdgeCollapseInfo", align 4
  %70 = alloca i32, align 4
  %71 = alloca %"struct.std::pair", align 8
  %72 = alloca %"class.std::vector", align 8
  %73 = alloca %"class.std::vector", align 8
  store i32 %0, ptr %6, align 4, !tbaa !5
  store ptr %1, ptr %7, align 8, !tbaa !9
  store ptr %2, ptr %8, align 8, !tbaa !9
  store ptr %3, ptr %9, align 8, !tbaa !9
  store ptr %4, ptr %10, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #10
  %74 = load ptr, ptr %10, align 8, !tbaa !9
  %75 = getelementptr inbounds %"class.Riemann::GeometryBoolean", ptr %74, i32 0, i32 7
  %76 = load float, ptr %75, align 8, !tbaa !11
  %77 = fmul float %76, 0x3F91DF46A0000000
  %78 = call float @cosf(float noundef %77) #10
  store float %78, ptr %11, align 4, !tbaa !36
  call void @llvm.lifetime.start.p0(i64 96, ptr %12) #10
  %79 = getelementptr inbounds [2 x %"class.std::set"], ptr %12, i32 0, i32 0
  %80 = getelementptr inbounds %"class.std::set", ptr %79, i64 2
  br label %81

81:                                               ; preds = %81, %5
  %82 = phi ptr [ %79, %5 ], [ %83, %81 ]
  call void @_ZNSt3setIiSt4lessIiESaIiEEC2Ev(ptr noundef nonnull align 8 dereferenceable(48) %82) #10
  %83 = getelementptr inbounds %"class.std::set", ptr %82, i64 1
  %84 = icmp eq ptr %83, %80
  br i1 %84, label %85, label %81

85:                                               ; preds = %81
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #10
  store i32 0, ptr %13, align 4, !tbaa !5
  br label %86

86:                                               ; preds = %113, %85
  %87 = load i32, ptr %13, align 4, !tbaa !5
  %88 = load i32, ptr %6, align 4, !tbaa !5
  %89 = icmp slt i32 %87, %88
  br i1 %89, label %91, label %90

90:                                               ; preds = %86
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #10
  br label %120

91:                                               ; preds = %86
  call void @llvm.lifetime.start.p0(i64 48, ptr %14) #10
  %92 = load ptr, ptr %8, align 8, !tbaa !9
  %93 = load i32, ptr %13, align 4, !tbaa !5
  %94 = sext i32 %93 to i64
  %95 = getelementptr inbounds %"class.std::vector", ptr %92, i64 %94
  %96 = call ptr @_ZNSt6vectorIiSaIiEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %95) #10
  %97 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator.57", ptr %15, i32 0, i32 0
  store ptr %96, ptr %97, align 8
  %98 = load ptr, ptr %8, align 8, !tbaa !9
  %99 = load i32, ptr %13, align 4, !tbaa !5
  %100 = sext i32 %99 to i64
  %101 = getelementptr inbounds %"class.std::vector", ptr %98, i64 %100
  %102 = call ptr @_ZNSt6vectorIiSaIiEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %101) #10
  %103 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator.57", ptr %16, i32 0, i32 0
  store ptr %102, ptr %103, align 8
  %104 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator.57", ptr %15, i32 0, i32 0
  %105 = load ptr, ptr %104, align 8
  %106 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator.57", ptr %16, i32 0, i32 0
  %107 = load ptr, ptr %106, align 8
  invoke void @_ZNSt3setIiSt4lessIiESaIiEEC2IN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiS2_EEEEET_SB_(ptr noundef nonnull align 8 dereferenceable(48) %14, ptr %105, ptr %107)
          to label %108 unwind label %116

108:                                              ; preds = %91
  %109 = load i32, ptr %13, align 4, !tbaa !5
  %110 = sext i32 %109 to i64
  %111 = getelementptr inbounds [2 x %"class.std::set"], ptr %12, i64 0, i64 %110
  %112 = call noundef nonnull align 8 dereferenceable(48) ptr @_ZNSt3setIiSt4lessIiESaIiEEaSEOS3_(ptr noundef nonnull align 8 dereferenceable(48) %111, ptr noundef nonnull align 8 dereferenceable(48) %14) #10
  call void @_ZNSt3setIiSt4lessIiESaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(48) %14) #10
  call void @llvm.lifetime.end.p0(i64 48, ptr %14) #10
  br label %113

113:                                              ; preds = %108
  %114 = load i32, ptr %13, align 4, !tbaa !5
  %115 = add nsw i32 %114, 1
  store i32 %115, ptr %13, align 4, !tbaa !5
  br label %86, !llvm.loop !37

116:                                              ; preds = %91
  %117 = landingpad { ptr, i32 }
          cleanup
  %118 = extractvalue { ptr, i32 } %117, 0
  store ptr %118, ptr %17, align 8
  %119 = extractvalue { ptr, i32 } %117, 1
  store i32 %119, ptr %18, align 4
  call void @llvm.lifetime.end.p0(i64 48, ptr %14) #10
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #10
  br label %914

120:                                              ; preds = %90
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #10
  store i32 0, ptr %19, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %20) #10
  store i32 0, ptr %20, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %21) #10
  store i32 1, ptr %21, align 4, !tbaa !5
  br label %121

121:                                              ; preds = %904, %120
  %122 = load i32, ptr %20, align 4, !tbaa !5
  %123 = load i32, ptr %21, align 4, !tbaa !5
  %124 = icmp slt i32 %122, %123
  br i1 %124, label %125, label %906

125:                                              ; preds = %121
  call void @llvm.lifetime.start.p0(i64 4, ptr %22) #10
  %126 = load i32, ptr %19, align 4, !tbaa !5
  store i32 %126, ptr %22, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %23) #10
  %127 = load ptr, ptr %8, align 8, !tbaa !9
  %128 = getelementptr inbounds %"class.std::vector", ptr %127, i64 0
  store ptr %128, ptr %23, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %24) #10
  %129 = load ptr, ptr %23, align 8, !tbaa !9
  %130 = call ptr @_ZNSt6vectorIiSaIiEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %129) #10
  %131 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator.57", ptr %24, i32 0, i32 0
  store ptr %130, ptr %131, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %25) #10
  %132 = load ptr, ptr %23, align 8, !tbaa !9
  %133 = call ptr @_ZNSt6vectorIiSaIiEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %132) #10
  %134 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator.57", ptr %25, i32 0, i32 0
  store ptr %133, ptr %134, align 8
  br label %135

135:                                              ; preds = %867, %125
  %136 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPiSt6vectorIiSaIiEEEEbRKNS_17__normal_iteratorIT_T0_EESA_(ptr noundef nonnull align 8 dereferenceable(8) %24, ptr noundef nonnull align 8 dereferenceable(8) %25) #10
  br i1 %136, label %138, label %137

137:                                              ; preds = %135
  store i32 7, ptr %26, align 4
  br label %875

138:                                              ; preds = %135
  call void @llvm.lifetime.start.p0(i64 4, ptr %27) #10
  %139 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %24) #10
  %140 = load i32, ptr %139, align 4, !tbaa !5
  store i32 %140, ptr %27, align 4, !tbaa !5
  %141 = load ptr, ptr %7, align 8, !tbaa !9
  %142 = getelementptr inbounds ptr, ptr %141, i64 0
  %143 = load ptr, ptr %142, align 8, !tbaa !9
  %144 = load i32, ptr %27, align 4, !tbaa !5
  %145 = invoke noundef zeroext i1 @_ZNK7Riemann11DynamicMesh6IsEdgeEi(ptr noundef nonnull align 8 dereferenceable(452) %143, i32 noundef %144)
          to label %146 unwind label %148

146:                                              ; preds = %138
  br i1 %145, label %152, label %147

147:                                              ; preds = %146
  store i32 8, ptr %26, align 4
  br label %864

148:                                              ; preds = %162, %152, %138
  %149 = landingpad { ptr, i32 }
          cleanup
  %150 = extractvalue { ptr, i32 } %149, 0
  store ptr %150, ptr %17, align 8
  %151 = extractvalue { ptr, i32 } %149, 1
  store i32 %151, ptr %18, align 4
  br label %874

152:                                              ; preds = %146
  %153 = load ptr, ptr %7, align 8, !tbaa !9
  %154 = getelementptr inbounds ptr, ptr %153, i64 0
  %155 = load ptr, ptr %154, align 8, !tbaa !9
  %156 = invoke noundef i32 @_ZNK7Riemann11DynamicMesh16GetTriangleCountEv(ptr noundef nonnull align 8 dereferenceable(452) %155)
          to label %157 unwind label %148

157:                                              ; preds = %152
  %158 = icmp sle i32 %156, 1
  br i1 %158, label %169, label %159

159:                                              ; preds = %157
  %160 = load i32, ptr %6, align 4, !tbaa !5
  %161 = icmp eq i32 %160, 2
  br i1 %161, label %162, label %170

162:                                              ; preds = %159
  %163 = load ptr, ptr %7, align 8, !tbaa !9
  %164 = getelementptr inbounds ptr, ptr %163, i64 1
  %165 = load ptr, ptr %164, align 8, !tbaa !9
  %166 = invoke noundef i32 @_ZNK7Riemann11DynamicMesh16GetTriangleCountEv(ptr noundef nonnull align 8 dereferenceable(452) %165)
          to label %167 unwind label %148

167:                                              ; preds = %162
  %168 = icmp sle i32 %166, 1
  br i1 %168, label %169, label %170

169:                                              ; preds = %167, %157
  store i32 7, ptr %26, align 4
  br label %864

170:                                              ; preds = %167, %159
  call void @llvm.lifetime.start.p0(i64 8, ptr %28) #10
  %171 = load ptr, ptr %7, align 8, !tbaa !9
  %172 = getelementptr inbounds ptr, ptr %171, i64 0
  %173 = load ptr, ptr %172, align 8, !tbaa !9
  %174 = load i32, ptr %27, align 4, !tbaa !5
  %175 = invoke noundef nonnull align 4 dereferenceable(16) ptr @_ZN7Riemann11DynamicMesh7GetEdgeEi(ptr noundef nonnull align 8 dereferenceable(452) %173, i32 noundef %174)
          to label %176 unwind label %187

176:                                              ; preds = %170
  store ptr %175, ptr %28, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %29) #10
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %29, ptr align 4 @__const._ZN7Riemann21SimplifyAlongNewEdgesEiPPNS_11DynamicMeshEPSt6vectorIiSaIiEERSt3mapIiiSt4lessIiESaISt4pairIKiiEEEPNS_15GeometryBooleanE.Matches, i64 8, i1 false)
  call void @llvm.lifetime.start.p0(i64 1, ptr %30) #10
  %177 = load i32, ptr %6, align 4, !tbaa !5
  %178 = icmp eq i32 %177, 2
  %179 = zext i1 %178 to i8
  store i8 %179, ptr %30, align 1, !tbaa !39
  %180 = load i8, ptr %30, align 1, !tbaa !39, !range !40, !noundef !41
  %181 = trunc i8 %180 to i1
  br i1 %181, label %182, label %226

182:                                              ; preds = %176
  call void @llvm.lifetime.start.p0(i64 4, ptr %31) #10
  store i32 0, ptr %31, align 4, !tbaa !5
  br label %183

183:                                              ; preds = %217, %182
  %184 = load i32, ptr %31, align 4, !tbaa !5
  %185 = icmp slt i32 %184, 2
  br i1 %185, label %191, label %186

186:                                              ; preds = %183
  store i32 9, ptr %26, align 4
  br label %220

187:                                              ; preds = %170
  %188 = landingpad { ptr, i32 }
          cleanup
  %189 = extractvalue { ptr, i32 } %188, 0
  store ptr %189, ptr %17, align 8
  %190 = extractvalue { ptr, i32 } %188, 1
  store i32 %190, ptr %18, align 4
  br label %873

191:                                              ; preds = %183
  call void @llvm.lifetime.start.p0(i64 8, ptr %32) #10
  %192 = load ptr, ptr %9, align 8, !tbaa !9
  %193 = load ptr, ptr %28, align 8, !tbaa !9
  %194 = getelementptr inbounds %"struct.Riemann::DynamicMesh::Edge", ptr %193, i32 0, i32 0
  %195 = load i32, ptr %31, align 4, !tbaa !5
  %196 = invoke noundef nonnull align 4 dereferenceable(4) ptr @_ZNK5Maths7TIndex2IiEixEi(ptr noundef nonnull align 4 dereferenceable(8) %194, i32 noundef %195)
          to label %197 unwind label %208

197:                                              ; preds = %191
  %198 = invoke noundef ptr @_Z7MapFindIiiSt3mapIiiSt4lessIiESaISt4pairIKiiEEEEPT0_RT1_RKT_(ptr noundef nonnull align 8 dereferenceable(48) %192, ptr noundef nonnull align 4 dereferenceable(4) %196)
          to label %199 unwind label %208

199:                                              ; preds = %197
  store ptr %198, ptr %32, align 8, !tbaa !9
  %200 = load ptr, ptr %32, align 8, !tbaa !9
  %201 = icmp ne ptr %200, null
  br i1 %201, label %202, label %212

202:                                              ; preds = %199
  %203 = load ptr, ptr %32, align 8, !tbaa !9
  %204 = load i32, ptr %203, align 4, !tbaa !5
  %205 = load i32, ptr %31, align 4, !tbaa !5
  %206 = sext i32 %205 to i64
  %207 = getelementptr inbounds [2 x i32], ptr %29, i64 0, i64 %206
  store i32 %204, ptr %207, align 4, !tbaa !5
  br label %213

208:                                              ; preds = %197, %191
  %209 = landingpad { ptr, i32 }
          cleanup
  %210 = extractvalue { ptr, i32 } %209, 0
  store ptr %210, ptr %17, align 8
  %211 = extractvalue { ptr, i32 } %209, 1
  store i32 %211, ptr %18, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %32) #10
  call void @llvm.lifetime.end.p0(i64 4, ptr %31) #10
  br label %872

212:                                              ; preds = %199
  store i8 0, ptr %30, align 1, !tbaa !39
  store i32 9, ptr %26, align 4
  br label %214

213:                                              ; preds = %202
  store i32 0, ptr %26, align 4
  br label %214

214:                                              ; preds = %213, %212
  call void @llvm.lifetime.end.p0(i64 8, ptr %32) #10
  %215 = load i32, ptr %26, align 4
  switch i32 %215, label %220 [
    i32 0, label %216
  ]

216:                                              ; preds = %214
  br label %217

217:                                              ; preds = %216
  %218 = load i32, ptr %31, align 4, !tbaa !5
  %219 = add nsw i32 %218, 1
  store i32 %219, ptr %31, align 4, !tbaa !5
  br label %183, !llvm.loop !42

220:                                              ; preds = %214, %186
  call void @llvm.lifetime.end.p0(i64 4, ptr %31) #10
  br label %221

221:                                              ; preds = %220
  %222 = load i8, ptr %30, align 1, !tbaa !39, !range !40, !noundef !41
  %223 = trunc i8 %222 to i1
  br i1 %223, label %225, label %224

224:                                              ; preds = %221
  store i32 8, ptr %26, align 4
  br label %861

225:                                              ; preds = %221
  br label %226

226:                                              ; preds = %225, %176
  call void @llvm.lifetime.start.p0(i64 4, ptr %33) #10
  store i32 -1, ptr %33, align 4, !tbaa !5
  %227 = load i8, ptr %30, align 1, !tbaa !39, !range !40, !noundef !41
  %228 = trunc i8 %227 to i1
  br i1 %228, label %229, label %247

229:                                              ; preds = %226
  %230 = load ptr, ptr %7, align 8, !tbaa !9
  %231 = getelementptr inbounds ptr, ptr %230, i64 1
  %232 = load ptr, ptr %231, align 8, !tbaa !9
  %233 = getelementptr inbounds [2 x i32], ptr %29, i64 0, i64 0
  %234 = load i32, ptr %233, align 4, !tbaa !5
  %235 = getelementptr inbounds [2 x i32], ptr %29, i64 0, i64 1
  %236 = load i32, ptr %235, align 4, !tbaa !5
  %237 = invoke noundef i32 @_ZNK7Riemann11DynamicMesh8FindEdgeEii(ptr noundef nonnull align 8 dereferenceable(452) %232, i32 noundef %234, i32 noundef %236)
          to label %238 unwind label %242

238:                                              ; preds = %229
  store i32 %237, ptr %33, align 4, !tbaa !5
  %239 = load i32, ptr %33, align 4, !tbaa !5
  %240 = icmp eq i32 %239, -1
  br i1 %240, label %241, label %246

241:                                              ; preds = %238
  store i32 8, ptr %26, align 4
  br label %860

242:                                              ; preds = %229
  %243 = landingpad { ptr, i32 }
          cleanup
  %244 = extractvalue { ptr, i32 } %243, 0
  store ptr %244, ptr %17, align 8
  %245 = extractvalue { ptr, i32 } %243, 1
  store i32 %245, ptr %18, align 4
  br label %871

246:                                              ; preds = %238
  br label %247

247:                                              ; preds = %246, %226
  call void @llvm.lifetime.start.p0(i64 2, ptr %34) #10
  call void @llvm.memset.p0.i64(ptr align 1 %34, i8 0, i64 2, i1 false)
  call void @llvm.lifetime.start.p0(i64 48, ptr %35) #10
  invoke void @_ZN5Maths8TVector3IfE4ZeroEv(ptr dead_on_unwind writable sret(%"class.Maths::TVector3") align 4 %35)
          to label %248 unwind label %259

248:                                              ; preds = %247
  %249 = getelementptr inbounds %"class.Maths::TVector3", ptr %35, i64 1
  invoke void @_ZN5Maths8TVector3IfE4ZeroEv(ptr dead_on_unwind writable sret(%"class.Maths::TVector3") align 4 %249)
          to label %250 unwind label %259

250:                                              ; preds = %248
  %251 = getelementptr inbounds [2 x %"class.Maths::TVector3"], ptr %35, i64 1
  invoke void @_ZN5Maths8TVector3IfE4ZeroEv(ptr dead_on_unwind writable sret(%"class.Maths::TVector3") align 4 %251)
          to label %252 unwind label %259

252:                                              ; preds = %250
  %253 = getelementptr inbounds %"class.Maths::TVector3", ptr %251, i64 1
  invoke void @_ZN5Maths8TVector3IfE4ZeroEv(ptr dead_on_unwind writable sret(%"class.Maths::TVector3") align 4 %253)
          to label %254 unwind label %259

254:                                              ; preds = %252
  call void @llvm.lifetime.start.p0(i64 4, ptr %36) #10
  store i32 0, ptr %36, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %37) #10
  store i32 0, ptr %37, align 4, !tbaa !5
  br label %255

255:                                              ; preds = %321, %254
  %256 = load i32, ptr %37, align 4, !tbaa !5
  %257 = icmp slt i32 %256, 2
  br i1 %257, label %263, label %258

258:                                              ; preds = %255
  store i32 12, ptr %26, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %37) #10
  br label %324

259:                                              ; preds = %252, %250, %248, %247
  %260 = landingpad { ptr, i32 }
          cleanup
  %261 = extractvalue { ptr, i32 } %260, 0
  store ptr %261, ptr %17, align 8
  %262 = extractvalue { ptr, i32 } %260, 1
  store i32 %262, ptr %18, align 4
  br label %870

263:                                              ; preds = %255
  %264 = load ptr, ptr %7, align 8, !tbaa !9
  %265 = getelementptr inbounds ptr, ptr %264, i64 0
  %266 = load ptr, ptr %265, align 8, !tbaa !9
  %267 = load ptr, ptr %28, align 8, !tbaa !9
  %268 = getelementptr inbounds %"struct.Riemann::DynamicMesh::Edge", ptr %267, i32 0, i32 0
  %269 = load i32, ptr %37, align 4, !tbaa !5
  %270 = invoke noundef nonnull align 4 dereferenceable(4) ptr @_ZNK5Maths7TIndex2IiEixEi(ptr noundef nonnull align 4 dereferenceable(8) %268, i32 noundef %269)
          to label %271 unwind label %307

271:                                              ; preds = %263
  %272 = load i32, ptr %270, align 4, !tbaa !5
  %273 = load float, ptr %11, align 4, !tbaa !36
  %274 = load i32, ptr %37, align 4, !tbaa !5
  %275 = sext i32 %274 to i64
  %276 = getelementptr inbounds [2 x [2 x %"class.Maths::TVector3"]], ptr %35, i64 0, i64 %275
  %277 = getelementptr inbounds [2 x %"class.Maths::TVector3"], ptr %276, i64 0, i64 0
  %278 = invoke noundef zeroext i1 @_ZN7Riemann20FLocalPlanarSimplify6IsFlatERKNS_11DynamicMeshEifRN5Maths8TVector3IfEE(ptr noundef nonnull align 8 dereferenceable(452) %266, i32 noundef %272, float noundef %273, ptr noundef nonnull align 4 dereferenceable(12) %277)
          to label %279 unwind label %307

279:                                              ; preds = %271
  br i1 %278, label %280, label %311

280:                                              ; preds = %279
  %281 = load i32, ptr %37, align 4, !tbaa !5
  %282 = sext i32 %281 to i64
  %283 = getelementptr inbounds [2 x i32], ptr %29, i64 0, i64 %282
  %284 = load i32, ptr %283, align 4, !tbaa !5
  %285 = icmp eq i32 %284, -1
  br i1 %285, label %301, label %286

286:                                              ; preds = %280
  %287 = load ptr, ptr %7, align 8, !tbaa !9
  %288 = getelementptr inbounds ptr, ptr %287, i64 1
  %289 = load ptr, ptr %288, align 8, !tbaa !9
  %290 = load i32, ptr %37, align 4, !tbaa !5
  %291 = sext i32 %290 to i64
  %292 = getelementptr inbounds [2 x i32], ptr %29, i64 0, i64 %291
  %293 = load i32, ptr %292, align 4, !tbaa !5
  %294 = load float, ptr %11, align 4, !tbaa !36
  %295 = load i32, ptr %37, align 4, !tbaa !5
  %296 = sext i32 %295 to i64
  %297 = getelementptr inbounds [2 x [2 x %"class.Maths::TVector3"]], ptr %35, i64 0, i64 %296
  %298 = getelementptr inbounds [2 x %"class.Maths::TVector3"], ptr %297, i64 0, i64 1
  %299 = invoke noundef zeroext i1 @_ZN7Riemann20FLocalPlanarSimplify6IsFlatERKNS_11DynamicMeshEifRN5Maths8TVector3IfEE(ptr noundef nonnull align 8 dereferenceable(452) %289, i32 noundef %293, float noundef %294, ptr noundef nonnull align 4 dereferenceable(12) %298)
          to label %300 unwind label %307

300:                                              ; preds = %286
  br label %301

301:                                              ; preds = %300, %280
  %302 = phi i1 [ true, %280 ], [ %299, %300 ]
  %303 = load i32, ptr %37, align 4, !tbaa !5
  %304 = sext i32 %303 to i64
  %305 = getelementptr inbounds [2 x i8], ptr %34, i64 0, i64 %304
  %306 = zext i1 %302 to i8
  store i8 %306, ptr %305, align 1, !tbaa !39
  br label %311

307:                                              ; preds = %286, %271, %263
  %308 = landingpad { ptr, i32 }
          cleanup
  %309 = extractvalue { ptr, i32 } %308, 0
  store ptr %309, ptr %17, align 8
  %310 = extractvalue { ptr, i32 } %308, 1
  store i32 %310, ptr %18, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %37) #10
  br label %869

311:                                              ; preds = %301, %279
  %312 = load i32, ptr %37, align 4, !tbaa !5
  %313 = sext i32 %312 to i64
  %314 = getelementptr inbounds [2 x i8], ptr %34, i64 0, i64 %313
  %315 = load i8, ptr %314, align 1, !tbaa !39, !range !40, !noundef !41
  %316 = trunc i8 %315 to i1
  br i1 %316, label %317, label %320

317:                                              ; preds = %311
  %318 = load i32, ptr %36, align 4, !tbaa !5
  %319 = add nsw i32 %318, 1
  store i32 %319, ptr %36, align 4, !tbaa !5
  br label %320

320:                                              ; preds = %317, %311
  br label %321

321:                                              ; preds = %320
  %322 = load i32, ptr %37, align 4, !tbaa !5
  %323 = add nsw i32 %322, 1
  store i32 %323, ptr %37, align 4, !tbaa !5
  br label %255, !llvm.loop !43

324:                                              ; preds = %258
  %325 = load i32, ptr %36, align 4, !tbaa !5
  %326 = icmp eq i32 %325, 0
  br i1 %326, label %327, label %328

327:                                              ; preds = %324
  store i32 8, ptr %26, align 4
  br label %859

328:                                              ; preds = %324
  call void @llvm.lifetime.start.p0(i64 4, ptr %38) #10
  store i32 0, ptr %38, align 4, !tbaa !5
  br label %329

329:                                              ; preds = %854, %328
  %330 = load i32, ptr %38, align 4, !tbaa !5
  %331 = icmp slt i32 %330, 2
  br i1 %331, label %333, label %332

332:                                              ; preds = %329
  store i32 15, ptr %26, align 4
  br label %857

333:                                              ; preds = %329
  %334 = load i32, ptr %38, align 4, !tbaa !5
  %335 = sext i32 %334 to i64
  %336 = getelementptr inbounds [2 x i8], ptr %34, i64 0, i64 %335
  %337 = load i8, ptr %336, align 1, !tbaa !39, !range !40, !noundef !41
  %338 = trunc i8 %337 to i1
  br i1 %338, label %340, label %339

339:                                              ; preds = %333
  br label %854

340:                                              ; preds = %333
  call void @llvm.lifetime.start.p0(i64 4, ptr %39) #10
  %341 = load i32, ptr %38, align 4, !tbaa !5
  %342 = sub nsw i32 1, %341
  store i32 %342, ptr %39, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 12, ptr %40) #10
  %343 = load ptr, ptr %7, align 8, !tbaa !9
  %344 = getelementptr inbounds ptr, ptr %343, i64 0
  %345 = load ptr, ptr %344, align 8, !tbaa !9
  %346 = load ptr, ptr %28, align 8, !tbaa !9
  %347 = getelementptr inbounds %"struct.Riemann::DynamicMesh::Edge", ptr %346, i32 0, i32 0
  %348 = load i32, ptr %38, align 4, !tbaa !5
  %349 = invoke noundef nonnull align 4 dereferenceable(4) ptr @_ZNK5Maths7TIndex2IiEixEi(ptr noundef nonnull align 4 dereferenceable(8) %347, i32 noundef %348)
          to label %350 unwind label %375

350:                                              ; preds = %340
  %351 = load i32, ptr %349, align 4, !tbaa !5
  invoke void @_ZNK7Riemann11DynamicMesh9GetVertexEi(ptr dead_on_unwind writable sret(%"class.Maths::TVector3") align 4 %40, ptr noundef nonnull align 8 dereferenceable(452) %345, i32 noundef %351)
          to label %352 unwind label %375

352:                                              ; preds = %350
  call void @llvm.lifetime.start.p0(i64 12, ptr %41) #10
  %353 = load ptr, ptr %7, align 8, !tbaa !9
  %354 = getelementptr inbounds ptr, ptr %353, i64 0
  %355 = load ptr, ptr %354, align 8, !tbaa !9
  %356 = load ptr, ptr %28, align 8, !tbaa !9
  %357 = getelementptr inbounds %"struct.Riemann::DynamicMesh::Edge", ptr %356, i32 0, i32 0
  %358 = load i32, ptr %39, align 4, !tbaa !5
  %359 = invoke noundef nonnull align 4 dereferenceable(4) ptr @_ZNK5Maths7TIndex2IiEixEi(ptr noundef nonnull align 4 dereferenceable(8) %357, i32 noundef %358)
          to label %360 unwind label %379

360:                                              ; preds = %352
  %361 = load i32, ptr %359, align 4, !tbaa !5
  invoke void @_ZNK7Riemann11DynamicMesh9GetVertexEi(ptr dead_on_unwind writable sret(%"class.Maths::TVector3") align 4 %41, ptr noundef nonnull align 8 dereferenceable(452) %355, i32 noundef %361)
          to label %362 unwind label %379

362:                                              ; preds = %360
  call void @llvm.lifetime.start.p0(i64 12, ptr %42) #10
  invoke void @_ZNK5Maths8TVector3IfEmiERKS1_(ptr dead_on_unwind writable sret(%"class.Maths::TVector3") align 4 %42, ptr noundef nonnull align 4 dereferenceable(12) %41, ptr noundef nonnull align 4 dereferenceable(12) %40)
          to label %363 unwind label %383

363:                                              ; preds = %362
  %364 = invoke noundef float @_ZN5Maths8TVector3IfE13SafeNormalizeEv(ptr noundef nonnull align 4 dereferenceable(12) %42)
          to label %365 unwind label %383

365:                                              ; preds = %363
  %366 = fcmp oeq float %364, 0.000000e+00
  br i1 %366, label %367, label %389

367:                                              ; preds = %365
  %368 = load ptr, ptr %10, align 8, !tbaa !9
  %369 = getelementptr inbounds %"class.Riemann::GeometryBoolean", ptr %368, i32 0, i32 2
  %370 = load i8, ptr %369, align 8, !tbaa !44, !range !40, !noundef !41
  %371 = trunc i8 %370 to i1
  %372 = xor i1 %371, true
  br i1 %372, label %373, label %374

373:                                              ; preds = %367
  br label %388

374:                                              ; preds = %367
  call void @__assert_fail(ptr noundef @.str, ptr noundef @.str.1, i32 noundef 2020, ptr noundef @__PRETTY_FUNCTION__._ZN7Riemann21SimplifyAlongNewEdgesEiPPNS_11DynamicMeshEPSt6vectorIiSaIiEERSt3mapIiiSt4lessIiESaISt4pairIKiiEEEPNS_15GeometryBooleanE) #11
  unreachable

375:                                              ; preds = %350, %340
  %376 = landingpad { ptr, i32 }
          cleanup
  %377 = extractvalue { ptr, i32 } %376, 0
  store ptr %377, ptr %17, align 8
  %378 = extractvalue { ptr, i32 } %376, 1
  store i32 %378, ptr %18, align 4
  br label %853

379:                                              ; preds = %360, %352
  %380 = landingpad { ptr, i32 }
          cleanup
  %381 = extractvalue { ptr, i32 } %380, 0
  store ptr %381, ptr %17, align 8
  %382 = extractvalue { ptr, i32 } %380, 1
  store i32 %382, ptr %18, align 4
  br label %852

383:                                              ; preds = %363, %362
  %384 = landingpad { ptr, i32 }
          cleanup
  %385 = extractvalue { ptr, i32 } %384, 0
  store ptr %385, ptr %17, align 8
  %386 = extractvalue { ptr, i32 } %384, 1
  store i32 %386, ptr %18, align 4
  br label %851

387:                                              ; No predecessors!
  br label %388

388:                                              ; preds = %387, %373
  store i32 15, ptr %26, align 4
  br label %849

389:                                              ; preds = %365
  call void @llvm.lifetime.start.p0(i64 1, ptr %43) #10
  store i8 0, ptr %43, align 1, !tbaa !39
  call void @llvm.lifetime.start.p0(i64 4, ptr %44) #10
  store i32 0, ptr %44, align 4, !tbaa !5
  br label %390

390:                                              ; preds = %525, %389
  %391 = load i8, ptr %43, align 1, !tbaa !39, !range !40, !noundef !41
  %392 = trunc i8 %391 to i1
  br i1 %392, label %397, label %393

393:                                              ; preds = %390
  %394 = load i32, ptr %44, align 4, !tbaa !5
  %395 = load i32, ptr %6, align 4, !tbaa !5
  %396 = icmp slt i32 %394, %395
  br label %397

397:                                              ; preds = %393, %390
  %398 = phi i1 [ false, %390 ], [ %396, %393 ]
  br i1 %398, label %400, label %399

399:                                              ; preds = %397
  store i32 18, ptr %26, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %44) #10
  br label %542

400:                                              ; preds = %397
  call void @llvm.lifetime.start.p0(i64 4, ptr %45) #10
  %401 = load i32, ptr %44, align 4, !tbaa !5
  %402 = icmp eq i32 %401, 0
  br i1 %402, label %403, label %410

403:                                              ; preds = %400
  %404 = load ptr, ptr %28, align 8, !tbaa !9
  %405 = getelementptr inbounds %"struct.Riemann::DynamicMesh::Edge", ptr %404, i32 0, i32 0
  %406 = load i32, ptr %38, align 4, !tbaa !5
  %407 = invoke noundef nonnull align 4 dereferenceable(4) ptr @_ZNK5Maths7TIndex2IiEixEi(ptr noundef nonnull align 4 dereferenceable(8) %405, i32 noundef %406)
          to label %408 unwind label %528

408:                                              ; preds = %403
  %409 = load i32, ptr %407, align 4, !tbaa !5
  br label %415

410:                                              ; preds = %400
  %411 = load i32, ptr %38, align 4, !tbaa !5
  %412 = sext i32 %411 to i64
  %413 = getelementptr inbounds [2 x i32], ptr %29, i64 0, i64 %412
  %414 = load i32, ptr %413, align 4, !tbaa !5
  br label %415

415:                                              ; preds = %410, %408
  %416 = phi i32 [ %409, %408 ], [ %414, %410 ]
  store i32 %416, ptr %45, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %46) #10
  %417 = load i32, ptr %44, align 4, !tbaa !5
  %418 = icmp eq i32 %417, 0
  br i1 %418, label %419, label %426

419:                                              ; preds = %415
  %420 = load ptr, ptr %28, align 8, !tbaa !9
  %421 = getelementptr inbounds %"struct.Riemann::DynamicMesh::Edge", ptr %420, i32 0, i32 0
  %422 = load i32, ptr %39, align 4, !tbaa !5
  %423 = invoke noundef nonnull align 4 dereferenceable(4) ptr @_ZNK5Maths7TIndex2IiEixEi(ptr noundef nonnull align 4 dereferenceable(8) %421, i32 noundef %422)
          to label %424 unwind label %532

424:                                              ; preds = %419
  %425 = load i32, ptr %423, align 4, !tbaa !5
  br label %431

426:                                              ; preds = %415
  %427 = load i32, ptr %39, align 4, !tbaa !5
  %428 = sext i32 %427 to i64
  %429 = getelementptr inbounds [2 x i32], ptr %29, i64 0, i64 %428
  %430 = load i32, ptr %429, align 4, !tbaa !5
  br label %431

431:                                              ; preds = %426, %424
  %432 = phi i32 [ %425, %424 ], [ %430, %426 ]
  store i32 %432, ptr %46, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %47) #10
  %433 = load i32, ptr %44, align 4, !tbaa !5
  %434 = icmp eq i32 %433, 0
  br i1 %434, label %435, label %437

435:                                              ; preds = %431
  %436 = load i32, ptr %27, align 4, !tbaa !5
  br label %439

437:                                              ; preds = %431
  %438 = load i32, ptr %33, align 4, !tbaa !5
  br label %439

439:                                              ; preds = %437, %435
  %440 = phi i32 [ %436, %435 ], [ %438, %437 ]
  store i32 %440, ptr %47, align 4, !tbaa !5
  %441 = load i8, ptr %43, align 1, !tbaa !39, !range !40, !noundef !41
  %442 = trunc i8 %441 to i1
  br i1 %442, label %462, label %443

443:                                              ; preds = %439
  %444 = load ptr, ptr %7, align 8, !tbaa !9
  %445 = load i32, ptr %44, align 4, !tbaa !5
  %446 = sext i32 %445 to i64
  %447 = getelementptr inbounds ptr, ptr %444, i64 %446
  %448 = load ptr, ptr %447, align 8, !tbaa !9
  %449 = load i32, ptr %38, align 4, !tbaa !5
  %450 = sext i32 %449 to i64
  %451 = getelementptr inbounds [2 x [2 x %"class.Maths::TVector3"]], ptr %35, i64 0, i64 %450
  %452 = load i32, ptr %44, align 4, !tbaa !5
  %453 = sext i32 %452 to i64
  %454 = getelementptr inbounds [2 x %"class.Maths::TVector3"], ptr %451, i64 0, i64 %453
  %455 = load i32, ptr %45, align 4, !tbaa !5
  %456 = load i32, ptr %46, align 4, !tbaa !5
  %457 = load ptr, ptr %10, align 8, !tbaa !9
  %458 = getelementptr inbounds %"class.Riemann::GeometryBoolean", ptr %457, i32 0, i32 8
  %459 = load float, ptr %458, align 4, !tbaa !45
  %460 = invoke noundef zeroext i1 @_ZN7Riemann20FLocalPlanarSimplify32CollapseWouldHurtTriangleQualityERKNS_11DynamicMeshERKN5Maths8TVector3IfEEiS8_iS8_fb(ptr noundef nonnull align 8 dereferenceable(452) %448, ptr noundef nonnull align 4 dereferenceable(12) %454, i32 noundef %455, ptr noundef nonnull align 4 dereferenceable(12) %40, i32 noundef %456, ptr noundef nonnull align 4 dereferenceable(12) %41, float noundef %459, i1 noundef zeroext false)
          to label %461 unwind label %536

461:                                              ; preds = %443
  br label %462

462:                                              ; preds = %461, %439
  %463 = phi i1 [ true, %439 ], [ %460, %461 ]
  %464 = zext i1 %463 to i8
  store i8 %464, ptr %43, align 1, !tbaa !39
  %465 = load i8, ptr %43, align 1, !tbaa !39, !range !40, !noundef !41
  %466 = trunc i8 %465 to i1
  br i1 %466, label %522, label %467

467:                                              ; preds = %462
  %468 = load ptr, ptr %7, align 8, !tbaa !9
  %469 = load i32, ptr %44, align 4, !tbaa !5
  %470 = sext i32 %469 to i64
  %471 = getelementptr inbounds ptr, ptr %468, i64 %470
  %472 = load ptr, ptr %471, align 8, !tbaa !9
  %473 = load i32, ptr %44, align 4, !tbaa !5
  %474 = sext i32 %473 to i64
  %475 = getelementptr inbounds [2 x %"class.std::set"], ptr %12, i64 0, i64 %474
  %476 = load float, ptr %11, align 4, !tbaa !36
  %477 = load i32, ptr %47, align 4, !tbaa !5
  %478 = load i32, ptr %45, align 4, !tbaa !5
  %479 = load i32, ptr %46, align 4, !tbaa !5
  %480 = load ptr, ptr %10, align 8, !tbaa !9
  %481 = getelementptr inbounds %"class.Riemann::GeometryBoolean", ptr %480, i32 0, i32 9
  %482 = load i8, ptr %481, align 8, !tbaa !46, !range !40, !noundef !41
  %483 = trunc i8 %482 to i1
  %484 = load ptr, ptr %10, align 8, !tbaa !9
  %485 = getelementptr inbounds %"class.Riemann::GeometryBoolean", ptr %484, i32 0, i32 15
  %486 = load i32, ptr %485, align 8, !tbaa !47
  %487 = icmp eq i32 %486, -1
  br i1 %487, label %494, label %488

488:                                              ; preds = %467
  %489 = load i32, ptr %44, align 4, !tbaa !5
  %490 = load ptr, ptr %10, align 8, !tbaa !9
  %491 = getelementptr inbounds %"class.Riemann::GeometryBoolean", ptr %490, i32 0, i32 15
  %492 = load i32, ptr %491, align 8, !tbaa !47
  %493 = icmp eq i32 %489, %492
  br label %494

494:                                              ; preds = %488, %467
  %495 = phi i1 [ true, %467 ], [ %493, %488 ]
  %496 = load ptr, ptr %10, align 8, !tbaa !9
  %497 = getelementptr inbounds %"class.Riemann::GeometryBoolean", ptr %496, i32 0, i32 10
  %498 = load i8, ptr %497, align 1, !tbaa !48, !range !40, !noundef !41
  %499 = trunc i8 %498 to i1
  %500 = load ptr, ptr %10, align 8, !tbaa !9
  %501 = getelementptr inbounds %"class.Riemann::GeometryBoolean", ptr %500, i32 0, i32 11
  %502 = load i8, ptr %501, align 2, !tbaa !49, !range !40, !noundef !41
  %503 = trunc i8 %502 to i1
  %504 = load ptr, ptr %10, align 8, !tbaa !9
  %505 = getelementptr inbounds %"class.Riemann::GeometryBoolean", ptr %504, i32 0, i32 12
  %506 = load float, ptr %505, align 4, !tbaa !50
  %507 = load ptr, ptr %10, align 8, !tbaa !9
  %508 = getelementptr inbounds %"class.Riemann::GeometryBoolean", ptr %507, i32 0, i32 12
  %509 = load float, ptr %508, align 4, !tbaa !50
  %510 = fmul float %506, %509
  %511 = load ptr, ptr %10, align 8, !tbaa !9
  %512 = getelementptr inbounds %"class.Riemann::GeometryBoolean", ptr %511, i32 0, i32 13
  %513 = load i8, ptr %512, align 8, !tbaa !51, !range !40, !noundef !41
  %514 = trunc i8 %513 to i1
  %515 = load ptr, ptr %10, align 8, !tbaa !9
  %516 = getelementptr inbounds %"class.Riemann::GeometryBoolean", ptr %515, i32 0, i32 14
  %517 = load float, ptr %516, align 4, !tbaa !52
  %518 = fmul float %517, 0x3F91DF46A0000000
  %519 = call float @cosf(float noundef %518) #10
  %520 = invoke noundef zeroext i1 @_ZN7Riemann20FLocalPlanarSimplify29CollapseWouldChangeShapeOrUVsERKNS_11DynamicMeshERKSt3setIiSt4lessIiESaIiEEfiiRKN5Maths8TVector3IfEEiSF_SF_bbbbfbf(ptr noundef nonnull align 8 dereferenceable(452) %472, ptr noundef nonnull align 8 dereferenceable(48) %475, float noundef %476, i32 noundef %477, i32 noundef %478, ptr noundef nonnull align 4 dereferenceable(12) %40, i32 noundef %479, ptr noundef nonnull align 4 dereferenceable(12) %41, ptr noundef nonnull align 4 dereferenceable(12) %42, i1 noundef zeroext %483, i1 noundef zeroext %495, i1 noundef zeroext %499, i1 noundef zeroext %503, float noundef %510, i1 noundef zeroext %514, float noundef %519)
          to label %521 unwind label %536

521:                                              ; preds = %494
  br label %522

522:                                              ; preds = %521, %462
  %523 = phi i1 [ true, %462 ], [ %520, %521 ]
  %524 = zext i1 %523 to i8
  store i8 %524, ptr %43, align 1, !tbaa !39
  call void @llvm.lifetime.end.p0(i64 4, ptr %47) #10
  call void @llvm.lifetime.end.p0(i64 4, ptr %46) #10
  call void @llvm.lifetime.end.p0(i64 4, ptr %45) #10
  br label %525

525:                                              ; preds = %522
  %526 = load i32, ptr %44, align 4, !tbaa !5
  %527 = add nsw i32 %526, 1
  store i32 %527, ptr %44, align 4, !tbaa !5
  br label %390, !llvm.loop !53

528:                                              ; preds = %403
  %529 = landingpad { ptr, i32 }
          cleanup
  %530 = extractvalue { ptr, i32 } %529, 0
  store ptr %530, ptr %17, align 8
  %531 = extractvalue { ptr, i32 } %529, 1
  store i32 %531, ptr %18, align 4
  br label %541

532:                                              ; preds = %419
  %533 = landingpad { ptr, i32 }
          cleanup
  %534 = extractvalue { ptr, i32 } %533, 0
  store ptr %534, ptr %17, align 8
  %535 = extractvalue { ptr, i32 } %533, 1
  store i32 %535, ptr %18, align 4
  br label %540

536:                                              ; preds = %494, %443
  %537 = landingpad { ptr, i32 }
          cleanup
  %538 = extractvalue { ptr, i32 } %537, 0
  store ptr %538, ptr %17, align 8
  %539 = extractvalue { ptr, i32 } %537, 1
  store i32 %539, ptr %18, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %47) #10
  br label %540

540:                                              ; preds = %536, %532
  call void @llvm.lifetime.end.p0(i64 4, ptr %46) #10
  br label %541

541:                                              ; preds = %540, %528
  call void @llvm.lifetime.end.p0(i64 4, ptr %45) #10
  call void @llvm.lifetime.end.p0(i64 4, ptr %44) #10
  br label %848

542:                                              ; preds = %399
  %543 = load i8, ptr %43, align 1, !tbaa !39, !range !40, !noundef !41
  %544 = trunc i8 %543 to i1
  br i1 %544, label %545, label %546

545:                                              ; preds = %542
  store i32 17, ptr %26, align 4
  br label %847

546:                                              ; preds = %542
  call void @llvm.lifetime.start.p0(i64 1, ptr %48) #10
  store i8 1, ptr %48, align 1, !tbaa !39
  %547 = load i8, ptr %30, align 1, !tbaa !39, !range !40, !noundef !41
  %548 = trunc i8 %547 to i1
  br i1 %548, label %549, label %635

549:                                              ; preds = %546
  call void @llvm.lifetime.start.p0(i64 4, ptr %49) #10
  %550 = load i32, ptr %38, align 4, !tbaa !5
  %551 = sext i32 %550 to i64
  %552 = getelementptr inbounds [2 x i32], ptr %29, i64 0, i64 %551
  %553 = load i32, ptr %552, align 4, !tbaa !5
  store i32 %553, ptr %49, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %50) #10
  %554 = load i32, ptr %39, align 4, !tbaa !5
  %555 = sext i32 %554 to i64
  %556 = getelementptr inbounds [2 x i32], ptr %29, i64 0, i64 %555
  %557 = load i32, ptr %556, align 4, !tbaa !5
  store i32 %557, ptr %50, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %51) #10
  %558 = load i32, ptr %49, align 4, !tbaa !5
  store i32 %558, ptr %51, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %52) #10
  %559 = load i32, ptr %50, align 4, !tbaa !5
  store i32 %559, ptr %52, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %53) #10
  %560 = load ptr, ptr %7, align 8, !tbaa !9
  %561 = getelementptr inbounds ptr, ptr %560, i64 1
  %562 = load ptr, ptr %561, align 8, !tbaa !9
  %563 = load i32, ptr %49, align 4, !tbaa !5
  %564 = load i32, ptr %50, align 4, !tbaa !5
  %565 = invoke noundef i32 @_ZNK7Riemann11DynamicMesh8FindEdgeEii(ptr noundef nonnull align 8 dereferenceable(452) %562, i32 noundef %563, i32 noundef %564)
          to label %566 unwind label %581

566:                                              ; preds = %549
  store i32 %565, ptr %53, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %54) #10
  %567 = load ptr, ptr %7, align 8, !tbaa !9
  %568 = getelementptr inbounds ptr, ptr %567, i64 1
  %569 = load ptr, ptr %568, align 8, !tbaa !9
  %570 = load i32, ptr %53, align 4, !tbaa !5
  %571 = invoke noundef nonnull align 4 dereferenceable(16) ptr @_ZN7Riemann11DynamicMesh7GetEdgeEi(ptr noundef nonnull align 8 dereferenceable(452) %569, i32 noundef %570)
          to label %572 unwind label %585

572:                                              ; preds = %566
  store ptr %571, ptr %54, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %55) #10
  %573 = load ptr, ptr %54, align 8, !tbaa !9
  %574 = getelementptr inbounds %"struct.Riemann::DynamicMesh::Edge", ptr %573, i32 0, i32 1
  %575 = invoke noundef nonnull align 4 dereferenceable(4) ptr @_ZNK5Maths7TIndex2IiEixEi(ptr noundef nonnull align 4 dereferenceable(8) %574, i32 noundef 0)
          to label %576 unwind label %589

576:                                              ; preds = %572
  %577 = load i32, ptr %575, align 4, !tbaa !5
  store i32 %577, ptr %55, align 4, !tbaa !5
  %578 = load i32, ptr %55, align 4, !tbaa !5
  %579 = icmp eq i32 %578, -1
  br i1 %579, label %580, label %593

580:                                              ; preds = %576
  store i8 0, ptr %48, align 1, !tbaa !39
  br label %631

581:                                              ; preds = %549
  %582 = landingpad { ptr, i32 }
          cleanup
  %583 = extractvalue { ptr, i32 } %582, 0
  store ptr %583, ptr %17, align 8
  %584 = extractvalue { ptr, i32 } %582, 1
  store i32 %584, ptr %18, align 4
  br label %634

585:                                              ; preds = %566
  %586 = landingpad { ptr, i32 }
          cleanup
  %587 = extractvalue { ptr, i32 } %586, 0
  store ptr %587, ptr %17, align 8
  %588 = extractvalue { ptr, i32 } %586, 1
  store i32 %588, ptr %18, align 4
  br label %633

589:                                              ; preds = %572
  %590 = landingpad { ptr, i32 }
          cleanup
  %591 = extractvalue { ptr, i32 } %590, 0
  store ptr %591, ptr %17, align 8
  %592 = extractvalue { ptr, i32 } %590, 1
  store i32 %592, ptr %18, align 4
  br label %632

593:                                              ; preds = %576
  call void @llvm.lifetime.start.p0(i64 12, ptr %56) #10
  %594 = load ptr, ptr %7, align 8, !tbaa !9
  %595 = getelementptr inbounds ptr, ptr %594, i64 1
  %596 = load ptr, ptr %595, align 8, !tbaa !9
  %597 = load i32, ptr %55, align 4, !tbaa !5
  invoke void @_ZNK7Riemann11DynamicMesh11GetTriangleEi(ptr dead_on_unwind writable sret(%"class.Maths::TIndex3") align 4 %56, ptr noundef nonnull align 8 dereferenceable(452) %596, i32 noundef %597)
          to label %598 unwind label %611

598:                                              ; preds = %593
  call void @llvm.lifetime.start.p0(i64 4, ptr %57) #10
  %599 = load i32, ptr %51, align 4, !tbaa !5
  %600 = load i32, ptr %52, align 4, !tbaa !5
  %601 = invoke noundef i32 @_ZN7RiemannL15FindTriOtherVtxIiN5Maths7TIndex3IiEEEEiT_S4_RKT0_(i32 noundef %599, i32 noundef %600, ptr noundef nonnull align 4 dereferenceable(12) %56)
          to label %602 unwind label %615

602:                                              ; preds = %598
  store i32 %601, ptr %57, align 4, !tbaa !5
  %603 = load ptr, ptr %54, align 8, !tbaa !9
  %604 = getelementptr inbounds %"struct.Riemann::DynamicMesh::Edge", ptr %603, i32 0, i32 1
  %605 = invoke noundef nonnull align 4 dereferenceable(4) ptr @_ZNK5Maths7TIndex2IiEixEi(ptr noundef nonnull align 4 dereferenceable(8) %604, i32 noundef 1)
          to label %606 unwind label %615

606:                                              ; preds = %602
  %607 = load i32, ptr %605, align 4, !tbaa !5
  %608 = icmp eq i32 %607, -1
  br i1 %608, label %609, label %610

609:                                              ; preds = %606
  br label %620

610:                                              ; preds = %606
  call void @__assert_fail(ptr noundef @.str.2, ptr noundef @.str.1, i32 noundef 2068, ptr noundef @__PRETTY_FUNCTION__._ZN7Riemann21SimplifyAlongNewEdgesEiPPNS_11DynamicMeshEPSt6vectorIiSaIiEERSt3mapIiiSt4lessIiESaISt4pairIKiiEEEPNS_15GeometryBooleanE) #11
  unreachable

611:                                              ; preds = %593
  %612 = landingpad { ptr, i32 }
          cleanup
  %613 = extractvalue { ptr, i32 } %612, 0
  store ptr %613, ptr %17, align 8
  %614 = extractvalue { ptr, i32 } %612, 1
  store i32 %614, ptr %18, align 4
  br label %630

615:                                              ; preds = %620, %602, %598
  %616 = landingpad { ptr, i32 }
          cleanup
  %617 = extractvalue { ptr, i32 } %616, 0
  store ptr %617, ptr %17, align 8
  %618 = extractvalue { ptr, i32 } %616, 1
  store i32 %618, ptr %18, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %57) #10
  br label %630

619:                                              ; No predecessors!
  br label %620

620:                                              ; preds = %619, %609
  %621 = load ptr, ptr %7, align 8, !tbaa !9
  %622 = getelementptr inbounds ptr, ptr %621, i64 1
  %623 = load ptr, ptr %622, align 8, !tbaa !9
  %624 = load i32, ptr %51, align 4, !tbaa !5
  %625 = getelementptr inbounds %class.anon.58, ptr %58, i32 0, i32 0
  store ptr %48, ptr %625, align 8, !tbaa !9
  %626 = getelementptr inbounds %class.anon.58, ptr %58, i32 0, i32 1
  store ptr %57, ptr %626, align 8, !tbaa !9
  %627 = getelementptr inbounds %class.anon.58, ptr %58, i32 0, i32 2
  store ptr %52, ptr %627, align 8, !tbaa !9
  %628 = getelementptr inbounds %class.anon.58, ptr %58, i32 0, i32 3
  store ptr %7, ptr %628, align 8, !tbaa !9
  invoke void @"_ZNK7Riemann11DynamicMesh23EnumerateVertexVerticesIZNS_21SimplifyAlongNewEdgesEiPPS0_PSt6vectorIiSaIiEERSt3mapIiiSt4lessIiESaISt4pairIKiiEEEPNS_15GeometryBooleanEE3$_0EEviT_"(ptr noundef nonnull align 8 dereferenceable(452) %623, i32 noundef %624, ptr noundef byval(%class.anon.58) align 8 %58)
          to label %629 unwind label %615

629:                                              ; preds = %620
  call void @llvm.lifetime.end.p0(i64 4, ptr %57) #10
  call void @llvm.lifetime.end.p0(i64 12, ptr %56) #10
  br label %631

630:                                              ; preds = %615, %611
  call void @llvm.lifetime.end.p0(i64 12, ptr %56) #10
  br label %632

631:                                              ; preds = %629, %580
  call void @llvm.lifetime.end.p0(i64 4, ptr %55) #10
  call void @llvm.lifetime.end.p0(i64 8, ptr %54) #10
  call void @llvm.lifetime.end.p0(i64 4, ptr %53) #10
  call void @llvm.lifetime.end.p0(i64 4, ptr %52) #10
  call void @llvm.lifetime.end.p0(i64 4, ptr %51) #10
  call void @llvm.lifetime.end.p0(i64 4, ptr %50) #10
  call void @llvm.lifetime.end.p0(i64 4, ptr %49) #10
  br label %635

632:                                              ; preds = %630, %589
  call void @llvm.lifetime.end.p0(i64 4, ptr %55) #10
  br label %633

633:                                              ; preds = %632, %585
  call void @llvm.lifetime.end.p0(i64 8, ptr %54) #10
  br label %634

634:                                              ; preds = %633, %581
  call void @llvm.lifetime.end.p0(i64 4, ptr %53) #10
  call void @llvm.lifetime.end.p0(i64 4, ptr %52) #10
  call void @llvm.lifetime.end.p0(i64 4, ptr %51) #10
  call void @llvm.lifetime.end.p0(i64 4, ptr %50) #10
  call void @llvm.lifetime.end.p0(i64 4, ptr %49) #10
  br label %846

635:                                              ; preds = %631, %546
  %636 = load i8, ptr %48, align 1, !tbaa !39, !range !40, !noundef !41
  %637 = trunc i8 %636 to i1
  br i1 %637, label %639, label %638

638:                                              ; preds = %635
  store i32 15, ptr %26, align 4
  br label %845

639:                                              ; preds = %635
  call void @llvm.lifetime.start.p0(i64 52, ptr %59) #10
  invoke void @_ZN7Riemann17FEdgeCollapseInfoC2Ev(ptr noundef nonnull align 4 dereferenceable(52) %59)
          to label %640 unwind label %692

640:                                              ; preds = %639
  call void @llvm.lifetime.start.p0(i64 4, ptr %60) #10
  %641 = load ptr, ptr %28, align 8, !tbaa !9
  %642 = getelementptr inbounds %"struct.Riemann::DynamicMesh::Edge", ptr %641, i32 0, i32 0
  %643 = load i32, ptr %38, align 4, !tbaa !5
  %644 = invoke noundef nonnull align 4 dereferenceable(4) ptr @_ZNK5Maths7TIndex2IiEixEi(ptr noundef nonnull align 4 dereferenceable(8) %642, i32 noundef %643)
          to label %645 unwind label %696

645:                                              ; preds = %640
  %646 = load i32, ptr %644, align 4, !tbaa !5
  store i32 %646, ptr %60, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %61) #10
  %647 = load ptr, ptr %28, align 8, !tbaa !9
  %648 = getelementptr inbounds %"struct.Riemann::DynamicMesh::Edge", ptr %647, i32 0, i32 0
  %649 = load i32, ptr %39, align 4, !tbaa !5
  %650 = invoke noundef nonnull align 4 dereferenceable(4) ptr @_ZNK5Maths7TIndex2IiEixEi(ptr noundef nonnull align 4 dereferenceable(8) %648, i32 noundef %649)
          to label %651 unwind label %700

651:                                              ; preds = %645
  %652 = load i32, ptr %650, align 4, !tbaa !5
  store i32 %652, ptr %61, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 1, ptr %62) #10
  call void @llvm.lifetime.start.p0(i64 1, ptr %63) #10
  %653 = load ptr, ptr %7, align 8, !tbaa !9
  %654 = getelementptr inbounds ptr, ptr %653, i64 0
  %655 = load ptr, ptr %654, align 8, !tbaa !9
  %656 = load i32, ptr %27, align 4, !tbaa !5
  %657 = load i32, ptr %60, align 4, !tbaa !5
  %658 = invoke noundef zeroext i1 @"_ZZN7Riemann21SimplifyAlongNewEdgesEiPPNS_11DynamicMeshEPSt6vectorIiSaIiEERSt3mapIiiSt4lessIiESaISt4pairIKiiEEEPNS_15GeometryBooleanEENK3$_1clERKS0_ii"(ptr noundef nonnull align 1 dereferenceable(1) %62, ptr noundef nonnull align 8 dereferenceable(452) %655, i32 noundef %656, i32 noundef %657)
          to label %659 unwind label %704

659:                                              ; preds = %651
  %660 = zext i1 %658 to i8
  store i8 %660, ptr %63, align 1, !tbaa !39
  call void @llvm.lifetime.start.p0(i64 4, ptr %64) #10
  %661 = load ptr, ptr %7, align 8, !tbaa !9
  %662 = getelementptr inbounds ptr, ptr %661, i64 0
  %663 = load ptr, ptr %662, align 8, !tbaa !9
  %664 = load i32, ptr %61, align 4, !tbaa !5
  %665 = load i32, ptr %60, align 4, !tbaa !5
  %666 = invoke noundef i32 @_ZN7Riemann11DynamicMesh12CollapseEdgeEiifRNS_17FEdgeCollapseInfoE(ptr noundef nonnull align 8 dereferenceable(452) %663, i32 noundef %664, i32 noundef %665, float noundef 0.000000e+00, ptr noundef nonnull align 4 dereferenceable(52) %59)
          to label %667 unwind label %708

667:                                              ; preds = %659
  store i32 %666, ptr %64, align 4, !tbaa !54
  %668 = load i32, ptr %64, align 4, !tbaa !54
  %669 = icmp eq i32 %668, 0
  br i1 %669, label %670, label %839

670:                                              ; preds = %667
  %671 = load i8, ptr %63, align 1, !tbaa !39, !range !40, !noundef !41
  %672 = trunc i8 %671 to i1
  br i1 %672, label %673, label %712

673:                                              ; preds = %670
  %674 = load ptr, ptr %7, align 8, !tbaa !9
  %675 = getelementptr inbounds ptr, ptr %674, i64 0
  %676 = load ptr, ptr %675, align 8, !tbaa !9
  %677 = getelementptr inbounds %"struct.Riemann::FEdgeCollapseInfo", ptr %59, i32 0, i32 7
  %678 = getelementptr inbounds %"class.Maths::TIndex2", ptr %677, i32 0, i32 0
  %679 = load i32, ptr %678, align 4, !tbaa !56
  %680 = invoke noundef zeroext i1 @_ZNK7Riemann11DynamicMesh14IsBoundaryEdgeEi(ptr noundef nonnull align 8 dereferenceable(452) %676, i32 noundef %679)
          to label %681 unwind label %708

681:                                              ; preds = %673
  br i1 %680, label %682, label %712

682:                                              ; preds = %681
  %683 = getelementptr inbounds [2 x %"class.std::set"], ptr %12, i64 0, i64 0
  %684 = getelementptr inbounds %"struct.Riemann::FEdgeCollapseInfo", ptr %59, i32 0, i32 7
  %685 = getelementptr inbounds %"class.Maths::TIndex2", ptr %684, i32 0, i32 0
  %686 = invoke { ptr, i8 } @_ZNSt3setIiSt4lessIiESaIiEE6insertERKi(ptr noundef nonnull align 8 dereferenceable(48) %683, ptr noundef nonnull align 4 dereferenceable(4) %685)
          to label %687 unwind label %708

687:                                              ; preds = %682
  %688 = getelementptr inbounds { ptr, i8 }, ptr %65, i32 0, i32 0
  %689 = extractvalue { ptr, i8 } %686, 0
  store ptr %689, ptr %688, align 8
  %690 = getelementptr inbounds { ptr, i8 }, ptr %65, i32 0, i32 1
  %691 = extractvalue { ptr, i8 } %686, 1
  store i8 %691, ptr %690, align 8
  br label %712

692:                                              ; preds = %639
  %693 = landingpad { ptr, i32 }
          cleanup
  %694 = extractvalue { ptr, i32 } %693, 0
  store ptr %694, ptr %17, align 8
  %695 = extractvalue { ptr, i32 } %693, 1
  store i32 %695, ptr %18, align 4
  br label %844

696:                                              ; preds = %640
  %697 = landingpad { ptr, i32 }
          cleanup
  %698 = extractvalue { ptr, i32 } %697, 0
  store ptr %698, ptr %17, align 8
  %699 = extractvalue { ptr, i32 } %697, 1
  store i32 %699, ptr %18, align 4
  br label %843

700:                                              ; preds = %645
  %701 = landingpad { ptr, i32 }
          cleanup
  %702 = extractvalue { ptr, i32 } %701, 0
  store ptr %702, ptr %17, align 8
  %703 = extractvalue { ptr, i32 } %701, 1
  store i32 %703, ptr %18, align 4
  br label %842

704:                                              ; preds = %651
  %705 = landingpad { ptr, i32 }
          cleanup
  %706 = extractvalue { ptr, i32 } %705, 0
  store ptr %706, ptr %17, align 8
  %707 = extractvalue { ptr, i32 } %705, 1
  store i32 %707, ptr %18, align 4
  br label %841

708:                                              ; preds = %835, %831, %825, %823, %819, %813, %682, %673, %659
  %709 = landingpad { ptr, i32 }
          cleanup
  %710 = extractvalue { ptr, i32 } %709, 0
  store ptr %710, ptr %17, align 8
  %711 = extractvalue { ptr, i32 } %709, 1
  store i32 %711, ptr %18, align 4
  br label %840

712:                                              ; preds = %687, %681, %670
  %713 = load i8, ptr %30, align 1, !tbaa !39, !range !40, !noundef !41
  %714 = trunc i8 %713 to i1
  br i1 %714, label %715, label %813

715:                                              ; preds = %712
  call void @llvm.lifetime.start.p0(i64 4, ptr %66) #10
  %716 = load i32, ptr %38, align 4, !tbaa !5
  %717 = sext i32 %716 to i64
  %718 = getelementptr inbounds [2 x i32], ptr %29, i64 0, i64 %717
  %719 = load i32, ptr %718, align 4, !tbaa !5
  store i32 %719, ptr %66, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %67) #10
  %720 = load i32, ptr %39, align 4, !tbaa !5
  %721 = sext i32 %720 to i64
  %722 = getelementptr inbounds [2 x i32], ptr %29, i64 0, i64 %721
  %723 = load i32, ptr %722, align 4, !tbaa !5
  store i32 %723, ptr %67, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 1, ptr %68) #10
  %724 = load ptr, ptr %7, align 8, !tbaa !9
  %725 = getelementptr inbounds ptr, ptr %724, i64 1
  %726 = load ptr, ptr %725, align 8, !tbaa !9
  %727 = load i32, ptr %33, align 4, !tbaa !5
  %728 = load i32, ptr %66, align 4, !tbaa !5
  %729 = invoke noundef zeroext i1 @"_ZZN7Riemann21SimplifyAlongNewEdgesEiPPNS_11DynamicMeshEPSt6vectorIiSaIiEERSt3mapIiiSt4lessIiESaISt4pairIKiiEEEPNS_15GeometryBooleanEENK3$_1clERKS0_ii"(ptr noundef nonnull align 1 dereferenceable(1) %62, ptr noundef nonnull align 8 dereferenceable(452) %726, i32 noundef %727, i32 noundef %728)
          to label %730 unwind label %747

730:                                              ; preds = %715
  %731 = zext i1 %729 to i8
  store i8 %731, ptr %68, align 1, !tbaa !39
  call void @llvm.lifetime.start.p0(i64 52, ptr %69) #10
  invoke void @_ZN7Riemann17FEdgeCollapseInfoC2Ev(ptr noundef nonnull align 4 dereferenceable(52) %69)
          to label %732 unwind label %751

732:                                              ; preds = %730
  call void @llvm.lifetime.start.p0(i64 4, ptr %70) #10
  %733 = load ptr, ptr %7, align 8, !tbaa !9
  %734 = getelementptr inbounds ptr, ptr %733, i64 1
  %735 = load ptr, ptr %734, align 8, !tbaa !9
  %736 = load i32, ptr %67, align 4, !tbaa !5
  %737 = load i32, ptr %66, align 4, !tbaa !5
  %738 = invoke noundef i32 @_ZN7Riemann11DynamicMesh12CollapseEdgeEiifRNS_17FEdgeCollapseInfoE(ptr noundef nonnull align 8 dereferenceable(452) %735, i32 noundef %736, i32 noundef %737, float noundef 0.000000e+00, ptr noundef nonnull align 4 dereferenceable(52) %69)
          to label %739 unwind label %755

739:                                              ; preds = %732
  store i32 %738, ptr %70, align 4, !tbaa !54
  %740 = load i32, ptr %70, align 4, !tbaa !54
  %741 = icmp ne i32 %740, 0
  br i1 %741, label %742, label %761

742:                                              ; preds = %739
  %743 = load i32, ptr %70, align 4, !tbaa !54
  %744 = icmp eq i32 %743, 26
  br i1 %744, label %745, label %746

745:                                              ; preds = %742
  br label %760

746:                                              ; preds = %742
  call void @__assert_fail(ptr noundef @.str.3, ptr noundef @.str.1, i32 noundef 2127, ptr noundef @__PRETTY_FUNCTION__._ZN7Riemann21SimplifyAlongNewEdgesEiPPNS_11DynamicMeshEPSt6vectorIiSaIiEERSt3mapIiiSt4lessIiESaISt4pairIKiiEEEPNS_15GeometryBooleanE) #11
  unreachable

747:                                              ; preds = %715
  %748 = landingpad { ptr, i32 }
          cleanup
  %749 = extractvalue { ptr, i32 } %748, 0
  store ptr %749, ptr %17, align 8
  %750 = extractvalue { ptr, i32 } %748, 1
  store i32 %750, ptr %18, align 4
  br label %812

751:                                              ; preds = %730
  %752 = landingpad { ptr, i32 }
          cleanup
  %753 = extractvalue { ptr, i32 } %752, 0
  store ptr %753, ptr %17, align 8
  %754 = extractvalue { ptr, i32 } %752, 1
  store i32 %754, ptr %18, align 4
  br label %811

755:                                              ; preds = %806, %802, %796, %794, %790, %786, %783, %773, %764, %732
  %756 = landingpad { ptr, i32 }
          cleanup
  %757 = extractvalue { ptr, i32 } %756, 0
  store ptr %757, ptr %17, align 8
  %758 = extractvalue { ptr, i32 } %756, 1
  store i32 %758, ptr %18, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %70) #10
  br label %811

759:                                              ; No predecessors!
  br label %760

760:                                              ; preds = %759, %745
  br label %810

761:                                              ; preds = %739
  %762 = load i8, ptr %68, align 1, !tbaa !39, !range !40, !noundef !41
  %763 = trunc i8 %762 to i1
  br i1 %763, label %764, label %783

764:                                              ; preds = %761
  %765 = load ptr, ptr %7, align 8, !tbaa !9
  %766 = getelementptr inbounds ptr, ptr %765, i64 1
  %767 = load ptr, ptr %766, align 8, !tbaa !9
  %768 = getelementptr inbounds %"struct.Riemann::FEdgeCollapseInfo", ptr %69, i32 0, i32 7
  %769 = getelementptr inbounds %"class.Maths::TIndex2", ptr %768, i32 0, i32 0
  %770 = load i32, ptr %769, align 4, !tbaa !56
  %771 = invoke noundef zeroext i1 @_ZNK7Riemann11DynamicMesh14IsBoundaryEdgeEi(ptr noundef nonnull align 8 dereferenceable(452) %767, i32 noundef %770)
          to label %772 unwind label %755

772:                                              ; preds = %764
  br i1 %771, label %773, label %783

773:                                              ; preds = %772
  %774 = getelementptr inbounds [2 x %"class.std::set"], ptr %12, i64 0, i64 1
  %775 = getelementptr inbounds %"struct.Riemann::FEdgeCollapseInfo", ptr %69, i32 0, i32 7
  %776 = getelementptr inbounds %"class.Maths::TIndex2", ptr %775, i32 0, i32 0
  %777 = invoke { ptr, i8 } @_ZNSt3setIiSt4lessIiESaIiEE6insertERKi(ptr noundef nonnull align 8 dereferenceable(48) %774, ptr noundef nonnull align 4 dereferenceable(4) %776)
          to label %778 unwind label %755

778:                                              ; preds = %773
  %779 = getelementptr inbounds { ptr, i8 }, ptr %71, i32 0, i32 0
  %780 = extractvalue { ptr, i8 } %777, 0
  store ptr %780, ptr %779, align 8
  %781 = getelementptr inbounds { ptr, i8 }, ptr %71, i32 0, i32 1
  %782 = extractvalue { ptr, i8 } %777, 1
  store i8 %782, ptr %781, align 8
  br label %783

783:                                              ; preds = %778, %772, %761
  %784 = load ptr, ptr %9, align 8, !tbaa !9
  %785 = invoke noundef i64 @_ZNSt3mapIiiSt4lessIiESaISt4pairIKiiEEE5eraseERS3_(ptr noundef nonnull align 8 dereferenceable(48) %784, ptr noundef nonnull align 4 dereferenceable(4) %60)
          to label %786 unwind label %755

786:                                              ; preds = %783
  %787 = getelementptr inbounds [2 x %"class.std::set"], ptr %12, i64 0, i64 1
  %788 = getelementptr inbounds %"struct.Riemann::FEdgeCollapseInfo", ptr %69, i32 0, i32 4
  %789 = invoke noundef i64 @_ZNSt3setIiSt4lessIiESaIiEE5eraseERKi(ptr noundef nonnull align 8 dereferenceable(48) %787, ptr noundef nonnull align 4 dereferenceable(4) %788)
          to label %790 unwind label %755

790:                                              ; preds = %786
  %791 = getelementptr inbounds [2 x %"class.std::set"], ptr %12, i64 0, i64 1
  %792 = getelementptr inbounds %"struct.Riemann::FEdgeCollapseInfo", ptr %69, i32 0, i32 6
  %793 = invoke noundef nonnull align 4 dereferenceable(4) ptr @_ZN5Maths7TIndex2IiEixEi(ptr noundef nonnull align 4 dereferenceable(8) %792, i32 noundef 0)
          to label %794 unwind label %755

794:                                              ; preds = %790
  %795 = invoke noundef i64 @_ZNSt3setIiSt4lessIiESaIiEE5eraseERKi(ptr noundef nonnull align 8 dereferenceable(48) %791, ptr noundef nonnull align 4 dereferenceable(4) %793)
          to label %796 unwind label %755

796:                                              ; preds = %794
  %797 = getelementptr inbounds %"struct.Riemann::FEdgeCollapseInfo", ptr %69, i32 0, i32 6
  %798 = invoke noundef nonnull align 4 dereferenceable(4) ptr @_ZN5Maths7TIndex2IiEixEi(ptr noundef nonnull align 4 dereferenceable(8) %797, i32 noundef 1)
          to label %799 unwind label %755

799:                                              ; preds = %796
  %800 = load i32, ptr %798, align 4, !tbaa !5
  %801 = icmp ne i32 %800, -1
  br i1 %801, label %802, label %809

802:                                              ; preds = %799
  %803 = getelementptr inbounds [2 x %"class.std::set"], ptr %12, i64 0, i64 1
  %804 = getelementptr inbounds %"struct.Riemann::FEdgeCollapseInfo", ptr %69, i32 0, i32 6
  %805 = invoke noundef nonnull align 4 dereferenceable(4) ptr @_ZN5Maths7TIndex2IiEixEi(ptr noundef nonnull align 4 dereferenceable(8) %804, i32 noundef 1)
          to label %806 unwind label %755

806:                                              ; preds = %802
  %807 = invoke noundef i64 @_ZNSt3setIiSt4lessIiESaIiEE5eraseERKi(ptr noundef nonnull align 8 dereferenceable(48) %803, ptr noundef nonnull align 4 dereferenceable(4) %805)
          to label %808 unwind label %755

808:                                              ; preds = %806
  br label %809

809:                                              ; preds = %808, %799
  br label %810

810:                                              ; preds = %809, %760
  call void @llvm.lifetime.end.p0(i64 4, ptr %70) #10
  call void @llvm.lifetime.end.p0(i64 52, ptr %69) #10
  call void @llvm.lifetime.end.p0(i64 1, ptr %68) #10
  call void @llvm.lifetime.end.p0(i64 4, ptr %67) #10
  call void @llvm.lifetime.end.p0(i64 4, ptr %66) #10
  br label %813

811:                                              ; preds = %755, %751
  call void @llvm.lifetime.end.p0(i64 52, ptr %69) #10
  br label %812

812:                                              ; preds = %811, %747
  call void @llvm.lifetime.end.p0(i64 1, ptr %68) #10
  call void @llvm.lifetime.end.p0(i64 4, ptr %67) #10
  call void @llvm.lifetime.end.p0(i64 4, ptr %66) #10
  br label %840

813:                                              ; preds = %810, %712
  %814 = load i32, ptr %19, align 4, !tbaa !5
  %815 = add nsw i32 %814, 1
  store i32 %815, ptr %19, align 4, !tbaa !5
  %816 = getelementptr inbounds [2 x %"class.std::set"], ptr %12, i64 0, i64 0
  %817 = getelementptr inbounds %"struct.Riemann::FEdgeCollapseInfo", ptr %59, i32 0, i32 4
  %818 = invoke noundef i64 @_ZNSt3setIiSt4lessIiESaIiEE5eraseERKi(ptr noundef nonnull align 8 dereferenceable(48) %816, ptr noundef nonnull align 4 dereferenceable(4) %817)
          to label %819 unwind label %708

819:                                              ; preds = %813
  %820 = getelementptr inbounds [2 x %"class.std::set"], ptr %12, i64 0, i64 0
  %821 = getelementptr inbounds %"struct.Riemann::FEdgeCollapseInfo", ptr %59, i32 0, i32 6
  %822 = invoke noundef nonnull align 4 dereferenceable(4) ptr @_ZN5Maths7TIndex2IiEixEi(ptr noundef nonnull align 4 dereferenceable(8) %821, i32 noundef 0)
          to label %823 unwind label %708

823:                                              ; preds = %819
  %824 = invoke noundef i64 @_ZNSt3setIiSt4lessIiESaIiEE5eraseERKi(ptr noundef nonnull align 8 dereferenceable(48) %820, ptr noundef nonnull align 4 dereferenceable(4) %822)
          to label %825 unwind label %708

825:                                              ; preds = %823
  %826 = getelementptr inbounds %"struct.Riemann::FEdgeCollapseInfo", ptr %59, i32 0, i32 6
  %827 = invoke noundef nonnull align 4 dereferenceable(4) ptr @_ZN5Maths7TIndex2IiEixEi(ptr noundef nonnull align 4 dereferenceable(8) %826, i32 noundef 1)
          to label %828 unwind label %708

828:                                              ; preds = %825
  %829 = load i32, ptr %827, align 4, !tbaa !5
  %830 = icmp ne i32 %829, -1
  br i1 %830, label %831, label %838

831:                                              ; preds = %828
  %832 = getelementptr inbounds [2 x %"class.std::set"], ptr %12, i64 0, i64 0
  %833 = getelementptr inbounds %"struct.Riemann::FEdgeCollapseInfo", ptr %59, i32 0, i32 6
  %834 = invoke noundef nonnull align 4 dereferenceable(4) ptr @_ZN5Maths7TIndex2IiEixEi(ptr noundef nonnull align 4 dereferenceable(8) %833, i32 noundef 1)
          to label %835 unwind label %708

835:                                              ; preds = %831
  %836 = invoke noundef i64 @_ZNSt3setIiSt4lessIiESaIiEE5eraseERKi(ptr noundef nonnull align 8 dereferenceable(48) %832, ptr noundef nonnull align 4 dereferenceable(4) %834)
          to label %837 unwind label %708

837:                                              ; preds = %835
  br label %838

838:                                              ; preds = %837, %828
  br label %839

839:                                              ; preds = %838, %667
  store i32 15, ptr %26, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %64) #10
  call void @llvm.lifetime.end.p0(i64 1, ptr %63) #10
  call void @llvm.lifetime.end.p0(i64 1, ptr %62) #10
  call void @llvm.lifetime.end.p0(i64 4, ptr %61) #10
  call void @llvm.lifetime.end.p0(i64 4, ptr %60) #10
  call void @llvm.lifetime.end.p0(i64 52, ptr %59) #10
  br label %845

840:                                              ; preds = %812, %708
  call void @llvm.lifetime.end.p0(i64 4, ptr %64) #10
  br label %841

841:                                              ; preds = %840, %704
  call void @llvm.lifetime.end.p0(i64 1, ptr %63) #10
  call void @llvm.lifetime.end.p0(i64 1, ptr %62) #10
  br label %842

842:                                              ; preds = %841, %700
  call void @llvm.lifetime.end.p0(i64 4, ptr %61) #10
  br label %843

843:                                              ; preds = %842, %696
  call void @llvm.lifetime.end.p0(i64 4, ptr %60) #10
  br label %844

844:                                              ; preds = %843, %692
  call void @llvm.lifetime.end.p0(i64 52, ptr %59) #10
  br label %846

845:                                              ; preds = %839, %638
  call void @llvm.lifetime.end.p0(i64 1, ptr %48) #10
  br label %847

846:                                              ; preds = %844, %634
  call void @llvm.lifetime.end.p0(i64 1, ptr %48) #10
  br label %848

847:                                              ; preds = %845, %545
  call void @llvm.lifetime.end.p0(i64 1, ptr %43) #10
  br label %849

848:                                              ; preds = %846, %541
  call void @llvm.lifetime.end.p0(i64 1, ptr %43) #10
  br label %851

849:                                              ; preds = %847, %388
  call void @llvm.lifetime.end.p0(i64 12, ptr %42) #10
  call void @llvm.lifetime.end.p0(i64 12, ptr %41) #10
  call void @llvm.lifetime.end.p0(i64 12, ptr %40) #10
  call void @llvm.lifetime.end.p0(i64 4, ptr %39) #10
  %850 = load i32, ptr %26, align 4
  switch i32 %850, label %857 [
    i32 17, label %854
  ]

851:                                              ; preds = %848, %383
  call void @llvm.lifetime.end.p0(i64 12, ptr %42) #10
  br label %852

852:                                              ; preds = %851, %379
  call void @llvm.lifetime.end.p0(i64 12, ptr %41) #10
  br label %853

853:                                              ; preds = %852, %375
  call void @llvm.lifetime.end.p0(i64 12, ptr %40) #10
  call void @llvm.lifetime.end.p0(i64 4, ptr %39) #10
  call void @llvm.lifetime.end.p0(i64 4, ptr %38) #10
  br label %869

854:                                              ; preds = %849, %339
  %855 = load i32, ptr %38, align 4, !tbaa !5
  %856 = add nsw i32 %855, 1
  store i32 %856, ptr %38, align 4, !tbaa !5
  br label %329, !llvm.loop !59

857:                                              ; preds = %849, %332
  call void @llvm.lifetime.end.p0(i64 4, ptr %38) #10
  br label %858

858:                                              ; preds = %857
  store i32 0, ptr %26, align 4
  br label %859

859:                                              ; preds = %858, %327
  call void @llvm.lifetime.end.p0(i64 4, ptr %36) #10
  call void @llvm.lifetime.end.p0(i64 48, ptr %35) #10
  call void @llvm.lifetime.end.p0(i64 2, ptr %34) #10
  br label %860

860:                                              ; preds = %859, %241
  call void @llvm.lifetime.end.p0(i64 4, ptr %33) #10
  br label %861

861:                                              ; preds = %860, %224
  call void @llvm.lifetime.end.p0(i64 1, ptr %30) #10
  call void @llvm.lifetime.end.p0(i64 8, ptr %29) #10
  call void @llvm.lifetime.end.p0(i64 8, ptr %28) #10
  %862 = load i32, ptr %26, align 4
  switch i32 %862, label %864 [
    i32 0, label %863
  ]

863:                                              ; preds = %861
  store i32 0, ptr %26, align 4
  br label %864

864:                                              ; preds = %863, %861, %169, %147
  call void @llvm.lifetime.end.p0(i64 4, ptr %27) #10
  %865 = load i32, ptr %26, align 4
  switch i32 %865, label %875 [
    i32 0, label %866
    i32 8, label %867
  ]

866:                                              ; preds = %864
  br label %867

867:                                              ; preds = %866, %864
  %868 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %24) #10
  br label %135

869:                                              ; preds = %853, %307
  call void @llvm.lifetime.end.p0(i64 4, ptr %36) #10
  br label %870

870:                                              ; preds = %869, %259
  call void @llvm.lifetime.end.p0(i64 48, ptr %35) #10
  call void @llvm.lifetime.end.p0(i64 2, ptr %34) #10
  br label %871

871:                                              ; preds = %870, %242
  call void @llvm.lifetime.end.p0(i64 4, ptr %33) #10
  br label %872

872:                                              ; preds = %871, %208
  call void @llvm.lifetime.end.p0(i64 1, ptr %30) #10
  call void @llvm.lifetime.end.p0(i64 8, ptr %29) #10
  br label %873

873:                                              ; preds = %872, %187
  call void @llvm.lifetime.end.p0(i64 8, ptr %28) #10
  br label %874

874:                                              ; preds = %873, %148
  call void @llvm.lifetime.end.p0(i64 4, ptr %27) #10
  call void @llvm.lifetime.end.p0(i64 8, ptr %25) #10
  call void @llvm.lifetime.end.p0(i64 8, ptr %24) #10
  call void @llvm.lifetime.end.p0(i64 8, ptr %23) #10
  br label %905

875:                                              ; preds = %864, %137
  call void @llvm.lifetime.end.p0(i64 8, ptr %25) #10
  call void @llvm.lifetime.end.p0(i64 8, ptr %24) #10
  call void @llvm.lifetime.end.p0(i64 8, ptr %23) #10
  br label %876

876:                                              ; preds = %875
  call void @llvm.lifetime.start.p0(i64 24, ptr %72) #10
  %877 = getelementptr inbounds [2 x %"class.std::set"], ptr %12, i64 0, i64 0
  invoke void @_Z8ToVectorIiSt3setIiSt4lessIiESaIiEEESt6vectorIT_SaIS6_EERKT0_(ptr dead_on_unwind writable sret(%"class.std::vector") align 8 %72, ptr noundef nonnull align 8 dereferenceable(48) %877)
          to label %878 unwind label %891

878:                                              ; preds = %876
  %879 = load ptr, ptr %8, align 8, !tbaa !9
  %880 = getelementptr inbounds %"class.std::vector", ptr %879, i64 0
  %881 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorIiSaIiEEaSEOS1_(ptr noundef nonnull align 8 dereferenceable(24) %880, ptr noundef nonnull align 8 dereferenceable(24) %72) #10
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %72) #10
  call void @llvm.lifetime.end.p0(i64 24, ptr %72) #10
  call void @llvm.lifetime.start.p0(i64 24, ptr %73) #10
  %882 = getelementptr inbounds [2 x %"class.std::set"], ptr %12, i64 0, i64 1
  invoke void @_Z8ToVectorIiSt3setIiSt4lessIiESaIiEEESt6vectorIT_SaIS6_EERKT0_(ptr dead_on_unwind writable sret(%"class.std::vector") align 8 %73, ptr noundef nonnull align 8 dereferenceable(48) %882)
          to label %883 unwind label %895

883:                                              ; preds = %878
  %884 = load ptr, ptr %8, align 8, !tbaa !9
  %885 = getelementptr inbounds %"class.std::vector", ptr %884, i64 1
  %886 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorIiSaIiEEaSEOS1_(ptr noundef nonnull align 8 dereferenceable(24) %885, ptr noundef nonnull align 8 dereferenceable(24) %73) #10
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %73) #10
  call void @llvm.lifetime.end.p0(i64 24, ptr %73) #10
  %887 = load i32, ptr %19, align 4, !tbaa !5
  %888 = load i32, ptr %22, align 4, !tbaa !5
  %889 = icmp eq i32 %887, %888
  br i1 %889, label %890, label %899

890:                                              ; preds = %883
  store i32 6, ptr %26, align 4
  br label %902

891:                                              ; preds = %876
  %892 = landingpad { ptr, i32 }
          cleanup
  %893 = extractvalue { ptr, i32 } %892, 0
  store ptr %893, ptr %17, align 8
  %894 = extractvalue { ptr, i32 } %892, 1
  store i32 %894, ptr %18, align 4
  call void @llvm.lifetime.end.p0(i64 24, ptr %72) #10
  br label %905

895:                                              ; preds = %878
  %896 = landingpad { ptr, i32 }
          cleanup
  %897 = extractvalue { ptr, i32 } %896, 0
  store ptr %897, ptr %17, align 8
  %898 = extractvalue { ptr, i32 } %896, 1
  store i32 %898, ptr %18, align 4
  call void @llvm.lifetime.end.p0(i64 24, ptr %73) #10
  br label %905

899:                                              ; preds = %883
  %900 = load i32, ptr %20, align 4, !tbaa !5
  %901 = add nsw i32 %900, 1
  store i32 %901, ptr %20, align 4, !tbaa !5
  store i32 0, ptr %26, align 4
  br label %902

902:                                              ; preds = %899, %890
  call void @llvm.lifetime.end.p0(i64 4, ptr %22) #10
  %903 = load i32, ptr %26, align 4
  switch i32 %903, label %927 [
    i32 0, label %904
    i32 6, label %906
  ]

904:                                              ; preds = %902
  br label %121, !llvm.loop !60

905:                                              ; preds = %895, %891, %874
  call void @llvm.lifetime.end.p0(i64 4, ptr %22) #10
  call void @llvm.lifetime.end.p0(i64 4, ptr %21) #10
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #10
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #10
  br label %914

906:                                              ; preds = %902, %121
  call void @llvm.lifetime.end.p0(i64 4, ptr %21) #10
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #10
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #10
  %907 = getelementptr inbounds [2 x %"class.std::set"], ptr %12, i32 0, i32 0
  %908 = getelementptr inbounds %"class.std::set", ptr %907, i64 2
  br label %909

909:                                              ; preds = %909, %906
  %910 = phi ptr [ %908, %906 ], [ %911, %909 ]
  %911 = getelementptr inbounds %"class.std::set", ptr %910, i64 -1
  call void @_ZNSt3setIiSt4lessIiESaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(48) %911) #10
  %912 = icmp eq ptr %911, %907
  br i1 %912, label %913, label %909

913:                                              ; preds = %909
  call void @llvm.lifetime.end.p0(i64 96, ptr %12) #10
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #10
  ret void

914:                                              ; preds = %905, %116
  %915 = getelementptr inbounds [2 x %"class.std::set"], ptr %12, i32 0, i32 0
  %916 = getelementptr inbounds %"class.std::set", ptr %915, i64 2
  br label %917

917:                                              ; preds = %917, %914
  %918 = phi ptr [ %916, %914 ], [ %919, %917 ]
  %919 = getelementptr inbounds %"class.std::set", ptr %918, i64 -1
  call void @_ZNSt3setIiSt4lessIiESaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(48) %919) #10
  %920 = icmp eq ptr %919, %915
  br i1 %920, label %921, label %917

921:                                              ; preds = %917
  call void @llvm.lifetime.end.p0(i64 96, ptr %12) #10
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #10
  br label %922

922:                                              ; preds = %921
  %923 = load ptr, ptr %17, align 8
  %924 = load i32, ptr %18, align 4
  %925 = insertvalue { ptr, i32 } poison, ptr %923, 0
  %926 = insertvalue { ptr, i32 } %925, i32 %924, 1
  resume { ptr, i32 } %926

927:                                              ; preds = %902
  unreachable
}

; Function Attrs: nounwind
declare float @cosf(float noundef) #5

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

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

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZNK7Riemann11DynamicMesh16GetTriangleCountEv(ptr noundef nonnull align 8 dereferenceable(452)) #4 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(16) ptr @_ZN7Riemann11DynamicMesh7GetEdgeEi(ptr noundef nonnull align 8 dereferenceable(452), i32 noundef) #1 align 2

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

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN5Maths8TVector3IfE4ZeroEv(ptr dead_on_unwind noalias writable sret(%"class.Maths::TVector3") align 4) #2 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZN7Riemann20FLocalPlanarSimplify6IsFlatERKNS_11DynamicMeshEifRN5Maths8TVector3IfEE(ptr noundef nonnull align 8 dereferenceable(452), i32 noundef, float noundef, ptr noundef nonnull align 4 dereferenceable(12)) #2 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZNK7Riemann11DynamicMesh9GetVertexEi(ptr dead_on_unwind noalias writable sret(%"class.Maths::TVector3") align 4, ptr noundef nonnull align 8 dereferenceable(452), i32 noundef) #3 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef float @_ZN5Maths8TVector3IfE13SafeNormalizeEv(ptr noundef nonnull align 4 dereferenceable(12)) #4 align 2

; Function Attrs: noreturn nounwind
declare void @__assert_fail(ptr noundef, ptr noundef, i32 noundef, ptr noundef) #8

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZN7Riemann20FLocalPlanarSimplify32CollapseWouldHurtTriangleQualityERKNS_11DynamicMeshERKN5Maths8TVector3IfEEiS8_iS8_fb(ptr noundef nonnull align 8 dereferenceable(452), ptr noundef nonnull align 4 dereferenceable(12), i32 noundef, ptr noundef nonnull align 4 dereferenceable(12), i32 noundef, ptr noundef nonnull align 4 dereferenceable(12), float noundef, i1 noundef zeroext) #2 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZN7Riemann20FLocalPlanarSimplify29CollapseWouldChangeShapeOrUVsERKNS_11DynamicMeshERKSt3setIiSt4lessIiESaIiEEfiiRKN5Maths8TVector3IfEEiSF_SF_bbbbfbf(ptr noundef nonnull align 8 dereferenceable(452), ptr noundef nonnull align 8 dereferenceable(48), float noundef, i32 noundef, i32 noundef, ptr noundef nonnull align 4 dereferenceable(12), i32 noundef, ptr noundef nonnull align 4 dereferenceable(12), ptr noundef nonnull align 4 dereferenceable(12), i1 noundef zeroext, i1 noundef zeroext, i1 noundef zeroext, i1 noundef zeroext, float noundef, i1 noundef zeroext, float noundef) #2 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZNK7Riemann11DynamicMesh11GetTriangleEi(ptr dead_on_unwind noalias writable sret(%"class.Maths::TIndex3") align 4, ptr noundef nonnull align 8 dereferenceable(452), i32 noundef) #3 align 2

; Function Attrs: mustprogress uwtable
declare hidden noundef i32 @_ZN7RiemannL15FindTriOtherVtxIiN5Maths7TIndex3IiEEEEiT_S4_RKT0_(i32 noundef, i32 noundef, ptr noundef nonnull align 4 dereferenceable(12)) #2

; Function Attrs: mustprogress uwtable
declare hidden void @"_ZNK7Riemann11DynamicMesh23EnumerateVertexVerticesIZNS_21SimplifyAlongNewEdgesEiPPS0_PSt6vectorIiSaIiEERSt3mapIiiSt4lessIiESaISt4pairIKiiEEEPNS_15GeometryBooleanEE3$_0EEviT_"(ptr noundef nonnull align 8 dereferenceable(452), i32 noundef, ptr noundef byval(%class.anon.58) align 8) #2 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN7Riemann17FEdgeCollapseInfoC2Ev(ptr noundef nonnull align 4 dereferenceable(52)) unnamed_addr #3 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare hidden noundef zeroext i1 @"_ZZN7Riemann21SimplifyAlongNewEdgesEiPPNS_11DynamicMeshEPSt6vectorIiSaIiEERSt3mapIiiSt4lessIiESaISt4pairIKiiEEEPNS_15GeometryBooleanEENK3$_1clERKS0_ii"(ptr noundef nonnull align 1 dereferenceable(1), ptr noundef nonnull align 8 dereferenceable(452), i32 noundef, i32 noundef) #3 align 2

declare noundef i32 @_ZN7Riemann11DynamicMesh12CollapseEdgeEiifRNS_17FEdgeCollapseInfoE(ptr noundef nonnull align 8 dereferenceable(452), i32 noundef, i32 noundef, float noundef, ptr noundef nonnull align 4 dereferenceable(52)) #9

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

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

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

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

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

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #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 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 = { nounwind "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 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #7 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #8 = { noreturn nounwind "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 #9 = { "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 #10 = { nounwind }
attributes #11 = { noreturn 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, !14, i64 16}
!12 = !{!"_ZTSN7Riemann15GeometryBooleanE", !13, i64 0, !14, i64 4, !15, i64 8, !15, i64 9, !15, i64 10, !15, i64 11, !15, i64 12, !14, i64 16, !14, i64 20, !15, i64 24, !15, i64 25, !15, i64 26, !14, i64 28, !15, i64 32, !14, i64 36, !6, i64 40, !7, i64 48, !7, i64 64, !10, i64 120, !16, i64 128, !19, i64 160, !23, i64 184, !15, i64 232, !32, i64 240}
!13 = !{!"_ZTSN7Riemann15GeometryBoolean9BooleanOpE", !7, i64 0}
!14 = !{!"float", !7, i64 0}
!15 = !{!"bool", !7, i64 0}
!16 = !{!"_ZTSN5Maths9TransformE", !17, i64 0, !18, i64 12}
!17 = !{!"_ZTSN5Maths8TVector3IfEE", !14, i64 0, !14, i64 4, !14, i64 8}
!18 = !{!"_ZTSN5Maths10QuaternionE", !14, i64 0, !14, i64 4, !14, i64 8, !14, i64 12}
!19 = !{!"_ZTSSt6vectorIiSaIiEE", !20, i64 0}
!20 = !{!"_ZTSSt12_Vector_baseIiSaIiEE", !21, i64 0}
!21 = !{!"_ZTSNSt12_Vector_baseIiSaIiEE12_Vector_implE", !22, i64 0}
!22 = !{!"_ZTSNSt12_Vector_baseIiSaIiEE17_Vector_impl_dataE", !10, i64 0, !10, i64 8, !10, i64 16}
!23 = !{!"_ZTSSt3setIiSt4lessIiESaIiEE", !24, i64 0}
!24 = !{!"_ZTSSt8_Rb_treeIiiSt9_IdentityIiESt4lessIiESaIiEE", !25, i64 0}
!25 = !{!"_ZTSNSt8_Rb_treeIiiSt9_IdentityIiESt4lessIiESaIiEE13_Rb_tree_implIS3_Lb1EEE", !26, i64 0, !28, i64 8}
!26 = !{!"_ZTSSt20_Rb_tree_key_compareISt4lessIiEE", !27, i64 0}
!27 = !{!"_ZTSSt4lessIiE"}
!28 = !{!"_ZTSSt15_Rb_tree_header", !29, i64 0, !31, i64 32}
!29 = !{!"_ZTSSt18_Rb_tree_node_base", !30, i64 0, !10, i64 8, !10, i64 16, !10, i64 24}
!30 = !{!"_ZTSSt14_Rb_tree_color", !7, i64 0}
!31 = !{!"long", !7, i64 0}
!32 = !{!"_ZTSN7Riemann10FIndexMapiE", !33, i64 0, !33, i64 48, !15, i64 96, !15, i64 97}
!33 = !{!"_ZTSSt3mapIiiSt4lessIiESaISt4pairIKiiEEE", !34, i64 0}
!34 = !{!"_ZTSSt8_Rb_treeIiSt4pairIKiiESt10_Select1stIS2_ESt4lessIiESaIS2_EE", !35, i64 0}
!35 = !{!"_ZTSNSt8_Rb_treeIiSt4pairIKiiESt10_Select1stIS2_ESt4lessIiESaIS2_EE13_Rb_tree_implIS6_Lb1EEE", !26, i64 0, !28, i64 8}
!36 = !{!14, !14, i64 0}
!37 = distinct !{!37, !38}
!38 = !{!"llvm.loop.mustprogress"}
!39 = !{!15, !15, i64 0}
!40 = !{i8 0, i8 2}
!41 = !{}
!42 = distinct !{!42, !38}
!43 = distinct !{!43, !38}
!44 = !{!12, !15, i64 8}
!45 = !{!12, !14, i64 20}
!46 = !{!12, !15, i64 24}
!47 = !{!12, !6, i64 40}
!48 = !{!12, !15, i64 25}
!49 = !{!12, !15, i64 26}
!50 = !{!12, !14, i64 28}
!51 = !{!12, !15, i64 32}
!52 = !{!12, !14, i64 36}
!53 = distinct !{!53, !38}
!54 = !{!55, !55, i64 0}
!55 = !{!"_ZTSN7Riemann11EMeshResultE", !7, i64 0}
!56 = !{!57, !6, i64 40}
!57 = !{!"_ZTSN7Riemann17FEdgeCollapseInfoE", !6, i64 0, !6, i64 4, !58, i64 8, !15, i64 16, !6, i64 20, !58, i64 24, !58, i64 32, !58, i64 40, !14, i64 48}
!58 = !{!"_ZTSN5Maths7TIndex2IiEE", !6, i64 0, !6, i64 4}
!59 = distinct !{!59, !38}
!60 = distinct !{!60, !38}


; 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.Maths::TVector3" = type { float, float, float }
%"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.__gnu_cxx::__normal_iterator.57" = type { ptr }
%"class.Maths::TIndex3" = type { i32, i32, i32 }
%class.anon.58 = type { ptr, ptr, ptr, ptr }
%"struct.Riemann::FEdgeCollapseInfo" = type { i32, i32, %"class.Maths::TIndex2", i8, i32, %"class.Maths::TIndex2", %"class.Maths::TIndex2", %"class.Maths::TIndex2", float }
%"class.Maths::TIndex2" = type { i32, i32 }
%class.anon.59 = type { i8 }
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl" = type { %"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" = type { ptr, ptr, ptr }

@__const._ZN7Riemann21SimplifyAlongNewEdgesEiPPNS_11DynamicMeshEPSt6vectorIiSaIiEERSt3mapIiiSt4lessIiESaISt4pairIKiiEEEPNS_15GeometryBooleanE.Matches = external hidden unnamed_addr constant [2 x i32], align 4
@.str = external hidden unnamed_addr constant [37 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [88 x i8], align 1
@__PRETTY_FUNCTION__._ZN7Riemann21SimplifyAlongNewEdgesEiPPNS_11DynamicMeshEPSt6vectorIiSaIiEERSt3mapIiiSt4lessIiESaISt4pairIKiiEEEPNS_15GeometryBooleanE = external hidden unnamed_addr constant [118 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [20 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [60 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: inlinehint mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZNK7Riemann11DynamicMesh6IsEdgeEi(ptr noundef nonnull align 8 dereferenceable(452), i32 noundef) local_unnamed_addr #1 align 2

declare i32 @__gxx_personality_v0(...)

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local { ptr, i8 } @_ZNSt3setIiSt4lessIiESaIiEE6insertERKi(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 ptr @_ZNSt6vectorIiSaIiEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #4 align 2

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

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZNK5Maths8TVector3IfEmiERKS1_(ptr dead_on_unwind noalias writable sret(%"class.Maths::TVector3") align 4, ptr noundef nonnull align 4 dereferenceable(12), ptr noundef nonnull align 4 dereferenceable(12)) local_unnamed_addr #3 align 2

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN7Riemann21SimplifyAlongNewEdgesEiPPNS_11DynamicMeshEPSt6vectorIiSaIiEERSt3mapIiiSt4lessIiESaISt4pairIKiiEEEPNS_15GeometryBooleanE(i32 noundef %0, ptr noundef %1, ptr noundef %2, ptr noundef nonnull align 8 dereferenceable(48) %3, ptr nocapture noundef readonly %4) local_unnamed_addr #2 personality ptr @__gxx_personality_v0 {
.preheader269:
  %5 = alloca ptr, align 8
  %6 = alloca [2 x %"class.std::set"], align 16
  %7 = alloca %"class.std::set", align 8
  %8 = alloca %"class.__gnu_cxx::__normal_iterator.57", align 8
  %9 = alloca %"class.__gnu_cxx::__normal_iterator.57", align 8
  %10 = alloca [2 x i32], align 8
  %11 = alloca [2 x [2 x %"class.Maths::TVector3"]], align 16
  %12 = alloca %"class.Maths::TVector3", align 4
  %13 = alloca %"class.Maths::TVector3", align 4
  %14 = alloca %"class.Maths::TVector3", align 4
  %15 = alloca i8, align 1
  %16 = alloca i32, align 4
  %17 = alloca %"class.Maths::TIndex3", align 4
  %18 = alloca i32, align 4
  %19 = alloca %class.anon.58, align 8
  %20 = alloca %"struct.Riemann::FEdgeCollapseInfo", align 4
  %21 = alloca i32, align 4
  %22 = alloca %class.anon.59, align 1
  %23 = alloca %"struct.Riemann::FEdgeCollapseInfo", align 4
  %24 = alloca %"class.std::vector", align 8
  %25 = alloca %"class.std::vector", align 8
  store ptr %1, ptr %5, align 8, !tbaa !5
  %26 = getelementptr inbounds i8, ptr %4, i64 16
  %27 = load float, ptr %26, align 8, !tbaa !9
  %28 = fmul float %27, 0x3F91DF46A0000000
  %29 = tail call float @cosf(float noundef %28) #8
  call void @llvm.lifetime.start.p0(i64 96, ptr nonnull %6) #8
  call void @_ZNSt3setIiSt4lessIiESaIiEEC2Ev(ptr noundef nonnull align 8 dereferenceable(48) %6) #8
  %.ptr.1 = getelementptr inbounds i8, ptr %6, i64 48
  call void @_ZNSt3setIiSt4lessIiESaIiEEC2Ev(ptr noundef nonnull align 8 dereferenceable(48) %.ptr.1) #8
  %30 = icmp sgt i32 %0, 0
  %indvars.iv356.lcssa465.sroa.gep470 = getelementptr inbounds i8, ptr %10, i64 4
  %.lcssa451.sroa.gep = getelementptr inbounds i8, ptr %10, i64 4
  br i1 %30, label %.lr.ph.preheader, label %.preheader268

.lr.ph.preheader:                                 ; preds = %.preheader269
  %wide.trip.count = zext nneg i32 %0 to i64
  br label %.lr.ph

.preheader268:                                    ; preds = %69, %.preheader269
  %31 = icmp eq i32 %0, 2
  %32 = load i64, ptr @__const._ZN7Riemann21SimplifyAlongNewEdgesEiPPNS_11DynamicMeshEPSt6vectorIiSaIiEERSt3mapIiiSt4lessIiESaISt4pairIKiiEEEPNS_15GeometryBooleanE.Matches, align 4
  %33 = getelementptr inbounds i8, ptr %10, i64 4
  %34 = getelementptr inbounds i8, ptr %11, i64 12
  %35 = getelementptr inbounds i8, ptr %11, i64 24
  %36 = getelementptr inbounds i8, ptr %11, i64 36
  %37 = icmp slt i32 %0, 1
  %38 = getelementptr inbounds i8, ptr %4, i64 20
  %39 = getelementptr inbounds i8, ptr %4, i64 24
  %40 = getelementptr inbounds i8, ptr %4, i64 40
  %41 = getelementptr inbounds i8, ptr %4, i64 25
  %42 = getelementptr inbounds i8, ptr %4, i64 26
  %43 = getelementptr inbounds i8, ptr %4, i64 28
  %44 = getelementptr inbounds i8, ptr %4, i64 32
  %45 = getelementptr inbounds i8, ptr %4, i64 36
  %46 = getelementptr inbounds i8, ptr %19, i64 8
  %47 = getelementptr inbounds i8, ptr %19, i64 16
  %48 = getelementptr inbounds i8, ptr %19, i64 24
  %49 = getelementptr inbounds i8, ptr %20, i64 40
  %50 = getelementptr inbounds i8, ptr %23, i64 40
  %51 = getelementptr inbounds i8, ptr %23, i64 20
  %52 = getelementptr inbounds i8, ptr %23, i64 32
  %53 = getelementptr inbounds i8, ptr %20, i64 20
  %54 = getelementptr inbounds i8, ptr %20, i64 32
  %55 = getelementptr inbounds i8, ptr %4, i64 8
  %56 = getelementptr inbounds i8, ptr %2, i64 24
  %57 = sext i32 %0 to i64
  %58 = trunc i64 %32 to i32
  %59 = lshr i64 %32, 32
  %60 = trunc nuw i64 %59 to i32
  %61 = getelementptr inbounds i8, ptr %11, i64 36
  %62 = icmp eq i32 %0, 1
  %63 = getelementptr inbounds i8, ptr %10, i64 4
  %64 = getelementptr inbounds i8, ptr %10, i64 4
  %65 = getelementptr inbounds i8, ptr %11, i64 24
  br label %74

.lr.ph:                                           ; preds = %.lr.ph.preheader, %69
  %indvars.iv = phi i64 [ 0, %.lr.ph.preheader ], [ %indvars.iv.next, %69 ]
  call void @llvm.lifetime.start.p0(i64 48, ptr nonnull %7) #8
  %66 = getelementptr inbounds %"class.std::vector", ptr %2, i64 %indvars.iv
  %67 = call ptr @_ZNSt6vectorIiSaIiEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %66) #8
  %68 = call ptr @_ZNSt6vectorIiSaIiEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %66) #8
  invoke void @_ZNSt3setIiSt4lessIiESaIiEEC2IN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiS2_EEEEET_SB_(ptr noundef nonnull align 8 dereferenceable(48) %7, ptr %67, ptr %68)
          to label %69 unwind label %72

69:                                               ; preds = %.lr.ph
  %70 = getelementptr inbounds [2 x %"class.std::set"], ptr %6, i64 0, i64 %indvars.iv
  %71 = call noundef nonnull align 8 dereferenceable(48) ptr @_ZNSt3setIiSt4lessIiESaIiEEaSEOS3_(ptr noundef nonnull align 8 dereferenceable(48) %70, ptr noundef nonnull align 8 dereferenceable(48) %7) #8
  call void @_ZNSt3setIiSt4lessIiESaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(48) %7) #8
  call void @llvm.lifetime.end.p0(i64 48, ptr nonnull %7) #8
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
  br i1 %exitcond.not, label %.preheader268, label %.lr.ph, !llvm.loop !35

72:                                               ; preds = %.lr.ph
  %73 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 48, ptr nonnull %7) #8
  br label %491

74:                                               ; preds = %.preheader268, %482
  %75 = phi i1 [ false, %482 ], [ true, %.preheader268 ]
  %.0164 = phi i32 [ %.1165.lcssa, %482 ], [ 0, %.preheader268 ]
  br i1 %75, label %76, label %489

76:                                               ; preds = %74
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %8) #8
  %77 = call ptr @_ZNSt6vectorIiSaIiEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %2) #8
  store ptr %77, ptr %8, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %9) #8
  %78 = call ptr @_ZNSt6vectorIiSaIiEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %2) #8
  store ptr %78, ptr %9, align 8
  %79 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPiSt6vectorIiSaIiEEEEbRKNS_17__normal_iteratorIT_T0_EESA_(ptr noundef nonnull align 8 dereferenceable(8) %8, ptr noundef nonnull align 8 dereferenceable(8) %9) #8
  br i1 %79, label %.lr.ph319, label %.thread254

.lr.ph319:                                        ; preds = %76, %.thread257
  %.1165317 = phi i32 [ %.12176260, %.thread257 ], [ %.0164, %76 ]
  %80 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %8) #8
  %81 = load i32, ptr %80, align 4, !tbaa !37
  %82 = load ptr, ptr %5, align 8, !tbaa !5
  %83 = load ptr, ptr %82, align 8, !tbaa !5
  %84 = call noundef zeroext i1 @_ZNK7Riemann11DynamicMesh6IsEdgeEi(ptr noundef nonnull align 8 dereferenceable(452) %83, i32 noundef %81)
  br i1 %84, label %85, label %.thread257

85:                                               ; preds = %.lr.ph319
  %86 = load ptr, ptr %5, align 8, !tbaa !5
  %87 = load ptr, ptr %86, align 8, !tbaa !5
  %88 = call noundef i32 @_ZNK7Riemann11DynamicMesh16GetTriangleCountEv(ptr noundef nonnull align 8 dereferenceable(452) %87)
  %89 = icmp slt i32 %88, 2
  br i1 %89, label %.thread254, label %90

90:                                               ; preds = %85
  br i1 %31, label %91, label %97

91:                                               ; preds = %90
  %92 = load ptr, ptr %5, align 8, !tbaa !5
  %93 = getelementptr inbounds i8, ptr %92, i64 8
  %94 = load ptr, ptr %93, align 8, !tbaa !5
  %95 = call noundef i32 @_ZNK7Riemann11DynamicMesh16GetTriangleCountEv(ptr noundef nonnull align 8 dereferenceable(452) %94)
  %96 = icmp slt i32 %95, 2
  br i1 %96, label %.thread254, label %97

97:                                               ; preds = %91, %90
  %98 = load ptr, ptr %5, align 8, !tbaa !5
  %99 = load ptr, ptr %98, align 8, !tbaa !5
  %100 = call noundef nonnull align 4 dereferenceable(16) ptr @_ZN7Riemann11DynamicMesh7GetEdgeEi(ptr noundef nonnull align 8 dereferenceable(452) %99, i32 noundef %81)
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %10) #8
  store i64 %32, ptr %10, align 8
  br i1 %31, label %.preheader267.preheader, label %.thread245

.preheader267.preheader:                          ; preds = %97
  %101 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK5Maths7TIndex2IiEixEi(ptr noundef nonnull align 4 dereferenceable(8) %100, i32 noundef 0)
  %102 = invoke noundef ptr @_Z7MapFindIiiSt3mapIiiSt4lessIiESaISt4pairIKiiEEEEPT0_RT1_RKT_(ptr noundef nonnull align 8 dereferenceable(48) %3, ptr noundef nonnull align 4 dereferenceable(4) %101)
          to label %103 unwind label %104

103:                                              ; preds = %.preheader267.preheader
  %.not.not = icmp eq ptr %102, null
  br i1 %.not.not, label %.thread262, label %.preheader267.1

104:                                              ; preds = %.preheader267.1, %.preheader267.preheader
  %105 = landingpad { ptr, i32 }
          cleanup
  br label %479

.preheader267.1:                                  ; preds = %103
  %106 = load i32, ptr %102, align 4, !tbaa !37
  store i32 %106, ptr %10, align 8, !tbaa !37
  %107 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK5Maths7TIndex2IiEixEi(ptr noundef nonnull align 4 dereferenceable(8) %100, i32 noundef 1)
  %108 = invoke noundef ptr @_Z7MapFindIiiSt3mapIiiSt4lessIiESaISt4pairIKiiEEEEPT0_RT1_RKT_(ptr noundef nonnull align 8 dereferenceable(48) %3, ptr noundef nonnull align 4 dereferenceable(4) %107)
          to label %109 unwind label %104

109:                                              ; preds = %.preheader267.1
  %.not.not.1 = icmp eq ptr %108, null
  br i1 %.not.not.1, label %.thread262, label %110

110:                                              ; preds = %109
  %111 = load i32, ptr %108, align 4, !tbaa !37
  store i32 %111, ptr %33, align 4, !tbaa !37
  %112 = load ptr, ptr %5, align 8, !tbaa !5
  %113 = getelementptr inbounds i8, ptr %112, i64 8
  %114 = load ptr, ptr %113, align 8, !tbaa !5
  %115 = invoke noundef i32 @_ZNK7Riemann11DynamicMesh8FindEdgeEii(ptr noundef nonnull align 8 dereferenceable(452) %114, i32 noundef %106, i32 noundef %111)
          to label %116 unwind label %118

116:                                              ; preds = %110
  %117 = icmp eq i32 %115, -1
  br i1 %117, label %.thread262, label %.thread245

118:                                              ; preds = %110
  %119 = landingpad { ptr, i32 }
          cleanup
  br label %479

.thread245:                                       ; preds = %97, %116
  %120 = phi i32 [ %111, %116 ], [ %60, %97 ]
  %121 = phi i32 [ %106, %116 ], [ %58, %97 ]
  %.0194 = phi i32 [ %115, %116 ], [ -1, %97 ]
  call void @llvm.lifetime.start.p0(i64 48, ptr nonnull %11) #8
  invoke void @_ZN5Maths8TVector3IfE4ZeroEv(ptr dead_on_unwind nonnull writable sret(%"class.Maths::TVector3") align 4 %11)
          to label %122 unwind label %130

122:                                              ; preds = %.thread245
  invoke void @_ZN5Maths8TVector3IfE4ZeroEv(ptr dead_on_unwind nonnull writable sret(%"class.Maths::TVector3") align 4 %34)
          to label %123 unwind label %130

123:                                              ; preds = %122
  invoke void @_ZN5Maths8TVector3IfE4ZeroEv(ptr dead_on_unwind nonnull writable sret(%"class.Maths::TVector3") align 4 %35)
          to label %124 unwind label %130

124:                                              ; preds = %123
  invoke void @_ZN5Maths8TVector3IfE4ZeroEv(ptr dead_on_unwind nonnull writable sret(%"class.Maths::TVector3") align 4 %36)
          to label %.preheader266.preheader unwind label %130

.preheader266.preheader:                          ; preds = %124
  %125 = load ptr, ptr %5, align 8, !tbaa !5
  %126 = load ptr, ptr %125, align 8, !tbaa !5
  %127 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK5Maths7TIndex2IiEixEi(ptr noundef nonnull align 4 dereferenceable(8) %100, i32 noundef 0)
  %128 = load i32, ptr %127, align 4, !tbaa !37
  %129 = invoke noundef zeroext i1 @_ZN7Riemann20FLocalPlanarSimplify6IsFlatERKNS_11DynamicMeshEifRN5Maths8TVector3IfEE(ptr noundef nonnull align 8 dereferenceable(452) %126, i32 noundef %128, float noundef %29, ptr noundef nonnull align 4 dereferenceable(12) %11)
          to label %132 unwind label %143

130:                                              ; preds = %124, %123, %122, %.thread245
  %131 = landingpad { ptr, i32 }
          cleanup
  br label %478

132:                                              ; preds = %.preheader266.preheader
  br i1 %129, label %133, label %.preheader266.1

133:                                              ; preds = %132
  %134 = icmp eq i32 %121, -1
  br i1 %134, label %140, label %135

135:                                              ; preds = %133
  %136 = load ptr, ptr %5, align 8, !tbaa !5
  %137 = getelementptr inbounds i8, ptr %136, i64 8
  %138 = load ptr, ptr %137, align 8, !tbaa !5
  %139 = invoke noundef zeroext i1 @_ZN7Riemann20FLocalPlanarSimplify6IsFlatERKNS_11DynamicMeshEifRN5Maths8TVector3IfEE(ptr noundef nonnull align 8 dereferenceable(452) %138, i32 noundef %121, float noundef %29, ptr noundef nonnull align 4 dereferenceable(12) %34)
          to label %140 unwind label %143

140:                                              ; preds = %135, %133
  %141 = phi i1 [ true, %133 ], [ %139, %135 ]
  %142 = zext i1 %141 to i8
  br label %.preheader266.1

143:                                              ; preds = %154, %.preheader266.1, %135, %.preheader266.preheader
  %144 = landingpad { ptr, i32 }
          cleanup
  br label %478

.preheader266.1:                                  ; preds = %140, %132
  %145 = phi i8 [ %142, %140 ], [ 0, %132 ]
  %146 = load ptr, ptr %5, align 8, !tbaa !5
  %147 = load ptr, ptr %146, align 8, !tbaa !5
  %148 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK5Maths7TIndex2IiEixEi(ptr noundef nonnull align 4 dereferenceable(8) %100, i32 noundef 1)
  %149 = load i32, ptr %148, align 4, !tbaa !37
  %150 = invoke noundef zeroext i1 @_ZN7Riemann20FLocalPlanarSimplify6IsFlatERKNS_11DynamicMeshEifRN5Maths8TVector3IfEE(ptr noundef nonnull align 8 dereferenceable(452) %147, i32 noundef %149, float noundef %29, ptr noundef nonnull align 4 dereferenceable(12) %35)
          to label %151 unwind label %143

151:                                              ; preds = %.preheader266.1
  br i1 %150, label %152, label %162

152:                                              ; preds = %151
  %153 = icmp eq i32 %120, -1
  br i1 %153, label %159, label %154

154:                                              ; preds = %152
  %155 = load ptr, ptr %5, align 8, !tbaa !5
  %156 = getelementptr inbounds i8, ptr %155, i64 8
  %157 = load ptr, ptr %156, align 8, !tbaa !5
  %158 = invoke noundef zeroext i1 @_ZN7Riemann20FLocalPlanarSimplify6IsFlatERKNS_11DynamicMeshEifRN5Maths8TVector3IfEE(ptr noundef nonnull align 8 dereferenceable(452) %157, i32 noundef %120, float noundef %29, ptr noundef nonnull align 4 dereferenceable(12) %61)
          to label %159 unwind label %143

159:                                              ; preds = %154, %152
  %160 = phi i1 [ true, %152 ], [ %158, %154 ]
  %161 = zext i1 %160 to i8
  br label %162

162:                                              ; preds = %159, %151
  %163 = phi i8 [ %161, %159 ], [ 0, %151 ]
  %164 = or i8 %145, %163
  %165 = icmp eq i8 %164, 0
  br i1 %165, label %.loopexit, label %.preheader265

.preheader265:                                    ; preds = %162
  %166 = trunc nuw i8 %145 to i1
  br i1 %166, label %167, label %.preheader265.1

167:                                              ; preds = %.preheader265
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %12) #8
  %168 = load ptr, ptr %5, align 8, !tbaa !5
  %169 = load ptr, ptr %168, align 8, !tbaa !5
  %170 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK5Maths7TIndex2IiEixEi(ptr noundef nonnull align 4 dereferenceable(8) %100, i32 noundef 0)
  %171 = load i32, ptr %170, align 4, !tbaa !37
  invoke void @_ZNK7Riemann11DynamicMesh9GetVertexEi(ptr dead_on_unwind nonnull writable sret(%"class.Maths::TVector3") align 4 %12, ptr noundef nonnull align 8 dereferenceable(452) %169, i32 noundef %171)
          to label %172 unwind label %216

172:                                              ; preds = %167
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %13) #8
  %173 = load ptr, ptr %5, align 8, !tbaa !5
  %174 = load ptr, ptr %173, align 8, !tbaa !5
  %175 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK5Maths7TIndex2IiEixEi(ptr noundef nonnull align 4 dereferenceable(8) %100, i32 noundef 1)
  %176 = load i32, ptr %175, align 4, !tbaa !37
  invoke void @_ZNK7Riemann11DynamicMesh9GetVertexEi(ptr dead_on_unwind nonnull writable sret(%"class.Maths::TVector3") align 4 %13, ptr noundef nonnull align 8 dereferenceable(452) %174, i32 noundef %176)
          to label %177 unwind label %218

177:                                              ; preds = %172
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %14) #8
  invoke void @_ZNK5Maths8TVector3IfEmiERKS1_(ptr dead_on_unwind nonnull writable sret(%"class.Maths::TVector3") align 4 %14, ptr noundef nonnull align 4 dereferenceable(12) %13, ptr noundef nonnull align 4 dereferenceable(12) %12)
          to label %178 unwind label %220

178:                                              ; preds = %177
  %179 = call noundef float @_ZN5Maths8TVector3IfE13SafeNormalizeEv(ptr noundef nonnull align 4 dereferenceable(12) %14)
  %180 = fcmp oeq float %179, 0.000000e+00
  br i1 %180, label %212, label %.preheader

.preheader:                                       ; preds = %178
  br i1 %37, label %.critedge325.thread, label %181

.critedge325.thread:                              ; preds = %.preheader.1, %.preheader
  %indvars.iv356.lcssa462 = phi i64 [ 0, %.preheader ], [ 1, %.preheader.1 ]
  %.lcssa455 = phi i32 [ 1, %.preheader ], [ 0, %.preheader.1 ]
  %.lcssa448 = phi i64 [ 1, %.preheader ], [ 0, %.preheader.1 ]
  %.lcssa440 = phi i32 [ 0, %.preheader ], [ 1, %.preheader.1 ]
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %15) #8
  store i8 1, ptr %15, align 1, !tbaa !38
  br label %.thread

181:                                              ; preds = %.preheader
  %182 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK5Maths7TIndex2IiEixEi(ptr noundef nonnull align 4 dereferenceable(8) %100, i32 noundef 0)
  %183 = load i32, ptr %182, align 4, !tbaa !37
  %184 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK5Maths7TIndex2IiEixEi(ptr noundef nonnull align 4 dereferenceable(8) %100, i32 noundef 1)
  %185 = load i32, ptr %184, align 4, !tbaa !37
  %186 = load ptr, ptr %5, align 8, !tbaa !5
  %187 = load ptr, ptr %186, align 8, !tbaa !5
  %188 = load float, ptr %38, align 4, !tbaa !39
  %189 = invoke noundef zeroext i1 @_ZN7Riemann20FLocalPlanarSimplify32CollapseWouldHurtTriangleQualityERKNS_11DynamicMeshERKN5Maths8TVector3IfEEiS8_iS8_fb(ptr noundef nonnull align 8 dereferenceable(452) %187, ptr noundef nonnull align 4 dereferenceable(12) %11, i32 noundef %183, ptr noundef nonnull align 4 dereferenceable(12) %12, i32 noundef %185, ptr noundef nonnull align 4 dereferenceable(12) %13, float noundef %188, i1 noundef zeroext false)
          to label %190 unwind label %.loopexit.split-lp

190:                                              ; preds = %181
  br i1 %189, label %._crit_edge.thread, label %191

191:                                              ; preds = %190
  %192 = load ptr, ptr %5, align 8, !tbaa !5
  %193 = load ptr, ptr %192, align 8, !tbaa !5
  %194 = load i8, ptr %39, align 8, !tbaa !40, !range !41, !noundef !42
  %195 = trunc nuw i8 %194 to i1
  %196 = load i32, ptr %40, align 8, !tbaa !43
  %197 = add i32 %196, 1
  %spec.select240.peel = icmp ult i32 %197, 2
  %198 = load i8, ptr %41, align 1, !tbaa !44, !range !41, !noundef !42
  %199 = trunc nuw i8 %198 to i1
  %200 = load i8, ptr %42, align 2, !tbaa !45, !range !41, !noundef !42
  %201 = trunc nuw i8 %200 to i1
  %202 = load float, ptr %43, align 4, !tbaa !46
  %203 = fmul float %202, %202
  %204 = load i8, ptr %44, align 8, !tbaa !47, !range !41, !noundef !42
  %205 = trunc nuw i8 %204 to i1
  %206 = load float, ptr %45, align 4, !tbaa !48
  %207 = fmul float %206, 0x3F91DF46A0000000
  %208 = call float @cosf(float noundef %207) #8
  %209 = invoke noundef zeroext i1 @_ZN7Riemann20FLocalPlanarSimplify29CollapseWouldChangeShapeOrUVsERKNS_11DynamicMeshERKSt3setIiSt4lessIiESaIiEEfiiRKN5Maths8TVector3IfEEiSF_SF_bbbbfbf(ptr noundef nonnull align 8 dereferenceable(452) %193, ptr noundef nonnull align 8 dereferenceable(48) %6, float noundef %29, i32 noundef %81, i32 noundef %183, ptr noundef nonnull align 4 dereferenceable(12) %12, i32 noundef %185, ptr noundef nonnull align 4 dereferenceable(12) %13, ptr noundef nonnull align 4 dereferenceable(12) %14, i1 noundef zeroext %195, i1 noundef zeroext %spec.select240.peel, i1 noundef zeroext %199, i1 noundef zeroext %201, float noundef %203, i1 noundef zeroext %205, float noundef %208)
          to label %.critedge.peel unwind label %.loopexit.split-lp

.critedge.peel:                                   ; preds = %191
  %.not212.peel = or i1 %209, %62
  br i1 %.not212.peel, label %._crit_edge, label %.peel.next

.peel.next:                                       ; preds = %.critedge.peel
  %210 = load i32, ptr %10, align 8, !tbaa !37
  %211 = load i32, ptr %63, align 4, !tbaa !37
  br label %222

212:                                              ; preds = %410, %178
  %213 = load i8, ptr %55, align 8, !tbaa !49, !range !41, !noundef !42
  %214 = trunc nuw i8 %213 to i1
  br i1 %214, label %215, label %.thread249

215:                                              ; preds = %212
  call void @__assert_fail(ptr noundef nonnull @.str, ptr noundef nonnull @.str.1, i32 noundef 2020, ptr noundef nonnull @__PRETTY_FUNCTION__._ZN7Riemann21SimplifyAlongNewEdgesEiPPNS_11DynamicMeshEPSt6vectorIiSaIiEERSt3mapIiiSt4lessIiESaISt4pairIKiiEEEPNS_15GeometryBooleanE) #9
  unreachable

216:                                              ; preds = %399, %167
  %217 = landingpad { ptr, i32 }
          cleanup
  br label %397

218:                                              ; preds = %404, %172
  %219 = landingpad { ptr, i32 }
          cleanup
  br label %396

220:                                              ; preds = %409, %177
  %221 = landingpad { ptr, i32 }
          cleanup
  br label %.loopexit355

._crit_edge:                                      ; preds = %.critedge, %.critedge.peel
  %.lcssa = phi i1 [ %209, %.critedge.peel ], [ %252, %.critedge ]
  br i1 %.lcssa, label %._crit_edge.thread, label %.critedge325

222:                                              ; preds = %.critedge, %.peel.next
  %indvars.iv352 = phi i64 [ 1, %.peel.next ], [ %indvars.iv.next353, %.critedge ]
  %223 = load ptr, ptr %5, align 8, !tbaa !5
  %224 = getelementptr inbounds ptr, ptr %223, i64 %indvars.iv352
  %225 = load ptr, ptr %224, align 8, !tbaa !5
  %226 = getelementptr inbounds [2 x [2 x %"class.Maths::TVector3"]], ptr %11, i64 0, i64 0, i64 %indvars.iv352
  %227 = load float, ptr %38, align 4, !tbaa !39
  %228 = invoke noundef zeroext i1 @_ZN7Riemann20FLocalPlanarSimplify32CollapseWouldHurtTriangleQualityERKNS_11DynamicMeshERKN5Maths8TVector3IfEEiS8_iS8_fb(ptr noundef nonnull align 8 dereferenceable(452) %225, ptr noundef nonnull align 4 dereferenceable(12) %226, i32 noundef %210, ptr noundef nonnull align 4 dereferenceable(12) %12, i32 noundef %211, ptr noundef nonnull align 4 dereferenceable(12) %13, float noundef %227, i1 noundef zeroext false)
          to label %229 unwind label %.loopexit355.loopexit

229:                                              ; preds = %222
  br i1 %228, label %._crit_edge.thread, label %230

230:                                              ; preds = %229
  %231 = load ptr, ptr %5, align 8, !tbaa !5
  %232 = getelementptr inbounds ptr, ptr %231, i64 %indvars.iv352
  %233 = load ptr, ptr %232, align 8, !tbaa !5
  %234 = getelementptr inbounds [2 x %"class.std::set"], ptr %6, i64 0, i64 %indvars.iv352
  %235 = load i8, ptr %39, align 8, !tbaa !40, !range !41, !noundef !42
  %236 = trunc nuw i8 %235 to i1
  %237 = load i32, ptr %40, align 8, !tbaa !43
  %238 = icmp eq i32 %237, -1
  %239 = zext i32 %237 to i64
  %240 = icmp eq i64 %indvars.iv352, %239
  %spec.select240 = or i1 %238, %240
  %241 = load i8, ptr %41, align 1, !tbaa !44, !range !41, !noundef !42
  %242 = trunc nuw i8 %241 to i1
  %243 = load i8, ptr %42, align 2, !tbaa !45, !range !41, !noundef !42
  %244 = trunc nuw i8 %243 to i1
  %245 = load float, ptr %43, align 4, !tbaa !46
  %246 = fmul float %245, %245
  %247 = load i8, ptr %44, align 8, !tbaa !47, !range !41, !noundef !42
  %248 = trunc nuw i8 %247 to i1
  %249 = load float, ptr %45, align 4, !tbaa !48
  %250 = fmul float %249, 0x3F91DF46A0000000
  %251 = call float @cosf(float noundef %250) #8
  %252 = invoke noundef zeroext i1 @_ZN7Riemann20FLocalPlanarSimplify29CollapseWouldChangeShapeOrUVsERKNS_11DynamicMeshERKSt3setIiSt4lessIiESaIiEEfiiRKN5Maths8TVector3IfEEiSF_SF_bbbbfbf(ptr noundef nonnull align 8 dereferenceable(452) %233, ptr noundef nonnull align 8 dereferenceable(48) %234, float noundef %29, i32 noundef %.0194, i32 noundef %210, ptr noundef nonnull align 4 dereferenceable(12) %12, i32 noundef %211, ptr noundef nonnull align 4 dereferenceable(12) %13, ptr noundef nonnull align 4 dereferenceable(12) %14, i1 noundef zeroext %236, i1 noundef zeroext %spec.select240, i1 noundef zeroext %242, i1 noundef zeroext %244, float noundef %246, i1 noundef zeroext %248, float noundef %251)
          to label %.critedge unwind label %.loopexit355.loopexit

.critedge:                                        ; preds = %230
  %indvars.iv.next353 = add nuw nsw i64 %indvars.iv352, 1
  %253 = icmp sge i64 %indvars.iv.next353, %57
  %.not212 = select i1 %252, i1 true, i1 %253
  br i1 %.not212, label %._crit_edge, label %222, !llvm.loop !50

.loopexit355.loopexit:                            ; preds = %230, %222
  %lpad.loopexit468 = landingpad { ptr, i32 }
          cleanup
  br label %.loopexit355

.loopexit355.loopexit.split-lp:                   ; preds = %444, %452
  %lpad.loopexit.split-lp469 = landingpad { ptr, i32 }
          cleanup
  br label %.loopexit355

.loopexit.split-lp:                               ; preds = %423, %413, %181, %191
  %lpad.loopexit.split-lp = landingpad { ptr, i32 }
          cleanup
  br label %.loopexit355

.critedge325:                                     ; preds = %._crit_edge.1, %._crit_edge
  %indvars.iv356.lcssa465.sroa.phi = phi ptr [ %10, %._crit_edge ], [ %indvars.iv356.lcssa465.sroa.gep470, %._crit_edge.1 ]
  %indvars.iv356.lcssa465 = phi i64 [ 0, %._crit_edge ], [ 1, %._crit_edge.1 ]
  %.lcssa458 = phi i32 [ 1, %._crit_edge ], [ 0, %._crit_edge.1 ]
  %.lcssa451.sroa.phi = phi ptr [ %.lcssa451.sroa.gep, %._crit_edge ], [ %10, %._crit_edge.1 ]
  %.lcssa451 = phi i64 [ 1, %._crit_edge ], [ 0, %._crit_edge.1 ]
  %.lcssa443 = phi i32 [ 0, %._crit_edge ], [ 1, %._crit_edge.1 ]
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %15) #8
  store i8 1, ptr %15, align 1, !tbaa !38
  br i1 %31, label %254, label %.thread

254:                                              ; preds = %.critedge325
  %255 = load i32, ptr %indvars.iv356.lcssa465.sroa.phi, align 4, !tbaa !37
  %256 = load i32, ptr %.lcssa451.sroa.phi, align 4, !tbaa !37
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %16) #8
  store i32 %256, ptr %16, align 4, !tbaa !37
  %257 = load ptr, ptr %5, align 8, !tbaa !5
  %258 = getelementptr inbounds i8, ptr %257, i64 8
  %259 = load ptr, ptr %258, align 8, !tbaa !5
  %260 = invoke noundef i32 @_ZNK7Riemann11DynamicMesh8FindEdgeEii(ptr noundef nonnull align 8 dereferenceable(452) %259, i32 noundef %255, i32 noundef %256)
          to label %261 unwind label %270

261:                                              ; preds = %254
  %262 = load ptr, ptr %5, align 8, !tbaa !5
  %263 = getelementptr inbounds i8, ptr %262, i64 8
  %264 = load ptr, ptr %263, align 8, !tbaa !5
  %265 = call noundef nonnull align 4 dereferenceable(16) ptr @_ZN7Riemann11DynamicMesh7GetEdgeEi(ptr noundef nonnull align 8 dereferenceable(452) %264, i32 noundef %260)
  %266 = getelementptr inbounds i8, ptr %265, i64 8
  %267 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK5Maths7TIndex2IiEixEi(ptr noundef nonnull align 4 dereferenceable(8) %266, i32 noundef 0)
  %268 = load i32, ptr %267, align 4, !tbaa !37
  %269 = icmp eq i32 %268, -1
  br i1 %269, label %.thread365, label %272

.thread365:                                       ; preds = %261
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %16) #8
  br label %394

270:                                              ; preds = %254
  %271 = landingpad { ptr, i32 }
          cleanup
  br label %293

272:                                              ; preds = %261
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %17) #8
  %273 = load ptr, ptr %5, align 8, !tbaa !5
  %274 = getelementptr inbounds i8, ptr %273, i64 8
  %275 = load ptr, ptr %274, align 8, !tbaa !5
  invoke void @_ZNK7Riemann11DynamicMesh11GetTriangleEi(ptr dead_on_unwind nonnull writable sret(%"class.Maths::TIndex3") align 4 %17, ptr noundef nonnull align 8 dereferenceable(452) %275, i32 noundef %268)
          to label %276 unwind label %284

276:                                              ; preds = %272
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %18) #8
  %277 = load i32, ptr %16, align 4, !tbaa !37
  %278 = invoke noundef i32 @_ZN7RiemannL15FindTriOtherVtxIiN5Maths7TIndex3IiEEEEiT_S4_RKT0_(i32 noundef %255, i32 noundef %277, ptr noundef nonnull align 4 dereferenceable(12) %17)
          to label %279 unwind label %286

279:                                              ; preds = %276
  store i32 %278, ptr %18, align 4, !tbaa !37
  %280 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK5Maths7TIndex2IiEixEi(ptr noundef nonnull align 4 dereferenceable(8) %266, i32 noundef 1)
  %281 = load i32, ptr %280, align 4, !tbaa !37
  %282 = icmp eq i32 %281, -1
  br i1 %282, label %288, label %283

283:                                              ; preds = %279
  call void @__assert_fail(ptr noundef nonnull @.str.2, ptr noundef nonnull @.str.1, i32 noundef 2068, ptr noundef nonnull @__PRETTY_FUNCTION__._ZN7Riemann21SimplifyAlongNewEdgesEiPPNS_11DynamicMeshEPSt6vectorIiSaIiEERSt3mapIiiSt4lessIiESaISt4pairIKiiEEEPNS_15GeometryBooleanE) #9
  unreachable

284:                                              ; preds = %272
  %285 = landingpad { ptr, i32 }
          cleanup
  br label %292

286:                                              ; preds = %288, %276
  %287 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %18) #8
  br label %292

288:                                              ; preds = %279
  %289 = load ptr, ptr %5, align 8, !tbaa !5
  %290 = getelementptr inbounds i8, ptr %289, i64 8
  %291 = load ptr, ptr %290, align 8, !tbaa !5
  store ptr %15, ptr %19, align 8, !tbaa !5
  store ptr %18, ptr %46, align 8, !tbaa !5
  store ptr %16, ptr %47, align 8, !tbaa !5
  store ptr %5, ptr %48, align 8, !tbaa !5
  invoke void @"_ZNK7Riemann11DynamicMesh23EnumerateVertexVerticesIZNS_21SimplifyAlongNewEdgesEiPPS0_PSt6vectorIiSaIiEERSt3mapIiiSt4lessIiESaISt4pairIKiiEEEPNS_15GeometryBooleanEE3$_0EEviT_"(ptr noundef nonnull align 8 dereferenceable(452) %291, i32 noundef %255, ptr noundef nonnull byval(%class.anon.58) align 8 %19)
          to label %294 unwind label %286

292:                                              ; preds = %286, %284
  %.pn = phi { ptr, i32 } [ %287, %286 ], [ %285, %284 ]
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %17) #8
  br label %293

293:                                              ; preds = %292, %270
  %.pn.pn = phi { ptr, i32 } [ %.pn, %292 ], [ %271, %270 ]
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %16) #8
  br label %395

294:                                              ; preds = %288
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %18) #8
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %17) #8
  %.pre.pre = load i8, ptr %15, align 1, !tbaa !38, !range !41
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %16) #8
  %295 = trunc nuw i8 %.pre.pre to i1
  br i1 %295, label %.thread, label %394

.thread:                                          ; preds = %.critedge325.thread, %.critedge325, %294
  %indvars.iv356467 = phi i64 [ %indvars.iv356.lcssa462, %.critedge325.thread ], [ %indvars.iv356.lcssa465, %.critedge325 ], [ %indvars.iv356.lcssa465, %294 ]
  %296 = phi i32 [ %.lcssa455, %.critedge325.thread ], [ %.lcssa458, %.critedge325 ], [ %.lcssa458, %294 ]
  %297 = phi i64 [ %.lcssa448, %.critedge325.thread ], [ %.lcssa451, %.critedge325 ], [ %.lcssa451, %294 ]
  %298 = phi i32 [ %.lcssa440, %.critedge325.thread ], [ %.lcssa443, %.critedge325 ], [ %.lcssa443, %294 ]
  call void @llvm.lifetime.start.p0(i64 52, ptr nonnull %20) #8
  invoke void @_ZN7Riemann17FEdgeCollapseInfoC2Ev(ptr noundef nonnull align 4 dereferenceable(52) %20)
          to label %299 unwind label %324

299:                                              ; preds = %.thread
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %21) #8
  %300 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK5Maths7TIndex2IiEixEi(ptr noundef nonnull align 4 dereferenceable(8) %100, i32 noundef %298)
  %301 = load i32, ptr %300, align 4, !tbaa !37
  store i32 %301, ptr %21, align 4, !tbaa !37
  %302 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK5Maths7TIndex2IiEixEi(ptr noundef nonnull align 4 dereferenceable(8) %100, i32 noundef %296)
  %303 = load i32, ptr %302, align 4, !tbaa !37
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %22) #8
  %304 = load ptr, ptr %5, align 8, !tbaa !5
  %305 = load ptr, ptr %304, align 8, !tbaa !5
  %306 = load i32, ptr %21, align 4, !tbaa !37
  %307 = invoke noundef zeroext i1 @"_ZZN7Riemann21SimplifyAlongNewEdgesEiPPNS_11DynamicMeshEPSt6vectorIiSaIiEERSt3mapIiiSt4lessIiESaISt4pairIKiiEEEPNS_15GeometryBooleanEENK3$_1clERKS0_ii"(ptr noundef nonnull align 1 dereferenceable(1) %22, ptr noundef nonnull align 8 dereferenceable(452) %305, i32 noundef %81, i32 noundef %306)
          to label %308 unwind label %326

308:                                              ; preds = %299
  %309 = load ptr, ptr %5, align 8, !tbaa !5
  %310 = load ptr, ptr %309, align 8, !tbaa !5
  %311 = load i32, ptr %21, align 4, !tbaa !37
  %312 = invoke noundef i32 @_ZN7Riemann11DynamicMesh12CollapseEdgeEiifRNS_17FEdgeCollapseInfoE(ptr noundef nonnull align 8 dereferenceable(452) %310, i32 noundef %303, i32 noundef %311, float noundef 0.000000e+00, ptr noundef nonnull align 4 dereferenceable(52) %20)
          to label %313 unwind label %328

313:                                              ; preds = %308
  %314 = icmp eq i32 %312, 0
  br i1 %314, label %315, label %391

315:                                              ; preds = %313
  br i1 %307, label %316, label %330

316:                                              ; preds = %315
  %317 = load ptr, ptr %5, align 8, !tbaa !5
  %318 = load ptr, ptr %317, align 8, !tbaa !5
  %319 = load i32, ptr %49, align 4, !tbaa !52
  %320 = invoke noundef zeroext i1 @_ZNK7Riemann11DynamicMesh14IsBoundaryEdgeEi(ptr noundef nonnull align 8 dereferenceable(452) %318, i32 noundef %319)
          to label %321 unwind label %328

321:                                              ; preds = %316
  br i1 %320, label %322, label %330

322:                                              ; preds = %321
  %323 = invoke { ptr, i8 } @_ZNSt3setIiSt4lessIiESaIiEE6insertERKi(ptr noundef nonnull align 8 dereferenceable(48) %6, ptr noundef nonnull align 4 dereferenceable(4) %49)
          to label %330 unwind label %328

324:                                              ; preds = %.thread
  %325 = landingpad { ptr, i32 }
          cleanup
  br label %393

326:                                              ; preds = %299
  %327 = landingpad { ptr, i32 }
          cleanup
  br label %392

328:                                              ; preds = %388, %382, %379, %322, %316, %308
  %329 = landingpad { ptr, i32 }
          cleanup
  br label %392

330:                                              ; preds = %322, %321, %315
  br i1 %31, label %331, label %379

331:                                              ; preds = %330
  %332 = getelementptr inbounds [2 x i32], ptr %10, i64 0, i64 %indvars.iv356467
  %333 = load i32, ptr %332, align 4, !tbaa !37
  %334 = getelementptr inbounds [2 x i32], ptr %10, i64 0, i64 %297
  %335 = load i32, ptr %334, align 4, !tbaa !37
  %336 = load ptr, ptr %5, align 8, !tbaa !5
  %337 = getelementptr inbounds i8, ptr %336, i64 8
  %338 = load ptr, ptr %337, align 8, !tbaa !5
  %339 = invoke noundef zeroext i1 @"_ZZN7Riemann21SimplifyAlongNewEdgesEiPPNS_11DynamicMeshEPSt6vectorIiSaIiEERSt3mapIiiSt4lessIiESaISt4pairIKiiEEEPNS_15GeometryBooleanEENK3$_1clERKS0_ii"(ptr noundef nonnull align 1 dereferenceable(1) %22, ptr noundef nonnull align 8 dereferenceable(452) %338, i32 noundef %.0194, i32 noundef %333)
          to label %340 unwind label %348

340:                                              ; preds = %331
  call void @llvm.lifetime.start.p0(i64 52, ptr nonnull %23) #8
  invoke void @_ZN7Riemann17FEdgeCollapseInfoC2Ev(ptr noundef nonnull align 4 dereferenceable(52) %23)
          to label %341 unwind label %350

341:                                              ; preds = %340
  %342 = load ptr, ptr %5, align 8, !tbaa !5
  %343 = getelementptr inbounds i8, ptr %342, i64 8
  %344 = load ptr, ptr %343, align 8, !tbaa !5
  %345 = invoke noundef i32 @_ZN7Riemann11DynamicMesh12CollapseEdgeEiifRNS_17FEdgeCollapseInfoE(ptr noundef nonnull align 8 dereferenceable(452) %344, i32 noundef %335, i32 noundef %333, float noundef 0.000000e+00, ptr noundef nonnull align 4 dereferenceable(52) %23)
          to label %346 unwind label %352

346:                                              ; preds = %341
  switch i32 %345, label %347 [
    i32 0, label %354
    i32 26, label %377
  ]

347:                                              ; preds = %346
  call void @__assert_fail(ptr noundef nonnull @.str.3, ptr noundef nonnull @.str.1, i32 noundef 2127, ptr noundef nonnull @__PRETTY_FUNCTION__._ZN7Riemann21SimplifyAlongNewEdgesEiPPNS_11DynamicMeshEPSt6vectorIiSaIiEERSt3mapIiiSt4lessIiESaISt4pairIKiiEEEPNS_15GeometryBooleanE) #9
  unreachable

348:                                              ; preds = %331
  %349 = landingpad { ptr, i32 }
          cleanup
  br label %392

350:                                              ; preds = %340
  %351 = landingpad { ptr, i32 }
          cleanup
  br label %378

352:                                              ; preds = %374, %368, %366, %364, %362, %355, %341
  %353 = landingpad { ptr, i32 }
          cleanup
  br label %378

354:                                              ; preds = %346
  br i1 %339, label %355, label %364

355:                                              ; preds = %354
  %356 = load ptr, ptr %5, align 8, !tbaa !5
  %357 = getelementptr inbounds i8, ptr %356, i64 8
  %358 = load ptr, ptr %357, align 8, !tbaa !5
  %359 = load i32, ptr %50, align 4, !tbaa !52
  %360 = invoke noundef zeroext i1 @_ZNK7Riemann11DynamicMesh14IsBoundaryEdgeEi(ptr noundef nonnull align 8 dereferenceable(452) %358, i32 noundef %359)
          to label %361 unwind label %352

361:                                              ; preds = %355
  br i1 %360, label %362, label %364

362:                                              ; preds = %361
  %363 = invoke { ptr, i8 } @_ZNSt3setIiSt4lessIiESaIiEE6insertERKi(ptr noundef nonnull align 8 dereferenceable(48) %.ptr.1, ptr noundef nonnull align 4 dereferenceable(4) %50)
          to label %364 unwind label %352

364:                                              ; preds = %362, %361, %354
  %365 = invoke noundef i64 @_ZNSt3mapIiiSt4lessIiESaISt4pairIKiiEEE5eraseERS3_(ptr noundef nonnull align 8 dereferenceable(48) %3, ptr noundef nonnull align 4 dereferenceable(4) %21)
          to label %366 unwind label %352

366:                                              ; preds = %364
  %367 = invoke noundef i64 @_ZNSt3setIiSt4lessIiESaIiEE5eraseERKi(ptr noundef nonnull align 8 dereferenceable(48) %.ptr.1, ptr noundef nonnull align 4 dereferenceable(4) %51)
          to label %368 unwind label %352

368:                                              ; preds = %366
  %369 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN5Maths7TIndex2IiEixEi(ptr noundef nonnull align 4 dereferenceable(8) %52, i32 noundef 0)
  %370 = invoke noundef i64 @_ZNSt3setIiSt4lessIiESaIiEE5eraseERKi(ptr noundef nonnull align 8 dereferenceable(48) %.ptr.1, ptr noundef nonnull align 4 dereferenceable(4) %369)
          to label %371 unwind label %352

371:                                              ; preds = %368
  %372 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN5Maths7TIndex2IiEixEi(ptr noundef nonnull align 4 dereferenceable(8) %52, i32 noundef 1)
  %373 = load i32, ptr %372, align 4, !tbaa !37
  %.not215 = icmp eq i32 %373, -1
  br i1 %.not215, label %377, label %374

374:                                              ; preds = %371
  %375 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN5Maths7TIndex2IiEixEi(ptr noundef nonnull align 4 dereferenceable(8) %52, i32 noundef 1)
  %376 = invoke noundef i64 @_ZNSt3setIiSt4lessIiESaIiEE5eraseERKi(ptr noundef nonnull align 8 dereferenceable(48) %.ptr.1, ptr noundef nonnull align 4 dereferenceable(4) %375)
          to label %377 unwind label %352

377:                                              ; preds = %346, %371, %374
  call void @llvm.lifetime.end.p0(i64 52, ptr nonnull %23) #8
  br label %379

378:                                              ; preds = %352, %350
  %.pn216 = phi { ptr, i32 } [ %353, %352 ], [ %351, %350 ]
  call void @llvm.lifetime.end.p0(i64 52, ptr nonnull %23) #8
  br label %392

379:                                              ; preds = %377, %330
  %380 = add nsw i32 %.1165317, 1
  %381 = invoke noundef i64 @_ZNSt3setIiSt4lessIiESaIiEE5eraseERKi(ptr noundef nonnull align 8 dereferenceable(48) %6, ptr noundef nonnull align 4 dereferenceable(4) %53)
          to label %382 unwind label %328

382:                                              ; preds = %379
  %383 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN5Maths7TIndex2IiEixEi(ptr noundef nonnull align 4 dereferenceable(8) %54, i32 noundef 0)
  %384 = invoke noundef i64 @_ZNSt3setIiSt4lessIiESaIiEE5eraseERKi(ptr noundef nonnull align 8 dereferenceable(48) %6, ptr noundef nonnull align 4 dereferenceable(4) %383)
          to label %385 unwind label %328

385:                                              ; preds = %382
  %386 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN5Maths7TIndex2IiEixEi(ptr noundef nonnull align 4 dereferenceable(8) %54, i32 noundef 1)
  %387 = load i32, ptr %386, align 4, !tbaa !37
  %.not219 = icmp eq i32 %387, -1
  br i1 %.not219, label %391, label %388

388:                                              ; preds = %385
  %389 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN5Maths7TIndex2IiEixEi(ptr noundef nonnull align 4 dereferenceable(8) %54, i32 noundef 1)
  %390 = invoke noundef i64 @_ZNSt3setIiSt4lessIiESaIiEE5eraseERKi(ptr noundef nonnull align 8 dereferenceable(48) %6, ptr noundef nonnull align 4 dereferenceable(4) %389)
          to label %391 unwind label %328

391:                                              ; preds = %385, %388, %313
  %.3167 = phi i32 [ %380, %388 ], [ %380, %385 ], [ %.1165317, %313 ]
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %22) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %21) #8
  call void @llvm.lifetime.end.p0(i64 52, ptr nonnull %20) #8
  br label %394

392:                                              ; preds = %328, %378, %348, %326
  %.pn220.pn = phi { ptr, i32 } [ %327, %326 ], [ %329, %328 ], [ %.pn216, %378 ], [ %349, %348 ]
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %22) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %21) #8
  br label %393

393:                                              ; preds = %392, %324
  %.pn220.pn.pn = phi { ptr, i32 } [ %.pn220.pn, %392 ], [ %325, %324 ]
  call void @llvm.lifetime.end.p0(i64 52, ptr nonnull %20) #8
  br label %395

394:                                              ; preds = %.thread365, %294, %391
  %.4168 = phi i32 [ %.3167, %391 ], [ %.1165317, %294 ], [ %.1165317, %.thread365 ]
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %15) #8
  br label %.thread249

395:                                              ; preds = %393, %293
  %.pn220.pn.pn.pn = phi { ptr, i32 } [ %.pn220.pn.pn, %393 ], [ %.pn.pn, %293 ]
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %15) #8
  br label %.loopexit355

.thread249:                                       ; preds = %212, %394
  %.6170.ph = phi i32 [ %.4168, %394 ], [ %.1165317, %212 ]
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %14) #8
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %13) #8
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %12) #8
  br label %.loopexit

._crit_edge.thread:                               ; preds = %229, %190, %._crit_edge
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %14) #8
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %13) #8
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %12) #8
  br label %.preheader265.1

.loopexit355:                                     ; preds = %.loopexit355.loopexit, %.loopexit355.loopexit.split-lp, %.loopexit.split-lp, %395, %220
  %.pn226.pn = phi { ptr, i32 } [ %221, %220 ], [ %.pn220.pn.pn.pn, %395 ], [ %lpad.loopexit.split-lp, %.loopexit.split-lp ], [ %lpad.loopexit468, %.loopexit355.loopexit ], [ %lpad.loopexit.split-lp469, %.loopexit355.loopexit.split-lp ]
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %14) #8
  br label %396

396:                                              ; preds = %.loopexit355, %218
  %.pn226.pn.pn = phi { ptr, i32 } [ %.pn226.pn, %.loopexit355 ], [ %219, %218 ]
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %13) #8
  br label %397

397:                                              ; preds = %396, %216
  %.pn226.pn.pn.pn = phi { ptr, i32 } [ %.pn226.pn.pn, %396 ], [ %217, %216 ]
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %12) #8
  br label %478

.preheader265.1:                                  ; preds = %._crit_edge.thread, %.preheader265
  %398 = trunc nuw i8 %163 to i1
  br i1 %398, label %399, label %.loopexit

399:                                              ; preds = %.preheader265.1
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %12) #8
  %400 = load ptr, ptr %5, align 8, !tbaa !5
  %401 = load ptr, ptr %400, align 8, !tbaa !5
  %402 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK5Maths7TIndex2IiEixEi(ptr noundef nonnull align 4 dereferenceable(8) %100, i32 noundef 1)
  %403 = load i32, ptr %402, align 4, !tbaa !37
  invoke void @_ZNK7Riemann11DynamicMesh9GetVertexEi(ptr dead_on_unwind nonnull writable sret(%"class.Maths::TVector3") align 4 %12, ptr noundef nonnull align 8 dereferenceable(452) %401, i32 noundef %403)
          to label %404 unwind label %216

404:                                              ; preds = %399
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %13) #8
  %405 = load ptr, ptr %5, align 8, !tbaa !5
  %406 = load ptr, ptr %405, align 8, !tbaa !5
  %407 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK5Maths7TIndex2IiEixEi(ptr noundef nonnull align 4 dereferenceable(8) %100, i32 noundef 0)
  %408 = load i32, ptr %407, align 4, !tbaa !37
  invoke void @_ZNK7Riemann11DynamicMesh9GetVertexEi(ptr dead_on_unwind nonnull writable sret(%"class.Maths::TVector3") align 4 %13, ptr noundef nonnull align 8 dereferenceable(452) %406, i32 noundef %408)
          to label %409 unwind label %218

409:                                              ; preds = %404
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %14) #8
  invoke void @_ZNK5Maths8TVector3IfEmiERKS1_(ptr dead_on_unwind nonnull writable sret(%"class.Maths::TVector3") align 4 %14, ptr noundef nonnull align 4 dereferenceable(12) %13, ptr noundef nonnull align 4 dereferenceable(12) %12)
          to label %410 unwind label %220

410:                                              ; preds = %409
  %411 = call noundef float @_ZN5Maths8TVector3IfE13SafeNormalizeEv(ptr noundef nonnull align 4 dereferenceable(12) %14)
  %412 = fcmp oeq float %411, 0.000000e+00
  br i1 %412, label %212, label %.preheader.1

.preheader.1:                                     ; preds = %410
  br i1 %37, label %.critedge325.thread, label %413

413:                                              ; preds = %.preheader.1
  %414 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK5Maths7TIndex2IiEixEi(ptr noundef nonnull align 4 dereferenceable(8) %100, i32 noundef 1)
  %415 = load i32, ptr %414, align 4, !tbaa !37
  %416 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK5Maths7TIndex2IiEixEi(ptr noundef nonnull align 4 dereferenceable(8) %100, i32 noundef 0)
  %417 = load i32, ptr %416, align 4, !tbaa !37
  %418 = load ptr, ptr %5, align 8, !tbaa !5
  %419 = load ptr, ptr %418, align 8, !tbaa !5
  %420 = load float, ptr %38, align 4, !tbaa !39
  %421 = invoke noundef zeroext i1 @_ZN7Riemann20FLocalPlanarSimplify32CollapseWouldHurtTriangleQualityERKNS_11DynamicMeshERKN5Maths8TVector3IfEEiS8_iS8_fb(ptr noundef nonnull align 8 dereferenceable(452) %419, ptr noundef nonnull align 4 dereferenceable(12) %65, i32 noundef %415, ptr noundef nonnull align 4 dereferenceable(12) %12, i32 noundef %417, ptr noundef nonnull align 4 dereferenceable(12) %13, float noundef %420, i1 noundef zeroext false)
          to label %422 unwind label %.loopexit.split-lp

422:                                              ; preds = %413
  br i1 %421, label %._crit_edge.thread.1, label %423

423:                                              ; preds = %422
  %424 = load ptr, ptr %5, align 8, !tbaa !5
  %425 = load ptr, ptr %424, align 8, !tbaa !5
  %426 = load i8, ptr %39, align 8, !tbaa !40, !range !41, !noundef !42
  %427 = trunc nuw i8 %426 to i1
  %428 = load i32, ptr %40, align 8, !tbaa !43
  %429 = add i32 %428, 1
  %spec.select240.peel.1 = icmp ult i32 %429, 2
  %430 = load i8, ptr %41, align 1, !tbaa !44, !range !41, !noundef !42
  %431 = trunc nuw i8 %430 to i1
  %432 = load i8, ptr %42, align 2, !tbaa !45, !range !41, !noundef !42
  %433 = trunc nuw i8 %432 to i1
  %434 = load float, ptr %43, align 4, !tbaa !46
  %435 = fmul float %434, %434
  %436 = load i8, ptr %44, align 8, !tbaa !47, !range !41, !noundef !42
  %437 = trunc nuw i8 %436 to i1
  %438 = load float, ptr %45, align 4, !tbaa !48
  %439 = fmul float %438, 0x3F91DF46A0000000
  %440 = call float @cosf(float noundef %439) #8
  %441 = invoke noundef zeroext i1 @_ZN7Riemann20FLocalPlanarSimplify29CollapseWouldChangeShapeOrUVsERKNS_11DynamicMeshERKSt3setIiSt4lessIiESaIiEEfiiRKN5Maths8TVector3IfEEiSF_SF_bbbbfbf(ptr noundef nonnull align 8 dereferenceable(452) %425, ptr noundef nonnull align 8 dereferenceable(48) %6, float noundef %29, i32 noundef %81, i32 noundef %415, ptr noundef nonnull align 4 dereferenceable(12) %12, i32 noundef %417, ptr noundef nonnull align 4 dereferenceable(12) %13, ptr noundef nonnull align 4 dereferenceable(12) %14, i1 noundef zeroext %427, i1 noundef zeroext %spec.select240.peel.1, i1 noundef zeroext %431, i1 noundef zeroext %433, float noundef %435, i1 noundef zeroext %437, float noundef %440)
          to label %.critedge.peel.1 unwind label %.loopexit.split-lp

.critedge.peel.1:                                 ; preds = %423
  %.not212.peel.1 = or i1 %441, %62
  br i1 %.not212.peel.1, label %._crit_edge.1, label %.peel.next.1

.peel.next.1:                                     ; preds = %.critedge.peel.1
  %442 = load i32, ptr %64, align 4, !tbaa !37
  %443 = load i32, ptr %10, align 8, !tbaa !37
  br label %444

444:                                              ; preds = %.critedge.1, %.peel.next.1
  %indvars.iv352.1 = phi i64 [ 1, %.peel.next.1 ], [ %indvars.iv.next353.1, %.critedge.1 ]
  %445 = load ptr, ptr %5, align 8, !tbaa !5
  %446 = getelementptr inbounds ptr, ptr %445, i64 %indvars.iv352.1
  %447 = load ptr, ptr %446, align 8, !tbaa !5
  %448 = getelementptr inbounds [2 x [2 x %"class.Maths::TVector3"]], ptr %11, i64 0, i64 1, i64 %indvars.iv352.1
  %449 = load float, ptr %38, align 4, !tbaa !39
  %450 = invoke noundef zeroext i1 @_ZN7Riemann20FLocalPlanarSimplify32CollapseWouldHurtTriangleQualityERKNS_11DynamicMeshERKN5Maths8TVector3IfEEiS8_iS8_fb(ptr noundef nonnull align 8 dereferenceable(452) %447, ptr noundef nonnull align 4 dereferenceable(12) %448, i32 noundef %442, ptr noundef nonnull align 4 dereferenceable(12) %12, i32 noundef %443, ptr noundef nonnull align 4 dereferenceable(12) %13, float noundef %449, i1 noundef zeroext false)
          to label %451 unwind label %.loopexit355.loopexit.split-lp

451:                                              ; preds = %444
  br i1 %450, label %._crit_edge.thread.1, label %452

452:                                              ; preds = %451
  %453 = load ptr, ptr %5, align 8, !tbaa !5
  %454 = getelementptr inbounds ptr, ptr %453, i64 %indvars.iv352.1
  %455 = load ptr, ptr %454, align 8, !tbaa !5
  %456 = getelementptr inbounds [2 x %"class.std::set"], ptr %6, i64 0, i64 %indvars.iv352.1
  %457 = load i8, ptr %39, align 8, !tbaa !40, !range !41, !noundef !42
  %458 = trunc nuw i8 %457 to i1
  %459 = load i32, ptr %40, align 8, !tbaa !43
  %460 = icmp eq i32 %459, -1
  %461 = zext i32 %459 to i64
  %462 = icmp eq i64 %indvars.iv352.1, %461
  %spec.select240.1 = or i1 %460, %462
  %463 = load i8, ptr %41, align 1, !tbaa !44, !range !41, !noundef !42
  %464 = trunc nuw i8 %463 to i1
  %465 = load i8, ptr %42, align 2, !tbaa !45, !range !41, !noundef !42
  %466 = trunc nuw i8 %465 to i1
  %467 = load float, ptr %43, align 4, !tbaa !46
  %468 = fmul float %467, %467
  %469 = load i8, ptr %44, align 8, !tbaa !47, !range !41, !noundef !42
  %470 = trunc nuw i8 %469 to i1
  %471 = load float, ptr %45, align 4, !tbaa !48
  %472 = fmul float %471, 0x3F91DF46A0000000
  %473 = call float @cosf(float noundef %472) #8
  %474 = invoke noundef zeroext i1 @_ZN7Riemann20FLocalPlanarSimplify29CollapseWouldChangeShapeOrUVsERKNS_11DynamicMeshERKSt3setIiSt4lessIiESaIiEEfiiRKN5Maths8TVector3IfEEiSF_SF_bbbbfbf(ptr noundef nonnull align 8 dereferenceable(452) %455, ptr noundef nonnull align 8 dereferenceable(48) %456, float noundef %29, i32 noundef %.0194, i32 noundef %442, ptr noundef nonnull align 4 dereferenceable(12) %12, i32 noundef %443, ptr noundef nonnull align 4 dereferenceable(12) %13, ptr noundef nonnull align 4 dereferenceable(12) %14, i1 noundef zeroext %458, i1 noundef zeroext %spec.select240.1, i1 noundef zeroext %464, i1 noundef zeroext %466, float noundef %468, i1 noundef zeroext %470, float noundef %473)
          to label %.critedge.1 unwind label %.loopexit355.loopexit.split-lp

.critedge.1:                                      ; preds = %452
  %indvars.iv.next353.1 = add nuw nsw i64 %indvars.iv352.1, 1
  %475 = icmp sge i64 %indvars.iv.next353.1, %57
  %.not212.1 = select i1 %474, i1 true, i1 %475
  br i1 %.not212.1, label %._crit_edge.1, label %444, !llvm.loop !50

._crit_edge.1:                                    ; preds = %.critedge.1, %.critedge.peel.1
  %.lcssa.1 = phi i1 [ %441, %.critedge.peel.1 ], [ %474, %.critedge.1 ]
  br i1 %.lcssa.1, label %._crit_edge.thread.1, label %.critedge325

._crit_edge.thread.1:                             ; preds = %451, %._crit_edge.1, %422
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %14) #8
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %13) #8
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %12) #8
  br label %.loopexit

.thread262:                                       ; preds = %103, %109, %116
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %10) #8
  br label %.thread257

.loopexit:                                        ; preds = %.preheader265.1, %._crit_edge.thread.1, %162, %.thread249
  %.9173 = phi i32 [ %.1165317, %162 ], [ %.6170.ph, %.thread249 ], [ %.1165317, %._crit_edge.thread.1 ], [ %.1165317, %.preheader265.1 ]
  call void @llvm.lifetime.end.p0(i64 48, ptr nonnull %11) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %10) #8
  br label %.thread257

.thread257:                                       ; preds = %.lr.ph319, %.loopexit, %.thread262
  %.12176260 = phi i32 [ %.9173, %.loopexit ], [ %.1165317, %.thread262 ], [ %.1165317, %.lr.ph319 ]
  %476 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %8) #8
  %477 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPiSt6vectorIiSaIiEEEEbRKNS_17__normal_iteratorIT_T0_EESA_(ptr noundef nonnull align 8 dereferenceable(8) %8, ptr noundef nonnull align 8 dereferenceable(8) %9) #8
  br i1 %477, label %.lr.ph319, label %.thread254

478:                                              ; preds = %143, %397, %130
  %.pn231.pn = phi { ptr, i32 } [ %131, %130 ], [ %144, %143 ], [ %.pn226.pn.pn.pn, %397 ]
  call void @llvm.lifetime.end.p0(i64 48, ptr nonnull %11) #8
  br label %479

479:                                              ; preds = %118, %478, %104
  %.pn231.pn.pn.pn = phi { ptr, i32 } [ %105, %104 ], [ %.pn231.pn, %478 ], [ %119, %118 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %10) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %9) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #8
  br label %491

.thread254:                                       ; preds = %.thread257, %91, %85, %76
  %.1165.lcssa = phi i32 [ %.0164, %76 ], [ %.1165317, %85 ], [ %.1165317, %91 ], [ %.12176260, %.thread257 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %9) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #8
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %24) #8
  invoke void @_Z8ToVectorIiSt3setIiSt4lessIiESaIiEEESt6vectorIT_SaIS6_EERKT0_(ptr dead_on_unwind nonnull writable sret(%"class.std::vector") align 8 %24, ptr noundef nonnull align 8 dereferenceable(48) %6)
          to label %480 unwind label %485

480:                                              ; preds = %.thread254
  %481 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorIiSaIiEEaSEOS1_(ptr noundef nonnull align 8 dereferenceable(24) %2, ptr noundef nonnull align 8 dereferenceable(24) %24) #8
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %24) #8
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %24) #8
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %25) #8
  invoke void @_Z8ToVectorIiSt3setIiSt4lessIiESaIiEEESt6vectorIT_SaIS6_EERKT0_(ptr dead_on_unwind nonnull writable sret(%"class.std::vector") align 8 %25, ptr noundef nonnull align 8 dereferenceable(48) %.ptr.1)
          to label %482 unwind label %487

482:                                              ; preds = %480
  %483 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorIiSaIiEEaSEOS1_(ptr noundef nonnull align 8 dereferenceable(24) %56, ptr noundef nonnull align 8 dereferenceable(24) %25) #8
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %25) #8
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %25) #8
  %484 = icmp eq i32 %.1165.lcssa, %.0164
  br i1 %484, label %489, label %74

485:                                              ; preds = %.thread254
  %486 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %24) #8
  br label %491

487:                                              ; preds = %480
  %488 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %25) #8
  br label %491

489:                                              ; preds = %482, %74
  %490 = getelementptr inbounds i8, ptr %6, i64 48
  call void @_ZNSt3setIiSt4lessIiESaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(48) %490) #8
  call void @_ZNSt3setIiSt4lessIiESaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(48) %6) #8
  call void @llvm.lifetime.end.p0(i64 96, ptr nonnull %6) #8
  ret void

491:                                              ; preds = %479, %485, %487, %72
  %.pn238 = phi { ptr, i32 } [ %73, %72 ], [ %488, %487 ], [ %486, %485 ], [ %.pn231.pn.pn.pn, %479 ]
  %492 = getelementptr inbounds i8, ptr %6, i64 48
  call void @_ZNSt3setIiSt4lessIiESaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(48) %492) #8
  call void @_ZNSt3setIiSt4lessIiESaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(48) %6) #8
  call void @llvm.lifetime.end.p0(i64 96, ptr nonnull %6) #8
  resume { ptr, i32 } %.pn238
}

; Function Attrs: mustprogress nofree nounwind willreturn memory(write)
declare float @cosf(float noundef) local_unnamed_addr #5

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

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

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZNK7Riemann11DynamicMesh16GetTriangleCountEv(ptr noundef nonnull align 8 dereferenceable(452)) local_unnamed_addr #4 align 2

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN5Maths8TVector3IfE4ZeroEv(ptr dead_on_unwind noalias writable sret(%"class.Maths::TVector3") align 4) local_unnamed_addr #2 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZN7Riemann20FLocalPlanarSimplify6IsFlatERKNS_11DynamicMeshEifRN5Maths8TVector3IfEE(ptr noundef nonnull align 8 dereferenceable(452), i32 noundef, float noundef, ptr noundef nonnull align 4 dereferenceable(12)) local_unnamed_addr #2 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZNK7Riemann11DynamicMesh9GetVertexEi(ptr dead_on_unwind noalias writable sret(%"class.Maths::TVector3") align 4, ptr noundef nonnull align 8 dereferenceable(452), i32 noundef) local_unnamed_addr #3 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef float @_ZN5Maths8TVector3IfE13SafeNormalizeEv(ptr noundef nonnull align 4 dereferenceable(12)) local_unnamed_addr #4 align 2

; Function Attrs: noreturn nounwind
declare void @__assert_fail(ptr noundef, ptr noundef, i32 noundef, ptr noundef) local_unnamed_addr #6

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZN7Riemann20FLocalPlanarSimplify32CollapseWouldHurtTriangleQualityERKNS_11DynamicMeshERKN5Maths8TVector3IfEEiS8_iS8_fb(ptr noundef nonnull align 8 dereferenceable(452), ptr noundef nonnull align 4 dereferenceable(12), i32 noundef, ptr noundef nonnull align 4 dereferenceable(12), i32 noundef, ptr noundef nonnull align 4 dereferenceable(12), float noundef, i1 noundef zeroext) local_unnamed_addr #2 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZN7Riemann20FLocalPlanarSimplify29CollapseWouldChangeShapeOrUVsERKNS_11DynamicMeshERKSt3setIiSt4lessIiESaIiEEfiiRKN5Maths8TVector3IfEEiSF_SF_bbbbfbf(ptr noundef nonnull align 8 dereferenceable(452), ptr noundef nonnull align 8 dereferenceable(48), float noundef, i32 noundef, i32 noundef, ptr noundef nonnull align 4 dereferenceable(12), i32 noundef, ptr noundef nonnull align 4 dereferenceable(12), ptr noundef nonnull align 4 dereferenceable(12), i1 noundef zeroext, i1 noundef zeroext, i1 noundef zeroext, i1 noundef zeroext, float noundef, i1 noundef zeroext, float noundef) local_unnamed_addr #2 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZNK7Riemann11DynamicMesh11GetTriangleEi(ptr dead_on_unwind noalias writable sret(%"class.Maths::TIndex3") align 4, ptr noundef nonnull align 8 dereferenceable(452), i32 noundef) local_unnamed_addr #3 align 2

; Function Attrs: mustprogress uwtable
declare hidden noundef i32 @_ZN7RiemannL15FindTriOtherVtxIiN5Maths7TIndex3IiEEEEiT_S4_RKT0_(i32 noundef, i32 noundef, ptr noundef nonnull align 4 dereferenceable(12)) local_unnamed_addr #2

; Function Attrs: mustprogress uwtable
declare hidden void @"_ZNK7Riemann11DynamicMesh23EnumerateVertexVerticesIZNS_21SimplifyAlongNewEdgesEiPPS0_PSt6vectorIiSaIiEERSt3mapIiiSt4lessIiESaISt4pairIKiiEEEPNS_15GeometryBooleanEE3$_0EEviT_"(ptr noundef nonnull align 8 dereferenceable(452), i32 noundef, ptr noundef byval(%class.anon.58) align 8) local_unnamed_addr #2 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN7Riemann17FEdgeCollapseInfoC2Ev(ptr noundef nonnull align 4 dereferenceable(52)) unnamed_addr #3 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare hidden noundef zeroext i1 @"_ZZN7Riemann21SimplifyAlongNewEdgesEiPPNS_11DynamicMeshEPSt6vectorIiSaIiEERSt3mapIiiSt4lessIiESaISt4pairIKiiEEEPNS_15GeometryBooleanEENK3$_1clERKS0_ii"(ptr noundef nonnull align 1 dereferenceable(1), ptr noundef nonnull align 8 dereferenceable(452), i32 noundef, i32 noundef) local_unnamed_addr #3 align 2

declare noundef i32 @_ZN7Riemann11DynamicMesh12CollapseEdgeEiifRNS_17FEdgeCollapseInfoE(ptr noundef nonnull align 8 dereferenceable(452), i32 noundef, i32 noundef, float noundef, ptr noundef nonnull align 4 dereferenceable(52)) local_unnamed_addr #7

; Function Attrs: mustprogress uwtable
declare dso_local noundef i64 @_ZNSt3mapIiiSt4lessIiESaISt4pairIKiiEEE5eraseERS3_(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 i64 @_ZNSt3setIiSt4lessIiESaIiEE5eraseERKi(ptr noundef nonnull align 8 dereferenceable(48), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #2 align 2

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

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

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

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #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 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 = { mustprogress nofree nounwind willreturn memory(write) "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 = { noreturn nounwind "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 #7 = { "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 #8 = { nounwind }
attributes #9 = { noreturn 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, !12, i64 16}
!10 = !{!"_ZTSN7Riemann15GeometryBooleanE", !11, i64 0, !12, i64 4, !13, i64 8, !13, i64 9, !13, i64 10, !13, i64 11, !13, i64 12, !12, i64 16, !12, i64 20, !13, i64 24, !13, i64 25, !13, i64 26, !12, i64 28, !13, i64 32, !12, i64 36, !14, i64 40, !7, i64 48, !7, i64 64, !6, i64 120, !15, i64 128, !18, i64 160, !22, i64 184, !13, i64 232, !31, i64 240}
!11 = !{!"_ZTSN7Riemann15GeometryBoolean9BooleanOpE", !7, i64 0}
!12 = !{!"float", !7, i64 0}
!13 = !{!"bool", !7, i64 0}
!14 = !{!"int", !7, i64 0}
!15 = !{!"_ZTSN5Maths9TransformE", !16, i64 0, !17, i64 12}
!16 = !{!"_ZTSN5Maths8TVector3IfEE", !12, i64 0, !12, i64 4, !12, i64 8}
!17 = !{!"_ZTSN5Maths10QuaternionE", !12, i64 0, !12, i64 4, !12, i64 8, !12, i64 12}
!18 = !{!"_ZTSSt6vectorIiSaIiEE", !19, i64 0}
!19 = !{!"_ZTSSt12_Vector_baseIiSaIiEE", !20, i64 0}
!20 = !{!"_ZTSNSt12_Vector_baseIiSaIiEE12_Vector_implE", !21, i64 0}
!21 = !{!"_ZTSNSt12_Vector_baseIiSaIiEE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!22 = !{!"_ZTSSt3setIiSt4lessIiESaIiEE", !23, i64 0}
!23 = !{!"_ZTSSt8_Rb_treeIiiSt9_IdentityIiESt4lessIiESaIiEE", !24, i64 0}
!24 = !{!"_ZTSNSt8_Rb_treeIiiSt9_IdentityIiESt4lessIiESaIiEE13_Rb_tree_implIS3_Lb1EEE", !25, i64 0, !27, i64 8}
!25 = !{!"_ZTSSt20_Rb_tree_key_compareISt4lessIiEE", !26, i64 0}
!26 = !{!"_ZTSSt4lessIiE"}
!27 = !{!"_ZTSSt15_Rb_tree_header", !28, i64 0, !30, i64 32}
!28 = !{!"_ZTSSt18_Rb_tree_node_base", !29, i64 0, !6, i64 8, !6, i64 16, !6, i64 24}
!29 = !{!"_ZTSSt14_Rb_tree_color", !7, i64 0}
!30 = !{!"long", !7, i64 0}
!31 = !{!"_ZTSN7Riemann10FIndexMapiE", !32, i64 0, !32, i64 48, !13, i64 96, !13, i64 97}
!32 = !{!"_ZTSSt3mapIiiSt4lessIiESaISt4pairIKiiEEE", !33, i64 0}
!33 = !{!"_ZTSSt8_Rb_treeIiSt4pairIKiiESt10_Select1stIS2_ESt4lessIiESaIS2_EE", !34, i64 0}
!34 = !{!"_ZTSNSt8_Rb_treeIiSt4pairIKiiESt10_Select1stIS2_ESt4lessIiESaIS2_EE13_Rb_tree_implIS6_Lb1EEE", !25, i64 0, !27, i64 8}
!35 = distinct !{!35, !36}
!36 = !{!"llvm.loop.mustprogress"}
!37 = !{!14, !14, i64 0}
!38 = !{!13, !13, i64 0}
!39 = !{!10, !12, i64 20}
!40 = !{!10, !13, i64 24}
!41 = !{i8 0, i8 2}
!42 = !{}
!43 = !{!10, !14, i64 40}
!44 = !{!10, !13, i64 25}
!45 = !{!10, !13, i64 26}
!46 = !{!10, !12, i64 28}
!47 = !{!10, !13, i64 32}
!48 = !{!10, !12, i64 36}
!49 = !{!10, !13, i64 8}
!50 = distinct !{!50, !36, !51}
!51 = !{!"llvm.loop.peeled.count", i32 1}
!52 = !{!53, !14, i64 40}
!53 = !{!"_ZTSN7Riemann17FEdgeCollapseInfoE", !14, i64 0, !14, i64 4, !54, i64 8, !13, i64 16, !14, i64 20, !54, i64 24, !54, i64 32, !54, i64 40, !12, i64 48}
!54 = !{!"_ZTSN5Maths7TIndex2IiEE", !14, i64 0, !14, i64 4}


; Effective O3 passes: ADCEPass,BDCEPass,CorrelatedValuePropagationPass,DSEPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferAlignmentPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LICMPass,LoopFullUnrollPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,PostOrderFunctionAttrsPass,ReassociatePass,SCCPPass,SROAPass,SimplifyCFGPass,TailCallElimPass