; LLVM IR from paroj/gltut :: Tut 11 Shinies/BlinnVsPhongLighting.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_pCubeMesh = external dso_local global ptr, align 8
@g_projectionUniformBuffer = external dso_local global i32, align 4
@_ZTISt9exception = external constant ptr
@.str.21 = external hidden unnamed_addr constant [17 x i8], align 1
@.str.22 = external hidden unnamed_addr constant [15 x i8], align 1
@.str.23 = external hidden unnamed_addr constant [13 x i8], align 1
@.str.24 = 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 @_Z18InitializeProgramsv() #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 %"class.std::__cxx11::basic_string", align 8
  %10 = alloca %"class.std::allocator.0", align 1
  %11 = alloca i1, align 1
  %12 = alloca ptr, align 8
  %13 = alloca float, align 4
  %14 = alloca float, align 4
  call void @_Z18InitializeProgramsv()
  %15 = invoke noalias noundef nonnull ptr @_Znwm(i64 noundef 8) #8
          to label %16 unwind label %27

16:                                               ; 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.21, ptr noundef nonnull align 1 dereferenceable(1) %4)
          to label %17 unwind label %31

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

18:                                               ; preds = %17
  store i1 false, ptr %5, align 1
  store ptr %15, 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
  %19 = invoke noalias noundef nonnull ptr @_Znwm(i64 noundef 8) #8
          to label %20 unwind label %27

20:                                               ; preds = %18
  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.22, ptr noundef nonnull align 1 dereferenceable(1) %7)
          to label %21 unwind label %43

21:                                               ; preds = %20
  invoke void @_ZN9Framework4MeshC1ERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(ptr noundef nonnull align 8 dereferenceable(8) %19, ptr noundef nonnull align 8 dereferenceable(32) %6)
          to label %22 unwind label %47

22:                                               ; preds = %21
  store i1 false, ptr %8, align 1
  store ptr %19, 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
  %23 = invoke noalias noundef nonnull ptr @_Znwm(i64 noundef 8) #8
          to label %24 unwind label %27

24:                                               ; preds = %22
  store i1 true, ptr %11, align 1
  call void @llvm.lifetime.start.p0(i64 32, ptr %9) #9
  call void @llvm.lifetime.start.p0(i64 1, ptr %10) #9
  call void @_ZNSaIcEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %10) #9
  invoke void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_(ptr noundef nonnull align 8 dereferenceable(32) %9, ptr noundef @.str.23, ptr noundef nonnull align 1 dereferenceable(1) %10)
          to label %25 unwind label %55

25:                                               ; preds = %24
  invoke void @_ZN9Framework4MeshC1ERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(ptr noundef nonnull align 8 dereferenceable(8) %23, ptr noundef nonnull align 8 dereferenceable(32) %9)
          to label %26 unwind label %59

26:                                               ; preds = %25
  store i1 false, ptr %11, align 1
  store ptr %23, ptr @g_pCubeMesh, align 8, !tbaa !5
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %9) #9
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %10) #9
  call void @llvm.lifetime.end.p0(i64 1, ptr %10) #9
  call void @llvm.lifetime.end.p0(i64 32, ptr %9) #9
  br label %86

27:                                               ; preds = %22, %18, %0
  %28 = landingpad { ptr, i32 }
          catch ptr @_ZTISt9exception
  %29 = extractvalue { ptr, i32 } %28, 0
  store ptr %29, ptr %1, align 8
  %30 = extractvalue { ptr, i32 } %28, 1
  store i32 %30, ptr %2, align 4
  br label %67

31:                                               ; preds = %16
  %32 = landingpad { ptr, i32 }
          cleanup
          catch ptr @_ZTISt9exception
  %33 = extractvalue { ptr, i32 } %32, 0
  store ptr %33, ptr %1, align 8
  %34 = extractvalue { ptr, i32 } %32, 1
  store i32 %34, ptr %2, align 4
  br label %39

35:                                               ; preds = %17
  %36 = landingpad { ptr, i32 }
          cleanup
          catch ptr @_ZTISt9exception
  %37 = extractvalue { ptr, i32 } %36, 0
  store ptr %37, ptr %1, align 8
  %38 = extractvalue { ptr, i32 } %36, 1
  store i32 %38, ptr %2, align 4
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %3) #9
  br label %39

39:                                               ; preds = %35, %31
  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
  %40 = load i1, ptr %5, align 1
  br i1 %40, label %41, label %42

41:                                               ; preds = %39
  call void @_ZdlPvm(ptr noundef %15, i64 noundef 8) #10
  br label %42

42:                                               ; preds = %41, %39
  br label %67

43:                                               ; preds = %20
  %44 = landingpad { ptr, i32 }
          cleanup
          catch ptr @_ZTISt9exception
  %45 = extractvalue { ptr, i32 } %44, 0
  store ptr %45, ptr %1, align 8
  %46 = extractvalue { ptr, i32 } %44, 1
  store i32 %46, ptr %2, align 4
  br label %51

47:                                               ; preds = %21
  %48 = landingpad { ptr, i32 }
          cleanup
          catch ptr @_ZTISt9exception
  %49 = extractvalue { ptr, i32 } %48, 0
  store ptr %49, ptr %1, align 8
  %50 = extractvalue { ptr, i32 } %48, 1
  store i32 %50, ptr %2, align 4
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %6) #9
  br label %51

51:                                               ; preds = %47, %43
  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
  %52 = load i1, ptr %8, align 1
  br i1 %52, label %53, label %54

53:                                               ; preds = %51
  call void @_ZdlPvm(ptr noundef %19, i64 noundef 8) #10
  br label %54

54:                                               ; preds = %53, %51
  br label %67

55:                                               ; preds = %24
  %56 = landingpad { ptr, i32 }
          cleanup
          catch ptr @_ZTISt9exception
  %57 = extractvalue { ptr, i32 } %56, 0
  store ptr %57, ptr %1, align 8
  %58 = extractvalue { ptr, i32 } %56, 1
  store i32 %58, ptr %2, align 4
  br label %63

59:                                               ; preds = %25
  %60 = landingpad { ptr, i32 }
          cleanup
          catch ptr @_ZTISt9exception
  %61 = extractvalue { ptr, i32 } %60, 0
  store ptr %61, ptr %1, align 8
  %62 = extractvalue { ptr, i32 } %60, 1
  store i32 %62, ptr %2, align 4
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %9) #9
  br label %63

63:                                               ; preds = %59, %55
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %10) #9
  call void @llvm.lifetime.end.p0(i64 1, ptr %10) #9
  call void @llvm.lifetime.end.p0(i64 32, ptr %9) #9
  %64 = load i1, ptr %11, align 1
  br i1 %64, label %65, label %66

65:                                               ; preds = %63
  call void @_ZdlPvm(ptr noundef %23, i64 noundef 8) #10
  br label %66

66:                                               ; preds = %65, %63
  br label %67

67:                                               ; preds = %66, %54, %42, %27
  %68 = load i32, ptr %2, align 4
  %69 = call i32 @llvm.eh.typeid.for.p0(ptr @_ZTISt9exception) #9
  %70 = icmp eq i32 %68, %69
  br i1 %70, label %71, label %102

71:                                               ; preds = %67
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #9
  %72 = load ptr, ptr %1, align 8
  %73 = call ptr @__cxa_begin_catch(ptr %72) #9
  store ptr %73, ptr %12, align 8
  %74 = load ptr, ptr %12, align 8, !tbaa !5
  %75 = load ptr, ptr %74, align 8, !tbaa !9
  %76 = getelementptr inbounds ptr, ptr %75, i64 2
  %77 = load ptr, ptr %76, align 8
  %78 = call noundef ptr %77(ptr noundef nonnull align 8 dereferenceable(8) %74) #9
  %79 = invoke i32 (ptr, ...) @printf(ptr noundef @.str.24, ptr noundef %78)
          to label %80 unwind label %81

80:                                               ; preds = %71
  invoke void @__cxa_rethrow() #11
          to label %110 unwind label %81

81:                                               ; preds = %80, %71
  %82 = landingpad { ptr, i32 }
          cleanup
  %83 = extractvalue { ptr, i32 } %82, 0
  store ptr %83, ptr %1, align 8
  %84 = extractvalue { ptr, i32 } %82, 1
  store i32 %84, ptr %2, align 4
  invoke void @__cxa_end_catch()
          to label %85 unwind label %107

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

86:                                               ; preds = %26
  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)
  %87 = load ptr, ptr @_funcptr_glEnable, align 8, !tbaa !5
  call void %87(i32 noundef 2884)
  %88 = load ptr, ptr @_funcptr_glCullFace, align 8, !tbaa !5
  call void %88(i32 noundef 1029)
  %89 = load ptr, ptr @_funcptr_glFrontFace, align 8, !tbaa !5
  call void %89(i32 noundef 2304)
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #9
  store float 0.000000e+00, ptr %13, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #9
  store float 1.000000e+00, ptr %14, align 4, !tbaa !11
  %90 = load ptr, ptr @_funcptr_glEnable, align 8, !tbaa !5
  call void %90(i32 noundef 2929)
  %91 = load ptr, ptr @_funcptr_glDepthMask, align 8, !tbaa !5
  call void %91(i8 noundef zeroext 1)
  %92 = load ptr, ptr @_funcptr_glDepthFunc, align 8, !tbaa !5
  call void %92(i32 noundef 515)
  %93 = load ptr, ptr @_funcptr_glDepthRange, align 8, !tbaa !5
  call void %93(double noundef 0.000000e+00, double noundef 1.000000e+00)
  %94 = load ptr, ptr @_funcptr_glEnable, align 8, !tbaa !5
  call void %94(i32 noundef 34383)
  %95 = load ptr, ptr @_funcptr_glGenBuffers, align 8, !tbaa !5
  call void %95(i32 noundef 1, ptr noundef @g_projectionUniformBuffer)
  %96 = load ptr, ptr @_funcptr_glBindBuffer, align 8, !tbaa !5
  %97 = load i32, ptr @g_projectionUniformBuffer, align 4, !tbaa !13
  call void %96(i32 noundef 35345, i32 noundef %97)
  %98 = load ptr, ptr @_funcptr_glBufferData, align 8, !tbaa !5
  call void %98(i32 noundef 35345, i64 noundef 64, ptr noundef null, i32 noundef 35048)
  %99 = load ptr, ptr @_funcptr_glBindBufferRange, align 8, !tbaa !5
  %100 = load i32, ptr @g_projectionUniformBuffer, align 4, !tbaa !13
  call void %99(i32 noundef 35345, i32 noundef 2, i32 noundef %100, i64 noundef 0, i64 noundef 64)
  %101 = load ptr, ptr @_funcptr_glBindBuffer, align 8, !tbaa !5
  call void %101(i32 noundef 35345, i32 noundef 0)
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #9
  ret void

102:                                              ; preds = %85, %67
  %103 = load ptr, ptr %1, align 8
  %104 = load i32, ptr %2, align 4
  %105 = insertvalue { ptr, i32 } poison, ptr %103, 0
  %106 = insertvalue { ptr, i32 } %105, i32 %104, 1
  resume { ptr, i32 } %106

107:                                              ; preds = %81
  %108 = landingpad { ptr, i32 }
          catch ptr null
  %109 = extractvalue { ptr, i32 } %108, 0
  call void @__clang_call_terminate(ptr %109) #12
  unreachable

110:                                              ; preds = %80
  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 = !{!"float", !7, i64 0}
!13 = !{!14, !14, i64 0}
!14 = !{!"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_pCubeMesh = external dso_local local_unnamed_addr global ptr, align 8
@g_projectionUniformBuffer = external dso_local global i32, align 4
@_ZTISt9exception = external constant ptr
@.str.21 = external hidden unnamed_addr constant [17 x i8], align 1
@.str.22 = external hidden unnamed_addr constant [15 x i8], align 1
@.str.23 = external hidden unnamed_addr constant [13 x i8], align 1
@.str.24 = 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 @_Z18InitializeProgramsv() 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
  %5 = alloca %"class.std::__cxx11::basic_string", align 8
  %6 = alloca %"class.std::allocator.0", align 1
  tail call void @_Z18InitializeProgramsv()
  %7 = invoke noalias noundef nonnull dereferenceable(8) ptr @_Znwm(i64 noundef 8) #9
          to label %8 unwind label %34

8:                                                ; 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.21, ptr noundef nonnull align 1 dereferenceable(1) %2)
          to label %9 unwind label %36

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

10:                                               ; preds = %9
  store ptr %7, 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
  %11 = invoke noalias noundef nonnull dereferenceable(8) ptr @_Znwm(i64 noundef 8) #9
          to label %12 unwind label %34

12:                                               ; preds = %10
  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.22, ptr noundef nonnull align 1 dereferenceable(1) %4)
          to label %13 unwind label %41

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

14:                                               ; preds = %13
  store ptr %11, 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
  %15 = invoke noalias noundef nonnull dereferenceable(8) ptr @_Znwm(i64 noundef 8) #9
          to label %16 unwind label %34

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

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

18:                                               ; preds = %17
  store ptr %15, ptr @g_pCubeMesh, align 8, !tbaa !5
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %5) #10
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %6) #10
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %6) #10
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %5) #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)
  %19 = load ptr, ptr @_funcptr_glEnable, align 8, !tbaa !5
  call void %19(i32 noundef 2884)
  %20 = load ptr, ptr @_funcptr_glCullFace, align 8, !tbaa !5
  call void %20(i32 noundef 1029)
  %21 = load ptr, ptr @_funcptr_glFrontFace, align 8, !tbaa !5
  call void %21(i32 noundef 2304)
  %22 = load ptr, ptr @_funcptr_glEnable, align 8, !tbaa !5
  call void %22(i32 noundef 2929)
  %23 = load ptr, ptr @_funcptr_glDepthMask, align 8, !tbaa !5
  call void %23(i8 noundef zeroext 1)
  %24 = load ptr, ptr @_funcptr_glDepthFunc, align 8, !tbaa !5
  call void %24(i32 noundef 515)
  %25 = load ptr, ptr @_funcptr_glDepthRange, align 8, !tbaa !5
  call void %25(double noundef 0.000000e+00, double noundef 1.000000e+00)
  %26 = load ptr, ptr @_funcptr_glEnable, align 8, !tbaa !5
  call void %26(i32 noundef 34383)
  %27 = load ptr, ptr @_funcptr_glGenBuffers, align 8, !tbaa !5
  call void %27(i32 noundef 1, ptr noundef nonnull @g_projectionUniformBuffer)
  %28 = load ptr, ptr @_funcptr_glBindBuffer, align 8, !tbaa !5
  %29 = load i32, ptr @g_projectionUniformBuffer, align 4, !tbaa !9
  call void %28(i32 noundef 35345, i32 noundef %29)
  %30 = load ptr, ptr @_funcptr_glBufferData, align 8, !tbaa !5
  call void %30(i32 noundef 35345, i64 noundef 64, ptr noundef null, i32 noundef 35048)
  %31 = load ptr, ptr @_funcptr_glBindBufferRange, align 8, !tbaa !5
  %32 = load i32, ptr @g_projectionUniformBuffer, align 4, !tbaa !9
  call void %31(i32 noundef 35345, i32 noundef 2, i32 noundef %32, i64 noundef 0, i64 noundef 64)
  %33 = load ptr, ptr @_funcptr_glBindBuffer, align 8, !tbaa !5
  call void %33(i32 noundef 35345, i32 noundef 0)
  ret void

34:                                               ; preds = %14, %10, %0
  %35 = landingpad { ptr, i32 }
          catch ptr @_ZTISt9exception
  br label %51

36:                                               ; preds = %8
  %37 = landingpad { ptr, i32 }
          cleanup
          catch ptr @_ZTISt9exception
  br label %40

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

40:                                               ; preds = %38, %36
  %.pn = phi { ptr, i32 } [ %39, %38 ], [ %37, %36 ]
  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 %7, i64 noundef 8) #11
  br label %51

41:                                               ; preds = %12
  %42 = landingpad { ptr, i32 }
          cleanup
          catch ptr @_ZTISt9exception
  br label %45

43:                                               ; preds = %13
  %44 = landingpad { ptr, i32 }
          cleanup
          catch ptr @_ZTISt9exception
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %3) #10
  br label %45

45:                                               ; preds = %43, %41
  %.pn13 = phi { ptr, i32 } [ %44, %43 ], [ %42, %41 ]
  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 %11, i64 noundef 8) #11
  br label %51

46:                                               ; preds = %16
  %47 = landingpad { ptr, i32 }
          cleanup
          catch ptr @_ZTISt9exception
  br label %50

48:                                               ; preds = %17
  %49 = landingpad { ptr, i32 }
          cleanup
          catch ptr @_ZTISt9exception
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %5) #10
  br label %50

50:                                               ; preds = %48, %46
  %.pn15 = phi { ptr, i32 } [ %49, %48 ], [ %47, %46 ]
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %6) #10
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %6) #10
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %5) #10
  call void @_ZdlPvm(ptr noundef nonnull %15, i64 noundef 8) #11
  br label %51

51:                                               ; preds = %50, %45, %40, %34
  %.pn15.pn = phi { ptr, i32 } [ %.pn15, %50 ], [ %35, %34 ], [ %.pn13, %45 ], [ %.pn, %40 ]
  %.310 = extractvalue { ptr, i32 } %.pn15.pn, 1
  %52 = call i32 @llvm.eh.typeid.for.p0(ptr nonnull @_ZTISt9exception) #10
  %53 = icmp eq i32 %.310, %52
  br i1 %53, label %54, label %63

54:                                               ; preds = %51
  %.3 = extractvalue { ptr, i32 } %.pn15.pn, 0
  %55 = call ptr @__cxa_begin_catch(ptr %.3) #10
  %56 = load ptr, ptr %55, align 8, !tbaa !11
  %57 = getelementptr inbounds i8, ptr %56, i64 16
  %58 = load ptr, ptr %57, align 8
  %59 = call noundef ptr %58(ptr noundef nonnull align 8 dereferenceable(8) %55) #10
  %60 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.24, ptr noundef %59)
  invoke void @__cxa_rethrow() #12
          to label %67 unwind label %61

61:                                               ; preds = %54
  %62 = landingpad { ptr, i32 }
          cleanup
  invoke void @__cxa_end_catch()
          to label %63 unwind label %64

63:                                               ; preds = %61, %51
  %.merged = phi { ptr, i32 } [ %.pn15.pn, %51 ], [ %62, %61 ]
  resume { ptr, i32 } %.merged

64:                                               ; preds = %61
  %65 = landingpad { ptr, i32 }
          catch ptr null
  %66 = extractvalue { ptr, i32 } %65, 0
  call void @__clang_call_terminate(ptr %66) #13
  unreachable

67:                                               ; preds = %54
  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