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

; 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.TinyGLPrimitiveRenderer = type { ptr, i32, i32, ptr, ptr }
%struct.PrimInternalData = type { i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32 }

@_ZTV23TinyGLPrimitiveRenderer = external dso_local unnamed_addr constant { [4 x ptr] }, align 8
@_ZL14vertexShader3D = external hidden global ptr, align 8
@_ZL16fragmentShader3D = external hidden global ptr, align 8
@glad_glGetUniformLocation = external global ptr, align 8
@.str = external hidden unnamed_addr constant [11 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [129 x i8], align 1
@__PRETTY_FUNCTION__._ZN23TinyGLPrimitiveRendererC2Eii = external hidden unnamed_addr constant [59 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [11 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [2 x i8], align 1
@glad_glGetAttribLocation = external global ptr, align 8
@.str.5 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [9 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [6 x i8], align 1

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN23TinyGLPrimitiveRendererC2Eii(ptr noundef nonnull align 8 dereferenceable(32) %0, i32 noundef %1, i32 noundef %2) unnamed_addr #0 align 2 personality ptr @__gxx_personality_v0 {
  %4 = alloca ptr, align 8
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca ptr, align 8
  %8 = alloca i32, align 4
  store ptr %0, ptr %4, align 8, !tbaa !5
  store i32 %1, ptr %5, align 4, !tbaa !9
  store i32 %2, ptr %6, align 4, !tbaa !9
  %9 = load ptr, ptr %4, align 8
  store ptr getelementptr inbounds inrange(-16, 16) ({ [4 x ptr] }, ptr @_ZTV23TinyGLPrimitiveRenderer, i32 0, i32 0, i32 2), ptr %9, align 8, !tbaa !11
  %10 = getelementptr inbounds %class.TinyGLPrimitiveRenderer, ptr %9, i32 0, i32 1
  %11 = load i32, ptr %5, align 4, !tbaa !9
  store i32 %11, ptr %10, align 8, !tbaa !13
  %12 = getelementptr inbounds %class.TinyGLPrimitiveRenderer, ptr %9, i32 0, i32 2
  %13 = load i32, ptr %6, align 4, !tbaa !9
  store i32 %13, ptr %12, align 4, !tbaa !15
  %14 = call noalias noundef nonnull ptr @_Znwm(i64 noundef 56) #5
  %15 = getelementptr inbounds %class.TinyGLPrimitiveRenderer, ptr %9, i32 0, i32 3
  store ptr %14, ptr %15, align 8, !tbaa !16
  %16 = call noalias noundef nonnull ptr @_Znwm(i64 noundef 655368) #5
  invoke void @_ZN17PrimInternalData2C2Ev(ptr noundef nonnull align 4 dereferenceable(655368) %16)
          to label %17 unwind label %40

17:                                               ; preds = %3
  %18 = getelementptr inbounds %class.TinyGLPrimitiveRenderer, ptr %9, i32 0, i32 4
  store ptr %16, ptr %18, align 8, !tbaa !17
  %19 = load ptr, ptr @_ZL14vertexShader3D, align 8, !tbaa !5
  %20 = load ptr, ptr @_ZL16fragmentShader3D, align 8, !tbaa !5
  %21 = call i32 @gltLoadShaderPair(ptr noundef %19, ptr noundef %20)
  %22 = getelementptr inbounds %class.TinyGLPrimitiveRenderer, ptr %9, i32 0, i32 3
  %23 = load ptr, ptr %22, align 8, !tbaa !16
  %24 = getelementptr inbounds %struct.PrimInternalData, ptr %23, i32 0, i32 0
  store i32 %21, ptr %24, align 4, !tbaa !18
  %25 = load ptr, ptr @glad_glGetUniformLocation, align 8, !tbaa !5
  %26 = getelementptr inbounds %class.TinyGLPrimitiveRenderer, ptr %9, i32 0, i32 3
  %27 = load ptr, ptr %26, align 8, !tbaa !16
  %28 = getelementptr inbounds %struct.PrimInternalData, ptr %27, i32 0, i32 0
  %29 = load i32, ptr %28, align 4, !tbaa !18
  %30 = call i32 %25(i32 noundef %29, ptr noundef @.str)
  %31 = getelementptr inbounds %class.TinyGLPrimitiveRenderer, ptr %9, i32 0, i32 3
  %32 = load ptr, ptr %31, align 8, !tbaa !16
  %33 = getelementptr inbounds %struct.PrimInternalData, ptr %32, i32 0, i32 1
  store i32 %30, ptr %33, align 4, !tbaa !20
  %34 = getelementptr inbounds %class.TinyGLPrimitiveRenderer, ptr %9, i32 0, i32 3
  %35 = load ptr, ptr %34, align 8, !tbaa !16
  %36 = getelementptr inbounds %struct.PrimInternalData, ptr %35, i32 0, i32 1
  %37 = load i32, ptr %36, align 4, !tbaa !20
  %38 = icmp slt i32 %37, 0
  br i1 %38, label %39, label %44

39:                                               ; preds = %17
  call void @__assert_fail(ptr noundef @.str.1, ptr noundef @.str.2, i32 noundef 81, ptr noundef @__PRETTY_FUNCTION__._ZN23TinyGLPrimitiveRendererC2Eii) #6
  unreachable

40:                                               ; preds = %3
  %41 = landingpad { ptr, i32 }
          cleanup
  %42 = extractvalue { ptr, i32 } %41, 0
  store ptr %42, ptr %7, align 8
  %43 = extractvalue { ptr, i32 } %41, 1
  store i32 %43, ptr %8, align 4
  call void @_ZdlPvm(ptr noundef %16, i64 noundef 655368) #7
  br label %125

44:                                               ; preds = %17
  %45 = load ptr, ptr @glad_glGetUniformLocation, align 8, !tbaa !5
  %46 = getelementptr inbounds %class.TinyGLPrimitiveRenderer, ptr %9, i32 0, i32 3
  %47 = load ptr, ptr %46, align 8, !tbaa !16
  %48 = getelementptr inbounds %struct.PrimInternalData, ptr %47, i32 0, i32 0
  %49 = load i32, ptr %48, align 4, !tbaa !18
  %50 = call i32 %45(i32 noundef %49, ptr noundef @.str.3)
  %51 = getelementptr inbounds %class.TinyGLPrimitiveRenderer, ptr %9, i32 0, i32 3
  %52 = load ptr, ptr %51, align 8, !tbaa !16
  %53 = getelementptr inbounds %struct.PrimInternalData, ptr %52, i32 0, i32 2
  store i32 %50, ptr %53, align 4, !tbaa !21
  %54 = getelementptr inbounds %class.TinyGLPrimitiveRenderer, ptr %9, i32 0, i32 3
  %55 = load ptr, ptr %54, align 8, !tbaa !16
  %56 = getelementptr inbounds %struct.PrimInternalData, ptr %55, i32 0, i32 2
  %57 = load i32, ptr %56, align 4, !tbaa !21
  %58 = icmp slt i32 %57, 0
  br i1 %58, label %59, label %60

59:                                               ; preds = %44
  call void @__assert_fail(ptr noundef @.str.1, ptr noundef @.str.2, i32 noundef 86, ptr noundef @__PRETTY_FUNCTION__._ZN23TinyGLPrimitiveRendererC2Eii) #6
  unreachable

60:                                               ; preds = %44
  %61 = load ptr, ptr @glad_glGetUniformLocation, align 8, !tbaa !5
  %62 = getelementptr inbounds %class.TinyGLPrimitiveRenderer, ptr %9, i32 0, i32 3
  %63 = load ptr, ptr %62, align 8, !tbaa !16
  %64 = getelementptr inbounds %struct.PrimInternalData, ptr %63, i32 0, i32 0
  %65 = load i32, ptr %64, align 4, !tbaa !18
  %66 = call i32 %61(i32 noundef %65, ptr noundef @.str.4)
  %67 = getelementptr inbounds %class.TinyGLPrimitiveRenderer, ptr %9, i32 0, i32 3
  %68 = load ptr, ptr %67, align 8, !tbaa !16
  %69 = getelementptr inbounds %struct.PrimInternalData, ptr %68, i32 0, i32 3
  store i32 %66, ptr %69, align 4, !tbaa !22
  %70 = getelementptr inbounds %class.TinyGLPrimitiveRenderer, ptr %9, i32 0, i32 3
  %71 = load ptr, ptr %70, align 8, !tbaa !16
  %72 = getelementptr inbounds %struct.PrimInternalData, ptr %71, i32 0, i32 3
  %73 = load i32, ptr %72, align 4, !tbaa !22
  %74 = icmp slt i32 %73, 0
  br i1 %74, label %75, label %76

75:                                               ; preds = %60
  call void @__assert_fail(ptr noundef @.str.1, ptr noundef @.str.2, i32 noundef 90, ptr noundef @__PRETTY_FUNCTION__._ZN23TinyGLPrimitiveRendererC2Eii) #6
  unreachable

76:                                               ; preds = %60
  %77 = load ptr, ptr @glad_glGetAttribLocation, align 8, !tbaa !5
  %78 = getelementptr inbounds %class.TinyGLPrimitiveRenderer, ptr %9, i32 0, i32 3
  %79 = load ptr, ptr %78, align 8, !tbaa !16
  %80 = getelementptr inbounds %struct.PrimInternalData, ptr %79, i32 0, i32 0
  %81 = load i32, ptr %80, align 4, !tbaa !18
  %82 = call i32 %77(i32 noundef %81, ptr noundef @.str.5)
  %83 = getelementptr inbounds %class.TinyGLPrimitiveRenderer, ptr %9, i32 0, i32 3
  %84 = load ptr, ptr %83, align 8, !tbaa !16
  %85 = getelementptr inbounds %struct.PrimInternalData, ptr %84, i32 0, i32 4
  store i32 %82, ptr %85, align 4, !tbaa !23
  %86 = getelementptr inbounds %class.TinyGLPrimitiveRenderer, ptr %9, i32 0, i32 3
  %87 = load ptr, ptr %86, align 8, !tbaa !16
  %88 = getelementptr inbounds %struct.PrimInternalData, ptr %87, i32 0, i32 4
  %89 = load i32, ptr %88, align 4, !tbaa !23
  %90 = icmp slt i32 %89, 0
  br i1 %90, label %91, label %92

91:                                               ; preds = %76
  call void @__assert_fail(ptr noundef @.str.1, ptr noundef @.str.2, i32 noundef 95, ptr noundef @__PRETTY_FUNCTION__._ZN23TinyGLPrimitiveRendererC2Eii) #6
  unreachable

92:                                               ; preds = %76
  %93 = load ptr, ptr @glad_glGetAttribLocation, align 8, !tbaa !5
  %94 = getelementptr inbounds %class.TinyGLPrimitiveRenderer, ptr %9, i32 0, i32 3
  %95 = load ptr, ptr %94, align 8, !tbaa !16
  %96 = getelementptr inbounds %struct.PrimInternalData, ptr %95, i32 0, i32 0
  %97 = load i32, ptr %96, align 4, !tbaa !18
  %98 = call i32 %93(i32 noundef %97, ptr noundef @.str.6)
  %99 = getelementptr inbounds %class.TinyGLPrimitiveRenderer, ptr %9, i32 0, i32 3
  %100 = load ptr, ptr %99, align 8, !tbaa !16
  %101 = getelementptr inbounds %struct.PrimInternalData, ptr %100, i32 0, i32 5
  store i32 %98, ptr %101, align 4, !tbaa !24
  %102 = getelementptr inbounds %class.TinyGLPrimitiveRenderer, ptr %9, i32 0, i32 3
  %103 = load ptr, ptr %102, align 8, !tbaa !16
  %104 = getelementptr inbounds %struct.PrimInternalData, ptr %103, i32 0, i32 5
  %105 = load i32, ptr %104, align 4, !tbaa !24
  %106 = icmp slt i32 %105, 0
  br i1 %106, label %107, label %108

107:                                              ; preds = %92
  call void @__assert_fail(ptr noundef @.str.1, ptr noundef @.str.2, i32 noundef 100, ptr noundef @__PRETTY_FUNCTION__._ZN23TinyGLPrimitiveRendererC2Eii) #6
  unreachable

108:                                              ; preds = %92
  %109 = load ptr, ptr @glad_glGetAttribLocation, align 8, !tbaa !5
  %110 = getelementptr inbounds %class.TinyGLPrimitiveRenderer, ptr %9, i32 0, i32 3
  %111 = load ptr, ptr %110, align 8, !tbaa !16
  %112 = getelementptr inbounds %struct.PrimInternalData, ptr %111, i32 0, i32 0
  %113 = load i32, ptr %112, align 4, !tbaa !18
  %114 = call i32 %109(i32 noundef %113, ptr noundef @.str.7)
  %115 = getelementptr inbounds %class.TinyGLPrimitiveRenderer, ptr %9, i32 0, i32 3
  %116 = load ptr, ptr %115, align 8, !tbaa !16
  %117 = getelementptr inbounds %struct.PrimInternalData, ptr %116, i32 0, i32 6
  store i32 %114, ptr %117, align 4, !tbaa !25
  %118 = getelementptr inbounds %class.TinyGLPrimitiveRenderer, ptr %9, i32 0, i32 3
  %119 = load ptr, ptr %118, align 8, !tbaa !16
  %120 = getelementptr inbounds %struct.PrimInternalData, ptr %119, i32 0, i32 6
  %121 = load i32, ptr %120, align 4, !tbaa !25
  %122 = icmp slt i32 %121, 0
  br i1 %122, label %123, label %124

123:                                              ; preds = %108
  call void @__assert_fail(ptr noundef @.str.1, ptr noundef @.str.2, i32 noundef 105, ptr noundef @__PRETTY_FUNCTION__._ZN23TinyGLPrimitiveRendererC2Eii) #6
  unreachable

124:                                              ; preds = %108
  call void @_ZN23TinyGLPrimitiveRenderer16load_buffer_dataEv(ptr noundef nonnull align 8 dereferenceable(32) %9)
  ret void

125:                                              ; preds = %40
  %126 = load ptr, ptr %7, align 8
  %127 = load i32, ptr %8, align 4
  %128 = insertvalue { ptr, i32 } poison, ptr %126, 0
  %129 = insertvalue { ptr, i32 } %128, i32 %127, 1
  resume { ptr, i32 } %129
}

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN17PrimInternalData2C2Ev(ptr noundef nonnull align 4 dereferenceable(655368)) unnamed_addr #0 align 2

declare i32 @__gxx_personality_v0(...)

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

declare i32 @gltLoadShaderPair(ptr noundef, ptr noundef) #3

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN23TinyGLPrimitiveRenderer16load_buffer_dataEv(ptr noundef nonnull align 8 dereferenceable(32)) #0 align 2

attributes #0 = { 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 #1 = { 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 #2 = { 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 #3 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { noreturn nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { builtin allocsize(0) }
attributes #6 = { noreturn nounwind }
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, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"vtable pointer", !8, i64 0}
!13 = !{!14, !10, i64 8}
!14 = !{!"_ZTS23TinyGLPrimitiveRenderer", !10, i64 8, !10, i64 12, !6, i64 16, !6, i64 24}
!15 = !{!14, !10, i64 12}
!16 = !{!14, !6, i64 16}
!17 = !{!14, !6, i64 24}
!18 = !{!19, !10, i64 0}
!19 = !{!"_ZTS16PrimInternalData", !10, i64 0, !10, i64 4, !10, i64 8, !10, i64 12, !10, i64 16, !10, i64 20, !10, i64 24, !10, i64 28, !10, i64 32, !10, i64 36, !10, i64 40, !10, i64 44, !10, i64 48, !10, i64 52}
!20 = !{!19, !10, i64 4}
!21 = !{!19, !10, i64 8}
!22 = !{!19, !10, i64 12}
!23 = !{!19, !10, i64 16}
!24 = !{!19, !10, i64 20}
!25 = !{!19, !10, i64 24}


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

@_ZTV23TinyGLPrimitiveRenderer = external dso_local unnamed_addr constant { [4 x ptr] }, align 8
@_ZL14vertexShader3D = external hidden local_unnamed_addr global ptr, align 8
@_ZL16fragmentShader3D = external hidden local_unnamed_addr global ptr, align 8
@glad_glGetUniformLocation = external local_unnamed_addr global ptr, align 8
@.str = external hidden unnamed_addr constant [11 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [129 x i8], align 1
@__PRETTY_FUNCTION__._ZN23TinyGLPrimitiveRendererC2Eii = external hidden unnamed_addr constant [59 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [11 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [2 x i8], align 1
@glad_glGetAttribLocation = external local_unnamed_addr global ptr, align 8
@.str.5 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [9 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [6 x i8], align 1

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN23TinyGLPrimitiveRendererC2Eii(ptr noundef nonnull align 8 dereferenceable(32) %0, i32 noundef %1, i32 noundef %2) unnamed_addr #0 align 2 personality ptr @__gxx_personality_v0 {
  store ptr getelementptr inbounds inrange(-16, 16) (i8, ptr @_ZTV23TinyGLPrimitiveRenderer, i64 16), ptr %0, align 8, !tbaa !5
  %4 = getelementptr inbounds i8, ptr %0, i64 8
  store i32 %1, ptr %4, align 8, !tbaa !8
  %5 = getelementptr inbounds i8, ptr %0, i64 12
  store i32 %2, ptr %5, align 4, !tbaa !13
  %6 = tail call noalias noundef nonnull dereferenceable(56) ptr @_Znwm(i64 noundef 56) #5
  %7 = getelementptr inbounds i8, ptr %0, i64 16
  store ptr %6, ptr %7, align 8, !tbaa !14
  %8 = tail call noalias noundef nonnull dereferenceable(655368) ptr @_Znwm(i64 noundef 655368) #5
  invoke void @_ZN17PrimInternalData2C2Ev(ptr noundef nonnull align 4 dereferenceable(655368) %8)
          to label %9 unwind label %21

9:                                                ; preds = %3
  %10 = getelementptr inbounds i8, ptr %0, i64 24
  store ptr %8, ptr %10, align 8, !tbaa !15
  %11 = load ptr, ptr @_ZL14vertexShader3D, align 8, !tbaa !16
  %12 = load ptr, ptr @_ZL16fragmentShader3D, align 8, !tbaa !16
  %13 = tail call i32 @gltLoadShaderPair(ptr noundef %11, ptr noundef %12)
  %14 = load ptr, ptr %7, align 8, !tbaa !14
  store i32 %13, ptr %14, align 4, !tbaa !17
  %15 = load ptr, ptr @glad_glGetUniformLocation, align 8, !tbaa !16
  %16 = tail call i32 %15(i32 noundef %13, ptr noundef nonnull @.str)
  %17 = load ptr, ptr %7, align 8, !tbaa !14
  %18 = getelementptr inbounds i8, ptr %17, i64 4
  store i32 %16, ptr %18, align 4, !tbaa !19
  %19 = icmp slt i32 %16, 0
  br i1 %19, label %20, label %23

20:                                               ; preds = %9
  tail call void @__assert_fail(ptr noundef nonnull @.str.1, ptr noundef nonnull @.str.2, i32 noundef 81, ptr noundef nonnull @__PRETTY_FUNCTION__._ZN23TinyGLPrimitiveRendererC2Eii) #6
  unreachable

21:                                               ; preds = %3
  %22 = landingpad { ptr, i32 }
          cleanup
  tail call void @_ZdlPvm(ptr noundef nonnull %8, i64 noundef 655368) #7
  resume { ptr, i32 } %22

23:                                               ; preds = %9
  %24 = load ptr, ptr @glad_glGetUniformLocation, align 8, !tbaa !16
  %25 = load i32, ptr %17, align 4, !tbaa !17
  %26 = tail call i32 %24(i32 noundef %25, ptr noundef nonnull @.str.3)
  %27 = load ptr, ptr %7, align 8, !tbaa !14
  %28 = getelementptr inbounds i8, ptr %27, i64 8
  store i32 %26, ptr %28, align 4, !tbaa !20
  %29 = icmp slt i32 %26, 0
  br i1 %29, label %30, label %31

30:                                               ; preds = %23
  tail call void @__assert_fail(ptr noundef nonnull @.str.1, ptr noundef nonnull @.str.2, i32 noundef 86, ptr noundef nonnull @__PRETTY_FUNCTION__._ZN23TinyGLPrimitiveRendererC2Eii) #6
  unreachable

31:                                               ; preds = %23
  %32 = load ptr, ptr @glad_glGetUniformLocation, align 8, !tbaa !16
  %33 = load i32, ptr %27, align 4, !tbaa !17
  %34 = tail call i32 %32(i32 noundef %33, ptr noundef nonnull @.str.4)
  %35 = load ptr, ptr %7, align 8, !tbaa !14
  %36 = getelementptr inbounds i8, ptr %35, i64 12
  store i32 %34, ptr %36, align 4, !tbaa !21
  %37 = icmp slt i32 %34, 0
  br i1 %37, label %38, label %39

38:                                               ; preds = %31
  tail call void @__assert_fail(ptr noundef nonnull @.str.1, ptr noundef nonnull @.str.2, i32 noundef 90, ptr noundef nonnull @__PRETTY_FUNCTION__._ZN23TinyGLPrimitiveRendererC2Eii) #6
  unreachable

39:                                               ; preds = %31
  %40 = load ptr, ptr @glad_glGetAttribLocation, align 8, !tbaa !16
  %41 = load i32, ptr %35, align 4, !tbaa !17
  %42 = tail call i32 %40(i32 noundef %41, ptr noundef nonnull @.str.5)
  %43 = load ptr, ptr %7, align 8, !tbaa !14
  %44 = getelementptr inbounds i8, ptr %43, i64 16
  store i32 %42, ptr %44, align 4, !tbaa !22
  %45 = icmp slt i32 %42, 0
  br i1 %45, label %46, label %47

46:                                               ; preds = %39
  tail call void @__assert_fail(ptr noundef nonnull @.str.1, ptr noundef nonnull @.str.2, i32 noundef 95, ptr noundef nonnull @__PRETTY_FUNCTION__._ZN23TinyGLPrimitiveRendererC2Eii) #6
  unreachable

47:                                               ; preds = %39
  %48 = load ptr, ptr @glad_glGetAttribLocation, align 8, !tbaa !16
  %49 = load i32, ptr %43, align 4, !tbaa !17
  %50 = tail call i32 %48(i32 noundef %49, ptr noundef nonnull @.str.6)
  %51 = load ptr, ptr %7, align 8, !tbaa !14
  %52 = getelementptr inbounds i8, ptr %51, i64 20
  store i32 %50, ptr %52, align 4, !tbaa !23
  %53 = icmp slt i32 %50, 0
  br i1 %53, label %54, label %55

54:                                               ; preds = %47
  tail call void @__assert_fail(ptr noundef nonnull @.str.1, ptr noundef nonnull @.str.2, i32 noundef 100, ptr noundef nonnull @__PRETTY_FUNCTION__._ZN23TinyGLPrimitiveRendererC2Eii) #6
  unreachable

55:                                               ; preds = %47
  %56 = load ptr, ptr @glad_glGetAttribLocation, align 8, !tbaa !16
  %57 = load i32, ptr %51, align 4, !tbaa !17
  %58 = tail call i32 %56(i32 noundef %57, ptr noundef nonnull @.str.7)
  %59 = load ptr, ptr %7, align 8, !tbaa !14
  %60 = getelementptr inbounds i8, ptr %59, i64 24
  store i32 %58, ptr %60, align 4, !tbaa !24
  %61 = icmp slt i32 %58, 0
  br i1 %61, label %62, label %63

62:                                               ; preds = %55
  tail call void @__assert_fail(ptr noundef nonnull @.str.1, ptr noundef nonnull @.str.2, i32 noundef 105, ptr noundef nonnull @__PRETTY_FUNCTION__._ZN23TinyGLPrimitiveRendererC2Eii) #6
  unreachable

63:                                               ; preds = %55
  tail call void @_ZN23TinyGLPrimitiveRenderer16load_buffer_dataEv(ptr noundef nonnull align 8 dereferenceable(32) %0)
  ret void
}

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN17PrimInternalData2C2Ev(ptr noundef nonnull align 4 dereferenceable(655368)) unnamed_addr #0 align 2

declare i32 @__gxx_personality_v0(...)

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

declare i32 @gltLoadShaderPair(ptr noundef, ptr noundef) local_unnamed_addr #3

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN23TinyGLPrimitiveRenderer16load_buffer_dataEv(ptr noundef nonnull align 8 dereferenceable(32)) local_unnamed_addr #0 align 2

attributes #0 = { 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 #1 = { 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 #2 = { 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 #3 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { noreturn nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { builtin allocsize(0) }
attributes #6 = { noreturn nounwind }
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 = !{!"vtable pointer", !7, i64 0}
!7 = !{!"Simple C++ TBAA"}
!8 = !{!9, !10, i64 8}
!9 = !{!"_ZTS23TinyGLPrimitiveRenderer", !10, i64 8, !10, i64 12, !12, i64 16, !12, i64 24}
!10 = !{!"int", !11, i64 0}
!11 = !{!"omnipotent char", !7, i64 0}
!12 = !{!"any pointer", !11, i64 0}
!13 = !{!9, !10, i64 12}
!14 = !{!9, !12, i64 16}
!15 = !{!9, !12, i64 24}
!16 = !{!12, !12, i64 0}
!17 = !{!18, !10, i64 0}
!18 = !{!"_ZTS16PrimInternalData", !10, i64 0, !10, i64 4, !10, i64 8, !10, i64 12, !10, i64 16, !10, i64 20, !10, i64 24, !10, i64 28, !10, i64 32, !10, i64 36, !10, i64 40, !10, i64 44, !10, i64 48, !10, i64 52}
!19 = !{!18, !10, i64 4}
!20 = !{!18, !10, i64 8}
!21 = !{!18, !10, i64 12}
!22 = !{!18, !10, i64 16}
!23 = !{!18, !10, i64 20}
!24 = !{!18, !10, i64 24}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GlobalOptPass,InstCombinePass,SROAPass,SimplifyCFGPass,TailCallElimPass