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

@.str.1 = external hidden unnamed_addr constant [130 x i8], align 1
@glad_glBindBuffer = external global ptr, align 8
@glad_glGetError = external global ptr, align 8
@.str.4 = external hidden unnamed_addr constant [28 x i8], align 1
@__PRETTY_FUNCTION__._ZN24TinyGLInstancingRenderer16write_transformsEv = external hidden unnamed_addr constant [50 x i8], align 1
@glad_glFlush = external global ptr, align 8
@glad_glBufferSubData = 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 nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIfSaIfEEixEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) #1 align 2

; Function Attrs: noreturn nounwind
declare void @__assert_fail(ptr noundef, ptr noundef, i32 noundef, ptr noundef) #2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN24TinyGLInstancingRenderer16write_transformsEv(ptr noundef nonnull align 8 dereferenceable(60) %0) #3 align 2 {
  %2 = alloca ptr, align 8
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  store ptr %0, ptr %2, align 8, !tbaa !5
  %6 = load ptr, ptr %2, align 8
  %7 = load ptr, ptr @glad_glGetError, align 8, !tbaa !5
  %8 = call i32 %7()
  %9 = icmp eq i32 %8, 0
  br i1 %9, label %10, label %11

10:                                               ; preds = %1
  br label %13

11:                                               ; preds = %1
  call void @__assert_fail(ptr noundef @.str.4, ptr noundef @.str.1, i32 noundef 656, ptr noundef @__PRETTY_FUNCTION__._ZN24TinyGLInstancingRenderer16write_transformsEv) #4
  unreachable

12:                                               ; No predecessors!
  br label %13

13:                                               ; preds = %12, %10
  %14 = load ptr, ptr @glad_glBindBuffer, align 8, !tbaa !5
  %15 = getelementptr inbounds %class.TinyGLInstancingRenderer, ptr %6, i32 0, i32 2
  %16 = load ptr, ptr %15, align 8, !tbaa !9
  %17 = getelementptr inbounds %struct.GLInstanceRendererInternalData, ptr %16, i32 0, i32 5
  %18 = load i32, ptr %17, align 4, !tbaa !17
  call void %14(i32 noundef 34962, i32 noundef %18)
  %19 = load ptr, ptr @glad_glFlush, align 8, !tbaa !5
  call void %19()
  %20 = load ptr, ptr @glad_glGetError, align 8, !tbaa !5
  %21 = call i32 %20()
  %22 = icmp eq i32 %21, 0
  br i1 %22, label %23, label %24

23:                                               ; preds = %13
  br label %26

24:                                               ; preds = %13
  call void @__assert_fail(ptr noundef @.str.4, ptr noundef @.str.1, i32 noundef 665, ptr noundef @__PRETTY_FUNCTION__._ZN24TinyGLInstancingRenderer16write_transformsEv) #4
  unreachable

25:                                               ; No predecessors!
  br label %26

26:                                               ; preds = %25, %23
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #5
  %27 = getelementptr inbounds %class.TinyGLInstancingRenderer, ptr %6, i32 0, i32 2
  %28 = load ptr, ptr %27, align 8, !tbaa !9
  %29 = getelementptr inbounds %struct.GLInstanceRendererInternalData, ptr %28, i32 0, i32 6
  %30 = load i32, ptr %29, align 8, !tbaa !23
  %31 = sext i32 %30 to i64
  %32 = mul i64 %31, 4
  %33 = mul i64 %32, 4
  %34 = trunc i64 %33 to i32
  store i32 %34, ptr %3, align 4, !tbaa !24
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #5
  %35 = getelementptr inbounds %class.TinyGLInstancingRenderer, ptr %6, i32 0, i32 2
  %36 = load ptr, ptr %35, align 8, !tbaa !9
  %37 = getelementptr inbounds %struct.GLInstanceRendererInternalData, ptr %36, i32 0, i32 6
  %38 = load i32, ptr %37, align 8, !tbaa !23
  %39 = sext i32 %38 to i64
  %40 = mul i64 %39, 4
  %41 = mul i64 %40, 4
  %42 = trunc i64 %41 to i32
  store i32 %42, ptr %4, align 4, !tbaa !24
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #5
  %43 = getelementptr inbounds %class.TinyGLInstancingRenderer, ptr %6, i32 0, i32 2
  %44 = load ptr, ptr %43, align 8, !tbaa !9
  %45 = getelementptr inbounds %struct.GLInstanceRendererInternalData, ptr %44, i32 0, i32 6
  %46 = load i32, ptr %45, align 8, !tbaa !23
  %47 = sext i32 %46 to i64
  %48 = mul i64 %47, 4
  %49 = mul i64 %48, 4
  %50 = trunc i64 %49 to i32
  store i32 %50, ptr %5, align 4, !tbaa !24
  %51 = load ptr, ptr @glad_glBufferSubData, align 8, !tbaa !5
  %52 = getelementptr inbounds %class.TinyGLInstancingRenderer, ptr %6, i32 0, i32 2
  %53 = load ptr, ptr %52, align 8, !tbaa !9
  %54 = getelementptr inbounds %struct.GLInstanceRendererInternalData, ptr %53, i32 0, i32 8
  %55 = load i32, ptr %54, align 8, !tbaa !25
  %56 = sext i32 %55 to i64
  %57 = getelementptr inbounds %class.TinyGLInstancingRenderer, ptr %6, i32 0, i32 2
  %58 = load ptr, ptr %57, align 8, !tbaa !9
  %59 = getelementptr inbounds %struct.GLInstanceRendererInternalData, ptr %58, i32 0, i32 6
  %60 = load i32, ptr %59, align 8, !tbaa !23
  %61 = sext i32 %60 to i64
  %62 = mul i64 %61, 4
  %63 = mul i64 %62, 4
  %64 = getelementptr inbounds %class.TinyGLInstancingRenderer, ptr %6, i32 0, i32 2
  %65 = load ptr, ptr %64, align 8, !tbaa !9
  %66 = getelementptr inbounds %struct.GLInstanceRendererInternalData, ptr %65, i32 0, i32 0
  %67 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIfSaIfEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %66, i64 noundef 0) #5
  call void %51(i32 noundef 34962, i64 noundef %56, i64 noundef %63, ptr noundef %67)
  %68 = load ptr, ptr @glad_glBufferSubData, align 8, !tbaa !5
  %69 = getelementptr inbounds %class.TinyGLInstancingRenderer, ptr %6, i32 0, i32 2
  %70 = load ptr, ptr %69, align 8, !tbaa !9
  %71 = getelementptr inbounds %struct.GLInstanceRendererInternalData, ptr %70, i32 0, i32 8
  %72 = load i32, ptr %71, align 8, !tbaa !25
  %73 = load i32, ptr %3, align 4, !tbaa !24
  %74 = add nsw i32 %72, %73
  %75 = sext i32 %74 to i64
  %76 = getelementptr inbounds %class.TinyGLInstancingRenderer, ptr %6, i32 0, i32 2
  %77 = load ptr, ptr %76, align 8, !tbaa !9
  %78 = getelementptr inbounds %struct.GLInstanceRendererInternalData, ptr %77, i32 0, i32 6
  %79 = load i32, ptr %78, align 8, !tbaa !23
  %80 = sext i32 %79 to i64
  %81 = mul i64 %80, 4
  %82 = mul i64 %81, 4
  %83 = getelementptr inbounds %class.TinyGLInstancingRenderer, ptr %6, i32 0, i32 2
  %84 = load ptr, ptr %83, align 8, !tbaa !9
  %85 = getelementptr inbounds %struct.GLInstanceRendererInternalData, ptr %84, i32 0, i32 1
  %86 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIfSaIfEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %85, i64 noundef 0) #5
  call void %68(i32 noundef 34962, i64 noundef %75, i64 noundef %82, ptr noundef %86)
  %87 = load ptr, ptr @glad_glBufferSubData, align 8, !tbaa !5
  %88 = getelementptr inbounds %class.TinyGLInstancingRenderer, ptr %6, i32 0, i32 2
  %89 = load ptr, ptr %88, align 8, !tbaa !9
  %90 = getelementptr inbounds %struct.GLInstanceRendererInternalData, ptr %89, i32 0, i32 8
  %91 = load i32, ptr %90, align 8, !tbaa !25
  %92 = load i32, ptr %3, align 4, !tbaa !24
  %93 = add nsw i32 %91, %92
  %94 = load i32, ptr %4, align 4, !tbaa !24
  %95 = add nsw i32 %93, %94
  %96 = sext i32 %95 to i64
  %97 = getelementptr inbounds %class.TinyGLInstancingRenderer, ptr %6, i32 0, i32 2
  %98 = load ptr, ptr %97, align 8, !tbaa !9
  %99 = getelementptr inbounds %struct.GLInstanceRendererInternalData, ptr %98, i32 0, i32 6
  %100 = load i32, ptr %99, align 8, !tbaa !23
  %101 = sext i32 %100 to i64
  %102 = mul i64 %101, 4
  %103 = mul i64 %102, 4
  %104 = getelementptr inbounds %class.TinyGLInstancingRenderer, ptr %6, i32 0, i32 2
  %105 = load ptr, ptr %104, align 8, !tbaa !9
  %106 = getelementptr inbounds %struct.GLInstanceRendererInternalData, ptr %105, i32 0, i32 2
  %107 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIfSaIfEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %106, i64 noundef 0) #5
  call void %87(i32 noundef 34962, i64 noundef %96, i64 noundef %103, ptr noundef %107)
  %108 = load ptr, ptr @glad_glBufferSubData, align 8, !tbaa !5
  %109 = getelementptr inbounds %class.TinyGLInstancingRenderer, ptr %6, i32 0, i32 2
  %110 = load ptr, ptr %109, align 8, !tbaa !9
  %111 = getelementptr inbounds %struct.GLInstanceRendererInternalData, ptr %110, i32 0, i32 8
  %112 = load i32, ptr %111, align 8, !tbaa !25
  %113 = load i32, ptr %3, align 4, !tbaa !24
  %114 = add nsw i32 %112, %113
  %115 = load i32, ptr %4, align 4, !tbaa !24
  %116 = add nsw i32 %114, %115
  %117 = load i32, ptr %5, align 4, !tbaa !24
  %118 = add nsw i32 %116, %117
  %119 = sext i32 %118 to i64
  %120 = getelementptr inbounds %class.TinyGLInstancingRenderer, ptr %6, i32 0, i32 2
  %121 = load ptr, ptr %120, align 8, !tbaa !9
  %122 = getelementptr inbounds %struct.GLInstanceRendererInternalData, ptr %121, i32 0, i32 6
  %123 = load i32, ptr %122, align 8, !tbaa !23
  %124 = sext i32 %123 to i64
  %125 = mul i64 %124, 4
  %126 = mul i64 %125, 4
  %127 = getelementptr inbounds %class.TinyGLInstancingRenderer, ptr %6, i32 0, i32 2
  %128 = load ptr, ptr %127, align 8, !tbaa !9
  %129 = getelementptr inbounds %struct.GLInstanceRendererInternalData, ptr %128, i32 0, i32 3
  %130 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIfSaIfEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %129, i64 noundef 0) #5
  call void %108(i32 noundef 34962, i64 noundef %119, i64 noundef %126, ptr noundef %130)
  %131 = load ptr, ptr @glad_glBindBuffer, align 8, !tbaa !5
  call void %131(i32 noundef 34962, i32 noundef 0)
  %132 = load ptr, ptr @glad_glGetError, align 8, !tbaa !5
  %133 = call i32 %132()
  %134 = icmp eq i32 %133, 0
  br i1 %134, label %135, label %136

135:                                              ; preds = %26
  br label %138

136:                                              ; preds = %26
  call void @__assert_fail(ptr noundef @.str.4, ptr noundef @.str.1, i32 noundef 790, ptr noundef @__PRETTY_FUNCTION__._ZN24TinyGLInstancingRenderer16write_transformsEv) #4
  unreachable

137:                                              ; No predecessors!
  br label %138

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

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { noreturn nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress 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 = { noreturn nounwind }
attributes #5 = { 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 100}
!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 = !{!18, !16, i64 104}
!24 = !{!16, !16, i64 0}
!25 = !{!18, !16, i64 112}


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

@.str.1 = external hidden unnamed_addr constant [130 x i8], align 1
@glad_glBindBuffer = external local_unnamed_addr global ptr, align 8
@glad_glGetError = external local_unnamed_addr global ptr, align 8
@.str.4 = external hidden unnamed_addr constant [28 x i8], align 1
@__PRETTY_FUNCTION__._ZN24TinyGLInstancingRenderer16write_transformsEv = external hidden unnamed_addr constant [50 x i8], align 1
@glad_glFlush = external local_unnamed_addr global ptr, align 8
@glad_glBufferSubData = external local_unnamed_addr global ptr, align 8

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

; Function Attrs: noreturn nounwind
declare void @__assert_fail(ptr noundef, ptr noundef, i32 noundef, ptr noundef) local_unnamed_addr #1

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN24TinyGLInstancingRenderer16write_transformsEv(ptr nocapture noundef nonnull readonly align 8 dereferenceable(60) %0) local_unnamed_addr #2 align 2 {
  %2 = load ptr, ptr @glad_glGetError, align 8, !tbaa !5
  %3 = tail call i32 %2()
  %4 = icmp eq i32 %3, 0
  br i1 %4, label %6, label %5

5:                                                ; preds = %1
  tail call void @__assert_fail(ptr noundef nonnull @.str.4, ptr noundef nonnull @.str.1, i32 noundef 656, ptr noundef nonnull @__PRETTY_FUNCTION__._ZN24TinyGLInstancingRenderer16write_transformsEv) #3
  unreachable

6:                                                ; preds = %1
  %7 = load ptr, ptr @glad_glBindBuffer, align 8, !tbaa !5
  %8 = getelementptr inbounds i8, ptr %0, i64 32
  %9 = load ptr, ptr %8, align 8, !tbaa !9
  %10 = getelementptr inbounds i8, ptr %9, i64 100
  %11 = load i32, ptr %10, align 4, !tbaa !17
  tail call void %7(i32 noundef 34962, i32 noundef %11)
  %12 = load ptr, ptr @glad_glFlush, align 8, !tbaa !5
  tail call void %12()
  %13 = load ptr, ptr @glad_glGetError, align 8, !tbaa !5
  %14 = tail call i32 %13()
  %15 = icmp eq i32 %14, 0
  br i1 %15, label %17, label %16

16:                                               ; preds = %6
  tail call void @__assert_fail(ptr noundef nonnull @.str.4, ptr noundef nonnull @.str.1, i32 noundef 665, ptr noundef nonnull @__PRETTY_FUNCTION__._ZN24TinyGLInstancingRenderer16write_transformsEv) #3
  unreachable

17:                                               ; preds = %6
  %18 = load ptr, ptr %8, align 8, !tbaa !9
  %19 = getelementptr inbounds i8, ptr %18, i64 104
  %20 = load i32, ptr %19, align 8, !tbaa !23
  %21 = sext i32 %20 to i64
  %22 = shl nsw i64 %21, 4
  %23 = trunc i64 %22 to i32
  %24 = load ptr, ptr @glad_glBufferSubData, align 8, !tbaa !5
  %25 = getelementptr inbounds i8, ptr %18, i64 112
  %26 = load i32, ptr %25, align 8, !tbaa !24
  %27 = sext i32 %26 to i64
  %28 = tail call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIfSaIfEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %18, i64 noundef 0) #4
  tail call void %24(i32 noundef 34962, i64 noundef %27, i64 noundef %22, ptr noundef nonnull %28)
  %29 = load ptr, ptr @glad_glBufferSubData, align 8, !tbaa !5
  %30 = load ptr, ptr %8, align 8, !tbaa !9
  %31 = getelementptr inbounds i8, ptr %30, i64 112
  %32 = load i32, ptr %31, align 8, !tbaa !24
  %33 = add nsw i32 %32, %23
  %34 = sext i32 %33 to i64
  %35 = getelementptr inbounds i8, ptr %30, i64 104
  %36 = load i32, ptr %35, align 8, !tbaa !23
  %37 = sext i32 %36 to i64
  %38 = shl nsw i64 %37, 4
  %39 = getelementptr inbounds i8, ptr %30, i64 24
  %40 = tail call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIfSaIfEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %39, i64 noundef 0) #4
  tail call void %29(i32 noundef 34962, i64 noundef %34, i64 noundef %38, ptr noundef nonnull %40)
  %41 = load ptr, ptr @glad_glBufferSubData, align 8, !tbaa !5
  %42 = load ptr, ptr %8, align 8, !tbaa !9
  %43 = getelementptr inbounds i8, ptr %42, i64 112
  %44 = load i32, ptr %43, align 8, !tbaa !24
  %reass.add = shl i32 %23, 1
  %45 = add i32 %44, %reass.add
  %46 = sext i32 %45 to i64
  %47 = getelementptr inbounds i8, ptr %42, i64 104
  %48 = load i32, ptr %47, align 8, !tbaa !23
  %49 = sext i32 %48 to i64
  %50 = shl nsw i64 %49, 4
  %51 = getelementptr inbounds i8, ptr %42, i64 48
  %52 = tail call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIfSaIfEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %51, i64 noundef 0) #4
  tail call void %41(i32 noundef 34962, i64 noundef %46, i64 noundef %50, ptr noundef nonnull %52)
  %53 = load ptr, ptr @glad_glBufferSubData, align 8, !tbaa !5
  %54 = load ptr, ptr %8, align 8, !tbaa !9
  %55 = getelementptr inbounds i8, ptr %54, i64 112
  %56 = load i32, ptr %55, align 8, !tbaa !24
  %57 = mul i32 %23, 3
  %58 = add i32 %57, %56
  %59 = sext i32 %58 to i64
  %60 = getelementptr inbounds i8, ptr %54, i64 104
  %61 = load i32, ptr %60, align 8, !tbaa !23
  %62 = sext i32 %61 to i64
  %63 = shl nsw i64 %62, 4
  %64 = getelementptr inbounds i8, ptr %54, i64 72
  %65 = tail call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIfSaIfEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %64, i64 noundef 0) #4
  tail call void %53(i32 noundef 34962, i64 noundef %59, i64 noundef %63, ptr noundef nonnull %65)
  %66 = load ptr, ptr @glad_glBindBuffer, align 8, !tbaa !5
  tail call void %66(i32 noundef 34962, i32 noundef 0)
  %67 = load ptr, ptr @glad_glGetError, align 8, !tbaa !5
  %68 = tail call i32 %67()
  %69 = icmp eq i32 %68, 0
  br i1 %69, label %71, label %70

70:                                               ; preds = %17
  tail call void @__assert_fail(ptr noundef nonnull @.str.4, ptr noundef nonnull @.str.1, i32 noundef 790, ptr noundef nonnull @__PRETTY_FUNCTION__._ZN24TinyGLInstancingRenderer16write_transformsEv) #3
  unreachable

71:                                               ; preds = %17
  ret void
}

attributes #0 = { 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 #1 = { noreturn nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { 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 #3 = { noreturn nounwind }
attributes #4 = { 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 100}
!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 = !{!18, !16, i64 104}
!24 = !{!18, !16, i64 112}


; Effective O3 passes: EarlyCSEPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,PostOrderFunctionAttrsPass,ReassociatePass,SROAPass,SimplifyCFGPass,TailCallElimPass