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

; 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.sth_texture = type { %union.anon, ptr, [128 x %struct.sth_row], i32, i32, [2048 x %struct.Vertex], ptr }
%union.anon = type { ptr }
%struct.sth_row = type { i16, i16, i16 }
%struct.Vertex = type { %struct.vec4, %struct.vec4, %struct.vec2 }
%struct.vec4 = type { [4 x float] }
%struct.vec2 = type { [2 x float] }

@glad_glGetError = external global ptr, align 8
@.str = external hidden unnamed_addr constant [28 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [133 x i8], align 1
@glad_glBindBuffer = external global ptr, align 8
@_ZL14s_vertexBuffer = external hidden global i32, align 4
@glad_glBindVertexArray = external global ptr, align 8
@_ZL19s_vertexArrayObject = external hidden global i32, align 4
@__PRETTY_FUNCTION__._ZN30InternalOpenGL2RenderCallbacks14update_textureEP11sth_textureP9sth_glyphii = external hidden unnamed_addr constant [98 x i8], align 1
@glad_glBindTexture = external global ptr, align 8
@glad_glPixelStorei = external global ptr, align 8
@glad_glTexImage2D = external global ptr, align 8
@glad_glGenTextures = external global ptr, align 8
@glad_glTexParameteri = external global ptr, align 8
@glad_glGenVertexArrays = external global ptr, align 8
@glad_glGenBuffers = external global ptr, align 8
@glad_glBufferData = external global ptr, align 8
@_ZL11s_indexData = external hidden global [4096 x i32], align 16
@_ZL13s_indexBuffer = external hidden global i32, align 4
@glad_glDeleteTextures = external global ptr, align 8

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

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

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

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

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

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

19:                                               ; preds = %5
  br label %22

20:                                               ; preds = %5
  call void @__assert_fail(ptr noundef @.str, ptr noundef @.str.1, i32 noundef 103, ptr noundef @__PRETTY_FUNCTION__._ZN30InternalOpenGL2RenderCallbacks14update_textureEP11sth_textureP9sth_glyphii) #7
  unreachable

21:                                               ; No predecessors!
  br label %22

22:                                               ; preds = %21, %19
  %23 = load ptr, ptr %8, align 8, !tbaa !5
  %24 = icmp ne ptr %23, null
  br i1 %24, label %25, label %53

25:                                               ; preds = %22
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #8
  %26 = load ptr, ptr %7, align 8, !tbaa !5
  %27 = getelementptr inbounds %struct.sth_texture, ptr %26, i32 0, i32 0
  %28 = load ptr, ptr %27, align 8, !tbaa !11
  store ptr %28, ptr %11, align 8, !tbaa !5
  %29 = load ptr, ptr @glad_glBindTexture, align 8, !tbaa !5
  %30 = load ptr, ptr %11, align 8, !tbaa !5
  %31 = load i32, ptr %30, align 4, !tbaa !9
  call void %29(i32 noundef 3553, i32 noundef %31)
  %32 = load ptr, ptr @glad_glPixelStorei, align 8, !tbaa !5
  call void %32(i32 noundef 3317, i32 noundef 1)
  %33 = load ptr, ptr @glad_glGetError, align 8, !tbaa !5
  %34 = call i32 %33()
  %35 = icmp eq i32 %34, 0
  br i1 %35, label %36, label %37

36:                                               ; preds = %25
  br label %39

37:                                               ; preds = %25
  call void @__assert_fail(ptr noundef @.str, ptr noundef @.str.1, i32 noundef 112, ptr noundef @__PRETTY_FUNCTION__._ZN30InternalOpenGL2RenderCallbacks14update_textureEP11sth_textureP9sth_glyphii) #7
  unreachable

38:                                               ; No predecessors!
  br label %39

39:                                               ; preds = %38, %36
  %40 = load ptr, ptr @glad_glTexImage2D, align 8, !tbaa !5
  %41 = load i32, ptr %9, align 4, !tbaa !9
  %42 = load i32, ptr %10, align 4, !tbaa !9
  %43 = load ptr, ptr %7, align 8, !tbaa !5
  %44 = getelementptr inbounds %struct.sth_texture, ptr %43, i32 0, i32 1
  %45 = load ptr, ptr %44, align 8, !tbaa !12
  call void %40(i32 noundef 3553, i32 noundef 0, i32 noundef 6403, i32 noundef %41, i32 noundef %42, i32 noundef 0, i32 noundef 6403, i32 noundef 5121, ptr noundef %45)
  %46 = load ptr, ptr @glad_glGetError, align 8, !tbaa !5
  %47 = call i32 %46()
  %48 = icmp eq i32 %47, 0
  br i1 %48, label %49, label %50

49:                                               ; preds = %39
  br label %52

50:                                               ; preds = %39
  call void @__assert_fail(ptr noundef @.str, ptr noundef @.str.1, i32 noundef 117, ptr noundef @__PRETTY_FUNCTION__._ZN30InternalOpenGL2RenderCallbacks14update_textureEP11sth_textureP9sth_glyphii) #7
  unreachable

51:                                               ; No predecessors!
  br label %52

52:                                               ; preds = %51, %49
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #8
  br label %165

53:                                               ; preds = %22
  %54 = load i32, ptr %9, align 4, !tbaa !9
  %55 = icmp ne i32 %54, 0
  br i1 %55, label %56, label %146

56:                                               ; preds = %53
  %57 = load i32, ptr %10, align 4, !tbaa !9
  %58 = icmp ne i32 %57, 0
  br i1 %58, label %59, label %146

59:                                               ; preds = %56
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #8
  %60 = call noalias noundef nonnull ptr @_Znwm(i64 noundef 4) #9
  store ptr %60, ptr %12, align 8, !tbaa !5
  %61 = load ptr, ptr %12, align 8, !tbaa !5
  %62 = load ptr, ptr %7, align 8, !tbaa !5
  %63 = getelementptr inbounds %struct.sth_texture, ptr %62, i32 0, i32 0
  store ptr %61, ptr %63, align 8, !tbaa !11
  %64 = load ptr, ptr @glad_glGenTextures, align 8, !tbaa !5
  %65 = load ptr, ptr %12, align 8, !tbaa !5
  call void %64(i32 noundef 1, ptr noundef %65)
  %66 = load ptr, ptr @glad_glGetError, align 8, !tbaa !5
  %67 = call i32 %66()
  %68 = icmp eq i32 %67, 0
  br i1 %68, label %69, label %70

69:                                               ; preds = %59
  br label %72

70:                                               ; preds = %59
  call void @__assert_fail(ptr noundef @.str, ptr noundef @.str.1, i32 noundef 125, ptr noundef @__PRETTY_FUNCTION__._ZN30InternalOpenGL2RenderCallbacks14update_textureEP11sth_textureP9sth_glyphii) #7
  unreachable

71:                                               ; No predecessors!
  br label %72

72:                                               ; preds = %71, %69
  %73 = load ptr, ptr @glad_glBindTexture, align 8, !tbaa !5
  %74 = load ptr, ptr %12, align 8, !tbaa !5
  %75 = load i32, ptr %74, align 4, !tbaa !9
  call void %73(i32 noundef 3553, i32 noundef %75)
  %76 = load i32, ptr %9, align 4, !tbaa !9
  %77 = load i32, ptr %10, align 4, !tbaa !9
  %78 = mul nsw i32 %76, %77
  %79 = sext i32 %78 to i64
  %80 = call noalias ptr @malloc(i64 noundef %79) #10
  %81 = load ptr, ptr %7, align 8, !tbaa !5
  %82 = getelementptr inbounds %struct.sth_texture, ptr %81, i32 0, i32 1
  store ptr %80, ptr %82, align 8, !tbaa !12
  %83 = load ptr, ptr %7, align 8, !tbaa !5
  %84 = getelementptr inbounds %struct.sth_texture, ptr %83, i32 0, i32 1
  %85 = load ptr, ptr %84, align 8, !tbaa !12
  %86 = load i32, ptr %9, align 4, !tbaa !9
  %87 = load i32, ptr %10, align 4, !tbaa !9
  %88 = mul nsw i32 %86, %87
  %89 = sext i32 %88 to i64
  call void @llvm.memset.p0.i64(ptr align 1 %85, i8 0, i64 %89, i1 false)
  %90 = load ptr, ptr @glad_glTexImage2D, align 8, !tbaa !5
  %91 = load i32, ptr %9, align 4, !tbaa !9
  %92 = load i32, ptr %10, align 4, !tbaa !9
  %93 = load ptr, ptr %7, align 8, !tbaa !5
  %94 = getelementptr inbounds %struct.sth_texture, ptr %93, i32 0, i32 1
  %95 = load ptr, ptr %94, align 8, !tbaa !12
  call void %90(i32 noundef 3553, i32 noundef 0, i32 noundef 6403, i32 noundef %91, i32 noundef %92, i32 noundef 0, i32 noundef 6403, i32 noundef 5121, ptr noundef %95)
  %96 = load ptr, ptr @glad_glTexParameteri, align 8, !tbaa !5
  call void %96(i32 noundef 3553, i32 noundef 10241, i32 noundef 9987)
  %97 = load ptr, ptr @glad_glTexParameteri, align 8, !tbaa !5
  call void %97(i32 noundef 3553, i32 noundef 10240, i32 noundef 9729)
  %98 = load ptr, ptr @glad_glGetError, align 8, !tbaa !5
  %99 = call i32 %98()
  %100 = icmp eq i32 %99, 0
  br i1 %100, label %101, label %102

101:                                              ; preds = %72
  br label %104

102:                                              ; preds = %72
  call void @__assert_fail(ptr noundef @.str, ptr noundef @.str.1, i32 noundef 135, ptr noundef @__PRETTY_FUNCTION__._ZN30InternalOpenGL2RenderCallbacks14update_textureEP11sth_textureP9sth_glyphii) #7
  unreachable

103:                                              ; No predecessors!
  br label %104

104:                                              ; preds = %103, %101
  %105 = load ptr, ptr @glad_glGenVertexArrays, align 8, !tbaa !5
  call void %105(i32 noundef 1, ptr noundef @_ZL19s_vertexArrayObject)
  %106 = load ptr, ptr @glad_glBindVertexArray, align 8, !tbaa !5
  %107 = load i32, ptr @_ZL19s_vertexArrayObject, align 4, !tbaa !9
  call void %106(i32 noundef %107)
  %108 = load ptr, ptr @glad_glGenBuffers, align 8, !tbaa !5
  call void %108(i32 noundef 1, ptr noundef @_ZL14s_vertexBuffer)
  %109 = load ptr, ptr @glad_glBindBuffer, align 8, !tbaa !5
  %110 = load i32, ptr @_ZL14s_vertexBuffer, align 4, !tbaa !9
  call void %109(i32 noundef 34962, i32 noundef %110)
  %111 = load ptr, ptr @glad_glBufferData, align 8, !tbaa !5
  %112 = load ptr, ptr %7, align 8, !tbaa !5
  %113 = getelementptr inbounds %struct.sth_texture, ptr %112, i32 0, i32 5
  %114 = getelementptr inbounds [2048 x %struct.Vertex], ptr %113, i64 0, i64 0
  call void %111(i32 noundef 34962, i64 noundef 81920, ptr noundef %114, i32 noundef 35048)
  %115 = load ptr, ptr @glad_glGetError, align 8, !tbaa !5
  %116 = call i32 %115()
  %117 = icmp eq i32 %116, 0
  br i1 %117, label %118, label %119

118:                                              ; preds = %104
  br label %121

119:                                              ; preds = %104
  call void @__assert_fail(ptr noundef @.str, ptr noundef @.str.1, i32 noundef 147, ptr noundef @__PRETTY_FUNCTION__._ZN30InternalOpenGL2RenderCallbacks14update_textureEP11sth_textureP9sth_glyphii) #7
  unreachable

120:                                              ; No predecessors!
  br label %121

121:                                              ; preds = %120, %118
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #8
  store i32 0, ptr %13, align 4, !tbaa !9
  br label %122

122:                                              ; preds = %131, %121
  %123 = load i32, ptr %13, align 4, !tbaa !9
  %124 = icmp slt i32 %123, 4096
  br i1 %124, label %126, label %125

125:                                              ; preds = %122
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #8
  br label %134

126:                                              ; preds = %122
  %127 = load i32, ptr %13, align 4, !tbaa !9
  %128 = load i32, ptr %13, align 4, !tbaa !9
  %129 = sext i32 %128 to i64
  %130 = getelementptr inbounds [4096 x i32], ptr @_ZL11s_indexData, i64 0, i64 %129
  store i32 %127, ptr %130, align 4, !tbaa !9
  br label %131

131:                                              ; preds = %126
  %132 = load i32, ptr %13, align 4, !tbaa !9
  %133 = add nsw i32 %132, 1
  store i32 %133, ptr %13, align 4, !tbaa !9
  br label %122, !llvm.loop !14

134:                                              ; preds = %125
  %135 = load ptr, ptr @glad_glGenBuffers, align 8, !tbaa !5
  call void %135(i32 noundef 1, ptr noundef @_ZL13s_indexBuffer)
  %136 = load ptr, ptr @glad_glBindBuffer, align 8, !tbaa !5
  %137 = load i32, ptr @_ZL13s_indexBuffer, align 4, !tbaa !9
  call void %136(i32 noundef 34963, i32 noundef %137)
  %138 = load ptr, ptr @glad_glBufferData, align 8, !tbaa !5
  call void %138(i32 noundef 34963, i64 noundef 16384, ptr noundef @_ZL11s_indexData, i32 noundef 35044)
  %139 = load ptr, ptr @glad_glGetError, align 8, !tbaa !5
  %140 = call i32 %139()
  %141 = icmp eq i32 %140, 0
  br i1 %141, label %142, label %143

142:                                              ; preds = %134
  br label %145

143:                                              ; preds = %134
  call void @__assert_fail(ptr noundef @.str, ptr noundef @.str.1, i32 noundef 158, ptr noundef @__PRETTY_FUNCTION__._ZN30InternalOpenGL2RenderCallbacks14update_textureEP11sth_textureP9sth_glyphii) #7
  unreachable

144:                                              ; No predecessors!
  br label %145

145:                                              ; preds = %144, %142
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #8
  br label %164

146:                                              ; preds = %56, %53
  %147 = load ptr, ptr %7, align 8, !tbaa !5
  %148 = getelementptr inbounds %struct.sth_texture, ptr %147, i32 0, i32 0
  %149 = load ptr, ptr %148, align 8, !tbaa !11
  %150 = icmp ne ptr %149, null
  br i1 %150, label %151, label %163

151:                                              ; preds = %146
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #8
  %152 = load ptr, ptr %7, align 8, !tbaa !5
  %153 = getelementptr inbounds %struct.sth_texture, ptr %152, i32 0, i32 0
  %154 = load ptr, ptr %153, align 8, !tbaa !11
  store ptr %154, ptr %14, align 8, !tbaa !5
  %155 = load ptr, ptr @glad_glDeleteTextures, align 8, !tbaa !5
  %156 = load ptr, ptr %14, align 8, !tbaa !5
  call void %155(i32 noundef 1, ptr noundef %156)
  %157 = load ptr, ptr %14, align 8, !tbaa !5
  %158 = icmp eq ptr %157, null
  br i1 %158, label %160, label %159

159:                                              ; preds = %151
  call void @_ZdlPvm(ptr noundef %157, i64 noundef 4) #11
  br label %160

160:                                              ; preds = %159, %151
  %161 = load ptr, ptr %7, align 8, !tbaa !5
  %162 = getelementptr inbounds %struct.sth_texture, ptr %161, i32 0, i32 0
  store ptr null, ptr %162, align 8, !tbaa !11
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #8
  br label %163

163:                                              ; preds = %160, %146
  br label %164

164:                                              ; preds = %163, %145
  br label %165

165:                                              ; preds = %164, %52
  ret void
}

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

; Function Attrs: nounwind allocsize(0)
declare noalias ptr @malloc(i64 noundef) #6

attributes #0 = { nobuiltin nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { 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 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #4 = { 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 #5 = { 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 #6 = { nounwind 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 #7 = { noreturn nounwind }
attributes #8 = { nounwind }
attributes #9 = { builtin allocsize(0) }
attributes #10 = { nounwind allocsize(0) }
attributes #11 = { 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, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = !{!7, !7, i64 0}
!12 = !{!13, !6, i64 8}
!13 = !{!"_ZTS11sth_texture", !7, i64 0, !6, i64 8, !7, i64 16, !10, i64 784, !10, i64 788, !7, i64 792, !6, i64 82712}
!14 = distinct !{!14, !15}
!15 = !{!"llvm.loop.mustprogress"}


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

@glad_glGetError = external local_unnamed_addr global ptr, align 8
@.str = external hidden unnamed_addr constant [28 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [133 x i8], align 1
@glad_glBindBuffer = external local_unnamed_addr global ptr, align 8
@_ZL14s_vertexBuffer = external hidden global i32, align 4
@glad_glBindVertexArray = external local_unnamed_addr global ptr, align 8
@_ZL19s_vertexArrayObject = external hidden global i32, align 4
@__PRETTY_FUNCTION__._ZN30InternalOpenGL2RenderCallbacks14update_textureEP11sth_textureP9sth_glyphii = external hidden unnamed_addr constant [98 x i8], align 1
@glad_glBindTexture = external local_unnamed_addr global ptr, align 8
@glad_glPixelStorei = external local_unnamed_addr global ptr, align 8
@glad_glTexImage2D = external local_unnamed_addr global ptr, align 8
@glad_glGenTextures = external local_unnamed_addr global ptr, align 8
@glad_glTexParameteri = external local_unnamed_addr global ptr, align 8
@glad_glGenVertexArrays = external local_unnamed_addr global ptr, align 8
@glad_glGenBuffers = external local_unnamed_addr global ptr, align 8
@glad_glBufferData = external local_unnamed_addr global ptr, align 8
@_ZL11s_indexData = external hidden global [4096 x i32], align 16
@_ZL13s_indexBuffer = external hidden global i32, align 4
@glad_glDeleteTextures = external local_unnamed_addr global ptr, align 8

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN30InternalOpenGL2RenderCallbacks14update_textureEP11sth_textureP9sth_glyphii(ptr nocapture noundef nonnull readnone align 8 dereferenceable(8) %0, ptr noundef %1, ptr noundef readnone %2, i32 noundef %3, i32 noundef %4) unnamed_addr #2 align 2 {
  %6 = load ptr, ptr @glad_glGetError, align 8, !tbaa !5
  %7 = tail call i32 %6()
  %8 = icmp eq i32 %7, 0
  br i1 %8, label %10, label %9

9:                                                ; preds = %5
  tail call void @__assert_fail(ptr noundef nonnull @.str, ptr noundef nonnull @.str.1, i32 noundef 103, ptr noundef nonnull @__PRETTY_FUNCTION__._ZN30InternalOpenGL2RenderCallbacks14update_textureEP11sth_textureP9sth_glyphii) #5
  unreachable

10:                                               ; preds = %5
  %.not = icmp eq ptr %2, null
  br i1 %.not, label %28, label %11

11:                                               ; preds = %10
  %12 = load ptr, ptr %1, align 8, !tbaa !9
  %13 = load ptr, ptr @glad_glBindTexture, align 8, !tbaa !5
  %14 = load i32, ptr %12, align 4, !tbaa !10
  tail call void %13(i32 noundef 3553, i32 noundef %14)
  %15 = load ptr, ptr @glad_glPixelStorei, align 8, !tbaa !5
  tail call void %15(i32 noundef 3317, i32 noundef 1)
  %16 = load ptr, ptr @glad_glGetError, align 8, !tbaa !5
  %17 = tail call i32 %16()
  %18 = icmp eq i32 %17, 0
  br i1 %18, label %20, label %19

19:                                               ; preds = %11
  tail call void @__assert_fail(ptr noundef nonnull @.str, ptr noundef nonnull @.str.1, i32 noundef 112, ptr noundef nonnull @__PRETTY_FUNCTION__._ZN30InternalOpenGL2RenderCallbacks14update_textureEP11sth_textureP9sth_glyphii) #5
  unreachable

20:                                               ; preds = %11
  %21 = load ptr, ptr @glad_glTexImage2D, align 8, !tbaa !5
  %22 = getelementptr inbounds i8, ptr %1, i64 8
  %23 = load ptr, ptr %22, align 8, !tbaa !12
  tail call void %21(i32 noundef 3553, i32 noundef 0, i32 noundef 6403, i32 noundef %3, i32 noundef %4, i32 noundef 0, i32 noundef 6403, i32 noundef 5121, ptr noundef %23)
  %24 = load ptr, ptr @glad_glGetError, align 8, !tbaa !5
  %25 = tail call i32 %24()
  %26 = icmp eq i32 %25, 0
  br i1 %26, label %85, label %27

27:                                               ; preds = %20
  tail call void @__assert_fail(ptr noundef nonnull @.str, ptr noundef nonnull @.str.1, i32 noundef 117, ptr noundef nonnull @__PRETTY_FUNCTION__._ZN30InternalOpenGL2RenderCallbacks14update_textureEP11sth_textureP9sth_glyphii) #5
  unreachable

28:                                               ; preds = %10
  %29 = icmp ne i32 %3, 0
  %30 = icmp ne i32 %4, 0
  %or.cond = and i1 %29, %30
  br i1 %or.cond, label %31, label %81

31:                                               ; preds = %28
  %32 = tail call noalias noundef nonnull dereferenceable(4) ptr @_Znwm(i64 noundef 4) #6
  store ptr %32, ptr %1, align 8, !tbaa !9
  %33 = load ptr, ptr @glad_glGenTextures, align 8, !tbaa !5
  tail call void %33(i32 noundef 1, ptr noundef nonnull %32)
  %34 = load ptr, ptr @glad_glGetError, align 8, !tbaa !5
  %35 = tail call i32 %34()
  %36 = icmp eq i32 %35, 0
  br i1 %36, label %38, label %37

37:                                               ; preds = %31
  tail call void @__assert_fail(ptr noundef nonnull @.str, ptr noundef nonnull @.str.1, i32 noundef 125, ptr noundef nonnull @__PRETTY_FUNCTION__._ZN30InternalOpenGL2RenderCallbacks14update_textureEP11sth_textureP9sth_glyphii) #5
  unreachable

38:                                               ; preds = %31
  %39 = load ptr, ptr @glad_glBindTexture, align 8, !tbaa !5
  %40 = load i32, ptr %32, align 4, !tbaa !10
  tail call void %39(i32 noundef 3553, i32 noundef %40)
  %41 = mul nsw i32 %4, %3
  %42 = sext i32 %41 to i64
  %calloc = tail call ptr @calloc(i64 1, i64 %42)
  %43 = getelementptr inbounds i8, ptr %1, i64 8
  store ptr %calloc, ptr %43, align 8, !tbaa !12
  %44 = load ptr, ptr @glad_glTexImage2D, align 8, !tbaa !5
  tail call void %44(i32 noundef 3553, i32 noundef 0, i32 noundef 6403, i32 noundef %3, i32 noundef %4, i32 noundef 0, i32 noundef 6403, i32 noundef 5121, ptr noundef %calloc)
  %45 = load ptr, ptr @glad_glTexParameteri, align 8, !tbaa !5
  tail call void %45(i32 noundef 3553, i32 noundef 10241, i32 noundef 9987)
  %46 = load ptr, ptr @glad_glTexParameteri, align 8, !tbaa !5
  tail call void %46(i32 noundef 3553, i32 noundef 10240, i32 noundef 9729)
  %47 = load ptr, ptr @glad_glGetError, align 8, !tbaa !5
  %48 = tail call i32 %47()
  %49 = icmp eq i32 %48, 0
  br i1 %49, label %51, label %50

50:                                               ; preds = %38
  tail call void @__assert_fail(ptr noundef nonnull @.str, ptr noundef nonnull @.str.1, i32 noundef 135, ptr noundef nonnull @__PRETTY_FUNCTION__._ZN30InternalOpenGL2RenderCallbacks14update_textureEP11sth_textureP9sth_glyphii) #5
  unreachable

51:                                               ; preds = %38
  %52 = load ptr, ptr @glad_glGenVertexArrays, align 8, !tbaa !5
  tail call void %52(i32 noundef 1, ptr noundef nonnull @_ZL19s_vertexArrayObject)
  %53 = load ptr, ptr @glad_glBindVertexArray, align 8, !tbaa !5
  %54 = load i32, ptr @_ZL19s_vertexArrayObject, align 4, !tbaa !10
  tail call void %53(i32 noundef %54)
  %55 = load ptr, ptr @glad_glGenBuffers, align 8, !tbaa !5
  tail call void %55(i32 noundef 1, ptr noundef nonnull @_ZL14s_vertexBuffer)
  %56 = load ptr, ptr @glad_glBindBuffer, align 8, !tbaa !5
  %57 = load i32, ptr @_ZL14s_vertexBuffer, align 4, !tbaa !10
  tail call void %56(i32 noundef 34962, i32 noundef %57)
  %58 = load ptr, ptr @glad_glBufferData, align 8, !tbaa !5
  %59 = getelementptr inbounds i8, ptr %1, i64 792
  tail call void %58(i32 noundef 34962, i64 noundef 81920, ptr noundef nonnull %59, i32 noundef 35048)
  %60 = load ptr, ptr @glad_glGetError, align 8, !tbaa !5
  %61 = tail call i32 %60()
  %62 = icmp eq i32 %61, 0
  br i1 %62, label %vector.body, label %72

vector.body:                                      ; preds = %51, %vector.body
  %index = phi i64 [ %index.next.3, %vector.body ], [ 0, %51 ]
  %vec.ind = phi <4 x i32> [ %vec.ind.next.3, %vector.body ], [ <i32 0, i32 1, i32 2, i32 3>, %51 ]
  %step.add = add <4 x i32> %vec.ind, <i32 4, i32 4, i32 4, i32 4>
  %63 = getelementptr inbounds [4096 x i32], ptr @_ZL11s_indexData, i64 0, i64 %index
  %64 = getelementptr inbounds i8, ptr %63, i64 16
  store <4 x i32> %vec.ind, ptr %63, align 16, !tbaa !10
  store <4 x i32> %step.add, ptr %64, align 16, !tbaa !10
  %index.next = or disjoint i64 %index, 8
  %vec.ind.next = add <4 x i32> %vec.ind, <i32 8, i32 8, i32 8, i32 8>
  %step.add.1 = add <4 x i32> %vec.ind, <i32 12, i32 12, i32 12, i32 12>
  %65 = getelementptr inbounds [4096 x i32], ptr @_ZL11s_indexData, i64 0, i64 %index.next
  %66 = getelementptr inbounds i8, ptr %65, i64 16
  store <4 x i32> %vec.ind.next, ptr %65, align 16, !tbaa !10
  store <4 x i32> %step.add.1, ptr %66, align 16, !tbaa !10
  %index.next.1 = or disjoint i64 %index, 16
  %vec.ind.next.1 = add <4 x i32> %vec.ind, <i32 16, i32 16, i32 16, i32 16>
  %step.add.2 = add <4 x i32> %vec.ind, <i32 20, i32 20, i32 20, i32 20>
  %67 = getelementptr inbounds [4096 x i32], ptr @_ZL11s_indexData, i64 0, i64 %index.next.1
  %68 = getelementptr inbounds i8, ptr %67, i64 16
  store <4 x i32> %vec.ind.next.1, ptr %67, align 16, !tbaa !10
  store <4 x i32> %step.add.2, ptr %68, align 16, !tbaa !10
  %index.next.2 = or disjoint i64 %index, 24
  %vec.ind.next.2 = add <4 x i32> %vec.ind, <i32 24, i32 24, i32 24, i32 24>
  %step.add.3 = add <4 x i32> %vec.ind, <i32 28, i32 28, i32 28, i32 28>
  %69 = getelementptr inbounds [4096 x i32], ptr @_ZL11s_indexData, i64 0, i64 %index.next.2
  %70 = getelementptr inbounds i8, ptr %69, i64 16
  store <4 x i32> %vec.ind.next.2, ptr %69, align 16, !tbaa !10
  store <4 x i32> %step.add.3, ptr %70, align 16, !tbaa !10
  %index.next.3 = add nuw nsw i64 %index, 32
  %vec.ind.next.3 = add <4 x i32> %vec.ind, <i32 32, i32 32, i32 32, i32 32>
  %71 = icmp eq i64 %index.next.3, 4096
  br i1 %71, label %middle.block, label %vector.body, !llvm.loop !14

72:                                               ; preds = %51
  tail call void @__assert_fail(ptr noundef nonnull @.str, ptr noundef nonnull @.str.1, i32 noundef 147, ptr noundef nonnull @__PRETTY_FUNCTION__._ZN30InternalOpenGL2RenderCallbacks14update_textureEP11sth_textureP9sth_glyphii) #5
  unreachable

middle.block:                                     ; preds = %vector.body
  %73 = load ptr, ptr @glad_glGenBuffers, align 8, !tbaa !5
  tail call void %73(i32 noundef 1, ptr noundef nonnull @_ZL13s_indexBuffer)
  %74 = load ptr, ptr @glad_glBindBuffer, align 8, !tbaa !5
  %75 = load i32, ptr @_ZL13s_indexBuffer, align 4, !tbaa !10
  tail call void %74(i32 noundef 34963, i32 noundef %75)
  %76 = load ptr, ptr @glad_glBufferData, align 8, !tbaa !5
  tail call void %76(i32 noundef 34963, i64 noundef 16384, ptr noundef nonnull @_ZL11s_indexData, i32 noundef 35044)
  %77 = load ptr, ptr @glad_glGetError, align 8, !tbaa !5
  %78 = tail call i32 %77()
  %79 = icmp eq i32 %78, 0
  br i1 %79, label %85, label %80

80:                                               ; preds = %middle.block
  tail call void @__assert_fail(ptr noundef nonnull @.str, ptr noundef nonnull @.str.1, i32 noundef 158, ptr noundef nonnull @__PRETTY_FUNCTION__._ZN30InternalOpenGL2RenderCallbacks14update_textureEP11sth_textureP9sth_glyphii) #5
  unreachable

81:                                               ; preds = %28
  %82 = load ptr, ptr %1, align 8, !tbaa !9
  %.not35 = icmp eq ptr %82, null
  br i1 %.not35, label %85, label %83

83:                                               ; preds = %81
  %84 = load ptr, ptr @glad_glDeleteTextures, align 8, !tbaa !5
  tail call void %84(i32 noundef 1, ptr noundef nonnull %82)
  tail call void @_ZdlPvm(ptr noundef nonnull %82, i64 noundef 4) #7
  store ptr null, ptr %1, align 8, !tbaa !9
  br label %85

85:                                               ; preds = %middle.block, %20, %83, %81
  ret void
}

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

; Function Attrs: nofree nounwind willreturn allockind("alloc,zeroed") allocsize(0,1) memory(inaccessiblemem: readwrite)
declare noalias noundef ptr @calloc(i64 noundef, i64 noundef) local_unnamed_addr #4

attributes #0 = { nobuiltin nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { 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 = { nofree nounwind willreturn allockind("alloc,zeroed") allocsize(0,1) memory(inaccessiblemem: readwrite) "alloc-family"="malloc" }
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 = !{!7, !7, i64 0}
!10 = !{!11, !11, i64 0}
!11 = !{!"int", !7, i64 0}
!12 = !{!13, !6, i64 8}
!13 = !{!"_ZTS11sth_texture", !7, i64 0, !6, i64 8, !7, i64 16, !11, i64 784, !11, i64 788, !7, i64 792, !6, i64 82712}
!14 = distinct !{!14, !15, !16, !17}
!15 = !{!"llvm.loop.mustprogress"}
!16 = !{!"llvm.loop.isvectorized", i32 1}
!17 = !{!"llvm.loop.unroll.runtime.disable"}


; Effective O3 passes: CorrelatedValuePropagationPass,DSEPass,EarlyCSEPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferAlignmentPass,InferFunctionAttrsPass,InstCombinePass,LoopLoadEliminationPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,LoopVectorizePass,PostOrderFunctionAttrsPass,ReassociatePass,SROAPass,SimplifyCFGPass,TailCallElimPass