; LLVM IR from paroj/gltut :: Tut 17 Spotlight on Textures/CubePointLight.ll (Z11BuildLightsRKN3glm6detail7tmat4x4IfEE)

; 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.Framework::UniformIntBinder" = type <{ %"class.Framework::UniformBinderBase", i32, [4 x i8] }>
%"class.Framework::UniformBinderBase" = type { %"class.Framework::StateBinder", %"class.std::map" }
%"class.Framework::StateBinder" = type { ptr }
%"class.std::map" = type { %"class.std::_Rb_tree" }
%"class.std::_Rb_tree" = type { %"struct.std::_Rb_tree<unsigned int, std::pair<const unsigned int, int>, std::_Select1st<std::pair<const unsigned int, int>>, std::less<unsigned int>>::_Rb_tree_impl" }
%"struct.std::_Rb_tree<unsigned int, std::pair<const unsigned int, int>, std::_Select1st<std::pair<const unsigned int, int>>, std::less<unsigned int>>::_Rb_tree_impl" = type { [8 x i8], %"struct.std::_Rb_tree_header" }
%"struct.std::_Rb_tree_header" = type { %"struct.std::_Rb_tree_node_base", i64 }
%"struct.std::_Rb_tree_node_base" = type { i32, ptr, ptr, ptr }
%struct.LightBlock = type { %"struct.glm::detail::tvec4", float, float, [2 x float], [4 x %struct.PerLight] }
%"struct.glm::detail::tvec4" = type { %union.anon.15 }
%union.anon.15 = type { %struct.anon.16 }
%struct.anon.16 = type { float, float, float, float }
%struct.PerLight = type { %"struct.glm::detail::tvec4", %"struct.glm::detail::tvec4" }

@g_lightUniformBuffer = external dso_local global i32, align 4
@g_lightNumBinder = external dso_local global %"class.Framework::UniformIntBinder", align 8
@_funcptr_glBindBuffer = external global ptr, align 8
@_funcptr_glBufferData = external global ptr, align 8
@g_bShowOtherLights = external dso_local global 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: mustprogress uwtable
define dso_local void @_Z11BuildLightsRKN3glm6detail7tmat4x4IfEE(ptr noundef nonnull align 4 dereferenceable(64) %0) #1 {
  %2 = alloca ptr, align 8
  %3 = alloca %struct.LightBlock, align 4
  %4 = alloca %"struct.glm::detail::tvec4", align 4
  %5 = alloca float, align 4
  %6 = alloca float, align 4
  %7 = alloca float, align 4
  %8 = alloca float, align 4
  %9 = alloca %"struct.glm::detail::tvec4", align 4
  %10 = alloca float, align 4
  %11 = alloca float, align 4
  %12 = alloca float, align 4
  %13 = alloca float, align 4
  %14 = alloca %"struct.glm::detail::tvec4", align 4
  %15 = alloca %"struct.glm::detail::tvec4", align 4
  %16 = alloca %"struct.glm::detail::tvec4", align 4
  %17 = alloca float, align 4
  %18 = alloca float, align 4
  %19 = alloca float, align 4
  %20 = alloca float, align 4
  %21 = alloca %"struct.glm::detail::tvec4", align 4
  %22 = alloca %"struct.glm::detail::tvec4", align 4
  %23 = alloca float, align 4
  %24 = alloca float, align 4
  %25 = alloca float, align 4
  %26 = alloca float, align 4
  %27 = alloca float, align 4
  %28 = alloca %"struct.glm::detail::tvec4", align 4
  %29 = alloca %"struct.glm::detail::tvec4", align 4
  %30 = alloca float, align 4
  %31 = alloca float, align 4
  %32 = alloca float, align 4
  %33 = alloca float, align 4
  %34 = alloca i32, align 4
  %35 = alloca i32, align 4
  store ptr %0, ptr %2, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 160, ptr %3) #5
  call void @_ZN10LightBlockC2Ev(ptr noundef nonnull align 4 dereferenceable(160) %3)
  call void @llvm.lifetime.start.p0(i64 16, ptr %4) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #5
  store float 0x3FC99999A0000000, ptr %5, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #5
  store float 0x3FC99999A0000000, ptr %6, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #5
  store float 0x3FC99999A0000000, ptr %7, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #5
  store float 1.000000e+00, ptr %8, align 4, !tbaa !9
  call void @_ZN3glm6detail5tvec4IfEC2ERKfS4_S4_S4_(ptr noundef nonnull align 4 dereferenceable(16) %4, ptr noundef nonnull align 4 dereferenceable(4) %5, ptr noundef nonnull align 4 dereferenceable(4) %6, ptr noundef nonnull align 4 dereferenceable(4) %7, ptr noundef nonnull align 4 dereferenceable(4) %8)
  %36 = getelementptr inbounds %struct.LightBlock, ptr %3, i32 0, i32 0
  %37 = call noundef nonnull align 4 dereferenceable(16) ptr @_ZN3glm6detail5tvec4IfEaSERKS2_(ptr noundef nonnull align 4 dereferenceable(16) %36, ptr noundef nonnull align 4 dereferenceable(16) %4)
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr %4) #5
  %38 = getelementptr inbounds %struct.LightBlock, ptr %3, i32 0, i32 1
  store float 0x3F52345680000000, ptr %38, align 4, !tbaa !11
  %39 = getelementptr inbounds %struct.LightBlock, ptr %3, i32 0, i32 2
  store float 2.000000e+00, ptr %39, align 4, !tbaa !14
  call void @llvm.lifetime.start.p0(i64 16, ptr %9) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #5
  store float 0x3FC99999A0000000, ptr %10, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #5
  store float 0x3FC99999A0000000, ptr %11, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #5
  store float 0x3FC99999A0000000, ptr %12, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #5
  store float 1.000000e+00, ptr %13, align 4, !tbaa !9
  call void @_ZN3glm6detail5tvec4IfEC2ERKfS4_S4_S4_(ptr noundef nonnull align 4 dereferenceable(16) %9, ptr noundef nonnull align 4 dereferenceable(4) %10, ptr noundef nonnull align 4 dereferenceable(4) %11, ptr noundef nonnull align 4 dereferenceable(4) %12, ptr noundef nonnull align 4 dereferenceable(4) %13)
  %40 = getelementptr inbounds %struct.LightBlock, ptr %3, i32 0, i32 4
  %41 = getelementptr inbounds [4 x %struct.PerLight], ptr %40, i64 0, i64 0
  %42 = getelementptr inbounds %struct.PerLight, ptr %41, i32 0, i32 1
  %43 = call noundef nonnull align 4 dereferenceable(16) ptr @_ZN3glm6detail5tvec4IfEaSERKS2_(ptr noundef nonnull align 4 dereferenceable(16) %42, ptr noundef nonnull align 4 dereferenceable(16) %9)
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr %9) #5
  call void @llvm.lifetime.start.p0(i64 16, ptr %14) #5
  %44 = load ptr, ptr %2, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 16, ptr %15) #5
  call void @llvm.lifetime.start.p0(i64 16, ptr %16) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #5
  store float 0xBFC99999A0000000, ptr %17, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #5
  store float 5.000000e-01, ptr %18, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #5
  store float 5.000000e-01, ptr %19, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %20) #5
  store float 0.000000e+00, ptr %20, align 4, !tbaa !9
  call void @_ZN3glm6detail5tvec4IfEC2ERKfS4_S4_S4_(ptr noundef nonnull align 4 dereferenceable(16) %16, ptr noundef nonnull align 4 dereferenceable(4) %17, ptr noundef nonnull align 4 dereferenceable(4) %18, ptr noundef nonnull align 4 dereferenceable(4) %19, ptr noundef nonnull align 4 dereferenceable(4) %20)
  call void @_ZN3glm9normalizeIfEENS_6detail5tvec4IT_EERKS4_(ptr dead_on_unwind writable sret(%"struct.glm::detail::tvec4") align 4 %15, ptr noundef nonnull align 4 dereferenceable(16) %16)
  call void @_ZN3glm6detailmlIfEENS0_7tmat4x4IT_E8col_typeERKS4_RKNS4_8row_typeE(ptr dead_on_unwind writable sret(%"struct.glm::detail::tvec4") align 4 %14, ptr noundef nonnull align 4 dereferenceable(64) %44, ptr noundef nonnull align 4 dereferenceable(16) %15)
  %45 = getelementptr inbounds %struct.LightBlock, ptr %3, i32 0, i32 4
  %46 = getelementptr inbounds [4 x %struct.PerLight], ptr %45, i64 0, i64 0
  %47 = getelementptr inbounds %struct.PerLight, ptr %46, i32 0, i32 0
  %48 = call noundef nonnull align 4 dereferenceable(16) ptr @_ZN3glm6detail5tvec4IfEaSERKS2_(ptr noundef nonnull align 4 dereferenceable(16) %47, ptr noundef nonnull align 4 dereferenceable(16) %14)
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr %16) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr %15) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr %14) #5
  call void @llvm.lifetime.start.p0(i64 16, ptr %21) #5
  call void @llvm.lifetime.start.p0(i64 16, ptr %22) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %23) #5
  store float 3.500000e+00, ptr %23, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %24) #5
  store float 6.500000e+00, ptr %24, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %25) #5
  store float 3.000000e+00, ptr %25, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %26) #5
  store float 1.000000e+00, ptr %26, align 4, !tbaa !9
  call void @_ZN3glm6detail5tvec4IfEC2ERKfS4_S4_S4_(ptr noundef nonnull align 4 dereferenceable(16) %22, ptr noundef nonnull align 4 dereferenceable(4) %23, ptr noundef nonnull align 4 dereferenceable(4) %24, ptr noundef nonnull align 4 dereferenceable(4) %25, ptr noundef nonnull align 4 dereferenceable(4) %26)
  call void @llvm.lifetime.start.p0(i64 4, ptr %27) #5
  store float 5.000000e-01, ptr %27, align 4, !tbaa !9
  call void @_ZN3glm6detailmlIfEENS0_5tvec4IT_EERKS4_RKNS4_10value_typeE(ptr dead_on_unwind writable sret(%"struct.glm::detail::tvec4") align 4 %21, ptr noundef nonnull align 4 dereferenceable(16) %22, ptr noundef nonnull align 4 dereferenceable(4) %27)
  %49 = getelementptr inbounds %struct.LightBlock, ptr %3, i32 0, i32 4
  %50 = getelementptr inbounds [4 x %struct.PerLight], ptr %49, i64 0, i64 1
  %51 = getelementptr inbounds %struct.PerLight, ptr %50, i32 0, i32 1
  %52 = call noundef nonnull align 4 dereferenceable(16) ptr @_ZN3glm6detail5tvec4IfEaSERKS2_(ptr noundef nonnull align 4 dereferenceable(16) %51, ptr noundef nonnull align 4 dereferenceable(16) %21)
  call void @llvm.lifetime.end.p0(i64 4, ptr %27) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %26) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %25) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %24) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %23) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr %22) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr %21) #5
  call void @llvm.lifetime.start.p0(i64 16, ptr %28) #5
  %53 = load ptr, ptr %2, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 16, ptr %29) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %30) #5
  store float 5.000000e+00, ptr %30, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %31) #5
  store float 6.000000e+00, ptr %31, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %32) #5
  store float 5.000000e-01, ptr %32, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %33) #5
  store float 1.000000e+00, ptr %33, align 4, !tbaa !9
  call void @_ZN3glm6detail5tvec4IfEC2ERKfS4_S4_S4_(ptr noundef nonnull align 4 dereferenceable(16) %29, ptr noundef nonnull align 4 dereferenceable(4) %30, ptr noundef nonnull align 4 dereferenceable(4) %31, ptr noundef nonnull align 4 dereferenceable(4) %32, ptr noundef nonnull align 4 dereferenceable(4) %33)
  call void @_ZN3glm6detailmlIfEENS0_7tmat4x4IT_E8col_typeERKS4_RKNS4_8row_typeE(ptr dead_on_unwind writable sret(%"struct.glm::detail::tvec4") align 4 %28, ptr noundef nonnull align 4 dereferenceable(64) %53, ptr noundef nonnull align 4 dereferenceable(16) %29)
  %54 = getelementptr inbounds %struct.LightBlock, ptr %3, i32 0, i32 4
  %55 = getelementptr inbounds [4 x %struct.PerLight], ptr %54, i64 0, i64 1
  %56 = getelementptr inbounds %struct.PerLight, ptr %55, i32 0, i32 0
  %57 = call noundef nonnull align 4 dereferenceable(16) ptr @_ZN3glm6detail5tvec4IfEaSERKS2_(ptr noundef nonnull align 4 dereferenceable(16) %56, ptr noundef nonnull align 4 dereferenceable(16) %28)
  call void @llvm.lifetime.end.p0(i64 4, ptr %33) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %32) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %31) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %30) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr %29) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr %28) #5
  %58 = load i8, ptr @g_bShowOtherLights, align 1, !tbaa !15, !range !17, !noundef !18
  %59 = trunc i8 %58 to i1
  br i1 %59, label %60, label %61

60:                                               ; preds = %1
  call void @llvm.lifetime.start.p0(i64 4, ptr %34) #5
  store i32 2, ptr %34, align 4, !tbaa !19
  call void @_ZN9Framework16UniformIntBinder8SetValueERKi(ptr noundef nonnull align 8 dereferenceable(60) @g_lightNumBinder, ptr noundef nonnull align 4 dereferenceable(4) %34)
  call void @llvm.lifetime.end.p0(i64 4, ptr %34) #5
  br label %62

61:                                               ; preds = %1
  call void @llvm.lifetime.start.p0(i64 4, ptr %35) #5
  store i32 0, ptr %35, align 4, !tbaa !19
  call void @_ZN9Framework16UniformIntBinder8SetValueERKi(ptr noundef nonnull align 8 dereferenceable(60) @g_lightNumBinder, ptr noundef nonnull align 4 dereferenceable(4) %35)
  call void @llvm.lifetime.end.p0(i64 4, ptr %35) #5
  br label %62

62:                                               ; preds = %61, %60
  %63 = load ptr, ptr @_funcptr_glBindBuffer, align 8, !tbaa !5
  %64 = load i32, ptr @g_lightUniformBuffer, align 4, !tbaa !19
  call void %63(i32 noundef 35345, i32 noundef %64)
  %65 = load ptr, ptr @_funcptr_glBufferData, align 8, !tbaa !5
  call void %65(i32 noundef 35345, i64 noundef 160, ptr noundef %3, i32 noundef 35040)
  call void @llvm.lifetime.end.p0(i64 160, ptr %3) #5
  ret void
}

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

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN3glm6detailmlIfEENS0_7tmat4x4IT_E8col_typeERKS4_RKNS4_8row_typeE(ptr dead_on_unwind noalias writable sret(%"struct.glm::detail::tvec4") align 4, ptr noundef nonnull align 4 dereferenceable(64), ptr noundef nonnull align 4 dereferenceable(16)) #2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN3glm9normalizeIfEENS_6detail5tvec4IT_EERKS4_(ptr dead_on_unwind noalias writable sret(%"struct.glm::detail::tvec4") align 4, ptr noundef nonnull align 4 dereferenceable(16)) #2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN3glm6detailmlIfEENS0_5tvec4IT_EERKS4_RKNS4_10value_typeE(ptr dead_on_unwind noalias writable sret(%"struct.glm::detail::tvec4") align 4, ptr noundef nonnull align 4 dereferenceable(16), ptr noundef nonnull align 4 dereferenceable(4)) #2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN9Framework16UniformIntBinder8SetValueERKi(ptr noundef nonnull align 8 dereferenceable(60), ptr noundef nonnull align 4 dereferenceable(4)) #4 align 2

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { 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 #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 }

!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, !10, i64 16}
!12 = !{!"_ZTS10LightBlock", !13, i64 0, !10, i64 16, !10, i64 20, !7, i64 24, !7, i64 32}
!13 = !{!"_ZTSN3glm6detail5tvec4IfEE", !7, i64 0}
!14 = !{!12, !10, i64 20}
!15 = !{!16, !16, i64 0}
!16 = !{!"bool", !7, i64 0}
!17 = !{i8 0, i8 2}
!18 = !{}
!19 = !{!20, !20, i64 0}
!20 = !{!"int", !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"

%"class.Framework::UniformIntBinder" = type <{ %"class.Framework::UniformBinderBase", i32, [4 x i8] }>
%"class.Framework::UniformBinderBase" = type { %"class.Framework::StateBinder", %"class.std::map" }
%"class.Framework::StateBinder" = type { ptr }
%"class.std::map" = type { %"class.std::_Rb_tree" }
%"class.std::_Rb_tree" = type { %"struct.std::_Rb_tree<unsigned int, std::pair<const unsigned int, int>, std::_Select1st<std::pair<const unsigned int, int>>, std::less<unsigned int>>::_Rb_tree_impl" }
%"struct.std::_Rb_tree<unsigned int, std::pair<const unsigned int, int>, std::_Select1st<std::pair<const unsigned int, int>>, std::less<unsigned int>>::_Rb_tree_impl" = type { [8 x i8], %"struct.std::_Rb_tree_header" }
%"struct.std::_Rb_tree_header" = type { %"struct.std::_Rb_tree_node_base", i64 }
%"struct.std::_Rb_tree_node_base" = type { i32, ptr, ptr, ptr }
%struct.LightBlock = type { %"struct.glm::detail::tvec4", float, float, [2 x float], [4 x %struct.PerLight] }
%"struct.glm::detail::tvec4" = type { %union.anon.15 }
%union.anon.15 = type { %struct.anon.16 }
%struct.anon.16 = type { float, float, float, float }
%struct.PerLight = type { %"struct.glm::detail::tvec4", %"struct.glm::detail::tvec4" }

@g_lightUniformBuffer = external dso_local local_unnamed_addr global i32, align 4
@g_lightNumBinder = external dso_local global %"class.Framework::UniformIntBinder", align 8
@_funcptr_glBindBuffer = external local_unnamed_addr global ptr, align 8
@_funcptr_glBufferData = external local_unnamed_addr global ptr, align 8
@g_bShowOtherLights = external dso_local local_unnamed_addr global 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: mustprogress uwtable
define dso_local void @_Z11BuildLightsRKN3glm6detail7tmat4x4IfEE(ptr noundef nonnull align 4 dereferenceable(64) %0) local_unnamed_addr #1 {
  %2 = alloca %struct.LightBlock, align 4
  %3 = alloca %"struct.glm::detail::tvec4", align 4
  %4 = alloca float, align 4
  %5 = alloca float, align 4
  %6 = alloca float, align 4
  %7 = alloca float, align 4
  %8 = alloca %"struct.glm::detail::tvec4", align 4
  %9 = alloca float, align 4
  %10 = alloca float, align 4
  %11 = alloca float, align 4
  %12 = alloca float, align 4
  %13 = alloca %"struct.glm::detail::tvec4", align 4
  %14 = alloca %"struct.glm::detail::tvec4", align 4
  %15 = alloca %"struct.glm::detail::tvec4", align 4
  %16 = alloca float, align 4
  %17 = alloca float, align 4
  %18 = alloca float, align 4
  %19 = alloca float, align 4
  %20 = alloca %"struct.glm::detail::tvec4", align 4
  %21 = alloca %"struct.glm::detail::tvec4", align 4
  %22 = alloca float, align 4
  %23 = alloca float, align 4
  %24 = alloca float, align 4
  %25 = alloca float, align 4
  %26 = alloca float, align 4
  %27 = alloca %"struct.glm::detail::tvec4", align 4
  %28 = alloca %"struct.glm::detail::tvec4", align 4
  %29 = alloca float, align 4
  %30 = alloca float, align 4
  %31 = alloca float, align 4
  %32 = alloca float, align 4
  %33 = alloca i32, align 4
  %34 = alloca i32, align 4
  call void @llvm.lifetime.start.p0(i64 160, ptr nonnull %2) #5
  call void @_ZN10LightBlockC2Ev(ptr noundef nonnull align 4 dereferenceable(160) %2)
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %3) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %4) #5
  store float 0x3FC99999A0000000, ptr %4, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %5) #5
  store float 0x3FC99999A0000000, ptr %5, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %6) #5
  store float 0x3FC99999A0000000, ptr %6, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %7) #5
  store float 1.000000e+00, ptr %7, align 4, !tbaa !5
  call void @_ZN3glm6detail5tvec4IfEC2ERKfS4_S4_S4_(ptr noundef nonnull align 4 dereferenceable(16) %3, ptr noundef nonnull align 4 dereferenceable(4) %4, ptr noundef nonnull align 4 dereferenceable(4) %5, ptr noundef nonnull align 4 dereferenceable(4) %6, ptr noundef nonnull align 4 dereferenceable(4) %7)
  %35 = call noundef nonnull align 4 dereferenceable(16) ptr @_ZN3glm6detail5tvec4IfEaSERKS2_(ptr noundef nonnull align 4 dereferenceable(16) %2, ptr noundef nonnull align 4 dereferenceable(16) %3)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %7) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %6) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %3) #5
  %36 = getelementptr inbounds i8, ptr %2, i64 16
  store <2 x float> <float 0x3F52345680000000, float 2.000000e+00>, ptr %36, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %8) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %9) #5
  store float 0x3FC99999A0000000, ptr %9, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %10) #5
  store float 0x3FC99999A0000000, ptr %10, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %11) #5
  store float 0x3FC99999A0000000, ptr %11, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %12) #5
  store float 1.000000e+00, ptr %12, align 4, !tbaa !5
  call void @_ZN3glm6detail5tvec4IfEC2ERKfS4_S4_S4_(ptr noundef nonnull align 4 dereferenceable(16) %8, ptr noundef nonnull align 4 dereferenceable(4) %9, ptr noundef nonnull align 4 dereferenceable(4) %10, ptr noundef nonnull align 4 dereferenceable(4) %11, ptr noundef nonnull align 4 dereferenceable(4) %12)
  %37 = getelementptr inbounds i8, ptr %2, i64 32
  %38 = getelementptr inbounds i8, ptr %2, i64 48
  %39 = call noundef nonnull align 4 dereferenceable(16) ptr @_ZN3glm6detail5tvec4IfEaSERKS2_(ptr noundef nonnull align 4 dereferenceable(16) %38, ptr noundef nonnull align 4 dereferenceable(16) %8)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %12) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %11) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %10) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %9) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %8) #5
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %13) #5
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %14) #5
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %15) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %16) #5
  store float 0xBFC99999A0000000, ptr %16, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %17) #5
  store float 5.000000e-01, ptr %17, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %18) #5
  store float 5.000000e-01, ptr %18, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %19) #5
  store float 0.000000e+00, ptr %19, align 4, !tbaa !5
  call void @_ZN3glm6detail5tvec4IfEC2ERKfS4_S4_S4_(ptr noundef nonnull align 4 dereferenceable(16) %15, ptr noundef nonnull align 4 dereferenceable(4) %16, 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 @_ZN3glm9normalizeIfEENS_6detail5tvec4IT_EERKS4_(ptr dead_on_unwind nonnull writable sret(%"struct.glm::detail::tvec4") align 4 %14, ptr noundef nonnull align 4 dereferenceable(16) %15)
  call void @_ZN3glm6detailmlIfEENS0_7tmat4x4IT_E8col_typeERKS4_RKNS4_8row_typeE(ptr dead_on_unwind nonnull writable sret(%"struct.glm::detail::tvec4") align 4 %13, ptr noundef nonnull align 4 dereferenceable(64) %0, ptr noundef nonnull align 4 dereferenceable(16) %14)
  %40 = call noundef nonnull align 4 dereferenceable(16) ptr @_ZN3glm6detail5tvec4IfEaSERKS2_(ptr noundef nonnull align 4 dereferenceable(16) %37, ptr noundef nonnull align 4 dereferenceable(16) %13)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %19) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %18) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %17) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %16) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %15) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %14) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %13) #5
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %20) #5
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %21) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %22) #5
  store float 3.500000e+00, ptr %22, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %23) #5
  store float 6.500000e+00, ptr %23, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %24) #5
  store float 3.000000e+00, ptr %24, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %25) #5
  store float 1.000000e+00, ptr %25, align 4, !tbaa !5
  call void @_ZN3glm6detail5tvec4IfEC2ERKfS4_S4_S4_(ptr noundef nonnull align 4 dereferenceable(16) %21, ptr noundef nonnull align 4 dereferenceable(4) %22, ptr noundef nonnull align 4 dereferenceable(4) %23, ptr noundef nonnull align 4 dereferenceable(4) %24, ptr noundef nonnull align 4 dereferenceable(4) %25)
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %26) #5
  store float 5.000000e-01, ptr %26, align 4, !tbaa !5
  call void @_ZN3glm6detailmlIfEENS0_5tvec4IT_EERKS4_RKNS4_10value_typeE(ptr dead_on_unwind nonnull writable sret(%"struct.glm::detail::tvec4") align 4 %20, ptr noundef nonnull align 4 dereferenceable(16) %21, ptr noundef nonnull align 4 dereferenceable(4) %26)
  %41 = getelementptr inbounds i8, ptr %2, i64 64
  %42 = getelementptr inbounds i8, ptr %2, i64 80
  %43 = call noundef nonnull align 4 dereferenceable(16) ptr @_ZN3glm6detail5tvec4IfEaSERKS2_(ptr noundef nonnull align 4 dereferenceable(16) %42, ptr noundef nonnull align 4 dereferenceable(16) %20)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %26) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %25) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %24) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %23) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %22) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %21) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %20) #5
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %27) #5
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %28) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %29) #5
  store float 5.000000e+00, ptr %29, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %30) #5
  store float 6.000000e+00, ptr %30, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %31) #5
  store float 5.000000e-01, ptr %31, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %32) #5
  store float 1.000000e+00, ptr %32, align 4, !tbaa !5
  call void @_ZN3glm6detail5tvec4IfEC2ERKfS4_S4_S4_(ptr noundef nonnull align 4 dereferenceable(16) %28, ptr noundef nonnull align 4 dereferenceable(4) %29, ptr noundef nonnull align 4 dereferenceable(4) %30, ptr noundef nonnull align 4 dereferenceable(4) %31, ptr noundef nonnull align 4 dereferenceable(4) %32)
  call void @_ZN3glm6detailmlIfEENS0_7tmat4x4IT_E8col_typeERKS4_RKNS4_8row_typeE(ptr dead_on_unwind nonnull writable sret(%"struct.glm::detail::tvec4") align 4 %27, ptr noundef nonnull align 4 dereferenceable(64) %0, ptr noundef nonnull align 4 dereferenceable(16) %28)
  %44 = call noundef nonnull align 4 dereferenceable(16) ptr @_ZN3glm6detail5tvec4IfEaSERKS2_(ptr noundef nonnull align 4 dereferenceable(16) %41, ptr noundef nonnull align 4 dereferenceable(16) %27)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %32) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %31) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %30) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %29) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %28) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %27) #5
  %45 = load i8, ptr @g_bShowOtherLights, align 1, !tbaa !9, !range !11, !noundef !12
  %46 = trunc nuw i8 %45 to i1
  br i1 %46, label %47, label %48

47:                                               ; preds = %1
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %33) #5
  store i32 2, ptr %33, align 4, !tbaa !13
  call void @_ZN9Framework16UniformIntBinder8SetValueERKi(ptr noundef nonnull align 8 dereferenceable(60) @g_lightNumBinder, ptr noundef nonnull align 4 dereferenceable(4) %33)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %33) #5
  br label %49

48:                                               ; preds = %1
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %34) #5
  store i32 0, ptr %34, align 4, !tbaa !13
  call void @_ZN9Framework16UniformIntBinder8SetValueERKi(ptr noundef nonnull align 8 dereferenceable(60) @g_lightNumBinder, ptr noundef nonnull align 4 dereferenceable(4) %34)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %34) #5
  br label %49

49:                                               ; preds = %48, %47
  %50 = load ptr, ptr @_funcptr_glBindBuffer, align 8, !tbaa !15
  %51 = load i32, ptr @g_lightUniformBuffer, align 4, !tbaa !13
  call void %50(i32 noundef 35345, i32 noundef %51)
  %52 = load ptr, ptr @_funcptr_glBufferData, align 8, !tbaa !15
  call void %52(i32 noundef 35345, i64 noundef 160, ptr noundef nonnull %2, i32 noundef 35040)
  call void @llvm.lifetime.end.p0(i64 160, ptr nonnull %2) #5
  ret void
}

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

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN3glm6detailmlIfEENS0_7tmat4x4IT_E8col_typeERKS4_RKNS4_8row_typeE(ptr dead_on_unwind noalias writable sret(%"struct.glm::detail::tvec4") align 4, ptr noundef nonnull align 4 dereferenceable(64), ptr noundef nonnull align 4 dereferenceable(16)) local_unnamed_addr #2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN3glm9normalizeIfEENS_6detail5tvec4IT_EERKS4_(ptr dead_on_unwind noalias writable sret(%"struct.glm::detail::tvec4") align 4, ptr noundef nonnull align 4 dereferenceable(16)) local_unnamed_addr #2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN3glm6detailmlIfEENS0_5tvec4IT_EERKS4_RKNS4_10value_typeE(ptr dead_on_unwind noalias writable sret(%"struct.glm::detail::tvec4") align 4, ptr noundef nonnull align 4 dereferenceable(16), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN9Framework16UniformIntBinder8SetValueERKi(ptr noundef nonnull align 8 dereferenceable(60), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #4 align 2

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { 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 #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 }

!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 = !{!"float", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"bool", !7, i64 0}
!11 = !{i8 0, i8 2}
!12 = !{}
!13 = !{!14, !14, i64 0}
!14 = !{!"int", !7, i64 0}
!15 = !{!16, !16, i64 0}
!16 = !{!"any pointer", !7, i64 0}


; Effective O3 passes: EarlyCSEPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,SLPVectorizerPass,SROAPass