; LLVM IR from paroj/gltut :: Tut 16 Gamma and Textures/GammaCheckers.ll (Z19LoadCheckerTexturesv)

; 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.std::__cxx11::basic_string" = type { %"struct.std::__cxx11::basic_string<char>::_Alloc_hider", i64, %union.anon }
%"struct.std::__cxx11::basic_string<char>::_Alloc_hider" = type { ptr }
%union.anon = type { i64, [8 x i8] }
%"class.std::allocator.0" = type { i8 }
%"class.std::unique_ptr" = type { %"struct.std::__uniq_ptr_data" }
%"struct.std::__uniq_ptr_data" = type { %"class.std::__uniq_ptr_impl" }
%"class.std::__uniq_ptr_impl" = type { %"class.std::tuple" }
%"class.std::tuple" = type { %"struct.std::_Tuple_impl" }
%"struct.std::_Tuple_impl" = type { %"struct.std::_Head_base.4" }
%"struct.std::_Head_base.4" = type { ptr }
%"class.glimg::SingleImage" = type <{ %"class.std::shared_ptr", i32, i32, i32, [4 x i8] }>
%"class.std::shared_ptr" = type { %"class.std::__shared_ptr" }
%"class.std::__shared_ptr" = type { ptr, %"class.std::__shared_count" }
%"class.std::__shared_count" = type { ptr }
%"struct.glimg::Dimensions" = type { i32, i32, i32, i32 }

@g_linearTexture = external dso_local global i32, align 4
@g_gammaTexture = external dso_local global i32, align 4
@_ZTISt9exception = external constant ptr
@.str.6 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [19 x i8], align 1
@_funcptr_glGenTextures = external global ptr, align 8
@_funcptr_glBindTexture = external global ptr, align 8
@_funcptr_glTexImage2D = external global ptr, align 8
@_funcptr_glTexParameteri = external global ptr, align 8
@.str.8 = external hidden unnamed_addr constant [18 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [4 x i8], align 1

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

declare i32 @__gxx_personality_v0(...)

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

; Function Attrs: mustprogress nounwind uwtable
declare void @_ZNSaIcEC2Ev(ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #1 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_(ptr noundef nonnull align 8 dereferenceable(32), ptr noundef, ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #2 align 2

; Function Attrs: mustprogress nounwind uwtable
declare void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32)) unnamed_addr #1 align 2

; Function Attrs: mustprogress uwtable
define dso_local void @_Z19LoadCheckerTexturesv() #2 personality ptr @__gxx_personality_v0 {
  %1 = alloca %"class.std::__cxx11::basic_string", align 8
  %2 = alloca %"class.std::allocator.0", align 1
  %3 = alloca ptr, align 8
  %4 = alloca i32, align 4
  %5 = alloca %"class.std::unique_ptr", align 8
  %6 = alloca %"class.std::__cxx11::basic_string", align 8
  %7 = alloca %"class.std::allocator.0", align 1
  %8 = alloca i32, align 4
  %9 = alloca %"class.glimg::SingleImage", align 8
  %10 = alloca %"struct.glimg::Dimensions", align 4
  %11 = alloca %"class.std::__cxx11::basic_string", align 8
  %12 = alloca %"class.std::__cxx11::basic_string", align 8
  %13 = alloca %"class.std::allocator.0", align 1
  %14 = alloca %"class.std::__cxx11::basic_string", align 8
  %15 = alloca %"class.std::allocator.0", align 1
  %16 = alloca i32, align 4
  %17 = alloca %"class.glimg::SingleImage", align 8
  %18 = alloca %"struct.glimg::Dimensions", align 4
  %19 = alloca ptr, align 8
  call void @llvm.lifetime.start.p0(i64 32, ptr %1) #8
  call void @llvm.lifetime.start.p0(i64 1, ptr %2) #8
  call void @_ZNSaIcEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %2) #8
  invoke void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_(ptr noundef nonnull align 8 dereferenceable(32) %1, ptr noundef @.str.6, ptr noundef nonnull align 1 dereferenceable(1) %2)
          to label %20 unwind label %39

20:                                               ; preds = %0
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %2) #8
  call void @llvm.lifetime.end.p0(i64 1, ptr %2) #8
  %21 = invoke noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEpLEPKc(ptr noundef nonnull align 8 dereferenceable(32) %1, ptr noundef @.str.7)
          to label %22 unwind label %43

22:                                               ; preds = %20
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #8
  call void @llvm.lifetime.start.p0(i64 32, ptr %6) #8
  %23 = call noundef ptr @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE5c_strEv(ptr noundef nonnull align 8 dereferenceable(32) %1) #8
  call void @llvm.lifetime.start.p0(i64 1, ptr %7) #8
  call void @_ZNSaIcEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %7) #8
  invoke void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_(ptr noundef nonnull align 8 dereferenceable(32) %6, ptr noundef %23, ptr noundef nonnull align 1 dereferenceable(1) %7)
          to label %24 unwind label %47

24:                                               ; preds = %22
  %25 = invoke noundef ptr @_ZN5glimg7loaders3dds12LoadFromFileERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(ptr noundef nonnull align 8 dereferenceable(32) %6)
          to label %26 unwind label %51

26:                                               ; preds = %24
  call void @_ZNSt10unique_ptrIN5glimg8ImageSetESt14default_deleteIS1_EEC2IS3_vEEPS1_(ptr noundef nonnull align 8 dereferenceable(8) %5, ptr noundef %25) #8
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %6) #8
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %7) #8
  call void @llvm.lifetime.end.p0(i64 1, ptr %7) #8
  call void @llvm.lifetime.end.p0(i64 32, ptr %6) #8
  %27 = load ptr, ptr @_funcptr_glGenTextures, align 8, !tbaa !5
  invoke void %27(i32 noundef 1, ptr noundef @g_linearTexture)
          to label %28 unwind label %56

28:                                               ; preds = %26
  %29 = load ptr, ptr @_funcptr_glBindTexture, align 8, !tbaa !5
  %30 = load i32, ptr @g_linearTexture, align 4, !tbaa !9
  invoke void %29(i32 noundef 3553, i32 noundef %30)
          to label %31 unwind label %56

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

32:                                               ; preds = %83, %31
  %33 = load i32, ptr %8, align 4, !tbaa !9
  %34 = call noundef ptr @_ZNKSt10unique_ptrIN5glimg8ImageSetESt14default_deleteIS1_EEptEv(ptr noundef nonnull align 8 dereferenceable(8) %5) #8
  %35 = invoke noundef i32 @_ZNK5glimg8ImageSet14GetMipmapCountEv(ptr noundef nonnull align 8 dereferenceable(16) %34)
          to label %36 unwind label %60

36:                                               ; preds = %32
  %37 = icmp slt i32 %33, %35
  br i1 %37, label %64, label %38

38:                                               ; preds = %36
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #8
  br label %96

39:                                               ; preds = %0
  %40 = landingpad { ptr, i32 }
          cleanup
          catch ptr @_ZTISt9exception
  %41 = extractvalue { ptr, i32 } %40, 0
  store ptr %41, ptr %3, align 8
  %42 = extractvalue { ptr, i32 } %40, 1
  store i32 %42, ptr %4, align 4
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %2) #8
  call void @llvm.lifetime.end.p0(i64 1, ptr %2) #8
  br label %192

43:                                               ; preds = %20
  %44 = landingpad { ptr, i32 }
          cleanup
          catch ptr @_ZTISt9exception
  %45 = extractvalue { ptr, i32 } %44, 0
  store ptr %45, ptr %3, align 8
  %46 = extractvalue { ptr, i32 } %44, 1
  store i32 %46, ptr %4, align 4
  br label %191

47:                                               ; preds = %22
  %48 = landingpad { ptr, i32 }
          cleanup
          catch ptr @_ZTISt9exception
  %49 = extractvalue { ptr, i32 } %48, 0
  store ptr %49, ptr %3, align 8
  %50 = extractvalue { ptr, i32 } %48, 1
  store i32 %50, ptr %4, align 4
  br label %55

51:                                               ; preds = %24
  %52 = landingpad { ptr, i32 }
          cleanup
          catch ptr @_ZTISt9exception
  %53 = extractvalue { ptr, i32 } %52, 0
  store ptr %53, ptr %3, align 8
  %54 = extractvalue { ptr, i32 } %52, 1
  store i32 %54, ptr %4, align 4
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %6) #8
  br label %55

55:                                               ; preds = %51, %47
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %7) #8
  call void @llvm.lifetime.end.p0(i64 1, ptr %7) #8
  call void @llvm.lifetime.end.p0(i64 32, ptr %6) #8
  br label %190

56:                                               ; preds = %186, %184, %180, %178, %113, %111, %102, %98, %96, %28, %26
  %57 = landingpad { ptr, i32 }
          cleanup
          catch ptr @_ZTISt9exception
  %58 = extractvalue { ptr, i32 } %57, 0
  store ptr %58, ptr %3, align 8
  %59 = extractvalue { ptr, i32 } %57, 1
  store i32 %59, ptr %4, align 4
  br label %189

60:                                               ; preds = %32
  %61 = landingpad { ptr, i32 }
          cleanup
          catch ptr @_ZTISt9exception
  %62 = extractvalue { ptr, i32 } %61, 0
  store ptr %62, ptr %3, align 8
  %63 = extractvalue { ptr, i32 } %61, 1
  store i32 %63, ptr %4, align 4
  br label %95

64:                                               ; preds = %36
  call void @llvm.lifetime.start.p0(i64 32, ptr %9) #8
  %65 = call noundef ptr @_ZNKSt10unique_ptrIN5glimg8ImageSetESt14default_deleteIS1_EEptEv(ptr noundef nonnull align 8 dereferenceable(8) %5) #8
  %66 = load i32, ptr %8, align 4, !tbaa !9
  invoke void @_ZNK5glimg8ImageSet8GetImageEiii(ptr dead_on_unwind writable sret(%"class.glimg::SingleImage") align 8 %9, ptr noundef nonnull align 8 dereferenceable(16) %65, i32 noundef %66, i32 noundef 0, i32 noundef 0)
          to label %67 unwind label %86

67:                                               ; preds = %64
  call void @llvm.lifetime.start.p0(i64 16, ptr %10) #8
  %68 = invoke { i64, i64 } @_ZNK5glimg11SingleImage13GetDimensionsEv(ptr noundef nonnull align 8 dereferenceable(28) %9)
          to label %69 unwind label %90

69:                                               ; preds = %67
  %70 = getelementptr inbounds { i64, i64 }, ptr %10, i32 0, i32 0
  %71 = extractvalue { i64, i64 } %68, 0
  store i64 %71, ptr %70, align 4
  %72 = getelementptr inbounds { i64, i64 }, ptr %10, i32 0, i32 1
  %73 = extractvalue { i64, i64 } %68, 1
  store i64 %73, ptr %72, align 4
  %74 = load ptr, ptr @_funcptr_glTexImage2D, align 8, !tbaa !5
  %75 = load i32, ptr %8, align 4, !tbaa !9
  %76 = getelementptr inbounds %"struct.glimg::Dimensions", ptr %10, i32 0, i32 1
  %77 = load i32, ptr %76, align 4, !tbaa !11
  %78 = getelementptr inbounds %"struct.glimg::Dimensions", ptr %10, i32 0, i32 2
  %79 = load i32, ptr %78, align 4, !tbaa !13
  %80 = invoke noundef ptr @_ZNK5glimg11SingleImage12GetImageDataEv(ptr noundef nonnull align 8 dereferenceable(28) %9)
          to label %81 unwind label %90

81:                                               ; preds = %69
  invoke void %74(i32 noundef 3553, i32 noundef %75, i32 noundef 35905, i32 noundef %77, i32 noundef %79, i32 noundef 0, i32 noundef 32993, i32 noundef 33639, ptr noundef %80)
          to label %82 unwind label %90

82:                                               ; preds = %81
  call void @llvm.lifetime.end.p0(i64 16, ptr %10) #8
  call void @_ZN5glimg11SingleImageD2Ev(ptr noundef nonnull align 8 dereferenceable(28) %9) #8
  call void @llvm.lifetime.end.p0(i64 32, ptr %9) #8
  br label %83

83:                                               ; preds = %82
  %84 = load i32, ptr %8, align 4, !tbaa !9
  %85 = add nsw i32 %84, 1
  store i32 %85, ptr %8, align 4, !tbaa !9
  br label %32, !llvm.loop !14

86:                                               ; preds = %64
  %87 = landingpad { ptr, i32 }
          cleanup
          catch ptr @_ZTISt9exception
  %88 = extractvalue { ptr, i32 } %87, 0
  store ptr %88, ptr %3, align 8
  %89 = extractvalue { ptr, i32 } %87, 1
  store i32 %89, ptr %4, align 4
  br label %94

90:                                               ; preds = %81, %69, %67
  %91 = landingpad { ptr, i32 }
          cleanup
          catch ptr @_ZTISt9exception
  %92 = extractvalue { ptr, i32 } %91, 0
  store ptr %92, ptr %3, align 8
  %93 = extractvalue { ptr, i32 } %91, 1
  store i32 %93, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 16, ptr %10) #8
  call void @_ZN5glimg11SingleImageD2Ev(ptr noundef nonnull align 8 dereferenceable(28) %9) #8
  br label %94

94:                                               ; preds = %90, %86
  call void @llvm.lifetime.end.p0(i64 32, ptr %9) #8
  br label %95

95:                                               ; preds = %94, %60
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #8
  br label %189

96:                                               ; preds = %38
  %97 = load ptr, ptr @_funcptr_glTexParameteri, align 8, !tbaa !5
  invoke void %97(i32 noundef 3553, i32 noundef 33084, i32 noundef 0)
          to label %98 unwind label %56

98:                                               ; preds = %96
  %99 = load ptr, ptr @_funcptr_glTexParameteri, align 8, !tbaa !5
  %100 = call noundef ptr @_ZNKSt10unique_ptrIN5glimg8ImageSetESt14default_deleteIS1_EEptEv(ptr noundef nonnull align 8 dereferenceable(8) %5) #8
  %101 = invoke noundef i32 @_ZNK5glimg8ImageSet14GetMipmapCountEv(ptr noundef nonnull align 8 dereferenceable(16) %100)
          to label %102 unwind label %56

102:                                              ; preds = %98
  %103 = sub nsw i32 %101, 1
  invoke void %99(i32 noundef 3553, i32 noundef 33085, i32 noundef %103)
          to label %104 unwind label %56

104:                                              ; preds = %102
  call void @llvm.lifetime.start.p0(i64 32, ptr %11) #8
  call void @llvm.lifetime.start.p0(i64 32, ptr %12) #8
  call void @llvm.lifetime.start.p0(i64 1, ptr %13) #8
  call void @_ZNSaIcEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %13) #8
  invoke void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_(ptr noundef nonnull align 8 dereferenceable(32) %12, ptr noundef @.str.6, ptr noundef nonnull align 1 dereferenceable(1) %13)
          to label %105 unwind label %124

105:                                              ; preds = %104
  invoke void @_ZStplIcSt11char_traitsIcESaIcEENSt7__cxx1112basic_stringIT_T0_T1_EEOS8_PKS5_(ptr dead_on_unwind writable sret(%"class.std::__cxx11::basic_string") align 8 %11, ptr noundef nonnull align 8 dereferenceable(32) %12, ptr noundef @.str.8)
          to label %106 unwind label %128

106:                                              ; preds = %105
  %107 = call noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEaSEOS4_(ptr noundef nonnull align 8 dereferenceable(32) %1, ptr noundef nonnull align 8 dereferenceable(32) %11) #8
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %11) #8
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %12) #8
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %13) #8
  call void @llvm.lifetime.end.p0(i64 1, ptr %13) #8
  call void @llvm.lifetime.end.p0(i64 32, ptr %12) #8
  call void @llvm.lifetime.end.p0(i64 32, ptr %11) #8
  call void @llvm.lifetime.start.p0(i64 32, ptr %14) #8
  %108 = call noundef ptr @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE5c_strEv(ptr noundef nonnull align 8 dereferenceable(32) %1) #8
  call void @llvm.lifetime.start.p0(i64 1, ptr %15) #8
  call void @_ZNSaIcEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %15) #8
  invoke void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_(ptr noundef nonnull align 8 dereferenceable(32) %14, ptr noundef %108, ptr noundef nonnull align 1 dereferenceable(1) %15)
          to label %109 unwind label %133

109:                                              ; preds = %106
  %110 = invoke noundef ptr @_ZN5glimg7loaders3dds12LoadFromFileERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(ptr noundef nonnull align 8 dereferenceable(32) %14)
          to label %111 unwind label %137

111:                                              ; preds = %109
  call void @_ZNSt10unique_ptrIN5glimg8ImageSetESt14default_deleteIS1_EE5resetEPS1_(ptr noundef nonnull align 8 dereferenceable(8) %5, ptr noundef %110) #8
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %14) #8
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %15) #8
  call void @llvm.lifetime.end.p0(i64 1, ptr %15) #8
  call void @llvm.lifetime.end.p0(i64 32, ptr %14) #8
  %112 = load ptr, ptr @_funcptr_glGenTextures, align 8, !tbaa !5
  invoke void %112(i32 noundef 1, ptr noundef @g_gammaTexture)
          to label %113 unwind label %56

113:                                              ; preds = %111
  %114 = load ptr, ptr @_funcptr_glBindTexture, align 8, !tbaa !5
  %115 = load i32, ptr @g_gammaTexture, align 4, !tbaa !9
  invoke void %114(i32 noundef 3553, i32 noundef %115)
          to label %116 unwind label %56

116:                                              ; preds = %113
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #8
  store i32 0, ptr %16, align 4, !tbaa !9
  br label %117

117:                                              ; preds = %165, %116
  %118 = load i32, ptr %16, align 4, !tbaa !9
  %119 = call noundef ptr @_ZNKSt10unique_ptrIN5glimg8ImageSetESt14default_deleteIS1_EEptEv(ptr noundef nonnull align 8 dereferenceable(8) %5) #8
  %120 = invoke noundef i32 @_ZNK5glimg8ImageSet14GetMipmapCountEv(ptr noundef nonnull align 8 dereferenceable(16) %119)
          to label %121 unwind label %142

121:                                              ; preds = %117
  %122 = icmp slt i32 %118, %120
  br i1 %122, label %146, label %123

123:                                              ; preds = %121
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #8
  br label %178

124:                                              ; preds = %104
  %125 = landingpad { ptr, i32 }
          cleanup
          catch ptr @_ZTISt9exception
  %126 = extractvalue { ptr, i32 } %125, 0
  store ptr %126, ptr %3, align 8
  %127 = extractvalue { ptr, i32 } %125, 1
  store i32 %127, ptr %4, align 4
  br label %132

128:                                              ; preds = %105
  %129 = landingpad { ptr, i32 }
          cleanup
          catch ptr @_ZTISt9exception
  %130 = extractvalue { ptr, i32 } %129, 0
  store ptr %130, ptr %3, align 8
  %131 = extractvalue { ptr, i32 } %129, 1
  store i32 %131, ptr %4, align 4
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %12) #8
  br label %132

132:                                              ; preds = %128, %124
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %13) #8
  call void @llvm.lifetime.end.p0(i64 1, ptr %13) #8
  call void @llvm.lifetime.end.p0(i64 32, ptr %12) #8
  call void @llvm.lifetime.end.p0(i64 32, ptr %11) #8
  br label %189

133:                                              ; preds = %106
  %134 = landingpad { ptr, i32 }
          cleanup
          catch ptr @_ZTISt9exception
  %135 = extractvalue { ptr, i32 } %134, 0
  store ptr %135, ptr %3, align 8
  %136 = extractvalue { ptr, i32 } %134, 1
  store i32 %136, ptr %4, align 4
  br label %141

137:                                              ; preds = %109
  %138 = landingpad { ptr, i32 }
          cleanup
          catch ptr @_ZTISt9exception
  %139 = extractvalue { ptr, i32 } %138, 0
  store ptr %139, ptr %3, align 8
  %140 = extractvalue { ptr, i32 } %138, 1
  store i32 %140, ptr %4, align 4
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %14) #8
  br label %141

141:                                              ; preds = %137, %133
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %15) #8
  call void @llvm.lifetime.end.p0(i64 1, ptr %15) #8
  call void @llvm.lifetime.end.p0(i64 32, ptr %14) #8
  br label %189

142:                                              ; preds = %117
  %143 = landingpad { ptr, i32 }
          cleanup
          catch ptr @_ZTISt9exception
  %144 = extractvalue { ptr, i32 } %143, 0
  store ptr %144, ptr %3, align 8
  %145 = extractvalue { ptr, i32 } %143, 1
  store i32 %145, ptr %4, align 4
  br label %177

146:                                              ; preds = %121
  call void @llvm.lifetime.start.p0(i64 32, ptr %17) #8
  %147 = call noundef ptr @_ZNKSt10unique_ptrIN5glimg8ImageSetESt14default_deleteIS1_EEptEv(ptr noundef nonnull align 8 dereferenceable(8) %5) #8
  %148 = load i32, ptr %16, align 4, !tbaa !9
  invoke void @_ZNK5glimg8ImageSet8GetImageEiii(ptr dead_on_unwind writable sret(%"class.glimg::SingleImage") align 8 %17, ptr noundef nonnull align 8 dereferenceable(16) %147, i32 noundef %148, i32 noundef 0, i32 noundef 0)
          to label %149 unwind label %168

149:                                              ; preds = %146
  call void @llvm.lifetime.start.p0(i64 16, ptr %18) #8
  %150 = invoke { i64, i64 } @_ZNK5glimg11SingleImage13GetDimensionsEv(ptr noundef nonnull align 8 dereferenceable(28) %17)
          to label %151 unwind label %172

151:                                              ; preds = %149
  %152 = getelementptr inbounds { i64, i64 }, ptr %18, i32 0, i32 0
  %153 = extractvalue { i64, i64 } %150, 0
  store i64 %153, ptr %152, align 4
  %154 = getelementptr inbounds { i64, i64 }, ptr %18, i32 0, i32 1
  %155 = extractvalue { i64, i64 } %150, 1
  store i64 %155, ptr %154, align 4
  %156 = load ptr, ptr @_funcptr_glTexImage2D, align 8, !tbaa !5
  %157 = load i32, ptr %16, align 4, !tbaa !9
  %158 = getelementptr inbounds %"struct.glimg::Dimensions", ptr %18, i32 0, i32 1
  %159 = load i32, ptr %158, align 4, !tbaa !11
  %160 = getelementptr inbounds %"struct.glimg::Dimensions", ptr %18, i32 0, i32 2
  %161 = load i32, ptr %160, align 4, !tbaa !13
  %162 = invoke noundef ptr @_ZNK5glimg11SingleImage12GetImageDataEv(ptr noundef nonnull align 8 dereferenceable(28) %17)
          to label %163 unwind label %172

163:                                              ; preds = %151
  invoke void %156(i32 noundef 3553, i32 noundef %157, i32 noundef 35905, i32 noundef %159, i32 noundef %161, i32 noundef 0, i32 noundef 32993, i32 noundef 33639, ptr noundef %162)
          to label %164 unwind label %172

164:                                              ; preds = %163
  call void @llvm.lifetime.end.p0(i64 16, ptr %18) #8
  call void @_ZN5glimg11SingleImageD2Ev(ptr noundef nonnull align 8 dereferenceable(28) %17) #8
  call void @llvm.lifetime.end.p0(i64 32, ptr %17) #8
  br label %165

165:                                              ; preds = %164
  %166 = load i32, ptr %16, align 4, !tbaa !9
  %167 = add nsw i32 %166, 1
  store i32 %167, ptr %16, align 4, !tbaa !9
  br label %117, !llvm.loop !16

168:                                              ; preds = %146
  %169 = landingpad { ptr, i32 }
          cleanup
          catch ptr @_ZTISt9exception
  %170 = extractvalue { ptr, i32 } %169, 0
  store ptr %170, ptr %3, align 8
  %171 = extractvalue { ptr, i32 } %169, 1
  store i32 %171, ptr %4, align 4
  br label %176

172:                                              ; preds = %163, %151, %149
  %173 = landingpad { ptr, i32 }
          cleanup
          catch ptr @_ZTISt9exception
  %174 = extractvalue { ptr, i32 } %173, 0
  store ptr %174, ptr %3, align 8
  %175 = extractvalue { ptr, i32 } %173, 1
  store i32 %175, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 16, ptr %18) #8
  call void @_ZN5glimg11SingleImageD2Ev(ptr noundef nonnull align 8 dereferenceable(28) %17) #8
  br label %176

176:                                              ; preds = %172, %168
  call void @llvm.lifetime.end.p0(i64 32, ptr %17) #8
  br label %177

177:                                              ; preds = %176, %142
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #8
  br label %189

178:                                              ; preds = %123
  %179 = load ptr, ptr @_funcptr_glTexParameteri, align 8, !tbaa !5
  invoke void %179(i32 noundef 3553, i32 noundef 33084, i32 noundef 0)
          to label %180 unwind label %56

180:                                              ; preds = %178
  %181 = load ptr, ptr @_funcptr_glTexParameteri, align 8, !tbaa !5
  %182 = call noundef ptr @_ZNKSt10unique_ptrIN5glimg8ImageSetESt14default_deleteIS1_EEptEv(ptr noundef nonnull align 8 dereferenceable(8) %5) #8
  %183 = invoke noundef i32 @_ZNK5glimg8ImageSet14GetMipmapCountEv(ptr noundef nonnull align 8 dereferenceable(16) %182)
          to label %184 unwind label %56

184:                                              ; preds = %180
  %185 = sub nsw i32 %183, 1
  invoke void %181(i32 noundef 3553, i32 noundef 33085, i32 noundef %185)
          to label %186 unwind label %56

186:                                              ; preds = %184
  %187 = load ptr, ptr @_funcptr_glBindTexture, align 8, !tbaa !5
  invoke void %187(i32 noundef 3553, i32 noundef 0)
          to label %188 unwind label %56

188:                                              ; preds = %186
  call void @_ZNSt10unique_ptrIN5glimg8ImageSetESt14default_deleteIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %5) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #8
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %1) #8
  call void @llvm.lifetime.end.p0(i64 32, ptr %1) #8
  br label %212

189:                                              ; preds = %177, %141, %132, %95, %56
  call void @_ZNSt10unique_ptrIN5glimg8ImageSetESt14default_deleteIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %5) #8
  br label %190

190:                                              ; preds = %189, %55
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #8
  br label %191

191:                                              ; preds = %190, %43
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %1) #8
  br label %192

192:                                              ; preds = %191, %39
  call void @llvm.lifetime.end.p0(i64 32, ptr %1) #8
  br label %193

193:                                              ; preds = %192
  %194 = load i32, ptr %4, align 4
  %195 = call i32 @llvm.eh.typeid.for.p0(ptr @_ZTISt9exception) #8
  %196 = icmp eq i32 %194, %195
  br i1 %196, label %197, label %213

197:                                              ; preds = %193
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #8
  %198 = load ptr, ptr %3, align 8
  %199 = call ptr @__cxa_begin_catch(ptr %198) #8
  store ptr %199, ptr %19, align 8
  %200 = load ptr, ptr %19, align 8, !tbaa !5
  %201 = load ptr, ptr %200, align 8, !tbaa !17
  %202 = getelementptr inbounds ptr, ptr %201, i64 2
  %203 = load ptr, ptr %202, align 8
  %204 = call noundef ptr %203(ptr noundef nonnull align 8 dereferenceable(8) %200) #8
  %205 = invoke i32 (ptr, ...) @printf(ptr noundef @.str.9, ptr noundef %204)
          to label %206 unwind label %207

206:                                              ; preds = %197
  invoke void @__cxa_rethrow() #9
          to label %221 unwind label %207

207:                                              ; preds = %206, %197
  %208 = landingpad { ptr, i32 }
          cleanup
  %209 = extractvalue { ptr, i32 } %208, 0
  store ptr %209, ptr %3, align 8
  %210 = extractvalue { ptr, i32 } %208, 1
  store i32 %210, ptr %4, align 4
  invoke void @__cxa_end_catch()
          to label %211 unwind label %218

211:                                              ; preds = %207
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #8
  br label %213

212:                                              ; preds = %188
  ret void

213:                                              ; preds = %211, %193
  %214 = load ptr, ptr %3, align 8
  %215 = load i32, ptr %4, align 4
  %216 = insertvalue { ptr, i32 } poison, ptr %214, 0
  %217 = insertvalue { ptr, i32 } %216, i32 %215, 1
  resume { ptr, i32 } %217

218:                                              ; preds = %207
  %219 = landingpad { ptr, i32 }
          catch ptr null
  %220 = extractvalue { ptr, i32 } %219, 0
  call void @__clang_call_terminate(ptr %220) #10
  unreachable

221:                                              ; preds = %206
  unreachable
}

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEpLEPKc(ptr noundef nonnull align 8 dereferenceable(32), ptr noundef) #2 align 2

declare noundef ptr @_ZN5glimg7loaders3dds12LoadFromFileERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(ptr noundef nonnull align 8 dereferenceable(32)) #3

; Function Attrs: mustprogress nounwind uwtable
declare noundef ptr @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE5c_strEv(ptr noundef nonnull align 8 dereferenceable(32)) #1 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt10unique_ptrIN5glimg8ImageSetESt14default_deleteIS1_EEC2IS3_vEEPS1_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) unnamed_addr #1 align 2

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

declare noundef i32 @_ZNK5glimg8ImageSet14GetMipmapCountEv(ptr noundef nonnull align 8 dereferenceable(16)) #3

declare void @_ZNK5glimg8ImageSet8GetImageEiii(ptr dead_on_unwind writable sret(%"class.glimg::SingleImage") align 8, ptr noundef nonnull align 8 dereferenceable(16), i32 noundef, i32 noundef, i32 noundef) #3

declare { i64, i64 } @_ZNK5glimg11SingleImage13GetDimensionsEv(ptr noundef nonnull align 8 dereferenceable(28)) #3

declare noundef ptr @_ZNK5glimg11SingleImage12GetImageDataEv(ptr noundef nonnull align 8 dereferenceable(28)) #3

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZStplIcSt11char_traitsIcESaIcEENSt7__cxx1112basic_stringIT_T0_T1_EEOS8_PKS5_(ptr dead_on_unwind noalias writable sret(%"class.std::__cxx11::basic_string") align 8, ptr noundef nonnull align 8 dereferenceable(32), ptr noundef) #5

; Function Attrs: mustprogress nounwind uwtable
declare noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEaSEOS4_(ptr noundef nonnull align 8 dereferenceable(32), ptr noundef nonnull align 8 dereferenceable(32)) #1 align 2

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

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

; Function Attrs: nounwind memory(none)
declare i32 @llvm.eh.typeid.for.p0(ptr) #6

declare ptr @__cxa_begin_catch(ptr)

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

declare void @__cxa_rethrow()

declare void @__cxa_end_catch()

; Function Attrs: noinline noreturn nounwind uwtable
declare hidden void @__clang_call_terminate(ptr noundef) #7

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

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { "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 = { 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 #5 = { 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 #6 = { nounwind memory(none) }
attributes #7 = { noinline noreturn nounwind uwtable "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 #8 = { nounwind }
attributes #9 = { noreturn }
attributes #10 = { noreturn 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 4}
!12 = !{!"_ZTSN5glimg10DimensionsE", !10, i64 0, !10, i64 4, !10, i64 8, !10, i64 12}
!13 = !{!12, !10, i64 8}
!14 = distinct !{!14, !15}
!15 = !{!"llvm.loop.mustprogress"}
!16 = distinct !{!16, !15}
!17 = !{!18, !18, i64 0}
!18 = !{!"vtable pointer", !8, i64 0}


; 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.std::__cxx11::basic_string" = type { %"struct.std::__cxx11::basic_string<char>::_Alloc_hider", i64, %union.anon }
%"struct.std::__cxx11::basic_string<char>::_Alloc_hider" = type { ptr }
%union.anon = type { i64, [8 x i8] }
%"class.std::allocator.0" = type { i8 }
%"class.std::unique_ptr" = type { %"struct.std::__uniq_ptr_data" }
%"struct.std::__uniq_ptr_data" = type { %"class.std::__uniq_ptr_impl" }
%"class.std::__uniq_ptr_impl" = type { %"class.std::tuple" }
%"class.std::tuple" = type { %"struct.std::_Tuple_impl" }
%"struct.std::_Tuple_impl" = type { %"struct.std::_Head_base.4" }
%"struct.std::_Head_base.4" = type { ptr }
%"class.glimg::SingleImage" = type <{ %"class.std::shared_ptr", i32, i32, i32, [4 x i8] }>
%"class.std::shared_ptr" = type { %"class.std::__shared_ptr" }
%"class.std::__shared_ptr" = type { ptr, %"class.std::__shared_count" }
%"class.std::__shared_count" = type { ptr }

@g_linearTexture = external dso_local global i32, align 4
@g_gammaTexture = external dso_local global i32, align 4
@_ZTISt9exception = external constant ptr
@.str.6 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [19 x i8], align 1
@_funcptr_glGenTextures = external local_unnamed_addr global ptr, align 8
@_funcptr_glBindTexture = external local_unnamed_addr global ptr, align 8
@_funcptr_glTexImage2D = external local_unnamed_addr global ptr, align 8
@_funcptr_glTexParameteri = external local_unnamed_addr global ptr, align 8
@.str.8 = external hidden unnamed_addr constant [18 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [4 x i8], align 1

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

declare i32 @__gxx_personality_v0(...)

; 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 nounwind uwtable
declare void @_ZNSaIcEC2Ev(ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #1 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_(ptr noundef nonnull align 8 dereferenceable(32), ptr noundef, ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #2 align 2

; Function Attrs: mustprogress nounwind uwtable
declare void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32)) unnamed_addr #1 align 2

; Function Attrs: mustprogress uwtable
define dso_local void @_Z19LoadCheckerTexturesv() local_unnamed_addr #2 personality ptr @__gxx_personality_v0 {
  %1 = alloca %"class.std::__cxx11::basic_string", align 8
  %2 = alloca %"class.std::allocator.0", align 1
  %3 = alloca %"class.std::unique_ptr", align 8
  %4 = alloca %"class.std::__cxx11::basic_string", align 8
  %5 = alloca %"class.std::allocator.0", align 1
  %6 = alloca %"class.glimg::SingleImage", align 8
  %7 = alloca %"class.std::__cxx11::basic_string", align 8
  %8 = alloca %"class.std::__cxx11::basic_string", align 8
  %9 = alloca %"class.std::allocator.0", align 1
  %10 = alloca %"class.std::__cxx11::basic_string", align 8
  %11 = alloca %"class.std::allocator.0", align 1
  %12 = alloca %"class.glimg::SingleImage", align 8
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %1) #9
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %2) #9
  call void @_ZNSaIcEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %2) #9
  invoke void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_(ptr noundef nonnull align 8 dereferenceable(32) %1, ptr noundef nonnull @.str.6, ptr noundef nonnull align 1 dereferenceable(1) %2)
          to label %13 unwind label %30

13:                                               ; preds = %0
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %2) #9
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %2) #9
  %14 = invoke noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEpLEPKc(ptr noundef nonnull align 8 dereferenceable(32) %1, ptr noundef nonnull @.str.7)
          to label %15 unwind label %32

15:                                               ; preds = %13
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #9
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %4) #9
  %16 = call noundef ptr @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE5c_strEv(ptr noundef nonnull align 8 dereferenceable(32) %1) #9
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %5) #9
  call void @_ZNSaIcEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %5) #9
  invoke void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_(ptr noundef nonnull align 8 dereferenceable(32) %4, ptr noundef %16, ptr noundef nonnull align 1 dereferenceable(1) %5)
          to label %17 unwind label %34

17:                                               ; preds = %15
  %18 = invoke noundef ptr @_ZN5glimg7loaders3dds12LoadFromFileERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(ptr noundef nonnull align 8 dereferenceable(32) %4)
          to label %19 unwind label %36

19:                                               ; preds = %17
  call void @_ZNSt10unique_ptrIN5glimg8ImageSetESt14default_deleteIS1_EEC2IS3_vEEPS1_(ptr noundef nonnull align 8 dereferenceable(8) %3, ptr noundef %18) #9
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %4) #9
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %5) #9
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %5) #9
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %4) #9
  %20 = load ptr, ptr @_funcptr_glGenTextures, align 8, !tbaa !5
  invoke void %20(i32 noundef 1, ptr noundef nonnull @g_linearTexture)
          to label %21 unwind label %39

21:                                               ; preds = %19
  %22 = load ptr, ptr @_funcptr_glBindTexture, align 8, !tbaa !5
  %23 = load i32, ptr @g_linearTexture, align 4, !tbaa !9
  invoke void %22(i32 noundef 3553, i32 noundef %23)
          to label %.preheader43 unwind label %39

.preheader43:                                     ; preds = %21, %53
  %.026 = phi i32 [ %54, %53 ], [ 0, %21 ]
  %24 = call noundef ptr @_ZNKSt10unique_ptrIN5glimg8ImageSetESt14default_deleteIS1_EEptEv(ptr noundef nonnull align 8 dereferenceable(8) %3) #9
  %25 = invoke noundef i32 @_ZNK5glimg8ImageSet14GetMipmapCountEv(ptr noundef nonnull align 8 dereferenceable(16) %24)
          to label %26 unwind label %41

26:                                               ; preds = %.preheader43
  %27 = icmp slt i32 %.026, %25
  br i1 %27, label %43, label %28

28:                                               ; preds = %26
  %29 = load ptr, ptr @_funcptr_glTexParameteri, align 8, !tbaa !5
  invoke void %29(i32 noundef 3553, i32 noundef 33084, i32 noundef 0)
          to label %60 unwind label %39

30:                                               ; preds = %0
  %31 = landingpad { ptr, i32 }
          cleanup
          catch ptr @_ZTISt9exception
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %2) #9
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %2) #9
  br label %125

32:                                               ; preds = %13
  %33 = landingpad { ptr, i32 }
          cleanup
          catch ptr @_ZTISt9exception
  br label %124

34:                                               ; preds = %15
  %35 = landingpad { ptr, i32 }
          cleanup
          catch ptr @_ZTISt9exception
  br label %38

36:                                               ; preds = %17
  %37 = landingpad { ptr, i32 }
          cleanup
          catch ptr @_ZTISt9exception
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %4) #9
  br label %38

38:                                               ; preds = %36, %34
  %.pn = phi { ptr, i32 } [ %37, %36 ], [ %35, %34 ]
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %5) #9
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %5) #9
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %4) #9
  br label %123

39:                                               ; preds = %119, %117, %113, %82, %75, %73, %64, %60, %28, %21, %19
  %40 = landingpad { ptr, i32 }
          cleanup
          catch ptr @_ZTISt9exception
  br label %122

41:                                               ; preds = %.preheader43
  %42 = landingpad { ptr, i32 }
          cleanup
          catch ptr @_ZTISt9exception
  br label %122

43:                                               ; preds = %26
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %6) #9
  %44 = call noundef ptr @_ZNKSt10unique_ptrIN5glimg8ImageSetESt14default_deleteIS1_EEptEv(ptr noundef nonnull align 8 dereferenceable(8) %3) #9
  invoke void @_ZNK5glimg8ImageSet8GetImageEiii(ptr dead_on_unwind nonnull writable sret(%"class.glimg::SingleImage") align 8 %6, ptr noundef nonnull align 8 dereferenceable(16) %44, i32 noundef %.026, i32 noundef 0, i32 noundef 0)
          to label %45 unwind label %55

45:                                               ; preds = %43
  %46 = invoke { i64, i64 } @_ZNK5glimg11SingleImage13GetDimensionsEv(ptr noundef nonnull align 8 dereferenceable(28) %6)
          to label %47 unwind label %57

47:                                               ; preds = %45
  %48 = load ptr, ptr @_funcptr_glTexImage2D, align 8, !tbaa !5
  %49 = invoke noundef ptr @_ZNK5glimg11SingleImage12GetImageDataEv(ptr noundef nonnull align 8 dereferenceable(28) %6)
          to label %50 unwind label %57

50:                                               ; preds = %47
  %51 = extractvalue { i64, i64 } %46, 1
  %.sroa.55.8.extract.trunc = trunc i64 %51 to i32
  %52 = extractvalue { i64, i64 } %46, 0
  %.sroa.04.4.extract.shift = lshr i64 %52, 32
  %.sroa.04.4.extract.trunc = trunc nuw i64 %.sroa.04.4.extract.shift to i32
  invoke void %48(i32 noundef 3553, i32 noundef %.026, i32 noundef 35905, i32 noundef %.sroa.04.4.extract.trunc, i32 noundef %.sroa.55.8.extract.trunc, i32 noundef 0, i32 noundef 32993, i32 noundef 33639, ptr noundef %49)
          to label %53 unwind label %57

53:                                               ; preds = %50
  call void @_ZN5glimg11SingleImageD2Ev(ptr noundef nonnull align 8 dereferenceable(28) %6) #9
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %6) #9
  %54 = add nuw nsw i32 %.026, 1
  br label %.preheader43, !llvm.loop !11

55:                                               ; preds = %43
  %56 = landingpad { ptr, i32 }
          cleanup
          catch ptr @_ZTISt9exception
  br label %59

57:                                               ; preds = %50, %47, %45
  %58 = landingpad { ptr, i32 }
          cleanup
          catch ptr @_ZTISt9exception
  call void @_ZN5glimg11SingleImageD2Ev(ptr noundef nonnull align 8 dereferenceable(28) %6) #9
  br label %59

59:                                               ; preds = %57, %55
  %.pn36 = phi { ptr, i32 } [ %58, %57 ], [ %56, %55 ]
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %6) #9
  br label %122

60:                                               ; preds = %28
  %61 = load ptr, ptr @_funcptr_glTexParameteri, align 8, !tbaa !5
  %62 = call noundef ptr @_ZNKSt10unique_ptrIN5glimg8ImageSetESt14default_deleteIS1_EEptEv(ptr noundef nonnull align 8 dereferenceable(8) %3) #9
  %63 = invoke noundef i32 @_ZNK5glimg8ImageSet14GetMipmapCountEv(ptr noundef nonnull align 8 dereferenceable(16) %62)
          to label %64 unwind label %39

64:                                               ; preds = %60
  %65 = add nsw i32 %63, -1
  invoke void %61(i32 noundef 3553, i32 noundef 33085, i32 noundef %65)
          to label %66 unwind label %39

66:                                               ; preds = %64
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %7) #9
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %8) #9
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %9) #9
  call void @_ZNSaIcEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %9) #9
  invoke void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_(ptr noundef nonnull align 8 dereferenceable(32) %8, ptr noundef nonnull @.str.6, ptr noundef nonnull align 1 dereferenceable(1) %9)
          to label %67 unwind label %84

67:                                               ; preds = %66
  invoke void @_ZStplIcSt11char_traitsIcESaIcEENSt7__cxx1112basic_stringIT_T0_T1_EEOS8_PKS5_(ptr dead_on_unwind nonnull writable sret(%"class.std::__cxx11::basic_string") align 8 %7, ptr noundef nonnull align 8 dereferenceable(32) %8, ptr noundef nonnull @.str.8)
          to label %68 unwind label %86

68:                                               ; preds = %67
  %69 = call noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEaSEOS4_(ptr noundef nonnull align 8 dereferenceable(32) %1, ptr noundef nonnull align 8 dereferenceable(32) %7) #9
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %7) #9
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %8) #9
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %9) #9
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %9) #9
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %8) #9
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %7) #9
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %10) #9
  %70 = call noundef ptr @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE5c_strEv(ptr noundef nonnull align 8 dereferenceable(32) %1) #9
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %11) #9
  call void @_ZNSaIcEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %11) #9
  invoke void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_(ptr noundef nonnull align 8 dereferenceable(32) %10, ptr noundef %70, ptr noundef nonnull align 1 dereferenceable(1) %11)
          to label %71 unwind label %89

71:                                               ; preds = %68
  %72 = invoke noundef ptr @_ZN5glimg7loaders3dds12LoadFromFileERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(ptr noundef nonnull align 8 dereferenceable(32) %10)
          to label %73 unwind label %91

73:                                               ; preds = %71
  call void @_ZNSt10unique_ptrIN5glimg8ImageSetESt14default_deleteIS1_EE5resetEPS1_(ptr noundef nonnull align 8 dereferenceable(8) %3, ptr noundef %72) #9
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %10) #9
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %11) #9
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %11) #9
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %10) #9
  %74 = load ptr, ptr @_funcptr_glGenTextures, align 8, !tbaa !5
  invoke void %74(i32 noundef 1, ptr noundef nonnull @g_gammaTexture)
          to label %75 unwind label %39

75:                                               ; preds = %73
  %76 = load ptr, ptr @_funcptr_glBindTexture, align 8, !tbaa !5
  %77 = load i32, ptr @g_gammaTexture, align 4, !tbaa !9
  invoke void %76(i32 noundef 3553, i32 noundef %77)
          to label %.preheader unwind label %39

.preheader:                                       ; preds = %75, %106
  %.027 = phi i32 [ %107, %106 ], [ 0, %75 ]
  %78 = call noundef ptr @_ZNKSt10unique_ptrIN5glimg8ImageSetESt14default_deleteIS1_EEptEv(ptr noundef nonnull align 8 dereferenceable(8) %3) #9
  %79 = invoke noundef i32 @_ZNK5glimg8ImageSet14GetMipmapCountEv(ptr noundef nonnull align 8 dereferenceable(16) %78)
          to label %80 unwind label %94

80:                                               ; preds = %.preheader
  %81 = icmp slt i32 %.027, %79
  br i1 %81, label %96, label %82

82:                                               ; preds = %80
  %83 = load ptr, ptr @_funcptr_glTexParameteri, align 8, !tbaa !5
  invoke void %83(i32 noundef 3553, i32 noundef 33084, i32 noundef 0)
          to label %113 unwind label %39

84:                                               ; preds = %66
  %85 = landingpad { ptr, i32 }
          cleanup
          catch ptr @_ZTISt9exception
  br label %88

86:                                               ; preds = %67
  %87 = landingpad { ptr, i32 }
          cleanup
          catch ptr @_ZTISt9exception
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %8) #9
  br label %88

88:                                               ; preds = %86, %84
  %.pn29 = phi { ptr, i32 } [ %87, %86 ], [ %85, %84 ]
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %9) #9
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %9) #9
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %8) #9
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %7) #9
  br label %122

89:                                               ; preds = %68
  %90 = landingpad { ptr, i32 }
          cleanup
          catch ptr @_ZTISt9exception
  br label %93

91:                                               ; preds = %71
  %92 = landingpad { ptr, i32 }
          cleanup
          catch ptr @_ZTISt9exception
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %10) #9
  br label %93

93:                                               ; preds = %91, %89
  %.pn31 = phi { ptr, i32 } [ %92, %91 ], [ %90, %89 ]
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %11) #9
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %11) #9
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %10) #9
  br label %122

94:                                               ; preds = %.preheader
  %95 = landingpad { ptr, i32 }
          cleanup
          catch ptr @_ZTISt9exception
  br label %122

96:                                               ; preds = %80
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %12) #9
  %97 = call noundef ptr @_ZNKSt10unique_ptrIN5glimg8ImageSetESt14default_deleteIS1_EEptEv(ptr noundef nonnull align 8 dereferenceable(8) %3) #9
  invoke void @_ZNK5glimg8ImageSet8GetImageEiii(ptr dead_on_unwind nonnull writable sret(%"class.glimg::SingleImage") align 8 %12, ptr noundef nonnull align 8 dereferenceable(16) %97, i32 noundef %.027, i32 noundef 0, i32 noundef 0)
          to label %98 unwind label %108

98:                                               ; preds = %96
  %99 = invoke { i64, i64 } @_ZNK5glimg11SingleImage13GetDimensionsEv(ptr noundef nonnull align 8 dereferenceable(28) %12)
          to label %100 unwind label %110

100:                                              ; preds = %98
  %101 = load ptr, ptr @_funcptr_glTexImage2D, align 8, !tbaa !5
  %102 = invoke noundef ptr @_ZNK5glimg11SingleImage12GetImageDataEv(ptr noundef nonnull align 8 dereferenceable(28) %12)
          to label %103 unwind label %110

103:                                              ; preds = %100
  %104 = extractvalue { i64, i64 } %99, 1
  %.sroa.5.8.extract.trunc = trunc i64 %104 to i32
  %105 = extractvalue { i64, i64 } %99, 0
  %.sroa.0.4.extract.shift = lshr i64 %105, 32
  %.sroa.0.4.extract.trunc = trunc nuw i64 %.sroa.0.4.extract.shift to i32
  invoke void %101(i32 noundef 3553, i32 noundef %.027, i32 noundef 35905, i32 noundef %.sroa.0.4.extract.trunc, i32 noundef %.sroa.5.8.extract.trunc, i32 noundef 0, i32 noundef 32993, i32 noundef 33639, ptr noundef %102)
          to label %106 unwind label %110

106:                                              ; preds = %103
  call void @_ZN5glimg11SingleImageD2Ev(ptr noundef nonnull align 8 dereferenceable(28) %12) #9
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %12) #9
  %107 = add nuw nsw i32 %.027, 1
  br label %.preheader, !llvm.loop !13

108:                                              ; preds = %96
  %109 = landingpad { ptr, i32 }
          cleanup
          catch ptr @_ZTISt9exception
  br label %112

110:                                              ; preds = %103, %100, %98
  %111 = landingpad { ptr, i32 }
          cleanup
          catch ptr @_ZTISt9exception
  call void @_ZN5glimg11SingleImageD2Ev(ptr noundef nonnull align 8 dereferenceable(28) %12) #9
  br label %112

112:                                              ; preds = %110, %108
  %.pn33 = phi { ptr, i32 } [ %111, %110 ], [ %109, %108 ]
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %12) #9
  br label %122

113:                                              ; preds = %82
  %114 = load ptr, ptr @_funcptr_glTexParameteri, align 8, !tbaa !5
  %115 = call noundef ptr @_ZNKSt10unique_ptrIN5glimg8ImageSetESt14default_deleteIS1_EEptEv(ptr noundef nonnull align 8 dereferenceable(8) %3) #9
  %116 = invoke noundef i32 @_ZNK5glimg8ImageSet14GetMipmapCountEv(ptr noundef nonnull align 8 dereferenceable(16) %115)
          to label %117 unwind label %39

117:                                              ; preds = %113
  %118 = add nsw i32 %116, -1
  invoke void %114(i32 noundef 3553, i32 noundef 33085, i32 noundef %118)
          to label %119 unwind label %39

119:                                              ; preds = %117
  %120 = load ptr, ptr @_funcptr_glBindTexture, align 8, !tbaa !5
  invoke void %120(i32 noundef 3553, i32 noundef 0)
          to label %121 unwind label %39

121:                                              ; preds = %119
  call void @_ZNSt10unique_ptrIN5glimg8ImageSetESt14default_deleteIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %3) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #9
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %1) #9
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %1) #9
  ret void

122:                                              ; preds = %94, %112, %41, %59, %93, %88, %39
  %.pn36.pn.pn = phi { ptr, i32 } [ %40, %39 ], [ %.pn31, %93 ], [ %.pn29, %88 ], [ %.pn36, %59 ], [ %42, %41 ], [ %.pn33, %112 ], [ %95, %94 ]
  call void @_ZNSt10unique_ptrIN5glimg8ImageSetESt14default_deleteIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %3) #9
  br label %123

123:                                              ; preds = %122, %38
  %.pn36.pn.pn.pn = phi { ptr, i32 } [ %.pn36.pn.pn, %122 ], [ %.pn, %38 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #9
  br label %124

124:                                              ; preds = %123, %32
  %.pn36.pn.pn.pn.pn = phi { ptr, i32 } [ %.pn36.pn.pn.pn, %123 ], [ %33, %32 ]
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %1) #9
  br label %125

125:                                              ; preds = %124, %30
  %.pn36.pn.pn.pn.pn.pn = phi { ptr, i32 } [ %.pn36.pn.pn.pn.pn, %124 ], [ %31, %30 ]
  %.1024 = extractvalue { ptr, i32 } %.pn36.pn.pn.pn.pn.pn, 1
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %1) #9
  %126 = call i32 @llvm.eh.typeid.for.p0(ptr nonnull @_ZTISt9exception) #9
  %127 = icmp eq i32 %.1024, %126
  br i1 %127, label %128, label %137

128:                                              ; preds = %125
  %.10 = extractvalue { ptr, i32 } %.pn36.pn.pn.pn.pn.pn, 0
  %129 = call ptr @__cxa_begin_catch(ptr %.10) #9
  %130 = load ptr, ptr %129, align 8, !tbaa !14
  %131 = getelementptr inbounds i8, ptr %130, i64 16
  %132 = load ptr, ptr %131, align 8
  %133 = call noundef ptr %132(ptr noundef nonnull align 8 dereferenceable(8) %129) #9
  %134 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.9, ptr noundef %133)
  invoke void @__cxa_rethrow() #10
          to label %141 unwind label %135

135:                                              ; preds = %128
  %136 = landingpad { ptr, i32 }
          cleanup
  invoke void @__cxa_end_catch()
          to label %137 unwind label %138

137:                                              ; preds = %135, %125
  %.merged = phi { ptr, i32 } [ %.pn36.pn.pn.pn.pn.pn, %125 ], [ %136, %135 ]
  resume { ptr, i32 } %.merged

138:                                              ; preds = %135
  %139 = landingpad { ptr, i32 }
          catch ptr null
  %140 = extractvalue { ptr, i32 } %139, 0
  call void @__clang_call_terminate(ptr %140) #11
  unreachable

141:                                              ; preds = %128
  unreachable
}

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEpLEPKc(ptr noundef nonnull align 8 dereferenceable(32), ptr noundef) local_unnamed_addr #2 align 2

declare noundef ptr @_ZN5glimg7loaders3dds12LoadFromFileERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(ptr noundef nonnull align 8 dereferenceable(32)) local_unnamed_addr #3

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt10unique_ptrIN5glimg8ImageSetESt14default_deleteIS1_EEC2IS3_vEEPS1_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) unnamed_addr #1 align 2

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

declare noundef i32 @_ZNK5glimg8ImageSet14GetMipmapCountEv(ptr noundef nonnull align 8 dereferenceable(16)) local_unnamed_addr #3

declare void @_ZNK5glimg8ImageSet8GetImageEiii(ptr dead_on_unwind writable sret(%"class.glimg::SingleImage") align 8, ptr noundef nonnull align 8 dereferenceable(16), i32 noundef, i32 noundef, i32 noundef) local_unnamed_addr #3

declare { i64, i64 } @_ZNK5glimg11SingleImage13GetDimensionsEv(ptr noundef nonnull align 8 dereferenceable(28)) local_unnamed_addr #3

declare noundef ptr @_ZNK5glimg11SingleImage12GetImageDataEv(ptr noundef nonnull align 8 dereferenceable(28)) local_unnamed_addr #3

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZStplIcSt11char_traitsIcESaIcEENSt7__cxx1112basic_stringIT_T0_T1_EEOS8_PKS5_(ptr dead_on_unwind noalias writable sret(%"class.std::__cxx11::basic_string") align 8, ptr noundef nonnull align 8 dereferenceable(32), ptr noundef) local_unnamed_addr #5

; Function Attrs: mustprogress nounwind uwtable
declare noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEaSEOS4_(ptr noundef nonnull align 8 dereferenceable(32), ptr noundef nonnull align 8 dereferenceable(32)) local_unnamed_addr #1 align 2

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

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

; Function Attrs: nofree nosync nounwind memory(none)
declare i32 @llvm.eh.typeid.for.p0(ptr) #6

declare ptr @__cxa_begin_catch(ptr) local_unnamed_addr

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

declare void @__cxa_rethrow() local_unnamed_addr

declare void @__cxa_end_catch() local_unnamed_addr

; Function Attrs: noinline noreturn nounwind uwtable
declare hidden void @__clang_call_terminate(ptr noundef) local_unnamed_addr #8

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

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { "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 = { 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 #5 = { 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 #6 = { nofree nosync nounwind memory(none) }
attributes #7 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #8 = { noinline noreturn nounwind uwtable "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 #9 = { nounwind }
attributes #10 = { noreturn }
attributes #11 = { noreturn 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 = distinct !{!13, !12}
!14 = !{!15, !15, i64 0}
!15 = !{!"vtable pointer", !8, i64 0}


; Effective O3 passes: GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,LoopSimplifyPass,LoopUnrollPass,SROAPass,SimplifyCFGPass