; LLVM IR from achilles288/robot-monitor-graphics :: src/base/context_renderer.ll (ZN3rmg7Context6renderEv)

; 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::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", [4 x i8] }
%"class.rmg::LinkedList.base" = type <{ ptr, ptr, i32 }>
%"class.rmg::MaterialList" = type { %"class.rmg::LinkedList.base.3", [4 x i8] }
%"class.rmg::LinkedList.base.3" = type <{ ptr, ptr, i32 }>
%"class.rmg::FontList" = type { %"class.rmg::LinkedList.base.5", [4 x i8] }
%"class.rmg::LinkedList.base.5" = 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 }

@.str.1 = external hidden unnamed_addr constant [56 x i8], align 1
@_ZTISt13runtime_error = external constant ptr
@.str.2 = external hidden unnamed_addr constant [30 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [98 x i8], align 1
@_ZL2t1 = external hidden global float, align 4
@_ZN3rmg8internal12glUseProgramE = external global ptr, align 8
@_ZTIN3rmg7Context17UserExitExceptionE = external dso_local constant { ptr, ptr, ptr }, align 8

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN3rmg7Context6renderEv(ptr noundef nonnull align 8 dereferenceable(1440) %0) #0 align 2 personality ptr @__gxx_personality_v0 {
  %2 = alloca ptr, align 8
  %3 = alloca i32, align 4
  %4 = alloca ptr, align 8
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca float, align 4
  %9 = alloca i32, align 4
  store ptr %0, ptr %2, align 8, !tbaa !5
  %10 = load ptr, ptr %2, align 8
  %11 = load ptr, ptr %10, align 8, !tbaa !9
  %12 = getelementptr inbounds ptr, ptr %11, i64 14
  %13 = load ptr, ptr %12, align 8
  call void %13(ptr noundef nonnull align 8 dereferenceable(1440) %10)
  %14 = getelementptr inbounds %"class.rmg::Context", ptr %10, i32 0, i32 23
  %15 = load i8, ptr %14, align 8, !tbaa !11, !range !41, !noundef !42
  %16 = trunc i8 %15 to i1
  br i1 %16, label %55, label %17

17:                                               ; preds = %1
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #7
  %18 = getelementptr inbounds %"class.rmg::Context", ptr %10, i32 0, i32 22
  %19 = call noundef i32 @_ZN3rmg8internal9GLContext4initEv(ptr noundef nonnull align 8 dereferenceable(304) %18)
  store i32 %19, ptr %3, align 4, !tbaa !43
  %20 = load i32, ptr %3, align 4, !tbaa !43
  %21 = icmp ne i32 %20, 0
  br i1 %21, label %22, label %29

22:                                               ; preds = %17
  call void @_ZN3rmg7Context12setErrorCodeEi(ptr noundef nonnull align 8 dereferenceable(1440) %10, i32 noundef 503)
  %23 = call ptr @__cxa_allocate_exception(i64 16) #7
  invoke void @_ZNSt13runtime_errorC1EPKc(ptr noundef nonnull align 8 dereferenceable(16) %23, ptr noundef @.str.1)
          to label %24 unwind label %25

24:                                               ; preds = %22
  call void @__cxa_throw(ptr %23, ptr @_ZTISt13runtime_error, ptr @_ZNSt13runtime_errorD1Ev) #8
  unreachable

25:                                               ; preds = %22
  %26 = landingpad { ptr, i32 }
          cleanup
  %27 = extractvalue { ptr, i32 } %26, 0
  store ptr %27, ptr %4, align 8
  %28 = extractvalue { ptr, i32 } %26, 1
  store i32 %28, ptr %5, align 4
  call void @__cxa_free_exception(ptr %23) #7
  br label %54

29:                                               ; preds = %17
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #7
  call void @glGetIntegerv(i32 noundef 33307, ptr noundef %6)
  call void @glGetIntegerv(i32 noundef 33308, ptr noundef %7)
  %30 = load i32, ptr %6, align 4, !tbaa !43
  %31 = mul nsw i32 %30, 100
  %32 = load i32, ptr %7, align 4, !tbaa !43
  %33 = add nsw i32 %31, %32
  %34 = icmp slt i32 %33, 302
  br i1 %34, label %35, label %44

35:                                               ; preds = %29
  call void @_ZN3rmg7Context12setErrorCodeEi(ptr noundef nonnull align 8 dereferenceable(1440) %10, i32 noundef 503)
  %36 = call ptr @glGetString(i32 noundef 7938)
  %37 = call i32 (ptr, ...) @printf(ptr noundef @.str.2, ptr noundef %36)
  %38 = call ptr @__cxa_allocate_exception(i64 16) #7
  invoke void @_ZNSt13runtime_errorC1EPKc(ptr noundef nonnull align 8 dereferenceable(16) %38, ptr noundef @.str.3)
          to label %39 unwind label %40

39:                                               ; preds = %35
  call void @__cxa_throw(ptr %38, ptr @_ZTISt13runtime_error, ptr @_ZNSt13runtime_errorD1Ev) #8
  unreachable

40:                                               ; preds = %35
  %41 = landingpad { ptr, i32 }
          cleanup
  %42 = extractvalue { ptr, i32 } %41, 0
  store ptr %42, ptr %4, align 8
  %43 = extractvalue { ptr, i32 } %41, 1
  store i32 %43, ptr %5, align 4
  call void @__cxa_free_exception(ptr %38) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #7
  br label %54

44:                                               ; preds = %29
  %45 = getelementptr inbounds %"class.rmg::Context", ptr %10, i32 0, i32 16
  call void @_ZN3rmg8internal13GeneralShader4loadEv(ptr noundef nonnull align 8 dereferenceable(60) %45)
  %46 = getelementptr inbounds %"class.rmg::Context", ptr %10, i32 0, i32 17
  call void @_ZN3rmg8internal15ShadowMapShader4loadEv(ptr noundef nonnull align 8 dereferenceable(336) %46)
  %47 = getelementptr inbounds %"class.rmg::Context", ptr %10, i32 0, i32 18
  call void @_ZN3rmg8internal14Object2DShader4loadEv(ptr noundef nonnull align 8 dereferenceable(112) %47)
  %48 = getelementptr inbounds %"class.rmg::Context", ptr %10, i32 0, i32 19
  call void @_ZN3rmg8internal14ParticleShader4loadEv(ptr noundef nonnull align 8 dereferenceable(40) %48)
  %49 = getelementptr inbounds %"class.rmg::Context", ptr %10, i32 0, i32 20
  call void @_ZN3rmg8internal12Line3DShader4loadEv(ptr noundef nonnull align 8 dereferenceable(32) %49)
  %50 = getelementptr inbounds %"class.rmg::Context", ptr %10, i32 0, i32 23
  store i8 1, ptr %50, align 8, !tbaa !11
  %51 = load ptr, ptr %10, align 8, !tbaa !9
  %52 = getelementptr inbounds ptr, ptr %51, i64 3
  %53 = load ptr, ptr %52, align 8
  call void %53(ptr noundef nonnull align 8 dereferenceable(1440) %10)
  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 4, ptr %3) #7
  br label %55

54:                                               ; preds = %40, %25
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #7
  br label %126

55:                                               ; preds = %44, %1
  %56 = getelementptr inbounds %"class.rmg::Context", ptr %10, i32 0, i32 21
  %57 = call noundef i64 @_ZNK3rmg8internal13ContextLoader12getLoadCountEv(ptr noundef nonnull align 8 dereferenceable(32) %56)
  %58 = icmp ugt i64 %57, 0
  br i1 %58, label %59, label %61

59:                                               ; preds = %55
  %60 = getelementptr inbounds %"class.rmg::Context", ptr %10, i32 0, i32 21
  call void @_ZN3rmg8internal13ContextLoader4loadEv(ptr noundef nonnull align 8 dereferenceable(32) %60)
  br label %61

61:                                               ; preds = %59, %55
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #7
  %62 = load ptr, ptr %10, align 8, !tbaa !9
  %63 = getelementptr inbounds ptr, ptr %62, i64 13
  %64 = load ptr, ptr %63, align 8
  %65 = call noundef float %64(ptr noundef nonnull align 8 dereferenceable(1440) %10)
  store float %65, ptr %8, align 4, !tbaa !44
  %66 = load float, ptr %8, align 4, !tbaa !44
  %67 = load float, ptr @_ZL2t1, align 4, !tbaa !44
  %68 = fsub float %66, %67
  %69 = fdiv float 1.000000e+00, %68
  %70 = getelementptr inbounds %"class.rmg::Context", ptr %10, i32 0, i32 24
  store float %69, ptr %70, align 4, !tbaa !45
  %71 = load float, ptr %8, align 4, !tbaa !44
  store float %71, ptr @_ZL2t1, align 4, !tbaa !44
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #7
  %72 = getelementptr inbounds %"class.rmg::Context", ptr %10, i32 0, i32 17
  %73 = getelementptr inbounds %"class.rmg::Context", ptr %10, i32 0, i32 9
  %74 = call noundef i32 @_ZN3rmg8internal15ShadowMapShader15createShadowMapERKNS_10ObjectListE(ptr noundef nonnull align 8 dereferenceable(336) %72, ptr noundef nonnull align 8 dereferenceable(20) %73)
  store i32 %74, ptr %9, align 4, !tbaa !43
  %75 = getelementptr inbounds %"class.rmg::Context", ptr %10, i32 0, i32 2
  %76 = load i16, ptr %75, align 4, !tbaa !46
  %77 = zext i16 %76 to i32
  %78 = getelementptr inbounds %"class.rmg::Context", ptr %10, i32 0, i32 3
  %79 = load i16, ptr %78, align 2, !tbaa !47
  %80 = zext i16 %79 to i32
  call void @glViewport(i32 noundef 0, i32 noundef 0, i32 noundef %77, i32 noundef %80)
  %81 = getelementptr inbounds %"class.rmg::Context", ptr %10, i32 0, i32 4
  %82 = getelementptr inbounds %"struct.rmg::ColorRGBA", ptr %81, i32 0, i32 0
  %83 = load float, ptr %82, align 8, !tbaa !48
  %84 = getelementptr inbounds %"class.rmg::Context", ptr %10, i32 0, i32 4
  %85 = getelementptr inbounds %"struct.rmg::ColorRGBA", ptr %84, i32 0, i32 1
  %86 = load float, ptr %85, align 4, !tbaa !49
  %87 = getelementptr inbounds %"class.rmg::Context", ptr %10, i32 0, i32 4
  %88 = getelementptr inbounds %"struct.rmg::ColorRGBA", ptr %87, i32 0, i32 2
  %89 = load float, ptr %88, align 8, !tbaa !50
  call void @glClearColor(float noundef %83, float noundef %86, float noundef %89, float noundef 1.000000e+00)
  call void @glClearDepth(double noundef 1.000000e+00)
  call void @glClear(i32 noundef 16640)
  %90 = getelementptr inbounds %"class.rmg::Context", ptr %10, i32 0, i32 20
  %91 = getelementptr inbounds %"class.rmg::Context", ptr %10, i32 0, i32 5
  %92 = call noundef nonnull align 4 dereferenceable(64) ptr @_ZNK3rmg6Camera11getVPMatrixEv(ptr noundef nonnull align 4 dereferenceable(264) %91)
  %93 = getelementptr inbounds %"class.rmg::Context", ptr %10, i32 0, i32 12
  call void @_ZN3rmg8internal12Line3DShader6renderERKNS_4Mat4ERKNS_10ObjectListE(ptr noundef nonnull align 8 dereferenceable(32) %90, ptr noundef nonnull align 4 dereferenceable(64) %92, ptr noundef nonnull align 8 dereferenceable(20) %93)
  %94 = getelementptr inbounds %"class.rmg::Context", ptr %10, i32 0, i32 16
  %95 = getelementptr inbounds %"class.rmg::Context", ptr %10, i32 0, i32 5
  %96 = call noundef nonnull align 4 dereferenceable(64) ptr @_ZNK3rmg6Camera13getViewMatrixEv(ptr noundef nonnull align 4 dereferenceable(264) %95)
  %97 = getelementptr inbounds %"class.rmg::Context", ptr %10, i32 0, i32 5
  %98 = call noundef nonnull align 4 dereferenceable(64) ptr @_ZNK3rmg6Camera19getProjectionMatrixEv(ptr noundef nonnull align 4 dereferenceable(264) %97)
  %99 = getelementptr inbounds %"class.rmg::Context", ptr %10, i32 0, i32 17
  %100 = call noundef nonnull align 4 dereferenceable(64) ptr @_ZNK3rmg8internal15ShadowMapShader15getShadowMatrixEv(ptr noundef nonnull align 8 dereferenceable(336) %99)
  %101 = getelementptr inbounds %"class.rmg::Context", ptr %10, i32 0, i32 7
  %102 = getelementptr inbounds %"class.rmg::Context", ptr %10, i32 0, i32 8
  %103 = load i32, ptr %9, align 4, !tbaa !43
  %104 = getelementptr inbounds %"class.rmg::Context", ptr %10, i32 0, i32 9
  call void @_ZN3rmg8internal13GeneralShader6renderERKNS_4Mat4ES4_S4_RKNS_4Vec3ERKNS_9ColorRGBAEjRKNS_10ObjectListE(ptr noundef nonnull align 8 dereferenceable(60) %94, ptr noundef nonnull align 4 dereferenceable(64) %96, ptr noundef nonnull align 4 dereferenceable(64) %98, ptr noundef nonnull align 4 dereferenceable(64) %100, ptr noundef nonnull align 4 dereferenceable(12) %101, ptr noundef nonnull align 4 dereferenceable(16) %102, i32 noundef %103, ptr noundef nonnull align 8 dereferenceable(20) %104)
  %105 = getelementptr inbounds %"class.rmg::Context", ptr %10, i32 0, i32 19
  %106 = getelementptr inbounds %"class.rmg::Context", ptr %10, i32 0, i32 5
  %107 = call noundef nonnull align 4 dereferenceable(64) ptr @_ZNK3rmg6Camera13getViewMatrixEv(ptr noundef nonnull align 4 dereferenceable(264) %106)
  %108 = getelementptr inbounds %"class.rmg::Context", ptr %10, i32 0, i32 5
  %109 = call noundef nonnull align 4 dereferenceable(64) ptr @_ZNK3rmg6Camera19getProjectionMatrixEv(ptr noundef nonnull align 4 dereferenceable(264) %108)
  %110 = getelementptr inbounds %"class.rmg::Context", ptr %10, i32 0, i32 11
  call void @_ZN3rmg8internal14ParticleShader6renderERKNS_4Mat4ES4_RKNS_10ObjectListE(ptr noundef nonnull align 8 dereferenceable(40) %105, ptr noundef nonnull align 4 dereferenceable(64) %107, ptr noundef nonnull align 4 dereferenceable(64) %109, ptr noundef nonnull align 8 dereferenceable(20) %110)
  %111 = getelementptr inbounds %"class.rmg::Context", ptr %10, i32 0, i32 18
  %112 = getelementptr inbounds %"class.rmg::Context", ptr %10, i32 0, i32 10
  call void @_ZN3rmg8internal14Object2DShader6renderERKNS_10ObjectListE(ptr noundef nonnull align 8 dereferenceable(112) %111, ptr noundef nonnull align 8 dereferenceable(20) %112)
  %113 = load ptr, ptr @_ZN3rmg8internal12glUseProgramE, align 8, !tbaa !5
  call void %113(i32 noundef 0)
  %114 = load ptr, ptr %10, align 8, !tbaa !9
  %115 = getelementptr inbounds ptr, ptr %114, i64 2
  %116 = load ptr, ptr %115, align 8
  call void %116(ptr noundef nonnull align 8 dereferenceable(1440) %10)
  %117 = getelementptr inbounds %"class.rmg::Context", ptr %10, i32 0, i32 25
  %118 = load i8, ptr %117, align 8, !tbaa !51, !range !41, !noundef !42
  %119 = trunc i8 %118 to i1
  br i1 %119, label %120, label %122

120:                                              ; preds = %61
  %121 = call ptr @__cxa_allocate_exception(i64 8) #7
  call void @llvm.memset.p0.i64(ptr align 16 %121, i8 0, i64 8, i1 false)
  call void @_ZN3rmg7Context17UserExitExceptionC2Ev(ptr noundef nonnull align 8 dereferenceable(8) %121) #7
  call void @__cxa_throw(ptr %121, ptr @_ZTIN3rmg7Context17UserExitExceptionE, ptr @_ZNSt9exceptionD2Ev) #8
  unreachable

122:                                              ; preds = %61
  %123 = load ptr, ptr %10, align 8, !tbaa !9
  %124 = getelementptr inbounds ptr, ptr %123, i64 15
  %125 = load ptr, ptr %124, align 8
  call void %125(ptr noundef nonnull align 8 dereferenceable(1440) %10)
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #7
  ret void

126:                                              ; preds = %54
  %127 = load ptr, ptr %4, align 8
  %128 = load i32, ptr %5, align 4
  %129 = insertvalue { ptr, i32 } poison, ptr %127, 0
  %130 = insertvalue { ptr, i32 } %129, i32 %128, 1
  resume { ptr, i32 } %130
}

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

declare noundef i32 @_ZN3rmg8internal9GLContext4initEv(ptr noundef nonnull align 8 dereferenceable(304)) #2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN3rmg7Context12setErrorCodeEi(ptr noundef nonnull align 8 dereferenceable(1440), i32 noundef) #3 align 2

declare ptr @__cxa_allocate_exception(i64)

declare void @_ZNSt13runtime_errorC1EPKc(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef) unnamed_addr #2

declare i32 @__gxx_personality_v0(...)

declare void @__cxa_free_exception(ptr)

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

declare void @__cxa_throw(ptr, ptr, ptr)

declare void @glGetIntegerv(i32 noundef, ptr noundef) #2

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

declare ptr @glGetString(i32 noundef) #2

declare void @_ZN3rmg8internal13GeneralShader4loadEv(ptr noundef nonnull align 8 dereferenceable(60)) unnamed_addr #2

declare void @_ZN3rmg8internal15ShadowMapShader4loadEv(ptr noundef nonnull align 8 dereferenceable(336)) unnamed_addr #2

declare void @_ZN3rmg8internal14Object2DShader4loadEv(ptr noundef nonnull align 8 dereferenceable(112)) #2

declare void @_ZN3rmg8internal14ParticleShader4loadEv(ptr noundef nonnull align 8 dereferenceable(40)) unnamed_addr #2

declare void @_ZN3rmg8internal12Line3DShader4loadEv(ptr noundef nonnull align 8 dereferenceable(32)) unnamed_addr #2

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

declare noundef i64 @_ZNK3rmg8internal13ContextLoader12getLoadCountEv(ptr noundef nonnull align 8 dereferenceable(32)) #2

declare void @_ZN3rmg8internal13ContextLoader4loadEv(ptr noundef nonnull align 8 dereferenceable(32)) #2

declare noundef i32 @_ZN3rmg8internal15ShadowMapShader15createShadowMapERKNS_10ObjectListE(ptr noundef nonnull align 8 dereferenceable(336), ptr noundef nonnull align 8 dereferenceable(20)) #2

declare void @glViewport(i32 noundef, i32 noundef, i32 noundef, i32 noundef) #2

declare void @glClearColor(float noundef, float noundef, float noundef, float noundef) #2

declare void @glClearDepth(double noundef) #2

declare void @glClear(i32 noundef) #2

declare void @_ZN3rmg8internal12Line3DShader6renderERKNS_4Mat4ERKNS_10ObjectListE(ptr noundef nonnull align 8 dereferenceable(32), ptr noundef nonnull align 4 dereferenceable(64), ptr noundef nonnull align 8 dereferenceable(20)) #2

declare noundef nonnull align 4 dereferenceable(64) ptr @_ZNK3rmg6Camera11getVPMatrixEv(ptr noundef nonnull align 4 dereferenceable(264)) #2

declare void @_ZN3rmg8internal13GeneralShader6renderERKNS_4Mat4ES4_S4_RKNS_4Vec3ERKNS_9ColorRGBAEjRKNS_10ObjectListE(ptr noundef nonnull align 8 dereferenceable(60), ptr noundef nonnull align 4 dereferenceable(64), ptr noundef nonnull align 4 dereferenceable(64), ptr noundef nonnull align 4 dereferenceable(64), ptr noundef nonnull align 4 dereferenceable(12), ptr noundef nonnull align 4 dereferenceable(16), i32 noundef, ptr noundef nonnull align 8 dereferenceable(20)) #2

declare noundef nonnull align 4 dereferenceable(64) ptr @_ZNK3rmg6Camera13getViewMatrixEv(ptr noundef nonnull align 4 dereferenceable(264)) #2

declare noundef nonnull align 4 dereferenceable(64) ptr @_ZNK3rmg6Camera19getProjectionMatrixEv(ptr noundef nonnull align 4 dereferenceable(264)) #2

declare noundef nonnull align 4 dereferenceable(64) ptr @_ZNK3rmg8internal15ShadowMapShader15getShadowMatrixEv(ptr noundef nonnull align 8 dereferenceable(336)) #2

declare void @_ZN3rmg8internal14ParticleShader6renderERKNS_4Mat4ES4_RKNS_10ObjectListE(ptr noundef nonnull align 8 dereferenceable(40), ptr noundef nonnull align 4 dereferenceable(64), ptr noundef nonnull align 4 dereferenceable(64), ptr noundef nonnull align 8 dereferenceable(20)) #2

declare void @_ZN3rmg8internal14Object2DShader6renderERKNS_10ObjectListE(ptr noundef nonnull align 8 dereferenceable(112), ptr noundef nonnull align 8 dereferenceable(20)) #2

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #5

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN3rmg7Context17UserExitExceptionC2Ev(ptr noundef nonnull align 8 dereferenceable(8)) unnamed_addr #6 align 2

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

attributes #0 = { 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 #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress 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 "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 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #6 = { inlinehint 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 #7 = { nounwind }
attributes #8 = { noreturn }

!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, !40, i64 1424}
!12 = !{!"_ZTSN3rmg7ContextE", !13, i64 8, !14, i64 12, !14, i64 14, !15, i64 16, !17, i64 32, !18, i64 296, !18, i64 308, !15, i64 320, !22, i64 336, !22, i64 360, !22, i64 384, !22, i64 408, !22, i64 432, !24, i64 456, !26, i64 480, !28, i64 504, !30, i64 568, !31, i64 904, !34, i64 1016, !35, i64 1056, !36, i64 1088, !39, i64 1120, !40, i64 1424, !16, i64 1428, !40, i64 1432, !13, i64 1436}
!13 = !{!"int", !7, i64 0}
!14 = !{!"short", !7, i64 0}
!15 = !{!"_ZTSN3rmg9ColorRGBAE", !16, i64 0, !16, i64 4, !16, i64 8, !16, i64 12}
!16 = !{!"float", !7, i64 0}
!17 = !{!"_ZTSN3rmg6CameraE", !18, i64 0, !19, i64 12, !20, i64 48, !20, i64 112, !20, i64 176, !16, i64 240, !16, i64 244, !16, i64 248, !16, i64 252, !16, i64 256, !21, i64 260}
!18 = !{!"_ZTSN3rmg4Vec3E", !7, i64 0}
!19 = !{!"_ZTSN3rmg4Mat3E", !7, i64 0}
!20 = !{!"_ZTSN3rmg4Mat4E", !7, i64 0}
!21 = !{!"_ZTSN3rmg14ProjectionModeE", !7, i64 0}
!22 = !{!"_ZTSN3rmg10ObjectListE", !23, i64 0}
!23 = !{!"_ZTSN3rmg10LinkedListINS_6ObjectEEE", !6, i64 0, !6, i64 8, !13, i64 16}
!24 = !{!"_ZTSN3rmg12MaterialListE", !25, i64 0}
!25 = !{!"_ZTSN3rmg10LinkedListINS_8MaterialEEE", !6, i64 0, !6, i64 8, !13, i64 16}
!26 = !{!"_ZTSN3rmg8FontListE", !27, i64 0}
!27 = !{!"_ZTSN3rmg10LinkedListINS_4FontEEE", !6, i64 0, !6, i64 8, !13, i64 16}
!28 = !{!"_ZTSN3rmg8internal13GeneralShaderE", !29, i64 0, !13, i64 12, !13, i64 16, !13, i64 20, !13, i64 24, !13, i64 28, !13, i64 32, !13, i64 36, !13, i64 40, !13, i64 44, !13, i64 48, !13, i64 52, !13, i64 56}
!29 = !{!"_ZTSN3rmg8internal6ShaderE", !13, i64 8}
!30 = !{!"_ZTSN3rmg8internal15ShadowMapShaderE", !29, i64 0, !17, i64 12, !18, i64 276, !18, i64 288, !18, i64 300, !16, i64 312, !16, i64 316, !16, i64 320, !13, i64 324, !13, i64 328, !13, i64 332}
!31 = !{!"_ZTSN3rmg8internal14Object2DShaderE", !32, i64 0, !33, i64 32, !19, i64 72, !14, i64 108, !14, i64 110}
!32 = !{!"_ZTSN3rmg8internal12SpriteShaderE", !29, i64 0, !13, i64 12, !13, i64 16, !13, i64 20, !13, i64 24, !13, i64 28}
!33 = !{!"_ZTSN3rmg8internal12Text2DShaderE", !29, i64 0, !13, i64 12, !13, i64 16, !13, i64 20, !13, i64 24, !13, i64 28, !13, i64 32, !13, i64 36}
!34 = !{!"_ZTSN3rmg8internal14ParticleShaderE", !29, i64 0, !13, i64 12, !13, i64 16, !13, i64 20, !13, i64 24, !13, i64 28, !13, i64 32, !13, i64 36}
!35 = !{!"_ZTSN3rmg8internal12Line3DShaderE", !29, i64 0, !13, i64 12, !13, i64 16, !13, i64 20, !13, i64 24, !13, i64 28}
!36 = !{!"_ZTSN3rmg8internal13ContextLoaderE", !37, i64 0}
!37 = !{!"_ZTSN3rmg8internal12PendingStackE", !6, i64 0, !38, i64 8, !13, i64 24}
!38 = !{!"_ZTSN3rmg8internal7PendingE", !6, i64 0, !6, i64 8}
!39 = !{!"_ZTSN3rmg8internal9GLContextE", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !6, i64 40, !6, i64 48, !6, i64 56, !6, i64 64, !6, i64 72, !6, i64 80, !6, i64 88, !6, i64 96, !6, i64 104, !6, i64 112, !6, i64 120, !6, i64 128, !6, i64 136, !6, i64 144, !6, i64 152, !6, i64 160, !6, i64 168, !6, i64 176, !6, i64 184, !6, i64 192, !6, i64 200, !6, i64 208, !6, i64 216, !6, i64 224, !6, i64 232, !6, i64 240, !6, i64 248, !6, i64 256, !6, i64 264, !6, i64 272, !6, i64 280, !6, i64 288, !6, i64 296}
!40 = !{!"bool", !7, i64 0}
!41 = !{i8 0, i8 2}
!42 = !{}
!43 = !{!13, !13, i64 0}
!44 = !{!16, !16, i64 0}
!45 = !{!12, !16, i64 1428}
!46 = !{!12, !14, i64 12}
!47 = !{!12, !14, i64 14}
!48 = !{!12, !16, i64 16}
!49 = !{!12, !16, i64 20}
!50 = !{!12, !16, i64 24}
!51 = !{!12, !40, i64 1432}


; 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"

@.str.1 = external hidden unnamed_addr constant [56 x i8], align 1
@_ZTISt13runtime_error = external constant ptr
@.str.2 = external hidden unnamed_addr constant [30 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [98 x i8], align 1
@_ZL2t1 = external hidden local_unnamed_addr global float, align 4
@_ZN3rmg8internal12glUseProgramE = external local_unnamed_addr global ptr, align 8
@_ZTIN3rmg7Context17UserExitExceptionE = external dso_local constant { ptr, ptr, ptr }, align 8

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN3rmg7Context6renderEv(ptr noundef nonnull align 8 dereferenceable(1440) %0) local_unnamed_addr #0 align 2 personality ptr @__gxx_personality_v0 {
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = load ptr, ptr %0, align 8, !tbaa !5
  %5 = getelementptr inbounds i8, ptr %4, i64 112
  %6 = load ptr, ptr %5, align 8
  tail call void %6(ptr noundef nonnull align 8 dereferenceable(1440) %0)
  %7 = getelementptr inbounds i8, ptr %0, i64 1424
  %8 = load i8, ptr %7, align 8, !tbaa !8, !range !40, !noundef !41
  %9 = trunc nuw i8 %8 to i1
  br i1 %9, label %41, label %10

10:                                               ; preds = %1
  %11 = getelementptr inbounds i8, ptr %0, i64 1120
  %12 = tail call noundef i32 @_ZN3rmg8internal9GLContext4initEv(ptr noundef nonnull align 8 dereferenceable(304) %11)
  %.not = icmp eq i32 %12, 0
  br i1 %.not, label %18, label %13

13:                                               ; preds = %10
  tail call void @_ZN3rmg7Context12setErrorCodeEi(ptr noundef nonnull align 8 dereferenceable(1440) %0, i32 noundef 503)
  %14 = tail call ptr @__cxa_allocate_exception(i64 16) #7
  invoke void @_ZNSt13runtime_errorC1EPKc(ptr noundef nonnull align 8 dereferenceable(16) %14, ptr noundef nonnull @.str.1)
          to label %15 unwind label %16

15:                                               ; preds = %13
  tail call void @__cxa_throw(ptr nonnull %14, ptr nonnull @_ZTISt13runtime_error, ptr nonnull @_ZNSt13runtime_errorD1Ev) #8
  unreachable

16:                                               ; preds = %13
  %17 = landingpad { ptr, i32 }
          cleanup
  tail call void @__cxa_free_exception(ptr %14) #7
  br label %40

18:                                               ; preds = %10
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #7
  call void @glGetIntegerv(i32 noundef 33307, ptr noundef nonnull %2)
  call void @glGetIntegerv(i32 noundef 33308, ptr noundef nonnull %3)
  %19 = load i32, ptr %2, align 4, !tbaa !42
  %20 = mul nsw i32 %19, 100
  %21 = load i32, ptr %3, align 4, !tbaa !42
  %22 = add nsw i32 %20, %21
  %23 = icmp slt i32 %22, 302
  br i1 %23, label %24, label %31

24:                                               ; preds = %18
  call void @_ZN3rmg7Context12setErrorCodeEi(ptr noundef nonnull align 8 dereferenceable(1440) %0, i32 noundef 503)
  %25 = call ptr @glGetString(i32 noundef 7938)
  %26 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, ptr noundef %25)
  %27 = call ptr @__cxa_allocate_exception(i64 16) #7
  invoke void @_ZNSt13runtime_errorC1EPKc(ptr noundef nonnull align 8 dereferenceable(16) %27, ptr noundef nonnull @.str.3)
          to label %28 unwind label %29

28:                                               ; preds = %24
  call void @__cxa_throw(ptr nonnull %27, ptr nonnull @_ZTISt13runtime_error, ptr nonnull @_ZNSt13runtime_errorD1Ev) #8
  unreachable

29:                                               ; preds = %24
  %30 = landingpad { ptr, i32 }
          cleanup
  call void @__cxa_free_exception(ptr %27) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #7
  br label %40

31:                                               ; preds = %18
  %32 = getelementptr inbounds i8, ptr %0, i64 504
  call void @_ZN3rmg8internal13GeneralShader4loadEv(ptr noundef nonnull align 8 dereferenceable(60) %32)
  %33 = getelementptr inbounds i8, ptr %0, i64 568
  call void @_ZN3rmg8internal15ShadowMapShader4loadEv(ptr noundef nonnull align 8 dereferenceable(336) %33)
  %34 = getelementptr inbounds i8, ptr %0, i64 904
  call void @_ZN3rmg8internal14Object2DShader4loadEv(ptr noundef nonnull align 8 dereferenceable(112) %34)
  %35 = getelementptr inbounds i8, ptr %0, i64 1016
  call void @_ZN3rmg8internal14ParticleShader4loadEv(ptr noundef nonnull align 8 dereferenceable(40) %35)
  %36 = getelementptr inbounds i8, ptr %0, i64 1056
  call void @_ZN3rmg8internal12Line3DShader4loadEv(ptr noundef nonnull align 8 dereferenceable(32) %36)
  store i8 1, ptr %7, align 8, !tbaa !8
  %37 = load ptr, ptr %0, align 8, !tbaa !5
  %38 = getelementptr inbounds i8, ptr %37, i64 24
  %39 = load ptr, ptr %38, align 8
  call void %39(ptr noundef nonnull align 8 dereferenceable(1440) %0)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #7
  br label %41

40:                                               ; preds = %29, %16
  %.pn = phi { ptr, i32 } [ %17, %16 ], [ %30, %29 ]
  resume { ptr, i32 } %.pn

41:                                               ; preds = %31, %1
  %42 = getelementptr inbounds i8, ptr %0, i64 1088
  %43 = call noundef i64 @_ZNK3rmg8internal13ContextLoader12getLoadCountEv(ptr noundef nonnull align 8 dereferenceable(32) %42)
  %.not8 = icmp eq i64 %43, 0
  br i1 %.not8, label %45, label %44

44:                                               ; preds = %41
  call void @_ZN3rmg8internal13ContextLoader4loadEv(ptr noundef nonnull align 8 dereferenceable(32) %42)
  br label %45

45:                                               ; preds = %44, %41
  %46 = load ptr, ptr %0, align 8, !tbaa !5
  %47 = getelementptr inbounds i8, ptr %46, i64 104
  %48 = load ptr, ptr %47, align 8
  %49 = call noundef float %48(ptr noundef nonnull align 8 dereferenceable(1440) %0)
  %50 = load float, ptr @_ZL2t1, align 4, !tbaa !43
  %51 = fsub float %49, %50
  %52 = fdiv float 1.000000e+00, %51
  %53 = getelementptr inbounds i8, ptr %0, i64 1428
  store float %52, ptr %53, align 4, !tbaa !44
  store float %49, ptr @_ZL2t1, align 4, !tbaa !43
  %54 = getelementptr inbounds i8, ptr %0, i64 568
  %55 = getelementptr inbounds i8, ptr %0, i64 336
  %56 = call noundef i32 @_ZN3rmg8internal15ShadowMapShader15createShadowMapERKNS_10ObjectListE(ptr noundef nonnull align 8 dereferenceable(336) %54, ptr noundef nonnull align 8 dereferenceable(20) %55)
  %57 = getelementptr inbounds i8, ptr %0, i64 12
  %58 = load i16, ptr %57, align 4, !tbaa !45
  %59 = zext i16 %58 to i32
  %60 = getelementptr inbounds i8, ptr %0, i64 14
  %61 = load i16, ptr %60, align 2, !tbaa !46
  %62 = zext i16 %61 to i32
  call void @glViewport(i32 noundef 0, i32 noundef 0, i32 noundef %59, i32 noundef %62)
  %63 = getelementptr inbounds i8, ptr %0, i64 16
  %64 = load float, ptr %63, align 8, !tbaa !47
  %65 = getelementptr inbounds i8, ptr %0, i64 20
  %66 = load float, ptr %65, align 4, !tbaa !48
  %67 = getelementptr inbounds i8, ptr %0, i64 24
  %68 = load float, ptr %67, align 8, !tbaa !49
  call void @glClearColor(float noundef %64, float noundef %66, float noundef %68, float noundef 1.000000e+00)
  call void @glClearDepth(double noundef 1.000000e+00)
  call void @glClear(i32 noundef 16640)
  %69 = getelementptr inbounds i8, ptr %0, i64 1056
  %70 = getelementptr inbounds i8, ptr %0, i64 32
  %71 = call noundef nonnull align 4 dereferenceable(64) ptr @_ZNK3rmg6Camera11getVPMatrixEv(ptr noundef nonnull align 4 dereferenceable(264) %70)
  %72 = getelementptr inbounds i8, ptr %0, i64 408
  call void @_ZN3rmg8internal12Line3DShader6renderERKNS_4Mat4ERKNS_10ObjectListE(ptr noundef nonnull align 8 dereferenceable(32) %69, ptr noundef nonnull align 4 dereferenceable(64) %71, ptr noundef nonnull align 8 dereferenceable(20) %72)
  %73 = getelementptr inbounds i8, ptr %0, i64 504
  %74 = call noundef nonnull align 4 dereferenceable(64) ptr @_ZNK3rmg6Camera13getViewMatrixEv(ptr noundef nonnull align 4 dereferenceable(264) %70)
  %75 = call noundef nonnull align 4 dereferenceable(64) ptr @_ZNK3rmg6Camera19getProjectionMatrixEv(ptr noundef nonnull align 4 dereferenceable(264) %70)
  %76 = call noundef nonnull align 4 dereferenceable(64) ptr @_ZNK3rmg8internal15ShadowMapShader15getShadowMatrixEv(ptr noundef nonnull align 8 dereferenceable(336) %54)
  %77 = getelementptr inbounds i8, ptr %0, i64 308
  %78 = getelementptr inbounds i8, ptr %0, i64 320
  call void @_ZN3rmg8internal13GeneralShader6renderERKNS_4Mat4ES4_S4_RKNS_4Vec3ERKNS_9ColorRGBAEjRKNS_10ObjectListE(ptr noundef nonnull align 8 dereferenceable(60) %73, ptr noundef nonnull align 4 dereferenceable(64) %74, ptr noundef nonnull align 4 dereferenceable(64) %75, ptr noundef nonnull align 4 dereferenceable(64) %76, ptr noundef nonnull align 4 dereferenceable(12) %77, ptr noundef nonnull align 4 dereferenceable(16) %78, i32 noundef %56, ptr noundef nonnull align 8 dereferenceable(20) %55)
  %79 = getelementptr inbounds i8, ptr %0, i64 1016
  %80 = call noundef nonnull align 4 dereferenceable(64) ptr @_ZNK3rmg6Camera13getViewMatrixEv(ptr noundef nonnull align 4 dereferenceable(264) %70)
  %81 = call noundef nonnull align 4 dereferenceable(64) ptr @_ZNK3rmg6Camera19getProjectionMatrixEv(ptr noundef nonnull align 4 dereferenceable(264) %70)
  %82 = getelementptr inbounds i8, ptr %0, i64 384
  call void @_ZN3rmg8internal14ParticleShader6renderERKNS_4Mat4ES4_RKNS_10ObjectListE(ptr noundef nonnull align 8 dereferenceable(40) %79, ptr noundef nonnull align 4 dereferenceable(64) %80, ptr noundef nonnull align 4 dereferenceable(64) %81, ptr noundef nonnull align 8 dereferenceable(20) %82)
  %83 = getelementptr inbounds i8, ptr %0, i64 904
  %84 = getelementptr inbounds i8, ptr %0, i64 360
  call void @_ZN3rmg8internal14Object2DShader6renderERKNS_10ObjectListE(ptr noundef nonnull align 8 dereferenceable(112) %83, ptr noundef nonnull align 8 dereferenceable(20) %84)
  %85 = load ptr, ptr @_ZN3rmg8internal12glUseProgramE, align 8, !tbaa !50
  call void %85(i32 noundef 0)
  %86 = load ptr, ptr %0, align 8, !tbaa !5
  %87 = getelementptr inbounds i8, ptr %86, i64 16
  %88 = load ptr, ptr %87, align 8
  call void %88(ptr noundef nonnull align 8 dereferenceable(1440) %0)
  %89 = getelementptr inbounds i8, ptr %0, i64 1432
  %90 = load i8, ptr %89, align 8, !tbaa !51, !range !40, !noundef !41
  %91 = trunc nuw i8 %90 to i1
  br i1 %91, label %92, label %94

92:                                               ; preds = %45
  %93 = call ptr @__cxa_allocate_exception(i64 8) #7
  store i64 0, ptr %93, align 16
  call void @_ZN3rmg7Context17UserExitExceptionC2Ev(ptr noundef nonnull align 8 dereferenceable(8) %93) #7
  call void @__cxa_throw(ptr nonnull %93, ptr nonnull @_ZTIN3rmg7Context17UserExitExceptionE, ptr nonnull @_ZNSt9exceptionD2Ev) #8
  unreachable

94:                                               ; preds = %45
  %95 = load ptr, ptr %0, align 8, !tbaa !5
  %96 = getelementptr inbounds i8, ptr %95, i64 120
  %97 = load ptr, ptr %96, align 8
  call void %97(ptr noundef nonnull align 8 dereferenceable(1440) %0)
  ret void
}

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

declare noundef i32 @_ZN3rmg8internal9GLContext4initEv(ptr noundef nonnull align 8 dereferenceable(304)) local_unnamed_addr #2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN3rmg7Context12setErrorCodeEi(ptr noundef nonnull align 8 dereferenceable(1440), i32 noundef) local_unnamed_addr #3 align 2

declare ptr @__cxa_allocate_exception(i64) local_unnamed_addr

declare void @_ZNSt13runtime_errorC1EPKc(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef) unnamed_addr #2

declare i32 @__gxx_personality_v0(...)

declare void @__cxa_free_exception(ptr) local_unnamed_addr

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

declare void @__cxa_throw(ptr, ptr, ptr) local_unnamed_addr

declare void @glGetIntegerv(i32 noundef, ptr noundef) local_unnamed_addr #2

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

declare ptr @glGetString(i32 noundef) local_unnamed_addr #2

declare void @_ZN3rmg8internal13GeneralShader4loadEv(ptr noundef nonnull align 8 dereferenceable(60)) unnamed_addr #2

declare void @_ZN3rmg8internal15ShadowMapShader4loadEv(ptr noundef nonnull align 8 dereferenceable(336)) unnamed_addr #2

declare void @_ZN3rmg8internal14Object2DShader4loadEv(ptr noundef nonnull align 8 dereferenceable(112)) local_unnamed_addr #2

declare void @_ZN3rmg8internal14ParticleShader4loadEv(ptr noundef nonnull align 8 dereferenceable(40)) unnamed_addr #2

declare void @_ZN3rmg8internal12Line3DShader4loadEv(ptr noundef nonnull align 8 dereferenceable(32)) unnamed_addr #2

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

declare noundef i64 @_ZNK3rmg8internal13ContextLoader12getLoadCountEv(ptr noundef nonnull align 8 dereferenceable(32)) local_unnamed_addr #2

declare void @_ZN3rmg8internal13ContextLoader4loadEv(ptr noundef nonnull align 8 dereferenceable(32)) local_unnamed_addr #2

declare noundef i32 @_ZN3rmg8internal15ShadowMapShader15createShadowMapERKNS_10ObjectListE(ptr noundef nonnull align 8 dereferenceable(336), ptr noundef nonnull align 8 dereferenceable(20)) local_unnamed_addr #2

declare void @glViewport(i32 noundef, i32 noundef, i32 noundef, i32 noundef) local_unnamed_addr #2

declare void @glClearColor(float noundef, float noundef, float noundef, float noundef) local_unnamed_addr #2

declare void @glClearDepth(double noundef) local_unnamed_addr #2

declare void @glClear(i32 noundef) local_unnamed_addr #2

declare void @_ZN3rmg8internal12Line3DShader6renderERKNS_4Mat4ERKNS_10ObjectListE(ptr noundef nonnull align 8 dereferenceable(32), ptr noundef nonnull align 4 dereferenceable(64), ptr noundef nonnull align 8 dereferenceable(20)) local_unnamed_addr #2

declare noundef nonnull align 4 dereferenceable(64) ptr @_ZNK3rmg6Camera11getVPMatrixEv(ptr noundef nonnull align 4 dereferenceable(264)) local_unnamed_addr #2

declare void @_ZN3rmg8internal13GeneralShader6renderERKNS_4Mat4ES4_S4_RKNS_4Vec3ERKNS_9ColorRGBAEjRKNS_10ObjectListE(ptr noundef nonnull align 8 dereferenceable(60), ptr noundef nonnull align 4 dereferenceable(64), ptr noundef nonnull align 4 dereferenceable(64), ptr noundef nonnull align 4 dereferenceable(64), ptr noundef nonnull align 4 dereferenceable(12), ptr noundef nonnull align 4 dereferenceable(16), i32 noundef, ptr noundef nonnull align 8 dereferenceable(20)) local_unnamed_addr #2

declare noundef nonnull align 4 dereferenceable(64) ptr @_ZNK3rmg6Camera13getViewMatrixEv(ptr noundef nonnull align 4 dereferenceable(264)) local_unnamed_addr #2

declare noundef nonnull align 4 dereferenceable(64) ptr @_ZNK3rmg6Camera19getProjectionMatrixEv(ptr noundef nonnull align 4 dereferenceable(264)) local_unnamed_addr #2

declare noundef nonnull align 4 dereferenceable(64) ptr @_ZNK3rmg8internal15ShadowMapShader15getShadowMatrixEv(ptr noundef nonnull align 8 dereferenceable(336)) local_unnamed_addr #2

declare void @_ZN3rmg8internal14ParticleShader6renderERKNS_4Mat4ES4_RKNS_10ObjectListE(ptr noundef nonnull align 8 dereferenceable(40), ptr noundef nonnull align 4 dereferenceable(64), ptr noundef nonnull align 4 dereferenceable(64), ptr noundef nonnull align 8 dereferenceable(20)) local_unnamed_addr #2

declare void @_ZN3rmg8internal14Object2DShader6renderERKNS_10ObjectListE(ptr noundef nonnull align 8 dereferenceable(112), ptr noundef nonnull align 8 dereferenceable(20)) local_unnamed_addr #2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN3rmg7Context17UserExitExceptionC2Ev(ptr noundef nonnull align 8 dereferenceable(8)) unnamed_addr #6 align 2

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

attributes #0 = { 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 #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress 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 "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 nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { inlinehint mustprogress 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 #7 = { nounwind }
attributes #8 = { noreturn }

!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 = !{!"vtable pointer", !7, i64 0}
!7 = !{!"Simple C++ TBAA"}
!8 = !{!9, !39, i64 1424}
!9 = !{!"_ZTSN3rmg7ContextE", !10, i64 8, !12, i64 12, !12, i64 14, !13, i64 16, !15, i64 32, !16, i64 296, !16, i64 308, !13, i64 320, !20, i64 336, !20, i64 360, !20, i64 384, !20, i64 408, !20, i64 432, !23, i64 456, !25, i64 480, !27, i64 504, !29, i64 568, !30, i64 904, !33, i64 1016, !34, i64 1056, !35, i64 1088, !38, i64 1120, !39, i64 1424, !14, i64 1428, !39, i64 1432, !10, i64 1436}
!10 = !{!"int", !11, i64 0}
!11 = !{!"omnipotent char", !7, i64 0}
!12 = !{!"short", !11, i64 0}
!13 = !{!"_ZTSN3rmg9ColorRGBAE", !14, i64 0, !14, i64 4, !14, i64 8, !14, i64 12}
!14 = !{!"float", !11, i64 0}
!15 = !{!"_ZTSN3rmg6CameraE", !16, i64 0, !17, i64 12, !18, i64 48, !18, i64 112, !18, i64 176, !14, i64 240, !14, i64 244, !14, i64 248, !14, i64 252, !14, i64 256, !19, i64 260}
!16 = !{!"_ZTSN3rmg4Vec3E", !11, i64 0}
!17 = !{!"_ZTSN3rmg4Mat3E", !11, i64 0}
!18 = !{!"_ZTSN3rmg4Mat4E", !11, i64 0}
!19 = !{!"_ZTSN3rmg14ProjectionModeE", !11, i64 0}
!20 = !{!"_ZTSN3rmg10ObjectListE", !21, i64 0}
!21 = !{!"_ZTSN3rmg10LinkedListINS_6ObjectEEE", !22, i64 0, !22, i64 8, !10, i64 16}
!22 = !{!"any pointer", !11, i64 0}
!23 = !{!"_ZTSN3rmg12MaterialListE", !24, i64 0}
!24 = !{!"_ZTSN3rmg10LinkedListINS_8MaterialEEE", !22, i64 0, !22, i64 8, !10, i64 16}
!25 = !{!"_ZTSN3rmg8FontListE", !26, i64 0}
!26 = !{!"_ZTSN3rmg10LinkedListINS_4FontEEE", !22, i64 0, !22, i64 8, !10, i64 16}
!27 = !{!"_ZTSN3rmg8internal13GeneralShaderE", !28, i64 0, !10, i64 12, !10, i64 16, !10, i64 20, !10, i64 24, !10, i64 28, !10, i64 32, !10, i64 36, !10, i64 40, !10, i64 44, !10, i64 48, !10, i64 52, !10, i64 56}
!28 = !{!"_ZTSN3rmg8internal6ShaderE", !10, i64 8}
!29 = !{!"_ZTSN3rmg8internal15ShadowMapShaderE", !28, i64 0, !15, i64 12, !16, i64 276, !16, i64 288, !16, i64 300, !14, i64 312, !14, i64 316, !14, i64 320, !10, i64 324, !10, i64 328, !10, i64 332}
!30 = !{!"_ZTSN3rmg8internal14Object2DShaderE", !31, i64 0, !32, i64 32, !17, i64 72, !12, i64 108, !12, i64 110}
!31 = !{!"_ZTSN3rmg8internal12SpriteShaderE", !28, i64 0, !10, i64 12, !10, i64 16, !10, i64 20, !10, i64 24, !10, i64 28}
!32 = !{!"_ZTSN3rmg8internal12Text2DShaderE", !28, i64 0, !10, i64 12, !10, i64 16, !10, i64 20, !10, i64 24, !10, i64 28, !10, i64 32, !10, i64 36}
!33 = !{!"_ZTSN3rmg8internal14ParticleShaderE", !28, i64 0, !10, i64 12, !10, i64 16, !10, i64 20, !10, i64 24, !10, i64 28, !10, i64 32, !10, i64 36}
!34 = !{!"_ZTSN3rmg8internal12Line3DShaderE", !28, i64 0, !10, i64 12, !10, i64 16, !10, i64 20, !10, i64 24, !10, i64 28}
!35 = !{!"_ZTSN3rmg8internal13ContextLoaderE", !36, i64 0}
!36 = !{!"_ZTSN3rmg8internal12PendingStackE", !22, i64 0, !37, i64 8, !10, i64 24}
!37 = !{!"_ZTSN3rmg8internal7PendingE", !22, i64 0, !22, i64 8}
!38 = !{!"_ZTSN3rmg8internal9GLContextE", !22, i64 0, !22, i64 8, !22, i64 16, !22, i64 24, !22, i64 32, !22, i64 40, !22, i64 48, !22, i64 56, !22, i64 64, !22, i64 72, !22, i64 80, !22, i64 88, !22, i64 96, !22, i64 104, !22, i64 112, !22, i64 120, !22, i64 128, !22, i64 136, !22, i64 144, !22, i64 152, !22, i64 160, !22, i64 168, !22, i64 176, !22, i64 184, !22, i64 192, !22, i64 200, !22, i64 208, !22, i64 216, !22, i64 224, !22, i64 232, !22, i64 240, !22, i64 248, !22, i64 256, !22, i64 264, !22, i64 272, !22, i64 280, !22, i64 288, !22, i64 296}
!39 = !{!"bool", !11, i64 0}
!40 = !{i8 0, i8 2}
!41 = !{}
!42 = !{!10, !10, i64 0}
!43 = !{!14, !14, i64 0}
!44 = !{!9, !14, i64 1428}
!45 = !{!9, !12, i64 12}
!46 = !{!9, !12, i64 14}
!47 = !{!9, !14, i64 16}
!48 = !{!9, !14, i64 20}
!49 = !{!9, !14, i64 24}
!50 = !{!22, !22, i64 0}
!51 = !{!9, !39, i64 1432}


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