; LLVM IR from paroj/gltut :: Tut 11 Shinies/PhongLighting.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.Framework::Timer" = type { i32, float, i8, i8, float, float }

@g_pCylinderMesh = external dso_local global ptr, align 8
@g_pPlaneMesh = external dso_local global ptr, align 8
@g_pCubeMesh = external dso_local global ptr, align 8
@.str.23 = external hidden unnamed_addr constant [4 x i8], align 1
@g_LightTimer = external dso_local global %"class.Framework::Timer", align 4
@_ZL14g_fLightHeight = external hidden global float, align 4
@_ZL14g_fLightRadius = external hidden global float, align 4
@_ZL13g_eLightModel = external hidden global i32, align 4
@_ZL18g_fShininessFactor = external hidden global float, align 4
@_ZL11g_bDrawDark = external hidden global i8, align 1
@_ZL11g_bScaleCyl = external hidden global i8, align 1
@_ZL17g_bDrawColoredCyl = external hidden global i8, align 1
@_ZL18g_bDrawLightSource = external hidden global i8, align 1
@.str.30 = external hidden unnamed_addr constant [11 x i8], align 1
@_ZL18strLightModelNames = external hidden global [3 x ptr], align 16

; 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: nobuiltin nounwind
declare void @_ZdlPvm(ptr noundef, i64 noundef) #1

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

declare void @glutPostRedisplay() #2

; Function Attrs: mustprogress uwtable
define dso_local void @_Z8keyboardhii(i8 noundef zeroext %0, i32 noundef %1, i32 noundef %2) #3 {
  %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
  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) #5
  store i8 0, ptr %7, align 1, !tbaa !10
  call void @llvm.lifetime.start.p0(i64 1, ptr %8) #5
  store i8 0, ptr %8, align 1, !tbaa !10
  %10 = load i8, ptr %4, align 1, !tbaa !5
  %11 = zext i8 %10 to i32
  switch i32 %11, label %94 [
    i32 27, label %12
    i32 32, label %25
    i32 105, label %30
    i32 107, label %33
    i32 108, label %36
    i32 106, label %39
    i32 73, label %42
    i32 75, label %45
    i32 76, label %48
    i32 74, label %51
    i32 111, label %54
    i32 117, label %57
    i32 79, label %60
    i32 85, label %63
    i32 121, label %66
    i32 116, label %71
    i32 98, label %76
    i32 103, label %78
    i32 104, label %83
    i32 72, label %88
  ]

12:                                               ; preds = %3
  %13 = load ptr, ptr @g_pPlaneMesh, align 8, !tbaa !12
  %14 = icmp eq ptr %13, null
  br i1 %14, label %16, label %15

15:                                               ; preds = %12
  call void @_ZN9Framework4MeshD1Ev(ptr noundef nonnull align 8 dereferenceable(8) %13) #5
  call void @_ZdlPvm(ptr noundef %13, i64 noundef 8) #6
  br label %16

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

19:                                               ; preds = %16
  call void @_ZN9Framework4MeshD1Ev(ptr noundef nonnull align 8 dereferenceable(8) %17) #5
  call void @_ZdlPvm(ptr noundef %17, i64 noundef 8) #6
  br label %20

20:                                               ; preds = %19, %16
  %21 = load ptr, ptr @g_pCubeMesh, align 8, !tbaa !12
  %22 = icmp eq ptr %21, null
  br i1 %22, label %24, label %23

23:                                               ; preds = %20
  call void @_ZN9Framework4MeshD1Ev(ptr noundef nonnull align 8 dereferenceable(8) %21) #5
  call void @_ZdlPvm(ptr noundef %21, i64 noundef 8) #6
  br label %24

24:                                               ; preds = %23, %20
  call void @glutLeaveMainLoop()
  store i32 1, ptr %9, align 4
  br label %119

25:                                               ; preds = %3
  %26 = load i8, ptr @_ZL17g_bDrawColoredCyl, align 1, !tbaa !10, !range !14, !noundef !15
  %27 = trunc i8 %26 to i1
  %28 = xor i1 %27, true
  %29 = zext i1 %28 to i8
  store i8 %29, ptr @_ZL17g_bDrawColoredCyl, align 1, !tbaa !10
  br label %94

30:                                               ; preds = %3
  %31 = load float, ptr @_ZL14g_fLightHeight, align 4, !tbaa !16
  %32 = fadd float %31, 0x3FC99999A0000000
  store float %32, ptr @_ZL14g_fLightHeight, align 4, !tbaa !16
  br label %94

33:                                               ; preds = %3
  %34 = load float, ptr @_ZL14g_fLightHeight, align 4, !tbaa !16
  %35 = fsub float %34, 0x3FC99999A0000000
  store float %35, ptr @_ZL14g_fLightHeight, align 4, !tbaa !16
  br label %94

36:                                               ; preds = %3
  %37 = load float, ptr @_ZL14g_fLightRadius, align 4, !tbaa !16
  %38 = fadd float %37, 0x3FC99999A0000000
  store float %38, ptr @_ZL14g_fLightRadius, align 4, !tbaa !16
  br label %94

39:                                               ; preds = %3
  %40 = load float, ptr @_ZL14g_fLightRadius, align 4, !tbaa !16
  %41 = fsub float %40, 0x3FC99999A0000000
  store float %41, ptr @_ZL14g_fLightRadius, align 4, !tbaa !16
  br label %94

42:                                               ; preds = %3
  %43 = load float, ptr @_ZL14g_fLightHeight, align 4, !tbaa !16
  %44 = fadd float %43, 0x3FA99999A0000000
  store float %44, ptr @_ZL14g_fLightHeight, align 4, !tbaa !16
  br label %94

45:                                               ; preds = %3
  %46 = load float, ptr @_ZL14g_fLightHeight, align 4, !tbaa !16
  %47 = fsub float %46, 0x3FA99999A0000000
  store float %47, ptr @_ZL14g_fLightHeight, align 4, !tbaa !16
  br label %94

48:                                               ; preds = %3
  %49 = load float, ptr @_ZL14g_fLightRadius, align 4, !tbaa !16
  %50 = fadd float %49, 0x3FA99999A0000000
  store float %50, ptr @_ZL14g_fLightRadius, align 4, !tbaa !16
  br label %94

51:                                               ; preds = %3
  %52 = load float, ptr @_ZL14g_fLightRadius, align 4, !tbaa !16
  %53 = fsub float %52, 0x3FA99999A0000000
  store float %53, ptr @_ZL14g_fLightRadius, align 4, !tbaa !16
  br label %94

54:                                               ; preds = %3
  %55 = load float, ptr @_ZL18g_fShininessFactor, align 4, !tbaa !16
  %56 = fadd float %55, 5.000000e-01
  store float %56, ptr @_ZL18g_fShininessFactor, align 4, !tbaa !16
  store i8 1, ptr %7, align 1, !tbaa !10
  br label %94

57:                                               ; preds = %3
  %58 = load float, ptr @_ZL18g_fShininessFactor, align 4, !tbaa !16
  %59 = fsub float %58, 5.000000e-01
  store float %59, ptr @_ZL18g_fShininessFactor, align 4, !tbaa !16
  store i8 1, ptr %7, align 1, !tbaa !10
  br label %94

60:                                               ; preds = %3
  %61 = load float, ptr @_ZL18g_fShininessFactor, align 4, !tbaa !16
  %62 = fadd float %61, 0x3FB99999A0000000
  store float %62, ptr @_ZL18g_fShininessFactor, align 4, !tbaa !16
  store i8 1, ptr %7, align 1, !tbaa !10
  br label %94

63:                                               ; preds = %3
  %64 = load float, ptr @_ZL18g_fShininessFactor, align 4, !tbaa !16
  %65 = fsub float %64, 0x3FB99999A0000000
  store float %65, ptr @_ZL18g_fShininessFactor, align 4, !tbaa !16
  store i8 1, ptr %7, align 1, !tbaa !10
  br label %94

66:                                               ; preds = %3
  %67 = load i8, ptr @_ZL18g_bDrawLightSource, align 1, !tbaa !10, !range !14, !noundef !15
  %68 = trunc i8 %67 to i1
  %69 = xor i1 %68, true
  %70 = zext i1 %69 to i8
  store i8 %70, ptr @_ZL18g_bDrawLightSource, align 1, !tbaa !10
  br label %94

71:                                               ; preds = %3
  %72 = load i8, ptr @_ZL11g_bScaleCyl, align 1, !tbaa !10, !range !14, !noundef !15
  %73 = trunc i8 %72 to i1
  %74 = xor i1 %73, true
  %75 = zext i1 %74 to i8
  store i8 %75, ptr @_ZL11g_bScaleCyl, align 1, !tbaa !10
  br label %94

76:                                               ; preds = %3
  %77 = call noundef zeroext i1 @_ZN9Framework5Timer11TogglePauseEv(ptr noundef nonnull align 4 dereferenceable(20) @g_LightTimer)
  br label %94

78:                                               ; preds = %3
  %79 = load i8, ptr @_ZL11g_bDrawDark, align 1, !tbaa !10, !range !14, !noundef !15
  %80 = trunc i8 %79 to i1
  %81 = xor i1 %80, true
  %82 = zext i1 %81 to i8
  store i8 %82, ptr @_ZL11g_bDrawDark, align 1, !tbaa !10
  br label %94

83:                                               ; preds = %3
  %84 = load i32, ptr @_ZL13g_eLightModel, align 4, !tbaa !8
  %85 = add nsw i32 %84, 1
  store i32 %85, ptr @_ZL13g_eLightModel, align 4, !tbaa !8
  %86 = load i32, ptr @_ZL13g_eLightModel, align 4, !tbaa !8
  %87 = srem i32 %86, 3
  store i32 %87, ptr @_ZL13g_eLightModel, align 4, !tbaa !8
  store i8 1, ptr %8, align 1, !tbaa !10
  br label %94

88:                                               ; preds = %3
  %89 = load i32, ptr @_ZL13g_eLightModel, align 4, !tbaa !8
  switch i32 %89, label %93 [
    i32 1, label %90
    i32 0, label %91
    i32 2, label %92
  ]

90:                                               ; preds = %88
  store i32 0, ptr @_ZL13g_eLightModel, align 4, !tbaa !8
  br label %93

91:                                               ; preds = %88
  store i32 1, ptr @_ZL13g_eLightModel, align 4, !tbaa !8
  br label %93

92:                                               ; preds = %88
  store i32 0, ptr @_ZL13g_eLightModel, align 4, !tbaa !8
  br label %93

93:                                               ; preds = %92, %91, %90, %88
  store i8 1, ptr %8, align 1, !tbaa !10
  br label %94

94:                                               ; preds = %93, %83, %78, %76, %71, %66, %63, %60, %57, %54, %51, %48, %45, %42, %39, %36, %33, %30, %25, %3
  %95 = load float, ptr @_ZL14g_fLightRadius, align 4, !tbaa !16
  %96 = fcmp olt float %95, 0x3FC99999A0000000
  br i1 %96, label %97, label %98

97:                                               ; preds = %94
  store float 0x3FC99999A0000000, ptr @_ZL14g_fLightRadius, align 4, !tbaa !16
  br label %98

98:                                               ; preds = %97, %94
  %99 = load float, ptr @_ZL18g_fShininessFactor, align 4, !tbaa !16
  %100 = fcmp ole float %99, 0.000000e+00
  br i1 %100, label %101, label %102

101:                                              ; preds = %98
  store float 0x3F1A36E2E0000000, ptr @_ZL18g_fShininessFactor, align 4, !tbaa !16
  br label %102

102:                                              ; preds = %101, %98
  %103 = load i8, ptr %7, align 1, !tbaa !10, !range !14, !noundef !15
  %104 = trunc i8 %103 to i1
  br i1 %104, label %105, label %109

105:                                              ; preds = %102
  %106 = load float, ptr @_ZL18g_fShininessFactor, align 4, !tbaa !16
  %107 = fpext float %106 to double
  %108 = call i32 (ptr, ...) @printf(ptr noundef @.str.30, double noundef %107)
  br label %109

109:                                              ; preds = %105, %102
  %110 = load i8, ptr %8, align 1, !tbaa !10, !range !14, !noundef !15
  %111 = trunc i8 %110 to i1
  br i1 %111, label %112, label %118

112:                                              ; preds = %109
  %113 = load i32, ptr @_ZL13g_eLightModel, align 4, !tbaa !8
  %114 = sext i32 %113 to i64
  %115 = getelementptr inbounds [3 x ptr], ptr @_ZL18strLightModelNames, i64 0, i64 %114
  %116 = load ptr, ptr %115, align 8, !tbaa !12
  %117 = call i32 (ptr, ...) @printf(ptr noundef @.str.23, ptr noundef %116)
  br label %118

118:                                              ; preds = %112, %109
  call void @glutPostRedisplay()
  store i32 0, ptr %9, align 4
  br label %119

119:                                              ; preds = %118, %24
  call void @llvm.lifetime.end.p0(i64 1, ptr %8) #5
  call void @llvm.lifetime.end.p0(i64 1, ptr %7) #5
  %120 = load i32, ptr %9, align 4
  switch i32 %120, label %122 [
    i32 0, label %121
    i32 1, label %121
  ]

121:                                              ; preds = %119, %119
  ret void

122:                                              ; preds = %119
  unreachable
}

; Function Attrs: nounwind
declare void @_ZN9Framework4MeshD1Ev(ptr noundef nonnull align 8 dereferenceable(8)) unnamed_addr #4

declare void @glutLeaveMainLoop() #2

declare noundef zeroext i1 @_ZN9Framework5Timer11TogglePauseEv(ptr noundef nonnull align 4 dereferenceable(20)) #2

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { "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 = { 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 #4 = { 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 #5 = { nounwind }
attributes #6 = { 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 = !{i8 0, i8 2}
!15 = !{}
!16 = !{!17, !17, i64 0}
!17 = !{!"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.Framework::Timer" = type { i32, float, i8, i8, float, float }

@g_pCylinderMesh = external dso_local local_unnamed_addr global ptr, align 8
@g_pPlaneMesh = external dso_local local_unnamed_addr global ptr, align 8
@g_pCubeMesh = external dso_local local_unnamed_addr global ptr, align 8
@.str.23 = external hidden unnamed_addr constant [4 x i8], align 1
@g_LightTimer = external dso_local global %"class.Framework::Timer", align 4
@_ZL14g_fLightHeight = external hidden local_unnamed_addr global float, align 4
@_ZL14g_fLightRadius = external hidden local_unnamed_addr global float, align 4
@_ZL13g_eLightModel = external hidden local_unnamed_addr global i32, align 4
@_ZL18g_fShininessFactor = external hidden local_unnamed_addr global float, align 4
@_ZL11g_bDrawDark = external hidden local_unnamed_addr global i8, align 1
@_ZL11g_bScaleCyl = external hidden local_unnamed_addr global i8, align 1
@_ZL17g_bDrawColoredCyl = external hidden local_unnamed_addr global i8, align 1
@_ZL18g_bDrawLightSource = external hidden local_unnamed_addr global i8, align 1
@.str.30 = external hidden unnamed_addr constant [11 x i8], align 1
@_ZL18strLightModelNames = external hidden local_unnamed_addr global [3 x ptr], align 16

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

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

declare void @glutPostRedisplay() 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 #3 {
  switch i8 %0, label %thread-pre-split [
    i8 27, label %4
    i8 32, label %17
    i8 105, label %20
    i8 107, label %23
    i8 108, label %26
    i8 106, label %29
    i8 73, label %32
    i8 75, label %35
    i8 76, label %38
    i8 74, label %41
    i8 111, label %44
    i8 117, label %47
    i8 79, label %50
    i8 85, label %53
    i8 121, label %56
    i8 116, label %59
    i8 98, label %62
    i8 103, label %64
    i8 104, label %67
    i8 72, label %71
  ]

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

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

8:                                                ; preds = %7, %4
  %9 = load ptr, ptr @g_pCylinderMesh, align 8, !tbaa !5
  %10 = icmp eq ptr %9, null
  br i1 %10, label %12, label %11

11:                                               ; preds = %8
  tail call void @_ZN9Framework4MeshD1Ev(ptr noundef nonnull align 8 dereferenceable(8) %9) #5
  tail call void @_ZdlPvm(ptr noundef nonnull %9, i64 noundef 8) #6
  br label %12

12:                                               ; preds = %11, %8
  %13 = load ptr, ptr @g_pCubeMesh, align 8, !tbaa !5
  %14 = icmp eq ptr %13, null
  br i1 %14, label %16, label %15

15:                                               ; preds = %12
  tail call void @_ZN9Framework4MeshD1Ev(ptr noundef nonnull align 8 dereferenceable(8) %13) #5
  tail call void @_ZdlPvm(ptr noundef nonnull %13, i64 noundef 8) #6
  br label %16

16:                                               ; preds = %15, %12
  tail call void @glutLeaveMainLoop()
  br label %97

17:                                               ; preds = %3
  %18 = load i8, ptr @_ZL17g_bDrawColoredCyl, align 1, !tbaa !9, !range !11, !noundef !12
  %19 = xor i8 %18, 1
  store i8 %19, ptr @_ZL17g_bDrawColoredCyl, align 1, !tbaa !9
  br label %thread-pre-split

20:                                               ; preds = %3
  %21 = load float, ptr @_ZL14g_fLightHeight, align 4, !tbaa !13
  %22 = fadd float %21, 0x3FC99999A0000000
  store float %22, ptr @_ZL14g_fLightHeight, align 4, !tbaa !13
  br label %thread-pre-split

23:                                               ; preds = %3
  %24 = load float, ptr @_ZL14g_fLightHeight, align 4, !tbaa !13
  %25 = fadd float %24, 0xBFC99999A0000000
  store float %25, ptr @_ZL14g_fLightHeight, align 4, !tbaa !13
  br label %thread-pre-split

26:                                               ; preds = %3
  %27 = load float, ptr @_ZL14g_fLightRadius, align 4, !tbaa !13
  %28 = fadd float %27, 0x3FC99999A0000000
  store float %28, ptr @_ZL14g_fLightRadius, align 4, !tbaa !13
  br label %76

29:                                               ; preds = %3
  %30 = load float, ptr @_ZL14g_fLightRadius, align 4, !tbaa !13
  %31 = fadd float %30, 0xBFC99999A0000000
  store float %31, ptr @_ZL14g_fLightRadius, align 4, !tbaa !13
  br label %76

32:                                               ; preds = %3
  %33 = load float, ptr @_ZL14g_fLightHeight, align 4, !tbaa !13
  %34 = fadd float %33, 0x3FA99999A0000000
  store float %34, ptr @_ZL14g_fLightHeight, align 4, !tbaa !13
  br label %thread-pre-split

35:                                               ; preds = %3
  %36 = load float, ptr @_ZL14g_fLightHeight, align 4, !tbaa !13
  %37 = fadd float %36, 0xBFA99999A0000000
  store float %37, ptr @_ZL14g_fLightHeight, align 4, !tbaa !13
  br label %thread-pre-split

38:                                               ; preds = %3
  %39 = load float, ptr @_ZL14g_fLightRadius, align 4, !tbaa !13
  %40 = fadd float %39, 0x3FA99999A0000000
  store float %40, ptr @_ZL14g_fLightRadius, align 4, !tbaa !13
  br label %76

41:                                               ; preds = %3
  %42 = load float, ptr @_ZL14g_fLightRadius, align 4, !tbaa !13
  %43 = fadd float %42, 0xBFA99999A0000000
  store float %43, ptr @_ZL14g_fLightRadius, align 4, !tbaa !13
  br label %76

44:                                               ; preds = %3
  %45 = load float, ptr @_ZL18g_fShininessFactor, align 4, !tbaa !13
  %46 = fadd float %45, 5.000000e-01
  store float %46, ptr @_ZL18g_fShininessFactor, align 4, !tbaa !13
  br label %thread-pre-split

47:                                               ; preds = %3
  %48 = load float, ptr @_ZL18g_fShininessFactor, align 4, !tbaa !13
  %49 = fadd float %48, -5.000000e-01
  store float %49, ptr @_ZL18g_fShininessFactor, align 4, !tbaa !13
  br label %thread-pre-split

50:                                               ; preds = %3
  %51 = load float, ptr @_ZL18g_fShininessFactor, align 4, !tbaa !13
  %52 = fadd float %51, 0x3FB99999A0000000
  store float %52, ptr @_ZL18g_fShininessFactor, align 4, !tbaa !13
  br label %thread-pre-split

53:                                               ; preds = %3
  %54 = load float, ptr @_ZL18g_fShininessFactor, align 4, !tbaa !13
  %55 = fadd float %54, 0xBFB99999A0000000
  store float %55, ptr @_ZL18g_fShininessFactor, align 4, !tbaa !13
  br label %thread-pre-split

56:                                               ; preds = %3
  %57 = load i8, ptr @_ZL18g_bDrawLightSource, align 1, !tbaa !9, !range !11, !noundef !12
  %58 = xor i8 %57, 1
  store i8 %58, ptr @_ZL18g_bDrawLightSource, align 1, !tbaa !9
  br label %thread-pre-split

59:                                               ; preds = %3
  %60 = load i8, ptr @_ZL11g_bScaleCyl, align 1, !tbaa !9, !range !11, !noundef !12
  %61 = xor i8 %60, 1
  store i8 %61, ptr @_ZL11g_bScaleCyl, align 1, !tbaa !9
  br label %thread-pre-split

62:                                               ; preds = %3
  %63 = tail call noundef zeroext i1 @_ZN9Framework5Timer11TogglePauseEv(ptr noundef nonnull align 4 dereferenceable(20) @g_LightTimer)
  br label %thread-pre-split

64:                                               ; preds = %3
  %65 = load i8, ptr @_ZL11g_bDrawDark, align 1, !tbaa !9, !range !11, !noundef !12
  %66 = xor i8 %65, 1
  store i8 %66, ptr @_ZL11g_bDrawDark, align 1, !tbaa !9
  br label %thread-pre-split

67:                                               ; preds = %3
  %68 = load i32, ptr @_ZL13g_eLightModel, align 4, !tbaa !15
  %69 = add nsw i32 %68, 1
  %70 = srem i32 %69, 3
  store i32 %70, ptr @_ZL13g_eLightModel, align 4, !tbaa !15
  br label %thread-pre-split

71:                                               ; preds = %3
  %72 = load i32, ptr @_ZL13g_eLightModel, align 4, !tbaa !15
  switch i32 %72, label %thread-pre-split [
    i32 1, label %73
    i32 0, label %74
    i32 2, label %75
  ]

73:                                               ; preds = %71
  store i32 0, ptr @_ZL13g_eLightModel, align 4, !tbaa !15
  br label %thread-pre-split

74:                                               ; preds = %71
  store i32 1, ptr @_ZL13g_eLightModel, align 4, !tbaa !15
  br label %thread-pre-split

75:                                               ; preds = %71
  store i32 0, ptr @_ZL13g_eLightModel, align 4, !tbaa !15
  br label %thread-pre-split

thread-pre-split:                                 ; preds = %3, %17, %20, %23, %32, %35, %44, %47, %50, %53, %56, %59, %62, %64, %67, %75, %74, %73, %71
  %.03.ph = phi i1 [ false, %71 ], [ false, %73 ], [ false, %74 ], [ false, %75 ], [ false, %17 ], [ false, %20 ], [ false, %23 ], [ false, %32 ], [ false, %35 ], [ true, %44 ], [ true, %47 ], [ true, %50 ], [ true, %53 ], [ false, %56 ], [ false, %59 ], [ false, %62 ], [ false, %64 ], [ false, %67 ], [ false, %3 ]
  %.0.ph = phi i1 [ true, %71 ], [ true, %73 ], [ true, %74 ], [ true, %75 ], [ false, %17 ], [ false, %20 ], [ false, %23 ], [ false, %32 ], [ false, %35 ], [ false, %44 ], [ false, %47 ], [ false, %50 ], [ false, %53 ], [ false, %56 ], [ false, %59 ], [ false, %62 ], [ false, %64 ], [ true, %67 ], [ false, %3 ]
  %.pr = load float, ptr @_ZL14g_fLightRadius, align 4, !tbaa !13
  br label %76

76:                                               ; preds = %thread-pre-split, %41, %38, %29, %26
  %77 = phi float [ %.pr, %thread-pre-split ], [ %43, %41 ], [ %40, %38 ], [ %31, %29 ], [ %28, %26 ]
  %.03 = phi i1 [ %.03.ph, %thread-pre-split ], [ false, %41 ], [ false, %38 ], [ false, %29 ], [ false, %26 ]
  %.0 = phi i1 [ %.0.ph, %thread-pre-split ], [ false, %41 ], [ false, %38 ], [ false, %29 ], [ false, %26 ]
  %78 = fcmp olt float %77, 0x3FC99999A0000000
  br i1 %78, label %79, label %80

79:                                               ; preds = %76
  store float 0x3FC99999A0000000, ptr @_ZL14g_fLightRadius, align 4, !tbaa !13
  br label %80

80:                                               ; preds = %79, %76
  %81 = load float, ptr @_ZL18g_fShininessFactor, align 4, !tbaa !13
  %82 = fcmp ugt float %81, 0.000000e+00
  br i1 %82, label %84, label %83

83:                                               ; preds = %80
  store float 0x3F1A36E2E0000000, ptr @_ZL18g_fShininessFactor, align 4, !tbaa !13
  br label %84

84:                                               ; preds = %83, %80
  %85 = phi float [ 0x3F1A36E2E0000000, %83 ], [ %81, %80 ]
  br i1 %.03, label %86, label %89

86:                                               ; preds = %84
  %87 = fpext float %85 to double
  %88 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.30, double noundef %87)
  br label %89

89:                                               ; preds = %86, %84
  br i1 %.0, label %90, label %96

90:                                               ; preds = %89
  %91 = load i32, ptr @_ZL13g_eLightModel, align 4, !tbaa !15
  %92 = sext i32 %91 to i64
  %93 = getelementptr inbounds [3 x ptr], ptr @_ZL18strLightModelNames, i64 0, i64 %92
  %94 = load ptr, ptr %93, align 8, !tbaa !5
  %95 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.23, ptr noundef %94)
  br label %96

96:                                               ; preds = %90, %89
  tail call void @glutPostRedisplay()
  br label %97

97:                                               ; preds = %96, %16
  ret void
}

; Function Attrs: nounwind
declare void @_ZN9Framework4MeshD1Ev(ptr noundef nonnull align 8 dereferenceable(8)) unnamed_addr #4

declare void @glutLeaveMainLoop() local_unnamed_addr #2

declare noundef zeroext i1 @_ZN9Framework5Timer11TogglePauseEv(ptr noundef nonnull align 4 dereferenceable(20)) local_unnamed_addr #2

attributes #0 = { 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 #1 = { 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 #2 = { "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 = { 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 #4 = { 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 #5 = { nounwind }
attributes #6 = { 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 = !{!"bool", !7, i64 0}
!11 = !{i8 0, i8 2}
!12 = !{}
!13 = !{!14, !14, i64 0}
!14 = !{!"float", !7, i64 0}
!15 = !{!16, !16, i64 0}
!16 = !{!"int", !7, i64 0}


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