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

%"struct.TINY::TinyPose" = type { %"struct.TINY::TinyVector3", %"struct.TINY::TinyQuaternion" }
%"struct.TINY::TinyVector3" = type { float, float, float, i32 }
%"struct.TINY::TinyQuaternion" = type { float, float, float, float }
%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 }
%"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 }

@.str.1 = external hidden unnamed_addr constant [130 x i8], align 1
@glad_glGetError = external global ptr, align 8
@.str.4 = external hidden unnamed_addr constant [28 x i8], align 1
@__PRETTY_FUNCTION__._ZN24TinyGLInstancingRenderer13update_cameraEi = external hidden unnamed_addr constant [58 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 @_ZN24TinyGLInstancingRenderer13update_cameraEi(ptr noundef nonnull align 8 dereferenceable(60) %0, i32 noundef %1) unnamed_addr #2 align 2 {
  %3 = alloca ptr, align 8
  %4 = alloca i32, align 4
  %5 = alloca [16 x float], align 16
  %6 = alloca [16 x float], align 16
  %7 = alloca i32, align 4
  %8 = alloca %"struct.TINY::TinyPose", align 4
  %9 = alloca i32, align 4
  store ptr %0, ptr %3, align 8, !tbaa !5
  store i32 %1, ptr %4, align 4, !tbaa !9
  %10 = load ptr, ptr %3, align 8
  %11 = load ptr, ptr @glad_glGetError, align 8, !tbaa !5
  %12 = call i32 %11()
  %13 = icmp eq i32 %12, 0
  br i1 %13, label %14, label %15

14:                                               ; preds = %2
  br label %17

15:                                               ; preds = %2
  call void @__assert_fail(ptr noundef @.str.4, ptr noundef @.str.1, i32 noundef 1508, ptr noundef @__PRETTY_FUNCTION__._ZN24TinyGLInstancingRenderer13update_cameraEi) #6
  unreachable

16:                                               ; No predecessors!
  br label %17

17:                                               ; preds = %16, %14
  %18 = load i32, ptr %4, align 4, !tbaa !9
  %19 = getelementptr inbounds %class.TinyGLInstancingRenderer, ptr %10, i32 0, i32 8
  store i32 %18, ptr %19, align 4, !tbaa !11
  %20 = getelementptr inbounds %class.TinyGLInstancingRenderer, ptr %10, i32 0, i32 2
  %21 = load ptr, ptr %20, align 8, !tbaa !18
  %22 = getelementptr inbounds %struct.InternalDataRenderer, ptr %21, i32 0, i32 3
  %23 = load ptr, ptr %22, align 8, !tbaa !19
  %24 = load i32, ptr %4, align 4, !tbaa !9
  %25 = load ptr, ptr %23, align 8, !tbaa !38
  %26 = getelementptr inbounds ptr, ptr %25, i64 11
  %27 = load ptr, ptr %26, align 8
  call void %27(ptr noundef nonnull align 8 dereferenceable(16) %23, i32 noundef %24)
  %28 = getelementptr inbounds %class.TinyGLInstancingRenderer, ptr %10, i32 0, i32 2
  %29 = load ptr, ptr %28, align 8, !tbaa !18
  %30 = getelementptr inbounds %struct.InternalDataRenderer, ptr %29, i32 0, i32 3
  %31 = load ptr, ptr %30, align 8, !tbaa !19
  %32 = getelementptr inbounds %class.TinyGLInstancingRenderer, ptr %10, i32 0, i32 6
  %33 = load i32, ptr %32, align 4, !tbaa !40
  %34 = sitofp i32 %33 to float
  %35 = getelementptr inbounds %class.TinyGLInstancingRenderer, ptr %10, i32 0, i32 7
  %36 = load i32, ptr %35, align 8, !tbaa !41
  %37 = sitofp i32 %36 to float
  %38 = fdiv float %34, %37
  %39 = load ptr, ptr %31, align 8, !tbaa !38
  %40 = getelementptr inbounds ptr, ptr %39, i64 17
  %41 = load ptr, ptr %40, align 8
  call void %41(ptr noundef nonnull align 8 dereferenceable(16) %31, float noundef %38)
  %42 = getelementptr inbounds %class.TinyGLInstancingRenderer, ptr %10, i32 0, i32 2
  %43 = load ptr, ptr %42, align 8, !tbaa !18
  %44 = getelementptr inbounds %struct.InternalDataRenderer, ptr %43, i32 0, i32 2
  call void @_ZN10TinyCamera6updateEv(ptr noundef nonnull align 8 dereferenceable(16) %44)
  %45 = getelementptr inbounds %class.TinyGLInstancingRenderer, ptr %10, i32 0, i32 2
  %46 = load ptr, ptr %45, align 8, !tbaa !18
  %47 = getelementptr inbounds %struct.InternalDataRenderer, ptr %46, i32 0, i32 3
  %48 = load ptr, ptr %47, align 8, !tbaa !19
  %49 = getelementptr inbounds %class.TinyGLInstancingRenderer, ptr %10, i32 0, i32 2
  %50 = load ptr, ptr %49, align 8, !tbaa !18
  %51 = getelementptr inbounds %struct.InternalDataRenderer, ptr %50, i32 0, i32 4
  %52 = getelementptr inbounds [16 x float], ptr %51, i64 0, i64 0
  %53 = load ptr, ptr %48, align 8, !tbaa !38
  %54 = getelementptr inbounds ptr, ptr %53, i64 2
  %55 = load ptr, ptr %54, align 8
  call void %55(ptr noundef nonnull align 8 dereferenceable(16) %48, ptr noundef %52)
  %56 = getelementptr inbounds %class.TinyGLInstancingRenderer, ptr %10, i32 0, i32 2
  %57 = load ptr, ptr %56, align 8, !tbaa !18
  %58 = getelementptr inbounds %struct.InternalDataRenderer, ptr %57, i32 0, i32 3
  %59 = load ptr, ptr %58, align 8, !tbaa !19
  %60 = getelementptr inbounds %class.TinyGLInstancingRenderer, ptr %10, i32 0, i32 2
  %61 = load ptr, ptr %60, align 8, !tbaa !18
  %62 = getelementptr inbounds %struct.InternalDataRenderer, ptr %61, i32 0, i32 5
  %63 = getelementptr inbounds [16 x float], ptr %62, i64 0, i64 0
  %64 = load ptr, ptr %59, align 8, !tbaa !38
  %65 = getelementptr inbounds ptr, ptr %64, i64 3
  %66 = load ptr, ptr %65, align 8
  call void %66(ptr noundef nonnull align 8 dereferenceable(16) %59, ptr noundef %63)
  call void @llvm.lifetime.start.p0(i64 64, ptr %5) #7
  call void @llvm.lifetime.start.p0(i64 64, ptr %6) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #7
  store i32 0, ptr %7, align 4, !tbaa !9
  br label %67

67:                                               ; preds = %82, %17
  %68 = load i32, ptr %7, align 4, !tbaa !9
  %69 = icmp slt i32 %68, 16
  br i1 %69, label %71, label %70

70:                                               ; preds = %67
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #7
  br label %85

71:                                               ; preds = %67
  %72 = getelementptr inbounds %class.TinyGLInstancingRenderer, ptr %10, i32 0, i32 2
  %73 = load ptr, ptr %72, align 8, !tbaa !18
  %74 = getelementptr inbounds %struct.InternalDataRenderer, ptr %73, i32 0, i32 5
  %75 = load i32, ptr %7, align 4, !tbaa !9
  %76 = sext i32 %75 to i64
  %77 = getelementptr inbounds [16 x float], ptr %74, i64 0, i64 %76
  %78 = load float, ptr %77, align 4, !tbaa !42
  %79 = load i32, ptr %7, align 4, !tbaa !9
  %80 = sext i32 %79 to i64
  %81 = getelementptr inbounds [16 x float], ptr %5, i64 0, i64 %80
  store float %78, ptr %81, align 4, !tbaa !42
  br label %82

82:                                               ; preds = %71
  %83 = load i32, ptr %7, align 4, !tbaa !9
  %84 = add nsw i32 %83, 1
  store i32 %84, ptr %7, align 4, !tbaa !9
  br label %67, !llvm.loop !43

85:                                               ; preds = %70
  call void @llvm.lifetime.start.p0(i64 32, ptr %8) #7
  call void @_ZN4TINY8TinyPoseIfNS_10FloatUtilsEEC2Ev(ptr noundef nonnull align 4 dereferenceable(32) %8)
  %86 = getelementptr inbounds [16 x float], ptr %5, i64 0, i64 0
  call void @_ZN4TINY19setFromOpenGLMatrixERNS_8TinyPoseIfNS_10FloatUtilsEEEPKf(ptr noundef nonnull align 4 dereferenceable(32) %8, ptr noundef %86)
  call void @_ZN4TINY8TinyPoseIfNS_10FloatUtilsEE7inverseEv(ptr noundef nonnull align 4 dereferenceable(32) %8)
  %87 = getelementptr inbounds [16 x float], ptr %6, i64 0, i64 0
  call void @_ZN4TINY15getOpenGLMatrixERKNS_8TinyPoseIfNS_10FloatUtilsEEEPf(ptr noundef nonnull align 4 dereferenceable(32) %8, ptr noundef %87)
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #7
  store i32 0, ptr %9, align 4, !tbaa !9
  br label %88

88:                                               ; preds = %103, %85
  %89 = load i32, ptr %9, align 4, !tbaa !9
  %90 = icmp slt i32 %89, 16
  br i1 %90, label %92, label %91

91:                                               ; preds = %88
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #7
  br label %106

92:                                               ; preds = %88
  %93 = load i32, ptr %9, align 4, !tbaa !9
  %94 = sext i32 %93 to i64
  %95 = getelementptr inbounds [16 x float], ptr %6, i64 0, i64 %94
  %96 = load float, ptr %95, align 4, !tbaa !42
  %97 = getelementptr inbounds %class.TinyGLInstancingRenderer, ptr %10, i32 0, i32 2
  %98 = load ptr, ptr %97, align 8, !tbaa !18
  %99 = getelementptr inbounds %struct.InternalDataRenderer, ptr %98, i32 0, i32 8
  %100 = load i32, ptr %9, align 4, !tbaa !9
  %101 = sext i32 %100 to i64
  %102 = getelementptr inbounds [16 x float], ptr %99, i64 0, i64 %101
  store float %96, ptr %102, align 4, !tbaa !42
  br label %103

103:                                              ; preds = %92
  %104 = load i32, ptr %9, align 4, !tbaa !9
  %105 = add nsw i32 %104, 1
  store i32 %105, ptr %9, align 4, !tbaa !9
  br label %88, !llvm.loop !45

106:                                              ; preds = %91
  call void @llvm.lifetime.end.p0(i64 32, ptr %8) #7
  call void @llvm.lifetime.end.p0(i64 64, ptr %6) #7
  call void @llvm.lifetime.end.p0(i64 64, ptr %5) #7
  ret void
}

declare void @_ZN10TinyCamera6updateEv(ptr noundef nonnull align 8 dereferenceable(16)) #3

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN4TINY8TinyPoseIfNS_10FloatUtilsEE7inverseEv(ptr noundef nonnull align 4 dereferenceable(32)) #5 align 2

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

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 = { "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 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 = { mustprogress uwtable "min-legal-vector-width"="64" "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 #6 = { noreturn nounwind }
attributes #7 = { 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, !10, i64 52}
!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 = !{!12, !6, i64 32}
!19 = !{!20, !6, i64 136}
!20 = !{!"_ZTS20InternalDataRenderer", !21, i64 0, !26, i64 120, !6, i64 136, !7, i64 144, !7, i64 208, !7, i64 272, !7, i64 336, !7, i64 400, !17, i64 464, !27, i64 468, !27, i64 484, !10, i64 500, !29, i64 504, !6, i64 528, !10, i64 536, !10, i64 540, !33, i64 544, !10, i64 584, !10, i64 588, !28, i64 592, !17, i64 596}
!21 = !{!"_ZTS30GLInstanceRendererInternalData", !22, i64 0, !22, i64 24, !22, i64 48, !22, i64 72, !10, i64 96, !10, i64 100, !10, i64 104, !10, i64 108, !10, i64 112}
!22 = !{!"_ZTSSt6vectorIfSaIfEE", !23, i64 0}
!23 = !{!"_ZTSSt12_Vector_baseIfSaIfEE", !24, i64 0}
!24 = !{!"_ZTSNSt12_Vector_baseIfSaIfEE12_Vector_implE", !25, i64 0}
!25 = !{!"_ZTSNSt12_Vector_baseIfSaIfEE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!26 = !{!"_ZTS10TinyCamera", !6, i64 8}
!27 = !{!"_ZTSN4TINY11TinyVector3IfNS_10FloatUtilsEEE", !28, i64 0, !28, i64 4, !28, i64 8, !10, i64 12}
!28 = !{!"float", !7, i64 0}
!29 = !{!"_ZTSSt6vectorI21InternalTextureHandleSaIS0_EE", !30, i64 0}
!30 = !{!"_ZTSSt12_Vector_baseI21InternalTextureHandleSaIS0_EE", !31, i64 0}
!31 = !{!"_ZTSNSt12_Vector_baseI21InternalTextureHandleSaIS0_EE12_Vector_implE", !32, i64 0}
!32 = !{!"_ZTSNSt12_Vector_baseI21InternalTextureHandleSaIS0_EE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!33 = !{!"_ZTS17TinyResizablePoolI18TinyPoolBodyHandleI30TinyPublicGraphicsInstanceDataEE", !34, i64 8, !10, i64 32, !10, i64 36}
!34 = !{!"_ZTSSt6vectorI18TinyPoolBodyHandleI30TinyPublicGraphicsInstanceDataESaIS2_EE", !35, i64 0}
!35 = !{!"_ZTSSt12_Vector_baseI18TinyPoolBodyHandleI30TinyPublicGraphicsInstanceDataESaIS2_EE", !36, i64 0}
!36 = !{!"_ZTSNSt12_Vector_baseI18TinyPoolBodyHandleI30TinyPublicGraphicsInstanceDataESaIS2_EE12_Vector_implE", !37, i64 0}
!37 = !{!"_ZTSNSt12_Vector_baseI18TinyPoolBodyHandleI30TinyPublicGraphicsInstanceDataESaIS2_EE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!38 = !{!39, !39, i64 0}
!39 = !{!"vtable pointer", !8, i64 0}
!40 = !{!12, !10, i64 44}
!41 = !{!12, !10, i64 48}
!42 = !{!28, !28, i64 0}
!43 = distinct !{!43, !44}
!44 = !{!"llvm.loop.mustprogress"}
!45 = distinct !{!45, !44}


; Optimized IR (opt -passes='default<O3>'):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

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

@.str.1 = external hidden unnamed_addr constant [130 x i8], align 1
@glad_glGetError = external local_unnamed_addr global ptr, align 8
@.str.4 = external hidden unnamed_addr constant [28 x i8], align 1
@__PRETTY_FUNCTION__._ZN24TinyGLInstancingRenderer13update_cameraEi = external hidden unnamed_addr constant [58 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 @_ZN24TinyGLInstancingRenderer13update_cameraEi(ptr nocapture noundef nonnull align 8 dereferenceable(60) %0, i32 noundef %1) unnamed_addr #2 align 2 {
  %3 = alloca [16 x float], align 16
  %4 = alloca [16 x float], align 16
  %5 = alloca %"struct.TINY::TinyPose", align 4
  %6 = load ptr, ptr @glad_glGetError, align 8, !tbaa !5
  %7 = tail call i32 %6()
  %8 = icmp eq i32 %7, 0
  br i1 %8, label %10, label %9

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

10:                                               ; preds = %2
  %11 = getelementptr inbounds i8, ptr %0, i64 52
  store i32 %1, ptr %11, align 4, !tbaa !9
  %12 = getelementptr inbounds i8, ptr %0, i64 32
  %13 = load ptr, ptr %12, align 8, !tbaa !17
  %14 = getelementptr inbounds i8, ptr %13, i64 136
  %15 = load ptr, ptr %14, align 8, !tbaa !18
  %16 = load ptr, ptr %15, align 8, !tbaa !37
  %17 = getelementptr inbounds i8, ptr %16, i64 88
  %18 = load ptr, ptr %17, align 8
  tail call void %18(ptr noundef nonnull align 8 dereferenceable(16) %15, i32 noundef %1)
  %19 = load ptr, ptr %12, align 8, !tbaa !17
  %20 = getelementptr inbounds i8, ptr %19, i64 136
  %21 = load ptr, ptr %20, align 8, !tbaa !18
  %22 = getelementptr inbounds i8, ptr %0, i64 44
  %23 = load <2 x i32>, ptr %22, align 4, !tbaa !39
  %24 = sitofp <2 x i32> %23 to <2 x float>
  %25 = extractelement <2 x float> %24, i64 0
  %26 = extractelement <2 x float> %24, i64 1
  %27 = fdiv float %25, %26
  %28 = load ptr, ptr %21, align 8, !tbaa !37
  %29 = getelementptr inbounds i8, ptr %28, i64 136
  %30 = load ptr, ptr %29, align 8
  tail call void %30(ptr noundef nonnull align 8 dereferenceable(16) %21, float noundef %27)
  %31 = load ptr, ptr %12, align 8, !tbaa !17
  %32 = getelementptr inbounds i8, ptr %31, i64 120
  tail call void @_ZN10TinyCamera6updateEv(ptr noundef nonnull align 8 dereferenceable(16) %32)
  %33 = load ptr, ptr %12, align 8, !tbaa !17
  %34 = getelementptr inbounds i8, ptr %33, i64 136
  %35 = load ptr, ptr %34, align 8, !tbaa !18
  %36 = getelementptr inbounds i8, ptr %33, i64 144
  %37 = load ptr, ptr %35, align 8, !tbaa !37
  %38 = getelementptr inbounds i8, ptr %37, i64 16
  %39 = load ptr, ptr %38, align 8
  tail call void %39(ptr noundef nonnull align 8 dereferenceable(16) %35, ptr noundef nonnull %36)
  %40 = load ptr, ptr %12, align 8, !tbaa !17
  %41 = getelementptr inbounds i8, ptr %40, i64 136
  %42 = load ptr, ptr %41, align 8, !tbaa !18
  %43 = getelementptr inbounds i8, ptr %40, i64 208
  %44 = load ptr, ptr %42, align 8, !tbaa !37
  %45 = getelementptr inbounds i8, ptr %44, i64 24
  %46 = load ptr, ptr %45, align 8
  tail call void %46(ptr noundef nonnull align 8 dereferenceable(16) %42, ptr noundef nonnull %43)
  call void @llvm.lifetime.start.p0(i64 64, ptr nonnull %3) #7
  call void @llvm.lifetime.start.p0(i64 64, ptr nonnull %4) #7
  %47 = load ptr, ptr %12, align 8, !tbaa !17
  %48 = getelementptr inbounds i8, ptr %47, i64 208
  %49 = load <4 x float>, ptr %48, align 4, !tbaa !40
  store <4 x float> %49, ptr %3, align 16, !tbaa !40
  %50 = getelementptr inbounds i8, ptr %47, i64 224
  %51 = getelementptr inbounds i8, ptr %3, i64 16
  %52 = load <4 x float>, ptr %50, align 4, !tbaa !40
  store <4 x float> %52, ptr %51, align 16, !tbaa !40
  %53 = getelementptr inbounds i8, ptr %47, i64 240
  %54 = getelementptr inbounds i8, ptr %3, i64 32
  %55 = load <4 x float>, ptr %53, align 4, !tbaa !40
  store <4 x float> %55, ptr %54, align 16, !tbaa !40
  %56 = getelementptr inbounds i8, ptr %47, i64 256
  %57 = getelementptr inbounds i8, ptr %3, i64 48
  %58 = load <4 x float>, ptr %56, align 4, !tbaa !40
  store <4 x float> %58, ptr %57, align 16, !tbaa !40
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %5) #7
  call void @_ZN4TINY8TinyPoseIfNS_10FloatUtilsEEC2Ev(ptr noundef nonnull align 4 dereferenceable(32) %5)
  call void @_ZN4TINY19setFromOpenGLMatrixERNS_8TinyPoseIfNS_10FloatUtilsEEEPKf(ptr noundef nonnull align 4 dereferenceable(32) %5, ptr noundef nonnull %3)
  call void @_ZN4TINY8TinyPoseIfNS_10FloatUtilsEE7inverseEv(ptr noundef nonnull align 4 dereferenceable(32) %5)
  call void @_ZN4TINY15getOpenGLMatrixERKNS_8TinyPoseIfNS_10FloatUtilsEEEPf(ptr noundef nonnull align 4 dereferenceable(32) %5, ptr noundef nonnull %4)
  %59 = load ptr, ptr %12, align 8, !tbaa !17
  %60 = getelementptr inbounds i8, ptr %59, i64 400
  %61 = load <4 x float>, ptr %4, align 16, !tbaa !40
  store <4 x float> %61, ptr %60, align 4, !tbaa !40
  %62 = getelementptr inbounds i8, ptr %4, i64 16
  %63 = getelementptr inbounds i8, ptr %59, i64 416
  %64 = load <4 x float>, ptr %62, align 16, !tbaa !40
  store <4 x float> %64, ptr %63, align 4, !tbaa !40
  %65 = getelementptr inbounds i8, ptr %4, i64 32
  %66 = getelementptr inbounds i8, ptr %59, i64 432
  %67 = load <4 x float>, ptr %65, align 16, !tbaa !40
  store <4 x float> %67, ptr %66, align 4, !tbaa !40
  %68 = getelementptr inbounds i8, ptr %4, i64 48
  %69 = getelementptr inbounds i8, ptr %59, i64 448
  %70 = load <4 x float>, ptr %68, align 16, !tbaa !40
  store <4 x float> %70, ptr %69, align 4, !tbaa !40
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %5) #7
  call void @llvm.lifetime.end.p0(i64 64, ptr nonnull %4) #7
  call void @llvm.lifetime.end.p0(i64 64, ptr nonnull %3) #7
  ret void
}

declare void @_ZN10TinyCamera6updateEv(ptr noundef nonnull align 8 dereferenceable(16)) local_unnamed_addr #3

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN4TINY8TinyPoseIfNS_10FloatUtilsEE7inverseEv(ptr noundef nonnull align 4 dereferenceable(32)) local_unnamed_addr #5 align 2

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

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 = { "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 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 = { mustprogress uwtable "min-legal-vector-width"="64" "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 #6 = { noreturn nounwind }
attributes #7 = { 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, !16, i64 52}
!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 = !{!10, !6, i64 32}
!18 = !{!19, !6, i64 136}
!19 = !{!"_ZTS20InternalDataRenderer", !20, i64 0, !25, i64 120, !6, i64 136, !7, i64 144, !7, i64 208, !7, i64 272, !7, i64 336, !7, i64 400, !15, i64 464, !26, i64 468, !26, i64 484, !16, i64 500, !28, i64 504, !6, i64 528, !16, i64 536, !16, i64 540, !32, i64 544, !16, i64 584, !16, i64 588, !27, i64 592, !15, i64 596}
!20 = !{!"_ZTS30GLInstanceRendererInternalData", !21, i64 0, !21, i64 24, !21, i64 48, !21, i64 72, !16, i64 96, !16, i64 100, !16, i64 104, !16, i64 108, !16, i64 112}
!21 = !{!"_ZTSSt6vectorIfSaIfEE", !22, i64 0}
!22 = !{!"_ZTSSt12_Vector_baseIfSaIfEE", !23, i64 0}
!23 = !{!"_ZTSNSt12_Vector_baseIfSaIfEE12_Vector_implE", !24, i64 0}
!24 = !{!"_ZTSNSt12_Vector_baseIfSaIfEE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!25 = !{!"_ZTS10TinyCamera", !6, i64 8}
!26 = !{!"_ZTSN4TINY11TinyVector3IfNS_10FloatUtilsEEE", !27, i64 0, !27, i64 4, !27, i64 8, !16, i64 12}
!27 = !{!"float", !7, i64 0}
!28 = !{!"_ZTSSt6vectorI21InternalTextureHandleSaIS0_EE", !29, i64 0}
!29 = !{!"_ZTSSt12_Vector_baseI21InternalTextureHandleSaIS0_EE", !30, i64 0}
!30 = !{!"_ZTSNSt12_Vector_baseI21InternalTextureHandleSaIS0_EE12_Vector_implE", !31, i64 0}
!31 = !{!"_ZTSNSt12_Vector_baseI21InternalTextureHandleSaIS0_EE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!32 = !{!"_ZTS17TinyResizablePoolI18TinyPoolBodyHandleI30TinyPublicGraphicsInstanceDataEE", !33, i64 8, !16, i64 32, !16, i64 36}
!33 = !{!"_ZTSSt6vectorI18TinyPoolBodyHandleI30TinyPublicGraphicsInstanceDataESaIS2_EE", !34, i64 0}
!34 = !{!"_ZTSSt12_Vector_baseI18TinyPoolBodyHandleI30TinyPublicGraphicsInstanceDataESaIS2_EE", !35, i64 0}
!35 = !{!"_ZTSNSt12_Vector_baseI18TinyPoolBodyHandleI30TinyPublicGraphicsInstanceDataESaIS2_EE12_Vector_implE", !36, i64 0}
!36 = !{!"_ZTSNSt12_Vector_baseI18TinyPoolBodyHandleI30TinyPublicGraphicsInstanceDataESaIS2_EE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!37 = !{!38, !38, i64 0}
!38 = !{!"vtable pointer", !8, i64 0}
!39 = !{!16, !16, i64 0}
!40 = !{!27, !27, i64 0}


; Effective O3 passes: EarlyCSEPass,GVNPass,GlobalOptPass,IndVarSimplifyPass,InferAlignmentPass,InferFunctionAttrsPass,InstCombinePass,LICMPass,LoopRotatePass,PostOrderFunctionAttrsPass,SLPVectorizerPass,SROAPass,SimplifyCFGPass,TailCallElimPass