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

; Unoptimized IR (clang -disable-llvm-passes):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%class.TinyGLInstancingRenderer = type <{ ptr, %"class.std::vector", ptr, i8, i8, [2 x i8], i32, i32, i32, i32, [4 x i8] }>
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<b3GraphicsInstance *, std::allocator<b3GraphicsInstance *>>::_Vector_impl" }
%"struct.std::_Vector_base<b3GraphicsInstance *, std::allocator<b3GraphicsInstance *>>::_Vector_impl" = type { %"struct.std::_Vector_base<b3GraphicsInstance *, std::allocator<b3GraphicsInstance *>>::_Vector_impl_data" }
%"struct.std::_Vector_base<b3GraphicsInstance *, std::allocator<b3GraphicsInstance *>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%struct.InternalDataRenderer = type <{ %struct.GLInstanceRendererInternalData.base, [4 x i8], %struct.TinyCamera, ptr, [16 x float], [16 x float], [16 x float], [16 x float], [16 x float], i8, [3 x i8], %"struct.TINY::TinyVector3", %"struct.TINY::TinyVector3", i32, %"class.std::vector.5", ptr, i32, i32, %class.TinyResizablePool, i32, i32, float, i8, [3 x i8] }>
%struct.GLInstanceRendererInternalData.base = type <{ %"class.std::vector.0", %"class.std::vector.0", %"class.std::vector.0", %"class.std::vector.0", i32, i32, i32, i32, i32 }>
%"class.std::vector.0" = type { %"struct.std::_Vector_base.1" }
%"struct.std::_Vector_base.1" = type { %"struct.std::_Vector_base<float, std::allocator<float>>::_Vector_impl" }
%"struct.std::_Vector_base<float, std::allocator<float>>::_Vector_impl" = type { %"struct.std::_Vector_base<float, std::allocator<float>>::_Vector_impl_data" }
%"struct.std::_Vector_base<float, std::allocator<float>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%struct.TinyCamera = type { ptr, ptr }
%"struct.TINY::TinyVector3" = type { float, float, float, i32 }
%"class.std::vector.5" = type { %"struct.std::_Vector_base.6" }
%"struct.std::_Vector_base.6" = type { %"struct.std::_Vector_base<InternalTextureHandle, std::allocator<InternalTextureHandle>>::_Vector_impl" }
%"struct.std::_Vector_base<InternalTextureHandle, std::allocator<InternalTextureHandle>>::_Vector_impl" = type { %"struct.std::_Vector_base<InternalTextureHandle, std::allocator<InternalTextureHandle>>::_Vector_impl_data" }
%"struct.std::_Vector_base<InternalTextureHandle, std::allocator<InternalTextureHandle>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%class.TinyResizablePool = type { ptr, %"class.std::vector.10", i32, i32 }
%"class.std::vector.10" = type { %"struct.std::_Vector_base.11" }
%"struct.std::_Vector_base.11" = type { %"struct.std::_Vector_base<TinyPoolBodyHandle<TinyPublicGraphicsInstanceData>, std::allocator<TinyPoolBodyHandle<TinyPublicGraphicsInstanceData>>>::_Vector_impl" }
%"struct.std::_Vector_base<TinyPoolBodyHandle<TinyPublicGraphicsInstanceData>, std::allocator<TinyPoolBodyHandle<TinyPublicGraphicsInstanceData>>>::_Vector_impl" = type { %"struct.std::_Vector_base<TinyPoolBodyHandle<TinyPublicGraphicsInstanceData>, std::allocator<TinyPoolBodyHandle<TinyPublicGraphicsInstanceData>>>::_Vector_impl_data" }
%"struct.std::_Vector_base<TinyPoolBodyHandle<TinyPublicGraphicsInstanceData>, std::allocator<TinyPoolBodyHandle<TinyPublicGraphicsInstanceData>>>::_Vector_impl_data" = type { ptr, ptr, ptr }

@lineVertexBufferObject = external dso_local global i32, align 4
@lineVertexArrayObject = external dso_local global i32, align 4
@.str.1 = external hidden unnamed_addr constant [130 x i8], align 1
@glad_glBindBuffer = external global ptr, align 8
@glad_glGetError = external global ptr, align 8
@.str.4 = external hidden unnamed_addr constant [28 x i8], align 1
@glad_glBufferSubData = external global ptr, align 8
@glad_glActiveTexture = external global ptr, align 8
@glad_glBindTexture = external global ptr, align 8
@glad_glBindVertexArray = external global ptr, align 8
@glad_glUseProgram = external global ptr, align 8
@_ZL11linesShader = external hidden global i32, align 4
@_ZL21lines_ModelViewMatrix = external hidden global i32, align 4
@_ZL22lines_ProjectionMatrix = external hidden global i32, align 4
@_ZL12lines_colour = external hidden global i32, align 4
@glad_glUniformMatrix4fv = external global ptr, align 8
@glad_glVertexAttribPointer = external global ptr, align 8
@glad_glEnableVertexAttribArray = external global ptr, align 8
@__PRETTY_FUNCTION__._ZN24TinyGLInstancingRenderer11draw_pointsEPKN4TINY11TinyVector3IfNS0_10FloatUtilsEEERS4_iif = external hidden unnamed_addr constant [112 x i8], align 1
@glad_glUniform4f = external global ptr, align 8
@glad_glPointSize = external global ptr, align 8
@glad_glDrawArrays = external global ptr, align 8

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

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZNK4TINY11TinyVector3IfNS_10FloatUtilsEEixEi(ptr noundef nonnull align 4 dereferenceable(16), i32 noundef) #2 align 2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN24TinyGLInstancingRenderer11draw_pointsEPKN4TINY11TinyVector3IfNS0_10FloatUtilsEEERS4_iif(ptr noundef nonnull align 8 dereferenceable(60) %0, ptr noundef %1, ptr noundef nonnull align 4 dereferenceable(16) %2, i32 noundef %3, i32 noundef %4, float noundef %5) unnamed_addr #3 align 2 {
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca ptr, align 8
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca float, align 4
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  %15 = alloca i32, align 4
  %16 = alloca i32, align 4
  %17 = alloca i32, align 4
  %18 = alloca i32, align 4
  store ptr %0, ptr %7, align 8, !tbaa !5
  store ptr %1, ptr %8, align 8, !tbaa !5
  store ptr %2, ptr %9, align 8, !tbaa !5
  store i32 %3, ptr %10, align 4, !tbaa !9
  store i32 %4, ptr %11, align 4, !tbaa !9
  store float %5, ptr %12, align 4, !tbaa !11
  %19 = load ptr, ptr %7, align 8
  %20 = load ptr, ptr @glad_glActiveTexture, align 8, !tbaa !5
  call void %20(i32 noundef 33984)
  %21 = load ptr, ptr @glad_glBindTexture, align 8, !tbaa !5
  call void %21(i32 noundef 3553, i32 noundef 0)
  %22 = load ptr, ptr @glad_glGetError, align 8, !tbaa !5
  %23 = call i32 %22()
  %24 = icmp eq i32 %23, 0
  br i1 %24, label %25, label %26

25:                                               ; preds = %6
  br label %28

26:                                               ; preds = %6
  call void @__assert_fail(ptr noundef @.str.4, ptr noundef @.str.1, i32 noundef 1852, ptr noundef @__PRETTY_FUNCTION__._ZN24TinyGLInstancingRenderer11draw_pointsEPKN4TINY11TinyVector3IfNS0_10FloatUtilsEEERS4_iif) #4
  unreachable

27:                                               ; No predecessors!
  br label %28

28:                                               ; preds = %27, %25
  %29 = load ptr, ptr @glad_glUseProgram, align 8, !tbaa !5
  %30 = load i32, ptr @_ZL11linesShader, align 4, !tbaa !9
  call void %29(i32 noundef %30)
  %31 = load ptr, ptr @glad_glUniformMatrix4fv, align 8, !tbaa !5
  %32 = load i32, ptr @_ZL22lines_ProjectionMatrix, align 4, !tbaa !9
  %33 = getelementptr inbounds %class.TinyGLInstancingRenderer, ptr %19, i32 0, i32 2
  %34 = load ptr, ptr %33, align 8, !tbaa !13
  %35 = getelementptr inbounds %struct.InternalDataRenderer, ptr %34, i32 0, i32 4
  %36 = getelementptr inbounds [16 x float], ptr %35, i64 0, i64 0
  call void %31(i32 noundef %32, i32 noundef 1, i8 noundef zeroext 0, ptr noundef %36)
  %37 = load ptr, ptr @glad_glUniformMatrix4fv, align 8, !tbaa !5
  %38 = load i32, ptr @_ZL21lines_ModelViewMatrix, align 4, !tbaa !9
  %39 = getelementptr inbounds %class.TinyGLInstancingRenderer, ptr %19, i32 0, i32 2
  %40 = load ptr, ptr %39, align 8, !tbaa !13
  %41 = getelementptr inbounds %struct.InternalDataRenderer, ptr %40, i32 0, i32 5
  %42 = getelementptr inbounds [16 x float], ptr %41, i64 0, i64 0
  call void %37(i32 noundef %38, i32 noundef 1, i8 noundef zeroext 0, ptr noundef %42)
  %43 = load ptr, ptr @glad_glUniform4f, align 8, !tbaa !5
  %44 = load i32, ptr @_ZL12lines_colour, align 4, !tbaa !9
  %45 = load ptr, ptr %9, align 8, !tbaa !5
  %46 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK4TINY11TinyVector3IfNS_10FloatUtilsEEixEi(ptr noundef nonnull align 4 dereferenceable(16) %45, i32 noundef 0)
  %47 = load float, ptr %46, align 4, !tbaa !11
  %48 = load ptr, ptr %9, align 8, !tbaa !5
  %49 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK4TINY11TinyVector3IfNS_10FloatUtilsEEixEi(ptr noundef nonnull align 4 dereferenceable(16) %48, i32 noundef 1)
  %50 = load float, ptr %49, align 4, !tbaa !11
  %51 = load ptr, ptr %9, align 8, !tbaa !5
  %52 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK4TINY11TinyVector3IfNS_10FloatUtilsEEixEi(ptr noundef nonnull align 4 dereferenceable(16) %51, i32 noundef 2)
  %53 = load float, ptr %52, align 4, !tbaa !11
  call void %43(i32 noundef %44, float noundef %47, float noundef %50, float noundef %53, float noundef 1.000000e+00)
  %54 = load ptr, ptr @glad_glPointSize, align 8, !tbaa !5
  %55 = load float, ptr %12, align 4, !tbaa !11
  call void %54(float noundef %55)
  %56 = load ptr, ptr @glad_glBindVertexArray, align 8, !tbaa !5
  %57 = load i32, ptr @lineVertexArrayObject, align 4, !tbaa !9
  call void %56(i32 noundef %57)
  %58 = load ptr, ptr @glad_glBindBuffer, align 8, !tbaa !5
  %59 = load i32, ptr @lineVertexBufferObject, align 4, !tbaa !9
  call void %58(i32 noundef 34962, i32 noundef %59)
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #5
  store i32 1024, ptr %13, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #5
  %60 = load i32, ptr %10, align 4, !tbaa !9
  store i32 %60, ptr %14, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #5
  store i32 0, ptr %15, align 4, !tbaa !9
  br label %61

61:                                               ; preds = %97, %28
  br label %62

62:                                               ; preds = %61
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #5
  %63 = call noundef nonnull align 4 dereferenceable(4) ptr @_Z7TinyMinIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %13, ptr noundef nonnull align 4 dereferenceable(4) %14)
  %64 = load i32, ptr %63, align 4, !tbaa !9
  store i32 %64, ptr %16, align 4, !tbaa !9
  %65 = load i32, ptr %16, align 4, !tbaa !9
  %66 = icmp ne i32 %65, 0
  br i1 %66, label %67, label %93

67:                                               ; preds = %62
  %68 = load ptr, ptr @glad_glBufferSubData, align 8, !tbaa !5
  %69 = load i32, ptr %16, align 4, !tbaa !9
  %70 = load i32, ptr %11, align 4, !tbaa !9
  %71 = mul nsw i32 %69, %70
  %72 = sext i32 %71 to i64
  %73 = load ptr, ptr %8, align 8, !tbaa !5
  %74 = load i32, ptr %15, align 4, !tbaa !9
  %75 = sext i32 %74 to i64
  %76 = load i32, ptr %11, align 4, !tbaa !9
  %77 = sext i32 %76 to i64
  %78 = udiv i64 %77, 4
  %79 = mul i64 %75, %78
  %80 = getelementptr inbounds %"struct.TINY::TinyVector3", ptr %73, i64 %79
  call void %68(i32 noundef 34962, i64 noundef 0, i64 noundef %72, ptr noundef %80)
  %81 = load ptr, ptr @glad_glEnableVertexAttribArray, align 8, !tbaa !5
  call void %81(i32 noundef 0)
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #5
  store i32 3, ptr %17, align 4, !tbaa !9
  %82 = load ptr, ptr @glad_glVertexAttribPointer, align 8, !tbaa !5
  %83 = load i32, ptr %17, align 4, !tbaa !9
  %84 = load i32, ptr %11, align 4, !tbaa !9
  call void %82(i32 noundef 0, i32 noundef %83, i32 noundef 5126, i8 noundef zeroext 0, i32 noundef %84, ptr noundef null)
  %85 = load ptr, ptr @glad_glDrawArrays, align 8, !tbaa !5
  %86 = load i32, ptr %16, align 4, !tbaa !9
  call void %85(i32 noundef 0, i32 noundef 0, i32 noundef %86)
  %87 = load i32, ptr %16, align 4, !tbaa !9
  %88 = load i32, ptr %14, align 4, !tbaa !9
  %89 = sub nsw i32 %88, %87
  store i32 %89, ptr %14, align 4, !tbaa !9
  %90 = load i32, ptr %16, align 4, !tbaa !9
  %91 = load i32, ptr %15, align 4, !tbaa !9
  %92 = add nsw i32 %91, %90
  store i32 %92, ptr %15, align 4, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #5
  br label %94

93:                                               ; preds = %62
  store i32 3, ptr %18, align 4
  br label %95

94:                                               ; preds = %67
  store i32 0, ptr %18, align 4
  br label %95

95:                                               ; preds = %94, %93
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #5
  %96 = load i32, ptr %18, align 4
  switch i32 %96, label %102 [
    i32 0, label %97
    i32 3, label %98
  ]

97:                                               ; preds = %95
  br label %61, !llvm.loop !20

98:                                               ; preds = %95
  %99 = load ptr, ptr @glad_glBindVertexArray, align 8, !tbaa !5
  call void %99(i32 noundef 0)
  %100 = load ptr, ptr @glad_glPointSize, align 8, !tbaa !5
  call void %100(float noundef 1.000000e+00)
  %101 = load ptr, ptr @glad_glUseProgram, align 8, !tbaa !5
  call void %101(i32 noundef 0)
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #5
  ret void

102:                                              ; preds = %95
  unreachable
}

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_Z7TinyMinIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) #2

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { noreturn nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { inlinehint 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 #3 = { 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 #4 = { noreturn nounwind }
attributes #5 = { 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 = !{!"float", !7, i64 0}
!13 = !{!14, !6, i64 32}
!14 = !{!"_ZTS24TinyGLInstancingRenderer", !15, i64 8, !6, i64 32, !19, i64 40, !19, i64 41, !10, i64 44, !10, i64 48, !10, i64 52, !10, i64 56}
!15 = !{!"_ZTSSt6vectorIP18b3GraphicsInstanceSaIS1_EE", !16, i64 0}
!16 = !{!"_ZTSSt12_Vector_baseIP18b3GraphicsInstanceSaIS1_EE", !17, i64 0}
!17 = !{!"_ZTSNSt12_Vector_baseIP18b3GraphicsInstanceSaIS1_EE12_Vector_implE", !18, i64 0}
!18 = !{!"_ZTSNSt12_Vector_baseIP18b3GraphicsInstanceSaIS1_EE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!19 = !{!"bool", !7, i64 0}
!20 = distinct !{!20, !21}
!21 = !{!"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"

%"struct.TINY::TinyVector3" = type { float, float, float, i32 }

@lineVertexBufferObject = external dso_local local_unnamed_addr global i32, align 4
@lineVertexArrayObject = external dso_local local_unnamed_addr global i32, align 4
@.str.1 = external hidden unnamed_addr constant [130 x i8], align 1
@glad_glBindBuffer = external local_unnamed_addr global ptr, align 8
@glad_glGetError = external local_unnamed_addr global ptr, align 8
@.str.4 = external hidden unnamed_addr constant [28 x i8], align 1
@glad_glBufferSubData = external local_unnamed_addr global ptr, align 8
@glad_glActiveTexture = external local_unnamed_addr global ptr, align 8
@glad_glBindTexture = external local_unnamed_addr global ptr, align 8
@glad_glBindVertexArray = external local_unnamed_addr global ptr, align 8
@glad_glUseProgram = external local_unnamed_addr global ptr, align 8
@_ZL11linesShader = external hidden local_unnamed_addr global i32, align 4
@_ZL21lines_ModelViewMatrix = external hidden local_unnamed_addr global i32, align 4
@_ZL22lines_ProjectionMatrix = external hidden local_unnamed_addr global i32, align 4
@_ZL12lines_colour = external hidden local_unnamed_addr global i32, align 4
@glad_glUniformMatrix4fv = external local_unnamed_addr global ptr, align 8
@glad_glVertexAttribPointer = external local_unnamed_addr global ptr, align 8
@glad_glEnableVertexAttribArray = external local_unnamed_addr global ptr, align 8
@__PRETTY_FUNCTION__._ZN24TinyGLInstancingRenderer11draw_pointsEPKN4TINY11TinyVector3IfNS0_10FloatUtilsEEERS4_iif = external hidden unnamed_addr constant [112 x i8], align 1
@glad_glUniform4f = external local_unnamed_addr global ptr, align 8
@glad_glPointSize = external local_unnamed_addr global ptr, align 8
@glad_glDrawArrays = external local_unnamed_addr global ptr, align 8

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

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZNK4TINY11TinyVector3IfNS_10FloatUtilsEEixEi(ptr noundef nonnull align 4 dereferenceable(16), i32 noundef) local_unnamed_addr #2 align 2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN24TinyGLInstancingRenderer11draw_pointsEPKN4TINY11TinyVector3IfNS0_10FloatUtilsEEERS4_iif(ptr nocapture noundef nonnull readonly align 8 dereferenceable(60) %0, ptr noundef %1, ptr noundef nonnull align 4 dereferenceable(16) %2, i32 noundef %3, i32 noundef %4, float noundef %5) unnamed_addr #3 align 2 {
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = load ptr, ptr @glad_glActiveTexture, align 8, !tbaa !5
  tail call void %9(i32 noundef 33984)
  %10 = load ptr, ptr @glad_glBindTexture, align 8, !tbaa !5
  tail call void %10(i32 noundef 3553, i32 noundef 0)
  %11 = load ptr, ptr @glad_glGetError, align 8, !tbaa !5
  %12 = tail call i32 %11()
  %13 = icmp eq i32 %12, 0
  br i1 %13, label %15, label %14

14:                                               ; preds = %6
  tail call void @__assert_fail(ptr noundef nonnull @.str.4, ptr noundef nonnull @.str.1, i32 noundef 1852, ptr noundef nonnull @__PRETTY_FUNCTION__._ZN24TinyGLInstancingRenderer11draw_pointsEPKN4TINY11TinyVector3IfNS0_10FloatUtilsEEERS4_iif) #4
  unreachable

15:                                               ; preds = %6
  %16 = load ptr, ptr @glad_glUseProgram, align 8, !tbaa !5
  %17 = load i32, ptr @_ZL11linesShader, align 4, !tbaa !9
  tail call void %16(i32 noundef %17)
  %18 = load ptr, ptr @glad_glUniformMatrix4fv, align 8, !tbaa !5
  %19 = load i32, ptr @_ZL22lines_ProjectionMatrix, align 4, !tbaa !9
  %20 = getelementptr inbounds i8, ptr %0, i64 32
  %21 = load ptr, ptr %20, align 8, !tbaa !11
  %22 = getelementptr inbounds i8, ptr %21, i64 144
  tail call void %18(i32 noundef %19, i32 noundef 1, i8 noundef zeroext 0, ptr noundef nonnull %22)
  %23 = load ptr, ptr @glad_glUniformMatrix4fv, align 8, !tbaa !5
  %24 = load i32, ptr @_ZL21lines_ModelViewMatrix, align 4, !tbaa !9
  %25 = load ptr, ptr %20, align 8, !tbaa !11
  %26 = getelementptr inbounds i8, ptr %25, i64 208
  tail call void %23(i32 noundef %24, i32 noundef 1, i8 noundef zeroext 0, ptr noundef nonnull %26)
  %27 = load ptr, ptr @glad_glUniform4f, align 8, !tbaa !5
  %28 = load i32, ptr @_ZL12lines_colour, align 4, !tbaa !9
  %29 = tail call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK4TINY11TinyVector3IfNS_10FloatUtilsEEixEi(ptr noundef nonnull align 4 dereferenceable(16) %2, i32 noundef 0)
  %30 = load float, ptr %29, align 4, !tbaa !18
  %31 = tail call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK4TINY11TinyVector3IfNS_10FloatUtilsEEixEi(ptr noundef nonnull align 4 dereferenceable(16) %2, i32 noundef 1)
  %32 = load float, ptr %31, align 4, !tbaa !18
  %33 = tail call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK4TINY11TinyVector3IfNS_10FloatUtilsEEixEi(ptr noundef nonnull align 4 dereferenceable(16) %2, i32 noundef 2)
  %34 = load float, ptr %33, align 4, !tbaa !18
  tail call void %27(i32 noundef %28, float noundef %30, float noundef %32, float noundef %34, float noundef 1.000000e+00)
  %35 = load ptr, ptr @glad_glPointSize, align 8, !tbaa !5
  tail call void %35(float noundef %5)
  %36 = load ptr, ptr @glad_glBindVertexArray, align 8, !tbaa !5
  %37 = load i32, ptr @lineVertexArrayObject, align 4, !tbaa !9
  tail call void %36(i32 noundef %37)
  %38 = load ptr, ptr @glad_glBindBuffer, align 8, !tbaa !5
  %39 = load i32, ptr @lineVertexBufferObject, align 4, !tbaa !9
  tail call void %38(i32 noundef 34962, i32 noundef %39)
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %7) #5
  store i32 1024, ptr %7, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %8) #5
  store i32 %3, ptr %8, align 4, !tbaa !9
  %40 = call noundef nonnull align 4 dereferenceable(4) ptr @_Z7TinyMinIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %7, ptr noundef nonnull align 4 dereferenceable(4) %8)
  %41 = load i32, ptr %40, align 4, !tbaa !9
  %.not23 = icmp eq i32 %41, 0
  br i1 %.not23, label %._crit_edge, label %.lr.ph

.lr.ph:                                           ; preds = %15
  %42 = sext i32 %4 to i64
  %43 = lshr i64 %42, 2
  br label %44

44:                                               ; preds = %.lr.ph, %44
  %45 = phi i32 [ %41, %.lr.ph ], [ %59, %44 ]
  %.01824 = phi i32 [ 0, %.lr.ph ], [ %57, %44 ]
  %46 = load ptr, ptr @glad_glBufferSubData, align 8, !tbaa !5
  %47 = mul nsw i32 %45, %4
  %48 = sext i32 %47 to i64
  %49 = sext i32 %.01824 to i64
  %50 = mul i64 %43, %49
  %51 = getelementptr inbounds %"struct.TINY::TinyVector3", ptr %1, i64 %50
  call void %46(i32 noundef 34962, i64 noundef 0, i64 noundef %48, ptr noundef %51)
  %52 = load ptr, ptr @glad_glEnableVertexAttribArray, align 8, !tbaa !5
  call void %52(i32 noundef 0)
  %53 = load ptr, ptr @glad_glVertexAttribPointer, align 8, !tbaa !5
  call void %53(i32 noundef 0, i32 noundef 3, i32 noundef 5126, i8 noundef zeroext 0, i32 noundef %4, ptr noundef null)
  %54 = load ptr, ptr @glad_glDrawArrays, align 8, !tbaa !5
  call void %54(i32 noundef 0, i32 noundef 0, i32 noundef %45)
  %55 = load i32, ptr %8, align 4, !tbaa !9
  %56 = sub nsw i32 %55, %45
  store i32 %56, ptr %8, align 4, !tbaa !9
  %57 = add nsw i32 %45, %.01824
  %58 = call noundef nonnull align 4 dereferenceable(4) ptr @_Z7TinyMinIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %7, ptr noundef nonnull align 4 dereferenceable(4) %8)
  %59 = load i32, ptr %58, align 4, !tbaa !9
  %.not = icmp eq i32 %59, 0
  br i1 %.not, label %._crit_edge, label %44

._crit_edge:                                      ; preds = %44, %15
  %60 = load ptr, ptr @glad_glBindVertexArray, align 8, !tbaa !5
  call void %60(i32 noundef 0)
  %61 = load ptr, ptr @glad_glPointSize, align 8, !tbaa !5
  call void %61(float noundef 1.000000e+00)
  %62 = load ptr, ptr @glad_glUseProgram, align 8, !tbaa !5
  call void %62(i32 noundef 0)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %8) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %7) #5
  ret void
}

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_Z7TinyMinIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #2

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { noreturn nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { inlinehint 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 #3 = { 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 #4 = { noreturn nounwind }
attributes #5 = { 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, !6, i64 32}
!12 = !{!"_ZTS24TinyGLInstancingRenderer", !13, i64 8, !6, i64 32, !17, i64 40, !17, i64 41, !10, i64 44, !10, i64 48, !10, i64 52, !10, i64 56}
!13 = !{!"_ZTSSt6vectorIP18b3GraphicsInstanceSaIS1_EE", !14, i64 0}
!14 = !{!"_ZTSSt12_Vector_baseIP18b3GraphicsInstanceSaIS1_EE", !15, i64 0}
!15 = !{!"_ZTSNSt12_Vector_baseIP18b3GraphicsInstanceSaIS1_EE12_Vector_implE", !16, i64 0}
!16 = !{!"_ZTSNSt12_Vector_baseIP18b3GraphicsInstanceSaIS1_EE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!17 = !{!"bool", !7, i64 0}
!18 = !{!19, !19, i64 0}
!19 = !{!"float", !7, i64 0}


; Effective O3 passes: EarlyCSEPass,GlobalOptPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LICMPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,PostOrderFunctionAttrsPass,ReassociatePass,SROAPass,SimplifyCFGPass,TailCallElimPass