; LLVM IR from atlantis13579/Riemann :: Src/Geometry/GeometryAttributes.ll (ZN7Riemann23DynamicMeshAttributeSet14SetNumUVLayersEi)

; 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.Riemann::TDynamicMeshVectorOverlay" = type { %"class.Riemann::TDynamicMeshOverlay" }
%"class.Riemann::TDynamicMeshOverlay" = type { ptr, %"class.std::vector", %"class.std::vector.0", %"class.std::vector.0", %"class.Riemann::RefCountVector" }
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<float, std::allocator<float>>::_Vector_impl" }
%"struct.std::_Vector_base<float, std::allocator<float>>::_Vector_impl" = type { %"struct.std::_Vector_base<float, std::allocator<float>>::_Vector_impl_data" }
%"struct.std::_Vector_base<float, std::allocator<float>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::vector.0" = type { %"struct.std::_Vector_base.1" }
%"struct.std::_Vector_base.1" = type { %"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl" = type { %"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.Riemann::RefCountVector" = type { %"class.std::vector.0" }
%"class.Riemann::DynamicMeshAttributeSet" = type { ptr, ptr, %"class.std::vector.51", %"class.std::vector.56", ptr, %"class.std::vector.61", %"class.std::map", %"class.std::vector.71" }
%"class.std::vector.51" = type { %"struct.std::_Vector_base.52" }
%"struct.std::_Vector_base.52" = type { %"struct.std::_Vector_base<Riemann::TDynamicMeshVectorOverlay<float, 2, Maths::TVector2<float>>, std::allocator<Riemann::TDynamicMeshVectorOverlay<float, 2, Maths::TVector2<float>>>>::_Vector_impl" }
%"struct.std::_Vector_base<Riemann::TDynamicMeshVectorOverlay<float, 2, Maths::TVector2<float>>, std::allocator<Riemann::TDynamicMeshVectorOverlay<float, 2, Maths::TVector2<float>>>>::_Vector_impl" = type { %"struct.std::_Vector_base<Riemann::TDynamicMeshVectorOverlay<float, 2, Maths::TVector2<float>>, std::allocator<Riemann::TDynamicMeshVectorOverlay<float, 2, Maths::TVector2<float>>>>::_Vector_impl_data" }
%"struct.std::_Vector_base<Riemann::TDynamicMeshVectorOverlay<float, 2, Maths::TVector2<float>>, std::allocator<Riemann::TDynamicMeshVectorOverlay<float, 2, Maths::TVector2<float>>>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::vector.56" = type { %"struct.std::_Vector_base.57" }
%"struct.std::_Vector_base.57" = type { %"struct.std::_Vector_base<Riemann::TDynamicMeshVectorOverlay<float, 3, Maths::TVector3<float>>, std::allocator<Riemann::TDynamicMeshVectorOverlay<float, 3, Maths::TVector3<float>>>>::_Vector_impl" }
%"struct.std::_Vector_base<Riemann::TDynamicMeshVectorOverlay<float, 3, Maths::TVector3<float>>, std::allocator<Riemann::TDynamicMeshVectorOverlay<float, 3, Maths::TVector3<float>>>>::_Vector_impl" = type { %"struct.std::_Vector_base<Riemann::TDynamicMeshVectorOverlay<float, 3, Maths::TVector3<float>>, std::allocator<Riemann::TDynamicMeshVectorOverlay<float, 3, Maths::TVector3<float>>>>::_Vector_impl_data" }
%"struct.std::_Vector_base<Riemann::TDynamicMeshVectorOverlay<float, 3, Maths::TVector3<float>>, std::allocator<Riemann::TDynamicMeshVectorOverlay<float, 3, Maths::TVector3<float>>>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::vector.61" = type { %"struct.std::_Vector_base.62" }
%"struct.std::_Vector_base.62" = type { %"struct.std::_Vector_base<Riemann::TDynamicVertexAttribute<float, 1>, std::allocator<Riemann::TDynamicVertexAttribute<float, 1>>>::_Vector_impl" }
%"struct.std::_Vector_base<Riemann::TDynamicVertexAttribute<float, 1>, std::allocator<Riemann::TDynamicVertexAttribute<float, 1>>>::_Vector_impl" = type { %"struct.std::_Vector_base<Riemann::TDynamicVertexAttribute<float, 1>, std::allocator<Riemann::TDynamicVertexAttribute<float, 1>>>::_Vector_impl_data" }
%"struct.std::_Vector_base<Riemann::TDynamicVertexAttribute<float, 1>, std::allocator<Riemann::TDynamicVertexAttribute<float, 1>>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::map" = type { %"class.std::_Rb_tree.66" }
%"class.std::_Rb_tree.66" = type { %"struct.std::_Rb_tree<std::__cxx11::basic_string<char>, std::pair<const std::__cxx11::basic_string<char>, Riemann::TDynamicAttributeBase *>, std::_Select1st<std::pair<const std::__cxx11::basic_string<char>, Riemann::TDynamicAttributeBase *>>, std::less<std::__cxx11::basic_string<char>>>::_Rb_tree_impl" }
%"struct.std::_Rb_tree<std::__cxx11::basic_string<char>, std::pair<const std::__cxx11::basic_string<char>, Riemann::TDynamicAttributeBase *>, std::_Select1st<std::pair<const std::__cxx11::basic_string<char>, Riemann::TDynamicAttributeBase *>>, std::less<std::__cxx11::basic_string<char>>>::_Rb_tree_impl" = type { [8 x i8], %"struct.std::_Rb_tree_header" }
%"struct.std::_Rb_tree_header" = type { %"struct.std::_Rb_tree_node_base", i64 }
%"struct.std::_Rb_tree_node_base" = type { i32, ptr, ptr, ptr }
%"class.std::vector.71" = type { %"struct.std::_Vector_base.72" }
%"struct.std::_Vector_base.72" = type { %"struct.std::_Vector_base<Riemann::TDynamicAttributeBase *, std::allocator<Riemann::TDynamicAttributeBase *>>::_Vector_impl" }
%"struct.std::_Vector_base<Riemann::TDynamicAttributeBase *, std::allocator<Riemann::TDynamicAttributeBase *>>::_Vector_impl" = type { %"struct.std::_Vector_base<Riemann::TDynamicAttributeBase *, std::allocator<Riemann::TDynamicAttributeBase *>>::_Vector_impl_data" }
%"struct.std::_Vector_base<Riemann::TDynamicAttributeBase *, std::allocator<Riemann::TDynamicAttributeBase *>>::_Vector_impl_data" = type { ptr, ptr, ptr }

@.str.1 = external hidden unnamed_addr constant [91 x i8], align 1
@.str.36 = external hidden unnamed_addr constant [28 x i8], align 1
@__PRETTY_FUNCTION__._ZN7Riemann23DynamicMeshAttributeSet14SetNumUVLayersEi = external hidden unnamed_addr constant [59 x i8], align 1

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN7Riemann19TDynamicMeshOverlayIfLi2EE19InitializeTrianglesEi(ptr noundef nonnull align 8 dereferenceable(104), i32 noundef) #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: noreturn nounwind
declare void @__assert_fail(ptr noundef, ptr noundef, i32 noundef, ptr noundef) #2

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

declare i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN7Riemann23DynamicMeshAttributeSet14SetNumUVLayersEi(ptr noundef nonnull align 8 dereferenceable(168) %0, i32 noundef %1) #0 align 2 personality ptr @__gxx_personality_v0 {
  %3 = alloca ptr, align 8
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca %"class.Riemann::TDynamicMeshVectorOverlay", align 8
  %7 = alloca ptr, align 8
  %8 = alloca i32, align 4
  store ptr %0, ptr %3, align 8, !tbaa !5
  store i32 %1, ptr %4, align 4, !tbaa !9
  %9 = load ptr, ptr %3, align 8
  %10 = getelementptr inbounds %"class.Riemann::DynamicMeshAttributeSet", ptr %9, i32 0, i32 2
  %11 = call noundef i64 @_ZNKSt6vectorIN7Riemann25TDynamicMeshVectorOverlayIfLi2EN5Maths8TVector2IfEEEESaIS5_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %10) #5
  %12 = trunc i64 %11 to i32
  %13 = load i32, ptr %4, align 4, !tbaa !9
  %14 = icmp eq i32 %12, %13
  br i1 %14, label %15, label %16

15:                                               ; preds = %2
  br label %62

16:                                               ; preds = %2
  %17 = load i32, ptr %4, align 4, !tbaa !9
  %18 = getelementptr inbounds %"class.Riemann::DynamicMeshAttributeSet", ptr %9, i32 0, i32 2
  %19 = call noundef i64 @_ZNKSt6vectorIN7Riemann25TDynamicMeshVectorOverlayIfLi2EN5Maths8TVector2IfEEEESaIS5_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %18) #5
  %20 = trunc i64 %19 to i32
  %21 = icmp sge i32 %17, %20
  br i1 %21, label %22, label %49

22:                                               ; preds = %16
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #5
  %23 = getelementptr inbounds %"class.Riemann::DynamicMeshAttributeSet", ptr %9, i32 0, i32 2
  %24 = call noundef i64 @_ZNKSt6vectorIN7Riemann25TDynamicMeshVectorOverlayIfLi2EN5Maths8TVector2IfEEEESaIS5_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %23) #5
  %25 = trunc i64 %24 to i32
  store i32 %25, ptr %5, align 4, !tbaa !9
  br label %26

26:                                               ; preds = %41, %22
  %27 = load i32, ptr %5, align 4, !tbaa !9
  %28 = load i32, ptr %4, align 4, !tbaa !9
  %29 = icmp slt i32 %27, %28
  br i1 %29, label %31, label %30

30:                                               ; preds = %26
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #5
  br label %48

31:                                               ; preds = %26
  call void @llvm.lifetime.start.p0(i64 104, ptr %6) #5
  %32 = getelementptr inbounds %"class.Riemann::DynamicMeshAttributeSet", ptr %9, i32 0, i32 0
  %33 = load ptr, ptr %32, align 8, !tbaa !11
  call void @_ZN7Riemann25TDynamicMeshVectorOverlayIfLi2EN5Maths8TVector2IfEEEC2EPNS_11DynamicMeshE(ptr noundef nonnull align 8 dereferenceable(104) %6, ptr noundef %33)
  %34 = getelementptr inbounds %"class.Riemann::DynamicMeshAttributeSet", ptr %9, i32 0, i32 0
  %35 = load ptr, ptr %34, align 8, !tbaa !11
  %36 = invoke noundef i32 @_ZNK7Riemann11DynamicMesh16GetTriangleCountEv(ptr noundef nonnull align 8 dereferenceable(452) %35)
          to label %37 unwind label %44

37:                                               ; preds = %31
  invoke void @_ZN7Riemann19TDynamicMeshOverlayIfLi2EE19InitializeTrianglesEi(ptr noundef nonnull align 8 dereferenceable(104) %6, i32 noundef %36)
          to label %38 unwind label %44

38:                                               ; preds = %37
  %39 = getelementptr inbounds %"class.Riemann::DynamicMeshAttributeSet", ptr %9, i32 0, i32 2
  invoke void @_ZNSt6vectorIN7Riemann25TDynamicMeshVectorOverlayIfLi2EN5Maths8TVector2IfEEEESaIS5_EE9push_backERKS5_(ptr noundef nonnull align 8 dereferenceable(24) %39, ptr noundef nonnull align 8 dereferenceable(104) %6)
          to label %40 unwind label %44

40:                                               ; preds = %38
  call void @_ZN7Riemann19TDynamicMeshOverlayIfLi2EED2Ev(ptr noundef nonnull align 8 dereferenceable(104) %6) #5
  call void @llvm.lifetime.end.p0(i64 104, ptr %6) #5
  br label %41

41:                                               ; preds = %40
  %42 = load i32, ptr %5, align 4, !tbaa !9
  %43 = add nsw i32 %42, 1
  store i32 %43, ptr %5, align 4, !tbaa !9
  br label %26, !llvm.loop !38

44:                                               ; preds = %38, %37, %31
  %45 = landingpad { ptr, i32 }
          cleanup
  %46 = extractvalue { ptr, i32 } %45, 0
  store ptr %46, ptr %7, align 8
  %47 = extractvalue { ptr, i32 } %45, 1
  store i32 %47, ptr %8, align 4
  call void @_ZN7Riemann19TDynamicMeshOverlayIfLi2EED2Ev(ptr noundef nonnull align 8 dereferenceable(104) %6) #5
  call void @llvm.lifetime.end.p0(i64 104, ptr %6) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #5
  br label %63

48:                                               ; preds = %30
  br label %53

49:                                               ; preds = %16
  %50 = getelementptr inbounds %"class.Riemann::DynamicMeshAttributeSet", ptr %9, i32 0, i32 2
  %51 = load i32, ptr %4, align 4, !tbaa !9
  %52 = sext i32 %51 to i64
  call void @_ZNSt6vectorIN7Riemann25TDynamicMeshVectorOverlayIfLi2EN5Maths8TVector2IfEEEESaIS5_EE6resizeEm(ptr noundef nonnull align 8 dereferenceable(24) %50, i64 noundef %52)
  br label %53

53:                                               ; preds = %49, %48
  %54 = getelementptr inbounds %"class.Riemann::DynamicMeshAttributeSet", ptr %9, i32 0, i32 2
  %55 = call noundef i64 @_ZNKSt6vectorIN7Riemann25TDynamicMeshVectorOverlayIfLi2EN5Maths8TVector2IfEEEESaIS5_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %54) #5
  %56 = load i32, ptr %4, align 4, !tbaa !9
  %57 = sext i32 %56 to i64
  %58 = icmp eq i64 %55, %57
  br i1 %58, label %59, label %60

59:                                               ; preds = %53
  br label %62

60:                                               ; preds = %53
  call void @__assert_fail(ptr noundef @.str.36, ptr noundef @.str.1, i32 noundef 1200, ptr noundef @__PRETTY_FUNCTION__._ZN7Riemann23DynamicMeshAttributeSet14SetNumUVLayersEi) #6
  unreachable

61:                                               ; No predecessors!
  br label %62

62:                                               ; preds = %61, %59, %15
  ret void

63:                                               ; preds = %44
  %64 = load ptr, ptr %7, align 8
  %65 = load i32, ptr %8, align 4
  %66 = insertvalue { ptr, i32 } poison, ptr %64, 0
  %67 = insertvalue { ptr, i32 } %66, i32 %65, 1
  resume { ptr, i32 } %67
}

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN7Riemann25TDynamicMeshVectorOverlayIfLi2EN5Maths8TVector2IfEEEC2EPNS_11DynamicMeshE(ptr noundef nonnull align 8 dereferenceable(104), ptr noundef) unnamed_addr #3 align 2

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

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

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

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

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = !{!12, !6, i64 0}
!12 = !{!"_ZTSN7Riemann23DynamicMeshAttributeSetE", !6, i64 0, !6, i64 8, !13, i64 16, !17, i64 40, !6, i64 64, !21, i64 72, !25, i64 96, !34, i64 144}
!13 = !{!"_ZTSSt6vectorIN7Riemann25TDynamicMeshVectorOverlayIfLi2EN5Maths8TVector2IfEEEESaIS5_EE", !14, i64 0}
!14 = !{!"_ZTSSt12_Vector_baseIN7Riemann25TDynamicMeshVectorOverlayIfLi2EN5Maths8TVector2IfEEEESaIS5_EE", !15, i64 0}
!15 = !{!"_ZTSNSt12_Vector_baseIN7Riemann25TDynamicMeshVectorOverlayIfLi2EN5Maths8TVector2IfEEEESaIS5_EE12_Vector_implE", !16, i64 0}
!16 = !{!"_ZTSNSt12_Vector_baseIN7Riemann25TDynamicMeshVectorOverlayIfLi2EN5Maths8TVector2IfEEEESaIS5_EE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!17 = !{!"_ZTSSt6vectorIN7Riemann25TDynamicMeshVectorOverlayIfLi3EN5Maths8TVector3IfEEEESaIS5_EE", !18, i64 0}
!18 = !{!"_ZTSSt12_Vector_baseIN7Riemann25TDynamicMeshVectorOverlayIfLi3EN5Maths8TVector3IfEEEESaIS5_EE", !19, i64 0}
!19 = !{!"_ZTSNSt12_Vector_baseIN7Riemann25TDynamicMeshVectorOverlayIfLi3EN5Maths8TVector3IfEEEESaIS5_EE12_Vector_implE", !20, i64 0}
!20 = !{!"_ZTSNSt12_Vector_baseIN7Riemann25TDynamicMeshVectorOverlayIfLi3EN5Maths8TVector3IfEEEESaIS5_EE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!21 = !{!"_ZTSSt6vectorIN7Riemann23TDynamicVertexAttributeIfLi1EEESaIS2_EE", !22, i64 0}
!22 = !{!"_ZTSSt12_Vector_baseIN7Riemann23TDynamicVertexAttributeIfLi1EEESaIS2_EE", !23, i64 0}
!23 = !{!"_ZTSNSt12_Vector_baseIN7Riemann23TDynamicVertexAttributeIfLi1EEESaIS2_EE12_Vector_implE", !24, i64 0}
!24 = !{!"_ZTSNSt12_Vector_baseIN7Riemann23TDynamicVertexAttributeIfLi1EEESaIS2_EE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!25 = !{!"_ZTSSt3mapINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEPN7Riemann21TDynamicAttributeBaseESt4lessIS5_ESaISt4pairIKS5_S8_EEE", !26, i64 0}
!26 = !{!"_ZTSSt8_Rb_treeINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESt4pairIKS5_PN7Riemann21TDynamicAttributeBaseEESt10_Select1stISB_ESt4lessIS5_ESaISB_EE", !27, i64 0}
!27 = !{!"_ZTSNSt8_Rb_treeINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESt4pairIKS5_PN7Riemann21TDynamicAttributeBaseEESt10_Select1stISB_ESt4lessIS5_ESaISB_EE13_Rb_tree_implISF_Lb1EEE", !28, i64 0, !30, i64 8}
!28 = !{!"_ZTSSt20_Rb_tree_key_compareISt4lessINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEEE", !29, i64 0}
!29 = !{!"_ZTSSt4lessINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEE"}
!30 = !{!"_ZTSSt15_Rb_tree_header", !31, i64 0, !33, i64 32}
!31 = !{!"_ZTSSt18_Rb_tree_node_base", !32, i64 0, !6, i64 8, !6, i64 16, !6, i64 24}
!32 = !{!"_ZTSSt14_Rb_tree_color", !7, i64 0}
!33 = !{!"long", !7, i64 0}
!34 = !{!"_ZTSSt6vectorIPN7Riemann21TDynamicAttributeBaseESaIS2_EE", !35, i64 0}
!35 = !{!"_ZTSSt12_Vector_baseIPN7Riemann21TDynamicAttributeBaseESaIS2_EE", !36, i64 0}
!36 = !{!"_ZTSNSt12_Vector_baseIPN7Riemann21TDynamicAttributeBaseESaIS2_EE12_Vector_implE", !37, i64 0}
!37 = !{!"_ZTSNSt12_Vector_baseIPN7Riemann21TDynamicAttributeBaseESaIS2_EE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!38 = distinct !{!38, !39}
!39 = !{!"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.Riemann::TDynamicMeshVectorOverlay" = type { %"class.Riemann::TDynamicMeshOverlay" }
%"class.Riemann::TDynamicMeshOverlay" = type { ptr, %"class.std::vector", %"class.std::vector.0", %"class.std::vector.0", %"class.Riemann::RefCountVector" }
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<float, std::allocator<float>>::_Vector_impl" }
%"struct.std::_Vector_base<float, std::allocator<float>>::_Vector_impl" = type { %"struct.std::_Vector_base<float, std::allocator<float>>::_Vector_impl_data" }
%"struct.std::_Vector_base<float, std::allocator<float>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::vector.0" = type { %"struct.std::_Vector_base.1" }
%"struct.std::_Vector_base.1" = type { %"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl" = type { %"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.Riemann::RefCountVector" = type { %"class.std::vector.0" }

@.str.1 = external hidden unnamed_addr constant [91 x i8], align 1
@.str.36 = external hidden unnamed_addr constant [28 x i8], align 1
@__PRETTY_FUNCTION__._ZN7Riemann23DynamicMeshAttributeSet14SetNumUVLayersEi = external hidden unnamed_addr constant [59 x i8], align 1

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN7Riemann19TDynamicMeshOverlayIfLi2EE19InitializeTrianglesEi(ptr noundef nonnull align 8 dereferenceable(104), i32 noundef) 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: noreturn nounwind
declare void @__assert_fail(ptr noundef, ptr noundef, i32 noundef, ptr noundef) local_unnamed_addr #2

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

declare i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN7Riemann23DynamicMeshAttributeSet14SetNumUVLayersEi(ptr noundef nonnull align 8 dereferenceable(168) %0, i32 noundef %1) local_unnamed_addr #0 align 2 personality ptr @__gxx_personality_v0 {
  %3 = alloca %"class.Riemann::TDynamicMeshVectorOverlay", align 8
  %4 = getelementptr inbounds i8, ptr %0, i64 16
  %5 = tail call noundef i64 @_ZNKSt6vectorIN7Riemann25TDynamicMeshVectorOverlayIfLi2EN5Maths8TVector2IfEEEESaIS5_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %4) #5
  %6 = trunc i64 %5 to i32
  %7 = icmp eq i32 %6, %1
  br i1 %7, label %29, label %8

8:                                                ; preds = %2
  %9 = tail call noundef i64 @_ZNKSt6vectorIN7Riemann25TDynamicMeshVectorOverlayIfLi2EN5Maths8TVector2IfEEEESaIS5_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %4) #5
  %10 = trunc i64 %9 to i32
  %.not = icmp sgt i32 %10, %1
  br i1 %.not, label %23, label %11

11:                                               ; preds = %8
  %12 = tail call noundef i64 @_ZNKSt6vectorIN7Riemann25TDynamicMeshVectorOverlayIfLi2EN5Maths8TVector2IfEEEESaIS5_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %4) #5
  %13 = trunc i64 %12 to i32
  %14 = icmp slt i32 %13, %1
  br i1 %14, label %.lr.ph, label %.loopexit

.lr.ph:                                           ; preds = %11, %19
  %.010 = phi i32 [ %20, %19 ], [ %13, %11 ]
  call void @llvm.lifetime.start.p0(i64 104, ptr nonnull %3) #5
  %15 = load ptr, ptr %0, align 8, !tbaa !5
  call void @_ZN7Riemann25TDynamicMeshVectorOverlayIfLi2EN5Maths8TVector2IfEEEC2EPNS_11DynamicMeshE(ptr noundef nonnull align 8 dereferenceable(104) %3, ptr noundef %15)
  %16 = load ptr, ptr %0, align 8, !tbaa !5
  %17 = call noundef i32 @_ZNK7Riemann11DynamicMesh16GetTriangleCountEv(ptr noundef nonnull align 8 dereferenceable(452) %16)
  invoke void @_ZN7Riemann19TDynamicMeshOverlayIfLi2EE19InitializeTrianglesEi(ptr noundef nonnull align 8 dereferenceable(104) %3, i32 noundef %17)
          to label %18 unwind label %21

18:                                               ; preds = %.lr.ph
  invoke void @_ZNSt6vectorIN7Riemann25TDynamicMeshVectorOverlayIfLi2EN5Maths8TVector2IfEEEESaIS5_EE9push_backERKS5_(ptr noundef nonnull align 8 dereferenceable(24) %4, ptr noundef nonnull align 8 dereferenceable(104) %3)
          to label %19 unwind label %21

19:                                               ; preds = %18
  call void @_ZN7Riemann19TDynamicMeshOverlayIfLi2EED2Ev(ptr noundef nonnull align 8 dereferenceable(104) %3) #5
  call void @llvm.lifetime.end.p0(i64 104, ptr nonnull %3) #5
  %20 = add i32 %.010, 1
  %exitcond.not = icmp eq i32 %20, %1
  br i1 %exitcond.not, label %.loopexit, label %.lr.ph, !llvm.loop !35

21:                                               ; preds = %18, %.lr.ph
  %22 = landingpad { ptr, i32 }
          cleanup
  call void @_ZN7Riemann19TDynamicMeshOverlayIfLi2EED2Ev(ptr noundef nonnull align 8 dereferenceable(104) %3) #5
  call void @llvm.lifetime.end.p0(i64 104, ptr nonnull %3) #5
  resume { ptr, i32 } %22

23:                                               ; preds = %8
  %24 = sext i32 %1 to i64
  tail call void @_ZNSt6vectorIN7Riemann25TDynamicMeshVectorOverlayIfLi2EN5Maths8TVector2IfEEEESaIS5_EE6resizeEm(ptr noundef nonnull align 8 dereferenceable(24) %4, i64 noundef %24)
  br label %.loopexit

.loopexit:                                        ; preds = %19, %11, %23
  %25 = call noundef i64 @_ZNKSt6vectorIN7Riemann25TDynamicMeshVectorOverlayIfLi2EN5Maths8TVector2IfEEEESaIS5_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %4) #5
  %26 = sext i32 %1 to i64
  %27 = icmp eq i64 %25, %26
  br i1 %27, label %29, label %28

28:                                               ; preds = %.loopexit
  call void @__assert_fail(ptr noundef nonnull @.str.36, ptr noundef nonnull @.str.1, i32 noundef 1200, ptr noundef nonnull @__PRETTY_FUNCTION__._ZN7Riemann23DynamicMeshAttributeSet14SetNumUVLayersEi) #6
  unreachable

29:                                               ; preds = %.loopexit, %2
  ret void
}

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN7Riemann25TDynamicMeshVectorOverlayIfLi2EN5Maths8TVector2IfEEEC2EPNS_11DynamicMeshE(ptr noundef nonnull align 8 dereferenceable(104), ptr noundef) unnamed_addr #3 align 2

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

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

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

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

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !7, i64 0}
!6 = !{!"_ZTSN7Riemann23DynamicMeshAttributeSetE", !7, i64 0, !7, i64 8, !10, i64 16, !14, i64 40, !7, i64 64, !18, i64 72, !22, i64 96, !31, i64 144}
!7 = !{!"any pointer", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!"_ZTSSt6vectorIN7Riemann25TDynamicMeshVectorOverlayIfLi2EN5Maths8TVector2IfEEEESaIS5_EE", !11, i64 0}
!11 = !{!"_ZTSSt12_Vector_baseIN7Riemann25TDynamicMeshVectorOverlayIfLi2EN5Maths8TVector2IfEEEESaIS5_EE", !12, i64 0}
!12 = !{!"_ZTSNSt12_Vector_baseIN7Riemann25TDynamicMeshVectorOverlayIfLi2EN5Maths8TVector2IfEEEESaIS5_EE12_Vector_implE", !13, i64 0}
!13 = !{!"_ZTSNSt12_Vector_baseIN7Riemann25TDynamicMeshVectorOverlayIfLi2EN5Maths8TVector2IfEEEESaIS5_EE17_Vector_impl_dataE", !7, i64 0, !7, i64 8, !7, i64 16}
!14 = !{!"_ZTSSt6vectorIN7Riemann25TDynamicMeshVectorOverlayIfLi3EN5Maths8TVector3IfEEEESaIS5_EE", !15, i64 0}
!15 = !{!"_ZTSSt12_Vector_baseIN7Riemann25TDynamicMeshVectorOverlayIfLi3EN5Maths8TVector3IfEEEESaIS5_EE", !16, i64 0}
!16 = !{!"_ZTSNSt12_Vector_baseIN7Riemann25TDynamicMeshVectorOverlayIfLi3EN5Maths8TVector3IfEEEESaIS5_EE12_Vector_implE", !17, i64 0}
!17 = !{!"_ZTSNSt12_Vector_baseIN7Riemann25TDynamicMeshVectorOverlayIfLi3EN5Maths8TVector3IfEEEESaIS5_EE17_Vector_impl_dataE", !7, i64 0, !7, i64 8, !7, i64 16}
!18 = !{!"_ZTSSt6vectorIN7Riemann23TDynamicVertexAttributeIfLi1EEESaIS2_EE", !19, i64 0}
!19 = !{!"_ZTSSt12_Vector_baseIN7Riemann23TDynamicVertexAttributeIfLi1EEESaIS2_EE", !20, i64 0}
!20 = !{!"_ZTSNSt12_Vector_baseIN7Riemann23TDynamicVertexAttributeIfLi1EEESaIS2_EE12_Vector_implE", !21, i64 0}
!21 = !{!"_ZTSNSt12_Vector_baseIN7Riemann23TDynamicVertexAttributeIfLi1EEESaIS2_EE17_Vector_impl_dataE", !7, i64 0, !7, i64 8, !7, i64 16}
!22 = !{!"_ZTSSt3mapINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEPN7Riemann21TDynamicAttributeBaseESt4lessIS5_ESaISt4pairIKS5_S8_EEE", !23, i64 0}
!23 = !{!"_ZTSSt8_Rb_treeINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESt4pairIKS5_PN7Riemann21TDynamicAttributeBaseEESt10_Select1stISB_ESt4lessIS5_ESaISB_EE", !24, i64 0}
!24 = !{!"_ZTSNSt8_Rb_treeINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESt4pairIKS5_PN7Riemann21TDynamicAttributeBaseEESt10_Select1stISB_ESt4lessIS5_ESaISB_EE13_Rb_tree_implISF_Lb1EEE", !25, i64 0, !27, i64 8}
!25 = !{!"_ZTSSt20_Rb_tree_key_compareISt4lessINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEEE", !26, i64 0}
!26 = !{!"_ZTSSt4lessINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEE"}
!27 = !{!"_ZTSSt15_Rb_tree_header", !28, i64 0, !30, i64 32}
!28 = !{!"_ZTSSt18_Rb_tree_node_base", !29, i64 0, !7, i64 8, !7, i64 16, !7, i64 24}
!29 = !{!"_ZTSSt14_Rb_tree_color", !8, i64 0}
!30 = !{!"long", !8, i64 0}
!31 = !{!"_ZTSSt6vectorIPN7Riemann21TDynamicAttributeBaseESaIS2_EE", !32, i64 0}
!32 = !{!"_ZTSSt12_Vector_baseIPN7Riemann21TDynamicAttributeBaseESaIS2_EE", !33, i64 0}
!33 = !{!"_ZTSNSt12_Vector_baseIPN7Riemann21TDynamicAttributeBaseESaIS2_EE12_Vector_implE", !34, i64 0}
!34 = !{!"_ZTSNSt12_Vector_baseIPN7Riemann21TDynamicAttributeBaseESaIS2_EE17_Vector_impl_dataE", !7, i64 0, !7, i64 8, !7, i64 16}
!35 = distinct !{!35, !36}
!36 = !{!"llvm.loop.mustprogress"}


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