; LLVM IR from niessner/Matterport :: code/gaps/pkgs/RGBD/RGBDSurface.ll (ZN11RGBDSurface12UpdateOpenGLEv)

; 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.RNRgb = type { [3 x double] }
%class.RGBDSurface = type { ptr, ptr, i32, %class.RNArray, i32, i32, i32, ptr, ptr, %class.R2Box, i32, ptr, ptr, ptr }
%class.RNArray = type { %class.RNVArray }
%class.RNVArray = type { ptr, i32, i32 }
%class.R2Box = type { %class.R2Solid, %class.R2Point, %class.R2Point }
%class.R2Solid = type { %class.R2Shape }
%class.R2Shape = type { ptr }
%class.R2Point = type { [2 x double] }

; 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
declare dso_local void @_ZNK11RGBDSurface10TexelColorEii(ptr dead_on_unwind noalias writable sret(%class.RNRgb) align 8, ptr noundef nonnull align 8 dereferenceable(144), i32 noundef, i32 noundef) #1 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef double @_ZNK5RNRgb1REv(ptr noundef nonnull align 8 dereferenceable(24)) #2 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef double @_ZNK5RNRgb1GEv(ptr noundef nonnull align 8 dereferenceable(24)) #2 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef double @_ZNK5RNRgb1BEv(ptr noundef nonnull align 8 dereferenceable(24)) #2 align 2

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN11RGBDSurface12UpdateOpenGLEv(ptr noundef nonnull align 8 dereferenceable(144) %0) unnamed_addr #1 align 2 {
  %2 = alloca ptr, align 8
  %3 = alloca i32, align 4
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca %class.RNRgb, align 8
  store ptr %0, ptr %2, align 8, !tbaa !5
  %10 = load ptr, ptr %2, align 8
  %11 = getelementptr inbounds %class.RGBDSurface, ptr %10, i32 0, i32 6
  %12 = load i32, ptr %11, align 8, !tbaa !9
  %13 = icmp sgt i32 %12, 0
  br i1 %13, label %14, label %15

14:                                               ; preds = %1
  br label %96

15:                                               ; preds = %1
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #6
  call void @glGenTextures(i32 noundef 1, ptr noundef %3)
  call void @llvm.lifetime.start.p0(i64 8, ptr %4) #6
  %16 = getelementptr inbounds %class.RGBDSurface, ptr %10, i32 0, i32 4
  %17 = load i32, ptr %16, align 8, !tbaa !18
  %18 = getelementptr inbounds %class.RGBDSurface, ptr %10, i32 0, i32 5
  %19 = load i32, ptr %18, align 4, !tbaa !19
  %20 = mul nsw i32 %17, %19
  %21 = mul nsw i32 %20, 4
  %22 = sext i32 %21 to i64
  %23 = call noalias noundef nonnull ptr @_Znam(i64 noundef %22) #7
  store ptr %23, ptr %4, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #6
  %24 = load ptr, ptr %4, align 8, !tbaa !5
  store ptr %24, ptr %5, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #6
  store i32 0, ptr %6, align 4, !tbaa !20
  br label %25

25:                                               ; preds = %80, %15
  %26 = load i32, ptr %6, align 4, !tbaa !20
  %27 = getelementptr inbounds %class.RGBDSurface, ptr %10, i32 0, i32 5
  %28 = load i32, ptr %27, align 4, !tbaa !19
  %29 = icmp slt i32 %26, %28
  br i1 %29, label %31, label %30

30:                                               ; preds = %25
  store i32 2, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #6
  br label %83

31:                                               ; preds = %25
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #6
  store i32 0, ptr %8, align 4, !tbaa !20
  br label %32

32:                                               ; preds = %76, %31
  %33 = load i32, ptr %8, align 4, !tbaa !20
  %34 = getelementptr inbounds %class.RGBDSurface, ptr %10, i32 0, i32 4
  %35 = load i32, ptr %34, align 8, !tbaa !18
  %36 = icmp slt i32 %33, %35
  br i1 %36, label %38, label %37

37:                                               ; preds = %32
  store i32 5, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #6
  br label %79

38:                                               ; preds = %32
  call void @llvm.lifetime.start.p0(i64 24, ptr %9) #6
  %39 = load i32, ptr %8, align 4, !tbaa !20
  %40 = load i32, ptr %6, align 4, !tbaa !20
  call void @_ZNK11RGBDSurface10TexelColorEii(ptr dead_on_unwind writable sret(%class.RNRgb) align 8 %9, ptr noundef nonnull align 8 dereferenceable(144) %10, i32 noundef %39, i32 noundef %40)
  %41 = call noundef double @_ZNK5RNRgb1REv(ptr noundef nonnull align 8 dereferenceable(24) %9)
  %42 = fcmp olt double %41, 1.000000e+00
  br i1 %42, label %43, label %46

43:                                               ; preds = %38
  %44 = call noundef double @_ZNK5RNRgb1REv(ptr noundef nonnull align 8 dereferenceable(24) %9)
  %45 = fmul double %44, 2.550000e+02
  br label %47

46:                                               ; preds = %38
  br label %47

47:                                               ; preds = %46, %43
  %48 = phi double [ %45, %43 ], [ 2.550000e+02, %46 ]
  %49 = fptoui double %48 to i8
  %50 = load ptr, ptr %5, align 8, !tbaa !5
  %51 = getelementptr inbounds i8, ptr %50, i32 1
  store ptr %51, ptr %5, align 8, !tbaa !5
  store i8 %49, ptr %50, align 1, !tbaa !21
  %52 = call noundef double @_ZNK5RNRgb1GEv(ptr noundef nonnull align 8 dereferenceable(24) %9)
  %53 = fcmp olt double %52, 1.000000e+00
  br i1 %53, label %54, label %57

54:                                               ; preds = %47
  %55 = call noundef double @_ZNK5RNRgb1GEv(ptr noundef nonnull align 8 dereferenceable(24) %9)
  %56 = fmul double %55, 2.550000e+02
  br label %58

57:                                               ; preds = %47
  br label %58

58:                                               ; preds = %57, %54
  %59 = phi double [ %56, %54 ], [ 2.550000e+02, %57 ]
  %60 = fptoui double %59 to i8
  %61 = load ptr, ptr %5, align 8, !tbaa !5
  %62 = getelementptr inbounds i8, ptr %61, i32 1
  store ptr %62, ptr %5, align 8, !tbaa !5
  store i8 %60, ptr %61, align 1, !tbaa !21
  %63 = call noundef double @_ZNK5RNRgb1BEv(ptr noundef nonnull align 8 dereferenceable(24) %9)
  %64 = fcmp olt double %63, 1.000000e+00
  br i1 %64, label %65, label %68

65:                                               ; preds = %58
  %66 = call noundef double @_ZNK5RNRgb1BEv(ptr noundef nonnull align 8 dereferenceable(24) %9)
  %67 = fmul double %66, 2.550000e+02
  br label %69

68:                                               ; preds = %58
  br label %69

69:                                               ; preds = %68, %65
  %70 = phi double [ %67, %65 ], [ 2.550000e+02, %68 ]
  %71 = fptoui double %70 to i8
  %72 = load ptr, ptr %5, align 8, !tbaa !5
  %73 = getelementptr inbounds i8, ptr %72, i32 1
  store ptr %73, ptr %5, align 8, !tbaa !5
  store i8 %71, ptr %72, align 1, !tbaa !21
  %74 = load ptr, ptr %5, align 8, !tbaa !5
  %75 = getelementptr inbounds i8, ptr %74, i32 1
  store ptr %75, ptr %5, align 8, !tbaa !5
  store i8 -1, ptr %74, align 1, !tbaa !21
  call void @llvm.lifetime.end.p0(i64 24, ptr %9) #6
  br label %76

76:                                               ; preds = %69
  %77 = load i32, ptr %8, align 4, !tbaa !20
  %78 = add nsw i32 %77, 1
  store i32 %78, ptr %8, align 4, !tbaa !20
  br label %32, !llvm.loop !22

79:                                               ; preds = %37
  br label %80

80:                                               ; preds = %79
  %81 = load i32, ptr %6, align 4, !tbaa !20
  %82 = add nsw i32 %81, 1
  store i32 %82, ptr %6, align 4, !tbaa !20
  br label %25, !llvm.loop !24

83:                                               ; preds = %30
  %84 = load i32, ptr %3, align 4, !tbaa !20
  call void @glBindTexture(i32 noundef 3553, i32 noundef %84)
  call void @glPixelStorei(i32 noundef 3317, i32 noundef 4)
  call void @glTexParameteri(i32 noundef 3553, i32 noundef 10242, i32 noundef 33071)
  call void @glTexParameteri(i32 noundef 3553, i32 noundef 10243, i32 noundef 33071)
  call void @glTexParameteri(i32 noundef 3553, i32 noundef 10241, i32 noundef 9728)
  call void @glTexParameteri(i32 noundef 3553, i32 noundef 10240, i32 noundef 9728)
  call void @glTexEnvi(i32 noundef 8960, i32 noundef 8704, i32 noundef 8448)
  %85 = getelementptr inbounds %class.RGBDSurface, ptr %10, i32 0, i32 4
  %86 = load i32, ptr %85, align 8, !tbaa !18
  %87 = getelementptr inbounds %class.RGBDSurface, ptr %10, i32 0, i32 5
  %88 = load i32, ptr %87, align 4, !tbaa !19
  %89 = load ptr, ptr %4, align 8, !tbaa !5
  call void @glTexImage2D(i32 noundef 3553, i32 noundef 0, i32 noundef 6408, i32 noundef %86, i32 noundef %88, i32 noundef 0, i32 noundef 6408, i32 noundef 5121, ptr noundef %89)
  %90 = load ptr, ptr %4, align 8, !tbaa !5
  %91 = icmp eq ptr %90, null
  br i1 %91, label %93, label %92

92:                                               ; preds = %83
  call void @_ZdaPv(ptr noundef %90) #8
  br label %93

93:                                               ; preds = %92, %83
  %94 = load i32, ptr %3, align 4, !tbaa !20
  %95 = getelementptr inbounds %class.RGBDSurface, ptr %10, i32 0, i32 6
  store i32 %94, ptr %95, align 8, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #6
  br label %96

96:                                               ; preds = %93, %14
  ret void
}

declare void @glGenTextures(i32 noundef, ptr noundef) #3

; Function Attrs: nobuiltin allocsize(0)
declare noundef nonnull ptr @_Znam(i64 noundef) #4

declare void @glPixelStorei(i32 noundef, i32 noundef) #3

declare void @glTexParameteri(i32 noundef, i32 noundef, i32 noundef) #3

declare void @glTexEnvi(i32 noundef, i32 noundef, i32 noundef) #3

declare void @glTexImage2D(i32 noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef, ptr noundef) #3

; Function Attrs: nobuiltin nounwind
declare void @_ZdaPv(ptr noundef) #5

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { 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 #3 = { "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 = { nobuiltin allocsize(0) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { nobuiltin nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { nounwind }
attributes #7 = { builtin allocsize(0) }
attributes #8 = { builtin 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 48}
!10 = !{!"_ZTS11RGBDSurface", !6, i64 8, !11, i64 16, !12, i64 24, !11, i64 40, !11, i64 44, !11, i64 48, !6, i64 56, !6, i64 64, !14, i64 72, !11, i64 112, !6, i64 120, !6, i64 128, !6, i64 136}
!11 = !{!"int", !7, i64 0}
!12 = !{!"_ZTS7RNArrayIP6R2GridE", !13, i64 0}
!13 = !{!"_ZTS8RNVArray", !6, i64 0, !11, i64 8, !11, i64 12}
!14 = !{!"_ZTS5R2Box", !15, i64 0, !17, i64 8, !17, i64 24}
!15 = !{!"_ZTS7R2Solid", !16, i64 0}
!16 = !{!"_ZTS7R2Shape"}
!17 = !{!"_ZTS7R2Point", !7, i64 0}
!18 = !{!10, !11, i64 40}
!19 = !{!10, !11, i64 44}
!20 = !{!11, !11, i64 0}
!21 = !{!7, !7, i64 0}
!22 = distinct !{!22, !23}
!23 = !{!"llvm.loop.mustprogress"}
!24 = distinct !{!24, !23}


; 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.RNRgb = type { [3 x double] }

; 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
declare dso_local void @_ZNK11RGBDSurface10TexelColorEii(ptr dead_on_unwind noalias writable sret(%class.RNRgb) align 8, ptr noundef nonnull align 8 dereferenceable(144), i32 noundef, i32 noundef) local_unnamed_addr #1 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef double @_ZNK5RNRgb1REv(ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #2 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef double @_ZNK5RNRgb1GEv(ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #2 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef double @_ZNK5RNRgb1BEv(ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #2 align 2

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN11RGBDSurface12UpdateOpenGLEv(ptr noundef nonnull align 8 dereferenceable(144) %0) unnamed_addr #1 align 2 {
  %2 = alloca i32, align 4
  %3 = alloca %class.RNRgb, align 8
  %4 = getelementptr inbounds i8, ptr %0, i64 48
  %5 = load i32, ptr %4, align 8, !tbaa !5
  %6 = icmp sgt i32 %5, 0
  br i1 %6, label %60, label %7

7:                                                ; preds = %1
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #6
  call void @glGenTextures(i32 noundef 1, ptr noundef nonnull %2)
  %8 = getelementptr inbounds i8, ptr %0, i64 40
  %9 = load i32, ptr %8, align 8, !tbaa !17
  %10 = getelementptr inbounds i8, ptr %0, i64 44
  %11 = load i32, ptr %10, align 4, !tbaa !18
  %12 = shl i32 %9, 2
  %13 = mul i32 %12, %11
  %14 = sext i32 %13 to i64
  %15 = call noalias noundef nonnull ptr @_Znam(i64 noundef %14) #7
  %16 = icmp sgt i32 %11, 0
  %17 = icmp sgt i32 %9, 0
  %or.cond = and i1 %16, %17
  br i1 %or.cond, label %.preheader, label %._crit_edge19

.preheader:                                       ; preds = %7, %._crit_edge
  %18 = phi i32 [ %25, %._crit_edge ], [ %11, %7 ]
  %19 = phi i32 [ %26, %._crit_edge ], [ %9, %7 ]
  %.01318 = phi i32 [ %27, %._crit_edge ], [ 0, %7 ]
  %.01417 = phi ptr [ %.1.lcssa, %._crit_edge ], [ %15, %7 ]
  %20 = icmp sgt i32 %19, 0
  br i1 %20, label %.lr.ph, label %._crit_edge

._crit_edge19:                                    ; preds = %._crit_edge, %7
  %21 = load i32, ptr %2, align 4, !tbaa !19
  call void @glBindTexture(i32 noundef 3553, i32 noundef %21)
  call void @glPixelStorei(i32 noundef 3317, i32 noundef 4)
  call void @glTexParameteri(i32 noundef 3553, i32 noundef 10242, i32 noundef 33071)
  call void @glTexParameteri(i32 noundef 3553, i32 noundef 10243, i32 noundef 33071)
  call void @glTexParameteri(i32 noundef 3553, i32 noundef 10241, i32 noundef 9728)
  call void @glTexParameteri(i32 noundef 3553, i32 noundef 10240, i32 noundef 9728)
  call void @glTexEnvi(i32 noundef 8960, i32 noundef 8704, i32 noundef 8448)
  %22 = load i32, ptr %8, align 8, !tbaa !17
  %23 = load i32, ptr %10, align 4, !tbaa !18
  call void @glTexImage2D(i32 noundef 3553, i32 noundef 0, i32 noundef 6408, i32 noundef %22, i32 noundef %23, i32 noundef 0, i32 noundef 6408, i32 noundef 5121, ptr noundef nonnull %15)
  call void @_ZdaPv(ptr noundef nonnull %15) #8
  %24 = load i32, ptr %2, align 4, !tbaa !19
  store i32 %24, ptr %4, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #6
  br label %60

._crit_edge.loopexit:                             ; preds = %52
  %.pre = load i32, ptr %10, align 4, !tbaa !18
  br label %._crit_edge

._crit_edge:                                      ; preds = %._crit_edge.loopexit, %.preheader
  %25 = phi i32 [ %18, %.preheader ], [ %.pre, %._crit_edge.loopexit ]
  %26 = phi i32 [ %19, %.preheader ], [ %58, %._crit_edge.loopexit ]
  %.1.lcssa = phi ptr [ %.01417, %.preheader ], [ %56, %._crit_edge.loopexit ]
  %27 = add nuw nsw i32 %.01318, 1
  %28 = icmp slt i32 %27, %25
  br i1 %28, label %.preheader, label %._crit_edge19, !llvm.loop !20

.lr.ph:                                           ; preds = %.preheader, %52
  %.016 = phi i32 [ %57, %52 ], [ 0, %.preheader ]
  %.115 = phi ptr [ %56, %52 ], [ %.01417, %.preheader ]
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %3) #6
  call void @_ZNK11RGBDSurface10TexelColorEii(ptr dead_on_unwind nonnull writable sret(%class.RNRgb) align 8 %3, ptr noundef nonnull align 8 dereferenceable(144) %0, i32 noundef %.016, i32 noundef %.01318)
  %29 = call noundef double @_ZNK5RNRgb1REv(ptr noundef nonnull align 8 dereferenceable(24) %3)
  %30 = fcmp olt double %29, 1.000000e+00
  br i1 %30, label %31, label %34

31:                                               ; preds = %.lr.ph
  %32 = call noundef double @_ZNK5RNRgb1REv(ptr noundef nonnull align 8 dereferenceable(24) %3)
  %33 = fmul double %32, 2.550000e+02
  br label %34

34:                                               ; preds = %.lr.ph, %31
  %35 = phi double [ %33, %31 ], [ 2.550000e+02, %.lr.ph ]
  %36 = fptoui double %35 to i8
  %37 = getelementptr inbounds i8, ptr %.115, i64 1
  store i8 %36, ptr %.115, align 1, !tbaa !23
  %38 = call noundef double @_ZNK5RNRgb1GEv(ptr noundef nonnull align 8 dereferenceable(24) %3)
  %39 = fcmp olt double %38, 1.000000e+00
  br i1 %39, label %40, label %43

40:                                               ; preds = %34
  %41 = call noundef double @_ZNK5RNRgb1GEv(ptr noundef nonnull align 8 dereferenceable(24) %3)
  %42 = fmul double %41, 2.550000e+02
  br label %43

43:                                               ; preds = %34, %40
  %44 = phi double [ %42, %40 ], [ 2.550000e+02, %34 ]
  %45 = fptoui double %44 to i8
  %46 = getelementptr inbounds i8, ptr %.115, i64 2
  store i8 %45, ptr %37, align 1, !tbaa !23
  %47 = call noundef double @_ZNK5RNRgb1BEv(ptr noundef nonnull align 8 dereferenceable(24) %3)
  %48 = fcmp olt double %47, 1.000000e+00
  br i1 %48, label %49, label %52

49:                                               ; preds = %43
  %50 = call noundef double @_ZNK5RNRgb1BEv(ptr noundef nonnull align 8 dereferenceable(24) %3)
  %51 = fmul double %50, 2.550000e+02
  br label %52

52:                                               ; preds = %43, %49
  %53 = phi double [ %51, %49 ], [ 2.550000e+02, %43 ]
  %54 = fptoui double %53 to i8
  %55 = getelementptr inbounds i8, ptr %.115, i64 3
  store i8 %54, ptr %46, align 1, !tbaa !23
  %56 = getelementptr inbounds i8, ptr %.115, i64 4
  store i8 -1, ptr %55, align 1, !tbaa !23
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %3) #6
  %57 = add nuw nsw i32 %.016, 1
  %58 = load i32, ptr %8, align 8, !tbaa !17
  %59 = icmp slt i32 %57, %58
  br i1 %59, label %.lr.ph, label %._crit_edge.loopexit, !llvm.loop !24

60:                                               ; preds = %1, %._crit_edge19
  ret void
}

declare void @glGenTextures(i32 noundef, ptr noundef) local_unnamed_addr #3

; Function Attrs: nobuiltin allocsize(0)
declare noundef nonnull ptr @_Znam(i64 noundef) local_unnamed_addr #4

declare void @glPixelStorei(i32 noundef, i32 noundef) local_unnamed_addr #3

declare void @glTexParameteri(i32 noundef, i32 noundef, i32 noundef) local_unnamed_addr #3

declare void @glTexEnvi(i32 noundef, i32 noundef, i32 noundef) local_unnamed_addr #3

declare void @glTexImage2D(i32 noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef, ptr noundef) local_unnamed_addr #3

; Function Attrs: nobuiltin nounwind
declare void @_ZdaPv(ptr noundef) local_unnamed_addr #5

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { 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 #3 = { "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 = { nobuiltin allocsize(0) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { nobuiltin nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { nounwind }
attributes #7 = { builtin allocsize(0) }
attributes #8 = { builtin 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, !10, i64 48}
!6 = !{!"_ZTS11RGBDSurface", !7, i64 8, !10, i64 16, !11, i64 24, !10, i64 40, !10, i64 44, !10, i64 48, !7, i64 56, !7, i64 64, !13, i64 72, !10, i64 112, !7, i64 120, !7, i64 128, !7, i64 136}
!7 = !{!"any pointer", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!"int", !8, i64 0}
!11 = !{!"_ZTS7RNArrayIP6R2GridE", !12, i64 0}
!12 = !{!"_ZTS8RNVArray", !7, i64 0, !10, i64 8, !10, i64 12}
!13 = !{!"_ZTS5R2Box", !14, i64 0, !16, i64 8, !16, i64 24}
!14 = !{!"_ZTS7R2Solid", !15, i64 0}
!15 = !{!"_ZTS7R2Shape"}
!16 = !{!"_ZTS7R2Point", !8, i64 0}
!17 = !{!6, !10, i64 40}
!18 = !{!6, !10, i64 44}
!19 = !{!10, !10, i64 0}
!20 = distinct !{!20, !21, !22}
!21 = !{!"llvm.loop.mustprogress"}
!22 = !{!"llvm.loop.unswitch.partial.disable"}
!23 = !{!8, !8, i64 0}
!24 = distinct !{!24, !21}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LICMPass,LoopInstSimplifyPass,LoopRotatePass,LoopSimplifyCFGPass,LoopSimplifyPass,LoopUnrollPass,ReassociatePass,SROAPass,SimpleLoopUnswitchPass,SimplifyCFGPass