; LLVM IR from achilles288/robot-monitor-graphics :: src/base/internal (line3d_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::ColorRGBA" = type { float, float, float, float }
%"class.rmg::internal::Shader" = type <{ ptr, i32, [4 x i8] }>
%"class.rmg::internal::Line3DShader" = type { %"class.rmg::internal::Shader.base", i32, i32, i32, i32, i32 }
%"class.rmg::internal::Shader.base" = type <{ ptr, i32 }>

@_ZN3rmg8internal17glBindVertexArrayE = external global ptr, align 8
@_ZN3rmg8internal12glBindBufferE = external global ptr, align 8
@_ZN3rmg8internal12glUseProgramE = external global ptr, align 8
@_ZN3rmg8internal18glUniformMatrix4fvE = external global ptr, align 8
@_ZN3rmg8internal12glUniform3fvE = external global ptr, align 8

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

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

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

18:                                               ; preds = %3
  br label %77

19:                                               ; preds = %3
  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)
  %20 = load ptr, ptr @_ZN3rmg8internal12glUseProgramE, align 8, !tbaa !5
  %21 = getelementptr inbounds %"class.rmg::internal::Shader", ptr %14, i32 0, i32 1
  %22 = load i32, ptr %21, align 8, !tbaa !9
  call void %20(i32 noundef %22)
  %23 = load ptr, ptr @_ZN3rmg8internal17glBindVertexArrayE, align 8, !tbaa !5
  %24 = getelementptr inbounds %"class.rmg::internal::Line3DShader", ptr %14, i32 0, i32 3
  %25 = load i32, ptr %24, align 4, !tbaa !12
  call void %23(i32 noundef %25)
  %26 = load ptr, ptr @_ZN3rmg8internal12glBindBufferE, align 8, !tbaa !5
  %27 = getelementptr inbounds %"class.rmg::internal::Line3DShader", ptr %14, i32 0, i32 5
  %28 = load i32, ptr %27, align 4, !tbaa !14
  call void %26(i32 noundef 34963, i32 noundef %28)
  call void @llvm.lifetime.start.p0(i64 16, ptr %7) #4
  %29 = load ptr, ptr %6, align 8, !tbaa !5
  %30 = call { ptr, ptr } @_ZNK3rmg10ObjectList5beginEv(ptr noundef nonnull align 8 dereferenceable(20) %29)
  %31 = getelementptr inbounds { ptr, ptr }, ptr %7, i32 0, i32 0
  %32 = extractvalue { ptr, ptr } %30, 0
  store ptr %32, ptr %31, align 8
  %33 = getelementptr inbounds { ptr, ptr }, ptr %7, i32 0, i32 1
  %34 = extractvalue { ptr, ptr } %30, 1
  store ptr %34, ptr %33, align 8
  br label %35

35:                                               ; preds = %71, %19
  call void @llvm.lifetime.start.p0(i64 16, ptr %8) #4
  %36 = load ptr, ptr %6, align 8, !tbaa !5
  %37 = call { ptr, ptr } @_ZNK3rmg10ObjectList3endEv(ptr noundef nonnull align 8 dereferenceable(20) %36)
  %38 = getelementptr inbounds { ptr, ptr }, ptr %8, i32 0, i32 0
  %39 = extractvalue { ptr, ptr } %37, 0
  store ptr %39, ptr %38, align 8
  %40 = getelementptr inbounds { ptr, ptr }, ptr %8, i32 0, i32 1
  %41 = extractvalue { ptr, ptr } %37, 1
  store ptr %41, ptr %40, align 8
  %42 = call noundef zeroext i1 @_ZN3rmg10ObjectList8iteratorneERKS1_(ptr noundef nonnull align 8 dereferenceable(16) %7, ptr noundef nonnull align 8 dereferenceable(16) %8)
  call void @llvm.lifetime.end.p0(i64 16, ptr %8) #4
  br i1 %42, label %44, label %43

43:                                               ; preds = %35
  store i32 2, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 16, ptr %7) #4
  br label %77

44:                                               ; preds = %35
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #4
  %45 = call noundef nonnull align 8 dereferenceable(48) ptr @_ZN3rmg10ObjectList8iteratordeEv(ptr noundef nonnull align 8 dereferenceable(16) %7)
  store ptr %45, ptr %10, align 8, !tbaa !5
  %46 = load ptr, ptr %10, align 8, !tbaa !5
  %47 = call noundef zeroext i1 @_ZNK3rmg6Object8isHiddenEv(ptr noundef nonnull align 8 dereferenceable(48) %46)
  br i1 %47, label %48, label %49

48:                                               ; preds = %44
  store i32 4, ptr %9, align 4
  br label %68

49:                                               ; preds = %44
  call void @llvm.lifetime.start.p0(i64 64, ptr %11) #4
  %50 = load ptr, ptr %5, align 8, !tbaa !5
  %51 = load ptr, ptr %10, align 8, !tbaa !5
  %52 = call noundef nonnull align 4 dereferenceable(64) ptr @_ZNK3rmg6Line3D14getModelMatrixEv(ptr noundef nonnull align 8 dereferenceable(128) %51)
  call void @_ZNK3rmg4Mat4mlERKS0_(ptr dead_on_unwind writable sret(%"struct.rmg::Mat4") align 4 %11, ptr noundef nonnull align 4 dereferenceable(64) %50, ptr noundef nonnull align 4 dereferenceable(64) %52)
  %53 = load ptr, ptr @_ZN3rmg8internal18glUniformMatrix4fvE, align 8, !tbaa !5
  %54 = getelementptr inbounds %"class.rmg::internal::Line3DShader", ptr %14, i32 0, i32 1
  %55 = load i32, ptr %54, align 4, !tbaa !15
  %56 = call noundef nonnull align 4 dereferenceable(16) ptr @_ZN3rmg4Mat4ixEh(ptr noundef nonnull align 4 dereferenceable(64) %11, i8 noundef zeroext 0)
  %57 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN3rmg7Mat4RowixEh(ptr noundef nonnull align 4 dereferenceable(16) %56, i8 noundef zeroext 0)
  call void %53(i32 noundef %55, i32 noundef 1, i8 noundef zeroext 1, ptr noundef %57)
  %58 = load ptr, ptr @_ZN3rmg8internal12glUniform3fvE, align 8, !tbaa !5
  %59 = getelementptr inbounds %"class.rmg::internal::Line3DShader", ptr %14, i32 0, i32 2
  %60 = load i32, ptr %59, align 8, !tbaa !16
  call void @llvm.lifetime.start.p0(i64 16, ptr %12) #4
  %61 = load ptr, ptr %10, align 8, !tbaa !5
  %62 = call { <2 x float>, <2 x float> } @_ZNK3rmg6Object8getColorEv(ptr noundef nonnull align 8 dereferenceable(48) %61)
  %63 = getelementptr inbounds { <2 x float>, <2 x float> }, ptr %12, i32 0, i32 0
  %64 = extractvalue { <2 x float>, <2 x float> } %62, 0
  store <2 x float> %64, ptr %63, align 4
  %65 = getelementptr inbounds { <2 x float>, <2 x float> }, ptr %12, i32 0, i32 1
  %66 = extractvalue { <2 x float>, <2 x float> } %62, 1
  store <2 x float> %66, ptr %65, align 4
  %67 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN3rmg9ColorRGBAixEh(ptr noundef nonnull align 4 dereferenceable(16) %12, i8 noundef zeroext 0)
  call void %58(i32 noundef %60, i32 noundef 1, ptr noundef %67)
  call void @llvm.lifetime.end.p0(i64 16, ptr %12) #4
  call void @glDrawElements(i32 noundef 4, i32 noundef 96, i32 noundef 5125, ptr noundef null)
  call void @llvm.lifetime.end.p0(i64 64, ptr %11) #4
  store i32 0, ptr %9, align 4
  br label %68

68:                                               ; preds = %49, %48
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #4
  %69 = load i32, ptr %9, align 4
  switch i32 %69, label %78 [
    i32 0, label %70
    i32 4, label %71
  ]

70:                                               ; preds = %68
  br label %71

71:                                               ; preds = %70, %68
  %72 = call { ptr, ptr } @_ZN3rmg10ObjectList8iteratorppEi(ptr noundef nonnull align 8 dereferenceable(16) %7, i32 noundef 0)
  %73 = getelementptr inbounds { ptr, ptr }, ptr %13, i32 0, i32 0
  %74 = extractvalue { ptr, ptr } %72, 0
  store ptr %74, ptr %73, align 8
  %75 = getelementptr inbounds { ptr, ptr }, ptr %13, i32 0, i32 1
  %76 = extractvalue { ptr, ptr } %72, 1
  store ptr %76, ptr %75, align 8
  br label %35, !llvm.loop !17

77:                                               ; preds = %43, %18
  ret void

78:                                               ; preds = %68
  unreachable
}

declare void @glEnable(i32 noundef) #2

declare void @glDepthFunc(i32 noundef) #2

declare void @glFrontFace(i32 noundef) #2

declare void @glDisable(i32 noundef) #2

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

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

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

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

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

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)) #2

declare noundef nonnull align 4 dereferenceable(64) ptr @_ZNK3rmg6Line3D14getModelMatrixEv(ptr noundef nonnull align 8 dereferenceable(128)) #2

; 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) #3 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) #3 align 2

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

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

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

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

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #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 = { 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 #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, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !11, i64 8}
!10 = !{!"_ZTSN3rmg8internal6ShaderE", !11, i64 8}
!11 = !{!"int", !7, i64 0}
!12 = !{!13, !11, i64 20}
!13 = !{!"_ZTSN3rmg8internal12Line3DShaderE", !10, i64 0, !11, i64 12, !11, i64 16, !11, i64 20, !11, i64 24, !11, i64 28}
!14 = !{!13, !11, i64 28}
!15 = !{!13, !11, i64 12}
!16 = !{!13, !11, i64 16}
!17 = distinct !{!17, !18}
!18 = !{!"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::ColorRGBA" = type { float, float, float, float }

@_ZN3rmg8internal17glBindVertexArrayE = external local_unnamed_addr global ptr, align 8
@_ZN3rmg8internal12glBindBufferE = external local_unnamed_addr global ptr, align 8
@_ZN3rmg8internal12glUseProgramE = external local_unnamed_addr global ptr, align 8
@_ZN3rmg8internal18glUniformMatrix4fvE = external local_unnamed_addr global ptr, align 8
@_ZN3rmg8internal12glUniform3fvE = external local_unnamed_addr global ptr, align 8

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN3rmg8internal12Line3DShader6renderERKNS_4Mat4ERKNS_10ObjectListE(ptr nocapture noundef nonnull readonly align 8 dereferenceable(32) %0, ptr noundef nonnull align 4 dereferenceable(64) %1, ptr noundef nonnull align 8 dereferenceable(20) %2) local_unnamed_addr #1 align 2 {
  %4 = alloca %"class.rmg::ObjectList::iterator", align 8
  %5 = alloca %"class.rmg::ObjectList::iterator", align 8
  %6 = alloca %"struct.rmg::Mat4", align 4
  %7 = alloca %"struct.rmg::ColorRGBA", align 8
  %8 = getelementptr inbounds i8, ptr %0, i64 8
  %9 = load i32, ptr %8, align 8, !tbaa !5
  %10 = icmp eq i32 %9, 0
  br i1 %10, label %53, label %11

11:                                               ; preds = %3
  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)
  %12 = load ptr, ptr @_ZN3rmg8internal12glUseProgramE, align 8, !tbaa !10
  %13 = load i32, ptr %8, align 8, !tbaa !5
  tail call void %12(i32 noundef %13)
  %14 = load ptr, ptr @_ZN3rmg8internal17glBindVertexArrayE, align 8, !tbaa !10
  %15 = getelementptr inbounds i8, ptr %0, i64 20
  %16 = load i32, ptr %15, align 4, !tbaa !12
  tail call void %14(i32 noundef %16)
  %17 = load ptr, ptr @_ZN3rmg8internal12glBindBufferE, align 8, !tbaa !10
  %18 = getelementptr inbounds i8, ptr %0, i64 28
  %19 = load i32, ptr %18, align 4, !tbaa !14
  tail call void %17(i32 noundef 34963, i32 noundef %19)
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %4) #4
  %20 = tail call { ptr, ptr } @_ZNK3rmg10ObjectList5beginEv(ptr noundef nonnull align 8 dereferenceable(20) %2)
  %21 = extractvalue { ptr, ptr } %20, 0
  store ptr %21, ptr %4, align 8
  %22 = getelementptr inbounds i8, ptr %4, i64 8
  %23 = extractvalue { ptr, ptr } %20, 1
  store ptr %23, ptr %22, align 8
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %5) #4
  %24 = tail call { ptr, ptr } @_ZNK3rmg10ObjectList3endEv(ptr noundef nonnull align 8 dereferenceable(20) %2)
  %25 = extractvalue { ptr, ptr } %24, 0
  store ptr %25, ptr %5, align 8
  %26 = getelementptr inbounds i8, ptr %5, i64 8
  %27 = extractvalue { ptr, ptr } %24, 1
  store ptr %27, ptr %26, align 8
  %28 = call noundef zeroext i1 @_ZN3rmg10ObjectList8iteratorneERKS1_(ptr noundef nonnull align 8 dereferenceable(16) %4, ptr noundef nonnull align 8 dereferenceable(16) %5)
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %5) #4
  br i1 %28, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %11
  %29 = getelementptr inbounds i8, ptr %0, i64 12
  %30 = getelementptr inbounds i8, ptr %0, i64 16
  %31 = getelementptr inbounds i8, ptr %7, i64 8
  br label %32

._crit_edge:                                      ; preds = %47, %11
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %4) #4
  br label %53

32:                                               ; preds = %.lr.ph, %47
  %33 = call noundef nonnull align 8 dereferenceable(48) ptr @_ZN3rmg10ObjectList8iteratordeEv(ptr noundef nonnull align 8 dereferenceable(16) %4)
  %34 = call noundef zeroext i1 @_ZNK3rmg6Object8isHiddenEv(ptr noundef nonnull align 8 dereferenceable(48) %33)
  br i1 %34, label %47, label %35

35:                                               ; preds = %32
  call void @llvm.lifetime.start.p0(i64 64, ptr nonnull %6) #4
  %36 = call noundef nonnull align 4 dereferenceable(64) ptr @_ZNK3rmg6Line3D14getModelMatrixEv(ptr noundef nonnull align 8 dereferenceable(128) %33)
  call void @_ZNK3rmg4Mat4mlERKS0_(ptr dead_on_unwind nonnull writable sret(%"struct.rmg::Mat4") align 4 %6, ptr noundef nonnull align 4 dereferenceable(64) %1, ptr noundef nonnull align 4 dereferenceable(64) %36)
  %37 = load ptr, ptr @_ZN3rmg8internal18glUniformMatrix4fvE, align 8, !tbaa !10
  %38 = load i32, ptr %29, align 4, !tbaa !15
  %39 = call noundef nonnull align 4 dereferenceable(16) ptr @_ZN3rmg4Mat4ixEh(ptr noundef nonnull align 4 dereferenceable(64) %6, i8 noundef zeroext 0)
  %40 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN3rmg7Mat4RowixEh(ptr noundef nonnull align 4 dereferenceable(16) %39, i8 noundef zeroext 0)
  call void %37(i32 noundef %38, i32 noundef 1, i8 noundef zeroext 1, ptr noundef nonnull %40)
  %41 = load ptr, ptr @_ZN3rmg8internal12glUniform3fvE, align 8, !tbaa !10
  %42 = load i32, ptr %30, align 8, !tbaa !16
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %7) #4
  %43 = call { <2 x float>, <2 x float> } @_ZNK3rmg6Object8getColorEv(ptr noundef nonnull align 8 dereferenceable(48) %33)
  %44 = extractvalue { <2 x float>, <2 x float> } %43, 0
  store <2 x float> %44, ptr %7, align 8
  %45 = extractvalue { <2 x float>, <2 x float> } %43, 1
  store <2 x float> %45, ptr %31, align 8
  %46 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN3rmg9ColorRGBAixEh(ptr noundef nonnull align 4 dereferenceable(16) %7, i8 noundef zeroext 0)
  call void %41(i32 noundef %42, i32 noundef 1, ptr noundef nonnull %46)
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %7) #4
  call void @glDrawElements(i32 noundef 4, i32 noundef 96, i32 noundef 5125, ptr noundef null)
  call void @llvm.lifetime.end.p0(i64 64, ptr nonnull %6) #4
  br label %47

47:                                               ; preds = %32, %35
  %48 = call { ptr, ptr } @_ZN3rmg10ObjectList8iteratorppEi(ptr noundef nonnull align 8 dereferenceable(16) %4, i32 noundef 0)
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %5) #4
  %49 = call { ptr, ptr } @_ZNK3rmg10ObjectList3endEv(ptr noundef nonnull align 8 dereferenceable(20) %2)
  %50 = extractvalue { ptr, ptr } %49, 0
  store ptr %50, ptr %5, align 8
  %51 = extractvalue { ptr, ptr } %49, 1
  store ptr %51, ptr %26, align 8
  %52 = call noundef zeroext i1 @_ZN3rmg10ObjectList8iteratorneERKS1_(ptr noundef nonnull align 8 dereferenceable(16) %4, ptr noundef nonnull align 8 dereferenceable(16) %5)
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %5) #4
  br i1 %52, label %32, label %._crit_edge, !llvm.loop !17

53:                                               ; preds = %3, %._crit_edge
  ret void
}

declare void @glEnable(i32 noundef) local_unnamed_addr #2

declare void @glDepthFunc(i32 noundef) local_unnamed_addr #2

declare void @glFrontFace(i32 noundef) local_unnamed_addr #2

declare void @glDisable(i32 noundef) local_unnamed_addr #2

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

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

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

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

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

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 #2

declare noundef nonnull align 4 dereferenceable(64) ptr @_ZNK3rmg6Line3D14getModelMatrixEv(ptr noundef nonnull align 8 dereferenceable(128)) local_unnamed_addr #2

; 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 #3 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 #3 align 2

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

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

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

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

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #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 = { 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 #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 20}
!13 = !{!"_ZTSN3rmg8internal12Line3DShaderE", !6, i64 0, !7, i64 12, !7, i64 16, !7, i64 20, !7, i64 24, !7, i64 28}
!14 = !{!13, !7, i64 28}
!15 = !{!13, !7, i64 12}
!16 = !{!13, !7, i64 16}
!17 = distinct !{!17, !18}
!18 = !{!"llvm.loop.mustprogress"}


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