; LLVM IR from zchrissirhcz/pixel :: src (px_bmp)

; 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.BMP_image = type { %struct.BMP_file_header, %struct.BMP_info_header, ptr, ptr }
%struct.BMP_file_header = type { [2 x i8], i32, [2 x i16], i32 }
%struct.BMP_info_header = type { i32, i32, i32, i16, i16, i32, i32, i32, i32, i32, i32 }
%struct.BMP_palette_entry = type { i8, i8, i8, i8 }

@stderr = external global ptr, align 8
@.str = external hidden unnamed_addr constant [42 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [23 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [12 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [22 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [38 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [39 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [40 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [30 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [52 x i8], align 1
@.str.12 = external hidden unnamed_addr constant [63 x i8], align 1
@.str.13 = external hidden unnamed_addr constant [38 x i8], align 1
@.str.14 = external hidden unnamed_addr constant [33 x i8], align 1
@.str.15 = external hidden unnamed_addr constant [74 x i8], align 1
@.str.16 = external hidden unnamed_addr constant [65 x i8], align 1
@.str.17 = external hidden unnamed_addr constant [64 x i8], align 1
@.str.18 = external hidden unnamed_addr constant [30 x i8], align 1
@.str.19 = external hidden unnamed_addr constant [43 x i8], align 1
@.str.20 = external hidden unnamed_addr constant [14 x i8], align 1

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

49:                                               ; preds = %7
  %50 = load ptr, ptr %8, align 8, !tbaa !5
  %51 = call zeroext i1 @is_valid_bmp_filename(ptr noundef %50)
  br i1 %51, label %53, label %52

52:                                               ; preds = %49
  br label %729

53:                                               ; preds = %49
  %54 = load i32, ptr %13, align 4, !tbaa !9
  %55 = icmp ne i32 %54, 1
  br i1 %55, label %56, label %67

56:                                               ; preds = %53
  %57 = load i32, ptr %13, align 4, !tbaa !9
  %58 = icmp ne i32 %57, 4
  br i1 %58, label %59, label %67

59:                                               ; preds = %56
  br label %60

60:                                               ; preds = %59
  %61 = load ptr, ptr @stderr, align 8, !tbaa !5
  %62 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %61, ptr noundef @.str) #8
  %63 = load ptr, ptr @stderr, align 8, !tbaa !5
  %64 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %63, ptr noundef @.str.1) #8
  br label %65

65:                                               ; preds = %60
  br label %66

66:                                               ; preds = %65
  br label %729

67:                                               ; preds = %56, %53
  call void @llvm.lifetime.start.p0(i64 14, ptr %22) #8
  call void @llvm.memset.p0.i64(ptr align 1 %22, i8 0, i64 14, i1 false)
  call void @llvm.lifetime.start.p0(i64 40, ptr %23) #8
  call void @llvm.memset.p0.i64(ptr align 16 %23, i8 0, i64 40, i1 false)
  %68 = load ptr, ptr %8, align 8, !tbaa !5
  %69 = call noalias ptr @fopen(ptr noundef %68, ptr noundef @.str.2)
  store ptr %69, ptr %15, align 8, !tbaa !5
  %70 = load ptr, ptr %15, align 8, !tbaa !5
  %71 = icmp ne ptr %70, null
  br i1 %71, label %81, label %72

72:                                               ; preds = %67
  br label %73

73:                                               ; preds = %72
  %74 = load ptr, ptr @stderr, align 8, !tbaa !5
  %75 = load ptr, ptr %8, align 8, !tbaa !5
  %76 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %74, ptr noundef @.str.3, ptr noundef %75) #8
  %77 = load ptr, ptr @stderr, align 8, !tbaa !5
  %78 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %77, ptr noundef @.str.1) #8
  br label %79

79:                                               ; preds = %73
  br label %80

80:                                               ; preds = %79
  store i32 2, ptr %24, align 4
  br label %725

81:                                               ; preds = %67
  %82 = getelementptr inbounds [14 x i8], ptr %22, i64 0, i64 0
  %83 = load ptr, ptr %15, align 8, !tbaa !5
  %84 = call i64 @fread(ptr noundef %82, i64 noundef 14, i64 noundef 1, ptr noundef %83)
  %85 = icmp ne i64 %84, 1
  br i1 %85, label %86, label %94

86:                                               ; preds = %81
  br label %87

87:                                               ; preds = %86
  %88 = load ptr, ptr @stderr, align 8, !tbaa !5
  %89 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %88, ptr noundef @.str.4) #8
  %90 = load ptr, ptr @stderr, align 8, !tbaa !5
  %91 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %90, ptr noundef @.str.1) #8
  br label %92

92:                                               ; preds = %87
  br label %93

93:                                               ; preds = %92
  store i32 2, ptr %24, align 4
  br label %725

94:                                               ; preds = %81
  %95 = getelementptr inbounds [40 x i8], ptr %23, i64 0, i64 0
  %96 = load ptr, ptr %15, align 8, !tbaa !5
  %97 = call i64 @fread(ptr noundef %95, i64 noundef 40, i64 noundef 1, ptr noundef %96)
  %98 = icmp ne i64 %97, 1
  br i1 %98, label %99, label %107

99:                                               ; preds = %94
  br label %100

100:                                              ; preds = %99
  %101 = load ptr, ptr @stderr, align 8, !tbaa !5
  %102 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %101, ptr noundef @.str.4) #8
  %103 = load ptr, ptr @stderr, align 8, !tbaa !5
  %104 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %103, ptr noundef @.str.1) #8
  br label %105

105:                                              ; preds = %100
  br label %106

106:                                              ; preds = %105
  store i32 2, ptr %24, align 4
  br label %725

107:                                              ; preds = %94
  call void @llvm.lifetime.start.p0(i64 8, ptr %25) #8
  %108 = getelementptr inbounds %struct.BMP_image, ptr %20, i32 0, i32 0
  store ptr %108, ptr %25, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %26) #8
  %109 = getelementptr inbounds %struct.BMP_image, ptr %20, i32 0, i32 1
  store ptr %109, ptr %26, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %27) #8
  %110 = getelementptr inbounds [14 x i8], ptr %22, i64 0, i64 0
  store ptr %110, ptr %27, align 8, !tbaa !5
  %111 = load ptr, ptr %27, align 8, !tbaa !5
  %112 = getelementptr inbounds i8, ptr %111, i64 0
  %113 = load i8, ptr %112, align 1, !tbaa !13
  %114 = load ptr, ptr %25, align 8, !tbaa !5
  %115 = getelementptr inbounds %struct.BMP_file_header, ptr %114, i32 0, i32 0
  %116 = getelementptr inbounds [2 x i8], ptr %115, i64 0, i64 0
  store i8 %113, ptr %116, align 4, !tbaa !13
  %117 = load ptr, ptr %27, align 8, !tbaa !5
  %118 = getelementptr inbounds i8, ptr %117, i64 1
  %119 = load i8, ptr %118, align 1, !tbaa !13
  %120 = load ptr, ptr %25, align 8, !tbaa !5
  %121 = getelementptr inbounds %struct.BMP_file_header, ptr %120, i32 0, i32 0
  %122 = getelementptr inbounds [2 x i8], ptr %121, i64 0, i64 1
  store i8 %119, ptr %122, align 1, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 8, ptr %28) #8
  store ptr @.str.5, ptr %28, align 8, !tbaa !5
  %123 = load ptr, ptr %25, align 8, !tbaa !5
  %124 = load ptr, ptr %28, align 8, !tbaa !5
  %125 = load ptr, ptr %28, align 8, !tbaa !5
  %126 = call i64 @strlen(ptr noundef %125) #9
  %127 = call i32 @memcmp(ptr noundef %123, ptr noundef %124, i64 noundef %126) #9
  %128 = icmp ne i32 %127, 0
  br i1 %128, label %129, label %137

129:                                              ; preds = %107
  br label %130

130:                                              ; preds = %129
  %131 = load ptr, ptr @stderr, align 8, !tbaa !5
  %132 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %131, ptr noundef @.str.6) #8
  %133 = load ptr, ptr @stderr, align 8, !tbaa !5
  %134 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %133, ptr noundef @.str.1) #8
  br label %135

135:                                              ; preds = %130
  br label %136

136:                                              ; preds = %135
  store i32 2, ptr %24, align 4
  br label %724

137:                                              ; preds = %107
  %138 = load ptr, ptr %27, align 8, !tbaa !5
  %139 = getelementptr inbounds i8, ptr %138, i64 2
  %140 = call i32 @read_int32_from_binary(ptr noundef %139)
  %141 = load ptr, ptr %25, align 8, !tbaa !5
  %142 = getelementptr inbounds %struct.BMP_file_header, ptr %141, i32 0, i32 1
  store i32 %140, ptr %142, align 4, !tbaa !14
  %143 = load ptr, ptr %27, align 8, !tbaa !5
  %144 = getelementptr inbounds i8, ptr %143, i64 6
  %145 = call signext i16 @read_int16_from_binary(ptr noundef %144)
  %146 = load ptr, ptr %25, align 8, !tbaa !5
  %147 = getelementptr inbounds %struct.BMP_file_header, ptr %146, i32 0, i32 2
  %148 = getelementptr inbounds [2 x i16], ptr %147, i64 0, i64 0
  store i16 %145, ptr %148, align 4, !tbaa !16
  %149 = load ptr, ptr %27, align 8, !tbaa !5
  %150 = getelementptr inbounds i8, ptr %149, i64 8
  %151 = call signext i16 @read_int16_from_binary(ptr noundef %150)
  %152 = load ptr, ptr %25, align 8, !tbaa !5
  %153 = getelementptr inbounds %struct.BMP_file_header, ptr %152, i32 0, i32 2
  %154 = getelementptr inbounds [2 x i16], ptr %153, i64 0, i64 1
  store i16 %151, ptr %154, align 2, !tbaa !16
  %155 = load ptr, ptr %27, align 8, !tbaa !5
  %156 = getelementptr inbounds i8, ptr %155, i64 10
  %157 = call i32 @read_int32_from_binary(ptr noundef %156)
  %158 = load ptr, ptr %25, align 8, !tbaa !5
  %159 = getelementptr inbounds %struct.BMP_file_header, ptr %158, i32 0, i32 3
  store i32 %157, ptr %159, align 4, !tbaa !18
  %160 = getelementptr inbounds [40 x i8], ptr %23, i64 0, i64 0
  store ptr %160, ptr %27, align 8, !tbaa !5
  %161 = load ptr, ptr %27, align 8, !tbaa !5
  %162 = call i32 @read_uint32_from_binary(ptr noundef %161)
  %163 = load ptr, ptr %26, align 8, !tbaa !5
  %164 = getelementptr inbounds %struct.BMP_info_header, ptr %163, i32 0, i32 0
  store i32 %162, ptr %164, align 4, !tbaa !19
  %165 = load ptr, ptr %26, align 8, !tbaa !5
  %166 = getelementptr inbounds %struct.BMP_info_header, ptr %165, i32 0, i32 0
  %167 = load i32, ptr %166, align 4, !tbaa !19
  %168 = icmp ne i32 %167, 40
  br i1 %168, label %169, label %177

169:                                              ; preds = %137
  br label %170

170:                                              ; preds = %169
  %171 = load ptr, ptr @stderr, align 8, !tbaa !5
  %172 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %171, ptr noundef @.str.7) #8
  %173 = load ptr, ptr @stderr, align 8, !tbaa !5
  %174 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %173, ptr noundef @.str.1) #8
  br label %175

175:                                              ; preds = %170
  br label %176

176:                                              ; preds = %175
  store i32 2, ptr %24, align 4
  br label %724

177:                                              ; preds = %137
  %178 = load ptr, ptr %27, align 8, !tbaa !5
  %179 = getelementptr inbounds i8, ptr %178, i64 4
  %180 = call i32 @read_int32_from_binary(ptr noundef %179)
  %181 = load ptr, ptr %26, align 8, !tbaa !5
  %182 = getelementptr inbounds %struct.BMP_info_header, ptr %181, i32 0, i32 1
  store i32 %180, ptr %182, align 4, !tbaa !21
  %183 = load ptr, ptr %26, align 8, !tbaa !5
  %184 = getelementptr inbounds %struct.BMP_info_header, ptr %183, i32 0, i32 1
  %185 = load i32, ptr %184, align 4, !tbaa !21
  %186 = icmp sle i32 %185, 0
  br i1 %186, label %187, label %198

187:                                              ; preds = %177
  br label %188

188:                                              ; preds = %187
  %189 = load ptr, ptr @stderr, align 8, !tbaa !5
  %190 = load ptr, ptr %26, align 8, !tbaa !5
  %191 = getelementptr inbounds %struct.BMP_info_header, ptr %190, i32 0, i32 1
  %192 = load i32, ptr %191, align 4, !tbaa !21
  %193 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %189, ptr noundef @.str.8, i32 noundef %192) #8
  %194 = load ptr, ptr @stderr, align 8, !tbaa !5
  %195 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %194, ptr noundef @.str.1) #8
  br label %196

196:                                              ; preds = %188
  br label %197

197:                                              ; preds = %196
  store i32 2, ptr %24, align 4
  br label %724

198:                                              ; preds = %177
  %199 = load ptr, ptr %27, align 8, !tbaa !5
  %200 = getelementptr inbounds i8, ptr %199, i64 8
  %201 = call i32 @read_int32_from_binary(ptr noundef %200)
  %202 = load ptr, ptr %26, align 8, !tbaa !5
  %203 = getelementptr inbounds %struct.BMP_info_header, ptr %202, i32 0, i32 2
  store i32 %201, ptr %203, align 4, !tbaa !22
  %204 = load ptr, ptr %26, align 8, !tbaa !5
  %205 = getelementptr inbounds %struct.BMP_info_header, ptr %204, i32 0, i32 2
  %206 = load i32, ptr %205, align 4, !tbaa !22
  %207 = icmp sle i32 %206, 0
  br i1 %207, label %208, label %219

208:                                              ; preds = %198
  br label %209

209:                                              ; preds = %208
  %210 = load ptr, ptr @stderr, align 8, !tbaa !5
  %211 = load ptr, ptr %26, align 8, !tbaa !5
  %212 = getelementptr inbounds %struct.BMP_info_header, ptr %211, i32 0, i32 2
  %213 = load i32, ptr %212, align 4, !tbaa !22
  %214 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %210, ptr noundef @.str.9, i32 noundef %213) #8
  %215 = load ptr, ptr @stderr, align 8, !tbaa !5
  %216 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %215, ptr noundef @.str.1) #8
  br label %217

217:                                              ; preds = %209
  br label %218

218:                                              ; preds = %217
  store i32 2, ptr %24, align 4
  br label %724

219:                                              ; preds = %198
  %220 = load ptr, ptr %27, align 8, !tbaa !5
  %221 = getelementptr inbounds i8, ptr %220, i64 12
  %222 = call signext i16 @read_int16_from_binary(ptr noundef %221)
  %223 = load ptr, ptr %26, align 8, !tbaa !5
  %224 = getelementptr inbounds %struct.BMP_info_header, ptr %223, i32 0, i32 3
  store i16 %222, ptr %224, align 4, !tbaa !23
  %225 = load ptr, ptr %26, align 8, !tbaa !5
  %226 = getelementptr inbounds %struct.BMP_info_header, ptr %225, i32 0, i32 3
  %227 = load i16, ptr %226, align 4, !tbaa !23
  %228 = sext i16 %227 to i32
  %229 = icmp ne i32 %228, 1
  br i1 %229, label %230, label %238

230:                                              ; preds = %219
  br label %231

231:                                              ; preds = %230
  %232 = load ptr, ptr @stderr, align 8, !tbaa !5
  %233 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %232, ptr noundef @.str.10) #8
  %234 = load ptr, ptr @stderr, align 8, !tbaa !5
  %235 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %234, ptr noundef @.str.1) #8
  br label %236

236:                                              ; preds = %231
  br label %237

237:                                              ; preds = %236
  store i32 2, ptr %24, align 4
  br label %724

238:                                              ; preds = %219
  %239 = load ptr, ptr %27, align 8, !tbaa !5
  %240 = getelementptr inbounds i8, ptr %239, i64 14
  %241 = call zeroext i16 @read_uint16_from_binary(ptr noundef %240)
  %242 = load ptr, ptr %26, align 8, !tbaa !5
  %243 = getelementptr inbounds %struct.BMP_info_header, ptr %242, i32 0, i32 4
  store i16 %241, ptr %243, align 2, !tbaa !24
  call void @llvm.lifetime.start.p0(i64 4, ptr %29) #8
  %244 = load ptr, ptr %26, align 8, !tbaa !5
  %245 = getelementptr inbounds %struct.BMP_info_header, ptr %244, i32 0, i32 4
  %246 = load i16, ptr %245, align 2, !tbaa !24
  %247 = zext i16 %246 to i32
  store i32 %247, ptr %29, align 4, !tbaa !9
  %248 = load i32, ptr %29, align 4, !tbaa !9
  %249 = icmp ne i32 %248, 8
  br i1 %249, label %250, label %265

250:                                              ; preds = %238
  %251 = load i32, ptr %29, align 4, !tbaa !9
  %252 = icmp ne i32 %251, 24
  br i1 %252, label %253, label %265

253:                                              ; preds = %250
  %254 = load i32, ptr %29, align 4, !tbaa !9
  %255 = icmp ne i32 %254, 32
  br i1 %255, label %256, label %265

256:                                              ; preds = %253
  br label %257

257:                                              ; preds = %256
  %258 = load ptr, ptr @stderr, align 8, !tbaa !5
  %259 = load i32, ptr %29, align 4, !tbaa !9
  %260 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %258, ptr noundef @.str.11, i32 noundef %259) #8
  %261 = load ptr, ptr @stderr, align 8, !tbaa !5
  %262 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %261, ptr noundef @.str.1) #8
  br label %263

263:                                              ; preds = %257
  br label %264

264:                                              ; preds = %263
  store i32 2, ptr %24, align 4
  br label %723

265:                                              ; preds = %253, %250, %238
  %266 = load ptr, ptr %27, align 8, !tbaa !5
  %267 = getelementptr inbounds i8, ptr %266, i64 16
  %268 = call i32 @read_uint32_from_binary(ptr noundef %267)
  %269 = load ptr, ptr %26, align 8, !tbaa !5
  %270 = getelementptr inbounds %struct.BMP_info_header, ptr %269, i32 0, i32 5
  store i32 %268, ptr %270, align 4, !tbaa !25
  %271 = load ptr, ptr %26, align 8, !tbaa !5
  %272 = getelementptr inbounds %struct.BMP_info_header, ptr %271, i32 0, i32 5
  %273 = load i32, ptr %272, align 4, !tbaa !25
  %274 = icmp ne i32 %273, 0
  br i1 %274, label %275, label %286

275:                                              ; preds = %265
  br label %276

276:                                              ; preds = %275
  %277 = load ptr, ptr @stderr, align 8, !tbaa !5
  %278 = load ptr, ptr %26, align 8, !tbaa !5
  %279 = getelementptr inbounds %struct.BMP_info_header, ptr %278, i32 0, i32 5
  %280 = load i32, ptr %279, align 4, !tbaa !25
  %281 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %277, ptr noundef @.str.12, i32 noundef %280) #8
  %282 = load ptr, ptr @stderr, align 8, !tbaa !5
  %283 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %282, ptr noundef @.str.1) #8
  br label %284

284:                                              ; preds = %276
  br label %285

285:                                              ; preds = %284
  store i32 2, ptr %24, align 4
  br label %723

286:                                              ; preds = %265
  %287 = load ptr, ptr %27, align 8, !tbaa !5
  %288 = getelementptr inbounds i8, ptr %287, i64 20
  %289 = call i32 @read_uint32_from_binary(ptr noundef %288)
  %290 = load ptr, ptr %26, align 8, !tbaa !5
  %291 = getelementptr inbounds %struct.BMP_info_header, ptr %290, i32 0, i32 6
  store i32 %289, ptr %291, align 4, !tbaa !26
  %292 = load ptr, ptr %27, align 8, !tbaa !5
  %293 = getelementptr inbounds i8, ptr %292, i64 24
  %294 = call i32 @read_int32_from_binary(ptr noundef %293)
  %295 = load ptr, ptr %26, align 8, !tbaa !5
  %296 = getelementptr inbounds %struct.BMP_info_header, ptr %295, i32 0, i32 7
  store i32 %294, ptr %296, align 4, !tbaa !27
  %297 = load ptr, ptr %27, align 8, !tbaa !5
  %298 = getelementptr inbounds i8, ptr %297, i64 28
  %299 = call i32 @read_int32_from_binary(ptr noundef %298)
  %300 = load ptr, ptr %26, align 8, !tbaa !5
  %301 = getelementptr inbounds %struct.BMP_info_header, ptr %300, i32 0, i32 8
  store i32 %299, ptr %301, align 4, !tbaa !28
  %302 = load ptr, ptr %27, align 8, !tbaa !5
  %303 = getelementptr inbounds i8, ptr %302, i64 32
  %304 = call i32 @read_uint32_from_binary(ptr noundef %303)
  %305 = load ptr, ptr %26, align 8, !tbaa !5
  %306 = getelementptr inbounds %struct.BMP_info_header, ptr %305, i32 0, i32 9
  store i32 %304, ptr %306, align 4, !tbaa !29
  %307 = load ptr, ptr %27, align 8, !tbaa !5
  %308 = getelementptr inbounds i8, ptr %307, i64 36
  %309 = call i32 @read_uint32_from_binary(ptr noundef %308)
  %310 = load ptr, ptr %26, align 8, !tbaa !5
  %311 = getelementptr inbounds %struct.BMP_info_header, ptr %310, i32 0, i32 10
  store i32 %309, ptr %311, align 4, !tbaa !30
  %312 = load ptr, ptr %26, align 8, !tbaa !5
  %313 = getelementptr inbounds %struct.BMP_info_header, ptr %312, i32 0, i32 5
  %314 = load i32, ptr %313, align 4, !tbaa !25
  %315 = icmp eq i32 %314, 0
  br i1 %315, label %316, label %376

316:                                              ; preds = %286
  %317 = load i32, ptr %29, align 4, !tbaa !9
  %318 = icmp eq i32 %317, 8
  br i1 %318, label %319, label %376

319:                                              ; preds = %316
  call void @llvm.lifetime.start.p0(i64 4, ptr %30) #8
  %320 = load ptr, ptr %26, align 8, !tbaa !5
  %321 = getelementptr inbounds %struct.BMP_info_header, ptr %320, i32 0, i32 9
  %322 = load i32, ptr %321, align 4, !tbaa !29
  %323 = icmp ne i32 %322, 0
  br i1 %323, label %324, label %335

324:                                              ; preds = %319
  %325 = load ptr, ptr %26, align 8, !tbaa !5
  %326 = getelementptr inbounds %struct.BMP_info_header, ptr %325, i32 0, i32 9
  %327 = load i32, ptr %326, align 4, !tbaa !29
  %328 = load i32, ptr %29, align 4, !tbaa !9
  %329 = shl i32 1, %328
  %330 = icmp ult i32 %327, %329
  br i1 %330, label %331, label %335

331:                                              ; preds = %324
  %332 = load ptr, ptr %26, align 8, !tbaa !5
  %333 = getelementptr inbounds %struct.BMP_info_header, ptr %332, i32 0, i32 9
  %334 = load i32, ptr %333, align 4, !tbaa !29
  store i32 %334, ptr %30, align 4, !tbaa !9
  br label %338

335:                                              ; preds = %324, %319
  %336 = load i32, ptr %29, align 4, !tbaa !9
  %337 = shl i32 1, %336
  store i32 %337, ptr %30, align 4, !tbaa !9
  br label %338

338:                                              ; preds = %335, %331
  %339 = load i32, ptr %30, align 4, !tbaa !9
  %340 = sext i32 %339 to i64
  %341 = mul i64 %340, 4
  %342 = call noalias ptr @malloc(i64 noundef %341) #10
  %343 = getelementptr inbounds %struct.BMP_image, ptr %20, i32 0, i32 2
  store ptr %342, ptr %343, align 8, !tbaa !31
  %344 = getelementptr inbounds %struct.BMP_image, ptr %20, i32 0, i32 2
  %345 = load ptr, ptr %344, align 8, !tbaa !31
  %346 = icmp eq ptr %345, null
  br i1 %346, label %347, label %355

347:                                              ; preds = %338
  br label %348

348:                                              ; preds = %347
  %349 = load ptr, ptr @stderr, align 8, !tbaa !5
  %350 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %349, ptr noundef @.str.13) #8
  %351 = load ptr, ptr @stderr, align 8, !tbaa !5
  %352 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %351, ptr noundef @.str.1) #8
  br label %353

353:                                              ; preds = %348
  br label %354

354:                                              ; preds = %353
  store i32 2, ptr %24, align 4
  br label %373

355:                                              ; preds = %338
  %356 = getelementptr inbounds %struct.BMP_image, ptr %20, i32 0, i32 2
  %357 = load ptr, ptr %356, align 8, !tbaa !31
  %358 = load i32, ptr %30, align 4, !tbaa !9
  %359 = sext i32 %358 to i64
  %360 = mul i64 %359, 4
  %361 = load ptr, ptr %15, align 8, !tbaa !5
  %362 = call i64 @fread(ptr noundef %357, i64 noundef %360, i64 noundef 1, ptr noundef %361)
  %363 = icmp ne i64 %362, 1
  br i1 %363, label %364, label %372

364:                                              ; preds = %355
  br label %365

365:                                              ; preds = %364
  %366 = load ptr, ptr @stderr, align 8, !tbaa !5
  %367 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %366, ptr noundef @.str.14) #8
  %368 = load ptr, ptr @stderr, align 8, !tbaa !5
  %369 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %368, ptr noundef @.str.1) #8
  br label %370

370:                                              ; preds = %365
  br label %371

371:                                              ; preds = %370
  store i32 2, ptr %24, align 4
  br label %373

372:                                              ; preds = %355
  store i32 0, ptr %24, align 4
  br label %373

373:                                              ; preds = %372, %371, %354
  call void @llvm.lifetime.end.p0(i64 4, ptr %30) #8
  %374 = load i32, ptr %24, align 4
  switch i32 %374, label %723 [
    i32 0, label %375
  ]

375:                                              ; preds = %373
  br label %376

376:                                              ; preds = %375, %316, %286
  %377 = load ptr, ptr %26, align 8, !tbaa !5
  %378 = getelementptr inbounds %struct.BMP_info_header, ptr %377, i32 0, i32 2
  %379 = load i32, ptr %378, align 4, !tbaa !22
  store i32 %379, ptr %16, align 4, !tbaa !9
  %380 = load ptr, ptr %26, align 8, !tbaa !5
  %381 = getelementptr inbounds %struct.BMP_info_header, ptr %380, i32 0, i32 1
  %382 = load i32, ptr %381, align 4, !tbaa !21
  store i32 %382, ptr %17, align 4, !tbaa !9
  %383 = load i32, ptr %29, align 4, !tbaa !9
  %384 = sdiv i32 %383, 8
  store i32 %384, ptr %18, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %31) #8
  %385 = load i32, ptr %17, align 4, !tbaa !9
  %386 = load i32, ptr %18, align 4, !tbaa !9
  %387 = mul nsw i32 %385, %386
  %388 = call i32 @px_align_up(i32 noundef %387, i32 noundef 4)
  store i32 %388, ptr %31, align 4, !tbaa !9
  %389 = getelementptr inbounds %struct.BMP_image, ptr %20, i32 0, i32 2
  %390 = load ptr, ptr %389, align 8, !tbaa !31
  %391 = icmp eq ptr %390, null
  br i1 %391, label %392, label %558

392:                                              ; preds = %376
  store i32 3, ptr %19, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %32) #8
  %393 = load i32, ptr %17, align 4, !tbaa !9
  %394 = load i32, ptr %19, align 4, !tbaa !9
  %395 = mul nsw i32 %393, %394
  %396 = load i32, ptr %13, align 4, !tbaa !9
  %397 = call i32 @px_align_up(i32 noundef %395, i32 noundef %396)
  store i32 %397, ptr %32, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 3, ptr %33) #8
  call void @llvm.memset.p0.i64(ptr align 1 %33, i8 0, i64 3, i1 false)
  call void @llvm.lifetime.start.p0(i64 4, ptr %34) #8
  %398 = load i32, ptr %31, align 4, !tbaa !9
  %399 = load i32, ptr %17, align 4, !tbaa !9
  %400 = load i32, ptr %18, align 4, !tbaa !9
  %401 = mul nsw i32 %399, %400
  %402 = sub nsw i32 %398, %401
  store i32 %402, ptr %34, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %35) #8
  %403 = load i32, ptr %32, align 4, !tbaa !9
  %404 = load i32, ptr %16, align 4, !tbaa !9
  %405 = mul nsw i32 %403, %404
  store i32 %405, ptr %35, align 4, !tbaa !9
  %406 = load i32, ptr %35, align 4, !tbaa !9
  %407 = sext i32 %406 to i64
  %408 = call noalias ptr @malloc(i64 noundef %407) #10
  %409 = getelementptr inbounds %struct.BMP_image, ptr %20, i32 0, i32 3
  store ptr %408, ptr %409, align 8, !tbaa !33
  %410 = getelementptr inbounds %struct.BMP_image, ptr %20, i32 0, i32 3
  %411 = load ptr, ptr %410, align 8, !tbaa !33
  store ptr %411, ptr %21, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %36) #8
  %412 = getelementptr inbounds %struct.BMP_image, ptr %20, i32 0, i32 3
  %413 = load ptr, ptr %412, align 8, !tbaa !33
  %414 = load i32, ptr %16, align 4, !tbaa !9
  %415 = sub nsw i32 %414, 1
  %416 = load i32, ptr %32, align 4, !tbaa !9
  %417 = mul nsw i32 %415, %416
  %418 = sext i32 %417 to i64
  %419 = getelementptr inbounds i8, ptr %413, i64 %418
  store ptr %419, ptr %36, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 1, ptr %37) #8
  store i8 1, ptr %37, align 1, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %38) #8
  %420 = load i32, ptr %19, align 4, !tbaa !9
  %421 = load i32, ptr %17, align 4, !tbaa !9
  %422 = mul nsw i32 %420, %421
  store i32 %422, ptr %38, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %39) #8
  %423 = load i32, ptr %16, align 4, !tbaa !9
  %424 = sub nsw i32 %423, 1
  store i32 %424, ptr %39, align 4, !tbaa !9
  br label %425

425:                                              ; preds = %540, %392
  %426 = load i32, ptr %39, align 4, !tbaa !9
  %427 = icmp ne i32 %426, -1
  br i1 %427, label %428, label %431

428:                                              ; preds = %425
  %429 = load i8, ptr %37, align 1, !tbaa !11, !range !34, !noundef !35
  %430 = trunc i8 %429 to i1
  br label %431

431:                                              ; preds = %428, %425
  %432 = phi i1 [ false, %425 ], [ %430, %428 ]
  br i1 %432, label %434, label %433

433:                                              ; preds = %431
  store i32 30, ptr %24, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %39) #8
  br label %543

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

435:                                              ; preds = %508, %434
  %436 = load i32, ptr %40, align 4, !tbaa !9
  %437 = load i32, ptr %38, align 4, !tbaa !9
  %438 = icmp slt i32 %436, %437
  br i1 %438, label %439, label %442

439:                                              ; preds = %435
  %440 = load i8, ptr %37, align 1, !tbaa !11, !range !34, !noundef !35
  %441 = trunc i8 %440 to i1
  br label %442

442:                                              ; preds = %439, %435
  %443 = phi i1 [ false, %435 ], [ %441, %439 ]
  br i1 %443, label %445, label %444

444:                                              ; preds = %442
  store i32 33, ptr %24, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %40) #8
  br label %512

445:                                              ; preds = %442
  %446 = load ptr, ptr %36, align 8, !tbaa !5
  %447 = load i32, ptr %40, align 4, !tbaa !9
  %448 = sext i32 %447 to i64
  %449 = getelementptr inbounds i8, ptr %446, i64 %448
  %450 = load i32, ptr %19, align 4, !tbaa !9
  %451 = sext i32 %450 to i64
  %452 = load ptr, ptr %15, align 8, !tbaa !5
  %453 = call i64 @fread(ptr noundef %449, i64 noundef %451, i64 noundef 1, ptr noundef %452)
  %454 = icmp ne i64 %453, 1
  br i1 %454, label %455, label %469

455:                                              ; preds = %445
  br label %456

456:                                              ; preds = %455
  %457 = load ptr, ptr @stderr, align 8, !tbaa !5
  %458 = load i32, ptr %39, align 4, !tbaa !9
  %459 = load i32, ptr %16, align 4, !tbaa !9
  %460 = load i32, ptr %40, align 4, !tbaa !9
  %461 = load i32, ptr %38, align 4, !tbaa !9
  %462 = load ptr, ptr %8, align 8, !tbaa !5
  %463 = load i32, ptr %19, align 4, !tbaa !9
  %464 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %457, ptr noundef @.str.15, ptr noundef @.str.16, i32 noundef 366, i32 noundef %458, i32 noundef %459, i32 noundef %460, i32 noundef %461, ptr noundef %462, i32 noundef %463) #8
  %465 = load ptr, ptr @stderr, align 8, !tbaa !5
  %466 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %465, ptr noundef @.str.1) #8
  br label %467

467:                                              ; preds = %456
  br label %468

468:                                              ; preds = %467
  call void @exit(i32 noundef 1) #11
  unreachable

469:                                              ; preds = %445
  %470 = load i8, ptr %14, align 1, !tbaa !11, !range !34, !noundef !35
  %471 = trunc i8 %470 to i1
  br i1 %471, label %472, label %507

472:                                              ; preds = %469
  %473 = load ptr, ptr %36, align 8, !tbaa !5
  %474 = load i32, ptr %40, align 4, !tbaa !9
  %475 = add nsw i32 %474, 2
  %476 = sext i32 %475 to i64
  %477 = getelementptr inbounds i8, ptr %473, i64 %476
  %478 = load i8, ptr %477, align 1, !tbaa !13
  %479 = zext i8 %478 to i32
  %480 = load ptr, ptr %36, align 8, !tbaa !5
  %481 = load i32, ptr %40, align 4, !tbaa !9
  %482 = sext i32 %481 to i64
  %483 = getelementptr inbounds i8, ptr %480, i64 %482
  %484 = load i8, ptr %483, align 1, !tbaa !13
  %485 = zext i8 %484 to i32
  %486 = xor i32 %485, %479
  %487 = trunc i32 %486 to i8
  store i8 %487, ptr %483, align 1, !tbaa !13
  %488 = zext i8 %487 to i32
  %489 = load ptr, ptr %36, align 8, !tbaa !5
  %490 = load i32, ptr %40, align 4, !tbaa !9
  %491 = add nsw i32 %490, 2
  %492 = sext i32 %491 to i64
  %493 = getelementptr inbounds i8, ptr %489, i64 %492
  %494 = load i8, ptr %493, align 1, !tbaa !13
  %495 = zext i8 %494 to i32
  %496 = xor i32 %495, %488
  %497 = trunc i32 %496 to i8
  store i8 %497, ptr %493, align 1, !tbaa !13
  %498 = zext i8 %497 to i32
  %499 = load ptr, ptr %36, align 8, !tbaa !5
  %500 = load i32, ptr %40, align 4, !tbaa !9
  %501 = sext i32 %500 to i64
  %502 = getelementptr inbounds i8, ptr %499, i64 %501
  %503 = load i8, ptr %502, align 1, !tbaa !13
  %504 = zext i8 %503 to i32
  %505 = xor i32 %504, %498
  %506 = trunc i32 %505 to i8
  store i8 %506, ptr %502, align 1, !tbaa !13
  br label %507

507:                                              ; preds = %472, %469
  br label %508

508:                                              ; preds = %507
  %509 = load i32, ptr %19, align 4, !tbaa !9
  %510 = load i32, ptr %40, align 4, !tbaa !9
  %511 = add nsw i32 %510, %509
  store i32 %511, ptr %40, align 4, !tbaa !9
  br label %435, !llvm.loop !36

512:                                              ; preds = %444
  %513 = load i32, ptr %32, align 4, !tbaa !9
  %514 = load ptr, ptr %36, align 8, !tbaa !5
  %515 = sext i32 %513 to i64
  %516 = sub i64 0, %515
  %517 = getelementptr inbounds i8, ptr %514, i64 %516
  store ptr %517, ptr %36, align 8, !tbaa !5
  %518 = load i32, ptr %34, align 4, !tbaa !9
  %519 = icmp ne i32 %518, 0
  br i1 %519, label %520, label %539

520:                                              ; preds = %512
  %521 = getelementptr inbounds [3 x i8], ptr %33, i64 0, i64 0
  %522 = load i32, ptr %34, align 4, !tbaa !9
  %523 = sext i32 %522 to i64
  %524 = load ptr, ptr %15, align 8, !tbaa !5
  %525 = call i64 @fread(ptr noundef %521, i64 noundef %523, i64 noundef 1, ptr noundef %524)
  %526 = icmp ne i64 %525, 1
  br i1 %526, label %527, label %539

527:                                              ; preds = %520
  br label %528

528:                                              ; preds = %527
  %529 = load ptr, ptr @stderr, align 8, !tbaa !5
  %530 = load i32, ptr %39, align 4, !tbaa !9
  %531 = load i32, ptr %16, align 4, !tbaa !9
  %532 = load ptr, ptr %8, align 8, !tbaa !5
  %533 = load i32, ptr %19, align 4, !tbaa !9
  %534 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %529, ptr noundef @.str.17, ptr noundef @.str.16, i32 noundef 382, i32 noundef %530, i32 noundef %531, ptr noundef %532, i32 noundef %533) #8
  %535 = load ptr, ptr @stderr, align 8, !tbaa !5
  %536 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %535, ptr noundef @.str.1) #8
  br label %537

537:                                              ; preds = %528
  br label %538

538:                                              ; preds = %537
  call void @exit(i32 noundef 1) #11
  unreachable

539:                                              ; preds = %520, %512
  br label %540

540:                                              ; preds = %539
  %541 = load i32, ptr %39, align 4, !tbaa !9
  %542 = add nsw i32 %541, -1
  store i32 %542, ptr %39, align 4, !tbaa !9
  br label %425, !llvm.loop !38

543:                                              ; preds = %433
  %544 = load i8, ptr %37, align 1, !tbaa !11, !range !34, !noundef !35
  %545 = trunc i8 %544 to i1
  br i1 %545, label %554, label %546

546:                                              ; preds = %543
  br label %547

547:                                              ; preds = %546
  %548 = load ptr, ptr @stderr, align 8, !tbaa !5
  %549 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %548, ptr noundef @.str.18) #8
  %550 = load ptr, ptr @stderr, align 8, !tbaa !5
  %551 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %550, ptr noundef @.str.1) #8
  br label %552

552:                                              ; preds = %547
  br label %553

553:                                              ; preds = %552
  store i32 2, ptr %24, align 4
  br label %555

554:                                              ; preds = %543
  store i32 0, ptr %24, align 4
  br label %555

555:                                              ; preds = %554, %553
  call void @llvm.lifetime.end.p0(i64 4, ptr %38) #8
  call void @llvm.lifetime.end.p0(i64 1, ptr %37) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %36) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %35) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %34) #8
  call void @llvm.lifetime.end.p0(i64 3, ptr %33) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %32) #8
  %556 = load i32, ptr %24, align 4
  switch i32 %556, label %722 [
    i32 0, label %557
  ]

557:                                              ; preds = %555
  br label %721

558:                                              ; preds = %376
  %559 = load i32, ptr %18, align 4, !tbaa !9
  store i32 %559, ptr %19, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %41) #8
  %560 = load i32, ptr %31, align 4, !tbaa !9
  %561 = load i32, ptr %16, align 4, !tbaa !9
  %562 = mul nsw i32 %560, %561
  store i32 %562, ptr %41, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %42) #8
  %563 = load i32, ptr %17, align 4, !tbaa !9
  %564 = load i32, ptr %19, align 4, !tbaa !9
  %565 = mul nsw i32 %563, %564
  %566 = load i32, ptr %13, align 4, !tbaa !9
  %567 = call i32 @px_align_up(i32 noundef %565, i32 noundef %566)
  store i32 %567, ptr %42, align 4, !tbaa !9
  %568 = load i32, ptr %41, align 4, !tbaa !9
  %569 = sext i32 %568 to i64
  %570 = call noalias ptr @malloc(i64 noundef %569) #10
  %571 = getelementptr inbounds %struct.BMP_image, ptr %20, i32 0, i32 3
  store ptr %570, ptr %571, align 8, !tbaa !33
  %572 = getelementptr inbounds %struct.BMP_image, ptr %20, i32 0, i32 3
  %573 = load ptr, ptr %572, align 8, !tbaa !33
  %574 = load i32, ptr %41, align 4, !tbaa !9
  %575 = sext i32 %574 to i64
  %576 = load ptr, ptr %15, align 8, !tbaa !5
  %577 = call i64 @fread(ptr noundef %573, i64 noundef %575, i64 noundef 1, ptr noundef %576)
  %578 = icmp ne i64 %577, 1
  br i1 %578, label %579, label %587

579:                                              ; preds = %558
  br label %580

580:                                              ; preds = %579
  %581 = load ptr, ptr @stderr, align 8, !tbaa !5
  %582 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %581, ptr noundef @.str.19) #8
  %583 = load ptr, ptr @stderr, align 8, !tbaa !5
  %584 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %583, ptr noundef @.str.1) #8
  br label %585

585:                                              ; preds = %580
  br label %586

586:                                              ; preds = %585
  store i32 2, ptr %24, align 4
  br label %718

587:                                              ; preds = %558
  %588 = load i32, ptr %42, align 4, !tbaa !9
  %589 = load i32, ptr %16, align 4, !tbaa !9
  %590 = mul nsw i32 %588, %589
  %591 = sext i32 %590 to i64
  %592 = call noalias ptr @malloc(i64 noundef %591) #10
  store ptr %592, ptr %21, align 8, !tbaa !5
  %593 = load ptr, ptr %21, align 8, !tbaa !5
  %594 = icmp eq ptr %593, null
  br i1 %594, label %595, label %603

595:                                              ; preds = %587
  br label %596

596:                                              ; preds = %595
  %597 = load ptr, ptr @stderr, align 8, !tbaa !5
  %598 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %597, ptr noundef @.str.20) #8
  %599 = load ptr, ptr @stderr, align 8, !tbaa !5
  %600 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %599, ptr noundef @.str.1) #8
  br label %601

601:                                              ; preds = %596
  br label %602

602:                                              ; preds = %601
  store i32 2, ptr %24, align 4
  br label %718

603:                                              ; preds = %587
  call void @llvm.lifetime.start.p0(i64 4, ptr %43) #8
  %604 = load i32, ptr %19, align 4, !tbaa !9
  %605 = load i32, ptr %17, align 4, !tbaa !9
  %606 = mul nsw i32 %604, %605
  store i32 %606, ptr %43, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %44) #8
  %607 = load ptr, ptr %21, align 8, !tbaa !5
  %608 = load i32, ptr %16, align 4, !tbaa !9
  %609 = sub nsw i32 %608, 1
  %610 = load i32, ptr %42, align 4, !tbaa !9
  %611 = mul nsw i32 %609, %610
  %612 = sext i32 %611 to i64
  %613 = getelementptr inbounds i8, ptr %607, i64 %612
  store ptr %613, ptr %44, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %45) #8
  %614 = getelementptr inbounds %struct.BMP_image, ptr %20, i32 0, i32 3
  %615 = load ptr, ptr %614, align 8, !tbaa !33
  store ptr %615, ptr %45, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %46) #8
  %616 = load i32, ptr %16, align 4, !tbaa !9
  %617 = sub nsw i32 %616, 1
  store i32 %617, ptr %46, align 4, !tbaa !9
  br label %618

618:                                              ; preds = %714, %603
  %619 = load i32, ptr %46, align 4, !tbaa !9
  %620 = icmp ne i32 %619, -1
  br i1 %620, label %622, label %621

621:                                              ; preds = %618
  store i32 46, ptr %24, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %46) #8
  br label %717

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

623:                                              ; preds = %700, %622
  %624 = load i32, ptr %47, align 4, !tbaa !9
  %625 = load i32, ptr %43, align 4, !tbaa !9
  %626 = icmp slt i32 %624, %625
  br i1 %626, label %628, label %627

627:                                              ; preds = %623
  store i32 49, ptr %24, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %47) #8
  br label %704

628:                                              ; preds = %623
  %629 = load i32, ptr %19, align 4, !tbaa !9
  %630 = icmp eq i32 %629, 3
  br i1 %630, label %631, label %679

631:                                              ; preds = %628
  %632 = getelementptr inbounds %struct.BMP_image, ptr %20, i32 0, i32 2
  %633 = load ptr, ptr %632, align 8, !tbaa !31
  %634 = load ptr, ptr %45, align 8, !tbaa !5
  %635 = load i32, ptr %47, align 4, !tbaa !9
  %636 = sext i32 %635 to i64
  %637 = getelementptr inbounds i8, ptr %634, i64 %636
  %638 = load i8, ptr %637, align 1, !tbaa !13
  %639 = zext i8 %638 to i64
  %640 = getelementptr inbounds %struct.BMP_palette_entry, ptr %633, i64 %639
  %641 = getelementptr inbounds %struct.BMP_palette_entry, ptr %640, i32 0, i32 2
  %642 = load i8, ptr %641, align 1, !tbaa !39
  %643 = load ptr, ptr %44, align 8, !tbaa !5
  %644 = load i32, ptr %47, align 4, !tbaa !9
  %645 = sext i32 %644 to i64
  %646 = getelementptr inbounds i8, ptr %643, i64 %645
  store i8 %642, ptr %646, align 1, !tbaa !13
  %647 = getelementptr inbounds %struct.BMP_image, ptr %20, i32 0, i32 2
  %648 = load ptr, ptr %647, align 8, !tbaa !31
  %649 = load ptr, ptr %45, align 8, !tbaa !5
  %650 = load i32, ptr %47, align 4, !tbaa !9
  %651 = sext i32 %650 to i64
  %652 = getelementptr inbounds i8, ptr %649, i64 %651
  %653 = load i8, ptr %652, align 1, !tbaa !13
  %654 = zext i8 %653 to i64
  %655 = getelementptr inbounds %struct.BMP_palette_entry, ptr %648, i64 %654
  %656 = getelementptr inbounds %struct.BMP_palette_entry, ptr %655, i32 0, i32 1
  %657 = load i8, ptr %656, align 1, !tbaa !41
  %658 = load ptr, ptr %44, align 8, !tbaa !5
  %659 = load i32, ptr %47, align 4, !tbaa !9
  %660 = add nsw i32 %659, 1
  %661 = sext i32 %660 to i64
  %662 = getelementptr inbounds i8, ptr %658, i64 %661
  store i8 %657, ptr %662, align 1, !tbaa !13
  %663 = getelementptr inbounds %struct.BMP_image, ptr %20, i32 0, i32 2
  %664 = load ptr, ptr %663, align 8, !tbaa !31
  %665 = load ptr, ptr %45, align 8, !tbaa !5
  %666 = load i32, ptr %47, align 4, !tbaa !9
  %667 = sext i32 %666 to i64
  %668 = getelementptr inbounds i8, ptr %665, i64 %667
  %669 = load i8, ptr %668, align 1, !tbaa !13
  %670 = zext i8 %669 to i64
  %671 = getelementptr inbounds %struct.BMP_palette_entry, ptr %664, i64 %670
  %672 = getelementptr inbounds %struct.BMP_palette_entry, ptr %671, i32 0, i32 0
  %673 = load i8, ptr %672, align 1, !tbaa !42
  %674 = load ptr, ptr %44, align 8, !tbaa !5
  %675 = load i32, ptr %47, align 4, !tbaa !9
  %676 = add nsw i32 %675, 2
  %677 = sext i32 %676 to i64
  %678 = getelementptr inbounds i8, ptr %674, i64 %677
  store i8 %673, ptr %678, align 1, !tbaa !13
  br label %699

679:                                              ; preds = %628
  %680 = load i32, ptr %19, align 4, !tbaa !9
  %681 = icmp eq i32 %680, 1
  br i1 %681, label %682, label %698

682:                                              ; preds = %679
  %683 = getelementptr inbounds %struct.BMP_image, ptr %20, i32 0, i32 2
  %684 = load ptr, ptr %683, align 8, !tbaa !31
  %685 = load ptr, ptr %45, align 8, !tbaa !5
  %686 = load i32, ptr %47, align 4, !tbaa !9
  %687 = sext i32 %686 to i64
  %688 = getelementptr inbounds i8, ptr %685, i64 %687
  %689 = load i8, ptr %688, align 1, !tbaa !13
  %690 = zext i8 %689 to i64
  %691 = getelementptr inbounds %struct.BMP_palette_entry, ptr %684, i64 %690
  %692 = getelementptr inbounds %struct.BMP_palette_entry, ptr %691, i32 0, i32 2
  %693 = load i8, ptr %692, align 1, !tbaa !39
  %694 = load ptr, ptr %44, align 8, !tbaa !5
  %695 = load i32, ptr %47, align 4, !tbaa !9
  %696 = sext i32 %695 to i64
  %697 = getelementptr inbounds i8, ptr %694, i64 %696
  store i8 %693, ptr %697, align 1, !tbaa !13
  br label %698

698:                                              ; preds = %682, %679
  br label %699

699:                                              ; preds = %698, %631
  br label %700

700:                                              ; preds = %699
  %701 = load i32, ptr %19, align 4, !tbaa !9
  %702 = load i32, ptr %47, align 4, !tbaa !9
  %703 = add nsw i32 %702, %701
  store i32 %703, ptr %47, align 4, !tbaa !9
  br label %623, !llvm.loop !43

704:                                              ; preds = %627
  %705 = load i32, ptr %31, align 4, !tbaa !9
  %706 = load ptr, ptr %45, align 8, !tbaa !5
  %707 = sext i32 %705 to i64
  %708 = getelementptr inbounds i8, ptr %706, i64 %707
  store ptr %708, ptr %45, align 8, !tbaa !5
  %709 = load i32, ptr %42, align 4, !tbaa !9
  %710 = load ptr, ptr %44, align 8, !tbaa !5
  %711 = sext i32 %709 to i64
  %712 = sub i64 0, %711
  %713 = getelementptr inbounds i8, ptr %710, i64 %712
  store ptr %713, ptr %44, align 8, !tbaa !5
  br label %714

714:                                              ; preds = %704
  %715 = load i32, ptr %46, align 4, !tbaa !9
  %716 = add nsw i32 %715, -1
  store i32 %716, ptr %46, align 4, !tbaa !9
  br label %618, !llvm.loop !44

717:                                              ; preds = %621
  call void @llvm.lifetime.end.p0(i64 8, ptr %45) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %44) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %43) #8
  store i32 0, ptr %24, align 4
  br label %718

718:                                              ; preds = %717, %602, %586
  call void @llvm.lifetime.end.p0(i64 4, ptr %42) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %41) #8
  %719 = load i32, ptr %24, align 4
  switch i32 %719, label %722 [
    i32 0, label %720
  ]

720:                                              ; preds = %718
  br label %721

721:                                              ; preds = %720, %557
  store i32 0, ptr %24, align 4
  br label %722

722:                                              ; preds = %721, %718, %555
  call void @llvm.lifetime.end.p0(i64 4, ptr %31) #8
  br label %723

723:                                              ; preds = %722, %373, %285, %264
  call void @llvm.lifetime.end.p0(i64 4, ptr %29) #8
  br label %724

724:                                              ; preds = %723, %237, %218, %197, %176, %136
  call void @llvm.lifetime.end.p0(i64 8, ptr %28) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %27) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %26) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %25) #8
  br label %725

725:                                              ; preds = %724, %106, %93, %80
  call void @llvm.lifetime.end.p0(i64 40, ptr %23) #8
  call void @llvm.lifetime.end.p0(i64 14, ptr %22) #8
  %726 = load i32, ptr %24, align 4
  switch i32 %726, label %759 [
    i32 0, label %727
    i32 2, label %729
  ]

727:                                              ; preds = %725
  br label %728

728:                                              ; preds = %727
  br label %729

729:                                              ; preds = %728, %725, %66, %52
  %730 = load ptr, ptr %15, align 8, !tbaa !5
  %731 = icmp ne ptr %730, null
  br i1 %731, label %732, label %735

732:                                              ; preds = %729
  %733 = load ptr, ptr %15, align 8, !tbaa !5
  %734 = call i32 @fclose(ptr noundef %733)
  br label %735

735:                                              ; preds = %732, %729
  %736 = load ptr, ptr %21, align 8, !tbaa !5
  %737 = getelementptr inbounds %struct.BMP_image, ptr %20, i32 0, i32 3
  %738 = load ptr, ptr %737, align 8, !tbaa !33
  %739 = icmp ne ptr %736, %738
  br i1 %739, label %740, label %743

740:                                              ; preds = %735
  %741 = getelementptr inbounds %struct.BMP_image, ptr %20, i32 0, i32 3
  %742 = load ptr, ptr %741, align 8, !tbaa !33
  call void @free(ptr noundef %742) #8
  br label %743

743:                                              ; preds = %740, %735
  %744 = getelementptr inbounds %struct.BMP_image, ptr %20, i32 0, i32 2
  %745 = load ptr, ptr %744, align 8, !tbaa !31
  %746 = icmp ne ptr %745, null
  br i1 %746, label %747, label %750

747:                                              ; preds = %743
  %748 = getelementptr inbounds %struct.BMP_image, ptr %20, i32 0, i32 2
  %749 = load ptr, ptr %748, align 8, !tbaa !31
  call void @free(ptr noundef %749) #8
  br label %750

750:                                              ; preds = %747, %743
  %751 = load i32, ptr %16, align 4, !tbaa !9
  %752 = load ptr, ptr %9, align 8, !tbaa !5
  store i32 %751, ptr %752, align 4, !tbaa !9
  %753 = load i32, ptr %17, align 4, !tbaa !9
  %754 = load ptr, ptr %10, align 8, !tbaa !5
  store i32 %753, ptr %754, align 4, !tbaa !9
  %755 = load i32, ptr %19, align 4, !tbaa !9
  %756 = load ptr, ptr %11, align 8, !tbaa !5
  store i32 %755, ptr %756, align 4, !tbaa !9
  %757 = load ptr, ptr %21, align 8, !tbaa !5
  %758 = load ptr, ptr %12, align 8, !tbaa !5
  store ptr %757, ptr %758, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #8
  call void @llvm.lifetime.end.p0(i64 72, ptr %20) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #8
  ret void

759:                                              ; preds = %725
  unreachable
}

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

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

; Function Attrs: nounwind uwtable
declare hidden zeroext i1 @is_valid_bmp_filename(ptr noundef) #0

; Function Attrs: nounwind
declare i32 @fprintf(ptr noundef, ptr noundef, ...) #3

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

declare i64 @fread(ptr noundef, i64 noundef, i64 noundef, ptr noundef) #4

; Function Attrs: nounwind willreturn memory(read)
declare i32 @memcmp(ptr noundef, ptr noundef, i64 noundef) #5

; Function Attrs: nounwind willreturn memory(read)
declare i64 @strlen(ptr noundef) #5

; Function Attrs: nounwind uwtable
declare hidden i32 @read_int32_from_binary(ptr noundef) #0

; Function Attrs: nounwind uwtable
declare hidden signext i16 @read_int16_from_binary(ptr noundef) #0

; Function Attrs: nounwind uwtable
declare hidden i32 @read_uint32_from_binary(ptr noundef) #0

; Function Attrs: nounwind uwtable
declare hidden zeroext i16 @read_uint16_from_binary(ptr noundef) #0

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

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

declare i32 @px_align_up(i32 noundef, i32 noundef) #4

; Function Attrs: noreturn nounwind
declare void @exit(i32 noundef) #7

declare i32 @fclose(ptr noundef) #4

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

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

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"_Bool", !7, i64 0}
!13 = !{!7, !7, i64 0}
!14 = !{!15, !10, i64 4}
!15 = !{!"BMP_file_header", !7, i64 0, !10, i64 4, !7, i64 8, !10, i64 12}
!16 = !{!17, !17, i64 0}
!17 = !{!"short", !7, i64 0}
!18 = !{!15, !10, i64 12}
!19 = !{!20, !10, i64 0}
!20 = !{!"BMP_info_header", !10, i64 0, !10, i64 4, !10, i64 8, !17, i64 12, !17, i64 14, !10, i64 16, !10, i64 20, !10, i64 24, !10, i64 28, !10, i64 32, !10, i64 36}
!21 = !{!20, !10, i64 4}
!22 = !{!20, !10, i64 8}
!23 = !{!20, !17, i64 12}
!24 = !{!20, !17, i64 14}
!25 = !{!20, !10, i64 16}
!26 = !{!20, !10, i64 20}
!27 = !{!20, !10, i64 24}
!28 = !{!20, !10, i64 28}
!29 = !{!20, !10, i64 32}
!30 = !{!20, !10, i64 36}
!31 = !{!32, !6, i64 56}
!32 = !{!"BMP_image", !15, i64 0, !20, i64 16, !6, i64 56, !6, i64 64}
!33 = !{!32, !6, i64 64}
!34 = !{i8 0, i8 2}
!35 = !{}
!36 = distinct !{!36, !37}
!37 = !{!"llvm.loop.mustprogress"}
!38 = distinct !{!38, !37}
!39 = !{!40, !7, i64 2}
!40 = !{!"BMP_palette_entry", !7, i64 0, !7, i64 1, !7, i64 2, !7, i64 3}
!41 = !{!40, !7, i64 1}
!42 = !{!40, !7, i64 0}
!43 = distinct !{!43, !37}
!44 = distinct !{!44, !37}


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

%struct.BMP_image = type { %struct.BMP_file_header, %struct.BMP_info_header, ptr, ptr }
%struct.BMP_file_header = type { [2 x i8], i32, [2 x i16], i32 }
%struct.BMP_info_header = type { i32, i32, i32, i16, i16, i32, i32, i32, i32, i32, i32 }
%struct.BMP_palette_entry = type { i8, i8, i8, i8 }

@stderr = external local_unnamed_addr global ptr, align 8
@.str = external hidden unnamed_addr constant [42 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [23 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [12 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [22 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [38 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [39 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [40 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [30 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [52 x i8], align 1
@.str.12 = external hidden unnamed_addr constant [63 x i8], align 1
@.str.13 = external hidden unnamed_addr constant [38 x i8], align 1
@.str.14 = external hidden unnamed_addr constant [33 x i8], align 1
@.str.15 = external hidden unnamed_addr constant [74 x i8], align 1
@.str.16 = external hidden unnamed_addr constant [65 x i8], align 1
@.str.17 = external hidden unnamed_addr constant [64 x i8], align 1
@.str.19 = external hidden unnamed_addr constant [43 x i8], align 1
@.str.20 = external hidden unnamed_addr constant [14 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local void @px_read_bmp_custom(ptr noundef %0, ptr nocapture noundef writeonly %1, ptr nocapture noundef writeonly %2, ptr nocapture noundef writeonly %3, ptr nocapture noundef writeonly %4, i32 noundef %5, i1 noundef zeroext %6) local_unnamed_addr #0 {
  %8 = alloca %struct.BMP_image, align 8
  %9 = alloca [14 x i8], align 1
  %10 = alloca [40 x i8], align 16
  %11 = alloca [3 x i8], align 1
  call void @llvm.lifetime.start.p0(i64 72, ptr nonnull %8) #11
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(72) %8, i8 0, i64 72, i1 false)
  %12 = tail call zeroext i1 @is_valid_bmp_filename(ptr noundef %0)
  br i1 %12, label %13, label %.thread.thread

13:                                               ; preds = %7
  switch i32 %5, label %14 [
    i32 4, label %19
    i32 1, label %19
  ]

14:                                               ; preds = %13
  %15 = load ptr, ptr @stderr, align 8, !tbaa !5
  %16 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %15, ptr noundef nonnull @.str) #12
  %17 = load ptr, ptr @stderr, align 8, !tbaa !5
  %18 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %17, ptr noundef nonnull @.str.1) #12
  br label %.thread.thread

19:                                               ; preds = %13, %13
  call void @llvm.lifetime.start.p0(i64 14, ptr nonnull %9) #11
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(14) %9, i8 0, i64 14, i1 false)
  call void @llvm.lifetime.start.p0(i64 40, ptr nonnull %10) #11
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(40) %10, i8 0, i64 40, i1 false)
  %20 = tail call noalias ptr @fopen(ptr noundef %0, ptr noundef nonnull @.str.2)
  %.not = icmp eq ptr %20, null
  br i1 %.not, label %.thread271, label %25

.thread271:                                       ; preds = %19
  %21 = load ptr, ptr @stderr, align 8, !tbaa !5
  %22 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %21, ptr noundef nonnull @.str.3, ptr noundef %0) #12
  %23 = load ptr, ptr @stderr, align 8, !tbaa !5
  %24 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %23, ptr noundef nonnull @.str.1) #12
  call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %10) #11
  call void @llvm.lifetime.end.p0(i64 14, ptr nonnull %9) #11
  br label %.thread.thread

25:                                               ; preds = %19
  %26 = call i64 @fread(ptr noundef nonnull %9, i64 noundef 14, i64 noundef 1, ptr noundef nonnull %20)
  %.not233 = icmp eq i64 %26, 1
  br i1 %.not233, label %32, label %27

27:                                               ; preds = %25
  %28 = load ptr, ptr @stderr, align 8, !tbaa !5
  %29 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %28, ptr noundef nonnull @.str.4) #12
  %30 = load ptr, ptr @stderr, align 8, !tbaa !5
  %31 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %30, ptr noundef nonnull @.str.1) #12
  br label %.thread261

32:                                               ; preds = %25
  %33 = call i64 @fread(ptr noundef nonnull %10, i64 noundef 40, i64 noundef 1, ptr noundef nonnull %20)
  %.not234 = icmp eq i64 %33, 1
  br i1 %.not234, label %39, label %34

34:                                               ; preds = %32
  %35 = load ptr, ptr @stderr, align 8, !tbaa !5
  %36 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %35, ptr noundef nonnull @.str.4) #12
  %37 = load ptr, ptr @stderr, align 8, !tbaa !5
  %38 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %37, ptr noundef nonnull @.str.1) #12
  br label %.thread261

39:                                               ; preds = %32
  %40 = load i8, ptr %9, align 1, !tbaa !9
  store i8 %40, ptr %8, align 8, !tbaa !9
  %41 = getelementptr inbounds i8, ptr %9, i64 1
  %42 = load i8, ptr %41, align 1, !tbaa !9
  %43 = getelementptr inbounds i8, ptr %8, i64 1
  store i8 %42, ptr %43, align 1, !tbaa !9
  %44 = tail call i64 @strlen(ptr noundef nonnull dereferenceable(1) @.str.5) #13
  %bcmp = call i32 @bcmp(ptr nonnull %8, ptr nonnull @.str.5, i64 %44)
  %.not235 = icmp eq i32 %bcmp, 0
  br i1 %.not235, label %50, label %45

45:                                               ; preds = %39
  %46 = load ptr, ptr @stderr, align 8, !tbaa !5
  %47 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %46, ptr noundef nonnull @.str.6) #12
  %48 = load ptr, ptr @stderr, align 8, !tbaa !5
  %49 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %48, ptr noundef nonnull @.str.1) #12
  br label %.thread261

50:                                               ; preds = %39
  %51 = getelementptr inbounds i8, ptr %8, i64 16
  %52 = getelementptr inbounds i8, ptr %9, i64 2
  %53 = call i32 @read_int32_from_binary(ptr noundef nonnull %52)
  %54 = getelementptr inbounds i8, ptr %8, i64 4
  store i32 %53, ptr %54, align 4, !tbaa !10
  %55 = getelementptr inbounds i8, ptr %9, i64 6
  %56 = call signext i16 @read_int16_from_binary(ptr noundef nonnull %55)
  %57 = getelementptr inbounds i8, ptr %8, i64 8
  store i16 %56, ptr %57, align 8, !tbaa !13
  %58 = getelementptr inbounds i8, ptr %9, i64 8
  %59 = call signext i16 @read_int16_from_binary(ptr noundef nonnull %58)
  %60 = getelementptr inbounds i8, ptr %8, i64 10
  store i16 %59, ptr %60, align 2, !tbaa !13
  %61 = getelementptr inbounds i8, ptr %9, i64 10
  %62 = call i32 @read_int32_from_binary(ptr noundef nonnull %61)
  %63 = getelementptr inbounds i8, ptr %8, i64 12
  store i32 %62, ptr %63, align 4, !tbaa !15
  %64 = call i32 @read_uint32_from_binary(ptr noundef nonnull %10)
  store i32 %64, ptr %51, align 8, !tbaa !16
  %.not236 = icmp eq i32 %64, 40
  br i1 %.not236, label %70, label %65

65:                                               ; preds = %50
  %66 = load ptr, ptr @stderr, align 8, !tbaa !5
  %67 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %66, ptr noundef nonnull @.str.7) #12
  %68 = load ptr, ptr @stderr, align 8, !tbaa !5
  %69 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %68, ptr noundef nonnull @.str.1) #12
  br label %.thread261

70:                                               ; preds = %50
  %71 = getelementptr inbounds i8, ptr %10, i64 4
  %72 = call i32 @read_int32_from_binary(ptr noundef nonnull %71)
  %73 = getelementptr inbounds i8, ptr %8, i64 20
  store i32 %72, ptr %73, align 4, !tbaa !18
  %74 = icmp slt i32 %72, 1
  br i1 %74, label %75, label %80

75:                                               ; preds = %70
  %76 = load ptr, ptr @stderr, align 8, !tbaa !5
  %77 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %76, ptr noundef nonnull @.str.8, i32 noundef %72) #12
  %78 = load ptr, ptr @stderr, align 8, !tbaa !5
  %79 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %78, ptr noundef nonnull @.str.1) #12
  br label %.thread261

80:                                               ; preds = %70
  %81 = getelementptr inbounds i8, ptr %10, i64 8
  %82 = call i32 @read_int32_from_binary(ptr noundef nonnull %81)
  %83 = getelementptr inbounds i8, ptr %8, i64 24
  store i32 %82, ptr %83, align 8, !tbaa !19
  %84 = icmp slt i32 %82, 1
  br i1 %84, label %85, label %90

85:                                               ; preds = %80
  %86 = load ptr, ptr @stderr, align 8, !tbaa !5
  %87 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %86, ptr noundef nonnull @.str.9, i32 noundef %82) #12
  %88 = load ptr, ptr @stderr, align 8, !tbaa !5
  %89 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %88, ptr noundef nonnull @.str.1) #12
  br label %.thread261

90:                                               ; preds = %80
  %91 = getelementptr inbounds i8, ptr %10, i64 12
  %92 = call signext i16 @read_int16_from_binary(ptr noundef nonnull %91)
  %93 = getelementptr inbounds i8, ptr %8, i64 28
  store i16 %92, ptr %93, align 4, !tbaa !20
  %.not237 = icmp eq i16 %92, 1
  br i1 %.not237, label %99, label %94

94:                                               ; preds = %90
  %95 = load ptr, ptr @stderr, align 8, !tbaa !5
  %96 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %95, ptr noundef nonnull @.str.10) #12
  %97 = load ptr, ptr @stderr, align 8, !tbaa !5
  %98 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %97, ptr noundef nonnull @.str.1) #12
  br label %.thread261

99:                                               ; preds = %90
  %100 = getelementptr inbounds i8, ptr %10, i64 14
  %101 = call zeroext i16 @read_uint16_from_binary(ptr noundef nonnull %100)
  %102 = getelementptr inbounds i8, ptr %8, i64 30
  store i16 %101, ptr %102, align 2, !tbaa !21
  %103 = zext i16 %101 to i32
  switch i16 %101, label %104 [
    i16 32, label %109
    i16 24, label %109
    i16 8, label %109
  ]

104:                                              ; preds = %99
  %105 = load ptr, ptr @stderr, align 8, !tbaa !5
  %106 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %105, ptr noundef nonnull @.str.11, i32 noundef %103) #12
  %107 = load ptr, ptr @stderr, align 8, !tbaa !5
  %108 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %107, ptr noundef nonnull @.str.1) #12
  br label %.thread261

109:                                              ; preds = %99, %99, %99
  %110 = getelementptr inbounds i8, ptr %10, i64 16
  %111 = call i32 @read_uint32_from_binary(ptr noundef nonnull %110)
  %112 = getelementptr inbounds i8, ptr %8, i64 32
  store i32 %111, ptr %112, align 8, !tbaa !22
  %.not238 = icmp eq i32 %111, 0
  br i1 %.not238, label %118, label %113

113:                                              ; preds = %109
  %114 = load ptr, ptr @stderr, align 8, !tbaa !5
  %115 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %114, ptr noundef nonnull @.str.12, i32 noundef %111) #12
  %116 = load ptr, ptr @stderr, align 8, !tbaa !5
  %117 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %116, ptr noundef nonnull @.str.1) #12
  br label %.thread261

118:                                              ; preds = %109
  %119 = getelementptr inbounds i8, ptr %10, i64 20
  %120 = call i32 @read_uint32_from_binary(ptr noundef nonnull %119)
  %121 = getelementptr inbounds i8, ptr %8, i64 36
  store i32 %120, ptr %121, align 4, !tbaa !23
  %122 = getelementptr inbounds i8, ptr %10, i64 24
  %123 = call i32 @read_int32_from_binary(ptr noundef nonnull %122)
  %124 = getelementptr inbounds i8, ptr %8, i64 40
  store i32 %123, ptr %124, align 8, !tbaa !24
  %125 = getelementptr inbounds i8, ptr %10, i64 28
  %126 = call i32 @read_int32_from_binary(ptr noundef nonnull %125)
  %127 = getelementptr inbounds i8, ptr %8, i64 44
  store i32 %126, ptr %127, align 4, !tbaa !25
  %128 = getelementptr inbounds i8, ptr %10, i64 32
  %129 = call i32 @read_uint32_from_binary(ptr noundef nonnull %128)
  %130 = getelementptr inbounds i8, ptr %8, i64 48
  store i32 %129, ptr %130, align 8, !tbaa !26
  %131 = getelementptr inbounds i8, ptr %10, i64 36
  %132 = call i32 @read_uint32_from_binary(ptr noundef nonnull %131)
  %133 = getelementptr inbounds i8, ptr %8, i64 52
  store i32 %132, ptr %133, align 4, !tbaa !27
  %134 = icmp eq i16 %101, 8
  br i1 %134, label %135, label %155

135:                                              ; preds = %118
  %136 = add i32 %129, -1
  %or.cond = icmp ult i32 %136, 255
  %137 = shl nuw nsw i32 %129, 2
  %138 = select i1 %or.cond, i32 %137, i32 1024
  %139 = zext nneg i32 %138 to i64
  %140 = call noalias ptr @malloc(i64 noundef %139) #14
  %141 = getelementptr inbounds i8, ptr %8, i64 56
  store ptr %140, ptr %141, align 8, !tbaa !28
  %142 = icmp eq ptr %140, null
  br i1 %142, label %143, label %148

143:                                              ; preds = %135
  %144 = load ptr, ptr @stderr, align 8, !tbaa !5
  %145 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %144, ptr noundef nonnull @.str.13) #12
  %146 = load ptr, ptr @stderr, align 8, !tbaa !5
  %147 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %146, ptr noundef nonnull @.str.1) #12
  br label %.thread261

148:                                              ; preds = %135
  %149 = call i64 @fread(ptr noundef nonnull %140, i64 noundef %139, i64 noundef 1, ptr noundef nonnull %20)
  %.not240 = icmp eq i64 %149, 1
  br i1 %.not240, label %155, label %150

150:                                              ; preds = %148
  %151 = load ptr, ptr @stderr, align 8, !tbaa !5
  %152 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %151, ptr noundef nonnull @.str.14) #12
  %153 = load ptr, ptr @stderr, align 8, !tbaa !5
  %154 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %153, ptr noundef nonnull @.str.1) #12
  br label %.thread261

155:                                              ; preds = %148, %118
  %156 = phi ptr [ %140, %148 ], [ null, %118 ]
  %157 = lshr exact i32 %103, 3
  %158 = mul nuw nsw i32 %157, %72
  %159 = call i32 @px_align_up(i32 noundef %158, i32 noundef 4) #11
  %160 = icmp eq ptr %156, null
  br i1 %160, label %.split311.us, label %209

.split311.us:                                     ; preds = %155
  %161 = mul nuw nsw i32 %72, 3
  %162 = call i32 @px_align_up(i32 noundef %161, i32 noundef %5) #11
  call void @llvm.lifetime.start.p0(i64 3, ptr nonnull %11) #11
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(3) %11, i8 0, i64 3, i1 false)
  %163 = sub nsw i32 %159, %158
  %164 = mul nsw i32 %162, %82
  %165 = sext i32 %164 to i64
  %166 = call noalias ptr @malloc(i64 noundef %165) #14
  %167 = getelementptr inbounds i8, ptr %8, i64 64
  store ptr %166, ptr %167, align 8, !tbaa !30
  %168 = sext i32 %162 to i64
  %169 = sub nsw i64 0, %168
  %.not244 = icmp eq i32 %159, %158
  %170 = sext i32 %163 to i64
  %171 = add nsw i32 %82, -1
  %172 = mul nsw i32 %162, %171
  %173 = sext i32 %172 to i64
  %174 = getelementptr inbounds i8, ptr %166, i64 %173
  br i1 %6, label %.preheader.us.us, label %.preheader.us

.preheader.us.us:                                 ; preds = %.split311.us, %177
  %.0202309.us.us = phi i32 [ %178, %177 ], [ %171, %.split311.us ]
  %.0207307.us.us = phi ptr [ %189, %177 ], [ %174, %.split311.us ]
  br label %179

175:                                              ; preds = %._crit_edge.split.us.us.us331
  %176 = call i64 @fread(ptr noundef nonnull %11, i64 noundef %170, i64 noundef 1, ptr noundef nonnull %20)
  %.not245.us.us = icmp eq i64 %176, 1
  br i1 %.not245.us.us, label %177, label %.split317.us

177:                                              ; preds = %._crit_edge.split.us.us.us331, %175
  %178 = add nsw i32 %.0202309.us.us, -1
  %.not243.us.us = icmp eq i32 %.0202309.us.us, 0
  br i1 %.not243.us.us, label %.split320.us, label %.preheader.us.us, !llvm.loop !31

179:                                              ; preds = %182, %.preheader.us.us
  %indvars.iv355 = phi i64 [ %indvars.iv.next356, %182 ], [ 0, %.preheader.us.us ]
  %180 = getelementptr inbounds i8, ptr %.0207307.us.us, i64 %indvars.iv355
  %181 = call i64 @fread(ptr noundef %180, i64 noundef 3, i64 noundef 1, ptr noundef nonnull %20)
  %.not246.us.us.us = icmp eq i64 %181, 1
  br i1 %.not246.us.us.us, label %182, label %.split305.us

182:                                              ; preds = %179
  %183 = add nuw nsw i64 %indvars.iv355, 2
  %184 = getelementptr inbounds i8, ptr %.0207307.us.us, i64 %183
  %185 = load i8, ptr %184, align 1, !tbaa !9
  %186 = load i8, ptr %180, align 1, !tbaa !9
  store i8 %186, ptr %184, align 1, !tbaa !9
  store i8 %185, ptr %180, align 1, !tbaa !9
  %indvars.iv.next356 = add nuw nsw i64 %indvars.iv355, 3
  %187 = trunc nuw i64 %indvars.iv.next356 to i32
  %188 = icmp sgt i32 %161, %187
  br i1 %188, label %179, label %._crit_edge.split.us.us.us331, !llvm.loop !33

._crit_edge.split.us.us.us331:                    ; preds = %182
  %189 = getelementptr inbounds i8, ptr %.0207307.us.us, i64 %169
  br i1 %.not244, label %177, label %175

.preheader.us:                                    ; preds = %.split311.us, %192
  %.0202309.us = phi i32 [ %193, %192 ], [ %171, %.split311.us ]
  %.0207307.us = phi ptr [ %200, %192 ], [ %174, %.split311.us ]
  br label %194

190:                                              ; preds = %._crit_edge.split.us314
  %191 = call i64 @fread(ptr noundef nonnull %11, i64 noundef %170, i64 noundef 1, ptr noundef nonnull %20)
  %.not245.us = icmp eq i64 %191, 1
  br i1 %.not245.us, label %192, label %.split317.us

192:                                              ; preds = %190, %._crit_edge.split.us314
  %193 = add nsw i32 %.0202309.us, -1
  %.not243.us = icmp eq i32 %.0202309.us, 0
  br i1 %.not243.us, label %.split320.us, label %.preheader.us, !llvm.loop !31

194:                                              ; preds = %.preheader.us, %197
  %indvars.iv352 = phi i64 [ 0, %.preheader.us ], [ %indvars.iv.next353, %197 ]
  %195 = getelementptr inbounds i8, ptr %.0207307.us, i64 %indvars.iv352
  %196 = call i64 @fread(ptr noundef %195, i64 noundef 3, i64 noundef 1, ptr noundef nonnull %20)
  %.not246.us313 = icmp eq i64 %196, 1
  br i1 %.not246.us313, label %197, label %.split305.us

197:                                              ; preds = %194
  %indvars.iv.next353 = add nuw nsw i64 %indvars.iv352, 3
  %198 = trunc nuw i64 %indvars.iv.next353 to i32
  %199 = icmp sgt i32 %161, %198
  br i1 %199, label %194, label %._crit_edge.split.us314, !llvm.loop !33

._crit_edge.split.us314:                          ; preds = %197
  %200 = getelementptr inbounds i8, ptr %.0207307.us, i64 %169
  br i1 %.not244, label %192, label %190

.split305.us:                                     ; preds = %194, %179
  %.us-phi = phi i32 [ %.0202309.us.us, %179 ], [ %.0202309.us, %194 ]
  %.us-phi306.in = phi i64 [ %indvars.iv355, %179 ], [ %indvars.iv352, %194 ]
  %.us-phi306 = trunc i64 %.us-phi306.in to i32
  %201 = load ptr, ptr @stderr, align 8, !tbaa !5
  %202 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %201, ptr noundef nonnull @.str.15, ptr noundef nonnull @.str.16, i32 noundef 366, i32 noundef %.us-phi, i32 noundef %82, i32 noundef %.us-phi306, i32 noundef %161, ptr noundef %0, i32 noundef 3) #12
  %203 = load ptr, ptr @stderr, align 8, !tbaa !5
  %204 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %203, ptr noundef nonnull @.str.1) #12
  call void @exit(i32 noundef 1) #15
  unreachable

.split317.us:                                     ; preds = %190, %175
  %.us-phi318 = phi i32 [ %.0202309.us.us, %175 ], [ %.0202309.us, %190 ]
  %205 = load ptr, ptr @stderr, align 8, !tbaa !5
  %206 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %205, ptr noundef nonnull @.str.17, ptr noundef nonnull @.str.16, i32 noundef 382, i32 noundef %.us-phi318, i32 noundef %82, ptr noundef %0, i32 noundef 3) #12
  %207 = load ptr, ptr @stderr, align 8, !tbaa !5
  %208 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %207, ptr noundef nonnull @.str.1) #12
  call void @exit(i32 noundef 1) #15
  unreachable

.split320.us:                                     ; preds = %192, %177
  call void @llvm.lifetime.end.p0(i64 3, ptr nonnull %11) #11
  %.pre.pre.pre = load ptr, ptr %167, align 8, !tbaa !30
  br label %.loopexit

209:                                              ; preds = %155
  %210 = mul nsw i32 %159, %82
  %211 = call i32 @px_align_up(i32 noundef %158, i32 noundef %5) #11
  %212 = sext i32 %210 to i64
  %213 = call noalias ptr @malloc(i64 noundef %212) #14
  %214 = getelementptr inbounds i8, ptr %8, i64 64
  store ptr %213, ptr %214, align 8, !tbaa !30
  %215 = call i64 @fread(ptr noundef %213, i64 noundef %212, i64 noundef 1, ptr noundef nonnull %20)
  %.not241 = icmp eq i64 %215, 1
  br i1 %.not241, label %221, label %216

216:                                              ; preds = %209
  %217 = load ptr, ptr @stderr, align 8, !tbaa !5
  %218 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %217, ptr noundef nonnull @.str.19) #12
  %219 = load ptr, ptr @stderr, align 8, !tbaa !5
  %220 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %219, ptr noundef nonnull @.str.1) #12
  br label %.thread261

221:                                              ; preds = %209
  %222 = mul nsw i32 %211, %82
  %223 = sext i32 %222 to i64
  %224 = call noalias ptr @malloc(i64 noundef %223) #14
  %225 = icmp eq ptr %224, null
  br i1 %225, label %226, label %.split.us

226:                                              ; preds = %221
  %227 = load ptr, ptr @stderr, align 8, !tbaa !5
  %228 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %227, ptr noundef nonnull @.str.20) #12
  %229 = load ptr, ptr @stderr, align 8, !tbaa !5
  %230 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %229, ptr noundef nonnull @.str.1) #12
  br label %.thread261

.split.us:                                        ; preds = %221
  %231 = add nsw i32 %82, -1
  %232 = sext i32 %159 to i64
  %233 = sext i32 %211 to i64
  %234 = sub nsw i64 0, %233
  %235 = mul nsw i32 %211, %231
  %236 = sext i32 %235 to i64
  %237 = getelementptr inbounds i8, ptr %224, i64 %236
  switch i16 %101, label %.loopexit [
    i16 24, label %.preheader277.us.us.preheader
    i16 8, label %.preheader277.us.us296.preheader
  ]

.preheader277.us.us296.preheader:                 ; preds = %.split.us
  %238 = call i32 @llvm.umax.i32(i32 %158, i32 1)
  %umax = zext nneg i32 %238 to i64
  %xtraiter = and i64 %umax, 3
  %239 = icmp ult i32 %158, 4
  %unroll_iter = and i64 %umax, 2147483644
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br label %.preheader277.us.us296

.preheader277.us.us.preheader:                    ; preds = %.split.us
  %240 = zext nneg i32 %158 to i64
  br label %.preheader277.us.us

.preheader277.us.us:                              ; preds = %.preheader277.us.us.preheader, %._crit_edge.split.us.us.us
  %.0192290.us.us = phi i32 [ %259, %._crit_edge.split.us.us.us ], [ %231, %.preheader277.us.us.preheader ]
  %.0193287.us.us = phi ptr [ %257, %._crit_edge.split.us.us.us ], [ %213, %.preheader277.us.us.preheader ]
  %.0194284.us.us = phi ptr [ %258, %._crit_edge.split.us.us.us ], [ %237, %.preheader277.us.us.preheader ]
  br label %241

241:                                              ; preds = %241, %.preheader277.us.us
  %indvars.iv350 = phi i64 [ %indvars.iv.next351, %241 ], [ 0, %.preheader277.us.us ]
  %242 = getelementptr inbounds i8, ptr %.0193287.us.us, i64 %indvars.iv350
  %243 = load i8, ptr %242, align 1, !tbaa !9
  %244 = zext i8 %243 to i64
  %245 = getelementptr inbounds %struct.BMP_palette_entry, ptr %156, i64 %244, i32 2
  %246 = load i8, ptr %245, align 1, !tbaa !34
  %247 = getelementptr inbounds i8, ptr %.0194284.us.us, i64 %indvars.iv350
  store i8 %246, ptr %247, align 1, !tbaa !9
  %248 = getelementptr inbounds %struct.BMP_palette_entry, ptr %156, i64 %244, i32 1
  %249 = load i8, ptr %248, align 1, !tbaa !36
  %250 = add nuw nsw i64 %indvars.iv350, 1
  %251 = getelementptr inbounds i8, ptr %.0194284.us.us, i64 %250
  store i8 %249, ptr %251, align 1, !tbaa !9
  %252 = getelementptr inbounds %struct.BMP_palette_entry, ptr %156, i64 %244
  %253 = load i8, ptr %252, align 1, !tbaa !37
  %254 = add nuw nsw i64 %indvars.iv350, 2
  %255 = getelementptr inbounds i8, ptr %.0194284.us.us, i64 %254
  store i8 %253, ptr %255, align 1, !tbaa !9
  %indvars.iv.next351 = add nuw nsw i64 %indvars.iv350, 3
  %256 = icmp ult i64 %indvars.iv.next351, %240
  br i1 %256, label %241, label %._crit_edge.split.us.us.us, !llvm.loop !38

._crit_edge.split.us.us.us:                       ; preds = %241
  %257 = getelementptr inbounds i8, ptr %.0193287.us.us, i64 %232
  %258 = getelementptr inbounds i8, ptr %.0194284.us.us, i64 %234
  %259 = add nsw i32 %.0192290.us.us, -1
  %.not242.us.us = icmp eq i32 %.0192290.us.us, 0
  br i1 %.not242.us.us, label %.loopexit, label %.preheader277.us.us, !llvm.loop !39

.preheader277.us.us296:                           ; preds = %.preheader277.us.us296.preheader, %._crit_edge.split.split.us.us.us
  %.0192290.us.us297 = phi i32 [ %292, %._crit_edge.split.split.us.us.us ], [ %231, %.preheader277.us.us296.preheader ]
  %.0193287.us.us298 = phi ptr [ %290, %._crit_edge.split.split.us.us.us ], [ %213, %.preheader277.us.us296.preheader ]
  %.0194284.us.us299 = phi ptr [ %291, %._crit_edge.split.split.us.us.us ], [ %237, %.preheader277.us.us296.preheader ]
  br i1 %239, label %._crit_edge.split.split.us.us.us.unr-lcssa, label %.preheader277.us.us296.new

.preheader277.us.us296.new:                       ; preds = %.preheader277.us.us296, %.preheader277.us.us296.new
  %indvars.iv = phi i64 [ %indvars.iv.next.3, %.preheader277.us.us296.new ], [ 0, %.preheader277.us.us296 ]
  %niter = phi i64 [ %niter.next.3, %.preheader277.us.us296.new ], [ 0, %.preheader277.us.us296 ]
  %260 = getelementptr inbounds i8, ptr %.0193287.us.us298, i64 %indvars.iv
  %261 = load i8, ptr %260, align 1, !tbaa !9
  %262 = zext i8 %261 to i64
  %263 = getelementptr inbounds %struct.BMP_palette_entry, ptr %156, i64 %262, i32 2
  %264 = load i8, ptr %263, align 1, !tbaa !34
  %265 = getelementptr inbounds i8, ptr %.0194284.us.us299, i64 %indvars.iv
  store i8 %264, ptr %265, align 1, !tbaa !9
  %indvars.iv.next = or disjoint i64 %indvars.iv, 1
  %266 = getelementptr inbounds i8, ptr %.0193287.us.us298, i64 %indvars.iv.next
  %267 = load i8, ptr %266, align 1, !tbaa !9
  %268 = zext i8 %267 to i64
  %269 = getelementptr inbounds %struct.BMP_palette_entry, ptr %156, i64 %268, i32 2
  %270 = load i8, ptr %269, align 1, !tbaa !34
  %271 = getelementptr inbounds i8, ptr %.0194284.us.us299, i64 %indvars.iv.next
  store i8 %270, ptr %271, align 1, !tbaa !9
  %indvars.iv.next.1 = or disjoint i64 %indvars.iv, 2
  %272 = getelementptr inbounds i8, ptr %.0193287.us.us298, i64 %indvars.iv.next.1
  %273 = load i8, ptr %272, align 1, !tbaa !9
  %274 = zext i8 %273 to i64
  %275 = getelementptr inbounds %struct.BMP_palette_entry, ptr %156, i64 %274, i32 2
  %276 = load i8, ptr %275, align 1, !tbaa !34
  %277 = getelementptr inbounds i8, ptr %.0194284.us.us299, i64 %indvars.iv.next.1
  store i8 %276, ptr %277, align 1, !tbaa !9
  %indvars.iv.next.2 = or disjoint i64 %indvars.iv, 3
  %278 = getelementptr inbounds i8, ptr %.0193287.us.us298, i64 %indvars.iv.next.2
  %279 = load i8, ptr %278, align 1, !tbaa !9
  %280 = zext i8 %279 to i64
  %281 = getelementptr inbounds %struct.BMP_palette_entry, ptr %156, i64 %280, i32 2
  %282 = load i8, ptr %281, align 1, !tbaa !34
  %283 = getelementptr inbounds i8, ptr %.0194284.us.us299, i64 %indvars.iv.next.2
  store i8 %282, ptr %283, align 1, !tbaa !9
  %indvars.iv.next.3 = add nuw nsw i64 %indvars.iv, 4
  %niter.next.3 = add i64 %niter, 4
  %niter.ncmp.3.not = icmp eq i64 %niter.next.3, %unroll_iter
  br i1 %niter.ncmp.3.not, label %._crit_edge.split.split.us.us.us.unr-lcssa, label %.preheader277.us.us296.new, !llvm.loop !38

._crit_edge.split.split.us.us.us.unr-lcssa:       ; preds = %.preheader277.us.us296.new, %.preheader277.us.us296
  %indvars.iv.unr = phi i64 [ 0, %.preheader277.us.us296 ], [ %indvars.iv.next.3, %.preheader277.us.us296.new ]
  br i1 %lcmp.mod.not, label %._crit_edge.split.split.us.us.us, label %.epil.preheader

.epil.preheader:                                  ; preds = %._crit_edge.split.split.us.us.us.unr-lcssa, %.epil.preheader
  %indvars.iv.epil = phi i64 [ %indvars.iv.next.epil, %.epil.preheader ], [ %indvars.iv.unr, %._crit_edge.split.split.us.us.us.unr-lcssa ]
  %epil.iter = phi i64 [ %epil.iter.next, %.epil.preheader ], [ 0, %._crit_edge.split.split.us.us.us.unr-lcssa ]
  %284 = getelementptr inbounds i8, ptr %.0193287.us.us298, i64 %indvars.iv.epil
  %285 = load i8, ptr %284, align 1, !tbaa !9
  %286 = zext i8 %285 to i64
  %287 = getelementptr inbounds %struct.BMP_palette_entry, ptr %156, i64 %286, i32 2
  %288 = load i8, ptr %287, align 1, !tbaa !34
  %289 = getelementptr inbounds i8, ptr %.0194284.us.us299, i64 %indvars.iv.epil
  store i8 %288, ptr %289, align 1, !tbaa !9
  %indvars.iv.next.epil = add nuw nsw i64 %indvars.iv.epil, 1
  %epil.iter.next = add i64 %epil.iter, 1
  %epil.iter.cmp.not = icmp eq i64 %epil.iter.next, %xtraiter
  br i1 %epil.iter.cmp.not, label %._crit_edge.split.split.us.us.us, label %.epil.preheader, !llvm.loop !40

._crit_edge.split.split.us.us.us:                 ; preds = %.epil.preheader, %._crit_edge.split.split.us.us.us.unr-lcssa
  %290 = getelementptr inbounds i8, ptr %.0193287.us.us298, i64 %232
  %291 = getelementptr inbounds i8, ptr %.0194284.us.us299, i64 %234
  %292 = add nsw i32 %.0192290.us.us297, -1
  %.not242.us.us301 = icmp eq i32 %.0192290.us.us297, 0
  br i1 %.not242.us.us301, label %.loopexit, label %.preheader277.us.us296, !llvm.loop !39

.thread261:                                       ; preds = %27, %34, %104, %113, %150, %143, %94, %85, %75, %65, %45, %226, %216
  %.pre359 = phi ptr [ %213, %216 ], [ %213, %226 ], [ null, %143 ], [ null, %150 ], [ null, %113 ], [ null, %104 ], [ null, %94 ], [ null, %85 ], [ null, %75 ], [ null, %65 ], [ null, %45 ], [ null, %34 ], [ null, %27 ]
  %.4.ph = phi i32 [ %157, %216 ], [ %157, %226 ], [ 0, %143 ], [ 0, %150 ], [ 0, %113 ], [ 0, %104 ], [ 0, %94 ], [ 0, %85 ], [ 0, %75 ], [ 0, %65 ], [ 0, %45 ], [ 0, %34 ], [ 0, %27 ]
  %.2199.ph = phi i32 [ %72, %216 ], [ %72, %226 ], [ 0, %143 ], [ 0, %150 ], [ 0, %113 ], [ 0, %104 ], [ 0, %94 ], [ 0, %85 ], [ 0, %75 ], [ 0, %65 ], [ 0, %45 ], [ 0, %34 ], [ 0, %27 ]
  %.2.ph = phi i32 [ %82, %216 ], [ %82, %226 ], [ 0, %143 ], [ 0, %150 ], [ 0, %113 ], [ 0, %104 ], [ 0, %94 ], [ 0, %85 ], [ 0, %75 ], [ 0, %65 ], [ 0, %45 ], [ 0, %34 ], [ 0, %27 ]
  call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %10) #11
  call void @llvm.lifetime.end.p0(i64 14, ptr nonnull %9) #11
  br label %.thread

.loopexit:                                        ; preds = %._crit_edge.split.split.us.us.us, %._crit_edge.split.us.us.us, %.split.us, %.split320.us
  %.pre.pre = phi ptr [ %.pre.pre.pre, %.split320.us ], [ %213, %.split.us ], [ %213, %._crit_edge.split.us.us.us ], [ %213, %._crit_edge.split.split.us.us.us ]
  %.5213 = phi ptr [ %166, %.split320.us ], [ %224, %.split.us ], [ %224, %._crit_edge.split.us.us.us ], [ %224, %._crit_edge.split.split.us.us.us ]
  %.4 = phi i32 [ 3, %.split320.us ], [ %157, %.split.us ], [ %157, %._crit_edge.split.us.us.us ], [ %157, %._crit_edge.split.split.us.us.us ]
  call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %10) #11
  call void @llvm.lifetime.end.p0(i64 14, ptr nonnull %9) #11
  br label %.thread

.thread:                                          ; preds = %.thread261, %.loopexit
  %.pre = phi ptr [ %.pre359, %.thread261 ], [ %.pre.pre, %.loopexit ]
  %.2270 = phi i32 [ %.2.ph, %.thread261 ], [ %82, %.loopexit ]
  %.2199269 = phi i32 [ %.2199.ph, %.thread261 ], [ %72, %.loopexit ]
  %.4268 = phi i32 [ %.4.ph, %.thread261 ], [ %.4, %.loopexit ]
  %.5213267 = phi ptr [ null, %.thread261 ], [ %.5213, %.loopexit ]
  %293 = call i32 @fclose(ptr noundef nonnull %20)
  %.not248 = icmp eq ptr %.5213267, %.pre
  br i1 %.not248, label %.thread.thread, label %294

294:                                              ; preds = %.thread
  call void @free(ptr noundef %.pre) #11
  br label %.thread.thread

.thread.thread:                                   ; preds = %7, %14, %.thread271, %294, %.thread
  %.6256369 = phi ptr [ %.5213267, %294 ], [ %.5213267, %.thread ], [ null, %.thread271 ], [ null, %14 ], [ null, %7 ]
  %.5257368 = phi i32 [ %.4268, %294 ], [ %.4268, %.thread ], [ 0, %.thread271 ], [ 0, %14 ], [ 0, %7 ]
  %.3200258367 = phi i32 [ %.2199269, %294 ], [ %.2199269, %.thread ], [ 0, %.thread271 ], [ 0, %14 ], [ 0, %7 ]
  %.3259366 = phi i32 [ %.2270, %294 ], [ %.2270, %.thread ], [ 0, %.thread271 ], [ 0, %14 ], [ 0, %7 ]
  %295 = getelementptr inbounds i8, ptr %8, i64 56
  %296 = load ptr, ptr %295, align 8, !tbaa !28
  %.not249 = icmp eq ptr %296, null
  br i1 %.not249, label %298, label %297

297:                                              ; preds = %.thread.thread
  call void @free(ptr noundef nonnull %296) #11
  br label %298

298:                                              ; preds = %297, %.thread.thread
  store i32 %.3259366, ptr %1, align 4, !tbaa !42
  store i32 %.3200258367, ptr %2, align 4, !tbaa !42
  store i32 %.5257368, ptr %3, align 4, !tbaa !42
  store ptr %.6256369, ptr %4, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 72, ptr nonnull %8) #11
  ret void
}

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

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

; Function Attrs: nounwind uwtable
declare hidden zeroext i1 @is_valid_bmp_filename(ptr noundef) local_unnamed_addr #0

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

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

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

; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read)
declare i64 @strlen(ptr nocapture noundef) local_unnamed_addr #4

; Function Attrs: nounwind uwtable
declare hidden i32 @read_int32_from_binary(ptr noundef) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
declare hidden signext i16 @read_int16_from_binary(ptr noundef) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
declare hidden i32 @read_uint32_from_binary(ptr noundef) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
declare hidden zeroext i16 @read_uint16_from_binary(ptr noundef) local_unnamed_addr #0

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

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

declare i32 @px_align_up(i32 noundef, i32 noundef) local_unnamed_addr #6

; Function Attrs: noreturn nounwind
declare void @exit(i32 noundef) local_unnamed_addr #7

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

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

; Function Attrs: nofree nounwind willreturn memory(argmem: read)
declare i32 @bcmp(ptr nocapture, ptr nocapture, i64) local_unnamed_addr #9

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

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

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!7, !7, i64 0}
!10 = !{!11, !12, i64 4}
!11 = !{!"BMP_file_header", !7, i64 0, !12, i64 4, !7, i64 8, !12, i64 12}
!12 = !{!"int", !7, i64 0}
!13 = !{!14, !14, i64 0}
!14 = !{!"short", !7, i64 0}
!15 = !{!11, !12, i64 12}
!16 = !{!17, !12, i64 0}
!17 = !{!"BMP_info_header", !12, i64 0, !12, i64 4, !12, i64 8, !14, i64 12, !14, i64 14, !12, i64 16, !12, i64 20, !12, i64 24, !12, i64 28, !12, i64 32, !12, i64 36}
!18 = !{!17, !12, i64 4}
!19 = !{!17, !12, i64 8}
!20 = !{!17, !14, i64 12}
!21 = !{!17, !14, i64 14}
!22 = !{!17, !12, i64 16}
!23 = !{!17, !12, i64 20}
!24 = !{!17, !12, i64 24}
!25 = !{!17, !12, i64 28}
!26 = !{!17, !12, i64 32}
!27 = !{!17, !12, i64 36}
!28 = !{!29, !6, i64 56}
!29 = !{!"BMP_image", !11, i64 0, !17, i64 16, !6, i64 56, !6, i64 64}
!30 = !{!29, !6, i64 64}
!31 = distinct !{!31, !32}
!32 = !{!"llvm.loop.mustprogress"}
!33 = distinct !{!33, !32}
!34 = !{!35, !7, i64 2}
!35 = !{!"BMP_palette_entry", !7, i64 0, !7, i64 1, !7, i64 2, !7, i64 3}
!36 = !{!35, !7, i64 1}
!37 = !{!35, !7, i64 0}
!38 = distinct !{!38, !32}
!39 = distinct !{!39, !32}
!40 = distinct !{!40, !41}
!41 = !{!"llvm.loop.unroll.disable"}
!42 = !{!12, !12, i64 0}


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