; LLVM IR from blat-blatnik/GPU-Life :: main (onFileDragAndDrop)

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

@maxTextureSize = external dso_local global i32, align 4
@.str.27 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.28 = external hidden unnamed_addr constant [17 x i8], align 1
@.str.29 = external hidden unnamed_addr constant [15 x i8], align 1
@.str.30 = external hidden unnamed_addr constant [15 x i8], align 1
@.str.31 = external hidden unnamed_addr constant [8 x i8], align 1
@.str.32 = external hidden unnamed_addr constant [24 x i8], align 1
@.str.33 = external hidden unnamed_addr constant [52 x i8], align 1
@.str.34 = external hidden unnamed_addr constant [13 x i8], align 1
@.str.35 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.36 = external hidden unnamed_addr constant [18 x i8], align 1
@.str.37 = external hidden unnamed_addr constant [8 x i8], align 1
@.str.38 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.39 = external hidden unnamed_addr constant [21 x i8], align 1
@.str.40 = external hidden unnamed_addr constant [24 x i8], align 1

; Function Attrs: nounwind uwtable
declare dso_local ptr @stbi_failure_reason() #0

; Function Attrs: nounwind uwtable
declare dso_local void @stbi_image_free(ptr noundef) #0

; Function Attrs: nounwind
declare void @free(ptr noundef) #1

; Function Attrs: nounwind uwtable
declare dso_local void @stbi_set_flip_vertically_on_load(i32 noundef) #0

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

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

declare i32 @fclose(ptr noundef) #3

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

declare i32 @fseek(ptr noundef, i64 noundef, i32 noundef) #3

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

; Function Attrs: nounwind uwtable
declare dso_local void @setPatternName(ptr noundef) #0

; Function Attrs: nounwind uwtable
declare dso_local void @setCells(ptr noundef, i32 noundef, i32 noundef) #0

; Function Attrs: nounwind allocsize(0,1)
declare noalias ptr @calloc(i64 noundef, i64 noundef) #4

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

; Function Attrs: nounwind uwtable
define dso_local void @onFileDragAndDrop(ptr noundef %0, i32 noundef %1, ptr noundef %2) #0 {
  %4 = alloca ptr, align 8
  %5 = alloca i32, align 4
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca i32, align 4
  %10 = alloca i8, align 1
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  %15 = alloca i32, align 4
  %16 = alloca i32, align 4
  %17 = alloca i32, align 4
  %18 = alloca i32, align 4
  %19 = alloca ptr, align 8
  %20 = alloca [1024 x i8], align 16
  %21 = alloca ptr, align 8
  %22 = alloca ptr, align 8
  %23 = alloca i32, align 4
  %24 = alloca i32, align 4
  %25 = alloca i32, align 4
  %26 = alloca i8, align 1
  %27 = alloca i32, align 4
  %28 = alloca ptr, align 8
  %29 = alloca i64, align 8
  %30 = alloca i64, align 8
  store ptr %0, ptr %4, align 8, !tbaa !5
  store i32 %1, ptr %5, align 4, !tbaa !9
  store ptr %2, ptr %6, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #6
  %31 = load ptr, ptr %6, align 8, !tbaa !5
  %32 = getelementptr inbounds ptr, ptr %31, i64 0
  %33 = load ptr, ptr %32, align 8, !tbaa !5
  store ptr %33, ptr %7, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #6
  %34 = load ptr, ptr %7, align 8, !tbaa !5
  %35 = call noalias ptr @fopen(ptr noundef %34, ptr noundef @.str.27)
  store ptr %35, ptr %8, align 8, !tbaa !5
  %36 = load ptr, ptr %8, align 8, !tbaa !5
  %37 = icmp ne ptr %36, null
  br i1 %37, label %41, label %38

38:                                               ; preds = %3
  %39 = load ptr, ptr %7, align 8, !tbaa !5
  %40 = call i32 (ptr, ...) @printf(ptr noundef @.str.28, ptr noundef %39)
  store i32 1, ptr %9, align 4
  br label %366

41:                                               ; preds = %3
  call void @llvm.lifetime.start.p0(i64 1, ptr %10) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #6
  %42 = load ptr, ptr %8, align 8, !tbaa !5
  %43 = call i32 @fseek(ptr noundef %42, i64 noundef 0, i32 noundef 0)
  %44 = load ptr, ptr %8, align 8, !tbaa !5
  %45 = call i32 (ptr, ptr, ...) @__isoc99_fscanf(ptr noundef %44, ptr noundef @.str.29, ptr noundef %10)
  %46 = icmp eq i32 1, %45
  br i1 %46, label %47, label %151

47:                                               ; preds = %41
  %48 = load ptr, ptr %7, align 8, !tbaa !5
  %49 = call i32 (ptr, ...) @printf(ptr noundef @.str.30, ptr noundef %48)
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #6
  store i32 0, ptr %13, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #6
  store i32 0, ptr %14, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #6
  store i32 0, ptr %15, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #6
  store i32 0, ptr %16, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #6
  br label %50

50:                                               ; preds = %78, %47
  %51 = load ptr, ptr %8, align 8, !tbaa !5
  %52 = call i32 (ptr, ptr, ...) @__isoc99_fscanf(ptr noundef %51, ptr noundef @.str.31, ptr noundef %17, ptr noundef %18)
  %53 = icmp eq i32 2, %52
  br i1 %53, label %54, label %79

54:                                               ; preds = %50
  %55 = load i32, ptr %17, align 4, !tbaa !9
  %56 = load i32, ptr %13, align 4, !tbaa !9
  %57 = icmp slt i32 %55, %56
  br i1 %57, label %58, label %60

58:                                               ; preds = %54
  %59 = load i32, ptr %17, align 4, !tbaa !9
  store i32 %59, ptr %13, align 4, !tbaa !9
  br label %60

60:                                               ; preds = %58, %54
  %61 = load i32, ptr %17, align 4, !tbaa !9
  %62 = load i32, ptr %14, align 4, !tbaa !9
  %63 = icmp sgt i32 %61, %62
  br i1 %63, label %64, label %66

64:                                               ; preds = %60
  %65 = load i32, ptr %17, align 4, !tbaa !9
  store i32 %65, ptr %14, align 4, !tbaa !9
  br label %66

66:                                               ; preds = %64, %60
  %67 = load i32, ptr %18, align 4, !tbaa !9
  %68 = load i32, ptr %15, align 4, !tbaa !9
  %69 = icmp slt i32 %67, %68
  br i1 %69, label %70, label %72

70:                                               ; preds = %66
  %71 = load i32, ptr %18, align 4, !tbaa !9
  store i32 %71, ptr %15, align 4, !tbaa !9
  br label %72

72:                                               ; preds = %70, %66
  %73 = load i32, ptr %18, align 4, !tbaa !9
  %74 = load i32, ptr %16, align 4, !tbaa !9
  %75 = icmp sgt i32 %73, %74
  br i1 %75, label %76, label %78

76:                                               ; preds = %72
  %77 = load i32, ptr %18, align 4, !tbaa !9
  store i32 %77, ptr %16, align 4, !tbaa !9
  br label %78

78:                                               ; preds = %76, %72
  br label %50, !llvm.loop !11

79:                                               ; preds = %50
  %80 = load i32, ptr %14, align 4, !tbaa !9
  %81 = add nsw i32 1, %80
  %82 = load i32, ptr %13, align 4, !tbaa !9
  %83 = sub nsw i32 %81, %82
  store i32 %83, ptr %11, align 4, !tbaa !9
  %84 = load i32, ptr %16, align 4, !tbaa !9
  %85 = add nsw i32 1, %84
  %86 = load i32, ptr %15, align 4, !tbaa !9
  %87 = sub nsw i32 %85, %86
  store i32 %87, ptr %12, align 4, !tbaa !9
  %88 = load i32, ptr %11, align 4, !tbaa !9
  %89 = icmp slt i32 %88, 1
  br i1 %89, label %90, label %95

90:                                               ; preds = %79
  %91 = load i32, ptr %12, align 4, !tbaa !9
  %92 = icmp slt i32 %91, 1
  br i1 %92, label %93, label %95

93:                                               ; preds = %90
  %94 = call i32 (ptr, ...) @printf(ptr noundef @.str.32)
  store i32 1, ptr %9, align 4
  br label %150

95:                                               ; preds = %90, %79
  %96 = load i32, ptr %11, align 4, !tbaa !9
  %97 = load i32, ptr @maxTextureSize, align 4, !tbaa !9
  %98 = icmp sgt i32 %96, %97
  br i1 %98, label %103, label %99

99:                                               ; preds = %95
  %100 = load i32, ptr %12, align 4, !tbaa !9
  %101 = load i32, ptr @maxTextureSize, align 4, !tbaa !9
  %102 = icmp sgt i32 %100, %101
  br i1 %102, label %103, label %109

103:                                              ; preds = %99, %95
  %104 = load i32, ptr %11, align 4, !tbaa !9
  %105 = load i32, ptr %12, align 4, !tbaa !9
  %106 = load i32, ptr @maxTextureSize, align 4, !tbaa !9
  %107 = load i32, ptr @maxTextureSize, align 4, !tbaa !9
  %108 = call i32 (ptr, ...) @printf(ptr noundef @.str.33, i32 noundef %104, i32 noundef %105, i32 noundef %106, i32 noundef %107)
  store i32 1, ptr %9, align 4
  br label %150

109:                                              ; preds = %99
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #6
  %110 = load i32, ptr %11, align 4, !tbaa !9
  %111 = sext i32 %110 to i64
  %112 = load i32, ptr %12, align 4, !tbaa !9
  %113 = sext i32 %112 to i64
  %114 = mul i64 %111, %113
  %115 = call noalias ptr @calloc(i64 noundef %114, i64 noundef 1) #7
  store ptr %115, ptr %19, align 8, !tbaa !5
  %116 = load ptr, ptr %8, align 8, !tbaa !5
  %117 = call i32 @fseek(ptr noundef %116, i64 noundef 0, i32 noundef 0)
  %118 = load ptr, ptr %8, align 8, !tbaa !5
  %119 = call i32 (ptr, ptr, ...) @__isoc99_fscanf(ptr noundef %118, ptr noundef @.str.34)
  br label %120

120:                                              ; preds = %124, %109
  %121 = load ptr, ptr %8, align 8, !tbaa !5
  %122 = call i32 (ptr, ptr, ...) @__isoc99_fscanf(ptr noundef %121, ptr noundef @.str.31, ptr noundef %17, ptr noundef %18)
  %123 = icmp eq i32 2, %122
  br i1 %123, label %124, label %143

124:                                              ; preds = %120
  %125 = load i32, ptr %13, align 4, !tbaa !9
  %126 = load i32, ptr %17, align 4, !tbaa !9
  %127 = sub nsw i32 %126, %125
  store i32 %127, ptr %17, align 4, !tbaa !9
  %128 = load i32, ptr %15, align 4, !tbaa !9
  %129 = load i32, ptr %18, align 4, !tbaa !9
  %130 = sub nsw i32 %129, %128
  store i32 %130, ptr %18, align 4, !tbaa !9
  %131 = load i32, ptr %12, align 4, !tbaa !9
  %132 = load i32, ptr %18, align 4, !tbaa !9
  %133 = sub nsw i32 %131, %132
  %134 = sub nsw i32 %133, 1
  store i32 %134, ptr %18, align 4, !tbaa !9
  %135 = load ptr, ptr %19, align 8, !tbaa !5
  %136 = load i32, ptr %18, align 4, !tbaa !9
  %137 = load i32, ptr %11, align 4, !tbaa !9
  %138 = mul nsw i32 %136, %137
  %139 = load i32, ptr %17, align 4, !tbaa !9
  %140 = add nsw i32 %138, %139
  %141 = sext i32 %140 to i64
  %142 = getelementptr inbounds i8, ptr %135, i64 %141
  store i8 -1, ptr %142, align 1, !tbaa !13
  br label %120, !llvm.loop !14

143:                                              ; preds = %120
  %144 = load ptr, ptr %7, align 8, !tbaa !5
  call void @setPatternName(ptr noundef %144)
  %145 = load ptr, ptr %19, align 8, !tbaa !5
  %146 = load i32, ptr %11, align 4, !tbaa !9
  %147 = load i32, ptr %12, align 4, !tbaa !9
  call void @setCells(ptr noundef %145, i32 noundef %146, i32 noundef %147)
  %148 = load ptr, ptr %19, align 8, !tbaa !5
  call void @free(ptr noundef %148) #6
  %149 = call i32 (ptr, ...) @printf(ptr noundef @.str.35)
  store i32 1, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #6
  br label %150

150:                                              ; preds = %143, %103, %93
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #6
  br label %365

151:                                              ; preds = %41
  %152 = load ptr, ptr %8, align 8, !tbaa !5
  %153 = call i32 @fseek(ptr noundef %152, i64 noundef 0, i32 noundef 0)
  call void @llvm.lifetime.start.p0(i64 1024, ptr %20) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %21) #6
  br label %154

154:                                              ; preds = %167, %151
  %155 = getelementptr inbounds [1024 x i8], ptr %20, i64 0, i64 0
  %156 = load ptr, ptr %8, align 8, !tbaa !5
  %157 = call ptr @fgets(ptr noundef %155, i32 noundef 1024, ptr noundef %156)
  store ptr %157, ptr %21, align 8, !tbaa !5
  br label %158

158:                                              ; preds = %154
  %159 = load ptr, ptr %21, align 8, !tbaa !5
  %160 = icmp ne ptr %159, null
  br i1 %160, label %161, label %167

161:                                              ; preds = %158
  %162 = load ptr, ptr %21, align 8, !tbaa !5
  %163 = getelementptr inbounds i8, ptr %162, i64 0
  %164 = load i8, ptr %163, align 1, !tbaa !13
  %165 = sext i8 %164 to i32
  %166 = icmp eq i32 %165, 35
  br label %167

167:                                              ; preds = %161, %158
  %168 = phi i1 [ false, %158 ], [ %166, %161 ]
  br i1 %168, label %154, label %169, !llvm.loop !15

169:                                              ; preds = %167
  %170 = load ptr, ptr %21, align 8, !tbaa !5
  %171 = call i32 (ptr, ptr, ...) @__isoc99_sscanf(ptr noundef %170, ptr noundef @.str.36, ptr noundef %11, ptr noundef %12) #6
  %172 = icmp eq i32 2, %171
  br i1 %172, label %173, label %291

173:                                              ; preds = %169
  %174 = load ptr, ptr %7, align 8, !tbaa !5
  %175 = call i32 (ptr, ...) @printf(ptr noundef @.str.30, ptr noundef %174)
  %176 = load i32, ptr %11, align 4, !tbaa !9
  %177 = load i32, ptr @maxTextureSize, align 4, !tbaa !9
  %178 = icmp sgt i32 %176, %177
  br i1 %178, label %183, label %179

179:                                              ; preds = %173
  %180 = load i32, ptr %12, align 4, !tbaa !9
  %181 = load i32, ptr @maxTextureSize, align 4, !tbaa !9
  %182 = icmp sgt i32 %180, %181
  br i1 %182, label %183, label %189

183:                                              ; preds = %179, %173
  %184 = load i32, ptr %11, align 4, !tbaa !9
  %185 = load i32, ptr %12, align 4, !tbaa !9
  %186 = load i32, ptr @maxTextureSize, align 4, !tbaa !9
  %187 = load i32, ptr @maxTextureSize, align 4, !tbaa !9
  %188 = call i32 (ptr, ...) @printf(ptr noundef @.str.33, i32 noundef %184, i32 noundef %185, i32 noundef %186, i32 noundef %187)
  store i32 1, ptr %9, align 4
  br label %364

189:                                              ; preds = %179
  call void @llvm.lifetime.start.p0(i64 8, ptr %22) #6
  %190 = load i32, ptr %11, align 4, !tbaa !9
  %191 = sext i32 %190 to i64
  %192 = load i32, ptr %12, align 4, !tbaa !9
  %193 = sext i32 %192 to i64
  %194 = mul i64 %191, %193
  %195 = call noalias ptr @calloc(i64 noundef %194, i64 noundef 1) #7
  store ptr %195, ptr %22, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %23) #6
  store i32 0, ptr %23, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %24) #6
  %196 = load i32, ptr %12, align 4, !tbaa !9
  %197 = sub nsw i32 %196, 1
  store i32 %197, ptr %24, align 4, !tbaa !9
  br label %198

198:                                              ; preds = %281, %189
  call void @llvm.lifetime.start.p0(i64 4, ptr %25) #6
  store i32 1, ptr %25, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 1, ptr %26) #6
  %199 = load ptr, ptr %8, align 8, !tbaa !5
  %200 = call i32 (ptr, ptr, ...) @__isoc99_fscanf(ptr noundef %199, ptr noundef @.str.37, ptr noundef %25, ptr noundef %26)
  %201 = icmp eq i32 2, %200
  br i1 %201, label %202, label %239

202:                                              ; preds = %198
  %203 = load i8, ptr %26, align 1, !tbaa !13
  %204 = sext i8 %203 to i32
  %205 = icmp eq i32 %204, 111
  br i1 %205, label %206, label %220

206:                                              ; preds = %202
  %207 = load ptr, ptr %22, align 8, !tbaa !5
  %208 = load i32, ptr %24, align 4, !tbaa !9
  %209 = load i32, ptr %11, align 4, !tbaa !9
  %210 = mul nsw i32 %208, %209
  %211 = load i32, ptr %23, align 4, !tbaa !9
  %212 = add nsw i32 %210, %211
  %213 = sext i32 %212 to i64
  %214 = getelementptr inbounds i8, ptr %207, i64 %213
  %215 = load i32, ptr %25, align 4, !tbaa !9
  %216 = sext i32 %215 to i64
  call void @llvm.memset.p0.i64(ptr align 1 %214, i8 -1, i64 %216, i1 false)
  %217 = load i32, ptr %25, align 4, !tbaa !9
  %218 = load i32, ptr %23, align 4, !tbaa !9
  %219 = add nsw i32 %218, %217
  store i32 %219, ptr %23, align 4, !tbaa !9
  br label %238

220:                                              ; preds = %202
  %221 = load i8, ptr %26, align 1, !tbaa !13
  %222 = sext i8 %221 to i32
  %223 = icmp eq i32 %222, 98
  br i1 %223, label %224, label %228

224:                                              ; preds = %220
  %225 = load i32, ptr %25, align 4, !tbaa !9
  %226 = load i32, ptr %23, align 4, !tbaa !9
  %227 = add nsw i32 %226, %225
  store i32 %227, ptr %23, align 4, !tbaa !9
  br label %237

228:                                              ; preds = %220
  %229 = load i8, ptr %26, align 1, !tbaa !13
  %230 = sext i8 %229 to i32
  %231 = icmp eq i32 %230, 36
  br i1 %231, label %232, label %236

232:                                              ; preds = %228
  %233 = load i32, ptr %25, align 4, !tbaa !9
  %234 = load i32, ptr %24, align 4, !tbaa !9
  %235 = sub nsw i32 %234, %233
  store i32 %235, ptr %24, align 4, !tbaa !9
  store i32 0, ptr %23, align 4, !tbaa !9
  br label %236

236:                                              ; preds = %232, %228
  br label %237

237:                                              ; preds = %236, %224
  br label %238

238:                                              ; preds = %237, %206
  store i32 9, ptr %9, align 4
  br label %281

239:                                              ; preds = %198
  %240 = load ptr, ptr %8, align 8, !tbaa !5
  %241 = call i32 (ptr, ptr, ...) @__isoc99_fscanf(ptr noundef %240, ptr noundef @.str.38, ptr noundef %26)
  %242 = icmp eq i32 1, %241
  br i1 %242, label %243, label %280

243:                                              ; preds = %239
  %244 = load i8, ptr %26, align 1, !tbaa !13
  %245 = sext i8 %244 to i32
  %246 = icmp eq i32 %245, 33
  br i1 %246, label %247, label %248

247:                                              ; preds = %243
  store i32 8, ptr %9, align 4
  br label %281

248:                                              ; preds = %243
  %249 = load i8, ptr %26, align 1, !tbaa !13
  %250 = sext i8 %249 to i32
  %251 = icmp eq i32 %250, 36
  br i1 %251, label %252, label %255

252:                                              ; preds = %248
  %253 = load i32, ptr %24, align 4, !tbaa !9
  %254 = add nsw i32 %253, -1
  store i32 %254, ptr %24, align 4, !tbaa !9
  store i32 0, ptr %23, align 4, !tbaa !9
  br label %278

255:                                              ; preds = %248
  %256 = load i8, ptr %26, align 1, !tbaa !13
  %257 = sext i8 %256 to i32
  %258 = icmp eq i32 %257, 111
  br i1 %258, label %259, label %269

259:                                              ; preds = %255
  %260 = load ptr, ptr %22, align 8, !tbaa !5
  %261 = load i32, ptr %24, align 4, !tbaa !9
  %262 = load i32, ptr %11, align 4, !tbaa !9
  %263 = mul nsw i32 %261, %262
  %264 = load i32, ptr %23, align 4, !tbaa !9
  %265 = add nsw i32 %264, 1
  store i32 %265, ptr %23, align 4, !tbaa !9
  %266 = add nsw i32 %263, %264
  %267 = sext i32 %266 to i64
  %268 = getelementptr inbounds i8, ptr %260, i64 %267
  store i8 -1, ptr %268, align 1, !tbaa !13
  br label %277

269:                                              ; preds = %255
  %270 = load i8, ptr %26, align 1, !tbaa !13
  %271 = sext i8 %270 to i32
  %272 = icmp eq i32 %271, 98
  br i1 %272, label %273, label %276

273:                                              ; preds = %269
  %274 = load i32, ptr %23, align 4, !tbaa !9
  %275 = add nsw i32 %274, 1
  store i32 %275, ptr %23, align 4, !tbaa !9
  br label %276

276:                                              ; preds = %273, %269
  br label %277

277:                                              ; preds = %276, %259
  br label %278

278:                                              ; preds = %277, %252
  br label %279

279:                                              ; preds = %278
  store i32 9, ptr %9, align 4
  br label %281

280:                                              ; preds = %239
  store i32 1, ptr %9, align 4
  br label %281

281:                                              ; preds = %280, %279, %247, %238
  call void @llvm.lifetime.end.p0(i64 1, ptr %26) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %25) #6
  %282 = load i32, ptr %9, align 4
  switch i32 %282, label %290 [
    i32 9, label %198
    i32 8, label %283
  ]

283:                                              ; preds = %281
  %284 = load ptr, ptr %7, align 8, !tbaa !5
  call void @setPatternName(ptr noundef %284)
  %285 = load ptr, ptr %22, align 8, !tbaa !5
  %286 = load i32, ptr %11, align 4, !tbaa !9
  %287 = load i32, ptr %12, align 4, !tbaa !9
  call void @setCells(ptr noundef %285, i32 noundef %286, i32 noundef %287)
  %288 = load ptr, ptr %22, align 8, !tbaa !5
  call void @free(ptr noundef %288) #6
  %289 = call i32 (ptr, ...) @printf(ptr noundef @.str.35)
  store i32 1, ptr %9, align 4
  br label %290

290:                                              ; preds = %283, %281
  call void @llvm.lifetime.end.p0(i64 4, ptr %24) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %23) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #6
  br label %364

291:                                              ; preds = %169
  %292 = load ptr, ptr %8, align 8, !tbaa !5
  %293 = call i32 @fclose(ptr noundef %292)
  call void @llvm.lifetime.start.p0(i64 4, ptr %27) #6
  %294 = load ptr, ptr %7, align 8, !tbaa !5
  %295 = call i32 @stbi_info(ptr noundef %294, ptr noundef %11, ptr noundef %12, ptr noundef %27)
  %296 = icmp ne i32 %295, 0
  br i1 %296, label %297, label %360

297:                                              ; preds = %291
  call void @stbi_set_flip_vertically_on_load(i32 noundef 1)
  call void @llvm.lifetime.start.p0(i64 8, ptr %28) #6
  %298 = load ptr, ptr %7, align 8, !tbaa !5
  %299 = call ptr @stbi_load(ptr noundef %298, ptr noundef %11, ptr noundef %12, ptr noundef %27, i32 noundef 1)
  store ptr %299, ptr %28, align 8, !tbaa !5
  %300 = load ptr, ptr %28, align 8, !tbaa !5
  %301 = icmp ne ptr %300, null
  br i1 %301, label %306, label %302

302:                                              ; preds = %297
  %303 = load ptr, ptr %7, align 8, !tbaa !5
  %304 = call ptr @stbi_failure_reason()
  %305 = call i32 (ptr, ...) @printf(ptr noundef @.str.39, ptr noundef %303, ptr noundef %304)
  store i32 1, ptr %9, align 4
  br label %359

306:                                              ; preds = %297
  %307 = load ptr, ptr %7, align 8, !tbaa !5
  %308 = call i32 (ptr, ...) @printf(ptr noundef @.str.30, ptr noundef %307)
  %309 = load i32, ptr %11, align 4, !tbaa !9
  %310 = load i32, ptr @maxTextureSize, align 4, !tbaa !9
  %311 = icmp sgt i32 %309, %310
  br i1 %311, label %316, label %312

312:                                              ; preds = %306
  %313 = load i32, ptr %12, align 4, !tbaa !9
  %314 = load i32, ptr @maxTextureSize, align 4, !tbaa !9
  %315 = icmp sgt i32 %313, %314
  br i1 %315, label %316, label %322

316:                                              ; preds = %312, %306
  %317 = load i32, ptr %11, align 4, !tbaa !9
  %318 = load i32, ptr %12, align 4, !tbaa !9
  %319 = load i32, ptr @maxTextureSize, align 4, !tbaa !9
  %320 = load i32, ptr @maxTextureSize, align 4, !tbaa !9
  %321 = call i32 (ptr, ...) @printf(ptr noundef @.str.33, i32 noundef %317, i32 noundef %318, i32 noundef %319, i32 noundef %320)
  store i32 1, ptr %9, align 4
  br label %359

322:                                              ; preds = %312
  call void @llvm.lifetime.start.p0(i64 8, ptr %29) #6
  %323 = load i32, ptr %11, align 4, !tbaa !9
  %324 = sext i32 %323 to i64
  %325 = load i32, ptr %12, align 4, !tbaa !9
  %326 = sext i32 %325 to i64
  %327 = mul nsw i64 %324, %326
  store i64 %327, ptr %29, align 8, !tbaa !16
  call void @llvm.lifetime.start.p0(i64 8, ptr %30) #6
  store i64 0, ptr %30, align 8, !tbaa !16
  br label %328

328:                                              ; preds = %349, %322
  %329 = load i64, ptr %30, align 8, !tbaa !16
  %330 = load i64, ptr %29, align 8, !tbaa !16
  %331 = icmp slt i64 %329, %330
  br i1 %331, label %333, label %332

332:                                              ; preds = %328
  store i32 10, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %30) #6
  br label %352

333:                                              ; preds = %328
  %334 = load ptr, ptr %28, align 8, !tbaa !5
  %335 = load i64, ptr %30, align 8, !tbaa !16
  %336 = getelementptr inbounds i8, ptr %334, i64 %335
  %337 = load i8, ptr %336, align 1, !tbaa !13
  %338 = zext i8 %337 to i32
  %339 = icmp sgt i32 %338, 127
  br i1 %339, label %340, label %344

340:                                              ; preds = %333
  %341 = load ptr, ptr %28, align 8, !tbaa !5
  %342 = load i64, ptr %30, align 8, !tbaa !16
  %343 = getelementptr inbounds i8, ptr %341, i64 %342
  store i8 0, ptr %343, align 1, !tbaa !13
  br label %348

344:                                              ; preds = %333
  %345 = load ptr, ptr %28, align 8, !tbaa !5
  %346 = load i64, ptr %30, align 8, !tbaa !16
  %347 = getelementptr inbounds i8, ptr %345, i64 %346
  store i8 -1, ptr %347, align 1, !tbaa !13
  br label %348

348:                                              ; preds = %344, %340
  br label %349

349:                                              ; preds = %348
  %350 = load i64, ptr %30, align 8, !tbaa !16
  %351 = add nsw i64 %350, 1
  store i64 %351, ptr %30, align 8, !tbaa !16
  br label %328, !llvm.loop !18

352:                                              ; preds = %332
  %353 = load ptr, ptr %7, align 8, !tbaa !5
  call void @setPatternName(ptr noundef %353)
  %354 = load ptr, ptr %28, align 8, !tbaa !5
  %355 = load i32, ptr %11, align 4, !tbaa !9
  %356 = load i32, ptr %12, align 4, !tbaa !9
  call void @setCells(ptr noundef %354, i32 noundef %355, i32 noundef %356)
  %357 = load ptr, ptr %28, align 8, !tbaa !5
  call void @stbi_image_free(ptr noundef %357)
  %358 = call i32 (ptr, ...) @printf(ptr noundef @.str.35)
  store i32 1, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %29) #6
  br label %359

359:                                              ; preds = %352, %316, %302
  call void @llvm.lifetime.end.p0(i64 8, ptr %28) #6
  br label %363

360:                                              ; preds = %291
  %361 = load ptr, ptr %7, align 8, !tbaa !5
  %362 = call i32 (ptr, ...) @printf(ptr noundef @.str.40, ptr noundef %361)
  store i32 0, ptr %9, align 4
  br label %363

363:                                              ; preds = %360, %359
  call void @llvm.lifetime.end.p0(i64 4, ptr %27) #6
  br label %364

364:                                              ; preds = %363, %290, %183
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #6
  call void @llvm.lifetime.end.p0(i64 1024, ptr %20) #6
  br label %365

365:                                              ; preds = %364, %150
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr %10) #6
  br label %366

366:                                              ; preds = %365, %38
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #6
  %367 = load i32, ptr %9, align 4
  switch i32 %367, label %369 [
    i32 0, label %368
    i32 1, label %368
  ]

368:                                              ; preds = %366, %366
  ret void

369:                                              ; preds = %366
  unreachable
}

declare noalias ptr @fopen(ptr noundef, ptr noundef) #3

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

declare ptr @fgets(ptr noundef, i32 noundef, ptr noundef) #3

; Function Attrs: nounwind
declare i32 @__isoc99_sscanf(ptr noundef, ptr noundef, ...) #1

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #5

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

!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 = !{!"int", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = !{!7, !7, i64 0}
!14 = distinct !{!14, !12}
!15 = distinct !{!15, !12}
!16 = !{!17, !17, i64 0}
!17 = !{!"long", !7, i64 0}
!18 = distinct !{!18, !12}


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

@maxTextureSize = external dso_local local_unnamed_addr global i32, align 4
@.str.27 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.28 = external hidden unnamed_addr constant [17 x i8], align 1
@.str.29 = external hidden unnamed_addr constant [15 x i8], align 1
@.str.30 = external hidden unnamed_addr constant [15 x i8], align 1
@.str.31 = external hidden unnamed_addr constant [8 x i8], align 1
@.str.33 = external hidden unnamed_addr constant [52 x i8], align 1
@.str.34 = external hidden unnamed_addr constant [13 x i8], align 1
@.str.35 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.36 = external hidden unnamed_addr constant [18 x i8], align 1
@.str.37 = external hidden unnamed_addr constant [8 x i8], align 1
@.str.38 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.39 = external hidden unnamed_addr constant [21 x i8], align 1
@.str.40 = external hidden unnamed_addr constant [24 x i8], align 1

; Function Attrs: nounwind uwtable
declare dso_local ptr @stbi_failure_reason() local_unnamed_addr #0

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

; Function Attrs: mustprogress nounwind willreturn allockind("free") memory(argmem: readwrite, inaccessiblemem: readwrite)
declare void @free(ptr allocptr nocapture noundef) local_unnamed_addr #1

; Function Attrs: nounwind uwtable
declare dso_local void @stbi_set_flip_vertically_on_load(i32 noundef) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
declare dso_local ptr @stbi_load(ptr noundef, ptr noundef, ptr noundef, ptr noundef, 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) #2

; Function Attrs: nofree nounwind
declare noundef i32 @fclose(ptr nocapture noundef) local_unnamed_addr #3

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

; Function Attrs: nofree nounwind
declare noundef i32 @fseek(ptr nocapture noundef, i64 noundef, i32 noundef) local_unnamed_addr #3

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

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

; Function Attrs: nounwind uwtable
declare dso_local void @setCells(ptr noundef, i32 noundef, i32 noundef) local_unnamed_addr #0

; Function Attrs: mustprogress nofree nounwind willreturn allockind("alloc,zeroed") allocsize(0,1) memory(inaccessiblemem: readwrite)
declare noalias noundef ptr @calloc(i64 noundef, i64 noundef) local_unnamed_addr #4

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

; Function Attrs: nounwind uwtable
define dso_local void @onFileDragAndDrop(ptr nocapture noundef readnone %0, i32 noundef %1, ptr nocapture noundef readonly %2) local_unnamed_addr #0 {
  %4 = alloca i8, align 1
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca [1024 x i8], align 16
  %10 = alloca i32, align 4
  %11 = alloca i8, align 1
  %12 = alloca i32, align 4
  %13 = load ptr, ptr %2, align 8, !tbaa !5
  %14 = tail call noalias ptr @fopen(ptr noundef %13, ptr noundef nonnull @.str.27)
  %.not = icmp eq ptr %14, null
  br i1 %.not, label %15, label %17

15:                                               ; preds = %3
  %16 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.28, ptr noundef %13)
  br label %173

17:                                               ; preds = %3
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %4) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %5) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %6) #8
  %18 = tail call i32 @fseek(ptr noundef nonnull %14, i64 noundef 0, i32 noundef 0)
  %19 = call i32 (ptr, ptr, ...) @__isoc99_fscanf(ptr noundef nonnull %14, ptr noundef nonnull @.str.29, ptr noundef nonnull %4) #8
  %20 = icmp eq i32 %19, 1
  br i1 %20, label %21, label %65

21:                                               ; preds = %17
  %22 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.30, ptr noundef %13)
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %7) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %8) #8
  %23 = call i32 (ptr, ptr, ...) @__isoc99_fscanf(ptr noundef nonnull %14, ptr noundef nonnull @.str.31, ptr noundef nonnull %7, ptr noundef nonnull %8) #8
  %24 = icmp eq i32 %23, 2
  br i1 %24, label %.lr.ph115, label %._crit_edge116

.lr.ph115:                                        ; preds = %21, %.lr.ph115
  %.068113 = phi i32 [ %spec.select, %.lr.ph115 ], [ 0, %21 ]
  %.075112 = phi i32 [ %.176, %.lr.ph115 ], [ 0, %21 ]
  %.077111 = phi i32 [ %.178, %.lr.ph115 ], [ 0, %21 ]
  %.079110 = phi i32 [ %.180, %.lr.ph115 ], [ 0, %21 ]
  %25 = load i32, ptr %7, align 4, !tbaa !9
  %spec.select = call i32 @llvm.smin.i32(i32 %25, i32 %.068113)
  %.176 = call i32 @llvm.smax.i32(i32 %25, i32 %.075112)
  %26 = load i32, ptr %8, align 4, !tbaa !9
  %.178 = call i32 @llvm.smin.i32(i32 %26, i32 %.077111)
  %.180 = call i32 @llvm.smax.i32(i32 %26, i32 %.079110)
  %27 = call i32 (ptr, ptr, ...) @__isoc99_fscanf(ptr noundef nonnull %14, ptr noundef nonnull @.str.31, ptr noundef nonnull %7, ptr noundef nonnull %8) #8
  %28 = icmp eq i32 %27, 2
  br i1 %28, label %.lr.ph115, label %._crit_edge116.loopexit, !llvm.loop !11

._crit_edge116.loopexit:                          ; preds = %.lr.ph115
  %29 = add nuw nsw i32 %.176, 1
  %30 = add nuw nsw i32 %.180, 1
  br label %._crit_edge116

._crit_edge116:                                   ; preds = %._crit_edge116.loopexit, %21
  %.079.lcssa = phi i32 [ 1, %21 ], [ %30, %._crit_edge116.loopexit ]
  %.077.lcssa = phi i32 [ 0, %21 ], [ %.178, %._crit_edge116.loopexit ]
  %.075.lcssa = phi i32 [ 1, %21 ], [ %29, %._crit_edge116.loopexit ]
  %.068.lcssa = phi i32 [ 0, %21 ], [ %spec.select, %._crit_edge116.loopexit ]
  %31 = sub i32 %.075.lcssa, %.068.lcssa
  store i32 %31, ptr %5, align 4, !tbaa !9
  %32 = sub i32 %.079.lcssa, %.077.lcssa
  store i32 %32, ptr %6, align 4, !tbaa !9
  %33 = load i32, ptr @maxTextureSize, align 4, !tbaa !9
  %34 = icmp sgt i32 %31, %33
  %35 = icmp sgt i32 %32, %33
  %or.cond = select i1 %34, i1 true, i1 %35
  br i1 %or.cond, label %36, label %38

36:                                               ; preds = %._crit_edge116
  %37 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.33, i32 noundef %31, i32 noundef %32, i32 noundef %33, i32 noundef %33)
  br label %64

38:                                               ; preds = %._crit_edge116
  %39 = sext i32 %31 to i64
  %40 = zext nneg i32 %32 to i64
  %41 = mul nsw i64 %39, %40
  %42 = call noalias ptr @calloc(i64 noundef %41, i64 noundef 1) #9
  %43 = call i32 @fseek(ptr noundef nonnull %14, i64 noundef 0, i32 noundef 0)
  %44 = call i32 (ptr, ptr, ...) @__isoc99_fscanf(ptr noundef nonnull %14, ptr noundef nonnull @.str.34) #8
  %45 = call i32 (ptr, ptr, ...) @__isoc99_fscanf(ptr noundef nonnull %14, ptr noundef nonnull @.str.31, ptr noundef nonnull %7, ptr noundef nonnull %8) #8
  %46 = icmp eq i32 %45, 2
  br i1 %46, label %.lr.ph121, label %._crit_edge122

.lr.ph121:                                        ; preds = %38, %.lr.ph121
  %47 = load i32, ptr %7, align 4, !tbaa !9
  %48 = sub nsw i32 %47, %.068.lcssa
  store i32 %48, ptr %7, align 4, !tbaa !9
  %49 = load i32, ptr %8, align 4, !tbaa !9
  %50 = load i32, ptr %6, align 4, !tbaa !9
  %51 = xor i32 %49, -1
  %52 = add i32 %.077.lcssa, %51
  %53 = add i32 %50, %52
  store i32 %53, ptr %8, align 4, !tbaa !9
  %54 = load i32, ptr %5, align 4, !tbaa !9
  %55 = mul nsw i32 %54, %53
  %56 = add nsw i32 %55, %48
  %57 = sext i32 %56 to i64
  %58 = getelementptr inbounds i8, ptr %42, i64 %57
  store i8 -1, ptr %58, align 1, !tbaa !13
  %59 = call i32 (ptr, ptr, ...) @__isoc99_fscanf(ptr noundef nonnull %14, ptr noundef nonnull @.str.31, ptr noundef nonnull %7, ptr noundef nonnull %8) #8
  %60 = icmp eq i32 %59, 2
  br i1 %60, label %.lr.ph121, label %._crit_edge122, !llvm.loop !14

._crit_edge122:                                   ; preds = %.lr.ph121, %38
  call void @setPatternName(ptr noundef %13)
  %61 = load i32, ptr %5, align 4, !tbaa !9
  %62 = load i32, ptr %6, align 4, !tbaa !9
  call void @setCells(ptr noundef %42, i32 noundef %61, i32 noundef %62)
  call void @free(ptr noundef %42) #8
  %63 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.35)
  br label %64

64:                                               ; preds = %._crit_edge122, %36
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %8) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %7) #8
  br label %172

65:                                               ; preds = %17
  %66 = call i32 @fseek(ptr noundef nonnull %14, i64 noundef 0, i32 noundef 0)
  call void @llvm.lifetime.start.p0(i64 1024, ptr nonnull %9) #8
  br label %67

67:                                               ; preds = %69, %65
  %68 = call ptr @fgets(ptr noundef nonnull %9, i32 noundef 1024, ptr noundef nonnull %14)
  %.not99 = icmp eq ptr %68, null
  br i1 %.not99, label %.critedge, label %69

69:                                               ; preds = %67
  %70 = load i8, ptr %68, align 1, !tbaa !13
  %71 = icmp eq i8 %70, 35
  br i1 %71, label %67, label %.critedge, !llvm.loop !15

.critedge:                                        ; preds = %67, %69
  %72 = call i32 (ptr, ptr, ...) @__isoc99_sscanf(ptr noundef %68, ptr noundef nonnull @.str.36, ptr noundef nonnull %5, ptr noundef nonnull %6) #8
  %73 = icmp eq i32 %72, 2
  br i1 %73, label %74, label %129

74:                                               ; preds = %.critedge
  %75 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.30, ptr noundef %13)
  %76 = load i32, ptr %5, align 4, !tbaa !9
  %77 = load i32, ptr @maxTextureSize, align 4, !tbaa !9
  %78 = icmp sgt i32 %76, %77
  %.pre123 = load i32, ptr %6, align 4, !tbaa !9
  %79 = icmp sgt i32 %.pre123, %77
  %or.cond124 = select i1 %78, i1 true, i1 %79
  br i1 %or.cond124, label %80, label %82

80:                                               ; preds = %74
  %81 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.33, i32 noundef %76, i32 noundef %.pre123, i32 noundef %77, i32 noundef %77)
  br label %171

82:                                               ; preds = %74
  %83 = sext i32 %76 to i64
  %84 = sext i32 %.pre123 to i64
  %85 = mul nsw i64 %84, %83
  %86 = call noalias ptr @calloc(i64 noundef %85, i64 noundef 1) #9
  %87 = add nsw i32 %.pre123, -1
  br label %88

88:                                               ; preds = %124, %82
  %.071 = phi i32 [ 0, %82 ], [ %.374, %124 ]
  %.069 = phi i32 [ %87, %82 ], [ %.3, %124 ]
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %10) #8
  store i32 1, ptr %10, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %11) #8
  %89 = call i32 (ptr, ptr, ...) @__isoc99_fscanf(ptr noundef nonnull %14, ptr noundef nonnull @.str.37, ptr noundef nonnull %10, ptr noundef nonnull %11) #8
  %90 = icmp eq i32 %89, 2
  br i1 %90, label %91, label %108

91:                                               ; preds = %88
  %92 = load i8, ptr %11, align 1, !tbaa !13
  switch i8 %92, label %124 [
    i8 111, label %93
    i8 98, label %102
    i8 36, label %105
  ]

93:                                               ; preds = %91
  %94 = load i32, ptr %5, align 4, !tbaa !9
  %95 = mul nsw i32 %94, %.069
  %96 = add nsw i32 %95, %.071
  %97 = sext i32 %96 to i64
  %98 = getelementptr inbounds i8, ptr %86, i64 %97
  %99 = load i32, ptr %10, align 4, !tbaa !9
  %100 = sext i32 %99 to i64
  call void @llvm.memset.p0.i64(ptr align 1 %98, i8 -1, i64 %100, i1 false)
  %101 = add nsw i32 %99, %.071
  br label %124

102:                                              ; preds = %91
  %103 = load i32, ptr %10, align 4, !tbaa !9
  %104 = add nsw i32 %103, %.071
  br label %124

105:                                              ; preds = %91
  %106 = load i32, ptr %10, align 4, !tbaa !9
  %107 = sub nsw i32 %.069, %106
  br label %124

108:                                              ; preds = %88
  %109 = call i32 (ptr, ptr, ...) @__isoc99_fscanf(ptr noundef nonnull %14, ptr noundef nonnull @.str.38, ptr noundef nonnull %11) #8
  %110 = icmp eq i32 %109, 1
  br i1 %110, label %111, label %.thread

.thread:                                          ; preds = %108
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %11) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %10) #8
  br label %171

111:                                              ; preds = %108
  %112 = load i8, ptr %11, align 1, !tbaa !13
  switch i8 %112, label %124 [
    i8 33, label %125
    i8 36, label %113
    i8 111, label %115
    i8 98, label %122
  ]

113:                                              ; preds = %111
  %114 = add nsw i32 %.069, -1
  br label %124

115:                                              ; preds = %111
  %116 = load i32, ptr %5, align 4, !tbaa !9
  %117 = mul nsw i32 %116, %.069
  %118 = add nsw i32 %.071, 1
  %119 = add nsw i32 %117, %.071
  %120 = sext i32 %119 to i64
  %121 = getelementptr inbounds i8, ptr %86, i64 %120
  store i8 -1, ptr %121, align 1, !tbaa !13
  br label %124

122:                                              ; preds = %111
  %123 = add nsw i32 %.071, 1
  br label %124

124:                                              ; preds = %111, %115, %122, %113, %93, %105, %102, %91
  %.374 = phi i32 [ %101, %93 ], [ %104, %102 ], [ 0, %105 ], [ %.071, %91 ], [ 0, %113 ], [ %118, %115 ], [ %123, %122 ], [ %.071, %111 ]
  %.3 = phi i32 [ %.069, %93 ], [ %.069, %102 ], [ %107, %105 ], [ %.069, %91 ], [ %114, %113 ], [ %.069, %115 ], [ %.069, %122 ], [ %.069, %111 ]
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %11) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %10) #8
  br label %88

125:                                              ; preds = %111
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %11) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %10) #8
  call void @setPatternName(ptr noundef %13)
  %126 = load i32, ptr %5, align 4, !tbaa !9
  %127 = load i32, ptr %6, align 4, !tbaa !9
  call void @setCells(ptr noundef %86, i32 noundef %126, i32 noundef %127)
  call void @free(ptr noundef %86) #8
  %128 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.35)
  br label %171

129:                                              ; preds = %.critedge
  %130 = call i32 @fclose(ptr noundef nonnull %14)
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %12) #8
  %131 = call i32 @stbi_info(ptr noundef %13, ptr noundef nonnull %5, ptr noundef nonnull %6, ptr noundef nonnull %12)
  %.not100 = icmp eq i32 %131, 0
  br i1 %.not100, label %168, label %132

132:                                              ; preds = %129
  call void @stbi_set_flip_vertically_on_load(i32 noundef 1)
  %133 = call ptr @stbi_load(ptr noundef %13, ptr noundef nonnull %5, ptr noundef nonnull %6, ptr noundef nonnull %12, i32 noundef 1)
  %.not101 = icmp eq ptr %133, null
  br i1 %.not101, label %134, label %137

134:                                              ; preds = %132
  %135 = call ptr @stbi_failure_reason()
  %136 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.39, ptr noundef %13, ptr noundef %135)
  br label %170

137:                                              ; preds = %132
  %138 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.30, ptr noundef %13)
  %139 = load i32, ptr %5, align 4, !tbaa !9
  %140 = load i32, ptr @maxTextureSize, align 4, !tbaa !9
  %141 = icmp sgt i32 %139, %140
  %.pre = load i32, ptr %6, align 4, !tbaa !9
  %142 = icmp sgt i32 %.pre, %140
  %or.cond125 = select i1 %141, i1 true, i1 %142
  br i1 %or.cond125, label %143, label %145

143:                                              ; preds = %137
  %144 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.33, i32 noundef %139, i32 noundef %.pre, i32 noundef %140, i32 noundef %140)
  br label %170

145:                                              ; preds = %137
  %146 = sext i32 %139 to i64
  %147 = sext i32 %.pre to i64
  %148 = mul nsw i64 %147, %146
  %149 = icmp sgt i64 %148, 0
  br i1 %149, label %iter.check, label %._crit_edge

iter.check:                                       ; preds = %145
  %min.iters.check = icmp ult i64 %148, 8
  br i1 %min.iters.check, label %.lr.ph.preheader, label %vector.main.loop.iter.check

vector.main.loop.iter.check:                      ; preds = %iter.check
  %min.iters.check126 = icmp ult i64 %148, 32
  br i1 %min.iters.check126, label %vec.epilog.ph, label %vector.ph

vector.ph:                                        ; preds = %vector.main.loop.iter.check
  %n.vec = and i64 %148, 9223372036854775776
  br label %vector.body

vector.body:                                      ; preds = %vector.body, %vector.ph
  %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
  %150 = getelementptr inbounds i8, ptr %133, i64 %index
  %151 = getelementptr inbounds i8, ptr %150, i64 16
  %wide.load = load <16 x i8>, ptr %150, align 1, !tbaa !13
  %wide.load127 = load <16 x i8>, ptr %151, align 1, !tbaa !13
  %152 = icmp sgt <16 x i8> %wide.load, <i8 -1, i8 -1, i8 -1, i8 -1, i8 -1, i8 -1, i8 -1, i8 -1, i8 -1, i8 -1, i8 -1, i8 -1, i8 -1, i8 -1, i8 -1, i8 -1>
  %153 = icmp sgt <16 x i8> %wide.load127, <i8 -1, i8 -1, i8 -1, i8 -1, i8 -1, i8 -1, i8 -1, i8 -1, i8 -1, i8 -1, i8 -1, i8 -1, i8 -1, i8 -1, i8 -1, i8 -1>
  %154 = sext <16 x i1> %152 to <16 x i8>
  %155 = sext <16 x i1> %153 to <16 x i8>
  store <16 x i8> %154, ptr %150, align 1, !tbaa !13
  store <16 x i8> %155, ptr %151, align 1, !tbaa !13
  %index.next = add nuw i64 %index, 32
  %156 = icmp eq i64 %index.next, %n.vec
  br i1 %156, label %middle.block, label %vector.body, !llvm.loop !16

middle.block:                                     ; preds = %vector.body
  %cmp.n = icmp eq i64 %148, %n.vec
  br i1 %cmp.n, label %._crit_edge, label %vec.epilog.iter.check

vec.epilog.iter.check:                            ; preds = %middle.block
  %n.vec.remaining = and i64 %148, 24
  %min.epilog.iters.check = icmp eq i64 %n.vec.remaining, 0
  br i1 %min.epilog.iters.check, label %.lr.ph.preheader, label %vec.epilog.ph

.lr.ph.preheader:                                 ; preds = %vec.epilog.middle.block, %iter.check, %vec.epilog.iter.check
  %.0109.ph = phi i64 [ 0, %iter.check ], [ %n.vec, %vec.epilog.iter.check ], [ %n.vec129, %vec.epilog.middle.block ]
  br label %.lr.ph

vec.epilog.ph:                                    ; preds = %vector.main.loop.iter.check, %vec.epilog.iter.check
  %vec.epilog.resume.val = phi i64 [ %n.vec, %vec.epilog.iter.check ], [ 0, %vector.main.loop.iter.check ]
  %n.vec129 = and i64 %148, 9223372036854775800
  br label %vec.epilog.vector.body

vec.epilog.vector.body:                           ; preds = %vec.epilog.vector.body, %vec.epilog.ph
  %index130 = phi i64 [ %vec.epilog.resume.val, %vec.epilog.ph ], [ %index.next132, %vec.epilog.vector.body ]
  %157 = getelementptr inbounds i8, ptr %133, i64 %index130
  %wide.load131 = load <8 x i8>, ptr %157, align 1, !tbaa !13
  %158 = icmp sgt <8 x i8> %wide.load131, <i8 -1, i8 -1, i8 -1, i8 -1, i8 -1, i8 -1, i8 -1, i8 -1>
  %159 = sext <8 x i1> %158 to <8 x i8>
  store <8 x i8> %159, ptr %157, align 1, !tbaa !13
  %index.next132 = add nuw i64 %index130, 8
  %160 = icmp eq i64 %index.next132, %n.vec129
  br i1 %160, label %vec.epilog.middle.block, label %vec.epilog.vector.body, !llvm.loop !19

vec.epilog.middle.block:                          ; preds = %vec.epilog.vector.body
  %cmp.n133 = icmp eq i64 %148, %n.vec129
  br i1 %cmp.n133, label %._crit_edge, label %.lr.ph.preheader

._crit_edge:                                      ; preds = %.lr.ph, %middle.block, %vec.epilog.middle.block, %145
  call void @setPatternName(ptr noundef %13)
  %161 = load i32, ptr %5, align 4, !tbaa !9
  %162 = load i32, ptr %6, align 4, !tbaa !9
  call void @setCells(ptr noundef nonnull %133, i32 noundef %161, i32 noundef %162)
  call void @stbi_image_free(ptr noundef nonnull %133)
  %163 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.35)
  br label %170

.lr.ph:                                           ; preds = %.lr.ph.preheader, %.lr.ph
  %.0109 = phi i64 [ %167, %.lr.ph ], [ %.0109.ph, %.lr.ph.preheader ]
  %164 = getelementptr inbounds i8, ptr %133, i64 %.0109
  %165 = load i8, ptr %164, align 1, !tbaa !13
  %166 = icmp sgt i8 %165, -1
  %. = sext i1 %166 to i8
  store i8 %., ptr %164, align 1, !tbaa !13
  %167 = add nuw nsw i64 %.0109, 1
  %exitcond.not = icmp eq i64 %167, %148
  br i1 %exitcond.not, label %._crit_edge, label %.lr.ph, !llvm.loop !20

168:                                              ; preds = %129
  %169 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.40, ptr noundef %13)
  br label %170

170:                                              ; preds = %134, %143, %._crit_edge, %168
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %12) #8
  br label %171

171:                                              ; preds = %.thread, %125, %170, %80
  call void @llvm.lifetime.end.p0(i64 1024, ptr nonnull %9) #8
  br label %172

172:                                              ; preds = %171, %64
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %6) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #8
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %4) #8
  br label %173

173:                                              ; preds = %172, %15
  ret void
}

; Function Attrs: nofree nounwind
declare noalias noundef ptr @fopen(ptr nocapture noundef readonly, ptr nocapture noundef readonly) local_unnamed_addr #3

declare i32 @__isoc99_fscanf(ptr noundef, ptr noundef, ...) local_unnamed_addr #5

; Function Attrs: nofree nounwind
declare noundef ptr @fgets(ptr noundef, i32 noundef, ptr nocapture noundef) local_unnamed_addr #3

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

; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #6

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

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

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

!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 = !{!"int", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = !{!7, !7, i64 0}
!14 = distinct !{!14, !12}
!15 = distinct !{!15, !12}
!16 = distinct !{!16, !12, !17, !18}
!17 = !{!"llvm.loop.isvectorized", i32 1}
!18 = !{!"llvm.loop.unroll.runtime.disable"}
!19 = distinct !{!19, !12, !17, !18}
!20 = distinct !{!20, !12, !18, !17}


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