; LLVM IR from SourangshuGhosh/Fluid-Simulation-for-Computer-Graphics :: src/trianglemesh.ll (ZN12TriangleMesh4joinERS_d)

; 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.AABB = type { %"class.vmath::vec3", double, double, double }
%"class.vmath::vec3" = type { float, float, float }
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<vmath::vec3, std::allocator<vmath::vec3>>::_Vector_impl" }
%"struct.std::_Vector_base<vmath::vec3, std::allocator<vmath::vec3>>::_Vector_impl" = type { %"struct.std::_Vector_base<vmath::vec3, std::allocator<vmath::vec3>>::_Vector_impl_data" }
%"struct.std::_Vector_base<vmath::vec3, std::allocator<vmath::vec3>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::vector.15" = type { %"struct.std::_Vector_base.16" }
%"struct.std::_Vector_base.16" = 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.std::vector.36" = type { %"struct.std::_Vector_base.37" }
%"struct.std::_Vector_base.37" = type { %"struct.std::_Vector_base<std::pair<int, int>, std::allocator<std::pair<int, int>>>::_Vector_impl" }
%"struct.std::_Vector_base<std::pair<int, int>, std::allocator<std::pair<int, int>>>::_Vector_impl" = type { %"struct.std::_Vector_base<std::pair<int, int>, std::allocator<std::pair<int, int>>>::_Vector_impl_data" }
%"struct.std::_Vector_base<std::pair<int, int>, std::allocator<std::pair<int, int>>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%struct.Triangle = type { [3 x i32] }
%class.TriangleMesh = type { %"class.std::vector", %"class.std::vector", %"class.std::vector", %"class.std::vector.0", i32, i32, i32, double, %"class.std::vector.5", %"class.std::vector.10", %class.Array3d }
%"class.std::vector.0" = type { %"struct.std::_Vector_base.1" }
%"struct.std::_Vector_base.1" = type { %"struct.std::_Vector_base<Triangle, std::allocator<Triangle>>::_Vector_impl" }
%"struct.std::_Vector_base<Triangle, std::allocator<Triangle>>::_Vector_impl" = type { %"struct.std::_Vector_base<Triangle, std::allocator<Triangle>>::_Vector_impl_data" }
%"struct.std::_Vector_base<Triangle, std::allocator<Triangle>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::vector.5" = type { %"struct.std::_Vector_base.6" }
%"struct.std::_Vector_base.6" = type { %"struct.std::_Vector_base<std::vector<int>, std::allocator<std::vector<int>>>::_Vector_impl" }
%"struct.std::_Vector_base<std::vector<int>, std::allocator<std::vector<int>>>::_Vector_impl" = type { %"struct.std::_Vector_base<std::vector<int>, std::allocator<std::vector<int>>>::_Vector_impl_data" }
%"struct.std::_Vector_base<std::vector<int>, std::allocator<std::vector<int>>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::vector.10" = type { %"struct.std::_Vector_base.11" }
%"struct.std::_Vector_base.11" = type { %"struct.std::_Vector_base<double, std::allocator<double>>::_Vector_impl" }
%"struct.std::_Vector_base<double, std::allocator<double>>::_Vector_impl" = type { %"struct.std::_Vector_base<double, std::allocator<double>>::_Vector_impl_data" }
%"struct.std::_Vector_base<double, std::allocator<double>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%class.Array3d = type <{ i32, i32, i32, [4 x i8], ptr, i8, [7 x i8], %"class.std::vector.15", i32, [4 x i8] }>
%"struct.std::pair" = type { i32, i32 }

declare i32 @__gxx_personality_v0(...)

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

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

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

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

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

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #2

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

; Function Attrs: nounwind
declare void @_ZN5vmath4vec3D1Ev(ptr noundef nonnull align 4 dereferenceable(12)) unnamed_addr #3

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN8TriangleC2Ev(ptr noundef nonnull align 4 dereferenceable(12)) unnamed_addr #0 align 2

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

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

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

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

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

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

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN12TriangleMesh4joinERS_d(ptr noundef nonnull align 8 dereferenceable(232) %0, ptr noundef nonnull align 8 dereferenceable(232) %1, double noundef %2) #4 align 2 personality ptr @__gxx_personality_v0 {
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca double, align 8
  %7 = alloca %class.AABB, align 8
  %8 = alloca %"class.std::vector", align 8
  %9 = alloca %"class.std::vector", align 8
  %10 = alloca ptr, align 8
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca %"class.std::vector.15", align 8
  %14 = alloca i32, align 4
  %15 = alloca %"class.vmath::vec3", align 4
  %16 = alloca i32, align 4
  %17 = alloca %"class.std::vector.15", align 8
  %18 = alloca i32, align 4
  %19 = alloca %"class.vmath::vec3", align 4
  %20 = alloca i32, align 4
  %21 = alloca %"class.std::vector.36", align 8
  %22 = alloca %class.AABB, align 8
  %23 = alloca %"class.std::vector.15", align 8
  %24 = alloca i32, align 4
  %25 = alloca i32, align 4
  %26 = alloca i32, align 4
  %27 = alloca %struct.Triangle, align 4
  %28 = alloca i32, align 4
  store ptr %0, ptr %4, align 8, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !5
  store double %2, ptr %6, align 8, !tbaa !9
  %29 = load ptr, ptr %4, align 8
  %30 = load ptr, ptr %5, align 8, !tbaa !5
  %31 = getelementptr inbounds %class.TriangleMesh, ptr %30, i32 0, i32 0
  %32 = call noundef i64 @_ZNKSt6vectorIN5vmath4vec3ESaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %31) #6
  %33 = icmp eq i64 %32, 0
  br i1 %33, label %34, label %35

34:                                               ; preds = %3
  br label %256

35:                                               ; preds = %3
  %36 = getelementptr inbounds %class.TriangleMesh, ptr %29, i32 0, i32 0
  %37 = call noundef i64 @_ZNKSt6vectorIN5vmath4vec3ESaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %36) #6
  %38 = icmp eq i64 %37, 0
  br i1 %38, label %39, label %41

39:                                               ; preds = %35
  %40 = load ptr, ptr %5, align 8, !tbaa !5
  call void @_ZN12TriangleMesh6appendERS_(ptr noundef nonnull align 8 dereferenceable(232) %29, ptr noundef nonnull align 8 dereferenceable(232) %40)
  br label %256

41:                                               ; preds = %35
  call void @llvm.lifetime.start.p0(i64 40, ptr %7) #6
  %42 = getelementptr inbounds %class.TriangleMesh, ptr %29, i32 0, i32 0
  call void @_ZNSt6vectorIN5vmath4vec3ESaIS1_EEC2ERKS3_(ptr noundef nonnull align 8 dereferenceable(24) %8, ptr noundef nonnull align 8 dereferenceable(24) %42)
  %43 = load ptr, ptr %5, align 8, !tbaa !5
  %44 = getelementptr inbounds %class.TriangleMesh, ptr %43, i32 0, i32 0
  invoke void @_ZNSt6vectorIN5vmath4vec3ESaIS1_EEC2ERKS3_(ptr noundef nonnull align 8 dereferenceable(24) %9, ptr noundef nonnull align 8 dereferenceable(24) %44)
          to label %45 unwind label %58

45:                                               ; preds = %41
  %46 = load double, ptr %6, align 8, !tbaa !9
  invoke void @_ZN12TriangleMesh30_getMeshVertexIntersectionAABBESt6vectorIN5vmath4vec3ESaIS2_EES4_d(ptr dead_on_unwind writable sret(%class.AABB) align 8 %7, ptr noundef nonnull align 8 dereferenceable(232) %29, ptr noundef %8, ptr noundef %9, double noundef %46)
          to label %47 unwind label %62

47:                                               ; preds = %45
  call void @_ZNSt6vectorIN5vmath4vec3ESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %9) #6
  call void @_ZNSt6vectorIN5vmath4vec3ESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %8) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #6
  %48 = getelementptr inbounds %class.TriangleMesh, ptr %29, i32 0, i32 0
  %49 = call noundef i64 @_ZNKSt6vectorIN5vmath4vec3ESaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %48) #6
  %50 = trunc i64 %49 to i32
  store i32 %50, ptr %12, align 4, !tbaa !11
  %51 = load ptr, ptr %5, align 8, !tbaa !5
  invoke void @_ZN12TriangleMesh6appendERS_(ptr noundef nonnull align 8 dereferenceable(232) %29, ptr noundef nonnull align 8 dereferenceable(232) %51)
          to label %52 unwind label %67

52:                                               ; preds = %47
  call void @llvm.lifetime.start.p0(i64 24, ptr %13) #6
  call void @_ZNSt6vectorIiSaIiEEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %13) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #6
  store i32 0, ptr %14, align 4, !tbaa !11
  br label %53

53:                                               ; preds = %90, %52
  %54 = load i32, ptr %14, align 4, !tbaa !11
  %55 = load i32, ptr %12, align 4, !tbaa !11
  %56 = icmp ult i32 %54, %55
  br i1 %56, label %71, label %57

57:                                               ; preds = %53
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #6
  br label %94

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

62:                                               ; preds = %45
  %63 = landingpad { ptr, i32 }
          cleanup
  %64 = extractvalue { ptr, i32 } %63, 0
  store ptr %64, ptr %10, align 8
  %65 = extractvalue { ptr, i32 } %63, 1
  store i32 %65, ptr %11, align 4
  call void @_ZNSt6vectorIN5vmath4vec3ESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %9) #6
  br label %66

66:                                               ; preds = %62, %58
  call void @_ZNSt6vectorIN5vmath4vec3ESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %8) #6
  br label %262

67:                                               ; preds = %47
  %68 = landingpad { ptr, i32 }
          cleanup
  %69 = extractvalue { ptr, i32 } %68, 0
  store ptr %69, ptr %10, align 8
  %70 = extractvalue { ptr, i32 } %68, 1
  store i32 %70, ptr %11, align 4
  br label %261

71:                                               ; preds = %53
  %72 = getelementptr inbounds %class.TriangleMesh, ptr %29, i32 0, i32 0
  %73 = load i32, ptr %14, align 4, !tbaa !11
  %74 = zext i32 %73 to i64
  %75 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt6vectorIN5vmath4vec3ESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %72, i64 noundef %74) #6
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %15, ptr align 4 %75, i64 12, i1 false), !tbaa.struct !13
  %76 = invoke noundef zeroext i1 @_ZN4AABB13isPointInsideEN5vmath4vec3E(ptr noundef nonnull align 8 dereferenceable(40) %7, ptr noundef %15)
          to label %77 unwind label %81

77:                                               ; preds = %71
  call void @_ZN5vmath4vec3D1Ev(ptr noundef nonnull align 4 dereferenceable(12) %15) #6
  br i1 %76, label %78, label %89

78:                                               ; preds = %77
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #6
  %79 = load i32, ptr %14, align 4, !tbaa !11
  store i32 %79, ptr %16, align 4, !tbaa !11
  invoke void @_ZNSt6vectorIiSaIiEE9push_backEOi(ptr noundef nonnull align 8 dereferenceable(24) %13, ptr noundef nonnull align 4 dereferenceable(4) %16)
          to label %80 unwind label %85

80:                                               ; preds = %78
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #6
  br label %89

81:                                               ; preds = %71
  %82 = landingpad { ptr, i32 }
          cleanup
  %83 = extractvalue { ptr, i32 } %82, 0
  store ptr %83, ptr %10, align 8
  %84 = extractvalue { ptr, i32 } %82, 1
  store i32 %84, ptr %11, align 4
  call void @_ZN5vmath4vec3D1Ev(ptr noundef nonnull align 4 dereferenceable(12) %15) #6
  br label %93

85:                                               ; preds = %78
  %86 = landingpad { ptr, i32 }
          cleanup
  %87 = extractvalue { ptr, i32 } %86, 0
  store ptr %87, ptr %10, align 8
  %88 = extractvalue { ptr, i32 } %86, 1
  store i32 %88, ptr %11, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #6
  br label %93

89:                                               ; preds = %80, %77
  br label %90

90:                                               ; preds = %89
  %91 = load i32, ptr %14, align 4, !tbaa !11
  %92 = add i32 %91, 1
  store i32 %92, ptr %14, align 4, !tbaa !11
  br label %53, !llvm.loop !16

93:                                               ; preds = %85, %81
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #6
  br label %260

94:                                               ; preds = %57
  call void @llvm.lifetime.start.p0(i64 24, ptr %17) #6
  call void @_ZNSt6vectorIiSaIiEEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %17) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #6
  %95 = load i32, ptr %12, align 4, !tbaa !11
  store i32 %95, ptr %18, align 4, !tbaa !11
  br label %96

96:                                               ; preds = %122, %94
  %97 = load i32, ptr %18, align 4, !tbaa !11
  %98 = zext i32 %97 to i64
  %99 = getelementptr inbounds %class.TriangleMesh, ptr %29, i32 0, i32 0
  %100 = call noundef i64 @_ZNKSt6vectorIN5vmath4vec3ESaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %99) #6
  %101 = icmp ult i64 %98, %100
  br i1 %101, label %103, label %102

102:                                              ; preds = %96
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #6
  br label %126

103:                                              ; preds = %96
  %104 = getelementptr inbounds %class.TriangleMesh, ptr %29, i32 0, i32 0
  %105 = load i32, ptr %18, align 4, !tbaa !11
  %106 = zext i32 %105 to i64
  %107 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt6vectorIN5vmath4vec3ESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %104, i64 noundef %106) #6
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %19, ptr align 4 %107, i64 12, i1 false), !tbaa.struct !13
  %108 = invoke noundef zeroext i1 @_ZN4AABB13isPointInsideEN5vmath4vec3E(ptr noundef nonnull align 8 dereferenceable(40) %7, ptr noundef %19)
          to label %109 unwind label %113

109:                                              ; preds = %103
  call void @_ZN5vmath4vec3D1Ev(ptr noundef nonnull align 4 dereferenceable(12) %19) #6
  br i1 %108, label %110, label %121

110:                                              ; preds = %109
  call void @llvm.lifetime.start.p0(i64 4, ptr %20) #6
  %111 = load i32, ptr %18, align 4, !tbaa !11
  store i32 %111, ptr %20, align 4, !tbaa !11
  invoke void @_ZNSt6vectorIiSaIiEE9push_backEOi(ptr noundef nonnull align 8 dereferenceable(24) %17, ptr noundef nonnull align 4 dereferenceable(4) %20)
          to label %112 unwind label %117

112:                                              ; preds = %110
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #6
  br label %121

113:                                              ; preds = %103
  %114 = landingpad { ptr, i32 }
          cleanup
  %115 = extractvalue { ptr, i32 } %114, 0
  store ptr %115, ptr %10, align 8
  %116 = extractvalue { ptr, i32 } %114, 1
  store i32 %116, ptr %11, align 4
  call void @_ZN5vmath4vec3D1Ev(ptr noundef nonnull align 4 dereferenceable(12) %19) #6
  br label %125

117:                                              ; preds = %110
  %118 = landingpad { ptr, i32 }
          cleanup
  %119 = extractvalue { ptr, i32 } %118, 0
  store ptr %119, ptr %10, align 8
  %120 = extractvalue { ptr, i32 } %118, 1
  store i32 %120, ptr %11, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #6
  br label %125

121:                                              ; preds = %112, %109
  br label %122

122:                                              ; preds = %121
  %123 = load i32, ptr %18, align 4, !tbaa !11
  %124 = add i32 %123, 1
  store i32 %124, ptr %18, align 4, !tbaa !11
  br label %96, !llvm.loop !18

125:                                              ; preds = %117, %113
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #6
  br label %259

126:                                              ; preds = %102
  call void @llvm.lifetime.start.p0(i64 24, ptr %21) #6
  call void @_ZNSt6vectorISt4pairIiiESaIS1_EEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %21) #6
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %22, ptr align 8 %7, i64 40, i1 false), !tbaa.struct !19
  %127 = load double, ptr %6, align 8, !tbaa !9
  invoke void @_ZN12TriangleMesh25_findDuplicateVertexPairsERSt6vectorIiSaIiEES3_4AABBdRS0_ISt4pairIiiESaIS6_EE(ptr noundef nonnull align 8 dereferenceable(232) %29, ptr noundef nonnull align 8 dereferenceable(24) %13, ptr noundef nonnull align 8 dereferenceable(24) %17, ptr noundef %22, double noundef %127, ptr noundef nonnull align 8 dereferenceable(24) %21)
          to label %128 unwind label %139

128:                                              ; preds = %126
  call void @_ZN4AABBD1Ev(ptr noundef nonnull align 8 dereferenceable(40) %22) #6
  call void @llvm.lifetime.start.p0(i64 24, ptr %23) #6
  call void @_ZNSt6vectorIiSaIiEEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %23) #6
  %129 = getelementptr inbounds %class.TriangleMesh, ptr %29, i32 0, i32 0
  %130 = call noundef i64 @_ZNKSt6vectorIN5vmath4vec3ESaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %129) #6
  invoke void @_ZNSt6vectorIiSaIiEE7reserveEm(ptr noundef nonnull align 8 dereferenceable(24) %23, i64 noundef %130)
          to label %131 unwind label %143

131:                                              ; preds = %128
  call void @llvm.lifetime.start.p0(i64 4, ptr %24) #6
  store i32 0, ptr %24, align 4, !tbaa !11
  br label %132

132:                                              ; preds = %150, %131
  %133 = load i32, ptr %24, align 4, !tbaa !11
  %134 = zext i32 %133 to i64
  %135 = getelementptr inbounds %class.TriangleMesh, ptr %29, i32 0, i32 0
  %136 = call noundef i64 @_ZNKSt6vectorIN5vmath4vec3ESaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %135) #6
  %137 = icmp ult i64 %134, %136
  br i1 %137, label %147, label %138

138:                                              ; preds = %132
  call void @llvm.lifetime.end.p0(i64 4, ptr %24) #6
  br label %157

139:                                              ; preds = %126
  %140 = landingpad { ptr, i32 }
          cleanup
  %141 = extractvalue { ptr, i32 } %140, 0
  store ptr %141, ptr %10, align 8
  %142 = extractvalue { ptr, i32 } %140, 1
  store i32 %142, ptr %11, align 4
  call void @_ZN4AABBD1Ev(ptr noundef nonnull align 8 dereferenceable(40) %22) #6
  br label %258

143:                                              ; preds = %128
  %144 = landingpad { ptr, i32 }
          cleanup
  %145 = extractvalue { ptr, i32 } %144, 0
  store ptr %145, ptr %10, align 8
  %146 = extractvalue { ptr, i32 } %144, 1
  store i32 %146, ptr %11, align 4
  br label %257

147:                                              ; preds = %132
  call void @llvm.lifetime.start.p0(i64 4, ptr %25) #6
  %148 = load i32, ptr %24, align 4, !tbaa !11
  store i32 %148, ptr %25, align 4, !tbaa !11
  invoke void @_ZNSt6vectorIiSaIiEE9push_backEOi(ptr noundef nonnull align 8 dereferenceable(24) %23, ptr noundef nonnull align 4 dereferenceable(4) %25)
          to label %149 unwind label %153

149:                                              ; preds = %147
  call void @llvm.lifetime.end.p0(i64 4, ptr %25) #6
  br label %150

150:                                              ; preds = %149
  %151 = load i32, ptr %24, align 4, !tbaa !11
  %152 = add i32 %151, 1
  store i32 %152, ptr %24, align 4, !tbaa !11
  br label %132, !llvm.loop !20

153:                                              ; preds = %147
  %154 = landingpad { ptr, i32 }
          cleanup
  %155 = extractvalue { ptr, i32 } %154, 0
  store ptr %155, ptr %10, align 8
  %156 = extractvalue { ptr, i32 } %154, 1
  store i32 %156, ptr %11, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %25) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %24) #6
  br label %257

157:                                              ; preds = %138
  call void @llvm.lifetime.start.p0(i64 4, ptr %26) #6
  store i32 0, ptr %26, align 4, !tbaa !11
  br label %158

158:                                              ; preds = %177, %157
  %159 = load i32, ptr %26, align 4, !tbaa !11
  %160 = zext i32 %159 to i64
  %161 = call noundef i64 @_ZNKSt6vectorISt4pairIiiESaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %21) #6
  %162 = icmp ult i64 %160, %161
  br i1 %162, label %164, label %163

163:                                              ; preds = %158
  call void @llvm.lifetime.end.p0(i64 4, ptr %26) #6
  br label %180

164:                                              ; preds = %158
  %165 = load i32, ptr %26, align 4, !tbaa !11
  %166 = zext i32 %165 to i64
  %167 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt6vectorISt4pairIiiESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %21, i64 noundef %166) #6
  %168 = getelementptr inbounds %"struct.std::pair", ptr %167, i32 0, i32 0
  %169 = load i32, ptr %168, align 4, !tbaa !21
  %170 = load i32, ptr %26, align 4, !tbaa !11
  %171 = zext i32 %170 to i64
  %172 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt6vectorISt4pairIiiESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %21, i64 noundef %171) #6
  %173 = getelementptr inbounds %"struct.std::pair", ptr %172, i32 0, i32 1
  %174 = load i32, ptr %173, align 4, !tbaa !23
  %175 = sext i32 %174 to i64
  %176 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %23, i64 noundef %175) #6
  store i32 %169, ptr %176, align 4, !tbaa !11
  br label %177

177:                                              ; preds = %164
  %178 = load i32, ptr %26, align 4, !tbaa !11
  %179 = add i32 %178, 1
  store i32 %179, ptr %26, align 4, !tbaa !11
  br label %158, !llvm.loop !24

180:                                              ; preds = %163
  call void @llvm.lifetime.start.p0(i64 12, ptr %27) #6
  invoke void @_ZN8TriangleC2Ev(ptr noundef nonnull align 4 dereferenceable(12) %27)
          to label %181 unwind label %189

181:                                              ; preds = %180
  call void @llvm.lifetime.start.p0(i64 4, ptr %28) #6
  store i32 0, ptr %28, align 4, !tbaa !11
  br label %182

182:                                              ; preds = %251, %181
  %183 = load i32, ptr %28, align 4, !tbaa !11
  %184 = zext i32 %183 to i64
  %185 = getelementptr inbounds %class.TriangleMesh, ptr %29, i32 0, i32 3
  %186 = call noundef i64 @_ZNKSt6vectorI8TriangleSaIS0_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %185) #6
  %187 = icmp ult i64 %184, %186
  br i1 %187, label %193, label %188

188:                                              ; preds = %182
  call void @llvm.lifetime.end.p0(i64 4, ptr %28) #6
  br label %254

189:                                              ; preds = %254, %180
  %190 = landingpad { ptr, i32 }
          cleanup
  %191 = extractvalue { ptr, i32 } %190, 0
  store ptr %191, ptr %10, align 8
  %192 = extractvalue { ptr, i32 } %190, 1
  store i32 %192, ptr %11, align 4
  call void @llvm.lifetime.end.p0(i64 12, ptr %27) #6
  br label %257

193:                                              ; preds = %182
  %194 = getelementptr inbounds %class.TriangleMesh, ptr %29, i32 0, i32 3
  %195 = load i32, ptr %28, align 4, !tbaa !11
  %196 = zext i32 %195 to i64
  %197 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt6vectorI8TriangleSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %194, i64 noundef %196) #6
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %27, ptr align 4 %197, i64 12, i1 false), !tbaa.struct !25
  %198 = getelementptr inbounds %struct.Triangle, ptr %27, i32 0, i32 0
  %199 = getelementptr inbounds [3 x i32], ptr %198, i64 0, i64 0
  %200 = load i32, ptr %199, align 4, !tbaa !11
  %201 = sext i32 %200 to i64
  %202 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %23, i64 noundef %201) #6
  %203 = load i32, ptr %202, align 4, !tbaa !11
  %204 = getelementptr inbounds %struct.Triangle, ptr %27, i32 0, i32 0
  %205 = getelementptr inbounds [3 x i32], ptr %204, i64 0, i64 0
  store i32 %203, ptr %205, align 4, !tbaa !11
  %206 = getelementptr inbounds %struct.Triangle, ptr %27, i32 0, i32 0
  %207 = getelementptr inbounds [3 x i32], ptr %206, i64 0, i64 1
  %208 = load i32, ptr %207, align 4, !tbaa !11
  %209 = sext i32 %208 to i64
  %210 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %23, i64 noundef %209) #6
  %211 = load i32, ptr %210, align 4, !tbaa !11
  %212 = getelementptr inbounds %struct.Triangle, ptr %27, i32 0, i32 0
  %213 = getelementptr inbounds [3 x i32], ptr %212, i64 0, i64 1
  store i32 %211, ptr %213, align 4, !tbaa !11
  %214 = getelementptr inbounds %struct.Triangle, ptr %27, i32 0, i32 0
  %215 = getelementptr inbounds [3 x i32], ptr %214, i64 0, i64 2
  %216 = load i32, ptr %215, align 4, !tbaa !11
  %217 = sext i32 %216 to i64
  %218 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %23, i64 noundef %217) #6
  %219 = load i32, ptr %218, align 4, !tbaa !11
  %220 = getelementptr inbounds %struct.Triangle, ptr %27, i32 0, i32 0
  %221 = getelementptr inbounds [3 x i32], ptr %220, i64 0, i64 2
  store i32 %219, ptr %221, align 4, !tbaa !11
  %222 = getelementptr inbounds %struct.Triangle, ptr %27, i32 0, i32 0
  %223 = getelementptr inbounds [3 x i32], ptr %222, i64 0, i64 0
  %224 = load i32, ptr %223, align 4, !tbaa !11
  %225 = getelementptr inbounds %struct.Triangle, ptr %27, i32 0, i32 0
  %226 = getelementptr inbounds [3 x i32], ptr %225, i64 0, i64 1
  %227 = load i32, ptr %226, align 4, !tbaa !11
  %228 = icmp eq i32 %224, %227
  br i1 %228, label %245, label %229

229:                                              ; preds = %193
  %230 = getelementptr inbounds %struct.Triangle, ptr %27, i32 0, i32 0
  %231 = getelementptr inbounds [3 x i32], ptr %230, i64 0, i64 1
  %232 = load i32, ptr %231, align 4, !tbaa !11
  %233 = getelementptr inbounds %struct.Triangle, ptr %27, i32 0, i32 0
  %234 = getelementptr inbounds [3 x i32], ptr %233, i64 0, i64 2
  %235 = load i32, ptr %234, align 4, !tbaa !11
  %236 = icmp eq i32 %232, %235
  br i1 %236, label %245, label %237

237:                                              ; preds = %229
  %238 = getelementptr inbounds %struct.Triangle, ptr %27, i32 0, i32 0
  %239 = getelementptr inbounds [3 x i32], ptr %238, i64 0, i64 2
  %240 = load i32, ptr %239, align 4, !tbaa !11
  %241 = getelementptr inbounds %struct.Triangle, ptr %27, i32 0, i32 0
  %242 = getelementptr inbounds [3 x i32], ptr %241, i64 0, i64 0
  %243 = load i32, ptr %242, align 4, !tbaa !11
  %244 = icmp eq i32 %240, %243
  br i1 %244, label %245, label %246

245:                                              ; preds = %237, %229, %193
  br label %251

246:                                              ; preds = %237
  %247 = getelementptr inbounds %class.TriangleMesh, ptr %29, i32 0, i32 3
  %248 = load i32, ptr %28, align 4, !tbaa !11
  %249 = zext i32 %248 to i64
  %250 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt6vectorI8TriangleSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %247, i64 noundef %249) #6
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %250, ptr align 4 %27, i64 12, i1 false), !tbaa.struct !25
  br label %251

251:                                              ; preds = %246, %245
  %252 = load i32, ptr %28, align 4, !tbaa !11
  %253 = add i32 %252, 1
  store i32 %253, ptr %28, align 4, !tbaa !11
  br label %182, !llvm.loop !27

254:                                              ; preds = %188
  invoke void @_ZN12TriangleMesh24removeExtraneousVerticesEv(ptr noundef nonnull align 8 dereferenceable(232) %29)
          to label %255 unwind label %189

255:                                              ; preds = %254
  call void @llvm.lifetime.end.p0(i64 12, ptr %27) #6
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %23) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr %23) #6
  call void @_ZNSt6vectorISt4pairIiiESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %21) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr %21) #6
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %17) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr %17) #6
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %13) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr %13) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #6
  call void @_ZN4AABBD1Ev(ptr noundef nonnull align 8 dereferenceable(40) %7) #6
  call void @llvm.lifetime.end.p0(i64 40, ptr %7) #6
  br label %256

256:                                              ; preds = %255, %39, %34
  ret void

257:                                              ; preds = %189, %153, %143
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %23) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr %23) #6
  br label %258

258:                                              ; preds = %257, %139
  call void @_ZNSt6vectorISt4pairIiiESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %21) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr %21) #6
  br label %259

259:                                              ; preds = %258, %125
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %17) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr %17) #6
  br label %260

260:                                              ; preds = %259, %93
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %13) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr %13) #6
  br label %261

261:                                              ; preds = %260, %67
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #6
  call void @_ZN4AABBD1Ev(ptr noundef nonnull align 8 dereferenceable(40) %7) #6
  br label %262

262:                                              ; preds = %261, %66
  call void @llvm.lifetime.end.p0(i64 40, ptr %7) #6
  br label %263

263:                                              ; preds = %262
  %264 = load ptr, ptr %10, align 8
  %265 = load i32, ptr %11, align 4
  %266 = insertvalue { ptr, i32 } poison, ptr %264, 0
  %267 = insertvalue { ptr, i32 } %266, i32 %265, 1
  resume { ptr, i32 } %267
}

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN12TriangleMesh30_getMeshVertexIntersectionAABBESt6vectorIN5vmath4vec3ESaIS2_EES4_d(ptr dead_on_unwind noalias writable sret(%class.AABB) align 8, ptr noundef nonnull align 8 dereferenceable(232), ptr noundef, ptr noundef, double noundef) #4 align 2

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

declare noundef zeroext i1 @_ZN4AABB13isPointInsideEN5vmath4vec3E(ptr noundef nonnull align 8 dereferenceable(40), ptr noundef) #5

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

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

; Function Attrs: nounwind
declare void @_ZN4AABBD1Ev(ptr noundef nonnull align 8 dereferenceable(40)) unnamed_addr #3

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

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

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

attributes #0 = { 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 #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { 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 #4 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { nounwind }

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"double", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"int", !7, i64 0}
!13 = !{i64 0, i64 4, !14, i64 4, i64 4, !14, i64 8, i64 4, !14}
!14 = !{!15, !15, i64 0}
!15 = !{!"float", !7, i64 0}
!16 = distinct !{!16, !17}
!17 = !{!"llvm.loop.mustprogress"}
!18 = distinct !{!18, !17}
!19 = !{i64 0, i64 4, !14, i64 4, i64 4, !14, i64 8, i64 4, !14, i64 16, i64 8, !9, i64 24, i64 8, !9, i64 32, i64 8, !9}
!20 = distinct !{!20, !17}
!21 = !{!22, !12, i64 0}
!22 = !{!"_ZTSSt4pairIiiE", !12, i64 0, !12, i64 4}
!23 = !{!22, !12, i64 4}
!24 = distinct !{!24, !17}
!25 = !{i64 0, i64 12, !26}
!26 = !{!7, !7, i64 0}
!27 = distinct !{!27, !17}


; 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.AABB = type { %"class.vmath::vec3", double, double, double }
%"class.vmath::vec3" = type { float, float, float }
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<vmath::vec3, std::allocator<vmath::vec3>>::_Vector_impl" }
%"struct.std::_Vector_base<vmath::vec3, std::allocator<vmath::vec3>>::_Vector_impl" = type { %"struct.std::_Vector_base<vmath::vec3, std::allocator<vmath::vec3>>::_Vector_impl_data" }
%"struct.std::_Vector_base<vmath::vec3, std::allocator<vmath::vec3>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::vector.15" = type { %"struct.std::_Vector_base.16" }
%"struct.std::_Vector_base.16" = 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.std::vector.36" = type { %"struct.std::_Vector_base.37" }
%"struct.std::_Vector_base.37" = type { %"struct.std::_Vector_base<std::pair<int, int>, std::allocator<std::pair<int, int>>>::_Vector_impl" }
%"struct.std::_Vector_base<std::pair<int, int>, std::allocator<std::pair<int, int>>>::_Vector_impl" = type { %"struct.std::_Vector_base<std::pair<int, int>, std::allocator<std::pair<int, int>>>::_Vector_impl_data" }
%"struct.std::_Vector_base<std::pair<int, int>, std::allocator<std::pair<int, int>>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%struct.Triangle = type { [3 x i32] }

declare i32 @__gxx_personality_v0(...)

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

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

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

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

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

; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #2

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

; Function Attrs: nounwind
declare void @_ZN5vmath4vec3D1Ev(ptr noundef nonnull align 4 dereferenceable(12)) unnamed_addr #3

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN8TriangleC2Ev(ptr noundef nonnull align 4 dereferenceable(12)) unnamed_addr #0 align 2

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

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

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

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

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

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

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN12TriangleMesh4joinERS_d(ptr noundef nonnull align 8 dereferenceable(232) %0, ptr noundef nonnull align 8 dereferenceable(232) %1, double noundef %2) local_unnamed_addr #4 align 2 personality ptr @__gxx_personality_v0 {
  %4 = alloca %class.AABB, align 8
  %5 = alloca %"class.std::vector", align 8
  %6 = alloca %"class.std::vector", align 8
  %7 = alloca %"class.std::vector.15", align 8
  %8 = alloca %"class.vmath::vec3", align 4
  %9 = alloca i32, align 4
  %10 = alloca %"class.std::vector.15", align 8
  %11 = alloca %"class.vmath::vec3", align 4
  %12 = alloca i32, align 4
  %13 = alloca %"class.std::vector.36", align 8
  %14 = alloca %class.AABB, align 8
  %15 = alloca %"class.std::vector.15", align 8
  %16 = alloca i32, align 4
  %17 = alloca %struct.Triangle, align 4
  %18 = tail call noundef i64 @_ZNKSt6vectorIN5vmath4vec3ESaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %1) #6
  %19 = icmp eq i64 %18, 0
  br i1 %19, label %128, label %20

20:                                               ; preds = %3
  %21 = tail call noundef i64 @_ZNKSt6vectorIN5vmath4vec3ESaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %0) #6
  %22 = icmp eq i64 %21, 0
  br i1 %22, label %23, label %24

23:                                               ; preds = %20
  tail call void @_ZN12TriangleMesh6appendERS_(ptr noundef nonnull align 8 dereferenceable(232) %0, ptr noundef nonnull align 8 dereferenceable(232) %1)
  br label %128

24:                                               ; preds = %20
  call void @llvm.lifetime.start.p0(i64 40, ptr nonnull %4) #6
  call void @_ZNSt6vectorIN5vmath4vec3ESaIS1_EEC2ERKS3_(ptr noundef nonnull align 8 dereferenceable(24) %5, ptr noundef nonnull align 8 dereferenceable(24) %0)
  invoke void @_ZNSt6vectorIN5vmath4vec3ESaIS1_EEC2ERKS3_(ptr noundef nonnull align 8 dereferenceable(24) %6, ptr noundef nonnull align 8 dereferenceable(24) %1)
          to label %25 unwind label %33

25:                                               ; preds = %24
  invoke void @_ZN12TriangleMesh30_getMeshVertexIntersectionAABBESt6vectorIN5vmath4vec3ESaIS2_EES4_d(ptr dead_on_unwind nonnull writable sret(%class.AABB) align 8 %4, ptr noundef nonnull align 8 dereferenceable(232) %0, ptr noundef nonnull %5, ptr noundef nonnull %6, double noundef %2)
          to label %26 unwind label %35

26:                                               ; preds = %25
  call void @_ZNSt6vectorIN5vmath4vec3ESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %6) #6
  call void @_ZNSt6vectorIN5vmath4vec3ESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %5) #6
  %27 = call noundef i64 @_ZNKSt6vectorIN5vmath4vec3ESaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %0) #6
  %28 = trunc i64 %27 to i32
  invoke void @_ZN12TriangleMesh6appendERS_(ptr noundef nonnull align 8 dereferenceable(232) %0, ptr noundef nonnull align 8 dereferenceable(232) %1)
          to label %29 unwind label %38

29:                                               ; preds = %26
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %7) #6
  call void @_ZNSt6vectorIiSaIiEEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %7) #6
  %.not = icmp eq i32 %28, 0
  br i1 %.not, label %._crit_edge, label %.lr.ph.preheader

.lr.ph.preheader:                                 ; preds = %29
  %wide.trip.count = and i64 %27, 4294967295
  br label %.lr.ph

._crit_edge:                                      ; preds = %50, %29
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %10) #6
  call void @_ZNSt6vectorIiSaIiEEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %10) #6
  %30 = and i64 %27, 4294967295
  %31 = call noundef i64 @_ZNKSt6vectorIN5vmath4vec3ESaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %0) #6
  %32 = icmp ugt i64 %31, %30
  br i1 %32, label %.lr.ph67, label %._crit_edge68

33:                                               ; preds = %24
  %34 = landingpad { ptr, i32 }
          cleanup
  br label %37

35:                                               ; preds = %25
  %36 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt6vectorIN5vmath4vec3ESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %6) #6
  br label %37

37:                                               ; preds = %35, %33
  %.pn = phi { ptr, i32 } [ %36, %35 ], [ %34, %33 ]
  call void @_ZNSt6vectorIN5vmath4vec3ESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %5) #6
  br label %134

38:                                               ; preds = %26
  %39 = landingpad { ptr, i32 }
          cleanup
  br label %133

.lr.ph:                                           ; preds = %.lr.ph.preheader, %50
  %indvars.iv = phi i64 [ 0, %.lr.ph.preheader ], [ %indvars.iv.next, %50 ]
  %40 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt6vectorIN5vmath4vec3ESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %0, i64 noundef %indvars.iv) #6
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(12) %8, ptr noundef nonnull align 4 dereferenceable(12) %40, i64 12, i1 false), !tbaa.struct !5
  %41 = invoke noundef zeroext i1 @_ZN4AABB13isPointInsideEN5vmath4vec3E(ptr noundef nonnull align 8 dereferenceable(40) %4, ptr noundef nonnull %8)
          to label %42 unwind label %46

42:                                               ; preds = %.lr.ph
  call void @_ZN5vmath4vec3D1Ev(ptr noundef nonnull align 4 dereferenceable(12) %8) #6
  br i1 %41, label %43, label %50

43:                                               ; preds = %42
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %9) #6
  %44 = trunc nuw i64 %indvars.iv to i32
  store i32 %44, ptr %9, align 4, !tbaa !10
  invoke void @_ZNSt6vectorIiSaIiEE9push_backEOi(ptr noundef nonnull align 8 dereferenceable(24) %7, ptr noundef nonnull align 4 dereferenceable(4) %9)
          to label %45 unwind label %48

45:                                               ; preds = %43
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %9) #6
  br label %50

46:                                               ; preds = %.lr.ph
  %47 = landingpad { ptr, i32 }
          cleanup
  call void @_ZN5vmath4vec3D1Ev(ptr noundef nonnull align 4 dereferenceable(12) %8) #6
  br label %132

48:                                               ; preds = %43
  %49 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %9) #6
  br label %132

50:                                               ; preds = %42, %45
  %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 %._crit_edge, label %.lr.ph, !llvm.loop !12

._crit_edge68:                                    ; preds = %61, %._crit_edge
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %13) #6
  call void @_ZNSt6vectorISt4pairIiiESaIS1_EEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %13) #6
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(40) %14, ptr noundef nonnull align 8 dereferenceable(40) %4, i64 40, i1 false), !tbaa.struct !14
  invoke void @_ZN12TriangleMesh25_findDuplicateVertexPairsERSt6vectorIiSaIiEES3_4AABBdRS0_ISt4pairIiiESaIS6_EE(ptr noundef nonnull align 8 dereferenceable(232) %0, ptr noundef nonnull align 8 dereferenceable(24) %7, ptr noundef nonnull align 8 dereferenceable(24) %10, ptr noundef nonnull %14, double noundef %2, ptr noundef nonnull align 8 dereferenceable(24) %13)
          to label %66 unwind label %70

.lr.ph67:                                         ; preds = %._crit_edge, %61
  %51 = phi i64 [ %63, %61 ], [ %30, %._crit_edge ]
  %.03165 = phi i32 [ %62, %61 ], [ %28, %._crit_edge ]
  %52 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt6vectorIN5vmath4vec3ESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %0, i64 noundef %51) #6
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(12) %11, ptr noundef nonnull align 4 dereferenceable(12) %52, i64 12, i1 false), !tbaa.struct !5
  %53 = invoke noundef zeroext i1 @_ZN4AABB13isPointInsideEN5vmath4vec3E(ptr noundef nonnull align 8 dereferenceable(40) %4, ptr noundef nonnull %11)
          to label %54 unwind label %57

54:                                               ; preds = %.lr.ph67
  call void @_ZN5vmath4vec3D1Ev(ptr noundef nonnull align 4 dereferenceable(12) %11) #6
  br i1 %53, label %55, label %61

55:                                               ; preds = %54
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %12) #6
  store i32 %.03165, ptr %12, align 4, !tbaa !10
  invoke void @_ZNSt6vectorIiSaIiEE9push_backEOi(ptr noundef nonnull align 8 dereferenceable(24) %10, ptr noundef nonnull align 4 dereferenceable(4) %12)
          to label %56 unwind label %59

56:                                               ; preds = %55
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %12) #6
  br label %61

57:                                               ; preds = %.lr.ph67
  %58 = landingpad { ptr, i32 }
          cleanup
  call void @_ZN5vmath4vec3D1Ev(ptr noundef nonnull align 4 dereferenceable(12) %11) #6
  br label %131

59:                                               ; preds = %55
  %60 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %12) #6
  br label %131

61:                                               ; preds = %54, %56
  %62 = add i32 %.03165, 1
  %63 = zext i32 %62 to i64
  %64 = call noundef i64 @_ZNKSt6vectorIN5vmath4vec3ESaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %0) #6
  %65 = icmp ugt i64 %64, %63
  br i1 %65, label %.lr.ph67, label %._crit_edge68, !llvm.loop !17

66:                                               ; preds = %._crit_edge68
  call void @_ZN4AABBD1Ev(ptr noundef nonnull align 8 dereferenceable(40) %14) #6
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %15) #6
  call void @_ZNSt6vectorIiSaIiEEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %15) #6
  %67 = call noundef i64 @_ZNKSt6vectorIN5vmath4vec3ESaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %0) #6
  invoke void @_ZNSt6vectorIiSaIiEE7reserveEm(ptr noundef nonnull align 8 dereferenceable(24) %15, i64 noundef %67)
          to label %.preheader63 unwind label %72

.preheader63:                                     ; preds = %66
  %68 = call noundef i64 @_ZNKSt6vectorIN5vmath4vec3ESaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %0) #6
  %.not78 = icmp eq i64 %68, 0
  br i1 %.not78, label %.preheader, label %.lr.ph70

.preheader:                                       ; preds = %74, %.preheader63
  %69 = call noundef i64 @_ZNKSt6vectorISt4pairIiiESaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %13) #6
  %.not79 = icmp eq i64 %69, 0
  br i1 %.not79, label %._crit_edge73, label %.lr.ph72

70:                                               ; preds = %._crit_edge68
  %71 = landingpad { ptr, i32 }
          cleanup
  call void @_ZN4AABBD1Ev(ptr noundef nonnull align 8 dereferenceable(40) %14) #6
  br label %130

72:                                               ; preds = %66
  %73 = landingpad { ptr, i32 }
          cleanup
  br label %129

.lr.ph70:                                         ; preds = %.preheader63, %74
  %.03069 = phi i32 [ %75, %74 ], [ 0, %.preheader63 ]
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %16) #6
  store i32 %.03069, ptr %16, align 4, !tbaa !10
  invoke void @_ZNSt6vectorIiSaIiEE9push_backEOi(ptr noundef nonnull align 8 dereferenceable(24) %15, ptr noundef nonnull align 4 dereferenceable(4) %16)
          to label %74 unwind label %79

74:                                               ; preds = %.lr.ph70
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %16) #6
  %75 = add i32 %.03069, 1
  %76 = zext i32 %75 to i64
  %77 = call noundef i64 @_ZNKSt6vectorIN5vmath4vec3ESaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %0) #6
  %78 = icmp ugt i64 %77, %76
  br i1 %78, label %.lr.ph70, label %.preheader, !llvm.loop !18

79:                                               ; preds = %.lr.ph70
  %80 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %16) #6
  br label %129

._crit_edge73:                                    ; preds = %.lr.ph72, %.preheader
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %17) #6
  call void @_ZN8TriangleC2Ev(ptr noundef nonnull align 4 dereferenceable(12) %17)
  %81 = getelementptr inbounds i8, ptr %0, i64 72
  %82 = call noundef i64 @_ZNKSt6vectorI8TriangleSaIS0_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %81) #6
  %.not80 = icmp eq i64 %82, 0
  br i1 %.not80, label %._crit_edge77, label %.lr.ph76

.lr.ph76:                                         ; preds = %._crit_edge73
  %83 = getelementptr inbounds i8, ptr %17, i64 4
  %84 = getelementptr inbounds i8, ptr %17, i64 8
  br label %99

.lr.ph72:                                         ; preds = %.preheader, %.lr.ph72
  %85 = phi i64 [ %94, %.lr.ph72 ], [ 0, %.preheader ]
  %.02971 = phi i32 [ %93, %.lr.ph72 ], [ 0, %.preheader ]
  %86 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt6vectorISt4pairIiiESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %13, i64 noundef %85) #6
  %87 = load i32, ptr %86, align 4, !tbaa !19
  %88 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt6vectorISt4pairIiiESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %13, i64 noundef %85) #6
  %89 = getelementptr inbounds i8, ptr %88, i64 4
  %90 = load i32, ptr %89, align 4, !tbaa !21
  %91 = sext i32 %90 to i64
  %92 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %15, i64 noundef %91) #6
  store i32 %87, ptr %92, align 4, !tbaa !10
  %93 = add i32 %.02971, 1
  %94 = zext i32 %93 to i64
  %95 = call noundef i64 @_ZNKSt6vectorISt4pairIiiESaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %13) #6
  %96 = icmp ugt i64 %95, %94
  br i1 %96, label %.lr.ph72, label %._crit_edge73, !llvm.loop !22

._crit_edge77:                                    ; preds = %122, %._crit_edge73
  invoke void @_ZN12TriangleMesh24removeExtraneousVerticesEv(ptr noundef nonnull align 8 dereferenceable(232) %0)
          to label %127 unwind label %97

97:                                               ; preds = %._crit_edge77
  %98 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %17) #6
  br label %129

99:                                               ; preds = %.lr.ph76, %122
  %100 = phi i64 [ 0, %.lr.ph76 ], [ %124, %122 ]
  %.074 = phi i32 [ 0, %.lr.ph76 ], [ %123, %122 ]
  %101 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt6vectorI8TriangleSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %81, i64 noundef %100) #6
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(12) %17, ptr noundef nonnull align 4 dereferenceable(12) %101, i64 12, i1 false), !tbaa.struct !23
  %102 = load i32, ptr %17, align 4, !tbaa !10
  %103 = sext i32 %102 to i64
  %104 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %15, i64 noundef %103) #6
  %105 = load i32, ptr %104, align 4, !tbaa !10
  store i32 %105, ptr %17, align 4, !tbaa !10
  %106 = load i32, ptr %83, align 4, !tbaa !10
  %107 = sext i32 %106 to i64
  %108 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %15, i64 noundef %107) #6
  %109 = load i32, ptr %108, align 4, !tbaa !10
  store i32 %109, ptr %83, align 4, !tbaa !10
  %110 = load i32, ptr %84, align 4, !tbaa !10
  %111 = sext i32 %110 to i64
  %112 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %15, i64 noundef %111) #6
  %113 = load i32, ptr %112, align 4, !tbaa !10
  store i32 %113, ptr %84, align 4, !tbaa !10
  %114 = load i32, ptr %17, align 4, !tbaa !10
  %115 = load i32, ptr %83, align 4, !tbaa !10
  %116 = icmp eq i32 %114, %115
  %117 = icmp eq i32 %115, %113
  %118 = icmp eq i32 %113, %114
  %119 = or i1 %118, %117
  %or.cond62 = select i1 %116, i1 true, i1 %119
  br i1 %or.cond62, label %122, label %120

120:                                              ; preds = %99
  %121 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt6vectorI8TriangleSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %81, i64 noundef %100) #6
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(12) %121, ptr noundef nonnull align 4 dereferenceable(12) %17, i64 12, i1 false), !tbaa.struct !23
  br label %122

122:                                              ; preds = %99, %120
  %123 = add i32 %.074, 1
  %124 = zext i32 %123 to i64
  %125 = call noundef i64 @_ZNKSt6vectorI8TriangleSaIS0_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %81) #6
  %126 = icmp ugt i64 %125, %124
  br i1 %126, label %99, label %._crit_edge77, !llvm.loop !25

127:                                              ; preds = %._crit_edge77
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %17) #6
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %15) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %15) #6
  call void @_ZNSt6vectorISt4pairIiiESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %13) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %13) #6
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %10) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %10) #6
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %7) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %7) #6
  call void @_ZN4AABBD1Ev(ptr noundef nonnull align 8 dereferenceable(40) %4) #6
  call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %4) #6
  br label %128

128:                                              ; preds = %3, %127, %23
  ret void

129:                                              ; preds = %97, %79, %72
  %.pn51 = phi { ptr, i32 } [ %80, %79 ], [ %98, %97 ], [ %73, %72 ]
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %15) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %15) #6
  br label %130

130:                                              ; preds = %129, %70
  %.pn51.pn = phi { ptr, i32 } [ %.pn51, %129 ], [ %71, %70 ]
  call void @_ZNSt6vectorISt4pairIiiESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %13) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %13) #6
  br label %131

131:                                              ; preds = %57, %59, %130
  %.pn54.pn = phi { ptr, i32 } [ %.pn51.pn, %130 ], [ %60, %59 ], [ %58, %57 ]
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %10) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %10) #6
  br label %132

132:                                              ; preds = %46, %48, %131
  %.pn57.pn = phi { ptr, i32 } [ %.pn54.pn, %131 ], [ %49, %48 ], [ %47, %46 ]
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %7) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %7) #6
  br label %133

133:                                              ; preds = %132, %38
  %.pn57.pn.pn = phi { ptr, i32 } [ %.pn57.pn, %132 ], [ %39, %38 ]
  call void @_ZN4AABBD1Ev(ptr noundef nonnull align 8 dereferenceable(40) %4) #6
  br label %134

134:                                              ; preds = %133, %37
  %.pn57.pn.pn.pn = phi { ptr, i32 } [ %.pn57.pn.pn, %133 ], [ %.pn, %37 ]
  call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %4) #6
  resume { ptr, i32 } %.pn57.pn.pn.pn
}

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN12TriangleMesh30_getMeshVertexIntersectionAABBESt6vectorIN5vmath4vec3ESaIS2_EES4_d(ptr dead_on_unwind noalias writable sret(%class.AABB) align 8, ptr noundef nonnull align 8 dereferenceable(232), ptr noundef, ptr noundef, double noundef) local_unnamed_addr #4 align 2

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

declare noundef zeroext i1 @_ZN4AABB13isPointInsideEN5vmath4vec3E(ptr noundef nonnull align 8 dereferenceable(40), ptr noundef) local_unnamed_addr #5

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

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

; Function Attrs: nounwind
declare void @_ZN4AABBD1Ev(ptr noundef nonnull align 8 dereferenceable(40)) unnamed_addr #3

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

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

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

attributes #0 = { 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 #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { 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 #4 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { nounwind }

!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 = !{i64 0, i64 4, !6, i64 4, i64 4, !6, i64 8, i64 4, !6}
!6 = !{!7, !7, i64 0}
!7 = !{!"float", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!11, !11, i64 0}
!11 = !{!"int", !8, i64 0}
!12 = distinct !{!12, !13}
!13 = !{!"llvm.loop.mustprogress"}
!14 = !{i64 0, i64 4, !6, i64 4, i64 4, !6, i64 8, i64 4, !6, i64 16, i64 8, !15, i64 24, i64 8, !15, i64 32, i64 8, !15}
!15 = !{!16, !16, i64 0}
!16 = !{!"double", !8, i64 0}
!17 = distinct !{!17, !13}
!18 = distinct !{!18, !13}
!19 = !{!20, !11, i64 0}
!20 = !{!"_ZTSSt4pairIiiE", !11, i64 0, !11, i64 4}
!21 = !{!20, !11, i64 4}
!22 = distinct !{!22, !13}
!23 = !{i64 0, i64 12, !24}
!24 = !{!8, !8, i64 0}
!25 = distinct !{!25, !13}


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