; LLVM IR from achilles288/robot-monitor-graphics :: src/window/window.ll (ZN3rmg6Window8mainLoopEv)

; 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.rmg::ContextList::iterator" = type { ptr, ptr }
%"struct.rmg::Rect" = type { i16, i16 }
%"class.rmg::Window" = type { %"class.rmg::Context", ptr }
%"class.rmg::Context" = type { ptr, i32, i16, i16, %"struct.rmg::ColorRGBA", %"class.rmg::Camera", %"struct.rmg::Vec3", %"struct.rmg::Vec3", %"struct.rmg::ColorRGBA", %"class.rmg::ObjectList", %"class.rmg::ObjectList", %"class.rmg::ObjectList", %"class.rmg::ObjectList", %"class.rmg::ObjectList", %"class.rmg::MaterialList", %"class.rmg::FontList", %"class.rmg::internal::GeneralShader", %"class.rmg::internal::ShadowMapShader", %"class.rmg::internal::Object2DShader", %"class.rmg::internal::ParticleShader", %"class.rmg::internal::Line3DShader", %"class.rmg::internal::ContextLoader", %"class.rmg::internal::GLContext", i8, float, i8, i32 }
%"class.rmg::Camera" = type { %"struct.rmg::Vec3", %"struct.rmg::Mat3", %"struct.rmg::Mat4", %"struct.rmg::Mat4", %"struct.rmg::Mat4", float, float, float, float, float, i32 }
%"struct.rmg::Mat3" = type { %union.anon.0 }
%union.anon.0 = type { [3 x [3 x float]] }
%"struct.rmg::Mat4" = type { %union.anon.1 }
%union.anon.1 = type { [4 x [4 x float]] }
%"struct.rmg::Vec3" = type { %union.anon }
%union.anon = type { %struct.anon }
%struct.anon = type { float, float, float }
%"struct.rmg::ColorRGBA" = type { float, float, float, float }
%"class.rmg::ObjectList" = type { %"class.rmg::LinkedList.base.3", [4 x i8] }
%"class.rmg::LinkedList.base.3" = type <{ ptr, ptr, i32 }>
%"class.rmg::MaterialList" = type { %"class.rmg::LinkedList.base.5", [4 x i8] }
%"class.rmg::LinkedList.base.5" = type <{ ptr, ptr, i32 }>
%"class.rmg::FontList" = type { %"class.rmg::LinkedList.base.7", [4 x i8] }
%"class.rmg::LinkedList.base.7" = type <{ ptr, ptr, i32 }>
%"class.rmg::internal::GeneralShader" = type { %"class.rmg::internal::Shader.base", i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, [4 x i8] }
%"class.rmg::internal::Shader.base" = type <{ ptr, i32 }>
%"class.rmg::internal::ShadowMapShader" = type { %"class.rmg::internal::Shader.base", %"class.rmg::Camera", %"struct.rmg::Vec3", %"struct.rmg::Vec3", %"struct.rmg::Vec3", float, float, float, i32, i32, i32 }
%"class.rmg::internal::Object2DShader" = type { %"class.rmg::internal::SpriteShader", %"class.rmg::internal::Text2DShader", %"struct.rmg::Mat3", i16, i16 }
%"class.rmg::internal::SpriteShader" = type { %"class.rmg::internal::Shader.base", i32, i32, i32, i32, i32 }
%"class.rmg::internal::Text2DShader" = type { %"class.rmg::internal::Shader.base", i32, i32, i32, i32, i32, i32, i32 }
%"class.rmg::internal::ParticleShader" = type { %"class.rmg::internal::Shader.base", i32, i32, i32, i32, i32, i32, i32 }
%"class.rmg::internal::Line3DShader" = type { %"class.rmg::internal::Shader.base", i32, i32, i32, i32, i32 }
%"class.rmg::internal::ContextLoader" = type { %"class.rmg::internal::PendingStack" }
%"class.rmg::internal::PendingStack" = type <{ ptr, %"class.rmg::internal::Pending", i32, [4 x i8] }>
%"class.rmg::internal::Pending" = type { ptr, ptr }
%"class.rmg::internal::GLContext" = type { ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr }

@_ZN3rmg6Window10windowListE = external dso_local global { ptr, ptr, i32 }, align 8
@_ZL12glfwInitDone = external hidden global i8, align 1
@_ZTISt13runtime_error = external constant ptr
@_ZTIN3rmg7Context17UserExitExceptionE = external constant ptr

declare i32 @__gxx_personality_v0(...)

declare void @_ZN3rmg7Context12setErrorCodeEi(ptr noundef nonnull align 8 dereferenceable(1440), i32 noundef) #0

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

declare double @glfwGetTime() #0

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN3rmg6Window8mainLoopEv() #2 align 2 personality ptr @__gxx_personality_v0 {
  %1 = alloca double, align 8
  %2 = alloca %"class.rmg::ContextList::iterator", align 8
  %3 = alloca %"class.rmg::ContextList::iterator", align 8
  %4 = alloca i32, align 4
  %5 = alloca ptr, align 8
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca %"struct.rmg::Rect", align 2
  %9 = alloca ptr, align 8
  %10 = alloca i32, align 4
  %11 = alloca ptr, align 8
  %12 = alloca ptr, align 8
  %13 = alloca %"class.rmg::ContextList::iterator", align 8
  %14 = alloca double, align 8
  %15 = alloca double, align 8
  br label %16

16:                                               ; preds = %160, %0
  %17 = call noundef i32 @_ZNK3rmg10LinkedListINS_7ContextEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(20) @_ZN3rmg6Window10windowListE)
  %18 = icmp ugt i32 %17, 0
  br i1 %18, label %19, label %161

19:                                               ; preds = %16
  call void @llvm.lifetime.start.p0(i64 8, ptr %1) #7
  %20 = call double @glfwGetTime()
  store double %20, ptr %1, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 16, ptr %2) #7
  %21 = call { ptr, ptr } @_ZNK3rmg11ContextList5beginEv(ptr noundef nonnull align 8 dereferenceable(20) @_ZN3rmg6Window10windowListE)
  %22 = getelementptr inbounds { ptr, ptr }, ptr %2, i32 0, i32 0
  %23 = extractvalue { ptr, ptr } %21, 0
  store ptr %23, ptr %22, align 8
  %24 = getelementptr inbounds { ptr, ptr }, ptr %2, i32 0, i32 1
  %25 = extractvalue { ptr, ptr } %21, 1
  store ptr %25, ptr %24, align 8
  br label %26

26:                                               ; preds = %139, %19
  call void @llvm.lifetime.start.p0(i64 16, ptr %3) #7
  %27 = call { ptr, ptr } @_ZNK3rmg11ContextList3endEv(ptr noundef nonnull align 8 dereferenceable(20) @_ZN3rmg6Window10windowListE)
  %28 = getelementptr inbounds { ptr, ptr }, ptr %3, i32 0, i32 0
  %29 = extractvalue { ptr, ptr } %27, 0
  store ptr %29, ptr %28, align 8
  %30 = getelementptr inbounds { ptr, ptr }, ptr %3, i32 0, i32 1
  %31 = extractvalue { ptr, ptr } %27, 1
  store ptr %31, ptr %30, align 8
  %32 = call noundef zeroext i1 @_ZN3rmg11ContextList8iteratorneERKS1_(ptr noundef nonnull align 8 dereferenceable(16) %2, ptr noundef nonnull align 8 dereferenceable(16) %3)
  call void @llvm.lifetime.end.p0(i64 16, ptr %3) #7
  br i1 %32, label %34, label %33

33:                                               ; preds = %26
  store i32 4, ptr %4, align 4
  br label %145

34:                                               ; preds = %26
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #7
  %35 = call noundef nonnull align 8 dereferenceable(1440) ptr @_ZN3rmg11ContextList8iteratordeEv(ptr noundef nonnull align 8 dereferenceable(16) %2)
  store ptr %35, ptr %5, align 8, !tbaa !9
  %36 = load ptr, ptr %5, align 8, !tbaa !9
  %37 = getelementptr inbounds %"class.rmg::Window", ptr %36, i32 0, i32 1
  %38 = load ptr, ptr %37, align 8, !tbaa !11
  %39 = call i32 @glfwWindowShouldClose(ptr noundef %38)
  %40 = icmp ne i32 %39, 0
  br i1 %40, label %41, label %46

41:                                               ; preds = %34
  %42 = load ptr, ptr %5, align 8, !tbaa !9
  %43 = load ptr, ptr %42, align 8, !tbaa !42
  %44 = getelementptr inbounds ptr, ptr %43, i64 16
  %45 = load ptr, ptr %44, align 8
  call void %45(ptr noundef nonnull align 8 dereferenceable(1448) %42)
  store i32 4, ptr %4, align 4
  br label %136

46:                                               ; preds = %34
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #7
  %47 = load ptr, ptr %5, align 8, !tbaa !9
  %48 = getelementptr inbounds %"class.rmg::Window", ptr %47, i32 0, i32 1
  %49 = load ptr, ptr %48, align 8, !tbaa !11
  call void @glfwGetFramebufferSize(ptr noundef %49, ptr noundef %6, ptr noundef %7)
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #7
  %50 = load ptr, ptr %5, align 8, !tbaa !9
  %51 = call i32 @_ZNK3rmg7Context14getContextSizeEv(ptr noundef nonnull align 8 dereferenceable(1440) %50)
  store i32 %51, ptr %8, align 2
  %52 = load i32, ptr %6, align 4, !tbaa !44
  %53 = getelementptr inbounds %"struct.rmg::Rect", ptr %8, i32 0, i32 0
  %54 = load i16, ptr %53, align 2, !tbaa !45
  %55 = zext i16 %54 to i32
  %56 = icmp ne i32 %52, %55
  br i1 %56, label %63, label %57

57:                                               ; preds = %46
  %58 = load i32, ptr %7, align 4, !tbaa !44
  %59 = getelementptr inbounds %"struct.rmg::Rect", ptr %8, i32 0, i32 1
  %60 = load i16, ptr %59, align 2, !tbaa !47
  %61 = zext i16 %60 to i32
  %62 = icmp ne i32 %58, %61
  br i1 %62, label %63, label %73

63:                                               ; preds = %57, %46
  %64 = load ptr, ptr %5, align 8, !tbaa !9
  %65 = load i32, ptr %6, align 4, !tbaa !44
  %66 = trunc i32 %65 to i16
  %67 = load i32, ptr %7, align 4, !tbaa !44
  %68 = trunc i32 %67 to i16
  call void @_ZN3rmg7Context14setContextSizeEtt(ptr noundef nonnull align 8 dereferenceable(1440) %64, i16 noundef zeroext %66, i16 noundef zeroext %68)
  %69 = load ptr, ptr %5, align 8, !tbaa !9
  %70 = load ptr, ptr %69, align 8, !tbaa !42
  %71 = getelementptr inbounds ptr, ptr %70, i64 4
  %72 = load ptr, ptr %71, align 8
  call void %72(ptr noundef nonnull align 8 dereferenceable(1440) %69)
  br label %73

73:                                               ; preds = %63, %57
  %74 = load ptr, ptr %5, align 8, !tbaa !9
  invoke void @_ZN3rmg7Context6renderEv(ptr noundef nonnull align 8 dereferenceable(1440) %74)
          to label %75 unwind label %76

75:                                               ; preds = %73
  br label %130

76:                                               ; preds = %73
  %77 = landingpad { ptr, i32 }
          cleanup
          catch ptr @_ZTISt13runtime_error
          catch ptr @_ZTIN3rmg7Context17UserExitExceptionE
  %78 = extractvalue { ptr, i32 } %77, 0
  store ptr %78, ptr %9, align 8
  %79 = extractvalue { ptr, i32 } %77, 1
  store i32 %79, ptr %10, align 4
  br label %80

80:                                               ; preds = %76
  %81 = load i32, ptr %10, align 4
  %82 = call i32 @llvm.eh.typeid.for.p0(ptr @_ZTISt13runtime_error) #7
  %83 = icmp eq i32 %81, %82
  br i1 %83, label %84, label %94

84:                                               ; preds = %80
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #7
  %85 = load ptr, ptr %9, align 8
  %86 = call ptr @__cxa_begin_catch(ptr %85) #7
  store ptr %86, ptr %12, align 8
  %87 = load ptr, ptr %5, align 8, !tbaa !9
  %88 = invoke noundef i32 @_ZNK3rmg7Context12getErrorCodeEv(ptr noundef nonnull align 8 dereferenceable(1440) %87)
          to label %89 unwind label %112

89:                                               ; preds = %84
  %90 = icmp eq i32 %88, 0
  br i1 %90, label %91, label %116

91:                                               ; preds = %89
  %92 = load ptr, ptr %5, align 8, !tbaa !9
  invoke void @_ZN3rmg7Context12setErrorCodeEi(ptr noundef nonnull align 8 dereferenceable(1440) %92, i32 noundef 1)
          to label %93 unwind label %112

93:                                               ; preds = %91
  br label %116

94:                                               ; preds = %80
  %95 = call i32 @llvm.eh.typeid.for.p0(ptr @_ZTIN3rmg7Context17UserExitExceptionE) #7
  %96 = icmp eq i32 %81, %95
  br i1 %96, label %97, label %134

97:                                               ; preds = %94
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #7
  %98 = load ptr, ptr %9, align 8
  %99 = call ptr @__cxa_begin_catch(ptr %98) #7
  store ptr %99, ptr %11, align 8
  %100 = load ptr, ptr %11, align 8, !tbaa !9
  %101 = load ptr, ptr %100, align 8, !tbaa !42
  %102 = getelementptr inbounds ptr, ptr %101, i64 2
  %103 = load ptr, ptr %102, align 8
  %104 = call noundef ptr %103(ptr noundef nonnull align 8 dereferenceable(8) %100) #7
  %105 = invoke i32 (ptr, ...) @printf(ptr noundef %104)
          to label %106 unwind label %107

106:                                              ; preds = %97
  store i32 4, ptr %4, align 4
  call void @__cxa_end_catch()
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #7
  br label %131

107:                                              ; preds = %97
  %108 = landingpad { ptr, i32 }
          cleanup
  %109 = extractvalue { ptr, i32 } %108, 0
  store ptr %109, ptr %9, align 8
  %110 = extractvalue { ptr, i32 } %108, 1
  store i32 %110, ptr %10, align 4
  invoke void @__cxa_end_catch()
          to label %111 unwind label %167

111:                                              ; preds = %107
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #7
  br label %134

112:                                              ; preds = %123, %116, %91, %84
  %113 = landingpad { ptr, i32 }
          cleanup
  %114 = extractvalue { ptr, i32 } %113, 0
  store ptr %114, ptr %9, align 8
  %115 = extractvalue { ptr, i32 } %113, 1
  store i32 %115, ptr %10, align 4
  invoke void @__cxa_end_catch()
          to label %129 unwind label %167

116:                                              ; preds = %93, %89
  %117 = load ptr, ptr %12, align 8, !tbaa !9
  %118 = load ptr, ptr %117, align 8, !tbaa !42
  %119 = getelementptr inbounds ptr, ptr %118, i64 2
  %120 = load ptr, ptr %119, align 8
  %121 = call noundef ptr %120(ptr noundef nonnull align 8 dereferenceable(16) %117) #7
  %122 = invoke i32 (ptr, ...) @printf(ptr noundef %121)
          to label %123 unwind label %112

123:                                              ; preds = %116
  %124 = load ptr, ptr %5, align 8, !tbaa !9
  %125 = load ptr, ptr %124, align 8, !tbaa !42
  %126 = getelementptr inbounds ptr, ptr %125, i64 16
  %127 = load ptr, ptr %126, align 8
  invoke void %127(ptr noundef nonnull align 8 dereferenceable(1448) %124)
          to label %128 unwind label %112

128:                                              ; preds = %123
  store i32 4, ptr %4, align 4
  call void @__cxa_end_catch()
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #7
  br label %131

129:                                              ; preds = %112
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #7
  br label %134

130:                                              ; preds = %75
  store i32 0, ptr %4, align 4
  br label %131

131:                                              ; preds = %130, %128, %106
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #7
  %132 = load i32, ptr %4, align 4
  switch i32 %132, label %136 [
    i32 0, label %133
  ]

133:                                              ; preds = %131
  br label %135

134:                                              ; preds = %129, %111, %94
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr %2) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %1) #7
  br label %162

135:                                              ; preds = %133
  store i32 0, ptr %4, align 4
  br label %136

136:                                              ; preds = %135, %131, %41
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #7
  %137 = load i32, ptr %4, align 4
  switch i32 %137, label %145 [
    i32 0, label %138
  ]

138:                                              ; preds = %136
  br label %139

139:                                              ; preds = %138
  %140 = call { ptr, ptr } @_ZN3rmg11ContextList8iteratorppEi(ptr noundef nonnull align 8 dereferenceable(16) %2, i32 noundef 0)
  %141 = getelementptr inbounds { ptr, ptr }, ptr %13, i32 0, i32 0
  %142 = extractvalue { ptr, ptr } %140, 0
  store ptr %142, ptr %141, align 8
  %143 = getelementptr inbounds { ptr, ptr }, ptr %13, i32 0, i32 1
  %144 = extractvalue { ptr, ptr } %140, 1
  store ptr %144, ptr %143, align 8
  br label %26, !llvm.loop !48

145:                                              ; preds = %136, %33
  call void @llvm.lifetime.end.p0(i64 16, ptr %2) #7
  br label %146

146:                                              ; preds = %145
  call void @glfwPollEvents()
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #7
  %147 = call double @glfwGetTime()
  store double %147, ptr %14, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #7
  %148 = load double, ptr %14, align 8, !tbaa !5
  %149 = load double, ptr %1, align 8, !tbaa !5
  %150 = fsub double %148, %149
  store double %150, ptr %15, align 8, !tbaa !5
  %151 = load double, ptr %15, align 8, !tbaa !5
  %152 = fcmp olt double %151, 0x3F91111340000000
  br i1 %152, label %153, label %160

153:                                              ; preds = %146
  %154 = load double, ptr %15, align 8, !tbaa !5
  %155 = fneg double %154
  %156 = call double @llvm.fmuladd.f64(double %155, double 1.000000e+03, double 0x4030AAACE0000000)
  %157 = fmul double %156, 1.000000e+03
  %158 = fptoui double %157 to i32
  %159 = call i32 @usleep(i32 noundef %158)
  br label %160

160:                                              ; preds = %153, %146
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %1) #7
  br label %16, !llvm.loop !50

161:                                              ; preds = %16
  call void @glfwTerminate()
  store i8 0, ptr @_ZL12glfwInitDone, align 1, !tbaa !51
  ret void

162:                                              ; preds = %134
  %163 = load ptr, ptr %9, align 8
  %164 = load i32, ptr %10, align 4
  %165 = insertvalue { ptr, i32 } poison, ptr %163, 0
  %166 = insertvalue { ptr, i32 } %165, i32 %164, 1
  resume { ptr, i32 } %166

167:                                              ; preds = %112, %107
  %168 = landingpad { ptr, i32 }
          catch ptr null
  %169 = extractvalue { ptr, i32 } %168, 0
  call void @__clang_call_terminate(ptr %169) #8
  unreachable
}

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZNK3rmg10LinkedListINS_7ContextEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(20)) #3 align 2

declare { ptr, ptr } @_ZNK3rmg11ContextList5beginEv(ptr noundef nonnull align 8 dereferenceable(20)) #0

declare noundef zeroext i1 @_ZN3rmg11ContextList8iteratorneERKS1_(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(16)) #0

declare { ptr, ptr } @_ZNK3rmg11ContextList3endEv(ptr noundef nonnull align 8 dereferenceable(20)) #0

declare noundef nonnull align 8 dereferenceable(1440) ptr @_ZN3rmg11ContextList8iteratordeEv(ptr noundef nonnull align 8 dereferenceable(16)) #0

declare i32 @glfwWindowShouldClose(ptr noundef) #0

declare void @glfwGetFramebufferSize(ptr noundef, ptr noundef, ptr noundef) #0

declare i32 @_ZNK3rmg7Context14getContextSizeEv(ptr noundef nonnull align 8 dereferenceable(1440)) #0

declare void @_ZN3rmg7Context14setContextSizeEtt(ptr noundef nonnull align 8 dereferenceable(1440), i16 noundef zeroext, i16 noundef zeroext) #0

declare void @_ZN3rmg7Context6renderEv(ptr noundef nonnull align 8 dereferenceable(1440)) #0

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

declare ptr @__cxa_begin_catch(ptr)

declare void @__cxa_end_catch()

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

declare noundef i32 @_ZNK3rmg7Context12getErrorCodeEv(ptr noundef nonnull align 8 dereferenceable(1440)) #0

declare { ptr, ptr } @_ZN3rmg11ContextList8iteratorppEi(ptr noundef nonnull align 8 dereferenceable(16), i32 noundef) #0

declare void @glfwPollEvents() #0

declare i32 @usleep(i32 noundef) #0

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare double @llvm.fmuladd.f64(double, double, double) #6

declare void @glfwTerminate() #0

attributes #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 #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { 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 #4 = { nounwind memory(none) }
attributes #5 = { 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 #6 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #7 = { nounwind }
attributes #8 = { 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 = !{!"double", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"any pointer", !7, i64 0}
!11 = !{!12, !10, i64 1440}
!12 = !{!"_ZTSN3rmg6WindowE", !13, i64 0, !10, i64 1440}
!13 = !{!"_ZTSN3rmg7ContextE", !14, i64 8, !15, i64 12, !15, i64 14, !16, i64 16, !18, i64 32, !19, i64 296, !19, i64 308, !16, i64 320, !23, i64 336, !23, i64 360, !23, i64 384, !23, i64 408, !23, i64 432, !25, i64 456, !27, i64 480, !29, i64 504, !31, i64 568, !32, i64 904, !35, i64 1016, !36, i64 1056, !37, i64 1088, !40, i64 1120, !41, i64 1424, !17, i64 1428, !41, i64 1432, !14, i64 1436}
!14 = !{!"int", !7, i64 0}
!15 = !{!"short", !7, i64 0}
!16 = !{!"_ZTSN3rmg9ColorRGBAE", !17, i64 0, !17, i64 4, !17, i64 8, !17, i64 12}
!17 = !{!"float", !7, i64 0}
!18 = !{!"_ZTSN3rmg6CameraE", !19, i64 0, !20, i64 12, !21, i64 48, !21, i64 112, !21, i64 176, !17, i64 240, !17, i64 244, !17, i64 248, !17, i64 252, !17, i64 256, !22, i64 260}
!19 = !{!"_ZTSN3rmg4Vec3E", !7, i64 0}
!20 = !{!"_ZTSN3rmg4Mat3E", !7, i64 0}
!21 = !{!"_ZTSN3rmg4Mat4E", !7, i64 0}
!22 = !{!"_ZTSN3rmg14ProjectionModeE", !7, i64 0}
!23 = !{!"_ZTSN3rmg10ObjectListE", !24, i64 0}
!24 = !{!"_ZTSN3rmg10LinkedListINS_6ObjectEEE", !10, i64 0, !10, i64 8, !14, i64 16}
!25 = !{!"_ZTSN3rmg12MaterialListE", !26, i64 0}
!26 = !{!"_ZTSN3rmg10LinkedListINS_8MaterialEEE", !10, i64 0, !10, i64 8, !14, i64 16}
!27 = !{!"_ZTSN3rmg8FontListE", !28, i64 0}
!28 = !{!"_ZTSN3rmg10LinkedListINS_4FontEEE", !10, i64 0, !10, i64 8, !14, i64 16}
!29 = !{!"_ZTSN3rmg8internal13GeneralShaderE", !30, i64 0, !14, i64 12, !14, i64 16, !14, i64 20, !14, i64 24, !14, i64 28, !14, i64 32, !14, i64 36, !14, i64 40, !14, i64 44, !14, i64 48, !14, i64 52, !14, i64 56}
!30 = !{!"_ZTSN3rmg8internal6ShaderE", !14, i64 8}
!31 = !{!"_ZTSN3rmg8internal15ShadowMapShaderE", !30, i64 0, !18, i64 12, !19, i64 276, !19, i64 288, !19, i64 300, !17, i64 312, !17, i64 316, !17, i64 320, !14, i64 324, !14, i64 328, !14, i64 332}
!32 = !{!"_ZTSN3rmg8internal14Object2DShaderE", !33, i64 0, !34, i64 32, !20, i64 72, !15, i64 108, !15, i64 110}
!33 = !{!"_ZTSN3rmg8internal12SpriteShaderE", !30, i64 0, !14, i64 12, !14, i64 16, !14, i64 20, !14, i64 24, !14, i64 28}
!34 = !{!"_ZTSN3rmg8internal12Text2DShaderE", !30, i64 0, !14, i64 12, !14, i64 16, !14, i64 20, !14, i64 24, !14, i64 28, !14, i64 32, !14, i64 36}
!35 = !{!"_ZTSN3rmg8internal14ParticleShaderE", !30, i64 0, !14, i64 12, !14, i64 16, !14, i64 20, !14, i64 24, !14, i64 28, !14, i64 32, !14, i64 36}
!36 = !{!"_ZTSN3rmg8internal12Line3DShaderE", !30, i64 0, !14, i64 12, !14, i64 16, !14, i64 20, !14, i64 24, !14, i64 28}
!37 = !{!"_ZTSN3rmg8internal13ContextLoaderE", !38, i64 0}
!38 = !{!"_ZTSN3rmg8internal12PendingStackE", !10, i64 0, !39, i64 8, !14, i64 24}
!39 = !{!"_ZTSN3rmg8internal7PendingE", !10, i64 0, !10, i64 8}
!40 = !{!"_ZTSN3rmg8internal9GLContextE", !10, i64 0, !10, i64 8, !10, i64 16, !10, i64 24, !10, i64 32, !10, i64 40, !10, i64 48, !10, i64 56, !10, i64 64, !10, i64 72, !10, i64 80, !10, i64 88, !10, i64 96, !10, i64 104, !10, i64 112, !10, i64 120, !10, i64 128, !10, i64 136, !10, i64 144, !10, i64 152, !10, i64 160, !10, i64 168, !10, i64 176, !10, i64 184, !10, i64 192, !10, i64 200, !10, i64 208, !10, i64 216, !10, i64 224, !10, i64 232, !10, i64 240, !10, i64 248, !10, i64 256, !10, i64 264, !10, i64 272, !10, i64 280, !10, i64 288, !10, i64 296}
!41 = !{!"bool", !7, i64 0}
!42 = !{!43, !43, i64 0}
!43 = !{!"vtable pointer", !8, i64 0}
!44 = !{!14, !14, i64 0}
!45 = !{!46, !15, i64 0}
!46 = !{!"_ZTSN3rmg4RectE", !15, i64 0, !15, i64 2}
!47 = !{!46, !15, i64 2}
!48 = distinct !{!48, !49}
!49 = !{!"llvm.loop.mustprogress"}
!50 = distinct !{!50, !49}
!51 = !{!41, !41, 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.rmg::ContextList::iterator" = type { ptr, ptr }

@_ZN3rmg6Window10windowListE = external dso_local global { ptr, ptr, i32 }, align 8
@_ZL12glfwInitDone = external hidden local_unnamed_addr global i8, align 1
@_ZTISt13runtime_error = external constant ptr
@_ZTIN3rmg7Context17UserExitExceptionE = external constant ptr

declare i32 @__gxx_personality_v0(...)

declare void @_ZN3rmg7Context12setErrorCodeEi(ptr noundef nonnull align 8 dereferenceable(1440), i32 noundef) local_unnamed_addr #0

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

declare double @glfwGetTime() local_unnamed_addr #0

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN3rmg6Window8mainLoopEv() local_unnamed_addr #3 align 2 personality ptr @__gxx_personality_v0 {
  %1 = alloca %"class.rmg::ContextList::iterator", align 8
  %2 = alloca %"class.rmg::ContextList::iterator", align 8
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = tail call noundef i32 @_ZNK3rmg10LinkedListINS_7ContextEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(20) @_ZN3rmg6Window10windowListE)
  %.not40 = icmp eq i32 %5, 0
  br i1 %.not40, label %._crit_edge, label %.lr.ph41

.lr.ph41:                                         ; preds = %0
  %6 = getelementptr inbounds i8, ptr %1, i64 8
  %7 = getelementptr inbounds i8, ptr %2, i64 8
  br label %8

8:                                                ; preds = %.lr.ph41, %84
  %9 = call double @glfwGetTime()
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %1) #8
  %10 = call { ptr, ptr } @_ZNK3rmg11ContextList5beginEv(ptr noundef nonnull align 8 dereferenceable(20) @_ZN3rmg6Window10windowListE)
  %11 = extractvalue { ptr, ptr } %10, 0
  store ptr %11, ptr %1, align 8
  %12 = extractvalue { ptr, ptr } %10, 1
  store ptr %12, ptr %6, align 8
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %2) #8
  %13 = call { ptr, ptr } @_ZNK3rmg11ContextList3endEv(ptr noundef nonnull align 8 dereferenceable(20) @_ZN3rmg6Window10windowListE)
  %14 = extractvalue { ptr, ptr } %13, 0
  store ptr %14, ptr %2, align 8
  %15 = extractvalue { ptr, ptr } %13, 1
  store ptr %15, ptr %7, align 8
  %16 = call noundef zeroext i1 @_ZN3rmg11ContextList8iteratorneERKS1_(ptr noundef nonnull align 8 dereferenceable(16) %1, ptr noundef nonnull align 8 dereferenceable(16) %2)
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %2) #8
  br i1 %16, label %.lr.ph, label %.loopexit

.lr.ph:                                           ; preds = %8, %69
  %17 = call noundef nonnull align 8 dereferenceable(1440) ptr @_ZN3rmg11ContextList8iteratordeEv(ptr noundef nonnull align 8 dereferenceable(16) %1)
  %18 = getelementptr inbounds i8, ptr %17, i64 1440
  %19 = load ptr, ptr %18, align 8, !tbaa !5
  %20 = call i32 @glfwWindowShouldClose(ptr noundef %19)
  %.not28 = icmp eq i32 %20, 0
  br i1 %.not28, label %24, label %.thread

.thread:                                          ; preds = %.lr.ph
  %21 = load ptr, ptr %17, align 8, !tbaa !39
  %22 = getelementptr inbounds i8, ptr %21, i64 128
  %23 = load ptr, ptr %22, align 8
  call void %23(ptr noundef nonnull align 8 dereferenceable(1448) %17)
  br label %.loopexit

24:                                               ; preds = %.lr.ph
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %4) #8
  %25 = load ptr, ptr %18, align 8, !tbaa !5
  call void @glfwGetFramebufferSize(ptr noundef %25, ptr noundef nonnull %3, ptr noundef nonnull %4)
  %26 = call i32 @_ZNK3rmg7Context14getContextSizeEv(ptr noundef nonnull align 8 dereferenceable(1440) %17)
  %27 = load i32, ptr %3, align 4, !tbaa !41
  %28 = and i32 %26, 65535
  %.not29 = icmp eq i32 %27, %28
  %.pre = load i32, ptr %4, align 4, !tbaa !41
  %.sroa.5.0.extract.shift = lshr i32 %26, 16
  %.not30 = icmp eq i32 %.pre, %.sroa.5.0.extract.shift
  %or.cond = select i1 %.not29, i1 %.not30, i1 false
  br i1 %or.cond, label %35, label %29

29:                                               ; preds = %24
  %30 = trunc i32 %27 to i16
  %31 = trunc i32 %.pre to i16
  call void @_ZN3rmg7Context14setContextSizeEtt(ptr noundef nonnull align 8 dereferenceable(1440) %17, i16 noundef zeroext %30, i16 noundef zeroext %31)
  %32 = load ptr, ptr %17, align 8, !tbaa !39
  %33 = getelementptr inbounds i8, ptr %32, i64 32
  %34 = load ptr, ptr %33, align 8
  call void %34(ptr noundef nonnull align 8 dereferenceable(1440) %17)
  br label %35

35:                                               ; preds = %24, %29
  invoke void @_ZN3rmg7Context6renderEv(ptr noundef nonnull align 8 dereferenceable(1440) %17)
          to label %69 unwind label %36

36:                                               ; preds = %35
  %37 = landingpad { ptr, i32 }
          cleanup
          catch ptr @_ZTISt13runtime_error
          catch ptr @_ZTIN3rmg7Context17UserExitExceptionE
  %38 = extractvalue { ptr, i32 } %37, 0
  %39 = extractvalue { ptr, i32 } %37, 1
  %40 = call i32 @llvm.eh.typeid.for.p0(ptr nonnull @_ZTISt13runtime_error) #8
  %41 = icmp eq i32 %39, %40
  br i1 %41, label %42, label %48

42:                                               ; preds = %36
  %43 = call ptr @__cxa_begin_catch(ptr %38) #8
  %44 = invoke noundef i32 @_ZNK3rmg7Context12getErrorCodeEv(ptr noundef nonnull align 8 dereferenceable(1440) %17)
          to label %45 unwind label %58

45:                                               ; preds = %42
  %46 = icmp eq i32 %44, 0
  br i1 %46, label %47, label %60

47:                                               ; preds = %45
  invoke void @_ZN3rmg7Context12setErrorCodeEi(ptr noundef nonnull align 8 dereferenceable(1440) %17, i32 noundef 1)
          to label %60 unwind label %58

48:                                               ; preds = %36
  %49 = call i32 @llvm.eh.typeid.for.p0(ptr nonnull @_ZTIN3rmg7Context17UserExitExceptionE) #8
  %50 = icmp eq i32 %39, %49
  br i1 %50, label %51, label %.loopexit36

51:                                               ; preds = %48
  %52 = call ptr @__cxa_begin_catch(ptr %38) #8
  %53 = load ptr, ptr %52, align 8, !tbaa !39
  %54 = getelementptr inbounds i8, ptr %53, i64 16
  %55 = load ptr, ptr %54, align 8
  %56 = call noundef ptr %55(ptr noundef nonnull align 8 dereferenceable(8) %52) #8
  %57 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %56)
  br label %.thread33

58:                                               ; preds = %60, %47, %42
  %59 = landingpad { ptr, i32 }
          cleanup
  invoke void @__cxa_end_catch()
          to label %.loopexit36 unwind label %86

60:                                               ; preds = %47, %45
  %61 = load ptr, ptr %43, align 8, !tbaa !39
  %62 = getelementptr inbounds i8, ptr %61, i64 16
  %63 = load ptr, ptr %62, align 8
  %64 = call noundef ptr %63(ptr noundef nonnull align 8 dereferenceable(16) %43) #8
  %65 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %64)
  %66 = load ptr, ptr %17, align 8, !tbaa !39
  %67 = getelementptr inbounds i8, ptr %66, i64 128
  %68 = load ptr, ptr %67, align 8
  invoke void %68(ptr noundef nonnull align 8 dereferenceable(1448) %17)
          to label %.thread33 unwind label %58

.loopexit36:                                      ; preds = %48, %58
  %.merged = phi { ptr, i32 } [ %59, %58 ], [ %37, %48 ]
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #8
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %1) #8
  resume { ptr, i32 } %.merged

.thread33:                                        ; preds = %60, %51
  call void @__cxa_end_catch()
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #8
  br label %.loopexit

69:                                               ; preds = %35
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #8
  %70 = call { ptr, ptr } @_ZN3rmg11ContextList8iteratorppEi(ptr noundef nonnull align 8 dereferenceable(16) %1, i32 noundef 0)
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %2) #8
  %71 = call { ptr, ptr } @_ZNK3rmg11ContextList3endEv(ptr noundef nonnull align 8 dereferenceable(20) @_ZN3rmg6Window10windowListE)
  %72 = extractvalue { ptr, ptr } %71, 0
  store ptr %72, ptr %2, align 8
  %73 = extractvalue { ptr, ptr } %71, 1
  store ptr %73, ptr %7, align 8
  %74 = call noundef zeroext i1 @_ZN3rmg11ContextList8iteratorneERKS1_(ptr noundef nonnull align 8 dereferenceable(16) %1, ptr noundef nonnull align 8 dereferenceable(16) %2)
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %2) #8
  br i1 %74, label %.lr.ph, label %.loopexit, !llvm.loop !42

.loopexit:                                        ; preds = %69, %8, %.thread33, %.thread
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %1) #8
  call void @glfwPollEvents()
  %75 = call double @glfwGetTime()
  %76 = fsub double %75, %9
  %77 = fcmp olt double %76, 0x3F91111340000000
  br i1 %77, label %78, label %84

78:                                               ; preds = %.loopexit
  %79 = fneg double %76
  %80 = call double @llvm.fmuladd.f64(double %79, double 1.000000e+03, double 0x4030AAACE0000000)
  %81 = fmul double %80, 1.000000e+03
  %82 = fptoui double %81 to i32
  %83 = call i32 @usleep(i32 noundef %82)
  br label %84

84:                                               ; preds = %78, %.loopexit
  %85 = call noundef i32 @_ZNK3rmg10LinkedListINS_7ContextEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(20) @_ZN3rmg6Window10windowListE)
  %.not = icmp eq i32 %85, 0
  br i1 %.not, label %._crit_edge, label %8, !llvm.loop !44

._crit_edge:                                      ; preds = %84, %0
  call void @glfwTerminate()
  store i8 0, ptr @_ZL12glfwInitDone, align 1, !tbaa !45
  ret void

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZNK3rmg10LinkedListINS_7ContextEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(20)) local_unnamed_addr #4 align 2

declare { ptr, ptr } @_ZNK3rmg11ContextList5beginEv(ptr noundef nonnull align 8 dereferenceable(20)) local_unnamed_addr #0

declare noundef zeroext i1 @_ZN3rmg11ContextList8iteratorneERKS1_(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(16)) local_unnamed_addr #0

declare { ptr, ptr } @_ZNK3rmg11ContextList3endEv(ptr noundef nonnull align 8 dereferenceable(20)) local_unnamed_addr #0

declare noundef nonnull align 8 dereferenceable(1440) ptr @_ZN3rmg11ContextList8iteratordeEv(ptr noundef nonnull align 8 dereferenceable(16)) local_unnamed_addr #0

declare i32 @glfwWindowShouldClose(ptr noundef) local_unnamed_addr #0

declare void @glfwGetFramebufferSize(ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #0

declare i32 @_ZNK3rmg7Context14getContextSizeEv(ptr noundef nonnull align 8 dereferenceable(1440)) local_unnamed_addr #0

declare void @_ZN3rmg7Context14setContextSizeEtt(ptr noundef nonnull align 8 dereferenceable(1440), i16 noundef zeroext, i16 noundef zeroext) local_unnamed_addr #0

declare void @_ZN3rmg7Context6renderEv(ptr noundef nonnull align 8 dereferenceable(1440)) local_unnamed_addr #0

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

declare ptr @__cxa_begin_catch(ptr) 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 #6

declare noundef i32 @_ZNK3rmg7Context12getErrorCodeEv(ptr noundef nonnull align 8 dereferenceable(1440)) local_unnamed_addr #0

declare { ptr, ptr } @_ZN3rmg11ContextList8iteratorppEi(ptr noundef nonnull align 8 dereferenceable(16), i32 noundef) local_unnamed_addr #0

declare void @glfwPollEvents() local_unnamed_addr #0

declare i32 @usleep(i32 noundef) local_unnamed_addr #0

; Function Attrs: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare double @llvm.fmuladd.f64(double, double, double) #7

declare void @glfwTerminate() local_unnamed_addr #0

attributes #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 #1 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { 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 #5 = { nofree nosync nounwind memory(none) }
attributes #6 = { 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 #7 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #8 = { nounwind }
attributes #9 = { 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, !21, i64 1440}
!6 = !{!"_ZTSN3rmg6WindowE", !7, i64 0, !21, i64 1440}
!7 = !{!"_ZTSN3rmg7ContextE", !8, i64 8, !11, i64 12, !11, i64 14, !12, i64 16, !14, i64 32, !15, i64 296, !15, i64 308, !12, i64 320, !19, i64 336, !19, i64 360, !19, i64 384, !19, i64 408, !19, i64 432, !22, i64 456, !24, i64 480, !26, i64 504, !28, i64 568, !29, i64 904, !32, i64 1016, !33, i64 1056, !34, i64 1088, !37, i64 1120, !38, i64 1424, !13, i64 1428, !38, i64 1432, !8, i64 1436}
!8 = !{!"int", !9, i64 0}
!9 = !{!"omnipotent char", !10, i64 0}
!10 = !{!"Simple C++ TBAA"}
!11 = !{!"short", !9, i64 0}
!12 = !{!"_ZTSN3rmg9ColorRGBAE", !13, i64 0, !13, i64 4, !13, i64 8, !13, i64 12}
!13 = !{!"float", !9, i64 0}
!14 = !{!"_ZTSN3rmg6CameraE", !15, i64 0, !16, i64 12, !17, i64 48, !17, i64 112, !17, i64 176, !13, i64 240, !13, i64 244, !13, i64 248, !13, i64 252, !13, i64 256, !18, i64 260}
!15 = !{!"_ZTSN3rmg4Vec3E", !9, i64 0}
!16 = !{!"_ZTSN3rmg4Mat3E", !9, i64 0}
!17 = !{!"_ZTSN3rmg4Mat4E", !9, i64 0}
!18 = !{!"_ZTSN3rmg14ProjectionModeE", !9, i64 0}
!19 = !{!"_ZTSN3rmg10ObjectListE", !20, i64 0}
!20 = !{!"_ZTSN3rmg10LinkedListINS_6ObjectEEE", !21, i64 0, !21, i64 8, !8, i64 16}
!21 = !{!"any pointer", !9, i64 0}
!22 = !{!"_ZTSN3rmg12MaterialListE", !23, i64 0}
!23 = !{!"_ZTSN3rmg10LinkedListINS_8MaterialEEE", !21, i64 0, !21, i64 8, !8, i64 16}
!24 = !{!"_ZTSN3rmg8FontListE", !25, i64 0}
!25 = !{!"_ZTSN3rmg10LinkedListINS_4FontEEE", !21, i64 0, !21, i64 8, !8, i64 16}
!26 = !{!"_ZTSN3rmg8internal13GeneralShaderE", !27, i64 0, !8, i64 12, !8, i64 16, !8, i64 20, !8, i64 24, !8, i64 28, !8, i64 32, !8, i64 36, !8, i64 40, !8, i64 44, !8, i64 48, !8, i64 52, !8, i64 56}
!27 = !{!"_ZTSN3rmg8internal6ShaderE", !8, i64 8}
!28 = !{!"_ZTSN3rmg8internal15ShadowMapShaderE", !27, i64 0, !14, i64 12, !15, i64 276, !15, i64 288, !15, i64 300, !13, i64 312, !13, i64 316, !13, i64 320, !8, i64 324, !8, i64 328, !8, i64 332}
!29 = !{!"_ZTSN3rmg8internal14Object2DShaderE", !30, i64 0, !31, i64 32, !16, i64 72, !11, i64 108, !11, i64 110}
!30 = !{!"_ZTSN3rmg8internal12SpriteShaderE", !27, i64 0, !8, i64 12, !8, i64 16, !8, i64 20, !8, i64 24, !8, i64 28}
!31 = !{!"_ZTSN3rmg8internal12Text2DShaderE", !27, i64 0, !8, i64 12, !8, i64 16, !8, i64 20, !8, i64 24, !8, i64 28, !8, i64 32, !8, i64 36}
!32 = !{!"_ZTSN3rmg8internal14ParticleShaderE", !27, i64 0, !8, i64 12, !8, i64 16, !8, i64 20, !8, i64 24, !8, i64 28, !8, i64 32, !8, i64 36}
!33 = !{!"_ZTSN3rmg8internal12Line3DShaderE", !27, i64 0, !8, i64 12, !8, i64 16, !8, i64 20, !8, i64 24, !8, i64 28}
!34 = !{!"_ZTSN3rmg8internal13ContextLoaderE", !35, i64 0}
!35 = !{!"_ZTSN3rmg8internal12PendingStackE", !21, i64 0, !36, i64 8, !8, i64 24}
!36 = !{!"_ZTSN3rmg8internal7PendingE", !21, i64 0, !21, i64 8}
!37 = !{!"_ZTSN3rmg8internal9GLContextE", !21, i64 0, !21, i64 8, !21, i64 16, !21, i64 24, !21, i64 32, !21, i64 40, !21, i64 48, !21, i64 56, !21, i64 64, !21, i64 72, !21, i64 80, !21, i64 88, !21, i64 96, !21, i64 104, !21, i64 112, !21, i64 120, !21, i64 128, !21, i64 136, !21, i64 144, !21, i64 152, !21, i64 160, !21, i64 168, !21, i64 176, !21, i64 184, !21, i64 192, !21, i64 200, !21, i64 208, !21, i64 216, !21, i64 224, !21, i64 232, !21, i64 240, !21, i64 248, !21, i64 256, !21, i64 264, !21, i64 272, !21, i64 280, !21, i64 288, !21, i64 296}
!38 = !{!"bool", !9, i64 0}
!39 = !{!40, !40, i64 0}
!40 = !{!"vtable pointer", !10, i64 0}
!41 = !{!8, !8, i64 0}
!42 = distinct !{!42, !43}
!43 = !{!"llvm.loop.mustprogress"}
!44 = distinct !{!44, !43}
!45 = !{!38, !38, i64 0}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LICMPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,SROAPass,SimplifyCFGPass,TailCallElimPass