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

; 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.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 }>
%"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.TinyCamera = type { ptr, ptr }
%"struct.TINY::TinyVector3" = type { float, float, float, i32 }
%"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 }

@.str.1 = external hidden unnamed_addr constant [130 x i8], align 1
@glad_glGetError = external global ptr, align 8
@.str.4 = external hidden unnamed_addr constant [28 x i8], align 1
@glad_glActiveTexture = external global ptr, align 8
@glad_glGenTextures = external global ptr, align 8
@glad_glBindTexture = external global ptr, align 8
@glad_glTexImage2D = external global ptr, align 8
@glad_glGenerateMipmap = external global ptr, align 8
@__PRETTY_FUNCTION__._ZN24TinyGLInstancingRenderer4initEv = external hidden unnamed_addr constant [46 x i8], align 1
@glad_glEnable = external global ptr, align 8
@glad_glDepthFunc = external global ptr, align 8
@glad_glDisable = 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: noreturn nounwind
declare void @__assert_fail(ptr noundef, ptr noundef, i32 noundef, ptr noundef) #1

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

12:                                               ; preds = %1
  br label %15

13:                                               ; preds = %1
  call void @__assert_fail(ptr noundef @.str.4, ptr noundef @.str.1, i32 noundef 1366, ptr noundef @__PRETTY_FUNCTION__._ZN24TinyGLInstancingRenderer4initEv) #5
  unreachable

14:                                               ; No predecessors!
  br label %15

15:                                               ; preds = %14, %12
  %16 = load ptr, ptr @glad_glEnable, align 8, !tbaa !5
  call void %16(i32 noundef 2929)
  %17 = load ptr, ptr @glad_glDepthFunc, align 8, !tbaa !5
  call void %17(i32 noundef 513)
  %18 = load ptr, ptr @glad_glGetError, align 8, !tbaa !5
  %19 = call i32 %18()
  %20 = icmp eq i32 %19, 0
  br i1 %20, label %21, label %22

21:                                               ; preds = %15
  br label %24

22:                                               ; preds = %15
  call void @__assert_fail(ptr noundef @.str.4, ptr noundef @.str.1, i32 noundef 1371, ptr noundef @__PRETTY_FUNCTION__._ZN24TinyGLInstancingRenderer4initEv) #5
  unreachable

23:                                               ; No predecessors!
  br label %24

24:                                               ; preds = %23, %21
  %25 = load ptr, ptr @glad_glGetError, align 8, !tbaa !5
  %26 = call i32 %25()
  %27 = icmp eq i32 %26, 0
  br i1 %27, label %28, label %29

28:                                               ; preds = %24
  br label %31

29:                                               ; preds = %24
  call void @__assert_fail(ptr noundef @.str.4, ptr noundef @.str.1, i32 noundef 1375, ptr noundef @__PRETTY_FUNCTION__._ZN24TinyGLInstancingRenderer4initEv) #5
  unreachable

30:                                               ; No predecessors!
  br label %31

31:                                               ; preds = %30, %28
  %32 = load ptr, ptr @glad_glGetError, align 8, !tbaa !5
  %33 = call i32 %32()
  %34 = icmp eq i32 %33, 0
  br i1 %34, label %35, label %36

35:                                               ; preds = %31
  br label %38

36:                                               ; preds = %31
  call void @__assert_fail(ptr noundef @.str.4, ptr noundef @.str.1, i32 noundef 1377, ptr noundef @__PRETTY_FUNCTION__._ZN24TinyGLInstancingRenderer4initEv) #5
  unreachable

37:                                               ; No predecessors!
  br label %38

38:                                               ; preds = %37, %35
  %39 = getelementptr inbounds %class.TinyGLInstancingRenderer, ptr %8, i32 0, i32 3
  %40 = load i8, ptr %39, align 8, !tbaa !9, !range !17, !noundef !18
  %41 = trunc i8 %40 to i1
  br i1 %41, label %42, label %152

42:                                               ; preds = %38
  %43 = getelementptr inbounds %class.TinyGLInstancingRenderer, ptr %8, i32 0, i32 4
  %44 = load i8, ptr %43, align 1, !tbaa !19, !range !17, !noundef !18
  %45 = trunc i8 %44 to i1
  br i1 %45, label %132, label %46

46:                                               ; preds = %42
  %47 = load ptr, ptr @glad_glActiveTexture, align 8, !tbaa !5
  call void %47(i32 noundef 33984)
  call void @llvm.lifetime.start.p0(i64 8, ptr %3) #6
  %48 = call noalias noundef nonnull ptr @_Znam(i64 noundef 196608) #7
  store ptr %48, ptr %3, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #6
  store i32 0, ptr %4, align 4, !tbaa !20
  br label %49

49:                                               ; preds = %97, %46
  %50 = load i32, ptr %4, align 4, !tbaa !20
  %51 = icmp slt i32 %50, 256
  br i1 %51, label %53, label %52

52:                                               ; preds = %49
  store i32 2, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #6
  br label %100

53:                                               ; preds = %49
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #6
  %54 = load ptr, ptr %3, align 8, !tbaa !5
  %55 = load i32, ptr %4, align 4, !tbaa !20
  %56 = mul nsw i32 %55, 256
  %57 = mul nsw i32 %56, 3
  %58 = sext i32 %57 to i64
  %59 = getelementptr inbounds i8, ptr %54, i64 %58
  store ptr %59, ptr %6, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #6
  store i32 0, ptr %7, align 4, !tbaa !20
  br label %60

60:                                               ; preds = %93, %53
  %61 = load i32, ptr %7, align 4, !tbaa !20
  %62 = icmp slt i32 %61, 256
  br i1 %62, label %64, label %63

63:                                               ; preds = %60
  store i32 5, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #6
  br label %96

64:                                               ; preds = %60
  %65 = load i32, ptr %7, align 4, !tbaa !20
  %66 = icmp slt i32 %65, 2
  br i1 %66, label %76, label %67

67:                                               ; preds = %64
  %68 = load i32, ptr %4, align 4, !tbaa !20
  %69 = icmp slt i32 %68, 2
  br i1 %69, label %76, label %70

70:                                               ; preds = %67
  %71 = load i32, ptr %7, align 4, !tbaa !20
  %72 = icmp sgt i32 %71, 253
  br i1 %72, label %76, label %73

73:                                               ; preds = %70
  %74 = load i32, ptr %4, align 4, !tbaa !20
  %75 = icmp sgt i32 %74, 253
  br i1 %75, label %76, label %83

76:                                               ; preds = %73, %70, %67, %64
  %77 = load ptr, ptr %6, align 8, !tbaa !5
  %78 = getelementptr inbounds i8, ptr %77, i64 0
  store i8 -1, ptr %78, align 1, !tbaa !21
  %79 = load ptr, ptr %6, align 8, !tbaa !5
  %80 = getelementptr inbounds i8, ptr %79, i64 1
  store i8 -1, ptr %80, align 1, !tbaa !21
  %81 = load ptr, ptr %6, align 8, !tbaa !5
  %82 = getelementptr inbounds i8, ptr %81, i64 2
  store i8 -1, ptr %82, align 1, !tbaa !21
  br label %90

83:                                               ; preds = %73
  %84 = load ptr, ptr %6, align 8, !tbaa !5
  %85 = getelementptr inbounds i8, ptr %84, i64 0
  store i8 -1, ptr %85, align 1, !tbaa !21
  %86 = load ptr, ptr %6, align 8, !tbaa !5
  %87 = getelementptr inbounds i8, ptr %86, i64 1
  store i8 -1, ptr %87, align 1, !tbaa !21
  %88 = load ptr, ptr %6, align 8, !tbaa !5
  %89 = getelementptr inbounds i8, ptr %88, i64 2
  store i8 -1, ptr %89, align 1, !tbaa !21
  br label %90

90:                                               ; preds = %83, %76
  %91 = load ptr, ptr %6, align 8, !tbaa !5
  %92 = getelementptr inbounds i8, ptr %91, i64 3
  store ptr %92, ptr %6, align 8, !tbaa !5
  br label %93

93:                                               ; preds = %90
  %94 = load i32, ptr %7, align 4, !tbaa !20
  %95 = add nsw i32 %94, 1
  store i32 %95, ptr %7, align 4, !tbaa !20
  br label %60, !llvm.loop !22

96:                                               ; preds = %63
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #6
  br label %97

97:                                               ; preds = %96
  %98 = load i32, ptr %4, align 4, !tbaa !20
  %99 = add nsw i32 %98, 1
  store i32 %99, ptr %4, align 4, !tbaa !20
  br label %49, !llvm.loop !24

100:                                              ; preds = %52
  %101 = load ptr, ptr @glad_glGenTextures, align 8, !tbaa !5
  %102 = getelementptr inbounds %class.TinyGLInstancingRenderer, ptr %8, i32 0, i32 2
  %103 = load ptr, ptr %102, align 8, !tbaa !25
  %104 = getelementptr inbounds %struct.InternalDataRenderer, ptr %103, i32 0, i32 13
  call void %101(i32 noundef 1, ptr noundef %104)
  %105 = load ptr, ptr @glad_glBindTexture, align 8, !tbaa !5
  %106 = getelementptr inbounds %class.TinyGLInstancingRenderer, ptr %8, i32 0, i32 2
  %107 = load ptr, ptr %106, align 8, !tbaa !25
  %108 = getelementptr inbounds %struct.InternalDataRenderer, ptr %107, i32 0, i32 13
  %109 = load i32, ptr %108, align 4, !tbaa !26
  call void %105(i32 noundef 3553, i32 noundef %109)
  %110 = load ptr, ptr @glad_glGetError, align 8, !tbaa !5
  %111 = call i32 %110()
  %112 = icmp eq i32 %111, 0
  br i1 %112, label %113, label %114

113:                                              ; preds = %100
  br label %116

114:                                              ; preds = %100
  call void @__assert_fail(ptr noundef @.str.4, ptr noundef @.str.1, i32 noundef 1414, ptr noundef @__PRETTY_FUNCTION__._ZN24TinyGLInstancingRenderer4initEv) #5
  unreachable

115:                                              ; No predecessors!
  br label %116

116:                                              ; preds = %115, %113
  %117 = load ptr, ptr @glad_glTexImage2D, align 8, !tbaa !5
  %118 = load ptr, ptr %3, align 8, !tbaa !5
  call void %117(i32 noundef 3553, i32 noundef 0, i32 noundef 6407, i32 noundef 256, i32 noundef 256, i32 noundef 0, i32 noundef 6407, i32 noundef 5121, ptr noundef %118)
  %119 = load ptr, ptr @glad_glGenerateMipmap, align 8, !tbaa !5
  call void %119(i32 noundef 3553)
  %120 = load ptr, ptr @glad_glGetError, align 8, !tbaa !5
  %121 = call i32 %120()
  %122 = icmp eq i32 %121, 0
  br i1 %122, label %123, label %124

123:                                              ; preds = %116
  br label %126

124:                                              ; preds = %116
  call void @__assert_fail(ptr noundef @.str.4, ptr noundef @.str.1, i32 noundef 1420, ptr noundef @__PRETTY_FUNCTION__._ZN24TinyGLInstancingRenderer4initEv) #5
  unreachable

125:                                              ; No predecessors!
  br label %126

126:                                              ; preds = %125, %123
  %127 = load ptr, ptr %3, align 8, !tbaa !5
  %128 = icmp eq ptr %127, null
  br i1 %128, label %130, label %129

129:                                              ; preds = %126
  call void @_ZdaPv(ptr noundef %127) #8
  br label %130

130:                                              ; preds = %129, %126
  %131 = getelementptr inbounds %class.TinyGLInstancingRenderer, ptr %8, i32 0, i32 4
  store i8 1, ptr %131, align 1, !tbaa !19
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #6
  br label %132

132:                                              ; preds = %130, %42
  %133 = load ptr, ptr @glad_glGetError, align 8, !tbaa !5
  %134 = call i32 %133()
  %135 = icmp eq i32 %134, 0
  br i1 %135, label %136, label %137

136:                                              ; preds = %132
  br label %139

137:                                              ; preds = %132
  call void @__assert_fail(ptr noundef @.str.4, ptr noundef @.str.1, i32 noundef 1426, ptr noundef @__PRETTY_FUNCTION__._ZN24TinyGLInstancingRenderer4initEv) #5
  unreachable

138:                                              ; No predecessors!
  br label %139

139:                                              ; preds = %138, %136
  %140 = load ptr, ptr @glad_glBindTexture, align 8, !tbaa !5
  %141 = getelementptr inbounds %class.TinyGLInstancingRenderer, ptr %8, i32 0, i32 2
  %142 = load ptr, ptr %141, align 8, !tbaa !25
  %143 = getelementptr inbounds %struct.InternalDataRenderer, ptr %142, i32 0, i32 13
  %144 = load i32, ptr %143, align 4, !tbaa !26
  call void %140(i32 noundef 3553, i32 noundef %144)
  %145 = load ptr, ptr @glad_glGetError, align 8, !tbaa !5
  %146 = call i32 %145()
  %147 = icmp eq i32 %146, 0
  br i1 %147, label %148, label %149

148:                                              ; preds = %139
  br label %151

149:                                              ; preds = %139
  call void @__assert_fail(ptr noundef @.str.4, ptr noundef @.str.1, i32 noundef 1429, ptr noundef @__PRETTY_FUNCTION__._ZN24TinyGLInstancingRenderer4initEv) #5
  unreachable

150:                                              ; No predecessors!
  br label %151

151:                                              ; preds = %150, %148
  br label %161

152:                                              ; preds = %38
  %153 = load ptr, ptr @glad_glDisable, align 8, !tbaa !5
  call void %153(i32 noundef 3553)
  %154 = load ptr, ptr @glad_glGetError, align 8, !tbaa !5
  %155 = call i32 %154()
  %156 = icmp eq i32 %155, 0
  br i1 %156, label %157, label %158

157:                                              ; preds = %152
  br label %160

158:                                              ; preds = %152
  call void @__assert_fail(ptr noundef @.str.4, ptr noundef @.str.1, i32 noundef 1432, ptr noundef @__PRETTY_FUNCTION__._ZN24TinyGLInstancingRenderer4initEv) #5
  unreachable

159:                                              ; No predecessors!
  br label %160

160:                                              ; preds = %159, %157
  br label %161

161:                                              ; preds = %160, %151
  %162 = load ptr, ptr @glad_glGetError, align 8, !tbaa !5
  %163 = call i32 %162()
  %164 = icmp eq i32 %163, 0
  br i1 %164, label %165, label %166

165:                                              ; preds = %161
  br label %168

166:                                              ; preds = %161
  call void @__assert_fail(ptr noundef @.str.4, ptr noundef @.str.1, i32 noundef 1437, ptr noundef @__PRETTY_FUNCTION__._ZN24TinyGLInstancingRenderer4initEv) #5
  unreachable

167:                                              ; No predecessors!
  br label %168

168:                                              ; preds = %167, %165
  ret void
}

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

; Function Attrs: nobuiltin nounwind
declare void @_ZdaPv(ptr noundef) #4

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { 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 #4 = { 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 #5 = { noreturn nounwind }
attributes #6 = { nounwind }
attributes #7 = { builtin allocsize(0) }
attributes #8 = { 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, !15, i64 40}
!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 = !{i8 0, i8 2}
!18 = !{}
!19 = !{!10, !15, i64 41}
!20 = !{!16, !16, i64 0}
!21 = !{!7, !7, i64 0}
!22 = distinct !{!22, !23}
!23 = !{!"llvm.loop.mustprogress"}
!24 = distinct !{!24, !23}
!25 = !{!10, !6, i64 32}
!26 = !{!27, !16, i64 500}
!27 = !{!"_ZTS20InternalDataRenderer", !28, i64 0, !33, i64 120, !6, i64 136, !7, i64 144, !7, i64 208, !7, i64 272, !7, i64 336, !7, i64 400, !15, i64 464, !34, i64 468, !34, i64 484, !16, i64 500, !36, i64 504, !6, i64 528, !16, i64 536, !16, i64 540, !40, i64 544, !16, i64 584, !16, i64 588, !35, i64 592, !15, i64 596}
!28 = !{!"_ZTS30GLInstanceRendererInternalData", !29, i64 0, !29, i64 24, !29, i64 48, !29, i64 72, !16, i64 96, !16, i64 100, !16, i64 104, !16, i64 108, !16, i64 112}
!29 = !{!"_ZTSSt6vectorIfSaIfEE", !30, i64 0}
!30 = !{!"_ZTSSt12_Vector_baseIfSaIfEE", !31, i64 0}
!31 = !{!"_ZTSNSt12_Vector_baseIfSaIfEE12_Vector_implE", !32, i64 0}
!32 = !{!"_ZTSNSt12_Vector_baseIfSaIfEE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!33 = !{!"_ZTS10TinyCamera", !6, i64 8}
!34 = !{!"_ZTSN4TINY11TinyVector3IfNS_10FloatUtilsEEE", !35, i64 0, !35, i64 4, !35, i64 8, !16, i64 12}
!35 = !{!"float", !7, i64 0}
!36 = !{!"_ZTSSt6vectorI21InternalTextureHandleSaIS0_EE", !37, i64 0}
!37 = !{!"_ZTSSt12_Vector_baseI21InternalTextureHandleSaIS0_EE", !38, i64 0}
!38 = !{!"_ZTSNSt12_Vector_baseI21InternalTextureHandleSaIS0_EE12_Vector_implE", !39, i64 0}
!39 = !{!"_ZTSNSt12_Vector_baseI21InternalTextureHandleSaIS0_EE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!40 = !{!"_ZTS17TinyResizablePoolI18TinyPoolBodyHandleI30TinyPublicGraphicsInstanceDataEE", !41, i64 8, !16, i64 32, !16, i64 36}
!41 = !{!"_ZTSSt6vectorI18TinyPoolBodyHandleI30TinyPublicGraphicsInstanceDataESaIS2_EE", !42, i64 0}
!42 = !{!"_ZTSSt12_Vector_baseI18TinyPoolBodyHandleI30TinyPublicGraphicsInstanceDataESaIS2_EE", !43, i64 0}
!43 = !{!"_ZTSNSt12_Vector_baseI18TinyPoolBodyHandleI30TinyPublicGraphicsInstanceDataESaIS2_EE12_Vector_implE", !44, i64 0}
!44 = !{!"_ZTSNSt12_Vector_baseI18TinyPoolBodyHandleI30TinyPublicGraphicsInstanceDataESaIS2_EE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}


; 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_glGetError = external local_unnamed_addr global ptr, align 8
@.str.4 = external hidden unnamed_addr constant [28 x i8], align 1
@glad_glActiveTexture = external local_unnamed_addr global ptr, align 8
@glad_glGenTextures = external local_unnamed_addr global ptr, align 8
@glad_glBindTexture = external local_unnamed_addr global ptr, align 8
@glad_glTexImage2D = external local_unnamed_addr global ptr, align 8
@glad_glGenerateMipmap = external local_unnamed_addr global ptr, align 8
@__PRETTY_FUNCTION__._ZN24TinyGLInstancingRenderer4initEv = external hidden unnamed_addr constant [46 x i8], align 1
@glad_glEnable = external local_unnamed_addr global ptr, align 8
@glad_glDepthFunc = external local_unnamed_addr global ptr, align 8
@glad_glDisable = external local_unnamed_addr global ptr, align 8

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN24TinyGLInstancingRenderer4initEv(ptr nocapture noundef nonnull align 8 dereferenceable(60) %0) unnamed_addr #1 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 1366, ptr noundef nonnull @__PRETTY_FUNCTION__._ZN24TinyGLInstancingRenderer4initEv) #5
  unreachable

6:                                                ; preds = %1
  %7 = load ptr, ptr @glad_glEnable, align 8, !tbaa !5
  tail call void %7(i32 noundef 2929)
  %8 = load ptr, ptr @glad_glDepthFunc, align 8, !tbaa !5
  tail call void %8(i32 noundef 513)
  %9 = load ptr, ptr @glad_glGetError, align 8, !tbaa !5
  %10 = tail call i32 %9()
  %11 = icmp eq i32 %10, 0
  br i1 %11, label %13, label %12

12:                                               ; preds = %6
  tail call void @__assert_fail(ptr noundef nonnull @.str.4, ptr noundef nonnull @.str.1, i32 noundef 1371, ptr noundef nonnull @__PRETTY_FUNCTION__._ZN24TinyGLInstancingRenderer4initEv) #5
  unreachable

13:                                               ; preds = %6
  %14 = load ptr, ptr @glad_glGetError, align 8, !tbaa !5
  %15 = tail call i32 %14()
  %16 = icmp eq i32 %15, 0
  br i1 %16, label %18, label %17

17:                                               ; preds = %13
  tail call void @__assert_fail(ptr noundef nonnull @.str.4, ptr noundef nonnull @.str.1, i32 noundef 1375, ptr noundef nonnull @__PRETTY_FUNCTION__._ZN24TinyGLInstancingRenderer4initEv) #5
  unreachable

18:                                               ; preds = %13
  %19 = load ptr, ptr @glad_glGetError, align 8, !tbaa !5
  %20 = tail call i32 %19()
  %21 = icmp eq i32 %20, 0
  br i1 %21, label %23, label %22

22:                                               ; preds = %18
  tail call void @__assert_fail(ptr noundef nonnull @.str.4, ptr noundef nonnull @.str.1, i32 noundef 1377, ptr noundef nonnull @__PRETTY_FUNCTION__._ZN24TinyGLInstancingRenderer4initEv) #5
  unreachable

23:                                               ; preds = %18
  %24 = getelementptr inbounds i8, ptr %0, i64 40
  %25 = load i8, ptr %24, align 8, !tbaa !9, !range !17, !noundef !18
  %26 = trunc nuw i8 %25 to i1
  br i1 %26, label %27, label %88

27:                                               ; preds = %23
  %28 = getelementptr inbounds i8, ptr %0, i64 41
  %29 = load i8, ptr %28, align 1, !tbaa !19, !range !17, !noundef !18
  %30 = trunc nuw i8 %29 to i1
  br i1 %30, label %73, label %31

31:                                               ; preds = %27
  %32 = load ptr, ptr @glad_glActiveTexture, align 8, !tbaa !5
  tail call void %32(i32 noundef 33984)
  %33 = tail call noalias noundef nonnull dereferenceable(196608) ptr @_Znam(i64 noundef 196608) #6
  br label %46

34:                                               ; preds = %.split29.us
  %35 = load ptr, ptr @glad_glGenTextures, align 8, !tbaa !5
  %36 = getelementptr inbounds i8, ptr %0, i64 32
  %37 = load ptr, ptr %36, align 8, !tbaa !20
  %38 = getelementptr inbounds i8, ptr %37, i64 500
  tail call void %35(i32 noundef 1, ptr noundef nonnull %38)
  %39 = load ptr, ptr @glad_glBindTexture, align 8, !tbaa !5
  %40 = load ptr, ptr %36, align 8, !tbaa !20
  %41 = getelementptr inbounds i8, ptr %40, i64 500
  %42 = load i32, ptr %41, align 4, !tbaa !21
  tail call void %39(i32 noundef 3553, i32 noundef %42)
  %43 = load ptr, ptr @glad_glGetError, align 8, !tbaa !5
  %44 = tail call i32 %43()
  %45 = icmp eq i32 %44, 0
  br i1 %45, label %65, label %64

46:                                               ; preds = %31, %.split29.us
  %indvar = phi i64 [ 0, %31 ], [ %indvar.next, %.split29.us ]
  %47 = mul nuw nsw i64 %indvar, 768
  %scevgep = getelementptr i8, ptr %33, i64 %47
  %48 = trunc i64 %indvar to i32
  %49 = add i32 %48, -254
  %50 = icmp ult i32 %49, -252
  br i1 %50, label %.split.us.preheader, label %.split

.split.us.preheader:                              ; preds = %46
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(768) %scevgep, i8 -1, i64 768, i1 false), !tbaa !40
  br label %.split29.us

.split29.us:                                      ; preds = %.split, %.split.us.preheader
  %indvar.next = add nuw nsw i64 %indvar, 1
  %exitcond34.not = icmp eq i64 %indvar.next, 256
  br i1 %exitcond34.not, label %34, label %46, !llvm.loop !41

.split:                                           ; preds = %46, %.split
  %.027 = phi i32 [ %63, %.split ], [ 0, %46 ]
  %.02426 = phi ptr [ %62, %.split ], [ %scevgep, %46 ]
  store i8 -1, ptr %.02426, align 1
  %51 = getelementptr inbounds i8, ptr %.02426, i64 1
  store i8 -1, ptr %51, align 1
  %52 = getelementptr inbounds i8, ptr %.02426, i64 2
  store i8 -1, ptr %52, align 1
  %53 = getelementptr inbounds i8, ptr %.02426, i64 3
  store i8 -1, ptr %53, align 1
  %54 = getelementptr inbounds i8, ptr %.02426, i64 4
  store i8 -1, ptr %54, align 1
  %55 = getelementptr inbounds i8, ptr %.02426, i64 5
  store i8 -1, ptr %55, align 1
  %56 = getelementptr inbounds i8, ptr %.02426, i64 6
  store i8 -1, ptr %56, align 1
  %57 = getelementptr inbounds i8, ptr %.02426, i64 7
  store i8 -1, ptr %57, align 1
  %58 = getelementptr inbounds i8, ptr %.02426, i64 8
  store i8 -1, ptr %58, align 1
  %59 = getelementptr inbounds i8, ptr %.02426, i64 9
  store i8 -1, ptr %59, align 1
  %60 = getelementptr inbounds i8, ptr %.02426, i64 10
  store i8 -1, ptr %60, align 1
  %61 = getelementptr inbounds i8, ptr %.02426, i64 11
  store i8 -1, ptr %61, align 1
  %62 = getelementptr inbounds i8, ptr %.02426, i64 12
  %63 = add nuw nsw i32 %.027, 4
  %exitcond.not.3 = icmp eq i32 %63, 256
  br i1 %exitcond.not.3, label %.split29.us, label %.split, !llvm.loop !43

64:                                               ; preds = %34
  tail call void @__assert_fail(ptr noundef nonnull @.str.4, ptr noundef nonnull @.str.1, i32 noundef 1414, ptr noundef nonnull @__PRETTY_FUNCTION__._ZN24TinyGLInstancingRenderer4initEv) #5
  unreachable

65:                                               ; preds = %34
  %66 = load ptr, ptr @glad_glTexImage2D, align 8, !tbaa !5
  tail call void %66(i32 noundef 3553, i32 noundef 0, i32 noundef 6407, i32 noundef 256, i32 noundef 256, i32 noundef 0, i32 noundef 6407, i32 noundef 5121, ptr noundef nonnull %33)
  %67 = load ptr, ptr @glad_glGenerateMipmap, align 8, !tbaa !5
  tail call void %67(i32 noundef 3553)
  %68 = load ptr, ptr @glad_glGetError, align 8, !tbaa !5
  %69 = tail call i32 %68()
  %70 = icmp eq i32 %69, 0
  br i1 %70, label %72, label %71

71:                                               ; preds = %65
  tail call void @__assert_fail(ptr noundef nonnull @.str.4, ptr noundef nonnull @.str.1, i32 noundef 1420, ptr noundef nonnull @__PRETTY_FUNCTION__._ZN24TinyGLInstancingRenderer4initEv) #5
  unreachable

72:                                               ; preds = %65
  tail call void @_ZdaPv(ptr noundef nonnull %33) #7
  store i8 1, ptr %28, align 1, !tbaa !19
  br label %73

73:                                               ; preds = %72, %27
  %74 = load ptr, ptr @glad_glGetError, align 8, !tbaa !5
  %75 = tail call i32 %74()
  %76 = icmp eq i32 %75, 0
  br i1 %76, label %78, label %77

77:                                               ; preds = %73
  tail call void @__assert_fail(ptr noundef nonnull @.str.4, ptr noundef nonnull @.str.1, i32 noundef 1426, ptr noundef nonnull @__PRETTY_FUNCTION__._ZN24TinyGLInstancingRenderer4initEv) #5
  unreachable

78:                                               ; preds = %73
  %79 = load ptr, ptr @glad_glBindTexture, align 8, !tbaa !5
  %80 = getelementptr inbounds i8, ptr %0, i64 32
  %81 = load ptr, ptr %80, align 8, !tbaa !20
  %82 = getelementptr inbounds i8, ptr %81, i64 500
  %83 = load i32, ptr %82, align 4, !tbaa !21
  tail call void %79(i32 noundef 3553, i32 noundef %83)
  %84 = load ptr, ptr @glad_glGetError, align 8, !tbaa !5
  %85 = tail call i32 %84()
  %86 = icmp eq i32 %85, 0
  br i1 %86, label %94, label %87

87:                                               ; preds = %78
  tail call void @__assert_fail(ptr noundef nonnull @.str.4, ptr noundef nonnull @.str.1, i32 noundef 1429, ptr noundef nonnull @__PRETTY_FUNCTION__._ZN24TinyGLInstancingRenderer4initEv) #5
  unreachable

88:                                               ; preds = %23
  %89 = load ptr, ptr @glad_glDisable, align 8, !tbaa !5
  tail call void %89(i32 noundef 3553)
  %90 = load ptr, ptr @glad_glGetError, align 8, !tbaa !5
  %91 = tail call i32 %90()
  %92 = icmp eq i32 %91, 0
  br i1 %92, label %94, label %93

93:                                               ; preds = %88
  tail call void @__assert_fail(ptr noundef nonnull @.str.4, ptr noundef nonnull @.str.1, i32 noundef 1432, ptr noundef nonnull @__PRETTY_FUNCTION__._ZN24TinyGLInstancingRenderer4initEv) #5
  unreachable

94:                                               ; preds = %88, %78
  %95 = load ptr, ptr @glad_glGetError, align 8, !tbaa !5
  %96 = tail call i32 %95()
  %97 = icmp eq i32 %96, 0
  br i1 %97, label %99, label %98

98:                                               ; preds = %94
  tail call void @__assert_fail(ptr noundef nonnull @.str.4, ptr noundef nonnull @.str.1, i32 noundef 1437, ptr noundef nonnull @__PRETTY_FUNCTION__._ZN24TinyGLInstancingRenderer4initEv) #5
  unreachable

99:                                               ; preds = %94
  ret void
}

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

; Function Attrs: nobuiltin nounwind
declare void @_ZdaPv(ptr noundef) local_unnamed_addr #3

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

attributes #0 = { 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 #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 = { 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 #3 = { 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 #4 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #5 = { noreturn nounwind }
attributes #6 = { builtin allocsize(0) }
attributes #7 = { 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, !15, i64 40}
!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 = !{i8 0, i8 2}
!18 = !{}
!19 = !{!10, !15, i64 41}
!20 = !{!10, !6, i64 32}
!21 = !{!22, !16, i64 500}
!22 = !{!"_ZTS20InternalDataRenderer", !23, i64 0, !28, i64 120, !6, i64 136, !7, i64 144, !7, i64 208, !7, i64 272, !7, i64 336, !7, i64 400, !15, i64 464, !29, i64 468, !29, i64 484, !16, i64 500, !31, i64 504, !6, i64 528, !16, i64 536, !16, i64 540, !35, i64 544, !16, i64 584, !16, i64 588, !30, i64 592, !15, i64 596}
!23 = !{!"_ZTS30GLInstanceRendererInternalData", !24, i64 0, !24, i64 24, !24, i64 48, !24, i64 72, !16, i64 96, !16, i64 100, !16, i64 104, !16, i64 108, !16, i64 112}
!24 = !{!"_ZTSSt6vectorIfSaIfEE", !25, i64 0}
!25 = !{!"_ZTSSt12_Vector_baseIfSaIfEE", !26, i64 0}
!26 = !{!"_ZTSNSt12_Vector_baseIfSaIfEE12_Vector_implE", !27, i64 0}
!27 = !{!"_ZTSNSt12_Vector_baseIfSaIfEE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!28 = !{!"_ZTS10TinyCamera", !6, i64 8}
!29 = !{!"_ZTSN4TINY11TinyVector3IfNS_10FloatUtilsEEE", !30, i64 0, !30, i64 4, !30, i64 8, !16, i64 12}
!30 = !{!"float", !7, i64 0}
!31 = !{!"_ZTSSt6vectorI21InternalTextureHandleSaIS0_EE", !32, i64 0}
!32 = !{!"_ZTSSt12_Vector_baseI21InternalTextureHandleSaIS0_EE", !33, i64 0}
!33 = !{!"_ZTSNSt12_Vector_baseI21InternalTextureHandleSaIS0_EE12_Vector_implE", !34, i64 0}
!34 = !{!"_ZTSNSt12_Vector_baseI21InternalTextureHandleSaIS0_EE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!35 = !{!"_ZTS17TinyResizablePoolI18TinyPoolBodyHandleI30TinyPublicGraphicsInstanceDataEE", !36, i64 8, !16, i64 32, !16, i64 36}
!36 = !{!"_ZTSSt6vectorI18TinyPoolBodyHandleI30TinyPublicGraphicsInstanceDataESaIS2_EE", !37, i64 0}
!37 = !{!"_ZTSSt12_Vector_baseI18TinyPoolBodyHandleI30TinyPublicGraphicsInstanceDataESaIS2_EE", !38, i64 0}
!38 = !{!"_ZTSNSt12_Vector_baseI18TinyPoolBodyHandleI30TinyPublicGraphicsInstanceDataESaIS2_EE12_Vector_implE", !39, i64 0}
!39 = !{!"_ZTSNSt12_Vector_baseI18TinyPoolBodyHandleI30TinyPublicGraphicsInstanceDataESaIS2_EE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!40 = !{!7, !7, i64 0}
!41 = distinct !{!41, !42}
!42 = !{!"llvm.loop.mustprogress"}
!43 = distinct !{!43, !42}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LICMPass,LoopIdiomRecognizePass,LoopInstSimplifyPass,LoopRotatePass,LoopSimplifyCFGPass,LoopSimplifyPass,LoopUnrollPass,MergedLoadStoreMotionPass,PostOrderFunctionAttrsPass,ReassociatePass,SROAPass,SimplifyCFGPass,TailCallElimPass