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

%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 }
%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_glBufferSubData = external global ptr, align 8
@.str.7 = external hidden unnamed_addr constant [46 x i8], align 1
@__PRETTY_FUNCTION__._ZN24TinyGLInstancingRenderer14register_shapeEPKfiPKiiii = external hidden unnamed_addr constant [101 x i8], align 1
@glad_glGenBuffers = external global ptr, align 8
@glad_glBufferData = external global ptr, align 8
@glad_glGenVertexArrays = external global ptr, align 8
@glad_glBindVertexArray = external global ptr, align 8

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

declare i32 @__gxx_personality_v0(...)

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

; 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: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #2

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

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_ZN24TinyGLInstancingRenderer14register_shapeEPKfiPKiiii(ptr noundef nonnull align 8 dereferenceable(60) %0, ptr noundef %1, i32 noundef %2, ptr noundef %3, i32 noundef %4, i32 noundef %5, i32 noundef %6) unnamed_addr #5 align 2 personality ptr @__gxx_personality_v0 {
  %8 = alloca i32, align 4
  %9 = alloca ptr, align 8
  %10 = alloca ptr, align 8
  %11 = alloca i32, align 4
  %12 = alloca ptr, align 8
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  %15 = alloca i32, align 4
  %16 = alloca ptr, align 8
  %17 = alloca ptr, align 8
  %18 = alloca i32, align 4
  %19 = alloca ptr, align 8
  %20 = alloca i32, align 4
  %21 = alloca i32, align 4
  %22 = alloca i32, align 4
  %23 = alloca i32, align 4
  %24 = alloca i32, align 4
  store ptr %0, ptr %9, align 8, !tbaa !5
  store ptr %1, ptr %10, align 8, !tbaa !5
  store i32 %2, ptr %11, align 4, !tbaa !9
  store ptr %3, ptr %12, align 8, !tbaa !5
  store i32 %4, ptr %13, align 4, !tbaa !9
  store i32 %5, ptr %14, align 4, !tbaa !9
  store i32 %6, ptr %15, align 4, !tbaa !9
  %25 = load ptr, ptr %9, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #6
  %26 = call noalias noundef nonnull ptr @_Znwm(i64 noundef 88) #7
  invoke void @_ZN18b3GraphicsInstanceC2Ev(ptr noundef nonnull align 8 dereferenceable(84) %26)
          to label %27 unwind label %38

27:                                               ; preds = %7
  store ptr %26, ptr %16, align 8, !tbaa !5
  %28 = load i32, ptr %15, align 4, !tbaa !9
  %29 = icmp sge i32 %28, 0
  br i1 %29, label %30, label %42

30:                                               ; preds = %27
  %31 = load i32, ptr %15, align 4, !tbaa !9
  %32 = load ptr, ptr %16, align 8, !tbaa !5
  %33 = getelementptr inbounds %struct.b3GraphicsInstance, ptr %32, i32 0, i32 2
  store i32 %31, ptr %33, align 8, !tbaa !11
  %34 = load ptr, ptr %16, align 8, !tbaa !5
  %35 = getelementptr inbounds %struct.b3GraphicsInstance, ptr %34, i32 0, i32 12
  %36 = load i32, ptr %35, align 8, !tbaa !19
  %37 = or i32 %36, 2
  store i32 %37, ptr %35, align 8, !tbaa !19
  br label %42

38:                                               ; preds = %7
  %39 = landingpad { ptr, i32 }
          cleanup
  %40 = extractvalue { ptr, i32 } %39, 0
  store ptr %40, ptr %17, align 8
  %41 = extractvalue { ptr, i32 } %39, 1
  store i32 %41, ptr %18, align 4
  call void @_ZdlPvm(ptr noundef %26, i64 noundef 88) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #6
  br label %170

42:                                               ; preds = %30, %27
  %43 = load i32, ptr %14, align 4, !tbaa !9
  %44 = load ptr, ptr %16, align 8, !tbaa !5
  %45 = getelementptr inbounds %struct.b3GraphicsInstance, ptr %44, i32 0, i32 9
  store i32 %43, ptr %45, align 8, !tbaa !20
  %46 = getelementptr inbounds %class.TinyGLInstancingRenderer, ptr %25, i32 0, i32 1
  %47 = call noundef i64 @_ZNKSt6vectorIP18b3GraphicsInstanceSaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %46) #6
  %48 = icmp ne i64 %47, 0
  br i1 %48, label %49, label %74

49:                                               ; preds = %42
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #6
  %50 = getelementptr inbounds %class.TinyGLInstancingRenderer, ptr %25, i32 0, i32 1
  %51 = getelementptr inbounds %class.TinyGLInstancingRenderer, ptr %25, i32 0, i32 1
  %52 = call noundef i64 @_ZNKSt6vectorIP18b3GraphicsInstanceSaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %51) #6
  %53 = sub i64 %52, 1
  %54 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIP18b3GraphicsInstanceSaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %50, i64 noundef %53) #6
  %55 = load ptr, ptr %54, align 8, !tbaa !5
  store ptr %55, ptr %19, align 8, !tbaa !5
  %56 = load ptr, ptr %19, align 8, !tbaa !5
  %57 = getelementptr inbounds %struct.b3GraphicsInstance, ptr %56, i32 0, i32 7
  %58 = load i32, ptr %57, align 8, !tbaa !21
  %59 = load ptr, ptr %19, align 8, !tbaa !5
  %60 = getelementptr inbounds %struct.b3GraphicsInstance, ptr %59, i32 0, i32 5
  %61 = load i32, ptr %60, align 4, !tbaa !22
  %62 = add nsw i32 %58, %61
  %63 = load ptr, ptr %16, align 8, !tbaa !5
  %64 = getelementptr inbounds %struct.b3GraphicsInstance, ptr %63, i32 0, i32 7
  store i32 %62, ptr %64, align 8, !tbaa !21
  %65 = load ptr, ptr %19, align 8, !tbaa !5
  %66 = getelementptr inbounds %struct.b3GraphicsInstance, ptr %65, i32 0, i32 8
  %67 = load i32, ptr %66, align 4, !tbaa !23
  %68 = load ptr, ptr %19, align 8, !tbaa !5
  %69 = getelementptr inbounds %struct.b3GraphicsInstance, ptr %68, i32 0, i32 4
  %70 = load i32, ptr %69, align 8, !tbaa !24
  %71 = add nsw i32 %67, %70
  %72 = load ptr, ptr %16, align 8, !tbaa !5
  %73 = getelementptr inbounds %struct.b3GraphicsInstance, ptr %72, i32 0, i32 8
  store i32 %71, ptr %73, align 4, !tbaa !23
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #6
  br label %77

74:                                               ; preds = %42
  %75 = load ptr, ptr %16, align 8, !tbaa !5
  %76 = getelementptr inbounds %struct.b3GraphicsInstance, ptr %75, i32 0, i32 7
  store i32 0, ptr %76, align 8, !tbaa !21
  br label %77

77:                                               ; preds = %74, %49
  %78 = getelementptr inbounds %class.TinyGLInstancingRenderer, ptr %25, i32 0, i32 1
  call void @_ZNSt6vectorIP18b3GraphicsInstanceSaIS1_EE9push_backERKS1_(ptr noundef nonnull align 8 dereferenceable(24) %78, ptr noundef nonnull align 8 dereferenceable(8) %16)
  %79 = load i32, ptr %13, align 4, !tbaa !9
  %80 = load ptr, ptr %16, align 8, !tbaa !5
  %81 = getelementptr inbounds %struct.b3GraphicsInstance, ptr %80, i32 0, i32 3
  store i32 %79, ptr %81, align 4, !tbaa !25
  %82 = load i32, ptr %11, align 4, !tbaa !9
  %83 = load ptr, ptr %16, align 8, !tbaa !5
  %84 = getelementptr inbounds %struct.b3GraphicsInstance, ptr %83, i32 0, i32 4
  store i32 %82, ptr %84, align 8, !tbaa !24
  call void @llvm.lifetime.start.p0(i64 4, ptr %20) #6
  store i32 36, ptr %20, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %21) #6
  %85 = load i32, ptr %11, align 4, !tbaa !9
  %86 = load i32, ptr %20, align 4, !tbaa !9
  %87 = mul nsw i32 %85, %86
  store i32 %87, ptr %21, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %22) #6
  %88 = load i32, ptr %20, align 4, !tbaa !9
  %89 = load ptr, ptr %16, align 8, !tbaa !5
  %90 = getelementptr inbounds %struct.b3GraphicsInstance, ptr %89, i32 0, i32 8
  %91 = load i32, ptr %90, align 4, !tbaa !23
  %92 = mul nsw i32 %88, %91
  %93 = load i32, ptr %21, align 4, !tbaa !9
  %94 = add nsw i32 %92, %93
  store i32 %94, ptr %22, align 4, !tbaa !9
  %95 = load i32, ptr %22, align 4, !tbaa !9
  %96 = getelementptr inbounds %class.TinyGLInstancingRenderer, ptr %25, i32 0, i32 2
  %97 = load ptr, ptr %96, align 8, !tbaa !26
  %98 = getelementptr inbounds %struct.GLInstanceRendererInternalData, ptr %97, i32 0, i32 8
  %99 = load i32, ptr %98, align 8, !tbaa !33
  %100 = icmp slt i32 %95, %99
  br i1 %100, label %101, label %102

101:                                              ; preds = %77
  br label %104

102:                                              ; preds = %77
  call void @__assert_fail(ptr noundef @.str.7, ptr noundef @.str.1, i32 noundef 1117, ptr noundef @__PRETTY_FUNCTION__._ZN24TinyGLInstancingRenderer14register_shapeEPKfiPKiiii) #9
  unreachable

103:                                              ; No predecessors!
  br label %104

104:                                              ; preds = %103, %101
  %105 = load i32, ptr %22, align 4, !tbaa !9
  %106 = getelementptr inbounds %class.TinyGLInstancingRenderer, ptr %25, i32 0, i32 2
  %107 = load ptr, ptr %106, align 8, !tbaa !26
  %108 = getelementptr inbounds %struct.GLInstanceRendererInternalData, ptr %107, i32 0, i32 8
  %109 = load i32, ptr %108, align 8, !tbaa !33
  %110 = icmp sge i32 %105, %109
  br i1 %110, label %111, label %112

111:                                              ; preds = %104
  store i32 -1, ptr %8, align 4
  store i32 1, ptr %23, align 4
  br label %168

112:                                              ; preds = %104
  %113 = load ptr, ptr @glad_glBindBuffer, align 8, !tbaa !5
  %114 = getelementptr inbounds %class.TinyGLInstancingRenderer, ptr %25, i32 0, i32 2
  %115 = load ptr, ptr %114, align 8, !tbaa !26
  %116 = getelementptr inbounds %struct.GLInstanceRendererInternalData, ptr %115, i32 0, i32 5
  %117 = load i32, ptr %116, align 4, !tbaa !39
  call void %113(i32 noundef 34962, i32 noundef %117)
  %118 = load ptr, ptr @glad_glBufferSubData, align 8, !tbaa !5
  %119 = load i32, ptr %20, align 4, !tbaa !9
  %120 = load ptr, ptr %16, align 8, !tbaa !5
  %121 = getelementptr inbounds %struct.b3GraphicsInstance, ptr %120, i32 0, i32 8
  %122 = load i32, ptr %121, align 4, !tbaa !23
  %123 = mul nsw i32 %119, %122
  %124 = sext i32 %123 to i64
  %125 = load i32, ptr %21, align 4, !tbaa !9
  %126 = sext i32 %125 to i64
  %127 = load ptr, ptr %10, align 8, !tbaa !5
  call void %118(i32 noundef 34962, i64 noundef %124, i64 noundef %126, ptr noundef %127)
  %128 = load ptr, ptr @glad_glGenBuffers, align 8, !tbaa !5
  %129 = load ptr, ptr %16, align 8, !tbaa !5
  %130 = getelementptr inbounds %struct.b3GraphicsInstance, ptr %129, i32 0, i32 1
  call void %128(i32 noundef 1, ptr noundef %130)
  %131 = load ptr, ptr @glad_glBindBuffer, align 8, !tbaa !5
  %132 = load ptr, ptr %16, align 8, !tbaa !5
  %133 = getelementptr inbounds %struct.b3GraphicsInstance, ptr %132, i32 0, i32 1
  %134 = load i32, ptr %133, align 4, !tbaa !40
  call void %131(i32 noundef 34963, i32 noundef %134)
  call void @llvm.lifetime.start.p0(i64 4, ptr %24) #6
  %135 = load ptr, ptr %16, align 8, !tbaa !5
  %136 = getelementptr inbounds %struct.b3GraphicsInstance, ptr %135, i32 0, i32 3
  %137 = load i32, ptr %136, align 4, !tbaa !25
  %138 = sext i32 %137 to i64
  %139 = mul i64 %138, 4
  %140 = trunc i64 %139 to i32
  store i32 %140, ptr %24, align 4, !tbaa !9
  %141 = load ptr, ptr @glad_glBufferData, align 8, !tbaa !5
  %142 = load i32, ptr %24, align 4, !tbaa !9
  %143 = sext i32 %142 to i64
  call void %141(i32 noundef 34963, i64 noundef %143, ptr noundef null, i32 noundef 35044)
  %144 = load ptr, ptr @glad_glBufferSubData, align 8, !tbaa !5
  %145 = load i32, ptr %24, align 4, !tbaa !9
  %146 = sext i32 %145 to i64
  %147 = load ptr, ptr %12, align 8, !tbaa !5
  call void %144(i32 noundef 34963, i64 noundef 0, i64 noundef %146, ptr noundef %147)
  %148 = load ptr, ptr @glad_glBindBuffer, align 8, !tbaa !5
  call void %148(i32 noundef 34963, i32 noundef 0)
  %149 = load ptr, ptr @glad_glGenVertexArrays, align 8, !tbaa !5
  %150 = load ptr, ptr %16, align 8, !tbaa !5
  %151 = getelementptr inbounds %struct.b3GraphicsInstance, ptr %150, i32 0, i32 0
  call void %149(i32 noundef 1, ptr noundef %151)
  %152 = load ptr, ptr @glad_glBindVertexArray, align 8, !tbaa !5
  %153 = load ptr, ptr %16, align 8, !tbaa !5
  %154 = getelementptr inbounds %struct.b3GraphicsInstance, ptr %153, i32 0, i32 0
  %155 = load i32, ptr %154, align 8, !tbaa !41
  call void %152(i32 noundef %155)
  %156 = load ptr, ptr @glad_glBindBuffer, align 8, !tbaa !5
  %157 = getelementptr inbounds %class.TinyGLInstancingRenderer, ptr %25, i32 0, i32 2
  %158 = load ptr, ptr %157, align 8, !tbaa !26
  %159 = getelementptr inbounds %struct.GLInstanceRendererInternalData, ptr %158, i32 0, i32 5
  %160 = load i32, ptr %159, align 4, !tbaa !39
  call void %156(i32 noundef 34962, i32 noundef %160)
  %161 = load ptr, ptr @glad_glBindVertexArray, align 8, !tbaa !5
  call void %161(i32 noundef 0)
  %162 = load ptr, ptr @glad_glBindBuffer, align 8, !tbaa !5
  call void %162(i32 noundef 34962, i32 noundef 0)
  %163 = load ptr, ptr @glad_glBindVertexArray, align 8, !tbaa !5
  call void %163(i32 noundef 0)
  %164 = getelementptr inbounds %class.TinyGLInstancingRenderer, ptr %25, i32 0, i32 1
  %165 = call noundef i64 @_ZNKSt6vectorIP18b3GraphicsInstanceSaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %164) #6
  %166 = sub i64 %165, 1
  %167 = trunc i64 %166 to i32
  store i32 %167, ptr %8, align 4
  store i32 1, ptr %23, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %24) #6
  br label %168

168:                                              ; preds = %112, %111
  call void @llvm.lifetime.end.p0(i64 4, ptr %22) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %21) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #6
  %169 = load i32, ptr %8, align 4
  ret i32 %169

170:                                              ; preds = %38
  %171 = load ptr, ptr %17, align 8
  %172 = load i32, ptr %18, align 4
  %173 = insertvalue { ptr, i32 } poison, ptr %171, 0
  %174 = insertvalue { ptr, i32 } %173, i32 %172, 1
  resume { ptr, i32 } %174
}

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN18b3GraphicsInstanceC2Ev(ptr noundef nonnull align 8 dereferenceable(84)) unnamed_addr #5 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt6vectorIP18b3GraphicsInstanceSaIS1_EE9push_backERKS1_(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(8)) #5 align 2

attributes #0 = { 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 #1 = { nobuiltin nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { 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 = { 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 #5 = { 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 #6 = { nounwind }
attributes #7 = { builtin allocsize(0) }
attributes #8 = { builtin nounwind }
attributes #9 = { noreturn 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, !10, i64 8}
!12 = !{!"_ZTS18b3GraphicsInstance", !10, i64 0, !10, i64 4, !10, i64 8, !10, i64 12, !10, i64 16, !10, i64 20, !13, i64 24, !10, i64 48, !10, i64 52, !10, i64 56, !17, i64 60, !18, i64 64, !10, i64 80}
!13 = !{!"_ZTSSt6vectorIiSaIiEE", !14, i64 0}
!14 = !{!"_ZTSSt12_Vector_baseIiSaIiEE", !15, i64 0}
!15 = !{!"_ZTSNSt12_Vector_baseIiSaIiEE12_Vector_implE", !16, i64 0}
!16 = !{!"_ZTSNSt12_Vector_baseIiSaIiEE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!17 = !{!"float", !7, i64 0}
!18 = !{!"_ZTSN4TINY11TinyVector3IfNS_10FloatUtilsEEE", !17, i64 0, !17, i64 4, !17, i64 8, !10, i64 12}
!19 = !{!12, !10, i64 80}
!20 = !{!12, !10, i64 56}
!21 = !{!12, !10, i64 48}
!22 = !{!12, !10, i64 20}
!23 = !{!12, !10, i64 52}
!24 = !{!12, !10, i64 16}
!25 = !{!12, !10, i64 12}
!26 = !{!27, !6, i64 32}
!27 = !{!"_ZTS24TinyGLInstancingRenderer", !28, i64 8, !6, i64 32, !32, i64 40, !32, i64 41, !10, i64 44, !10, i64 48, !10, i64 52, !10, i64 56}
!28 = !{!"_ZTSSt6vectorIP18b3GraphicsInstanceSaIS1_EE", !29, i64 0}
!29 = !{!"_ZTSSt12_Vector_baseIP18b3GraphicsInstanceSaIS1_EE", !30, i64 0}
!30 = !{!"_ZTSNSt12_Vector_baseIP18b3GraphicsInstanceSaIS1_EE12_Vector_implE", !31, i64 0}
!31 = !{!"_ZTSNSt12_Vector_baseIP18b3GraphicsInstanceSaIS1_EE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!32 = !{!"bool", !7, i64 0}
!33 = !{!34, !10, i64 112}
!34 = !{!"_ZTS30GLInstanceRendererInternalData", !35, i64 0, !35, i64 24, !35, i64 48, !35, i64 72, !10, i64 96, !10, i64 100, !10, i64 104, !10, i64 108, !10, i64 112}
!35 = !{!"_ZTSSt6vectorIfSaIfEE", !36, i64 0}
!36 = !{!"_ZTSSt12_Vector_baseIfSaIfEE", !37, i64 0}
!37 = !{!"_ZTSNSt12_Vector_baseIfSaIfEE12_Vector_implE", !38, i64 0}
!38 = !{!"_ZTSNSt12_Vector_baseIfSaIfEE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!39 = !{!34, !10, i64 100}
!40 = !{!12, !10, i64 4}
!41 = !{!12, !10, i64 0}


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

@.str.1 = external hidden unnamed_addr constant [130 x i8], align 1
@glad_glBindBuffer = external local_unnamed_addr global ptr, align 8
@glad_glBufferSubData = external local_unnamed_addr global ptr, align 8
@.str.7 = external hidden unnamed_addr constant [46 x i8], align 1
@__PRETTY_FUNCTION__._ZN24TinyGLInstancingRenderer14register_shapeEPKfiPKiiii = external hidden unnamed_addr constant [101 x i8], align 1
@glad_glGenBuffers = external local_unnamed_addr global ptr, align 8
@glad_glBufferData = external local_unnamed_addr global ptr, align 8
@glad_glGenVertexArrays = external local_unnamed_addr global ptr, align 8
@glad_glBindVertexArray = external local_unnamed_addr global ptr, align 8

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

declare i32 @__gxx_personality_v0(...)

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

; 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 dso_local noundef i64 @_ZNKSt6vectorIP18b3GraphicsInstanceSaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #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) local_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: noreturn nounwind
declare void @__assert_fail(ptr noundef, ptr noundef, i32 noundef, ptr noundef) local_unnamed_addr #4

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_ZN24TinyGLInstancingRenderer14register_shapeEPKfiPKiiii(ptr noundef nonnull align 8 dereferenceable(60) %0, ptr noundef %1, i32 noundef %2, ptr noundef %3, i32 noundef %4, i32 noundef %5, i32 noundef %6) unnamed_addr #5 align 2 personality ptr @__gxx_personality_v0 {
  %8 = alloca ptr, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %8) #6
  %9 = tail call noalias noundef nonnull dereferenceable(88) ptr @_Znwm(i64 noundef 88) #7
  invoke void @_ZN18b3GraphicsInstanceC2Ev(ptr noundef nonnull align 8 dereferenceable(84) %9)
          to label %10 unwind label %17

10:                                               ; preds = %7
  store ptr %9, ptr %8, align 8, !tbaa !5
  %11 = icmp sgt i32 %6, -1
  br i1 %11, label %12, label %19

12:                                               ; preds = %10
  %13 = getelementptr inbounds i8, ptr %9, i64 8
  store i32 %6, ptr %13, align 8, !tbaa !9
  %14 = getelementptr inbounds i8, ptr %9, i64 80
  %15 = load i32, ptr %14, align 8, !tbaa !18
  %16 = or i32 %15, 2
  store i32 %16, ptr %14, align 8, !tbaa !18
  br label %19

17:                                               ; preds = %7
  %18 = landingpad { ptr, i32 }
          cleanup
  tail call void @_ZdlPvm(ptr noundef nonnull %9, i64 noundef 88) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #6
  resume { ptr, i32 } %18

19:                                               ; preds = %12, %10
  %20 = getelementptr inbounds i8, ptr %9, i64 56
  store i32 %5, ptr %20, align 8, !tbaa !19
  %21 = getelementptr inbounds i8, ptr %0, i64 8
  %22 = tail call noundef i64 @_ZNKSt6vectorIP18b3GraphicsInstanceSaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %21) #6
  %.not = icmp eq i64 %22, 0
  br i1 %.not, label %35, label %23

23:                                               ; preds = %19
  %24 = tail call noundef i64 @_ZNKSt6vectorIP18b3GraphicsInstanceSaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %21) #6
  %25 = add i64 %24, -1
  %26 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIP18b3GraphicsInstanceSaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %21, i64 noundef %25) #6
  %27 = load ptr, ptr %26, align 8, !tbaa !5
  %28 = getelementptr inbounds i8, ptr %27, i64 48
  %29 = getelementptr inbounds i8, ptr %9, i64 48
  %30 = getelementptr inbounds i8, ptr %27, i64 16
  %31 = load <2 x i32>, ptr %28, align 8, !tbaa !20
  %32 = load <2 x i32>, ptr %30, align 8, !tbaa !20
  %33 = shufflevector <2 x i32> %32, <2 x i32> poison, <2 x i32> <i32 1, i32 0>
  %34 = add nsw <2 x i32> %33, %31
  store <2 x i32> %34, ptr %29, align 8, !tbaa !20
  br label %37

35:                                               ; preds = %19
  %36 = getelementptr inbounds i8, ptr %9, i64 48
  store i32 0, ptr %36, align 8, !tbaa !21
  br label %37

37:                                               ; preds = %35, %23
  call void @_ZNSt6vectorIP18b3GraphicsInstanceSaIS1_EE9push_backERKS1_(ptr noundef nonnull align 8 dereferenceable(24) %21, ptr noundef nonnull align 8 dereferenceable(8) %8)
  %38 = load ptr, ptr %8, align 8, !tbaa !5
  %39 = getelementptr inbounds i8, ptr %38, i64 12
  store i32 %4, ptr %39, align 4, !tbaa !22
  %40 = getelementptr inbounds i8, ptr %38, i64 16
  store i32 %2, ptr %40, align 8, !tbaa !23
  %41 = getelementptr inbounds i8, ptr %38, i64 52
  %42 = load i32, ptr %41, align 4, !tbaa !24
  %43 = add i32 %42, %2
  %44 = mul i32 %43, 36
  %45 = getelementptr inbounds i8, ptr %0, i64 32
  %46 = load ptr, ptr %45, align 8, !tbaa !25
  %47 = getelementptr inbounds i8, ptr %46, i64 112
  %48 = load i32, ptr %47, align 8, !tbaa !32
  %49 = icmp slt i32 %44, %48
  br i1 %49, label %51, label %50

50:                                               ; preds = %37
  call void @__assert_fail(ptr noundef nonnull @.str.7, ptr noundef nonnull @.str.1, i32 noundef 1117, ptr noundef nonnull @__PRETTY_FUNCTION__._ZN24TinyGLInstancingRenderer14register_shapeEPKfiPKiiii) #9
  unreachable

51:                                               ; preds = %37
  %52 = mul nsw i32 %2, 36
  %53 = load ptr, ptr @glad_glBindBuffer, align 8, !tbaa !5
  %54 = getelementptr inbounds i8, ptr %46, i64 100
  %55 = load i32, ptr %54, align 4, !tbaa !38
  call void %53(i32 noundef 34962, i32 noundef %55)
  %56 = load ptr, ptr @glad_glBufferSubData, align 8, !tbaa !5
  %57 = load ptr, ptr %8, align 8, !tbaa !5
  %58 = getelementptr inbounds i8, ptr %57, i64 52
  %59 = load i32, ptr %58, align 4, !tbaa !24
  %60 = mul nsw i32 %59, 36
  %61 = sext i32 %60 to i64
  %62 = sext i32 %52 to i64
  call void %56(i32 noundef 34962, i64 noundef %61, i64 noundef %62, ptr noundef %1)
  %63 = load ptr, ptr @glad_glGenBuffers, align 8, !tbaa !5
  %64 = load ptr, ptr %8, align 8, !tbaa !5
  %65 = getelementptr inbounds i8, ptr %64, i64 4
  call void %63(i32 noundef 1, ptr noundef nonnull %65)
  %66 = load ptr, ptr @glad_glBindBuffer, align 8, !tbaa !5
  %67 = load ptr, ptr %8, align 8, !tbaa !5
  %68 = getelementptr inbounds i8, ptr %67, i64 4
  %69 = load i32, ptr %68, align 4, !tbaa !39
  call void %66(i32 noundef 34963, i32 noundef %69)
  %70 = load ptr, ptr %8, align 8, !tbaa !5
  %71 = getelementptr inbounds i8, ptr %70, i64 12
  %72 = load i32, ptr %71, align 4, !tbaa !22
  %73 = shl i32 %72, 2
  %74 = load ptr, ptr @glad_glBufferData, align 8, !tbaa !5
  %75 = sext i32 %73 to i64
  call void %74(i32 noundef 34963, i64 noundef %75, ptr noundef null, i32 noundef 35044)
  %76 = load ptr, ptr @glad_glBufferSubData, align 8, !tbaa !5
  call void %76(i32 noundef 34963, i64 noundef 0, i64 noundef %75, ptr noundef %3)
  %77 = load ptr, ptr @glad_glBindBuffer, align 8, !tbaa !5
  call void %77(i32 noundef 34963, i32 noundef 0)
  %78 = load ptr, ptr @glad_glGenVertexArrays, align 8, !tbaa !5
  %79 = load ptr, ptr %8, align 8, !tbaa !5
  call void %78(i32 noundef 1, ptr noundef %79)
  %80 = load ptr, ptr @glad_glBindVertexArray, align 8, !tbaa !5
  %81 = load ptr, ptr %8, align 8, !tbaa !5
  %82 = load i32, ptr %81, align 8, !tbaa !40
  call void %80(i32 noundef %82)
  %83 = load ptr, ptr @glad_glBindBuffer, align 8, !tbaa !5
  %84 = load ptr, ptr %45, align 8, !tbaa !25
  %85 = getelementptr inbounds i8, ptr %84, i64 100
  %86 = load i32, ptr %85, align 4, !tbaa !38
  call void %83(i32 noundef 34962, i32 noundef %86)
  %87 = load ptr, ptr @glad_glBindVertexArray, align 8, !tbaa !5
  call void %87(i32 noundef 0)
  %88 = load ptr, ptr @glad_glBindBuffer, align 8, !tbaa !5
  call void %88(i32 noundef 34962, i32 noundef 0)
  %89 = load ptr, ptr @glad_glBindVertexArray, align 8, !tbaa !5
  call void %89(i32 noundef 0)
  %90 = call noundef i64 @_ZNKSt6vectorIP18b3GraphicsInstanceSaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %21) #6
  %91 = trunc i64 %90 to i32
  %92 = add i32 %91, -1
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #6
  ret i32 %92
}

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN18b3GraphicsInstanceC2Ev(ptr noundef nonnull align 8 dereferenceable(84)) unnamed_addr #5 align 2

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

attributes #0 = { 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 #1 = { nobuiltin nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { mustprogress 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 = { 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 #5 = { 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 #6 = { nounwind }
attributes #7 = { builtin allocsize(0) }
attributes #8 = { builtin nounwind }
attributes #9 = { noreturn 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, !11, i64 8}
!10 = !{!"_ZTS18b3GraphicsInstance", !11, i64 0, !11, i64 4, !11, i64 8, !11, i64 12, !11, i64 16, !11, i64 20, !12, i64 24, !11, i64 48, !11, i64 52, !11, i64 56, !16, i64 60, !17, i64 64, !11, i64 80}
!11 = !{!"int", !7, i64 0}
!12 = !{!"_ZTSSt6vectorIiSaIiEE", !13, i64 0}
!13 = !{!"_ZTSSt12_Vector_baseIiSaIiEE", !14, i64 0}
!14 = !{!"_ZTSNSt12_Vector_baseIiSaIiEE12_Vector_implE", !15, i64 0}
!15 = !{!"_ZTSNSt12_Vector_baseIiSaIiEE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!16 = !{!"float", !7, i64 0}
!17 = !{!"_ZTSN4TINY11TinyVector3IfNS_10FloatUtilsEEE", !16, i64 0, !16, i64 4, !16, i64 8, !11, i64 12}
!18 = !{!10, !11, i64 80}
!19 = !{!10, !11, i64 56}
!20 = !{!11, !11, i64 0}
!21 = !{!10, !11, i64 48}
!22 = !{!10, !11, i64 12}
!23 = !{!10, !11, i64 16}
!24 = !{!10, !11, i64 52}
!25 = !{!26, !6, i64 32}
!26 = !{!"_ZTS24TinyGLInstancingRenderer", !27, i64 8, !6, i64 32, !31, i64 40, !31, i64 41, !11, i64 44, !11, i64 48, !11, i64 52, !11, i64 56}
!27 = !{!"_ZTSSt6vectorIP18b3GraphicsInstanceSaIS1_EE", !28, i64 0}
!28 = !{!"_ZTSSt12_Vector_baseIP18b3GraphicsInstanceSaIS1_EE", !29, i64 0}
!29 = !{!"_ZTSNSt12_Vector_baseIP18b3GraphicsInstanceSaIS1_EE12_Vector_implE", !30, i64 0}
!30 = !{!"_ZTSNSt12_Vector_baseIP18b3GraphicsInstanceSaIS1_EE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!31 = !{!"bool", !7, i64 0}
!32 = !{!33, !11, i64 112}
!33 = !{!"_ZTS30GLInstanceRendererInternalData", !34, i64 0, !34, i64 24, !34, i64 48, !34, i64 72, !11, i64 96, !11, i64 100, !11, i64 104, !11, i64 108, !11, i64 112}
!34 = !{!"_ZTSSt6vectorIfSaIfEE", !35, i64 0}
!35 = !{!"_ZTSSt12_Vector_baseIfSaIfEE", !36, i64 0}
!36 = !{!"_ZTSNSt12_Vector_baseIfSaIfEE12_Vector_implE", !37, i64 0}
!37 = !{!"_ZTSNSt12_Vector_baseIfSaIfEE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!38 = !{!33, !11, i64 100}
!39 = !{!10, !11, i64 4}
!40 = !{!10, !11, i64 0}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,ReassociatePass,SLPVectorizerPass,SROAPass,SimplifyCFGPass,TailCallElimPass