; LLVM IR from erwincoumans/tiny-differentiable-simulator :: src/visualizer/opengl (tiny_gl_instancing_renderer)

; 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.TinyGLInstancingRenderer = type <{ ptr, %"class.std::vector", ptr, i8, i8, [2 x i8], i32, i32, i32, i32, [4 x i8] }>
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<b3GraphicsInstance *, std::allocator<b3GraphicsInstance *>>::_Vector_impl" }
%"struct.std::_Vector_base<b3GraphicsInstance *, std::allocator<b3GraphicsInstance *>>::_Vector_impl" = type { %"struct.std::_Vector_base<b3GraphicsInstance *, std::allocator<b3GraphicsInstance *>>::_Vector_impl_data" }
%"struct.std::_Vector_base<b3GraphicsInstance *, std::allocator<b3GraphicsInstance *>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%struct.GLInstanceRendererInternalData = type <{ %"class.std::vector.0", %"class.std::vector.0", %"class.std::vector.0", %"class.std::vector.0", i32, i32, i32, i32, i32, [4 x i8] }>
%"class.std::vector.0" = type { %"struct.std::_Vector_base.1" }
%"struct.std::_Vector_base.1" = type { %"struct.std::_Vector_base<float, std::allocator<float>>::_Vector_impl" }
%"struct.std::_Vector_base<float, std::allocator<float>>::_Vector_impl" = type { %"struct.std::_Vector_base<float, std::allocator<float>>::_Vector_impl_data" }
%"struct.std::_Vector_base<float, std::allocator<float>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%struct.b3GraphicsInstance = type <{ i32, i32, i32, i32, i32, i32, %"class.std::vector.15", i32, i32, i32, float, %"struct.TINY::TinyVector3", i32, [4 x i8] }>
%"class.std::vector.15" = type { %"struct.std::_Vector_base.16" }
%"struct.std::_Vector_base.16" = type { %"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl" = type { %"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"struct.TINY::TinyVector3" = type { float, float, float, i32 }
%struct.InternalDataRenderer = type <{ %struct.GLInstanceRendererInternalData.base, [4 x i8], %struct.TinyCamera, ptr, [16 x float], [16 x float], [16 x float], [16 x float], [16 x float], i8, [3 x i8], %"struct.TINY::TinyVector3", %"struct.TINY::TinyVector3", i32, %"class.std::vector.5", ptr, i32, i32, %class.TinyResizablePool, i32, i32, float, i8, [3 x i8] }>
%struct.GLInstanceRendererInternalData.base = type <{ %"class.std::vector.0", %"class.std::vector.0", %"class.std::vector.0", %"class.std::vector.0", i32, i32, i32, i32, i32 }>
%struct.TinyCamera = type { ptr, ptr }
%"class.std::vector.5" = type { %"struct.std::_Vector_base.6" }
%"struct.std::_Vector_base.6" = type { %"struct.std::_Vector_base<InternalTextureHandle, std::allocator<InternalTextureHandle>>::_Vector_impl" }
%"struct.std::_Vector_base<InternalTextureHandle, std::allocator<InternalTextureHandle>>::_Vector_impl" = type { %"struct.std::_Vector_base<InternalTextureHandle, std::allocator<InternalTextureHandle>>::_Vector_impl_data" }
%"struct.std::_Vector_base<InternalTextureHandle, std::allocator<InternalTextureHandle>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%class.TinyResizablePool = type { ptr, %"class.std::vector.10", i32, i32 }
%"class.std::vector.10" = type { %"struct.std::_Vector_base.11" }
%"struct.std::_Vector_base.11" = type { %"struct.std::_Vector_base<TinyPoolBodyHandle<TinyPublicGraphicsInstanceData>, std::allocator<TinyPoolBodyHandle<TinyPublicGraphicsInstanceData>>>::_Vector_impl" }
%"struct.std::_Vector_base<TinyPoolBodyHandle<TinyPublicGraphicsInstanceData>, std::allocator<TinyPoolBodyHandle<TinyPublicGraphicsInstanceData>>>::_Vector_impl" = type { %"struct.std::_Vector_base<TinyPoolBodyHandle<TinyPublicGraphicsInstanceData>, std::allocator<TinyPoolBodyHandle<TinyPublicGraphicsInstanceData>>>::_Vector_impl_data" }
%"struct.std::_Vector_base<TinyPoolBodyHandle<TinyPublicGraphicsInstanceData>, std::allocator<TinyPoolBodyHandle<TinyPublicGraphicsInstanceData>>>::_Vector_impl_data" = type { ptr, ptr, ptr }

@glad_glDeleteBuffers = external global ptr, align 8
@glad_glDeleteVertexArrays = external global ptr, align 8

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN24TinyGLInstancingRenderer20remove_all_instancesEv(ptr noundef nonnull align 8 dereferenceable(60) %0) unnamed_addr #1 align 2 {
  %2 = alloca ptr, align 8
  %3 = alloca i32, align 4
  store ptr %0, ptr %2, align 8, !tbaa !5
  %4 = load ptr, ptr %2, align 8
  %5 = getelementptr inbounds %class.TinyGLInstancingRenderer, ptr %4, i32 0, i32 2
  %6 = load ptr, ptr %5, align 8, !tbaa !9
  %7 = getelementptr inbounds %struct.GLInstanceRendererInternalData, ptr %6, i32 0, i32 6
  store i32 0, ptr %7, align 8, !tbaa !17
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #5
  store i32 0, ptr %3, align 4, !tbaa !23
  br label %8

8:                                                ; preds = %58, %1
  %9 = load i32, ptr %3, align 4, !tbaa !23
  %10 = sext i32 %9 to i64
  %11 = getelementptr inbounds %class.TinyGLInstancingRenderer, ptr %4, i32 0, i32 1
  %12 = call noundef i64 @_ZNKSt6vectorIP18b3GraphicsInstanceSaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %11) #5
  %13 = icmp ult i64 %10, %12
  br i1 %13, label %15, label %14

14:                                               ; preds = %8
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #5
  br label %61

15:                                               ; preds = %8
  %16 = getelementptr inbounds %class.TinyGLInstancingRenderer, ptr %4, i32 0, i32 1
  %17 = load i32, ptr %3, align 4, !tbaa !23
  %18 = sext i32 %17 to i64
  %19 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIP18b3GraphicsInstanceSaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %16, i64 noundef %18) #5
  %20 = load ptr, ptr %19, align 8, !tbaa !5
  %21 = getelementptr inbounds %struct.b3GraphicsInstance, ptr %20, i32 0, i32 1
  %22 = load i32, ptr %21, align 4, !tbaa !24
  %23 = icmp ne i32 %22, 0
  br i1 %23, label %24, label %32

24:                                               ; preds = %15
  %25 = load ptr, ptr @glad_glDeleteBuffers, align 8, !tbaa !5
  %26 = getelementptr inbounds %class.TinyGLInstancingRenderer, ptr %4, i32 0, i32 1
  %27 = load i32, ptr %3, align 4, !tbaa !23
  %28 = sext i32 %27 to i64
  %29 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIP18b3GraphicsInstanceSaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %26, i64 noundef %28) #5
  %30 = load ptr, ptr %29, align 8, !tbaa !5
  %31 = getelementptr inbounds %struct.b3GraphicsInstance, ptr %30, i32 0, i32 1
  call void %25(i32 noundef 1, ptr noundef %31)
  br label %32

32:                                               ; preds = %24, %15
  %33 = getelementptr inbounds %class.TinyGLInstancingRenderer, ptr %4, i32 0, i32 1
  %34 = load i32, ptr %3, align 4, !tbaa !23
  %35 = sext i32 %34 to i64
  %36 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIP18b3GraphicsInstanceSaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %33, i64 noundef %35) #5
  %37 = load ptr, ptr %36, align 8, !tbaa !5
  %38 = getelementptr inbounds %struct.b3GraphicsInstance, ptr %37, i32 0, i32 0
  %39 = load i32, ptr %38, align 8, !tbaa !32
  %40 = icmp ne i32 %39, 0
  br i1 %40, label %41, label %49

41:                                               ; preds = %32
  %42 = load ptr, ptr @glad_glDeleteVertexArrays, align 8, !tbaa !5
  %43 = getelementptr inbounds %class.TinyGLInstancingRenderer, ptr %4, i32 0, i32 1
  %44 = load i32, ptr %3, align 4, !tbaa !23
  %45 = sext i32 %44 to i64
  %46 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIP18b3GraphicsInstanceSaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %43, i64 noundef %45) #5
  %47 = load ptr, ptr %46, align 8, !tbaa !5
  %48 = getelementptr inbounds %struct.b3GraphicsInstance, ptr %47, i32 0, i32 0
  call void %42(i32 noundef 1, ptr noundef %48)
  br label %49

49:                                               ; preds = %41, %32
  %50 = getelementptr inbounds %class.TinyGLInstancingRenderer, ptr %4, i32 0, i32 1
  %51 = load i32, ptr %3, align 4, !tbaa !23
  %52 = sext i32 %51 to i64
  %53 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIP18b3GraphicsInstanceSaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %50, i64 noundef %52) #5
  %54 = load ptr, ptr %53, align 8, !tbaa !5
  %55 = icmp eq ptr %54, null
  br i1 %55, label %57, label %56

56:                                               ; preds = %49
  call void @_ZN18b3GraphicsInstanceD2Ev(ptr noundef nonnull align 8 dereferenceable(84) %54) #5
  call void @_ZdlPvm(ptr noundef %54, i64 noundef 88) #6
  br label %57

57:                                               ; preds = %56, %49
  br label %58

58:                                               ; preds = %57
  %59 = load i32, ptr %3, align 4, !tbaa !23
  %60 = add nsw i32 %59, 1
  store i32 %60, ptr %3, align 4, !tbaa !23
  br label %8, !llvm.loop !33

61:                                               ; preds = %14
  %62 = getelementptr inbounds %class.TinyGLInstancingRenderer, ptr %4, i32 0, i32 1
  call void @_ZNSt6vectorIP18b3GraphicsInstanceSaIS1_EE5clearEv(ptr noundef nonnull align 8 dereferenceable(24) %62) #5
  %63 = getelementptr inbounds %class.TinyGLInstancingRenderer, ptr %4, i32 0, i32 2
  %64 = load ptr, ptr %63, align 8, !tbaa !9
  %65 = getelementptr inbounds %struct.InternalDataRenderer, ptr %64, i32 0, i32 18
  call void @_ZN17TinyResizablePoolI18TinyPoolBodyHandleI30TinyPublicGraphicsInstanceDataEE12exit_handlesEv(ptr noundef nonnull align 8 dereferenceable(40) %65)
  %66 = getelementptr inbounds %class.TinyGLInstancingRenderer, ptr %4, i32 0, i32 2
  %67 = load ptr, ptr %66, align 8, !tbaa !9
  %68 = getelementptr inbounds %struct.InternalDataRenderer, ptr %67, i32 0, i32 18
  call void @_ZN17TinyResizablePoolI18TinyPoolBodyHandleI30TinyPublicGraphicsInstanceDataEE12init_handlesEv(ptr noundef nonnull align 8 dereferenceable(40) %68)
  ret void
}

; 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 dso_local noundef i64 @_ZNKSt6vectorIP18b3GraphicsInstanceSaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24)) #3 align 2

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN18b3GraphicsInstanceD2Ev(ptr noundef nonnull align 8 dereferenceable(84)) unnamed_addr #4 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: mustprogress nounwind uwtable
declare dso_local void @_ZNSt6vectorIP18b3GraphicsInstanceSaIS1_EE5clearEv(ptr noundef nonnull align 8 dereferenceable(24)) #3 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN17TinyResizablePoolI18TinyPoolBodyHandleI30TinyPublicGraphicsInstanceDataEE12exit_handlesEv(ptr noundef nonnull align 8 dereferenceable(40)) #1 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN17TinyResizablePoolI18TinyPoolBodyHandleI30TinyPublicGraphicsInstanceDataEE12init_handlesEv(ptr noundef nonnull align 8 dereferenceable(40)) #1 align 2

attributes #0 = { 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 #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 = { 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 = { nounwind }
attributes #6 = { 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, !6, i64 32}
!10 = !{!"_ZTS24TinyGLInstancingRenderer", !11, i64 8, !6, i64 32, !15, i64 40, !15, i64 41, !16, i64 44, !16, i64 48, !16, i64 52, !16, i64 56}
!11 = !{!"_ZTSSt6vectorIP18b3GraphicsInstanceSaIS1_EE", !12, i64 0}
!12 = !{!"_ZTSSt12_Vector_baseIP18b3GraphicsInstanceSaIS1_EE", !13, i64 0}
!13 = !{!"_ZTSNSt12_Vector_baseIP18b3GraphicsInstanceSaIS1_EE12_Vector_implE", !14, i64 0}
!14 = !{!"_ZTSNSt12_Vector_baseIP18b3GraphicsInstanceSaIS1_EE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!15 = !{!"bool", !7, i64 0}
!16 = !{!"int", !7, i64 0}
!17 = !{!18, !16, i64 104}
!18 = !{!"_ZTS30GLInstanceRendererInternalData", !19, i64 0, !19, i64 24, !19, i64 48, !19, i64 72, !16, i64 96, !16, i64 100, !16, i64 104, !16, i64 108, !16, i64 112}
!19 = !{!"_ZTSSt6vectorIfSaIfEE", !20, i64 0}
!20 = !{!"_ZTSSt12_Vector_baseIfSaIfEE", !21, i64 0}
!21 = !{!"_ZTSNSt12_Vector_baseIfSaIfEE12_Vector_implE", !22, i64 0}
!22 = !{!"_ZTSNSt12_Vector_baseIfSaIfEE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!23 = !{!16, !16, i64 0}
!24 = !{!25, !16, i64 4}
!25 = !{!"_ZTS18b3GraphicsInstance", !16, i64 0, !16, i64 4, !16, i64 8, !16, i64 12, !16, i64 16, !16, i64 20, !26, i64 24, !16, i64 48, !16, i64 52, !16, i64 56, !30, i64 60, !31, i64 64, !16, i64 80}
!26 = !{!"_ZTSSt6vectorIiSaIiEE", !27, i64 0}
!27 = !{!"_ZTSSt12_Vector_baseIiSaIiEE", !28, i64 0}
!28 = !{!"_ZTSNSt12_Vector_baseIiSaIiEE12_Vector_implE", !29, i64 0}
!29 = !{!"_ZTSNSt12_Vector_baseIiSaIiEE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!30 = !{!"float", !7, i64 0}
!31 = !{!"_ZTSN4TINY11TinyVector3IfNS_10FloatUtilsEEE", !30, i64 0, !30, i64 4, !30, i64 8, !16, i64 12}
!32 = !{!25, !16, i64 0}
!33 = distinct !{!33, !34}
!34 = !{!"llvm.loop.mustprogress"}


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

@glad_glDeleteBuffers = external local_unnamed_addr global ptr, align 8
@glad_glDeleteVertexArrays = external local_unnamed_addr global ptr, align 8

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN24TinyGLInstancingRenderer20remove_all_instancesEv(ptr noundef nonnull align 8 dereferenceable(60) %0) unnamed_addr #1 align 2 {
  %2 = getelementptr inbounds i8, ptr %0, i64 32
  %3 = load ptr, ptr %2, align 8, !tbaa !5
  %4 = getelementptr inbounds i8, ptr %3, i64 104
  store i32 0, ptr %4, align 8, !tbaa !16
  %5 = getelementptr inbounds i8, ptr %0, i64 8
  %6 = tail call noundef i64 @_ZNKSt6vectorIP18b3GraphicsInstanceSaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %5) #4
  %.not11 = icmp eq i64 %6, 0
  br i1 %.not11, label %._crit_edge, label %.lr.ph

._crit_edge:                                      ; preds = %33, %1
  tail call void @_ZNSt6vectorIP18b3GraphicsInstanceSaIS1_EE5clearEv(ptr noundef nonnull align 8 dereferenceable(24) %5) #4
  %7 = load ptr, ptr %2, align 8, !tbaa !5
  %8 = getelementptr inbounds i8, ptr %7, i64 544
  tail call void @_ZN17TinyResizablePoolI18TinyPoolBodyHandleI30TinyPublicGraphicsInstanceDataEE12exit_handlesEv(ptr noundef nonnull align 8 dereferenceable(40) %8)
  %9 = load ptr, ptr %2, align 8, !tbaa !5
  %10 = getelementptr inbounds i8, ptr %9, i64 544
  tail call void @_ZN17TinyResizablePoolI18TinyPoolBodyHandleI30TinyPublicGraphicsInstanceDataEE12init_handlesEv(ptr noundef nonnull align 8 dereferenceable(40) %10)
  ret void

.lr.ph:                                           ; preds = %1, %33
  %indvars.iv = phi i64 [ %indvars.iv.next, %33 ], [ 0, %1 ]
  %11 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIP18b3GraphicsInstanceSaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %5, i64 noundef %indvars.iv) #4
  %12 = load ptr, ptr %11, align 8, !tbaa !22
  %13 = getelementptr inbounds i8, ptr %12, i64 4
  %14 = load i32, ptr %13, align 4, !tbaa !23
  %.not = icmp eq i32 %14, 0
  br i1 %.not, label %20, label %15

15:                                               ; preds = %.lr.ph
  %16 = load ptr, ptr @glad_glDeleteBuffers, align 8, !tbaa !22
  %17 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIP18b3GraphicsInstanceSaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %5, i64 noundef %indvars.iv) #4
  %18 = load ptr, ptr %17, align 8, !tbaa !22
  %19 = getelementptr inbounds i8, ptr %18, i64 4
  tail call void %16(i32 noundef 1, ptr noundef nonnull %19)
  br label %20

20:                                               ; preds = %15, %.lr.ph
  %21 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIP18b3GraphicsInstanceSaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %5, i64 noundef %indvars.iv) #4
  %22 = load ptr, ptr %21, align 8, !tbaa !22
  %23 = load i32, ptr %22, align 8, !tbaa !31
  %.not9 = icmp eq i32 %23, 0
  br i1 %.not9, label %28, label %24

24:                                               ; preds = %20
  %25 = load ptr, ptr @glad_glDeleteVertexArrays, align 8, !tbaa !22
  %26 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIP18b3GraphicsInstanceSaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %5, i64 noundef %indvars.iv) #4
  %27 = load ptr, ptr %26, align 8, !tbaa !22
  tail call void %25(i32 noundef 1, ptr noundef %27)
  br label %28

28:                                               ; preds = %24, %20
  %29 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIP18b3GraphicsInstanceSaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %5, i64 noundef %indvars.iv) #4
  %30 = load ptr, ptr %29, align 8, !tbaa !22
  %31 = icmp eq ptr %30, null
  br i1 %31, label %33, label %32

32:                                               ; preds = %28
  tail call void @_ZN18b3GraphicsInstanceD2Ev(ptr noundef nonnull align 8 dereferenceable(84) %30) #4
  tail call void @_ZdlPvm(ptr noundef nonnull %30, i64 noundef 88) #5
  br label %33

33:                                               ; preds = %28, %32
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %34 = tail call noundef i64 @_ZNKSt6vectorIP18b3GraphicsInstanceSaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %5) #4
  %35 = icmp ugt i64 %34, %indvars.iv.next
  br i1 %35, label %.lr.ph, label %._crit_edge, !llvm.loop !32
}

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

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN17TinyResizablePoolI18TinyPoolBodyHandleI30TinyPublicGraphicsInstanceDataEE12exit_handlesEv(ptr noundef nonnull align 8 dereferenceable(40)) local_unnamed_addr #1 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN17TinyResizablePoolI18TinyPoolBodyHandleI30TinyPublicGraphicsInstanceDataEE12init_handlesEv(ptr noundef nonnull align 8 dereferenceable(40)) local_unnamed_addr #1 align 2

attributes #0 = { 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 #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 = { 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 #4 = { nounwind }
attributes #5 = { 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, !11, i64 32}
!6 = !{!"_ZTS24TinyGLInstancingRenderer", !7, i64 8, !11, i64 32, !14, i64 40, !14, i64 41, !15, i64 44, !15, i64 48, !15, i64 52, !15, i64 56}
!7 = !{!"_ZTSSt6vectorIP18b3GraphicsInstanceSaIS1_EE", !8, i64 0}
!8 = !{!"_ZTSSt12_Vector_baseIP18b3GraphicsInstanceSaIS1_EE", !9, i64 0}
!9 = !{!"_ZTSNSt12_Vector_baseIP18b3GraphicsInstanceSaIS1_EE12_Vector_implE", !10, i64 0}
!10 = !{!"_ZTSNSt12_Vector_baseIP18b3GraphicsInstanceSaIS1_EE17_Vector_impl_dataE", !11, i64 0, !11, i64 8, !11, i64 16}
!11 = !{!"any pointer", !12, i64 0}
!12 = !{!"omnipotent char", !13, i64 0}
!13 = !{!"Simple C++ TBAA"}
!14 = !{!"bool", !12, i64 0}
!15 = !{!"int", !12, i64 0}
!16 = !{!17, !15, i64 104}
!17 = !{!"_ZTS30GLInstanceRendererInternalData", !18, i64 0, !18, i64 24, !18, i64 48, !18, i64 72, !15, i64 96, !15, i64 100, !15, i64 104, !15, i64 108, !15, i64 112}
!18 = !{!"_ZTSSt6vectorIfSaIfEE", !19, i64 0}
!19 = !{!"_ZTSSt12_Vector_baseIfSaIfEE", !20, i64 0}
!20 = !{!"_ZTSNSt12_Vector_baseIfSaIfEE12_Vector_implE", !21, i64 0}
!21 = !{!"_ZTSNSt12_Vector_baseIfSaIfEE17_Vector_impl_dataE", !11, i64 0, !11, i64 8, !11, i64 16}
!22 = !{!11, !11, i64 0}
!23 = !{!24, !15, i64 4}
!24 = !{!"_ZTS18b3GraphicsInstance", !15, i64 0, !15, i64 4, !15, i64 8, !15, i64 12, !15, i64 16, !15, i64 20, !25, i64 24, !15, i64 48, !15, i64 52, !15, i64 56, !29, i64 60, !30, i64 64, !15, i64 80}
!25 = !{!"_ZTSSt6vectorIiSaIiEE", !26, i64 0}
!26 = !{!"_ZTSSt12_Vector_baseIiSaIiEE", !27, i64 0}
!27 = !{!"_ZTSNSt12_Vector_baseIiSaIiEE12_Vector_implE", !28, i64 0}
!28 = !{!"_ZTSNSt12_Vector_baseIiSaIiEE17_Vector_impl_dataE", !11, i64 0, !11, i64 8, !11, i64 16}
!29 = !{!"float", !12, i64 0}
!30 = !{!"_ZTSN4TINY11TinyVector3IfNS_10FloatUtilsEEE", !29, i64 0, !29, i64 4, !29, i64 8, !15, i64 12}
!31 = !{!24, !15, i64 0}
!32 = distinct !{!32, !33}
!33 = !{!"llvm.loop.mustprogress"}


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