; LLVM IR from ThePhysicsGuys/Physics3D :: graphics/buffers (vertexArray)

; 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] }
%"class.P3D::Graphics::VertexBuffer" = type { %"class.P3D::Graphics::Bindable.base", i64, i64, %"struct.P3D::Graphics::BufferLayout" }
%"class.P3D::Graphics::Bindable.base" = type <{ ptr, i32 }>
%"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.P3D::Graphics::VertexArray" = type { %"class.P3D::Graphics::Bindable.base", i32 }

@_ZN3P3D8Graphics14BufferDataType4MAT2E = external global %"struct.P3D::Graphics::BufferDataType::Info", align 8
@_ZN3P3D8Graphics14BufferDataType4MAT3E = external global %"struct.P3D::Graphics::BufferDataType::Info", align 8
@_ZN3P3D8Graphics14BufferDataType4MAT4E = external global %"struct.P3D::Graphics::BufferDataType::Info", align 8
@__glewEnableVertexAttribArray = external global ptr, align 8
@__glewVertexAttribIPointer = external global ptr, align 8
@__glewVertexAttribPointer = external global ptr, align 8
@__glewVertexAttribDivisor = external global ptr, 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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN3P3D8Graphics11VertexArray9addBufferEPNS0_12VertexBufferE(ptr noundef nonnull align 8 dereferenceable(16) %0, ptr noundef %1) #1 align 2 {
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca i64, align 8
  %6 = alloca i64, align 8
  %7 = alloca i32, align 4
  %8 = alloca ptr, align 8
  %9 = alloca i32, align 4
  %10 = alloca i64, align 8
  store ptr %0, ptr %3, align 8, !tbaa !5
  store ptr %1, ptr %4, align 8, !tbaa !5
  %11 = load ptr, ptr %3, align 8
  %12 = load ptr, ptr %11, align 8, !tbaa !9
  %13 = getelementptr inbounds ptr, ptr %12, i64 0
  %14 = load ptr, ptr %13, align 8
  call void %14(ptr noundef nonnull align 8 dereferenceable(16) %11)
  %15 = load ptr, ptr %4, align 8, !tbaa !5
  %16 = load ptr, ptr %15, align 8, !tbaa !9
  %17 = getelementptr inbounds ptr, ptr %16, i64 0
  %18 = load ptr, ptr %17, align 8
  call void %18(ptr noundef nonnull align 8 dereferenceable(64) %15)
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #3
  store i64 0, ptr %5, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #3
  store i64 0, ptr %6, align 8, !tbaa !11
  br label %19

19:                                               ; preds = %132, %2
  %20 = load i64, ptr %6, align 8, !tbaa !11
  %21 = load ptr, ptr %4, align 8, !tbaa !5
  %22 = getelementptr inbounds %"class.P3D::Graphics::VertexBuffer", ptr %21, i32 0, i32 3
  %23 = getelementptr inbounds %"struct.P3D::Graphics::BufferLayout", ptr %22, i32 0, i32 0
  %24 = call noundef i64 @_ZNKSt6vectorIN3P3D8Graphics13BufferElementESaIS2_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %23) #3
  %25 = icmp ult i64 %20, %24
  br i1 %25, label %27, label %26

26:                                               ; preds = %19
  store i32 2, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #3
  br label %135

27:                                               ; preds = %19
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #3
  %28 = load ptr, ptr %4, align 8, !tbaa !5
  %29 = getelementptr inbounds %"class.P3D::Graphics::VertexBuffer", ptr %28, i32 0, i32 3
  %30 = getelementptr inbounds %"struct.P3D::Graphics::BufferLayout", ptr %29, i32 0, i32 0
  %31 = load i64, ptr %6, align 8, !tbaa !11
  %32 = call noundef nonnull align 8 dereferenceable(82) ptr @_ZNSt6vectorIN3P3D8Graphics13BufferElementESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %30, i64 noundef %31) #3
  store ptr %32, ptr %8, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #3
  %33 = load ptr, ptr %8, align 8, !tbaa !5
  %34 = getelementptr inbounds %"struct.P3D::Graphics::BufferElement", ptr %33, i32 0, i32 1
  %35 = call noundef zeroext i1 @_ZNK3P3D8Graphics14BufferDataType4InfoeqERKS2_(ptr noundef nonnull align 8 dereferenceable(45) %34, ptr noundef nonnull align 8 dereferenceable(45) @_ZN3P3D8Graphics14BufferDataType4MAT2E)
  br i1 %35, label %44, label %36

36:                                               ; preds = %27
  %37 = load ptr, ptr %8, align 8, !tbaa !5
  %38 = getelementptr inbounds %"struct.P3D::Graphics::BufferElement", ptr %37, i32 0, i32 1
  %39 = call noundef zeroext i1 @_ZNK3P3D8Graphics14BufferDataType4InfoeqERKS2_(ptr noundef nonnull align 8 dereferenceable(45) %38, ptr noundef nonnull align 8 dereferenceable(45) @_ZN3P3D8Graphics14BufferDataType4MAT3E)
  br i1 %39, label %44, label %40

40:                                               ; preds = %36
  %41 = load ptr, ptr %8, align 8, !tbaa !5
  %42 = getelementptr inbounds %"struct.P3D::Graphics::BufferElement", ptr %41, i32 0, i32 1
  %43 = call noundef zeroext i1 @_ZNK3P3D8Graphics14BufferDataType4InfoeqERKS2_(ptr noundef nonnull align 8 dereferenceable(45) %42, ptr noundef nonnull align 8 dereferenceable(45) @_ZN3P3D8Graphics14BufferDataType4MAT4E)
  br i1 %43, label %44, label %49

44:                                               ; preds = %40, %36, %27
  %45 = load ptr, ptr %8, align 8, !tbaa !5
  %46 = getelementptr inbounds %"struct.P3D::Graphics::BufferElement", ptr %45, i32 0, i32 1
  %47 = getelementptr inbounds %"struct.P3D::Graphics::BufferDataType::Info", ptr %46, i32 0, i32 2
  %48 = load i32, ptr %47, align 4, !tbaa !13
  br label %50

49:                                               ; preds = %40
  br label %50

50:                                               ; preds = %49, %44
  %51 = phi i32 [ %48, %44 ], [ 1, %49 ]
  store i32 %51, ptr %9, align 4, !tbaa !20
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #3
  store i64 0, ptr %10, align 8, !tbaa !11
  br label %52

52:                                               ; preds = %128, %50
  %53 = load i64, ptr %10, align 8, !tbaa !11
  %54 = load i32, ptr %9, align 4, !tbaa !20
  %55 = sext i32 %54 to i64
  %56 = icmp ult i64 %53, %55
  br i1 %56, label %58, label %57

57:                                               ; preds = %52
  store i32 5, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #3
  br label %131

58:                                               ; preds = %52
  %59 = load ptr, ptr @__glewEnableVertexAttribArray, align 8, !tbaa !5
  %60 = getelementptr inbounds %"class.P3D::Graphics::VertexArray", ptr %11, i32 0, i32 1
  %61 = load i32, ptr %60, align 4, !tbaa !21
  call void %59(i32 noundef %61)
  %62 = load ptr, ptr %8, align 8, !tbaa !5
  %63 = getelementptr inbounds %"struct.P3D::Graphics::BufferElement", ptr %62, i32 0, i32 1
  %64 = getelementptr inbounds %"struct.P3D::Graphics::BufferDataType::Info", ptr %63, i32 0, i32 4
  %65 = load i8, ptr %64, align 4, !tbaa !24, !range !25, !noundef !26
  %66 = trunc i8 %65 to i1
  br i1 %66, label %67, label %85

67:                                               ; preds = %58
  %68 = load ptr, ptr @__glewVertexAttribIPointer, align 8, !tbaa !5
  %69 = getelementptr inbounds %"class.P3D::Graphics::VertexArray", ptr %11, i32 0, i32 1
  %70 = load i32, ptr %69, align 4, !tbaa !21
  %71 = load ptr, ptr %8, align 8, !tbaa !5
  %72 = getelementptr inbounds %"struct.P3D::Graphics::BufferElement", ptr %71, i32 0, i32 1
  %73 = getelementptr inbounds %"struct.P3D::Graphics::BufferDataType::Info", ptr %72, i32 0, i32 2
  %74 = load i32, ptr %73, align 4, !tbaa !13
  %75 = load ptr, ptr %8, align 8, !tbaa !5
  %76 = getelementptr inbounds %"struct.P3D::Graphics::BufferElement", ptr %75, i32 0, i32 1
  %77 = getelementptr inbounds %"struct.P3D::Graphics::BufferDataType::Info", ptr %76, i32 0, i32 1
  %78 = load i32, ptr %77, align 8, !tbaa !27
  %79 = load ptr, ptr %4, align 8, !tbaa !5
  %80 = getelementptr inbounds %"class.P3D::Graphics::VertexBuffer", ptr %79, i32 0, i32 3
  %81 = getelementptr inbounds %"struct.P3D::Graphics::BufferLayout", ptr %80, i32 0, i32 1
  %82 = load i32, ptr %81, align 8, !tbaa !28
  %83 = load i64, ptr %5, align 8, !tbaa !11
  %84 = inttoptr i64 %83 to ptr
  call void %68(i32 noundef %70, i32 noundef %74, i32 noundef %78, i32 noundef %82, ptr noundef %84)
  br label %108

85:                                               ; preds = %58
  %86 = load ptr, ptr @__glewVertexAttribPointer, align 8, !tbaa !5
  %87 = getelementptr inbounds %"class.P3D::Graphics::VertexArray", ptr %11, i32 0, i32 1
  %88 = load i32, ptr %87, align 4, !tbaa !21
  %89 = load ptr, ptr %8, align 8, !tbaa !5
  %90 = getelementptr inbounds %"struct.P3D::Graphics::BufferElement", ptr %89, i32 0, i32 1
  %91 = getelementptr inbounds %"struct.P3D::Graphics::BufferDataType::Info", ptr %90, i32 0, i32 2
  %92 = load i32, ptr %91, align 4, !tbaa !13
  %93 = load ptr, ptr %8, align 8, !tbaa !5
  %94 = getelementptr inbounds %"struct.P3D::Graphics::BufferElement", ptr %93, i32 0, i32 1
  %95 = getelementptr inbounds %"struct.P3D::Graphics::BufferDataType::Info", ptr %94, i32 0, i32 1
  %96 = load i32, ptr %95, align 8, !tbaa !27
  %97 = load ptr, ptr %8, align 8, !tbaa !5
  %98 = getelementptr inbounds %"struct.P3D::Graphics::BufferElement", ptr %97, i32 0, i32 3
  %99 = load i8, ptr %98, align 1, !tbaa !35, !range !25, !noundef !26
  %100 = trunc i8 %99 to i1
  %101 = zext i1 %100 to i8
  %102 = load ptr, ptr %4, align 8, !tbaa !5
  %103 = getelementptr inbounds %"class.P3D::Graphics::VertexBuffer", ptr %102, i32 0, i32 3
  %104 = getelementptr inbounds %"struct.P3D::Graphics::BufferLayout", ptr %103, i32 0, i32 1
  %105 = load i32, ptr %104, align 8, !tbaa !28
  %106 = load i64, ptr %5, align 8, !tbaa !11
  %107 = inttoptr i64 %106 to ptr
  call void %86(i32 noundef %88, i32 noundef %92, i32 noundef %96, i8 noundef zeroext %101, i32 noundef %105, ptr noundef %107)
  br label %108

108:                                              ; preds = %85, %67
  %109 = load ptr, ptr %8, align 8, !tbaa !5
  %110 = getelementptr inbounds %"struct.P3D::Graphics::BufferElement", ptr %109, i32 0, i32 2
  %111 = load i8, ptr %110, align 8, !tbaa !36, !range !25, !noundef !26
  %112 = trunc i8 %111 to i1
  br i1 %112, label %113, label %117

113:                                              ; preds = %108
  %114 = load ptr, ptr @__glewVertexAttribDivisor, align 8, !tbaa !5
  %115 = getelementptr inbounds %"class.P3D::Graphics::VertexArray", ptr %11, i32 0, i32 1
  %116 = load i32, ptr %115, align 4, !tbaa !21
  call void %114(i32 noundef %116, i32 noundef 1)
  br label %117

117:                                              ; preds = %113, %108
  %118 = load ptr, ptr %8, align 8, !tbaa !5
  %119 = getelementptr inbounds %"struct.P3D::Graphics::BufferElement", ptr %118, i32 0, i32 1
  %120 = getelementptr inbounds %"struct.P3D::Graphics::BufferDataType::Info", ptr %119, i32 0, i32 3
  %121 = load i32, ptr %120, align 8, !tbaa !37
  %122 = sext i32 %121 to i64
  %123 = load i64, ptr %5, align 8, !tbaa !11
  %124 = add i64 %123, %122
  store i64 %124, ptr %5, align 8, !tbaa !11
  %125 = getelementptr inbounds %"class.P3D::Graphics::VertexArray", ptr %11, i32 0, i32 1
  %126 = load i32, ptr %125, align 4, !tbaa !21
  %127 = add i32 %126, 1
  store i32 %127, ptr %125, align 4, !tbaa !21
  br label %128

128:                                              ; preds = %117
  %129 = load i64, ptr %10, align 8, !tbaa !11
  %130 = add i64 %129, 1
  store i64 %130, ptr %10, align 8, !tbaa !11
  br label %52, !llvm.loop !38

131:                                              ; preds = %57
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #3
  br label %132

132:                                              ; preds = %131
  %133 = load i64, ptr %6, align 8, !tbaa !11
  %134 = add i64 %133, 1
  store i64 %134, ptr %6, align 8, !tbaa !11
  br label %19, !llvm.loop !40

135:                                              ; preds = %26
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #3
  ret void
}

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

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

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

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #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 = { 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 = !{!"vtable pointer", !8, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"long", !7, i64 0}
!13 = !{!14, !18, i64 68}
!14 = !{!"_ZTSN3P3D8Graphics13BufferElementE", !15, i64 0, !17, i64 32, !19, i64 80, !19, i64 81}
!15 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE", !16, i64 0, !12, i64 8, !7, i64 16}
!16 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_Alloc_hiderE", !6, i64 0}
!17 = !{!"_ZTSN3P3D8Graphics14BufferDataType4InfoE", !15, i64 0, !18, i64 32, !18, i64 36, !18, i64 40, !19, i64 44}
!18 = !{!"int", !7, i64 0}
!19 = !{!"bool", !7, i64 0}
!20 = !{!18, !18, i64 0}
!21 = !{!22, !18, i64 12}
!22 = !{!"_ZTSN3P3D8Graphics11VertexArrayE", !23, i64 0, !18, i64 12}
!23 = !{!"_ZTSN3P3D8Graphics8BindableE", !18, i64 8}
!24 = !{!14, !19, i64 76}
!25 = !{i8 0, i8 2}
!26 = !{}
!27 = !{!14, !18, i64 64}
!28 = !{!29, !18, i64 56}
!29 = !{!"_ZTSN3P3D8Graphics12VertexBufferE", !23, i64 0, !12, i64 16, !12, i64 24, !30, i64 32}
!30 = !{!"_ZTSN3P3D8Graphics12BufferLayoutE", !31, i64 0, !18, i64 24}
!31 = !{!"_ZTSSt6vectorIN3P3D8Graphics13BufferElementESaIS2_EE", !32, i64 0}
!32 = !{!"_ZTSSt12_Vector_baseIN3P3D8Graphics13BufferElementESaIS2_EE", !33, i64 0}
!33 = !{!"_ZTSNSt12_Vector_baseIN3P3D8Graphics13BufferElementESaIS2_EE12_Vector_implE", !34, i64 0}
!34 = !{!"_ZTSNSt12_Vector_baseIN3P3D8Graphics13BufferElementESaIS2_EE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!35 = !{!14, !19, i64 81}
!36 = !{!14, !19, i64 80}
!37 = !{!14, !18, i64 72}
!38 = distinct !{!38, !39}
!39 = !{!"llvm.loop.mustprogress"}
!40 = distinct !{!40, !39}


; 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] }

@_ZN3P3D8Graphics14BufferDataType4MAT2E = external global %"struct.P3D::Graphics::BufferDataType::Info", align 8
@_ZN3P3D8Graphics14BufferDataType4MAT3E = external global %"struct.P3D::Graphics::BufferDataType::Info", align 8
@_ZN3P3D8Graphics14BufferDataType4MAT4E = external global %"struct.P3D::Graphics::BufferDataType::Info", align 8
@__glewEnableVertexAttribArray = external local_unnamed_addr global ptr, align 8
@__glewVertexAttribIPointer = external local_unnamed_addr global ptr, align 8
@__glewVertexAttribPointer = external local_unnamed_addr global ptr, align 8
@__glewVertexAttribDivisor = external local_unnamed_addr global ptr, align 8

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN3P3D8Graphics11VertexArray9addBufferEPNS0_12VertexBufferE(ptr noundef nonnull align 8 dereferenceable(16) %0, ptr noundef %1) local_unnamed_addr #0 align 2 {
  %3 = load ptr, ptr %0, align 8, !tbaa !5
  %4 = load ptr, ptr %3, align 8
  tail call void %4(ptr noundef nonnull align 8 dereferenceable(16) %0)
  %5 = load ptr, ptr %1, align 8, !tbaa !5
  %6 = load ptr, ptr %5, align 8
  tail call void %6(ptr noundef nonnull align 8 dereferenceable(64) %1)
  %7 = getelementptr inbounds i8, ptr %1, i64 32
  %8 = tail call noundef i64 @_ZNKSt6vectorIN3P3D8Graphics13BufferElementESaIS2_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %7) #2
  %.not = icmp eq i64 %8, 0
  br i1 %.not, label %._crit_edge34, label %.lr.ph33

.lr.ph33:                                         ; preds = %2
  %9 = getelementptr inbounds i8, ptr %0, i64 12
  %10 = getelementptr inbounds i8, ptr %1, i64 56
  br label %11

._crit_edge34:                                    ; preds = %._crit_edge, %2
  ret void

11:                                               ; preds = %.lr.ph33, %._crit_edge
  %.02631 = phi i64 [ 0, %.lr.ph33 ], [ %.1.lcssa, %._crit_edge ]
  %.02730 = phi i64 [ 0, %.lr.ph33 ], [ %30, %._crit_edge ]
  %12 = tail call noundef nonnull align 8 dereferenceable(82) ptr @_ZNSt6vectorIN3P3D8Graphics13BufferElementESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %7, i64 noundef %.02730) #2
  %13 = getelementptr inbounds i8, ptr %12, i64 32
  %14 = tail call noundef zeroext i1 @_ZNK3P3D8Graphics14BufferDataType4InfoeqERKS2_(ptr noundef nonnull align 8 dereferenceable(45) %13, ptr noundef nonnull align 8 dereferenceable(45) @_ZN3P3D8Graphics14BufferDataType4MAT2E)
  br i1 %14, label %19, label %15

15:                                               ; preds = %11
  %16 = tail call noundef zeroext i1 @_ZNK3P3D8Graphics14BufferDataType4InfoeqERKS2_(ptr noundef nonnull align 8 dereferenceable(45) %13, ptr noundef nonnull align 8 dereferenceable(45) @_ZN3P3D8Graphics14BufferDataType4MAT3E)
  br i1 %16, label %19, label %17

17:                                               ; preds = %15
  %18 = tail call noundef zeroext i1 @_ZNK3P3D8Graphics14BufferDataType4InfoeqERKS2_(ptr noundef nonnull align 8 dereferenceable(45) %13, ptr noundef nonnull align 8 dereferenceable(45) @_ZN3P3D8Graphics14BufferDataType4MAT4E)
  br i1 %18, label %19, label %.lr.ph

19:                                               ; preds = %11, %15, %17
  %20 = getelementptr inbounds i8, ptr %12, i64 68
  %21 = load i32, ptr %20, align 4, !tbaa !8
  %22 = sext i32 %21 to i64
  %.not35 = icmp eq i32 %21, 0
  br i1 %.not35, label %._crit_edge, label %.lr.ph

.lr.ph:                                           ; preds = %17, %19
  %23 = phi i64 [ %22, %19 ], [ 1, %17 ]
  %24 = getelementptr inbounds i8, ptr %12, i64 76
  %25 = getelementptr inbounds i8, ptr %12, i64 68
  %26 = getelementptr inbounds i8, ptr %12, i64 64
  %27 = getelementptr inbounds i8, ptr %12, i64 81
  %28 = getelementptr inbounds i8, ptr %12, i64 80
  %29 = getelementptr inbounds i8, ptr %12, i64 72
  %.pre = load i32, ptr %9, align 4, !tbaa !18
  br label %33

._crit_edge:                                      ; preds = %56, %19
  %.1.lcssa = phi i64 [ %.02631, %19 ], [ %59, %56 ]
  %30 = add nuw i64 %.02730, 1
  %31 = tail call noundef i64 @_ZNKSt6vectorIN3P3D8Graphics13BufferElementESaIS2_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %7) #2
  %32 = icmp ult i64 %30, %31
  br i1 %32, label %11, label %._crit_edge34, !llvm.loop !21

33:                                               ; preds = %.lr.ph, %56
  %34 = phi i32 [ %.pre, %.lr.ph ], [ %61, %56 ]
  %.029 = phi i64 [ 0, %.lr.ph ], [ %62, %56 ]
  %.128 = phi i64 [ %.02631, %.lr.ph ], [ %59, %56 ]
  %35 = load ptr, ptr @__glewEnableVertexAttribArray, align 8, !tbaa !23
  tail call void %35(i32 noundef %34)
  %36 = load i8, ptr %24, align 4, !tbaa !24, !range !25, !noundef !26
  %37 = trunc nuw i8 %36 to i1
  %38 = load i32, ptr %9, align 4, !tbaa !18
  %39 = load i32, ptr %25, align 4, !tbaa !8
  %40 = load i32, ptr %26, align 8, !tbaa !27
  br i1 %37, label %41, label %45

41:                                               ; preds = %33
  %42 = load ptr, ptr @__glewVertexAttribIPointer, align 8, !tbaa !23
  %43 = load i32, ptr %10, align 8, !tbaa !28
  %44 = inttoptr i64 %.128 to ptr
  tail call void %42(i32 noundef %38, i32 noundef %39, i32 noundef %40, i32 noundef %43, ptr noundef %44)
  br label %50

45:                                               ; preds = %33
  %46 = load ptr, ptr @__glewVertexAttribPointer, align 8, !tbaa !23
  %47 = load i8, ptr %27, align 1, !tbaa !35, !range !25, !noundef !26
  %48 = load i32, ptr %10, align 8, !tbaa !28
  %49 = inttoptr i64 %.128 to ptr
  tail call void %46(i32 noundef %38, i32 noundef %39, i32 noundef %40, i8 noundef zeroext %47, i32 noundef %48, ptr noundef %49)
  br label %50

50:                                               ; preds = %45, %41
  %51 = load i8, ptr %28, align 8, !tbaa !36, !range !25, !noundef !26
  %52 = trunc nuw i8 %51 to i1
  br i1 %52, label %53, label %56

53:                                               ; preds = %50
  %54 = load ptr, ptr @__glewVertexAttribDivisor, align 8, !tbaa !23
  %55 = load i32, ptr %9, align 4, !tbaa !18
  tail call void %54(i32 noundef %55, i32 noundef 1)
  br label %56

56:                                               ; preds = %53, %50
  %57 = load i32, ptr %29, align 8, !tbaa !37
  %58 = sext i32 %57 to i64
  %59 = add i64 %.128, %58
  %60 = load i32, ptr %9, align 4, !tbaa !18
  %61 = add i32 %60, 1
  store i32 %61, ptr %9, align 4, !tbaa !18
  %62 = add nuw i64 %.029, 1
  %exitcond.not = icmp eq i64 %62, %23
  br i1 %exitcond.not, label %._crit_edge, label %33, !llvm.loop !38
}

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

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

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

attributes #0 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress 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 #2 = { 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, !16, i64 68}
!9 = !{!"_ZTSN3P3D8Graphics13BufferElementE", !10, i64 0, !15, i64 32, !17, i64 80, !17, i64 81}
!10 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE", !11, i64 0, !14, i64 8, !13, i64 16}
!11 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_Alloc_hiderE", !12, i64 0}
!12 = !{!"any pointer", !13, i64 0}
!13 = !{!"omnipotent char", !7, i64 0}
!14 = !{!"long", !13, i64 0}
!15 = !{!"_ZTSN3P3D8Graphics14BufferDataType4InfoE", !10, i64 0, !16, i64 32, !16, i64 36, !16, i64 40, !17, i64 44}
!16 = !{!"int", !13, i64 0}
!17 = !{!"bool", !13, i64 0}
!18 = !{!19, !16, i64 12}
!19 = !{!"_ZTSN3P3D8Graphics11VertexArrayE", !20, i64 0, !16, i64 12}
!20 = !{!"_ZTSN3P3D8Graphics8BindableE", !16, i64 8}
!21 = distinct !{!21, !22}
!22 = !{!"llvm.loop.mustprogress"}
!23 = !{!12, !12, i64 0}
!24 = !{!9, !17, i64 76}
!25 = !{i8 0, i8 2}
!26 = !{}
!27 = !{!9, !16, i64 64}
!28 = !{!29, !16, i64 56}
!29 = !{!"_ZTSN3P3D8Graphics12VertexBufferE", !20, i64 0, !14, i64 16, !14, i64 24, !30, i64 32}
!30 = !{!"_ZTSN3P3D8Graphics12BufferLayoutE", !31, i64 0, !16, i64 24}
!31 = !{!"_ZTSSt6vectorIN3P3D8Graphics13BufferElementESaIS2_EE", !32, i64 0}
!32 = !{!"_ZTSSt12_Vector_baseIN3P3D8Graphics13BufferElementESaIS2_EE", !33, i64 0}
!33 = !{!"_ZTSNSt12_Vector_baseIN3P3D8Graphics13BufferElementESaIS2_EE12_Vector_implE", !34, i64 0}
!34 = !{!"_ZTSNSt12_Vector_baseIN3P3D8Graphics13BufferElementESaIS2_EE17_Vector_impl_dataE", !12, i64 0, !12, i64 8, !12, i64 16}
!35 = !{!9, !17, i64 81}
!36 = !{!9, !17, i64 80}
!37 = !{!9, !16, i64 72}
!38 = distinct !{!38, !22}


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