; LLVM IR from steps3d/graphics-book :: Code/Libs/SOIL (SOIL)

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

%struct.DDS_header = type { i32, i32, i32, i32, i32, i32, i32, i32, [11 x i32], %struct.anon, %struct.anon.0, i32 }
%struct.anon = type { i32, i32, i32, i32, i32, i32, i32, i32 }
%struct.anon.0 = type { i32, i32, i32, i32 }

@result_string_pointer = external dso_local global ptr, align 8
@__glewCompressedTexImage2D = external global ptr, align 8
@__glewTexImage3D = external global ptr, align 8
@.str.26 = external hidden unnamed_addr constant [12 x i8], align 1
@.str.27 = external hidden unnamed_addr constant [49 x i8], align 1
@.str.28 = external hidden unnamed_addr constant [34 x i8], align 1
@.str.29 = external hidden unnamed_addr constant [32 x i8], align 1
@.str.30 = external hidden unnamed_addr constant [64 x i8], align 1
@.str.31 = external hidden unnamed_addr constant [24 x i8], align 1
@.str.32 = external hidden unnamed_addr constant [67 x i8], align 1
@.str.33 = external hidden unnamed_addr constant [28 x i8], align 1
@__glewCompressedTexImage3D = external global ptr, align 8
@.str.34 = external hidden unnamed_addr constant [16 x i8], align 1
@.str.35 = external hidden unnamed_addr constant [47 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

; Function Attrs: nounwind uwtable
declare dso_local void @SOIL_free_image_data(ptr noundef) #1

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

; Function Attrs: nounwind uwtable
define dso_local i32 @SOIL_direct_load_DDS_from_memory(ptr noundef %0, i64 noundef %1, i32 noundef %2, i32 noundef %3, i32 noundef %4) #1 {
  %6 = alloca i32, align 4
  %7 = alloca ptr, align 8
  %8 = alloca i64, align 8
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca %struct.DDS_header, align 4
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  %15 = alloca i32, align 4
  %16 = alloca ptr, align 8
  %17 = alloca i32, align 4
  %18 = alloca i32, align 4
  %19 = alloca i32, align 4
  %20 = alloca i32, align 4
  %21 = alloca i32, align 4
  %22 = alloca i32, align 4
  %23 = alloca i32, align 4
  %24 = alloca i32, align 4
  %25 = alloca i32, align 4
  %26 = alloca i32, align 4
  %27 = alloca i32, align 4
  %28 = alloca i32, align 4
  %29 = alloca i32, align 4
  %30 = alloca i32, align 4
  %31 = alloca i32, align 4
  %32 = alloca i32, align 4
  %33 = alloca i32, align 4
  %34 = alloca i32, align 4
  %35 = alloca i32, align 4
  %36 = alloca i32, align 4
  %37 = alloca i32, align 4
  %38 = alloca i32, align 4
  %39 = alloca i8, align 1
  %40 = alloca i32, align 4
  %41 = alloca i32, align 4
  %42 = alloca i32, align 4
  %43 = alloca i32, align 4
  %44 = alloca i32, align 4
  store ptr %0, ptr %7, align 8, !tbaa !5
  store i64 %1, ptr %8, align 8, !tbaa !9
  store i32 %2, ptr %9, align 4, !tbaa !11
  store i32 %3, ptr %10, align 4, !tbaa !11
  store i32 %4, ptr %11, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 128, ptr %12) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #5
  store i32 0, ptr %13, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #5
  store i32 0, ptr %14, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #5
  store i32 0, ptr %15, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %20) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %21) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %22) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %23) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %24) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %25) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %26) #5
  store i32 16, ptr %26, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %27) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %28) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %29) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %30) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %31) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %32) #5
  %45 = load ptr, ptr @__glewTexImage3D, align 8, !tbaa !5
  %46 = icmp eq ptr %45, null
  br i1 %46, label %47, label %49

47:                                               ; preds = %5
  %48 = call i32 @query_DXT_capability()
  br label %49

49:                                               ; preds = %47, %5
  %50 = load ptr, ptr %7, align 8, !tbaa !5
  %51 = icmp eq ptr null, %50
  br i1 %51, label %52, label %53

52:                                               ; preds = %49
  store ptr @.str.26, ptr @result_string_pointer, align 8, !tbaa !5
  store i32 0, ptr %6, align 4
  store i32 1, ptr %33, align 4
  br label %527

53:                                               ; preds = %49
  %54 = load i64, ptr %8, align 8, !tbaa !9
  %55 = icmp ult i64 %54, 128
  br i1 %55, label %56, label %57

56:                                               ; preds = %53
  store ptr @.str.27, ptr @result_string_pointer, align 8, !tbaa !5
  store i32 0, ptr %6, align 4
  store i32 1, ptr %33, align 4
  br label %527

57:                                               ; preds = %53
  %58 = load ptr, ptr %7, align 8, !tbaa !5
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %12, ptr align 1 %58, i64 128, i1 false)
  store i32 128, ptr %13, align 4, !tbaa !11
  store ptr @.str.28, ptr @result_string_pointer, align 8, !tbaa !5
  store i32 542327876, ptr %27, align 4, !tbaa !11
  %59 = getelementptr inbounds %struct.DDS_header, ptr %12, i32 0, i32 0
  %60 = load i32, ptr %59, align 4, !tbaa !13
  %61 = load i32, ptr %27, align 4, !tbaa !11
  %62 = icmp ne i32 %60, %61
  br i1 %62, label %63, label %64

63:                                               ; preds = %57
  br label %525

64:                                               ; preds = %57
  %65 = getelementptr inbounds %struct.DDS_header, ptr %12, i32 0, i32 1
  %66 = load i32, ptr %65, align 4, !tbaa !17
  %67 = icmp ne i32 %66, 124
  br i1 %67, label %68, label %69

68:                                               ; preds = %64
  br label %525

69:                                               ; preds = %64
  store i32 4103, ptr %27, align 4, !tbaa !11
  %70 = getelementptr inbounds %struct.DDS_header, ptr %12, i32 0, i32 2
  %71 = load i32, ptr %70, align 4, !tbaa !18
  %72 = load i32, ptr %27, align 4, !tbaa !11
  %73 = and i32 %71, %72
  %74 = load i32, ptr %27, align 4, !tbaa !11
  %75 = icmp ne i32 %73, %74
  br i1 %75, label %76, label %77

76:                                               ; preds = %69
  br label %525

77:                                               ; preds = %69
  store i32 68, ptr %27, align 4, !tbaa !11
  %78 = getelementptr inbounds %struct.DDS_header, ptr %12, i32 0, i32 9
  %79 = getelementptr inbounds %struct.anon, ptr %78, i32 0, i32 1
  %80 = load i32, ptr %79, align 4, !tbaa !19
  %81 = load i32, ptr %27, align 4, !tbaa !11
  %82 = and i32 %80, %81
  %83 = icmp eq i32 %82, 0
  br i1 %83, label %84, label %85

84:                                               ; preds = %77
  br label %525

85:                                               ; preds = %77
  %86 = getelementptr inbounds %struct.DDS_header, ptr %12, i32 0, i32 9
  %87 = getelementptr inbounds %struct.anon, ptr %86, i32 0, i32 0
  %88 = load i32, ptr %87, align 4, !tbaa !20
  %89 = icmp ne i32 %88, 32
  br i1 %89, label %90, label %91

90:                                               ; preds = %85
  br label %525

91:                                               ; preds = %85
  %92 = getelementptr inbounds %struct.DDS_header, ptr %12, i32 0, i32 10
  %93 = getelementptr inbounds %struct.anon.0, ptr %92, i32 0, i32 0
  %94 = load i32, ptr %93, align 4, !tbaa !21
  %95 = and i32 %94, 4096
  %96 = icmp eq i32 %95, 0
  br i1 %96, label %97, label %98

97:                                               ; preds = %91
  br label %525

98:                                               ; preds = %91
  %99 = getelementptr inbounds %struct.DDS_header, ptr %12, i32 0, i32 9
  %100 = getelementptr inbounds %struct.anon, ptr %99, i32 0, i32 1
  %101 = load i32, ptr %100, align 4, !tbaa !19
  %102 = and i32 %101, 4
  %103 = icmp ne i32 %102, 0
  br i1 %103, label %104, label %120

104:                                              ; preds = %98
  %105 = getelementptr inbounds %struct.DDS_header, ptr %12, i32 0, i32 9
  %106 = getelementptr inbounds %struct.anon, ptr %105, i32 0, i32 2
  %107 = load i32, ptr %106, align 4, !tbaa !22
  %108 = icmp eq i32 %107, 827611204
  br i1 %108, label %120, label %109

109:                                              ; preds = %104
  %110 = getelementptr inbounds %struct.DDS_header, ptr %12, i32 0, i32 9
  %111 = getelementptr inbounds %struct.anon, ptr %110, i32 0, i32 2
  %112 = load i32, ptr %111, align 4, !tbaa !22
  %113 = icmp eq i32 %112, 861165636
  br i1 %113, label %120, label %114

114:                                              ; preds = %109
  %115 = getelementptr inbounds %struct.DDS_header, ptr %12, i32 0, i32 9
  %116 = getelementptr inbounds %struct.anon, ptr %115, i32 0, i32 2
  %117 = load i32, ptr %116, align 4, !tbaa !22
  %118 = icmp eq i32 %117, 894720068
  br i1 %118, label %120, label %119

119:                                              ; preds = %114
  br label %525

120:                                              ; preds = %114, %109, %104, %98
  store ptr @.str.29, ptr @result_string_pointer, align 8, !tbaa !5
  %121 = getelementptr inbounds %struct.DDS_header, ptr %12, i32 0, i32 4
  %122 = load i32, ptr %121, align 4, !tbaa !23
  store i32 %122, ptr %19, align 4, !tbaa !11
  %123 = getelementptr inbounds %struct.DDS_header, ptr %12, i32 0, i32 3
  %124 = load i32, ptr %123, align 4, !tbaa !24
  store i32 %124, ptr %20, align 4, !tbaa !11
  %125 = getelementptr inbounds %struct.DDS_header, ptr %12, i32 0, i32 6
  %126 = load i32, ptr %125, align 4, !tbaa !25
  store i32 %126, ptr %21, align 4, !tbaa !11
  %127 = getelementptr inbounds %struct.DDS_header, ptr %12, i32 0, i32 9
  %128 = getelementptr inbounds %struct.anon, ptr %127, i32 0, i32 1
  %129 = load i32, ptr %128, align 4, !tbaa !19
  %130 = and i32 %129, 4
  %131 = udiv i32 %130, 4
  %132 = sub i32 1, %131
  store i32 %132, ptr %25, align 4, !tbaa !11
  %133 = getelementptr inbounds %struct.DDS_header, ptr %12, i32 0, i32 10
  %134 = getelementptr inbounds %struct.anon.0, ptr %133, i32 0, i32 1
  %135 = load i32, ptr %134, align 4, !tbaa !26
  %136 = and i32 %135, 512
  %137 = udiv i32 %136, 512
  store i32 %137, ptr %23, align 4, !tbaa !11
  %138 = getelementptr inbounds %struct.DDS_header, ptr %12, i32 0, i32 2
  %139 = load i32, ptr %138, align 4, !tbaa !18
  %140 = and i32 %139, 8388608
  store i32 %140, ptr %24, align 4, !tbaa !11
  %141 = load i32, ptr %25, align 4, !tbaa !11
  %142 = icmp ne i32 %141, 0
  br i1 %142, label %143, label %158

143:                                              ; preds = %120
  store i32 6407, ptr %15, align 4, !tbaa !11
  store i32 3, ptr %26, align 4, !tbaa !11
  %144 = getelementptr inbounds %struct.DDS_header, ptr %12, i32 0, i32 9
  %145 = getelementptr inbounds %struct.anon, ptr %144, i32 0, i32 1
  %146 = load i32, ptr %145, align 4, !tbaa !19
  %147 = and i32 %146, 1
  %148 = icmp ne i32 %147, 0
  br i1 %148, label %149, label %150

149:                                              ; preds = %143
  store i32 6408, ptr %15, align 4, !tbaa !11
  store i32 4, ptr %26, align 4, !tbaa !11
  br label %150

150:                                              ; preds = %149, %143
  %151 = load i32, ptr %21, align 4, !tbaa !11
  %152 = load i32, ptr %19, align 4, !tbaa !11
  %153 = mul i32 %151, %152
  %154 = load i32, ptr %20, align 4, !tbaa !11
  %155 = mul i32 %153, %154
  %156 = load i32, ptr %26, align 4, !tbaa !11
  %157 = mul i32 %155, %156
  store i32 %157, ptr %17, align 4, !tbaa !11
  br label %181

158:                                              ; preds = %120
  %159 = call i32 @query_DXT_capability()
  %160 = icmp ne i32 %159, 1
  br i1 %160, label %161, label %162

161:                                              ; preds = %158
  store ptr @.str.30, ptr @result_string_pointer, align 8, !tbaa !5
  store i32 0, ptr %6, align 4
  store i32 1, ptr %33, align 4
  br label %527

162:                                              ; preds = %158
  %163 = getelementptr inbounds %struct.DDS_header, ptr %12, i32 0, i32 9
  %164 = getelementptr inbounds %struct.anon, ptr %163, i32 0, i32 2
  %165 = load i32, ptr %164, align 4, !tbaa !22
  %166 = lshr i32 %165, 24
  %167 = sub i32 %166, 48
  switch i32 %167, label %171 [
    i32 1, label %168
    i32 3, label %169
    i32 5, label %170
  ]

168:                                              ; preds = %162
  store i32 33777, ptr %15, align 4, !tbaa !11
  store i32 8, ptr %26, align 4, !tbaa !11
  br label %171

169:                                              ; preds = %162
  store i32 33778, ptr %15, align 4, !tbaa !11
  store i32 16, ptr %26, align 4, !tbaa !11
  br label %171

170:                                              ; preds = %162
  store i32 33779, ptr %15, align 4, !tbaa !11
  store i32 16, ptr %26, align 4, !tbaa !11
  br label %171

171:                                              ; preds = %170, %169, %168, %162
  %172 = load i32, ptr %19, align 4, !tbaa !11
  %173 = add i32 %172, 3
  %174 = lshr i32 %173, 2
  %175 = load i32, ptr %20, align 4, !tbaa !11
  %176 = add i32 %175, 3
  %177 = lshr i32 %176, 2
  %178 = mul i32 %174, %177
  %179 = load i32, ptr %26, align 4, !tbaa !11
  %180 = mul i32 %178, %179
  store i32 %180, ptr %17, align 4, !tbaa !11
  br label %181

181:                                              ; preds = %171, %150
  %182 = load i32, ptr %24, align 4, !tbaa !11
  %183 = icmp ne i32 %182, 0
  br i1 %183, label %184, label %185

184:                                              ; preds = %181
  store i32 32879, ptr %29, align 4, !tbaa !11
  store i32 32879, ptr %30, align 4, !tbaa !11
  store i32 32879, ptr %31, align 4, !tbaa !11
  br label %203

185:                                              ; preds = %181
  %186 = load i32, ptr %23, align 4, !tbaa !11
  %187 = icmp ne i32 %186, 0
  br i1 %187, label %188, label %197

188:                                              ; preds = %185
  %189 = load i32, ptr %11, align 4, !tbaa !11
  %190 = icmp ne i32 %189, 0
  br i1 %190, label %192, label %191

191:                                              ; preds = %188
  store ptr @.str.31, ptr @result_string_pointer, align 8, !tbaa !5
  store i32 0, ptr %6, align 4
  store i32 1, ptr %33, align 4
  br label %527

192:                                              ; preds = %188
  %193 = call i32 @query_cubemap_capability()
  %194 = icmp ne i32 %193, 1
  br i1 %194, label %195, label %196

195:                                              ; preds = %192
  store ptr @.str.32, ptr @result_string_pointer, align 8, !tbaa !5
  store i32 0, ptr %6, align 4
  store i32 1, ptr %33, align 4
  br label %527

196:                                              ; preds = %192
  store i32 34069, ptr %29, align 4, !tbaa !11
  store i32 34074, ptr %30, align 4, !tbaa !11
  store i32 34067, ptr %31, align 4, !tbaa !11
  br label %202

197:                                              ; preds = %185
  %198 = load i32, ptr %11, align 4, !tbaa !11
  %199 = icmp ne i32 %198, 0
  br i1 %199, label %200, label %201

200:                                              ; preds = %197
  store ptr @.str.33, ptr @result_string_pointer, align 8, !tbaa !5
  store i32 0, ptr %6, align 4
  store i32 1, ptr %33, align 4
  br label %527

201:                                              ; preds = %197
  store i32 3553, ptr %29, align 4, !tbaa !11
  store i32 3553, ptr %30, align 4, !tbaa !11
  store i32 3553, ptr %31, align 4, !tbaa !11
  br label %202

202:                                              ; preds = %201, %196
  br label %203

203:                                              ; preds = %202, %184
  %204 = getelementptr inbounds %struct.DDS_header, ptr %12, i32 0, i32 10
  %205 = getelementptr inbounds %struct.anon.0, ptr %204, i32 0, i32 0
  %206 = load i32, ptr %205, align 4, !tbaa !21
  %207 = and i32 %206, 4194304
  %208 = icmp ne i32 %207, 0
  br i1 %208, label %209, label %266

209:                                              ; preds = %203
  %210 = getelementptr inbounds %struct.DDS_header, ptr %12, i32 0, i32 7
  %211 = load i32, ptr %210, align 4, !tbaa !27
  %212 = icmp ugt i32 %211, 1
  br i1 %212, label %213, label %266

213:                                              ; preds = %209
  call void @llvm.lifetime.start.p0(i64 4, ptr %34) #5
  %214 = getelementptr inbounds %struct.DDS_header, ptr %12, i32 0, i32 7
  %215 = load i32, ptr %214, align 4, !tbaa !27
  %216 = sub i32 %215, 1
  store i32 %216, ptr %22, align 4, !tbaa !11
  %217 = load i32, ptr %17, align 4, !tbaa !11
  store i32 %217, ptr %18, align 4, !tbaa !11
  %218 = load i32, ptr %25, align 4, !tbaa !11
  %219 = icmp ne i32 %218, 0
  br i1 %219, label %220, label %221

220:                                              ; preds = %213
  store i32 0, ptr %34, align 4, !tbaa !11
  br label %222

221:                                              ; preds = %213
  store i32 2, ptr %34, align 4, !tbaa !11
  br label %222

222:                                              ; preds = %221, %220
  store i32 1, ptr %32, align 4, !tbaa !11
  br label %223

223:                                              ; preds = %262, %222
  %224 = load i32, ptr %32, align 4, !tbaa !11
  %225 = load i32, ptr %22, align 4, !tbaa !11
  %226 = icmp sle i32 %224, %225
  br i1 %226, label %227, label %265

227:                                              ; preds = %223
  call void @llvm.lifetime.start.p0(i64 4, ptr %35) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %36) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %37) #5
  %228 = load i32, ptr %19, align 4, !tbaa !11
  %229 = load i32, ptr %34, align 4, !tbaa !11
  %230 = load i32, ptr %32, align 4, !tbaa !11
  %231 = add nsw i32 %229, %230
  %232 = lshr i32 %228, %231
  store i32 %232, ptr %35, align 4, !tbaa !11
  %233 = load i32, ptr %20, align 4, !tbaa !11
  %234 = load i32, ptr %34, align 4, !tbaa !11
  %235 = load i32, ptr %32, align 4, !tbaa !11
  %236 = add nsw i32 %234, %235
  %237 = lshr i32 %233, %236
  store i32 %237, ptr %36, align 4, !tbaa !11
  %238 = load i32, ptr %21, align 4, !tbaa !11
  %239 = load i32, ptr %32, align 4, !tbaa !11
  %240 = lshr i32 %238, %239
  store i32 %240, ptr %37, align 4, !tbaa !11
  %241 = load i32, ptr %35, align 4, !tbaa !11
  %242 = icmp slt i32 %241, 1
  br i1 %242, label %243, label %244

243:                                              ; preds = %227
  store i32 1, ptr %35, align 4, !tbaa !11
  br label %244

244:                                              ; preds = %243, %227
  %245 = load i32, ptr %36, align 4, !tbaa !11
  %246 = icmp slt i32 %245, 1
  br i1 %246, label %247, label %248

247:                                              ; preds = %244
  store i32 1, ptr %36, align 4, !tbaa !11
  br label %248

248:                                              ; preds = %247, %244
  %249 = load i32, ptr %37, align 4, !tbaa !11
  %250 = icmp slt i32 %249, 1
  br i1 %250, label %251, label %252

251:                                              ; preds = %248
  store i32 1, ptr %37, align 4, !tbaa !11
  br label %252

252:                                              ; preds = %251, %248
  %253 = load i32, ptr %37, align 4, !tbaa !11
  %254 = load i32, ptr %35, align 4, !tbaa !11
  %255 = mul nsw i32 %253, %254
  %256 = load i32, ptr %36, align 4, !tbaa !11
  %257 = mul nsw i32 %255, %256
  %258 = load i32, ptr %26, align 4, !tbaa !11
  %259 = mul nsw i32 %257, %258
  %260 = load i32, ptr %18, align 4, !tbaa !11
  %261 = add i32 %260, %259
  store i32 %261, ptr %18, align 4, !tbaa !11
  call void @llvm.lifetime.end.p0(i64 4, ptr %37) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %36) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %35) #5
  br label %262

262:                                              ; preds = %252
  %263 = load i32, ptr %32, align 4, !tbaa !11
  %264 = add nsw i32 %263, 1
  store i32 %264, ptr %32, align 4, !tbaa !11
  br label %223, !llvm.loop !28

265:                                              ; preds = %223
  call void @llvm.lifetime.end.p0(i64 4, ptr %34) #5
  br label %268

266:                                              ; preds = %209, %203
  store i32 0, ptr %22, align 4, !tbaa !11
  %267 = load i32, ptr %17, align 4, !tbaa !11
  store i32 %267, ptr %18, align 4, !tbaa !11
  br label %268

268:                                              ; preds = %266, %265
  %269 = load i32, ptr %18, align 4, !tbaa !11
  %270 = zext i32 %269 to i64
  %271 = call noalias ptr @malloc(i64 noundef %270) #6
  store ptr %271, ptr %16, align 8, !tbaa !5
  %272 = load i32, ptr %9, align 4, !tbaa !11
  store i32 %272, ptr %14, align 4, !tbaa !11
  %273 = load i32, ptr %14, align 4, !tbaa !11
  %274 = icmp eq i32 %273, 0
  br i1 %274, label %275, label %276

275:                                              ; preds = %268
  call void @glGenTextures(i32 noundef 1, ptr noundef %14)
  br label %276

276:                                              ; preds = %275, %268
  %277 = load i32, ptr %31, align 4, !tbaa !11
  %278 = load i32, ptr %14, align 4, !tbaa !11
  call void @glBindTexture(i32 noundef %277, i32 noundef %278)
  %279 = load i32, ptr %29, align 4, !tbaa !11
  store i32 %279, ptr %28, align 4, !tbaa !11
  br label %280

280:                                              ; preds = %492, %276
  %281 = load i32, ptr %28, align 4, !tbaa !11
  %282 = load i32, ptr %30, align 4, !tbaa !11
  %283 = icmp ule i32 %281, %282
  br i1 %283, label %284, label %495

284:                                              ; preds = %280
  %285 = load i32, ptr %13, align 4, !tbaa !11
  %286 = load i32, ptr %18, align 4, !tbaa !11
  %287 = add i32 %285, %286
  %288 = zext i32 %287 to i64
  %289 = load i64, ptr %8, align 8, !tbaa !9
  %290 = icmp ule i64 %288, %289
  br i1 %290, label %291, label %488

291:                                              ; preds = %284
  call void @llvm.lifetime.start.p0(i64 4, ptr %38) #5
  %292 = load i32, ptr %17, align 4, !tbaa !11
  store i32 %292, ptr %38, align 4, !tbaa !11
  %293 = load ptr, ptr %16, align 8, !tbaa !5
  %294 = load ptr, ptr %7, align 8, !tbaa !5
  %295 = load i32, ptr %13, align 4, !tbaa !11
  %296 = zext i32 %295 to i64
  %297 = getelementptr inbounds i8, ptr %294, i64 %296
  %298 = load i32, ptr %18, align 4, !tbaa !11
  %299 = zext i32 %298 to i64
  call void @llvm.memcpy.p0.p0.i64(ptr align 1 %293, ptr align 1 %297, i64 %299, i1 false)
  %300 = load i32, ptr %18, align 4, !tbaa !11
  %301 = load i32, ptr %13, align 4, !tbaa !11
  %302 = add i32 %301, %300
  store i32 %302, ptr %13, align 4, !tbaa !11
  %303 = load i32, ptr %25, align 4, !tbaa !11
  %304 = icmp ne i32 %303, 0
  br i1 %304, label %305, label %356

305:                                              ; preds = %291
  store i32 0, ptr %32, align 4, !tbaa !11
  br label %306

306:                                              ; preds = %332, %305
  %307 = load i32, ptr %32, align 4, !tbaa !11
  %308 = load i32, ptr %18, align 4, !tbaa !11
  %309 = icmp slt i32 %307, %308
  br i1 %309, label %310, label %336

310:                                              ; preds = %306
  call void @llvm.lifetime.start.p0(i64 1, ptr %39) #5
  %311 = load ptr, ptr %16, align 8, !tbaa !5
  %312 = load i32, ptr %32, align 4, !tbaa !11
  %313 = sext i32 %312 to i64
  %314 = getelementptr inbounds i8, ptr %311, i64 %313
  %315 = load i8, ptr %314, align 1, !tbaa !30
  store i8 %315, ptr %39, align 1, !tbaa !30
  %316 = load ptr, ptr %16, align 8, !tbaa !5
  %317 = load i32, ptr %32, align 4, !tbaa !11
  %318 = add nsw i32 %317, 2
  %319 = sext i32 %318 to i64
  %320 = getelementptr inbounds i8, ptr %316, i64 %319
  %321 = load i8, ptr %320, align 1, !tbaa !30
  %322 = load ptr, ptr %16, align 8, !tbaa !5
  %323 = load i32, ptr %32, align 4, !tbaa !11
  %324 = sext i32 %323 to i64
  %325 = getelementptr inbounds i8, ptr %322, i64 %324
  store i8 %321, ptr %325, align 1, !tbaa !30
  %326 = load i8, ptr %39, align 1, !tbaa !30
  %327 = load ptr, ptr %16, align 8, !tbaa !5
  %328 = load i32, ptr %32, align 4, !tbaa !11
  %329 = add nsw i32 %328, 2
  %330 = sext i32 %329 to i64
  %331 = getelementptr inbounds i8, ptr %327, i64 %330
  store i8 %326, ptr %331, align 1, !tbaa !30
  call void @llvm.lifetime.end.p0(i64 1, ptr %39) #5
  br label %332

332:                                              ; preds = %310
  %333 = load i32, ptr %26, align 4, !tbaa !11
  %334 = load i32, ptr %32, align 4, !tbaa !11
  %335 = add nsw i32 %334, %333
  store i32 %335, ptr %32, align 4, !tbaa !11
  br label %306, !llvm.loop !31

336:                                              ; preds = %306
  %337 = load i32, ptr %24, align 4, !tbaa !11
  %338 = icmp ne i32 %337, 0
  br i1 %338, label %339, label %348

339:                                              ; preds = %336
  %340 = load ptr, ptr @__glewTexImage3D, align 8, !tbaa !5
  %341 = load i32, ptr %28, align 4, !tbaa !11
  %342 = load i32, ptr %15, align 4, !tbaa !11
  %343 = load i32, ptr %19, align 4, !tbaa !11
  %344 = load i32, ptr %20, align 4, !tbaa !11
  %345 = load i32, ptr %21, align 4, !tbaa !11
  %346 = load i32, ptr %15, align 4, !tbaa !11
  %347 = load ptr, ptr %16, align 8, !tbaa !5
  call void %340(i32 noundef %341, i32 noundef 0, i32 noundef %342, i32 noundef %343, i32 noundef %344, i32 noundef %345, i32 noundef 0, i32 noundef %346, i32 noundef 5121, ptr noundef %347)
  br label %355

348:                                              ; preds = %336
  %349 = load i32, ptr %28, align 4, !tbaa !11
  %350 = load i32, ptr %15, align 4, !tbaa !11
  %351 = load i32, ptr %19, align 4, !tbaa !11
  %352 = load i32, ptr %20, align 4, !tbaa !11
  %353 = load i32, ptr %15, align 4, !tbaa !11
  %354 = load ptr, ptr %16, align 8, !tbaa !5
  call void @glTexImage2D(i32 noundef %349, i32 noundef 0, i32 noundef %350, i32 noundef %351, i32 noundef %352, i32 noundef 0, i32 noundef %353, i32 noundef 5121, ptr noundef %354)
  br label %355

355:                                              ; preds = %348, %339
  br label %377

356:                                              ; preds = %291
  %357 = load i32, ptr %24, align 4, !tbaa !11
  %358 = icmp ne i32 %357, 0
  br i1 %358, label %359, label %368

359:                                              ; preds = %356
  %360 = load ptr, ptr @__glewCompressedTexImage3D, align 8, !tbaa !5
  %361 = load i32, ptr %28, align 4, !tbaa !11
  %362 = load i32, ptr %15, align 4, !tbaa !11
  %363 = load i32, ptr %19, align 4, !tbaa !11
  %364 = load i32, ptr %20, align 4, !tbaa !11
  %365 = load i32, ptr %21, align 4, !tbaa !11
  %366 = load i32, ptr %17, align 4, !tbaa !11
  %367 = load ptr, ptr %16, align 8, !tbaa !5
  call void %360(i32 noundef %361, i32 noundef 0, i32 noundef %362, i32 noundef %363, i32 noundef %364, i32 noundef %365, i32 noundef 0, i32 noundef %366, ptr noundef %367)
  br label %376

368:                                              ; preds = %356
  %369 = load ptr, ptr @__glewCompressedTexImage2D, align 8, !tbaa !5
  %370 = load i32, ptr %28, align 4, !tbaa !11
  %371 = load i32, ptr %15, align 4, !tbaa !11
  %372 = load i32, ptr %19, align 4, !tbaa !11
  %373 = load i32, ptr %20, align 4, !tbaa !11
  %374 = load i32, ptr %17, align 4, !tbaa !11
  %375 = load ptr, ptr %16, align 8, !tbaa !5
  call void %369(i32 noundef %370, i32 noundef 0, i32 noundef %371, i32 noundef %372, i32 noundef %373, i32 noundef 0, i32 noundef %374, ptr noundef %375)
  br label %376

376:                                              ; preds = %368, %359
  br label %377

377:                                              ; preds = %376, %355
  store i32 1, ptr %32, align 4, !tbaa !11
  br label %378

378:                                              ; preds = %484, %377
  %379 = load i32, ptr %32, align 4, !tbaa !11
  %380 = load i32, ptr %22, align 4, !tbaa !11
  %381 = icmp sle i32 %379, %380
  br i1 %381, label %382, label %487

382:                                              ; preds = %378
  call void @llvm.lifetime.start.p0(i64 4, ptr %40) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %41) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %42) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %43) #5
  %383 = load i32, ptr %19, align 4, !tbaa !11
  %384 = load i32, ptr %32, align 4, !tbaa !11
  %385 = lshr i32 %383, %384
  store i32 %385, ptr %40, align 4, !tbaa !11
  %386 = load i32, ptr %20, align 4, !tbaa !11
  %387 = load i32, ptr %32, align 4, !tbaa !11
  %388 = lshr i32 %386, %387
  store i32 %388, ptr %41, align 4, !tbaa !11
  %389 = load i32, ptr %21, align 4, !tbaa !11
  %390 = lshr i32 %389, 1
  store i32 %390, ptr %42, align 4, !tbaa !11
  %391 = load i32, ptr %40, align 4, !tbaa !11
  %392 = icmp slt i32 %391, 1
  br i1 %392, label %393, label %394

393:                                              ; preds = %382
  store i32 1, ptr %40, align 4, !tbaa !11
  br label %394

394:                                              ; preds = %393, %382
  %395 = load i32, ptr %41, align 4, !tbaa !11
  %396 = icmp slt i32 %395, 1
  br i1 %396, label %397, label %398

397:                                              ; preds = %394
  store i32 1, ptr %41, align 4, !tbaa !11
  br label %398

398:                                              ; preds = %397, %394
  %399 = load i32, ptr %42, align 4, !tbaa !11
  %400 = icmp slt i32 %399, 1
  br i1 %400, label %401, label %402

401:                                              ; preds = %398
  store i32 1, ptr %42, align 4, !tbaa !11
  br label %402

402:                                              ; preds = %401, %398
  %403 = load i32, ptr %25, align 4, !tbaa !11
  %404 = icmp ne i32 %403, 0
  br i1 %404, label %405, label %440

405:                                              ; preds = %402
  %406 = load i32, ptr %40, align 4, !tbaa !11
  %407 = load i32, ptr %41, align 4, !tbaa !11
  %408 = mul nsw i32 %406, %407
  %409 = load i32, ptr %42, align 4, !tbaa !11
  %410 = mul nsw i32 %408, %409
  %411 = load i32, ptr %26, align 4, !tbaa !11
  %412 = mul nsw i32 %410, %411
  store i32 %412, ptr %43, align 4, !tbaa !11
  %413 = load i32, ptr %24, align 4, !tbaa !11
  %414 = icmp ne i32 %413, 0
  br i1 %414, label %415, label %426

415:                                              ; preds = %405
  %416 = load i32, ptr %28, align 4, !tbaa !11
  %417 = load i32, ptr %32, align 4, !tbaa !11
  %418 = load i32, ptr %15, align 4, !tbaa !11
  %419 = load i32, ptr %40, align 4, !tbaa !11
  %420 = load i32, ptr %41, align 4, !tbaa !11
  %421 = load i32, ptr %15, align 4, !tbaa !11
  %422 = load ptr, ptr %16, align 8, !tbaa !5
  %423 = load i32, ptr %38, align 4, !tbaa !11
  %424 = zext i32 %423 to i64
  %425 = getelementptr inbounds i8, ptr %422, i64 %424
  call void @glTexImage2D(i32 noundef %416, i32 noundef %417, i32 noundef %418, i32 noundef %419, i32 noundef %420, i32 noundef 0, i32 noundef %421, i32 noundef 5121, ptr noundef %425)
  br label %439

426:                                              ; preds = %405
  %427 = load ptr, ptr @__glewTexImage3D, align 8, !tbaa !5
  %428 = load i32, ptr %28, align 4, !tbaa !11
  %429 = load i32, ptr %32, align 4, !tbaa !11
  %430 = load i32, ptr %15, align 4, !tbaa !11
  %431 = load i32, ptr %40, align 4, !tbaa !11
  %432 = load i32, ptr %41, align 4, !tbaa !11
  %433 = load i32, ptr %42, align 4, !tbaa !11
  %434 = load i32, ptr %15, align 4, !tbaa !11
  %435 = load ptr, ptr %16, align 8, !tbaa !5
  %436 = load i32, ptr %38, align 4, !tbaa !11
  %437 = zext i32 %436 to i64
  %438 = getelementptr inbounds i8, ptr %435, i64 %437
  call void %427(i32 noundef %428, i32 noundef %429, i32 noundef %430, i32 noundef %431, i32 noundef %432, i32 noundef %433, i32 noundef 0, i32 noundef %434, i32 noundef 5121, ptr noundef %438)
  br label %439

439:                                              ; preds = %426, %415
  br label %480

440:                                              ; preds = %402
  %441 = load i32, ptr %42, align 4, !tbaa !11
  %442 = load i32, ptr %40, align 4, !tbaa !11
  %443 = add nsw i32 %442, 3
  %444 = sdiv i32 %443, 4
  %445 = mul nsw i32 %441, %444
  %446 = load i32, ptr %41, align 4, !tbaa !11
  %447 = add nsw i32 %446, 3
  %448 = sdiv i32 %447, 4
  %449 = mul nsw i32 %445, %448
  %450 = load i32, ptr %26, align 4, !tbaa !11
  %451 = mul nsw i32 %449, %450
  store i32 %451, ptr %43, align 4, !tbaa !11
  %452 = load i32, ptr %24, align 4, !tbaa !11
  %453 = icmp ne i32 %452, 0
  br i1 %453, label %454, label %467

454:                                              ; preds = %440
  %455 = load ptr, ptr @__glewCompressedTexImage3D, align 8, !tbaa !5
  %456 = load i32, ptr %28, align 4, !tbaa !11
  %457 = load i32, ptr %32, align 4, !tbaa !11
  %458 = load i32, ptr %15, align 4, !tbaa !11
  %459 = load i32, ptr %40, align 4, !tbaa !11
  %460 = load i32, ptr %41, align 4, !tbaa !11
  %461 = load i32, ptr %42, align 4, !tbaa !11
  %462 = load i32, ptr %43, align 4, !tbaa !11
  %463 = load ptr, ptr %16, align 8, !tbaa !5
  %464 = load i32, ptr %38, align 4, !tbaa !11
  %465 = zext i32 %464 to i64
  %466 = getelementptr inbounds i8, ptr %463, i64 %465
  call void %455(i32 noundef %456, i32 noundef %457, i32 noundef %458, i32 noundef %459, i32 noundef %460, i32 noundef %461, i32 noundef 0, i32 noundef %462, ptr noundef %466)
  br label %479

467:                                              ; preds = %440
  %468 = load ptr, ptr @__glewCompressedTexImage2D, align 8, !tbaa !5
  %469 = load i32, ptr %28, align 4, !tbaa !11
  %470 = load i32, ptr %32, align 4, !tbaa !11
  %471 = load i32, ptr %15, align 4, !tbaa !11
  %472 = load i32, ptr %40, align 4, !tbaa !11
  %473 = load i32, ptr %41, align 4, !tbaa !11
  %474 = load i32, ptr %43, align 4, !tbaa !11
  %475 = load ptr, ptr %16, align 8, !tbaa !5
  %476 = load i32, ptr %38, align 4, !tbaa !11
  %477 = zext i32 %476 to i64
  %478 = getelementptr inbounds i8, ptr %475, i64 %477
  call void %468(i32 noundef %469, i32 noundef %470, i32 noundef %471, i32 noundef %472, i32 noundef %473, i32 noundef 0, i32 noundef %474, ptr noundef %478)
  br label %479

479:                                              ; preds = %467, %454
  br label %480

480:                                              ; preds = %479, %439
  %481 = load i32, ptr %43, align 4, !tbaa !11
  %482 = load i32, ptr %38, align 4, !tbaa !11
  %483 = add i32 %482, %481
  store i32 %483, ptr %38, align 4, !tbaa !11
  call void @llvm.lifetime.end.p0(i64 4, ptr %43) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %42) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %41) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %40) #5
  br label %484

484:                                              ; preds = %480
  %485 = load i32, ptr %32, align 4, !tbaa !11
  %486 = add nsw i32 %485, 1
  store i32 %486, ptr %32, align 4, !tbaa !11
  br label %378, !llvm.loop !32

487:                                              ; preds = %378
  store ptr @.str.34, ptr @result_string_pointer, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr %38) #5
  br label %491

488:                                              ; preds = %284
  call void @glDeleteTextures(i32 noundef 1, ptr noundef %14)
  store i32 0, ptr %14, align 4, !tbaa !11
  %489 = load i32, ptr %30, align 4, !tbaa !11
  %490 = add i32 %489, 1
  store i32 %490, ptr %28, align 4, !tbaa !11
  store ptr @.str.35, ptr @result_string_pointer, align 8, !tbaa !5
  br label %491

491:                                              ; preds = %488, %487
  br label %492

492:                                              ; preds = %491
  %493 = load i32, ptr %28, align 4, !tbaa !11
  %494 = add i32 %493, 1
  store i32 %494, ptr %28, align 4, !tbaa !11
  br label %280, !llvm.loop !33

495:                                              ; preds = %280
  %496 = load ptr, ptr %16, align 8, !tbaa !5
  call void @SOIL_free_image_data(ptr noundef %496)
  %497 = load i32, ptr %14, align 4, !tbaa !11
  %498 = icmp ne i32 %497, 0
  br i1 %498, label %499, label %524

499:                                              ; preds = %495
  %500 = load i32, ptr %22, align 4, !tbaa !11
  %501 = icmp sgt i32 %500, 0
  br i1 %501, label %502, label %505

502:                                              ; preds = %499
  %503 = load i32, ptr %31, align 4, !tbaa !11
  call void @glTexParameteri(i32 noundef %503, i32 noundef 10240, i32 noundef 9729)
  %504 = load i32, ptr %31, align 4, !tbaa !11
  call void @glTexParameteri(i32 noundef %504, i32 noundef 10241, i32 noundef 9987)
  br label %508

505:                                              ; preds = %499
  %506 = load i32, ptr %31, align 4, !tbaa !11
  call void @glTexParameteri(i32 noundef %506, i32 noundef 10240, i32 noundef 9729)
  %507 = load i32, ptr %31, align 4, !tbaa !11
  call void @glTexParameteri(i32 noundef %507, i32 noundef 10241, i32 noundef 9729)
  br label %508

508:                                              ; preds = %505, %502
  %509 = load i32, ptr %10, align 4, !tbaa !11
  %510 = and i32 %509, 4
  %511 = icmp ne i32 %510, 0
  br i1 %511, label %512, label %516

512:                                              ; preds = %508
  %513 = load i32, ptr %31, align 4, !tbaa !11
  call void @glTexParameteri(i32 noundef %513, i32 noundef 10242, i32 noundef 10497)
  %514 = load i32, ptr %31, align 4, !tbaa !11
  call void @glTexParameteri(i32 noundef %514, i32 noundef 10243, i32 noundef 10497)
  %515 = load i32, ptr %31, align 4, !tbaa !11
  call void @glTexParameteri(i32 noundef %515, i32 noundef 32882, i32 noundef 10497)
  br label %523

516:                                              ; preds = %508
  call void @llvm.lifetime.start.p0(i64 4, ptr %44) #5
  store i32 33071, ptr %44, align 4, !tbaa !11
  %517 = load i32, ptr %31, align 4, !tbaa !11
  %518 = load i32, ptr %44, align 4, !tbaa !11
  call void @glTexParameteri(i32 noundef %517, i32 noundef 10242, i32 noundef %518)
  %519 = load i32, ptr %31, align 4, !tbaa !11
  %520 = load i32, ptr %44, align 4, !tbaa !11
  call void @glTexParameteri(i32 noundef %519, i32 noundef 10243, i32 noundef %520)
  %521 = load i32, ptr %31, align 4, !tbaa !11
  %522 = load i32, ptr %44, align 4, !tbaa !11
  call void @glTexParameteri(i32 noundef %521, i32 noundef 32882, i32 noundef %522)
  call void @llvm.lifetime.end.p0(i64 4, ptr %44) #5
  br label %523

523:                                              ; preds = %516, %512
  br label %524

524:                                              ; preds = %523, %495
  br label %525

525:                                              ; preds = %524, %119, %97, %90, %84, %76, %68, %63
  %526 = load i32, ptr %14, align 4, !tbaa !11
  store i32 %526, ptr %6, align 4
  store i32 1, ptr %33, align 4
  br label %527

527:                                              ; preds = %525, %200, %195, %191, %161, %56, %52
  call void @llvm.lifetime.end.p0(i64 4, ptr %32) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %31) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %30) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %29) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %28) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %27) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %26) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %25) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %24) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %23) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %22) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %21) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #5
  call void @llvm.lifetime.end.p0(i64 128, ptr %12) #5
  %528 = load i32, ptr %6, align 4
  ret i32 %528
}

; Function Attrs: nounwind uwtable
declare dso_local i32 @query_cubemap_capability() #1

; Function Attrs: nounwind allocsize(0)
declare noalias ptr @malloc(i64 noundef) #2

; 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) #3

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

; Function Attrs: nounwind uwtable
declare dso_local i32 @query_DXT_capability() #1

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

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

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

declare void @glDeleteTextures(i32 noundef, ptr noundef) #4

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

!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/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"long", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"int", !7, i64 0}
!13 = !{!14, !12, i64 0}
!14 = !{!"", !12, i64 0, !12, i64 4, !12, i64 8, !12, i64 12, !12, i64 16, !12, i64 20, !12, i64 24, !12, i64 28, !7, i64 32, !15, i64 76, !16, i64 108, !12, i64 124}
!15 = !{!"", !12, i64 0, !12, i64 4, !12, i64 8, !12, i64 12, !12, i64 16, !12, i64 20, !12, i64 24, !12, i64 28}
!16 = !{!"", !12, i64 0, !12, i64 4, !12, i64 8, !12, i64 12}
!17 = !{!14, !12, i64 4}
!18 = !{!14, !12, i64 8}
!19 = !{!14, !12, i64 80}
!20 = !{!14, !12, i64 76}
!21 = !{!14, !12, i64 108}
!22 = !{!14, !12, i64 84}
!23 = !{!14, !12, i64 16}
!24 = !{!14, !12, i64 12}
!25 = !{!14, !12, i64 24}
!26 = !{!14, !12, i64 112}
!27 = !{!14, !12, i64 28}
!28 = distinct !{!28, !29}
!29 = !{!"llvm.loop.mustprogress"}
!30 = !{!7, !7, i64 0}
!31 = distinct !{!31, !29}
!32 = distinct !{!32, !29}
!33 = distinct !{!33, !29}


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

@result_string_pointer = external dso_local local_unnamed_addr global ptr, align 8
@__glewCompressedTexImage2D = external local_unnamed_addr global ptr, align 8
@__glewTexImage3D = external local_unnamed_addr global ptr, align 8
@.str.26 = external hidden unnamed_addr constant [12 x i8], align 1
@.str.27 = external hidden unnamed_addr constant [49 x i8], align 1
@.str.28 = external hidden unnamed_addr constant [34 x i8], align 1
@.str.29 = external hidden unnamed_addr constant [32 x i8], align 1
@.str.30 = external hidden unnamed_addr constant [64 x i8], align 1
@.str.31 = external hidden unnamed_addr constant [24 x i8], align 1
@.str.32 = external hidden unnamed_addr constant [67 x i8], align 1
@.str.33 = external hidden unnamed_addr constant [28 x i8], align 1
@__glewCompressedTexImage3D = external local_unnamed_addr global ptr, align 8
@.str.34 = external hidden unnamed_addr constant [16 x i8], align 1
@.str.35 = external hidden unnamed_addr constant [47 x i8], align 1
@switch.table.SOIL_direct_load_DDS_from_memory = private unnamed_addr constant [5 x i32] [i32 8, i32 16, i32 16, i32 16, i32 16], align 4
@switch.table.SOIL_direct_load_DDS_from_memory.1 = private unnamed_addr constant [5 x i32] [i32 33777, i32 0, i32 33778, i32 0, i32 33779], align 4

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

; Function Attrs: nounwind uwtable
declare dso_local void @SOIL_free_image_data(ptr noundef) local_unnamed_addr #1

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

; Function Attrs: nounwind uwtable
define dso_local i32 @SOIL_direct_load_DDS_from_memory(ptr noundef readonly %0, i64 noundef %1, i32 noundef %2, i32 noundef %3, i32 noundef %4) local_unnamed_addr #1 {
  %6 = alloca i32, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %6) #6
  store i32 0, ptr %6, align 4, !tbaa !5
  %7 = load ptr, ptr @__glewTexImage3D, align 8, !tbaa !9
  %8 = icmp eq ptr %7, null
  br i1 %8, label %9, label %11

9:                                                ; preds = %5
  %10 = tail call i32 @query_DXT_capability()
  br label %11

11:                                               ; preds = %9, %5
  %12 = icmp eq ptr %0, null
  br i1 %12, label %13, label %14

13:                                               ; preds = %11
  store ptr @.str.26, ptr @result_string_pointer, align 8, !tbaa !9
  br label %160

14:                                               ; preds = %11
  %15 = icmp ult i64 %1, 128
  br i1 %15, label %16, label %17

16:                                               ; preds = %14
  store ptr @.str.27, ptr @result_string_pointer, align 8, !tbaa !9
  br label %160

17:                                               ; preds = %14
  %.sroa.0.0.copyload = load i32, ptr %0, align 1
  %.sroa.4.0..sroa_idx = getelementptr inbounds i8, ptr %0, i64 4
  %.sroa.4.0.copyload = load i32, ptr %.sroa.4.0..sroa_idx, align 1
  %.sroa.5.0..sroa_idx = getelementptr inbounds i8, ptr %0, i64 8
  %.sroa.5.0.copyload = load i32, ptr %.sroa.5.0..sroa_idx, align 1
  %.sroa.7.0..sroa_idx = getelementptr inbounds i8, ptr %0, i64 12
  %.sroa.7.0.copyload = load i32, ptr %.sroa.7.0..sroa_idx, align 1
  %.sroa.8.0..sroa_idx = getelementptr inbounds i8, ptr %0, i64 16
  %.sroa.8.0.copyload = load i32, ptr %.sroa.8.0..sroa_idx, align 1
  %.sroa.9192.0..sroa_idx = getelementptr inbounds i8, ptr %0, i64 24
  %.sroa.9192.0.copyload = load i32, ptr %.sroa.9192.0..sroa_idx, align 1
  %.sroa.10.0..sroa_idx = getelementptr inbounds i8, ptr %0, i64 28
  %.sroa.10.0.copyload = load i32, ptr %.sroa.10.0..sroa_idx, align 1
  %.sroa.12194.0..sroa_idx = getelementptr inbounds i8, ptr %0, i64 76
  %.sroa.12194.0.copyload = load i32, ptr %.sroa.12194.0..sroa_idx, align 1
  %.sroa.13.0..sroa_idx = getelementptr inbounds i8, ptr %0, i64 80
  %.sroa.13.0.copyload = load i32, ptr %.sroa.13.0..sroa_idx, align 1
  %.sroa.17.0..sroa_idx = getelementptr inbounds i8, ptr %0, i64 84
  %.sroa.17.0.copyload = load i32, ptr %.sroa.17.0..sroa_idx, align 1
  %.sroa.21201.0..sroa_idx = getelementptr inbounds i8, ptr %0, i64 108
  %.sroa.21201.0.copyload = load i32, ptr %.sroa.21201.0..sroa_idx, align 1
  %.sroa.23.0..sroa_idx = getelementptr inbounds i8, ptr %0, i64 112
  %.sroa.23.0.copyload = load i32, ptr %.sroa.23.0..sroa_idx, align 1
  store ptr @.str.28, ptr @result_string_pointer, align 8, !tbaa !9
  %18 = icmp eq i32 %.sroa.0.0.copyload, 542327876
  %19 = icmp eq i32 %.sroa.4.0.copyload, 124
  %or.cond20.not256 = select i1 %18, i1 %19, i1 false
  %20 = and i32 %.sroa.5.0.copyload, 4103
  %.not = icmp eq i32 %20, 4103
  %or.cond = select i1 %or.cond20.not256, i1 %.not, i1 false
  br i1 %or.cond, label %21, label %158

21:                                               ; preds = %17
  %22 = and i32 %.sroa.13.0.copyload, 68
  %23 = icmp eq i32 %22, 0
  %24 = icmp ne i32 %.sroa.12194.0.copyload, 32
  %or.cond24 = select i1 %23, i1 true, i1 %24
  %25 = and i32 %.sroa.21201.0.copyload, 4096
  %26 = icmp eq i32 %25, 0
  %or.cond252 = select i1 %or.cond24, i1 true, i1 %26
  br i1 %or.cond252, label %158, label %27

27:                                               ; preds = %21
  %28 = and i32 %.sroa.13.0.copyload, 4
  %29 = icmp eq i32 %28, 0
  %30 = and i32 %.sroa.17.0.copyload, -33554433
  %31 = icmp eq i32 %30, 827611204
  %32 = icmp eq i32 %.sroa.17.0.copyload, 894720068
  %33 = or i1 %32, %31
  %or.cond11 = select i1 %29, i1 true, i1 %33
  br i1 %or.cond11, label %34, label %158

34:                                               ; preds = %27
  store ptr @.str.29, ptr @result_string_pointer, align 8, !tbaa !9
  %35 = and i32 %.sroa.5.0.copyload, 8388608
  br i1 %29, label %36, label %41

36:                                               ; preds = %34
  %37 = and i32 %.sroa.13.0.copyload, 1
  %.not239 = icmp eq i32 %37, 0
  %spec.select = select i1 %.not239, i32 3, i32 4
  %spec.select253 = select i1 %.not239, i32 6407, i32 6408
  %38 = mul i32 %.sroa.8.0.copyload, %.sroa.7.0.copyload
  %39 = mul i32 %38, %.sroa.9192.0.copyload
  %40 = mul i32 %39, %spec.select
  br label %56

41:                                               ; preds = %34
  %42 = tail call i32 @query_DXT_capability()
  %.not238 = icmp eq i32 %42, 1
  br i1 %.not238, label %44, label %43

43:                                               ; preds = %41
  store ptr @.str.30, ptr @result_string_pointer, align 8, !tbaa !9
  br label %160

44:                                               ; preds = %41
  %45 = lshr i32 %.sroa.17.0.copyload, 24
  %trunc = trunc nuw i32 %45 to i8
  %switch.tableidx = add i8 %trunc, -49
  %46 = icmp ult i8 %switch.tableidx, 5
  br i1 %46, label %switch.lookup, label %49

switch.lookup:                                    ; preds = %44
  %47 = zext nneg i8 %switch.tableidx to i64
  %switch.gep = getelementptr inbounds [5 x i32], ptr @switch.table.SOIL_direct_load_DDS_from_memory, i64 0, i64 %47
  %switch.load = load i32, ptr %switch.gep, align 4
  %48 = zext nneg i8 %switch.tableidx to i64
  %switch.gep291 = getelementptr inbounds [5 x i32], ptr @switch.table.SOIL_direct_load_DDS_from_memory.1, i64 0, i64 %48
  %switch.load292 = load i32, ptr %switch.gep291, align 4
  br label %49

49:                                               ; preds = %switch.lookup, %44
  %.1231 = phi i32 [ 16, %44 ], [ %switch.load, %switch.lookup ]
  %.1217 = phi i32 [ 0, %44 ], [ %switch.load292, %switch.lookup ]
  %50 = add i32 %.sroa.8.0.copyload, 3
  %51 = lshr i32 %50, 2
  %52 = add i32 %.sroa.7.0.copyload, 3
  %53 = lshr i32 %52, 2
  %54 = mul i32 %51, %53
  %55 = mul i32 %54, %.1231
  br label %56

56:                                               ; preds = %49, %36
  %.2232 = phi i32 [ %spec.select, %36 ], [ %.1231, %49 ]
  %.0218 = phi i32 [ %40, %36 ], [ %55, %49 ]
  %.2 = phi i32 [ %spec.select253, %36 ], [ %.1217, %49 ]
  %.not240 = icmp eq i32 %35, 0
  br i1 %.not240, label %57, label %66

57:                                               ; preds = %56
  %58 = and i32 %.sroa.23.0.copyload, 512
  %.not241 = icmp eq i32 %58, 0
  %.not242 = icmp eq i32 %4, 0
  br i1 %.not241, label %64, label %59

59:                                               ; preds = %57
  br i1 %.not242, label %60, label %61

60:                                               ; preds = %59
  store ptr @.str.31, ptr @result_string_pointer, align 8, !tbaa !9
  br label %160

61:                                               ; preds = %59
  %62 = tail call i32 @query_cubemap_capability()
  %.not244 = icmp eq i32 %62, 1
  br i1 %.not244, label %66, label %63

63:                                               ; preds = %61
  store ptr @.str.32, ptr @result_string_pointer, align 8, !tbaa !9
  br label %160

64:                                               ; preds = %57
  br i1 %.not242, label %66, label %65

65:                                               ; preds = %64
  store ptr @.str.33, ptr @result_string_pointer, align 8, !tbaa !9
  br label %160

66:                                               ; preds = %64, %61, %56
  %.0227 = phi i32 [ 32879, %56 ], [ 34069, %61 ], [ 3553, %64 ]
  %.0226 = phi i32 [ 32879, %56 ], [ 34074, %61 ], [ 3553, %64 ]
  %.0225 = phi i32 [ 32879, %56 ], [ 34067, %61 ], [ 3553, %64 ]
  %67 = and i32 %.sroa.21201.0.copyload, 4194304
  %68 = icmp ne i32 %67, 0
  %69 = icmp ugt i32 %.sroa.10.0.copyload, 1
  %or.cond14 = select i1 %68, i1 %69, i1 false
  br i1 %or.cond14, label %70, label %.loopexit257

70:                                               ; preds = %66
  %71 = add i32 %.sroa.10.0.copyload, -1
  %. = lshr exact i32 %28, 1
  %.not245258 = icmp slt i32 %71, 1
  br i1 %.not245258, label %.loopexit257, label %.lr.ph

.lr.ph:                                           ; preds = %70, %.lr.ph
  %.0219260 = phi i32 [ %79, %.lr.ph ], [ %.0218, %70 ]
  %.0222259 = phi i32 [ %80, %.lr.ph ], [ 1, %70 ]
  %72 = add nuw nsw i32 %.0222259, %.
  %73 = lshr i32 %.sroa.8.0.copyload, %72
  %74 = lshr i32 %.sroa.7.0.copyload, %72
  %75 = lshr i32 %.sroa.9192.0.copyload, %.0222259
  %spec.store.select = tail call i32 @llvm.smax.i32(i32 %73, i32 1)
  %spec.store.select25 = tail call i32 @llvm.smax.i32(i32 %74, i32 1)
  %spec.store.select15 = tail call i32 @llvm.smax.i32(i32 %75, i32 1)
  %76 = mul i32 %spec.store.select15, %.2232
  %77 = mul i32 %76, %spec.store.select
  %78 = mul i32 %77, %spec.store.select25
  %79 = add i32 %78, %.0219260
  %80 = add nuw i32 %.0222259, 1
  %exitcond.not = icmp eq i32 %80, %.sroa.10.0.copyload
  br i1 %exitcond.not, label %.loopexit257, label %.lr.ph, !llvm.loop !11

.loopexit257:                                     ; preds = %.lr.ph, %70, %66
  %.0233 = phi i32 [ 0, %66 ], [ %71, %70 ], [ %71, %.lr.ph ]
  %.1220 = phi i32 [ %.0218, %66 ], [ %.0218, %70 ], [ %79, %.lr.ph ]
  %81 = zext i32 %.1220 to i64
  %82 = tail call noalias ptr @malloc(i64 noundef %81) #7
  store i32 %2, ptr %6, align 4, !tbaa !5
  %83 = icmp eq i32 %2, 0
  br i1 %83, label %84, label %85

84:                                               ; preds = %.loopexit257
  call void @glGenTextures(i32 noundef 1, ptr noundef nonnull %6) #6
  %.pre = load i32, ptr %6, align 4, !tbaa !5
  br label %85

85:                                               ; preds = %84, %.loopexit257
  %86 = phi i32 [ %.pre, %84 ], [ %2, %.loopexit257 ]
  call void @glBindTexture(i32 noundef %.0225, i32 noundef %86) #6
  %.not246268 = icmp ugt i32 %.0227, %.0226
  br i1 %.not246268, label %._crit_edge275, label %.lr.ph274

.lr.ph274:                                        ; preds = %85
  %87 = icmp sgt i32 %.1220, 0
  %.not250263 = icmp slt i32 %.0233, 1
  %88 = lshr i32 %.sroa.9192.0.copyload, 1
  %.inv = icmp ugt i32 %.sroa.9192.0.copyload, 1
  %spec.store.select17 = select i1 %.inv, i32 %88, i32 1
  %89 = mul i32 %.2232, %spec.store.select17
  %90 = add nuw nsw i32 %.0226, 1
  %91 = zext i32 %.2232 to i64
  %92 = sext i32 %.1220 to i64
  br label %93

93:                                               ; preds = %.lr.ph274, %.loopexit
  %.0214272 = phi i32 [ 128, %.lr.ph274 ], [ %.1, %.loopexit ]
  %.0228269 = phi i32 [ %.0227, %.lr.ph274 ], [ %154, %.loopexit ]
  %94 = add i32 %.0214272, %.1220
  %95 = zext i32 %94 to i64
  %.not249 = icmp ugt i64 %95, %1
  br i1 %.not249, label %153, label %96

96:                                               ; preds = %93
  %97 = zext i32 %.0214272 to i64
  %98 = getelementptr inbounds i8, ptr %0, i64 %97
  call void @llvm.memcpy.p0.p0.i64(ptr align 1 %82, ptr nonnull align 1 %98, i64 %81, i1 false)
  br i1 %29, label %.preheader, label %107

.preheader:                                       ; preds = %96
  br i1 %87, label %.lr.ph262, label %._crit_edge

.lr.ph262:                                        ; preds = %.preheader, %.lr.ph262
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph262 ], [ 0, %.preheader ]
  %99 = getelementptr inbounds i8, ptr %82, i64 %indvars.iv
  %100 = load i8, ptr %99, align 1, !tbaa !13
  %101 = getelementptr i8, ptr %99, i64 2
  %102 = load i8, ptr %101, align 1, !tbaa !13
  store i8 %102, ptr %99, align 1, !tbaa !13
  store i8 %100, ptr %101, align 1, !tbaa !13
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, %91
  %103 = icmp slt i64 %indvars.iv.next, %92
  br i1 %103, label %.lr.ph262, label %._crit_edge, !llvm.loop !14

._crit_edge:                                      ; preds = %.lr.ph262, %.preheader
  br i1 %.not240, label %106, label %104

104:                                              ; preds = %._crit_edge
  %105 = load ptr, ptr @__glewTexImage3D, align 8, !tbaa !9
  call void %105(i32 noundef %.0228269, i32 noundef 0, i32 noundef %.2, i32 noundef %.sroa.8.0.copyload, i32 noundef %.sroa.7.0.copyload, i32 noundef %.sroa.9192.0.copyload, i32 noundef 0, i32 noundef %.2, i32 noundef 5121, ptr noundef %82) #6
  br label %112

106:                                              ; preds = %._crit_edge
  call void @glTexImage2D(i32 noundef %.0228269, i32 noundef 0, i32 noundef %.2, i32 noundef %.sroa.8.0.copyload, i32 noundef %.sroa.7.0.copyload, i32 noundef 0, i32 noundef %.2, i32 noundef 5121, ptr noundef %82) #6
  br label %112

107:                                              ; preds = %96
  br i1 %.not240, label %110, label %108

108:                                              ; preds = %107
  %109 = load ptr, ptr @__glewCompressedTexImage3D, align 8, !tbaa !9
  call void %109(i32 noundef %.0228269, i32 noundef 0, i32 noundef %.2, i32 noundef %.sroa.8.0.copyload, i32 noundef %.sroa.7.0.copyload, i32 noundef %.sroa.9192.0.copyload, i32 noundef 0, i32 noundef %.0218, ptr noundef %82) #6
  br label %112

110:                                              ; preds = %107
  %111 = load ptr, ptr @__glewCompressedTexImage2D, align 8, !tbaa !9
  call void %111(i32 noundef %.0228269, i32 noundef 0, i32 noundef %.2, i32 noundef %.sroa.8.0.copyload, i32 noundef %.sroa.7.0.copyload, i32 noundef 0, i32 noundef %.0218, ptr noundef %82) #6
  br label %112

112:                                              ; preds = %108, %110, %104, %106
  br i1 %.not250263, label %.loopexit, label %.lr.ph267

.lr.ph267:                                        ; preds = %112
  br i1 %29, label %.lr.ph267.split.us, label %.lr.ph267.split

.lr.ph267.split.us:                               ; preds = %.lr.ph267
  br i1 %.not240, label %.lr.ph267.split.us.split.us, label %.lr.ph267.split.us.split

.lr.ph267.split.us.split.us:                      ; preds = %.lr.ph267.split.us, %.lr.ph267.split.us.split.us
  %.0215265.us.us = phi i32 [ %122, %.lr.ph267.split.us.split.us ], [ %.0218, %.lr.ph267.split.us ]
  %.2224264.us.us = phi i32 [ %123, %.lr.ph267.split.us.split.us ], [ 1, %.lr.ph267.split.us ]
  %113 = lshr i32 %.sroa.8.0.copyload, %.2224264.us.us
  %114 = lshr i32 %.sroa.7.0.copyload, %.2224264.us.us
  %115 = call i32 @llvm.umax.i32(i32 %113, i32 1)
  %116 = call i32 @llvm.umax.i32(i32 %114, i32 1)
  %117 = mul i32 %89, %116
  %118 = mul i32 %117, %115
  %119 = load ptr, ptr @__glewTexImage3D, align 8, !tbaa !9
  %120 = zext i32 %.0215265.us.us to i64
  %121 = getelementptr inbounds i8, ptr %82, i64 %120
  call void %119(i32 noundef %.0228269, i32 noundef %.2224264.us.us, i32 noundef %.2, i32 noundef %115, i32 noundef %116, i32 noundef %spec.store.select17, i32 noundef 0, i32 noundef %.2, i32 noundef 5121, ptr noundef %121) #6
  %122 = add i32 %118, %.0215265.us.us
  %123 = add nuw i32 %.2224264.us.us, 1
  %exitcond281.not = icmp eq i32 %.2224264.us.us, %.0233
  br i1 %exitcond281.not, label %.loopexit, label %.lr.ph267.split.us.split.us, !llvm.loop !16

.lr.ph267.split.us.split:                         ; preds = %.lr.ph267.split.us, %.lr.ph267.split.us.split
  %.0215265.us = phi i32 [ %132, %.lr.ph267.split.us.split ], [ %.0218, %.lr.ph267.split.us ]
  %.2224264.us = phi i32 [ %133, %.lr.ph267.split.us.split ], [ 1, %.lr.ph267.split.us ]
  %124 = lshr i32 %.sroa.8.0.copyload, %.2224264.us
  %125 = lshr i32 %.sroa.7.0.copyload, %.2224264.us
  %126 = call i32 @llvm.umax.i32(i32 %124, i32 1)
  %127 = call i32 @llvm.umax.i32(i32 %125, i32 1)
  %128 = mul i32 %89, %127
  %129 = mul i32 %128, %126
  %130 = zext i32 %.0215265.us to i64
  %131 = getelementptr inbounds i8, ptr %82, i64 %130
  call void @glTexImage2D(i32 noundef %.0228269, i32 noundef %.2224264.us, i32 noundef %.2, i32 noundef %126, i32 noundef %127, i32 noundef 0, i32 noundef %.2, i32 noundef 5121, ptr noundef %131) #6
  %132 = add i32 %129, %.0215265.us
  %133 = add nuw i32 %.2224264.us, 1
  %exitcond280.not = icmp eq i32 %.2224264.us, %.0233
  br i1 %exitcond280.not, label %.loopexit, label %.lr.ph267.split.us.split, !llvm.loop !16

.lr.ph267.split:                                  ; preds = %.lr.ph267, %150
  %.0215265 = phi i32 [ %151, %150 ], [ %.0218, %.lr.ph267 ]
  %.2224264 = phi i32 [ %152, %150 ], [ 1, %.lr.ph267 ]
  %134 = lshr i32 %.sroa.8.0.copyload, %.2224264
  %135 = lshr i32 %.sroa.7.0.copyload, %.2224264
  %136 = call i32 @llvm.umax.i32(i32 %134, i32 1)
  %137 = call i32 @llvm.umax.i32(i32 %135, i32 1)
  %138 = add nuw nsw i32 %136, 3
  %139 = lshr i32 %138, 2
  %140 = add nuw nsw i32 %137, 3
  %141 = lshr i32 %140, 2
  %142 = mul i32 %89, %139
  %143 = mul i32 %142, %141
  %144 = zext i32 %.0215265 to i64
  %145 = getelementptr inbounds i8, ptr %82, i64 %144
  br i1 %.not240, label %148, label %146

146:                                              ; preds = %.lr.ph267.split
  %147 = load ptr, ptr @__glewCompressedTexImage3D, align 8, !tbaa !9
  call void %147(i32 noundef %.0228269, i32 noundef %.2224264, i32 noundef %.2, i32 noundef %136, i32 noundef %137, i32 noundef %spec.store.select17, i32 noundef 0, i32 noundef %143, ptr noundef %145) #6
  br label %150

148:                                              ; preds = %.lr.ph267.split
  %149 = load ptr, ptr @__glewCompressedTexImage2D, align 8, !tbaa !9
  call void %149(i32 noundef %.0228269, i32 noundef %.2224264, i32 noundef %.2, i32 noundef %136, i32 noundef %137, i32 noundef 0, i32 noundef %143, ptr noundef %145) #6
  br label %150

150:                                              ; preds = %146, %148
  %151 = add i32 %143, %.0215265
  %152 = add nuw i32 %.2224264, 1
  %exitcond279.not = icmp eq i32 %.2224264, %.0233
  br i1 %exitcond279.not, label %.loopexit, label %.lr.ph267.split, !llvm.loop !16

153:                                              ; preds = %93
  call void @glDeleteTextures(i32 noundef 1, ptr noundef nonnull %6) #6
  store i32 0, ptr %6, align 4, !tbaa !5
  br label %.loopexit

.loopexit:                                        ; preds = %150, %.lr.ph267.split.us.split, %.lr.ph267.split.us.split.us, %112, %153
  %storemerge = phi ptr [ @.str.35, %153 ], [ @.str.34, %112 ], [ @.str.34, %.lr.ph267.split.us.split.us ], [ @.str.34, %.lr.ph267.split.us.split ], [ @.str.34, %150 ]
  %.1229 = phi i32 [ %90, %153 ], [ %.0228269, %112 ], [ %.0228269, %.lr.ph267.split.us.split.us ], [ %.0228269, %.lr.ph267.split.us.split ], [ %.0228269, %150 ]
  %.1 = phi i32 [ %.0214272, %153 ], [ %94, %112 ], [ %94, %.lr.ph267.split.us.split.us ], [ %94, %.lr.ph267.split.us.split ], [ %94, %150 ]
  store ptr %storemerge, ptr @result_string_pointer, align 8, !tbaa !9
  %154 = add i32 %.1229, 1
  %.not246 = icmp ugt i32 %154, %.0226
  br i1 %.not246, label %._crit_edge275, label %93, !llvm.loop !17

._crit_edge275:                                   ; preds = %.loopexit, %85
  call void @SOIL_free_image_data(ptr noundef %82)
  %155 = load i32, ptr %6, align 4, !tbaa !5
  %.not247 = icmp eq i32 %155, 0
  br i1 %.not247, label %158, label %.sink.split

.sink.split:                                      ; preds = %._crit_edge275
  %156 = icmp sgt i32 %.0233, 0
  call void @glTexParameteri(i32 noundef %.0225, i32 noundef 10240, i32 noundef 9729) #6
  %.287 = select i1 %156, i32 9987, i32 9729
  call void @glTexParameteri(i32 noundef %.0225, i32 noundef 10241, i32 noundef %.287) #6
  %157 = and i32 %3, 4
  %.not248 = icmp eq i32 %157, 0
  %.sink286 = select i1 %.not248, i32 33071, i32 10497
  call void @glTexParameteri(i32 noundef %.0225, i32 noundef 10242, i32 noundef %.sink286) #6
  call void @glTexParameteri(i32 noundef %.0225, i32 noundef 10243, i32 noundef %.sink286) #6
  call void @glTexParameteri(i32 noundef %.0225, i32 noundef 32882, i32 noundef %.sink286) #6
  br label %158

158:                                              ; preds = %.sink.split, %._crit_edge275, %27, %21, %17
  %159 = load i32, ptr %6, align 4, !tbaa !5
  br label %160

160:                                              ; preds = %158, %65, %63, %60, %43, %16, %13
  %.0 = phi i32 [ 0, %13 ], [ 0, %16 ], [ %159, %158 ], [ 0, %63 ], [ 0, %60 ], [ 0, %65 ], [ 0, %43 ]
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %6) #6
  ret i32 %.0
}

; Function Attrs: nounwind uwtable
declare dso_local i32 @query_cubemap_capability() local_unnamed_addr #1

; Function Attrs: mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite)
declare noalias noundef ptr @malloc(i64 noundef) local_unnamed_addr #2

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

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

; Function Attrs: nounwind uwtable
declare dso_local i32 @query_DXT_capability() local_unnamed_addr #1

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

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

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

declare void @glDeleteTextures(i32 noundef, ptr noundef) local_unnamed_addr #4

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smax.i32(i32, i32) #5

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.umax.i32(i32, i32) #5

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite) "alloc-family"="malloc" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
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 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #6 = { nounwind }
attributes #7 = { nounwind allocsize(0) }

!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/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"any pointer", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = !{!7, !7, i64 0}
!14 = distinct !{!14, !12, !15}
!15 = !{!"llvm.loop.isvectorized", i32 1}
!16 = distinct !{!16, !12}
!17 = distinct !{!17, !12}


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