; LLVM IR from jasonlmfong/Model-Modifier :: Model-Modifier/src/scene/surface (Surface_CatmullClark)

; Unoptimized IR (clang -disable-llvm-passes):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<glm::vec<3, float>, std::allocator<glm::vec<3, float>>>::_Vector_impl" }
%"struct.std::_Vector_base<glm::vec<3, float>, std::allocator<glm::vec<3, float>>>::_Vector_impl" = type { %"struct.std::_Vector_base<glm::vec<3, float>, std::allocator<glm::vec<3, float>>>::_Vector_impl_data" }
%"struct.std::_Vector_base<glm::vec<3, float>, std::allocator<glm::vec<3, float>>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::allocator" = type { i8 }
%struct.EdgeRecord = type { i32, i32, %"struct.glm::vec", %"class.std::vector.22" }
%"struct.glm::vec" = type { %union.anon, %union.anon.15, %union.anon.16 }
%union.anon = type { float }
%union.anon.15 = type { float }
%union.anon.16 = type { float }
%"class.std::vector.22" = type { %"struct.std::_Vector_base.23" }
%"struct.std::_Vector_base.23" = type { %"struct.std::_Vector_base<unsigned int, std::allocator<unsigned int>>::_Vector_impl" }
%"struct.std::_Vector_base<unsigned int, std::allocator<unsigned int>>::_Vector_impl" = type { %"struct.std::_Vector_base<unsigned int, std::allocator<unsigned int>>::_Vector_impl_data" }
%"struct.std::_Vector_base<unsigned int, std::allocator<unsigned int>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%class.Surface = type { %"class.std::vector.0", %"class.std::vector.5", %"class.std::vector.10", %"struct.glm::vec", %"struct.glm::vec", %"class.std::unordered_map" }
%"class.std::vector.0" = type { %"struct.std::_Vector_base.1" }
%"struct.std::_Vector_base.1" = type { %"struct.std::_Vector_base<VertexRecord, std::allocator<VertexRecord>>::_Vector_impl" }
%"struct.std::_Vector_base<VertexRecord, std::allocator<VertexRecord>>::_Vector_impl" = type { %"struct.std::_Vector_base<VertexRecord, std::allocator<VertexRecord>>::_Vector_impl_data" }
%"struct.std::_Vector_base<VertexRecord, std::allocator<VertexRecord>>::_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<EdgeRecord, std::allocator<EdgeRecord>>::_Vector_impl" }
%"struct.std::_Vector_base<EdgeRecord, std::allocator<EdgeRecord>>::_Vector_impl" = type { %"struct.std::_Vector_base<EdgeRecord, std::allocator<EdgeRecord>>::_Vector_impl_data" }
%"struct.std::_Vector_base<EdgeRecord, std::allocator<EdgeRecord>>::_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<FaceRecord, std::allocator<FaceRecord>>::_Vector_impl" }
%"struct.std::_Vector_base<FaceRecord, std::allocator<FaceRecord>>::_Vector_impl" = type { %"struct.std::_Vector_base<FaceRecord, std::allocator<FaceRecord>>::_Vector_impl_data" }
%"struct.std::_Vector_base<FaceRecord, std::allocator<FaceRecord>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::unordered_map" = type { %"class.std::_Hashtable" }
%"class.std::_Hashtable" = type { ptr, i64, %"struct.std::__detail::_Hash_node_base", i64, %"struct.std::__detail::_Prime_rehash_policy", ptr }
%"struct.std::__detail::_Hash_node_base" = type { ptr }
%"struct.std::__detail::_Prime_rehash_policy" = type { float, i64 }
%struct.FaceRecord = type { %"struct.glm::vec", %"class.std::vector.22", %"class.std::unordered_map.27", %"class.std::vector.22" }
%"class.std::unordered_map.27" = type { %"class.std::_Hashtable.28" }
%"class.std::_Hashtable.28" = type { ptr, i64, %"struct.std::__detail::_Hash_node_base", i64, %"struct.std::__detail::_Prime_rehash_policy", ptr }

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN7Surface21CatmulClarkEdgePointsEv(ptr dead_on_unwind noalias writable sret(%"class.std::vector") align 8 %0, ptr noundef nonnull align 8 dereferenceable(152) %1) #0 align 2 personality ptr @__gxx_personality_v0 {
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca i32, align 4
  %6 = alloca i1, align 1
  %7 = alloca %"class.std::allocator", align 1
  %8 = alloca ptr, align 8
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca %struct.EdgeRecord, align 8
  %12 = alloca %"struct.glm::vec", align 4
  %13 = alloca %"struct.glm::vec", align 4
  %14 = alloca { <2 x float>, float }, align 8
  %15 = alloca %"struct.glm::vec", align 4
  %16 = alloca %"struct.glm::vec", align 4
  %17 = alloca { <2 x float>, float }, align 8
  %18 = alloca { <2 x float>, float }, align 8
  %19 = alloca { <2 x float>, float }, align 8
  store ptr %0, ptr %3, align 8
  store ptr %1, ptr %4, align 8, !tbaa !5
  %20 = load ptr, ptr %4, align 8
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #7
  %21 = getelementptr inbounds %class.Surface, ptr %20, i32 0, i32 1
  %22 = call noundef i64 @_ZNKSt6vectorI10EdgeRecordSaIS0_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %21) #7
  %23 = trunc i64 %22 to i32
  store i32 %23, ptr %5, align 4, !tbaa !9
  store i1 false, ptr %6, align 1
  %24 = load i32, ptr %5, align 4, !tbaa !9
  %25 = zext i32 %24 to i64
  call void @llvm.lifetime.start.p0(i64 1, ptr %7) #7
  call void @_ZNSaIN3glm3vecILi3EfLNS_9qualifierE0EEEEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %7) #7
  invoke void @_ZNSt6vectorIN3glm3vecILi3EfLNS0_9qualifierE0EEESaIS3_EEC2EmRKS4_(ptr noundef nonnull align 8 dereferenceable(24) %0, i64 noundef %25, ptr noundef nonnull align 1 dereferenceable(1) %7)
          to label %26 unwind label %32

26:                                               ; preds = %2
  call void @_ZNSt15__new_allocatorIN3glm3vecILi3EfLNS0_9qualifierE0EEEED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %7) #7
  call void @llvm.lifetime.end.p0(i64 1, ptr %7) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #7
  store i32 0, ptr %10, align 4, !tbaa !9
  br label %27

27:                                               ; preds = %91, %26
  %28 = load i32, ptr %10, align 4, !tbaa !9
  %29 = load i32, ptr %5, align 4, !tbaa !9
  %30 = icmp ult i32 %28, %29
  br i1 %30, label %36, label %31

31:                                               ; preds = %27
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #7
  br label %95

32:                                               ; preds = %2
  %33 = landingpad { ptr, i32 }
          cleanup
  %34 = extractvalue { ptr, i32 } %33, 0
  store ptr %34, ptr %8, align 8
  %35 = extractvalue { ptr, i32 } %33, 1
  store i32 %35, ptr %9, align 4
  call void @_ZNSt15__new_allocatorIN3glm3vecILi3EfLNS0_9qualifierE0EEEED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %7) #7
  call void @llvm.lifetime.end.p0(i64 1, ptr %7) #7
  br label %99

36:                                               ; preds = %27
  call void @llvm.lifetime.start.p0(i64 48, ptr %11) #7
  %37 = getelementptr inbounds %class.Surface, ptr %20, i32 0, i32 1
  %38 = load i32, ptr %10, align 4, !tbaa !9
  %39 = zext i32 %38 to i64
  %40 = call noundef nonnull align 8 dereferenceable(48) ptr @_ZNSt6vectorI10EdgeRecordSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %37, i64 noundef %39) #7
  invoke void @_ZN10EdgeRecordC2ERKS_(ptr noundef nonnull align 8 dereferenceable(48) %11, ptr noundef nonnull align 8 dereferenceable(48) %40)
          to label %41 unwind label %50

41:                                               ; preds = %36
  %42 = getelementptr inbounds %struct.EdgeRecord, ptr %11, i32 0, i32 3
  %43 = call noundef i64 @_ZNKSt6vectorIjSaIjEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %42) #7
  %44 = icmp eq i64 %43, 1
  br i1 %44, label %45, label %54

45:                                               ; preds = %41
  %46 = getelementptr inbounds %struct.EdgeRecord, ptr %11, i32 0, i32 2
  %47 = load i32, ptr %10, align 4, !tbaa !9
  %48 = zext i32 %47 to i64
  %49 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt6vectorIN3glm3vecILi3EfLNS0_9qualifierE0EEESaIS3_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %0, i64 noundef %48) #7
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %49, ptr align 8 %46, i64 12, i1 false), !tbaa.struct !11
  br label %90

50:                                               ; preds = %36
  %51 = landingpad { ptr, i32 }
          cleanup
  %52 = extractvalue { ptr, i32 } %51, 0
  store ptr %52, ptr %8, align 8
  %53 = extractvalue { ptr, i32 } %51, 1
  store i32 %53, ptr %9, align 4
  br label %94

54:                                               ; preds = %41
  call void @llvm.lifetime.start.p0(i64 12, ptr %12) #7
  call void @llvm.lifetime.start.p0(i64 12, ptr %13) #7
  %55 = getelementptr inbounds %struct.EdgeRecord, ptr %11, i32 0, i32 2
  %56 = invoke { <2 x float>, float } @_ZN3glmmlIfLNS_9qualifierE0EEENS_3vecILi3ET_XT0_EEES3_RKS4_(float noundef 5.000000e-01, ptr noundef nonnull align 4 dereferenceable(12) %55)
          to label %57 unwind label %81

57:                                               ; preds = %54
  store { <2 x float>, float } %56, ptr %14, align 8
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %13, ptr align 8 %14, i64 12, i1 false)
  call void @llvm.lifetime.start.p0(i64 12, ptr %15) #7
  call void @llvm.lifetime.start.p0(i64 12, ptr %16) #7
  %58 = getelementptr inbounds %class.Surface, ptr %20, i32 0, i32 2
  %59 = getelementptr inbounds %struct.EdgeRecord, ptr %11, i32 0, i32 3
  %60 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIjSaIjEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %59, i64 noundef 0) #7
  %61 = load i32, ptr %60, align 4, !tbaa !9
  %62 = zext i32 %61 to i64
  %63 = call noundef nonnull align 8 dereferenceable(120) ptr @_ZNSt6vectorI10FaceRecordSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %58, i64 noundef %62) #7
  %64 = getelementptr inbounds %struct.FaceRecord, ptr %63, i32 0, i32 0
  %65 = getelementptr inbounds %class.Surface, ptr %20, i32 0, i32 2
  %66 = getelementptr inbounds %struct.EdgeRecord, ptr %11, i32 0, i32 3
  %67 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIjSaIjEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %66, i64 noundef 1) #7
  %68 = load i32, ptr %67, align 4, !tbaa !9
  %69 = zext i32 %68 to i64
  %70 = call noundef nonnull align 8 dereferenceable(120) ptr @_ZNSt6vectorI10FaceRecordSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %65, i64 noundef %69) #7
  %71 = getelementptr inbounds %struct.FaceRecord, ptr %70, i32 0, i32 0
  %72 = invoke { <2 x float>, float } @_ZN3glmplIfLNS_9qualifierE0EEENS_3vecILi3ET_XT0_EEERKS4_S6_(ptr noundef nonnull align 4 dereferenceable(12) %64, ptr noundef nonnull align 4 dereferenceable(12) %71)
          to label %73 unwind label %85

73:                                               ; preds = %57
  store { <2 x float>, float } %72, ptr %17, align 8
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %16, ptr align 8 %17, i64 12, i1 false)
  %74 = invoke { <2 x float>, float } @_ZN3glmmlIfLNS_9qualifierE0EEENS_3vecILi3ET_XT0_EEES3_RKS4_(float noundef 2.500000e-01, ptr noundef nonnull align 4 dereferenceable(12) %16)
          to label %75 unwind label %85

75:                                               ; preds = %73
  store { <2 x float>, float } %74, ptr %18, align 8
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %15, ptr align 8 %18, i64 12, i1 false)
  %76 = invoke { <2 x float>, float } @_ZN3glmplIfLNS_9qualifierE0EEENS_3vecILi3ET_XT0_EEERKS4_S6_(ptr noundef nonnull align 4 dereferenceable(12) %13, ptr noundef nonnull align 4 dereferenceable(12) %15)
          to label %77 unwind label %85

77:                                               ; preds = %75
  store { <2 x float>, float } %76, ptr %19, align 8
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %12, ptr align 8 %19, i64 12, i1 false)
  %78 = load i32, ptr %10, align 4, !tbaa !9
  %79 = zext i32 %78 to i64
  %80 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt6vectorIN3glm3vecILi3EfLNS0_9qualifierE0EEESaIS3_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %0, i64 noundef %79) #7
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %80, ptr align 4 %12, i64 12, i1 false), !tbaa.struct !11
  call void @llvm.lifetime.end.p0(i64 12, ptr %16) #7
  call void @llvm.lifetime.end.p0(i64 12, ptr %15) #7
  call void @llvm.lifetime.end.p0(i64 12, ptr %13) #7
  call void @llvm.lifetime.end.p0(i64 12, ptr %12) #7
  br label %90

81:                                               ; preds = %54
  %82 = landingpad { ptr, i32 }
          cleanup
  %83 = extractvalue { ptr, i32 } %82, 0
  store ptr %83, ptr %8, align 8
  %84 = extractvalue { ptr, i32 } %82, 1
  store i32 %84, ptr %9, align 4
  br label %89

85:                                               ; preds = %75, %73, %57
  %86 = landingpad { ptr, i32 }
          cleanup
  %87 = extractvalue { ptr, i32 } %86, 0
  store ptr %87, ptr %8, align 8
  %88 = extractvalue { ptr, i32 } %86, 1
  store i32 %88, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 12, ptr %16) #7
  call void @llvm.lifetime.end.p0(i64 12, ptr %15) #7
  br label %89

89:                                               ; preds = %85, %81
  call void @llvm.lifetime.end.p0(i64 12, ptr %13) #7
  call void @llvm.lifetime.end.p0(i64 12, ptr %12) #7
  call void @_ZN10EdgeRecordD2Ev(ptr noundef nonnull align 8 dereferenceable(48) %11) #7
  br label %94

90:                                               ; preds = %77, %45
  call void @_ZN10EdgeRecordD2Ev(ptr noundef nonnull align 8 dereferenceable(48) %11) #7
  call void @llvm.lifetime.end.p0(i64 48, ptr %11) #7
  br label %91

91:                                               ; preds = %90
  %92 = load i32, ptr %10, align 4, !tbaa !9
  %93 = add i32 %92, 1
  store i32 %93, ptr %10, align 4, !tbaa !9
  br label %27, !llvm.loop !13

94:                                               ; preds = %89, %50
  call void @llvm.lifetime.end.p0(i64 48, ptr %11) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #7
  call void @_ZNSt6vectorIN3glm3vecILi3EfLNS0_9qualifierE0EEESaIS3_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %0) #7
  br label %99

95:                                               ; preds = %31
  store i1 true, ptr %6, align 1
  %96 = load i1, ptr %6, align 1
  br i1 %96, label %98, label %97

97:                                               ; preds = %95
  call void @_ZNSt6vectorIN3glm3vecILi3EfLNS0_9qualifierE0EEESaIS3_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %0) #7
  br label %98

98:                                               ; preds = %97, %95
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #7
  ret void

99:                                               ; preds = %94, %32
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #7
  br label %100

100:                                              ; preds = %99
  %101 = load ptr, ptr %8, align 8
  %102 = load i32, ptr %9, align 4
  %103 = insertvalue { ptr, i32 } poison, ptr %101, 0
  %104 = insertvalue { ptr, i32 } %103, i32 %102, 1
  resume { ptr, i32 } %104
}

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt6vectorIN3glm3vecILi3EfLNS0_9qualifierE0EEESaIS3_EEC2EmRKS4_(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef, ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #3 align 2

declare i32 @__gxx_personality_v0(...)

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

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

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt6vectorIN3glm3vecILi3EfLNS0_9qualifierE0EEESaIS3_EEixEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) #2 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) #5

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local { <2 x float>, float } @_ZN3glmplIfLNS_9qualifierE0EEENS_3vecILi3ET_XT0_EEERKS4_S6_(ptr noundef nonnull align 4 dereferenceable(12), ptr noundef nonnull align 4 dereferenceable(12)) #4

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local { <2 x float>, float } @_ZN3glmmlIfLNS_9qualifierE0EEENS_3vecILi3ET_XT0_EEES3_RKS4_(float noundef, ptr noundef nonnull align 4 dereferenceable(12)) #4

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

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

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

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

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

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

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

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


; Optimized IR (opt -passes='default<O3>'):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<glm::vec<3, float>, std::allocator<glm::vec<3, float>>>::_Vector_impl" }
%"struct.std::_Vector_base<glm::vec<3, float>, std::allocator<glm::vec<3, float>>>::_Vector_impl" = type { %"struct.std::_Vector_base<glm::vec<3, float>, std::allocator<glm::vec<3, float>>>::_Vector_impl_data" }
%"struct.std::_Vector_base<glm::vec<3, float>, std::allocator<glm::vec<3, float>>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::allocator" = type { i8 }
%struct.EdgeRecord = type { i32, i32, %"struct.glm::vec", %"class.std::vector.22" }
%"struct.glm::vec" = type { %union.anon, %union.anon.15, %union.anon.16 }
%union.anon = type { float }
%union.anon.15 = type { float }
%union.anon.16 = type { float }
%"class.std::vector.22" = type { %"struct.std::_Vector_base.23" }
%"struct.std::_Vector_base.23" = type { %"struct.std::_Vector_base<unsigned int, std::allocator<unsigned int>>::_Vector_impl" }
%"struct.std::_Vector_base<unsigned int, std::allocator<unsigned int>>::_Vector_impl" = type { %"struct.std::_Vector_base<unsigned int, std::allocator<unsigned int>>::_Vector_impl_data" }
%"struct.std::_Vector_base<unsigned int, std::allocator<unsigned int>>::_Vector_impl_data" = type { ptr, ptr, ptr }

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN7Surface21CatmulClarkEdgePointsEv(ptr dead_on_unwind noalias writable sret(%"class.std::vector") align 8 %0, ptr noundef nonnull align 8 dereferenceable(152) %1) local_unnamed_addr #0 align 2 personality ptr @__gxx_personality_v0 {
  %3 = alloca %"class.std::allocator", align 1
  %4 = alloca %struct.EdgeRecord, align 8
  %5 = alloca %"struct.glm::vec", align 8
  %6 = alloca %"struct.glm::vec", align 8
  %7 = alloca %"struct.glm::vec", align 8
  %8 = getelementptr inbounds i8, ptr %1, i64 24
  %9 = tail call noundef i64 @_ZNKSt6vectorI10EdgeRecordSaIS0_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %8) #7
  %10 = and i64 %9, 4294967295
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %3) #7
  call void @_ZNSaIN3glm3vecILi3EfLNS_9qualifierE0EEEEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %3) #7
  invoke void @_ZNSt6vectorIN3glm3vecILi3EfLNS0_9qualifierE0EEESaIS3_EEC2EmRKS4_(ptr noundef nonnull align 8 dereferenceable(24) %0, i64 noundef %10, ptr noundef nonnull align 1 dereferenceable(1) %3)
          to label %11 unwind label %16

11:                                               ; preds = %2
  call void @_ZNSt15__new_allocatorIN3glm3vecILi3EfLNS0_9qualifierE0EEEED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %3) #7
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %3) #7
  %12 = and i64 %9, 4294967295
  %.not = icmp eq i64 %12, 0
  br i1 %.not, label %._crit_edge, label %.lr.ph

.lr.ph:                                           ; preds = %11
  %13 = getelementptr inbounds i8, ptr %4, i64 24
  %14 = getelementptr inbounds i8, ptr %4, i64 8
  %.sroa.212.0..sroa_idx = getelementptr inbounds i8, ptr %5, i64 8
  %15 = getelementptr inbounds i8, ptr %1, i64 48
  %.sroa.28.0..sroa_idx = getelementptr inbounds i8, ptr %7, i64 8
  %.sroa.24.0..sroa_idx = getelementptr inbounds i8, ptr %6, i64 8
  %wide.trip.count = and i64 %9, 4294967295
  br label %18

16:                                               ; preds = %2
  %17 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt15__new_allocatorIN3glm3vecILi3EfLNS0_9qualifierE0EEEED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %3) #7
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %3) #7
  br label %52

18:                                               ; preds = %.lr.ph, %50
  %indvars.iv = phi i64 [ 0, %.lr.ph ], [ %indvars.iv.next, %50 ]
  call void @llvm.lifetime.start.p0(i64 48, ptr nonnull %4) #7
  %19 = call noundef nonnull align 8 dereferenceable(48) ptr @_ZNSt6vectorI10EdgeRecordSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %8, i64 noundef %indvars.iv) #7
  invoke void @_ZN10EdgeRecordC2ERKS_(ptr noundef nonnull align 8 dereferenceable(48) %4, ptr noundef nonnull align 8 dereferenceable(48) %19)
          to label %20 unwind label %25

20:                                               ; preds = %18
  %21 = call noundef i64 @_ZNKSt6vectorIjSaIjEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %13) #7
  %22 = icmp eq i64 %21, 1
  br i1 %22, label %23, label %27

23:                                               ; preds = %20
  %24 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt6vectorIN3glm3vecILi3EfLNS0_9qualifierE0EEESaIS3_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %0, i64 noundef %indvars.iv) #7
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(12) %24, ptr noundef nonnull align 8 dereferenceable(12) %14, i64 12, i1 false), !tbaa.struct !5
  br label %50

25:                                               ; preds = %18
  %26 = landingpad { ptr, i32 }
          cleanup
  br label %51

27:                                               ; preds = %20
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %5) #7
  %28 = invoke { <2 x float>, float } @_ZN3glmmlIfLNS_9qualifierE0EEENS_3vecILi3ET_XT0_EEES3_RKS4_(float noundef 5.000000e-01, ptr noundef nonnull align 4 dereferenceable(12) %14)
          to label %29 unwind label %45

29:                                               ; preds = %27
  %.fca.0.extract9 = extractvalue { <2 x float>, float } %28, 0
  %.fca.1.extract10 = extractvalue { <2 x float>, float } %28, 1
  store <2 x float> %.fca.0.extract9, ptr %5, align 8
  store float %.fca.1.extract10, ptr %.sroa.212.0..sroa_idx, align 8
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %6) #7
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %7) #7
  %30 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIjSaIjEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %13, i64 noundef 0) #7
  %31 = load i32, ptr %30, align 4, !tbaa !9
  %32 = zext i32 %31 to i64
  %33 = call noundef nonnull align 8 dereferenceable(120) ptr @_ZNSt6vectorI10FaceRecordSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %15, i64 noundef %32) #7
  %34 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIjSaIjEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %13, i64 noundef 1) #7
  %35 = load i32, ptr %34, align 4, !tbaa !9
  %36 = zext i32 %35 to i64
  %37 = call noundef nonnull align 8 dereferenceable(120) ptr @_ZNSt6vectorI10FaceRecordSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %15, i64 noundef %36) #7
  %38 = invoke { <2 x float>, float } @_ZN3glmplIfLNS_9qualifierE0EEENS_3vecILi3ET_XT0_EEERKS4_S6_(ptr noundef nonnull align 4 dereferenceable(12) %33, ptr noundef nonnull align 4 dereferenceable(12) %37)
          to label %39 unwind label %47

39:                                               ; preds = %29
  %.fca.0.extract5 = extractvalue { <2 x float>, float } %38, 0
  %.fca.1.extract6 = extractvalue { <2 x float>, float } %38, 1
  store <2 x float> %.fca.0.extract5, ptr %7, align 8
  store float %.fca.1.extract6, ptr %.sroa.28.0..sroa_idx, align 8
  %40 = invoke { <2 x float>, float } @_ZN3glmmlIfLNS_9qualifierE0EEENS_3vecILi3ET_XT0_EEES3_RKS4_(float noundef 2.500000e-01, ptr noundef nonnull align 4 dereferenceable(12) %7)
          to label %41 unwind label %47

41:                                               ; preds = %39
  %.fca.0.extract1 = extractvalue { <2 x float>, float } %40, 0
  %.fca.1.extract2 = extractvalue { <2 x float>, float } %40, 1
  store <2 x float> %.fca.0.extract1, ptr %6, align 8
  store float %.fca.1.extract2, ptr %.sroa.24.0..sroa_idx, align 8
  %42 = invoke { <2 x float>, float } @_ZN3glmplIfLNS_9qualifierE0EEENS_3vecILi3ET_XT0_EEERKS4_S6_(ptr noundef nonnull align 4 dereferenceable(12) %5, ptr noundef nonnull align 4 dereferenceable(12) %6)
          to label %43 unwind label %47

43:                                               ; preds = %41
  %.fca.0.extract = extractvalue { <2 x float>, float } %42, 0
  %.fca.1.extract = extractvalue { <2 x float>, float } %42, 1
  %44 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt6vectorIN3glm3vecILi3EfLNS0_9qualifierE0EEESaIS3_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %0, i64 noundef %indvars.iv) #7
  store <2 x float> %.fca.0.extract, ptr %44, align 4
  %.sroa.5.0..sroa_idx = getelementptr inbounds i8, ptr %44, i64 8
  store float %.fca.1.extract, ptr %.sroa.5.0..sroa_idx, align 4, !tbaa !6
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %7) #7
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %6) #7
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %5) #7
  br label %50

45:                                               ; preds = %27
  %46 = landingpad { ptr, i32 }
          cleanup
  br label %49

47:                                               ; preds = %41, %39, %29
  %48 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %7) #7
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %6) #7
  br label %49

49:                                               ; preds = %47, %45
  %.pn = phi { ptr, i32 } [ %48, %47 ], [ %46, %45 ]
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %5) #7
  call void @_ZN10EdgeRecordD2Ev(ptr noundef nonnull align 8 dereferenceable(48) %4) #7
  br label %51

50:                                               ; preds = %43, %23
  call void @_ZN10EdgeRecordD2Ev(ptr noundef nonnull align 8 dereferenceable(48) %4) #7
  call void @llvm.lifetime.end.p0(i64 48, ptr nonnull %4) #7
  %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 %18, !llvm.loop !11

51:                                               ; preds = %49, %25
  %.pn.pn = phi { ptr, i32 } [ %.pn, %49 ], [ %26, %25 ]
  call void @llvm.lifetime.end.p0(i64 48, ptr nonnull %4) #7
  call void @_ZNSt6vectorIN3glm3vecILi3EfLNS0_9qualifierE0EEESaIS3_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %0) #7
  br label %52

._crit_edge:                                      ; preds = %50, %11
  ret void

52:                                               ; preds = %51, %16
  %.pn.pn.pn = phi { ptr, i32 } [ %.pn.pn, %51 ], [ %17, %16 ]
  resume { ptr, i32 } %.pn.pn.pn
}

; 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 nounwind uwtable
declare dso_local noundef i64 @_ZNKSt6vectorI10EdgeRecordSaIS0_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #2 align 2

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt6vectorIN3glm3vecILi3EfLNS0_9qualifierE0EEESaIS3_EEC2EmRKS4_(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef, ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #3 align 2

declare i32 @__gxx_personality_v0(...)

; 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 nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(48) ptr @_ZNSt6vectorI10EdgeRecordSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) local_unnamed_addr #2 align 2

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

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

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local { <2 x float>, float } @_ZN3glmplIfLNS_9qualifierE0EEENS_3vecILi3ET_XT0_EEERKS4_S6_(ptr noundef nonnull align 4 dereferenceable(12), ptr noundef nonnull align 4 dereferenceable(12)) local_unnamed_addr #4

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local { <2 x float>, float } @_ZN3glmmlIfLNS_9qualifierE0EEENS_3vecILi3ET_XT0_EEES3_RKS4_(float noundef, ptr noundef nonnull align 4 dereferenceable(12)) local_unnamed_addr #4

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

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

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

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

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

attributes #0 = { mustprogress uwtable "min-legal-vector-width"="64" "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 nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { 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 = { inlinehint mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #6 = { 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 #7 = { 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 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}


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