; LLVM IR from ThePhysicsGuys/Physics3D :: graphics/mesh/arrayMesh.ll (ZN3P3D8Graphics9ArrayMeshC2EPKfS3_jj)

; 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"

%"struct.P3D::Graphics::BufferDataType::Info" = type <{ %"class.std::__cxx11::basic_string", i32, i32, i32, i8, [3 x i8] }>
%"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] }
%"struct.P3D::Graphics::BufferLayout" = type <{ %"class.std::vector", i32, [4 x i8] }>
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<P3D::Graphics::BufferElement, std::allocator<P3D::Graphics::BufferElement>>::_Vector_impl" }
%"struct.std::_Vector_base<P3D::Graphics::BufferElement, std::allocator<P3D::Graphics::BufferElement>>::_Vector_impl" = type { %"struct.std::_Vector_base<P3D::Graphics::BufferElement, std::allocator<P3D::Graphics::BufferElement>>::_Vector_impl_data" }
%"struct.std::_Vector_base<P3D::Graphics::BufferElement, std::allocator<P3D::Graphics::BufferElement>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::initializer_list" = type { ptr, i64 }
%"struct.P3D::Graphics::BufferElement" = type <{ %"class.std::__cxx11::basic_string", %"struct.P3D::Graphics::BufferDataType::Info", i8, i8, [6 x i8] }>
%"class.std::allocator.0" = type { i8 }
%"class.std::allocator" = type { i8 }
%"class.P3D::Graphics::ArrayMesh" = type <{ %"class.P3D::Graphics::AbstractMesh.base", [4 x i8], %"struct.P3D::Graphics::BufferLayout", %"struct.P3D::Graphics::BufferLayout", ptr, ptr, i32, [4 x i8] }>
%"class.P3D::Graphics::AbstractMesh.base" = type <{ ptr, ptr, i32 }>
%"class.P3D::Graphics::AbstractMesh" = type <{ ptr, ptr, i32, [4 x i8] }>

@_ZTVN3P3D8Graphics9ArrayMeshE = external dso_local unnamed_addr constant { [4 x ptr] }, align 8
@.str = external hidden unnamed_addr constant [10 x i8], align 1
@_ZN3P3D8Graphics14BufferDataType6FLOAT2E = external global %"struct.P3D::Graphics::BufferDataType::Info", align 8
@_ZN3P3D8Graphics14BufferDataType6FLOAT3E = external global %"struct.P3D::Graphics::BufferDataType::Info", align 8
@.str.1 = external hidden unnamed_addr constant [4 x i8], align 1

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN3P3D8Graphics9ArrayMeshC2EPKfS3_jj(ptr noundef nonnull align 8 dereferenceable(108) %0, ptr noundef %1, ptr noundef %2, i32 noundef %3, i32 noundef %4) unnamed_addr #0 align 2 personality ptr @__gxx_personality_v0 {
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca ptr, align 8
  %12 = alloca i32, align 4
  %13 = alloca %"struct.P3D::Graphics::BufferLayout", align 8
  %14 = alloca %"class.std::vector", align 8
  %15 = alloca %"class.std::initializer_list", align 8
  %16 = alloca [1 x %"struct.P3D::Graphics::BufferElement"], align 8
  %17 = alloca ptr, align 8
  %18 = alloca %"class.std::__cxx11::basic_string", align 8
  %19 = alloca %"class.std::allocator.0", align 1
  %20 = alloca i1, align 1
  %21 = alloca %"class.std::allocator", align 1
  %22 = alloca %"struct.P3D::Graphics::BufferLayout", align 8
  %23 = alloca %"class.std::vector", align 8
  %24 = alloca %"class.std::initializer_list", align 8
  %25 = alloca [1 x %"struct.P3D::Graphics::BufferElement"], align 8
  %26 = alloca ptr, align 8
  %27 = alloca %"class.std::__cxx11::basic_string", align 8
  %28 = alloca %"class.std::allocator.0", align 1
  %29 = alloca i1, align 1
  %30 = alloca %"class.std::allocator", align 1
  store ptr %0, ptr %6, align 8, !tbaa !5
  store ptr %1, ptr %7, align 8, !tbaa !5
  store ptr %2, ptr %8, align 8, !tbaa !5
  store i32 %3, ptr %9, align 4, !tbaa !9
  store i32 %4, ptr %10, align 4, !tbaa !9
  %31 = load ptr, ptr %6, align 8
  call void @_ZN3P3D8Graphics12AbstractMeshC2Ev(ptr noundef nonnull align 8 dereferenceable(20) %31)
  store ptr getelementptr inbounds inrange(-16, 16) ({ [4 x ptr] }, ptr @_ZTVN3P3D8Graphics9ArrayMeshE, i32 0, i32 0, i32 2), ptr %31, align 8, !tbaa !11
  %32 = getelementptr inbounds %"class.P3D::Graphics::ArrayMesh", ptr %31, i32 0, i32 2
  call void @_ZN3P3D8Graphics12BufferLayoutC2Ev(ptr noundef nonnull align 8 dereferenceable(28) %32)
  %33 = getelementptr inbounds %"class.P3D::Graphics::ArrayMesh", ptr %31, i32 0, i32 3
  invoke void @_ZN3P3D8Graphics12BufferLayoutC2Ev(ptr noundef nonnull align 8 dereferenceable(28) %33)
          to label %34 unwind label %114

34:                                               ; preds = %5
  %35 = getelementptr inbounds %"class.P3D::Graphics::ArrayMesh", ptr %31, i32 0, i32 4
  store ptr null, ptr %35, align 8, !tbaa !13
  %36 = getelementptr inbounds %"class.P3D::Graphics::ArrayMesh", ptr %31, i32 0, i32 5
  store ptr null, ptr %36, align 8, !tbaa !21
  %37 = getelementptr inbounds %"class.P3D::Graphics::ArrayMesh", ptr %31, i32 0, i32 6
  %38 = load i32, ptr %9, align 4, !tbaa !9
  store i32 %38, ptr %37, align 8, !tbaa !22
  call void @llvm.lifetime.start.p0(i64 32, ptr %13) #7
  call void @llvm.lifetime.start.p0(i64 24, ptr %14) #7
  call void @llvm.lifetime.start.p0(i64 88, ptr %16) #7
  store i1 true, ptr %20, align 1
  store ptr %16, ptr %17, align 8
  call void @llvm.lifetime.start.p0(i64 32, ptr %18) #7
  call void @llvm.lifetime.start.p0(i64 1, ptr %19) #7
  call void @_ZNSaIcEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %19) #7
  invoke void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_(ptr noundef nonnull align 8 dereferenceable(32) %18, ptr noundef @.str, ptr noundef nonnull align 1 dereferenceable(1) %19)
          to label %39 unwind label %118

39:                                               ; preds = %34
  %40 = load i32, ptr %10, align 4, !tbaa !9
  %41 = icmp eq i32 %40, 2
  br i1 %41, label %42, label %43

42:                                               ; preds = %39
  br label %44

43:                                               ; preds = %39
  br label %44

44:                                               ; preds = %43, %42
  %45 = phi ptr [ @_ZN3P3D8Graphics14BufferDataType6FLOAT2E, %42 ], [ @_ZN3P3D8Graphics14BufferDataType6FLOAT3E, %43 ]
  invoke void @_ZN3P3D8Graphics13BufferElementC2ERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEERKNS0_14BufferDataType4InfoEbb(ptr noundef nonnull align 8 dereferenceable(82) %16, ptr noundef nonnull align 8 dereferenceable(32) %18, ptr noundef nonnull align 8 dereferenceable(45) %45, i1 noundef zeroext false, i1 noundef zeroext false)
          to label %46 unwind label %122

46:                                               ; preds = %44
  store i1 false, ptr %20, align 1
  %47 = getelementptr inbounds %"class.std::initializer_list", ptr %15, i32 0, i32 0
  store ptr %16, ptr %47, align 8, !tbaa !23
  %48 = getelementptr inbounds %"class.std::initializer_list", ptr %15, i32 0, i32 1
  store i64 1, ptr %48, align 8, !tbaa !26
  call void @llvm.lifetime.start.p0(i64 1, ptr %21) #7
  call void @_ZNSaIN3P3D8Graphics13BufferElementEEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %21) #7
  %49 = getelementptr inbounds { ptr, i64 }, ptr %15, i32 0, i32 0
  %50 = load ptr, ptr %49, align 8
  %51 = getelementptr inbounds { ptr, i64 }, ptr %15, i32 0, i32 1
  %52 = load i64, ptr %51, align 8
  invoke void @_ZNSt6vectorIN3P3D8Graphics13BufferElementESaIS2_EEC2ESt16initializer_listIS2_ERKS3_(ptr noundef nonnull align 8 dereferenceable(24) %14, ptr %50, i64 %52, ptr noundef nonnull align 1 dereferenceable(1) %21)
          to label %53 unwind label %126

53:                                               ; preds = %46
  invoke void @_ZN3P3D8Graphics12BufferLayoutC2ERKSt6vectorINS0_13BufferElementESaIS3_EE(ptr noundef nonnull align 8 dereferenceable(28) %13, ptr noundef nonnull align 8 dereferenceable(24) %14)
          to label %54 unwind label %130

54:                                               ; preds = %53
  %55 = getelementptr inbounds %"class.P3D::Graphics::ArrayMesh", ptr %31, i32 0, i32 2
  %56 = call noundef nonnull align 8 dereferenceable(28) ptr @_ZN3P3D8Graphics12BufferLayoutaSEOS1_(ptr noundef nonnull align 8 dereferenceable(28) %55, ptr noundef nonnull align 8 dereferenceable(28) %13) #7
  call void @_ZN3P3D8Graphics12BufferLayoutD2Ev(ptr noundef nonnull align 8 dereferenceable(28) %13) #7
  call void @_ZNSt6vectorIN3P3D8Graphics13BufferElementESaIS2_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %14) #7
  call void @_ZNSt15__new_allocatorIN3P3D8Graphics13BufferElementEED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %21) #7
  call void @llvm.lifetime.end.p0(i64 1, ptr %21) #7
  %57 = getelementptr inbounds [1 x %"struct.P3D::Graphics::BufferElement"], ptr %16, i32 0, i32 0
  %58 = getelementptr inbounds %"struct.P3D::Graphics::BufferElement", ptr %57, i64 1
  br label %59

59:                                               ; preds = %59, %54
  %60 = phi ptr [ %58, %54 ], [ %61, %59 ]
  %61 = getelementptr inbounds %"struct.P3D::Graphics::BufferElement", ptr %60, i64 -1
  call void @_ZN3P3D8Graphics13BufferElementD2Ev(ptr noundef nonnull align 8 dereferenceable(82) %61) #7
  %62 = icmp eq ptr %61, %57
  br i1 %62, label %63, label %59

63:                                               ; preds = %59
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %18) #7
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %19) #7
  call void @llvm.lifetime.end.p0(i64 1, ptr %19) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr %18) #7
  call void @llvm.lifetime.end.p0(i64 88, ptr %16) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr %14) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr %13) #7
  %64 = invoke noalias noundef nonnull ptr @_Znwm(i64 noundef 64) #8
          to label %65 unwind label %154

65:                                               ; preds = %63
  %66 = getelementptr inbounds %"class.P3D::Graphics::ArrayMesh", ptr %31, i32 0, i32 2
  %67 = load ptr, ptr %7, align 8, !tbaa !5
  %68 = load i32, ptr %10, align 4, !tbaa !9
  %69 = load i32, ptr %9, align 4, !tbaa !9
  %70 = mul i32 %68, %69
  %71 = zext i32 %70 to i64
  %72 = mul i64 %71, 4
  invoke void @_ZN3P3D8Graphics12VertexBufferC1ERKNS0_12BufferLayoutEPKvm(ptr noundef nonnull align 8 dereferenceable(64) %64, ptr noundef nonnull align 8 dereferenceable(28) %66, ptr noundef %67, i64 noundef %72)
          to label %73 unwind label %158

73:                                               ; preds = %65
  %74 = getelementptr inbounds %"class.P3D::Graphics::ArrayMesh", ptr %31, i32 0, i32 4
  store ptr %64, ptr %74, align 8, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 32, ptr %22) #7
  call void @llvm.lifetime.start.p0(i64 24, ptr %23) #7
  call void @llvm.lifetime.start.p0(i64 88, ptr %25) #7
  store i1 true, ptr %29, align 1
  store ptr %25, ptr %26, align 8
  call void @llvm.lifetime.start.p0(i64 32, ptr %27) #7
  call void @llvm.lifetime.start.p0(i64 1, ptr %28) #7
  call void @_ZNSaIcEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %28) #7
  invoke void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_(ptr noundef nonnull align 8 dereferenceable(32) %27, ptr noundef @.str.1, ptr noundef nonnull align 1 dereferenceable(1) %28)
          to label %75 unwind label %162

75:                                               ; preds = %73
  invoke void @_ZN3P3D8Graphics13BufferElementC2ERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEERKNS0_14BufferDataType4InfoEbb(ptr noundef nonnull align 8 dereferenceable(82) %25, ptr noundef nonnull align 8 dereferenceable(32) %27, ptr noundef nonnull align 8 dereferenceable(45) @_ZN3P3D8Graphics14BufferDataType6FLOAT2E, i1 noundef zeroext false, i1 noundef zeroext false)
          to label %76 unwind label %166

76:                                               ; preds = %75
  store i1 false, ptr %29, align 1
  %77 = getelementptr inbounds %"class.std::initializer_list", ptr %24, i32 0, i32 0
  store ptr %25, ptr %77, align 8, !tbaa !23
  %78 = getelementptr inbounds %"class.std::initializer_list", ptr %24, i32 0, i32 1
  store i64 1, ptr %78, align 8, !tbaa !26
  call void @llvm.lifetime.start.p0(i64 1, ptr %30) #7
  call void @_ZNSaIN3P3D8Graphics13BufferElementEEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %30) #7
  %79 = getelementptr inbounds { ptr, i64 }, ptr %24, i32 0, i32 0
  %80 = load ptr, ptr %79, align 8
  %81 = getelementptr inbounds { ptr, i64 }, ptr %24, i32 0, i32 1
  %82 = load i64, ptr %81, align 8
  invoke void @_ZNSt6vectorIN3P3D8Graphics13BufferElementESaIS2_EEC2ESt16initializer_listIS2_ERKS3_(ptr noundef nonnull align 8 dereferenceable(24) %23, ptr %80, i64 %82, ptr noundef nonnull align 1 dereferenceable(1) %30)
          to label %83 unwind label %170

83:                                               ; preds = %76
  invoke void @_ZN3P3D8Graphics12BufferLayoutC2ERKSt6vectorINS0_13BufferElementESaIS3_EE(ptr noundef nonnull align 8 dereferenceable(28) %22, ptr noundef nonnull align 8 dereferenceable(24) %23)
          to label %84 unwind label %174

84:                                               ; preds = %83
  %85 = getelementptr inbounds %"class.P3D::Graphics::ArrayMesh", ptr %31, i32 0, i32 3
  %86 = call noundef nonnull align 8 dereferenceable(28) ptr @_ZN3P3D8Graphics12BufferLayoutaSEOS1_(ptr noundef nonnull align 8 dereferenceable(28) %85, ptr noundef nonnull align 8 dereferenceable(28) %22) #7
  call void @_ZN3P3D8Graphics12BufferLayoutD2Ev(ptr noundef nonnull align 8 dereferenceable(28) %22) #7
  call void @_ZNSt6vectorIN3P3D8Graphics13BufferElementESaIS2_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %23) #7
  call void @_ZNSt15__new_allocatorIN3P3D8Graphics13BufferElementEED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %30) #7
  call void @llvm.lifetime.end.p0(i64 1, ptr %30) #7
  %87 = getelementptr inbounds [1 x %"struct.P3D::Graphics::BufferElement"], ptr %25, i32 0, i32 0
  %88 = getelementptr inbounds %"struct.P3D::Graphics::BufferElement", ptr %87, i64 1
  br label %89

89:                                               ; preds = %89, %84
  %90 = phi ptr [ %88, %84 ], [ %91, %89 ]
  %91 = getelementptr inbounds %"struct.P3D::Graphics::BufferElement", ptr %90, i64 -1
  call void @_ZN3P3D8Graphics13BufferElementD2Ev(ptr noundef nonnull align 8 dereferenceable(82) %91) #7
  %92 = icmp eq ptr %91, %87
  br i1 %92, label %93, label %89

93:                                               ; preds = %89
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %27) #7
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %28) #7
  call void @llvm.lifetime.end.p0(i64 1, ptr %28) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr %27) #7
  call void @llvm.lifetime.end.p0(i64 88, ptr %25) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr %23) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr %22) #7
  %94 = invoke noalias noundef nonnull ptr @_Znwm(i64 noundef 64) #8
          to label %95 unwind label %154

95:                                               ; preds = %93
  %96 = getelementptr inbounds %"class.P3D::Graphics::ArrayMesh", ptr %31, i32 0, i32 3
  %97 = load ptr, ptr %8, align 8, !tbaa !5
  %98 = load i32, ptr %9, align 4, !tbaa !9
  %99 = mul i32 2, %98
  %100 = zext i32 %99 to i64
  %101 = mul i64 %100, 4
  invoke void @_ZN3P3D8Graphics12VertexBufferC1ERKNS0_12BufferLayoutEPKvm(ptr noundef nonnull align 8 dereferenceable(64) %94, ptr noundef nonnull align 8 dereferenceable(28) %96, ptr noundef %97, i64 noundef %101)
          to label %102 unwind label %198

102:                                              ; preds = %95
  %103 = getelementptr inbounds %"class.P3D::Graphics::ArrayMesh", ptr %31, i32 0, i32 5
  store ptr %94, ptr %103, align 8, !tbaa !21
  %104 = getelementptr inbounds %"class.P3D::Graphics::AbstractMesh", ptr %31, i32 0, i32 1
  %105 = load ptr, ptr %104, align 8, !tbaa !27
  %106 = getelementptr inbounds %"class.P3D::Graphics::ArrayMesh", ptr %31, i32 0, i32 4
  %107 = load ptr, ptr %106, align 8, !tbaa !13
  invoke void @_ZN3P3D8Graphics11VertexArray9addBufferEPNS0_12VertexBufferE(ptr noundef nonnull align 8 dereferenceable(16) %105, ptr noundef %107)
          to label %108 unwind label %154

108:                                              ; preds = %102
  %109 = getelementptr inbounds %"class.P3D::Graphics::AbstractMesh", ptr %31, i32 0, i32 1
  %110 = load ptr, ptr %109, align 8, !tbaa !27
  %111 = getelementptr inbounds %"class.P3D::Graphics::ArrayMesh", ptr %31, i32 0, i32 5
  %112 = load ptr, ptr %111, align 8, !tbaa !21
  invoke void @_ZN3P3D8Graphics11VertexArray9addBufferEPNS0_12VertexBufferE(ptr noundef nonnull align 8 dereferenceable(16) %110, ptr noundef %112)
          to label %113 unwind label %154

113:                                              ; preds = %108
  ret void

114:                                              ; preds = %5
  %115 = landingpad { ptr, i32 }
          cleanup
  %116 = extractvalue { ptr, i32 } %115, 0
  store ptr %116, ptr %11, align 8
  %117 = extractvalue { ptr, i32 } %115, 1
  store i32 %117, ptr %12, align 4
  br label %203

118:                                              ; preds = %34
  %119 = landingpad { ptr, i32 }
          cleanup
  %120 = extractvalue { ptr, i32 } %119, 0
  store ptr %120, ptr %11, align 8
  %121 = extractvalue { ptr, i32 } %119, 1
  store i32 %121, ptr %12, align 4
  br label %143

122:                                              ; preds = %44
  %123 = landingpad { ptr, i32 }
          cleanup
  %124 = extractvalue { ptr, i32 } %123, 0
  store ptr %124, ptr %11, align 8
  %125 = extractvalue { ptr, i32 } %123, 1
  store i32 %125, ptr %12, align 4
  br label %142

126:                                              ; preds = %46
  %127 = landingpad { ptr, i32 }
          cleanup
  %128 = extractvalue { ptr, i32 } %127, 0
  store ptr %128, ptr %11, align 8
  %129 = extractvalue { ptr, i32 } %127, 1
  store i32 %129, ptr %12, align 4
  br label %134

130:                                              ; preds = %53
  %131 = landingpad { ptr, i32 }
          cleanup
  %132 = extractvalue { ptr, i32 } %131, 0
  store ptr %132, ptr %11, align 8
  %133 = extractvalue { ptr, i32 } %131, 1
  store i32 %133, ptr %12, align 4
  call void @_ZNSt6vectorIN3P3D8Graphics13BufferElementESaIS2_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %14) #7
  br label %134

134:                                              ; preds = %130, %126
  call void @_ZNSt15__new_allocatorIN3P3D8Graphics13BufferElementEED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %21) #7
  call void @llvm.lifetime.end.p0(i64 1, ptr %21) #7
  %135 = getelementptr inbounds [1 x %"struct.P3D::Graphics::BufferElement"], ptr %16, i32 0, i32 0
  %136 = getelementptr inbounds %"struct.P3D::Graphics::BufferElement", ptr %135, i64 1
  br label %137

137:                                              ; preds = %137, %134
  %138 = phi ptr [ %136, %134 ], [ %139, %137 ]
  %139 = getelementptr inbounds %"struct.P3D::Graphics::BufferElement", ptr %138, i64 -1
  call void @_ZN3P3D8Graphics13BufferElementD2Ev(ptr noundef nonnull align 8 dereferenceable(82) %139) #7
  %140 = icmp eq ptr %139, %135
  br i1 %140, label %141, label %137

141:                                              ; preds = %137
  br label %142

142:                                              ; preds = %141, %122
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %18) #7
  br label %143

143:                                              ; preds = %142, %118
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %19) #7
  call void @llvm.lifetime.end.p0(i64 1, ptr %19) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr %18) #7
  %144 = load i1, ptr %20, align 1
  br i1 %144, label %145, label %153

145:                                              ; preds = %143
  %146 = load ptr, ptr %17, align 8
  %147 = icmp eq ptr %16, %146
  br i1 %147, label %152, label %148

148:                                              ; preds = %148, %145
  %149 = phi ptr [ %146, %145 ], [ %150, %148 ]
  %150 = getelementptr inbounds %"struct.P3D::Graphics::BufferElement", ptr %149, i64 -1
  call void @_ZN3P3D8Graphics13BufferElementD2Ev(ptr noundef nonnull align 8 dereferenceable(82) %150) #7
  %151 = icmp eq ptr %150, %16
  br i1 %151, label %152, label %148

152:                                              ; preds = %148, %145
  br label %153

153:                                              ; preds = %152, %143
  call void @llvm.lifetime.end.p0(i64 88, ptr %16) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr %14) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr %13) #7
  br label %202

154:                                              ; preds = %108, %102, %93, %63
  %155 = landingpad { ptr, i32 }
          cleanup
  %156 = extractvalue { ptr, i32 } %155, 0
  store ptr %156, ptr %11, align 8
  %157 = extractvalue { ptr, i32 } %155, 1
  store i32 %157, ptr %12, align 4
  br label %202

158:                                              ; preds = %65
  %159 = landingpad { ptr, i32 }
          cleanup
  %160 = extractvalue { ptr, i32 } %159, 0
  store ptr %160, ptr %11, align 8
  %161 = extractvalue { ptr, i32 } %159, 1
  store i32 %161, ptr %12, align 4
  call void @_ZdlPvm(ptr noundef %64, i64 noundef 64) #9
  br label %202

162:                                              ; preds = %73
  %163 = landingpad { ptr, i32 }
          cleanup
  %164 = extractvalue { ptr, i32 } %163, 0
  store ptr %164, ptr %11, align 8
  %165 = extractvalue { ptr, i32 } %163, 1
  store i32 %165, ptr %12, align 4
  br label %187

166:                                              ; preds = %75
  %167 = landingpad { ptr, i32 }
          cleanup
  %168 = extractvalue { ptr, i32 } %167, 0
  store ptr %168, ptr %11, align 8
  %169 = extractvalue { ptr, i32 } %167, 1
  store i32 %169, ptr %12, align 4
  br label %186

170:                                              ; preds = %76
  %171 = landingpad { ptr, i32 }
          cleanup
  %172 = extractvalue { ptr, i32 } %171, 0
  store ptr %172, ptr %11, align 8
  %173 = extractvalue { ptr, i32 } %171, 1
  store i32 %173, ptr %12, align 4
  br label %178

174:                                              ; preds = %83
  %175 = landingpad { ptr, i32 }
          cleanup
  %176 = extractvalue { ptr, i32 } %175, 0
  store ptr %176, ptr %11, align 8
  %177 = extractvalue { ptr, i32 } %175, 1
  store i32 %177, ptr %12, align 4
  call void @_ZNSt6vectorIN3P3D8Graphics13BufferElementESaIS2_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %23) #7
  br label %178

178:                                              ; preds = %174, %170
  call void @_ZNSt15__new_allocatorIN3P3D8Graphics13BufferElementEED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %30) #7
  call void @llvm.lifetime.end.p0(i64 1, ptr %30) #7
  %179 = getelementptr inbounds [1 x %"struct.P3D::Graphics::BufferElement"], ptr %25, i32 0, i32 0
  %180 = getelementptr inbounds %"struct.P3D::Graphics::BufferElement", ptr %179, i64 1
  br label %181

181:                                              ; preds = %181, %178
  %182 = phi ptr [ %180, %178 ], [ %183, %181 ]
  %183 = getelementptr inbounds %"struct.P3D::Graphics::BufferElement", ptr %182, i64 -1
  call void @_ZN3P3D8Graphics13BufferElementD2Ev(ptr noundef nonnull align 8 dereferenceable(82) %183) #7
  %184 = icmp eq ptr %183, %179
  br i1 %184, label %185, label %181

185:                                              ; preds = %181
  br label %186

186:                                              ; preds = %185, %166
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %27) #7
  br label %187

187:                                              ; preds = %186, %162
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %28) #7
  call void @llvm.lifetime.end.p0(i64 1, ptr %28) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr %27) #7
  %188 = load i1, ptr %29, align 1
  br i1 %188, label %189, label %197

189:                                              ; preds = %187
  %190 = load ptr, ptr %26, align 8
  %191 = icmp eq ptr %25, %190
  br i1 %191, label %196, label %192

192:                                              ; preds = %192, %189
  %193 = phi ptr [ %190, %189 ], [ %194, %192 ]
  %194 = getelementptr inbounds %"struct.P3D::Graphics::BufferElement", ptr %193, i64 -1
  call void @_ZN3P3D8Graphics13BufferElementD2Ev(ptr noundef nonnull align 8 dereferenceable(82) %194) #7
  %195 = icmp eq ptr %194, %25
  br i1 %195, label %196, label %192

196:                                              ; preds = %192, %189
  br label %197

197:                                              ; preds = %196, %187
  call void @llvm.lifetime.end.p0(i64 88, ptr %25) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr %23) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr %22) #7
  br label %202

198:                                              ; preds = %95
  %199 = landingpad { ptr, i32 }
          cleanup
  %200 = extractvalue { ptr, i32 } %199, 0
  store ptr %200, ptr %11, align 8
  %201 = extractvalue { ptr, i32 } %199, 1
  store i32 %201, ptr %12, align 4
  call void @_ZdlPvm(ptr noundef %94, i64 noundef 64) #9
  br label %202

202:                                              ; preds = %198, %197, %158, %154, %153
  call void @_ZN3P3D8Graphics12BufferLayoutD2Ev(ptr noundef nonnull align 8 dereferenceable(28) %33) #7
  br label %203

203:                                              ; preds = %202, %114
  call void @_ZN3P3D8Graphics12BufferLayoutD2Ev(ptr noundef nonnull align 8 dereferenceable(28) %32) #7
  br label %204

204:                                              ; preds = %203
  %205 = load ptr, ptr %11, align 8
  %206 = load i32, ptr %12, align 4
  %207 = insertvalue { ptr, i32 } poison, ptr %205, 0
  %208 = insertvalue { ptr, i32 } %207, i32 %206, 1
  resume { ptr, i32 } %208
}

declare void @_ZN3P3D8Graphics12AbstractMeshC2Ev(ptr noundef nonnull align 8 dereferenceable(20)) unnamed_addr #1

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

declare i32 @__gxx_personality_v0(...)

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_(ptr noundef nonnull align 8 dereferenceable(32), ptr noundef, ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #0 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN3P3D8Graphics13BufferElementC2ERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEERKNS0_14BufferDataType4InfoEbb(ptr noundef nonnull align 8 dereferenceable(82), ptr noundef nonnull align 8 dereferenceable(32), ptr noundef nonnull align 8 dereferenceable(45), i1 noundef zeroext, i1 noundef zeroext) unnamed_addr #0 align 2

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

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

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

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

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

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

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

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

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

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

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

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

declare void @_ZN3P3D8Graphics12VertexBufferC1ERKNS0_12BufferLayoutEPKvm(ptr noundef nonnull align 8 dereferenceable(64), ptr noundef nonnull align 8 dereferenceable(28), ptr noundef, i64 noundef) unnamed_addr #1

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

declare void @_ZN3P3D8Graphics11VertexArray9addBufferEPNS0_12VertexBufferE(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef) #1

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 = { "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 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { 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 #6 = { 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 #7 = { nounwind }
attributes #8 = { builtin allocsize(0) }
attributes #9 = { 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}
!11 = !{!12, !12, i64 0}
!12 = !{!"vtable pointer", !8, i64 0}
!13 = !{!14, !6, i64 88}
!14 = !{!"_ZTSN3P3D8Graphics9ArrayMeshE", !15, i64 0, !16, i64 24, !16, i64 56, !6, i64 88, !6, i64 96, !10, i64 104}
!15 = !{!"_ZTSN3P3D8Graphics12AbstractMeshE", !6, i64 8, !10, i64 16}
!16 = !{!"_ZTSN3P3D8Graphics12BufferLayoutE", !17, i64 0, !10, i64 24}
!17 = !{!"_ZTSSt6vectorIN3P3D8Graphics13BufferElementESaIS2_EE", !18, i64 0}
!18 = !{!"_ZTSSt12_Vector_baseIN3P3D8Graphics13BufferElementESaIS2_EE", !19, i64 0}
!19 = !{!"_ZTSNSt12_Vector_baseIN3P3D8Graphics13BufferElementESaIS2_EE12_Vector_implE", !20, i64 0}
!20 = !{!"_ZTSNSt12_Vector_baseIN3P3D8Graphics13BufferElementESaIS2_EE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!21 = !{!14, !6, i64 96}
!22 = !{!14, !10, i64 104}
!23 = !{!24, !6, i64 0}
!24 = !{!"_ZTSSt16initializer_listIN3P3D8Graphics13BufferElementEE", !6, i64 0, !25, i64 8}
!25 = !{!"long", !7, i64 0}
!26 = !{!24, !25, i64 8}
!27 = !{!15, !6, i64 8}


; 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"

%"struct.P3D::Graphics::BufferDataType::Info" = type <{ %"class.std::__cxx11::basic_string", i32, i32, i32, i8, [3 x i8] }>
%"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] }
%"struct.P3D::Graphics::BufferLayout" = type <{ %"class.std::vector", i32, [4 x i8] }>
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<P3D::Graphics::BufferElement, std::allocator<P3D::Graphics::BufferElement>>::_Vector_impl" }
%"struct.std::_Vector_base<P3D::Graphics::BufferElement, std::allocator<P3D::Graphics::BufferElement>>::_Vector_impl" = type { %"struct.std::_Vector_base<P3D::Graphics::BufferElement, std::allocator<P3D::Graphics::BufferElement>>::_Vector_impl_data" }
%"struct.std::_Vector_base<P3D::Graphics::BufferElement, std::allocator<P3D::Graphics::BufferElement>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"struct.P3D::Graphics::BufferElement" = type <{ %"class.std::__cxx11::basic_string", %"struct.P3D::Graphics::BufferDataType::Info", i8, i8, [6 x i8] }>
%"class.std::allocator.0" = type { i8 }
%"class.std::allocator" = type { i8 }

@_ZTVN3P3D8Graphics9ArrayMeshE = external dso_local unnamed_addr constant { [4 x ptr] }, align 8
@.str = external hidden unnamed_addr constant [10 x i8], align 1
@_ZN3P3D8Graphics14BufferDataType6FLOAT2E = external global %"struct.P3D::Graphics::BufferDataType::Info", align 8
@_ZN3P3D8Graphics14BufferDataType6FLOAT3E = external global %"struct.P3D::Graphics::BufferDataType::Info", align 8
@.str.1 = external hidden unnamed_addr constant [4 x i8], align 1

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN3P3D8Graphics9ArrayMeshC2EPKfS3_jj(ptr noundef nonnull align 8 dereferenceable(108) %0, ptr noundef %1, ptr noundef %2, i32 noundef %3, i32 noundef %4) unnamed_addr #0 align 2 personality ptr @__gxx_personality_v0 {
  %6 = alloca %"struct.P3D::Graphics::BufferLayout", align 8
  %7 = alloca %"class.std::vector", align 8
  %8 = alloca [1 x %"struct.P3D::Graphics::BufferElement"], align 8
  %9 = alloca %"class.std::__cxx11::basic_string", align 8
  %10 = alloca %"class.std::allocator.0", align 1
  %11 = alloca %"class.std::allocator", align 1
  %12 = alloca %"struct.P3D::Graphics::BufferLayout", align 8
  %13 = alloca %"class.std::vector", align 8
  %14 = alloca [1 x %"struct.P3D::Graphics::BufferElement"], align 8
  %15 = alloca %"class.std::__cxx11::basic_string", align 8
  %16 = alloca %"class.std::allocator.0", align 1
  %17 = alloca %"class.std::allocator", align 1
  tail call void @_ZN3P3D8Graphics12AbstractMeshC2Ev(ptr noundef nonnull align 8 dereferenceable(20) %0)
  store ptr getelementptr inbounds inrange(-16, 16) (i8, ptr @_ZTVN3P3D8Graphics9ArrayMeshE, i64 16), ptr %0, align 8, !tbaa !5
  %18 = getelementptr inbounds i8, ptr %0, i64 24
  tail call void @_ZN3P3D8Graphics12BufferLayoutC2Ev(ptr noundef nonnull align 8 dereferenceable(28) %18)
  %19 = getelementptr inbounds i8, ptr %0, i64 56
  invoke void @_ZN3P3D8Graphics12BufferLayoutC2Ev(ptr noundef nonnull align 8 dereferenceable(28) %19)
          to label %20 unwind label %54

20:                                               ; preds = %5
  %21 = getelementptr inbounds i8, ptr %0, i64 88
  %22 = getelementptr inbounds i8, ptr %0, i64 96
  %23 = getelementptr inbounds i8, ptr %0, i64 104
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %21, i8 0, i64 16, i1 false)
  store i32 %3, ptr %23, align 8, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %6) #8
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %7) #8
  call void @llvm.lifetime.start.p0(i64 88, ptr nonnull %8) #8
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %9) #8
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %10) #8
  call void @_ZNSaIcEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %10) #8
  invoke void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_(ptr noundef nonnull align 8 dereferenceable(32) %9, ptr noundef nonnull @.str, ptr noundef nonnull align 1 dereferenceable(1) %10)
          to label %24 unwind label %56

24:                                               ; preds = %20
  %25 = icmp eq i32 %4, 2
  %_ZN3P3D8Graphics14BufferDataType6FLOAT2E._ZN3P3D8Graphics14BufferDataType6FLOAT3E = select i1 %25, ptr @_ZN3P3D8Graphics14BufferDataType6FLOAT2E, ptr @_ZN3P3D8Graphics14BufferDataType6FLOAT3E
  invoke void @_ZN3P3D8Graphics13BufferElementC2ERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEERKNS0_14BufferDataType4InfoEbb(ptr noundef nonnull align 8 dereferenceable(82) %8, ptr noundef nonnull align 8 dereferenceable(32) %9, ptr noundef nonnull align 8 dereferenceable(45) %_ZN3P3D8Graphics14BufferDataType6FLOAT2E._ZN3P3D8Graphics14BufferDataType6FLOAT3E, i1 noundef zeroext false, i1 noundef zeroext false)
          to label %26 unwind label %58

26:                                               ; preds = %24
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %11) #8
  call void @_ZNSaIN3P3D8Graphics13BufferElementEEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %11) #8
  invoke void @_ZNSt6vectorIN3P3D8Graphics13BufferElementESaIS2_EEC2ESt16initializer_listIS2_ERKS3_(ptr noundef nonnull align 8 dereferenceable(24) %7, ptr nonnull %8, i64 1, ptr noundef nonnull align 1 dereferenceable(1) %11)
          to label %27 unwind label %60

27:                                               ; preds = %26
  invoke void @_ZN3P3D8Graphics12BufferLayoutC2ERKSt6vectorINS0_13BufferElementESaIS3_EE(ptr noundef nonnull align 8 dereferenceable(28) %6, ptr noundef nonnull align 8 dereferenceable(24) %7)
          to label %28 unwind label %62

28:                                               ; preds = %27
  %29 = call noundef nonnull align 8 dereferenceable(28) ptr @_ZN3P3D8Graphics12BufferLayoutaSEOS1_(ptr noundef nonnull align 8 dereferenceable(28) %18, ptr noundef nonnull align 8 dereferenceable(28) %6) #8
  call void @_ZN3P3D8Graphics12BufferLayoutD2Ev(ptr noundef nonnull align 8 dereferenceable(28) %6) #8
  call void @_ZNSt6vectorIN3P3D8Graphics13BufferElementESaIS2_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %7) #8
  call void @_ZNSt15__new_allocatorIN3P3D8Graphics13BufferElementEED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %11) #8
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %11) #8
  call void @_ZN3P3D8Graphics13BufferElementD2Ev(ptr noundef nonnull align 8 dereferenceable(82) %8) #8
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %9) #8
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %10) #8
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %10) #8
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %9) #8
  call void @llvm.lifetime.end.p0(i64 88, ptr nonnull %8) #8
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %7) #8
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %6) #8
  %30 = invoke noalias noundef nonnull dereferenceable(64) ptr @_Znwm(i64 noundef 64) #9
          to label %31 unwind label %65

31:                                               ; preds = %28
  %32 = mul i32 %4, %3
  %33 = zext i32 %32 to i64
  %34 = shl nuw nsw i64 %33, 2
  invoke void @_ZN3P3D8Graphics12VertexBufferC1ERKNS0_12BufferLayoutEPKvm(ptr noundef nonnull align 8 dereferenceable(64) %30, ptr noundef nonnull align 8 dereferenceable(28) %18, ptr noundef %1, i64 noundef %34)
          to label %35 unwind label %67

35:                                               ; preds = %31
  store ptr %30, ptr %21, align 8, !tbaa !19
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %12) #8
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %13) #8
  call void @llvm.lifetime.start.p0(i64 88, ptr nonnull %14) #8
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %15) #8
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %16) #8
  call void @_ZNSaIcEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %16) #8
  invoke void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_(ptr noundef nonnull align 8 dereferenceable(32) %15, ptr noundef nonnull @.str.1, ptr noundef nonnull align 1 dereferenceable(1) %16)
          to label %36 unwind label %69

36:                                               ; preds = %35
  invoke void @_ZN3P3D8Graphics13BufferElementC2ERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEERKNS0_14BufferDataType4InfoEbb(ptr noundef nonnull align 8 dereferenceable(82) %14, ptr noundef nonnull align 8 dereferenceable(32) %15, ptr noundef nonnull align 8 dereferenceable(45) @_ZN3P3D8Graphics14BufferDataType6FLOAT2E, i1 noundef zeroext false, i1 noundef zeroext false)
          to label %37 unwind label %71

37:                                               ; preds = %36
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %17) #8
  call void @_ZNSaIN3P3D8Graphics13BufferElementEEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %17) #8
  invoke void @_ZNSt6vectorIN3P3D8Graphics13BufferElementESaIS2_EEC2ESt16initializer_listIS2_ERKS3_(ptr noundef nonnull align 8 dereferenceable(24) %13, ptr nonnull %14, i64 1, ptr noundef nonnull align 1 dereferenceable(1) %17)
          to label %38 unwind label %73

38:                                               ; preds = %37
  invoke void @_ZN3P3D8Graphics12BufferLayoutC2ERKSt6vectorINS0_13BufferElementESaIS3_EE(ptr noundef nonnull align 8 dereferenceable(28) %12, ptr noundef nonnull align 8 dereferenceable(24) %13)
          to label %39 unwind label %75

39:                                               ; preds = %38
  %40 = call noundef nonnull align 8 dereferenceable(28) ptr @_ZN3P3D8Graphics12BufferLayoutaSEOS1_(ptr noundef nonnull align 8 dereferenceable(28) %19, ptr noundef nonnull align 8 dereferenceable(28) %12) #8
  call void @_ZN3P3D8Graphics12BufferLayoutD2Ev(ptr noundef nonnull align 8 dereferenceable(28) %12) #8
  call void @_ZNSt6vectorIN3P3D8Graphics13BufferElementESaIS2_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %13) #8
  call void @_ZNSt15__new_allocatorIN3P3D8Graphics13BufferElementEED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %17) #8
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %17) #8
  call void @_ZN3P3D8Graphics13BufferElementD2Ev(ptr noundef nonnull align 8 dereferenceable(82) %14) #8
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %15) #8
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %16) #8
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %16) #8
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %15) #8
  call void @llvm.lifetime.end.p0(i64 88, ptr nonnull %14) #8
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %13) #8
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %12) #8
  %41 = invoke noalias noundef nonnull dereferenceable(64) ptr @_Znwm(i64 noundef 64) #9
          to label %42 unwind label %65

42:                                               ; preds = %39
  %43 = shl i32 %3, 1
  %44 = zext i32 %43 to i64
  %45 = shl nuw nsw i64 %44, 2
  invoke void @_ZN3P3D8Graphics12VertexBufferC1ERKNS0_12BufferLayoutEPKvm(ptr noundef nonnull align 8 dereferenceable(64) %41, ptr noundef nonnull align 8 dereferenceable(28) %19, ptr noundef %2, i64 noundef %45)
          to label %46 unwind label %78

46:                                               ; preds = %42
  store ptr %41, ptr %22, align 8, !tbaa !20
  %47 = getelementptr inbounds i8, ptr %0, i64 8
  %48 = load ptr, ptr %47, align 8, !tbaa !21
  %49 = load ptr, ptr %21, align 8, !tbaa !19
  invoke void @_ZN3P3D8Graphics11VertexArray9addBufferEPNS0_12VertexBufferE(ptr noundef nonnull align 8 dereferenceable(16) %48, ptr noundef %49)
          to label %50 unwind label %65

50:                                               ; preds = %46
  %51 = load ptr, ptr %47, align 8, !tbaa !21
  %52 = load ptr, ptr %22, align 8, !tbaa !20
  invoke void @_ZN3P3D8Graphics11VertexArray9addBufferEPNS0_12VertexBufferE(ptr noundef nonnull align 8 dereferenceable(16) %51, ptr noundef %52)
          to label %53 unwind label %65

53:                                               ; preds = %50
  ret void

54:                                               ; preds = %5
  %55 = landingpad { ptr, i32 }
          cleanup
  br label %81

56:                                               ; preds = %20
  %57 = landingpad { ptr, i32 }
          cleanup
  br label %64

58:                                               ; preds = %24
  %59 = landingpad { ptr, i32 }
          cleanup
  br label %.loopexit43

60:                                               ; preds = %26
  %61 = landingpad { ptr, i32 }
          cleanup
  br label %.loopexit43.loopexit

62:                                               ; preds = %27
  %63 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt6vectorIN3P3D8Graphics13BufferElementESaIS2_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %7) #8
  br label %.loopexit43.loopexit

.loopexit43.loopexit:                             ; preds = %62, %60
  %.pn = phi { ptr, i32 } [ %63, %62 ], [ %61, %60 ]
  call void @_ZNSt15__new_allocatorIN3P3D8Graphics13BufferElementEED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %11) #8
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %11) #8
  call void @_ZN3P3D8Graphics13BufferElementD2Ev(ptr noundef nonnull align 8 dereferenceable(82) %8) #8
  br label %.loopexit43

.loopexit43:                                      ; preds = %.loopexit43.loopexit, %58
  %.pn.pn = phi { ptr, i32 } [ %59, %58 ], [ %.pn, %.loopexit43.loopexit ]
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %9) #8
  br label %64

64:                                               ; preds = %.loopexit43, %56
  %.pn.pn.pn = phi { ptr, i32 } [ %.pn.pn, %.loopexit43 ], [ %57, %56 ]
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %10) #8
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %10) #8
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %9) #8
  call void @llvm.lifetime.end.p0(i64 88, ptr nonnull %8) #8
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %7) #8
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %6) #8
  br label %80

65:                                               ; preds = %50, %46, %39, %28
  %66 = landingpad { ptr, i32 }
          cleanup
  br label %80

67:                                               ; preds = %31
  %68 = landingpad { ptr, i32 }
          cleanup
  call void @_ZdlPvm(ptr noundef nonnull %30, i64 noundef 64) #10
  br label %80

69:                                               ; preds = %35
  %70 = landingpad { ptr, i32 }
          cleanup
  br label %77

71:                                               ; preds = %36
  %72 = landingpad { ptr, i32 }
          cleanup
  br label %.loopexit

73:                                               ; preds = %37
  %74 = landingpad { ptr, i32 }
          cleanup
  br label %.loopexit.loopexit

75:                                               ; preds = %38
  %76 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt6vectorIN3P3D8Graphics13BufferElementESaIS2_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %13) #8
  br label %.loopexit.loopexit

.loopexit.loopexit:                               ; preds = %75, %73
  %.pn36 = phi { ptr, i32 } [ %76, %75 ], [ %74, %73 ]
  call void @_ZNSt15__new_allocatorIN3P3D8Graphics13BufferElementEED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %17) #8
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %17) #8
  call void @_ZN3P3D8Graphics13BufferElementD2Ev(ptr noundef nonnull align 8 dereferenceable(82) %14) #8
  br label %.loopexit

.loopexit:                                        ; preds = %.loopexit.loopexit, %71
  %.pn36.pn = phi { ptr, i32 } [ %72, %71 ], [ %.pn36, %.loopexit.loopexit ]
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %15) #8
  br label %77

77:                                               ; preds = %.loopexit, %69
  %.pn36.pn.pn = phi { ptr, i32 } [ %.pn36.pn, %.loopexit ], [ %70, %69 ]
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %16) #8
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %16) #8
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %15) #8
  call void @llvm.lifetime.end.p0(i64 88, ptr nonnull %14) #8
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %13) #8
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %12) #8
  br label %80

78:                                               ; preds = %42
  %79 = landingpad { ptr, i32 }
          cleanup
  call void @_ZdlPvm(ptr noundef nonnull %41, i64 noundef 64) #10
  br label %80

80:                                               ; preds = %78, %77, %67, %65, %64
  %.pn40 = phi { ptr, i32 } [ %66, %65 ], [ %79, %78 ], [ %.pn36.pn.pn, %77 ], [ %68, %67 ], [ %.pn.pn.pn, %64 ]
  call void @_ZN3P3D8Graphics12BufferLayoutD2Ev(ptr noundef nonnull align 8 dereferenceable(28) %19) #8
  br label %81

81:                                               ; preds = %80, %54
  %.pn40.pn = phi { ptr, i32 } [ %.pn40, %80 ], [ %55, %54 ]
  call void @_ZN3P3D8Graphics12BufferLayoutD2Ev(ptr noundef nonnull align 8 dereferenceable(28) %18) #8
  resume { ptr, i32 } %.pn40.pn
}

declare void @_ZN3P3D8Graphics12AbstractMeshC2Ev(ptr noundef nonnull align 8 dereferenceable(20)) unnamed_addr #1

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

declare i32 @__gxx_personality_v0(...)

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_(ptr noundef nonnull align 8 dereferenceable(32), ptr noundef, ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #0 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN3P3D8Graphics13BufferElementC2ERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEERKNS0_14BufferDataType4InfoEbb(ptr noundef nonnull align 8 dereferenceable(82), ptr noundef nonnull align 8 dereferenceable(32), ptr noundef nonnull align 8 dereferenceable(45), i1 noundef zeroext, i1 noundef zeroext) unnamed_addr #0 align 2

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

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

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

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

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

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

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

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

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

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

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

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

declare void @_ZN3P3D8Graphics12VertexBufferC1ERKNS0_12BufferLayoutEPKvm(ptr noundef nonnull align 8 dereferenceable(64), ptr noundef nonnull align 8 dereferenceable(28), ptr noundef, i64 noundef) unnamed_addr #1

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

declare void @_ZN3P3D8Graphics11VertexArray9addBufferEPNS0_12VertexBufferE(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef) local_unnamed_addr #1

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

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 = { "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 nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { 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 #6 = { 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 #7 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #8 = { nounwind }
attributes #9 = { builtin allocsize(0) }
attributes #10 = { 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 = !{!"vtable pointer", !7, i64 0}
!7 = !{!"Simple C++ TBAA"}
!8 = !{!9, !13, i64 104}
!9 = !{!"_ZTSN3P3D8Graphics9ArrayMeshE", !10, i64 0, !14, i64 24, !14, i64 56, !11, i64 88, !11, i64 96, !13, i64 104}
!10 = !{!"_ZTSN3P3D8Graphics12AbstractMeshE", !11, i64 8, !13, i64 16}
!11 = !{!"any pointer", !12, i64 0}
!12 = !{!"omnipotent char", !7, i64 0}
!13 = !{!"int", !12, i64 0}
!14 = !{!"_ZTSN3P3D8Graphics12BufferLayoutE", !15, i64 0, !13, i64 24}
!15 = !{!"_ZTSSt6vectorIN3P3D8Graphics13BufferElementESaIS2_EE", !16, i64 0}
!16 = !{!"_ZTSSt12_Vector_baseIN3P3D8Graphics13BufferElementESaIS2_EE", !17, i64 0}
!17 = !{!"_ZTSNSt12_Vector_baseIN3P3D8Graphics13BufferElementESaIS2_EE12_Vector_implE", !18, i64 0}
!18 = !{!"_ZTSNSt12_Vector_baseIN3P3D8Graphics13BufferElementESaIS2_EE17_Vector_impl_dataE", !11, i64 0, !11, i64 8, !11, i64 16}
!19 = !{!9, !11, i64 88}
!20 = !{!9, !11, i64 96}
!21 = !{!10, !11, i64 8}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,LoopSimplifyPass,MemCpyOptPass,SROAPass,SimplifyCFGPass,TailCallElimPass