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

@lineWidthRange = external dso_local global [2 x i32], align 4
@linesVertexBufferObject = external dso_local global i32, align 4
@linesVertexArrayObject = external dso_local global i32, align 4
@linesIndexVbo = 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_glBufferData = 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
@glad_glDrawElements = external global ptr, align 8
@glad_glUniform4f = external global ptr, align 8
@glad_glPointSize = external global ptr, align 8
@glad_glLineWidth = external global ptr, align 8
@__PRETTY_FUNCTION__._ZN24TinyGLInstancingRenderer10draw_linesEPKN4TINY11TinyVector3IfNS0_10FloatUtilsEEERS4_iiPKjif = external hidden unnamed_addr constant [138 x i8], align 1

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

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN24TinyGLInstancingRenderer10draw_linesEPKN4TINY11TinyVector3IfNS0_10FloatUtilsEEERS4_iiPKjif(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, ptr noundef %5, i32 noundef %6, float noundef %7) unnamed_addr #2 align 2 {
  %9 = alloca ptr, align 8
  %10 = alloca ptr, align 8
  %11 = alloca ptr, align 8
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca ptr, align 8
  %15 = alloca i32, align 4
  %16 = alloca float, align 4
  %17 = alloca float, align 4
  %18 = alloca float, align 4
  %19 = alloca float, align 4
  %20 = alloca i32, align 4
  %21 = alloca i32, align 4
  store ptr %0, ptr %9, align 8, !tbaa !5
  store ptr %1, ptr %10, align 8, !tbaa !5
  store ptr %2, ptr %11, align 8, !tbaa !5
  store i32 %3, ptr %12, align 4, !tbaa !9
  store i32 %4, ptr %13, align 4, !tbaa !9
  store ptr %5, ptr %14, align 8, !tbaa !5
  store i32 %6, ptr %15, align 4, !tbaa !9
  store float %7, ptr %16, align 4, !tbaa !11
  %22 = load ptr, ptr %9, align 8
  %23 = load ptr, ptr @glad_glActiveTexture, align 8, !tbaa !5
  call void %23(i32 noundef 33984)
  %24 = load ptr, ptr @glad_glBindTexture, align 8, !tbaa !5
  call void %24(i32 noundef 3553, i32 noundef 0)
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #5
  %25 = load float, ptr %16, align 4, !tbaa !11
  store float %25, ptr %17, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #5
  %26 = load i32, ptr @lineWidthRange, align 4, !tbaa !9
  %27 = sitofp i32 %26 to float
  store float %27, ptr %18, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #5
  %28 = load i32, ptr getelementptr inbounds ([2 x i32], ptr @lineWidthRange, i64 0, i64 1), align 4, !tbaa !9
  %29 = sitofp i32 %28 to float
  store float %29, ptr %19, align 4, !tbaa !11
  call void @_Z9TinyClampIfEvRT_RKS0_S3_(ptr noundef nonnull align 4 dereferenceable(4) %17, ptr noundef nonnull align 4 dereferenceable(4) %18, ptr noundef nonnull align 4 dereferenceable(4) %19)
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #5
  %30 = load ptr, ptr @glad_glLineWidth, align 8, !tbaa !5
  %31 = load float, ptr %17, align 4, !tbaa !11
  call void %30(float noundef %31)
  %32 = load ptr, ptr @glad_glBindBuffer, align 8, !tbaa !5
  call void %32(i32 noundef 34963, i32 noundef 0)
  %33 = load ptr, ptr @glad_glActiveTexture, align 8, !tbaa !5
  call void %33(i32 noundef 33984)
  %34 = load ptr, ptr @glad_glBindTexture, align 8, !tbaa !5
  call void %34(i32 noundef 3553, i32 noundef 0)
  %35 = load ptr, ptr @glad_glGetError, align 8, !tbaa !5
  %36 = call i32 %35()
  %37 = icmp eq i32 %36, 0
  br i1 %37, label %38, label %39

38:                                               ; preds = %8
  br label %41

39:                                               ; preds = %8
  call void @__assert_fail(ptr noundef @.str.4, ptr noundef @.str.1, i32 noundef 1907, ptr noundef @__PRETTY_FUNCTION__._ZN24TinyGLInstancingRenderer10draw_linesEPKN4TINY11TinyVector3IfNS0_10FloatUtilsEEERS4_iiPKjif) #6
  unreachable

40:                                               ; No predecessors!
  br label %41

41:                                               ; preds = %40, %38
  %42 = load ptr, ptr @glad_glUseProgram, align 8, !tbaa !5
  %43 = load i32, ptr @_ZL11linesShader, align 4, !tbaa !9
  call void %42(i32 noundef %43)
  %44 = load ptr, ptr @glad_glUniformMatrix4fv, align 8, !tbaa !5
  %45 = load i32, ptr @_ZL22lines_ProjectionMatrix, align 4, !tbaa !9
  %46 = getelementptr inbounds %class.TinyGLInstancingRenderer, ptr %22, i32 0, i32 2
  %47 = load ptr, ptr %46, align 8, !tbaa !13
  %48 = getelementptr inbounds %struct.InternalDataRenderer, ptr %47, i32 0, i32 4
  %49 = getelementptr inbounds [16 x float], ptr %48, i64 0, i64 0
  call void %44(i32 noundef %45, i32 noundef 1, i8 noundef zeroext 0, ptr noundef %49)
  %50 = load ptr, ptr @glad_glUniformMatrix4fv, align 8, !tbaa !5
  %51 = load i32, ptr @_ZL21lines_ModelViewMatrix, align 4, !tbaa !9
  %52 = getelementptr inbounds %class.TinyGLInstancingRenderer, ptr %22, i32 0, i32 2
  %53 = load ptr, ptr %52, align 8, !tbaa !13
  %54 = getelementptr inbounds %struct.InternalDataRenderer, ptr %53, i32 0, i32 5
  %55 = getelementptr inbounds [16 x float], ptr %54, i64 0, i64 0
  call void %50(i32 noundef %51, i32 noundef 1, i8 noundef zeroext 0, ptr noundef %55)
  %56 = load ptr, ptr @glad_glUniform4f, align 8, !tbaa !5
  %57 = load i32, ptr @_ZL12lines_colour, align 4, !tbaa !9
  %58 = load ptr, ptr %11, align 8, !tbaa !5
  %59 = call noundef float @_ZNK4TINY11TinyVector3IfNS_10FloatUtilsEE1xEv(ptr noundef nonnull align 4 dereferenceable(16) %58)
  %60 = load ptr, ptr %11, align 8, !tbaa !5
  %61 = call noundef float @_ZNK4TINY11TinyVector3IfNS_10FloatUtilsEE1yEv(ptr noundef nonnull align 4 dereferenceable(16) %60)
  %62 = load ptr, ptr %11, align 8, !tbaa !5
  %63 = call noundef float @_ZNK4TINY11TinyVector3IfNS_10FloatUtilsEE1zEv(ptr noundef nonnull align 4 dereferenceable(16) %62)
  call void %56(i32 noundef %57, float noundef %59, float noundef %61, float noundef %63, float noundef 1.000000e+00)
  %64 = load ptr, ptr @glad_glBindVertexArray, align 8, !tbaa !5
  %65 = load i32, ptr @linesVertexArrayObject, align 4, !tbaa !9
  call void %64(i32 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 = %41
  br label %72

70:                                               ; preds = %41
  call void @__assert_fail(ptr noundef @.str.4, ptr noundef @.str.1, i32 noundef 1917, ptr noundef @__PRETTY_FUNCTION__._ZN24TinyGLInstancingRenderer10draw_linesEPKN4TINY11TinyVector3IfNS0_10FloatUtilsEEERS4_iiPKjif) #6
  unreachable

71:                                               ; No predecessors!
  br label %72

72:                                               ; preds = %71, %69
  %73 = load ptr, ptr @glad_glBindBuffer, align 8, !tbaa !5
  %74 = load i32, ptr @linesVertexBufferObject, align 4, !tbaa !9
  call void %73(i32 noundef 34962, i32 noundef %74)
  %75 = load ptr, ptr @glad_glBufferData, align 8, !tbaa !5
  %76 = load i32, ptr %12, align 4, !tbaa !9
  %77 = load i32, ptr %13, align 4, !tbaa !9
  %78 = mul nsw i32 %76, %77
  %79 = sext i32 %78 to i64
  call void %75(i32 noundef 34962, i64 noundef %79, ptr noundef null, i32 noundef 35048)
  %80 = load ptr, ptr @glad_glBufferSubData, align 8, !tbaa !5
  %81 = load i32, ptr %12, align 4, !tbaa !9
  %82 = load i32, ptr %13, align 4, !tbaa !9
  %83 = mul nsw i32 %81, %82
  %84 = sext i32 %83 to i64
  %85 = load ptr, ptr %10, align 8, !tbaa !5
  call void %80(i32 noundef 34962, i64 noundef 0, i64 noundef %84, ptr noundef %85)
  %86 = load ptr, ptr @glad_glGetError, align 8, !tbaa !5
  %87 = call i32 %86()
  %88 = icmp eq i32 %87, 0
  br i1 %88, label %89, label %90

89:                                               ; preds = %72
  br label %92

90:                                               ; preds = %72
  call void @__assert_fail(ptr noundef @.str.4, ptr noundef @.str.1, i32 noundef 1926, ptr noundef @__PRETTY_FUNCTION__._ZN24TinyGLInstancingRenderer10draw_linesEPKN4TINY11TinyVector3IfNS0_10FloatUtilsEEERS4_iiPKjif) #6
  unreachable

91:                                               ; No predecessors!
  br label %92

92:                                               ; preds = %91, %89
  %93 = load ptr, ptr @glad_glBindBuffer, align 8, !tbaa !5
  call void %93(i32 noundef 34962, i32 noundef 0)
  %94 = load ptr, ptr @glad_glBindBuffer, align 8, !tbaa !5
  %95 = load i32, ptr @linesVertexBufferObject, align 4, !tbaa !9
  call void %94(i32 noundef 34962, i32 noundef %95)
  %96 = load ptr, ptr @glad_glEnableVertexAttribArray, align 8, !tbaa !5
  call void %96(i32 noundef 0)
  %97 = load ptr, ptr @glad_glGetError, align 8, !tbaa !5
  %98 = call i32 %97()
  %99 = icmp eq i32 %98, 0
  br i1 %99, label %100, label %101

100:                                              ; preds = %92
  br label %103

101:                                              ; preds = %92
  call void @__assert_fail(ptr noundef @.str.4, ptr noundef @.str.1, i32 noundef 1931, ptr noundef @__PRETTY_FUNCTION__._ZN24TinyGLInstancingRenderer10draw_linesEPKN4TINY11TinyVector3IfNS0_10FloatUtilsEEERS4_iiPKjif) #6
  unreachable

102:                                              ; No predecessors!
  br label %103

103:                                              ; preds = %102, %100
  call void @llvm.lifetime.start.p0(i64 4, ptr %20) #5
  store i32 3, ptr %20, align 4, !tbaa !9
  %104 = load ptr, ptr @glad_glVertexAttribPointer, align 8, !tbaa !5
  %105 = load i32, ptr %20, align 4, !tbaa !9
  %106 = load i32, ptr %13, align 4, !tbaa !9
  call void %104(i32 noundef 0, i32 noundef %105, i32 noundef 5126, i8 noundef zeroext 0, i32 noundef %106, ptr noundef null)
  %107 = load ptr, ptr @glad_glGetError, align 8, !tbaa !5
  %108 = call i32 %107()
  %109 = icmp eq i32 %108, 0
  br i1 %109, label %110, label %111

110:                                              ; preds = %103
  br label %113

111:                                              ; preds = %103
  call void @__assert_fail(ptr noundef @.str.4, ptr noundef @.str.1, i32 noundef 1935, ptr noundef @__PRETTY_FUNCTION__._ZN24TinyGLInstancingRenderer10draw_linesEPKN4TINY11TinyVector3IfNS0_10FloatUtilsEEERS4_iiPKjif) #6
  unreachable

112:                                              ; No predecessors!
  br label %113

113:                                              ; preds = %112, %110
  %114 = load ptr, ptr @glad_glBindBuffer, align 8, !tbaa !5
  %115 = load i32, ptr @linesIndexVbo, align 4, !tbaa !9
  call void %114(i32 noundef 34963, i32 noundef %115)
  call void @llvm.lifetime.start.p0(i64 4, ptr %21) #5
  %116 = load i32, ptr %15, align 4, !tbaa !9
  %117 = sext i32 %116 to i64
  %118 = mul i64 %117, 4
  %119 = trunc i64 %118 to i32
  store i32 %119, ptr %21, align 4, !tbaa !9
  %120 = load ptr, ptr @glad_glBufferData, align 8, !tbaa !5
  %121 = load i32, ptr %21, align 4, !tbaa !9
  %122 = sext i32 %121 to i64
  call void %120(i32 noundef 34963, i64 noundef %122, ptr noundef null, i32 noundef 35048)
  %123 = load ptr, ptr @glad_glBufferSubData, align 8, !tbaa !5
  %124 = load i32, ptr %21, align 4, !tbaa !9
  %125 = sext i32 %124 to i64
  %126 = load ptr, ptr %14, align 8, !tbaa !5
  call void %123(i32 noundef 34963, i64 noundef 0, i64 noundef %125, ptr noundef %126)
  %127 = load ptr, ptr @glad_glDrawElements, align 8, !tbaa !5
  %128 = load i32, ptr %15, align 4, !tbaa !9
  call void %127(i32 noundef 1, i32 noundef %128, i32 noundef 5125, ptr noundef null)
  call void @llvm.lifetime.end.p0(i64 4, ptr %21) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #5
  %129 = load ptr, ptr @glad_glBindBuffer, align 8, !tbaa !5
  call void %129(i32 noundef 34963, i32 noundef 0)
  %130 = load ptr, ptr @glad_glBindBuffer, align 8, !tbaa !5
  call void %130(i32 noundef 34962, i32 noundef 0)
  %131 = load ptr, ptr @glad_glGetError, align 8, !tbaa !5
  %132 = call i32 %131()
  %133 = icmp eq i32 %132, 0
  br i1 %133, label %134, label %135

134:                                              ; preds = %113
  br label %137

135:                                              ; preds = %113
  call void @__assert_fail(ptr noundef @.str.4, ptr noundef @.str.1, i32 noundef 1952, ptr noundef @__PRETTY_FUNCTION__._ZN24TinyGLInstancingRenderer10draw_linesEPKN4TINY11TinyVector3IfNS0_10FloatUtilsEEERS4_iiPKjif) #6
  unreachable

136:                                              ; No predecessors!
  br label %137

137:                                              ; preds = %136, %134
  %138 = load ptr, ptr @glad_glBindVertexArray, align 8, !tbaa !5
  call void %138(i32 noundef 0)
  %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 = %137
  br label %145

143:                                              ; preds = %137
  call void @__assert_fail(ptr noundef @.str.4, ptr noundef @.str.1, i32 noundef 1954, ptr noundef @__PRETTY_FUNCTION__._ZN24TinyGLInstancingRenderer10draw_linesEPKN4TINY11TinyVector3IfNS0_10FloatUtilsEEERS4_iiPKjif) #6
  unreachable

144:                                              ; No predecessors!
  br label %145

145:                                              ; preds = %144, %142
  %146 = load ptr, ptr @glad_glPointSize, align 8, !tbaa !5
  call void %146(float noundef 1.000000e+00)
  %147 = load ptr, ptr @glad_glGetError, align 8, !tbaa !5
  %148 = call i32 %147()
  %149 = icmp eq i32 %148, 0
  br i1 %149, label %150, label %151

150:                                              ; preds = %145
  br label %153

151:                                              ; preds = %145
  call void @__assert_fail(ptr noundef @.str.4, ptr noundef @.str.1, i32 noundef 1956, ptr noundef @__PRETTY_FUNCTION__._ZN24TinyGLInstancingRenderer10draw_linesEPKN4TINY11TinyVector3IfNS0_10FloatUtilsEEERS4_iiPKjif) #6
  unreachable

152:                                              ; No predecessors!
  br label %153

153:                                              ; preds = %152, %150
  %154 = load ptr, ptr @glad_glUseProgram, align 8, !tbaa !5
  call void %154(i32 noundef 0)
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #5
  ret void
}

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef float @_ZNK4TINY11TinyVector3IfNS_10FloatUtilsEE1xEv(ptr noundef nonnull align 4 dereferenceable(16)) #4 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef float @_ZNK4TINY11TinyVector3IfNS_10FloatUtilsEE1yEv(ptr noundef nonnull align 4 dereferenceable(16)) #4 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef float @_ZNK4TINY11TinyVector3IfNS_10FloatUtilsEE1zEv(ptr noundef nonnull align 4 dereferenceable(16)) #4 align 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 = { 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 = { 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 #4 = { 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 #5 = { nounwind }
attributes #6 = { noreturn 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}


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

@lineWidthRange = external dso_local local_unnamed_addr global [2 x i32], align 4
@linesVertexBufferObject = external dso_local local_unnamed_addr global i32, align 4
@linesVertexArrayObject = external dso_local local_unnamed_addr global i32, align 4
@linesIndexVbo = 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_glBufferData = 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
@glad_glDrawElements = external local_unnamed_addr global ptr, align 8
@glad_glUniform4f = external local_unnamed_addr global ptr, align 8
@glad_glPointSize = external local_unnamed_addr global ptr, align 8
@glad_glLineWidth = external local_unnamed_addr global ptr, align 8
@__PRETTY_FUNCTION__._ZN24TinyGLInstancingRenderer10draw_linesEPKN4TINY11TinyVector3IfNS0_10FloatUtilsEEERS4_iiPKjif = external hidden unnamed_addr constant [138 x i8], align 1

; 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: mustprogress uwtable
define dso_local void @_ZN24TinyGLInstancingRenderer10draw_linesEPKN4TINY11TinyVector3IfNS0_10FloatUtilsEEERS4_iiPKjif(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, ptr noundef %5, i32 noundef %6, float noundef %7) unnamed_addr #2 align 2 {
  %9 = alloca float, align 4
  %10 = alloca float, align 4
  %11 = alloca float, align 4
  %12 = load ptr, ptr @glad_glActiveTexture, align 8, !tbaa !5
  tail call void %12(i32 noundef 33984)
  %13 = load ptr, ptr @glad_glBindTexture, align 8, !tbaa !5
  tail call void %13(i32 noundef 3553, i32 noundef 0)
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %9) #5
  store float %7, ptr %9, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %10) #5
  %14 = load i32, ptr @lineWidthRange, align 4, !tbaa !11
  %15 = sitofp i32 %14 to float
  store float %15, ptr %10, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %11) #5
  %16 = load i32, ptr getelementptr inbounds (i8, ptr @lineWidthRange, i64 4), align 4, !tbaa !11
  %17 = sitofp i32 %16 to float
  store float %17, ptr %11, align 4, !tbaa !9
  call void @_Z9TinyClampIfEvRT_RKS0_S3_(ptr noundef nonnull align 4 dereferenceable(4) %9, ptr noundef nonnull align 4 dereferenceable(4) %10, ptr noundef nonnull align 4 dereferenceable(4) %11)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %11) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %10) #5
  %18 = load ptr, ptr @glad_glLineWidth, align 8, !tbaa !5
  %19 = load float, ptr %9, align 4, !tbaa !9
  call void %18(float noundef %19)
  %20 = load ptr, ptr @glad_glBindBuffer, align 8, !tbaa !5
  call void %20(i32 noundef 34963, i32 noundef 0)
  %21 = load ptr, ptr @glad_glActiveTexture, align 8, !tbaa !5
  call void %21(i32 noundef 33984)
  %22 = load ptr, ptr @glad_glBindTexture, align 8, !tbaa !5
  call void %22(i32 noundef 3553, i32 noundef 0)
  %23 = load ptr, ptr @glad_glGetError, align 8, !tbaa !5
  %24 = call i32 %23()
  %25 = icmp eq i32 %24, 0
  br i1 %25, label %27, label %26

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

27:                                               ; preds = %8
  %28 = load ptr, ptr @glad_glUseProgram, align 8, !tbaa !5
  %29 = load i32, ptr @_ZL11linesShader, align 4, !tbaa !11
  call void %28(i32 noundef %29)
  %30 = load ptr, ptr @glad_glUniformMatrix4fv, align 8, !tbaa !5
  %31 = load i32, ptr @_ZL22lines_ProjectionMatrix, align 4, !tbaa !11
  %32 = getelementptr inbounds i8, ptr %0, i64 32
  %33 = load ptr, ptr %32, align 8, !tbaa !13
  %34 = getelementptr inbounds i8, ptr %33, i64 144
  call void %30(i32 noundef %31, i32 noundef 1, i8 noundef zeroext 0, ptr noundef nonnull %34)
  %35 = load ptr, ptr @glad_glUniformMatrix4fv, align 8, !tbaa !5
  %36 = load i32, ptr @_ZL21lines_ModelViewMatrix, align 4, !tbaa !11
  %37 = load ptr, ptr %32, align 8, !tbaa !13
  %38 = getelementptr inbounds i8, ptr %37, i64 208
  call void %35(i32 noundef %36, i32 noundef 1, i8 noundef zeroext 0, ptr noundef nonnull %38)
  %39 = load ptr, ptr @glad_glUniform4f, align 8, !tbaa !5
  %40 = load i32, ptr @_ZL12lines_colour, align 4, !tbaa !11
  %41 = call noundef float @_ZNK4TINY11TinyVector3IfNS_10FloatUtilsEE1xEv(ptr noundef nonnull align 4 dereferenceable(16) %2)
  %42 = call noundef float @_ZNK4TINY11TinyVector3IfNS_10FloatUtilsEE1yEv(ptr noundef nonnull align 4 dereferenceable(16) %2)
  %43 = call noundef float @_ZNK4TINY11TinyVector3IfNS_10FloatUtilsEE1zEv(ptr noundef nonnull align 4 dereferenceable(16) %2)
  call void %39(i32 noundef %40, float noundef %41, float noundef %42, float noundef %43, float noundef 1.000000e+00)
  %44 = load ptr, ptr @glad_glBindVertexArray, align 8, !tbaa !5
  %45 = load i32, ptr @linesVertexArrayObject, align 4, !tbaa !11
  call void %44(i32 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 %50, label %49

49:                                               ; preds = %27
  call void @__assert_fail(ptr noundef nonnull @.str.4, ptr noundef nonnull @.str.1, i32 noundef 1917, ptr noundef nonnull @__PRETTY_FUNCTION__._ZN24TinyGLInstancingRenderer10draw_linesEPKN4TINY11TinyVector3IfNS0_10FloatUtilsEEERS4_iiPKjif) #6
  unreachable

50:                                               ; preds = %27
  %51 = load ptr, ptr @glad_glBindBuffer, align 8, !tbaa !5
  %52 = load i32, ptr @linesVertexBufferObject, align 4, !tbaa !11
  call void %51(i32 noundef 34962, i32 noundef %52)
  %53 = load ptr, ptr @glad_glBufferData, align 8, !tbaa !5
  %54 = mul nsw i32 %4, %3
  %55 = sext i32 %54 to i64
  call void %53(i32 noundef 34962, i64 noundef %55, ptr noundef null, i32 noundef 35048)
  %56 = load ptr, ptr @glad_glBufferSubData, align 8, !tbaa !5
  call void %56(i32 noundef 34962, i64 noundef 0, i64 noundef %55, ptr noundef %1)
  %57 = load ptr, ptr @glad_glGetError, align 8, !tbaa !5
  %58 = call i32 %57()
  %59 = icmp eq i32 %58, 0
  br i1 %59, label %61, label %60

60:                                               ; preds = %50
  call void @__assert_fail(ptr noundef nonnull @.str.4, ptr noundef nonnull @.str.1, i32 noundef 1926, ptr noundef nonnull @__PRETTY_FUNCTION__._ZN24TinyGLInstancingRenderer10draw_linesEPKN4TINY11TinyVector3IfNS0_10FloatUtilsEEERS4_iiPKjif) #6
  unreachable

61:                                               ; preds = %50
  %62 = load ptr, ptr @glad_glBindBuffer, align 8, !tbaa !5
  call void %62(i32 noundef 34962, i32 noundef 0)
  %63 = load ptr, ptr @glad_glBindBuffer, align 8, !tbaa !5
  %64 = load i32, ptr @linesVertexBufferObject, align 4, !tbaa !11
  call void %63(i32 noundef 34962, i32 noundef %64)
  %65 = load ptr, ptr @glad_glEnableVertexAttribArray, align 8, !tbaa !5
  call void %65(i32 noundef 0)
  %66 = load ptr, ptr @glad_glGetError, align 8, !tbaa !5
  %67 = call i32 %66()
  %68 = icmp eq i32 %67, 0
  br i1 %68, label %70, label %69

69:                                               ; preds = %61
  call void @__assert_fail(ptr noundef nonnull @.str.4, ptr noundef nonnull @.str.1, i32 noundef 1931, ptr noundef nonnull @__PRETTY_FUNCTION__._ZN24TinyGLInstancingRenderer10draw_linesEPKN4TINY11TinyVector3IfNS0_10FloatUtilsEEERS4_iiPKjif) #6
  unreachable

70:                                               ; preds = %61
  %71 = load ptr, ptr @glad_glVertexAttribPointer, align 8, !tbaa !5
  call void %71(i32 noundef 0, i32 noundef 3, i32 noundef 5126, i8 noundef zeroext 0, i32 noundef %4, ptr noundef null)
  %72 = load ptr, ptr @glad_glGetError, align 8, !tbaa !5
  %73 = call i32 %72()
  %74 = icmp eq i32 %73, 0
  br i1 %74, label %76, label %75

75:                                               ; preds = %70
  call void @__assert_fail(ptr noundef nonnull @.str.4, ptr noundef nonnull @.str.1, i32 noundef 1935, ptr noundef nonnull @__PRETTY_FUNCTION__._ZN24TinyGLInstancingRenderer10draw_linesEPKN4TINY11TinyVector3IfNS0_10FloatUtilsEEERS4_iiPKjif) #6
  unreachable

76:                                               ; preds = %70
  %77 = load ptr, ptr @glad_glBindBuffer, align 8, !tbaa !5
  %78 = load i32, ptr @linesIndexVbo, align 4, !tbaa !11
  call void %77(i32 noundef 34963, i32 noundef %78)
  %79 = shl i32 %6, 2
  %80 = load ptr, ptr @glad_glBufferData, align 8, !tbaa !5
  %81 = sext i32 %79 to i64
  call void %80(i32 noundef 34963, i64 noundef %81, ptr noundef null, i32 noundef 35048)
  %82 = load ptr, ptr @glad_glBufferSubData, align 8, !tbaa !5
  call void %82(i32 noundef 34963, i64 noundef 0, i64 noundef %81, ptr noundef %5)
  %83 = load ptr, ptr @glad_glDrawElements, align 8, !tbaa !5
  call void %83(i32 noundef 1, i32 noundef %6, i32 noundef 5125, ptr noundef null)
  %84 = load ptr, ptr @glad_glBindBuffer, align 8, !tbaa !5
  call void %84(i32 noundef 34963, i32 noundef 0)
  %85 = load ptr, ptr @glad_glBindBuffer, align 8, !tbaa !5
  call void %85(i32 noundef 34962, i32 noundef 0)
  %86 = load ptr, ptr @glad_glGetError, align 8, !tbaa !5
  %87 = call i32 %86()
  %88 = icmp eq i32 %87, 0
  br i1 %88, label %90, label %89

89:                                               ; preds = %76
  call void @__assert_fail(ptr noundef nonnull @.str.4, ptr noundef nonnull @.str.1, i32 noundef 1952, ptr noundef nonnull @__PRETTY_FUNCTION__._ZN24TinyGLInstancingRenderer10draw_linesEPKN4TINY11TinyVector3IfNS0_10FloatUtilsEEERS4_iiPKjif) #6
  unreachable

90:                                               ; preds = %76
  %91 = load ptr, ptr @glad_glBindVertexArray, align 8, !tbaa !5
  call void %91(i32 noundef 0)
  %92 = load ptr, ptr @glad_glGetError, align 8, !tbaa !5
  %93 = call i32 %92()
  %94 = icmp eq i32 %93, 0
  br i1 %94, label %96, label %95

95:                                               ; preds = %90
  call void @__assert_fail(ptr noundef nonnull @.str.4, ptr noundef nonnull @.str.1, i32 noundef 1954, ptr noundef nonnull @__PRETTY_FUNCTION__._ZN24TinyGLInstancingRenderer10draw_linesEPKN4TINY11TinyVector3IfNS0_10FloatUtilsEEERS4_iiPKjif) #6
  unreachable

96:                                               ; preds = %90
  %97 = load ptr, ptr @glad_glPointSize, align 8, !tbaa !5
  call void %97(float noundef 1.000000e+00)
  %98 = load ptr, ptr @glad_glGetError, align 8, !tbaa !5
  %99 = call i32 %98()
  %100 = icmp eq i32 %99, 0
  br i1 %100, label %102, label %101

101:                                              ; preds = %96
  call void @__assert_fail(ptr noundef nonnull @.str.4, ptr noundef nonnull @.str.1, i32 noundef 1956, ptr noundef nonnull @__PRETTY_FUNCTION__._ZN24TinyGLInstancingRenderer10draw_linesEPKN4TINY11TinyVector3IfNS0_10FloatUtilsEEERS4_iiPKjif) #6
  unreachable

102:                                              ; preds = %96
  %103 = load ptr, ptr @glad_glUseProgram, align 8, !tbaa !5
  call void %103(i32 noundef 0)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %9) #5
  ret void
}

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef float @_ZNK4TINY11TinyVector3IfNS_10FloatUtilsEE1xEv(ptr noundef nonnull align 4 dereferenceable(16)) local_unnamed_addr #4 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef float @_ZNK4TINY11TinyVector3IfNS_10FloatUtilsEE1yEv(ptr noundef nonnull align 4 dereferenceable(16)) local_unnamed_addr #4 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef float @_ZNK4TINY11TinyVector3IfNS_10FloatUtilsEE1zEv(ptr noundef nonnull align 4 dereferenceable(16)) local_unnamed_addr #4 align 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 = { 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 = { 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 #4 = { 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 #5 = { nounwind }
attributes #6 = { noreturn 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 = !{!"float", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"int", !7, i64 0}
!13 = !{!14, !6, i64 32}
!14 = !{!"_ZTS24TinyGLInstancingRenderer", !15, i64 8, !6, i64 32, !19, i64 40, !19, i64 41, !12, i64 44, !12, i64 48, !12, i64 52, !12, 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}


; Effective O3 passes: EarlyCSEPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,PostOrderFunctionAttrsPass,ReassociatePass,SROAPass,SimplifyCFGPass,TailCallElimPass