; LLVM IR from paroj/gltut :: Tut 11 Shinies/BlinnVsPhongLighting.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 }
%class.MaterialParams = type { 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.24 = 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
@_ZL11g_matParams = external hidden global %class.MaterialParams, align 4
@_ZL13g_eLightModel = external hidden global i32, 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.32 = external hidden unnamed_addr constant [11 x i8], align 1
@_ZL18strLightModelNames = external hidden global [4 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

; Function Attrs: mustprogress uwtable
declare dso_local noundef float @_ZNK14MaterialParamscvfEv(ptr noundef nonnull align 4 dereferenceable(8)) #3 align 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) #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
  %10 = load i8, ptr %4, align 1, !tbaa !5
  %11 = zext i8 %10 to i32
  switch i32 %11, label %93 [
    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 %55
    i32 79, label %56
    i32 85, label %57
    i32 121, label %58
    i32 116, label %63
    i32 98, label %68
    i32 103, label %70
    i32 104, label %75
    i32 72, label %80
  ]

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) #6
  call void @_ZdlPvm(ptr noundef %13, i64 noundef 8) #7
  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) #6
  call void @_ZdlPvm(ptr noundef %17, i64 noundef 8) #7
  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) #6
  call void @_ZdlPvm(ptr noundef %21, i64 noundef 8) #7
  br label %24

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

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

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

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

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

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

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

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

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

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

54:                                               ; preds = %3
  call void @_ZN14MaterialParams9IncrementEb(ptr noundef nonnull align 4 dereferenceable(8) @_ZL11g_matParams, i1 noundef zeroext true)
  store i8 1, ptr %7, align 1, !tbaa !10
  br label %93

55:                                               ; preds = %3
  call void @_ZN14MaterialParams9DecrementEb(ptr noundef nonnull align 4 dereferenceable(8) @_ZL11g_matParams, i1 noundef zeroext true)
  store i8 1, ptr %7, align 1, !tbaa !10
  br label %93

56:                                               ; preds = %3
  call void @_ZN14MaterialParams9IncrementEb(ptr noundef nonnull align 4 dereferenceable(8) @_ZL11g_matParams, i1 noundef zeroext false)
  store i8 1, ptr %7, align 1, !tbaa !10
  br label %93

57:                                               ; preds = %3
  call void @_ZN14MaterialParams9DecrementEb(ptr noundef nonnull align 4 dereferenceable(8) @_ZL11g_matParams, i1 noundef zeroext false)
  store i8 1, ptr %7, align 1, !tbaa !10
  br label %93

58:                                               ; preds = %3
  %59 = load i8, ptr @_ZL18g_bDrawLightSource, align 1, !tbaa !10, !range !14, !noundef !15
  %60 = trunc i8 %59 to i1
  %61 = xor i1 %60, true
  %62 = zext i1 %61 to i8
  store i8 %62, ptr @_ZL18g_bDrawLightSource, align 1, !tbaa !10
  br label %93

63:                                               ; preds = %3
  %64 = load i8, ptr @_ZL11g_bScaleCyl, align 1, !tbaa !10, !range !14, !noundef !15
  %65 = trunc i8 %64 to i1
  %66 = xor i1 %65, true
  %67 = zext i1 %66 to i8
  store i8 %67, ptr @_ZL11g_bScaleCyl, align 1, !tbaa !10
  br label %93

68:                                               ; preds = %3
  %69 = call noundef zeroext i1 @_ZN9Framework5Timer11TogglePauseEv(ptr noundef nonnull align 4 dereferenceable(20) @g_LightTimer)
  br label %93

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

75:                                               ; preds = %3
  %76 = load i32, ptr @_ZL13g_eLightModel, align 4, !tbaa !8
  %77 = add nsw i32 %76, 2
  store i32 %77, ptr @_ZL13g_eLightModel, align 4, !tbaa !8
  %78 = load i32, ptr @_ZL13g_eLightModel, align 4, !tbaa !8
  %79 = srem i32 %78, 4
  store i32 %79, ptr @_ZL13g_eLightModel, align 4, !tbaa !8
  store i8 1, ptr %8, align 1, !tbaa !10
  br label %93

80:                                               ; preds = %3
  %81 = load i32, ptr @_ZL13g_eLightModel, align 4, !tbaa !8
  %82 = srem i32 %81, 2
  %83 = icmp ne i32 %82, 0
  br i1 %83, label %84, label %87

84:                                               ; preds = %80
  %85 = load i32, ptr @_ZL13g_eLightModel, align 4, !tbaa !8
  %86 = sub nsw i32 %85, 1
  store i32 %86, ptr @_ZL13g_eLightModel, align 4, !tbaa !8
  br label %90

87:                                               ; preds = %80
  %88 = load i32, ptr @_ZL13g_eLightModel, align 4, !tbaa !8
  %89 = add nsw i32 %88, 1
  store i32 %89, ptr @_ZL13g_eLightModel, align 4, !tbaa !8
  br label %90

90:                                               ; preds = %87, %84
  %91 = load i32, ptr @_ZL13g_eLightModel, align 4, !tbaa !8
  %92 = srem i32 %91, 4
  store i32 %92, ptr @_ZL13g_eLightModel, align 4, !tbaa !8
  store i8 1, ptr %8, align 1, !tbaa !10
  br label %93

93:                                               ; preds = %90, %75, %70, %68, %63, %58, %57, %56, %55, %54, %51, %48, %45, %42, %39, %36, %33, %30, %25, %3
  %94 = load float, ptr @_ZL14g_fLightRadius, align 4, !tbaa !16
  %95 = fcmp olt float %94, 0x3FC99999A0000000
  br i1 %95, label %96, label %97

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

97:                                               ; preds = %96, %93
  %98 = load i8, ptr %7, align 1, !tbaa !10, !range !14, !noundef !15
  %99 = trunc i8 %98 to i1
  br i1 %99, label %100, label %104

100:                                              ; preds = %97
  %101 = call noundef float @_ZNK14MaterialParamscvfEv(ptr noundef nonnull align 4 dereferenceable(8) @_ZL11g_matParams)
  %102 = fpext float %101 to double
  %103 = call i32 (ptr, ...) @printf(ptr noundef @.str.32, double noundef %102)
  br label %104

104:                                              ; preds = %100, %97
  %105 = load i8, ptr %8, align 1, !tbaa !10, !range !14, !noundef !15
  %106 = trunc i8 %105 to i1
  br i1 %106, label %107, label %113

107:                                              ; preds = %104
  %108 = load i32, ptr @_ZL13g_eLightModel, align 4, !tbaa !8
  %109 = sext i32 %108 to i64
  %110 = getelementptr inbounds [4 x ptr], ptr @_ZL18strLightModelNames, i64 0, i64 %109
  %111 = load ptr, ptr %110, align 8, !tbaa !12
  %112 = call i32 (ptr, ...) @printf(ptr noundef @.str.24, ptr noundef %111)
  br label %113

113:                                              ; preds = %107, %104
  call void @glutPostRedisplay()
  store i32 0, ptr %9, align 4
  br label %114

114:                                              ; preds = %113, %24
  call void @llvm.lifetime.end.p0(i64 1, ptr %8) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr %7) #6
  %115 = load i32, ptr %9, align 4
  switch i32 %115, label %117 [
    i32 0, label %116
    i32 1, label %116
  ]

116:                                              ; preds = %114, %114
  ret void

117:                                              ; preds = %114
  unreachable
}

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

declare void @glutLeaveMainLoop() #2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN14MaterialParams9IncrementEb(ptr noundef nonnull align 4 dereferenceable(8), i1 noundef zeroext) #3 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN14MaterialParams9DecrementEb(ptr noundef nonnull align 4 dereferenceable(8), i1 noundef zeroext) #5 align 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 = { 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 #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 = !{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 }
%class.MaterialParams = type { 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.24 = 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
@_ZL11g_matParams = external hidden global %class.MaterialParams, align 4
@_ZL13g_eLightModel = external hidden local_unnamed_addr global i32, 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.32 = external hidden unnamed_addr constant [11 x i8], align 1
@_ZL18strLightModelNames = external hidden local_unnamed_addr global [4 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

; Function Attrs: mustprogress uwtable
declare dso_local noundef float @_ZNK14MaterialParamscvfEv(ptr noundef nonnull align 4 dereferenceable(8)) local_unnamed_addr #2 align 2

declare void @glutPostRedisplay() local_unnamed_addr #3

; Function Attrs: mustprogress uwtable
define dso_local void @_Z8keyboardhii(i8 noundef zeroext %0, i32 noundef %1, i32 noundef %2) local_unnamed_addr #2 {
  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 %45
    i8 79, label %46
    i8 85, label %47
    i8 121, label %48
    i8 116, label %51
    i8 98, label %54
    i8 103, label %56
    i8 104, label %59
    i8 72, label %63
  ]

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) #6
  tail call void @_ZdlPvm(ptr noundef nonnull %5, i64 noundef 8) #7
  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) #6
  tail call void @_ZdlPvm(ptr noundef nonnull %9, i64 noundef 8) #7
  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) #6
  tail call void @_ZdlPvm(ptr noundef nonnull %13, i64 noundef 8) #7
  br label %16

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

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

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

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

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

44:                                               ; preds = %3
  tail call void @_ZN14MaterialParams9IncrementEb(ptr noundef nonnull align 4 dereferenceable(8) @_ZL11g_matParams, i1 noundef zeroext true)
  br label %thread-pre-split

45:                                               ; preds = %3
  tail call void @_ZN14MaterialParams9DecrementEb(ptr noundef nonnull align 4 dereferenceable(8) @_ZL11g_matParams, i1 noundef zeroext true)
  br label %thread-pre-split

46:                                               ; preds = %3
  tail call void @_ZN14MaterialParams9IncrementEb(ptr noundef nonnull align 4 dereferenceable(8) @_ZL11g_matParams, i1 noundef zeroext false)
  br label %thread-pre-split

47:                                               ; preds = %3
  tail call void @_ZN14MaterialParams9DecrementEb(ptr noundef nonnull align 4 dereferenceable(8) @_ZL11g_matParams, i1 noundef zeroext false)
  br label %thread-pre-split

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

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

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

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

59:                                               ; preds = %3
  %60 = load i32, ptr @_ZL13g_eLightModel, align 4, !tbaa !15
  %61 = add nsw i32 %60, 2
  %62 = srem i32 %61, 4
  store i32 %62, ptr @_ZL13g_eLightModel, align 4, !tbaa !15
  br label %thread-pre-split

63:                                               ; preds = %3
  %64 = load i32, ptr @_ZL13g_eLightModel, align 4, !tbaa !15
  %65 = and i32 %64, 1
  %.not = icmp eq i32 %65, 0
  %66 = or disjoint i32 %64, 1
  %67 = add nsw i32 %64, -1
  %storemerge = select i1 %.not, i32 %66, i32 %67
  %68 = srem i32 %storemerge, 4
  store i32 %68, ptr @_ZL13g_eLightModel, align 4, !tbaa !15
  br label %thread-pre-split

thread-pre-split:                                 ; preds = %3, %17, %20, %23, %32, %35, %44, %45, %46, %47, %48, %51, %54, %56, %59, %63
  %.03.ph = phi i1 [ false, %17 ], [ false, %20 ], [ false, %23 ], [ false, %32 ], [ false, %35 ], [ true, %44 ], [ true, %45 ], [ true, %46 ], [ true, %47 ], [ false, %48 ], [ false, %51 ], [ false, %54 ], [ false, %56 ], [ false, %59 ], [ false, %63 ], [ false, %3 ]
  %.0.ph = phi i1 [ false, %17 ], [ false, %20 ], [ false, %23 ], [ false, %32 ], [ false, %35 ], [ false, %44 ], [ false, %45 ], [ false, %46 ], [ false, %47 ], [ false, %48 ], [ false, %51 ], [ false, %54 ], [ false, %56 ], [ true, %59 ], [ true, %63 ], [ false, %3 ]
  %.pr = load float, ptr @_ZL14g_fLightRadius, align 4, !tbaa !13
  br label %69

69:                                               ; preds = %thread-pre-split, %41, %38, %29, %26
  %70 = 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 ]
  %71 = fcmp olt float %70, 0x3FC99999A0000000
  br i1 %71, label %72, label %73

72:                                               ; preds = %69
  store float 0x3FC99999A0000000, ptr @_ZL14g_fLightRadius, align 4, !tbaa !13
  br label %73

73:                                               ; preds = %72, %69
  br i1 %.03, label %74, label %78

74:                                               ; preds = %73
  %75 = tail call noundef float @_ZNK14MaterialParamscvfEv(ptr noundef nonnull align 4 dereferenceable(8) @_ZL11g_matParams)
  %76 = fpext float %75 to double
  %77 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.32, double noundef %76)
  br label %78

78:                                               ; preds = %74, %73
  br i1 %.0, label %79, label %85

79:                                               ; preds = %78
  %80 = load i32, ptr @_ZL13g_eLightModel, align 4, !tbaa !15
  %81 = sext i32 %80 to i64
  %82 = getelementptr inbounds [4 x ptr], ptr @_ZL18strLightModelNames, i64 0, i64 %81
  %83 = load ptr, ptr %82, align 8, !tbaa !5
  %84 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.24, ptr noundef %83)
  br label %85

85:                                               ; preds = %79, %78
  tail call void @glutPostRedisplay()
  br label %86

86:                                               ; preds = %85, %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 #3

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN14MaterialParams9IncrementEb(ptr noundef nonnull align 4 dereferenceable(8), i1 noundef zeroext) local_unnamed_addr #2 align 2

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

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

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 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { 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 = { 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 #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 = !{!"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,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,SROAPass,SimplifyCFGPass,TailCallElimPass