; 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.GLInstanceRendererInternalData = type <{ %"class.std::vector.0", %"class.std::vector.0", %"class.std::vector.0", %"class.std::vector.0", i32, i32, i32, i32, i32, [4 x i8] }>
%"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.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 }>
%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 }
%struct.TinyPublicGraphicsInstanceData = type { i32, i32, [4 x float], [4 x float], [4 x float], [4 x float] }
%struct.b3GraphicsInstance = type <{ i32, i32, i32, i32, i32, i32, %"class.std::vector.15", i32, i32, i32, float, %"struct.TINY::TinyVector3", i32, [4 x i8] }>
%"class.std::vector.15" = type { %"struct.std::_Vector_base.16" }
%"struct.std::_Vector_base.16" = type { %"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl" = type { %"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" = type { ptr, ptr, ptr }

@.str = external hidden unnamed_addr constant [3 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [130 x i8], align 1
@glad_glBindBuffer = external global ptr, align 8
@__PRETTY_FUNCTION__._ZN24TinyGLInstancingRenderer38write_single_instance_transform_to_gpuEPfS0_i = external hidden unnamed_addr constant [101 x i8], align 1
@glad_glMapBuffer = external global ptr, align 8
@glad_glUnmapBuffer = 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: mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZNKSt6vectorIP18b3GraphicsInstanceSaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24)) #1 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIP18b3GraphicsInstanceSaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) #1 align 2

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef ptr @_ZN17TinyResizablePoolI18TinyPoolBodyHandleI30TinyPublicGraphicsInstanceDataEE10get_handleEi(ptr noundef nonnull align 8 dereferenceable(40), i32 noundef) #2 align 2

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN24TinyGLInstancingRenderer38write_single_instance_transform_to_gpuEPfS0_i(ptr noundef nonnull align 8 dereferenceable(60) %0, ptr noundef %1, ptr noundef %2, i32 noundef %3) unnamed_addr #2 align 2 {
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca i32, align 4
  %9 = alloca ptr, align 8
  %10 = alloca i32, align 4
  %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 ptr, align 8
  %17 = alloca ptr, align 8
  %18 = alloca ptr, align 8
  store ptr %0, ptr %5, align 8, !tbaa !5
  store ptr %1, ptr %6, align 8, !tbaa !5
  store ptr %2, ptr %7, align 8, !tbaa !5
  store i32 %3, ptr %8, align 4, !tbaa !9
  %19 = load ptr, ptr %5, align 8
  %20 = load ptr, ptr @glad_glBindBuffer, align 8, !tbaa !5
  %21 = getelementptr inbounds %class.TinyGLInstancingRenderer, ptr %19, i32 0, i32 2
  %22 = load ptr, ptr %21, align 8, !tbaa !11
  %23 = getelementptr inbounds %struct.GLInstanceRendererInternalData, ptr %22, i32 0, i32 5
  %24 = load i32, ptr %23, align 4, !tbaa !18
  call void %20(i32 noundef 34962, i32 noundef %24)
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #4
  %25 = getelementptr inbounds %class.TinyGLInstancingRenderer, ptr %19, i32 0, i32 2
  %26 = load ptr, ptr %25, align 8, !tbaa !11
  %27 = getelementptr inbounds %struct.InternalDataRenderer, ptr %26, i32 0, i32 18
  %28 = load i32, ptr %8, align 4, !tbaa !9
  %29 = call noundef ptr @_ZN17TinyResizablePoolI18TinyPoolBodyHandleI30TinyPublicGraphicsInstanceDataEE10get_handleEi(ptr noundef nonnull align 8 dereferenceable(40) %27, i32 noundef %28)
  store ptr %29, ptr %9, align 8, !tbaa !5
  %30 = load ptr, ptr %9, align 8, !tbaa !5
  %31 = icmp ne ptr %30, null
  br i1 %31, label %32, label %33

32:                                               ; preds = %4
  br label %35

33:                                               ; preds = %4
  call void @__assert_fail(ptr noundef @.str, ptr noundef @.str.1, i32 noundef 622, ptr noundef @__PRETTY_FUNCTION__._ZN24TinyGLInstancingRenderer38write_single_instance_transform_to_gpuEPfS0_i) #5
  unreachable

34:                                               ; No predecessors!
  br label %35

35:                                               ; preds = %34, %32
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #4
  %36 = load ptr, ptr %9, align 8, !tbaa !5
  %37 = getelementptr inbounds %struct.TinyPublicGraphicsInstanceData, ptr %36, i32 0, i32 1
  %38 = load i32, ptr %37, align 4, !tbaa !24
  store i32 %38, ptr %10, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #4
  %39 = load ptr, ptr @glad_glMapBuffer, align 8, !tbaa !5
  %40 = call ptr %39(i32 noundef 34962, i32 noundef 35002)
  store ptr %40, ptr %11, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #4
  store i32 0, ptr %12, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #4
  store i32 0, ptr %13, align 4, !tbaa !9
  br label %41

41:                                               ; preds = %59, %35
  %42 = load i32, ptr %13, align 4, !tbaa !9
  %43 = sext i32 %42 to i64
  %44 = getelementptr inbounds %class.TinyGLInstancingRenderer, ptr %19, i32 0, i32 1
  %45 = call noundef i64 @_ZNKSt6vectorIP18b3GraphicsInstanceSaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %44) #4
  %46 = icmp ult i64 %43, %45
  br i1 %46, label %48, label %47

47:                                               ; preds = %41
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #4
  br label %62

48:                                               ; preds = %41
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #4
  %49 = getelementptr inbounds %class.TinyGLInstancingRenderer, ptr %19, i32 0, i32 1
  %50 = load i32, ptr %13, align 4, !tbaa !9
  %51 = sext i32 %50 to i64
  %52 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIP18b3GraphicsInstanceSaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %49, i64 noundef %51) #4
  %53 = load ptr, ptr %52, align 8, !tbaa !5
  store ptr %53, ptr %14, align 8, !tbaa !5
  %54 = load ptr, ptr %14, align 8, !tbaa !5
  %55 = getelementptr inbounds %struct.b3GraphicsInstance, ptr %54, i32 0, i32 5
  %56 = load i32, ptr %55, align 4, !tbaa !26
  %57 = load i32, ptr %12, align 4, !tbaa !9
  %58 = add nsw i32 %57, %56
  store i32 %58, ptr %12, align 4, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #4
  br label %59

59:                                               ; preds = %48
  %60 = load i32, ptr %13, align 4, !tbaa !9
  %61 = add nsw i32 %60, 1
  store i32 %61, ptr %13, align 4, !tbaa !9
  br label %41, !llvm.loop !34

62:                                               ; preds = %47
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #4
  %63 = load i32, ptr %12, align 4, !tbaa !9
  %64 = sext i32 %63 to i64
  %65 = mul i64 %64, 4
  %66 = mul i64 %65, 4
  %67 = trunc i64 %66 to i32
  store i32 %67, ptr %15, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #4
  %68 = load ptr, ptr %11, align 8, !tbaa !5
  store ptr %68, ptr %16, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #4
  %69 = load ptr, ptr %16, align 8, !tbaa !5
  %70 = getelementptr inbounds %class.TinyGLInstancingRenderer, ptr %19, i32 0, i32 2
  %71 = load ptr, ptr %70, align 8, !tbaa !11
  %72 = getelementptr inbounds %struct.GLInstanceRendererInternalData, ptr %71, i32 0, i32 8
  %73 = load i32, ptr %72, align 8, !tbaa !36
  %74 = sext i32 %73 to i64
  %75 = getelementptr inbounds i8, ptr %69, i64 %74
  store ptr %75, ptr %17, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #4
  %76 = load ptr, ptr %16, align 8, !tbaa !5
  %77 = getelementptr inbounds %class.TinyGLInstancingRenderer, ptr %19, i32 0, i32 2
  %78 = load ptr, ptr %77, align 8, !tbaa !11
  %79 = getelementptr inbounds %struct.GLInstanceRendererInternalData, ptr %78, i32 0, i32 8
  %80 = load i32, ptr %79, align 8, !tbaa !36
  %81 = sext i32 %80 to i64
  %82 = getelementptr inbounds i8, ptr %76, i64 %81
  %83 = load i32, ptr %15, align 4, !tbaa !9
  %84 = sext i32 %83 to i64
  %85 = getelementptr inbounds i8, ptr %82, i64 %84
  store ptr %85, ptr %18, align 8, !tbaa !5
  %86 = load ptr, ptr %6, align 8, !tbaa !5
  %87 = getelementptr inbounds float, ptr %86, i64 0
  %88 = load float, ptr %87, align 4, !tbaa !37
  %89 = load ptr, ptr %17, align 8, !tbaa !5
  %90 = load i32, ptr %10, align 4, !tbaa !9
  %91 = mul nsw i32 %90, 4
  %92 = sext i32 %91 to i64
  %93 = getelementptr inbounds float, ptr %89, i64 %92
  store float %88, ptr %93, align 4, !tbaa !37
  %94 = load ptr, ptr %6, align 8, !tbaa !5
  %95 = getelementptr inbounds float, ptr %94, i64 1
  %96 = load float, ptr %95, align 4, !tbaa !37
  %97 = load ptr, ptr %17, align 8, !tbaa !5
  %98 = load i32, ptr %10, align 4, !tbaa !9
  %99 = mul nsw i32 %98, 4
  %100 = add nsw i32 %99, 1
  %101 = sext i32 %100 to i64
  %102 = getelementptr inbounds float, ptr %97, i64 %101
  store float %96, ptr %102, align 4, !tbaa !37
  %103 = load ptr, ptr %6, align 8, !tbaa !5
  %104 = getelementptr inbounds float, ptr %103, i64 2
  %105 = load float, ptr %104, align 4, !tbaa !37
  %106 = load ptr, ptr %17, align 8, !tbaa !5
  %107 = load i32, ptr %10, align 4, !tbaa !9
  %108 = mul nsw i32 %107, 4
  %109 = add nsw i32 %108, 2
  %110 = sext i32 %109 to i64
  %111 = getelementptr inbounds float, ptr %106, i64 %110
  store float %105, ptr %111, align 4, !tbaa !37
  %112 = load ptr, ptr %6, align 8, !tbaa !5
  %113 = getelementptr inbounds float, ptr %112, i64 3
  %114 = load float, ptr %113, align 4, !tbaa !37
  %115 = load ptr, ptr %17, align 8, !tbaa !5
  %116 = load i32, ptr %10, align 4, !tbaa !9
  %117 = mul nsw i32 %116, 4
  %118 = add nsw i32 %117, 3
  %119 = sext i32 %118 to i64
  %120 = getelementptr inbounds float, ptr %115, i64 %119
  store float %114, ptr %120, align 4, !tbaa !37
  %121 = load ptr, ptr %7, align 8, !tbaa !5
  %122 = getelementptr inbounds float, ptr %121, i64 0
  %123 = load float, ptr %122, align 4, !tbaa !37
  %124 = load ptr, ptr %18, align 8, !tbaa !5
  %125 = load i32, ptr %10, align 4, !tbaa !9
  %126 = mul nsw i32 %125, 4
  %127 = sext i32 %126 to i64
  %128 = getelementptr inbounds float, ptr %124, i64 %127
  store float %123, ptr %128, align 4, !tbaa !37
  %129 = load ptr, ptr %7, align 8, !tbaa !5
  %130 = getelementptr inbounds float, ptr %129, i64 1
  %131 = load float, ptr %130, align 4, !tbaa !37
  %132 = load ptr, ptr %18, align 8, !tbaa !5
  %133 = load i32, ptr %10, align 4, !tbaa !9
  %134 = mul nsw i32 %133, 4
  %135 = add nsw i32 %134, 1
  %136 = sext i32 %135 to i64
  %137 = getelementptr inbounds float, ptr %132, i64 %136
  store float %131, ptr %137, align 4, !tbaa !37
  %138 = load ptr, ptr %7, align 8, !tbaa !5
  %139 = getelementptr inbounds float, ptr %138, i64 2
  %140 = load float, ptr %139, align 4, !tbaa !37
  %141 = load ptr, ptr %18, align 8, !tbaa !5
  %142 = load i32, ptr %10, align 4, !tbaa !9
  %143 = mul nsw i32 %142, 4
  %144 = add nsw i32 %143, 2
  %145 = sext i32 %144 to i64
  %146 = getelementptr inbounds float, ptr %141, i64 %145
  store float %140, ptr %146, align 4, !tbaa !37
  %147 = load ptr, ptr %7, align 8, !tbaa !5
  %148 = getelementptr inbounds float, ptr %147, i64 3
  %149 = load float, ptr %148, align 4, !tbaa !37
  %150 = load ptr, ptr %18, align 8, !tbaa !5
  %151 = load i32, ptr %10, align 4, !tbaa !9
  %152 = mul nsw i32 %151, 4
  %153 = add nsw i32 %152, 3
  %154 = sext i32 %153 to i64
  %155 = getelementptr inbounds float, ptr %150, i64 %154
  store float %149, ptr %155, align 4, !tbaa !37
  %156 = load ptr, ptr @glad_glUnmapBuffer, align 8, !tbaa !5
  %157 = call zeroext i8 %156(i32 noundef 34962)
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #4
  ret void
}

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #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 = { 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 #4 = { nounwind }
attributes #5 = { 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, !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, !10, i64 100}
!19 = !{!"_ZTS30GLInstanceRendererInternalData", !20, i64 0, !20, i64 24, !20, i64 48, !20, i64 72, !10, i64 96, !10, i64 100, !10, i64 104, !10, i64 108, !10, i64 112}
!20 = !{!"_ZTSSt6vectorIfSaIfEE", !21, i64 0}
!21 = !{!"_ZTSSt12_Vector_baseIfSaIfEE", !22, i64 0}
!22 = !{!"_ZTSNSt12_Vector_baseIfSaIfEE12_Vector_implE", !23, i64 0}
!23 = !{!"_ZTSNSt12_Vector_baseIfSaIfEE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!24 = !{!25, !10, i64 4}
!25 = !{!"_ZTS30TinyPublicGraphicsInstanceData", !10, i64 0, !10, i64 4, !7, i64 8, !7, i64 24, !7, i64 40, !7, i64 56}
!26 = !{!27, !10, i64 20}
!27 = !{!"_ZTS18b3GraphicsInstance", !10, i64 0, !10, i64 4, !10, i64 8, !10, i64 12, !10, i64 16, !10, i64 20, !28, i64 24, !10, i64 48, !10, i64 52, !10, i64 56, !32, i64 60, !33, i64 64, !10, i64 80}
!28 = !{!"_ZTSSt6vectorIiSaIiEE", !29, i64 0}
!29 = !{!"_ZTSSt12_Vector_baseIiSaIiEE", !30, i64 0}
!30 = !{!"_ZTSNSt12_Vector_baseIiSaIiEE12_Vector_implE", !31, i64 0}
!31 = !{!"_ZTSNSt12_Vector_baseIiSaIiEE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!32 = !{!"float", !7, i64 0}
!33 = !{!"_ZTSN4TINY11TinyVector3IfNS_10FloatUtilsEEE", !32, i64 0, !32, i64 4, !32, i64 8, !10, i64 12}
!34 = distinct !{!34, !35}
!35 = !{!"llvm.loop.mustprogress"}
!36 = !{!19, !10, i64 112}
!37 = !{!32, !32, 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"

@.str = external hidden unnamed_addr constant [3 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [130 x i8], align 1
@glad_glBindBuffer = external local_unnamed_addr global ptr, align 8
@__PRETTY_FUNCTION__._ZN24TinyGLInstancingRenderer38write_single_instance_transform_to_gpuEPfS0_i = external hidden unnamed_addr constant [101 x i8], align 1
@glad_glMapBuffer = external local_unnamed_addr global ptr, align 8
@glad_glUnmapBuffer = external local_unnamed_addr global ptr, align 8

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZNKSt6vectorIP18b3GraphicsInstanceSaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #0 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIP18b3GraphicsInstanceSaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) local_unnamed_addr #0 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef ptr @_ZN17TinyResizablePoolI18TinyPoolBodyHandleI30TinyPublicGraphicsInstanceDataEE10get_handleEi(ptr noundef nonnull align 8 dereferenceable(40), i32 noundef) local_unnamed_addr #1 align 2

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN24TinyGLInstancingRenderer38write_single_instance_transform_to_gpuEPfS0_i(ptr noundef nonnull align 8 dereferenceable(60) %0, ptr nocapture noundef readonly %1, ptr nocapture noundef readonly %2, i32 noundef %3) unnamed_addr #1 align 2 {
  %5 = load ptr, ptr @glad_glBindBuffer, align 8, !tbaa !5
  %6 = getelementptr inbounds i8, ptr %0, i64 32
  %7 = load ptr, ptr %6, align 8, !tbaa !9
  %8 = getelementptr inbounds i8, ptr %7, i64 100
  %9 = load i32, ptr %8, align 4, !tbaa !17
  tail call void %5(i32 noundef 34962, i32 noundef %9)
  %10 = load ptr, ptr %6, align 8, !tbaa !9
  %11 = getelementptr inbounds i8, ptr %10, i64 544
  %12 = tail call noundef ptr @_ZN17TinyResizablePoolI18TinyPoolBodyHandleI30TinyPublicGraphicsInstanceDataEE10get_handleEi(ptr noundef nonnull align 8 dereferenceable(40) %11, i32 noundef %3)
  %.not = icmp eq ptr %12, null
  br i1 %.not, label %13, label %14

13:                                               ; preds = %4
  tail call void @__assert_fail(ptr noundef nonnull @.str, ptr noundef nonnull @.str.1, i32 noundef 622, ptr noundef nonnull @__PRETTY_FUNCTION__._ZN24TinyGLInstancingRenderer38write_single_instance_transform_to_gpuEPfS0_i) #3
  unreachable

14:                                               ; preds = %4
  %15 = getelementptr inbounds i8, ptr %12, i64 4
  %16 = load i32, ptr %15, align 4, !tbaa !23
  %17 = load ptr, ptr @glad_glMapBuffer, align 8, !tbaa !5
  %18 = tail call ptr %17(i32 noundef 34962, i32 noundef 35002)
  %19 = getelementptr inbounds i8, ptr %0, i64 8
  %20 = tail call noundef i64 @_ZNKSt6vectorIP18b3GraphicsInstanceSaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %19) #4
  %.not42 = icmp eq i64 %20, 0
  br i1 %.not42, label %._crit_edge, label %.lr.ph

._crit_edge.loopexit:                             ; preds = %.lr.ph
  %21 = shl i32 %65, 4
  %22 = sext i32 %21 to i64
  br label %._crit_edge

._crit_edge:                                      ; preds = %._crit_edge.loopexit, %14
  %.0.lcssa = phi i64 [ 0, %14 ], [ %22, %._crit_edge.loopexit ]
  %23 = load ptr, ptr %6, align 8, !tbaa !9
  %24 = getelementptr inbounds i8, ptr %23, i64 112
  %25 = load i32, ptr %24, align 8, !tbaa !25
  %26 = sext i32 %25 to i64
  %27 = getelementptr inbounds i8, ptr %18, i64 %26
  %28 = getelementptr inbounds i8, ptr %27, i64 %.0.lcssa
  %29 = load float, ptr %1, align 4, !tbaa !26
  %30 = shl nsw i32 %16, 2
  %31 = sext i32 %30 to i64
  %32 = getelementptr inbounds float, ptr %27, i64 %31
  store float %29, ptr %32, align 4, !tbaa !26
  %33 = getelementptr inbounds i8, ptr %1, i64 4
  %34 = load float, ptr %33, align 4, !tbaa !26
  %35 = or disjoint i32 %30, 1
  %36 = sext i32 %35 to i64
  %37 = getelementptr inbounds float, ptr %27, i64 %36
  store float %34, ptr %37, align 4, !tbaa !26
  %38 = getelementptr inbounds i8, ptr %1, i64 8
  %39 = load float, ptr %38, align 4, !tbaa !26
  %40 = or disjoint i32 %30, 2
  %41 = sext i32 %40 to i64
  %42 = getelementptr inbounds float, ptr %27, i64 %41
  store float %39, ptr %42, align 4, !tbaa !26
  %43 = getelementptr inbounds i8, ptr %1, i64 12
  %44 = load float, ptr %43, align 4, !tbaa !26
  %45 = or disjoint i32 %30, 3
  %46 = sext i32 %45 to i64
  %47 = getelementptr inbounds float, ptr %27, i64 %46
  store float %44, ptr %47, align 4, !tbaa !26
  %48 = load float, ptr %2, align 4, !tbaa !26
  %49 = getelementptr inbounds float, ptr %28, i64 %31
  store float %48, ptr %49, align 4, !tbaa !26
  %50 = getelementptr inbounds i8, ptr %2, i64 4
  %51 = load float, ptr %50, align 4, !tbaa !26
  %52 = getelementptr inbounds float, ptr %28, i64 %36
  store float %51, ptr %52, align 4, !tbaa !26
  %53 = getelementptr inbounds i8, ptr %2, i64 8
  %54 = load float, ptr %53, align 4, !tbaa !26
  %55 = getelementptr inbounds float, ptr %28, i64 %41
  store float %54, ptr %55, align 4, !tbaa !26
  %56 = getelementptr inbounds i8, ptr %2, i64 12
  %57 = load float, ptr %56, align 4, !tbaa !26
  %58 = getelementptr inbounds float, ptr %28, i64 %46
  store float %57, ptr %58, align 4, !tbaa !26
  %59 = load ptr, ptr @glad_glUnmapBuffer, align 8, !tbaa !5
  %60 = tail call zeroext i8 %59(i32 noundef 34962)
  ret void

.lr.ph:                                           ; preds = %14, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ 0, %14 ]
  %.041 = phi i32 [ %65, %.lr.ph ], [ 0, %14 ]
  %61 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIP18b3GraphicsInstanceSaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %19, i64 noundef %indvars.iv) #4
  %62 = load ptr, ptr %61, align 8, !tbaa !5
  %63 = getelementptr inbounds i8, ptr %62, i64 20
  %64 = load i32, ptr %63, align 4, !tbaa !28
  %65 = add nsw i32 %64, %.041
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %66 = tail call noundef i64 @_ZNKSt6vectorIP18b3GraphicsInstanceSaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %19) #4
  %67 = icmp ugt i64 %66, %indvars.iv.next
  br i1 %67, label %.lr.ph, label %._crit_edge.loopexit, !llvm.loop !35
}

attributes #0 = { 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 #1 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { 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 #3 = { noreturn nounwind }
attributes #4 = { nounwind }

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !6, i64 32}
!10 = !{!"_ZTS24TinyGLInstancingRenderer", !11, i64 8, !6, i64 32, !15, i64 40, !15, i64 41, !16, i64 44, !16, i64 48, !16, i64 52, !16, i64 56}
!11 = !{!"_ZTSSt6vectorIP18b3GraphicsInstanceSaIS1_EE", !12, i64 0}
!12 = !{!"_ZTSSt12_Vector_baseIP18b3GraphicsInstanceSaIS1_EE", !13, i64 0}
!13 = !{!"_ZTSNSt12_Vector_baseIP18b3GraphicsInstanceSaIS1_EE12_Vector_implE", !14, i64 0}
!14 = !{!"_ZTSNSt12_Vector_baseIP18b3GraphicsInstanceSaIS1_EE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!15 = !{!"bool", !7, i64 0}
!16 = !{!"int", !7, i64 0}
!17 = !{!18, !16, i64 100}
!18 = !{!"_ZTS30GLInstanceRendererInternalData", !19, i64 0, !19, i64 24, !19, i64 48, !19, i64 72, !16, i64 96, !16, i64 100, !16, i64 104, !16, i64 108, !16, i64 112}
!19 = !{!"_ZTSSt6vectorIfSaIfEE", !20, i64 0}
!20 = !{!"_ZTSSt12_Vector_baseIfSaIfEE", !21, i64 0}
!21 = !{!"_ZTSNSt12_Vector_baseIfSaIfEE12_Vector_implE", !22, i64 0}
!22 = !{!"_ZTSNSt12_Vector_baseIfSaIfEE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!23 = !{!24, !16, i64 4}
!24 = !{!"_ZTS30TinyPublicGraphicsInstanceData", !16, i64 0, !16, i64 4, !7, i64 8, !7, i64 24, !7, i64 40, !7, i64 56}
!25 = !{!18, !16, i64 112}
!26 = !{!27, !27, i64 0}
!27 = !{!"float", !7, i64 0}
!28 = !{!29, !16, i64 20}
!29 = !{!"_ZTS18b3GraphicsInstance", !16, i64 0, !16, i64 4, !16, i64 8, !16, i64 12, !16, i64 16, !16, i64 20, !30, i64 24, !16, i64 48, !16, i64 52, !16, i64 56, !27, i64 60, !34, i64 64, !16, i64 80}
!30 = !{!"_ZTSSt6vectorIiSaIiEE", !31, i64 0}
!31 = !{!"_ZTSSt12_Vector_baseIiSaIiEE", !32, i64 0}
!32 = !{!"_ZTSNSt12_Vector_baseIiSaIiEE12_Vector_implE", !33, i64 0}
!33 = !{!"_ZTSNSt12_Vector_baseIiSaIiEE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!34 = !{!"_ZTSN4TINY11TinyVector3IfNS_10FloatUtilsEEE", !27, i64 0, !27, i64 4, !27, i64 8, !16, i64 12}
!35 = distinct !{!35, !36}
!36 = !{!"llvm.loop.mustprogress"}


; Effective O3 passes: EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,LCSSAPass,LICMPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,PostOrderFunctionAttrsPass,ReassociatePass,SROAPass,SimplifyCFGPass,TailCallElimPass