; LLVM IR from EyalAr/lwip :: src/lib/png (pngrutil)

; 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.png_struct_def = type { [1 x %struct.__jmp_buf_tag], ptr, ptr, i64, ptr, ptr, ptr, ptr, ptr, ptr, ptr, i8, i8, i32, i32, i32, i32, %struct.z_stream_s, i32, i32, i32, i32, i64, i32, i32, i32, ptr, ptr, i64, i32, i32, ptr, i16, i32, i16, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i16, i8, i32, %struct.png_color_16_struct, %struct.png_color_16_struct, i32, i32, ptr, ptr, ptr, ptr, ptr, ptr, %struct.png_color_8_struct, %struct.png_color_8_struct, ptr, %struct.png_color_16_struct, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, i32, i32, i64, i64, i64, i64, i32, i32, ptr, ptr, i8, [29 x i8], i32, ptr, ptr, i32, i32, ptr, i8, i8, i16, i16, i32, i8, ptr, ptr, ptr, ptr, ptr, ptr, ptr, i8, i32, i32, i32, i64, %struct.png_unknown_chunk_t, i64, ptr, i64, i32, i32, ptr, [4 x ptr], %struct.png_colorspace }
%struct.__jmp_buf_tag = type { [8 x i64], i32, %struct.__sigset_t }
%struct.__sigset_t = type { [16 x i64] }
%struct.z_stream_s = type { ptr, i32, i64, ptr, i32, i64, ptr, ptr, ptr, ptr, ptr, i32, i64, i64 }
%struct.png_color_8_struct = type { i8, i8, i8, i8, i8 }
%struct.png_color_16_struct = type { i8, i16, i16, i16, i16 }
%struct.png_unknown_chunk_t = type { [5 x i8], ptr, i64, i8 }
%struct.png_colorspace = type { i32, %struct.png_xy, %struct.png_XYZ, i16, i16 }
%struct.png_xy = type { i32, i32, i32, i32, i32, i32, i32, i32 }
%struct.png_XYZ = type { i32, i32, i32, i32, i32, i32, i32, i32, i32 }
%struct.png_info_def = type { i32, i32, i32, i64, ptr, i16, i16, i8, i8, i8, i8, i8, i8, i8, i8, [8 x i8], %struct.png_colorspace, ptr, ptr, i32, i32, i32, ptr, %struct.png_time_struct, %struct.png_color_8_struct, ptr, %struct.png_color_16_struct, %struct.png_color_16_struct, i32, i32, i8, i32, i32, i8, ptr, ptr, i32, i32, ptr, ptr, i8, i8, i32, ptr, i32, ptr, i32, i8, ptr, ptr, ptr }
%struct.png_time_struct = type { i16, i8, i8, i8, i8, i8 }

@.str.4 = external hidden unnamed_addr constant [13 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [8 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [13 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [10 x i8], align 1
@.str.16 = external hidden unnamed_addr constant [14 x i8], align 1
@.str.22 = external hidden unnamed_addr constant [24 x i8], align 1
@.str.23 = external hidden unnamed_addr constant [27 x i8], align 1
@.str.24 = external hidden unnamed_addr constant [13 x i8], align 1

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

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

; Function Attrs: nounwind uwtable
declare dso_local void @png_crc_read(ptr noalias noundef, ptr noundef, i32 noundef) #1

; Function Attrs: nounwind uwtable
declare dso_local i32 @png_crc_finish(ptr noalias noundef, i32 noundef) #1

; Function Attrs: noreturn
declare void @png_chunk_error(ptr noundef, ptr noundef) #2

declare void @png_chunk_benign_error(ptr noundef, ptr noundef) #3

; Function Attrs: nounwind uwtable
declare hidden ptr @png_read_buffer(ptr noalias noundef, i64 noundef, i32 noundef) #1

declare noalias ptr @png_malloc_warn(ptr noundef, i64 noundef) #3

declare void @png_free(ptr noundef, ptr noundef) #3

; Function Attrs: nounwind uwtable
define dso_local void @png_handle_pCAL(ptr noalias noundef %0, ptr noalias noundef %1, i32 noundef %2) #1 {
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca i8, align 1
  %10 = alloca i8, align 1
  %11 = alloca ptr, align 8
  %12 = alloca ptr, align 8
  %13 = alloca ptr, align 8
  %14 = alloca ptr, align 8
  %15 = alloca ptr, align 8
  %16 = alloca i32, align 4
  %17 = alloca i32, align 4
  store ptr %0, ptr %4, align 8, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !5
  store i32 %2, ptr %6, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #4
  call void @llvm.lifetime.start.p0(i64 1, ptr %9) #4
  call void @llvm.lifetime.start.p0(i64 1, ptr %10) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #4
  %18 = load ptr, ptr %4, align 8, !tbaa !5
  %19 = getelementptr inbounds %struct.png_struct_def, ptr %18, i32 0, i32 13
  %20 = load i32, ptr %19, align 4, !tbaa !11
  %21 = and i32 %20, 1
  %22 = icmp eq i32 %21, 0
  br i1 %22, label %23, label %25

23:                                               ; preds = %3
  %24 = load ptr, ptr %4, align 8, !tbaa !5
  call void @png_chunk_error(ptr noundef %24, ptr noundef @.str.6) #5
  unreachable

25:                                               ; preds = %3
  %26 = load ptr, ptr %4, align 8, !tbaa !5
  %27 = getelementptr inbounds %struct.png_struct_def, ptr %26, i32 0, i32 13
  %28 = load i32, ptr %27, align 4, !tbaa !11
  %29 = and i32 %28, 4
  %30 = icmp ne i32 %29, 0
  br i1 %30, label %31, label %36

31:                                               ; preds = %25
  %32 = load ptr, ptr %4, align 8, !tbaa !5
  %33 = load i32, ptr %6, align 4, !tbaa !9
  %34 = call i32 @png_crc_finish(ptr noundef %32, i32 noundef %33)
  %35 = load ptr, ptr %4, align 8, !tbaa !5
  call void @png_chunk_benign_error(ptr noundef %35, ptr noundef @.str.4)
  store i32 1, ptr %17, align 4
  br label %352

36:                                               ; preds = %25
  %37 = load ptr, ptr %5, align 8, !tbaa !5
  %38 = icmp ne ptr %37, null
  br i1 %38, label %39, label %50

39:                                               ; preds = %36
  %40 = load ptr, ptr %5, align 8, !tbaa !5
  %41 = getelementptr inbounds %struct.png_info_def, ptr %40, i32 0, i32 2
  %42 = load i32, ptr %41, align 8, !tbaa !22
  %43 = and i32 %42, 1024
  %44 = icmp ne i32 %43, 0
  br i1 %44, label %45, label %50

45:                                               ; preds = %39
  %46 = load ptr, ptr %4, align 8, !tbaa !5
  %47 = load i32, ptr %6, align 4, !tbaa !9
  %48 = call i32 @png_crc_finish(ptr noundef %46, i32 noundef %47)
  %49 = load ptr, ptr %4, align 8, !tbaa !5
  call void @png_chunk_benign_error(ptr noundef %49, ptr noundef @.str.7)
  store i32 1, ptr %17, align 4
  br label %352

50:                                               ; preds = %39, %36
  br label %51

51:                                               ; preds = %50
  br label %52

52:                                               ; preds = %51
  %53 = load ptr, ptr %4, align 8, !tbaa !5
  %54 = load i32, ptr %6, align 4, !tbaa !9
  %55 = add i32 %54, 1
  %56 = zext i32 %55 to i64
  %57 = call ptr @png_read_buffer(ptr noundef %53, i64 noundef %56, i32 noundef 2)
  store ptr %57, ptr %11, align 8, !tbaa !5
  %58 = load ptr, ptr %11, align 8, !tbaa !5
  %59 = icmp eq ptr %58, null
  br i1 %59, label %60, label %65

60:                                               ; preds = %52
  %61 = load ptr, ptr %4, align 8, !tbaa !5
  %62 = load i32, ptr %6, align 4, !tbaa !9
  %63 = call i32 @png_crc_finish(ptr noundef %61, i32 noundef %62)
  %64 = load ptr, ptr %4, align 8, !tbaa !5
  call void @png_chunk_benign_error(ptr noundef %64, ptr noundef @.str.16)
  store i32 1, ptr %17, align 4
  br label %352

65:                                               ; preds = %52
  %66 = load ptr, ptr %4, align 8, !tbaa !5
  %67 = load ptr, ptr %11, align 8, !tbaa !5
  %68 = load i32, ptr %6, align 4, !tbaa !9
  call void @png_crc_read(ptr noundef %66, ptr noundef %67, i32 noundef %68)
  %69 = load ptr, ptr %4, align 8, !tbaa !5
  %70 = call i32 @png_crc_finish(ptr noundef %69, i32 noundef 0)
  %71 = icmp ne i32 %70, 0
  br i1 %71, label %72, label %73

72:                                               ; preds = %65
  store i32 1, ptr %17, align 4
  br label %352

73:                                               ; preds = %65
  %74 = load ptr, ptr %11, align 8, !tbaa !5
  %75 = load i32, ptr %6, align 4, !tbaa !9
  %76 = zext i32 %75 to i64
  %77 = getelementptr inbounds i8, ptr %74, i64 %76
  store i8 0, ptr %77, align 1, !tbaa !25
  %78 = load ptr, ptr %11, align 8, !tbaa !5
  store ptr %78, ptr %12, align 8, !tbaa !5
  br label %79

79:                                               ; preds = %84, %73
  %80 = load ptr, ptr %12, align 8, !tbaa !5
  %81 = load i8, ptr %80, align 1, !tbaa !25
  %82 = icmp ne i8 %81, 0
  br i1 %82, label %83, label %87

83:                                               ; preds = %79
  br label %84

84:                                               ; preds = %83
  %85 = load ptr, ptr %12, align 8, !tbaa !5
  %86 = getelementptr inbounds i8, ptr %85, i32 1
  store ptr %86, ptr %12, align 8, !tbaa !5
  br label %79, !llvm.loop !26

87:                                               ; preds = %79
  %88 = load ptr, ptr %11, align 8, !tbaa !5
  %89 = load i32, ptr %6, align 4, !tbaa !9
  %90 = zext i32 %89 to i64
  %91 = getelementptr inbounds i8, ptr %88, i64 %90
  store ptr %91, ptr %14, align 8, !tbaa !5
  %92 = load ptr, ptr %14, align 8, !tbaa !5
  %93 = load ptr, ptr %12, align 8, !tbaa !5
  %94 = getelementptr inbounds i8, ptr %93, i64 12
  %95 = icmp ule ptr %92, %94
  br i1 %95, label %96, label %98

96:                                               ; preds = %87
  %97 = load ptr, ptr %4, align 8, !tbaa !5
  call void @png_chunk_benign_error(ptr noundef %97, ptr noundef @.str.5)
  store i32 1, ptr %17, align 4
  br label %352

98:                                               ; preds = %87
  %99 = load ptr, ptr %12, align 8, !tbaa !5
  %100 = getelementptr inbounds i8, ptr %99, i64 1
  %101 = load i8, ptr %100, align 1, !tbaa !25
  %102 = zext i8 %101 to i32
  %103 = and i32 %102, 128
  %104 = icmp ne i32 %103, 0
  br i1 %104, label %105, label %136

105:                                              ; preds = %98
  %106 = load ptr, ptr %12, align 8, !tbaa !5
  %107 = getelementptr inbounds i8, ptr %106, i64 1
  %108 = load i8, ptr %107, align 1, !tbaa !25
  %109 = zext i8 %108 to i32
  %110 = shl i32 %109, 24
  %111 = load ptr, ptr %12, align 8, !tbaa !5
  %112 = getelementptr inbounds i8, ptr %111, i64 1
  %113 = getelementptr inbounds i8, ptr %112, i64 1
  %114 = load i8, ptr %113, align 1, !tbaa !25
  %115 = zext i8 %114 to i32
  %116 = shl i32 %115, 16
  %117 = add i32 %110, %116
  %118 = load ptr, ptr %12, align 8, !tbaa !5
  %119 = getelementptr inbounds i8, ptr %118, i64 1
  %120 = getelementptr inbounds i8, ptr %119, i64 2
  %121 = load i8, ptr %120, align 1, !tbaa !25
  %122 = zext i8 %121 to i32
  %123 = shl i32 %122, 8
  %124 = add i32 %117, %123
  %125 = load ptr, ptr %12, align 8, !tbaa !5
  %126 = getelementptr inbounds i8, ptr %125, i64 1
  %127 = getelementptr inbounds i8, ptr %126, i64 3
  %128 = load i8, ptr %127, align 1, !tbaa !25
  %129 = zext i8 %128 to i32
  %130 = add i32 %124, %129
  %131 = zext i32 %130 to i64
  %132 = xor i64 %131, 4294967295
  %133 = add nsw i64 %132, 1
  %134 = trunc i64 %133 to i32
  %135 = sub nsw i32 0, %134
  br label %162

136:                                              ; preds = %98
  %137 = load ptr, ptr %12, align 8, !tbaa !5
  %138 = getelementptr inbounds i8, ptr %137, i64 1
  %139 = load i8, ptr %138, align 1, !tbaa !25
  %140 = zext i8 %139 to i32
  %141 = shl i32 %140, 24
  %142 = load ptr, ptr %12, align 8, !tbaa !5
  %143 = getelementptr inbounds i8, ptr %142, i64 1
  %144 = getelementptr inbounds i8, ptr %143, i64 1
  %145 = load i8, ptr %144, align 1, !tbaa !25
  %146 = zext i8 %145 to i32
  %147 = shl i32 %146, 16
  %148 = add i32 %141, %147
  %149 = load ptr, ptr %12, align 8, !tbaa !5
  %150 = getelementptr inbounds i8, ptr %149, i64 1
  %151 = getelementptr inbounds i8, ptr %150, i64 2
  %152 = load i8, ptr %151, align 1, !tbaa !25
  %153 = zext i8 %152 to i32
  %154 = shl i32 %153, 8
  %155 = add i32 %148, %154
  %156 = load ptr, ptr %12, align 8, !tbaa !5
  %157 = getelementptr inbounds i8, ptr %156, i64 1
  %158 = getelementptr inbounds i8, ptr %157, i64 3
  %159 = load i8, ptr %158, align 1, !tbaa !25
  %160 = zext i8 %159 to i32
  %161 = add i32 %155, %160
  br label %162

162:                                              ; preds = %136, %105
  %163 = phi i32 [ %135, %105 ], [ %161, %136 ]
  store i32 %163, ptr %7, align 4, !tbaa !9
  %164 = load ptr, ptr %12, align 8, !tbaa !5
  %165 = getelementptr inbounds i8, ptr %164, i64 5
  %166 = load i8, ptr %165, align 1, !tbaa !25
  %167 = zext i8 %166 to i32
  %168 = and i32 %167, 128
  %169 = icmp ne i32 %168, 0
  br i1 %169, label %170, label %201

170:                                              ; preds = %162
  %171 = load ptr, ptr %12, align 8, !tbaa !5
  %172 = getelementptr inbounds i8, ptr %171, i64 5
  %173 = load i8, ptr %172, align 1, !tbaa !25
  %174 = zext i8 %173 to i32
  %175 = shl i32 %174, 24
  %176 = load ptr, ptr %12, align 8, !tbaa !5
  %177 = getelementptr inbounds i8, ptr %176, i64 5
  %178 = getelementptr inbounds i8, ptr %177, i64 1
  %179 = load i8, ptr %178, align 1, !tbaa !25
  %180 = zext i8 %179 to i32
  %181 = shl i32 %180, 16
  %182 = add i32 %175, %181
  %183 = load ptr, ptr %12, align 8, !tbaa !5
  %184 = getelementptr inbounds i8, ptr %183, i64 5
  %185 = getelementptr inbounds i8, ptr %184, i64 2
  %186 = load i8, ptr %185, align 1, !tbaa !25
  %187 = zext i8 %186 to i32
  %188 = shl i32 %187, 8
  %189 = add i32 %182, %188
  %190 = load ptr, ptr %12, align 8, !tbaa !5
  %191 = getelementptr inbounds i8, ptr %190, i64 5
  %192 = getelementptr inbounds i8, ptr %191, i64 3
  %193 = load i8, ptr %192, align 1, !tbaa !25
  %194 = zext i8 %193 to i32
  %195 = add i32 %189, %194
  %196 = zext i32 %195 to i64
  %197 = xor i64 %196, 4294967295
  %198 = add nsw i64 %197, 1
  %199 = trunc i64 %198 to i32
  %200 = sub nsw i32 0, %199
  br label %227

201:                                              ; preds = %162
  %202 = load ptr, ptr %12, align 8, !tbaa !5
  %203 = getelementptr inbounds i8, ptr %202, i64 5
  %204 = load i8, ptr %203, align 1, !tbaa !25
  %205 = zext i8 %204 to i32
  %206 = shl i32 %205, 24
  %207 = load ptr, ptr %12, align 8, !tbaa !5
  %208 = getelementptr inbounds i8, ptr %207, i64 5
  %209 = getelementptr inbounds i8, ptr %208, i64 1
  %210 = load i8, ptr %209, align 1, !tbaa !25
  %211 = zext i8 %210 to i32
  %212 = shl i32 %211, 16
  %213 = add i32 %206, %212
  %214 = load ptr, ptr %12, align 8, !tbaa !5
  %215 = getelementptr inbounds i8, ptr %214, i64 5
  %216 = getelementptr inbounds i8, ptr %215, i64 2
  %217 = load i8, ptr %216, align 1, !tbaa !25
  %218 = zext i8 %217 to i32
  %219 = shl i32 %218, 8
  %220 = add i32 %213, %219
  %221 = load ptr, ptr %12, align 8, !tbaa !5
  %222 = getelementptr inbounds i8, ptr %221, i64 5
  %223 = getelementptr inbounds i8, ptr %222, i64 3
  %224 = load i8, ptr %223, align 1, !tbaa !25
  %225 = zext i8 %224 to i32
  %226 = add i32 %220, %225
  br label %227

227:                                              ; preds = %201, %170
  %228 = phi i32 [ %200, %170 ], [ %226, %201 ]
  store i32 %228, ptr %8, align 4, !tbaa !9
  %229 = load ptr, ptr %12, align 8, !tbaa !5
  %230 = getelementptr inbounds i8, ptr %229, i64 9
  %231 = load i8, ptr %230, align 1, !tbaa !25
  store i8 %231, ptr %9, align 1, !tbaa !25
  %232 = load ptr, ptr %12, align 8, !tbaa !5
  %233 = getelementptr inbounds i8, ptr %232, i64 10
  %234 = load i8, ptr %233, align 1, !tbaa !25
  store i8 %234, ptr %10, align 1, !tbaa !25
  %235 = load ptr, ptr %12, align 8, !tbaa !5
  %236 = getelementptr inbounds i8, ptr %235, i64 11
  store ptr %236, ptr %13, align 8, !tbaa !5
  %237 = load i8, ptr %9, align 1, !tbaa !25
  %238 = zext i8 %237 to i32
  %239 = icmp eq i32 %238, 0
  br i1 %239, label %240, label %244

240:                                              ; preds = %227
  %241 = load i8, ptr %10, align 1, !tbaa !25
  %242 = zext i8 %241 to i32
  %243 = icmp ne i32 %242, 2
  br i1 %243, label %268, label %244

244:                                              ; preds = %240, %227
  %245 = load i8, ptr %9, align 1, !tbaa !25
  %246 = zext i8 %245 to i32
  %247 = icmp eq i32 %246, 1
  br i1 %247, label %248, label %252

248:                                              ; preds = %244
  %249 = load i8, ptr %10, align 1, !tbaa !25
  %250 = zext i8 %249 to i32
  %251 = icmp ne i32 %250, 3
  br i1 %251, label %268, label %252

252:                                              ; preds = %248, %244
  %253 = load i8, ptr %9, align 1, !tbaa !25
  %254 = zext i8 %253 to i32
  %255 = icmp eq i32 %254, 2
  br i1 %255, label %256, label %260

256:                                              ; preds = %252
  %257 = load i8, ptr %10, align 1, !tbaa !25
  %258 = zext i8 %257 to i32
  %259 = icmp ne i32 %258, 3
  br i1 %259, label %268, label %260

260:                                              ; preds = %256, %252
  %261 = load i8, ptr %9, align 1, !tbaa !25
  %262 = zext i8 %261 to i32
  %263 = icmp eq i32 %262, 3
  br i1 %263, label %264, label %270

264:                                              ; preds = %260
  %265 = load i8, ptr %10, align 1, !tbaa !25
  %266 = zext i8 %265 to i32
  %267 = icmp ne i32 %266, 4
  br i1 %267, label %268, label %270

268:                                              ; preds = %264, %256, %248, %240
  %269 = load ptr, ptr %4, align 8, !tbaa !5
  call void @png_chunk_benign_error(ptr noundef %269, ptr noundef @.str.22)
  store i32 1, ptr %17, align 4
  br label %352

270:                                              ; preds = %264, %260
  %271 = load i8, ptr %9, align 1, !tbaa !25
  %272 = zext i8 %271 to i32
  %273 = icmp sge i32 %272, 4
  br i1 %273, label %274, label %276

274:                                              ; preds = %270
  %275 = load ptr, ptr %4, align 8, !tbaa !5
  call void @png_chunk_benign_error(ptr noundef %275, ptr noundef @.str.23)
  br label %276

276:                                              ; preds = %274, %270
  br label %277

277:                                              ; preds = %276
  %278 = load ptr, ptr %13, align 8, !tbaa !5
  store ptr %278, ptr %12, align 8, !tbaa !5
  br label %279

279:                                              ; preds = %284, %277
  %280 = load ptr, ptr %12, align 8, !tbaa !5
  %281 = load i8, ptr %280, align 1, !tbaa !25
  %282 = icmp ne i8 %281, 0
  br i1 %282, label %283, label %287

283:                                              ; preds = %279
  br label %284

284:                                              ; preds = %283
  %285 = load ptr, ptr %12, align 8, !tbaa !5
  %286 = getelementptr inbounds i8, ptr %285, i32 1
  store ptr %286, ptr %12, align 8, !tbaa !5
  br label %279, !llvm.loop !28

287:                                              ; preds = %279
  %288 = load ptr, ptr %4, align 8, !tbaa !5
  %289 = load i8, ptr %10, align 1, !tbaa !25
  %290 = zext i8 %289 to i64
  %291 = mul i64 %290, 8
  %292 = call noalias ptr @png_malloc_warn(ptr noundef %288, i64 noundef %291)
  store ptr %292, ptr %15, align 8, !tbaa !5
  %293 = load ptr, ptr %15, align 8, !tbaa !5
  %294 = icmp eq ptr %293, null
  br i1 %294, label %295, label %297

295:                                              ; preds = %287
  %296 = load ptr, ptr %4, align 8, !tbaa !5
  call void @png_chunk_benign_error(ptr noundef %296, ptr noundef @.str.16)
  store i32 1, ptr %17, align 4
  br label %352

297:                                              ; preds = %287
  store i32 0, ptr %16, align 4, !tbaa !9
  br label %298

298:                                              ; preds = %335, %297
  %299 = load i32, ptr %16, align 4, !tbaa !9
  %300 = load i8, ptr %10, align 1, !tbaa !25
  %301 = zext i8 %300 to i32
  %302 = icmp slt i32 %299, %301
  br i1 %302, label %303, label %338

303:                                              ; preds = %298
  %304 = load ptr, ptr %12, align 8, !tbaa !5
  %305 = getelementptr inbounds i8, ptr %304, i32 1
  store ptr %305, ptr %12, align 8, !tbaa !5
  %306 = load ptr, ptr %12, align 8, !tbaa !5
  %307 = load ptr, ptr %15, align 8, !tbaa !5
  %308 = load i32, ptr %16, align 4, !tbaa !9
  %309 = sext i32 %308 to i64
  %310 = getelementptr inbounds ptr, ptr %307, i64 %309
  store ptr %306, ptr %310, align 8, !tbaa !5
  br label %311

311:                                              ; preds = %323, %303
  %312 = load ptr, ptr %12, align 8, !tbaa !5
  %313 = load ptr, ptr %14, align 8, !tbaa !5
  %314 = icmp ule ptr %312, %313
  br i1 %314, label %315, label %320

315:                                              ; preds = %311
  %316 = load ptr, ptr %12, align 8, !tbaa !5
  %317 = load i8, ptr %316, align 1, !tbaa !25
  %318 = zext i8 %317 to i32
  %319 = icmp ne i32 %318, 0
  br label %320

320:                                              ; preds = %315, %311
  %321 = phi i1 [ false, %311 ], [ %319, %315 ]
  br i1 %321, label %322, label %326

322:                                              ; preds = %320
  br label %323

323:                                              ; preds = %322
  %324 = load ptr, ptr %12, align 8, !tbaa !5
  %325 = getelementptr inbounds i8, ptr %324, i32 1
  store ptr %325, ptr %12, align 8, !tbaa !5
  br label %311, !llvm.loop !29

326:                                              ; preds = %320
  %327 = load ptr, ptr %12, align 8, !tbaa !5
  %328 = load ptr, ptr %14, align 8, !tbaa !5
  %329 = icmp ugt ptr %327, %328
  br i1 %329, label %330, label %334

330:                                              ; preds = %326
  %331 = load ptr, ptr %4, align 8, !tbaa !5
  %332 = load ptr, ptr %15, align 8, !tbaa !5
  call void @png_free(ptr noundef %331, ptr noundef %332)
  %333 = load ptr, ptr %4, align 8, !tbaa !5
  call void @png_chunk_benign_error(ptr noundef %333, ptr noundef @.str.24)
  store i32 1, ptr %17, align 4
  br label %352

334:                                              ; preds = %326
  br label %335

335:                                              ; preds = %334
  %336 = load i32, ptr %16, align 4, !tbaa !9
  %337 = add nsw i32 %336, 1
  store i32 %337, ptr %16, align 4, !tbaa !9
  br label %298, !llvm.loop !30

338:                                              ; preds = %298
  %339 = load ptr, ptr %4, align 8, !tbaa !5
  %340 = load ptr, ptr %5, align 8, !tbaa !5
  %341 = load ptr, ptr %11, align 8, !tbaa !5
  %342 = load i32, ptr %7, align 4, !tbaa !9
  %343 = load i32, ptr %8, align 4, !tbaa !9
  %344 = load i8, ptr %9, align 1, !tbaa !25
  %345 = zext i8 %344 to i32
  %346 = load i8, ptr %10, align 1, !tbaa !25
  %347 = zext i8 %346 to i32
  %348 = load ptr, ptr %13, align 8, !tbaa !5
  %349 = load ptr, ptr %15, align 8, !tbaa !5
  call void @png_set_pCAL(ptr noundef %339, ptr noundef %340, ptr noundef %341, i32 noundef %342, i32 noundef %343, i32 noundef %345, i32 noundef %347, ptr noundef %348, ptr noundef %349)
  %350 = load ptr, ptr %4, align 8, !tbaa !5
  %351 = load ptr, ptr %15, align 8, !tbaa !5
  call void @png_free(ptr noundef %350, ptr noundef %351)
  store i32 0, ptr %17, align 4
  br label %352

352:                                              ; preds = %338, %330, %295, %268, %96, %72, %60, %45, %31
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #4
  call void @llvm.lifetime.end.p0(i64 1, ptr %10) #4
  call void @llvm.lifetime.end.p0(i64 1, ptr %9) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #4
  %353 = load i32, ptr %17, align 4
  switch i32 %353, label %355 [
    i32 0, label %354
    i32 1, label %354
  ]

354:                                              ; preds = %352, %352
  ret void

355:                                              ; preds = %352
  unreachable
}

declare void @png_set_pCAL(ptr noundef, ptr noundef, ptr noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef, ptr noundef, ptr noundef) #3

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

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!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 284}
!12 = !{!"png_struct_def", !7, i64 0, !6, i64 200, !6, i64 208, !13, i64 216, !6, i64 224, !6, i64 232, !6, i64 240, !6, i64 248, !6, i64 256, !6, i64 264, !6, i64 272, !7, i64 280, !7, i64 281, !10, i64 284, !10, i64 288, !10, i64 292, !10, i64 296, !14, i64 304, !10, i64 416, !10, i64 420, !10, i64 424, !10, i64 428, !13, i64 432, !10, i64 440, !10, i64 444, !10, i64 448, !6, i64 456, !6, i64 464, !13, i64 472, !10, i64 480, !10, i64 484, !6, i64 488, !15, i64 496, !10, i64 500, !15, i64 504, !7, i64 506, !7, i64 507, !7, i64 508, !7, i64 509, !7, i64 510, !7, i64 511, !7, i64 512, !7, i64 513, !7, i64 514, !7, i64 515, !7, i64 516, !7, i64 517, !7, i64 518, !15, i64 520, !7, i64 522, !10, i64 524, !16, i64 528, !16, i64 538, !10, i64 548, !10, i64 552, !6, i64 560, !6, i64 568, !6, i64 576, !6, i64 584, !6, i64 592, !6, i64 600, !17, i64 608, !17, i64 613, !6, i64 624, !16, i64 632, !6, i64 648, !6, i64 656, !6, i64 664, !6, i64 672, !6, i64 680, !6, i64 688, !6, i64 696, !6, i64 704, !6, i64 712, !10, i64 720, !10, i64 724, !13, i64 728, !13, i64 736, !13, i64 744, !13, i64 752, !10, i64 760, !10, i64 764, !6, i64 768, !6, i64 776, !7, i64 784, !7, i64 785, !10, i64 816, !6, i64 824, !6, i64 832, !10, i64 840, !10, i64 844, !6, i64 848, !7, i64 856, !7, i64 857, !15, i64 858, !15, i64 860, !10, i64 864, !7, i64 868, !6, i64 872, !6, i64 880, !6, i64 888, !6, i64 896, !6, i64 904, !6, i64 912, !6, i64 920, !7, i64 928, !10, i64 932, !10, i64 936, !10, i64 940, !13, i64 944, !18, i64 952, !13, i64 984, !6, i64 992, !13, i64 1000, !10, i64 1008, !10, i64 1012, !6, i64 1016, !7, i64 1024, !19, i64 1056}
!13 = !{!"long", !7, i64 0}
!14 = !{!"z_stream_s", !6, i64 0, !10, i64 8, !13, i64 16, !6, i64 24, !10, i64 32, !13, i64 40, !6, i64 48, !6, i64 56, !6, i64 64, !6, i64 72, !6, i64 80, !10, i64 88, !13, i64 96, !13, i64 104}
!15 = !{!"short", !7, i64 0}
!16 = !{!"png_color_16_struct", !7, i64 0, !15, i64 2, !15, i64 4, !15, i64 6, !15, i64 8}
!17 = !{!"png_color_8_struct", !7, i64 0, !7, i64 1, !7, i64 2, !7, i64 3, !7, i64 4}
!18 = !{!"png_unknown_chunk_t", !7, i64 0, !6, i64 8, !13, i64 16, !7, i64 24}
!19 = !{!"png_colorspace", !10, i64 0, !20, i64 4, !21, i64 36, !15, i64 72, !15, i64 74}
!20 = !{!"png_xy", !10, i64 0, !10, i64 4, !10, i64 8, !10, i64 12, !10, i64 16, !10, i64 20, !10, i64 24, !10, i64 28}
!21 = !{!"png_XYZ", !10, i64 0, !10, i64 4, !10, i64 8, !10, i64 12, !10, i64 16, !10, i64 20, !10, i64 24, !10, i64 28, !10, i64 32}
!22 = !{!23, !10, i64 8}
!23 = !{!"png_info_def", !10, i64 0, !10, i64 4, !10, i64 8, !13, i64 16, !6, i64 24, !15, i64 32, !15, i64 34, !7, i64 36, !7, i64 37, !7, i64 38, !7, i64 39, !7, i64 40, !7, i64 41, !7, i64 42, !7, i64 43, !7, i64 44, !19, i64 52, !6, i64 128, !6, i64 136, !10, i64 144, !10, i64 148, !10, i64 152, !6, i64 160, !24, i64 168, !17, i64 176, !6, i64 184, !16, i64 192, !16, i64 202, !10, i64 212, !10, i64 216, !7, i64 220, !10, i64 224, !10, i64 228, !7, i64 232, !6, i64 240, !6, i64 248, !10, i64 256, !10, i64 260, !6, i64 264, !6, i64 272, !7, i64 280, !7, i64 281, !10, i64 284, !6, i64 288, !10, i64 296, !6, i64 304, !10, i64 312, !7, i64 316, !6, i64 320, !6, i64 328, !6, i64 336}
!24 = !{!"png_time_struct", !15, i64 0, !7, i64 2, !7, i64 3, !7, i64 4, !7, i64 5, !7, i64 6}
!25 = !{!7, !7, i64 0}
!26 = distinct !{!26, !27}
!27 = !{!"llvm.loop.mustprogress"}
!28 = distinct !{!28, !27}
!29 = distinct !{!29, !27}
!30 = distinct !{!30, !27}


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

@.str.4 = external hidden unnamed_addr constant [13 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [8 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [13 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [10 x i8], align 1
@.str.16 = external hidden unnamed_addr constant [14 x i8], align 1
@.str.22 = external hidden unnamed_addr constant [24 x i8], align 1
@.str.23 = external hidden unnamed_addr constant [27 x i8], align 1
@.str.24 = external hidden unnamed_addr constant [13 x i8], align 1

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

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

; Function Attrs: noreturn
declare void @png_chunk_error(ptr noundef, ptr noundef) local_unnamed_addr #1

declare void @png_chunk_benign_error(ptr noundef, ptr noundef) local_unnamed_addr #2

; Function Attrs: nounwind uwtable
declare hidden ptr @png_read_buffer(ptr noalias noundef, i64 noundef, i32 noundef) local_unnamed_addr #0

declare noalias ptr @png_malloc_warn(ptr noundef, i64 noundef) local_unnamed_addr #2

declare void @png_free(ptr noundef, ptr noundef) local_unnamed_addr #2

; Function Attrs: nounwind uwtable
define dso_local void @png_handle_pCAL(ptr noalias noundef %0, ptr noalias noundef %1, i32 noundef %2) local_unnamed_addr #0 {
  %4 = getelementptr inbounds i8, ptr %0, i64 284
  %5 = load i32, ptr %4, align 4, !tbaa !5
  %6 = and i32 %5, 1
  %7 = icmp eq i32 %6, 0
  br i1 %7, label %8, label %9

8:                                                ; preds = %3
  tail call void @png_chunk_error(ptr noundef nonnull %0, ptr noundef nonnull @.str.6) #3
  unreachable

9:                                                ; preds = %3
  %10 = and i32 %5, 4
  %.not = icmp eq i32 %10, 0
  br i1 %.not, label %13, label %11

11:                                               ; preds = %9
  %12 = tail call i32 @png_crc_finish(ptr noundef nonnull %0, i32 noundef %2)
  tail call void @png_chunk_benign_error(ptr noundef nonnull %0, ptr noundef nonnull @.str.4) #4
  br label %142

13:                                               ; preds = %9
  %.not113 = icmp eq ptr %1, null
  br i1 %.not113, label %20, label %14

14:                                               ; preds = %13
  %15 = getelementptr inbounds i8, ptr %1, i64 8
  %16 = load i32, ptr %15, align 8, !tbaa !20
  %17 = and i32 %16, 1024
  %.not114 = icmp eq i32 %17, 0
  br i1 %.not114, label %20, label %18

18:                                               ; preds = %14
  %19 = tail call i32 @png_crc_finish(ptr noundef nonnull %0, i32 noundef %2)
  tail call void @png_chunk_benign_error(ptr noundef nonnull %0, ptr noundef nonnull @.str.7) #4
  br label %142

20:                                               ; preds = %14, %13
  %21 = add i32 %2, 1
  %22 = zext i32 %21 to i64
  %23 = tail call ptr @png_read_buffer(ptr noundef nonnull %0, i64 noundef %22, i32 noundef 2)
  %24 = icmp eq ptr %23, null
  br i1 %24, label %25, label %27

25:                                               ; preds = %20
  %26 = tail call i32 @png_crc_finish(ptr noundef nonnull %0, i32 noundef %2)
  tail call void @png_chunk_benign_error(ptr noundef nonnull %0, ptr noundef nonnull @.str.16) #4
  br label %142

27:                                               ; preds = %20
  tail call void @png_crc_read(ptr noundef nonnull %0, ptr noundef nonnull %23, i32 noundef %2)
  %28 = tail call i32 @png_crc_finish(ptr noundef nonnull %0, i32 noundef 0)
  %.not115 = icmp eq i32 %28, 0
  br i1 %.not115, label %29, label %142

29:                                               ; preds = %27
  %30 = zext i32 %2 to i64
  %31 = getelementptr inbounds i8, ptr %23, i64 %30
  store i8 0, ptr %31, align 1, !tbaa !23
  br label %32

32:                                               ; preds = %32, %29
  %.0107 = phi ptr [ %23, %29 ], [ %34, %32 ]
  %33 = load i8, ptr %.0107, align 1, !tbaa !23
  %.not116 = icmp eq i8 %33, 0
  %34 = getelementptr inbounds i8, ptr %.0107, i64 1
  br i1 %.not116, label %35, label %32, !llvm.loop !24

35:                                               ; preds = %32
  %36 = getelementptr inbounds i8, ptr %.0107, i64 12
  %.not117 = icmp ugt ptr %31, %36
  br i1 %.not117, label %38, label %37

37:                                               ; preds = %35
  tail call void @png_chunk_benign_error(ptr noundef %0, ptr noundef nonnull @.str.5) #4
  br label %142

38:                                               ; preds = %35
  %39 = load i8, ptr %34, align 1, !tbaa !23
  %40 = zext i8 %39 to i32
  %.not118 = icmp sgt i8 %39, -1
  br i1 %.not118, label %55, label %41

41:                                               ; preds = %38
  %42 = getelementptr inbounds i8, ptr %.0107, i64 2
  %43 = load i8, ptr %42, align 1, !tbaa !23
  %44 = zext i8 %43 to i32
  %.neg119.neg = shl nuw nsw i32 %44, 16
  %45 = shl nuw i32 %40, 24
  %46 = getelementptr inbounds i8, ptr %.0107, i64 3
  %47 = load i8, ptr %46, align 1, !tbaa !23
  %48 = zext i8 %47 to i32
  %49 = shl nuw nsw i32 %48, 8
  %50 = getelementptr inbounds i8, ptr %.0107, i64 4
  %51 = load i8, ptr %50, align 1, !tbaa !23
  %52 = zext i8 %51 to i32
  %53 = or disjoint i32 %.neg119.neg, %45
  %54 = or disjoint i32 %53, %49
  %.neg123.neg = or disjoint i32 %54, %52
  br label %71

55:                                               ; preds = %38
  %56 = shl nuw nsw i32 %40, 24
  %57 = getelementptr inbounds i8, ptr %.0107, i64 2
  %58 = load i8, ptr %57, align 1, !tbaa !23
  %59 = zext i8 %58 to i32
  %60 = shl nuw nsw i32 %59, 16
  %61 = or disjoint i32 %60, %56
  %62 = getelementptr inbounds i8, ptr %.0107, i64 3
  %63 = load i8, ptr %62, align 1, !tbaa !23
  %64 = zext i8 %63 to i32
  %65 = shl nuw nsw i32 %64, 8
  %66 = or disjoint i32 %61, %65
  %67 = getelementptr inbounds i8, ptr %.0107, i64 4
  %68 = load i8, ptr %67, align 1, !tbaa !23
  %69 = zext i8 %68 to i32
  %70 = or disjoint i32 %66, %69
  br label %71

71:                                               ; preds = %55, %41
  %72 = phi i32 [ %.neg123.neg, %41 ], [ %70, %55 ]
  %73 = getelementptr inbounds i8, ptr %.0107, i64 5
  %74 = load i8, ptr %73, align 1, !tbaa !23
  %75 = zext i8 %74 to i32
  %.not124 = icmp sgt i8 %74, -1
  br i1 %.not124, label %90, label %76

76:                                               ; preds = %71
  %77 = getelementptr inbounds i8, ptr %.0107, i64 6
  %78 = load i8, ptr %77, align 1, !tbaa !23
  %79 = zext i8 %78 to i32
  %.neg125.neg = shl nuw nsw i32 %79, 16
  %80 = shl nuw i32 %75, 24
  %81 = getelementptr inbounds i8, ptr %.0107, i64 7
  %82 = load i8, ptr %81, align 1, !tbaa !23
  %83 = zext i8 %82 to i32
  %84 = shl nuw nsw i32 %83, 8
  %85 = getelementptr inbounds i8, ptr %.0107, i64 8
  %86 = load i8, ptr %85, align 1, !tbaa !23
  %87 = zext i8 %86 to i32
  %88 = or disjoint i32 %.neg125.neg, %80
  %89 = or disjoint i32 %88, %84
  %.neg129.neg = or disjoint i32 %89, %87
  br label %106

90:                                               ; preds = %71
  %91 = shl nuw nsw i32 %75, 24
  %92 = getelementptr inbounds i8, ptr %.0107, i64 6
  %93 = load i8, ptr %92, align 1, !tbaa !23
  %94 = zext i8 %93 to i32
  %95 = shl nuw nsw i32 %94, 16
  %96 = or disjoint i32 %95, %91
  %97 = getelementptr inbounds i8, ptr %.0107, i64 7
  %98 = load i8, ptr %97, align 1, !tbaa !23
  %99 = zext i8 %98 to i32
  %100 = shl nuw nsw i32 %99, 8
  %101 = or disjoint i32 %96, %100
  %102 = getelementptr inbounds i8, ptr %.0107, i64 8
  %103 = load i8, ptr %102, align 1, !tbaa !23
  %104 = zext i8 %103 to i32
  %105 = or disjoint i32 %101, %104
  br label %106

106:                                              ; preds = %90, %76
  %107 = phi i32 [ %.neg129.neg, %76 ], [ %105, %90 ]
  %108 = getelementptr inbounds i8, ptr %.0107, i64 9
  %109 = load i8, ptr %108, align 1, !tbaa !23
  %110 = getelementptr inbounds i8, ptr %.0107, i64 10
  %111 = load i8, ptr %110, align 1, !tbaa !23
  %112 = getelementptr inbounds i8, ptr %.0107, i64 11
  %113 = zext i8 %109 to i32
  %114 = icmp eq i8 %109, 0
  %115 = zext i8 %111 to i32
  %116 = icmp ne i8 %111, 2
  %or.cond = select i1 %114, i1 %116, i1 false
  br i1 %or.cond, label %124, label %117

117:                                              ; preds = %106
  %118 = icmp ne i8 %111, 3
  %119 = add i8 %109, -1
  %120 = icmp ult i8 %119, 2
  %or.cond133 = select i1 %120, i1 %118, i1 false
  br i1 %or.cond133, label %124, label %121

121:                                              ; preds = %117
  %122 = icmp eq i8 %109, 3
  %123 = icmp ne i8 %111, 4
  %or.cond11 = select i1 %122, i1 %123, i1 false
  br i1 %or.cond11, label %124, label %125

124:                                              ; preds = %121, %117, %106
  tail call void @png_chunk_benign_error(ptr noundef %0, ptr noundef nonnull @.str.22) #4
  br label %142

125:                                              ; preds = %121
  %126 = icmp ugt i8 %109, 3
  br i1 %126, label %127, label %.preheader152

127:                                              ; preds = %125
  tail call void @png_chunk_benign_error(ptr noundef %0, ptr noundef nonnull @.str.23) #4
  br label %.preheader152

.preheader152:                                    ; preds = %125, %127
  br label %128

128:                                              ; preds = %.preheader152, %128
  %.1 = phi ptr [ %130, %128 ], [ %112, %.preheader152 ]
  %129 = load i8, ptr %.1, align 1, !tbaa !23
  %.not130 = icmp eq i8 %129, 0
  %130 = getelementptr inbounds i8, ptr %.1, i64 1
  br i1 %.not130, label %131, label %128, !llvm.loop !26

131:                                              ; preds = %128
  %132 = zext i8 %111 to i64
  %133 = shl nuw nsw i64 %132, 3
  %134 = tail call noalias ptr @png_malloc_warn(ptr noundef %0, i64 noundef %133) #4
  %135 = icmp eq ptr %134, null
  br i1 %135, label %136, label %.preheader

.preheader:                                       ; preds = %131
  %.not142 = icmp eq i8 %111, 0
  br i1 %.not142, label %._crit_edge141, label %.lr.ph140.preheader

.lr.ph140.preheader:                              ; preds = %.preheader
  %wide.trip.count = zext i8 %111 to i64
  br label %.lr.ph140

136:                                              ; preds = %131
  tail call void @png_chunk_benign_error(ptr noundef %0, ptr noundef nonnull @.str.16) #4
  br label %142

.lr.ph140:                                        ; preds = %.lr.ph140.preheader, %.critedge
  %indvars.iv = phi i64 [ 0, %.lr.ph140.preheader ], [ %indvars.iv.next, %.critedge ]
  %.2138 = phi ptr [ %.1, %.lr.ph140.preheader ], [ %.3136, %.critedge ]
  %137 = getelementptr inbounds i8, ptr %.2138, i64 1
  %138 = getelementptr inbounds ptr, ptr %134, i64 %indvars.iv
  store ptr %137, ptr %138, align 8, !tbaa !27
  %.not131135 = icmp ugt ptr %137, %31
  br i1 %.not131135, label %._crit_edge, label %.lr.ph

.lr.ph:                                           ; preds = %.lr.ph140, %140
  %.3136 = phi ptr [ %141, %140 ], [ %137, %.lr.ph140 ]
  %139 = load i8, ptr %.3136, align 1, !tbaa !23
  %.not132 = icmp eq i8 %139, 0
  br i1 %.not132, label %.critedge, label %140

140:                                              ; preds = %.lr.ph
  %141 = getelementptr inbounds i8, ptr %.3136, i64 1
  %.not131 = icmp ugt ptr %141, %31
  br i1 %.not131, label %._crit_edge, label %.lr.ph, !llvm.loop !28

._crit_edge:                                      ; preds = %.lr.ph140, %140
  tail call void @png_free(ptr noundef %0, ptr noundef nonnull %134) #4
  tail call void @png_chunk_benign_error(ptr noundef %0, ptr noundef nonnull @.str.24) #4
  br label %142

.critedge:                                        ; preds = %.lr.ph
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
  br i1 %exitcond.not, label %._crit_edge141, label %.lr.ph140, !llvm.loop !29

._crit_edge141:                                   ; preds = %.critedge, %.preheader
  tail call void @png_set_pCAL(ptr noundef %0, ptr noundef %1, ptr noundef nonnull %23, i32 noundef %72, i32 noundef %107, i32 noundef %113, i32 noundef %115, ptr noundef nonnull %112, ptr noundef nonnull %134) #4
  tail call void @png_free(ptr noundef %0, ptr noundef nonnull %134) #4
  br label %142

142:                                              ; preds = %27, %._crit_edge141, %._crit_edge, %136, %124, %37, %25, %18, %11
  ret void
}

declare void @png_set_pCAL(ptr noundef, ptr noundef, ptr noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef, ptr noundef, ptr noundef) local_unnamed_addr #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 = { noreturn "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { "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 = { noreturn nounwind }
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, !11, i64 284}
!6 = !{!"png_struct_def", !7, i64 0, !9, i64 200, !9, i64 208, !10, i64 216, !9, i64 224, !9, i64 232, !9, i64 240, !9, i64 248, !9, i64 256, !9, i64 264, !9, i64 272, !7, i64 280, !7, i64 281, !11, i64 284, !11, i64 288, !11, i64 292, !11, i64 296, !12, i64 304, !11, i64 416, !11, i64 420, !11, i64 424, !11, i64 428, !10, i64 432, !11, i64 440, !11, i64 444, !11, i64 448, !9, i64 456, !9, i64 464, !10, i64 472, !11, i64 480, !11, i64 484, !9, i64 488, !13, i64 496, !11, i64 500, !13, i64 504, !7, i64 506, !7, i64 507, !7, i64 508, !7, i64 509, !7, i64 510, !7, i64 511, !7, i64 512, !7, i64 513, !7, i64 514, !7, i64 515, !7, i64 516, !7, i64 517, !7, i64 518, !13, i64 520, !7, i64 522, !11, i64 524, !14, i64 528, !14, i64 538, !11, i64 548, !11, i64 552, !9, i64 560, !9, i64 568, !9, i64 576, !9, i64 584, !9, i64 592, !9, i64 600, !15, i64 608, !15, i64 613, !9, i64 624, !14, i64 632, !9, i64 648, !9, i64 656, !9, i64 664, !9, i64 672, !9, i64 680, !9, i64 688, !9, i64 696, !9, i64 704, !9, i64 712, !11, i64 720, !11, i64 724, !10, i64 728, !10, i64 736, !10, i64 744, !10, i64 752, !11, i64 760, !11, i64 764, !9, i64 768, !9, i64 776, !7, i64 784, !7, i64 785, !11, i64 816, !9, i64 824, !9, i64 832, !11, i64 840, !11, i64 844, !9, i64 848, !7, i64 856, !7, i64 857, !13, i64 858, !13, i64 860, !11, i64 864, !7, i64 868, !9, i64 872, !9, i64 880, !9, i64 888, !9, i64 896, !9, i64 904, !9, i64 912, !9, i64 920, !7, i64 928, !11, i64 932, !11, i64 936, !11, i64 940, !10, i64 944, !16, i64 952, !10, i64 984, !9, i64 992, !10, i64 1000, !11, i64 1008, !11, i64 1012, !9, i64 1016, !7, i64 1024, !17, i64 1056}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!"any pointer", !7, i64 0}
!10 = !{!"long", !7, i64 0}
!11 = !{!"int", !7, i64 0}
!12 = !{!"z_stream_s", !9, i64 0, !11, i64 8, !10, i64 16, !9, i64 24, !11, i64 32, !10, i64 40, !9, i64 48, !9, i64 56, !9, i64 64, !9, i64 72, !9, i64 80, !11, i64 88, !10, i64 96, !10, i64 104}
!13 = !{!"short", !7, i64 0}
!14 = !{!"png_color_16_struct", !7, i64 0, !13, i64 2, !13, i64 4, !13, i64 6, !13, i64 8}
!15 = !{!"png_color_8_struct", !7, i64 0, !7, i64 1, !7, i64 2, !7, i64 3, !7, i64 4}
!16 = !{!"png_unknown_chunk_t", !7, i64 0, !9, i64 8, !10, i64 16, !7, i64 24}
!17 = !{!"png_colorspace", !11, i64 0, !18, i64 4, !19, i64 36, !13, i64 72, !13, i64 74}
!18 = !{!"png_xy", !11, i64 0, !11, i64 4, !11, i64 8, !11, i64 12, !11, i64 16, !11, i64 20, !11, i64 24, !11, i64 28}
!19 = !{!"png_XYZ", !11, i64 0, !11, i64 4, !11, i64 8, !11, i64 12, !11, i64 16, !11, i64 20, !11, i64 24, !11, i64 28, !11, i64 32}
!20 = !{!21, !11, i64 8}
!21 = !{!"png_info_def", !11, i64 0, !11, i64 4, !11, i64 8, !10, i64 16, !9, i64 24, !13, i64 32, !13, i64 34, !7, i64 36, !7, i64 37, !7, i64 38, !7, i64 39, !7, i64 40, !7, i64 41, !7, i64 42, !7, i64 43, !7, i64 44, !17, i64 52, !9, i64 128, !9, i64 136, !11, i64 144, !11, i64 148, !11, i64 152, !9, i64 160, !22, i64 168, !15, i64 176, !9, i64 184, !14, i64 192, !14, i64 202, !11, i64 212, !11, i64 216, !7, i64 220, !11, i64 224, !11, i64 228, !7, i64 232, !9, i64 240, !9, i64 248, !11, i64 256, !11, i64 260, !9, i64 264, !9, i64 272, !7, i64 280, !7, i64 281, !11, i64 284, !9, i64 288, !11, i64 296, !9, i64 304, !11, i64 312, !7, i64 316, !9, i64 320, !9, i64 328, !9, i64 336}
!22 = !{!"png_time_struct", !13, i64 0, !7, i64 2, !7, i64 3, !7, i64 4, !7, i64 5, !7, i64 6}
!23 = !{!7, !7, i64 0}
!24 = distinct !{!24, !25}
!25 = !{!"llvm.loop.mustprogress"}
!26 = distinct !{!26, !25}
!27 = !{!9, !9, i64 0}
!28 = distinct !{!28, !25}
!29 = distinct !{!29, !25}


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