; LLVM IR from niessner/Matterport :: code/gaps/pkgs/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, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, i8, i8, i32, i32, i32, %struct.z_stream_s, ptr, i64, i32, i32, i32, i32, i32, i32, i32, i32, i32, i64, i64, i32, i32, ptr, ptr, ptr, ptr, ptr, ptr, %struct.png_row_info_struct, i32, i32, ptr, i16, i16, [5 x i8], i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i16, i8, float, %struct.png_color_16_struct, %struct.png_color_16_struct, ptr, i32, i32, i32, float, float, 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, i64, i64, ptr, ptr, ptr, ptr, ptr, i8, i8, ptr, ptr, ptr, ptr, ptr, ptr, i32, ptr, ptr, i32, ptr, i8, i16, i16, i16, i32, i32, i8, ptr, ptr, ptr, ptr, ptr, ptr, ptr, i8, i32, i32, i32, %struct.png_unknown_chunk_t, i32, i32, ptr, i32 }
%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_row_info_struct = type { i32, i64, i8, i8, i8, i8 }
%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_info_struct = type { i32, i32, i32, i64, ptr, i16, i16, i8, i8, i8, i8, i8, i8, i8, i8, [8 x i8], float, i8, 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, float, float, float, float, float, float, float, float, ptr, i32, i32, ptr, ptr, i8, i8, i32, ptr, i64, ptr, ptr, i32, i8, ptr, i32, i8, double, double, ptr, ptr, ptr, i32, i32, i32, i32, i32, i32, i32, i32, i32 }
%struct.png_time_struct = type { i16, i8, i8, i8, i8, i8 }

@.str.89 = external hidden unnamed_addr constant [25 x i8], align 1
@.str.90 = external hidden unnamed_addr constant [24 x i8], align 1
@.str.91 = external hidden unnamed_addr constant [21 x i8], align 1
@.str.92 = external hidden unnamed_addr constant [27 x i8], align 1
@.str.93 = external hidden unnamed_addr constant [18 x i8], align 1
@.str.94 = external hidden unnamed_addr constant [42 x i8], align 1
@.str.95 = external hidden unnamed_addr constant [42 x i8], align 1
@.str.96 = external hidden unnamed_addr constant [26 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

declare void @png_error(ptr noundef, ptr noundef) #1

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

; Function Attrs: nounwind uwtable
declare dso_local void @png_crc_read(ptr noundef, ptr noundef, i64 noundef) #2

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

declare void @png_warning(ptr noundef, ptr noundef) #1

declare ptr @png_malloc_warn(ptr noundef, i64 noundef) #1

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

; Function Attrs: nounwind uwtable
define dso_local void @png_handle_pCAL(ptr noundef %0, ptr noundef %1, i32 noundef %2) #2 {
  %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 i64, 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) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #3
  call void @llvm.lifetime.start.p0(i64 1, ptr %9) #3
  call void @llvm.lifetime.start.p0(i64 1, ptr %10) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #3
  %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 ne i32 %21, 0
  br i1 %22, label %25, label %23

23:                                               ; preds = %3
  %24 = load ptr, ptr %4, align 8, !tbaa !5
  call void @png_error(ptr noundef %24, ptr noundef @.str.89)
  br label %52

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
  call void @png_warning(ptr noundef %32, ptr noundef @.str.90)
  %33 = load ptr, ptr %4, align 8, !tbaa !5
  %34 = load i32, ptr %6, align 4, !tbaa !9
  %35 = call i32 @png_crc_finish(ptr noundef %33, i32 noundef %34)
  store i32 1, ptr %17, align 4
  br label %399

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_struct, ptr %40, i32 0, i32 2
  %42 = load i32, ptr %41, align 8, !tbaa !21
  %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
  call void @png_warning(ptr noundef %46, ptr noundef @.str.91)
  %47 = load ptr, ptr %4, align 8, !tbaa !5
  %48 = load i32, ptr %6, align 4, !tbaa !9
  %49 = call i32 @png_crc_finish(ptr noundef %47, i32 noundef %48)
  store i32 1, ptr %17, align 4
  br label %399

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

51:                                               ; preds = %50
  br label %52

52:                                               ; preds = %51, %23
  %53 = load ptr, ptr %4, align 8, !tbaa !5
  %54 = load ptr, ptr %4, align 8, !tbaa !5
  %55 = getelementptr inbounds %struct.png_struct_def, ptr %54, i32 0, i32 136
  %56 = load ptr, ptr %55, align 8, !tbaa !25
  call void @png_free(ptr noundef %53, ptr noundef %56)
  %57 = load ptr, ptr %4, align 8, !tbaa !5
  %58 = load i32, ptr %6, align 4, !tbaa !9
  %59 = add i32 %58, 1
  %60 = zext i32 %59 to i64
  %61 = call ptr @png_malloc_warn(ptr noundef %57, i64 noundef %60)
  %62 = load ptr, ptr %4, align 8, !tbaa !5
  %63 = getelementptr inbounds %struct.png_struct_def, ptr %62, i32 0, i32 136
  store ptr %61, ptr %63, align 8, !tbaa !25
  %64 = load ptr, ptr %4, align 8, !tbaa !5
  %65 = getelementptr inbounds %struct.png_struct_def, ptr %64, i32 0, i32 136
  %66 = load ptr, ptr %65, align 8, !tbaa !25
  %67 = icmp eq ptr %66, null
  br i1 %67, label %68, label %70

68:                                               ; preds = %52
  %69 = load ptr, ptr %4, align 8, !tbaa !5
  call void @png_warning(ptr noundef %69, ptr noundef @.str.92)
  store i32 1, ptr %17, align 4
  br label %399

70:                                               ; preds = %52
  %71 = load i32, ptr %6, align 4, !tbaa !9
  %72 = zext i32 %71 to i64
  store i64 %72, ptr %15, align 8, !tbaa !26
  %73 = load ptr, ptr %4, align 8, !tbaa !5
  %74 = load ptr, ptr %4, align 8, !tbaa !5
  %75 = getelementptr inbounds %struct.png_struct_def, ptr %74, i32 0, i32 136
  %76 = load ptr, ptr %75, align 8, !tbaa !25
  %77 = load i64, ptr %15, align 8, !tbaa !26
  call void @png_crc_read(ptr noundef %73, ptr noundef %76, i64 noundef %77)
  %78 = load ptr, ptr %4, align 8, !tbaa !5
  %79 = call i32 @png_crc_finish(ptr noundef %78, i32 noundef 0)
  %80 = icmp ne i32 %79, 0
  br i1 %80, label %81, label %88

81:                                               ; preds = %70
  %82 = load ptr, ptr %4, align 8, !tbaa !5
  %83 = load ptr, ptr %4, align 8, !tbaa !5
  %84 = getelementptr inbounds %struct.png_struct_def, ptr %83, i32 0, i32 136
  %85 = load ptr, ptr %84, align 8, !tbaa !25
  call void @png_free(ptr noundef %82, ptr noundef %85)
  %86 = load ptr, ptr %4, align 8, !tbaa !5
  %87 = getelementptr inbounds %struct.png_struct_def, ptr %86, i32 0, i32 136
  store ptr null, ptr %87, align 8, !tbaa !25
  store i32 1, ptr %17, align 4
  br label %399

88:                                               ; preds = %70
  %89 = load ptr, ptr %4, align 8, !tbaa !5
  %90 = getelementptr inbounds %struct.png_struct_def, ptr %89, i32 0, i32 136
  %91 = load ptr, ptr %90, align 8, !tbaa !25
  %92 = load i64, ptr %15, align 8, !tbaa !26
  %93 = getelementptr inbounds i8, ptr %91, i64 %92
  store i8 0, ptr %93, align 1, !tbaa !27
  %94 = load ptr, ptr %4, align 8, !tbaa !5
  %95 = getelementptr inbounds %struct.png_struct_def, ptr %94, i32 0, i32 136
  %96 = load ptr, ptr %95, align 8, !tbaa !25
  store ptr %96, ptr %11, align 8, !tbaa !5
  br label %97

97:                                               ; preds = %102, %88
  %98 = load ptr, ptr %11, align 8, !tbaa !5
  %99 = load i8, ptr %98, align 1, !tbaa !27
  %100 = icmp ne i8 %99, 0
  br i1 %100, label %101, label %105

101:                                              ; preds = %97
  br label %102

102:                                              ; preds = %101
  %103 = load ptr, ptr %11, align 8, !tbaa !5
  %104 = getelementptr inbounds i8, ptr %103, i32 1
  store ptr %104, ptr %11, align 8, !tbaa !5
  br label %97, !llvm.loop !28

105:                                              ; preds = %97
  %106 = load ptr, ptr %4, align 8, !tbaa !5
  %107 = getelementptr inbounds %struct.png_struct_def, ptr %106, i32 0, i32 136
  %108 = load ptr, ptr %107, align 8, !tbaa !25
  %109 = load i64, ptr %15, align 8, !tbaa !26
  %110 = getelementptr inbounds i8, ptr %108, i64 %109
  store ptr %110, ptr %13, align 8, !tbaa !5
  %111 = load ptr, ptr %13, align 8, !tbaa !5
  %112 = load ptr, ptr %11, align 8, !tbaa !5
  %113 = getelementptr inbounds i8, ptr %112, i64 12
  %114 = icmp ule ptr %111, %113
  br i1 %114, label %115, label %123

115:                                              ; preds = %105
  %116 = load ptr, ptr %4, align 8, !tbaa !5
  call void @png_warning(ptr noundef %116, ptr noundef @.str.93)
  %117 = load ptr, ptr %4, align 8, !tbaa !5
  %118 = load ptr, ptr %4, align 8, !tbaa !5
  %119 = getelementptr inbounds %struct.png_struct_def, ptr %118, i32 0, i32 136
  %120 = load ptr, ptr %119, align 8, !tbaa !25
  call void @png_free(ptr noundef %117, ptr noundef %120)
  %121 = load ptr, ptr %4, align 8, !tbaa !5
  %122 = getelementptr inbounds %struct.png_struct_def, ptr %121, i32 0, i32 136
  store ptr null, ptr %122, align 8, !tbaa !25
  store i32 1, ptr %17, align 4
  br label %399

123:                                              ; preds = %105
  %124 = load ptr, ptr %11, align 8, !tbaa !5
  %125 = getelementptr inbounds i8, ptr %124, i64 1
  %126 = load i8, ptr %125, align 1, !tbaa !27
  %127 = zext i8 %126 to i32
  %128 = and i32 %127, 128
  %129 = icmp ne i32 %128, 0
  br i1 %129, label %130, label %159

130:                                              ; preds = %123
  %131 = load ptr, ptr %11, align 8, !tbaa !5
  %132 = getelementptr inbounds i8, ptr %131, i64 1
  %133 = load i8, ptr %132, align 1, !tbaa !27
  %134 = zext i8 %133 to i32
  %135 = shl i32 %134, 24
  %136 = load ptr, ptr %11, align 8, !tbaa !5
  %137 = getelementptr inbounds i8, ptr %136, i64 1
  %138 = getelementptr inbounds i8, ptr %137, i64 1
  %139 = load i8, ptr %138, align 1, !tbaa !27
  %140 = zext i8 %139 to i32
  %141 = shl i32 %140, 16
  %142 = add i32 %135, %141
  %143 = load ptr, ptr %11, align 8, !tbaa !5
  %144 = getelementptr inbounds i8, ptr %143, i64 1
  %145 = getelementptr inbounds i8, ptr %144, i64 2
  %146 = load i8, ptr %145, align 1, !tbaa !27
  %147 = zext i8 %146 to i32
  %148 = shl i32 %147, 8
  %149 = add i32 %142, %148
  %150 = load ptr, ptr %11, align 8, !tbaa !5
  %151 = getelementptr inbounds i8, ptr %150, i64 1
  %152 = getelementptr inbounds i8, ptr %151, i64 3
  %153 = load i8, ptr %152, align 1, !tbaa !27
  %154 = zext i8 %153 to i32
  %155 = add i32 %149, %154
  %156 = xor i32 %155, -1
  %157 = add i32 %156, 1
  %158 = sub nsw i32 0, %157
  br label %185

159:                                              ; preds = %123
  %160 = load ptr, ptr %11, align 8, !tbaa !5
  %161 = getelementptr inbounds i8, ptr %160, i64 1
  %162 = load i8, ptr %161, align 1, !tbaa !27
  %163 = zext i8 %162 to i32
  %164 = shl i32 %163, 24
  %165 = load ptr, ptr %11, align 8, !tbaa !5
  %166 = getelementptr inbounds i8, ptr %165, i64 1
  %167 = getelementptr inbounds i8, ptr %166, i64 1
  %168 = load i8, ptr %167, align 1, !tbaa !27
  %169 = zext i8 %168 to i32
  %170 = shl i32 %169, 16
  %171 = add i32 %164, %170
  %172 = load ptr, ptr %11, align 8, !tbaa !5
  %173 = getelementptr inbounds i8, ptr %172, i64 1
  %174 = getelementptr inbounds i8, ptr %173, i64 2
  %175 = load i8, ptr %174, align 1, !tbaa !27
  %176 = zext i8 %175 to i32
  %177 = shl i32 %176, 8
  %178 = add i32 %171, %177
  %179 = load ptr, ptr %11, align 8, !tbaa !5
  %180 = getelementptr inbounds i8, ptr %179, i64 1
  %181 = getelementptr inbounds i8, ptr %180, i64 3
  %182 = load i8, ptr %181, align 1, !tbaa !27
  %183 = zext i8 %182 to i32
  %184 = add i32 %178, %183
  br label %185

185:                                              ; preds = %159, %130
  %186 = phi i32 [ %158, %130 ], [ %184, %159 ]
  store i32 %186, ptr %7, align 4, !tbaa !9
  %187 = load ptr, ptr %11, align 8, !tbaa !5
  %188 = getelementptr inbounds i8, ptr %187, i64 5
  %189 = load i8, ptr %188, align 1, !tbaa !27
  %190 = zext i8 %189 to i32
  %191 = and i32 %190, 128
  %192 = icmp ne i32 %191, 0
  br i1 %192, label %193, label %222

193:                                              ; preds = %185
  %194 = load ptr, ptr %11, align 8, !tbaa !5
  %195 = getelementptr inbounds i8, ptr %194, i64 5
  %196 = load i8, ptr %195, align 1, !tbaa !27
  %197 = zext i8 %196 to i32
  %198 = shl i32 %197, 24
  %199 = load ptr, ptr %11, align 8, !tbaa !5
  %200 = getelementptr inbounds i8, ptr %199, i64 5
  %201 = getelementptr inbounds i8, ptr %200, i64 1
  %202 = load i8, ptr %201, align 1, !tbaa !27
  %203 = zext i8 %202 to i32
  %204 = shl i32 %203, 16
  %205 = add i32 %198, %204
  %206 = load ptr, ptr %11, align 8, !tbaa !5
  %207 = getelementptr inbounds i8, ptr %206, i64 5
  %208 = getelementptr inbounds i8, ptr %207, i64 2
  %209 = load i8, ptr %208, align 1, !tbaa !27
  %210 = zext i8 %209 to i32
  %211 = shl i32 %210, 8
  %212 = add i32 %205, %211
  %213 = load ptr, ptr %11, align 8, !tbaa !5
  %214 = getelementptr inbounds i8, ptr %213, i64 5
  %215 = getelementptr inbounds i8, ptr %214, i64 3
  %216 = load i8, ptr %215, align 1, !tbaa !27
  %217 = zext i8 %216 to i32
  %218 = add i32 %212, %217
  %219 = xor i32 %218, -1
  %220 = add i32 %219, 1
  %221 = sub nsw i32 0, %220
  br label %248

222:                                              ; preds = %185
  %223 = load ptr, ptr %11, align 8, !tbaa !5
  %224 = getelementptr inbounds i8, ptr %223, i64 5
  %225 = load i8, ptr %224, align 1, !tbaa !27
  %226 = zext i8 %225 to i32
  %227 = shl i32 %226, 24
  %228 = load ptr, ptr %11, align 8, !tbaa !5
  %229 = getelementptr inbounds i8, ptr %228, i64 5
  %230 = getelementptr inbounds i8, ptr %229, i64 1
  %231 = load i8, ptr %230, align 1, !tbaa !27
  %232 = zext i8 %231 to i32
  %233 = shl i32 %232, 16
  %234 = add i32 %227, %233
  %235 = load ptr, ptr %11, align 8, !tbaa !5
  %236 = getelementptr inbounds i8, ptr %235, i64 5
  %237 = getelementptr inbounds i8, ptr %236, i64 2
  %238 = load i8, ptr %237, align 1, !tbaa !27
  %239 = zext i8 %238 to i32
  %240 = shl i32 %239, 8
  %241 = add i32 %234, %240
  %242 = load ptr, ptr %11, align 8, !tbaa !5
  %243 = getelementptr inbounds i8, ptr %242, i64 5
  %244 = getelementptr inbounds i8, ptr %243, i64 3
  %245 = load i8, ptr %244, align 1, !tbaa !27
  %246 = zext i8 %245 to i32
  %247 = add i32 %241, %246
  br label %248

248:                                              ; preds = %222, %193
  %249 = phi i32 [ %221, %193 ], [ %247, %222 ]
  store i32 %249, ptr %8, align 4, !tbaa !9
  %250 = load ptr, ptr %11, align 8, !tbaa !5
  %251 = getelementptr inbounds i8, ptr %250, i64 9
  %252 = load i8, ptr %251, align 1, !tbaa !27
  store i8 %252, ptr %9, align 1, !tbaa !27
  %253 = load ptr, ptr %11, align 8, !tbaa !5
  %254 = getelementptr inbounds i8, ptr %253, i64 10
  %255 = load i8, ptr %254, align 1, !tbaa !27
  store i8 %255, ptr %10, align 1, !tbaa !27
  %256 = load ptr, ptr %11, align 8, !tbaa !5
  %257 = getelementptr inbounds i8, ptr %256, i64 11
  store ptr %257, ptr %12, align 8, !tbaa !5
  %258 = load i8, ptr %9, align 1, !tbaa !27
  %259 = zext i8 %258 to i32
  %260 = icmp eq i32 %259, 0
  br i1 %260, label %261, label %265

261:                                              ; preds = %248
  %262 = load i8, ptr %10, align 1, !tbaa !27
  %263 = zext i8 %262 to i32
  %264 = icmp ne i32 %263, 2
  br i1 %264, label %289, label %265

265:                                              ; preds = %261, %248
  %266 = load i8, ptr %9, align 1, !tbaa !27
  %267 = zext i8 %266 to i32
  %268 = icmp eq i32 %267, 1
  br i1 %268, label %269, label %273

269:                                              ; preds = %265
  %270 = load i8, ptr %10, align 1, !tbaa !27
  %271 = zext i8 %270 to i32
  %272 = icmp ne i32 %271, 3
  br i1 %272, label %289, label %273

273:                                              ; preds = %269, %265
  %274 = load i8, ptr %9, align 1, !tbaa !27
  %275 = zext i8 %274 to i32
  %276 = icmp eq i32 %275, 2
  br i1 %276, label %277, label %281

277:                                              ; preds = %273
  %278 = load i8, ptr %10, align 1, !tbaa !27
  %279 = zext i8 %278 to i32
  %280 = icmp ne i32 %279, 3
  br i1 %280, label %289, label %281

281:                                              ; preds = %277, %273
  %282 = load i8, ptr %9, align 1, !tbaa !27
  %283 = zext i8 %282 to i32
  %284 = icmp eq i32 %283, 3
  br i1 %284, label %285, label %297

285:                                              ; preds = %281
  %286 = load i8, ptr %10, align 1, !tbaa !27
  %287 = zext i8 %286 to i32
  %288 = icmp ne i32 %287, 4
  br i1 %288, label %289, label %297

289:                                              ; preds = %285, %277, %269, %261
  %290 = load ptr, ptr %4, align 8, !tbaa !5
  call void @png_warning(ptr noundef %290, ptr noundef @.str.94)
  %291 = load ptr, ptr %4, align 8, !tbaa !5
  %292 = load ptr, ptr %4, align 8, !tbaa !5
  %293 = getelementptr inbounds %struct.png_struct_def, ptr %292, i32 0, i32 136
  %294 = load ptr, ptr %293, align 8, !tbaa !25
  call void @png_free(ptr noundef %291, ptr noundef %294)
  %295 = load ptr, ptr %4, align 8, !tbaa !5
  %296 = getelementptr inbounds %struct.png_struct_def, ptr %295, i32 0, i32 136
  store ptr null, ptr %296, align 8, !tbaa !25
  store i32 1, ptr %17, align 4
  br label %399

297:                                              ; preds = %285, %281
  %298 = load i8, ptr %9, align 1, !tbaa !27
  %299 = zext i8 %298 to i32
  %300 = icmp sge i32 %299, 4
  br i1 %300, label %301, label %303

301:                                              ; preds = %297
  %302 = load ptr, ptr %4, align 8, !tbaa !5
  call void @png_warning(ptr noundef %302, ptr noundef @.str.95)
  br label %303

303:                                              ; preds = %301, %297
  br label %304

304:                                              ; preds = %303
  %305 = load ptr, ptr %12, align 8, !tbaa !5
  store ptr %305, ptr %11, align 8, !tbaa !5
  br label %306

306:                                              ; preds = %311, %304
  %307 = load ptr, ptr %11, align 8, !tbaa !5
  %308 = load i8, ptr %307, align 1, !tbaa !27
  %309 = icmp ne i8 %308, 0
  br i1 %309, label %310, label %314

310:                                              ; preds = %306
  br label %311

311:                                              ; preds = %310
  %312 = load ptr, ptr %11, align 8, !tbaa !5
  %313 = getelementptr inbounds i8, ptr %312, i32 1
  store ptr %313, ptr %11, align 8, !tbaa !5
  br label %306, !llvm.loop !30

314:                                              ; preds = %306
  %315 = load ptr, ptr %4, align 8, !tbaa !5
  %316 = load i8, ptr %10, align 1, !tbaa !27
  %317 = zext i8 %316 to i64
  %318 = mul i64 %317, 8
  %319 = call ptr @png_malloc_warn(ptr noundef %315, i64 noundef %318)
  store ptr %319, ptr %14, align 8, !tbaa !5
  %320 = load ptr, ptr %14, align 8, !tbaa !5
  %321 = icmp eq ptr %320, null
  br i1 %321, label %322, label %330

322:                                              ; preds = %314
  %323 = load ptr, ptr %4, align 8, !tbaa !5
  %324 = load ptr, ptr %4, align 8, !tbaa !5
  %325 = getelementptr inbounds %struct.png_struct_def, ptr %324, i32 0, i32 136
  %326 = load ptr, ptr %325, align 8, !tbaa !25
  call void @png_free(ptr noundef %323, ptr noundef %326)
  %327 = load ptr, ptr %4, align 8, !tbaa !5
  %328 = getelementptr inbounds %struct.png_struct_def, ptr %327, i32 0, i32 136
  store ptr null, ptr %328, align 8, !tbaa !25
  %329 = load ptr, ptr %4, align 8, !tbaa !5
  call void @png_warning(ptr noundef %329, ptr noundef @.str.96)
  store i32 1, ptr %17, align 4
  br label %399

330:                                              ; preds = %314
  store i32 0, ptr %16, align 4, !tbaa !9
  br label %331

331:                                              ; preds = %374, %330
  %332 = load i32, ptr %16, align 4, !tbaa !9
  %333 = load i8, ptr %10, align 1, !tbaa !27
  %334 = zext i8 %333 to i32
  %335 = icmp slt i32 %332, %334
  br i1 %335, label %336, label %377

336:                                              ; preds = %331
  %337 = load ptr, ptr %11, align 8, !tbaa !5
  %338 = getelementptr inbounds i8, ptr %337, i32 1
  store ptr %338, ptr %11, align 8, !tbaa !5
  %339 = load ptr, ptr %11, align 8, !tbaa !5
  %340 = load ptr, ptr %14, align 8, !tbaa !5
  %341 = load i32, ptr %16, align 4, !tbaa !9
  %342 = sext i32 %341 to i64
  %343 = getelementptr inbounds ptr, ptr %340, i64 %342
  store ptr %339, ptr %343, align 8, !tbaa !5
  br label %344

344:                                              ; preds = %356, %336
  %345 = load ptr, ptr %11, align 8, !tbaa !5
  %346 = load ptr, ptr %13, align 8, !tbaa !5
  %347 = icmp ule ptr %345, %346
  br i1 %347, label %348, label %353

348:                                              ; preds = %344
  %349 = load ptr, ptr %11, align 8, !tbaa !5
  %350 = load i8, ptr %349, align 1, !tbaa !27
  %351 = sext i8 %350 to i32
  %352 = icmp ne i32 %351, 0
  br label %353

353:                                              ; preds = %348, %344
  %354 = phi i1 [ false, %344 ], [ %352, %348 ]
  br i1 %354, label %355, label %359

355:                                              ; preds = %353
  br label %356

356:                                              ; preds = %355
  %357 = load ptr, ptr %11, align 8, !tbaa !5
  %358 = getelementptr inbounds i8, ptr %357, i32 1
  store ptr %358, ptr %11, align 8, !tbaa !5
  br label %344, !llvm.loop !31

359:                                              ; preds = %353
  %360 = load ptr, ptr %11, align 8, !tbaa !5
  %361 = load ptr, ptr %13, align 8, !tbaa !5
  %362 = icmp ugt ptr %360, %361
  br i1 %362, label %363, label %373

363:                                              ; preds = %359
  %364 = load ptr, ptr %4, align 8, !tbaa !5
  call void @png_warning(ptr noundef %364, ptr noundef @.str.93)
  %365 = load ptr, ptr %4, align 8, !tbaa !5
  %366 = load ptr, ptr %4, align 8, !tbaa !5
  %367 = getelementptr inbounds %struct.png_struct_def, ptr %366, i32 0, i32 136
  %368 = load ptr, ptr %367, align 8, !tbaa !25
  call void @png_free(ptr noundef %365, ptr noundef %368)
  %369 = load ptr, ptr %4, align 8, !tbaa !5
  %370 = getelementptr inbounds %struct.png_struct_def, ptr %369, i32 0, i32 136
  store ptr null, ptr %370, align 8, !tbaa !25
  %371 = load ptr, ptr %4, align 8, !tbaa !5
  %372 = load ptr, ptr %14, align 8, !tbaa !5
  call void @png_free(ptr noundef %371, ptr noundef %372)
  store i32 1, ptr %17, align 4
  br label %399

373:                                              ; preds = %359
  br label %374

374:                                              ; preds = %373
  %375 = load i32, ptr %16, align 4, !tbaa !9
  %376 = add nsw i32 %375, 1
  store i32 %376, ptr %16, align 4, !tbaa !9
  br label %331, !llvm.loop !32

377:                                              ; preds = %331
  %378 = load ptr, ptr %4, align 8, !tbaa !5
  %379 = load ptr, ptr %5, align 8, !tbaa !5
  %380 = load ptr, ptr %4, align 8, !tbaa !5
  %381 = getelementptr inbounds %struct.png_struct_def, ptr %380, i32 0, i32 136
  %382 = load ptr, ptr %381, align 8, !tbaa !25
  %383 = load i32, ptr %7, align 4, !tbaa !9
  %384 = load i32, ptr %8, align 4, !tbaa !9
  %385 = load i8, ptr %9, align 1, !tbaa !27
  %386 = zext i8 %385 to i32
  %387 = load i8, ptr %10, align 1, !tbaa !27
  %388 = zext i8 %387 to i32
  %389 = load ptr, ptr %12, align 8, !tbaa !5
  %390 = load ptr, ptr %14, align 8, !tbaa !5
  call void @png_set_pCAL(ptr noundef %378, ptr noundef %379, ptr noundef %382, i32 noundef %383, i32 noundef %384, i32 noundef %386, i32 noundef %388, ptr noundef %389, ptr noundef %390)
  %391 = load ptr, ptr %4, align 8, !tbaa !5
  %392 = load ptr, ptr %4, align 8, !tbaa !5
  %393 = getelementptr inbounds %struct.png_struct_def, ptr %392, i32 0, i32 136
  %394 = load ptr, ptr %393, align 8, !tbaa !25
  call void @png_free(ptr noundef %391, ptr noundef %394)
  %395 = load ptr, ptr %4, align 8, !tbaa !5
  %396 = getelementptr inbounds %struct.png_struct_def, ptr %395, i32 0, i32 136
  store ptr null, ptr %396, align 8, !tbaa !25
  %397 = load ptr, ptr %4, align 8, !tbaa !5
  %398 = load ptr, ptr %14, align 8, !tbaa !5
  call void @png_free(ptr noundef %397, ptr noundef %398)
  store i32 0, ptr %17, align 4
  br label %399

399:                                              ; preds = %377, %363, %322, %289, %115, %81, %68, %45, %31
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #3
  call void @llvm.lifetime.end.p0(i64 1, ptr %10) #3
  call void @llvm.lifetime.end.p0(i64 1, ptr %9) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #3
  %400 = load i32, ptr %17, align 4
  switch i32 %400, label %402 [
    i32 0, label %401
    i32 1, label %401
  ]

401:                                              ; preds = %399, %399
  ret void

402:                                              ; preds = %399
  unreachable
}

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

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { 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 #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 284}
!12 = !{!"png_struct_def", !7, i64 0, !6, i64 200, !6, i64 208, !6, 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, !13, i64 296, !6, i64 408, !14, i64 416, !10, i64 424, !10, i64 428, !10, i64 432, !10, i64 436, !10, i64 440, !10, i64 444, !10, i64 448, !10, i64 452, !10, i64 456, !14, i64 464, !14, i64 472, !10, i64 480, !10, i64 484, !6, i64 488, !6, i64 496, !6, i64 504, !6, i64 512, !6, i64 520, !6, i64 528, !15, i64 536, !10, i64 560, !10, i64 564, !6, i64 568, !16, i64 576, !16, i64 578, !7, i64 580, !7, i64 585, !7, i64 586, !7, i64 587, !7, i64 588, !7, i64 589, !7, i64 590, !7, i64 591, !7, i64 592, !7, i64 593, !7, i64 594, !7, i64 595, !7, i64 596, !16, i64 598, !7, i64 600, !17, i64 604, !18, i64 608, !18, i64 618, !6, i64 632, !10, i64 640, !10, i64 644, !10, i64 648, !17, i64 652, !17, i64 656, !6, i64 664, !6, i64 672, !6, i64 680, !6, i64 688, !6, i64 696, !6, i64 704, !19, i64 712, !19, i64 717, !6, i64 728, !18, i64 736, !6, i64 752, !6, i64 760, !6, i64 768, !6, i64 776, !6, i64 784, !6, i64 792, !6, i64 800, !6, i64 808, !6, i64 816, !10, i64 824, !10, i64 828, !14, i64 832, !14, i64 840, !14, i64 848, !14, i64 856, !10, i64 864, !10, i64 868, !14, i64 872, !14, i64 880, !6, i64 888, !6, i64 896, !6, i64 904, !6, i64 912, !6, i64 920, !7, i64 928, !7, i64 929, !6, i64 936, !6, i64 944, !6, i64 952, !6, i64 960, !6, i64 968, !6, i64 976, !10, i64 984, !6, i64 992, !6, i64 1000, !10, i64 1008, !6, i64 1016, !7, i64 1024, !16, i64 1026, !16, i64 1028, !16, i64 1030, !10, i64 1032, !10, i64 1036, !7, i64 1040, !6, i64 1048, !6, i64 1056, !6, i64 1064, !6, i64 1072, !6, i64 1080, !6, i64 1088, !6, i64 1096, !7, i64 1104, !10, i64 1108, !10, i64 1112, !10, i64 1116, !20, i64 1120, !10, i64 1152, !10, i64 1156, !6, i64 1160, !10, i64 1168}
!13 = !{!"z_stream_s", !6, i64 0, !10, i64 8, !14, i64 16, !6, i64 24, !10, i64 32, !14, i64 40, !6, i64 48, !6, i64 56, !6, i64 64, !6, i64 72, !6, i64 80, !10, i64 88, !14, i64 96, !14, i64 104}
!14 = !{!"long", !7, i64 0}
!15 = !{!"png_row_info_struct", !10, i64 0, !14, i64 8, !7, i64 16, !7, i64 17, !7, i64 18, !7, i64 19}
!16 = !{!"short", !7, i64 0}
!17 = !{!"float", !7, i64 0}
!18 = !{!"png_color_16_struct", !7, i64 0, !16, i64 2, !16, i64 4, !16, i64 6, !16, i64 8}
!19 = !{!"png_color_8_struct", !7, i64 0, !7, i64 1, !7, i64 2, !7, i64 3, !7, i64 4}
!20 = !{!"png_unknown_chunk_t", !7, i64 0, !6, i64 8, !14, i64 16, !7, i64 24}
!21 = !{!22, !10, i64 8}
!22 = !{!"png_info_struct", !10, i64 0, !10, i64 4, !10, i64 8, !14, i64 16, !6, i64 24, !16, i64 32, !16, 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, !7, i64 56, !10, i64 60, !10, i64 64, !6, i64 72, !23, i64 80, !19, i64 88, !6, i64 96, !18, i64 104, !18, i64 114, !10, i64 124, !10, i64 128, !7, i64 132, !10, i64 136, !10, i64 140, !7, i64 144, !6, i64 152, !17, i64 160, !17, i64 164, !17, i64 168, !17, i64 172, !17, i64 176, !17, i64 180, !17, i64 184, !17, i64 188, !6, i64 192, !10, i64 200, !10, i64 204, !6, i64 208, !6, i64 216, !7, i64 224, !7, i64 225, !10, i64 228, !6, i64 232, !14, i64 240, !6, i64 248, !6, i64 256, !10, i64 264, !7, i64 268, !6, i64 272, !10, i64 280, !7, i64 284, !24, i64 288, !24, i64 296, !6, i64 304, !6, i64 312, !6, i64 320, !10, i64 328, !10, i64 332, !10, i64 336, !10, i64 340, !10, i64 344, !10, i64 348, !10, i64 352, !10, i64 356, !10, i64 360}
!23 = !{!"png_time_struct", !16, i64 0, !7, i64 2, !7, i64 3, !7, i64 4, !7, i64 5, !7, i64 6}
!24 = !{!"double", !7, i64 0}
!25 = !{!12, !6, i64 1160}
!26 = !{!14, !14, i64 0}
!27 = !{!7, !7, i64 0}
!28 = distinct !{!28, !29}
!29 = !{!"llvm.loop.mustprogress"}
!30 = distinct !{!30, !29}
!31 = distinct !{!31, !29}
!32 = distinct !{!32, !29}


; Optimized IR (opt -passes='default<O3>'):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

@.str.89 = external hidden unnamed_addr constant [25 x i8], align 1
@.str.90 = external hidden unnamed_addr constant [24 x i8], align 1
@.str.91 = external hidden unnamed_addr constant [21 x i8], align 1
@.str.92 = external hidden unnamed_addr constant [27 x i8], align 1
@.str.93 = external hidden unnamed_addr constant [18 x i8], align 1
@.str.94 = external hidden unnamed_addr constant [42 x i8], align 1
@.str.95 = external hidden unnamed_addr constant [42 x i8], align 1
@.str.96 = external hidden unnamed_addr constant [26 x i8], align 1

declare void @png_error(ptr noundef, ptr noundef) local_unnamed_addr #0

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

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

declare void @png_warning(ptr noundef, ptr noundef) local_unnamed_addr #0

declare ptr @png_malloc_warn(ptr noundef, i64 noundef) local_unnamed_addr #0

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

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

7:                                                ; preds = %3
  tail call void @png_error(ptr noundef nonnull %0, ptr noundef nonnull @.str.89) #2
  br label %19

8:                                                ; preds = %3
  %9 = and i32 %5, 4
  %.not133 = icmp eq i32 %9, 0
  br i1 %.not133, label %12, label %10

10:                                               ; preds = %8
  tail call void @png_warning(ptr noundef nonnull %0, ptr noundef nonnull @.str.90) #2
  %11 = tail call i32 @png_crc_finish(ptr noundef nonnull %0, i32 noundef %2)
  br label %152

12:                                               ; preds = %8
  %.not134 = icmp eq ptr %1, null
  br i1 %.not134, label %19, label %13

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

17:                                               ; preds = %13
  tail call void @png_warning(ptr noundef nonnull %0, ptr noundef nonnull @.str.91) #2
  %18 = tail call i32 @png_crc_finish(ptr noundef nonnull %0, i32 noundef %2)
  br label %152

19:                                               ; preds = %13, %12, %7
  %20 = getelementptr inbounds i8, ptr %0, i64 1160
  %21 = load ptr, ptr %20, align 8, !tbaa !23
  tail call void @png_free(ptr noundef nonnull %0, ptr noundef %21) #2
  %22 = add i32 %2, 1
  %23 = zext i32 %22 to i64
  %24 = tail call ptr @png_malloc_warn(ptr noundef nonnull %0, i64 noundef %23) #2
  store ptr %24, ptr %20, align 8, !tbaa !23
  %25 = icmp eq ptr %24, null
  br i1 %25, label %26, label %27

26:                                               ; preds = %19
  tail call void @png_warning(ptr noundef nonnull %0, ptr noundef nonnull @.str.92) #2
  br label %152

27:                                               ; preds = %19
  %28 = zext i32 %2 to i64
  tail call void @png_crc_read(ptr noundef nonnull %0, ptr noundef nonnull %24, i64 noundef %28)
  %29 = tail call i32 @png_crc_finish(ptr noundef nonnull %0, i32 noundef 0)
  %.not136 = icmp eq i32 %29, 0
  %30 = load ptr, ptr %20, align 8, !tbaa !23
  br i1 %.not136, label %32, label %31

31:                                               ; preds = %27
  tail call void @png_free(ptr noundef nonnull %0, ptr noundef %30) #2
  store ptr null, ptr %20, align 8, !tbaa !23
  br label %152

32:                                               ; preds = %27
  %33 = getelementptr inbounds i8, ptr %30, i64 %28
  store i8 0, ptr %33, align 1, !tbaa !24
  %34 = load ptr, ptr %20, align 8, !tbaa !23
  br label %35

35:                                               ; preds = %35, %32
  %.0127 = phi ptr [ %34, %32 ], [ %37, %35 ]
  %36 = load i8, ptr %.0127, align 1, !tbaa !24
  %.not137 = icmp eq i8 %36, 0
  %37 = getelementptr inbounds i8, ptr %.0127, i64 1
  br i1 %.not137, label %38, label %35, !llvm.loop !25

38:                                               ; preds = %35
  %39 = getelementptr inbounds i8, ptr %34, i64 %28
  %40 = getelementptr inbounds i8, ptr %.0127, i64 12
  %.not138 = icmp ugt ptr %39, %40
  br i1 %.not138, label %43, label %41

41:                                               ; preds = %38
  tail call void @png_warning(ptr noundef %0, ptr noundef nonnull @.str.93) #2
  %42 = load ptr, ptr %20, align 8, !tbaa !23
  tail call void @png_free(ptr noundef %0, ptr noundef %42) #2
  store ptr null, ptr %20, align 8, !tbaa !23
  br label %152

43:                                               ; preds = %38
  %44 = load i8, ptr %37, align 1, !tbaa !24
  %45 = zext i8 %44 to i32
  %.not139 = icmp sgt i8 %44, -1
  br i1 %.not139, label %60, label %46

46:                                               ; preds = %43
  %47 = getelementptr inbounds i8, ptr %.0127, i64 2
  %48 = load i8, ptr %47, align 1, !tbaa !24
  %49 = zext i8 %48 to i32
  %.neg140.neg = shl nuw nsw i32 %49, 16
  %50 = shl nuw i32 %45, 24
  %51 = getelementptr inbounds i8, ptr %.0127, i64 3
  %52 = load i8, ptr %51, align 1, !tbaa !24
  %53 = zext i8 %52 to i32
  %54 = shl nuw nsw i32 %53, 8
  %55 = getelementptr inbounds i8, ptr %.0127, i64 4
  %56 = load i8, ptr %55, align 1, !tbaa !24
  %57 = zext i8 %56 to i32
  %58 = or disjoint i32 %.neg140.neg, %50
  %59 = or disjoint i32 %58, %54
  %.neg144.neg = or disjoint i32 %59, %57
  br label %76

60:                                               ; preds = %43
  %61 = shl nuw nsw i32 %45, 24
  %62 = getelementptr inbounds i8, ptr %.0127, i64 2
  %63 = load i8, ptr %62, align 1, !tbaa !24
  %64 = zext i8 %63 to i32
  %65 = shl nuw nsw i32 %64, 16
  %66 = or disjoint i32 %65, %61
  %67 = getelementptr inbounds i8, ptr %.0127, i64 3
  %68 = load i8, ptr %67, align 1, !tbaa !24
  %69 = zext i8 %68 to i32
  %70 = shl nuw nsw i32 %69, 8
  %71 = or disjoint i32 %66, %70
  %72 = getelementptr inbounds i8, ptr %.0127, i64 4
  %73 = load i8, ptr %72, align 1, !tbaa !24
  %74 = zext i8 %73 to i32
  %75 = or disjoint i32 %71, %74
  br label %76

76:                                               ; preds = %60, %46
  %77 = phi i32 [ %.neg144.neg, %46 ], [ %75, %60 ]
  %78 = getelementptr inbounds i8, ptr %.0127, i64 5
  %79 = load i8, ptr %78, align 1, !tbaa !24
  %80 = zext i8 %79 to i32
  %.not145 = icmp sgt i8 %79, -1
  br i1 %.not145, label %95, label %81

81:                                               ; preds = %76
  %82 = getelementptr inbounds i8, ptr %.0127, i64 6
  %83 = load i8, ptr %82, align 1, !tbaa !24
  %84 = zext i8 %83 to i32
  %.neg146.neg = shl nuw nsw i32 %84, 16
  %85 = shl nuw i32 %80, 24
  %86 = getelementptr inbounds i8, ptr %.0127, i64 7
  %87 = load i8, ptr %86, align 1, !tbaa !24
  %88 = zext i8 %87 to i32
  %89 = shl nuw nsw i32 %88, 8
  %90 = getelementptr inbounds i8, ptr %.0127, i64 8
  %91 = load i8, ptr %90, align 1, !tbaa !24
  %92 = zext i8 %91 to i32
  %93 = or disjoint i32 %.neg146.neg, %85
  %94 = or disjoint i32 %93, %89
  %.neg150.neg = or disjoint i32 %94, %92
  br label %111

95:                                               ; preds = %76
  %96 = shl nuw nsw i32 %80, 24
  %97 = getelementptr inbounds i8, ptr %.0127, i64 6
  %98 = load i8, ptr %97, align 1, !tbaa !24
  %99 = zext i8 %98 to i32
  %100 = shl nuw nsw i32 %99, 16
  %101 = or disjoint i32 %100, %96
  %102 = getelementptr inbounds i8, ptr %.0127, i64 7
  %103 = load i8, ptr %102, align 1, !tbaa !24
  %104 = zext i8 %103 to i32
  %105 = shl nuw nsw i32 %104, 8
  %106 = or disjoint i32 %101, %105
  %107 = getelementptr inbounds i8, ptr %.0127, i64 8
  %108 = load i8, ptr %107, align 1, !tbaa !24
  %109 = zext i8 %108 to i32
  %110 = or disjoint i32 %106, %109
  br label %111

111:                                              ; preds = %95, %81
  %112 = phi i32 [ %.neg150.neg, %81 ], [ %110, %95 ]
  %113 = getelementptr inbounds i8, ptr %.0127, i64 9
  %114 = load i8, ptr %113, align 1, !tbaa !24
  %115 = getelementptr inbounds i8, ptr %.0127, i64 10
  %116 = load i8, ptr %115, align 1, !tbaa !24
  %117 = getelementptr inbounds i8, ptr %.0127, i64 11
  %118 = zext i8 %114 to i32
  %119 = icmp eq i8 %114, 0
  %120 = zext i8 %116 to i32
  %121 = icmp ne i8 %116, 2
  %or.cond = select i1 %119, i1 %121, i1 false
  br i1 %or.cond, label %129, label %122

122:                                              ; preds = %111
  %123 = icmp ne i8 %116, 3
  %124 = add i8 %114, -1
  %125 = icmp ult i8 %124, 2
  %or.cond154 = select i1 %125, i1 %123, i1 false
  br i1 %or.cond154, label %129, label %126

126:                                              ; preds = %122
  %127 = icmp eq i8 %114, 3
  %128 = icmp ne i8 %116, 4
  %or.cond11 = select i1 %127, i1 %128, i1 false
  br i1 %or.cond11, label %129, label %131

129:                                              ; preds = %126, %122, %111
  tail call void @png_warning(ptr noundef %0, ptr noundef nonnull @.str.94) #2
  %130 = load ptr, ptr %20, align 8, !tbaa !23
  tail call void @png_free(ptr noundef %0, ptr noundef %130) #2
  store ptr null, ptr %20, align 8, !tbaa !23
  br label %152

131:                                              ; preds = %126
  %132 = icmp ugt i8 %114, 3
  br i1 %132, label %133, label %.preheader173

133:                                              ; preds = %131
  tail call void @png_warning(ptr noundef %0, ptr noundef nonnull @.str.95) #2
  br label %.preheader173

.preheader173:                                    ; preds = %131, %133
  br label %134

134:                                              ; preds = %.preheader173, %134
  %.1 = phi ptr [ %136, %134 ], [ %117, %.preheader173 ]
  %135 = load i8, ptr %.1, align 1, !tbaa !24
  %.not151 = icmp eq i8 %135, 0
  %136 = getelementptr inbounds i8, ptr %.1, i64 1
  br i1 %.not151, label %137, label %134, !llvm.loop !27

137:                                              ; preds = %134
  %138 = zext i8 %116 to i64
  %139 = shl nuw nsw i64 %138, 3
  %140 = tail call ptr @png_malloc_warn(ptr noundef %0, i64 noundef %139) #2
  %141 = icmp eq ptr %140, null
  br i1 %141, label %142, label %.preheader

.preheader:                                       ; preds = %137
  %.not163 = icmp eq i8 %116, 0
  br i1 %.not163, label %._crit_edge162, label %.lr.ph161.preheader

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

142:                                              ; preds = %137
  %143 = load ptr, ptr %20, align 8, !tbaa !23
  tail call void @png_free(ptr noundef %0, ptr noundef %143) #2
  store ptr null, ptr %20, align 8, !tbaa !23
  tail call void @png_warning(ptr noundef %0, ptr noundef nonnull @.str.96) #2
  br label %152

.lr.ph161:                                        ; preds = %.lr.ph161.preheader, %.critedge
  %indvars.iv = phi i64 [ 0, %.lr.ph161.preheader ], [ %indvars.iv.next, %.critedge ]
  %.2159 = phi ptr [ %.1, %.lr.ph161.preheader ], [ %.3157, %.critedge ]
  %144 = getelementptr inbounds i8, ptr %.2159, i64 1
  %145 = getelementptr inbounds ptr, ptr %140, i64 %indvars.iv
  store ptr %144, ptr %145, align 8, !tbaa !28
  %.not152156 = icmp ugt ptr %144, %39
  br i1 %.not152156, label %._crit_edge, label %.lr.ph

.lr.ph:                                           ; preds = %.lr.ph161, %147
  %.3157 = phi ptr [ %148, %147 ], [ %144, %.lr.ph161 ]
  %146 = load i8, ptr %.3157, align 1, !tbaa !24
  %.not153 = icmp eq i8 %146, 0
  br i1 %.not153, label %.critedge, label %147

147:                                              ; preds = %.lr.ph
  %148 = getelementptr inbounds i8, ptr %.3157, i64 1
  %.not152 = icmp ugt ptr %148, %39
  br i1 %.not152, label %._crit_edge, label %.lr.ph, !llvm.loop !29

._crit_edge:                                      ; preds = %.lr.ph161, %147
  tail call void @png_warning(ptr noundef %0, ptr noundef nonnull @.str.93) #2
  %149 = load ptr, ptr %20, align 8, !tbaa !23
  tail call void @png_free(ptr noundef %0, ptr noundef %149) #2
  store ptr null, ptr %20, align 8, !tbaa !23
  tail call void @png_free(ptr noundef %0, ptr noundef nonnull %140) #2
  br label %152

.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_edge162, label %.lr.ph161, !llvm.loop !30

._crit_edge162:                                   ; preds = %.critedge, %.preheader
  %150 = load ptr, ptr %20, align 8, !tbaa !23
  tail call void @png_set_pCAL(ptr noundef %0, ptr noundef %1, ptr noundef %150, i32 noundef %77, i32 noundef %112, i32 noundef %118, i32 noundef %120, ptr noundef nonnull %117, ptr noundef nonnull %140) #2
  %151 = load ptr, ptr %20, align 8, !tbaa !23
  tail call void @png_free(ptr noundef %0, ptr noundef %151) #2
  store ptr null, ptr %20, align 8, !tbaa !23
  tail call void @png_free(ptr noundef %0, ptr noundef nonnull %140) #2
  br label %152

152:                                              ; preds = %._crit_edge162, %._crit_edge, %142, %129, %41, %31, %26, %17, %10
  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 #0

attributes #0 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { nounwind }

!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, !10, i64 284}
!6 = !{!"png_struct_def", !7, i64 0, !9, i64 200, !9, i64 208, !9, 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, !10, i64 284, !10, i64 288, !10, i64 292, !11, i64 296, !9, i64 408, !12, i64 416, !10, i64 424, !10, i64 428, !10, i64 432, !10, i64 436, !10, i64 440, !10, i64 444, !10, i64 448, !10, i64 452, !10, i64 456, !12, i64 464, !12, i64 472, !10, i64 480, !10, i64 484, !9, i64 488, !9, i64 496, !9, i64 504, !9, i64 512, !9, i64 520, !9, i64 528, !13, i64 536, !10, i64 560, !10, i64 564, !9, i64 568, !14, i64 576, !14, i64 578, !7, i64 580, !7, i64 585, !7, i64 586, !7, i64 587, !7, i64 588, !7, i64 589, !7, i64 590, !7, i64 591, !7, i64 592, !7, i64 593, !7, i64 594, !7, i64 595, !7, i64 596, !14, i64 598, !7, i64 600, !15, i64 604, !16, i64 608, !16, i64 618, !9, i64 632, !10, i64 640, !10, i64 644, !10, i64 648, !15, i64 652, !15, i64 656, !9, i64 664, !9, i64 672, !9, i64 680, !9, i64 688, !9, i64 696, !9, i64 704, !17, i64 712, !17, i64 717, !9, i64 728, !16, i64 736, !9, i64 752, !9, i64 760, !9, i64 768, !9, i64 776, !9, i64 784, !9, i64 792, !9, i64 800, !9, i64 808, !9, i64 816, !10, i64 824, !10, i64 828, !12, i64 832, !12, i64 840, !12, i64 848, !12, i64 856, !10, i64 864, !10, i64 868, !12, i64 872, !12, i64 880, !9, i64 888, !9, i64 896, !9, i64 904, !9, i64 912, !9, i64 920, !7, i64 928, !7, i64 929, !9, i64 936, !9, i64 944, !9, i64 952, !9, i64 960, !9, i64 968, !9, i64 976, !10, i64 984, !9, i64 992, !9, i64 1000, !10, i64 1008, !9, i64 1016, !7, i64 1024, !14, i64 1026, !14, i64 1028, !14, i64 1030, !10, i64 1032, !10, i64 1036, !7, i64 1040, !9, i64 1048, !9, i64 1056, !9, i64 1064, !9, i64 1072, !9, i64 1080, !9, i64 1088, !9, i64 1096, !7, i64 1104, !10, i64 1108, !10, i64 1112, !10, i64 1116, !18, i64 1120, !10, i64 1152, !10, i64 1156, !9, i64 1160, !10, i64 1168}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!"any pointer", !7, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = !{!"z_stream_s", !9, i64 0, !10, i64 8, !12, i64 16, !9, i64 24, !10, i64 32, !12, i64 40, !9, i64 48, !9, i64 56, !9, i64 64, !9, i64 72, !9, i64 80, !10, i64 88, !12, i64 96, !12, i64 104}
!12 = !{!"long", !7, i64 0}
!13 = !{!"png_row_info_struct", !10, i64 0, !12, i64 8, !7, i64 16, !7, i64 17, !7, i64 18, !7, i64 19}
!14 = !{!"short", !7, i64 0}
!15 = !{!"float", !7, i64 0}
!16 = !{!"png_color_16_struct", !7, i64 0, !14, i64 2, !14, i64 4, !14, i64 6, !14, 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, !9, i64 8, !12, i64 16, !7, i64 24}
!19 = !{!20, !10, i64 8}
!20 = !{!"png_info_struct", !10, i64 0, !10, i64 4, !10, i64 8, !12, i64 16, !9, i64 24, !14, i64 32, !14, 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, !15, i64 52, !7, i64 56, !10, i64 60, !10, i64 64, !9, i64 72, !21, i64 80, !17, i64 88, !9, i64 96, !16, i64 104, !16, i64 114, !10, i64 124, !10, i64 128, !7, i64 132, !10, i64 136, !10, i64 140, !7, i64 144, !9, i64 152, !15, i64 160, !15, i64 164, !15, i64 168, !15, i64 172, !15, i64 176, !15, i64 180, !15, i64 184, !15, i64 188, !9, i64 192, !10, i64 200, !10, i64 204, !9, i64 208, !9, i64 216, !7, i64 224, !7, i64 225, !10, i64 228, !9, i64 232, !12, i64 240, !9, i64 248, !9, i64 256, !10, i64 264, !7, i64 268, !9, i64 272, !10, i64 280, !7, i64 284, !22, i64 288, !22, i64 296, !9, i64 304, !9, i64 312, !9, i64 320, !10, i64 328, !10, i64 332, !10, i64 336, !10, i64 340, !10, i64 344, !10, i64 348, !10, i64 352, !10, i64 356, !10, i64 360}
!21 = !{!"png_time_struct", !14, i64 0, !7, i64 2, !7, i64 3, !7, i64 4, !7, i64 5, !7, i64 6}
!22 = !{!"double", !7, i64 0}
!23 = !{!6, !9, i64 1160}
!24 = !{!7, !7, i64 0}
!25 = distinct !{!25, !26}
!26 = !{!"llvm.loop.mustprogress"}
!27 = distinct !{!27, !26}
!28 = !{!9, !9, i64 0}
!29 = distinct !{!29, !26}
!30 = distinct !{!30, !26}


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