; LLVM IR from paroj/gltut :: Tut 12 Dynamic Range/SceneLighting.ll (Z8keyboardhii)

; 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.LightManager = type { %"class.Framework::Timer", %"class.Framework::TimedLinearInterpolator", %"class.Framework::TimedLinearInterpolator", %"class.Framework::TimedLinearInterpolator", %"class.Framework::TimedLinearInterpolator.8", %"class.std::vector.15", %"class.std::vector.20", %"class.std::vector.25", %"class.std::map" }
%"class.Framework::Timer" = type { i32, float, i8, i8, float, float }
%"class.Framework::TimedLinearInterpolator" = type { %"class.Framework::WeightedLinearInterpolator" }
%"class.Framework::WeightedLinearInterpolator" = type { %"class.std::vector.3" }
%"class.std::vector.3" = type { %"struct.std::_Vector_base.4" }
%"struct.std::_Vector_base.4" = type { %"struct.std::_Vector_base<Framework::WeightedLinearInterpolator<glm::detail::tvec4<float>>::Data, std::allocator<Framework::WeightedLinearInterpolator<glm::detail::tvec4<float>>::Data>>::_Vector_impl" }
%"struct.std::_Vector_base<Framework::WeightedLinearInterpolator<glm::detail::tvec4<float>>::Data, std::allocator<Framework::WeightedLinearInterpolator<glm::detail::tvec4<float>>::Data>>::_Vector_impl" = type { %"struct.std::_Vector_base<Framework::WeightedLinearInterpolator<glm::detail::tvec4<float>>::Data, std::allocator<Framework::WeightedLinearInterpolator<glm::detail::tvec4<float>>::Data>>::_Vector_impl_data" }
%"struct.std::_Vector_base<Framework::WeightedLinearInterpolator<glm::detail::tvec4<float>>::Data, std::allocator<Framework::WeightedLinearInterpolator<glm::detail::tvec4<float>>::Data>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.Framework::TimedLinearInterpolator.8" = type { %"class.Framework::WeightedLinearInterpolator.9" }
%"class.Framework::WeightedLinearInterpolator.9" = type { %"class.std::vector.10" }
%"class.std::vector.10" = type { %"struct.std::_Vector_base.11" }
%"struct.std::_Vector_base.11" = type { %"struct.std::_Vector_base<Framework::WeightedLinearInterpolator<float>::Data, std::allocator<Framework::WeightedLinearInterpolator<float>::Data>>::_Vector_impl" }
%"struct.std::_Vector_base<Framework::WeightedLinearInterpolator<float>::Data, std::allocator<Framework::WeightedLinearInterpolator<float>::Data>>::_Vector_impl" = type { %"struct.std::_Vector_base<Framework::WeightedLinearInterpolator<float>::Data, std::allocator<Framework::WeightedLinearInterpolator<float>::Data>>::_Vector_impl_data" }
%"struct.std::_Vector_base<Framework::WeightedLinearInterpolator<float>::Data, std::allocator<Framework::WeightedLinearInterpolator<float>::Data>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::vector.15" = type { %"struct.std::_Vector_base.16" }
%"struct.std::_Vector_base.16" = type { %"struct.std::_Vector_base<Framework::ConstVelLinearInterpolator<glm::detail::tvec3<float>>, std::allocator<Framework::ConstVelLinearInterpolator<glm::detail::tvec3<float>>>>::_Vector_impl" }
%"struct.std::_Vector_base<Framework::ConstVelLinearInterpolator<glm::detail::tvec3<float>>, std::allocator<Framework::ConstVelLinearInterpolator<glm::detail::tvec3<float>>>>::_Vector_impl" = type { %"struct.std::_Vector_base<Framework::ConstVelLinearInterpolator<glm::detail::tvec3<float>>, std::allocator<Framework::ConstVelLinearInterpolator<glm::detail::tvec3<float>>>>::_Vector_impl_data" }
%"struct.std::_Vector_base<Framework::ConstVelLinearInterpolator<glm::detail::tvec3<float>>, std::allocator<Framework::ConstVelLinearInterpolator<glm::detail::tvec3<float>>>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::vector.20" = type { %"struct.std::_Vector_base.21" }
%"struct.std::_Vector_base.21" = type { %"struct.std::_Vector_base<glm::detail::tvec4<float>, std::allocator<glm::detail::tvec4<float>>>::_Vector_impl" }
%"struct.std::_Vector_base<glm::detail::tvec4<float>, std::allocator<glm::detail::tvec4<float>>>::_Vector_impl" = type { %"struct.std::_Vector_base<glm::detail::tvec4<float>, std::allocator<glm::detail::tvec4<float>>>::_Vector_impl_data" }
%"struct.std::_Vector_base<glm::detail::tvec4<float>, std::allocator<glm::detail::tvec4<float>>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::vector.25" = type { %"struct.std::_Vector_base.26" }
%"struct.std::_Vector_base.26" = type { %"struct.std::_Vector_base<Framework::Timer, std::allocator<Framework::Timer>>::_Vector_impl" }
%"struct.std::_Vector_base<Framework::Timer, std::allocator<Framework::Timer>>::_Vector_impl" = type { %"struct.std::_Vector_base<Framework::Timer, std::allocator<Framework::Timer>>::_Vector_impl_data" }
%"struct.std::_Vector_base<Framework::Timer, std::allocator<Framework::Timer>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::map" = type { %"class.std::_Rb_tree" }
%"class.std::_Rb_tree" = type { %"struct.std::_Rb_tree<std::__cxx11::basic_string<char>, std::pair<const std::__cxx11::basic_string<char>, Framework::Timer>, std::_Select1st<std::pair<const std::__cxx11::basic_string<char>, Framework::Timer>>, std::less<std::__cxx11::basic_string<char>>>::_Rb_tree_impl" }
%"struct.std::_Rb_tree<std::__cxx11::basic_string<char>, std::pair<const std::__cxx11::basic_string<char>, Framework::Timer>, std::_Select1st<std::pair<const std::__cxx11::basic_string<char>, Framework::Timer>>, std::less<std::__cxx11::basic_string<char>>>::_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 }
%"class.glutil::ViewPole" = type <{ %"class.glutil::ViewProvider", %"struct.glutil::ViewData", %"struct.glutil::ViewScale", %"struct.glutil::ViewData", i32, i8, i8, [2 x i8], i32, float, %"struct.glm::detail::tvec2", %"struct.glm::detail::tquat", [4 x i8] }>
%"class.glutil::ViewProvider" = type { ptr }
%"struct.glutil::ViewScale" = type { float, float, float, float, float, float, float }
%"struct.glutil::ViewData" = type { %"struct.glm::detail::tvec3", %"struct.glm::detail::tquat", float, float }
%"struct.glm::detail::tvec3" = type { %union.anon.33 }
%union.anon.33 = type { %struct.anon }
%struct.anon = type { float, float, float }
%"struct.glm::detail::tvec2" = type { %union.anon.36 }
%union.anon.36 = type { %struct.anon.37 }
%struct.anon.37 = type { i32, i32 }
%"struct.glm::detail::tquat" = type { float, float, float, float }

@g_lights = external dso_local global %class.LightManager, align 8
@g_viewPole = external dso_local global %"class.glutil::ViewPole", align 8
@g_pScene = external dso_local global ptr, align 8
@g_bDrawCameraPos = external dso_local global i8, align 1
@g_eTimerMode = external dso_local global i32, align 4
@.str.20 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.21 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.22 = external hidden unnamed_addr constant [8 x i8], align 1
@.str.23 = external hidden unnamed_addr constant [11 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: mustprogress uwtable
declare dso_local void @_Z20SetupDaytimeLightingv() #1

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z22SetupNighttimeLightingv() #1

; Function Attrs: nobuiltin nounwind
declare void @_ZdlPvm(ptr noundef, i64 noundef) #2

declare i32 @printf(ptr noundef, ...) #3

; Function Attrs: mustprogress uwtable
define dso_local void @_Z8keyboardhii(i8 noundef zeroext %0, i32 noundef %1, i32 noundef %2) #1 {
  %4 = alloca i8, align 1
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca i8, align 1
  %8 = alloca i8, align 1
  %9 = alloca i32, align 4
  %10 = alloca float, align 4
  %11 = alloca float, align 4
  %12 = alloca i32, align 4
  %13 = alloca float, align 4
  %14 = alloca i32, align 4
  store i8 %0, ptr %4, align 1, !tbaa !5
  store i32 %1, ptr %5, align 4, !tbaa !8
  store i32 %2, ptr %6, align 4, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 1, ptr %7) #6
  store i8 0, ptr %7, align 1, !tbaa !10
  call void @llvm.lifetime.start.p0(i64 1, ptr %8) #6
  store i8 0, ptr %8, align 1, !tbaa !10
  %15 = load i8, ptr %4, align 1, !tbaa !5
  %16 = zext i8 %15 to i32
  switch i32 %16, label %66 [
    i32 27, label %17
    i32 112, label %22
    i32 45, label %24
    i32 61, label %26
    i32 116, label %28
    i32 49, label %33
    i32 50, label %35
    i32 51, label %37
    i32 108, label %39
    i32 76, label %40
    i32 32, label %41
  ]

17:                                               ; preds = %3
  %18 = load ptr, ptr @g_pScene, align 8, !tbaa !12
  %19 = icmp eq ptr %18, null
  br i1 %19, label %21, label %20

20:                                               ; preds = %17
  call void @_ZN5SceneD2Ev(ptr noundef nonnull align 8 dereferenceable(48) %18) #6
  call void @_ZdlPvm(ptr noundef %18, i64 noundef 48) #7
  br label %21

21:                                               ; preds = %20, %17
  store ptr null, ptr @g_pScene, align 8, !tbaa !12
  call void @glutLeaveMainLoop()
  store i32 1, ptr %9, align 4
  br label %68

22:                                               ; preds = %3
  %23 = load i32, ptr @g_eTimerMode, align 4, !tbaa !14
  call void @_ZN12LightManager11TogglePauseE10TimerTypes(ptr noundef nonnull align 8 dereferenceable(240) @g_lights, i32 noundef %23)
  br label %66

24:                                               ; preds = %3
  %25 = load i32, ptr @g_eTimerMode, align 4, !tbaa !14
  call void @_ZN12LightManager10RewindTimeE10TimerTypesf(ptr noundef nonnull align 8 dereferenceable(240) @g_lights, i32 noundef %25, float noundef 1.000000e+00)
  br label %66

26:                                               ; preds = %3
  %27 = load i32, ptr @g_eTimerMode, align 4, !tbaa !14
  call void @_ZN12LightManager15FastForwardTimeE10TimerTypesf(ptr noundef nonnull align 8 dereferenceable(240) @g_lights, i32 noundef %27, float noundef 1.000000e+00)
  br label %66

28:                                               ; preds = %3
  %29 = load i8, ptr @g_bDrawCameraPos, align 1, !tbaa !10, !range !16, !noundef !17
  %30 = trunc i8 %29 to i1
  %31 = xor i1 %30, true
  %32 = zext i1 %31 to i8
  store i8 %32, ptr @g_bDrawCameraPos, align 1, !tbaa !10
  br label %66

33:                                               ; preds = %3
  store i32 2, ptr @g_eTimerMode, align 4, !tbaa !14
  %34 = call i32 (ptr, ...) @printf(ptr noundef @.str.20)
  br label %66

35:                                               ; preds = %3
  store i32 0, ptr @g_eTimerMode, align 4, !tbaa !14
  %36 = call i32 (ptr, ...) @printf(ptr noundef @.str.21)
  br label %66

37:                                               ; preds = %3
  store i32 1, ptr @g_eTimerMode, align 4, !tbaa !14
  %38 = call i32 (ptr, ...) @printf(ptr noundef @.str.22)
  br label %66

39:                                               ; preds = %3
  call void @_Z20SetupDaytimeLightingv()
  br label %66

40:                                               ; preds = %3
  call void @_Z22SetupNighttimeLightingv()
  br label %66

41:                                               ; preds = %3
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #6
  %42 = call noundef float @_ZNK12LightManager10GetSunTimeEv(ptr noundef nonnull align 8 dereferenceable(240) @g_lights)
  store float %42, ptr %10, align 4, !tbaa !18
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #6
  %43 = load float, ptr %10, align 4, !tbaa !18
  %44 = call float @llvm.fmuladd.f32(float %43, float 2.400000e+01, float 1.200000e+01)
  store float %44, ptr %11, align 4, !tbaa !18
  %45 = load float, ptr %11, align 4, !tbaa !18
  %46 = fcmp ogt float %45, 2.400000e+01
  br i1 %46, label %47, label %50

47:                                               ; preds = %41
  %48 = load float, ptr %11, align 4, !tbaa !18
  %49 = fsub float %48, 2.400000e+01
  br label %52

50:                                               ; preds = %41
  %51 = load float, ptr %11, align 4, !tbaa !18
  br label %52

52:                                               ; preds = %50, %47
  %53 = phi float [ %49, %47 ], [ %51, %50 ]
  store float %53, ptr %11, align 4, !tbaa !18
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #6
  %54 = load float, ptr %11, align 4, !tbaa !18
  %55 = fptosi float %54 to i32
  store i32 %55, ptr %12, align 4, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #6
  %56 = load float, ptr %11, align 4, !tbaa !18
  %57 = load i32, ptr %12, align 4, !tbaa !8
  %58 = sitofp i32 %57 to float
  %59 = fsub float %56, %58
  %60 = fmul float %59, 6.000000e+01
  store float %60, ptr %13, align 4, !tbaa !18
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #6
  %61 = load float, ptr %13, align 4, !tbaa !18
  %62 = fptosi float %61 to i32
  store i32 %62, ptr %14, align 4, !tbaa !8
  %63 = load i32, ptr %12, align 4, !tbaa !8
  %64 = load i32, ptr %14, align 4, !tbaa !8
  %65 = call i32 (ptr, ...) @printf(ptr noundef @.str.23, i32 noundef %63, i32 noundef %64)
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #6
  br label %66

66:                                               ; preds = %52, %40, %39, %37, %35, %33, %28, %26, %24, %22, %3
  %67 = load i8, ptr %4, align 1, !tbaa !5
  call void @_ZN6glutil8ViewPole9CharPressEc(ptr noundef nonnull align 8 dereferenceable(148) @g_viewPole, i8 noundef signext %67)
  store i32 0, ptr %9, align 4
  br label %68

68:                                               ; preds = %66, %21
  call void @llvm.lifetime.end.p0(i64 1, ptr %8) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr %7) #6
  %69 = load i32, ptr %9, align 4
  switch i32 %69, label %71 [
    i32 0, label %70
    i32 1, label %70
  ]

70:                                               ; preds = %68, %68
  ret void

71:                                               ; preds = %68
  unreachable
}

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN5SceneD2Ev(ptr noundef nonnull align 8 dereferenceable(48)) unnamed_addr #4 align 2

declare void @glutLeaveMainLoop() #3

declare void @_ZN12LightManager11TogglePauseE10TimerTypes(ptr noundef nonnull align 8 dereferenceable(240), i32 noundef) #3

declare void @_ZN12LightManager10RewindTimeE10TimerTypesf(ptr noundef nonnull align 8 dereferenceable(240), i32 noundef, float noundef) #3

declare void @_ZN12LightManager15FastForwardTimeE10TimerTypesf(ptr noundef nonnull align 8 dereferenceable(240), i32 noundef, float noundef) #3

declare noundef float @_ZNK12LightManager10GetSunTimeEv(ptr noundef nonnull align 8 dereferenceable(240)) #3

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare float @llvm.fmuladd.f32(float, float, float) #5

declare void @_ZN6glutil8ViewPole9CharPressEc(ptr noundef nonnull align 8 dereferenceable(148), i8 noundef signext) #3

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 = { nobuiltin 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 = { "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 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #6 = { nounwind }
attributes #7 = { builtin 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 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C++ TBAA"}
!8 = !{!9, !9, i64 0}
!9 = !{!"int", !6, i64 0}
!10 = !{!11, !11, i64 0}
!11 = !{!"bool", !6, i64 0}
!12 = !{!13, !13, i64 0}
!13 = !{!"any pointer", !6, i64 0}
!14 = !{!15, !15, i64 0}
!15 = !{!"_ZTS10TimerTypes", !6, i64 0}
!16 = !{i8 0, i8 2}
!17 = !{}
!18 = !{!19, !19, i64 0}
!19 = !{!"float", !6, 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.LightManager = type { %"class.Framework::Timer", %"class.Framework::TimedLinearInterpolator", %"class.Framework::TimedLinearInterpolator", %"class.Framework::TimedLinearInterpolator", %"class.Framework::TimedLinearInterpolator.8", %"class.std::vector.15", %"class.std::vector.20", %"class.std::vector.25", %"class.std::map" }
%"class.Framework::Timer" = type { i32, float, i8, i8, float, float }
%"class.Framework::TimedLinearInterpolator" = type { %"class.Framework::WeightedLinearInterpolator" }
%"class.Framework::WeightedLinearInterpolator" = type { %"class.std::vector.3" }
%"class.std::vector.3" = type { %"struct.std::_Vector_base.4" }
%"struct.std::_Vector_base.4" = type { %"struct.std::_Vector_base<Framework::WeightedLinearInterpolator<glm::detail::tvec4<float>>::Data, std::allocator<Framework::WeightedLinearInterpolator<glm::detail::tvec4<float>>::Data>>::_Vector_impl" }
%"struct.std::_Vector_base<Framework::WeightedLinearInterpolator<glm::detail::tvec4<float>>::Data, std::allocator<Framework::WeightedLinearInterpolator<glm::detail::tvec4<float>>::Data>>::_Vector_impl" = type { %"struct.std::_Vector_base<Framework::WeightedLinearInterpolator<glm::detail::tvec4<float>>::Data, std::allocator<Framework::WeightedLinearInterpolator<glm::detail::tvec4<float>>::Data>>::_Vector_impl_data" }
%"struct.std::_Vector_base<Framework::WeightedLinearInterpolator<glm::detail::tvec4<float>>::Data, std::allocator<Framework::WeightedLinearInterpolator<glm::detail::tvec4<float>>::Data>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.Framework::TimedLinearInterpolator.8" = type { %"class.Framework::WeightedLinearInterpolator.9" }
%"class.Framework::WeightedLinearInterpolator.9" = type { %"class.std::vector.10" }
%"class.std::vector.10" = type { %"struct.std::_Vector_base.11" }
%"struct.std::_Vector_base.11" = type { %"struct.std::_Vector_base<Framework::WeightedLinearInterpolator<float>::Data, std::allocator<Framework::WeightedLinearInterpolator<float>::Data>>::_Vector_impl" }
%"struct.std::_Vector_base<Framework::WeightedLinearInterpolator<float>::Data, std::allocator<Framework::WeightedLinearInterpolator<float>::Data>>::_Vector_impl" = type { %"struct.std::_Vector_base<Framework::WeightedLinearInterpolator<float>::Data, std::allocator<Framework::WeightedLinearInterpolator<float>::Data>>::_Vector_impl_data" }
%"struct.std::_Vector_base<Framework::WeightedLinearInterpolator<float>::Data, std::allocator<Framework::WeightedLinearInterpolator<float>::Data>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::vector.15" = type { %"struct.std::_Vector_base.16" }
%"struct.std::_Vector_base.16" = type { %"struct.std::_Vector_base<Framework::ConstVelLinearInterpolator<glm::detail::tvec3<float>>, std::allocator<Framework::ConstVelLinearInterpolator<glm::detail::tvec3<float>>>>::_Vector_impl" }
%"struct.std::_Vector_base<Framework::ConstVelLinearInterpolator<glm::detail::tvec3<float>>, std::allocator<Framework::ConstVelLinearInterpolator<glm::detail::tvec3<float>>>>::_Vector_impl" = type { %"struct.std::_Vector_base<Framework::ConstVelLinearInterpolator<glm::detail::tvec3<float>>, std::allocator<Framework::ConstVelLinearInterpolator<glm::detail::tvec3<float>>>>::_Vector_impl_data" }
%"struct.std::_Vector_base<Framework::ConstVelLinearInterpolator<glm::detail::tvec3<float>>, std::allocator<Framework::ConstVelLinearInterpolator<glm::detail::tvec3<float>>>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::vector.20" = type { %"struct.std::_Vector_base.21" }
%"struct.std::_Vector_base.21" = type { %"struct.std::_Vector_base<glm::detail::tvec4<float>, std::allocator<glm::detail::tvec4<float>>>::_Vector_impl" }
%"struct.std::_Vector_base<glm::detail::tvec4<float>, std::allocator<glm::detail::tvec4<float>>>::_Vector_impl" = type { %"struct.std::_Vector_base<glm::detail::tvec4<float>, std::allocator<glm::detail::tvec4<float>>>::_Vector_impl_data" }
%"struct.std::_Vector_base<glm::detail::tvec4<float>, std::allocator<glm::detail::tvec4<float>>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::vector.25" = type { %"struct.std::_Vector_base.26" }
%"struct.std::_Vector_base.26" = type { %"struct.std::_Vector_base<Framework::Timer, std::allocator<Framework::Timer>>::_Vector_impl" }
%"struct.std::_Vector_base<Framework::Timer, std::allocator<Framework::Timer>>::_Vector_impl" = type { %"struct.std::_Vector_base<Framework::Timer, std::allocator<Framework::Timer>>::_Vector_impl_data" }
%"struct.std::_Vector_base<Framework::Timer, std::allocator<Framework::Timer>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::map" = type { %"class.std::_Rb_tree" }
%"class.std::_Rb_tree" = type { %"struct.std::_Rb_tree<std::__cxx11::basic_string<char>, std::pair<const std::__cxx11::basic_string<char>, Framework::Timer>, std::_Select1st<std::pair<const std::__cxx11::basic_string<char>, Framework::Timer>>, std::less<std::__cxx11::basic_string<char>>>::_Rb_tree_impl" }
%"struct.std::_Rb_tree<std::__cxx11::basic_string<char>, std::pair<const std::__cxx11::basic_string<char>, Framework::Timer>, std::_Select1st<std::pair<const std::__cxx11::basic_string<char>, Framework::Timer>>, std::less<std::__cxx11::basic_string<char>>>::_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 }
%"class.glutil::ViewPole" = type <{ %"class.glutil::ViewProvider", %"struct.glutil::ViewData", %"struct.glutil::ViewScale", %"struct.glutil::ViewData", i32, i8, i8, [2 x i8], i32, float, %"struct.glm::detail::tvec2", %"struct.glm::detail::tquat", [4 x i8] }>
%"class.glutil::ViewProvider" = type { ptr }
%"struct.glutil::ViewScale" = type { float, float, float, float, float, float, float }
%"struct.glutil::ViewData" = type { %"struct.glm::detail::tvec3", %"struct.glm::detail::tquat", float, float }
%"struct.glm::detail::tvec3" = type { %union.anon.33 }
%union.anon.33 = type { %struct.anon }
%struct.anon = type { float, float, float }
%"struct.glm::detail::tvec2" = type { %union.anon.36 }
%union.anon.36 = type { %struct.anon.37 }
%struct.anon.37 = type { i32, i32 }
%"struct.glm::detail::tquat" = type { float, float, float, float }

@g_lights = external dso_local global %class.LightManager, align 8
@g_viewPole = external dso_local global %"class.glutil::ViewPole", align 8
@g_pScene = external dso_local local_unnamed_addr global ptr, align 8
@g_bDrawCameraPos = external dso_local local_unnamed_addr global i8, align 1
@g_eTimerMode = external dso_local local_unnamed_addr global i32, align 4
@.str.20 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.21 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.22 = external hidden unnamed_addr constant [8 x i8], align 1
@.str.23 = external hidden unnamed_addr constant [11 x i8], align 1

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z20SetupDaytimeLightingv() local_unnamed_addr #0

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z22SetupNighttimeLightingv() local_unnamed_addr #0

; Function Attrs: nobuiltin nounwind
declare void @_ZdlPvm(ptr noundef, i64 noundef) local_unnamed_addr #1

; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2

; Function Attrs: mustprogress uwtable
define dso_local void @_Z8keyboardhii(i8 noundef zeroext %0, i32 noundef %1, i32 noundef %2) local_unnamed_addr #0 {
  switch i8 %0, label %38 [
    i8 27, label %4
    i8 112, label %9
    i8 45, label %11
    i8 61, label %13
    i8 116, label %15
    i8 49, label %18
    i8 50, label %20
    i8 51, label %22
    i8 108, label %24
    i8 76, label %25
    i8 32, label %26
  ]

4:                                                ; preds = %3
  %5 = load ptr, ptr @g_pScene, align 8, !tbaa !5
  %6 = icmp eq ptr %5, null
  br i1 %6, label %8, label %7

7:                                                ; preds = %4
  tail call void @_ZN5SceneD2Ev(ptr noundef nonnull align 8 dereferenceable(48) %5) #6
  tail call void @_ZdlPvm(ptr noundef nonnull %5, i64 noundef 48) #7
  br label %8

8:                                                ; preds = %7, %4
  store ptr null, ptr @g_pScene, align 8, !tbaa !5
  tail call void @glutLeaveMainLoop()
  br label %39

9:                                                ; preds = %3
  %10 = load i32, ptr @g_eTimerMode, align 4, !tbaa !9
  tail call void @_ZN12LightManager11TogglePauseE10TimerTypes(ptr noundef nonnull align 8 dereferenceable(240) @g_lights, i32 noundef %10)
  br label %38

11:                                               ; preds = %3
  %12 = load i32, ptr @g_eTimerMode, align 4, !tbaa !9
  tail call void @_ZN12LightManager10RewindTimeE10TimerTypesf(ptr noundef nonnull align 8 dereferenceable(240) @g_lights, i32 noundef %12, float noundef 1.000000e+00)
  br label %38

13:                                               ; preds = %3
  %14 = load i32, ptr @g_eTimerMode, align 4, !tbaa !9
  tail call void @_ZN12LightManager15FastForwardTimeE10TimerTypesf(ptr noundef nonnull align 8 dereferenceable(240) @g_lights, i32 noundef %14, float noundef 1.000000e+00)
  br label %38

15:                                               ; preds = %3
  %16 = load i8, ptr @g_bDrawCameraPos, align 1, !tbaa !11, !range !13, !noundef !14
  %17 = xor i8 %16, 1
  store i8 %17, ptr @g_bDrawCameraPos, align 1, !tbaa !11
  br label %38

18:                                               ; preds = %3
  store i32 2, ptr @g_eTimerMode, align 4, !tbaa !9
  %19 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.20)
  br label %38

20:                                               ; preds = %3
  store i32 0, ptr @g_eTimerMode, align 4, !tbaa !9
  %21 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.21)
  br label %38

22:                                               ; preds = %3
  store i32 1, ptr @g_eTimerMode, align 4, !tbaa !9
  %23 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.22)
  br label %38

24:                                               ; preds = %3
  tail call void @_Z20SetupDaytimeLightingv()
  br label %38

25:                                               ; preds = %3
  tail call void @_Z22SetupNighttimeLightingv()
  br label %38

26:                                               ; preds = %3
  %27 = tail call noundef float @_ZNK12LightManager10GetSunTimeEv(ptr noundef nonnull align 8 dereferenceable(240) @g_lights)
  %28 = tail call float @llvm.fmuladd.f32(float %27, float 2.400000e+01, float 1.200000e+01)
  %29 = fcmp ogt float %28, 2.400000e+01
  %30 = fadd float %28, -2.400000e+01
  %31 = select i1 %29, float %30, float %28
  %32 = fptosi float %31 to i32
  %33 = sitofp i32 %32 to float
  %34 = fsub float %31, %33
  %35 = fmul float %34, 6.000000e+01
  %36 = fptosi float %35 to i32
  %37 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.23, i32 noundef %32, i32 noundef %36)
  br label %38

38:                                               ; preds = %26, %25, %24, %22, %20, %18, %15, %13, %11, %9, %3
  tail call void @_ZN6glutil8ViewPole9CharPressEc(ptr noundef nonnull align 8 dereferenceable(148) @g_viewPole, i8 noundef signext %0)
  br label %39

39:                                               ; preds = %38, %8
  ret void
}

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN5SceneD2Ev(ptr noundef nonnull align 8 dereferenceable(48)) unnamed_addr #3 align 2

declare void @glutLeaveMainLoop() local_unnamed_addr #4

declare void @_ZN12LightManager11TogglePauseE10TimerTypes(ptr noundef nonnull align 8 dereferenceable(240), i32 noundef) local_unnamed_addr #4

declare void @_ZN12LightManager10RewindTimeE10TimerTypesf(ptr noundef nonnull align 8 dereferenceable(240), i32 noundef, float noundef) local_unnamed_addr #4

declare void @_ZN12LightManager15FastForwardTimeE10TimerTypesf(ptr noundef nonnull align 8 dereferenceable(240), i32 noundef, float noundef) local_unnamed_addr #4

declare noundef float @_ZNK12LightManager10GetSunTimeEv(ptr noundef nonnull align 8 dereferenceable(240)) local_unnamed_addr #4

; Function Attrs: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare float @llvm.fmuladd.f32(float, float, float) #5

declare void @_ZN6glutil8ViewPole9CharPressEc(ptr noundef nonnull align 8 dereferenceable(148), i8 noundef signext) local_unnamed_addr #4

attributes #0 = { 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 #1 = { nobuiltin 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 = { nofree 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 = { "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 nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #6 = { nounwind }
attributes #7 = { builtin 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 = !{!"_ZTS10TimerTypes", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"bool", !7, i64 0}
!13 = !{i8 0, i8 2}
!14 = !{}


; Effective O3 passes: CorrelatedValuePropagationPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,SROAPass,SimplifyCFGPass,TailCallElimPass