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

; 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::__cxx11::basic_string" = type { %"struct.std::__cxx11::basic_string<char>::_Alloc_hider", i64, %union.anon }
%"struct.std::__cxx11::basic_string<char>::_Alloc_hider" = type { ptr }
%union.anon = type { i64, [8 x i8] }
%"class.Maths::TVector3" = type { float, float, float }

@_ZN7Riemann15ColorAttribNameB5cxx11E = external dso_local global %"class.std::__cxx11::basic_string", align 8
@_ZN7Riemann18TangentUAttribNameB5cxx11E = external dso_local global %"class.std::__cxx11::basic_string", align 8
@_ZN7Riemann18TangentVAttribNameB5cxx11E = external dso_local global %"class.std::__cxx11::basic_string", align 8
@_ZN7Riemann17VisibleAttribNameB5cxx11E = external dso_local global %"class.std::__cxx11::basic_string", align 8
@_ZN7Riemann18InternalAttribNameB5cxx11E = external dso_local global %"class.std::__cxx11::basic_string", align 8

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

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

declare i32 @__gxx_personality_v0(...)

; Function Attrs: nobuiltin nounwind
declare void @_ZdlPvm(ptr noundef, i64 noundef) #1

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN7Riemann23DynamicMeshAttributeSet16EnableMaterialIDEv(ptr noundef nonnull align 8 dereferenceable(168)) #3 align 2

; Function Attrs: nobuiltin allocsize(0)
declare noundef nonnull ptr @_Znwm(i64 noundef) #4

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN7Riemann23DynamicMeshAttributeSet16EnableUVChannelsEPNS_11DynamicMeshEibb(ptr noundef, i32 noundef, i1 noundef zeroext, i1 noundef zeroext) #3 align 2

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN7Riemann23DynamicMeshAttributeSet15AttachAttributeENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEPNS_21TDynamicAttributeBaseE(ptr noundef nonnull align 8 dereferenceable(168), ptr noundef, ptr noundef) #3 align 2

; Function Attrs: mustprogress uwtable
declare void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2ERKS4_(ptr noundef nonnull align 8 dereferenceable(32), ptr noundef nonnull align 8 dereferenceable(32)) unnamed_addr #3 align 2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN7Riemann23DynamicMeshAttributeSet7AugmentEPNS_11DynamicMeshEi(ptr noundef %0, i32 noundef %1) #3 align 2 personality ptr @__gxx_personality_v0 {
  %3 = alloca ptr, align 8
  %4 = alloca i32, align 4
  %5 = alloca %"class.Maths::TVector3", align 4
  %6 = alloca %"class.std::__cxx11::basic_string", align 8
  %7 = alloca ptr, align 8
  %8 = alloca i32, align 4
  %9 = alloca %"class.std::__cxx11::basic_string", align 8
  %10 = alloca %"class.std::__cxx11::basic_string", align 8
  %11 = alloca ptr, align 8
  %12 = alloca %"class.std::__cxx11::basic_string", align 8
  %13 = alloca ptr, align 8
  %14 = alloca %"class.std::__cxx11::basic_string", align 8
  store ptr %0, ptr %3, align 8, !tbaa !5
  store i32 %1, ptr %4, align 4, !tbaa !9
  %15 = load ptr, ptr %3, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 12, ptr %5) #5
  call void @_ZN5Maths8TVector3IfE5UnitZEv(ptr dead_on_unwind writable sret(%"class.Maths::TVector3") align 4 %5)
  call void @_ZN7Riemann11DynamicMesh19EnableVertexNormalsERKN5Maths8TVector3IfEE(ptr noundef nonnull align 8 dereferenceable(452) %15, ptr noundef nonnull align 4 dereferenceable(12) %5)
  call void @llvm.lifetime.end.p0(i64 12, ptr %5) #5
  %16 = load ptr, ptr %3, align 8, !tbaa !5
  call void @_ZN7Riemann11DynamicMesh16EnableAttributesEv(ptr noundef nonnull align 8 dereferenceable(452) %16)
  %17 = load ptr, ptr %3, align 8, !tbaa !5
  %18 = call noundef ptr @_ZN7Riemann11DynamicMesh10AttributesEv(ptr noundef nonnull align 8 dereferenceable(452) %17)
  call void @_ZN7Riemann23DynamicMeshAttributeSet16EnableMaterialIDEv(ptr noundef nonnull align 8 dereferenceable(168) %18)
  %19 = load ptr, ptr %3, align 8, !tbaa !5
  %20 = call noundef ptr @_ZN7Riemann11DynamicMesh10AttributesEv(ptr noundef nonnull align 8 dereferenceable(452) %19)
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2ERKS4_(ptr noundef nonnull align 8 dereferenceable(32) %6, ptr noundef nonnull align 8 dereferenceable(32) @_ZN7Riemann15ColorAttribNameB5cxx11E)
  %21 = invoke noalias noundef nonnull ptr @_Znwm(i64 noundef 72) #6
          to label %22 unwind label %58

22:                                               ; preds = %2
  %23 = load ptr, ptr %3, align 8, !tbaa !5
  invoke void @_ZN7Riemann23TDynamicVertexAttributeIfLi4EEC2EPNS_11DynamicMeshEb(ptr noundef nonnull align 8 dereferenceable(72) %21, ptr noundef %23, i1 noundef zeroext true)
          to label %24 unwind label %62

24:                                               ; preds = %22
  invoke void @_ZN7Riemann23DynamicMeshAttributeSet15AttachAttributeENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEPNS_21TDynamicAttributeBaseE(ptr noundef nonnull align 8 dereferenceable(168) %20, ptr noundef %6, ptr noundef %21)
          to label %25 unwind label %58

25:                                               ; preds = %24
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %6) #5
  %26 = load ptr, ptr %3, align 8, !tbaa !5
  %27 = call noundef ptr @_ZN7Riemann11DynamicMesh10AttributesEv(ptr noundef nonnull align 8 dereferenceable(452) %26)
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2ERKS4_(ptr noundef nonnull align 8 dereferenceable(32) %9, ptr noundef nonnull align 8 dereferenceable(32) @_ZN7Riemann18TangentUAttribNameB5cxx11E)
  %28 = invoke noalias noundef nonnull ptr @_Znwm(i64 noundef 72) #6
          to label %29 unwind label %67

29:                                               ; preds = %25
  %30 = load ptr, ptr %3, align 8, !tbaa !5
  invoke void @_ZN7Riemann23TDynamicVertexAttributeIfLi3EEC2EPNS_11DynamicMeshEb(ptr noundef nonnull align 8 dereferenceable(72) %28, ptr noundef %30, i1 noundef zeroext true)
          to label %31 unwind label %71

31:                                               ; preds = %29
  invoke void @_ZN7Riemann23DynamicMeshAttributeSet15AttachAttributeENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEPNS_21TDynamicAttributeBaseE(ptr noundef nonnull align 8 dereferenceable(168) %27, ptr noundef %9, ptr noundef %28)
          to label %32 unwind label %67

32:                                               ; preds = %31
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %9) #5
  %33 = load ptr, ptr %3, align 8, !tbaa !5
  %34 = call noundef ptr @_ZN7Riemann11DynamicMesh10AttributesEv(ptr noundef nonnull align 8 dereferenceable(452) %33)
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2ERKS4_(ptr noundef nonnull align 8 dereferenceable(32) %10, ptr noundef nonnull align 8 dereferenceable(32) @_ZN7Riemann18TangentVAttribNameB5cxx11E)
  %35 = invoke noalias noundef nonnull ptr @_Znwm(i64 noundef 72) #6
          to label %36 unwind label %76

36:                                               ; preds = %32
  %37 = load ptr, ptr %3, align 8, !tbaa !5
  invoke void @_ZN7Riemann23TDynamicVertexAttributeIfLi3EEC2EPNS_11DynamicMeshEb(ptr noundef nonnull align 8 dereferenceable(72) %35, ptr noundef %37, i1 noundef zeroext true)
          to label %38 unwind label %80

38:                                               ; preds = %36
  invoke void @_ZN7Riemann23DynamicMeshAttributeSet15AttachAttributeENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEPNS_21TDynamicAttributeBaseE(ptr noundef nonnull align 8 dereferenceable(168) %34, ptr noundef %10, ptr noundef %35)
          to label %39 unwind label %76

39:                                               ; preds = %38
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %10) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #5
  %40 = call noalias noundef nonnull ptr @_Znwm(i64 noundef 88) #6
  %41 = load ptr, ptr %3, align 8, !tbaa !5
  invoke void @_ZN7Riemann35TDynamicMeshScalarTriangleAttributeIbEC2EPNS_11DynamicMeshE(ptr noundef nonnull align 8 dereferenceable(88) %40, ptr noundef %41)
          to label %42 unwind label %85

42:                                               ; preds = %39
  store ptr %40, ptr %11, align 8, !tbaa !5
  %43 = load ptr, ptr %11, align 8, !tbaa !5
  call void @_ZN7Riemann29TDynamicMeshTriangleAttributeIbLi1EE10InitializeEb(ptr noundef nonnull align 8 dereferenceable(88) %43, i1 noundef zeroext true)
  %44 = load ptr, ptr %3, align 8, !tbaa !5
  %45 = call noundef ptr @_ZN7Riemann11DynamicMesh10AttributesEv(ptr noundef nonnull align 8 dereferenceable(452) %44)
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2ERKS4_(ptr noundef nonnull align 8 dereferenceable(32) %12, ptr noundef nonnull align 8 dereferenceable(32) @_ZN7Riemann17VisibleAttribNameB5cxx11E)
  %46 = load ptr, ptr %11, align 8, !tbaa !5
  invoke void @_ZN7Riemann23DynamicMeshAttributeSet15AttachAttributeENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEPNS_21TDynamicAttributeBaseE(ptr noundef nonnull align 8 dereferenceable(168) %45, ptr noundef %12, ptr noundef %46)
          to label %47 unwind label %89

47:                                               ; preds = %42
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %12) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #5
  %48 = call noalias noundef nonnull ptr @_Znwm(i64 noundef 88) #6
  %49 = load ptr, ptr %3, align 8, !tbaa !5
  invoke void @_ZN7Riemann35TDynamicMeshScalarTriangleAttributeIbEC2EPNS_11DynamicMeshE(ptr noundef nonnull align 8 dereferenceable(88) %48, ptr noundef %49)
          to label %50 unwind label %93

50:                                               ; preds = %47
  store ptr %48, ptr %13, align 8, !tbaa !5
  %51 = load ptr, ptr %13, align 8, !tbaa !5
  call void @_ZN7Riemann29TDynamicMeshTriangleAttributeIbLi1EE10InitializeEb(ptr noundef nonnull align 8 dereferenceable(88) %51, i1 noundef zeroext true)
  %52 = load ptr, ptr %3, align 8, !tbaa !5
  %53 = call noundef ptr @_ZN7Riemann11DynamicMesh10AttributesEv(ptr noundef nonnull align 8 dereferenceable(452) %52)
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2ERKS4_(ptr noundef nonnull align 8 dereferenceable(32) %14, ptr noundef nonnull align 8 dereferenceable(32) @_ZN7Riemann18InternalAttribNameB5cxx11E)
  %54 = load ptr, ptr %13, align 8, !tbaa !5
  invoke void @_ZN7Riemann23DynamicMeshAttributeSet15AttachAttributeENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEPNS_21TDynamicAttributeBaseE(ptr noundef nonnull align 8 dereferenceable(168) %53, ptr noundef %14, ptr noundef %54)
          to label %55 unwind label %97

55:                                               ; preds = %50
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %14) #5
  %56 = load ptr, ptr %3, align 8, !tbaa !5
  %57 = load i32, ptr %4, align 4, !tbaa !9
  call void @_ZN7Riemann23DynamicMeshAttributeSet16EnableUVChannelsEPNS_11DynamicMeshEibb(ptr noundef %56, i32 noundef %57, i1 noundef zeroext false, i1 noundef zeroext true)
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #5
  ret void

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

62:                                               ; preds = %22
  %63 = landingpad { ptr, i32 }
          cleanup
  %64 = extractvalue { ptr, i32 } %63, 0
  store ptr %64, ptr %7, align 8
  %65 = extractvalue { ptr, i32 } %63, 1
  store i32 %65, ptr %8, align 4
  call void @_ZdlPvm(ptr noundef %21, i64 noundef 72) #7
  br label %66

66:                                               ; preds = %62, %58
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %6) #5
  br label %103

67:                                               ; preds = %31, %25
  %68 = landingpad { ptr, i32 }
          cleanup
  %69 = extractvalue { ptr, i32 } %68, 0
  store ptr %69, ptr %7, align 8
  %70 = extractvalue { ptr, i32 } %68, 1
  store i32 %70, ptr %8, align 4
  br label %75

71:                                               ; preds = %29
  %72 = landingpad { ptr, i32 }
          cleanup
  %73 = extractvalue { ptr, i32 } %72, 0
  store ptr %73, ptr %7, align 8
  %74 = extractvalue { ptr, i32 } %72, 1
  store i32 %74, ptr %8, align 4
  call void @_ZdlPvm(ptr noundef %28, i64 noundef 72) #7
  br label %75

75:                                               ; preds = %71, %67
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %9) #5
  br label %103

76:                                               ; preds = %38, %32
  %77 = landingpad { ptr, i32 }
          cleanup
  %78 = extractvalue { ptr, i32 } %77, 0
  store ptr %78, ptr %7, align 8
  %79 = extractvalue { ptr, i32 } %77, 1
  store i32 %79, ptr %8, align 4
  br label %84

80:                                               ; preds = %36
  %81 = landingpad { ptr, i32 }
          cleanup
  %82 = extractvalue { ptr, i32 } %81, 0
  store ptr %82, ptr %7, align 8
  %83 = extractvalue { ptr, i32 } %81, 1
  store i32 %83, ptr %8, align 4
  call void @_ZdlPvm(ptr noundef %35, i64 noundef 72) #7
  br label %84

84:                                               ; preds = %80, %76
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %10) #5
  br label %103

85:                                               ; preds = %39
  %86 = landingpad { ptr, i32 }
          cleanup
  %87 = extractvalue { ptr, i32 } %86, 0
  store ptr %87, ptr %7, align 8
  %88 = extractvalue { ptr, i32 } %86, 1
  store i32 %88, ptr %8, align 4
  call void @_ZdlPvm(ptr noundef %40, i64 noundef 88) #7
  br label %102

89:                                               ; preds = %42
  %90 = landingpad { ptr, i32 }
          cleanup
  %91 = extractvalue { ptr, i32 } %90, 0
  store ptr %91, ptr %7, align 8
  %92 = extractvalue { ptr, i32 } %90, 1
  store i32 %92, ptr %8, align 4
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %12) #5
  br label %102

93:                                               ; preds = %47
  %94 = landingpad { ptr, i32 }
          cleanup
  %95 = extractvalue { ptr, i32 } %94, 0
  store ptr %95, ptr %7, align 8
  %96 = extractvalue { ptr, i32 } %94, 1
  store i32 %96, ptr %8, align 4
  call void @_ZdlPvm(ptr noundef %48, i64 noundef 88) #7
  br label %101

97:                                               ; preds = %50
  %98 = landingpad { ptr, i32 }
          cleanup
  %99 = extractvalue { ptr, i32 } %98, 0
  store ptr %99, ptr %7, align 8
  %100 = extractvalue { ptr, i32 } %98, 1
  store i32 %100, ptr %8, align 4
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %14) #5
  br label %101

101:                                              ; preds = %97, %93
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #5
  br label %102

102:                                              ; preds = %101, %89, %85
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #5
  br label %103

103:                                              ; preds = %102, %84, %75, %66
  %104 = load ptr, ptr %7, align 8
  %105 = load i32, ptr %8, align 4
  %106 = insertvalue { ptr, i32 } poison, ptr %104, 0
  %107 = insertvalue { ptr, i32 } %106, i32 %105, 1
  resume { ptr, i32 } %107
}

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN7Riemann11DynamicMesh19EnableVertexNormalsERKN5Maths8TVector3IfEE(ptr noundef nonnull align 8 dereferenceable(452), ptr noundef nonnull align 4 dereferenceable(12)) #3 align 2

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN7Riemann23TDynamicVertexAttributeIfLi4EEC2EPNS_11DynamicMeshEb(ptr noundef nonnull align 8 dereferenceable(72), ptr noundef, i1 noundef zeroext) unnamed_addr #3 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN7Riemann23TDynamicVertexAttributeIfLi3EEC2EPNS_11DynamicMeshEb(ptr noundef nonnull align 8 dereferenceable(72), ptr noundef, i1 noundef zeroext) unnamed_addr #3 align 2

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

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

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { nobuiltin 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 #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 = { nobuiltin allocsize(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 = { builtin allocsize(0) }
attributes #7 = { builtin 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}


; 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::__cxx11::basic_string" = type { %"struct.std::__cxx11::basic_string<char>::_Alloc_hider", i64, %union.anon }
%"struct.std::__cxx11::basic_string<char>::_Alloc_hider" = type { ptr }
%union.anon = type { i64, [8 x i8] }
%"class.Maths::TVector3" = type { float, float, float }

@_ZN7Riemann15ColorAttribNameB5cxx11E = external dso_local global %"class.std::__cxx11::basic_string", align 8
@_ZN7Riemann18TangentUAttribNameB5cxx11E = external dso_local global %"class.std::__cxx11::basic_string", align 8
@_ZN7Riemann18TangentVAttribNameB5cxx11E = external dso_local global %"class.std::__cxx11::basic_string", align 8
@_ZN7Riemann17VisibleAttribNameB5cxx11E = external dso_local global %"class.std::__cxx11::basic_string", align 8
@_ZN7Riemann18InternalAttribNameB5cxx11E = external dso_local global %"class.std::__cxx11::basic_string", align 8

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

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

declare i32 @__gxx_personality_v0(...)

; Function Attrs: nobuiltin nounwind
declare void @_ZdlPvm(ptr noundef, i64 noundef) local_unnamed_addr #1

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN7Riemann23DynamicMeshAttributeSet16EnableMaterialIDEv(ptr noundef nonnull align 8 dereferenceable(168)) local_unnamed_addr #3 align 2

; Function Attrs: nobuiltin allocsize(0)
declare noundef nonnull ptr @_Znwm(i64 noundef) local_unnamed_addr #4

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN7Riemann23DynamicMeshAttributeSet16EnableUVChannelsEPNS_11DynamicMeshEibb(ptr noundef, i32 noundef, i1 noundef zeroext, i1 noundef zeroext) local_unnamed_addr #3 align 2

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN7Riemann23DynamicMeshAttributeSet15AttachAttributeENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEPNS_21TDynamicAttributeBaseE(ptr noundef nonnull align 8 dereferenceable(168), ptr noundef, ptr noundef) local_unnamed_addr #3 align 2

; Function Attrs: mustprogress uwtable
declare void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2ERKS4_(ptr noundef nonnull align 8 dereferenceable(32), ptr noundef nonnull align 8 dereferenceable(32)) unnamed_addr #3 align 2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN7Riemann23DynamicMeshAttributeSet7AugmentEPNS_11DynamicMeshEi(ptr noundef %0, i32 noundef %1) local_unnamed_addr #3 align 2 personality ptr @__gxx_personality_v0 {
  %3 = alloca %"class.Maths::TVector3", align 4
  %4 = alloca %"class.std::__cxx11::basic_string", align 8
  %5 = alloca %"class.std::__cxx11::basic_string", align 8
  %6 = alloca %"class.std::__cxx11::basic_string", align 8
  %7 = alloca %"class.std::__cxx11::basic_string", align 8
  %8 = alloca %"class.std::__cxx11::basic_string", align 8
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %3) #5
  call void @_ZN5Maths8TVector3IfE5UnitZEv(ptr dead_on_unwind nonnull writable sret(%"class.Maths::TVector3") align 4 %3)
  call void @_ZN7Riemann11DynamicMesh19EnableVertexNormalsERKN5Maths8TVector3IfEE(ptr noundef nonnull align 8 dereferenceable(452) %0, ptr noundef nonnull align 4 dereferenceable(12) %3)
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %3) #5
  call void @_ZN7Riemann11DynamicMesh16EnableAttributesEv(ptr noundef nonnull align 8 dereferenceable(452) %0)
  %9 = call noundef ptr @_ZN7Riemann11DynamicMesh10AttributesEv(ptr noundef nonnull align 8 dereferenceable(452) %0)
  call void @_ZN7Riemann23DynamicMeshAttributeSet16EnableMaterialIDEv(ptr noundef nonnull align 8 dereferenceable(168) %9)
  %10 = call noundef ptr @_ZN7Riemann11DynamicMesh10AttributesEv(ptr noundef nonnull align 8 dereferenceable(452) %0)
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2ERKS4_(ptr noundef nonnull align 8 dereferenceable(32) %4, ptr noundef nonnull align 8 dereferenceable(32) @_ZN7Riemann15ColorAttribNameB5cxx11E)
  %11 = invoke noalias noundef nonnull dereferenceable(72) ptr @_Znwm(i64 noundef 72) #6
          to label %12 unwind label %33

12:                                               ; preds = %2
  invoke void @_ZN7Riemann23TDynamicVertexAttributeIfLi4EEC2EPNS_11DynamicMeshEb(ptr noundef nonnull align 8 dereferenceable(72) %11, ptr noundef nonnull %0, i1 noundef zeroext true)
          to label %13 unwind label %35

13:                                               ; preds = %12
  invoke void @_ZN7Riemann23DynamicMeshAttributeSet15AttachAttributeENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEPNS_21TDynamicAttributeBaseE(ptr noundef nonnull align 8 dereferenceable(168) %10, ptr noundef nonnull %4, ptr noundef nonnull %11)
          to label %14 unwind label %33

14:                                               ; preds = %13
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %4) #5
  %15 = call noundef ptr @_ZN7Riemann11DynamicMesh10AttributesEv(ptr noundef nonnull align 8 dereferenceable(452) %0)
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2ERKS4_(ptr noundef nonnull align 8 dereferenceable(32) %5, ptr noundef nonnull align 8 dereferenceable(32) @_ZN7Riemann18TangentUAttribNameB5cxx11E)
  %16 = invoke noalias noundef nonnull dereferenceable(72) ptr @_Znwm(i64 noundef 72) #6
          to label %17 unwind label %38

17:                                               ; preds = %14
  invoke void @_ZN7Riemann23TDynamicVertexAttributeIfLi3EEC2EPNS_11DynamicMeshEb(ptr noundef nonnull align 8 dereferenceable(72) %16, ptr noundef nonnull %0, i1 noundef zeroext true)
          to label %18 unwind label %40

18:                                               ; preds = %17
  invoke void @_ZN7Riemann23DynamicMeshAttributeSet15AttachAttributeENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEPNS_21TDynamicAttributeBaseE(ptr noundef nonnull align 8 dereferenceable(168) %15, ptr noundef nonnull %5, ptr noundef nonnull %16)
          to label %19 unwind label %38

19:                                               ; preds = %18
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %5) #5
  %20 = call noundef ptr @_ZN7Riemann11DynamicMesh10AttributesEv(ptr noundef nonnull align 8 dereferenceable(452) %0)
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2ERKS4_(ptr noundef nonnull align 8 dereferenceable(32) %6, ptr noundef nonnull align 8 dereferenceable(32) @_ZN7Riemann18TangentVAttribNameB5cxx11E)
  %21 = invoke noalias noundef nonnull dereferenceable(72) ptr @_Znwm(i64 noundef 72) #6
          to label %22 unwind label %43

22:                                               ; preds = %19
  invoke void @_ZN7Riemann23TDynamicVertexAttributeIfLi3EEC2EPNS_11DynamicMeshEb(ptr noundef nonnull align 8 dereferenceable(72) %21, ptr noundef nonnull %0, i1 noundef zeroext true)
          to label %23 unwind label %45

23:                                               ; preds = %22
  invoke void @_ZN7Riemann23DynamicMeshAttributeSet15AttachAttributeENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEPNS_21TDynamicAttributeBaseE(ptr noundef nonnull align 8 dereferenceable(168) %20, ptr noundef nonnull %6, ptr noundef nonnull %21)
          to label %24 unwind label %43

24:                                               ; preds = %23
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %6) #5
  %25 = call noalias noundef nonnull dereferenceable(88) ptr @_Znwm(i64 noundef 88) #6
  invoke void @_ZN7Riemann35TDynamicMeshScalarTriangleAttributeIbEC2EPNS_11DynamicMeshE(ptr noundef nonnull align 8 dereferenceable(88) %25, ptr noundef nonnull %0)
          to label %26 unwind label %48

26:                                               ; preds = %24
  call void @_ZN7Riemann29TDynamicMeshTriangleAttributeIbLi1EE10InitializeEb(ptr noundef nonnull align 8 dereferenceable(88) %25, i1 noundef zeroext true)
  %27 = call noundef ptr @_ZN7Riemann11DynamicMesh10AttributesEv(ptr noundef nonnull align 8 dereferenceable(452) %0)
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2ERKS4_(ptr noundef nonnull align 8 dereferenceable(32) %7, ptr noundef nonnull align 8 dereferenceable(32) @_ZN7Riemann17VisibleAttribNameB5cxx11E)
  invoke void @_ZN7Riemann23DynamicMeshAttributeSet15AttachAttributeENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEPNS_21TDynamicAttributeBaseE(ptr noundef nonnull align 8 dereferenceable(168) %27, ptr noundef nonnull %7, ptr noundef nonnull %25)
          to label %28 unwind label %50

28:                                               ; preds = %26
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %7) #5
  %29 = call noalias noundef nonnull dereferenceable(88) ptr @_Znwm(i64 noundef 88) #6
  invoke void @_ZN7Riemann35TDynamicMeshScalarTriangleAttributeIbEC2EPNS_11DynamicMeshE(ptr noundef nonnull align 8 dereferenceable(88) %29, ptr noundef nonnull %0)
          to label %30 unwind label %52

30:                                               ; preds = %28
  call void @_ZN7Riemann29TDynamicMeshTriangleAttributeIbLi1EE10InitializeEb(ptr noundef nonnull align 8 dereferenceable(88) %29, i1 noundef zeroext true)
  %31 = call noundef ptr @_ZN7Riemann11DynamicMesh10AttributesEv(ptr noundef nonnull align 8 dereferenceable(452) %0)
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2ERKS4_(ptr noundef nonnull align 8 dereferenceable(32) %8, ptr noundef nonnull align 8 dereferenceable(32) @_ZN7Riemann18InternalAttribNameB5cxx11E)
  invoke void @_ZN7Riemann23DynamicMeshAttributeSet15AttachAttributeENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEPNS_21TDynamicAttributeBaseE(ptr noundef nonnull align 8 dereferenceable(168) %31, ptr noundef nonnull %8, ptr noundef nonnull %29)
          to label %32 unwind label %54

32:                                               ; preds = %30
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %8) #5
  call void @_ZN7Riemann23DynamicMeshAttributeSet16EnableUVChannelsEPNS_11DynamicMeshEibb(ptr noundef nonnull %0, i32 noundef %1, i1 noundef zeroext false, i1 noundef zeroext true)
  ret void

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

35:                                               ; preds = %12
  %36 = landingpad { ptr, i32 }
          cleanup
  call void @_ZdlPvm(ptr noundef nonnull %11, i64 noundef 72) #7
  br label %37

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

38:                                               ; preds = %18, %14
  %39 = landingpad { ptr, i32 }
          cleanup
  br label %42

40:                                               ; preds = %17
  %41 = landingpad { ptr, i32 }
          cleanup
  call void @_ZdlPvm(ptr noundef nonnull %16, i64 noundef 72) #7
  br label %42

42:                                               ; preds = %40, %38
  %.pn27 = phi { ptr, i32 } [ %39, %38 ], [ %41, %40 ]
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %5) #5
  br label %56

43:                                               ; preds = %23, %19
  %44 = landingpad { ptr, i32 }
          cleanup
  br label %47

45:                                               ; preds = %22
  %46 = landingpad { ptr, i32 }
          cleanup
  call void @_ZdlPvm(ptr noundef nonnull %21, i64 noundef 72) #7
  br label %47

47:                                               ; preds = %45, %43
  %.pn29 = phi { ptr, i32 } [ %44, %43 ], [ %46, %45 ]
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %6) #5
  br label %56

48:                                               ; preds = %24
  %49 = landingpad { ptr, i32 }
          cleanup
  call void @_ZdlPvm(ptr noundef nonnull %25, i64 noundef 88) #7
  br label %56

50:                                               ; preds = %26
  %51 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %7) #5
  br label %56

52:                                               ; preds = %28
  %53 = landingpad { ptr, i32 }
          cleanup
  call void @_ZdlPvm(ptr noundef nonnull %29, i64 noundef 88) #7
  br label %56

54:                                               ; preds = %30
  %55 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %8) #5
  br label %56

56:                                               ; preds = %48, %50, %54, %52, %47, %42, %37
  %.pn31.pn.pn = phi { ptr, i32 } [ %.pn29, %47 ], [ %.pn27, %42 ], [ %.pn, %37 ], [ %51, %50 ], [ %49, %48 ], [ %55, %54 ], [ %53, %52 ]
  resume { ptr, i32 } %.pn31.pn.pn
}

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN7Riemann11DynamicMesh19EnableVertexNormalsERKN5Maths8TVector3IfEE(ptr noundef nonnull align 8 dereferenceable(452), ptr noundef nonnull align 4 dereferenceable(12)) local_unnamed_addr #3 align 2

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN7Riemann23TDynamicVertexAttributeIfLi4EEC2EPNS_11DynamicMeshEb(ptr noundef nonnull align 8 dereferenceable(72), ptr noundef, i1 noundef zeroext) unnamed_addr #3 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN7Riemann23TDynamicVertexAttributeIfLi3EEC2EPNS_11DynamicMeshEb(ptr noundef nonnull align 8 dereferenceable(72), ptr noundef, i1 noundef zeroext) unnamed_addr #3 align 2

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

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

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { nobuiltin 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 #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 = { nobuiltin allocsize(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 = { builtin allocsize(0) }
attributes #7 = { builtin 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)"}


; Effective O3 passes: CorrelatedValuePropagationPass,GlobalOptPass,InferFunctionAttrsPass,InstCombinePass,SROAPass,SimplifyCFGPass