; LLVM IR from erwincoumans/tiny-differentiable-simulator :: src/visualizer/opengl (tiny_gl_primitive_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.PrimVertex = type { %struct.PrimVec4, %struct.PrimVec4, %struct.PrimVec2 }
%struct.PrimVec4 = type { [4 x float] }
%struct.PrimVec2 = type { [2 x float] }
%class.TinyGLPrimitiveRenderer = type { ptr, i32, i32, ptr, ptr }
%struct.PrimInternalData = type { i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32 }

@.str.2 = external hidden unnamed_addr constant [129 x i8], align 1
@glad_glGenVertexArrays = external global ptr, align 8
@glad_glBindVertexArray = external global ptr, align 8
@glad_glGenBuffers = external global ptr, align 8
@glad_glBindBuffer = external global ptr, align 8
@glad_glBufferData = external global ptr, align 8
@glad_glGetError = external global ptr, align 8
@.str.8 = external hidden unnamed_addr constant [28 x i8], align 1
@__PRETTY_FUNCTION__._ZN23TinyGLPrimitiveRenderer16load_buffer_dataEv = external hidden unnamed_addr constant [49 x i8], align 1
@_ZL11s_indexData = external hidden global [6 x i32], align 16
@glad_glEnableVertexAttribArray = external global ptr, align 8
@glad_glVertexAttribPointer = external global ptr, align 8
@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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN23TinyGLPrimitiveRenderer16load_buffer_dataEv(ptr noundef nonnull align 8 dereferenceable(32) %0) #1 align 2 {
  %2 = alloca ptr, align 8
  %3 = alloca [4 x %struct.PrimVertex], align 16
  %4 = alloca %struct.PrimVec4, align 4
  %5 = alloca %struct.PrimVec4, align 4
  %6 = alloca %struct.PrimVec2, align 4
  %7 = alloca %struct.PrimVec4, align 4
  %8 = alloca %struct.PrimVec4, align 4
  %9 = alloca %struct.PrimVec2, align 4
  %10 = alloca %struct.PrimVec4, align 4
  %11 = alloca %struct.PrimVec4, align 4
  %12 = alloca %struct.PrimVec2, align 4
  %13 = alloca %struct.PrimVec4, align 4
  %14 = alloca %struct.PrimVec4, align 4
  %15 = alloca %struct.PrimVec2, align 4
  %16 = alloca [16384 x i32], align 16
  %17 = alloca i32, align 4
  %18 = alloca i32, align 4
  %19 = alloca ptr, align 8
  %20 = alloca i32, align 4
  %21 = alloca i32, align 4
  %22 = alloca ptr, align 8
  %23 = alloca i32, align 4
  store ptr %0, ptr %2, align 8, !tbaa !5
  %24 = load ptr, ptr %2, align 8
  call void @llvm.lifetime.start.p0(i64 160, ptr %3) #6
  call void @llvm.lifetime.start.p0(i64 16, ptr %4) #6
  call void @_ZN8PrimVec4C2Effff(ptr noundef nonnull align 4 dereferenceable(16) %4, float noundef -1.000000e+00, float noundef -1.000000e+00, float noundef 0.000000e+00, float noundef 1.000000e+00)
  call void @llvm.lifetime.start.p0(i64 16, ptr %5) #6
  call void @_ZN8PrimVec4C2Effff(ptr noundef nonnull align 4 dereferenceable(16) %5, float noundef 1.000000e+00, float noundef 0.000000e+00, float noundef 0.000000e+00, float noundef 1.000000e+00)
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #6
  call void @_ZN8PrimVec2C2Eff(ptr noundef nonnull align 4 dereferenceable(8) %6, float noundef 0.000000e+00, float noundef 0.000000e+00)
  call void @_ZN10PrimVertexC2ERK8PrimVec4S2_RK8PrimVec2(ptr noundef nonnull align 4 dereferenceable(40) %3, ptr noundef nonnull align 4 dereferenceable(16) %4, ptr noundef nonnull align 4 dereferenceable(16) %5, ptr noundef nonnull align 4 dereferenceable(8) %6)
  %25 = getelementptr inbounds %struct.PrimVertex, ptr %3, i64 1
  call void @llvm.lifetime.start.p0(i64 16, ptr %7) #6
  call void @_ZN8PrimVec4C2Effff(ptr noundef nonnull align 4 dereferenceable(16) %7, float noundef -1.000000e+00, float noundef 1.000000e+00, float noundef 0.000000e+00, float noundef 1.000000e+00)
  call void @llvm.lifetime.start.p0(i64 16, ptr %8) #6
  call void @_ZN8PrimVec4C2Effff(ptr noundef nonnull align 4 dereferenceable(16) %8, float noundef 0.000000e+00, float noundef 1.000000e+00, float noundef 0.000000e+00, float noundef 1.000000e+00)
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #6
  call void @_ZN8PrimVec2C2Eff(ptr noundef nonnull align 4 dereferenceable(8) %9, float noundef 0.000000e+00, float noundef 1.000000e+00)
  call void @_ZN10PrimVertexC2ERK8PrimVec4S2_RK8PrimVec2(ptr noundef nonnull align 4 dereferenceable(40) %25, ptr noundef nonnull align 4 dereferenceable(16) %7, ptr noundef nonnull align 4 dereferenceable(16) %8, ptr noundef nonnull align 4 dereferenceable(8) %9)
  %26 = getelementptr inbounds %struct.PrimVertex, ptr %3, i64 2
  call void @llvm.lifetime.start.p0(i64 16, ptr %10) #6
  call void @_ZN8PrimVec4C2Effff(ptr noundef nonnull align 4 dereferenceable(16) %10, float noundef 1.000000e+00, float noundef 1.000000e+00, float noundef 0.000000e+00, float noundef 1.000000e+00)
  call void @llvm.lifetime.start.p0(i64 16, ptr %11) #6
  call void @_ZN8PrimVec4C2Effff(ptr noundef nonnull align 4 dereferenceable(16) %11, float noundef 0.000000e+00, float noundef 0.000000e+00, float noundef 1.000000e+00, float noundef 1.000000e+00)
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #6
  call void @_ZN8PrimVec2C2Eff(ptr noundef nonnull align 4 dereferenceable(8) %12, float noundef 1.000000e+00, float noundef 1.000000e+00)
  call void @_ZN10PrimVertexC2ERK8PrimVec4S2_RK8PrimVec2(ptr noundef nonnull align 4 dereferenceable(40) %26, ptr noundef nonnull align 4 dereferenceable(16) %10, ptr noundef nonnull align 4 dereferenceable(16) %11, ptr noundef nonnull align 4 dereferenceable(8) %12)
  %27 = getelementptr inbounds %struct.PrimVertex, ptr %3, i64 3
  call void @llvm.lifetime.start.p0(i64 16, ptr %13) #6
  call void @_ZN8PrimVec4C2Effff(ptr noundef nonnull align 4 dereferenceable(16) %13, float noundef 1.000000e+00, float noundef -1.000000e+00, float noundef 0.000000e+00, float noundef 1.000000e+00)
  call void @llvm.lifetime.start.p0(i64 16, ptr %14) #6
  call void @_ZN8PrimVec4C2Effff(ptr noundef nonnull align 4 dereferenceable(16) %14, float noundef 1.000000e+00, float noundef 1.000000e+00, float noundef 1.000000e+00, float noundef 1.000000e+00)
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #6
  call void @_ZN8PrimVec2C2Eff(ptr noundef nonnull align 4 dereferenceable(8) %15, float noundef 1.000000e+00, float noundef 0.000000e+00)
  call void @_ZN10PrimVertexC2ERK8PrimVec4S2_RK8PrimVec2(ptr noundef nonnull align 4 dereferenceable(40) %27, ptr noundef nonnull align 4 dereferenceable(16) %13, ptr noundef nonnull align 4 dereferenceable(16) %14, ptr noundef nonnull align 4 dereferenceable(8) %15)
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr %14) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr %13) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr %11) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr %10) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr %8) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr %7) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr %5) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr %4) #6
  %28 = load ptr, ptr @glad_glGenVertexArrays, align 8, !tbaa !5
  %29 = getelementptr inbounds %class.TinyGLPrimitiveRenderer, ptr %24, i32 0, i32 3
  %30 = load ptr, ptr %29, align 8, !tbaa !9
  %31 = getelementptr inbounds %struct.PrimInternalData, ptr %30, i32 0, i32 9
  call void %28(i32 noundef 1, ptr noundef %31)
  %32 = load ptr, ptr @glad_glBindVertexArray, align 8, !tbaa !5
  %33 = getelementptr inbounds %class.TinyGLPrimitiveRenderer, ptr %24, i32 0, i32 3
  %34 = load ptr, ptr %33, align 8, !tbaa !9
  %35 = getelementptr inbounds %struct.PrimInternalData, ptr %34, i32 0, i32 9
  %36 = load i32, ptr %35, align 4, !tbaa !12
  call void %32(i32 noundef %36)
  %37 = load ptr, ptr @glad_glGenBuffers, align 8, !tbaa !5
  %38 = getelementptr inbounds %class.TinyGLPrimitiveRenderer, ptr %24, i32 0, i32 3
  %39 = load ptr, ptr %38, align 8, !tbaa !9
  %40 = getelementptr inbounds %struct.PrimInternalData, ptr %39, i32 0, i32 7
  call void %37(i32 noundef 1, ptr noundef %40)
  %41 = load ptr, ptr @glad_glBindBuffer, align 8, !tbaa !5
  %42 = getelementptr inbounds %class.TinyGLPrimitiveRenderer, ptr %24, i32 0, i32 3
  %43 = load ptr, ptr %42, align 8, !tbaa !9
  %44 = getelementptr inbounds %struct.PrimInternalData, ptr %43, i32 0, i32 7
  %45 = load i32, ptr %44, align 4, !tbaa !14
  call void %41(i32 noundef 34962, i32 noundef %45)
  %46 = load ptr, ptr @glad_glBufferData, align 8, !tbaa !5
  %47 = getelementptr inbounds [4 x %struct.PrimVertex], ptr %3, i64 0, i64 0
  call void %46(i32 noundef 34962, i64 noundef 160, ptr noundef %47, i32 noundef 35048)
  %48 = load ptr, ptr @glad_glGenVertexArrays, align 8, !tbaa !5
  %49 = getelementptr inbounds %class.TinyGLPrimitiveRenderer, ptr %24, i32 0, i32 3
  %50 = load ptr, ptr %49, align 8, !tbaa !9
  %51 = getelementptr inbounds %struct.PrimInternalData, ptr %50, i32 0, i32 10
  call void %48(i32 noundef 1, ptr noundef %51)
  %52 = load ptr, ptr @glad_glBindVertexArray, align 8, !tbaa !5
  %53 = getelementptr inbounds %class.TinyGLPrimitiveRenderer, ptr %24, i32 0, i32 3
  %54 = load ptr, ptr %53, align 8, !tbaa !9
  %55 = getelementptr inbounds %struct.PrimInternalData, ptr %54, i32 0, i32 10
  %56 = load i32, ptr %55, align 4, !tbaa !15
  call void %52(i32 noundef %56)
  %57 = load ptr, ptr @glad_glGenBuffers, align 8, !tbaa !5
  %58 = getelementptr inbounds %class.TinyGLPrimitiveRenderer, ptr %24, i32 0, i32 3
  %59 = load ptr, ptr %58, align 8, !tbaa !9
  %60 = getelementptr inbounds %struct.PrimInternalData, ptr %59, i32 0, i32 8
  call void %57(i32 noundef 1, ptr noundef %60)
  %61 = load ptr, ptr @glad_glBindBuffer, align 8, !tbaa !5
  %62 = getelementptr inbounds %class.TinyGLPrimitiveRenderer, ptr %24, i32 0, i32 3
  %63 = load ptr, ptr %62, align 8, !tbaa !9
  %64 = getelementptr inbounds %struct.PrimInternalData, ptr %63, i32 0, i32 8
  %65 = load i32, ptr %64, align 4, !tbaa !16
  call void %61(i32 noundef 34962, i32 noundef %65)
  %66 = load ptr, ptr @glad_glBufferData, align 8, !tbaa !5
  call void %66(i32 noundef 34962, i64 noundef 327680, ptr noundef null, i32 noundef 35048)
  %67 = load ptr, ptr @glad_glGetError, align 8, !tbaa !5
  %68 = call i32 %67()
  %69 = icmp eq i32 %68, 0
  br i1 %69, label %70, label %71

70:                                               ; preds = %1
  br label %73

71:                                               ; preds = %1
  call void @__assert_fail(ptr noundef @.str.8, ptr noundef @.str.2, i32 noundef 137, ptr noundef @__PRETTY_FUNCTION__._ZN23TinyGLPrimitiveRenderer16load_buffer_dataEv) #7
  unreachable

72:                                               ; No predecessors!
  br label %73

73:                                               ; preds = %72, %70
  %74 = load ptr, ptr @glad_glGenBuffers, align 8, !tbaa !5
  %75 = getelementptr inbounds %class.TinyGLPrimitiveRenderer, ptr %24, i32 0, i32 3
  %76 = load ptr, ptr %75, align 8, !tbaa !9
  %77 = getelementptr inbounds %struct.PrimInternalData, ptr %76, i32 0, i32 11
  call void %74(i32 noundef 1, ptr noundef %77)
  %78 = load ptr, ptr @glad_glBindBuffer, align 8, !tbaa !5
  %79 = getelementptr inbounds %class.TinyGLPrimitiveRenderer, ptr %24, i32 0, i32 3
  %80 = load ptr, ptr %79, align 8, !tbaa !9
  %81 = getelementptr inbounds %struct.PrimInternalData, ptr %80, i32 0, i32 11
  %82 = load i32, ptr %81, align 4, !tbaa !17
  call void %78(i32 noundef 34963, i32 noundef %82)
  %83 = load ptr, ptr @glad_glBufferData, align 8, !tbaa !5
  call void %83(i32 noundef 34963, i64 noundef 24, ptr noundef @_ZL11s_indexData, i32 noundef 35044)
  call void @llvm.lifetime.start.p0(i64 65536, ptr %16) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #6
  store i32 0, ptr %17, align 4, !tbaa !18
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #6
  store i32 0, ptr %18, align 4, !tbaa !18
  br label %84

84:                                               ; preds = %123, %73
  %85 = load i32, ptr %18, align 4, !tbaa !18
  %86 = icmp slt i32 %85, 8192
  br i1 %86, label %88, label %87

87:                                               ; preds = %84
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #6
  br label %126

88:                                               ; preds = %84
  %89 = load i32, ptr %18, align 4, !tbaa !18
  %90 = load i32, ptr %17, align 4, !tbaa !18
  %91 = add nsw i32 %90, 1
  store i32 %91, ptr %17, align 4, !tbaa !18
  %92 = sext i32 %90 to i64
  %93 = getelementptr inbounds [16384 x i32], ptr %16, i64 0, i64 %92
  store i32 %89, ptr %93, align 4, !tbaa !18
  %94 = load i32, ptr %18, align 4, !tbaa !18
  %95 = add nsw i32 %94, 1
  %96 = load i32, ptr %17, align 4, !tbaa !18
  %97 = add nsw i32 %96, 1
  store i32 %97, ptr %17, align 4, !tbaa !18
  %98 = sext i32 %96 to i64
  %99 = getelementptr inbounds [16384 x i32], ptr %16, i64 0, i64 %98
  store i32 %95, ptr %99, align 4, !tbaa !18
  %100 = load i32, ptr %18, align 4, !tbaa !18
  %101 = add nsw i32 %100, 2
  %102 = load i32, ptr %17, align 4, !tbaa !18
  %103 = add nsw i32 %102, 1
  store i32 %103, ptr %17, align 4, !tbaa !18
  %104 = sext i32 %102 to i64
  %105 = getelementptr inbounds [16384 x i32], ptr %16, i64 0, i64 %104
  store i32 %101, ptr %105, align 4, !tbaa !18
  %106 = load i32, ptr %18, align 4, !tbaa !18
  %107 = load i32, ptr %17, align 4, !tbaa !18
  %108 = add nsw i32 %107, 1
  store i32 %108, ptr %17, align 4, !tbaa !18
  %109 = sext i32 %107 to i64
  %110 = getelementptr inbounds [16384 x i32], ptr %16, i64 0, i64 %109
  store i32 %106, ptr %110, align 4, !tbaa !18
  %111 = load i32, ptr %18, align 4, !tbaa !18
  %112 = add nsw i32 %111, 2
  %113 = load i32, ptr %17, align 4, !tbaa !18
  %114 = add nsw i32 %113, 1
  store i32 %114, ptr %17, align 4, !tbaa !18
  %115 = sext i32 %113 to i64
  %116 = getelementptr inbounds [16384 x i32], ptr %16, i64 0, i64 %115
  store i32 %112, ptr %116, align 4, !tbaa !18
  %117 = load i32, ptr %18, align 4, !tbaa !18
  %118 = add nsw i32 %117, 3
  %119 = load i32, ptr %17, align 4, !tbaa !18
  %120 = add nsw i32 %119, 1
  store i32 %120, ptr %17, align 4, !tbaa !18
  %121 = sext i32 %119 to i64
  %122 = getelementptr inbounds [16384 x i32], ptr %16, i64 0, i64 %121
  store i32 %118, ptr %122, align 4, !tbaa !18
  br label %123

123:                                              ; preds = %88
  %124 = load i32, ptr %18, align 4, !tbaa !18
  %125 = add nsw i32 %124, 4
  store i32 %125, ptr %18, align 4, !tbaa !18
  br label %84, !llvm.loop !19

126:                                              ; preds = %87
  %127 = load ptr, ptr @glad_glGenBuffers, align 8, !tbaa !5
  %128 = getelementptr inbounds %class.TinyGLPrimitiveRenderer, ptr %24, i32 0, i32 3
  %129 = load ptr, ptr %128, align 8, !tbaa !9
  %130 = getelementptr inbounds %struct.PrimInternalData, ptr %129, i32 0, i32 12
  call void %127(i32 noundef 1, ptr noundef %130)
  %131 = load ptr, ptr @glad_glBindBuffer, align 8, !tbaa !5
  %132 = getelementptr inbounds %class.TinyGLPrimitiveRenderer, ptr %24, i32 0, i32 3
  %133 = load ptr, ptr %132, align 8, !tbaa !9
  %134 = getelementptr inbounds %struct.PrimInternalData, ptr %133, i32 0, i32 12
  %135 = load i32, ptr %134, align 4, !tbaa !21
  call void %131(i32 noundef 34963, i32 noundef %135)
  %136 = load ptr, ptr @glad_glBufferData, align 8, !tbaa !5
  %137 = load i32, ptr %17, align 4, !tbaa !18
  %138 = sext i32 %137 to i64
  %139 = mul i64 %138, 4
  %140 = getelementptr inbounds [16384 x i32], ptr %16, i64 0, i64 0
  call void %136(i32 noundef 34963, i64 noundef %139, ptr noundef %140, i32 noundef 35044)
  %141 = load ptr, ptr @glad_glEnableVertexAttribArray, align 8, !tbaa !5
  %142 = getelementptr inbounds %class.TinyGLPrimitiveRenderer, ptr %24, i32 0, i32 3
  %143 = load ptr, ptr %142, align 8, !tbaa !9
  %144 = getelementptr inbounds %struct.PrimInternalData, ptr %143, i32 0, i32 5
  %145 = load i32, ptr %144, align 4, !tbaa !22
  call void %141(i32 noundef %145)
  %146 = load ptr, ptr @glad_glEnableVertexAttribArray, align 8, !tbaa !5
  %147 = getelementptr inbounds %class.TinyGLPrimitiveRenderer, ptr %24, i32 0, i32 3
  %148 = load ptr, ptr %147, align 8, !tbaa !9
  %149 = getelementptr inbounds %struct.PrimInternalData, ptr %148, i32 0, i32 4
  %150 = load i32, ptr %149, align 4, !tbaa !23
  call void %146(i32 noundef %150)
  %151 = load ptr, ptr @glad_glGetError, align 8, !tbaa !5
  %152 = call i32 %151()
  %153 = icmp eq i32 %152, 0
  br i1 %153, label %154, label %155

154:                                              ; preds = %126
  br label %157

155:                                              ; preds = %126
  call void @__assert_fail(ptr noundef @.str.8, ptr noundef @.str.2, i32 noundef 162, ptr noundef @__PRETTY_FUNCTION__._ZN23TinyGLPrimitiveRenderer16load_buffer_dataEv) #7
  unreachable

156:                                              ; No predecessors!
  br label %157

157:                                              ; preds = %156, %154
  %158 = load ptr, ptr @glad_glEnableVertexAttribArray, align 8, !tbaa !5
  %159 = getelementptr inbounds %class.TinyGLPrimitiveRenderer, ptr %24, i32 0, i32 3
  %160 = load ptr, ptr %159, align 8, !tbaa !9
  %161 = getelementptr inbounds %struct.PrimInternalData, ptr %160, i32 0, i32 6
  %162 = load i32, ptr %161, align 4, !tbaa !24
  call void %158(i32 noundef %162)
  %163 = load ptr, ptr @glad_glVertexAttribPointer, align 8, !tbaa !5
  %164 = getelementptr inbounds %class.TinyGLPrimitiveRenderer, ptr %24, i32 0, i32 3
  %165 = load ptr, ptr %164, align 8, !tbaa !9
  %166 = getelementptr inbounds %struct.PrimInternalData, ptr %165, i32 0, i32 5
  %167 = load i32, ptr %166, align 4, !tbaa !22
  call void %163(i32 noundef %167, i32 noundef 4, i32 noundef 5126, i8 noundef zeroext 0, i32 noundef 40, ptr noundef null)
  %168 = load ptr, ptr @glad_glVertexAttribPointer, align 8, !tbaa !5
  %169 = getelementptr inbounds %class.TinyGLPrimitiveRenderer, ptr %24, i32 0, i32 3
  %170 = load ptr, ptr %169, align 8, !tbaa !9
  %171 = getelementptr inbounds %struct.PrimInternalData, ptr %170, i32 0, i32 4
  %172 = load i32, ptr %171, align 4, !tbaa !23
  call void %168(i32 noundef %172, i32 noundef 4, i32 noundef 5126, i8 noundef zeroext 0, i32 noundef 40, ptr noundef inttoptr (i64 16 to ptr))
  %173 = load ptr, ptr @glad_glVertexAttribPointer, align 8, !tbaa !5
  %174 = getelementptr inbounds %class.TinyGLPrimitiveRenderer, ptr %24, i32 0, i32 3
  %175 = load ptr, ptr %174, align 8, !tbaa !9
  %176 = getelementptr inbounds %struct.PrimInternalData, ptr %175, i32 0, i32 6
  %177 = load i32, ptr %176, align 4, !tbaa !24
  call void %173(i32 noundef %177, i32 noundef 2, i32 noundef 5126, i8 noundef zeroext 0, i32 noundef 40, ptr noundef inttoptr (i64 32 to ptr))
  %178 = load ptr, ptr @glad_glGetError, align 8, !tbaa !5
  %179 = call i32 %178()
  %180 = icmp eq i32 %179, 0
  br i1 %180, label %181, label %182

181:                                              ; preds = %157
  br label %184

182:                                              ; preds = %157
  call void @__assert_fail(ptr noundef @.str.8, ptr noundef @.str.2, i32 noundef 173, ptr noundef @__PRETTY_FUNCTION__._ZN23TinyGLPrimitiveRenderer16load_buffer_dataEv) #7
  unreachable

183:                                              ; No predecessors!
  br label %184

184:                                              ; preds = %183, %181
  %185 = load ptr, ptr @glad_glActiveTexture, align 8, !tbaa !5
  call void %185(i32 noundef 33984)
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #6
  %186 = call noalias noundef nonnull ptr @_Znam(i64 noundef 196608) #8
  store ptr %186, ptr %19, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %20) #6
  store i32 0, ptr %20, align 4, !tbaa !18
  br label %187

187:                                              ; preds = %227, %184
  %188 = load i32, ptr %20, align 4, !tbaa !18
  %189 = icmp slt i32 %188, 256
  br i1 %189, label %191, label %190

190:                                              ; preds = %187
  store i32 5, ptr %21, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #6
  br label %230

191:                                              ; preds = %187
  call void @llvm.lifetime.start.p0(i64 8, ptr %22) #6
  %192 = load ptr, ptr %19, align 8, !tbaa !5
  %193 = load i32, ptr %20, align 4, !tbaa !18
  %194 = mul nsw i32 %193, 256
  %195 = mul nsw i32 %194, 3
  %196 = sext i32 %195 to i64
  %197 = getelementptr inbounds i8, ptr %192, i64 %196
  store ptr %197, ptr %22, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %23) #6
  store i32 0, ptr %23, align 4, !tbaa !18
  br label %198

198:                                              ; preds = %223, %191
  %199 = load i32, ptr %23, align 4, !tbaa !18
  %200 = icmp slt i32 %199, 256
  br i1 %200, label %202, label %201

201:                                              ; preds = %198
  store i32 8, ptr %21, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %23) #6
  br label %226

202:                                              ; preds = %198
  %203 = load i32, ptr %23, align 4, !tbaa !18
  %204 = load i32, ptr %20, align 4, !tbaa !18
  %205 = icmp slt i32 %203, %204
  br i1 %205, label %206, label %213

206:                                              ; preds = %202
  %207 = load ptr, ptr %22, align 8, !tbaa !5
  %208 = getelementptr inbounds i8, ptr %207, i64 0
  store i8 -1, ptr %208, align 1, !tbaa !25
  %209 = load ptr, ptr %22, align 8, !tbaa !5
  %210 = getelementptr inbounds i8, ptr %209, i64 1
  store i8 0, ptr %210, align 1, !tbaa !25
  %211 = load ptr, ptr %22, align 8, !tbaa !5
  %212 = getelementptr inbounds i8, ptr %211, i64 2
  store i8 0, ptr %212, align 1, !tbaa !25
  br label %220

213:                                              ; preds = %202
  %214 = load ptr, ptr %22, align 8, !tbaa !5
  %215 = getelementptr inbounds i8, ptr %214, i64 0
  store i8 -1, ptr %215, align 1, !tbaa !25
  %216 = load ptr, ptr %22, align 8, !tbaa !5
  %217 = getelementptr inbounds i8, ptr %216, i64 1
  store i8 -1, ptr %217, align 1, !tbaa !25
  %218 = load ptr, ptr %22, align 8, !tbaa !5
  %219 = getelementptr inbounds i8, ptr %218, i64 2
  store i8 -1, ptr %219, align 1, !tbaa !25
  br label %220

220:                                              ; preds = %213, %206
  %221 = load ptr, ptr %22, align 8, !tbaa !5
  %222 = getelementptr inbounds i8, ptr %221, i64 3
  store ptr %222, ptr %22, align 8, !tbaa !5
  br label %223

223:                                              ; preds = %220
  %224 = load i32, ptr %23, align 4, !tbaa !18
  %225 = add nsw i32 %224, 1
  store i32 %225, ptr %23, align 4, !tbaa !18
  br label %198, !llvm.loop !26

226:                                              ; preds = %201
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #6
  br label %227

227:                                              ; preds = %226
  %228 = load i32, ptr %20, align 4, !tbaa !18
  %229 = add nsw i32 %228, 1
  store i32 %229, ptr %20, align 4, !tbaa !18
  br label %187, !llvm.loop !27

230:                                              ; preds = %190
  %231 = load ptr, ptr @glad_glGenTextures, align 8, !tbaa !5
  %232 = getelementptr inbounds %class.TinyGLPrimitiveRenderer, ptr %24, i32 0, i32 3
  %233 = load ptr, ptr %232, align 8, !tbaa !9
  %234 = getelementptr inbounds %struct.PrimInternalData, ptr %233, i32 0, i32 13
  call void %231(i32 noundef 1, ptr noundef %234)
  %235 = load ptr, ptr @glad_glBindTexture, align 8, !tbaa !5
  %236 = getelementptr inbounds %class.TinyGLPrimitiveRenderer, ptr %24, i32 0, i32 3
  %237 = load ptr, ptr %236, align 8, !tbaa !9
  %238 = getelementptr inbounds %struct.PrimInternalData, ptr %237, i32 0, i32 13
  %239 = load i32, ptr %238, align 4, !tbaa !28
  call void %235(i32 noundef 3553, i32 noundef %239)
  %240 = load ptr, ptr @glad_glTexImage2D, align 8, !tbaa !5
  %241 = load ptr, ptr %19, align 8, !tbaa !5
  call void %240(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 %241)
  %242 = load ptr, ptr @glad_glGenerateMipmap, align 8, !tbaa !5
  call void %242(i32 noundef 3553)
  %243 = load ptr, ptr @glad_glGetError, align 8, !tbaa !5
  %244 = call i32 %243()
  %245 = icmp eq i32 %244, 0
  br i1 %245, label %246, label %247

246:                                              ; preds = %230
  br label %249

247:                                              ; preds = %230
  call void @__assert_fail(ptr noundef @.str.8, ptr noundef @.str.2, i32 noundef 206, ptr noundef @__PRETTY_FUNCTION__._ZN23TinyGLPrimitiveRenderer16load_buffer_dataEv) #7
  unreachable

248:                                              ; No predecessors!
  br label %249

249:                                              ; preds = %248, %246
  %250 = load ptr, ptr %19, align 8, !tbaa !5
  %251 = icmp eq ptr %250, null
  br i1 %251, label %253, label %252

252:                                              ; preds = %249
  call void @_ZdaPv(ptr noundef %250) #9
  br label %253

253:                                              ; preds = %252, %249
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #6
  call void @llvm.lifetime.end.p0(i64 65536, ptr %16) #6
  call void @llvm.lifetime.end.p0(i64 160, ptr %3) #6
  ret void
}

; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN8PrimVec4C2Effff(ptr noundef nonnull align 4 dereferenceable(16), float noundef, float noundef, float noundef, float noundef) unnamed_addr #3 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN8PrimVec2C2Eff(ptr noundef nonnull align 4 dereferenceable(8), float noundef, float noundef) unnamed_addr #3 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN10PrimVertexC2ERK8PrimVec4S2_RK8PrimVec2(ptr noundef nonnull align 4 dereferenceable(40), ptr noundef nonnull align 4 dereferenceable(16), ptr noundef nonnull align 4 dereferenceable(16), ptr noundef nonnull align 4 dereferenceable(8)) unnamed_addr #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: nobuiltin allocsize(0)
declare noundef nonnull ptr @_Znam(i64 noundef) #4

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

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 = { 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 = { 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 #5 = { 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 #6 = { nounwind }
attributes #7 = { noreturn nounwind }
attributes #8 = { builtin allocsize(0) }
attributes #9 = { builtin nounwind }

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !6, i64 16}
!10 = !{!"_ZTS23TinyGLPrimitiveRenderer", !11, i64 8, !11, i64 12, !6, i64 16, !6, i64 24}
!11 = !{!"int", !7, i64 0}
!12 = !{!13, !11, i64 36}
!13 = !{!"_ZTS16PrimInternalData", !11, i64 0, !11, i64 4, !11, i64 8, !11, i64 12, !11, i64 16, !11, i64 20, !11, i64 24, !11, i64 28, !11, i64 32, !11, i64 36, !11, i64 40, !11, i64 44, !11, i64 48, !11, i64 52}
!14 = !{!13, !11, i64 28}
!15 = !{!13, !11, i64 40}
!16 = !{!13, !11, i64 32}
!17 = !{!13, !11, i64 44}
!18 = !{!11, !11, i64 0}
!19 = distinct !{!19, !20}
!20 = !{!"llvm.loop.mustprogress"}
!21 = !{!13, !11, i64 48}
!22 = !{!13, !11, i64 20}
!23 = !{!13, !11, i64 16}
!24 = !{!13, !11, i64 24}
!25 = !{!7, !7, i64 0}
!26 = distinct !{!26, !20}
!27 = distinct !{!27, !20}
!28 = !{!13, !11, i64 52}


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

%struct.PrimVertex = type { %struct.PrimVec4, %struct.PrimVec4, %struct.PrimVec2 }
%struct.PrimVec4 = type { [4 x float] }
%struct.PrimVec2 = type { [2 x float] }

@.str.2 = external hidden unnamed_addr constant [129 x i8], align 1
@glad_glGenVertexArrays = external local_unnamed_addr global ptr, align 8
@glad_glBindVertexArray = external local_unnamed_addr global ptr, align 8
@glad_glGenBuffers = external local_unnamed_addr global ptr, align 8
@glad_glBindBuffer = external local_unnamed_addr global ptr, align 8
@glad_glBufferData = external local_unnamed_addr global ptr, align 8
@glad_glGetError = external local_unnamed_addr global ptr, align 8
@.str.8 = external hidden unnamed_addr constant [28 x i8], align 1
@__PRETTY_FUNCTION__._ZN23TinyGLPrimitiveRenderer16load_buffer_dataEv = external hidden unnamed_addr constant [49 x i8], align 1
@_ZL11s_indexData = external hidden global [6 x i32], align 16
@glad_glEnableVertexAttribArray = external local_unnamed_addr global ptr, align 8
@glad_glVertexAttribPointer = external local_unnamed_addr global ptr, align 8
@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

; 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 @_ZN23TinyGLPrimitiveRenderer16load_buffer_dataEv(ptr nocapture noundef nonnull readonly align 8 dereferenceable(32) %0) local_unnamed_addr #1 align 2 {
  %2 = alloca [4 x %struct.PrimVertex], align 16
  %3 = alloca %struct.PrimVec4, align 4
  %4 = alloca %struct.PrimVec4, align 4
  %5 = alloca %struct.PrimVec2, align 4
  %6 = alloca %struct.PrimVec4, align 4
  %7 = alloca %struct.PrimVec4, align 4
  %8 = alloca %struct.PrimVec2, align 4
  %9 = alloca %struct.PrimVec4, align 4
  %10 = alloca %struct.PrimVec4, align 4
  %11 = alloca %struct.PrimVec2, align 4
  %12 = alloca %struct.PrimVec4, align 4
  %13 = alloca %struct.PrimVec4, align 4
  %14 = alloca %struct.PrimVec2, align 4
  %15 = alloca [16384 x i32], align 16
  call void @llvm.lifetime.start.p0(i64 160, ptr nonnull %2) #6
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %3) #6
  call void @_ZN8PrimVec4C2Effff(ptr noundef nonnull align 4 dereferenceable(16) %3, float noundef -1.000000e+00, float noundef -1.000000e+00, float noundef 0.000000e+00, float noundef 1.000000e+00)
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %4) #6
  call void @_ZN8PrimVec4C2Effff(ptr noundef nonnull align 4 dereferenceable(16) %4, float noundef 1.000000e+00, float noundef 0.000000e+00, float noundef 0.000000e+00, float noundef 1.000000e+00)
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #6
  call void @_ZN8PrimVec2C2Eff(ptr noundef nonnull align 4 dereferenceable(8) %5, float noundef 0.000000e+00, float noundef 0.000000e+00)
  call void @_ZN10PrimVertexC2ERK8PrimVec4S2_RK8PrimVec2(ptr noundef nonnull align 4 dereferenceable(40) %2, ptr noundef nonnull align 4 dereferenceable(16) %3, ptr noundef nonnull align 4 dereferenceable(16) %4, ptr noundef nonnull align 4 dereferenceable(8) %5)
  %16 = getelementptr inbounds i8, ptr %2, i64 40
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %6) #6
  call void @_ZN8PrimVec4C2Effff(ptr noundef nonnull align 4 dereferenceable(16) %6, float noundef -1.000000e+00, float noundef 1.000000e+00, float noundef 0.000000e+00, float noundef 1.000000e+00)
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %7) #6
  call void @_ZN8PrimVec4C2Effff(ptr noundef nonnull align 4 dereferenceable(16) %7, float noundef 0.000000e+00, float noundef 1.000000e+00, float noundef 0.000000e+00, float noundef 1.000000e+00)
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %8) #6
  call void @_ZN8PrimVec2C2Eff(ptr noundef nonnull align 4 dereferenceable(8) %8, float noundef 0.000000e+00, float noundef 1.000000e+00)
  call void @_ZN10PrimVertexC2ERK8PrimVec4S2_RK8PrimVec2(ptr noundef nonnull align 4 dereferenceable(40) %16, ptr noundef nonnull align 4 dereferenceable(16) %6, ptr noundef nonnull align 4 dereferenceable(16) %7, ptr noundef nonnull align 4 dereferenceable(8) %8)
  %17 = getelementptr inbounds i8, ptr %2, i64 80
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %9) #6
  call void @_ZN8PrimVec4C2Effff(ptr noundef nonnull align 4 dereferenceable(16) %9, float noundef 1.000000e+00, float noundef 1.000000e+00, float noundef 0.000000e+00, float noundef 1.000000e+00)
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %10) #6
  call void @_ZN8PrimVec4C2Effff(ptr noundef nonnull align 4 dereferenceable(16) %10, float noundef 0.000000e+00, float noundef 0.000000e+00, float noundef 1.000000e+00, float noundef 1.000000e+00)
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %11) #6
  call void @_ZN8PrimVec2C2Eff(ptr noundef nonnull align 4 dereferenceable(8) %11, float noundef 1.000000e+00, float noundef 1.000000e+00)
  call void @_ZN10PrimVertexC2ERK8PrimVec4S2_RK8PrimVec2(ptr noundef nonnull align 4 dereferenceable(40) %17, ptr noundef nonnull align 4 dereferenceable(16) %9, ptr noundef nonnull align 4 dereferenceable(16) %10, ptr noundef nonnull align 4 dereferenceable(8) %11)
  %18 = getelementptr inbounds i8, ptr %2, i64 120
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %12) #6
  call void @_ZN8PrimVec4C2Effff(ptr noundef nonnull align 4 dereferenceable(16) %12, float noundef 1.000000e+00, float noundef -1.000000e+00, float noundef 0.000000e+00, float noundef 1.000000e+00)
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %13) #6
  call void @_ZN8PrimVec4C2Effff(ptr noundef nonnull align 4 dereferenceable(16) %13, float noundef 1.000000e+00, float noundef 1.000000e+00, float noundef 1.000000e+00, float noundef 1.000000e+00)
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %14) #6
  call void @_ZN8PrimVec2C2Eff(ptr noundef nonnull align 4 dereferenceable(8) %14, float noundef 1.000000e+00, float noundef 0.000000e+00)
  call void @_ZN10PrimVertexC2ERK8PrimVec4S2_RK8PrimVec2(ptr noundef nonnull align 4 dereferenceable(40) %18, ptr noundef nonnull align 4 dereferenceable(16) %12, ptr noundef nonnull align 4 dereferenceable(16) %13, ptr noundef nonnull align 4 dereferenceable(8) %14)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %14) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %13) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %12) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %11) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %10) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %9) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %7) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %6) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %4) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %3) #6
  %19 = load ptr, ptr @glad_glGenVertexArrays, align 8, !tbaa !5
  %20 = getelementptr inbounds i8, ptr %0, i64 16
  %21 = load ptr, ptr %20, align 8, !tbaa !9
  %22 = getelementptr inbounds i8, ptr %21, i64 36
  call void %19(i32 noundef 1, ptr noundef nonnull %22)
  %23 = load ptr, ptr @glad_glBindVertexArray, align 8, !tbaa !5
  %24 = load ptr, ptr %20, align 8, !tbaa !9
  %25 = getelementptr inbounds i8, ptr %24, i64 36
  %26 = load i32, ptr %25, align 4, !tbaa !12
  call void %23(i32 noundef %26)
  %27 = load ptr, ptr @glad_glGenBuffers, align 8, !tbaa !5
  %28 = load ptr, ptr %20, align 8, !tbaa !9
  %29 = getelementptr inbounds i8, ptr %28, i64 28
  call void %27(i32 noundef 1, ptr noundef nonnull %29)
  %30 = load ptr, ptr @glad_glBindBuffer, align 8, !tbaa !5
  %31 = load ptr, ptr %20, align 8, !tbaa !9
  %32 = getelementptr inbounds i8, ptr %31, i64 28
  %33 = load i32, ptr %32, align 4, !tbaa !14
  call void %30(i32 noundef 34962, i32 noundef %33)
  %34 = load ptr, ptr @glad_glBufferData, align 8, !tbaa !5
  call void %34(i32 noundef 34962, i64 noundef 160, ptr noundef nonnull %2, i32 noundef 35048)
  %35 = load ptr, ptr @glad_glGenVertexArrays, align 8, !tbaa !5
  %36 = load ptr, ptr %20, align 8, !tbaa !9
  %37 = getelementptr inbounds i8, ptr %36, i64 40
  call void %35(i32 noundef 1, ptr noundef nonnull %37)
  %38 = load ptr, ptr @glad_glBindVertexArray, align 8, !tbaa !5
  %39 = load ptr, ptr %20, align 8, !tbaa !9
  %40 = getelementptr inbounds i8, ptr %39, i64 40
  %41 = load i32, ptr %40, align 4, !tbaa !15
  call void %38(i32 noundef %41)
  %42 = load ptr, ptr @glad_glGenBuffers, align 8, !tbaa !5
  %43 = load ptr, ptr %20, align 8, !tbaa !9
  %44 = getelementptr inbounds i8, ptr %43, i64 32
  call void %42(i32 noundef 1, ptr noundef nonnull %44)
  %45 = load ptr, ptr @glad_glBindBuffer, align 8, !tbaa !5
  %46 = load ptr, ptr %20, align 8, !tbaa !9
  %47 = getelementptr inbounds i8, ptr %46, i64 32
  %48 = load i32, ptr %47, align 4, !tbaa !16
  call void %45(i32 noundef 34962, i32 noundef %48)
  %49 = load ptr, ptr @glad_glBufferData, align 8, !tbaa !5
  call void %49(i32 noundef 34962, i64 noundef 327680, ptr noundef null, i32 noundef 35048)
  %50 = load ptr, ptr @glad_glGetError, align 8, !tbaa !5
  %51 = call i32 %50()
  %52 = icmp eq i32 %51, 0
  br i1 %52, label %54, label %53

53:                                               ; preds = %1
  call void @__assert_fail(ptr noundef nonnull @.str.8, ptr noundef nonnull @.str.2, i32 noundef 137, ptr noundef nonnull @__PRETTY_FUNCTION__._ZN23TinyGLPrimitiveRenderer16load_buffer_dataEv) #7
  unreachable

54:                                               ; preds = %1
  %55 = load ptr, ptr @glad_glGenBuffers, align 8, !tbaa !5
  %56 = load ptr, ptr %20, align 8, !tbaa !9
  %57 = getelementptr inbounds i8, ptr %56, i64 44
  call void %55(i32 noundef 1, ptr noundef nonnull %57)
  %58 = load ptr, ptr @glad_glBindBuffer, align 8, !tbaa !5
  %59 = load ptr, ptr %20, align 8, !tbaa !9
  %60 = getelementptr inbounds i8, ptr %59, i64 44
  %61 = load i32, ptr %60, align 4, !tbaa !17
  call void %58(i32 noundef 34963, i32 noundef %61)
  %62 = load ptr, ptr @glad_glBufferData, align 8, !tbaa !5
  call void %62(i32 noundef 34963, i64 noundef 24, ptr noundef nonnull @_ZL11s_indexData, i32 noundef 35044)
  call void @llvm.lifetime.start.p0(i64 65536, ptr nonnull %15) #6
  br label %83

63:                                               ; preds = %83
  %64 = load ptr, ptr @glad_glGenBuffers, align 8, !tbaa !5
  %65 = load ptr, ptr %20, align 8, !tbaa !9
  %66 = getelementptr inbounds i8, ptr %65, i64 48
  call void %64(i32 noundef 1, ptr noundef nonnull %66)
  %67 = load ptr, ptr @glad_glBindBuffer, align 8, !tbaa !5
  %68 = load ptr, ptr %20, align 8, !tbaa !9
  %69 = getelementptr inbounds i8, ptr %68, i64 48
  %70 = load i32, ptr %69, align 4, !tbaa !18
  call void %67(i32 noundef 34963, i32 noundef %70)
  %71 = load ptr, ptr @glad_glBufferData, align 8, !tbaa !5
  call void %71(i32 noundef 34963, i64 noundef 49152, ptr noundef nonnull %15, i32 noundef 35044)
  %72 = load ptr, ptr @glad_glEnableVertexAttribArray, align 8, !tbaa !5
  %73 = load ptr, ptr %20, align 8, !tbaa !9
  %74 = getelementptr inbounds i8, ptr %73, i64 20
  %75 = load i32, ptr %74, align 4, !tbaa !19
  call void %72(i32 noundef %75)
  %76 = load ptr, ptr @glad_glEnableVertexAttribArray, align 8, !tbaa !5
  %77 = load ptr, ptr %20, align 8, !tbaa !9
  %78 = getelementptr inbounds i8, ptr %77, i64 16
  %79 = load i32, ptr %78, align 4, !tbaa !20
  call void %76(i32 noundef %79)
  %80 = load ptr, ptr @glad_glGetError, align 8, !tbaa !5
  %81 = call i32 %80()
  %82 = icmp eq i32 %81, 0
  br i1 %82, label %101, label %100

83:                                               ; preds = %54, %83
  %indvars.iv = phi i64 [ 0, %54 ], [ %indvars.iv.next, %83 ]
  %.03536 = phi i32 [ 0, %54 ], [ %98, %83 ]
  %84 = or disjoint i64 %indvars.iv, 1
  %85 = getelementptr inbounds [16384 x i32], ptr %15, i64 0, i64 %indvars.iv
  store i32 %.03536, ptr %85, align 8, !tbaa !21
  %86 = or disjoint i32 %.03536, 1
  %87 = add nuw nsw i64 %indvars.iv, 2
  %88 = getelementptr inbounds [16384 x i32], ptr %15, i64 0, i64 %84
  store i32 %86, ptr %88, align 4, !tbaa !21
  %89 = or disjoint i32 %.03536, 2
  %90 = add nuw nsw i64 %indvars.iv, 3
  %91 = getelementptr inbounds [16384 x i32], ptr %15, i64 0, i64 %87
  store i32 %89, ptr %91, align 8, !tbaa !21
  %92 = add nuw nsw i64 %indvars.iv, 4
  %93 = getelementptr inbounds [16384 x i32], ptr %15, i64 0, i64 %90
  store i32 %.03536, ptr %93, align 4, !tbaa !21
  %94 = add nuw nsw i64 %indvars.iv, 5
  %95 = getelementptr inbounds [16384 x i32], ptr %15, i64 0, i64 %92
  store i32 %89, ptr %95, align 8, !tbaa !21
  %96 = or disjoint i32 %.03536, 3
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 6
  %97 = getelementptr inbounds [16384 x i32], ptr %15, i64 0, i64 %94
  store i32 %96, ptr %97, align 4, !tbaa !21
  %98 = add nuw nsw i32 %.03536, 4
  %99 = icmp ult i32 %.03536, 8188
  br i1 %99, label %83, label %63, !llvm.loop !22

100:                                              ; preds = %63
  call void @__assert_fail(ptr noundef nonnull @.str.8, ptr noundef nonnull @.str.2, i32 noundef 162, ptr noundef nonnull @__PRETTY_FUNCTION__._ZN23TinyGLPrimitiveRenderer16load_buffer_dataEv) #7
  unreachable

101:                                              ; preds = %63
  %102 = load ptr, ptr @glad_glEnableVertexAttribArray, align 8, !tbaa !5
  %103 = load ptr, ptr %20, align 8, !tbaa !9
  %104 = getelementptr inbounds i8, ptr %103, i64 24
  %105 = load i32, ptr %104, align 4, !tbaa !24
  call void %102(i32 noundef %105)
  %106 = load ptr, ptr @glad_glVertexAttribPointer, align 8, !tbaa !5
  %107 = load ptr, ptr %20, align 8, !tbaa !9
  %108 = getelementptr inbounds i8, ptr %107, i64 20
  %109 = load i32, ptr %108, align 4, !tbaa !19
  call void %106(i32 noundef %109, i32 noundef 4, i32 noundef 5126, i8 noundef zeroext 0, i32 noundef 40, ptr noundef null)
  %110 = load ptr, ptr @glad_glVertexAttribPointer, align 8, !tbaa !5
  %111 = load ptr, ptr %20, align 8, !tbaa !9
  %112 = getelementptr inbounds i8, ptr %111, i64 16
  %113 = load i32, ptr %112, align 4, !tbaa !20
  call void %110(i32 noundef %113, i32 noundef 4, i32 noundef 5126, i8 noundef zeroext 0, i32 noundef 40, ptr noundef nonnull inttoptr (i64 16 to ptr))
  %114 = load ptr, ptr @glad_glVertexAttribPointer, align 8, !tbaa !5
  %115 = load ptr, ptr %20, align 8, !tbaa !9
  %116 = getelementptr inbounds i8, ptr %115, i64 24
  %117 = load i32, ptr %116, align 4, !tbaa !24
  call void %114(i32 noundef %117, i32 noundef 2, i32 noundef 5126, i8 noundef zeroext 0, i32 noundef 40, ptr noundef nonnull inttoptr (i64 32 to ptr))
  %118 = load ptr, ptr @glad_glGetError, align 8, !tbaa !5
  %119 = call i32 %118()
  %120 = icmp eq i32 %119, 0
  br i1 %120, label %122, label %121

121:                                              ; preds = %101
  call void @__assert_fail(ptr noundef nonnull @.str.8, ptr noundef nonnull @.str.2, i32 noundef 173, ptr noundef nonnull @__PRETTY_FUNCTION__._ZN23TinyGLPrimitiveRenderer16load_buffer_dataEv) #7
  unreachable

122:                                              ; preds = %101
  %123 = load ptr, ptr @glad_glActiveTexture, align 8, !tbaa !5
  call void %123(i32 noundef 33984)
  %124 = call noalias noundef nonnull dereferenceable(196608) ptr @_Znam(i64 noundef 196608) #8
  br label %138

125:                                              ; preds = %141
  %126 = load ptr, ptr @glad_glGenTextures, align 8, !tbaa !5
  %127 = load ptr, ptr %20, align 8, !tbaa !9
  %128 = getelementptr inbounds i8, ptr %127, i64 52
  call void %126(i32 noundef 1, ptr noundef nonnull %128)
  %129 = load ptr, ptr @glad_glBindTexture, align 8, !tbaa !5
  %130 = load ptr, ptr %20, align 8, !tbaa !9
  %131 = getelementptr inbounds i8, ptr %130, i64 52
  %132 = load i32, ptr %131, align 4, !tbaa !25
  call void %129(i32 noundef 3553, i32 noundef %132)
  %133 = load ptr, ptr @glad_glTexImage2D, align 8, !tbaa !5
  call void %133(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 %124)
  %134 = load ptr, ptr @glad_glGenerateMipmap, align 8, !tbaa !5
  call void %134(i32 noundef 3553)
  %135 = load ptr, ptr @glad_glGetError, align 8, !tbaa !5
  %136 = call i32 %135()
  %137 = icmp eq i32 %136, 0
  br i1 %137, label %168, label %167

138:                                              ; preds = %122, %141
  %indvars.iv42 = phi i64 [ 0, %122 ], [ %indvars.iv.next43, %141 ]
  %139 = mul nuw nsw i64 %indvars.iv42, 768
  %140 = getelementptr inbounds i8, ptr %124, i64 %139
  br label %142

141:                                              ; preds = %142
  %indvars.iv.next43 = add nuw nsw i64 %indvars.iv42, 1
  %exitcond45.not = icmp eq i64 %indvars.iv.next43, 256
  br i1 %exitcond45.not, label %125, label %138, !llvm.loop !26

142:                                              ; preds = %142, %138
  %.039 = phi i32 [ 0, %138 ], [ %166, %142 ]
  %.03238 = phi ptr [ %140, %138 ], [ %165, %142 ]
  %143 = zext nneg i32 %.039 to i64
  %144 = icmp ule i64 %indvars.iv42, %143
  %spec.select = sext i1 %144 to i8
  store i8 -1, ptr %.03238, align 1
  %145 = getelementptr inbounds i8, ptr %.03238, i64 1
  store i8 %spec.select, ptr %145, align 1
  %146 = getelementptr inbounds i8, ptr %.03238, i64 2
  store i8 %spec.select, ptr %146, align 1
  %147 = getelementptr inbounds i8, ptr %.03238, i64 3
  %148 = or disjoint i32 %.039, 1
  %149 = zext nneg i32 %148 to i64
  %150 = icmp ule i64 %indvars.iv42, %149
  %spec.select.1 = sext i1 %150 to i8
  store i8 -1, ptr %147, align 1
  %151 = getelementptr inbounds i8, ptr %.03238, i64 4
  store i8 %spec.select.1, ptr %151, align 1
  %152 = getelementptr inbounds i8, ptr %.03238, i64 5
  store i8 %spec.select.1, ptr %152, align 1
  %153 = getelementptr inbounds i8, ptr %.03238, i64 6
  %154 = or disjoint i32 %.039, 2
  %155 = zext nneg i32 %154 to i64
  %156 = icmp ule i64 %indvars.iv42, %155
  %spec.select.2 = sext i1 %156 to i8
  store i8 -1, ptr %153, align 1
  %157 = getelementptr inbounds i8, ptr %.03238, i64 7
  store i8 %spec.select.2, ptr %157, align 1
  %158 = getelementptr inbounds i8, ptr %.03238, i64 8
  store i8 %spec.select.2, ptr %158, align 1
  %159 = getelementptr inbounds i8, ptr %.03238, i64 9
  %160 = or disjoint i32 %.039, 3
  %161 = zext nneg i32 %160 to i64
  %162 = icmp ule i64 %indvars.iv42, %161
  %spec.select.3 = sext i1 %162 to i8
  store i8 -1, ptr %159, align 1
  %163 = getelementptr inbounds i8, ptr %.03238, i64 10
  store i8 %spec.select.3, ptr %163, align 1
  %164 = getelementptr inbounds i8, ptr %.03238, i64 11
  store i8 %spec.select.3, ptr %164, align 1
  %165 = getelementptr inbounds i8, ptr %.03238, i64 12
  %166 = add nuw nsw i32 %.039, 4
  %exitcond.not.3 = icmp eq i32 %166, 256
  br i1 %exitcond.not.3, label %141, label %142, !llvm.loop !27

167:                                              ; preds = %125
  call void @__assert_fail(ptr noundef nonnull @.str.8, ptr noundef nonnull @.str.2, i32 noundef 206, ptr noundef nonnull @__PRETTY_FUNCTION__._ZN23TinyGLPrimitiveRenderer16load_buffer_dataEv) #7
  unreachable

168:                                              ; preds = %125
  call void @_ZdaPv(ptr noundef nonnull %124) #9
  call void @llvm.lifetime.end.p0(i64 65536, ptr nonnull %15) #6
  call void @llvm.lifetime.end.p0(i64 160, ptr nonnull %2) #6
  ret void
}

; 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 void @_ZN8PrimVec4C2Effff(ptr noundef nonnull align 4 dereferenceable(16), float noundef, float noundef, float noundef, float noundef) unnamed_addr #3 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN8PrimVec2C2Eff(ptr noundef nonnull align 4 dereferenceable(8), float noundef, float noundef) unnamed_addr #3 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN10PrimVertexC2ERK8PrimVec4S2_RK8PrimVec2(ptr noundef nonnull align 4 dereferenceable(40), ptr noundef nonnull align 4 dereferenceable(16), ptr noundef nonnull align 4 dereferenceable(16), ptr noundef nonnull align 4 dereferenceable(8)) 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: nobuiltin allocsize(0)
declare noundef nonnull ptr @_Znam(i64 noundef) local_unnamed_addr #4

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

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 = { 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 = { 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 #5 = { 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 #6 = { nounwind }
attributes #7 = { noreturn nounwind }
attributes #8 = { builtin allocsize(0) }
attributes #9 = { builtin nounwind }

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !6, i64 16}
!10 = !{!"_ZTS23TinyGLPrimitiveRenderer", !11, i64 8, !11, i64 12, !6, i64 16, !6, i64 24}
!11 = !{!"int", !7, i64 0}
!12 = !{!13, !11, i64 36}
!13 = !{!"_ZTS16PrimInternalData", !11, i64 0, !11, i64 4, !11, i64 8, !11, i64 12, !11, i64 16, !11, i64 20, !11, i64 24, !11, i64 28, !11, i64 32, !11, i64 36, !11, i64 40, !11, i64 44, !11, i64 48, !11, i64 52}
!14 = !{!13, !11, i64 28}
!15 = !{!13, !11, i64 40}
!16 = !{!13, !11, i64 32}
!17 = !{!13, !11, i64 44}
!18 = !{!13, !11, i64 48}
!19 = !{!13, !11, i64 20}
!20 = !{!13, !11, i64 16}
!21 = !{!11, !11, i64 0}
!22 = distinct !{!22, !23}
!23 = !{!"llvm.loop.mustprogress"}
!24 = !{!13, !11, i64 24}
!25 = !{!13, !11, i64 52}
!26 = distinct !{!26, !23}
!27 = distinct !{!27, !23}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferAlignmentPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LCSSAPass,LoopRotatePass,LoopUnrollPass,MergedLoadStoreMotionPass,PostOrderFunctionAttrsPass,SROAPass,SimplifyCFGPass