; 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 }
%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
@__PRETTY_FUNCTION__._ZN24TinyGLInstancingRenderer43write_single_instance_specular_color_to_cpuEPKdi = external hidden unnamed_addr constant [104 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: 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 @_ZN24TinyGLInstancingRenderer43write_single_instance_specular_color_to_cpuEPKdi(ptr noundef nonnull align 8 dereferenceable(60) %0, ptr noundef %1, i32 noundef %2) unnamed_addr #2 align 2 {
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca i32, align 4
  %7 = alloca ptr, align 8
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  store ptr %0, ptr %4, align 8, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !5
  store i32 %2, ptr %6, align 4, !tbaa !9
  %13 = load ptr, ptr %4, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #5
  %14 = getelementptr inbounds %class.TinyGLInstancingRenderer, ptr %13, i32 0, i32 2
  %15 = load ptr, ptr %14, align 8, !tbaa !11
  %16 = getelementptr inbounds %struct.InternalDataRenderer, ptr %15, i32 0, i32 18
  %17 = load i32, ptr %6, align 4, !tbaa !9
  %18 = call noundef ptr @_ZN17TinyResizablePoolI18TinyPoolBodyHandleI30TinyPublicGraphicsInstanceDataEE10get_handleEi(ptr noundef nonnull align 8 dereferenceable(40) %16, i32 noundef %17)
  store ptr %18, ptr %7, align 8, !tbaa !5
  %19 = load ptr, ptr %7, align 8, !tbaa !5
  %20 = icmp ne ptr %19, null
  br i1 %20, label %21, label %22

21:                                               ; preds = %3
  br label %24

22:                                               ; preds = %3
  call void @__assert_fail(ptr noundef @.str, ptr noundef @.str.1, i32 noundef 555, ptr noundef @__PRETTY_FUNCTION__._ZN24TinyGLInstancingRenderer43write_single_instance_specular_color_to_cpuEPKdi) #6
  unreachable

23:                                               ; No predecessors!
  br label %24

24:                                               ; preds = %23, %21
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #5
  %25 = load ptr, ptr %7, align 8, !tbaa !5
  %26 = getelementptr inbounds %struct.TinyPublicGraphicsInstanceData, ptr %25, i32 0, i32 1
  %27 = load i32, ptr %26, align 4, !tbaa !18
  store i32 %27, ptr %8, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #5
  store i32 0, ptr %9, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #5
  store i32 -1, ptr %10, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #5
  store i32 0, ptr %11, align 4, !tbaa !9
  br label %28

28:                                               ; preds = %51, %24
  %29 = load i32, ptr %11, align 4, !tbaa !9
  %30 = sext i32 %29 to i64
  %31 = getelementptr inbounds %class.TinyGLInstancingRenderer, ptr %13, i32 0, i32 1
  %32 = call noundef i64 @_ZNKSt6vectorIP18b3GraphicsInstanceSaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %31) #5
  %33 = icmp ult i64 %30, %32
  br i1 %33, label %35, label %34

34:                                               ; preds = %28
  store i32 2, ptr %12, align 4
  br label %54

35:                                               ; preds = %28
  %36 = getelementptr inbounds %class.TinyGLInstancingRenderer, ptr %13, i32 0, i32 1
  %37 = load i32, ptr %11, align 4, !tbaa !9
  %38 = sext i32 %37 to i64
  %39 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIP18b3GraphicsInstanceSaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %36, i64 noundef %38) #5
  %40 = load ptr, ptr %39, align 8, !tbaa !5
  %41 = getelementptr inbounds %struct.b3GraphicsInstance, ptr %40, i32 0, i32 5
  %42 = load i32, ptr %41, align 4, !tbaa !20
  %43 = load i32, ptr %9, align 4, !tbaa !9
  %44 = add nsw i32 %43, %42
  store i32 %44, ptr %9, align 4, !tbaa !9
  %45 = load i32, ptr %6, align 4, !tbaa !9
  %46 = load i32, ptr %9, align 4, !tbaa !9
  %47 = icmp slt i32 %45, %46
  br i1 %47, label %48, label %50

48:                                               ; preds = %35
  %49 = load i32, ptr %11, align 4, !tbaa !9
  store i32 %49, ptr %10, align 4, !tbaa !9
  store i32 2, ptr %12, align 4
  br label %54

50:                                               ; preds = %35
  br label %51

51:                                               ; preds = %50
  %52 = load i32, ptr %11, align 4, !tbaa !9
  %53 = add nsw i32 %52, 1
  store i32 %53, ptr %11, align 4, !tbaa !9
  br label %28, !llvm.loop !28

54:                                               ; preds = %48, %34
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #5
  br label %55

55:                                               ; preds = %54
  %56 = load i32, ptr %10, align 4, !tbaa !9
  %57 = icmp sgt i32 %56, 0
  br i1 %57, label %58, label %92

58:                                               ; preds = %55
  %59 = load ptr, ptr %5, align 8, !tbaa !5
  %60 = getelementptr inbounds double, ptr %59, i64 0
  %61 = load double, ptr %60, align 8, !tbaa !30
  %62 = fptrunc double %61 to float
  %63 = getelementptr inbounds %class.TinyGLInstancingRenderer, ptr %13, i32 0, i32 1
  %64 = load i32, ptr %10, align 4, !tbaa !9
  %65 = sext i32 %64 to i64
  %66 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIP18b3GraphicsInstanceSaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %63, i64 noundef %65) #5
  %67 = load ptr, ptr %66, align 8, !tbaa !5
  %68 = getelementptr inbounds %struct.b3GraphicsInstance, ptr %67, i32 0, i32 11
  %69 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN4TINY11TinyVector3IfNS_10FloatUtilsEEixEi(ptr noundef nonnull align 4 dereferenceable(16) %68, i32 noundef 0)
  store float %62, ptr %69, align 4, !tbaa !32
  %70 = load ptr, ptr %5, align 8, !tbaa !5
  %71 = getelementptr inbounds double, ptr %70, i64 1
  %72 = load double, ptr %71, align 8, !tbaa !30
  %73 = fptrunc double %72 to float
  %74 = getelementptr inbounds %class.TinyGLInstancingRenderer, ptr %13, i32 0, i32 1
  %75 = load i32, ptr %10, align 4, !tbaa !9
  %76 = sext i32 %75 to i64
  %77 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIP18b3GraphicsInstanceSaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %74, i64 noundef %76) #5
  %78 = load ptr, ptr %77, align 8, !tbaa !5
  %79 = getelementptr inbounds %struct.b3GraphicsInstance, ptr %78, i32 0, i32 11
  %80 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN4TINY11TinyVector3IfNS_10FloatUtilsEEixEi(ptr noundef nonnull align 4 dereferenceable(16) %79, i32 noundef 1)
  store float %73, ptr %80, align 4, !tbaa !32
  %81 = load ptr, ptr %5, align 8, !tbaa !5
  %82 = getelementptr inbounds double, ptr %81, i64 2
  %83 = load double, ptr %82, align 8, !tbaa !30
  %84 = fptrunc double %83 to float
  %85 = getelementptr inbounds %class.TinyGLInstancingRenderer, ptr %13, i32 0, i32 1
  %86 = load i32, ptr %10, align 4, !tbaa !9
  %87 = sext i32 %86 to i64
  %88 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIP18b3GraphicsInstanceSaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %85, i64 noundef %87) #5
  %89 = load ptr, ptr %88, align 8, !tbaa !5
  %90 = getelementptr inbounds %struct.b3GraphicsInstance, ptr %89, i32 0, i32 11
  %91 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN4TINY11TinyVector3IfNS_10FloatUtilsEEixEi(ptr noundef nonnull align 4 dereferenceable(16) %90, i32 noundef 2)
  store float %84, ptr %91, align 4, !tbaa !32
  br label %92

92:                                               ; preds = %58, %55
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #5
  ret void
}

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

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 = { 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 #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, !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 4}
!19 = !{!"_ZTS30TinyPublicGraphicsInstanceData", !10, i64 0, !10, i64 4, !7, i64 8, !7, i64 24, !7, i64 40, !7, i64 56}
!20 = !{!21, !10, i64 20}
!21 = !{!"_ZTS18b3GraphicsInstance", !10, i64 0, !10, i64 4, !10, i64 8, !10, i64 12, !10, i64 16, !10, i64 20, !22, i64 24, !10, i64 48, !10, i64 52, !10, i64 56, !26, i64 60, !27, i64 64, !10, i64 80}
!22 = !{!"_ZTSSt6vectorIiSaIiEE", !23, i64 0}
!23 = !{!"_ZTSSt12_Vector_baseIiSaIiEE", !24, i64 0}
!24 = !{!"_ZTSNSt12_Vector_baseIiSaIiEE12_Vector_implE", !25, i64 0}
!25 = !{!"_ZTSNSt12_Vector_baseIiSaIiEE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!26 = !{!"float", !7, i64 0}
!27 = !{!"_ZTSN4TINY11TinyVector3IfNS_10FloatUtilsEEE", !26, i64 0, !26, i64 4, !26, i64 8, !10, i64 12}
!28 = distinct !{!28, !29}
!29 = !{!"llvm.loop.mustprogress"}
!30 = !{!31, !31, i64 0}
!31 = !{!"double", !7, i64 0}
!32 = !{!26, !26, 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
@__PRETTY_FUNCTION__._ZN24TinyGLInstancingRenderer43write_single_instance_specular_color_to_cpuEPKdi = external hidden unnamed_addr constant [104 x i8], align 1

; 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 @_ZN24TinyGLInstancingRenderer43write_single_instance_specular_color_to_cpuEPKdi(ptr noundef nonnull align 8 dereferenceable(60) %0, ptr nocapture noundef readonly %1, i32 noundef %2) unnamed_addr #1 align 2 {
  %4 = getelementptr inbounds i8, ptr %0, i64 32
  %5 = load ptr, ptr %4, align 8, !tbaa !5
  %6 = getelementptr inbounds i8, ptr %5, i64 544
  %7 = tail call noundef ptr @_ZN17TinyResizablePoolI18TinyPoolBodyHandleI30TinyPublicGraphicsInstanceDataEE10get_handleEi(ptr noundef nonnull align 8 dereferenceable(40) %6, i32 noundef %2)
  %.not = icmp eq ptr %7, null
  br i1 %.not, label %10, label %.preheader

.preheader:                                       ; preds = %3
  %8 = getelementptr inbounds i8, ptr %0, i64 8
  %9 = tail call noundef i64 @_ZNKSt6vectorIP18b3GraphicsInstanceSaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %8) #4
  %.not28 = icmp eq i64 %9, 0
  br i1 %.not28, label %.thread, label %.lr.ph

10:                                               ; preds = %3
  tail call void @__assert_fail(ptr noundef nonnull @.str, ptr noundef nonnull @.str.1, i32 noundef 555, ptr noundef nonnull @__PRETTY_FUNCTION__._ZN24TinyGLInstancingRenderer43write_single_instance_specular_color_to_cpuEPKdi) #5
  unreachable

.lr.ph:                                           ; preds = %.preheader, %17
  %indvars.iv = phi i64 [ %indvars.iv.next, %17 ], [ 0, %.preheader ]
  %.01826 = phi i32 [ %15, %17 ], [ 0, %.preheader ]
  %11 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIP18b3GraphicsInstanceSaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %8, i64 noundef %indvars.iv) #4
  %12 = load ptr, ptr %11, align 8, !tbaa !16
  %13 = getelementptr inbounds i8, ptr %12, i64 20
  %14 = load i32, ptr %13, align 4, !tbaa !17
  %15 = add nsw i32 %14, %.01826
  %16 = icmp sgt i32 %15, %2
  br i1 %16, label %20, label %17

17:                                               ; preds = %.lr.ph
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %18 = tail call noundef i64 @_ZNKSt6vectorIP18b3GraphicsInstanceSaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %8) #4
  %19 = icmp ugt i64 %18, %indvars.iv.next
  br i1 %19, label %.lr.ph, label %.thread, !llvm.loop !25

20:                                               ; preds = %.lr.ph
  %.not23 = icmp eq i64 %indvars.iv, 0
  br i1 %.not23, label %.thread, label %21

21:                                               ; preds = %20
  %22 = load double, ptr %1, align 8, !tbaa !27
  %23 = fptrunc double %22 to float
  %24 = and i64 %indvars.iv, 4294967295
  %25 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIP18b3GraphicsInstanceSaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %8, i64 noundef %24) #4
  %26 = load ptr, ptr %25, align 8, !tbaa !16
  %27 = getelementptr inbounds i8, ptr %26, i64 64
  %28 = tail call noundef nonnull align 4 dereferenceable(4) ptr @_ZN4TINY11TinyVector3IfNS_10FloatUtilsEEixEi(ptr noundef nonnull align 4 dereferenceable(16) %27, i32 noundef 0)
  store float %23, ptr %28, align 4, !tbaa !29
  %29 = getelementptr inbounds i8, ptr %1, i64 8
  %30 = load double, ptr %29, align 8, !tbaa !27
  %31 = fptrunc double %30 to float
  %32 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIP18b3GraphicsInstanceSaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %8, i64 noundef %24) #4
  %33 = load ptr, ptr %32, align 8, !tbaa !16
  %34 = getelementptr inbounds i8, ptr %33, i64 64
  %35 = tail call noundef nonnull align 4 dereferenceable(4) ptr @_ZN4TINY11TinyVector3IfNS_10FloatUtilsEEixEi(ptr noundef nonnull align 4 dereferenceable(16) %34, i32 noundef 1)
  store float %31, ptr %35, align 4, !tbaa !29
  %36 = getelementptr inbounds i8, ptr %1, i64 16
  %37 = load double, ptr %36, align 8, !tbaa !27
  %38 = fptrunc double %37 to float
  %39 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIP18b3GraphicsInstanceSaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %8, i64 noundef %24) #4
  %40 = load ptr, ptr %39, align 8, !tbaa !16
  %41 = getelementptr inbounds i8, ptr %40, i64 64
  %42 = tail call noundef nonnull align 4 dereferenceable(4) ptr @_ZN4TINY11TinyVector3IfNS_10FloatUtilsEEixEi(ptr noundef nonnull align 4 dereferenceable(16) %41, i32 noundef 2)
  store float %38, ptr %42, align 4, !tbaa !29
  br label %.thread

.thread:                                          ; preds = %17, %.preheader, %21, %20
  ret void
}

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

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 = { 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 = { 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, !11, i64 32}
!6 = !{!"_ZTS24TinyGLInstancingRenderer", !7, i64 8, !11, i64 32, !14, i64 40, !14, i64 41, !15, i64 44, !15, i64 48, !15, i64 52, !15, i64 56}
!7 = !{!"_ZTSSt6vectorIP18b3GraphicsInstanceSaIS1_EE", !8, i64 0}
!8 = !{!"_ZTSSt12_Vector_baseIP18b3GraphicsInstanceSaIS1_EE", !9, i64 0}
!9 = !{!"_ZTSNSt12_Vector_baseIP18b3GraphicsInstanceSaIS1_EE12_Vector_implE", !10, i64 0}
!10 = !{!"_ZTSNSt12_Vector_baseIP18b3GraphicsInstanceSaIS1_EE17_Vector_impl_dataE", !11, i64 0, !11, i64 8, !11, i64 16}
!11 = !{!"any pointer", !12, i64 0}
!12 = !{!"omnipotent char", !13, i64 0}
!13 = !{!"Simple C++ TBAA"}
!14 = !{!"bool", !12, i64 0}
!15 = !{!"int", !12, i64 0}
!16 = !{!11, !11, i64 0}
!17 = !{!18, !15, i64 20}
!18 = !{!"_ZTS18b3GraphicsInstance", !15, i64 0, !15, i64 4, !15, i64 8, !15, i64 12, !15, i64 16, !15, i64 20, !19, i64 24, !15, i64 48, !15, i64 52, !15, i64 56, !23, i64 60, !24, i64 64, !15, i64 80}
!19 = !{!"_ZTSSt6vectorIiSaIiEE", !20, i64 0}
!20 = !{!"_ZTSSt12_Vector_baseIiSaIiEE", !21, i64 0}
!21 = !{!"_ZTSNSt12_Vector_baseIiSaIiEE12_Vector_implE", !22, i64 0}
!22 = !{!"_ZTSNSt12_Vector_baseIiSaIiEE17_Vector_impl_dataE", !11, i64 0, !11, i64 8, !11, i64 16}
!23 = !{!"float", !12, i64 0}
!24 = !{!"_ZTSN4TINY11TinyVector3IfNS_10FloatUtilsEEE", !23, i64 0, !23, i64 4, !23, i64 8, !15, i64 12}
!25 = distinct !{!25, !26}
!26 = !{!"llvm.loop.mustprogress"}
!27 = !{!28, !28, i64 0}
!28 = !{!"double", !12, i64 0}
!29 = !{!23, !23, i64 0}


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