; LLVM IR from paroj/gltut :: glsdk/glimg/source/TextureGenerator.ll (ZN5glimg13CreateTextureEjPKNS_8ImageSetEj)

; 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.glimg::ImageFormat" = type { %"struct.glimg::UncheckedImageFormat" }
%"struct.glimg::UncheckedImageFormat" = type { i32, i32, i32, i32, i32 }
%"struct.glimg::OpenGLPixelTransferParams" = type { i32, i32, i32 }
%"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 }
%"class.glimg::ImageSet" = type { %"class.std::shared_ptr" }

@_ZTIN5glimg25CannotForceTextureStorageE = external dso_local constant { ptr, ptr, ptr }, align 8
@_ZTIN5glimg19CannotForceDSAUsageE = external dso_local constant { ptr, ptr, ptr }, align 8

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_ZN5glimg17GetInternalFormatERKNS_11ImageFormatEj(ptr noundef nonnull align 4 dereferenceable(20), i32 noundef) #0

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

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

; Function Attrs: mustprogress uwtable
declare dso_local { i64, i32 } @_ZN5glimg19GetUploadFormatTypeERKNS_11ImageFormatEj(ptr noundef nonnull align 4 dereferenceable(20), i32 noundef) #0

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #2

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_ZN5glimg14GetTextureTypeEPKNS_8ImageSetEj(ptr noundef, i32 noundef) #0

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN5glimg13CreateTextureEjPKNS_8ImageSetEj(i32 noundef %0, ptr noundef %1, i32 noundef %2) #0 personality ptr @__gxx_personality_v0 {
  %4 = alloca i32, align 4
  %5 = alloca ptr, align 8
  %6 = alloca i32, align 4
  %7 = alloca ptr, align 8
  %8 = alloca i32, align 4
  %9 = alloca ptr, align 8
  %10 = alloca %"class.glimg::ImageFormat", align 4
  %11 = alloca i32, align 4
  %12 = alloca %"struct.glimg::OpenGLPixelTransferParams", align 4
  %13 = alloca { i64, i32 }, align 8
  %14 = alloca %"class.std::shared_ptr", align 8
  %15 = alloca %"class.std::shared_ptr", align 8
  %16 = alloca %"class.std::shared_ptr", align 8
  %17 = alloca %"class.std::shared_ptr", align 8
  %18 = alloca %"class.std::shared_ptr", align 8
  %19 = alloca %"class.std::shared_ptr", align 8
  %20 = alloca %"class.std::shared_ptr", align 8
  store i32 %0, ptr %4, align 4, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !9
  store i32 %2, ptr %6, align 4, !tbaa !5
  %21 = load i32, ptr %6, align 4, !tbaa !5
  %22 = and i32 %21, 512
  %23 = icmp ne i32 %22, 0
  br i1 %23, label %24, label %36

24:                                               ; preds = %3
  %25 = call noundef zeroext i1 @_ZN5glimg12_GLOBAL__N_125IsTextureStorageSupportedEv()
  br i1 %25, label %33, label %26

26:                                               ; preds = %24
  %27 = call ptr @__cxa_allocate_exception(i64 40) #5
  invoke void @_ZN5glimg25CannotForceTextureStorageC2Ev(ptr noundef nonnull align 8 dereferenceable(40) %27)
          to label %28 unwind label %29

28:                                               ; preds = %26
  call void @__cxa_throw(ptr %27, ptr @_ZTIN5glimg25CannotForceTextureStorageE, ptr @_ZN5glimg26TextureGenerationExceptionD2Ev) #6
  unreachable

29:                                               ; preds = %26
  %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
  call void @__cxa_free_exception(ptr %27) #5
  br label %162

33:                                               ; preds = %24
  %34 = load i32, ptr %6, align 4, !tbaa !5
  %35 = or i32 %34, 256
  store i32 %35, ptr %6, align 4, !tbaa !5
  br label %36

36:                                               ; preds = %33, %3
  %37 = load i32, ptr %6, align 4, !tbaa !5
  %38 = and i32 %37, 256
  %39 = icmp ne i32 %38, 0
  br i1 %39, label %40, label %46

40:                                               ; preds = %36
  %41 = call noundef zeroext i1 @_ZN5glimg12_GLOBAL__N_125IsTextureStorageSupportedEv()
  br i1 %41, label %45, label %42

42:                                               ; preds = %40
  %43 = load i32, ptr %6, align 4, !tbaa !5
  %44 = and i32 %43, -257
  store i32 %44, ptr %6, align 4, !tbaa !5
  br label %45

45:                                               ; preds = %42, %40
  br label %46

46:                                               ; preds = %45, %36
  %47 = load i32, ptr %6, align 4, !tbaa !5
  %48 = and i32 %47, 2048
  %49 = icmp ne i32 %48, 0
  br i1 %49, label %50, label %62

50:                                               ; preds = %46
  %51 = call noundef zeroext i1 @_ZN5glimg12_GLOBAL__N_128IsDirectStateAccessSupportedEv()
  br i1 %51, label %59, label %52

52:                                               ; preds = %50
  %53 = call ptr @__cxa_allocate_exception(i64 40) #5
  invoke void @_ZN5glimg19CannotForceDSAUsageC2Ev(ptr noundef nonnull align 8 dereferenceable(40) %53)
          to label %54 unwind label %55

54:                                               ; preds = %52
  call void @__cxa_throw(ptr %53, ptr @_ZTIN5glimg19CannotForceDSAUsageE, ptr @_ZN5glimg26TextureGenerationExceptionD2Ev) #6
  unreachable

55:                                               ; preds = %52
  %56 = landingpad { ptr, i32 }
          cleanup
  %57 = extractvalue { ptr, i32 } %56, 0
  store ptr %57, ptr %7, align 8
  %58 = extractvalue { ptr, i32 } %56, 1
  store i32 %58, ptr %8, align 4
  call void @__cxa_free_exception(ptr %53) #5
  br label %162

59:                                               ; preds = %50
  %60 = load i32, ptr %6, align 4, !tbaa !5
  %61 = or i32 %60, 1024
  store i32 %61, ptr %6, align 4, !tbaa !5
  br label %62

62:                                               ; preds = %59, %46
  %63 = load i32, ptr %6, align 4, !tbaa !5
  %64 = and i32 %63, 1024
  %65 = icmp ne i32 %64, 0
  br i1 %65, label %66, label %72

66:                                               ; preds = %62
  %67 = call noundef zeroext i1 @_ZN5glimg12_GLOBAL__N_128IsDirectStateAccessSupportedEv()
  br i1 %67, label %71, label %68

68:                                               ; preds = %66
  %69 = load i32, ptr %6, align 4, !tbaa !5
  %70 = and i32 %69, -1025
  store i32 %70, ptr %6, align 4, !tbaa !5
  br label %71

71:                                               ; preds = %68, %66
  br label %72

72:                                               ; preds = %71, %62
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #5
  call void @llvm.lifetime.start.p0(i64 20, ptr %10) #5
  %73 = load ptr, ptr %5, align 8, !tbaa !9
  call void @_ZNK5glimg8ImageSet9GetFormatEv(ptr dead_on_unwind writable sret(%"class.glimg::ImageFormat") align 4 %10, ptr noundef nonnull align 8 dereferenceable(16) %73)
  store ptr %10, ptr %9, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #5
  %74 = load ptr, ptr %9, align 8, !tbaa !9
  %75 = load i32, ptr %6, align 4, !tbaa !5
  %76 = call noundef i32 @_ZN5glimg17GetInternalFormatERKNS_11ImageFormatEj(ptr noundef nonnull align 4 dereferenceable(20) %74, i32 noundef %75)
  store i32 %76, ptr %11, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 12, ptr %12) #5
  %77 = load ptr, ptr %9, align 8, !tbaa !9
  %78 = load i32, ptr %6, align 4, !tbaa !5
  %79 = call { i64, i32 } @_ZN5glimg19GetUploadFormatTypeERKNS_11ImageFormatEj(ptr noundef nonnull align 4 dereferenceable(20) %77, i32 noundef %78)
  store { i64, i32 } %79, ptr %13, align 8
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %12, ptr align 8 %13, i64 12, i1 false)
  %80 = load ptr, ptr %5, align 8, !tbaa !9
  %81 = load i32, ptr %6, align 4, !tbaa !5
  %82 = call noundef i32 @_ZN5glimg14GetTextureTypeEPKNS_8ImageSetEj(ptr noundef %80, i32 noundef %81)
  switch i32 %82, label %160 [
    i32 3552, label %83
    i32 3553, label %94
    i32 32879, label %105
    i32 35864, label %116
    i32 35866, label %127
    i32 34067, label %138
    i32 36873, label %149
  ]

83:                                               ; preds = %72
  %84 = load i32, ptr %4, align 4, !tbaa !5
  %85 = load ptr, ptr %5, align 8, !tbaa !9
  %86 = getelementptr inbounds %"class.glimg::ImageSet", ptr %85, i32 0, i32 0
  call void @_ZNSt10shared_ptrIKN5glimg6detail12ImageSetImplEEC2ERKS4_(ptr noundef nonnull align 8 dereferenceable(16) %14, ptr noundef nonnull align 8 dereferenceable(16) %86) #5
  %87 = load i32, ptr %6, align 4, !tbaa !5
  %88 = load i32, ptr %11, align 4, !tbaa !5
  invoke void @_ZN5glimg12_GLOBAL__N_114Build1DTextureEjSt10shared_ptrIKNS_6detail12ImageSetImplEEjjRKNS_25OpenGLPixelTransferParamsE(i32 noundef %84, ptr noundef %14, i32 noundef %87, i32 noundef %88, ptr noundef nonnull align 4 dereferenceable(12) %12)
          to label %89 unwind label %90

89:                                               ; preds = %83
  call void @_ZNSt12__shared_ptrIKN5glimg6detail12ImageSetImplELN9__gnu_cxx12_Lock_policyE2EED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %14) #5
  br label %160

90:                                               ; preds = %83
  %91 = landingpad { ptr, i32 }
          cleanup
  %92 = extractvalue { ptr, i32 } %91, 0
  store ptr %92, ptr %7, align 8
  %93 = extractvalue { ptr, i32 } %91, 1
  store i32 %93, ptr %8, align 4
  call void @_ZNSt12__shared_ptrIKN5glimg6detail12ImageSetImplELN9__gnu_cxx12_Lock_policyE2EED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %14) #5
  br label %161

94:                                               ; preds = %72
  %95 = load i32, ptr %4, align 4, !tbaa !5
  %96 = load ptr, ptr %5, align 8, !tbaa !9
  %97 = getelementptr inbounds %"class.glimg::ImageSet", ptr %96, i32 0, i32 0
  call void @_ZNSt10shared_ptrIKN5glimg6detail12ImageSetImplEEC2ERKS4_(ptr noundef nonnull align 8 dereferenceable(16) %15, ptr noundef nonnull align 8 dereferenceable(16) %97) #5
  %98 = load i32, ptr %6, align 4, !tbaa !5
  %99 = load i32, ptr %11, align 4, !tbaa !5
  invoke void @_ZN5glimg12_GLOBAL__N_114Build2DTextureEjSt10shared_ptrIKNS_6detail12ImageSetImplEEjjRKNS_25OpenGLPixelTransferParamsE(i32 noundef %95, ptr noundef %15, i32 noundef %98, i32 noundef %99, ptr noundef nonnull align 4 dereferenceable(12) %12)
          to label %100 unwind label %101

100:                                              ; preds = %94
  call void @_ZNSt12__shared_ptrIKN5glimg6detail12ImageSetImplELN9__gnu_cxx12_Lock_policyE2EED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %15) #5
  br label %160

101:                                              ; preds = %94
  %102 = landingpad { ptr, i32 }
          cleanup
  %103 = extractvalue { ptr, i32 } %102, 0
  store ptr %103, ptr %7, align 8
  %104 = extractvalue { ptr, i32 } %102, 1
  store i32 %104, ptr %8, align 4
  call void @_ZNSt12__shared_ptrIKN5glimg6detail12ImageSetImplELN9__gnu_cxx12_Lock_policyE2EED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %15) #5
  br label %161

105:                                              ; preds = %72
  %106 = load i32, ptr %4, align 4, !tbaa !5
  %107 = load ptr, ptr %5, align 8, !tbaa !9
  %108 = getelementptr inbounds %"class.glimg::ImageSet", ptr %107, i32 0, i32 0
  call void @_ZNSt10shared_ptrIKN5glimg6detail12ImageSetImplEEC2ERKS4_(ptr noundef nonnull align 8 dereferenceable(16) %16, ptr noundef nonnull align 8 dereferenceable(16) %108) #5
  %109 = load i32, ptr %6, align 4, !tbaa !5
  %110 = load i32, ptr %11, align 4, !tbaa !5
  invoke void @_ZN5glimg12_GLOBAL__N_114Build3DTextureEjSt10shared_ptrIKNS_6detail12ImageSetImplEEjjRKNS_25OpenGLPixelTransferParamsE(i32 noundef %106, ptr noundef %16, i32 noundef %109, i32 noundef %110, ptr noundef nonnull align 4 dereferenceable(12) %12)
          to label %111 unwind label %112

111:                                              ; preds = %105
  call void @_ZNSt12__shared_ptrIKN5glimg6detail12ImageSetImplELN9__gnu_cxx12_Lock_policyE2EED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %16) #5
  br label %160

112:                                              ; preds = %105
  %113 = landingpad { ptr, i32 }
          cleanup
  %114 = extractvalue { ptr, i32 } %113, 0
  store ptr %114, ptr %7, align 8
  %115 = extractvalue { ptr, i32 } %113, 1
  store i32 %115, ptr %8, align 4
  call void @_ZNSt12__shared_ptrIKN5glimg6detail12ImageSetImplELN9__gnu_cxx12_Lock_policyE2EED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %16) #5
  br label %161

116:                                              ; preds = %72
  %117 = load i32, ptr %4, align 4, !tbaa !5
  %118 = load ptr, ptr %5, align 8, !tbaa !9
  %119 = getelementptr inbounds %"class.glimg::ImageSet", ptr %118, i32 0, i32 0
  call void @_ZNSt10shared_ptrIKN5glimg6detail12ImageSetImplEEC2ERKS4_(ptr noundef nonnull align 8 dereferenceable(16) %17, ptr noundef nonnull align 8 dereferenceable(16) %119) #5
  %120 = load i32, ptr %6, align 4, !tbaa !5
  %121 = load i32, ptr %11, align 4, !tbaa !5
  invoke void @_ZN5glimg12_GLOBAL__N_119Build1DArrayTextureEjSt10shared_ptrIKNS_6detail12ImageSetImplEEjjRKNS_25OpenGLPixelTransferParamsE(i32 noundef %117, ptr noundef %17, i32 noundef %120, i32 noundef %121, ptr noundef nonnull align 4 dereferenceable(12) %12)
          to label %122 unwind label %123

122:                                              ; preds = %116
  call void @_ZNSt12__shared_ptrIKN5glimg6detail12ImageSetImplELN9__gnu_cxx12_Lock_policyE2EED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %17) #5
  br label %160

123:                                              ; preds = %116
  %124 = landingpad { ptr, i32 }
          cleanup
  %125 = extractvalue { ptr, i32 } %124, 0
  store ptr %125, ptr %7, align 8
  %126 = extractvalue { ptr, i32 } %124, 1
  store i32 %126, ptr %8, align 4
  call void @_ZNSt12__shared_ptrIKN5glimg6detail12ImageSetImplELN9__gnu_cxx12_Lock_policyE2EED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %17) #5
  br label %161

127:                                              ; preds = %72
  %128 = load i32, ptr %4, align 4, !tbaa !5
  %129 = load ptr, ptr %5, align 8, !tbaa !9
  %130 = getelementptr inbounds %"class.glimg::ImageSet", ptr %129, i32 0, i32 0
  call void @_ZNSt10shared_ptrIKN5glimg6detail12ImageSetImplEEC2ERKS4_(ptr noundef nonnull align 8 dereferenceable(16) %18, ptr noundef nonnull align 8 dereferenceable(16) %130) #5
  %131 = load i32, ptr %6, align 4, !tbaa !5
  %132 = load i32, ptr %11, align 4, !tbaa !5
  invoke void @_ZN5glimg12_GLOBAL__N_119Build2DArrayTextureEjSt10shared_ptrIKNS_6detail12ImageSetImplEEjjRKNS_25OpenGLPixelTransferParamsE(i32 noundef %128, ptr noundef %18, i32 noundef %131, i32 noundef %132, ptr noundef nonnull align 4 dereferenceable(12) %12)
          to label %133 unwind label %134

133:                                              ; preds = %127
  call void @_ZNSt12__shared_ptrIKN5glimg6detail12ImageSetImplELN9__gnu_cxx12_Lock_policyE2EED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %18) #5
  br label %160

134:                                              ; preds = %127
  %135 = landingpad { ptr, i32 }
          cleanup
  %136 = extractvalue { ptr, i32 } %135, 0
  store ptr %136, ptr %7, align 8
  %137 = extractvalue { ptr, i32 } %135, 1
  store i32 %137, ptr %8, align 4
  call void @_ZNSt12__shared_ptrIKN5glimg6detail12ImageSetImplELN9__gnu_cxx12_Lock_policyE2EED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %18) #5
  br label %161

138:                                              ; preds = %72
  %139 = load i32, ptr %4, align 4, !tbaa !5
  %140 = load ptr, ptr %5, align 8, !tbaa !9
  %141 = getelementptr inbounds %"class.glimg::ImageSet", ptr %140, i32 0, i32 0
  call void @_ZNSt10shared_ptrIKN5glimg6detail12ImageSetImplEEC2ERKS4_(ptr noundef nonnull align 8 dereferenceable(16) %19, ptr noundef nonnull align 8 dereferenceable(16) %141) #5
  %142 = load i32, ptr %6, align 4, !tbaa !5
  %143 = load i32, ptr %11, align 4, !tbaa !5
  invoke void @_ZN5glimg12_GLOBAL__N_118Build2DCubeTextureEjSt10shared_ptrIKNS_6detail12ImageSetImplEEjjRKNS_25OpenGLPixelTransferParamsE(i32 noundef %139, ptr noundef %19, i32 noundef %142, i32 noundef %143, ptr noundef nonnull align 4 dereferenceable(12) %12)
          to label %144 unwind label %145

144:                                              ; preds = %138
  call void @_ZNSt12__shared_ptrIKN5glimg6detail12ImageSetImplELN9__gnu_cxx12_Lock_policyE2EED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %19) #5
  br label %160

145:                                              ; preds = %138
  %146 = landingpad { ptr, i32 }
          cleanup
  %147 = extractvalue { ptr, i32 } %146, 0
  store ptr %147, ptr %7, align 8
  %148 = extractvalue { ptr, i32 } %146, 1
  store i32 %148, ptr %8, align 4
  call void @_ZNSt12__shared_ptrIKN5glimg6detail12ImageSetImplELN9__gnu_cxx12_Lock_policyE2EED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %19) #5
  br label %161

149:                                              ; preds = %72
  %150 = load i32, ptr %4, align 4, !tbaa !5
  %151 = load ptr, ptr %5, align 8, !tbaa !9
  %152 = getelementptr inbounds %"class.glimg::ImageSet", ptr %151, i32 0, i32 0
  call void @_ZNSt10shared_ptrIKN5glimg6detail12ImageSetImplEEC2ERKS4_(ptr noundef nonnull align 8 dereferenceable(16) %20, ptr noundef nonnull align 8 dereferenceable(16) %152) #5
  %153 = load i32, ptr %6, align 4, !tbaa !5
  %154 = load i32, ptr %11, align 4, !tbaa !5
  invoke void @_ZN5glimg12_GLOBAL__N_123Build2DCubeArrayTextureEjSt10shared_ptrIKNS_6detail12ImageSetImplEEjjRKNS_25OpenGLPixelTransferParamsE(i32 noundef %150, ptr noundef %20, i32 noundef %153, i32 noundef %154, ptr noundef nonnull align 4 dereferenceable(12) %12)
          to label %155 unwind label %156

155:                                              ; preds = %149
  call void @_ZNSt12__shared_ptrIKN5glimg6detail12ImageSetImplELN9__gnu_cxx12_Lock_policyE2EED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %20) #5
  br label %160

156:                                              ; preds = %149
  %157 = landingpad { ptr, i32 }
          cleanup
  %158 = extractvalue { ptr, i32 } %157, 0
  store ptr %158, ptr %7, align 8
  %159 = extractvalue { ptr, i32 } %157, 1
  store i32 %159, ptr %8, align 4
  call void @_ZNSt12__shared_ptrIKN5glimg6detail12ImageSetImplELN9__gnu_cxx12_Lock_policyE2EED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %20) #5
  br label %161

160:                                              ; preds = %155, %144, %133, %122, %111, %100, %89, %72
  call void @llvm.lifetime.end.p0(i64 12, ptr %12) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #5
  call void @llvm.lifetime.end.p0(i64 20, ptr %10) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #5
  ret void

161:                                              ; preds = %156, %145, %134, %123, %112, %101, %90
  call void @llvm.lifetime.end.p0(i64 12, ptr %12) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #5
  call void @llvm.lifetime.end.p0(i64 20, ptr %10) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #5
  br label %162

162:                                              ; preds = %161, %55, %29
  %163 = load ptr, ptr %7, align 8
  %164 = load i32, ptr %8, align 4
  %165 = insertvalue { ptr, i32 } poison, ptr %163, 0
  %166 = insertvalue { ptr, i32 } %165, i32 %164, 1
  resume { ptr, i32 } %166
}

declare i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress uwtable
declare hidden noundef zeroext i1 @_ZN5glimg12_GLOBAL__N_125IsTextureStorageSupportedEv() #0

declare ptr @__cxa_allocate_exception(i64)

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN5glimg25CannotForceTextureStorageC2Ev(ptr noundef nonnull align 8 dereferenceable(40)) unnamed_addr #0 align 2

declare void @__cxa_free_exception(ptr)

declare void @__cxa_throw(ptr, ptr, ptr)

; Function Attrs: mustprogress nounwind uwtable
declare hidden noundef zeroext i1 @_ZN5glimg12_GLOBAL__N_128IsDirectStateAccessSupportedEv() #3

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN5glimg19CannotForceDSAUsageC2Ev(ptr noundef nonnull align 8 dereferenceable(40)) unnamed_addr #0 align 2

declare void @_ZNK5glimg8ImageSet9GetFormatEv(ptr dead_on_unwind writable sret(%"class.glimg::ImageFormat") align 4, ptr noundef nonnull align 8 dereferenceable(16)) #4

; Function Attrs: mustprogress uwtable
declare hidden void @_ZN5glimg12_GLOBAL__N_114Build1DTextureEjSt10shared_ptrIKNS_6detail12ImageSetImplEEjjRKNS_25OpenGLPixelTransferParamsE(i32 noundef, ptr noundef, i32 noundef, i32 noundef, ptr noundef nonnull align 4 dereferenceable(12)) #0

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

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

; Function Attrs: mustprogress uwtable
declare hidden void @_ZN5glimg12_GLOBAL__N_114Build2DTextureEjSt10shared_ptrIKNS_6detail12ImageSetImplEEjjRKNS_25OpenGLPixelTransferParamsE(i32 noundef, ptr noundef, i32 noundef, i32 noundef, ptr noundef nonnull align 4 dereferenceable(12)) #0

; Function Attrs: mustprogress uwtable
declare hidden void @_ZN5glimg12_GLOBAL__N_114Build3DTextureEjSt10shared_ptrIKNS_6detail12ImageSetImplEEjjRKNS_25OpenGLPixelTransferParamsE(i32 noundef, ptr noundef, i32 noundef, i32 noundef, ptr noundef nonnull align 4 dereferenceable(12)) #0

; Function Attrs: mustprogress uwtable
declare hidden void @_ZN5glimg12_GLOBAL__N_119Build1DArrayTextureEjSt10shared_ptrIKNS_6detail12ImageSetImplEEjjRKNS_25OpenGLPixelTransferParamsE(i32 noundef, ptr noundef, i32 noundef, i32 noundef, ptr noundef nonnull align 4 dereferenceable(12)) #0

; Function Attrs: mustprogress uwtable
declare hidden void @_ZN5glimg12_GLOBAL__N_119Build2DArrayTextureEjSt10shared_ptrIKNS_6detail12ImageSetImplEEjjRKNS_25OpenGLPixelTransferParamsE(i32 noundef, ptr noundef, i32 noundef, i32 noundef, ptr noundef nonnull align 4 dereferenceable(12)) #0

; Function Attrs: mustprogress uwtable
declare hidden void @_ZN5glimg12_GLOBAL__N_118Build2DCubeTextureEjSt10shared_ptrIKNS_6detail12ImageSetImplEEjjRKNS_25OpenGLPixelTransferParamsE(i32 noundef, ptr noundef, i32 noundef, i32 noundef, ptr noundef nonnull align 4 dereferenceable(12)) #0

; Function Attrs: mustprogress uwtable
declare hidden void @_ZN5glimg12_GLOBAL__N_123Build2DCubeArrayTextureEjSt10shared_ptrIKNS_6detail12ImageSetImplEEjjRKNS_25OpenGLPixelTransferParamsE(i32 noundef, ptr noundef, i32 noundef, i32 noundef, ptr noundef nonnull align 4 dereferenceable(12)) #0

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

attributes #0 = { 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 #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { 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 #4 = { "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 = { nounwind }
attributes #6 = { 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 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"any pointer", !7, 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.glimg::ImageFormat" = type { %"struct.glimg::UncheckedImageFormat" }
%"struct.glimg::UncheckedImageFormat" = type { i32, i32, i32, i32, i32 }
%"struct.glimg::OpenGLPixelTransferParams" = type { i32, i32, i32 }
%"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 }

@_ZTIN5glimg25CannotForceTextureStorageE = external dso_local constant { ptr, ptr, ptr }, align 8
@_ZTIN5glimg19CannotForceDSAUsageE = external dso_local constant { ptr, ptr, ptr }, align 8

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_ZN5glimg17GetInternalFormatERKNS_11ImageFormatEj(ptr noundef nonnull align 4 dereferenceable(20), i32 noundef) local_unnamed_addr #0

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

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

; Function Attrs: mustprogress uwtable
declare dso_local { i64, i32 } @_ZN5glimg19GetUploadFormatTypeERKNS_11ImageFormatEj(ptr noundef nonnull align 4 dereferenceable(20), i32 noundef) local_unnamed_addr #0

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_ZN5glimg14GetTextureTypeEPKNS_8ImageSetEj(ptr noundef, i32 noundef) local_unnamed_addr #0

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN5glimg13CreateTextureEjPKNS_8ImageSetEj(i32 noundef %0, ptr noundef %1, i32 noundef %2) local_unnamed_addr #0 personality ptr @__gxx_personality_v0 {
  %4 = alloca %"class.glimg::ImageFormat", align 4
  %5 = alloca %"struct.glimg::OpenGLPixelTransferParams", align 8
  %6 = alloca %"class.std::shared_ptr", align 8
  %7 = alloca %"class.std::shared_ptr", align 8
  %8 = alloca %"class.std::shared_ptr", align 8
  %9 = alloca %"class.std::shared_ptr", align 8
  %10 = alloca %"class.std::shared_ptr", align 8
  %11 = alloca %"class.std::shared_ptr", align 8
  %12 = alloca %"class.std::shared_ptr", align 8
  %13 = and i32 %2, 512
  %.not = icmp eq i32 %13, 0
  br i1 %.not, label %23, label %14

14:                                               ; preds = %3
  %15 = tail call noundef zeroext i1 @_ZN5glimg12_GLOBAL__N_125IsTextureStorageSupportedEv()
  br i1 %15, label %21, label %16

16:                                               ; preds = %14
  %17 = tail call ptr @__cxa_allocate_exception(i64 40) #4
  invoke void @_ZN5glimg25CannotForceTextureStorageC2Ev(ptr noundef nonnull align 8 dereferenceable(40) %17)
          to label %18 unwind label %19

18:                                               ; preds = %16
  tail call void @__cxa_throw(ptr nonnull %17, ptr nonnull @_ZTIN5glimg25CannotForceTextureStorageE, ptr nonnull @_ZN5glimg26TextureGenerationExceptionD2Ev) #5
  unreachable

19:                                               ; preds = %16
  %20 = landingpad { ptr, i32 }
          cleanup
  tail call void @__cxa_free_exception(ptr %17) #4
  br label %71

21:                                               ; preds = %14
  %22 = or i32 %2, 256
  br label %23

23:                                               ; preds = %21, %3
  %.0 = phi i32 [ %22, %21 ], [ %2, %3 ]
  %24 = and i32 %.0, 256
  %.not48 = icmp eq i32 %24, 0
  br i1 %.not48, label %28, label %25

25:                                               ; preds = %23
  %26 = tail call noundef zeroext i1 @_ZN5glimg12_GLOBAL__N_125IsTextureStorageSupportedEv()
  %27 = and i32 %.0, -257
  %spec.select = select i1 %26, i32 %.0, i32 %27
  br label %28

28:                                               ; preds = %25, %23
  %.1 = phi i32 [ %.0, %23 ], [ %spec.select, %25 ]
  %29 = and i32 %.1, 2048
  %.not49 = icmp eq i32 %29, 0
  br i1 %.not49, label %39, label %30

30:                                               ; preds = %28
  %31 = tail call noundef zeroext i1 @_ZN5glimg12_GLOBAL__N_128IsDirectStateAccessSupportedEv()
  br i1 %31, label %37, label %32

32:                                               ; preds = %30
  %33 = tail call ptr @__cxa_allocate_exception(i64 40) #4
  invoke void @_ZN5glimg19CannotForceDSAUsageC2Ev(ptr noundef nonnull align 8 dereferenceable(40) %33)
          to label %34 unwind label %35

34:                                               ; preds = %32
  tail call void @__cxa_throw(ptr nonnull %33, ptr nonnull @_ZTIN5glimg19CannotForceDSAUsageE, ptr nonnull @_ZN5glimg26TextureGenerationExceptionD2Ev) #5
  unreachable

35:                                               ; preds = %32
  %36 = landingpad { ptr, i32 }
          cleanup
  tail call void @__cxa_free_exception(ptr %33) #4
  br label %71

37:                                               ; preds = %30
  %38 = or i32 %.1, 1024
  br label %39

39:                                               ; preds = %37, %28
  %.2 = phi i32 [ %38, %37 ], [ %.1, %28 ]
  %40 = and i32 %.2, 1024
  %.not50 = icmp eq i32 %40, 0
  br i1 %.not50, label %44, label %41

41:                                               ; preds = %39
  %42 = tail call noundef zeroext i1 @_ZN5glimg12_GLOBAL__N_128IsDirectStateAccessSupportedEv()
  %43 = and i32 %.2, -1025
  %spec.select53 = select i1 %42, i32 %.2, i32 %43
  br label %44

44:                                               ; preds = %41, %39
  %.3 = phi i32 [ %.2, %39 ], [ %spec.select53, %41 ]
  call void @llvm.lifetime.start.p0(i64 20, ptr nonnull %4) #4
  call void @_ZNK5glimg8ImageSet9GetFormatEv(ptr dead_on_unwind nonnull writable sret(%"class.glimg::ImageFormat") align 4 %4, ptr noundef nonnull align 8 dereferenceable(16) %1)
  %45 = call noundef i32 @_ZN5glimg17GetInternalFormatERKNS_11ImageFormatEj(ptr noundef nonnull align 4 dereferenceable(20) %4, i32 noundef %.3)
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %5) #4
  %46 = call { i64, i32 } @_ZN5glimg19GetUploadFormatTypeERKNS_11ImageFormatEj(ptr noundef nonnull align 4 dereferenceable(20) %4, i32 noundef %.3)
  %.fca.0.extract = extractvalue { i64, i32 } %46, 0
  %.fca.1.extract = extractvalue { i64, i32 } %46, 1
  store i64 %.fca.0.extract, ptr %5, align 8
  %.sroa.2.0..sroa_idx = getelementptr inbounds i8, ptr %5, i64 8
  store i32 %.fca.1.extract, ptr %.sroa.2.0..sroa_idx, align 8
  %47 = call noundef i32 @_ZN5glimg14GetTextureTypeEPKNS_8ImageSetEj(ptr noundef nonnull %1, i32 noundef %.3)
  switch i32 %47, label %69 [
    i32 3552, label %48
    i32 3553, label %51
    i32 32879, label %54
    i32 35864, label %57
    i32 35866, label %60
    i32 34067, label %63
    i32 36873, label %66
  ]

48:                                               ; preds = %44
  call void @_ZNSt10shared_ptrIKN5glimg6detail12ImageSetImplEEC2ERKS4_(ptr noundef nonnull align 8 dereferenceable(16) %6, ptr noundef nonnull align 8 dereferenceable(16) %1) #4
  invoke void @_ZN5glimg12_GLOBAL__N_114Build1DTextureEjSt10shared_ptrIKNS_6detail12ImageSetImplEEjjRKNS_25OpenGLPixelTransferParamsE(i32 noundef %0, ptr noundef nonnull %6, i32 noundef %.3, i32 noundef %45, ptr noundef nonnull align 4 dereferenceable(12) %5)
          to label %.sink.split unwind label %49

49:                                               ; preds = %48
  %50 = landingpad { ptr, i32 }
          cleanup
  br label %70

51:                                               ; preds = %44
  call void @_ZNSt10shared_ptrIKN5glimg6detail12ImageSetImplEEC2ERKS4_(ptr noundef nonnull align 8 dereferenceable(16) %7, ptr noundef nonnull align 8 dereferenceable(16) %1) #4
  invoke void @_ZN5glimg12_GLOBAL__N_114Build2DTextureEjSt10shared_ptrIKNS_6detail12ImageSetImplEEjjRKNS_25OpenGLPixelTransferParamsE(i32 noundef %0, ptr noundef nonnull %7, i32 noundef %.3, i32 noundef %45, ptr noundef nonnull align 4 dereferenceable(12) %5)
          to label %.sink.split unwind label %52

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

54:                                               ; preds = %44
  call void @_ZNSt10shared_ptrIKN5glimg6detail12ImageSetImplEEC2ERKS4_(ptr noundef nonnull align 8 dereferenceable(16) %8, ptr noundef nonnull align 8 dereferenceable(16) %1) #4
  invoke void @_ZN5glimg12_GLOBAL__N_114Build3DTextureEjSt10shared_ptrIKNS_6detail12ImageSetImplEEjjRKNS_25OpenGLPixelTransferParamsE(i32 noundef %0, ptr noundef nonnull %8, i32 noundef %.3, i32 noundef %45, ptr noundef nonnull align 4 dereferenceable(12) %5)
          to label %.sink.split unwind label %55

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

57:                                               ; preds = %44
  call void @_ZNSt10shared_ptrIKN5glimg6detail12ImageSetImplEEC2ERKS4_(ptr noundef nonnull align 8 dereferenceable(16) %9, ptr noundef nonnull align 8 dereferenceable(16) %1) #4
  invoke void @_ZN5glimg12_GLOBAL__N_119Build1DArrayTextureEjSt10shared_ptrIKNS_6detail12ImageSetImplEEjjRKNS_25OpenGLPixelTransferParamsE(i32 noundef %0, ptr noundef nonnull %9, i32 noundef %.3, i32 noundef %45, ptr noundef nonnull align 4 dereferenceable(12) %5)
          to label %.sink.split unwind label %58

58:                                               ; preds = %57
  %59 = landingpad { ptr, i32 }
          cleanup
  br label %70

60:                                               ; preds = %44
  call void @_ZNSt10shared_ptrIKN5glimg6detail12ImageSetImplEEC2ERKS4_(ptr noundef nonnull align 8 dereferenceable(16) %10, ptr noundef nonnull align 8 dereferenceable(16) %1) #4
  invoke void @_ZN5glimg12_GLOBAL__N_119Build2DArrayTextureEjSt10shared_ptrIKNS_6detail12ImageSetImplEEjjRKNS_25OpenGLPixelTransferParamsE(i32 noundef %0, ptr noundef nonnull %10, i32 noundef %.3, i32 noundef %45, ptr noundef nonnull align 4 dereferenceable(12) %5)
          to label %.sink.split unwind label %61

61:                                               ; preds = %60
  %62 = landingpad { ptr, i32 }
          cleanup
  br label %70

63:                                               ; preds = %44
  call void @_ZNSt10shared_ptrIKN5glimg6detail12ImageSetImplEEC2ERKS4_(ptr noundef nonnull align 8 dereferenceable(16) %11, ptr noundef nonnull align 8 dereferenceable(16) %1) #4
  invoke void @_ZN5glimg12_GLOBAL__N_118Build2DCubeTextureEjSt10shared_ptrIKNS_6detail12ImageSetImplEEjjRKNS_25OpenGLPixelTransferParamsE(i32 noundef %0, ptr noundef nonnull %11, i32 noundef %.3, i32 noundef %45, ptr noundef nonnull align 4 dereferenceable(12) %5)
          to label %.sink.split unwind label %64

64:                                               ; preds = %63
  %65 = landingpad { ptr, i32 }
          cleanup
  br label %70

66:                                               ; preds = %44
  call void @_ZNSt10shared_ptrIKN5glimg6detail12ImageSetImplEEC2ERKS4_(ptr noundef nonnull align 8 dereferenceable(16) %12, ptr noundef nonnull align 8 dereferenceable(16) %1) #4
  invoke void @_ZN5glimg12_GLOBAL__N_123Build2DCubeArrayTextureEjSt10shared_ptrIKNS_6detail12ImageSetImplEEjjRKNS_25OpenGLPixelTransferParamsE(i32 noundef %0, ptr noundef nonnull %12, i32 noundef %.3, i32 noundef %45, ptr noundef nonnull align 4 dereferenceable(12) %5)
          to label %.sink.split unwind label %67

67:                                               ; preds = %66
  %68 = landingpad { ptr, i32 }
          cleanup
  br label %70

.sink.split:                                      ; preds = %66, %63, %60, %57, %54, %51, %48
  %.sink = phi ptr [ %6, %48 ], [ %7, %51 ], [ %8, %54 ], [ %9, %57 ], [ %10, %60 ], [ %11, %63 ], [ %12, %66 ]
  call void @_ZNSt12__shared_ptrIKN5glimg6detail12ImageSetImplELN9__gnu_cxx12_Lock_policyE2EED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %.sink) #4
  br label %69

69:                                               ; preds = %.sink.split, %44
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %5) #4
  call void @llvm.lifetime.end.p0(i64 20, ptr nonnull %4) #4
  ret void

70:                                               ; preds = %67, %64, %61, %58, %55, %52, %49
  %.sink54 = phi ptr [ %12, %67 ], [ %11, %64 ], [ %10, %61 ], [ %9, %58 ], [ %8, %55 ], [ %7, %52 ], [ %6, %49 ]
  %.pn = phi { ptr, i32 } [ %68, %67 ], [ %65, %64 ], [ %62, %61 ], [ %59, %58 ], [ %56, %55 ], [ %53, %52 ], [ %50, %49 ]
  call void @_ZNSt12__shared_ptrIKN5glimg6detail12ImageSetImplELN9__gnu_cxx12_Lock_policyE2EED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %.sink54) #4
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %5) #4
  call void @llvm.lifetime.end.p0(i64 20, ptr nonnull %4) #4
  br label %71

71:                                               ; preds = %70, %35, %19
  %.pn.pn = phi { ptr, i32 } [ %.pn, %70 ], [ %36, %35 ], [ %20, %19 ]
  resume { ptr, i32 } %.pn.pn
}

declare i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress uwtable
declare hidden noundef zeroext i1 @_ZN5glimg12_GLOBAL__N_125IsTextureStorageSupportedEv() local_unnamed_addr #0

declare ptr @__cxa_allocate_exception(i64) local_unnamed_addr

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN5glimg25CannotForceTextureStorageC2Ev(ptr noundef nonnull align 8 dereferenceable(40)) unnamed_addr #0 align 2

declare void @__cxa_free_exception(ptr) local_unnamed_addr

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

; Function Attrs: mustprogress nounwind uwtable
declare hidden noundef zeroext i1 @_ZN5glimg12_GLOBAL__N_128IsDirectStateAccessSupportedEv() local_unnamed_addr #2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN5glimg19CannotForceDSAUsageC2Ev(ptr noundef nonnull align 8 dereferenceable(40)) unnamed_addr #0 align 2

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

; Function Attrs: mustprogress uwtable
declare hidden void @_ZN5glimg12_GLOBAL__N_114Build1DTextureEjSt10shared_ptrIKNS_6detail12ImageSetImplEEjjRKNS_25OpenGLPixelTransferParamsE(i32 noundef, ptr noundef, i32 noundef, i32 noundef, ptr noundef nonnull align 4 dereferenceable(12)) local_unnamed_addr #0

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

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

; Function Attrs: mustprogress uwtable
declare hidden void @_ZN5glimg12_GLOBAL__N_114Build2DTextureEjSt10shared_ptrIKNS_6detail12ImageSetImplEEjjRKNS_25OpenGLPixelTransferParamsE(i32 noundef, ptr noundef, i32 noundef, i32 noundef, ptr noundef nonnull align 4 dereferenceable(12)) local_unnamed_addr #0

; Function Attrs: mustprogress uwtable
declare hidden void @_ZN5glimg12_GLOBAL__N_114Build3DTextureEjSt10shared_ptrIKNS_6detail12ImageSetImplEEjjRKNS_25OpenGLPixelTransferParamsE(i32 noundef, ptr noundef, i32 noundef, i32 noundef, ptr noundef nonnull align 4 dereferenceable(12)) local_unnamed_addr #0

; Function Attrs: mustprogress uwtable
declare hidden void @_ZN5glimg12_GLOBAL__N_119Build1DArrayTextureEjSt10shared_ptrIKNS_6detail12ImageSetImplEEjjRKNS_25OpenGLPixelTransferParamsE(i32 noundef, ptr noundef, i32 noundef, i32 noundef, ptr noundef nonnull align 4 dereferenceable(12)) local_unnamed_addr #0

; Function Attrs: mustprogress uwtable
declare hidden void @_ZN5glimg12_GLOBAL__N_119Build2DArrayTextureEjSt10shared_ptrIKNS_6detail12ImageSetImplEEjjRKNS_25OpenGLPixelTransferParamsE(i32 noundef, ptr noundef, i32 noundef, i32 noundef, ptr noundef nonnull align 4 dereferenceable(12)) local_unnamed_addr #0

; Function Attrs: mustprogress uwtable
declare hidden void @_ZN5glimg12_GLOBAL__N_118Build2DCubeTextureEjSt10shared_ptrIKNS_6detail12ImageSetImplEEjjRKNS_25OpenGLPixelTransferParamsE(i32 noundef, ptr noundef, i32 noundef, i32 noundef, ptr noundef nonnull align 4 dereferenceable(12)) local_unnamed_addr #0

; Function Attrs: mustprogress uwtable
declare hidden void @_ZN5glimg12_GLOBAL__N_123Build2DCubeArrayTextureEjSt10shared_ptrIKNS_6detail12ImageSetImplEEjjRKNS_25OpenGLPixelTransferParamsE(i32 noundef, ptr noundef, i32 noundef, i32 noundef, ptr noundef nonnull align 4 dereferenceable(12)) local_unnamed_addr #0

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

attributes #0 = { 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 #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { "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 }
attributes #5 = { 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)"}


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