; LLVM IR from ronan-kerviche/glip-lib :: GLIP-Lib/src/Modules (ImageBuffer)

; 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" = type { i8 }
%"class.Glip::Modules::ImageBuffer" = type { %"class.Glip::CoreGL::HdlAbstractTextureFormat.base", ptr, ptr }
%"class.Glip::CoreGL::HdlAbstractTextureFormat.base" = type <{ ptr, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32 }>
%"struct.Glip::CoreGL::HdlTextureFormatDescriptor" = type { i32, i32, i32, i32, i32, [4 x i32], [4 x i32], [4 x i32], i8, i8, i8 }

@.str.3 = external hidden unnamed_addr constant [94 x i8], align 1
@_ZTIN4Glip9ExceptionE = external constant ptr
@.str.5 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [76 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [90 x i8], align 1
@__glewGenerateMipmap = external global ptr, align 8

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

; Function Attrs: 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

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 @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32)) unnamed_addr #1 align 2

declare noundef i32 @_ZNK4Glip6CoreGL24HdlAbstractTextureFormat10getGLDepthEv(ptr noundef nonnull align 8 dereferenceable(52)) #3

declare noundef i32 @_ZNK4Glip6CoreGL24HdlAbstractTextureFormat8getWidthEv(ptr noundef nonnull align 8 dereferenceable(52)) #3

declare noundef i32 @_ZNK4Glip6CoreGL24HdlAbstractTextureFormat9getHeightEv(ptr noundef nonnull align 8 dereferenceable(52)) #3

declare noundef zeroext i1 @_ZNK4Glip6CoreGL24HdlAbstractTextureFormat16isCompatibleWithERKS1_(ptr noundef nonnull align 8 dereferenceable(52), ptr noundef nonnull align 8 dereferenceable(52)) #3

declare ptr @__cxa_allocate_exception(i64)

declare void @_ZN4Glip9ExceptionC1ERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEES6_iRKNS0_4TypeE(ptr noundef nonnull align 8 dereferenceable(152), ptr noundef nonnull align 8 dereferenceable(32), ptr noundef, i32 noundef, ptr noundef nonnull align 4 dereferenceable(4)) unnamed_addr #3

; Function Attrs: nounwind
declare void @_ZN4Glip9ExceptionD1Ev(ptr noundef nonnull align 8 dereferenceable(152)) unnamed_addr #4

declare void @__cxa_throw(ptr, ptr, ptr)

declare void @__cxa_free_exception(ptr)

declare void @_ZN4Glip6CoreGL10HdlTexture4bindEj(ptr noundef nonnull align 8 dereferenceable(57), i32 noundef) #3

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

declare noundef i32 @_ZNK4Glip6CoreGL24HdlAbstractTextureFormat12getAlignmentEv(ptr noundef nonnull align 8 dereferenceable(52)) #3

declare i32 @glGetError() #3

; 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: inlinehint mustprogress uwtable
declare dso_local void @_ZStplIcSt11char_traitsIcESaIcEENSt7__cxx1112basic_stringIT_T0_T1_EEPKS5_OS8_(ptr dead_on_unwind noalias writable sret(%"class.std::__cxx11::basic_string") align 8, ptr noundef, ptr noundef nonnull align 8 dereferenceable(32)) #5

; Function Attrs: nounwind
declare void @_ZN4Glip6CoreGL17getGLEnumNameSafeB5cxx11ERKj(ptr dead_on_unwind writable sret(%"class.std::__cxx11::basic_string") align 8, ptr noundef nonnull align 4 dereferenceable(4)) #4

declare void @_ZN4Glip6CoreGL10HdlTexture6unbindEj(i32 noundef) #3

declare noundef i32 @_ZNK4Glip6CoreGL24HdlAbstractTextureFormat12getMinFilterEv(ptr noundef nonnull align 8 dereferenceable(52)) #3

declare noundef i32 @_ZNK4Glip6CoreGL24HdlAbstractTextureFormat12getMagFilterEv(ptr noundef nonnull align 8 dereferenceable(52)) #3

declare noundef i32 @_ZNK4Glip6CoreGL24HdlAbstractTextureFormat12getSWrappingEv(ptr noundef nonnull align 8 dereferenceable(52)) #3

declare noundef i32 @_ZNK4Glip6CoreGL24HdlAbstractTextureFormat12getTWrappingEv(ptr noundef nonnull align 8 dereferenceable(52)) #3

; Function Attrs: mustprogress uwtable
define dso_local noundef nonnull align 8 dereferenceable(72) ptr @_ZNK4Glip7Modules11ImageBufferrsERNS_6CoreGL10HdlTextureE(ptr noundef nonnull align 8 dereferenceable(72) %0, ptr noundef nonnull align 8 dereferenceable(57) %1) #2 align 2 personality ptr @__gxx_personality_v0 {
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca %"class.std::__cxx11::basic_string", align 8
  %6 = alloca %"class.std::allocator", align 1
  %7 = alloca ptr, align 8
  %8 = alloca i32, align 4
  %9 = alloca %"class.std::__cxx11::basic_string", align 8
  %10 = alloca %"class.std::allocator", align 1
  %11 = alloca i32, align 4
  %12 = alloca i1, align 1
  %13 = alloca i32, align 4
  %14 = alloca %"class.std::__cxx11::basic_string", align 8
  %15 = alloca %"class.std::__cxx11::basic_string", align 8
  %16 = alloca %"class.std::__cxx11::basic_string", align 8
  %17 = alloca %"class.std::__cxx11::basic_string", align 8
  %18 = alloca %"class.std::allocator", align 1
  %19 = alloca i32, align 4
  %20 = alloca i1, align 1
  store ptr %0, ptr %3, align 8, !tbaa !5
  store ptr %1, ptr %4, align 8, !tbaa !5
  %21 = load ptr, ptr %3, align 8
  %22 = load ptr, ptr %4, align 8, !tbaa !5
  %23 = call noundef zeroext i1 @_ZNK4Glip6CoreGL24HdlAbstractTextureFormat16isCompatibleWithERKS1_(ptr noundef nonnull align 8 dereferenceable(52) %21, ptr noundef nonnull align 8 dereferenceable(52) %22)
  br i1 %23, label %46, label %24

24:                                               ; preds = %2
  store i1 true, ptr %12, align 1
  %25 = call ptr @__cxa_allocate_exception(i64 152) #6
  call void @llvm.lifetime.start.p0(i64 32, ptr %5) #6
  call void @llvm.lifetime.start.p0(i64 1, ptr %6) #6
  call void @_ZNSaIcEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %6) #6
  invoke void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_(ptr noundef nonnull align 8 dereferenceable(32) %5, ptr noundef @.str.7, ptr noundef nonnull align 1 dereferenceable(1) %6)
          to label %26 unwind label %29

26:                                               ; preds = %24
  call void @llvm.lifetime.start.p0(i64 1, ptr %10) #6
  call void @_ZNSaIcEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %10) #6
  invoke void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_(ptr noundef nonnull align 8 dereferenceable(32) %9, ptr noundef @.str.3, ptr noundef nonnull align 1 dereferenceable(1) %10)
          to label %27 unwind label %33

27:                                               ; preds = %26
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #6
  store i32 2, ptr %11, align 4, !tbaa !9
  invoke void @_ZN4Glip9ExceptionC1ERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEES6_iRKNS0_4TypeE(ptr noundef nonnull align 8 dereferenceable(152) %25, ptr noundef nonnull align 8 dereferenceable(32) %5, ptr noundef %9, i32 noundef 289, ptr noundef nonnull align 4 dereferenceable(4) %11)
          to label %28 unwind label %37

28:                                               ; preds = %27
  store i1 false, ptr %12, align 1
  invoke void @__cxa_throw(ptr %25, ptr @_ZTIN4Glip9ExceptionE, ptr @_ZN4Glip9ExceptionD1Ev) #7
          to label %114 unwind label %37

29:                                               ; preds = %24
  %30 = landingpad { ptr, i32 }
          cleanup
  %31 = extractvalue { ptr, i32 } %30, 0
  store ptr %31, ptr %7, align 8
  %32 = extractvalue { ptr, i32 } %30, 1
  store i32 %32, ptr %8, align 4
  br label %42

33:                                               ; preds = %26
  %34 = landingpad { ptr, i32 }
          cleanup
  %35 = extractvalue { ptr, i32 } %34, 0
  store ptr %35, ptr %7, align 8
  %36 = extractvalue { ptr, i32 } %34, 1
  store i32 %36, ptr %8, align 4
  br label %41

37:                                               ; preds = %28, %27
  %38 = landingpad { ptr, i32 }
          cleanup
  %39 = extractvalue { ptr, i32 } %38, 0
  store ptr %39, ptr %7, align 8
  %40 = extractvalue { ptr, i32 } %38, 1
  store i32 %40, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #6
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %9) #6
  br label %41

41:                                               ; preds = %37, %33
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %10) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr %10) #6
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %5) #6
  br label %42

42:                                               ; preds = %41, %29
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %6) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr %6) #6
  call void @llvm.lifetime.end.p0(i64 32, ptr %5) #6
  %43 = load i1, ptr %12, align 1
  br i1 %43, label %44, label %45

44:                                               ; preds = %42
  call void @__cxa_free_exception(ptr %25) #6
  br label %45

45:                                               ; preds = %44, %42
  br label %109

46:                                               ; preds = %2
  %47 = load ptr, ptr %4, align 8, !tbaa !5
  call void @_ZN4Glip6CoreGL10HdlTexture4bindEj(ptr noundef nonnull align 8 dereferenceable(57) %47, i32 noundef 33984)
  %48 = call noundef i32 @_ZNK4Glip6CoreGL24HdlAbstractTextureFormat12getAlignmentEv(ptr noundef nonnull align 8 dereferenceable(52) %21)
  call void @glPixelStorei(i32 noundef 3317, i32 noundef %48)
  %49 = call noundef i32 @_ZNK4Glip6CoreGL24HdlAbstractTextureFormat9getGLModeEv(ptr noundef nonnull align 8 dereferenceable(52) %21)
  %50 = call noundef i32 @_ZNK4Glip6CoreGL24HdlAbstractTextureFormat8getWidthEv(ptr noundef nonnull align 8 dereferenceable(52) %21)
  %51 = call noundef i32 @_ZNK4Glip6CoreGL24HdlAbstractTextureFormat9getHeightEv(ptr noundef nonnull align 8 dereferenceable(52) %21)
  %52 = getelementptr inbounds %"class.Glip::Modules::ImageBuffer", ptr %21, i32 0, i32 1
  %53 = load ptr, ptr %52, align 8, !tbaa !11
  %54 = getelementptr inbounds %"struct.Glip::CoreGL::HdlTextureFormatDescriptor", ptr %53, i32 0, i32 1
  %55 = load i32, ptr %54, align 4, !tbaa !15
  %56 = call noundef i32 @_ZNK4Glip6CoreGL24HdlAbstractTextureFormat10getGLDepthEv(ptr noundef nonnull align 8 dereferenceable(52) %21)
  %57 = getelementptr inbounds %"class.Glip::Modules::ImageBuffer", ptr %21, i32 0, i32 2
  %58 = load ptr, ptr %57, align 8, !tbaa !18
  %59 = load ptr, ptr %58, align 8, !tbaa !19
  %60 = getelementptr inbounds ptr, ptr %59, i64 31
  %61 = load ptr, ptr %60, align 8
  %62 = call noundef ptr %61(ptr noundef nonnull align 8 dereferenceable(32) %58)
  call void @glTexImage2D(i32 noundef 3553, i32 noundef 0, i32 noundef %49, i32 noundef %50, i32 noundef %51, i32 noundef 0, i32 noundef %55, i32 noundef %56, ptr noundef %62)
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #6
  %63 = call i32 @glGetError()
  store i32 %63, ptr %13, align 4, !tbaa !21
  %64 = load i32, ptr %13, align 4, !tbaa !21
  %65 = icmp ne i32 %64, 0
  br i1 %65, label %66, label %94

66:                                               ; preds = %46
  store i1 true, ptr %20, align 1
  %67 = call ptr @__cxa_allocate_exception(i64 152) #6
  call void @llvm.lifetime.start.p0(i64 32, ptr %14) #6
  call void @llvm.lifetime.start.p0(i64 32, ptr %15) #6
  call void @llvm.lifetime.start.p0(i64 32, ptr %16) #6
  call void @_ZN4Glip6CoreGL17getGLEnumNameSafeB5cxx11ERKj(ptr dead_on_unwind writable sret(%"class.std::__cxx11::basic_string") align 8 %16, ptr noundef nonnull align 4 dereferenceable(4) %13) #6
  invoke void @_ZStplIcSt11char_traitsIcESaIcEENSt7__cxx1112basic_stringIT_T0_T1_EEPKS5_OS8_(ptr dead_on_unwind writable sret(%"class.std::__cxx11::basic_string") align 8 %15, ptr noundef @.str.8, ptr noundef nonnull align 8 dereferenceable(32) %16)
          to label %68 unwind label %72

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

69:                                               ; preds = %68
  call void @llvm.lifetime.start.p0(i64 1, ptr %18) #6
  call void @_ZNSaIcEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %18) #6
  invoke void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_(ptr noundef nonnull align 8 dereferenceable(32) %17, ptr noundef @.str.3, ptr noundef nonnull align 1 dereferenceable(1) %18)
          to label %70 unwind label %80

70:                                               ; preds = %69
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #6
  store i32 2, ptr %19, align 4, !tbaa !9
  invoke void @_ZN4Glip9ExceptionC1ERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEES6_iRKNS0_4TypeE(ptr noundef nonnull align 8 dereferenceable(152) %67, ptr noundef nonnull align 8 dereferenceable(32) %14, ptr noundef %17, i32 noundef 302, ptr noundef nonnull align 4 dereferenceable(4) %19)
          to label %71 unwind label %84

71:                                               ; preds = %70
  store i1 false, ptr %20, align 1
  invoke void @__cxa_throw(ptr %67, ptr @_ZTIN4Glip9ExceptionE, ptr @_ZN4Glip9ExceptionD1Ev) #7
          to label %114 unwind label %84

72:                                               ; preds = %66
  %73 = landingpad { ptr, i32 }
          cleanup
  %74 = extractvalue { ptr, i32 } %73, 0
  store ptr %74, ptr %7, align 8
  %75 = extractvalue { ptr, i32 } %73, 1
  store i32 %75, ptr %8, align 4
  br label %90

76:                                               ; preds = %68
  %77 = landingpad { ptr, i32 }
          cleanup
  %78 = extractvalue { ptr, i32 } %77, 0
  store ptr %78, ptr %7, align 8
  %79 = extractvalue { ptr, i32 } %77, 1
  store i32 %79, ptr %8, align 4
  br label %89

80:                                               ; preds = %69
  %81 = landingpad { ptr, i32 }
          cleanup
  %82 = extractvalue { ptr, i32 } %81, 0
  store ptr %82, ptr %7, align 8
  %83 = extractvalue { ptr, i32 } %81, 1
  store i32 %83, ptr %8, align 4
  br label %88

84:                                               ; preds = %71, %70
  %85 = landingpad { ptr, i32 }
          cleanup
  %86 = extractvalue { ptr, i32 } %85, 0
  store ptr %86, ptr %7, align 8
  %87 = extractvalue { ptr, i32 } %85, 1
  store i32 %87, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #6
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %17) #6
  br label %88

88:                                               ; preds = %84, %80
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %18) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr %18) #6
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %14) #6
  br label %89

89:                                               ; preds = %88, %76
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %15) #6
  br label %90

90:                                               ; preds = %89, %72
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %16) #6
  call void @llvm.lifetime.end.p0(i64 32, ptr %16) #6
  call void @llvm.lifetime.end.p0(i64 32, ptr %15) #6
  call void @llvm.lifetime.end.p0(i64 32, ptr %14) #6
  %91 = load i1, ptr %20, align 1
  br i1 %91, label %92, label %93

92:                                               ; preds = %90
  call void @__cxa_free_exception(ptr %67) #6
  br label %93

93:                                               ; preds = %92, %90
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #6
  br label %109

94:                                               ; preds = %46
  %95 = load ptr, ptr %4, align 8, !tbaa !5
  %96 = call noundef i32 @_ZNK4Glip6CoreGL24HdlAbstractTextureFormat11getMaxLevelEv(ptr noundef nonnull align 8 dereferenceable(52) %95)
  %97 = icmp sgt i32 %96, 0
  br i1 %97, label %98, label %100

98:                                               ; preds = %94
  %99 = load ptr, ptr @__glewGenerateMipmap, align 8, !tbaa !5
  call void %99(i32 noundef 3553)
  br label %100

100:                                              ; preds = %98, %94
  call void @_ZN4Glip6CoreGL10HdlTexture6unbindEj(i32 noundef 33984)
  %101 = load ptr, ptr %4, align 8, !tbaa !5
  %102 = call noundef i32 @_ZNK4Glip6CoreGL24HdlAbstractTextureFormat12getMinFilterEv(ptr noundef nonnull align 8 dereferenceable(52) %21)
  call void @_ZN4Glip6CoreGL10HdlTexture12setMinFilterEj(ptr noundef nonnull align 8 dereferenceable(57) %101, i32 noundef %102)
  %103 = load ptr, ptr %4, align 8, !tbaa !5
  %104 = call noundef i32 @_ZNK4Glip6CoreGL24HdlAbstractTextureFormat12getMagFilterEv(ptr noundef nonnull align 8 dereferenceable(52) %21)
  call void @_ZN4Glip6CoreGL10HdlTexture12setMagFilterEj(ptr noundef nonnull align 8 dereferenceable(57) %103, i32 noundef %104)
  %105 = load ptr, ptr %4, align 8, !tbaa !5
  %106 = call noundef i32 @_ZNK4Glip6CoreGL24HdlAbstractTextureFormat12getSWrappingEv(ptr noundef nonnull align 8 dereferenceable(52) %21)
  call void @_ZN4Glip6CoreGL10HdlTexture12setSWrappingEj(ptr noundef nonnull align 8 dereferenceable(57) %105, i32 noundef %106)
  %107 = load ptr, ptr %4, align 8, !tbaa !5
  %108 = call noundef i32 @_ZNK4Glip6CoreGL24HdlAbstractTextureFormat12getTWrappingEv(ptr noundef nonnull align 8 dereferenceable(52) %21)
  call void @_ZN4Glip6CoreGL10HdlTexture12setTWrappingEj(ptr noundef nonnull align 8 dereferenceable(57) %107, i32 noundef %108)
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #6
  ret ptr %21

109:                                              ; preds = %93, %45
  %110 = load ptr, ptr %7, align 8
  %111 = load i32, ptr %8, align 4
  %112 = insertvalue { ptr, i32 } poison, ptr %110, 0
  %113 = insertvalue { ptr, i32 } %112, i32 %111, 1
  resume { ptr, i32 } %113

114:                                              ; preds = %71, %28
  unreachable
}

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

declare noundef i32 @_ZNK4Glip6CoreGL24HdlAbstractTextureFormat9getGLModeEv(ptr noundef nonnull align 8 dereferenceable(52)) #3

declare noundef i32 @_ZNK4Glip6CoreGL24HdlAbstractTextureFormat11getMaxLevelEv(ptr noundef nonnull align 8 dereferenceable(52)) #3

declare void @_ZN4Glip6CoreGL10HdlTexture12setMinFilterEj(ptr noundef nonnull align 8 dereferenceable(57), i32 noundef) #3

declare void @_ZN4Glip6CoreGL10HdlTexture12setMagFilterEj(ptr noundef nonnull align 8 dereferenceable(57), i32 noundef) #3

declare void @_ZN4Glip6CoreGL10HdlTexture12setSWrappingEj(ptr noundef nonnull align 8 dereferenceable(57), i32 noundef) #3

declare void @_ZN4Glip6CoreGL10HdlTexture12setTWrappingEj(ptr noundef nonnull align 8 dereferenceable(57), i32 noundef) #3

; 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 = { 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 #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 }
attributes #7 = { noreturn }

!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 = !{!"_ZTSN4Glip9Exception4TypeE", !7, i64 0}
!11 = !{!12, !6, i64 56}
!12 = !{!"_ZTSN4Glip7Modules11ImageBufferE", !13, i64 0, !6, i64 56, !6, i64 64}
!13 = !{!"_ZTSN4Glip6CoreGL24HdlAbstractTextureFormatE", !14, i64 8, !14, i64 12, !14, i64 16, !14, i64 20, !14, i64 24, !14, i64 28, !14, i64 32, !14, i64 36, !14, i64 40, !14, i64 44, !14, i64 48}
!14 = !{!"int", !7, i64 0}
!15 = !{!16, !14, i64 4}
!16 = !{!"_ZTSN4Glip6CoreGL26HdlTextureFormatDescriptorE", !14, i64 0, !14, i64 4, !14, i64 8, !14, i64 12, !14, i64 16, !7, i64 20, !7, i64 36, !7, i64 52, !17, i64 68, !17, i64 69, !17, i64 70}
!17 = !{!"bool", !7, i64 0}
!18 = !{!12, !6, i64 64}
!19 = !{!20, !20, i64 0}
!20 = !{!"vtable pointer", !8, i64 0}
!21 = !{!14, !14, 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" = type { i8 }

@.str.3 = external hidden unnamed_addr constant [94 x i8], align 1
@_ZTIN4Glip9ExceptionE = external constant ptr
@.str.5 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [76 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [90 x i8], align 1
@__glewGenerateMipmap = external local_unnamed_addr global ptr, align 8

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

; Function Attrs: mustprogress 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

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 @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32)) unnamed_addr #1 align 2

declare noundef i32 @_ZNK4Glip6CoreGL24HdlAbstractTextureFormat10getGLDepthEv(ptr noundef nonnull align 8 dereferenceable(52)) local_unnamed_addr #3

declare noundef i32 @_ZNK4Glip6CoreGL24HdlAbstractTextureFormat8getWidthEv(ptr noundef nonnull align 8 dereferenceable(52)) local_unnamed_addr #3

declare noundef i32 @_ZNK4Glip6CoreGL24HdlAbstractTextureFormat9getHeightEv(ptr noundef nonnull align 8 dereferenceable(52)) local_unnamed_addr #3

declare noundef zeroext i1 @_ZNK4Glip6CoreGL24HdlAbstractTextureFormat16isCompatibleWithERKS1_(ptr noundef nonnull align 8 dereferenceable(52), ptr noundef nonnull align 8 dereferenceable(52)) local_unnamed_addr #3

declare ptr @__cxa_allocate_exception(i64) local_unnamed_addr

declare void @_ZN4Glip9ExceptionC1ERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEES6_iRKNS0_4TypeE(ptr noundef nonnull align 8 dereferenceable(152), ptr noundef nonnull align 8 dereferenceable(32), ptr noundef, i32 noundef, ptr noundef nonnull align 4 dereferenceable(4)) unnamed_addr #3

; Function Attrs: nounwind
declare void @_ZN4Glip9ExceptionD1Ev(ptr noundef nonnull align 8 dereferenceable(152)) unnamed_addr #4

declare void @__cxa_throw(ptr, ptr, ptr) local_unnamed_addr

declare void @__cxa_free_exception(ptr) local_unnamed_addr

declare void @_ZN4Glip6CoreGL10HdlTexture4bindEj(ptr noundef nonnull align 8 dereferenceable(57), i32 noundef) local_unnamed_addr #3

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

declare noundef i32 @_ZNK4Glip6CoreGL24HdlAbstractTextureFormat12getAlignmentEv(ptr noundef nonnull align 8 dereferenceable(52)) local_unnamed_addr #3

declare i32 @glGetError() local_unnamed_addr #3

; 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: inlinehint mustprogress uwtable
declare dso_local void @_ZStplIcSt11char_traitsIcESaIcEENSt7__cxx1112basic_stringIT_T0_T1_EEPKS5_OS8_(ptr dead_on_unwind noalias writable sret(%"class.std::__cxx11::basic_string") align 8, ptr noundef, ptr noundef nonnull align 8 dereferenceable(32)) local_unnamed_addr #5

; Function Attrs: nounwind
declare void @_ZN4Glip6CoreGL17getGLEnumNameSafeB5cxx11ERKj(ptr dead_on_unwind writable sret(%"class.std::__cxx11::basic_string") align 8, ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #4

declare void @_ZN4Glip6CoreGL10HdlTexture6unbindEj(i32 noundef) local_unnamed_addr #3

declare noundef i32 @_ZNK4Glip6CoreGL24HdlAbstractTextureFormat12getMinFilterEv(ptr noundef nonnull align 8 dereferenceable(52)) local_unnamed_addr #3

declare noundef i32 @_ZNK4Glip6CoreGL24HdlAbstractTextureFormat12getMagFilterEv(ptr noundef nonnull align 8 dereferenceable(52)) local_unnamed_addr #3

declare noundef i32 @_ZNK4Glip6CoreGL24HdlAbstractTextureFormat12getSWrappingEv(ptr noundef nonnull align 8 dereferenceable(52)) local_unnamed_addr #3

declare noundef i32 @_ZNK4Glip6CoreGL24HdlAbstractTextureFormat12getTWrappingEv(ptr noundef nonnull align 8 dereferenceable(52)) local_unnamed_addr #3

; Function Attrs: mustprogress uwtable
define dso_local noundef nonnull align 8 dereferenceable(72) ptr @_ZNK4Glip7Modules11ImageBufferrsERNS_6CoreGL10HdlTextureE(ptr noundef nonnull returned align 8 dereferenceable(72) %0, ptr noundef nonnull align 8 dereferenceable(57) %1) local_unnamed_addr #2 align 2 personality ptr @__gxx_personality_v0 {
  %3 = alloca %"class.std::__cxx11::basic_string", align 8
  %4 = alloca %"class.std::allocator", align 1
  %5 = alloca %"class.std::__cxx11::basic_string", align 8
  %6 = alloca %"class.std::allocator", align 1
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca %"class.std::__cxx11::basic_string", align 8
  %10 = alloca %"class.std::__cxx11::basic_string", align 8
  %11 = alloca %"class.std::__cxx11::basic_string", align 8
  %12 = alloca %"class.std::__cxx11::basic_string", align 8
  %13 = alloca %"class.std::allocator", align 1
  %14 = alloca i32, align 4
  %15 = tail call noundef zeroext i1 @_ZNK4Glip6CoreGL24HdlAbstractTextureFormat16isCompatibleWithERKS1_(ptr noundef nonnull align 8 dereferenceable(52) %0, ptr noundef nonnull align 8 dereferenceable(52) %1)
  br i1 %15, label %28, label %16

16:                                               ; preds = %2
  %17 = tail call ptr @__cxa_allocate_exception(i64 152) #6
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %3) #6
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %4) #6
  call void @_ZNSaIcEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %4) #6
  invoke void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_(ptr noundef nonnull align 8 dereferenceable(32) %3, ptr noundef nonnull @.str.7, ptr noundef nonnull align 1 dereferenceable(1) %4)
          to label %18 unwind label %.thread

18:                                               ; preds = %16
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %6) #6
  call void @_ZNSaIcEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %6) #6
  invoke void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_(ptr noundef nonnull align 8 dereferenceable(32) %5, ptr noundef nonnull @.str.3, ptr noundef nonnull align 1 dereferenceable(1) %6)
          to label %19 unwind label %22

19:                                               ; preds = %18
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %7) #6
  store i32 2, ptr %7, align 4, !tbaa !5
  invoke void @_ZN4Glip9ExceptionC1ERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEES6_iRKNS0_4TypeE(ptr noundef nonnull align 8 dereferenceable(152) %17, ptr noundef nonnull align 8 dereferenceable(32) %3, ptr noundef nonnull %5, i32 noundef 289, ptr noundef nonnull align 4 dereferenceable(4) %7)
          to label %20 unwind label %24

20:                                               ; preds = %19
  invoke void @__cxa_throw(ptr nonnull %17, ptr nonnull @_ZTIN4Glip9ExceptionE, ptr nonnull @_ZN4Glip9ExceptionD1Ev) #7
          to label %73 unwind label %24

.thread:                                          ; preds = %16
  %21 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %4) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %4) #6
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %3) #6
  br label %27

22:                                               ; preds = %18
  %23 = landingpad { ptr, i32 }
          cleanup
  br label %26

24:                                               ; preds = %20, %19
  %.011 = phi i1 [ false, %20 ], [ true, %19 ]
  %25 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %7) #6
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %5) #6
  br label %26

26:                                               ; preds = %22, %24
  %.pn = phi { ptr, i32 } [ %25, %24 ], [ %23, %22 ]
  %.112 = phi i1 [ %.011, %24 ], [ true, %22 ]
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %6) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %6) #6
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %3) #6
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %4) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %4) #6
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %3) #6
  br i1 %.112, label %27, label %72

27:                                               ; preds = %.thread, %26
  %.pn.pn33 = phi { ptr, i32 } [ %21, %.thread ], [ %.pn, %26 ]
  call void @__cxa_free_exception(ptr %17) #6
  br label %72

28:                                               ; preds = %2
  tail call void @_ZN4Glip6CoreGL10HdlTexture4bindEj(ptr noundef nonnull align 8 dereferenceable(57) %1, i32 noundef 33984)
  %29 = tail call noundef i32 @_ZNK4Glip6CoreGL24HdlAbstractTextureFormat12getAlignmentEv(ptr noundef nonnull align 8 dereferenceable(52) %0)
  tail call void @glPixelStorei(i32 noundef 3317, i32 noundef %29)
  %30 = tail call noundef i32 @_ZNK4Glip6CoreGL24HdlAbstractTextureFormat9getGLModeEv(ptr noundef nonnull align 8 dereferenceable(52) %0)
  %31 = tail call noundef i32 @_ZNK4Glip6CoreGL24HdlAbstractTextureFormat8getWidthEv(ptr noundef nonnull align 8 dereferenceable(52) %0)
  %32 = tail call noundef i32 @_ZNK4Glip6CoreGL24HdlAbstractTextureFormat9getHeightEv(ptr noundef nonnull align 8 dereferenceable(52) %0)
  %33 = getelementptr inbounds i8, ptr %0, i64 56
  %34 = load ptr, ptr %33, align 8, !tbaa !9
  %35 = getelementptr inbounds i8, ptr %34, i64 4
  %36 = load i32, ptr %35, align 4, !tbaa !14
  %37 = tail call noundef i32 @_ZNK4Glip6CoreGL24HdlAbstractTextureFormat10getGLDepthEv(ptr noundef nonnull align 8 dereferenceable(52) %0)
  %38 = getelementptr inbounds i8, ptr %0, i64 64
  %39 = load ptr, ptr %38, align 8, !tbaa !17
  %40 = load ptr, ptr %39, align 8, !tbaa !18
  %41 = getelementptr inbounds i8, ptr %40, i64 248
  %42 = load ptr, ptr %41, align 8
  %43 = tail call noundef ptr %42(ptr noundef nonnull align 8 dereferenceable(32) %39)
  tail call void @glTexImage2D(i32 noundef 3553, i32 noundef 0, i32 noundef %30, i32 noundef %31, i32 noundef %32, i32 noundef 0, i32 noundef %36, i32 noundef %37, ptr noundef %43)
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %8) #6
  %44 = tail call i32 @glGetError()
  store i32 %44, ptr %8, align 4, !tbaa !20
  %.not = icmp eq i32 %44, 0
  br i1 %.not, label %62, label %45

45:                                               ; preds = %28
  %46 = tail call ptr @__cxa_allocate_exception(i64 152) #6
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %9) #6
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %10) #6
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %11) #6
  call void @_ZN4Glip6CoreGL17getGLEnumNameSafeB5cxx11ERKj(ptr dead_on_unwind nonnull writable sret(%"class.std::__cxx11::basic_string") align 8 %11, ptr noundef nonnull align 4 dereferenceable(4) %8) #6
  invoke void @_ZStplIcSt11char_traitsIcESaIcEENSt7__cxx1112basic_stringIT_T0_T1_EEPKS5_OS8_(ptr dead_on_unwind nonnull writable sret(%"class.std::__cxx11::basic_string") align 8 %10, ptr noundef nonnull @.str.8, ptr noundef nonnull align 8 dereferenceable(32) %11)
          to label %47 unwind label %.thread34

47:                                               ; preds = %45
  invoke void @_ZStplIcSt11char_traitsIcESaIcEENSt7__cxx1112basic_stringIT_T0_T1_EEOS8_PKS5_(ptr dead_on_unwind nonnull writable sret(%"class.std::__cxx11::basic_string") align 8 %9, ptr noundef nonnull align 8 dereferenceable(32) %10, ptr noundef nonnull @.str.5)
          to label %48 unwind label %52

48:                                               ; preds = %47
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %13) #6
  call void @_ZNSaIcEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %13) #6
  invoke void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_(ptr noundef nonnull align 8 dereferenceable(32) %12, ptr noundef nonnull @.str.3, ptr noundef nonnull align 1 dereferenceable(1) %13)
          to label %49 unwind label %54

49:                                               ; preds = %48
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %14) #6
  store i32 2, ptr %14, align 4, !tbaa !5
  invoke void @_ZN4Glip9ExceptionC1ERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEES6_iRKNS0_4TypeE(ptr noundef nonnull align 8 dereferenceable(152) %46, ptr noundef nonnull align 8 dereferenceable(32) %9, ptr noundef nonnull %12, i32 noundef 302, ptr noundef nonnull align 4 dereferenceable(4) %14)
          to label %50 unwind label %56

50:                                               ; preds = %49
  invoke void @__cxa_throw(ptr nonnull %46, ptr nonnull @_ZTIN4Glip9ExceptionE, ptr nonnull @_ZN4Glip9ExceptionD1Ev) #7
          to label %73 unwind label %56

.thread34:                                        ; preds = %45
  %51 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %11) #6
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %11) #6
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %10) #6
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %9) #6
  br label %60

52:                                               ; preds = %47
  %53 = landingpad { ptr, i32 }
          cleanup
  br label %59

54:                                               ; preds = %48
  %55 = landingpad { ptr, i32 }
          cleanup
  br label %58

56:                                               ; preds = %50, %49
  %.0 = phi i1 [ false, %50 ], [ true, %49 ]
  %57 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %14) #6
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %12) #6
  br label %58

58:                                               ; preds = %56, %54
  %.pn26 = phi { ptr, i32 } [ %57, %56 ], [ %55, %54 ]
  %.1 = phi i1 [ %.0, %56 ], [ true, %54 ]
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %13) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %13) #6
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %9) #6
  br label %59

59:                                               ; preds = %52, %58
  %.pn26.pn = phi { ptr, i32 } [ %.pn26, %58 ], [ %53, %52 ]
  %.2 = phi i1 [ %.1, %58 ], [ true, %52 ]
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %10) #6
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %11) #6
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %11) #6
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %10) #6
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %9) #6
  br i1 %.2, label %60, label %61

60:                                               ; preds = %.thread34, %59
  %.pn26.pn.pn38 = phi { ptr, i32 } [ %51, %.thread34 ], [ %.pn26.pn, %59 ]
  call void @__cxa_free_exception(ptr %46) #6
  br label %61

61:                                               ; preds = %60, %59
  %.pn26.pn.pn37 = phi { ptr, i32 } [ %.pn26.pn.pn38, %60 ], [ %.pn26.pn, %59 ]
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %8) #6
  br label %72

62:                                               ; preds = %28
  %63 = tail call noundef i32 @_ZNK4Glip6CoreGL24HdlAbstractTextureFormat11getMaxLevelEv(ptr noundef nonnull align 8 dereferenceable(52) %1)
  %64 = icmp sgt i32 %63, 0
  br i1 %64, label %65, label %67

65:                                               ; preds = %62
  %66 = load ptr, ptr @__glewGenerateMipmap, align 8, !tbaa !21
  tail call void %66(i32 noundef 3553)
  br label %67

67:                                               ; preds = %65, %62
  tail call void @_ZN4Glip6CoreGL10HdlTexture6unbindEj(i32 noundef 33984)
  %68 = tail call noundef i32 @_ZNK4Glip6CoreGL24HdlAbstractTextureFormat12getMinFilterEv(ptr noundef nonnull align 8 dereferenceable(52) %0)
  tail call void @_ZN4Glip6CoreGL10HdlTexture12setMinFilterEj(ptr noundef nonnull align 8 dereferenceable(57) %1, i32 noundef %68)
  %69 = tail call noundef i32 @_ZNK4Glip6CoreGL24HdlAbstractTextureFormat12getMagFilterEv(ptr noundef nonnull align 8 dereferenceable(52) %0)
  tail call void @_ZN4Glip6CoreGL10HdlTexture12setMagFilterEj(ptr noundef nonnull align 8 dereferenceable(57) %1, i32 noundef %69)
  %70 = tail call noundef i32 @_ZNK4Glip6CoreGL24HdlAbstractTextureFormat12getSWrappingEv(ptr noundef nonnull align 8 dereferenceable(52) %0)
  tail call void @_ZN4Glip6CoreGL10HdlTexture12setSWrappingEj(ptr noundef nonnull align 8 dereferenceable(57) %1, i32 noundef %70)
  %71 = tail call noundef i32 @_ZNK4Glip6CoreGL24HdlAbstractTextureFormat12getTWrappingEv(ptr noundef nonnull align 8 dereferenceable(52) %0)
  tail call void @_ZN4Glip6CoreGL10HdlTexture12setTWrappingEj(ptr noundef nonnull align 8 dereferenceable(57) %1, i32 noundef %71)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %8) #6
  ret ptr %0

72:                                               ; preds = %26, %27, %61
  %.pn26.pn.pn.pn = phi { ptr, i32 } [ %.pn26.pn.pn37, %61 ], [ %.pn.pn33, %27 ], [ %.pn, %26 ]
  resume { ptr, i32 } %.pn26.pn.pn.pn

73:                                               ; preds = %50, %20
  unreachable
}

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

declare noundef i32 @_ZNK4Glip6CoreGL24HdlAbstractTextureFormat9getGLModeEv(ptr noundef nonnull align 8 dereferenceable(52)) local_unnamed_addr #3

declare noundef i32 @_ZNK4Glip6CoreGL24HdlAbstractTextureFormat11getMaxLevelEv(ptr noundef nonnull align 8 dereferenceable(52)) local_unnamed_addr #3

declare void @_ZN4Glip6CoreGL10HdlTexture12setMinFilterEj(ptr noundef nonnull align 8 dereferenceable(57), i32 noundef) local_unnamed_addr #3

declare void @_ZN4Glip6CoreGL10HdlTexture12setMagFilterEj(ptr noundef nonnull align 8 dereferenceable(57), i32 noundef) local_unnamed_addr #3

declare void @_ZN4Glip6CoreGL10HdlTexture12setSWrappingEj(ptr noundef nonnull align 8 dereferenceable(57), i32 noundef) local_unnamed_addr #3

declare void @_ZN4Glip6CoreGL10HdlTexture12setTWrappingEj(ptr noundef nonnull align 8 dereferenceable(57), i32 noundef) local_unnamed_addr #3

; 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 = { 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 #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 }
attributes #7 = { noreturn }

!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 = !{!"_ZTSN4Glip9Exception4TypeE", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !13, i64 56}
!10 = !{!"_ZTSN4Glip7Modules11ImageBufferE", !11, i64 0, !13, i64 56, !13, i64 64}
!11 = !{!"_ZTSN4Glip6CoreGL24HdlAbstractTextureFormatE", !12, i64 8, !12, i64 12, !12, i64 16, !12, i64 20, !12, i64 24, !12, i64 28, !12, i64 32, !12, i64 36, !12, i64 40, !12, i64 44, !12, i64 48}
!12 = !{!"int", !7, i64 0}
!13 = !{!"any pointer", !7, i64 0}
!14 = !{!15, !12, i64 4}
!15 = !{!"_ZTSN4Glip6CoreGL26HdlTextureFormatDescriptorE", !12, i64 0, !12, i64 4, !12, i64 8, !12, i64 12, !12, i64 16, !7, i64 20, !7, i64 36, !7, i64 52, !16, i64 68, !16, i64 69, !16, i64 70}
!16 = !{!"bool", !7, i64 0}
!17 = !{!10, !13, i64 64}
!18 = !{!19, !19, i64 0}
!19 = !{!"vtable pointer", !8, i64 0}
!20 = !{!12, !12, i64 0}
!21 = !{!13, !13, i64 0}


; Effective O3 passes: EarlyCSEPass,GlobalOptPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,PostOrderFunctionAttrsPass,SROAPass,SimplifyCFGPass,TailCallElimPass