; LLVM IR from achilles288/robot-monitor-graphics :: src/base/internal (general_shader)

; 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::ObjectList::iterator" = type { ptr, ptr }
%"struct.rmg::Mat4" = type { %union.anon.0 }
%union.anon.0 = 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::internal::Shader" = type <{ ptr, i32, [4 x i8] }>
%"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 }>

@_ZN3rmg8internal12glUseProgramE = external global ptr, align 8
@_ZN3rmg8internal12glUniform3fvE = external global ptr, align 8
@_ZN3rmg8internal12glUniform4fvE = external global ptr, align 8
@_ZN3rmg8internal11glUniform1iE = external global ptr, align 8
@_ZN3rmg8internal18glUniformMatrix4fvE = external global ptr, align 8
@_ZN3rmg8internal15glActiveTextureE = external global ptr, align 8
@_ZN3rmg8internal11glUniform1fE = external global ptr, align 8

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN3rmg8internal13GeneralShader6renderERKNS_4Mat4ES4_S4_RKNS_4Vec3ERKNS_9ColorRGBAEjRKNS_10ObjectListE(ptr noundef nonnull align 8 dereferenceable(60) %0, ptr noundef nonnull align 4 dereferenceable(64) %1, ptr noundef nonnull align 4 dereferenceable(64) %2, ptr noundef nonnull align 4 dereferenceable(64) %3, ptr noundef nonnull align 4 dereferenceable(12) %4, ptr noundef nonnull align 4 dereferenceable(16) %5, i32 noundef %6, ptr noundef nonnull align 8 dereferenceable(20) %7) #0 align 2 {
  %9 = alloca ptr, align 8
  %10 = alloca ptr, align 8
  %11 = alloca ptr, align 8
  %12 = alloca ptr, align 8
  %13 = alloca ptr, align 8
  %14 = alloca ptr, align 8
  %15 = alloca i32, align 4
  %16 = alloca ptr, align 8
  %17 = alloca %"class.rmg::ObjectList::iterator", align 8
  %18 = alloca %"class.rmg::ObjectList::iterator", align 8
  %19 = alloca i32, align 4
  %20 = alloca i32, align 4
  %21 = alloca ptr, align 8
  %22 = alloca %"struct.rmg::Mat4", align 4
  %23 = alloca %"struct.rmg::Mat4", align 4
  %24 = alloca %"struct.rmg::Vec3", align 4
  %25 = alloca { <2 x float>, float }, align 8
  %26 = alloca %"struct.rmg::Mat4", align 4
  %27 = alloca %"struct.rmg::ColorRGBA", align 4
  %28 = alloca %"class.rmg::ObjectList::iterator", align 8
  store ptr %0, ptr %9, align 8, !tbaa !5
  store ptr %1, ptr %10, align 8, !tbaa !5
  store ptr %2, ptr %11, align 8, !tbaa !5
  store ptr %3, ptr %12, align 8, !tbaa !5
  store ptr %4, ptr %13, align 8, !tbaa !5
  store ptr %5, ptr %14, align 8, !tbaa !5
  store i32 %6, ptr %15, align 4, !tbaa !9
  store ptr %7, ptr %16, align 8, !tbaa !5
  %29 = load ptr, ptr %9, align 8
  %30 = getelementptr inbounds %"class.rmg::internal::Shader", ptr %29, i32 0, i32 1
  %31 = load i32, ptr %30, align 8, !tbaa !11
  %32 = icmp eq i32 %31, 0
  br i1 %32, label %33, label %34

33:                                               ; preds = %8
  br label %166

34:                                               ; preds = %8
  call void @glEnable(i32 noundef 2929)
  call void @glDepthFunc(i32 noundef 513)
  call void @glFrontFace(i32 noundef 2305)
  call void @glDisable(i32 noundef 2884)
  call void @glDisable(i32 noundef 3042)
  %35 = load ptr, ptr @_ZN3rmg8internal12glUseProgramE, align 8, !tbaa !5
  %36 = getelementptr inbounds %"class.rmg::internal::Shader", ptr %29, i32 0, i32 1
  %37 = load i32, ptr %36, align 8, !tbaa !11
  call void %35(i32 noundef %37)
  %38 = load ptr, ptr @_ZN3rmg8internal12glUniform3fvE, align 8, !tbaa !5
  %39 = getelementptr inbounds %"class.rmg::internal::GeneralShader", ptr %29, i32 0, i32 6
  %40 = load i32, ptr %39, align 8, !tbaa !13
  %41 = load ptr, ptr %13, align 8, !tbaa !5
  %42 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK3rmg4Vec3ixEh(ptr noundef nonnull align 4 dereferenceable(12) %41, i8 noundef zeroext 0)
  call void %38(i32 noundef %40, i32 noundef 1, ptr noundef %42)
  %43 = load ptr, ptr @_ZN3rmg8internal12glUniform4fvE, align 8, !tbaa !5
  %44 = getelementptr inbounds %"class.rmg::internal::GeneralShader", ptr %29, i32 0, i32 7
  %45 = load i32, ptr %44, align 4, !tbaa !15
  %46 = load ptr, ptr %14, align 8, !tbaa !5
  %47 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK3rmg9ColorRGBAixEh(ptr noundef nonnull align 4 dereferenceable(16) %46, i8 noundef zeroext 0)
  call void %43(i32 noundef %45, i32 noundef 1, ptr noundef %47)
  %48 = load ptr, ptr @_ZN3rmg8internal11glUniform1iE, align 8, !tbaa !5
  %49 = getelementptr inbounds %"class.rmg::internal::GeneralShader", ptr %29, i32 0, i32 4
  %50 = load i32, ptr %49, align 8, !tbaa !16
  call void %48(i32 noundef %50, i32 noundef 1)
  call void @llvm.lifetime.start.p0(i64 16, ptr %17) #5
  %51 = load ptr, ptr %16, align 8, !tbaa !5
  %52 = call { ptr, ptr } @_ZNK3rmg10ObjectList5beginEv(ptr noundef nonnull align 8 dereferenceable(20) %51)
  %53 = getelementptr inbounds { ptr, ptr }, ptr %17, i32 0, i32 0
  %54 = extractvalue { ptr, ptr } %52, 0
  store ptr %54, ptr %53, align 8
  %55 = getelementptr inbounds { ptr, ptr }, ptr %17, i32 0, i32 1
  %56 = extractvalue { ptr, ptr } %52, 1
  store ptr %56, ptr %55, align 8
  br label %57

57:                                               ; preds = %160, %34
  call void @llvm.lifetime.start.p0(i64 16, ptr %18) #5
  %58 = load ptr, ptr %16, align 8, !tbaa !5
  %59 = call { ptr, ptr } @_ZNK3rmg10ObjectList3endEv(ptr noundef nonnull align 8 dereferenceable(20) %58)
  %60 = getelementptr inbounds { ptr, ptr }, ptr %18, i32 0, i32 0
  %61 = extractvalue { ptr, ptr } %59, 0
  store ptr %61, ptr %60, align 8
  %62 = getelementptr inbounds { ptr, ptr }, ptr %18, i32 0, i32 1
  %63 = extractvalue { ptr, ptr } %59, 1
  store ptr %63, ptr %62, align 8
  %64 = call noundef zeroext i1 @_ZN3rmg10ObjectList8iteratorneERKS1_(ptr noundef nonnull align 8 dereferenceable(16) %17, ptr noundef nonnull align 8 dereferenceable(16) %18)
  call void @llvm.lifetime.end.p0(i64 16, ptr %18) #5
  br i1 %64, label %66, label %65

65:                                               ; preds = %57
  store i32 2, ptr %19, align 4
  call void @llvm.lifetime.end.p0(i64 16, ptr %17) #5
  br label %166

66:                                               ; preds = %57
  call void @llvm.lifetime.start.p0(i64 4, ptr %20) #5
  store i32 0, ptr %20, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %21) #5
  %67 = call noundef nonnull align 8 dereferenceable(48) ptr @_ZN3rmg10ObjectList8iteratordeEv(ptr noundef nonnull align 8 dereferenceable(16) %17)
  store ptr %67, ptr %21, align 8, !tbaa !5
  %68 = load ptr, ptr %21, align 8, !tbaa !5
  %69 = call noundef zeroext i1 @_ZNK3rmg6Object8isHiddenEv(ptr noundef nonnull align 8 dereferenceable(48) %68)
  br i1 %69, label %74, label %70

70:                                               ; preds = %66
  %71 = load ptr, ptr %21, align 8, !tbaa !5
  %72 = call noundef ptr @_ZNK3rmg8Object3D6getVBOEv(ptr noundef nonnull align 8 dereferenceable(216) %71)
  %73 = icmp eq ptr %72, null
  br i1 %73, label %74, label %75

74:                                               ; preds = %70, %66
  store i32 4, ptr %19, align 4
  br label %157

75:                                               ; preds = %70
  call void @llvm.lifetime.start.p0(i64 64, ptr %22) #5
  %76 = load ptr, ptr %10, align 8, !tbaa !5
  %77 = load ptr, ptr %21, align 8, !tbaa !5
  %78 = call noundef nonnull align 4 dereferenceable(64) ptr @_ZNK3rmg8Object3D14getModelMatrixEv(ptr noundef nonnull align 8 dereferenceable(216) %77)
  call void @_ZNK3rmg4Mat4mlERKS0_(ptr dead_on_unwind writable sret(%"struct.rmg::Mat4") align 4 %22, ptr noundef nonnull align 4 dereferenceable(64) %76, ptr noundef nonnull align 4 dereferenceable(64) %78)
  call void @llvm.lifetime.start.p0(i64 64, ptr %23) #5
  %79 = load ptr, ptr %11, align 8, !tbaa !5
  call void @_ZNK3rmg4Mat4mlERKS0_(ptr dead_on_unwind writable sret(%"struct.rmg::Mat4") align 4 %23, ptr noundef nonnull align 4 dereferenceable(64) %79, ptr noundef nonnull align 4 dereferenceable(64) %22)
  %80 = load ptr, ptr @_ZN3rmg8internal18glUniformMatrix4fvE, align 8, !tbaa !5
  %81 = getelementptr inbounds %"class.rmg::internal::GeneralShader", ptr %29, i32 0, i32 1
  %82 = load i32, ptr %81, align 4, !tbaa !17
  %83 = call noundef nonnull align 4 dereferenceable(16) ptr @_ZN3rmg4Mat4ixEh(ptr noundef nonnull align 4 dereferenceable(64) %23, i8 noundef zeroext 0)
  %84 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN3rmg7Mat4RowixEh(ptr noundef nonnull align 4 dereferenceable(16) %83, i8 noundef zeroext 0)
  call void %80(i32 noundef %82, i32 noundef 1, i8 noundef zeroext 1, ptr noundef %84)
  %85 = load ptr, ptr @_ZN3rmg8internal18glUniformMatrix4fvE, align 8, !tbaa !5
  %86 = getelementptr inbounds %"class.rmg::internal::GeneralShader", ptr %29, i32 0, i32 2
  %87 = load i32, ptr %86, align 8, !tbaa !18
  %88 = call noundef nonnull align 4 dereferenceable(16) ptr @_ZN3rmg4Mat4ixEh(ptr noundef nonnull align 4 dereferenceable(64) %22, i8 noundef zeroext 0)
  %89 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN3rmg7Mat4RowixEh(ptr noundef nonnull align 4 dereferenceable(16) %88, i8 noundef zeroext 0)
  call void %85(i32 noundef %87, i32 noundef 1, i8 noundef zeroext 1, ptr noundef %89)
  %90 = load ptr, ptr @_ZN3rmg8internal12glUniform3fvE, align 8, !tbaa !5
  %91 = getelementptr inbounds %"class.rmg::internal::GeneralShader", ptr %29, i32 0, i32 3
  %92 = load i32, ptr %91, align 4, !tbaa !19
  call void @llvm.lifetime.start.p0(i64 12, ptr %24) #5
  %93 = load ptr, ptr %21, align 8, !tbaa !5
  %94 = call { <2 x float>, float } @_ZNK3rmg8Object3D8getScaleEv(ptr noundef nonnull align 8 dereferenceable(216) %93)
  %95 = getelementptr inbounds %"struct.rmg::Vec3", ptr %24, i32 0, i32 0
  %96 = getelementptr inbounds %union.anon, ptr %95, i32 0, i32 0
  store { <2 x float>, float } %94, ptr %25, align 8
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %96, ptr align 8 %25, i64 12, i1 false)
  %97 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN3rmg4Vec3ixEh(ptr noundef nonnull align 4 dereferenceable(12) %24, i8 noundef zeroext 0)
  call void %90(i32 noundef %92, i32 noundef 1, ptr noundef %97)
  call void @llvm.lifetime.end.p0(i64 12, ptr %24) #5
  %98 = load i32, ptr %15, align 4, !tbaa !9
  %99 = icmp ne i32 %98, 0
  br i1 %99, label %100, label %113

100:                                              ; preds = %75
  %101 = load i32, ptr %20, align 4, !tbaa !9
  %102 = or i32 %101, 1
  store i32 %102, ptr %20, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 64, ptr %26) #5
  %103 = load ptr, ptr %12, align 8, !tbaa !5
  %104 = load ptr, ptr %21, align 8, !tbaa !5
  %105 = call noundef nonnull align 4 dereferenceable(64) ptr @_ZNK3rmg8Object3D14getModelMatrixEv(ptr noundef nonnull align 8 dereferenceable(216) %104)
  call void @_ZNK3rmg4Mat4mlERKS0_(ptr dead_on_unwind writable sret(%"struct.rmg::Mat4") align 4 %26, ptr noundef nonnull align 4 dereferenceable(64) %103, ptr noundef nonnull align 4 dereferenceable(64) %105)
  %106 = load ptr, ptr @_ZN3rmg8internal18glUniformMatrix4fvE, align 8, !tbaa !5
  %107 = getelementptr inbounds %"class.rmg::internal::GeneralShader", ptr %29, i32 0, i32 5
  %108 = load i32, ptr %107, align 4, !tbaa !20
  %109 = call noundef nonnull align 4 dereferenceable(16) ptr @_ZN3rmg4Mat4ixEh(ptr noundef nonnull align 4 dereferenceable(64) %26, i8 noundef zeroext 0)
  %110 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN3rmg7Mat4RowixEh(ptr noundef nonnull align 4 dereferenceable(16) %109, i8 noundef zeroext 0)
  call void %106(i32 noundef %108, i32 noundef 1, i8 noundef zeroext 1, ptr noundef %110)
  %111 = load ptr, ptr @_ZN3rmg8internal15glActiveTextureE, align 8, !tbaa !5
  call void %111(i32 noundef 33985)
  %112 = load i32, ptr %15, align 4, !tbaa !9
  call void @glBindTexture(i32 noundef 3553, i32 noundef %112)
  call void @llvm.lifetime.end.p0(i64 64, ptr %26) #5
  br label %113

113:                                              ; preds = %100, %75
  %114 = load ptr, ptr @_ZN3rmg8internal12glUniform4fvE, align 8, !tbaa !5
  %115 = getelementptr inbounds %"class.rmg::internal::GeneralShader", ptr %29, i32 0, i32 8
  %116 = load i32, ptr %115, align 8, !tbaa !21
  call void @llvm.lifetime.start.p0(i64 16, ptr %27) #5
  %117 = load ptr, ptr %21, align 8, !tbaa !5
  %118 = call { <2 x float>, <2 x float> } @_ZNK3rmg6Object8getColorEv(ptr noundef nonnull align 8 dereferenceable(48) %117)
  %119 = getelementptr inbounds { <2 x float>, <2 x float> }, ptr %27, i32 0, i32 0
  %120 = extractvalue { <2 x float>, <2 x float> } %118, 0
  store <2 x float> %120, ptr %119, align 4
  %121 = getelementptr inbounds { <2 x float>, <2 x float> }, ptr %27, i32 0, i32 1
  %122 = extractvalue { <2 x float>, <2 x float> } %118, 1
  store <2 x float> %122, ptr %121, align 4
  %123 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN3rmg9ColorRGBAixEh(ptr noundef nonnull align 4 dereferenceable(16) %27, i8 noundef zeroext 0)
  call void %114(i32 noundef %116, i32 noundef 1, ptr noundef %123)
  call void @llvm.lifetime.end.p0(i64 16, ptr %27) #5
  %124 = load ptr, ptr @_ZN3rmg8internal11glUniform1fE, align 8, !tbaa !5
  %125 = getelementptr inbounds %"class.rmg::internal::GeneralShader", ptr %29, i32 0, i32 9
  %126 = load i32, ptr %125, align 4, !tbaa !22
  %127 = load ptr, ptr %21, align 8, !tbaa !5
  %128 = call noundef float @_ZNK3rmg8Object3D12getMetalnessEv(ptr noundef nonnull align 8 dereferenceable(216) %127)
  call void %124(i32 noundef %126, float noundef %128)
  %129 = load ptr, ptr @_ZN3rmg8internal11glUniform1fE, align 8, !tbaa !5
  %130 = getelementptr inbounds %"class.rmg::internal::GeneralShader", ptr %29, i32 0, i32 10
  %131 = load i32, ptr %130, align 8, !tbaa !23
  %132 = load ptr, ptr %21, align 8, !tbaa !5
  %133 = call noundef float @_ZNK3rmg8Object3D12getRoughnessEv(ptr noundef nonnull align 8 dereferenceable(216) %132)
  call void %129(i32 noundef %131, float noundef %133)
  %134 = load ptr, ptr @_ZN3rmg8internal11glUniform1fE, align 8, !tbaa !5
  %135 = getelementptr inbounds %"class.rmg::internal::GeneralShader", ptr %29, i32 0, i32 11
  %136 = load i32, ptr %135, align 4, !tbaa !24
  %137 = load ptr, ptr %21, align 8, !tbaa !5
  %138 = call noundef float @_ZNK3rmg8Object3D20getAmbientOcculationEv(ptr noundef nonnull align 8 dereferenceable(216) %137)
  call void %134(i32 noundef %136, float noundef %138)
  %139 = load ptr, ptr %21, align 8, !tbaa !5
  %140 = call noundef ptr @_ZNK3rmg8Object3D6getVBOEv(ptr noundef nonnull align 8 dereferenceable(216) %139)
  %141 = call noundef i32 @_ZNK3rmg8internal3VBO7getModeEv(ptr noundef nonnull align 4 dereferenceable(28) %140)
  %142 = icmp eq i32 %141, 2
  br i1 %142, label %143, label %150

143:                                              ; preds = %113
  %144 = load ptr, ptr %21, align 8, !tbaa !5
  %145 = call noundef ptr @_ZNK3rmg8Object3D10getTextureEv(ptr noundef nonnull align 8 dereferenceable(216) %144)
  %146 = icmp ne ptr %145, null
  br i1 %146, label %147, label %150

147:                                              ; preds = %143
  %148 = load i32, ptr %20, align 4, !tbaa !9
  %149 = or i32 %148, 256
  store i32 %149, ptr %20, align 4, !tbaa !9
  br label %150

150:                                              ; preds = %147, %143, %113
  %151 = load ptr, ptr @_ZN3rmg8internal11glUniform1iE, align 8, !tbaa !5
  %152 = getelementptr inbounds %"class.rmg::internal::GeneralShader", ptr %29, i32 0, i32 12
  %153 = load i32, ptr %152, align 8, !tbaa !25
  %154 = load i32, ptr %20, align 4, !tbaa !9
  call void %151(i32 noundef %153, i32 noundef %154)
  %155 = load ptr, ptr %21, align 8, !tbaa !5
  %156 = call noundef ptr @_ZNK3rmg8Object3D6getVBOEv(ptr noundef nonnull align 8 dereferenceable(216) %155)
  call void @_ZNK3rmg8internal3VBO4drawEv(ptr noundef nonnull align 4 dereferenceable(28) %156)
  call void @llvm.lifetime.end.p0(i64 64, ptr %23) #5
  call void @llvm.lifetime.end.p0(i64 64, ptr %22) #5
  store i32 0, ptr %19, align 4
  br label %157

157:                                              ; preds = %150, %74
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #5
  %158 = load i32, ptr %19, align 4
  switch i32 %158, label %167 [
    i32 0, label %159
    i32 4, label %160
  ]

159:                                              ; preds = %157
  br label %160

160:                                              ; preds = %159, %157
  %161 = call { ptr, ptr } @_ZN3rmg10ObjectList8iteratorppEi(ptr noundef nonnull align 8 dereferenceable(16) %17, i32 noundef 0)
  %162 = getelementptr inbounds { ptr, ptr }, ptr %28, i32 0, i32 0
  %163 = extractvalue { ptr, ptr } %161, 0
  store ptr %163, ptr %162, align 8
  %164 = getelementptr inbounds { ptr, ptr }, ptr %28, i32 0, i32 1
  %165 = extractvalue { ptr, ptr } %161, 1
  store ptr %165, ptr %164, align 8
  br label %57, !llvm.loop !26

166:                                              ; preds = %65, %33
  ret void

167:                                              ; preds = %157
  unreachable
}

declare void @glEnable(i32 noundef) #1

declare void @glDepthFunc(i32 noundef) #1

declare void @glFrontFace(i32 noundef) #1

declare void @glDisable(i32 noundef) #1

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZNK3rmg4Vec3ixEh(ptr noundef nonnull align 4 dereferenceable(12), i8 noundef zeroext) #2 align 2

declare noundef nonnull align 4 dereferenceable(4) ptr @_ZNK3rmg9ColorRGBAixEh(ptr noundef nonnull align 4 dereferenceable(16), i8 noundef zeroext) #1

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

declare { ptr, ptr } @_ZNK3rmg10ObjectList5beginEv(ptr noundef nonnull align 8 dereferenceable(20)) #1

declare noundef zeroext i1 @_ZN3rmg10ObjectList8iteratorneERKS1_(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(16)) #1

declare { ptr, ptr } @_ZNK3rmg10ObjectList3endEv(ptr noundef nonnull align 8 dereferenceable(20)) #1

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

declare noundef nonnull align 8 dereferenceable(48) ptr @_ZN3rmg10ObjectList8iteratordeEv(ptr noundef nonnull align 8 dereferenceable(16)) #1

declare noundef zeroext i1 @_ZNK3rmg6Object8isHiddenEv(ptr noundef nonnull align 8 dereferenceable(48)) #1

declare noundef ptr @_ZNK3rmg8Object3D6getVBOEv(ptr noundef nonnull align 8 dereferenceable(216)) #1

declare void @_ZNK3rmg4Mat4mlERKS0_(ptr dead_on_unwind writable sret(%"struct.rmg::Mat4") align 4, ptr noundef nonnull align 4 dereferenceable(64), ptr noundef nonnull align 4 dereferenceable(64)) #1

declare noundef nonnull align 4 dereferenceable(64) ptr @_ZNK3rmg8Object3D14getModelMatrixEv(ptr noundef nonnull align 8 dereferenceable(216)) #1

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef nonnull align 4 dereferenceable(16) ptr @_ZN3rmg4Mat4ixEh(ptr noundef nonnull align 4 dereferenceable(64), i8 noundef zeroext) #2 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZN3rmg7Mat4RowixEh(ptr noundef nonnull align 4 dereferenceable(16), i8 noundef zeroext) #2 align 2

declare { <2 x float>, float } @_ZNK3rmg8Object3D8getScaleEv(ptr noundef nonnull align 8 dereferenceable(216)) #1

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #4

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZN3rmg4Vec3ixEh(ptr noundef nonnull align 4 dereferenceable(12), i8 noundef zeroext) #2 align 2

declare void @glBindTexture(i32 noundef, i32 noundef) #1

declare { <2 x float>, <2 x float> } @_ZNK3rmg6Object8getColorEv(ptr noundef nonnull align 8 dereferenceable(48)) #1

declare noundef nonnull align 4 dereferenceable(4) ptr @_ZN3rmg9ColorRGBAixEh(ptr noundef nonnull align 4 dereferenceable(16), i8 noundef zeroext) #1

declare noundef float @_ZNK3rmg8Object3D12getMetalnessEv(ptr noundef nonnull align 8 dereferenceable(216)) #1

declare noundef float @_ZNK3rmg8Object3D12getRoughnessEv(ptr noundef nonnull align 8 dereferenceable(216)) #1

declare noundef float @_ZNK3rmg8Object3D20getAmbientOcculationEv(ptr noundef nonnull align 8 dereferenceable(216)) #1

declare noundef i32 @_ZNK3rmg8internal3VBO7getModeEv(ptr noundef nonnull align 4 dereferenceable(28)) #1

declare noundef ptr @_ZNK3rmg8Object3D10getTextureEv(ptr noundef nonnull align 8 dereferenceable(216)) #1

declare void @_ZNK3rmg8internal3VBO4drawEv(ptr noundef nonnull align 4 dereferenceable(28)) #1

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

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

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = !{!12, !10, i64 8}
!12 = !{!"_ZTSN3rmg8internal6ShaderE", !10, i64 8}
!13 = !{!14, !10, i64 32}
!14 = !{!"_ZTSN3rmg8internal13GeneralShaderE", !12, 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}
!15 = !{!14, !10, i64 36}
!16 = !{!14, !10, i64 24}
!17 = !{!14, !10, i64 12}
!18 = !{!14, !10, i64 16}
!19 = !{!14, !10, i64 20}
!20 = !{!14, !10, i64 28}
!21 = !{!14, !10, i64 40}
!22 = !{!14, !10, i64 44}
!23 = !{!14, !10, i64 48}
!24 = !{!14, !10, i64 52}
!25 = !{!14, !10, i64 56}
!26 = distinct !{!26, !27}
!27 = !{!"llvm.loop.mustprogress"}


; 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::ObjectList::iterator" = type { ptr, ptr }
%"struct.rmg::Mat4" = type { %union.anon.0 }
%union.anon.0 = 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 }

@_ZN3rmg8internal12glUseProgramE = external local_unnamed_addr global ptr, align 8
@_ZN3rmg8internal12glUniform3fvE = external local_unnamed_addr global ptr, align 8
@_ZN3rmg8internal12glUniform4fvE = external local_unnamed_addr global ptr, align 8
@_ZN3rmg8internal11glUniform1iE = external local_unnamed_addr global ptr, align 8
@_ZN3rmg8internal18glUniformMatrix4fvE = external local_unnamed_addr global ptr, align 8
@_ZN3rmg8internal15glActiveTextureE = external local_unnamed_addr global ptr, align 8
@_ZN3rmg8internal11glUniform1fE = external local_unnamed_addr global ptr, align 8

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN3rmg8internal13GeneralShader6renderERKNS_4Mat4ES4_S4_RKNS_4Vec3ERKNS_9ColorRGBAEjRKNS_10ObjectListE(ptr nocapture noundef nonnull readonly align 8 dereferenceable(60) %0, ptr noundef nonnull align 4 dereferenceable(64) %1, ptr noundef nonnull align 4 dereferenceable(64) %2, ptr noundef nonnull align 4 dereferenceable(64) %3, ptr noundef nonnull align 4 dereferenceable(12) %4, ptr noundef nonnull align 4 dereferenceable(16) %5, i32 noundef %6, ptr noundef nonnull align 8 dereferenceable(20) %7) local_unnamed_addr #0 align 2 {
  %9 = alloca %"class.rmg::ObjectList::iterator", align 8
  %10 = alloca %"class.rmg::ObjectList::iterator", align 8
  %11 = alloca %"struct.rmg::Mat4", align 4
  %12 = alloca %"struct.rmg::Mat4", align 4
  %13 = alloca %"struct.rmg::Vec3", align 8
  %14 = alloca %"struct.rmg::Mat4", align 4
  %15 = alloca %"struct.rmg::ColorRGBA", align 8
  %16 = getelementptr inbounds i8, ptr %0, i64 8
  %17 = load i32, ptr %16, align 8, !tbaa !5
  %18 = icmp eq i32 %17, 0
  br i1 %18, label %111, label %19

19:                                               ; preds = %8
  tail call void @glEnable(i32 noundef 2929)
  tail call void @glDepthFunc(i32 noundef 513)
  tail call void @glFrontFace(i32 noundef 2305)
  tail call void @glDisable(i32 noundef 2884)
  tail call void @glDisable(i32 noundef 3042)
  %20 = load ptr, ptr @_ZN3rmg8internal12glUseProgramE, align 8, !tbaa !10
  %21 = load i32, ptr %16, align 8, !tbaa !5
  tail call void %20(i32 noundef %21)
  %22 = load ptr, ptr @_ZN3rmg8internal12glUniform3fvE, align 8, !tbaa !10
  %23 = getelementptr inbounds i8, ptr %0, i64 32
  %24 = load i32, ptr %23, align 8, !tbaa !12
  %25 = tail call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK3rmg4Vec3ixEh(ptr noundef nonnull align 4 dereferenceable(12) %4, i8 noundef zeroext 0)
  tail call void %22(i32 noundef %24, i32 noundef 1, ptr noundef nonnull %25)
  %26 = load ptr, ptr @_ZN3rmg8internal12glUniform4fvE, align 8, !tbaa !10
  %27 = getelementptr inbounds i8, ptr %0, i64 36
  %28 = load i32, ptr %27, align 4, !tbaa !14
  %29 = tail call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK3rmg9ColorRGBAixEh(ptr noundef nonnull align 4 dereferenceable(16) %5, i8 noundef zeroext 0)
  tail call void %26(i32 noundef %28, i32 noundef 1, ptr noundef nonnull %29)
  %30 = load ptr, ptr @_ZN3rmg8internal11glUniform1iE, align 8, !tbaa !10
  %31 = getelementptr inbounds i8, ptr %0, i64 24
  %32 = load i32, ptr %31, align 8, !tbaa !15
  tail call void %30(i32 noundef %32, i32 noundef 1)
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %9) #4
  %33 = tail call { ptr, ptr } @_ZNK3rmg10ObjectList5beginEv(ptr noundef nonnull align 8 dereferenceable(20) %7)
  %34 = extractvalue { ptr, ptr } %33, 0
  store ptr %34, ptr %9, align 8
  %35 = getelementptr inbounds i8, ptr %9, i64 8
  %36 = extractvalue { ptr, ptr } %33, 1
  store ptr %36, ptr %35, align 8
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %10) #4
  %37 = tail call { ptr, ptr } @_ZNK3rmg10ObjectList3endEv(ptr noundef nonnull align 8 dereferenceable(20) %7)
  %38 = extractvalue { ptr, ptr } %37, 0
  store ptr %38, ptr %10, align 8
  %39 = getelementptr inbounds i8, ptr %10, i64 8
  %40 = extractvalue { ptr, ptr } %37, 1
  store ptr %40, ptr %39, align 8
  %41 = call noundef zeroext i1 @_ZN3rmg10ObjectList8iteratorneERKS1_(ptr noundef nonnull align 8 dereferenceable(16) %9, ptr noundef nonnull align 8 dereferenceable(16) %10)
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %10) #4
  br i1 %41, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %19
  %42 = getelementptr inbounds i8, ptr %0, i64 12
  %43 = getelementptr inbounds i8, ptr %0, i64 16
  %44 = getelementptr inbounds i8, ptr %0, i64 20
  %.sroa.2.0..sroa_idx = getelementptr inbounds i8, ptr %13, i64 8
  %.not = icmp eq i32 %6, 0
  %45 = getelementptr inbounds i8, ptr %0, i64 28
  %46 = getelementptr inbounds i8, ptr %0, i64 40
  %47 = getelementptr inbounds i8, ptr %15, i64 8
  %48 = getelementptr inbounds i8, ptr %0, i64 44
  %49 = getelementptr inbounds i8, ptr %0, i64 48
  %50 = getelementptr inbounds i8, ptr %0, i64 52
  %51 = getelementptr inbounds i8, ptr %0, i64 56
  br label %52

._crit_edge:                                      ; preds = %105, %19
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %9) #4
  br label %111

52:                                               ; preds = %.lr.ph, %105
  %53 = call noundef nonnull align 8 dereferenceable(48) ptr @_ZN3rmg10ObjectList8iteratordeEv(ptr noundef nonnull align 8 dereferenceable(16) %9)
  %54 = call noundef zeroext i1 @_ZNK3rmg6Object8isHiddenEv(ptr noundef nonnull align 8 dereferenceable(48) %53)
  br i1 %54, label %105, label %55

55:                                               ; preds = %52
  %56 = call noundef ptr @_ZNK3rmg8Object3D6getVBOEv(ptr noundef nonnull align 8 dereferenceable(216) %53)
  %57 = icmp eq ptr %56, null
  br i1 %57, label %105, label %58

58:                                               ; preds = %55
  call void @llvm.lifetime.start.p0(i64 64, ptr nonnull %11) #4
  %59 = call noundef nonnull align 4 dereferenceable(64) ptr @_ZNK3rmg8Object3D14getModelMatrixEv(ptr noundef nonnull align 8 dereferenceable(216) %53)
  call void @_ZNK3rmg4Mat4mlERKS0_(ptr dead_on_unwind nonnull writable sret(%"struct.rmg::Mat4") align 4 %11, ptr noundef nonnull align 4 dereferenceable(64) %1, ptr noundef nonnull align 4 dereferenceable(64) %59)
  call void @llvm.lifetime.start.p0(i64 64, ptr nonnull %12) #4
  call void @_ZNK3rmg4Mat4mlERKS0_(ptr dead_on_unwind nonnull writable sret(%"struct.rmg::Mat4") align 4 %12, ptr noundef nonnull align 4 dereferenceable(64) %2, ptr noundef nonnull align 4 dereferenceable(64) %11)
  %60 = load ptr, ptr @_ZN3rmg8internal18glUniformMatrix4fvE, align 8, !tbaa !10
  %61 = load i32, ptr %42, align 4, !tbaa !16
  %62 = call noundef nonnull align 4 dereferenceable(16) ptr @_ZN3rmg4Mat4ixEh(ptr noundef nonnull align 4 dereferenceable(64) %12, i8 noundef zeroext 0)
  %63 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN3rmg7Mat4RowixEh(ptr noundef nonnull align 4 dereferenceable(16) %62, i8 noundef zeroext 0)
  call void %60(i32 noundef %61, i32 noundef 1, i8 noundef zeroext 1, ptr noundef nonnull %63)
  %64 = load ptr, ptr @_ZN3rmg8internal18glUniformMatrix4fvE, align 8, !tbaa !10
  %65 = load i32, ptr %43, align 8, !tbaa !17
  %66 = call noundef nonnull align 4 dereferenceable(16) ptr @_ZN3rmg4Mat4ixEh(ptr noundef nonnull align 4 dereferenceable(64) %11, i8 noundef zeroext 0)
  %67 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN3rmg7Mat4RowixEh(ptr noundef nonnull align 4 dereferenceable(16) %66, i8 noundef zeroext 0)
  call void %64(i32 noundef %65, i32 noundef 1, i8 noundef zeroext 1, ptr noundef nonnull %67)
  %68 = load ptr, ptr @_ZN3rmg8internal12glUniform3fvE, align 8, !tbaa !10
  %69 = load i32, ptr %44, align 4, !tbaa !18
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %13) #4
  %70 = call { <2 x float>, float } @_ZNK3rmg8Object3D8getScaleEv(ptr noundef nonnull align 8 dereferenceable(216) %53)
  %.fca.0.extract = extractvalue { <2 x float>, float } %70, 0
  %.fca.1.extract = extractvalue { <2 x float>, float } %70, 1
  store <2 x float> %.fca.0.extract, ptr %13, align 8
  store float %.fca.1.extract, ptr %.sroa.2.0..sroa_idx, align 8
  %71 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN3rmg4Vec3ixEh(ptr noundef nonnull align 4 dereferenceable(12) %13, i8 noundef zeroext 0)
  call void %68(i32 noundef %69, i32 noundef 1, ptr noundef nonnull %71)
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %13) #4
  br i1 %.not, label %79, label %72

72:                                               ; preds = %58
  call void @llvm.lifetime.start.p0(i64 64, ptr nonnull %14) #4
  %73 = call noundef nonnull align 4 dereferenceable(64) ptr @_ZNK3rmg8Object3D14getModelMatrixEv(ptr noundef nonnull align 8 dereferenceable(216) %53)
  call void @_ZNK3rmg4Mat4mlERKS0_(ptr dead_on_unwind nonnull writable sret(%"struct.rmg::Mat4") align 4 %14, ptr noundef nonnull align 4 dereferenceable(64) %3, ptr noundef nonnull align 4 dereferenceable(64) %73)
  %74 = load ptr, ptr @_ZN3rmg8internal18glUniformMatrix4fvE, align 8, !tbaa !10
  %75 = load i32, ptr %45, align 4, !tbaa !19
  %76 = call noundef nonnull align 4 dereferenceable(16) ptr @_ZN3rmg4Mat4ixEh(ptr noundef nonnull align 4 dereferenceable(64) %14, i8 noundef zeroext 0)
  %77 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN3rmg7Mat4RowixEh(ptr noundef nonnull align 4 dereferenceable(16) %76, i8 noundef zeroext 0)
  call void %74(i32 noundef %75, i32 noundef 1, i8 noundef zeroext 1, ptr noundef nonnull %77)
  %78 = load ptr, ptr @_ZN3rmg8internal15glActiveTextureE, align 8, !tbaa !10
  call void %78(i32 noundef 33985)
  call void @glBindTexture(i32 noundef 3553, i32 noundef %6)
  call void @llvm.lifetime.end.p0(i64 64, ptr nonnull %14) #4
  br label %79

79:                                               ; preds = %72, %58
  %.0 = phi i32 [ 1, %72 ], [ 0, %58 ]
  %80 = load ptr, ptr @_ZN3rmg8internal12glUniform4fvE, align 8, !tbaa !10
  %81 = load i32, ptr %46, align 8, !tbaa !20
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %15) #4
  %82 = call { <2 x float>, <2 x float> } @_ZNK3rmg6Object8getColorEv(ptr noundef nonnull align 8 dereferenceable(48) %53)
  %83 = extractvalue { <2 x float>, <2 x float> } %82, 0
  store <2 x float> %83, ptr %15, align 8
  %84 = extractvalue { <2 x float>, <2 x float> } %82, 1
  store <2 x float> %84, ptr %47, align 8
  %85 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN3rmg9ColorRGBAixEh(ptr noundef nonnull align 4 dereferenceable(16) %15, i8 noundef zeroext 0)
  call void %80(i32 noundef %81, i32 noundef 1, ptr noundef nonnull %85)
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %15) #4
  %86 = load ptr, ptr @_ZN3rmg8internal11glUniform1fE, align 8, !tbaa !10
  %87 = load i32, ptr %48, align 4, !tbaa !21
  %88 = call noundef float @_ZNK3rmg8Object3D12getMetalnessEv(ptr noundef nonnull align 8 dereferenceable(216) %53)
  call void %86(i32 noundef %87, float noundef %88)
  %89 = load ptr, ptr @_ZN3rmg8internal11glUniform1fE, align 8, !tbaa !10
  %90 = load i32, ptr %49, align 8, !tbaa !22
  %91 = call noundef float @_ZNK3rmg8Object3D12getRoughnessEv(ptr noundef nonnull align 8 dereferenceable(216) %53)
  call void %89(i32 noundef %90, float noundef %91)
  %92 = load ptr, ptr @_ZN3rmg8internal11glUniform1fE, align 8, !tbaa !10
  %93 = load i32, ptr %50, align 4, !tbaa !23
  %94 = call noundef float @_ZNK3rmg8Object3D20getAmbientOcculationEv(ptr noundef nonnull align 8 dereferenceable(216) %53)
  call void %92(i32 noundef %93, float noundef %94)
  %95 = call noundef ptr @_ZNK3rmg8Object3D6getVBOEv(ptr noundef nonnull align 8 dereferenceable(216) %53)
  %96 = call noundef i32 @_ZNK3rmg8internal3VBO7getModeEv(ptr noundef nonnull align 4 dereferenceable(28) %95)
  %97 = icmp eq i32 %96, 2
  br i1 %97, label %98, label %101

98:                                               ; preds = %79
  %99 = call noundef ptr @_ZNK3rmg8Object3D10getTextureEv(ptr noundef nonnull align 8 dereferenceable(216) %53)
  %.not26 = icmp eq ptr %99, null
  %100 = or disjoint i32 %.0, 256
  %spec.select = select i1 %.not26, i32 %.0, i32 %100
  br label %101

101:                                              ; preds = %98, %79
  %.1 = phi i32 [ %.0, %79 ], [ %spec.select, %98 ]
  %102 = load ptr, ptr @_ZN3rmg8internal11glUniform1iE, align 8, !tbaa !10
  %103 = load i32, ptr %51, align 8, !tbaa !24
  call void %102(i32 noundef %103, i32 noundef %.1)
  %104 = call noundef ptr @_ZNK3rmg8Object3D6getVBOEv(ptr noundef nonnull align 8 dereferenceable(216) %53)
  call void @_ZNK3rmg8internal3VBO4drawEv(ptr noundef nonnull align 4 dereferenceable(28) %104)
  call void @llvm.lifetime.end.p0(i64 64, ptr nonnull %12) #4
  call void @llvm.lifetime.end.p0(i64 64, ptr nonnull %11) #4
  br label %105

105:                                              ; preds = %52, %55, %101
  %106 = call { ptr, ptr } @_ZN3rmg10ObjectList8iteratorppEi(ptr noundef nonnull align 8 dereferenceable(16) %9, i32 noundef 0)
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %10) #4
  %107 = call { ptr, ptr } @_ZNK3rmg10ObjectList3endEv(ptr noundef nonnull align 8 dereferenceable(20) %7)
  %108 = extractvalue { ptr, ptr } %107, 0
  store ptr %108, ptr %10, align 8
  %109 = extractvalue { ptr, ptr } %107, 1
  store ptr %109, ptr %39, align 8
  %110 = call noundef zeroext i1 @_ZN3rmg10ObjectList8iteratorneERKS1_(ptr noundef nonnull align 8 dereferenceable(16) %9, ptr noundef nonnull align 8 dereferenceable(16) %10)
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %10) #4
  br i1 %110, label %52, label %._crit_edge, !llvm.loop !25

111:                                              ; preds = %8, %._crit_edge
  ret void
}

declare void @glEnable(i32 noundef) local_unnamed_addr #1

declare void @glDepthFunc(i32 noundef) local_unnamed_addr #1

declare void @glFrontFace(i32 noundef) local_unnamed_addr #1

declare void @glDisable(i32 noundef) local_unnamed_addr #1

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZNK3rmg4Vec3ixEh(ptr noundef nonnull align 4 dereferenceable(12), i8 noundef zeroext) local_unnamed_addr #2 align 2

declare noundef nonnull align 4 dereferenceable(4) ptr @_ZNK3rmg9ColorRGBAixEh(ptr noundef nonnull align 4 dereferenceable(16), i8 noundef zeroext) local_unnamed_addr #1

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

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

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

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

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

declare noundef nonnull align 8 dereferenceable(48) ptr @_ZN3rmg10ObjectList8iteratordeEv(ptr noundef nonnull align 8 dereferenceable(16)) local_unnamed_addr #1

declare noundef zeroext i1 @_ZNK3rmg6Object8isHiddenEv(ptr noundef nonnull align 8 dereferenceable(48)) local_unnamed_addr #1

declare noundef ptr @_ZNK3rmg8Object3D6getVBOEv(ptr noundef nonnull align 8 dereferenceable(216)) local_unnamed_addr #1

declare void @_ZNK3rmg4Mat4mlERKS0_(ptr dead_on_unwind writable sret(%"struct.rmg::Mat4") align 4, ptr noundef nonnull align 4 dereferenceable(64), ptr noundef nonnull align 4 dereferenceable(64)) local_unnamed_addr #1

declare noundef nonnull align 4 dereferenceable(64) ptr @_ZNK3rmg8Object3D14getModelMatrixEv(ptr noundef nonnull align 8 dereferenceable(216)) local_unnamed_addr #1

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef nonnull align 4 dereferenceable(16) ptr @_ZN3rmg4Mat4ixEh(ptr noundef nonnull align 4 dereferenceable(64), i8 noundef zeroext) local_unnamed_addr #2 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZN3rmg7Mat4RowixEh(ptr noundef nonnull align 4 dereferenceable(16), i8 noundef zeroext) local_unnamed_addr #2 align 2

declare { <2 x float>, float } @_ZNK3rmg8Object3D8getScaleEv(ptr noundef nonnull align 8 dereferenceable(216)) local_unnamed_addr #1

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZN3rmg4Vec3ixEh(ptr noundef nonnull align 4 dereferenceable(12), i8 noundef zeroext) local_unnamed_addr #2 align 2

declare void @glBindTexture(i32 noundef, i32 noundef) local_unnamed_addr #1

declare { <2 x float>, <2 x float> } @_ZNK3rmg6Object8getColorEv(ptr noundef nonnull align 8 dereferenceable(48)) local_unnamed_addr #1

declare noundef nonnull align 4 dereferenceable(4) ptr @_ZN3rmg9ColorRGBAixEh(ptr noundef nonnull align 4 dereferenceable(16), i8 noundef zeroext) local_unnamed_addr #1

declare noundef float @_ZNK3rmg8Object3D12getMetalnessEv(ptr noundef nonnull align 8 dereferenceable(216)) local_unnamed_addr #1

declare noundef float @_ZNK3rmg8Object3D12getRoughnessEv(ptr noundef nonnull align 8 dereferenceable(216)) local_unnamed_addr #1

declare noundef float @_ZNK3rmg8Object3D20getAmbientOcculationEv(ptr noundef nonnull align 8 dereferenceable(216)) local_unnamed_addr #1

declare noundef i32 @_ZNK3rmg8internal3VBO7getModeEv(ptr noundef nonnull align 4 dereferenceable(28)) local_unnamed_addr #1

declare noundef ptr @_ZNK3rmg8Object3D10getTextureEv(ptr noundef nonnull align 8 dereferenceable(216)) local_unnamed_addr #1

declare void @_ZNK3rmg8internal3VBO4drawEv(ptr noundef nonnull align 4 dereferenceable(28)) local_unnamed_addr #1

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

attributes #0 = { mustprogress uwtable "min-legal-vector-width"="64" "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 = { "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 = { inlinehint mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #4 = { 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, !7, i64 8}
!6 = !{!"_ZTSN3rmg8internal6ShaderE", !7, i64 8}
!7 = !{!"int", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!11, !11, i64 0}
!11 = !{!"any pointer", !8, i64 0}
!12 = !{!13, !7, i64 32}
!13 = !{!"_ZTSN3rmg8internal13GeneralShaderE", !6, i64 0, !7, i64 12, !7, i64 16, !7, i64 20, !7, i64 24, !7, i64 28, !7, i64 32, !7, i64 36, !7, i64 40, !7, i64 44, !7, i64 48, !7, i64 52, !7, i64 56}
!14 = !{!13, !7, i64 36}
!15 = !{!13, !7, i64 24}
!16 = !{!13, !7, i64 12}
!17 = !{!13, !7, i64 16}
!18 = !{!13, !7, i64 20}
!19 = !{!13, !7, i64 28}
!20 = !{!13, !7, i64 40}
!21 = !{!13, !7, i64 44}
!22 = !{!13, !7, i64 48}
!23 = !{!13, !7, i64 52}
!24 = !{!13, !7, i64 56}
!25 = distinct !{!25, !26}
!26 = !{!"llvm.loop.mustprogress"}


; Effective O3 passes: EarlyCSEPass,GlobalOptPass,InferAlignmentPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LICMPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,PostOrderFunctionAttrsPass,SROAPass,SimplifyCFGPass,TailCallElimPass