; LLVM IR from paroj/gltut :: Tut 09 Lights on/AmbientLighting.ll (Z4initv)

; 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.std::__cxx11::basic_string" = type { %"struct.std::__cxx11::basic_string<char>::_Alloc_hider", i64, %union.anon }
%"struct.std::__cxx11::basic_string<char>::_Alloc_hider" = type { ptr }
%union.anon = type { i64, [8 x i8] }
%"class.std::allocator.0" = type { i8 }

@g_pCylinderMesh = external dso_local global ptr, align 8
@g_pPlaneMesh = external dso_local global ptr, align 8
@g_projectionUniformBuffer = external dso_local global i32, align 4
@_ZTISt9exception = external constant ptr
@.str.14 = external hidden unnamed_addr constant [17 x i8], align 1
@.str.15 = external hidden unnamed_addr constant [15 x i8], align 1
@.str.16 = external hidden unnamed_addr constant [4 x i8], align 1
@_funcptr_glEnable = external global ptr, align 8
@_funcptr_glCullFace = external global ptr, align 8
@_funcptr_glFrontFace = external global ptr, align 8
@_funcptr_glDepthMask = external global ptr, align 8
@_funcptr_glDepthFunc = external global ptr, align 8
@_funcptr_glDepthRange = external global ptr, align 8
@_funcptr_glGenBuffers = external global ptr, align 8
@_funcptr_glBindBuffer = external global ptr, align 8
@_funcptr_glBufferData = external global ptr, align 8
@_funcptr_glBindBufferRange = external global ptr, align 8

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

declare i32 @__gxx_personality_v0(...)

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

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

; Function Attrs: mustprogress nounwind uwtable
declare void @_ZNSaIcEC2Ev(ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #2 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_(ptr noundef nonnull align 8 dereferenceable(32), ptr noundef, ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #1 align 2

; Function Attrs: mustprogress nounwind uwtable
declare void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32)) unnamed_addr #2 align 2

; Function Attrs: mustprogress uwtable
define dso_local void @_Z4initv() #1 personality ptr @__gxx_personality_v0 {
  %1 = alloca ptr, align 8
  %2 = alloca i32, align 4
  %3 = alloca %"class.std::__cxx11::basic_string", align 8
  %4 = alloca %"class.std::allocator.0", align 1
  %5 = alloca i1, align 1
  %6 = alloca %"class.std::__cxx11::basic_string", align 8
  %7 = alloca %"class.std::allocator.0", align 1
  %8 = alloca i1, align 1
  %9 = alloca ptr, align 8
  call void @_Z17InitializeProgramv()
  %10 = invoke noalias noundef nonnull ptr @_Znwm(i64 noundef 8) #8
          to label %11 unwind label %18

11:                                               ; preds = %0
  store i1 true, ptr %5, align 1
  call void @llvm.lifetime.start.p0(i64 32, ptr %3) #9
  call void @llvm.lifetime.start.p0(i64 1, ptr %4) #9
  call void @_ZNSaIcEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %4) #9
  invoke void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_(ptr noundef nonnull align 8 dereferenceable(32) %3, ptr noundef @.str.14, ptr noundef nonnull align 1 dereferenceable(1) %4)
          to label %12 unwind label %22

12:                                               ; preds = %11
  invoke void @_ZN9Framework4MeshC1ERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(ptr noundef nonnull align 8 dereferenceable(8) %10, ptr noundef nonnull align 8 dereferenceable(32) %3)
          to label %13 unwind label %26

13:                                               ; preds = %12
  store i1 false, ptr %5, align 1
  store ptr %10, ptr @g_pCylinderMesh, align 8, !tbaa !5
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %3) #9
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %4) #9
  call void @llvm.lifetime.end.p0(i64 1, ptr %4) #9
  call void @llvm.lifetime.end.p0(i64 32, ptr %3) #9
  %14 = invoke noalias noundef nonnull ptr @_Znwm(i64 noundef 8) #8
          to label %15 unwind label %18

15:                                               ; preds = %13
  store i1 true, ptr %8, align 1
  call void @llvm.lifetime.start.p0(i64 32, ptr %6) #9
  call void @llvm.lifetime.start.p0(i64 1, ptr %7) #9
  call void @_ZNSaIcEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %7) #9
  invoke void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_(ptr noundef nonnull align 8 dereferenceable(32) %6, ptr noundef @.str.15, ptr noundef nonnull align 1 dereferenceable(1) %7)
          to label %16 unwind label %34

16:                                               ; preds = %15
  invoke void @_ZN9Framework4MeshC1ERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(ptr noundef nonnull align 8 dereferenceable(8) %14, ptr noundef nonnull align 8 dereferenceable(32) %6)
          to label %17 unwind label %38

17:                                               ; preds = %16
  store i1 false, ptr %8, align 1
  store ptr %14, ptr @g_pPlaneMesh, align 8, !tbaa !5
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %6) #9
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %7) #9
  call void @llvm.lifetime.end.p0(i64 1, ptr %7) #9
  call void @llvm.lifetime.end.p0(i64 32, ptr %6) #9
  br label %65

18:                                               ; preds = %13, %0
  %19 = landingpad { ptr, i32 }
          catch ptr @_ZTISt9exception
  %20 = extractvalue { ptr, i32 } %19, 0
  store ptr %20, ptr %1, align 8
  %21 = extractvalue { ptr, i32 } %19, 1
  store i32 %21, ptr %2, align 4
  br label %46

22:                                               ; preds = %11
  %23 = landingpad { ptr, i32 }
          cleanup
          catch ptr @_ZTISt9exception
  %24 = extractvalue { ptr, i32 } %23, 0
  store ptr %24, ptr %1, align 8
  %25 = extractvalue { ptr, i32 } %23, 1
  store i32 %25, ptr %2, align 4
  br label %30

26:                                               ; preds = %12
  %27 = landingpad { ptr, i32 }
          cleanup
          catch ptr @_ZTISt9exception
  %28 = extractvalue { ptr, i32 } %27, 0
  store ptr %28, ptr %1, align 8
  %29 = extractvalue { ptr, i32 } %27, 1
  store i32 %29, ptr %2, align 4
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %3) #9
  br label %30

30:                                               ; preds = %26, %22
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %4) #9
  call void @llvm.lifetime.end.p0(i64 1, ptr %4) #9
  call void @llvm.lifetime.end.p0(i64 32, ptr %3) #9
  %31 = load i1, ptr %5, align 1
  br i1 %31, label %32, label %33

32:                                               ; preds = %30
  call void @_ZdlPvm(ptr noundef %10, i64 noundef 8) #10
  br label %33

33:                                               ; preds = %32, %30
  br label %46

34:                                               ; preds = %15
  %35 = landingpad { ptr, i32 }
          cleanup
          catch ptr @_ZTISt9exception
  %36 = extractvalue { ptr, i32 } %35, 0
  store ptr %36, ptr %1, align 8
  %37 = extractvalue { ptr, i32 } %35, 1
  store i32 %37, ptr %2, align 4
  br label %42

38:                                               ; preds = %16
  %39 = landingpad { ptr, i32 }
          cleanup
          catch ptr @_ZTISt9exception
  %40 = extractvalue { ptr, i32 } %39, 0
  store ptr %40, ptr %1, align 8
  %41 = extractvalue { ptr, i32 } %39, 1
  store i32 %41, ptr %2, align 4
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %6) #9
  br label %42

42:                                               ; preds = %38, %34
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %7) #9
  call void @llvm.lifetime.end.p0(i64 1, ptr %7) #9
  call void @llvm.lifetime.end.p0(i64 32, ptr %6) #9
  %43 = load i1, ptr %8, align 1
  br i1 %43, label %44, label %45

44:                                               ; preds = %42
  call void @_ZdlPvm(ptr noundef %14, i64 noundef 8) #10
  br label %45

45:                                               ; preds = %44, %42
  br label %46

46:                                               ; preds = %45, %33, %18
  %47 = load i32, ptr %2, align 4
  %48 = call i32 @llvm.eh.typeid.for.p0(ptr @_ZTISt9exception) #9
  %49 = icmp eq i32 %47, %48
  br i1 %49, label %50, label %81

50:                                               ; preds = %46
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #9
  %51 = load ptr, ptr %1, align 8
  %52 = call ptr @__cxa_begin_catch(ptr %51) #9
  store ptr %52, ptr %9, align 8
  %53 = load ptr, ptr %9, align 8, !tbaa !5
  %54 = load ptr, ptr %53, align 8, !tbaa !9
  %55 = getelementptr inbounds ptr, ptr %54, i64 2
  %56 = load ptr, ptr %55, align 8
  %57 = call noundef ptr %56(ptr noundef nonnull align 8 dereferenceable(8) %53) #9
  %58 = invoke i32 (ptr, ...) @printf(ptr noundef @.str.16, ptr noundef %57)
          to label %59 unwind label %60

59:                                               ; preds = %50
  invoke void @__cxa_rethrow() #11
          to label %89 unwind label %60

60:                                               ; preds = %59, %50
  %61 = landingpad { ptr, i32 }
          cleanup
  %62 = extractvalue { ptr, i32 } %61, 0
  store ptr %62, ptr %1, align 8
  %63 = extractvalue { ptr, i32 } %61, 1
  store i32 %63, ptr %2, align 4
  invoke void @__cxa_end_catch()
          to label %64 unwind label %86

64:                                               ; preds = %60
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #9
  br label %81

65:                                               ; preds = %17
  call void @glutMouseFunc(ptr noundef @_ZN12_GLOBAL__N_111MouseButtonEiiii)
  call void @glutMotionFunc(ptr noundef @_ZN12_GLOBAL__N_111MouseMotionEii)
  call void @glutMouseWheelFunc(ptr noundef @_ZN12_GLOBAL__N_110MouseWheelEiiii)
  %66 = load ptr, ptr @_funcptr_glEnable, align 8, !tbaa !5
  call void %66(i32 noundef 2884)
  %67 = load ptr, ptr @_funcptr_glCullFace, align 8, !tbaa !5
  call void %67(i32 noundef 1029)
  %68 = load ptr, ptr @_funcptr_glFrontFace, align 8, !tbaa !5
  call void %68(i32 noundef 2304)
  %69 = load ptr, ptr @_funcptr_glEnable, align 8, !tbaa !5
  call void %69(i32 noundef 2929)
  %70 = load ptr, ptr @_funcptr_glDepthMask, align 8, !tbaa !5
  call void %70(i8 noundef zeroext 1)
  %71 = load ptr, ptr @_funcptr_glDepthFunc, align 8, !tbaa !5
  call void %71(i32 noundef 515)
  %72 = load ptr, ptr @_funcptr_glDepthRange, align 8, !tbaa !5
  call void %72(double noundef 0.000000e+00, double noundef 1.000000e+00)
  %73 = load ptr, ptr @_funcptr_glEnable, align 8, !tbaa !5
  call void %73(i32 noundef 34383)
  %74 = load ptr, ptr @_funcptr_glGenBuffers, align 8, !tbaa !5
  call void %74(i32 noundef 1, ptr noundef @g_projectionUniformBuffer)
  %75 = load ptr, ptr @_funcptr_glBindBuffer, align 8, !tbaa !5
  %76 = load i32, ptr @g_projectionUniformBuffer, align 4, !tbaa !11
  call void %75(i32 noundef 35345, i32 noundef %76)
  %77 = load ptr, ptr @_funcptr_glBufferData, align 8, !tbaa !5
  call void %77(i32 noundef 35345, i64 noundef 64, ptr noundef null, i32 noundef 35048)
  %78 = load ptr, ptr @_funcptr_glBindBufferRange, align 8, !tbaa !5
  %79 = load i32, ptr @g_projectionUniformBuffer, align 4, !tbaa !11
  call void %78(i32 noundef 35345, i32 noundef 2, i32 noundef %79, i64 noundef 0, i64 noundef 64)
  %80 = load ptr, ptr @_funcptr_glBindBuffer, align 8, !tbaa !5
  call void %80(i32 noundef 35345, i32 noundef 0)
  ret void

81:                                               ; preds = %64, %46
  %82 = load ptr, ptr %1, align 8
  %83 = load i32, ptr %2, align 4
  %84 = insertvalue { ptr, i32 } poison, ptr %82, 0
  %85 = insertvalue { ptr, i32 } %84, i32 %83, 1
  resume { ptr, i32 } %85

86:                                               ; preds = %60
  %87 = landingpad { ptr, i32 }
          catch ptr null
  %88 = extractvalue { ptr, i32 } %87, 0
  call void @__clang_call_terminate(ptr %88) #12
  unreachable

89:                                               ; preds = %59
  unreachable
}

; Function Attrs: nobuiltin allocsize(0)
declare noundef nonnull ptr @_Znwm(i64 noundef) #3

declare void @_ZN9Framework4MeshC1ERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(32)) unnamed_addr #4

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

; Function Attrs: nounwind memory(none)
declare i32 @llvm.eh.typeid.for.p0(ptr) #6

declare ptr @__cxa_begin_catch(ptr)

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

declare void @__cxa_rethrow()

declare void @__cxa_end_catch()

; Function Attrs: noinline noreturn nounwind uwtable
declare hidden void @__clang_call_terminate(ptr noundef) #7

declare void @glutMouseFunc(ptr noundef) #4

; Function Attrs: mustprogress uwtable
declare hidden void @_ZN12_GLOBAL__N_111MouseButtonEiiii(i32 noundef, i32 noundef, i32 noundef, i32 noundef) #1

declare void @glutMotionFunc(ptr noundef) #4

; Function Attrs: mustprogress uwtable
declare hidden void @_ZN12_GLOBAL__N_111MouseMotionEii(i32 noundef, i32 noundef) #1

declare void @glutMouseWheelFunc(ptr noundef) #4

; Function Attrs: mustprogress uwtable
declare hidden void @_ZN12_GLOBAL__N_110MouseWheelEiiii(i32 noundef, i32 noundef, i32 noundef, i32 noundef) #1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #2 align 2

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { 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 #3 = { nobuiltin allocsize(0) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { 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 #6 = { nounwind memory(none) }
attributes #7 = { noinline noreturn nounwind uwtable "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 #8 = { builtin allocsize(0) }
attributes #9 = { nounwind }
attributes #10 = { builtin nounwind }
attributes #11 = { noreturn }
attributes #12 = { noreturn 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 = !{!"vtable pointer", !8, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"int", !7, 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.std::__cxx11::basic_string" = type { %"struct.std::__cxx11::basic_string<char>::_Alloc_hider", i64, %union.anon }
%"struct.std::__cxx11::basic_string<char>::_Alloc_hider" = type { ptr }
%union.anon = type { i64, [8 x i8] }
%"class.std::allocator.0" = type { i8 }

@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_projectionUniformBuffer = external dso_local global i32, align 4
@_ZTISt9exception = external constant ptr
@.str.14 = external hidden unnamed_addr constant [17 x i8], align 1
@.str.15 = external hidden unnamed_addr constant [15 x i8], align 1
@.str.16 = external hidden unnamed_addr constant [4 x i8], align 1
@_funcptr_glEnable = external local_unnamed_addr global ptr, align 8
@_funcptr_glCullFace = external local_unnamed_addr global ptr, align 8
@_funcptr_glFrontFace = external local_unnamed_addr global ptr, align 8
@_funcptr_glDepthMask = external local_unnamed_addr global ptr, align 8
@_funcptr_glDepthFunc = external local_unnamed_addr global ptr, align 8
@_funcptr_glDepthRange = external local_unnamed_addr global ptr, align 8
@_funcptr_glGenBuffers = external local_unnamed_addr global ptr, align 8
@_funcptr_glBindBuffer = external local_unnamed_addr global ptr, align 8
@_funcptr_glBufferData = external local_unnamed_addr global ptr, align 8
@_funcptr_glBindBufferRange = external local_unnamed_addr global ptr, align 8

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

declare i32 @__gxx_personality_v0(...)

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

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

; Function Attrs: mustprogress nounwind uwtable
declare void @_ZNSaIcEC2Ev(ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #2 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_(ptr noundef nonnull align 8 dereferenceable(32), ptr noundef, ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #1 align 2

; Function Attrs: mustprogress nounwind uwtable
declare void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32)) unnamed_addr #2 align 2

; Function Attrs: mustprogress uwtable
define dso_local void @_Z4initv() local_unnamed_addr #1 personality ptr @__gxx_personality_v0 {
  %1 = alloca %"class.std::__cxx11::basic_string", align 8
  %2 = alloca %"class.std::allocator.0", align 1
  %3 = alloca %"class.std::__cxx11::basic_string", align 8
  %4 = alloca %"class.std::allocator.0", align 1
  tail call void @_Z17InitializeProgramv()
  %5 = invoke noalias noundef nonnull dereferenceable(8) ptr @_Znwm(i64 noundef 8) #9
          to label %6 unwind label %28

6:                                                ; preds = %0
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %1) #10
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %2) #10
  call void @_ZNSaIcEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %2) #10
  invoke void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_(ptr noundef nonnull align 8 dereferenceable(32) %1, ptr noundef nonnull @.str.14, ptr noundef nonnull align 1 dereferenceable(1) %2)
          to label %7 unwind label %30

7:                                                ; preds = %6
  invoke void @_ZN9Framework4MeshC1ERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(ptr noundef nonnull align 8 dereferenceable(8) %5, ptr noundef nonnull align 8 dereferenceable(32) %1)
          to label %8 unwind label %32

8:                                                ; preds = %7
  store ptr %5, ptr @g_pCylinderMesh, align 8, !tbaa !5
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %1) #10
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %2) #10
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %2) #10
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %1) #10
  %9 = invoke noalias noundef nonnull dereferenceable(8) ptr @_Znwm(i64 noundef 8) #9
          to label %10 unwind label %28

10:                                               ; preds = %8
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %3) #10
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %4) #10
  call void @_ZNSaIcEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %4) #10
  invoke void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_(ptr noundef nonnull align 8 dereferenceable(32) %3, ptr noundef nonnull @.str.15, ptr noundef nonnull align 1 dereferenceable(1) %4)
          to label %11 unwind label %35

11:                                               ; preds = %10
  invoke void @_ZN9Framework4MeshC1ERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(ptr noundef nonnull align 8 dereferenceable(8) %9, ptr noundef nonnull align 8 dereferenceable(32) %3)
          to label %12 unwind label %37

12:                                               ; preds = %11
  store ptr %9, ptr @g_pPlaneMesh, align 8, !tbaa !5
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %3) #10
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %4) #10
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %4) #10
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %3) #10
  call void @glutMouseFunc(ptr noundef nonnull @_ZN12_GLOBAL__N_111MouseButtonEiiii)
  call void @glutMotionFunc(ptr noundef nonnull @_ZN12_GLOBAL__N_111MouseMotionEii)
  call void @glutMouseWheelFunc(ptr noundef nonnull @_ZN12_GLOBAL__N_110MouseWheelEiiii)
  %13 = load ptr, ptr @_funcptr_glEnable, align 8, !tbaa !5
  call void %13(i32 noundef 2884)
  %14 = load ptr, ptr @_funcptr_glCullFace, align 8, !tbaa !5
  call void %14(i32 noundef 1029)
  %15 = load ptr, ptr @_funcptr_glFrontFace, align 8, !tbaa !5
  call void %15(i32 noundef 2304)
  %16 = load ptr, ptr @_funcptr_glEnable, align 8, !tbaa !5
  call void %16(i32 noundef 2929)
  %17 = load ptr, ptr @_funcptr_glDepthMask, align 8, !tbaa !5
  call void %17(i8 noundef zeroext 1)
  %18 = load ptr, ptr @_funcptr_glDepthFunc, align 8, !tbaa !5
  call void %18(i32 noundef 515)
  %19 = load ptr, ptr @_funcptr_glDepthRange, align 8, !tbaa !5
  call void %19(double noundef 0.000000e+00, double noundef 1.000000e+00)
  %20 = load ptr, ptr @_funcptr_glEnable, align 8, !tbaa !5
  call void %20(i32 noundef 34383)
  %21 = load ptr, ptr @_funcptr_glGenBuffers, align 8, !tbaa !5
  call void %21(i32 noundef 1, ptr noundef nonnull @g_projectionUniformBuffer)
  %22 = load ptr, ptr @_funcptr_glBindBuffer, align 8, !tbaa !5
  %23 = load i32, ptr @g_projectionUniformBuffer, align 4, !tbaa !9
  call void %22(i32 noundef 35345, i32 noundef %23)
  %24 = load ptr, ptr @_funcptr_glBufferData, align 8, !tbaa !5
  call void %24(i32 noundef 35345, i64 noundef 64, ptr noundef null, i32 noundef 35048)
  %25 = load ptr, ptr @_funcptr_glBindBufferRange, align 8, !tbaa !5
  %26 = load i32, ptr @g_projectionUniformBuffer, align 4, !tbaa !9
  call void %25(i32 noundef 35345, i32 noundef 2, i32 noundef %26, i64 noundef 0, i64 noundef 64)
  %27 = load ptr, ptr @_funcptr_glBindBuffer, align 8, !tbaa !5
  call void %27(i32 noundef 35345, i32 noundef 0)
  ret void

28:                                               ; preds = %8, %0
  %29 = landingpad { ptr, i32 }
          catch ptr @_ZTISt9exception
  br label %40

30:                                               ; preds = %6
  %31 = landingpad { ptr, i32 }
          cleanup
          catch ptr @_ZTISt9exception
  br label %34

32:                                               ; preds = %7
  %33 = landingpad { ptr, i32 }
          cleanup
          catch ptr @_ZTISt9exception
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %1) #10
  br label %34

34:                                               ; preds = %32, %30
  %.pn = phi { ptr, i32 } [ %33, %32 ], [ %31, %30 ]
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %2) #10
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %2) #10
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %1) #10
  call void @_ZdlPvm(ptr noundef nonnull %5, i64 noundef 8) #11
  br label %40

35:                                               ; preds = %10
  %36 = landingpad { ptr, i32 }
          cleanup
          catch ptr @_ZTISt9exception
  br label %39

37:                                               ; preds = %11
  %38 = landingpad { ptr, i32 }
          cleanup
          catch ptr @_ZTISt9exception
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %3) #10
  br label %39

39:                                               ; preds = %37, %35
  %.pn11 = phi { ptr, i32 } [ %38, %37 ], [ %36, %35 ]
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %4) #10
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %4) #10
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %3) #10
  call void @_ZdlPvm(ptr noundef nonnull %9, i64 noundef 8) #11
  br label %40

40:                                               ; preds = %39, %34, %28
  %.pn11.pn = phi { ptr, i32 } [ %.pn11, %39 ], [ %29, %28 ], [ %.pn, %34 ]
  %.28 = extractvalue { ptr, i32 } %.pn11.pn, 1
  %41 = call i32 @llvm.eh.typeid.for.p0(ptr nonnull @_ZTISt9exception) #10
  %42 = icmp eq i32 %.28, %41
  br i1 %42, label %43, label %52

43:                                               ; preds = %40
  %.2 = extractvalue { ptr, i32 } %.pn11.pn, 0
  %44 = call ptr @__cxa_begin_catch(ptr %.2) #10
  %45 = load ptr, ptr %44, align 8, !tbaa !11
  %46 = getelementptr inbounds i8, ptr %45, i64 16
  %47 = load ptr, ptr %46, align 8
  %48 = call noundef ptr %47(ptr noundef nonnull align 8 dereferenceable(8) %44) #10
  %49 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.16, ptr noundef %48)
  invoke void @__cxa_rethrow() #12
          to label %56 unwind label %50

50:                                               ; preds = %43
  %51 = landingpad { ptr, i32 }
          cleanup
  invoke void @__cxa_end_catch()
          to label %52 unwind label %53

52:                                               ; preds = %50, %40
  %.merged = phi { ptr, i32 } [ %.pn11.pn, %40 ], [ %51, %50 ]
  resume { ptr, i32 } %.merged

53:                                               ; preds = %50
  %54 = landingpad { ptr, i32 }
          catch ptr null
  %55 = extractvalue { ptr, i32 } %54, 0
  call void @__clang_call_terminate(ptr %55) #13
  unreachable

56:                                               ; preds = %43
  unreachable
}

; Function Attrs: nobuiltin allocsize(0)
declare noundef nonnull ptr @_Znwm(i64 noundef) local_unnamed_addr #3

declare void @_ZN9Framework4MeshC1ERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(32)) unnamed_addr #4

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

; Function Attrs: nofree nosync nounwind memory(none)
declare i32 @llvm.eh.typeid.for.p0(ptr) #6

declare ptr @__cxa_begin_catch(ptr) local_unnamed_addr

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

declare void @__cxa_rethrow() local_unnamed_addr

declare void @__cxa_end_catch() local_unnamed_addr

; Function Attrs: noinline noreturn nounwind uwtable
declare hidden void @__clang_call_terminate(ptr noundef) local_unnamed_addr #8

declare void @glutMouseFunc(ptr noundef) local_unnamed_addr #4

; Function Attrs: mustprogress uwtable
declare hidden void @_ZN12_GLOBAL__N_111MouseButtonEiiii(i32 noundef, i32 noundef, i32 noundef, i32 noundef) #1

declare void @glutMotionFunc(ptr noundef) local_unnamed_addr #4

; Function Attrs: mustprogress uwtable
declare hidden void @_ZN12_GLOBAL__N_111MouseMotionEii(i32 noundef, i32 noundef) #1

declare void @glutMouseWheelFunc(ptr noundef) local_unnamed_addr #4

; Function Attrs: mustprogress uwtable
declare hidden void @_ZN12_GLOBAL__N_110MouseWheelEiiii(i32 noundef, i32 noundef, i32 noundef, i32 noundef) #1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #2 align 2

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { 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 #3 = { nobuiltin allocsize(0) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { 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 #6 = { nofree nosync nounwind memory(none) }
attributes #7 = { 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 #8 = { noinline noreturn nounwind uwtable "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 #9 = { builtin allocsize(0) }
attributes #10 = { nounwind }
attributes #11 = { builtin nounwind }
attributes #12 = { noreturn }
attributes #13 = { noreturn 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 = !{!"int", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"vtable pointer", !8, i64 0}


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