; LLVM IR from jingweizhanghuai/Morn :: src/image (morn_image_file)

; 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.BMPHeader = type { i32, i32, i32, i32, i32, i32, i16, i16, i32, i32, i32, i32, i32, i32 }
%struct.colorlist = type { i8, i8, i8, i8 }
%struct.MImage = type { i32, i32, i32, [4 x ptr], ptr }

@.str = external hidden unnamed_addr constant [83 x i8], align 1
@__FUNCTION__.BMPGraySave = external hidden unnamed_addr constant [12 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [13 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [11 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [17 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [17 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local void @BMPGraySave(ptr noundef %0, ptr noundef %1) #0 {
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca ptr, align 8
  %11 = alloca i32, align 4
  %12 = alloca i16, align 2
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  %15 = alloca i32, align 4
  %16 = alloca i32, align 4
  %17 = alloca i32, align 4
  %18 = alloca %struct.BMPHeader, align 4
  %19 = alloca i32, align 4
  %20 = alloca [256 x %struct.colorlist], align 16
  %21 = alloca i32, align 4
  %22 = alloca i32, align 4
  %23 = alloca i32, align 4
  %24 = alloca i32, align 4
  store ptr %0, ptr %3, align 8, !tbaa !5
  store ptr %1, ptr %4, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #3
  store i32 0, ptr %6, align 4, !tbaa !9
  br label %25

25:                                               ; preds = %2
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #3
  %26 = load ptr, ptr %3, align 8, !tbaa !5
  %27 = icmp eq ptr %26, null
  br i1 %27, label %32, label %28

28:                                               ; preds = %25
  %29 = load ptr, ptr %3, align 8, !tbaa !5
  %30 = ptrtoint ptr %29 to i64
  %31 = icmp eq i64 %30, -1
  br i1 %31, label %32, label %33

32:                                               ; preds = %28, %25
  br label %62

33:                                               ; preds = %28
  %34 = load ptr, ptr %3, align 8, !tbaa !5
  %35 = getelementptr inbounds %struct.MImage, ptr %34, i32 0, i32 3
  %36 = getelementptr inbounds [4 x ptr], ptr %35, i64 0, i64 0
  %37 = icmp eq ptr %36, null
  br i1 %37, label %59, label %38

38:                                               ; preds = %33
  %39 = load ptr, ptr %3, align 8, !tbaa !5
  %40 = getelementptr inbounds %struct.MImage, ptr %39, i32 0, i32 3
  %41 = getelementptr inbounds [4 x ptr], ptr %40, i64 0, i64 0
  %42 = ptrtoint ptr %41 to i64
  %43 = icmp eq i64 %42, -1
  br i1 %43, label %59, label %44

44:                                               ; preds = %38
  %45 = load ptr, ptr %3, align 8, !tbaa !5
  %46 = getelementptr inbounds %struct.MImage, ptr %45, i32 0, i32 0
  %47 = load i32, ptr %46, align 8, !tbaa !11
  %48 = icmp sle i32 %47, 0
  br i1 %48, label %59, label %49

49:                                               ; preds = %44
  %50 = load ptr, ptr %3, align 8, !tbaa !5
  %51 = getelementptr inbounds %struct.MImage, ptr %50, i32 0, i32 1
  %52 = load i32, ptr %51, align 4, !tbaa !13
  %53 = icmp sle i32 %52, 0
  br i1 %53, label %59, label %54

54:                                               ; preds = %49
  %55 = load ptr, ptr %3, align 8, !tbaa !5
  %56 = getelementptr inbounds %struct.MImage, ptr %55, i32 0, i32 2
  %57 = load i32, ptr %56, align 8, !tbaa !14
  %58 = icmp sle i32 %57, 0
  br label %59

59:                                               ; preds = %54, %49, %44, %38, %33
  %60 = phi i1 [ true, %49 ], [ true, %44 ], [ true, %38 ], [ true, %33 ], [ %58, %54 ]
  %61 = zext i1 %60 to i32
  br label %62

62:                                               ; preds = %59, %32
  %63 = phi i32 [ 1, %32 ], [ %61, %59 ]
  store i32 %63, ptr %7, align 4, !tbaa !9
  %64 = load i32, ptr %7, align 4, !tbaa !9
  %65 = icmp ne i32 %64, 0
  br i1 %65, label %66, label %68

66:                                               ; preds = %62
  %67 = load i32, ptr %7, align 4, !tbaa !9
  call void (i32, i32, ptr, i32, ptr, ptr, ...) @m_Exception(i32 noundef %67, i32 noundef -1, ptr noundef @.str, i32 noundef 44, ptr noundef @__FUNCTION__.BMPGraySave, ptr noundef @.str.1)
  br label %68

68:                                               ; preds = %66, %62
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #3
  br label %69

69:                                               ; preds = %68
  br label %70

70:                                               ; preds = %69
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #3
  store i32 -1, ptr %8, align 4, !tbaa !9
  %71 = load ptr, ptr %3, align 8, !tbaa !5
  %72 = call ptr @m_PropertyRead(ptr noundef %71, ptr noundef @.str.2, ptr noundef %8, ptr noundef null)
  br label %73

73:                                               ; preds = %70
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #3
  %74 = load i32, ptr %8, align 4, !tbaa !9
  %75 = icmp ne i32 %74, 1
  %76 = zext i1 %75 to i32
  store i32 %76, ptr %9, align 4, !tbaa !9
  %77 = load i32, ptr %9, align 4, !tbaa !9
  %78 = icmp ne i32 %77, 0
  br i1 %78, label %79, label %81

79:                                               ; preds = %73
  %80 = load i32, ptr %9, align 4, !tbaa !9
  call void (i32, i32, ptr, i32, ptr, ptr, ...) @m_Exception(i32 noundef %80, i32 noundef -1, ptr noundef @.str, i32 noundef 46, ptr noundef @__FUNCTION__.BMPGraySave, ptr noundef @.str.1)
  br label %81

81:                                               ; preds = %79, %73
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #3
  br label %82

82:                                               ; preds = %81
  br label %83

83:                                               ; preds = %82
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #3
  %84 = load ptr, ptr %4, align 8, !tbaa !5
  %85 = call noalias ptr @fopen(ptr noundef %84, ptr noundef @.str.3)
  store ptr %85, ptr %10, align 8, !tbaa !5
  br label %86

86:                                               ; preds = %83
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #3
  %87 = load ptr, ptr %10, align 8, !tbaa !5
  %88 = icmp eq ptr %87, null
  %89 = zext i1 %88 to i32
  store i32 %89, ptr %11, align 4, !tbaa !9
  %90 = load i32, ptr %11, align 4, !tbaa !9
  %91 = icmp ne i32 %90, 0
  br i1 %91, label %92, label %94

92:                                               ; preds = %86
  %93 = load i32, ptr %11, align 4, !tbaa !9
  call void (i32, i32, ptr, i32, ptr, ptr, ...) @m_Exception(i32 noundef %93, i32 noundef -1, ptr noundef @.str, i32 noundef 50, ptr noundef @__FUNCTION__.BMPGraySave, ptr noundef @.str.4)
  br label %94

94:                                               ; preds = %92, %86
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #3
  br label %95

95:                                               ; preds = %94
  br label %96

96:                                               ; preds = %95
  call void @llvm.lifetime.start.p0(i64 2, ptr %12) #3
  store i16 19778, ptr %12, align 2, !tbaa !15
  br label %97

97:                                               ; preds = %96
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #3
  %98 = load ptr, ptr %10, align 8, !tbaa !5
  %99 = call i64 @fwrite(ptr noundef %12, i64 noundef 1, i64 noundef 2, ptr noundef %98)
  %100 = trunc i64 %99 to i32
  %101 = icmp ne i32 %100, 2
  %102 = zext i1 %101 to i32
  store i32 %102, ptr %13, align 4, !tbaa !9
  %103 = load i32, ptr %13, align 4, !tbaa !9
  %104 = icmp ne i32 %103, 0
  br i1 %104, label %105, label %107

105:                                              ; preds = %97
  %106 = load i32, ptr %13, align 4, !tbaa !9
  call void (i32, i32, ptr, i32, ptr, ptr, ...) @m_Exception(i32 noundef %106, i32 noundef -1, ptr noundef @.str, i32 noundef 51, ptr noundef @__FUNCTION__.BMPGraySave, ptr noundef @.str.5)
  br label %107

107:                                              ; preds = %105, %97
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #3
  br label %108

108:                                              ; preds = %107
  br label %109

109:                                              ; preds = %108
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #3
  %110 = load ptr, ptr %3, align 8, !tbaa !5
  %111 = getelementptr inbounds %struct.MImage, ptr %110, i32 0, i32 2
  %112 = load i32, ptr %111, align 8, !tbaa !14
  store i32 %112, ptr %14, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #3
  %113 = load ptr, ptr %3, align 8, !tbaa !5
  %114 = getelementptr inbounds %struct.MImage, ptr %113, i32 0, i32 1
  %115 = load i32, ptr %114, align 4, !tbaa !13
  store i32 %115, ptr %15, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #3
  %116 = load i32, ptr %14, align 4, !tbaa !9
  %117 = sub nsw i32 %116, 1
  %118 = and i32 %117, -4
  %119 = add i32 %118, 4
  store i32 %119, ptr %16, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #3
  %120 = load i32, ptr %15, align 4, !tbaa !9
  %121 = load i32, ptr %16, align 4, !tbaa !9
  %122 = mul nsw i32 %120, %121
  store i32 %122, ptr %17, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 52, ptr %18) #3
  %123 = load i32, ptr %17, align 4, !tbaa !9
  %124 = add nsw i32 1078, %123
  %125 = getelementptr inbounds %struct.BMPHeader, ptr %18, i32 0, i32 0
  store i32 %124, ptr %125, align 4, !tbaa !17
  %126 = getelementptr inbounds %struct.BMPHeader, ptr %18, i32 0, i32 1
  store i32 0, ptr %126, align 4, !tbaa !19
  %127 = getelementptr inbounds %struct.BMPHeader, ptr %18, i32 0, i32 2
  store i32 1078, ptr %127, align 4, !tbaa !20
  %128 = getelementptr inbounds %struct.BMPHeader, ptr %18, i32 0, i32 3
  store i32 40, ptr %128, align 4, !tbaa !21
  %129 = load i32, ptr %14, align 4, !tbaa !9
  %130 = getelementptr inbounds %struct.BMPHeader, ptr %18, i32 0, i32 4
  store i32 %129, ptr %130, align 4, !tbaa !22
  %131 = load i32, ptr %15, align 4, !tbaa !9
  %132 = getelementptr inbounds %struct.BMPHeader, ptr %18, i32 0, i32 5
  store i32 %131, ptr %132, align 4, !tbaa !23
  %133 = getelementptr inbounds %struct.BMPHeader, ptr %18, i32 0, i32 6
  store i16 1, ptr %133, align 4, !tbaa !24
  %134 = getelementptr inbounds %struct.BMPHeader, ptr %18, i32 0, i32 7
  store i16 8, ptr %134, align 2, !tbaa !25
  %135 = getelementptr inbounds %struct.BMPHeader, ptr %18, i32 0, i32 8
  store i32 0, ptr %135, align 4, !tbaa !26
  %136 = load i32, ptr %17, align 4, !tbaa !9
  %137 = getelementptr inbounds %struct.BMPHeader, ptr %18, i32 0, i32 9
  store i32 %136, ptr %137, align 4, !tbaa !27
  %138 = getelementptr inbounds %struct.BMPHeader, ptr %18, i32 0, i32 10
  store i32 11811, ptr %138, align 4, !tbaa !28
  %139 = getelementptr inbounds %struct.BMPHeader, ptr %18, i32 0, i32 11
  store i32 11811, ptr %139, align 4, !tbaa !29
  %140 = getelementptr inbounds %struct.BMPHeader, ptr %18, i32 0, i32 12
  store i32 0, ptr %140, align 4, !tbaa !30
  %141 = getelementptr inbounds %struct.BMPHeader, ptr %18, i32 0, i32 13
  store i32 0, ptr %141, align 4, !tbaa !31
  br label %142

142:                                              ; preds = %109
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #3
  %143 = load ptr, ptr %10, align 8, !tbaa !5
  %144 = call i64 @fwrite(ptr noundef %18, i64 noundef 1, i64 noundef 52, ptr noundef %143)
  %145 = trunc i64 %144 to i32
  %146 = icmp ne i32 %145, 52
  %147 = zext i1 %146 to i32
  store i32 %147, ptr %19, align 4, !tbaa !9
  %148 = load i32, ptr %19, align 4, !tbaa !9
  %149 = icmp ne i32 %148, 0
  br i1 %149, label %150, label %152

150:                                              ; preds = %142
  %151 = load i32, ptr %19, align 4, !tbaa !9
  call void (i32, i32, ptr, i32, ptr, ptr, ...) @m_Exception(i32 noundef %151, i32 noundef -1, ptr noundef @.str, i32 noundef 74, ptr noundef @__FUNCTION__.BMPGraySave, ptr noundef @.str.5)
  br label %152

152:                                              ; preds = %150, %142
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #3
  br label %153

153:                                              ; preds = %152
  br label %154

154:                                              ; preds = %153
  call void @llvm.lifetime.start.p0(i64 1024, ptr %20) #3
  store i32 0, ptr %5, align 4, !tbaa !9
  br label %155

155:                                              ; preds = %181, %154
  %156 = load i32, ptr %5, align 4, !tbaa !9
  %157 = icmp slt i32 %156, 256
  br i1 %157, label %158, label %184

158:                                              ; preds = %155
  %159 = load i32, ptr %5, align 4, !tbaa !9
  %160 = trunc i32 %159 to i8
  %161 = load i32, ptr %5, align 4, !tbaa !9
  %162 = sext i32 %161 to i64
  %163 = getelementptr inbounds [256 x %struct.colorlist], ptr %20, i64 0, i64 %162
  %164 = getelementptr inbounds %struct.colorlist, ptr %163, i32 0, i32 0
  store i8 %160, ptr %164, align 4, !tbaa !32
  %165 = load i32, ptr %5, align 4, !tbaa !9
  %166 = trunc i32 %165 to i8
  %167 = load i32, ptr %5, align 4, !tbaa !9
  %168 = sext i32 %167 to i64
  %169 = getelementptr inbounds [256 x %struct.colorlist], ptr %20, i64 0, i64 %168
  %170 = getelementptr inbounds %struct.colorlist, ptr %169, i32 0, i32 1
  store i8 %166, ptr %170, align 1, !tbaa !34
  %171 = load i32, ptr %5, align 4, !tbaa !9
  %172 = trunc i32 %171 to i8
  %173 = load i32, ptr %5, align 4, !tbaa !9
  %174 = sext i32 %173 to i64
  %175 = getelementptr inbounds [256 x %struct.colorlist], ptr %20, i64 0, i64 %174
  %176 = getelementptr inbounds %struct.colorlist, ptr %175, i32 0, i32 2
  store i8 %172, ptr %176, align 2, !tbaa !35
  %177 = load i32, ptr %5, align 4, !tbaa !9
  %178 = sext i32 %177 to i64
  %179 = getelementptr inbounds [256 x %struct.colorlist], ptr %20, i64 0, i64 %178
  %180 = getelementptr inbounds %struct.colorlist, ptr %179, i32 0, i32 3
  store i8 0, ptr %180, align 1, !tbaa !36
  br label %181

181:                                              ; preds = %158
  %182 = load i32, ptr %5, align 4, !tbaa !9
  %183 = add nsw i32 %182, 1
  store i32 %183, ptr %5, align 4, !tbaa !9
  br label %155, !llvm.loop !37

184:                                              ; preds = %155
  br label %185

185:                                              ; preds = %184
  call void @llvm.lifetime.start.p0(i64 4, ptr %21) #3
  %186 = getelementptr inbounds [256 x %struct.colorlist], ptr %20, i64 0, i64 0
  %187 = load ptr, ptr %10, align 8, !tbaa !5
  %188 = call i64 @fwrite(ptr noundef %186, i64 noundef 1, i64 noundef 1024, ptr noundef %187)
  %189 = trunc i64 %188 to i32
  %190 = icmp ne i32 %189, 1024
  %191 = zext i1 %190 to i32
  store i32 %191, ptr %21, align 4, !tbaa !9
  %192 = load i32, ptr %21, align 4, !tbaa !9
  %193 = icmp ne i32 %192, 0
  br i1 %193, label %194, label %196

194:                                              ; preds = %185
  %195 = load i32, ptr %21, align 4, !tbaa !9
  call void (i32, i32, ptr, i32, ptr, ptr, ...) @m_Exception(i32 noundef %195, i32 noundef -1, ptr noundef @.str, i32 noundef 84, ptr noundef @__FUNCTION__.BMPGraySave, ptr noundef @.str.5)
  br label %196

196:                                              ; preds = %194, %185
  call void @llvm.lifetime.end.p0(i64 4, ptr %21) #3
  br label %197

197:                                              ; preds = %196
  br label %198

198:                                              ; preds = %197
  %199 = load i32, ptr %16, align 4, !tbaa !9
  %200 = load i32, ptr %14, align 4, !tbaa !9
  %201 = icmp eq i32 %199, %200
  br i1 %201, label %202, label %237

202:                                              ; preds = %198
  %203 = load i32, ptr %15, align 4, !tbaa !9
  %204 = sub nsw i32 %203, 1
  store i32 %204, ptr %5, align 4, !tbaa !9
  br label %205

205:                                              ; preds = %233, %202
  %206 = load i32, ptr %5, align 4, !tbaa !9
  %207 = icmp sge i32 %206, 0
  br i1 %207, label %208, label %236

208:                                              ; preds = %205
  br label %209

209:                                              ; preds = %208
  call void @llvm.lifetime.start.p0(i64 4, ptr %22) #3
  %210 = load ptr, ptr %3, align 8, !tbaa !5
  %211 = getelementptr inbounds %struct.MImage, ptr %210, i32 0, i32 3
  %212 = getelementptr inbounds [4 x ptr], ptr %211, i64 0, i64 0
  %213 = load ptr, ptr %212, align 8, !tbaa !5
  %214 = load i32, ptr %5, align 4, !tbaa !9
  %215 = sext i32 %214 to i64
  %216 = getelementptr inbounds ptr, ptr %213, i64 %215
  %217 = load ptr, ptr %216, align 8, !tbaa !5
  %218 = load i32, ptr %14, align 4, !tbaa !9
  %219 = sext i32 %218 to i64
  %220 = load ptr, ptr %10, align 8, !tbaa !5
  %221 = call i64 @fwrite(ptr noundef %217, i64 noundef 1, i64 noundef %219, ptr noundef %220)
  %222 = trunc i64 %221 to i32
  %223 = load i32, ptr %14, align 4, !tbaa !9
  %224 = icmp ne i32 %222, %223
  %225 = zext i1 %224 to i32
  store i32 %225, ptr %22, align 4, !tbaa !9
  %226 = load i32, ptr %22, align 4, !tbaa !9
  %227 = icmp ne i32 %226, 0
  br i1 %227, label %228, label %230

228:                                              ; preds = %209
  %229 = load i32, ptr %22, align 4, !tbaa !9
  call void (i32, i32, ptr, i32, ptr, ptr, ...) @m_Exception(i32 noundef %229, i32 noundef -1, ptr noundef @.str, i32 noundef 89, ptr noundef @__FUNCTION__.BMPGraySave, ptr noundef @.str.5)
  br label %230

230:                                              ; preds = %228, %209
  call void @llvm.lifetime.end.p0(i64 4, ptr %22) #3
  br label %231

231:                                              ; preds = %230
  br label %232

232:                                              ; preds = %231
  br label %233

233:                                              ; preds = %232
  %234 = load i32, ptr %5, align 4, !tbaa !9
  %235 = add nsw i32 %234, -1
  store i32 %235, ptr %5, align 4, !tbaa !9
  br label %205, !llvm.loop !39

236:                                              ; preds = %205
  br label %292

237:                                              ; preds = %198
  %238 = load i32, ptr %15, align 4, !tbaa !9
  %239 = sub nsw i32 %238, 1
  store i32 %239, ptr %5, align 4, !tbaa !9
  br label %240

240:                                              ; preds = %288, %237
  %241 = load i32, ptr %5, align 4, !tbaa !9
  %242 = icmp sge i32 %241, 0
  br i1 %242, label %243, label %291

243:                                              ; preds = %240
  br label %244

244:                                              ; preds = %243
  call void @llvm.lifetime.start.p0(i64 4, ptr %23) #3
  %245 = load ptr, ptr %3, align 8, !tbaa !5
  %246 = getelementptr inbounds %struct.MImage, ptr %245, i32 0, i32 3
  %247 = getelementptr inbounds [4 x ptr], ptr %246, i64 0, i64 0
  %248 = load ptr, ptr %247, align 8, !tbaa !5
  %249 = load i32, ptr %5, align 4, !tbaa !9
  %250 = sext i32 %249 to i64
  %251 = getelementptr inbounds ptr, ptr %248, i64 %250
  %252 = load ptr, ptr %251, align 8, !tbaa !5
  %253 = load i32, ptr %14, align 4, !tbaa !9
  %254 = sext i32 %253 to i64
  %255 = load ptr, ptr %10, align 8, !tbaa !5
  %256 = call i64 @fwrite(ptr noundef %252, i64 noundef 1, i64 noundef %254, ptr noundef %255)
  %257 = trunc i64 %256 to i32
  %258 = load i32, ptr %14, align 4, !tbaa !9
  %259 = icmp ne i32 %257, %258
  %260 = zext i1 %259 to i32
  store i32 %260, ptr %23, align 4, !tbaa !9
  %261 = load i32, ptr %23, align 4, !tbaa !9
  %262 = icmp ne i32 %261, 0
  br i1 %262, label %263, label %265

263:                                              ; preds = %244
  %264 = load i32, ptr %23, align 4, !tbaa !9
  call void (i32, i32, ptr, i32, ptr, ptr, ...) @m_Exception(i32 noundef %264, i32 noundef -1, ptr noundef @.str, i32 noundef 95, ptr noundef @__FUNCTION__.BMPGraySave, ptr noundef @.str.5)
  br label %265

265:                                              ; preds = %263, %244
  call void @llvm.lifetime.end.p0(i64 4, ptr %23) #3
  br label %266

266:                                              ; preds = %265
  br label %267

267:                                              ; preds = %266
  br label %268

268:                                              ; preds = %267
  call void @llvm.lifetime.start.p0(i64 4, ptr %24) #3
  %269 = load i32, ptr %16, align 4, !tbaa !9
  %270 = load i32, ptr %14, align 4, !tbaa !9
  %271 = sub nsw i32 %269, %270
  %272 = sext i32 %271 to i64
  %273 = load ptr, ptr %10, align 8, !tbaa !5
  %274 = call i64 @fwrite(ptr noundef %6, i64 noundef 1, i64 noundef %272, ptr noundef %273)
  %275 = trunc i64 %274 to i32
  %276 = load i32, ptr %16, align 4, !tbaa !9
  %277 = load i32, ptr %14, align 4, !tbaa !9
  %278 = sub nsw i32 %276, %277
  %279 = icmp ne i32 %275, %278
  %280 = zext i1 %279 to i32
  store i32 %280, ptr %24, align 4, !tbaa !9
  %281 = load i32, ptr %24, align 4, !tbaa !9
  %282 = icmp ne i32 %281, 0
  br i1 %282, label %283, label %285

283:                                              ; preds = %268
  %284 = load i32, ptr %24, align 4, !tbaa !9
  call void (i32, i32, ptr, i32, ptr, ptr, ...) @m_Exception(i32 noundef %284, i32 noundef -1, ptr noundef @.str, i32 noundef 96, ptr noundef @__FUNCTION__.BMPGraySave, ptr noundef @.str.5)
  br label %285

285:                                              ; preds = %283, %268
  call void @llvm.lifetime.end.p0(i64 4, ptr %24) #3
  br label %286

286:                                              ; preds = %285
  br label %287

287:                                              ; preds = %286
  br label %288

288:                                              ; preds = %287
  %289 = load i32, ptr %5, align 4, !tbaa !9
  %290 = add nsw i32 %289, -1
  store i32 %290, ptr %5, align 4, !tbaa !9
  br label %240, !llvm.loop !40

291:                                              ; preds = %240
  br label %292

292:                                              ; preds = %291, %236
  %293 = load ptr, ptr %10, align 8, !tbaa !5
  %294 = call i32 @fclose(ptr noundef %293)
  call void @llvm.lifetime.end.p0(i64 1024, ptr %20) #3
  call void @llvm.lifetime.end.p0(i64 52, ptr %18) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #3
  call void @llvm.lifetime.end.p0(i64 2, ptr %12) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #3
  ret void
}

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

declare void @m_Exception(i32 noundef, i32 noundef, ptr noundef, i32 noundef, ptr noundef, ptr noundef, ...) #2

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

declare ptr @m_PropertyRead(ptr noundef, ptr noundef, ptr noundef, ptr noundef) #2

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

declare i64 @fwrite(ptr noundef, i64 noundef, i64 noundef, ptr noundef) #2

declare i32 @fclose(ptr noundef) #2

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 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { 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, !10, i64 0}
!12 = !{!"MImage", !10, i64 0, !10, i64 4, !10, i64 8, !7, i64 16, !6, i64 48}
!13 = !{!12, !10, i64 4}
!14 = !{!12, !10, i64 8}
!15 = !{!16, !16, i64 0}
!16 = !{!"short", !7, i64 0}
!17 = !{!18, !10, i64 0}
!18 = !{!"BMPHeader", !10, i64 0, !10, i64 4, !10, i64 8, !10, i64 12, !10, i64 16, !10, i64 20, !16, i64 24, !16, i64 26, !10, i64 28, !10, i64 32, !10, i64 36, !10, i64 40, !10, i64 44, !10, i64 48}
!19 = !{!18, !10, i64 4}
!20 = !{!18, !10, i64 8}
!21 = !{!18, !10, i64 12}
!22 = !{!18, !10, i64 16}
!23 = !{!18, !10, i64 20}
!24 = !{!18, !16, i64 24}
!25 = !{!18, !16, i64 26}
!26 = !{!18, !10, i64 28}
!27 = !{!18, !10, i64 32}
!28 = !{!18, !10, i64 36}
!29 = !{!18, !10, i64 40}
!30 = !{!18, !10, i64 44}
!31 = !{!18, !10, i64 48}
!32 = !{!33, !7, i64 0}
!33 = !{!"colorlist", !7, i64 0, !7, i64 1, !7, i64 2, !7, i64 3}
!34 = !{!33, !7, i64 1}
!35 = !{!33, !7, i64 2}
!36 = !{!33, !7, i64 3}
!37 = distinct !{!37, !38}
!38 = !{!"llvm.loop.mustprogress"}
!39 = distinct !{!39, !38}
!40 = distinct !{!40, !38}


; 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.BMPHeader = type { i32, i32, i32, i32, i32, i32, i16, i16, i32, i32, i32, i32, i32, i32 }
%struct.colorlist = type { i8, i8, i8, i8 }

@.str = external hidden unnamed_addr constant [83 x i8], align 1
@__FUNCTION__.BMPGraySave = external hidden unnamed_addr constant [12 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [13 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [11 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [17 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [17 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local void @BMPGraySave(ptr noundef %0, ptr nocapture noundef readonly %1) local_unnamed_addr #0 {
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca i16, align 2
  %6 = alloca %struct.BMPHeader, align 4
  %7 = alloca [256 x %struct.colorlist], align 16
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #4
  store i32 0, ptr %3, align 4, !tbaa !5
  %magicptr = ptrtoint ptr %0 to i64
  switch i64 %magicptr, label %8 [
    i64 -1, label %.critedge
    i64 0, label %.critedge
  ]

8:                                                ; preds = %2
  %9 = getelementptr inbounds i8, ptr %0, i64 16
  %10 = icmp eq ptr %9, inttoptr (i64 -1 to ptr)
  br i1 %10, label %.critedge, label %11

11:                                               ; preds = %8
  %12 = load i32, ptr %0, align 8, !tbaa !9
  %13 = icmp slt i32 %12, 1
  br i1 %13, label %.critedge, label %14

14:                                               ; preds = %11
  %15 = getelementptr inbounds i8, ptr %0, i64 4
  %16 = load i32, ptr %15, align 4, !tbaa !12
  %17 = icmp slt i32 %16, 1
  br i1 %17, label %.critedge, label %18

18:                                               ; preds = %14
  %19 = getelementptr inbounds i8, ptr %0, i64 8
  %20 = load i32, ptr %19, align 8, !tbaa !13
  %21 = icmp sgt i32 %20, 0
  br i1 %21, label %22, label %.critedge

.critedge:                                        ; preds = %2, %2, %14, %11, %8, %18
  tail call void (i32, i32, ptr, i32, ptr, ptr, ...) @m_Exception(i32 noundef 1, i32 noundef -1, ptr noundef nonnull @.str, i32 noundef 44, ptr noundef nonnull @__FUNCTION__.BMPGraySave, ptr noundef nonnull @.str.1) #4
  br label %22

22:                                               ; preds = %.critedge, %18
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %4) #4
  store i32 -1, ptr %4, align 4, !tbaa !5
  %23 = call ptr @m_PropertyRead(ptr noundef %0, ptr noundef nonnull @.str.2, ptr noundef nonnull %4, ptr noundef null) #4
  %24 = load i32, ptr %4, align 4, !tbaa !5
  %.not = icmp eq i32 %24, 1
  br i1 %.not, label %26, label %25

25:                                               ; preds = %22
  call void (i32, i32, ptr, i32, ptr, ptr, ...) @m_Exception(i32 noundef 1, i32 noundef -1, ptr noundef nonnull @.str, i32 noundef 46, ptr noundef nonnull @__FUNCTION__.BMPGraySave, ptr noundef nonnull @.str.1) #4
  br label %26

26:                                               ; preds = %25, %22
  %27 = call noalias ptr @fopen(ptr noundef %1, ptr noundef nonnull @.str.3)
  %28 = icmp eq ptr %27, null
  br i1 %28, label %29, label %30

29:                                               ; preds = %26
  call void (i32, i32, ptr, i32, ptr, ptr, ...) @m_Exception(i32 noundef 1, i32 noundef -1, ptr noundef nonnull @.str, i32 noundef 50, ptr noundef nonnull @__FUNCTION__.BMPGraySave, ptr noundef nonnull @.str.4) #4
  br label %30

30:                                               ; preds = %29, %26
  call void @llvm.lifetime.start.p0(i64 2, ptr nonnull %5) #4
  store i16 19778, ptr %5, align 2, !tbaa !14
  %31 = call i64 @fwrite(ptr noundef nonnull %5, i64 noundef 1, i64 noundef 2, ptr noundef %27)
  %32 = and i64 %31, 4294967295
  %.not84 = icmp eq i64 %32, 2
  br i1 %.not84, label %34, label %33

33:                                               ; preds = %30
  call void (i32, i32, ptr, i32, ptr, ptr, ...) @m_Exception(i32 noundef 1, i32 noundef -1, ptr noundef nonnull @.str, i32 noundef 51, ptr noundef nonnull @__FUNCTION__.BMPGraySave, ptr noundef nonnull @.str.5) #4
  br label %34

34:                                               ; preds = %33, %30
  %35 = getelementptr inbounds i8, ptr %0, i64 8
  %36 = load i32, ptr %35, align 8, !tbaa !13
  %37 = getelementptr inbounds i8, ptr %0, i64 4
  %38 = load i32, ptr %37, align 4, !tbaa !12
  %39 = add nsw i32 %36, -1
  %40 = and i32 %39, -4
  %41 = add i32 %40, 4
  %42 = mul nsw i32 %41, %38
  call void @llvm.lifetime.start.p0(i64 52, ptr nonnull %6) #4
  %43 = add nsw i32 %42, 1078
  store i32 %43, ptr %6, align 4, !tbaa !16
  %44 = getelementptr inbounds i8, ptr %6, i64 4
  store i32 0, ptr %44, align 4, !tbaa !18
  %45 = getelementptr inbounds i8, ptr %6, i64 8
  store i32 1078, ptr %45, align 4, !tbaa !19
  %46 = getelementptr inbounds i8, ptr %6, i64 12
  store i32 40, ptr %46, align 4, !tbaa !20
  %47 = getelementptr inbounds i8, ptr %6, i64 16
  store i32 %36, ptr %47, align 4, !tbaa !21
  %48 = getelementptr inbounds i8, ptr %6, i64 20
  store i32 %38, ptr %48, align 4, !tbaa !22
  %49 = getelementptr inbounds i8, ptr %6, i64 24
  store i16 1, ptr %49, align 4, !tbaa !23
  %50 = getelementptr inbounds i8, ptr %6, i64 26
  store i16 8, ptr %50, align 2, !tbaa !24
  %51 = getelementptr inbounds i8, ptr %6, i64 28
  store i32 0, ptr %51, align 4, !tbaa !25
  %52 = getelementptr inbounds i8, ptr %6, i64 32
  store i32 %42, ptr %52, align 4, !tbaa !26
  %53 = getelementptr inbounds i8, ptr %6, i64 36
  store <4 x i32> <i32 11811, i32 11811, i32 0, i32 0>, ptr %53, align 4, !tbaa !5
  %54 = call i64 @fwrite(ptr noundef nonnull %6, i64 noundef 1, i64 noundef 52, ptr noundef %27)
  %55 = and i64 %54, 4294967295
  %.not85 = icmp eq i64 %55, 52
  br i1 %.not85, label %57, label %56

56:                                               ; preds = %34
  call void (i32, i32, ptr, i32, ptr, ptr, ...) @m_Exception(i32 noundef 1, i32 noundef -1, ptr noundef nonnull @.str, i32 noundef 74, ptr noundef nonnull @__FUNCTION__.BMPGraySave, ptr noundef nonnull @.str.5) #4
  br label %57

57:                                               ; preds = %56, %34
  call void @llvm.lifetime.start.p0(i64 1024, ptr nonnull %7) #4
  br label %58

58:                                               ; preds = %58, %57
  %indvars.iv = phi i64 [ 0, %57 ], [ %indvars.iv.next.3, %58 ]
  %59 = trunc i64 %indvars.iv to i8
  %60 = getelementptr inbounds [256 x %struct.colorlist], ptr %7, i64 0, i64 %indvars.iv
  store i8 %59, ptr %60, align 16, !tbaa !27
  %61 = getelementptr inbounds i8, ptr %60, i64 1
  store i8 %59, ptr %61, align 1, !tbaa !29
  %62 = getelementptr inbounds i8, ptr %60, i64 2
  store i8 %59, ptr %62, align 2, !tbaa !30
  %63 = getelementptr inbounds i8, ptr %60, i64 3
  store i8 0, ptr %63, align 1, !tbaa !31
  %indvars.iv.next = or disjoint i64 %indvars.iv, 1
  %64 = trunc i64 %indvars.iv.next to i8
  %65 = getelementptr inbounds [256 x %struct.colorlist], ptr %7, i64 0, i64 %indvars.iv.next
  store i8 %64, ptr %65, align 4, !tbaa !27
  %66 = getelementptr inbounds i8, ptr %65, i64 1
  store i8 %64, ptr %66, align 1, !tbaa !29
  %67 = getelementptr inbounds i8, ptr %65, i64 2
  store i8 %64, ptr %67, align 2, !tbaa !30
  %68 = getelementptr inbounds i8, ptr %65, i64 3
  store i8 0, ptr %68, align 1, !tbaa !31
  %indvars.iv.next.1 = or disjoint i64 %indvars.iv, 2
  %69 = trunc i64 %indvars.iv.next.1 to i8
  %70 = getelementptr inbounds [256 x %struct.colorlist], ptr %7, i64 0, i64 %indvars.iv.next.1
  store i8 %69, ptr %70, align 8, !tbaa !27
  %71 = getelementptr inbounds i8, ptr %70, i64 1
  store i8 %69, ptr %71, align 1, !tbaa !29
  %72 = getelementptr inbounds i8, ptr %70, i64 2
  store i8 %69, ptr %72, align 2, !tbaa !30
  %73 = getelementptr inbounds i8, ptr %70, i64 3
  store i8 0, ptr %73, align 1, !tbaa !31
  %indvars.iv.next.2 = or disjoint i64 %indvars.iv, 3
  %74 = trunc i64 %indvars.iv.next.2 to i8
  %75 = getelementptr inbounds [256 x %struct.colorlist], ptr %7, i64 0, i64 %indvars.iv.next.2
  store i8 %74, ptr %75, align 4, !tbaa !27
  %76 = getelementptr inbounds i8, ptr %75, i64 1
  store i8 %74, ptr %76, align 1, !tbaa !29
  %77 = getelementptr inbounds i8, ptr %75, i64 2
  store i8 %74, ptr %77, align 2, !tbaa !30
  %78 = getelementptr inbounds i8, ptr %75, i64 3
  store i8 0, ptr %78, align 1, !tbaa !31
  %indvars.iv.next.3 = add nuw nsw i64 %indvars.iv, 4
  %exitcond.not.3 = icmp eq i64 %indvars.iv.next.3, 256
  br i1 %exitcond.not.3, label %79, label %58, !llvm.loop !32

79:                                               ; preds = %58
  %80 = call i64 @fwrite(ptr noundef nonnull %7, i64 noundef 1, i64 noundef 1024, ptr noundef %27)
  %81 = and i64 %80, 4294967295
  %.not86 = icmp eq i64 %81, 1024
  br i1 %.not86, label %83, label %82

82:                                               ; preds = %79
  call void (i32, i32, ptr, i32, ptr, ptr, ...) @m_Exception(i32 noundef 1, i32 noundef -1, ptr noundef nonnull @.str, i32 noundef 84, ptr noundef nonnull @__FUNCTION__.BMPGraySave, ptr noundef nonnull @.str.5) #4
  br label %83

83:                                               ; preds = %82, %79
  %84 = icmp eq i32 %41, %36
  %85 = icmp sgt i32 %38, 0
  br i1 %84, label %.preheader, label %.preheader90

.preheader90:                                     ; preds = %83
  br i1 %85, label %.lr.ph, label %.loopexit

.lr.ph:                                           ; preds = %.preheader90
  %86 = getelementptr inbounds i8, ptr %0, i64 16
  %87 = sext i32 %36 to i64
  %88 = sub nsw i32 %41, %36
  %89 = sext i32 %88 to i64
  %90 = zext nneg i32 %38 to i64
  br label %103

.preheader:                                       ; preds = %83
  br i1 %85, label %.lr.ph97, label %.loopexit

.lr.ph97:                                         ; preds = %.preheader
  %91 = getelementptr inbounds i8, ptr %0, i64 16
  %92 = sext i32 %36 to i64
  %93 = zext nneg i32 %38 to i64
  br label %94

94:                                               ; preds = %.lr.ph97, %101
  %indvars.iv103 = phi i64 [ %93, %.lr.ph97 ], [ %indvars.iv.next104, %101 ]
  %indvars.iv.next104 = add nsw i64 %indvars.iv103, -1
  %95 = load ptr, ptr %91, align 8, !tbaa !34
  %96 = getelementptr inbounds ptr, ptr %95, i64 %indvars.iv.next104
  %97 = load ptr, ptr %96, align 8, !tbaa !34
  %98 = call i64 @fwrite(ptr noundef %97, i64 noundef 1, i64 noundef %92, ptr noundef %27)
  %99 = trunc i64 %98 to i32
  %.not89 = icmp eq i32 %36, %99
  br i1 %.not89, label %101, label %100

100:                                              ; preds = %94
  call void (i32, i32, ptr, i32, ptr, ptr, ...) @m_Exception(i32 noundef 1, i32 noundef -1, ptr noundef nonnull @.str, i32 noundef 89, ptr noundef nonnull @__FUNCTION__.BMPGraySave, ptr noundef nonnull @.str.5) #4
  br label %101

101:                                              ; preds = %100, %94
  %102 = icmp ugt i64 %indvars.iv103, 1
  br i1 %102, label %94, label %.loopexit, !llvm.loop !35

103:                                              ; preds = %.lr.ph, %114
  %indvars.iv100 = phi i64 [ %90, %.lr.ph ], [ %indvars.iv.next101, %114 ]
  %indvars.iv.next101 = add nsw i64 %indvars.iv100, -1
  %104 = load ptr, ptr %86, align 8, !tbaa !34
  %105 = getelementptr inbounds ptr, ptr %104, i64 %indvars.iv.next101
  %106 = load ptr, ptr %105, align 8, !tbaa !34
  %107 = call i64 @fwrite(ptr noundef %106, i64 noundef 1, i64 noundef %87, ptr noundef %27)
  %108 = trunc i64 %107 to i32
  %.not87 = icmp eq i32 %36, %108
  br i1 %.not87, label %110, label %109

109:                                              ; preds = %103
  call void (i32, i32, ptr, i32, ptr, ptr, ...) @m_Exception(i32 noundef 1, i32 noundef -1, ptr noundef nonnull @.str, i32 noundef 95, ptr noundef nonnull @__FUNCTION__.BMPGraySave, ptr noundef nonnull @.str.5) #4
  br label %110

110:                                              ; preds = %109, %103
  %111 = call i64 @fwrite(ptr noundef nonnull %3, i64 noundef 1, i64 noundef %89, ptr noundef %27)
  %112 = trunc i64 %111 to i32
  %.not88 = icmp eq i32 %88, %112
  br i1 %.not88, label %114, label %113

113:                                              ; preds = %110
  call void (i32, i32, ptr, i32, ptr, ptr, ...) @m_Exception(i32 noundef 1, i32 noundef -1, ptr noundef nonnull @.str, i32 noundef 96, ptr noundef nonnull @__FUNCTION__.BMPGraySave, ptr noundef nonnull @.str.5) #4
  br label %114

114:                                              ; preds = %113, %110
  %115 = icmp ugt i64 %indvars.iv100, 1
  br i1 %115, label %103, label %.loopexit, !llvm.loop !36

.loopexit:                                        ; preds = %114, %101, %.preheader90, %.preheader
  %116 = call i32 @fclose(ptr noundef %27)
  call void @llvm.lifetime.end.p0(i64 1024, ptr nonnull %7) #4
  call void @llvm.lifetime.end.p0(i64 52, ptr nonnull %6) #4
  call void @llvm.lifetime.end.p0(i64 2, ptr nonnull %5) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #4
  ret void
}

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

declare void @m_Exception(i32 noundef, i32 noundef, ptr noundef, i32 noundef, ptr noundef, ptr noundef, ...) local_unnamed_addr #2

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

declare ptr @m_PropertyRead(ptr noundef, ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #2

; 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 @fwrite(ptr nocapture noundef, i64 noundef, i64 noundef, ptr nocapture noundef) local_unnamed_addr #3

; Function Attrs: nofree nounwind
declare noundef i32 @fclose(ptr nocapture noundef) local_unnamed_addr #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 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { 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 = { 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 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !6, i64 0}
!10 = !{!"MImage", !6, i64 0, !6, i64 4, !6, i64 8, !7, i64 16, !11, i64 48}
!11 = !{!"any pointer", !7, i64 0}
!12 = !{!10, !6, i64 4}
!13 = !{!10, !6, i64 8}
!14 = !{!15, !15, i64 0}
!15 = !{!"short", !7, i64 0}
!16 = !{!17, !6, i64 0}
!17 = !{!"BMPHeader", !6, i64 0, !6, i64 4, !6, i64 8, !6, i64 12, !6, i64 16, !6, i64 20, !15, i64 24, !15, i64 26, !6, i64 28, !6, i64 32, !6, i64 36, !6, i64 40, !6, i64 44, !6, i64 48}
!18 = !{!17, !6, i64 4}
!19 = !{!17, !6, i64 8}
!20 = !{!17, !6, i64 12}
!21 = !{!17, !6, i64 16}
!22 = !{!17, !6, i64 20}
!23 = !{!17, !15, i64 24}
!24 = !{!17, !15, i64 26}
!25 = !{!17, !6, i64 28}
!26 = !{!17, !6, i64 32}
!27 = !{!28, !7, i64 0}
!28 = !{!"colorlist", !7, i64 0, !7, i64 1, !7, i64 2, !7, i64 3}
!29 = !{!28, !7, i64 1}
!30 = !{!28, !7, i64 2}
!31 = !{!28, !7, i64 3}
!32 = distinct !{!32, !33}
!33 = !{!"llvm.loop.mustprogress"}
!34 = !{!11, !11, i64 0}
!35 = distinct !{!35, !33}
!36 = distinct !{!36, !33}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferAlignmentPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LICMPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,PostOrderFunctionAttrsPass,ReassociatePass,SLPVectorizerPass,SROAPass,SimplifyCFGPass,TailCallElimPass