; LLVM IR from paroj/gltut :: Tut 07 World in Motion/WorldScene.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"

%"struct.glm::detail::tvec3" = type { %union.anon.6 }
%union.anon.6 = type { %struct.anon.7 }
%struct.anon.7 = type { float, float, float }
%struct.anon.9 = type { float, float, float }

@g_pConeMesh = external dso_local global ptr, align 8
@g_pCylinderMesh = external dso_local global ptr, align 8
@g_pCubeTintMesh = external dso_local global ptr, align 8
@g_pCubeColorMesh = external dso_local global ptr, align 8
@g_pPlaneMesh = external dso_local global ptr, align 8
@_ZL11g_camTarget = external hidden global %"struct.glm::detail::tvec3", align 4
@_ZL17g_sphereCamRelPos = external hidden global %"struct.glm::detail::tvec3", align 4
@_ZL18g_bDrawLookatPoint = external hidden global i8, align 1
@.str.16 = external hidden unnamed_addr constant [20 x i8], align 1
@.str.17 = external hidden unnamed_addr constant [22 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: 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 float, align 4
  %8 = alloca float, 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
  %9 = load i8, ptr %4, align 1, !tbaa !5
  %10 = zext i8 %9 to i32
  switch i32 %10, label %123 [
    i32 27, label %11
    i32 119, label %32
    i32 115, label %35
    i32 100, label %38
    i32 97, label %41
    i32 101, label %44
    i32 113, label %47
    i32 87, label %50
    i32 83, label %53
    i32 68, label %56
    i32 65, label %59
    i32 69, label %62
    i32 81, label %65
    i32 105, label %68
    i32 107, label %71
    i32 106, label %74
    i32 108, label %77
    i32 111, label %80
    i32 117, label %83
    i32 73, label %86
    i32 75, label %89
    i32 74, label %92
    i32 76, label %95
    i32 79, label %98
    i32 85, label %101
    i32 32, label %104
  ]

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

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

15:                                               ; preds = %14, %11
  store ptr null, ptr @g_pConeMesh, align 8, !tbaa !10
  %16 = load ptr, ptr @g_pCylinderMesh, align 8, !tbaa !10
  %17 = icmp eq ptr %16, null
  br i1 %17, label %19, label %18

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

19:                                               ; preds = %18, %15
  store ptr null, ptr @g_pCylinderMesh, align 8, !tbaa !10
  %20 = load ptr, ptr @g_pCubeTintMesh, align 8, !tbaa !10
  %21 = icmp eq ptr %20, null
  br i1 %21, label %23, label %22

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

23:                                               ; preds = %22, %19
  store ptr null, ptr @g_pCubeTintMesh, align 8, !tbaa !10
  %24 = load ptr, ptr @g_pCubeColorMesh, align 8, !tbaa !10
  %25 = icmp eq ptr %24, null
  br i1 %25, label %27, label %26

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

27:                                               ; preds = %26, %23
  store ptr null, ptr @g_pCubeColorMesh, align 8, !tbaa !10
  %28 = load ptr, ptr @g_pPlaneMesh, align 8, !tbaa !10
  %29 = icmp eq ptr %28, null
  br i1 %29, label %31, label %30

30:                                               ; preds = %27
  call void @_ZN9Framework4MeshD1Ev(ptr noundef nonnull align 8 dereferenceable(8) %28) #6
  call void @_ZdlPvm(ptr noundef %28, i64 noundef 8) #7
  br label %31

31:                                               ; preds = %30, %27
  store ptr null, ptr @g_pPlaneMesh, align 8, !tbaa !10
  call void @glutLeaveMainLoop()
  br label %139

32:                                               ; preds = %3
  %33 = load float, ptr getelementptr inbounds (%struct.anon.9, ptr @_ZL11g_camTarget, i32 0, i32 2), align 4, !tbaa !5
  %34 = fsub float %33, 4.000000e+00
  store float %34, ptr getelementptr inbounds (%struct.anon.9, ptr @_ZL11g_camTarget, i32 0, i32 2), align 4, !tbaa !5
  br label %123

35:                                               ; preds = %3
  %36 = load float, ptr getelementptr inbounds (%struct.anon.9, ptr @_ZL11g_camTarget, i32 0, i32 2), align 4, !tbaa !5
  %37 = fadd float %36, 4.000000e+00
  store float %37, ptr getelementptr inbounds (%struct.anon.9, ptr @_ZL11g_camTarget, i32 0, i32 2), align 4, !tbaa !5
  br label %123

38:                                               ; preds = %3
  %39 = load float, ptr @_ZL11g_camTarget, align 4, !tbaa !5
  %40 = fadd float %39, 4.000000e+00
  store float %40, ptr @_ZL11g_camTarget, align 4, !tbaa !5
  br label %123

41:                                               ; preds = %3
  %42 = load float, ptr @_ZL11g_camTarget, align 4, !tbaa !5
  %43 = fsub float %42, 4.000000e+00
  store float %43, ptr @_ZL11g_camTarget, align 4, !tbaa !5
  br label %123

44:                                               ; preds = %3
  %45 = load float, ptr getelementptr inbounds (%struct.anon.9, ptr @_ZL11g_camTarget, i32 0, i32 1), align 4, !tbaa !5
  %46 = fsub float %45, 4.000000e+00
  store float %46, ptr getelementptr inbounds (%struct.anon.9, ptr @_ZL11g_camTarget, i32 0, i32 1), align 4, !tbaa !5
  br label %123

47:                                               ; preds = %3
  %48 = load float, ptr getelementptr inbounds (%struct.anon.9, ptr @_ZL11g_camTarget, i32 0, i32 1), align 4, !tbaa !5
  %49 = fadd float %48, 4.000000e+00
  store float %49, ptr getelementptr inbounds (%struct.anon.9, ptr @_ZL11g_camTarget, i32 0, i32 1), align 4, !tbaa !5
  br label %123

50:                                               ; preds = %3
  %51 = load float, ptr getelementptr inbounds (%struct.anon.9, ptr @_ZL11g_camTarget, i32 0, i32 2), align 4, !tbaa !5
  %52 = fsub float %51, 0x3FD99999A0000000
  store float %52, ptr getelementptr inbounds (%struct.anon.9, ptr @_ZL11g_camTarget, i32 0, i32 2), align 4, !tbaa !5
  br label %123

53:                                               ; preds = %3
  %54 = load float, ptr getelementptr inbounds (%struct.anon.9, ptr @_ZL11g_camTarget, i32 0, i32 2), align 4, !tbaa !5
  %55 = fadd float %54, 0x3FD99999A0000000
  store float %55, ptr getelementptr inbounds (%struct.anon.9, ptr @_ZL11g_camTarget, i32 0, i32 2), align 4, !tbaa !5
  br label %123

56:                                               ; preds = %3
  %57 = load float, ptr @_ZL11g_camTarget, align 4, !tbaa !5
  %58 = fadd float %57, 0x3FD99999A0000000
  store float %58, ptr @_ZL11g_camTarget, align 4, !tbaa !5
  br label %123

59:                                               ; preds = %3
  %60 = load float, ptr @_ZL11g_camTarget, align 4, !tbaa !5
  %61 = fsub float %60, 0x3FD99999A0000000
  store float %61, ptr @_ZL11g_camTarget, align 4, !tbaa !5
  br label %123

62:                                               ; preds = %3
  %63 = load float, ptr getelementptr inbounds (%struct.anon.9, ptr @_ZL11g_camTarget, i32 0, i32 1), align 4, !tbaa !5
  %64 = fsub float %63, 0x3FD99999A0000000
  store float %64, ptr getelementptr inbounds (%struct.anon.9, ptr @_ZL11g_camTarget, i32 0, i32 1), align 4, !tbaa !5
  br label %123

65:                                               ; preds = %3
  %66 = load float, ptr getelementptr inbounds (%struct.anon.9, ptr @_ZL11g_camTarget, i32 0, i32 1), align 4, !tbaa !5
  %67 = fadd float %66, 0x3FD99999A0000000
  store float %67, ptr getelementptr inbounds (%struct.anon.9, ptr @_ZL11g_camTarget, i32 0, i32 1), align 4, !tbaa !5
  br label %123

68:                                               ; preds = %3
  %69 = load float, ptr getelementptr inbounds (%struct.anon.9, ptr @_ZL17g_sphereCamRelPos, i32 0, i32 1), align 4, !tbaa !5
  %70 = fsub float %69, 1.125000e+01
  store float %70, ptr getelementptr inbounds (%struct.anon.9, ptr @_ZL17g_sphereCamRelPos, i32 0, i32 1), align 4, !tbaa !5
  br label %123

71:                                               ; preds = %3
  %72 = load float, ptr getelementptr inbounds (%struct.anon.9, ptr @_ZL17g_sphereCamRelPos, i32 0, i32 1), align 4, !tbaa !5
  %73 = fadd float %72, 1.125000e+01
  store float %73, ptr getelementptr inbounds (%struct.anon.9, ptr @_ZL17g_sphereCamRelPos, i32 0, i32 1), align 4, !tbaa !5
  br label %123

74:                                               ; preds = %3
  %75 = load float, ptr @_ZL17g_sphereCamRelPos, align 4, !tbaa !5
  %76 = fsub float %75, 1.125000e+01
  store float %76, ptr @_ZL17g_sphereCamRelPos, align 4, !tbaa !5
  br label %123

77:                                               ; preds = %3
  %78 = load float, ptr @_ZL17g_sphereCamRelPos, align 4, !tbaa !5
  %79 = fadd float %78, 1.125000e+01
  store float %79, ptr @_ZL17g_sphereCamRelPos, align 4, !tbaa !5
  br label %123

80:                                               ; preds = %3
  %81 = load float, ptr getelementptr inbounds (%struct.anon.9, ptr @_ZL17g_sphereCamRelPos, i32 0, i32 2), align 4, !tbaa !5
  %82 = fsub float %81, 5.000000e+00
  store float %82, ptr getelementptr inbounds (%struct.anon.9, ptr @_ZL17g_sphereCamRelPos, i32 0, i32 2), align 4, !tbaa !5
  br label %123

83:                                               ; preds = %3
  %84 = load float, ptr getelementptr inbounds (%struct.anon.9, ptr @_ZL17g_sphereCamRelPos, i32 0, i32 2), align 4, !tbaa !5
  %85 = fadd float %84, 5.000000e+00
  store float %85, ptr getelementptr inbounds (%struct.anon.9, ptr @_ZL17g_sphereCamRelPos, i32 0, i32 2), align 4, !tbaa !5
  br label %123

86:                                               ; preds = %3
  %87 = load float, ptr getelementptr inbounds (%struct.anon.9, ptr @_ZL17g_sphereCamRelPos, i32 0, i32 1), align 4, !tbaa !5
  %88 = fsub float %87, 1.125000e+00
  store float %88, ptr getelementptr inbounds (%struct.anon.9, ptr @_ZL17g_sphereCamRelPos, i32 0, i32 1), align 4, !tbaa !5
  br label %123

89:                                               ; preds = %3
  %90 = load float, ptr getelementptr inbounds (%struct.anon.9, ptr @_ZL17g_sphereCamRelPos, i32 0, i32 1), align 4, !tbaa !5
  %91 = fadd float %90, 1.125000e+00
  store float %91, ptr getelementptr inbounds (%struct.anon.9, ptr @_ZL17g_sphereCamRelPos, i32 0, i32 1), align 4, !tbaa !5
  br label %123

92:                                               ; preds = %3
  %93 = load float, ptr @_ZL17g_sphereCamRelPos, align 4, !tbaa !5
  %94 = fsub float %93, 1.125000e+00
  store float %94, ptr @_ZL17g_sphereCamRelPos, align 4, !tbaa !5
  br label %123

95:                                               ; preds = %3
  %96 = load float, ptr @_ZL17g_sphereCamRelPos, align 4, !tbaa !5
  %97 = fadd float %96, 1.125000e+00
  store float %97, ptr @_ZL17g_sphereCamRelPos, align 4, !tbaa !5
  br label %123

98:                                               ; preds = %3
  %99 = load float, ptr getelementptr inbounds (%struct.anon.9, ptr @_ZL17g_sphereCamRelPos, i32 0, i32 2), align 4, !tbaa !5
  %100 = fsub float %99, 5.000000e-01
  store float %100, ptr getelementptr inbounds (%struct.anon.9, ptr @_ZL17g_sphereCamRelPos, i32 0, i32 2), align 4, !tbaa !5
  br label %123

101:                                              ; preds = %3
  %102 = load float, ptr getelementptr inbounds (%struct.anon.9, ptr @_ZL17g_sphereCamRelPos, i32 0, i32 2), align 4, !tbaa !5
  %103 = fadd float %102, 5.000000e-01
  store float %103, ptr getelementptr inbounds (%struct.anon.9, ptr @_ZL17g_sphereCamRelPos, i32 0, i32 2), align 4, !tbaa !5
  br label %123

104:                                              ; preds = %3
  %105 = load i8, ptr @_ZL18g_bDrawLookatPoint, align 1, !tbaa !12, !range !14, !noundef !15
  %106 = trunc i8 %105 to i1
  %107 = xor i1 %106, true
  %108 = zext i1 %107 to i8
  store i8 %108, ptr @_ZL18g_bDrawLookatPoint, align 1, !tbaa !12
  %109 = load float, ptr @_ZL11g_camTarget, align 4, !tbaa !5
  %110 = fpext float %109 to double
  %111 = load float, ptr getelementptr inbounds (%struct.anon.9, ptr @_ZL11g_camTarget, i32 0, i32 1), align 4, !tbaa !5
  %112 = fpext float %111 to double
  %113 = load float, ptr getelementptr inbounds (%struct.anon.9, ptr @_ZL11g_camTarget, i32 0, i32 2), align 4, !tbaa !5
  %114 = fpext float %113 to double
  %115 = call i32 (ptr, ...) @printf(ptr noundef @.str.16, double noundef %110, double noundef %112, double noundef %114)
  %116 = load float, ptr @_ZL17g_sphereCamRelPos, align 4, !tbaa !5
  %117 = fpext float %116 to double
  %118 = load float, ptr getelementptr inbounds (%struct.anon.9, ptr @_ZL17g_sphereCamRelPos, i32 0, i32 1), align 4, !tbaa !5
  %119 = fpext float %118 to double
  %120 = load float, ptr getelementptr inbounds (%struct.anon.9, ptr @_ZL17g_sphereCamRelPos, i32 0, i32 2), align 4, !tbaa !5
  %121 = fpext float %120 to double
  %122 = call i32 (ptr, ...) @printf(ptr noundef @.str.17, double noundef %117, double noundef %119, double noundef %121)
  br label %123

123:                                              ; preds = %104, %101, %98, %95, %92, %89, %86, %83, %80, %77, %74, %71, %68, %65, %62, %59, %56, %53, %50, %47, %44, %41, %38, %35, %32, %3
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #6
  store float -7.875000e+01, ptr %7, align 4, !tbaa !16
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #6
  store float -1.000000e+00, ptr %8, align 4, !tbaa !16
  %124 = call noundef float @_ZN3glm5clampIfEET_RKS1_S3_S3_(ptr noundef nonnull align 4 dereferenceable(4) getelementptr inbounds (%struct.anon.9, ptr @_ZL17g_sphereCamRelPos, i32 0, i32 1), ptr noundef nonnull align 4 dereferenceable(4) %7, ptr noundef nonnull align 4 dereferenceable(4) %8)
  store float %124, ptr getelementptr inbounds (%struct.anon.9, ptr @_ZL17g_sphereCamRelPos, i32 0, i32 1), align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #6
  %125 = load float, ptr getelementptr inbounds (%struct.anon.9, ptr @_ZL11g_camTarget, i32 0, i32 1), align 4, !tbaa !5
  %126 = fcmp ogt float %125, 0.000000e+00
  br i1 %126, label %127, label %129

127:                                              ; preds = %123
  %128 = load float, ptr getelementptr inbounds (%struct.anon.9, ptr @_ZL11g_camTarget, i32 0, i32 1), align 4, !tbaa !5
  br label %130

129:                                              ; preds = %123
  br label %130

130:                                              ; preds = %129, %127
  %131 = phi float [ %128, %127 ], [ 0.000000e+00, %129 ]
  store float %131, ptr getelementptr inbounds (%struct.anon.9, ptr @_ZL11g_camTarget, i32 0, i32 1), align 4, !tbaa !5
  %132 = load float, ptr getelementptr inbounds (%struct.anon.9, ptr @_ZL17g_sphereCamRelPos, i32 0, i32 2), align 4, !tbaa !5
  %133 = fcmp ogt float %132, 5.000000e+00
  br i1 %133, label %134, label %136

134:                                              ; preds = %130
  %135 = load float, ptr getelementptr inbounds (%struct.anon.9, ptr @_ZL17g_sphereCamRelPos, i32 0, i32 2), align 4, !tbaa !5
  br label %137

136:                                              ; preds = %130
  br label %137

137:                                              ; preds = %136, %134
  %138 = phi float [ %135, %134 ], [ 5.000000e+00, %136 ]
  store float %138, ptr getelementptr inbounds (%struct.anon.9, ptr @_ZL17g_sphereCamRelPos, i32 0, i32 2), align 4, !tbaa !5
  call void @glutPostRedisplay()
  br label %139

139:                                              ; preds = %137, %31
  ret void
}

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

declare void @glutLeaveMainLoop() #2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef float @_ZN3glm5clampIfEET_RKS1_S3_S3_(ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) #5

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 = { inlinehint mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #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 = !{!"any pointer", !6, i64 0}
!12 = !{!13, !13, i64 0}
!13 = !{!"bool", !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"

%"struct.glm::detail::tvec3" = type { %union.anon.6 }
%union.anon.6 = type { %struct.anon.7 }
%struct.anon.7 = type { float, float, float }

@g_pConeMesh = external dso_local local_unnamed_addr global ptr, align 8
@g_pCylinderMesh = external dso_local local_unnamed_addr global ptr, align 8
@g_pCubeTintMesh = external dso_local local_unnamed_addr global ptr, align 8
@g_pCubeColorMesh = external dso_local local_unnamed_addr global ptr, align 8
@g_pPlaneMesh = external dso_local local_unnamed_addr global ptr, align 8
@_ZL11g_camTarget = external hidden local_unnamed_addr global %"struct.glm::detail::tvec3", align 4
@_ZL17g_sphereCamRelPos = external hidden global %"struct.glm::detail::tvec3", align 4
@_ZL18g_bDrawLookatPoint = external hidden local_unnamed_addr global i8, align 1
@.str.16 = external hidden unnamed_addr constant [20 x i8], align 1
@.str.17 = external hidden unnamed_addr constant [22 x i8], align 1

; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #0

; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #0

; Function Attrs: 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

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 #4 {
  %4 = alloca float, align 4
  %5 = alloca float, align 4
  switch i8 %0, label %116 [
    i8 27, label %6
    i8 119, label %27
    i8 115, label %30
    i8 100, label %33
    i8 97, label %36
    i8 101, label %39
    i8 113, label %42
    i8 87, label %45
    i8 83, label %48
    i8 68, label %51
    i8 65, label %54
    i8 69, label %57
    i8 81, label %60
    i8 105, label %63
    i8 107, label %66
    i8 106, label %69
    i8 108, label %72
    i8 111, label %75
    i8 117, label %78
    i8 73, label %81
    i8 75, label %84
    i8 74, label %87
    i8 76, label %90
    i8 79, label %93
    i8 85, label %96
    i8 32, label %99
  ]

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

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

10:                                               ; preds = %9, %6
  store ptr null, ptr @g_pConeMesh, align 8, !tbaa !5
  %11 = load ptr, ptr @g_pCylinderMesh, align 8, !tbaa !5
  %12 = icmp eq ptr %11, null
  br i1 %12, label %14, label %13

13:                                               ; preds = %10
  tail call void @_ZN9Framework4MeshD1Ev(ptr noundef nonnull align 8 dereferenceable(8) %11) #7
  tail call void @_ZdlPvm(ptr noundef nonnull %11, i64 noundef 8) #8
  br label %14

14:                                               ; preds = %13, %10
  store ptr null, ptr @g_pCylinderMesh, align 8, !tbaa !5
  %15 = load ptr, ptr @g_pCubeTintMesh, align 8, !tbaa !5
  %16 = icmp eq ptr %15, null
  br i1 %16, label %18, label %17

17:                                               ; preds = %14
  tail call void @_ZN9Framework4MeshD1Ev(ptr noundef nonnull align 8 dereferenceable(8) %15) #7
  tail call void @_ZdlPvm(ptr noundef nonnull %15, i64 noundef 8) #8
  br label %18

18:                                               ; preds = %17, %14
  store ptr null, ptr @g_pCubeTintMesh, align 8, !tbaa !5
  %19 = load ptr, ptr @g_pCubeColorMesh, align 8, !tbaa !5
  %20 = icmp eq ptr %19, null
  br i1 %20, label %22, label %21

21:                                               ; preds = %18
  tail call void @_ZN9Framework4MeshD1Ev(ptr noundef nonnull align 8 dereferenceable(8) %19) #7
  tail call void @_ZdlPvm(ptr noundef nonnull %19, i64 noundef 8) #8
  br label %22

22:                                               ; preds = %21, %18
  store ptr null, ptr @g_pCubeColorMesh, align 8, !tbaa !5
  %23 = load ptr, ptr @g_pPlaneMesh, align 8, !tbaa !5
  %24 = icmp eq ptr %23, null
  br i1 %24, label %26, label %25

25:                                               ; preds = %22
  tail call void @_ZN9Framework4MeshD1Ev(ptr noundef nonnull align 8 dereferenceable(8) %23) #7
  tail call void @_ZdlPvm(ptr noundef nonnull %23, i64 noundef 8) #8
  br label %26

26:                                               ; preds = %25, %22
  store ptr null, ptr @g_pPlaneMesh, align 8, !tbaa !5
  tail call void @glutLeaveMainLoop()
  br label %124

27:                                               ; preds = %3
  %28 = load float, ptr getelementptr inbounds (i8, ptr @_ZL11g_camTarget, i64 8), align 4, !tbaa !9
  %29 = fadd float %28, -4.000000e+00
  store float %29, ptr getelementptr inbounds (i8, ptr @_ZL11g_camTarget, i64 8), align 4, !tbaa !9
  br label %116

30:                                               ; preds = %3
  %31 = load float, ptr getelementptr inbounds (i8, ptr @_ZL11g_camTarget, i64 8), align 4, !tbaa !9
  %32 = fadd float %31, 4.000000e+00
  store float %32, ptr getelementptr inbounds (i8, ptr @_ZL11g_camTarget, i64 8), align 4, !tbaa !9
  br label %116

33:                                               ; preds = %3
  %34 = load float, ptr @_ZL11g_camTarget, align 4, !tbaa !9
  %35 = fadd float %34, 4.000000e+00
  store float %35, ptr @_ZL11g_camTarget, align 4, !tbaa !9
  br label %116

36:                                               ; preds = %3
  %37 = load float, ptr @_ZL11g_camTarget, align 4, !tbaa !9
  %38 = fadd float %37, -4.000000e+00
  store float %38, ptr @_ZL11g_camTarget, align 4, !tbaa !9
  br label %116

39:                                               ; preds = %3
  %40 = load float, ptr getelementptr inbounds (i8, ptr @_ZL11g_camTarget, i64 4), align 4, !tbaa !9
  %41 = fadd float %40, -4.000000e+00
  store float %41, ptr getelementptr inbounds (i8, ptr @_ZL11g_camTarget, i64 4), align 4, !tbaa !9
  br label %116

42:                                               ; preds = %3
  %43 = load float, ptr getelementptr inbounds (i8, ptr @_ZL11g_camTarget, i64 4), align 4, !tbaa !9
  %44 = fadd float %43, 4.000000e+00
  store float %44, ptr getelementptr inbounds (i8, ptr @_ZL11g_camTarget, i64 4), align 4, !tbaa !9
  br label %116

45:                                               ; preds = %3
  %46 = load float, ptr getelementptr inbounds (i8, ptr @_ZL11g_camTarget, i64 8), align 4, !tbaa !9
  %47 = fadd float %46, 0xBFD99999A0000000
  store float %47, ptr getelementptr inbounds (i8, ptr @_ZL11g_camTarget, i64 8), align 4, !tbaa !9
  br label %116

48:                                               ; preds = %3
  %49 = load float, ptr getelementptr inbounds (i8, ptr @_ZL11g_camTarget, i64 8), align 4, !tbaa !9
  %50 = fadd float %49, 0x3FD99999A0000000
  store float %50, ptr getelementptr inbounds (i8, ptr @_ZL11g_camTarget, i64 8), align 4, !tbaa !9
  br label %116

51:                                               ; preds = %3
  %52 = load float, ptr @_ZL11g_camTarget, align 4, !tbaa !9
  %53 = fadd float %52, 0x3FD99999A0000000
  store float %53, ptr @_ZL11g_camTarget, align 4, !tbaa !9
  br label %116

54:                                               ; preds = %3
  %55 = load float, ptr @_ZL11g_camTarget, align 4, !tbaa !9
  %56 = fadd float %55, 0xBFD99999A0000000
  store float %56, ptr @_ZL11g_camTarget, align 4, !tbaa !9
  br label %116

57:                                               ; preds = %3
  %58 = load float, ptr getelementptr inbounds (i8, ptr @_ZL11g_camTarget, i64 4), align 4, !tbaa !9
  %59 = fadd float %58, 0xBFD99999A0000000
  store float %59, ptr getelementptr inbounds (i8, ptr @_ZL11g_camTarget, i64 4), align 4, !tbaa !9
  br label %116

60:                                               ; preds = %3
  %61 = load float, ptr getelementptr inbounds (i8, ptr @_ZL11g_camTarget, i64 4), align 4, !tbaa !9
  %62 = fadd float %61, 0x3FD99999A0000000
  store float %62, ptr getelementptr inbounds (i8, ptr @_ZL11g_camTarget, i64 4), align 4, !tbaa !9
  br label %116

63:                                               ; preds = %3
  %64 = load float, ptr getelementptr inbounds (i8, ptr @_ZL17g_sphereCamRelPos, i64 4), align 4, !tbaa !9
  %65 = fadd float %64, -1.125000e+01
  store float %65, ptr getelementptr inbounds (i8, ptr @_ZL17g_sphereCamRelPos, i64 4), align 4, !tbaa !9
  br label %116

66:                                               ; preds = %3
  %67 = load float, ptr getelementptr inbounds (i8, ptr @_ZL17g_sphereCamRelPos, i64 4), align 4, !tbaa !9
  %68 = fadd float %67, 1.125000e+01
  store float %68, ptr getelementptr inbounds (i8, ptr @_ZL17g_sphereCamRelPos, i64 4), align 4, !tbaa !9
  br label %116

69:                                               ; preds = %3
  %70 = load float, ptr @_ZL17g_sphereCamRelPos, align 4, !tbaa !9
  %71 = fadd float %70, -1.125000e+01
  store float %71, ptr @_ZL17g_sphereCamRelPos, align 4, !tbaa !9
  br label %116

72:                                               ; preds = %3
  %73 = load float, ptr @_ZL17g_sphereCamRelPos, align 4, !tbaa !9
  %74 = fadd float %73, 1.125000e+01
  store float %74, ptr @_ZL17g_sphereCamRelPos, align 4, !tbaa !9
  br label %116

75:                                               ; preds = %3
  %76 = load float, ptr getelementptr inbounds (i8, ptr @_ZL17g_sphereCamRelPos, i64 8), align 4, !tbaa !9
  %77 = fadd float %76, -5.000000e+00
  store float %77, ptr getelementptr inbounds (i8, ptr @_ZL17g_sphereCamRelPos, i64 8), align 4, !tbaa !9
  br label %116

78:                                               ; preds = %3
  %79 = load float, ptr getelementptr inbounds (i8, ptr @_ZL17g_sphereCamRelPos, i64 8), align 4, !tbaa !9
  %80 = fadd float %79, 5.000000e+00
  store float %80, ptr getelementptr inbounds (i8, ptr @_ZL17g_sphereCamRelPos, i64 8), align 4, !tbaa !9
  br label %116

81:                                               ; preds = %3
  %82 = load float, ptr getelementptr inbounds (i8, ptr @_ZL17g_sphereCamRelPos, i64 4), align 4, !tbaa !9
  %83 = fadd float %82, -1.125000e+00
  store float %83, ptr getelementptr inbounds (i8, ptr @_ZL17g_sphereCamRelPos, i64 4), align 4, !tbaa !9
  br label %116

84:                                               ; preds = %3
  %85 = load float, ptr getelementptr inbounds (i8, ptr @_ZL17g_sphereCamRelPos, i64 4), align 4, !tbaa !9
  %86 = fadd float %85, 1.125000e+00
  store float %86, ptr getelementptr inbounds (i8, ptr @_ZL17g_sphereCamRelPos, i64 4), align 4, !tbaa !9
  br label %116

87:                                               ; preds = %3
  %88 = load float, ptr @_ZL17g_sphereCamRelPos, align 4, !tbaa !9
  %89 = fadd float %88, -1.125000e+00
  store float %89, ptr @_ZL17g_sphereCamRelPos, align 4, !tbaa !9
  br label %116

90:                                               ; preds = %3
  %91 = load float, ptr @_ZL17g_sphereCamRelPos, align 4, !tbaa !9
  %92 = fadd float %91, 1.125000e+00
  store float %92, ptr @_ZL17g_sphereCamRelPos, align 4, !tbaa !9
  br label %116

93:                                               ; preds = %3
  %94 = load float, ptr getelementptr inbounds (i8, ptr @_ZL17g_sphereCamRelPos, i64 8), align 4, !tbaa !9
  %95 = fadd float %94, -5.000000e-01
  store float %95, ptr getelementptr inbounds (i8, ptr @_ZL17g_sphereCamRelPos, i64 8), align 4, !tbaa !9
  br label %116

96:                                               ; preds = %3
  %97 = load float, ptr getelementptr inbounds (i8, ptr @_ZL17g_sphereCamRelPos, i64 8), align 4, !tbaa !9
  %98 = fadd float %97, 5.000000e-01
  store float %98, ptr getelementptr inbounds (i8, ptr @_ZL17g_sphereCamRelPos, i64 8), align 4, !tbaa !9
  br label %116

99:                                               ; preds = %3
  %100 = load i8, ptr @_ZL18g_bDrawLookatPoint, align 1, !tbaa !10, !range !12, !noundef !13
  %101 = xor i8 %100, 1
  store i8 %101, ptr @_ZL18g_bDrawLookatPoint, align 1, !tbaa !10
  %102 = load float, ptr @_ZL11g_camTarget, align 4, !tbaa !9
  %103 = fpext float %102 to double
  %104 = load float, ptr getelementptr inbounds (i8, ptr @_ZL11g_camTarget, i64 4), align 4, !tbaa !9
  %105 = fpext float %104 to double
  %106 = load float, ptr getelementptr inbounds (i8, ptr @_ZL11g_camTarget, i64 8), align 4, !tbaa !9
  %107 = fpext float %106 to double
  %108 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.16, double noundef %103, double noundef %105, double noundef %107)
  %109 = load float, ptr @_ZL17g_sphereCamRelPos, align 4, !tbaa !9
  %110 = fpext float %109 to double
  %111 = load float, ptr getelementptr inbounds (i8, ptr @_ZL17g_sphereCamRelPos, i64 4), align 4, !tbaa !9
  %112 = fpext float %111 to double
  %113 = load float, ptr getelementptr inbounds (i8, ptr @_ZL17g_sphereCamRelPos, i64 8), align 4, !tbaa !9
  %114 = fpext float %113 to double
  %115 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.17, double noundef %110, double noundef %112, double noundef %114)
  br label %116

116:                                              ; preds = %99, %96, %93, %90, %87, %84, %81, %78, %75, %72, %69, %66, %63, %60, %57, %54, %51, %48, %45, %42, %39, %36, %33, %30, %27, %3
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %4) #7
  store float -7.875000e+01, ptr %4, align 4, !tbaa !14
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %5) #7
  store float -1.000000e+00, ptr %5, align 4, !tbaa !14
  %117 = call noundef float @_ZN3glm5clampIfEET_RKS1_S3_S3_(ptr noundef nonnull align 4 dereferenceable(4) getelementptr inbounds (i8, ptr @_ZL17g_sphereCamRelPos, i64 4), ptr noundef nonnull align 4 dereferenceable(4) %4, ptr noundef nonnull align 4 dereferenceable(4) %5)
  store float %117, ptr getelementptr inbounds (i8, ptr @_ZL17g_sphereCamRelPos, i64 4), align 4, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #7
  %118 = load float, ptr getelementptr inbounds (i8, ptr @_ZL11g_camTarget, i64 4), align 4
  %119 = fcmp ogt float %118, 0.000000e+00
  %120 = select i1 %119, float %118, float 0.000000e+00
  store float %120, ptr getelementptr inbounds (i8, ptr @_ZL11g_camTarget, i64 4), align 4, !tbaa !9
  %121 = load float, ptr getelementptr inbounds (i8, ptr @_ZL17g_sphereCamRelPos, i64 8), align 4
  %122 = fcmp ogt float %121, 5.000000e+00
  %123 = select i1 %122, float %121, float 5.000000e+00
  store float %123, ptr getelementptr inbounds (i8, ptr @_ZL17g_sphereCamRelPos, i64 8), align 4, !tbaa !9
  call void @glutPostRedisplay()
  br label %124

124:                                              ; preds = %116, %26
  ret void
}

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

declare void @glutLeaveMainLoop() local_unnamed_addr #3

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef float @_ZN3glm5clampIfEET_RKS1_S3_S3_(ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #6

attributes #0 = { mustprogress 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 = { 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 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { nounwind "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 = { inlinehint mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #7 = { nounwind }
attributes #8 = { 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 = !{!7, !7, i64 0}
!10 = !{!11, !11, i64 0}
!11 = !{!"bool", !7, i64 0}
!12 = !{i8 0, i8 2}
!13 = !{}
!14 = !{!15, !15, i64 0}
!15 = !{!"float", !7, i64 0}


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