; LLVM IR from santa01/graphene :: src (ImageTexture)

; 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.Graphene::Texture" = type { ptr, i32, i32, i32, i32 }

@_ZN8Graphene15glTexSubImage2DE = external global ptr, align 8
@_ZN8Graphene16glGenerateMipmapE = external global ptr, align 8

declare noundef i32 @_ZNK8Graphene5Image8getWidthEv(ptr noundef nonnull align 8 dereferenceable(32)) #0

declare noundef i32 @_ZNK8Graphene5Image9getHeightEv(ptr noundef nonnull align 8 dereferenceable(32)) #0

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

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

declare void @_ZN8Graphene7Texture4bindEv(ptr noundef nonnull align 8 dereferenceable(24)) #0

declare noundef i32 @_ZNK8Graphene5Image13getPixelDepthEv(ptr noundef nonnull align 8 dereferenceable(32)) #0

declare noundef ptr @_ZNK8Graphene5Image9getPixelsEv(ptr noundef nonnull align 8 dereferenceable(32)) #0

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(16) ptr @_ZNKSt5arrayISt10shared_ptrIN8Graphene5ImageEELm6EEixEm(ptr noundef nonnull align 8 dereferenceable(96), i64 noundef) #2 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef ptr @_ZNKSt19__shared_ptr_accessIN8Graphene5ImageELN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1)) #2 align 2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN8Graphene16ImageCubeTexture6updateERKSt5arrayISt10shared_ptrINS_5ImageEELm6EE(ptr noundef nonnull align 8 dereferenceable(24) %0, ptr noundef nonnull align 8 dereferenceable(96) %1) #3 align 2 {
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca i32, align 4
  %6 = alloca ptr, align 8
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  store ptr %0, ptr %3, align 8, !tbaa !5
  store ptr %1, ptr %4, align 8, !tbaa !5
  %9 = load ptr, ptr %3, align 8
  call void @_ZN8Graphene7Texture4bindEv(ptr noundef nonnull align 8 dereferenceable(24) %9)
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #4
  store i32 0, ptr %5, align 4, !tbaa !9
  br label %10

10:                                               ; preds = %39, %2
  %11 = load i32, ptr %5, align 4, !tbaa !9
  %12 = icmp slt i32 %11, 6
  br i1 %12, label %14, label %13

13:                                               ; preds = %10
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #4
  br label %42

14:                                               ; preds = %10
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #4
  %15 = load ptr, ptr %4, align 8, !tbaa !5
  %16 = load i32, ptr %5, align 4, !tbaa !9
  %17 = sext i32 %16 to i64
  %18 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNKSt5arrayISt10shared_ptrIN8Graphene5ImageEELm6EEixEm(ptr noundef nonnull align 8 dereferenceable(96) %15, i64 noundef %17) #4
  store ptr %18, ptr %6, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #4
  %19 = load i32, ptr %5, align 4, !tbaa !9
  %20 = add nsw i32 34069, %19
  store i32 %20, ptr %7, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #4
  %21 = load ptr, ptr %6, align 8, !tbaa !5
  %22 = call noundef ptr @_ZNKSt19__shared_ptr_accessIN8Graphene5ImageELN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) %21) #4
  %23 = call noundef i32 @_ZNK8Graphene5Image13getPixelDepthEv(ptr noundef nonnull align 8 dereferenceable(32) %22)
  %24 = icmp eq i32 %23, 32
  %25 = zext i1 %24 to i64
  %26 = select i1 %24, i32 32993, i32 32992
  store i32 %26, ptr %8, align 4, !tbaa !9
  %27 = load ptr, ptr @_ZN8Graphene15glTexSubImage2DE, align 8, !tbaa !5
  %28 = load i32, ptr %7, align 4, !tbaa !9
  %29 = load ptr, ptr %6, align 8, !tbaa !5
  %30 = call noundef ptr @_ZNKSt19__shared_ptr_accessIN8Graphene5ImageELN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) %29) #4
  %31 = call noundef i32 @_ZNK8Graphene5Image8getWidthEv(ptr noundef nonnull align 8 dereferenceable(32) %30)
  %32 = load ptr, ptr %6, align 8, !tbaa !5
  %33 = call noundef ptr @_ZNKSt19__shared_ptr_accessIN8Graphene5ImageELN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) %32) #4
  %34 = call noundef i32 @_ZNK8Graphene5Image9getHeightEv(ptr noundef nonnull align 8 dereferenceable(32) %33)
  %35 = load i32, ptr %8, align 4, !tbaa !9
  %36 = load ptr, ptr %6, align 8, !tbaa !5
  %37 = call noundef ptr @_ZNKSt19__shared_ptr_accessIN8Graphene5ImageELN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) %36) #4
  %38 = call noundef ptr @_ZNK8Graphene5Image9getPixelsEv(ptr noundef nonnull align 8 dereferenceable(32) %37)
  call void %27(i32 noundef %28, i32 noundef 0, i32 noundef 0, i32 noundef 0, i32 noundef %31, i32 noundef %34, i32 noundef %35, i32 noundef 5121, ptr noundef %38)
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #4
  br label %39

39:                                               ; preds = %14
  %40 = load i32, ptr %5, align 4, !tbaa !9
  %41 = add nsw i32 %40, 1
  store i32 %41, ptr %5, align 4, !tbaa !9
  br label %10, !llvm.loop !11

42:                                               ; preds = %13
  %43 = load ptr, ptr @_ZN8Graphene16glGenerateMipmapE, align 8, !tbaa !5
  %44 = getelementptr inbounds %"class.Graphene::Texture", ptr %9, i32 0, i32 3
  %45 = load i32, ptr %44, align 8, !tbaa !13
  call void %43(i32 noundef %45)
  ret void
}

attributes #0 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { mustprogress 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 = { 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, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = !{!14, !10, i64 16}
!14 = !{!"_ZTSN8Graphene7TextureE", !10, i64 8, !10, i64 12, !10, i64 16, !10, i64 20}


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

@_ZN8Graphene15glTexSubImage2DE = external local_unnamed_addr global ptr, align 8
@_ZN8Graphene16glGenerateMipmapE = external local_unnamed_addr global ptr, align 8

declare noundef i32 @_ZNK8Graphene5Image8getWidthEv(ptr noundef nonnull align 8 dereferenceable(32)) local_unnamed_addr #0

declare noundef i32 @_ZNK8Graphene5Image9getHeightEv(ptr noundef nonnull align 8 dereferenceable(32)) local_unnamed_addr #0

declare void @_ZN8Graphene7Texture4bindEv(ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #0

declare noundef i32 @_ZNK8Graphene5Image13getPixelDepthEv(ptr noundef nonnull align 8 dereferenceable(32)) local_unnamed_addr #0

declare noundef ptr @_ZNK8Graphene5Image9getPixelsEv(ptr noundef nonnull align 8 dereferenceable(32)) local_unnamed_addr #0

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(16) ptr @_ZNKSt5arrayISt10shared_ptrIN8Graphene5ImageEELm6EEixEm(ptr noundef nonnull align 8 dereferenceable(96), i64 noundef) local_unnamed_addr #1 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef ptr @_ZNKSt19__shared_ptr_accessIN8Graphene5ImageELN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1)) local_unnamed_addr #1 align 2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN8Graphene16ImageCubeTexture6updateERKSt5arrayISt10shared_ptrINS_5ImageEELm6EE(ptr noundef nonnull align 8 dereferenceable(24) %0, ptr noundef nonnull align 8 dereferenceable(96) %1) local_unnamed_addr #2 align 2 {
  tail call void @_ZN8Graphene7Texture4bindEv(ptr noundef nonnull align 8 dereferenceable(24) %0)
  %3 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNKSt5arrayISt10shared_ptrIN8Graphene5ImageEELm6EEixEm(ptr noundef nonnull align 8 dereferenceable(96) %1, i64 noundef 0) #3
  %4 = tail call noundef ptr @_ZNKSt19__shared_ptr_accessIN8Graphene5ImageELN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) %3) #3
  %5 = tail call noundef i32 @_ZNK8Graphene5Image13getPixelDepthEv(ptr noundef nonnull align 8 dereferenceable(32) %4)
  %6 = icmp eq i32 %5, 32
  %7 = select i1 %6, i32 32993, i32 32992
  %8 = load ptr, ptr @_ZN8Graphene15glTexSubImage2DE, align 8, !tbaa !5
  %9 = tail call noundef ptr @_ZNKSt19__shared_ptr_accessIN8Graphene5ImageELN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) %3) #3
  %10 = tail call noundef i32 @_ZNK8Graphene5Image8getWidthEv(ptr noundef nonnull align 8 dereferenceable(32) %9)
  %11 = tail call noundef ptr @_ZNKSt19__shared_ptr_accessIN8Graphene5ImageELN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) %3) #3
  %12 = tail call noundef i32 @_ZNK8Graphene5Image9getHeightEv(ptr noundef nonnull align 8 dereferenceable(32) %11)
  %13 = tail call noundef ptr @_ZNKSt19__shared_ptr_accessIN8Graphene5ImageELN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) %3) #3
  %14 = tail call noundef ptr @_ZNK8Graphene5Image9getPixelsEv(ptr noundef nonnull align 8 dereferenceable(32) %13)
  tail call void %8(i32 noundef 34069, i32 noundef 0, i32 noundef 0, i32 noundef 0, i32 noundef %10, i32 noundef %12, i32 noundef %7, i32 noundef 5121, ptr noundef %14)
  %15 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNKSt5arrayISt10shared_ptrIN8Graphene5ImageEELm6EEixEm(ptr noundef nonnull align 8 dereferenceable(96) %1, i64 noundef 1) #3
  %16 = tail call noundef ptr @_ZNKSt19__shared_ptr_accessIN8Graphene5ImageELN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) %15) #3
  %17 = tail call noundef i32 @_ZNK8Graphene5Image13getPixelDepthEv(ptr noundef nonnull align 8 dereferenceable(32) %16)
  %18 = icmp eq i32 %17, 32
  %19 = select i1 %18, i32 32993, i32 32992
  %20 = load ptr, ptr @_ZN8Graphene15glTexSubImage2DE, align 8, !tbaa !5
  %21 = tail call noundef ptr @_ZNKSt19__shared_ptr_accessIN8Graphene5ImageELN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) %15) #3
  %22 = tail call noundef i32 @_ZNK8Graphene5Image8getWidthEv(ptr noundef nonnull align 8 dereferenceable(32) %21)
  %23 = tail call noundef ptr @_ZNKSt19__shared_ptr_accessIN8Graphene5ImageELN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) %15) #3
  %24 = tail call noundef i32 @_ZNK8Graphene5Image9getHeightEv(ptr noundef nonnull align 8 dereferenceable(32) %23)
  %25 = tail call noundef ptr @_ZNKSt19__shared_ptr_accessIN8Graphene5ImageELN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) %15) #3
  %26 = tail call noundef ptr @_ZNK8Graphene5Image9getPixelsEv(ptr noundef nonnull align 8 dereferenceable(32) %25)
  tail call void %20(i32 noundef 34070, i32 noundef 0, i32 noundef 0, i32 noundef 0, i32 noundef %22, i32 noundef %24, i32 noundef %19, i32 noundef 5121, ptr noundef %26)
  %27 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNKSt5arrayISt10shared_ptrIN8Graphene5ImageEELm6EEixEm(ptr noundef nonnull align 8 dereferenceable(96) %1, i64 noundef 2) #3
  %28 = tail call noundef ptr @_ZNKSt19__shared_ptr_accessIN8Graphene5ImageELN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) %27) #3
  %29 = tail call noundef i32 @_ZNK8Graphene5Image13getPixelDepthEv(ptr noundef nonnull align 8 dereferenceable(32) %28)
  %30 = icmp eq i32 %29, 32
  %31 = select i1 %30, i32 32993, i32 32992
  %32 = load ptr, ptr @_ZN8Graphene15glTexSubImage2DE, align 8, !tbaa !5
  %33 = tail call noundef ptr @_ZNKSt19__shared_ptr_accessIN8Graphene5ImageELN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) %27) #3
  %34 = tail call noundef i32 @_ZNK8Graphene5Image8getWidthEv(ptr noundef nonnull align 8 dereferenceable(32) %33)
  %35 = tail call noundef ptr @_ZNKSt19__shared_ptr_accessIN8Graphene5ImageELN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) %27) #3
  %36 = tail call noundef i32 @_ZNK8Graphene5Image9getHeightEv(ptr noundef nonnull align 8 dereferenceable(32) %35)
  %37 = tail call noundef ptr @_ZNKSt19__shared_ptr_accessIN8Graphene5ImageELN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) %27) #3
  %38 = tail call noundef ptr @_ZNK8Graphene5Image9getPixelsEv(ptr noundef nonnull align 8 dereferenceable(32) %37)
  tail call void %32(i32 noundef 34071, i32 noundef 0, i32 noundef 0, i32 noundef 0, i32 noundef %34, i32 noundef %36, i32 noundef %31, i32 noundef 5121, ptr noundef %38)
  %39 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNKSt5arrayISt10shared_ptrIN8Graphene5ImageEELm6EEixEm(ptr noundef nonnull align 8 dereferenceable(96) %1, i64 noundef 3) #3
  %40 = tail call noundef ptr @_ZNKSt19__shared_ptr_accessIN8Graphene5ImageELN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) %39) #3
  %41 = tail call noundef i32 @_ZNK8Graphene5Image13getPixelDepthEv(ptr noundef nonnull align 8 dereferenceable(32) %40)
  %42 = icmp eq i32 %41, 32
  %43 = select i1 %42, i32 32993, i32 32992
  %44 = load ptr, ptr @_ZN8Graphene15glTexSubImage2DE, align 8, !tbaa !5
  %45 = tail call noundef ptr @_ZNKSt19__shared_ptr_accessIN8Graphene5ImageELN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) %39) #3
  %46 = tail call noundef i32 @_ZNK8Graphene5Image8getWidthEv(ptr noundef nonnull align 8 dereferenceable(32) %45)
  %47 = tail call noundef ptr @_ZNKSt19__shared_ptr_accessIN8Graphene5ImageELN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) %39) #3
  %48 = tail call noundef i32 @_ZNK8Graphene5Image9getHeightEv(ptr noundef nonnull align 8 dereferenceable(32) %47)
  %49 = tail call noundef ptr @_ZNKSt19__shared_ptr_accessIN8Graphene5ImageELN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) %39) #3
  %50 = tail call noundef ptr @_ZNK8Graphene5Image9getPixelsEv(ptr noundef nonnull align 8 dereferenceable(32) %49)
  tail call void %44(i32 noundef 34072, i32 noundef 0, i32 noundef 0, i32 noundef 0, i32 noundef %46, i32 noundef %48, i32 noundef %43, i32 noundef 5121, ptr noundef %50)
  %51 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNKSt5arrayISt10shared_ptrIN8Graphene5ImageEELm6EEixEm(ptr noundef nonnull align 8 dereferenceable(96) %1, i64 noundef 4) #3
  %52 = tail call noundef ptr @_ZNKSt19__shared_ptr_accessIN8Graphene5ImageELN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) %51) #3
  %53 = tail call noundef i32 @_ZNK8Graphene5Image13getPixelDepthEv(ptr noundef nonnull align 8 dereferenceable(32) %52)
  %54 = icmp eq i32 %53, 32
  %55 = select i1 %54, i32 32993, i32 32992
  %56 = load ptr, ptr @_ZN8Graphene15glTexSubImage2DE, align 8, !tbaa !5
  %57 = tail call noundef ptr @_ZNKSt19__shared_ptr_accessIN8Graphene5ImageELN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) %51) #3
  %58 = tail call noundef i32 @_ZNK8Graphene5Image8getWidthEv(ptr noundef nonnull align 8 dereferenceable(32) %57)
  %59 = tail call noundef ptr @_ZNKSt19__shared_ptr_accessIN8Graphene5ImageELN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) %51) #3
  %60 = tail call noundef i32 @_ZNK8Graphene5Image9getHeightEv(ptr noundef nonnull align 8 dereferenceable(32) %59)
  %61 = tail call noundef ptr @_ZNKSt19__shared_ptr_accessIN8Graphene5ImageELN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) %51) #3
  %62 = tail call noundef ptr @_ZNK8Graphene5Image9getPixelsEv(ptr noundef nonnull align 8 dereferenceable(32) %61)
  tail call void %56(i32 noundef 34073, i32 noundef 0, i32 noundef 0, i32 noundef 0, i32 noundef %58, i32 noundef %60, i32 noundef %55, i32 noundef 5121, ptr noundef %62)
  %63 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNKSt5arrayISt10shared_ptrIN8Graphene5ImageEELm6EEixEm(ptr noundef nonnull align 8 dereferenceable(96) %1, i64 noundef 5) #3
  %64 = tail call noundef ptr @_ZNKSt19__shared_ptr_accessIN8Graphene5ImageELN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) %63) #3
  %65 = tail call noundef i32 @_ZNK8Graphene5Image13getPixelDepthEv(ptr noundef nonnull align 8 dereferenceable(32) %64)
  %66 = icmp eq i32 %65, 32
  %67 = select i1 %66, i32 32993, i32 32992
  %68 = load ptr, ptr @_ZN8Graphene15glTexSubImage2DE, align 8, !tbaa !5
  %69 = tail call noundef ptr @_ZNKSt19__shared_ptr_accessIN8Graphene5ImageELN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) %63) #3
  %70 = tail call noundef i32 @_ZNK8Graphene5Image8getWidthEv(ptr noundef nonnull align 8 dereferenceable(32) %69)
  %71 = tail call noundef ptr @_ZNKSt19__shared_ptr_accessIN8Graphene5ImageELN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) %63) #3
  %72 = tail call noundef i32 @_ZNK8Graphene5Image9getHeightEv(ptr noundef nonnull align 8 dereferenceable(32) %71)
  %73 = tail call noundef ptr @_ZNKSt19__shared_ptr_accessIN8Graphene5ImageELN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) %63) #3
  %74 = tail call noundef ptr @_ZNK8Graphene5Image9getPixelsEv(ptr noundef nonnull align 8 dereferenceable(32) %73)
  tail call void %68(i32 noundef 34074, i32 noundef 0, i32 noundef 0, i32 noundef 0, i32 noundef %70, i32 noundef %72, i32 noundef %67, i32 noundef 5121, ptr noundef %74)
  %75 = load ptr, ptr @_ZN8Graphene16glGenerateMipmapE, align 8, !tbaa !5
  %76 = getelementptr inbounds i8, ptr %0, i64 16
  %77 = load i32, ptr %76, align 8, !tbaa !9
  tail call void %75(i32 noundef %77)
  ret void
}

attributes #0 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { 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 #2 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { 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 16}
!10 = !{!"_ZTSN8Graphene7TextureE", !11, i64 8, !11, i64 12, !11, i64 16, !11, i64 20}
!11 = !{!"int", !7, i64 0}


; Effective O3 passes: EarlyCSEPass,GVNPass,GlobalOptPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,LoopRotatePass,SROAPass,SimplifyCFGPass,TailCallElimPass