; LLVM IR from paroj/gltut :: Tut 12 Dynamic Range/GammaCorrection.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_isGammaCorrect = external dso_local global i8, align 1
@g_gammaValue = external dso_local global float, align 4
@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
@.str.24 = external hidden unnamed_addr constant [12 x i8], align 1
@.str.25 = external hidden unnamed_addr constant [11 x i8], align 1
@.str.26 = 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 @_Z16SetupHDRLightingv() #1

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z18SetupGammaLightingv() #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 %94 [
    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 107, label %41
    i32 121, label %53
    i32 104, label %59
    i32 32, label %69
  ]

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 %96

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 %94

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 %94

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 %94

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 %94

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

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

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

39:                                               ; preds = %3
  call void @_Z16SetupHDRLightingv()
  br label %94

40:                                               ; preds = %3
  call void @_Z18SetupGammaLightingv()
  br label %94

41:                                               ; preds = %3
  %42 = load i8, ptr @g_isGammaCorrect, align 1, !tbaa !10, !range !16, !noundef !17
  %43 = trunc i8 %42 to i1
  %44 = xor i1 %43, true
  %45 = zext i1 %44 to i8
  store i8 %45, ptr @g_isGammaCorrect, align 1, !tbaa !10
  %46 = load i8, ptr @g_isGammaCorrect, align 1, !tbaa !10, !range !16, !noundef !17
  %47 = trunc i8 %46 to i1
  br i1 %47, label %48, label %50

48:                                               ; preds = %41
  %49 = call i32 (ptr, ...) @printf(ptr noundef @.str.23)
  br label %52

50:                                               ; preds = %41
  %51 = call i32 (ptr, ...) @printf(ptr noundef @.str.24)
  br label %52

52:                                               ; preds = %50, %48
  br label %94

53:                                               ; preds = %3
  %54 = load float, ptr @g_gammaValue, align 4, !tbaa !18
  %55 = fadd float %54, 0x3FB99999A0000000
  store float %55, ptr @g_gammaValue, align 4, !tbaa !18
  %56 = load float, ptr @g_gammaValue, align 4, !tbaa !18
  %57 = fpext float %56 to double
  %58 = call i32 (ptr, ...) @printf(ptr noundef @.str.25, double noundef %57)
  br label %94

59:                                               ; preds = %3
  %60 = load float, ptr @g_gammaValue, align 4, !tbaa !18
  %61 = fsub float %60, 0x3FB99999A0000000
  store float %61, ptr @g_gammaValue, align 4, !tbaa !18
  %62 = load float, ptr @g_gammaValue, align 4, !tbaa !18
  %63 = fcmp olt float %62, 1.000000e+00
  br i1 %63, label %64, label %65

64:                                               ; preds = %59
  store float 1.000000e+00, ptr @g_gammaValue, align 4, !tbaa !18
  br label %65

65:                                               ; preds = %64, %59
  %66 = load float, ptr @g_gammaValue, align 4, !tbaa !18
  %67 = fpext float %66 to double
  %68 = call i32 (ptr, ...) @printf(ptr noundef @.str.25, double noundef %67)
  br label %94

69:                                               ; preds = %3
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #6
  %70 = call noundef float @_ZNK12LightManager10GetSunTimeEv(ptr noundef nonnull align 8 dereferenceable(240) @g_lights)
  store float %70, ptr %10, align 4, !tbaa !18
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #6
  %71 = load float, ptr %10, align 4, !tbaa !18
  %72 = call float @llvm.fmuladd.f32(float %71, float 2.400000e+01, float 1.200000e+01)
  store float %72, ptr %11, align 4, !tbaa !18
  %73 = load float, ptr %11, align 4, !tbaa !18
  %74 = fcmp ogt float %73, 2.400000e+01
  br i1 %74, label %75, label %78

75:                                               ; preds = %69
  %76 = load float, ptr %11, align 4, !tbaa !18
  %77 = fsub float %76, 2.400000e+01
  br label %80

78:                                               ; preds = %69
  %79 = load float, ptr %11, align 4, !tbaa !18
  br label %80

80:                                               ; preds = %78, %75
  %81 = phi float [ %77, %75 ], [ %79, %78 ]
  store float %81, ptr %11, align 4, !tbaa !18
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #6
  %82 = load float, ptr %11, align 4, !tbaa !18
  %83 = fptosi float %82 to i32
  store i32 %83, ptr %12, align 4, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #6
  %84 = load float, ptr %11, align 4, !tbaa !18
  %85 = load i32, ptr %12, align 4, !tbaa !8
  %86 = sitofp i32 %85 to float
  %87 = fsub float %84, %86
  %88 = fmul float %87, 6.000000e+01
  store float %88, ptr %13, align 4, !tbaa !18
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #6
  %89 = load float, ptr %13, align 4, !tbaa !18
  %90 = fptosi float %89 to i32
  store i32 %90, ptr %14, align 4, !tbaa !8
  %91 = load i32, ptr %12, align 4, !tbaa !8
  %92 = load i32, ptr %14, align 4, !tbaa !8
  %93 = call i32 (ptr, ...) @printf(ptr noundef @.str.26, i32 noundef %91, i32 noundef %92)
  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 %94

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

96:                                               ; preds = %94, %21
  call void @llvm.lifetime.end.p0(i64 1, ptr %8) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr %7) #6
  %97 = load i32, ptr %9, align 4
  switch i32 %97, label %99 [
    i32 0, label %98
    i32 1, label %98
  ]

98:                                               ; preds = %96, %96
  ret void

99:                                               ; preds = %96
  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_isGammaCorrect = external dso_local local_unnamed_addr global i8, align 1
@g_gammaValue = external dso_local local_unnamed_addr global float, align 4
@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
@.str.24 = external hidden unnamed_addr constant [12 x i8], align 1
@.str.25 = external hidden unnamed_addr constant [11 x i8], align 1
@.str.26 = external hidden unnamed_addr constant [11 x i8], align 1

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z18SetupGammaLightingv() 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 %57 [
    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 107, label %26
    i8 121, label %34
    i8 104, label %39
    i8 32, label %45
  ]

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 %58

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 %57

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 %57

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 %57

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 %57

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 %57

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 %57

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 %57

24:                                               ; preds = %3
  tail call void @_Z16SetupHDRLightingv()
  br label %57

25:                                               ; preds = %3
  tail call void @_Z18SetupGammaLightingv()
  br label %57

26:                                               ; preds = %3
  %27 = load i8, ptr @g_isGammaCorrect, align 1, !tbaa !11, !range !13, !noundef !14
  %28 = trunc nuw i8 %27 to i1
  %29 = xor i8 %27, 1
  store i8 %29, ptr @g_isGammaCorrect, align 1, !tbaa !11
  br i1 %28, label %32, label %30

30:                                               ; preds = %26
  %31 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.23)
  br label %57

32:                                               ; preds = %26
  %33 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.24)
  br label %57

34:                                               ; preds = %3
  %35 = load float, ptr @g_gammaValue, align 4, !tbaa !15
  %36 = fadd float %35, 0x3FB99999A0000000
  store float %36, ptr @g_gammaValue, align 4, !tbaa !15
  %37 = fpext float %36 to double
  %38 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.25, double noundef %37)
  br label %57

39:                                               ; preds = %3
  %40 = load float, ptr @g_gammaValue, align 4, !tbaa !15
  %41 = fadd float %40, 0xBFB99999A0000000
  %42 = fcmp olt float %41, 1.000000e+00
  %storemerge = select i1 %42, float 1.000000e+00, float %41
  store float %storemerge, ptr @g_gammaValue, align 4, !tbaa !15
  %43 = fpext float %storemerge to double
  %44 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.25, double noundef %43)
  br label %57

45:                                               ; preds = %3
  %46 = tail call noundef float @_ZNK12LightManager10GetSunTimeEv(ptr noundef nonnull align 8 dereferenceable(240) @g_lights)
  %47 = tail call float @llvm.fmuladd.f32(float %46, float 2.400000e+01, float 1.200000e+01)
  %48 = fcmp ogt float %47, 2.400000e+01
  %49 = fadd float %47, -2.400000e+01
  %50 = select i1 %48, float %49, float %47
  %51 = fptosi float %50 to i32
  %52 = sitofp i32 %51 to float
  %53 = fsub float %50, %52
  %54 = fmul float %53, 6.000000e+01
  %55 = fptosi float %54 to i32
  %56 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.26, i32 noundef %51, i32 noundef %55)
  br label %57

57:                                               ; preds = %30, %32, %45, %39, %34, %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 %58

58:                                               ; preds = %57, %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 = !{}
!15 = !{!16, !16, i64 0}
!16 = !{!"float", !7, i64 0}


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