; LLVM IR from rdguez-mariano/fast_imas_IPOL :: io_png/libs/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, i8, i8, i64, i64, i64, %struct.z_stream_s, ptr, i64, i32, i32, i32, i32, i32, i64, i64, i64, i64, i64, i64, i64, i64, ptr, ptr, ptr, ptr, ptr, ptr, %struct.png_row_info_struct, i64, i64, 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, i64, i64, 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, i64, i64, i64, i64, i64, i64, i32, i32, i64, i64, ptr, ptr, ptr, ptr, ptr, i8, i8, ptr, ptr, ptr, ptr, ptr, ptr, i64, ptr, ptr, i32, ptr, i8, i16, i16, i16, i64, i64, i8, i8, i64, i64, ptr, ptr, ptr, ptr, ptr, ptr, ptr, i8, i64, i64, %struct.png_unknown_chunk_t, i64, i64, ptr }
%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 { i64, 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 }

@png_decompress_chunk.msg = external hidden constant [31 x i8], align 16
@.str.2 = external hidden unnamed_addr constant [38 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [39 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [40 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [50 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [48 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [45 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [28 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [33 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: nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #2

; Function Attrs: nounwind uwtable
define dso_local void @png_decompress_chunk(ptr noundef %0, i32 noundef %1, i64 noundef %2, i64 noundef %3, ptr noundef %4) #3 {
  %6 = alloca ptr, align 8
  %7 = alloca i32, align 4
  %8 = alloca i64, align 8
  %9 = alloca i64, align 8
  %10 = alloca ptr, align 8
  %11 = alloca ptr, align 8
  %12 = alloca i64, align 8
  %13 = alloca i32, align 4
  %14 = alloca ptr, align 8
  %15 = alloca [52 x i8], align 16
  %16 = alloca [50 x i8], align 16
  store ptr %0, ptr %6, align 8, !tbaa !5
  store i32 %1, ptr %7, align 4, !tbaa !9
  store i64 %2, ptr %8, align 8, !tbaa !11
  store i64 %3, ptr %9, align 8, !tbaa !11
  store ptr %4, ptr %10, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #5
  %17 = load i32, ptr %7, align 4, !tbaa !9
  %18 = icmp eq i32 %17, 0
  br i1 %18, label %19, label %346

19:                                               ; preds = %5
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #5
  store i32 0, ptr %13, align 4, !tbaa !9
  %20 = load ptr, ptr %6, align 8, !tbaa !5
  %21 = getelementptr inbounds %struct.png_struct_def, ptr %20, i32 0, i32 137
  %22 = load ptr, ptr %21, align 8, !tbaa !13
  %23 = load i64, ptr %9, align 8, !tbaa !11
  %24 = getelementptr inbounds i8, ptr %22, i64 %23
  %25 = load ptr, ptr %6, align 8, !tbaa !5
  %26 = getelementptr inbounds %struct.png_struct_def, ptr %25, i32 0, i32 15
  %27 = getelementptr inbounds %struct.z_stream_s, ptr %26, i32 0, i32 0
  store ptr %24, ptr %27, align 8, !tbaa !22
  %28 = load i64, ptr %8, align 8, !tbaa !11
  %29 = load i64, ptr %9, align 8, !tbaa !11
  %30 = sub i64 %28, %29
  %31 = trunc i64 %30 to i32
  %32 = load ptr, ptr %6, align 8, !tbaa !5
  %33 = getelementptr inbounds %struct.png_struct_def, ptr %32, i32 0, i32 15
  %34 = getelementptr inbounds %struct.z_stream_s, ptr %33, i32 0, i32 1
  store i32 %31, ptr %34, align 8, !tbaa !23
  %35 = load ptr, ptr %6, align 8, !tbaa !5
  %36 = getelementptr inbounds %struct.png_struct_def, ptr %35, i32 0, i32 16
  %37 = load ptr, ptr %36, align 8, !tbaa !24
  %38 = load ptr, ptr %6, align 8, !tbaa !5
  %39 = getelementptr inbounds %struct.png_struct_def, ptr %38, i32 0, i32 15
  %40 = getelementptr inbounds %struct.z_stream_s, ptr %39, i32 0, i32 3
  store ptr %37, ptr %40, align 8, !tbaa !25
  %41 = load ptr, ptr %6, align 8, !tbaa !5
  %42 = getelementptr inbounds %struct.png_struct_def, ptr %41, i32 0, i32 17
  %43 = load i64, ptr %42, align 8, !tbaa !26
  %44 = trunc i64 %43 to i32
  %45 = load ptr, ptr %6, align 8, !tbaa !5
  %46 = getelementptr inbounds %struct.png_struct_def, ptr %45, i32 0, i32 15
  %47 = getelementptr inbounds %struct.z_stream_s, ptr %46, i32 0, i32 4
  store i32 %44, ptr %47, align 8, !tbaa !27
  store i64 0, ptr %12, align 8, !tbaa !11
  store ptr null, ptr %11, align 8, !tbaa !5
  br label %48

48:                                               ; preds = %270, %19
  %49 = load ptr, ptr %6, align 8, !tbaa !5
  %50 = getelementptr inbounds %struct.png_struct_def, ptr %49, i32 0, i32 15
  %51 = getelementptr inbounds %struct.z_stream_s, ptr %50, i32 0, i32 1
  %52 = load i32, ptr %51, align 8, !tbaa !23
  %53 = icmp ne i32 %52, 0
  br i1 %53, label %54, label %271

54:                                               ; preds = %48
  %55 = load ptr, ptr %6, align 8, !tbaa !5
  %56 = getelementptr inbounds %struct.png_struct_def, ptr %55, i32 0, i32 15
  %57 = call i32 @inflate(ptr noundef %56, i32 noundef 1)
  store i32 %57, ptr %13, align 4, !tbaa !9
  %58 = load i32, ptr %13, align 4, !tbaa !9
  %59 = icmp ne i32 %58, 0
  br i1 %59, label %60, label %132

60:                                               ; preds = %54
  %61 = load i32, ptr %13, align 4, !tbaa !9
  %62 = icmp ne i32 %61, 1
  br i1 %62, label %63, label %132

63:                                               ; preds = %60
  %64 = load ptr, ptr %6, align 8, !tbaa !5
  %65 = getelementptr inbounds %struct.png_struct_def, ptr %64, i32 0, i32 15
  %66 = getelementptr inbounds %struct.z_stream_s, ptr %65, i32 0, i32 6
  %67 = load ptr, ptr %66, align 8, !tbaa !28
  %68 = icmp ne ptr %67, null
  br i1 %68, label %69, label %75

69:                                               ; preds = %63
  %70 = load ptr, ptr %6, align 8, !tbaa !5
  %71 = load ptr, ptr %6, align 8, !tbaa !5
  %72 = getelementptr inbounds %struct.png_struct_def, ptr %71, i32 0, i32 15
  %73 = getelementptr inbounds %struct.z_stream_s, ptr %72, i32 0, i32 6
  %74 = load ptr, ptr %73, align 8, !tbaa !28
  call void @png_warning(ptr noundef %70, ptr noundef %74)
  br label %77

75:                                               ; preds = %63
  %76 = load ptr, ptr %6, align 8, !tbaa !5
  call void @png_warning(ptr noundef %76, ptr noundef @png_decompress_chunk.msg)
  br label %77

77:                                               ; preds = %75, %69
  %78 = load ptr, ptr %6, align 8, !tbaa !5
  %79 = getelementptr inbounds %struct.png_struct_def, ptr %78, i32 0, i32 15
  %80 = call i32 @inflateReset(ptr noundef %79)
  %81 = load ptr, ptr %6, align 8, !tbaa !5
  %82 = getelementptr inbounds %struct.png_struct_def, ptr %81, i32 0, i32 15
  %83 = getelementptr inbounds %struct.z_stream_s, ptr %82, i32 0, i32 1
  store i32 0, ptr %83, align 8, !tbaa !23
  %84 = load ptr, ptr %11, align 8, !tbaa !5
  %85 = icmp eq ptr %84, null
  br i1 %85, label %86, label %109

86:                                               ; preds = %77
  %87 = load i64, ptr %9, align 8, !tbaa !11
  %88 = add i64 %87, 31
  %89 = add i64 %88, 1
  store i64 %89, ptr %12, align 8, !tbaa !11
  %90 = load ptr, ptr %6, align 8, !tbaa !5
  %91 = load i64, ptr %12, align 8, !tbaa !11
  %92 = call ptr @png_malloc_warn(ptr noundef %90, i64 noundef %91)
  store ptr %92, ptr %11, align 8, !tbaa !5
  %93 = load ptr, ptr %11, align 8, !tbaa !5
  %94 = icmp eq ptr %93, null
  br i1 %94, label %95, label %103

95:                                               ; preds = %86
  %96 = load ptr, ptr %6, align 8, !tbaa !5
  %97 = load ptr, ptr %6, align 8, !tbaa !5
  %98 = getelementptr inbounds %struct.png_struct_def, ptr %97, i32 0, i32 137
  %99 = load ptr, ptr %98, align 8, !tbaa !13
  call void @png_free(ptr noundef %96, ptr noundef %99)
  %100 = load ptr, ptr %6, align 8, !tbaa !5
  %101 = getelementptr inbounds %struct.png_struct_def, ptr %100, i32 0, i32 137
  store ptr null, ptr %101, align 8, !tbaa !13
  %102 = load ptr, ptr %6, align 8, !tbaa !5
  call void @png_error(ptr noundef %102, ptr noundef @.str.2)
  br label %103

103:                                              ; preds = %95, %86
  %104 = load ptr, ptr %11, align 8, !tbaa !5
  %105 = load ptr, ptr %6, align 8, !tbaa !5
  %106 = getelementptr inbounds %struct.png_struct_def, ptr %105, i32 0, i32 137
  %107 = load ptr, ptr %106, align 8, !tbaa !13
  %108 = load i64, ptr %9, align 8, !tbaa !11
  call void @llvm.memcpy.p0.p0.i64(ptr align 1 %104, ptr align 1 %107, i64 %108, i1 false)
  br label %109

109:                                              ; preds = %103, %77
  %110 = load ptr, ptr %11, align 8, !tbaa !5
  %111 = load i64, ptr %12, align 8, !tbaa !11
  %112 = sub i64 %111, 1
  %113 = getelementptr inbounds i8, ptr %110, i64 %112
  store i8 0, ptr %113, align 1, !tbaa !29
  %114 = load i64, ptr %8, align 8, !tbaa !11
  %115 = load ptr, ptr %11, align 8, !tbaa !5
  %116 = load ptr, ptr %6, align 8, !tbaa !5
  %117 = getelementptr inbounds %struct.png_struct_def, ptr %116, i32 0, i32 137
  %118 = load ptr, ptr %117, align 8, !tbaa !13
  %119 = ptrtoint ptr %115 to i64
  %120 = ptrtoint ptr %118 to i64
  %121 = sub i64 %119, %120
  %122 = sub i64 %114, %121
  %123 = sub i64 %122, 1
  store i64 %123, ptr %12, align 8, !tbaa !11
  %124 = load i64, ptr %12, align 8, !tbaa !11
  %125 = icmp ugt i64 %124, 31
  br i1 %125, label %126, label %127

126:                                              ; preds = %109
  store i64 31, ptr %12, align 8, !tbaa !11
  br label %127

127:                                              ; preds = %126, %109
  %128 = load ptr, ptr %11, align 8, !tbaa !5
  %129 = load i64, ptr %9, align 8, !tbaa !11
  %130 = getelementptr inbounds i8, ptr %128, i64 %129
  %131 = load i64, ptr %12, align 8, !tbaa !11
  call void @llvm.memcpy.p0.p0.i64(ptr align 1 %130, ptr align 16 @png_decompress_chunk.msg, i64 %131, i1 false)
  br label %271

132:                                              ; preds = %60, %54
  %133 = load ptr, ptr %6, align 8, !tbaa !5
  %134 = getelementptr inbounds %struct.png_struct_def, ptr %133, i32 0, i32 15
  %135 = getelementptr inbounds %struct.z_stream_s, ptr %134, i32 0, i32 4
  %136 = load i32, ptr %135, align 8, !tbaa !27
  %137 = icmp ne i32 %136, 0
  br i1 %137, label %138, label %141

138:                                              ; preds = %132
  %139 = load i32, ptr %13, align 4, !tbaa !9
  %140 = icmp eq i32 %139, 1
  br i1 %140, label %141, label %270

141:                                              ; preds = %138, %132
  %142 = load ptr, ptr %11, align 8, !tbaa !5
  %143 = icmp eq ptr %142, null
  br i1 %143, label %144, label %188

144:                                              ; preds = %141
  %145 = load i64, ptr %9, align 8, !tbaa !11
  %146 = load ptr, ptr %6, align 8, !tbaa !5
  %147 = getelementptr inbounds %struct.png_struct_def, ptr %146, i32 0, i32 17
  %148 = load i64, ptr %147, align 8, !tbaa !26
  %149 = add i64 %145, %148
  %150 = load ptr, ptr %6, align 8, !tbaa !5
  %151 = getelementptr inbounds %struct.png_struct_def, ptr %150, i32 0, i32 15
  %152 = getelementptr inbounds %struct.z_stream_s, ptr %151, i32 0, i32 4
  %153 = load i32, ptr %152, align 8, !tbaa !27
  %154 = zext i32 %153 to i64
  %155 = sub i64 %149, %154
  store i64 %155, ptr %12, align 8, !tbaa !11
  %156 = load ptr, ptr %6, align 8, !tbaa !5
  %157 = load i64, ptr %12, align 8, !tbaa !11
  %158 = add i64 %157, 1
  %159 = call ptr @png_malloc_warn(ptr noundef %156, i64 noundef %158)
  store ptr %159, ptr %11, align 8, !tbaa !5
  %160 = load ptr, ptr %11, align 8, !tbaa !5
  %161 = icmp eq ptr %160, null
  br i1 %161, label %162, label %170

162:                                              ; preds = %144
  %163 = load ptr, ptr %6, align 8, !tbaa !5
  %164 = load ptr, ptr %6, align 8, !tbaa !5
  %165 = getelementptr inbounds %struct.png_struct_def, ptr %164, i32 0, i32 137
  %166 = load ptr, ptr %165, align 8, !tbaa !13
  call void @png_free(ptr noundef %163, ptr noundef %166)
  %167 = load ptr, ptr %6, align 8, !tbaa !5
  %168 = getelementptr inbounds %struct.png_struct_def, ptr %167, i32 0, i32 137
  store ptr null, ptr %168, align 8, !tbaa !13
  %169 = load ptr, ptr %6, align 8, !tbaa !5
  call void @png_error(ptr noundef %169, ptr noundef @.str.3)
  br label %170

170:                                              ; preds = %162, %144
  %171 = load ptr, ptr %11, align 8, !tbaa !5
  %172 = load i64, ptr %9, align 8, !tbaa !11
  %173 = getelementptr inbounds i8, ptr %171, i64 %172
  %174 = load ptr, ptr %6, align 8, !tbaa !5
  %175 = getelementptr inbounds %struct.png_struct_def, ptr %174, i32 0, i32 16
  %176 = load ptr, ptr %175, align 8, !tbaa !24
  %177 = load i64, ptr %12, align 8, !tbaa !11
  %178 = load i64, ptr %9, align 8, !tbaa !11
  %179 = sub i64 %177, %178
  call void @llvm.memcpy.p0.p0.i64(ptr align 1 %173, ptr align 1 %176, i64 %179, i1 false)
  %180 = load ptr, ptr %11, align 8, !tbaa !5
  %181 = load ptr, ptr %6, align 8, !tbaa !5
  %182 = getelementptr inbounds %struct.png_struct_def, ptr %181, i32 0, i32 137
  %183 = load ptr, ptr %182, align 8, !tbaa !13
  %184 = load i64, ptr %9, align 8, !tbaa !11
  call void @llvm.memcpy.p0.p0.i64(ptr align 1 %180, ptr align 1 %183, i64 %184, i1 false)
  %185 = load ptr, ptr %11, align 8, !tbaa !5
  %186 = load i64, ptr %12, align 8, !tbaa !11
  %187 = getelementptr inbounds i8, ptr %185, i64 %186
  store i8 0, ptr %187, align 1, !tbaa !29
  br label %251

188:                                              ; preds = %141
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #5
  %189 = load ptr, ptr %11, align 8, !tbaa !5
  store ptr %189, ptr %14, align 8, !tbaa !5
  %190 = load ptr, ptr %6, align 8, !tbaa !5
  %191 = load i64, ptr %12, align 8, !tbaa !11
  %192 = load ptr, ptr %6, align 8, !tbaa !5
  %193 = getelementptr inbounds %struct.png_struct_def, ptr %192, i32 0, i32 17
  %194 = load i64, ptr %193, align 8, !tbaa !26
  %195 = add i64 %191, %194
  %196 = load ptr, ptr %6, align 8, !tbaa !5
  %197 = getelementptr inbounds %struct.png_struct_def, ptr %196, i32 0, i32 15
  %198 = getelementptr inbounds %struct.z_stream_s, ptr %197, i32 0, i32 4
  %199 = load i32, ptr %198, align 8, !tbaa !27
  %200 = zext i32 %199 to i64
  %201 = sub i64 %195, %200
  %202 = add i64 %201, 1
  %203 = call ptr @png_malloc_warn(ptr noundef %190, i64 noundef %202)
  store ptr %203, ptr %11, align 8, !tbaa !5
  %204 = load ptr, ptr %11, align 8, !tbaa !5
  %205 = icmp eq ptr %204, null
  br i1 %205, label %206, label %216

206:                                              ; preds = %188
  %207 = load ptr, ptr %6, align 8, !tbaa !5
  %208 = load ptr, ptr %14, align 8, !tbaa !5
  call void @png_free(ptr noundef %207, ptr noundef %208)
  %209 = load ptr, ptr %6, align 8, !tbaa !5
  %210 = load ptr, ptr %6, align 8, !tbaa !5
  %211 = getelementptr inbounds %struct.png_struct_def, ptr %210, i32 0, i32 137
  %212 = load ptr, ptr %211, align 8, !tbaa !13
  call void @png_free(ptr noundef %209, ptr noundef %212)
  %213 = load ptr, ptr %6, align 8, !tbaa !5
  %214 = getelementptr inbounds %struct.png_struct_def, ptr %213, i32 0, i32 137
  store ptr null, ptr %214, align 8, !tbaa !13
  %215 = load ptr, ptr %6, align 8, !tbaa !5
  call void @png_error(ptr noundef %215, ptr noundef @.str.4)
  br label %216

216:                                              ; preds = %206, %188
  %217 = load ptr, ptr %11, align 8, !tbaa !5
  %218 = load ptr, ptr %14, align 8, !tbaa !5
  %219 = load i64, ptr %12, align 8, !tbaa !11
  call void @llvm.memcpy.p0.p0.i64(ptr align 1 %217, ptr align 1 %218, i64 %219, i1 false)
  %220 = load ptr, ptr %6, align 8, !tbaa !5
  %221 = load ptr, ptr %14, align 8, !tbaa !5
  call void @png_free(ptr noundef %220, ptr noundef %221)
  %222 = load ptr, ptr %11, align 8, !tbaa !5
  %223 = load i64, ptr %12, align 8, !tbaa !11
  %224 = getelementptr inbounds i8, ptr %222, i64 %223
  %225 = load ptr, ptr %6, align 8, !tbaa !5
  %226 = getelementptr inbounds %struct.png_struct_def, ptr %225, i32 0, i32 16
  %227 = load ptr, ptr %226, align 8, !tbaa !24
  %228 = load ptr, ptr %6, align 8, !tbaa !5
  %229 = getelementptr inbounds %struct.png_struct_def, ptr %228, i32 0, i32 17
  %230 = load i64, ptr %229, align 8, !tbaa !26
  %231 = load ptr, ptr %6, align 8, !tbaa !5
  %232 = getelementptr inbounds %struct.png_struct_def, ptr %231, i32 0, i32 15
  %233 = getelementptr inbounds %struct.z_stream_s, ptr %232, i32 0, i32 4
  %234 = load i32, ptr %233, align 8, !tbaa !27
  %235 = zext i32 %234 to i64
  %236 = sub i64 %230, %235
  call void @llvm.memcpy.p0.p0.i64(ptr align 1 %224, ptr align 1 %227, i64 %236, i1 false)
  %237 = load ptr, ptr %6, align 8, !tbaa !5
  %238 = getelementptr inbounds %struct.png_struct_def, ptr %237, i32 0, i32 17
  %239 = load i64, ptr %238, align 8, !tbaa !26
  %240 = load ptr, ptr %6, align 8, !tbaa !5
  %241 = getelementptr inbounds %struct.png_struct_def, ptr %240, i32 0, i32 15
  %242 = getelementptr inbounds %struct.z_stream_s, ptr %241, i32 0, i32 4
  %243 = load i32, ptr %242, align 8, !tbaa !27
  %244 = zext i32 %243 to i64
  %245 = sub i64 %239, %244
  %246 = load i64, ptr %12, align 8, !tbaa !11
  %247 = add i64 %246, %245
  store i64 %247, ptr %12, align 8, !tbaa !11
  %248 = load ptr, ptr %11, align 8, !tbaa !5
  %249 = load i64, ptr %12, align 8, !tbaa !11
  %250 = getelementptr inbounds i8, ptr %248, i64 %249
  store i8 0, ptr %250, align 1, !tbaa !29
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #5
  br label %251

251:                                              ; preds = %216, %170
  %252 = load i32, ptr %13, align 4, !tbaa !9
  %253 = icmp eq i32 %252, 1
  br i1 %253, label %254, label %255

254:                                              ; preds = %251
  br label %271

255:                                              ; preds = %251
  %256 = load ptr, ptr %6, align 8, !tbaa !5
  %257 = getelementptr inbounds %struct.png_struct_def, ptr %256, i32 0, i32 16
  %258 = load ptr, ptr %257, align 8, !tbaa !24
  %259 = load ptr, ptr %6, align 8, !tbaa !5
  %260 = getelementptr inbounds %struct.png_struct_def, ptr %259, i32 0, i32 15
  %261 = getelementptr inbounds %struct.z_stream_s, ptr %260, i32 0, i32 3
  store ptr %258, ptr %261, align 8, !tbaa !25
  %262 = load ptr, ptr %6, align 8, !tbaa !5
  %263 = getelementptr inbounds %struct.png_struct_def, ptr %262, i32 0, i32 17
  %264 = load i64, ptr %263, align 8, !tbaa !26
  %265 = trunc i64 %264 to i32
  %266 = load ptr, ptr %6, align 8, !tbaa !5
  %267 = getelementptr inbounds %struct.png_struct_def, ptr %266, i32 0, i32 15
  %268 = getelementptr inbounds %struct.z_stream_s, ptr %267, i32 0, i32 4
  store i32 %265, ptr %268, align 8, !tbaa !27
  br label %269

269:                                              ; preds = %255
  br label %270

270:                                              ; preds = %269, %138
  br label %48, !llvm.loop !30

271:                                              ; preds = %254, %127, %48
  %272 = load i32, ptr %13, align 4, !tbaa !9
  %273 = icmp ne i32 %272, 1
  br i1 %273, label %274, label %330

274:                                              ; preds = %271
  call void @llvm.lifetime.start.p0(i64 52, ptr %15) #5
  %275 = load i32, ptr %13, align 4, !tbaa !9
  %276 = icmp eq i32 %275, -5
  br i1 %276, label %277, label %283

277:                                              ; preds = %274
  %278 = getelementptr inbounds [52 x i8], ptr %15, i64 0, i64 0
  %279 = load ptr, ptr %6, align 8, !tbaa !5
  %280 = getelementptr inbounds %struct.png_struct_def, ptr %279, i32 0, i32 43
  %281 = getelementptr inbounds [5 x i8], ptr %280, i64 0, i64 0
  %282 = call i32 (ptr, i64, ptr, ...) @snprintf(ptr noundef %278, i64 noundef 52, ptr noundef @.str.5, ptr noundef %281) #5
  br label %299

283:                                              ; preds = %274
  %284 = load i32, ptr %13, align 4, !tbaa !9
  %285 = icmp eq i32 %284, -3
  br i1 %285, label %286, label %292

286:                                              ; preds = %283
  %287 = getelementptr inbounds [52 x i8], ptr %15, i64 0, i64 0
  %288 = load ptr, ptr %6, align 8, !tbaa !5
  %289 = getelementptr inbounds %struct.png_struct_def, ptr %288, i32 0, i32 43
  %290 = getelementptr inbounds [5 x i8], ptr %289, i64 0, i64 0
  %291 = call i32 (ptr, i64, ptr, ...) @snprintf(ptr noundef %287, i64 noundef 52, ptr noundef @.str.6, ptr noundef %290) #5
  br label %298

292:                                              ; preds = %283
  %293 = getelementptr inbounds [52 x i8], ptr %15, i64 0, i64 0
  %294 = load ptr, ptr %6, align 8, !tbaa !5
  %295 = getelementptr inbounds %struct.png_struct_def, ptr %294, i32 0, i32 43
  %296 = getelementptr inbounds [5 x i8], ptr %295, i64 0, i64 0
  %297 = call i32 (ptr, i64, ptr, ...) @snprintf(ptr noundef %293, i64 noundef 52, ptr noundef @.str.7, ptr noundef %296) #5
  br label %298

298:                                              ; preds = %292, %286
  br label %299

299:                                              ; preds = %298, %277
  %300 = load ptr, ptr %6, align 8, !tbaa !5
  %301 = getelementptr inbounds [52 x i8], ptr %15, i64 0, i64 0
  call void @png_warning(ptr noundef %300, ptr noundef %301)
  %302 = load i64, ptr %9, align 8, !tbaa !11
  store i64 %302, ptr %12, align 8, !tbaa !11
  %303 = load ptr, ptr %11, align 8, !tbaa !5
  %304 = icmp eq ptr %303, null
  br i1 %304, label %305, label %326

305:                                              ; preds = %299
  %306 = load ptr, ptr %6, align 8, !tbaa !5
  %307 = load i64, ptr %12, align 8, !tbaa !11
  %308 = add i64 %307, 1
  %309 = call ptr @png_malloc_warn(ptr noundef %306, i64 noundef %308)
  store ptr %309, ptr %11, align 8, !tbaa !5
  %310 = load ptr, ptr %11, align 8, !tbaa !5
  %311 = icmp eq ptr %310, null
  br i1 %311, label %312, label %320

312:                                              ; preds = %305
  %313 = load ptr, ptr %6, align 8, !tbaa !5
  %314 = load ptr, ptr %6, align 8, !tbaa !5
  %315 = getelementptr inbounds %struct.png_struct_def, ptr %314, i32 0, i32 137
  %316 = load ptr, ptr %315, align 8, !tbaa !13
  call void @png_free(ptr noundef %313, ptr noundef %316)
  %317 = load ptr, ptr %6, align 8, !tbaa !5
  %318 = getelementptr inbounds %struct.png_struct_def, ptr %317, i32 0, i32 137
  store ptr null, ptr %318, align 8, !tbaa !13
  %319 = load ptr, ptr %6, align 8, !tbaa !5
  call void @png_error(ptr noundef %319, ptr noundef @.str.8)
  br label %320

320:                                              ; preds = %312, %305
  %321 = load ptr, ptr %11, align 8, !tbaa !5
  %322 = load ptr, ptr %6, align 8, !tbaa !5
  %323 = getelementptr inbounds %struct.png_struct_def, ptr %322, i32 0, i32 137
  %324 = load ptr, ptr %323, align 8, !tbaa !13
  %325 = load i64, ptr %9, align 8, !tbaa !11
  call void @llvm.memcpy.p0.p0.i64(ptr align 1 %321, ptr align 1 %324, i64 %325, i1 false)
  br label %326

326:                                              ; preds = %320, %299
  %327 = load ptr, ptr %11, align 8, !tbaa !5
  %328 = load i64, ptr %12, align 8, !tbaa !11
  %329 = getelementptr inbounds i8, ptr %327, i64 %328
  store i8 0, ptr %329, align 1, !tbaa !29
  call void @llvm.lifetime.end.p0(i64 52, ptr %15) #5
  br label %330

330:                                              ; preds = %326, %271
  %331 = load ptr, ptr %6, align 8, !tbaa !5
  %332 = getelementptr inbounds %struct.png_struct_def, ptr %331, i32 0, i32 15
  %333 = call i32 @inflateReset(ptr noundef %332)
  %334 = load ptr, ptr %6, align 8, !tbaa !5
  %335 = getelementptr inbounds %struct.png_struct_def, ptr %334, i32 0, i32 15
  %336 = getelementptr inbounds %struct.z_stream_s, ptr %335, i32 0, i32 1
  store i32 0, ptr %336, align 8, !tbaa !23
  %337 = load ptr, ptr %6, align 8, !tbaa !5
  %338 = load ptr, ptr %6, align 8, !tbaa !5
  %339 = getelementptr inbounds %struct.png_struct_def, ptr %338, i32 0, i32 137
  %340 = load ptr, ptr %339, align 8, !tbaa !13
  call void @png_free(ptr noundef %337, ptr noundef %340)
  %341 = load ptr, ptr %11, align 8, !tbaa !5
  %342 = load ptr, ptr %6, align 8, !tbaa !5
  %343 = getelementptr inbounds %struct.png_struct_def, ptr %342, i32 0, i32 137
  store ptr %341, ptr %343, align 8, !tbaa !13
  %344 = load i64, ptr %12, align 8, !tbaa !11
  %345 = load ptr, ptr %10, align 8, !tbaa !5
  store i64 %344, ptr %345, align 8, !tbaa !11
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #5
  br label %359

346:                                              ; preds = %5
  call void @llvm.lifetime.start.p0(i64 50, ptr %16) #5
  %347 = getelementptr inbounds [50 x i8], ptr %16, i64 0, i64 0
  %348 = load i32, ptr %7, align 4, !tbaa !9
  %349 = call i32 (ptr, i64, ptr, ...) @snprintf(ptr noundef %347, i64 noundef 50, ptr noundef @.str.9, i32 noundef %348) #5
  %350 = load ptr, ptr %6, align 8, !tbaa !5
  %351 = getelementptr inbounds [50 x i8], ptr %16, i64 0, i64 0
  call void @png_warning(ptr noundef %350, ptr noundef %351)
  %352 = load ptr, ptr %6, align 8, !tbaa !5
  %353 = getelementptr inbounds %struct.png_struct_def, ptr %352, i32 0, i32 137
  %354 = load ptr, ptr %353, align 8, !tbaa !13
  %355 = load i64, ptr %9, align 8, !tbaa !11
  %356 = getelementptr inbounds i8, ptr %354, i64 %355
  store i8 0, ptr %356, align 1, !tbaa !29
  %357 = load i64, ptr %9, align 8, !tbaa !11
  %358 = load ptr, ptr %10, align 8, !tbaa !5
  store i64 %357, ptr %358, align 8, !tbaa !11
  call void @llvm.lifetime.end.p0(i64 50, ptr %16) #5
  br label %359

359:                                              ; preds = %346, %330
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #5
  ret void
}

declare i32 @inflate(ptr noundef, i32 noundef) #1

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

declare i32 @inflateReset(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
declare i32 @snprintf(ptr noundef, i64 noundef, ptr noundef, ...) #4

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

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"long", !7, i64 0}
!13 = !{!14, !6, i64 1256}
!14 = !{!"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, !7, i64 272, !7, i64 273, !12, i64 280, !12, i64 288, !12, i64 296, !15, i64 304, !6, i64 416, !12, i64 424, !10, i64 432, !10, i64 436, !10, i64 440, !10, i64 444, !10, i64 448, !12, i64 456, !12, i64 464, !12, i64 472, !12, i64 480, !12, i64 488, !12, i64 496, !12, i64 504, !12, i64 512, !6, i64 520, !6, i64 528, !6, i64 536, !6, i64 544, !6, i64 552, !6, i64 560, !16, i64 568, !12, i64 592, !12, i64 600, !6, i64 608, !17, i64 616, !17, i64 618, !7, i64 620, !7, i64 625, !7, i64 626, !7, i64 627, !7, i64 628, !7, i64 629, !7, i64 630, !7, i64 631, !7, i64 632, !7, i64 633, !7, i64 634, !7, i64 635, !7, i64 636, !17, i64 638, !7, i64 640, !18, i64 644, !19, i64 648, !19, i64 658, !6, i64 672, !12, i64 680, !12, i64 688, !10, i64 696, !18, i64 700, !18, i64 704, !6, i64 712, !6, i64 720, !6, i64 728, !6, i64 736, !6, i64 744, !6, i64 752, !20, i64 760, !20, i64 765, !6, i64 776, !19, i64 784, !6, i64 800, !6, i64 808, !6, i64 816, !6, i64 824, !6, i64 832, !6, i64 840, !6, i64 848, !6, i64 856, !6, i64 864, !12, i64 872, !12, i64 880, !12, i64 888, !12, i64 896, !12, i64 904, !12, i64 912, !10, i64 920, !10, i64 924, !12, i64 928, !12, i64 936, !6, i64 944, !6, i64 952, !6, i64 960, !6, i64 968, !6, i64 976, !7, i64 984, !7, i64 985, !6, i64 992, !6, i64 1000, !6, i64 1008, !6, i64 1016, !6, i64 1024, !6, i64 1032, !12, i64 1040, !6, i64 1048, !6, i64 1056, !10, i64 1064, !6, i64 1072, !7, i64 1080, !17, i64 1082, !17, i64 1084, !17, i64 1086, !12, i64 1088, !12, i64 1096, !7, i64 1104, !7, i64 1105, !12, i64 1112, !12, i64 1120, !6, i64 1128, !6, i64 1136, !6, i64 1144, !6, i64 1152, !6, i64 1160, !6, i64 1168, !6, i64 1176, !7, i64 1184, !12, i64 1192, !12, i64 1200, !21, i64 1208, !12, i64 1240, !12, i64 1248, !6, i64 1256}
!15 = !{!"z_stream_s", !6, i64 0, !10, i64 8, !12, i64 16, !6, i64 24, !10, i64 32, !12, i64 40, !6, i64 48, !6, i64 56, !6, i64 64, !6, i64 72, !6, i64 80, !10, i64 88, !12, i64 96, !12, i64 104}
!16 = !{!"png_row_info_struct", !12, i64 0, !12, i64 8, !7, i64 16, !7, i64 17, !7, i64 18, !7, i64 19}
!17 = !{!"short", !7, i64 0}
!18 = !{!"float", !7, i64 0}
!19 = !{!"png_color_16_struct", !7, i64 0, !17, i64 2, !17, i64 4, !17, i64 6, !17, i64 8}
!20 = !{!"png_color_8_struct", !7, i64 0, !7, i64 1, !7, i64 2, !7, i64 3, !7, i64 4}
!21 = !{!"png_unknown_chunk_t", !7, i64 0, !6, i64 8, !12, i64 16, !7, i64 24}
!22 = !{!14, !6, i64 304}
!23 = !{!14, !10, i64 312}
!24 = !{!14, !6, i64 416}
!25 = !{!14, !6, i64 328}
!26 = !{!14, !12, i64 424}
!27 = !{!14, !10, i64 336}
!28 = !{!14, !6, i64 352}
!29 = !{!7, !7, i64 0}
!30 = distinct !{!30, !31}
!31 = !{!"llvm.loop.mustprogress"}


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

@png_decompress_chunk.msg = external hidden constant [31 x i8], align 16
@.str.2 = external hidden unnamed_addr constant [38 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [39 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [40 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [50 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [48 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [45 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [28 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [33 x i8], align 1

; Function Attrs: mustprogress 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) local_unnamed_addr #1

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

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

; Function Attrs: nounwind uwtable
define dso_local void @png_decompress_chunk(ptr noundef %0, i32 noundef %1, i64 noundef %2, i64 noundef %3, ptr nocapture noundef writeonly %4) local_unnamed_addr #3 {
  %6 = alloca [52 x i8], align 16
  %7 = alloca [50 x i8], align 16
  %8 = icmp eq i32 %1, 0
  br i1 %8, label %9, label %117

9:                                                ; preds = %5
  %10 = getelementptr inbounds i8, ptr %0, i64 1256
  %11 = load ptr, ptr %10, align 8, !tbaa !5
  %12 = getelementptr inbounds i8, ptr %11, i64 %3
  %13 = getelementptr inbounds i8, ptr %0, i64 304
  store ptr %12, ptr %13, align 8, !tbaa !19
  %14 = sub i64 %2, %3
  %15 = trunc i64 %14 to i32
  %16 = getelementptr inbounds i8, ptr %0, i64 312
  store i32 %15, ptr %16, align 8, !tbaa !20
  %17 = getelementptr inbounds i8, ptr %0, i64 416
  %18 = load ptr, ptr %17, align 8, !tbaa !21
  %19 = getelementptr inbounds i8, ptr %0, i64 328
  store ptr %18, ptr %19, align 8, !tbaa !22
  %20 = getelementptr inbounds i8, ptr %0, i64 424
  %21 = load i64, ptr %20, align 8, !tbaa !23
  %22 = trunc i64 %21 to i32
  %23 = getelementptr inbounds i8, ptr %0, i64 336
  store i32 %22, ptr %23, align 8, !tbaa !24
  %.not170 = icmp eq i32 %15, 0
  br i1 %.not170, label %.thread154, label %.lr.ph

.thread154:                                       ; preds = %86, %9
  %.0.lcssa = phi ptr [ null, %9 ], [ %.3, %86 ]
  call void @llvm.lifetime.start.p0(i64 52, ptr nonnull %6) #6
  br label %101

.lr.ph:                                           ; preds = %9, %86
  %.0172 = phi ptr [ %.3, %86 ], [ null, %9 ]
  %.0136171 = phi i64 [ %.3139, %86 ], [ 0, %9 ]
  %24 = tail call i32 @inflate(ptr noundef nonnull %13, i32 noundef 1) #6
  %or.cond = icmp ugt i32 %24, 1
  br i1 %or.cond, label %25, label %38

25:                                               ; preds = %.lr.ph
  %26 = getelementptr inbounds i8, ptr %0, i64 352
  %27 = load ptr, ptr %26, align 8, !tbaa !25
  %.not146 = icmp eq ptr %27, null
  %png_decompress_chunk.msg. = select i1 %.not146, ptr @png_decompress_chunk.msg, ptr %27
  tail call void @png_warning(ptr noundef nonnull %0, ptr noundef nonnull %png_decompress_chunk.msg.) #6
  %28 = tail call i32 @inflateReset(ptr noundef nonnull %13) #6
  store i32 0, ptr %16, align 8, !tbaa !20
  %29 = icmp eq ptr %.0172, null
  br i1 %29, label %30, label %88

30:                                               ; preds = %25
  %31 = add i64 %3, 32
  %32 = tail call ptr @png_malloc_warn(ptr noundef nonnull %0, i64 noundef %31) #6
  %33 = icmp eq ptr %32, null
  br i1 %33, label %34, label %36

34:                                               ; preds = %30
  %35 = load ptr, ptr %10, align 8, !tbaa !5
  tail call void @png_free(ptr noundef nonnull %0, ptr noundef %35) #6
  store ptr null, ptr %10, align 8, !tbaa !5
  tail call void @png_error(ptr noundef nonnull %0, ptr noundef nonnull @.str.2) #6
  br label %36

36:                                               ; preds = %34, %30
  %37 = load ptr, ptr %10, align 8, !tbaa !5
  tail call void @llvm.memcpy.p0.p0.i64(ptr align 1 %32, ptr align 1 %37, i64 %3, i1 false)
  br label %88

38:                                               ; preds = %.lr.ph
  %39 = load i32, ptr %23, align 8, !tbaa !24
  %40 = icmp eq i32 %39, 0
  %41 = icmp eq i32 %24, 1
  %or.cond3 = or i1 %41, %40
  br i1 %or.cond3, label %42, label %86

42:                                               ; preds = %38
  %43 = icmp eq ptr %.0172, null
  %44 = load i64, ptr %20, align 8, !tbaa !23
  %45 = zext i32 %39 to i64
  br i1 %43, label %46, label %60

46:                                               ; preds = %42
  %47 = sub i64 %3, %45
  %48 = add i64 %47, %44
  %49 = add i64 %48, 1
  %50 = tail call ptr @png_malloc_warn(ptr noundef nonnull %0, i64 noundef %49) #6
  %51 = icmp eq ptr %50, null
  br i1 %51, label %52, label %54

52:                                               ; preds = %46
  %53 = load ptr, ptr %10, align 8, !tbaa !5
  tail call void @png_free(ptr noundef nonnull %0, ptr noundef %53) #6
  store ptr null, ptr %10, align 8, !tbaa !5
  tail call void @png_error(ptr noundef nonnull %0, ptr noundef nonnull @.str.3) #6
  br label %54

54:                                               ; preds = %52, %46
  %55 = getelementptr inbounds i8, ptr %50, i64 %3
  %56 = load ptr, ptr %17, align 8, !tbaa !21
  %57 = sub i64 %48, %3
  tail call void @llvm.memcpy.p0.p0.i64(ptr align 1 %55, ptr align 1 %56, i64 %57, i1 false)
  %58 = load ptr, ptr %10, align 8, !tbaa !5
  tail call void @llvm.memcpy.p0.p0.i64(ptr align 1 %50, ptr align 1 %58, i64 %3, i1 false)
  %59 = getelementptr inbounds i8, ptr %50, i64 %48
  br label %81

60:                                               ; preds = %42
  %61 = add i64 %.0136171, 1
  %62 = sub i64 %61, %45
  %63 = add i64 %62, %44
  %64 = tail call ptr @png_malloc_warn(ptr noundef nonnull %0, i64 noundef %63) #6
  %65 = icmp eq ptr %64, null
  br i1 %65, label %66, label %68

66:                                               ; preds = %60
  tail call void @png_free(ptr noundef nonnull %0, ptr noundef nonnull %.0172) #6
  %67 = load ptr, ptr %10, align 8, !tbaa !5
  tail call void @png_free(ptr noundef nonnull %0, ptr noundef %67) #6
  store ptr null, ptr %10, align 8, !tbaa !5
  tail call void @png_error(ptr noundef nonnull %0, ptr noundef nonnull @.str.4) #6
  br label %68

68:                                               ; preds = %66, %60
  tail call void @llvm.memcpy.p0.p0.i64(ptr align 1 %64, ptr nonnull align 1 %.0172, i64 %.0136171, i1 false)
  tail call void @png_free(ptr noundef nonnull %0, ptr noundef nonnull %.0172) #6
  %69 = getelementptr inbounds i8, ptr %64, i64 %.0136171
  %70 = load ptr, ptr %17, align 8, !tbaa !21
  %71 = load i64, ptr %20, align 8, !tbaa !23
  %72 = load i32, ptr %23, align 8, !tbaa !24
  %73 = zext i32 %72 to i64
  %74 = sub i64 %71, %73
  tail call void @llvm.memcpy.p0.p0.i64(ptr align 1 %69, ptr align 1 %70, i64 %74, i1 false)
  %75 = load i64, ptr %20, align 8, !tbaa !23
  %76 = load i32, ptr %23, align 8, !tbaa !24
  %77 = zext i32 %76 to i64
  %78 = sub i64 %75, %77
  %79 = add i64 %78, %.0136171
  %80 = getelementptr inbounds i8, ptr %64, i64 %79
  br label %81

81:                                               ; preds = %68, %54
  %.sink = phi ptr [ %80, %68 ], [ %59, %54 ]
  %.2138 = phi i64 [ %79, %68 ], [ %48, %54 ]
  %.2 = phi ptr [ %64, %68 ], [ %50, %54 ]
  store i8 0, ptr %.sink, align 1, !tbaa !26
  br i1 %41, label %.loopexit, label %82

82:                                               ; preds = %81
  %83 = load ptr, ptr %17, align 8, !tbaa !21
  store ptr %83, ptr %19, align 8, !tbaa !22
  %84 = load i64, ptr %20, align 8, !tbaa !23
  %85 = trunc i64 %84 to i32
  store i32 %85, ptr %23, align 8, !tbaa !24
  br label %86

86:                                               ; preds = %38, %82
  %.3139 = phi i64 [ %.2138, %82 ], [ %.0136171, %38 ]
  %.3 = phi ptr [ %.2, %82 ], [ %.0172, %38 ]
  %87 = load i32, ptr %16, align 8, !tbaa !20
  %.not = icmp eq i32 %87, 0
  br i1 %.not, label %.thread154, label %.lr.ph, !llvm.loop !27

88:                                               ; preds = %25, %36
  %.1137 = phi i64 [ %31, %36 ], [ %.0136171, %25 ]
  %.1 = phi ptr [ %32, %36 ], [ %.0172, %25 ]
  %89 = add i64 %.1137, -1
  %90 = getelementptr inbounds i8, ptr %.1, i64 %89
  store i8 0, ptr %90, align 1, !tbaa !26
  %91 = load ptr, ptr %10, align 8, !tbaa !5
  %92 = ptrtoint ptr %.1 to i64
  %93 = ptrtoint ptr %91 to i64
  %94 = xor i64 %92, -1
  %95 = add i64 %94, %2
  %96 = add i64 %95, %93
  %spec.store.select = tail call i64 @llvm.umin.i64(i64 %96, i64 31)
  %97 = getelementptr inbounds i8, ptr %.1, i64 %3
  tail call void @llvm.memcpy.p0.p0.i64(ptr align 1 %97, ptr nonnull align 16 @png_decompress_chunk.msg, i64 %spec.store.select, i1 false)
  call void @llvm.lifetime.start.p0(i64 52, ptr nonnull %6) #6
  switch i32 %24, label %101 [
    i32 -5, label %.thread160
    i32 -3, label %98
  ]

98:                                               ; preds = %88
  br label %.thread160

.thread160:                                       ; preds = %88, %98
  %.str.6.sink = phi ptr [ @.str.6, %98 ], [ @.str.5, %88 ]
  %99 = getelementptr inbounds i8, ptr %0, i64 620
  %100 = call i32 (ptr, i64, ptr, ...) @snprintf(ptr noundef nonnull dereferenceable(1) %6, i64 noundef 52, ptr noundef nonnull %.str.6.sink, ptr noundef nonnull %99) #6
  call void @png_warning(ptr noundef nonnull %0, ptr noundef nonnull %6) #6
  br label %113

101:                                              ; preds = %88, %.thread154
  %.4.ph158 = phi ptr [ %.0.lcssa, %.thread154 ], [ %.1, %88 ]
  %102 = getelementptr inbounds i8, ptr %0, i64 620
  %103 = call i32 (ptr, i64, ptr, ...) @snprintf(ptr noundef nonnull dereferenceable(1) %6, i64 noundef 52, ptr noundef nonnull @.str.7, ptr noundef nonnull %102) #6
  call void @png_warning(ptr noundef nonnull %0, ptr noundef nonnull %6) #6
  %104 = icmp eq ptr %.4.ph158, null
  br i1 %104, label %105, label %113

105:                                              ; preds = %101
  %106 = add i64 %3, 1
  %107 = call ptr @png_malloc_warn(ptr noundef nonnull %0, i64 noundef %106) #6
  %108 = icmp eq ptr %107, null
  br i1 %108, label %109, label %111

109:                                              ; preds = %105
  %110 = load ptr, ptr %10, align 8, !tbaa !5
  call void @png_free(ptr noundef nonnull %0, ptr noundef %110) #6
  store ptr null, ptr %10, align 8, !tbaa !5
  call void @png_error(ptr noundef nonnull %0, ptr noundef nonnull @.str.8) #6
  br label %111

111:                                              ; preds = %109, %105
  %112 = load ptr, ptr %10, align 8, !tbaa !5
  call void @llvm.memcpy.p0.p0.i64(ptr align 1 %107, ptr align 1 %112, i64 %3, i1 false)
  br label %113

113:                                              ; preds = %.thread160, %111, %101
  %.5 = phi ptr [ %107, %111 ], [ %.4.ph158, %101 ], [ %.1, %.thread160 ]
  %114 = getelementptr inbounds i8, ptr %.5, i64 %3
  store i8 0, ptr %114, align 1, !tbaa !26
  call void @llvm.lifetime.end.p0(i64 52, ptr nonnull %6) #6
  br label %.loopexit

.loopexit:                                        ; preds = %81, %113
  %.5141 = phi i64 [ %3, %113 ], [ %.2138, %81 ]
  %.6 = phi ptr [ %.5, %113 ], [ %.2, %81 ]
  %115 = call i32 @inflateReset(ptr noundef nonnull %13) #6
  store i32 0, ptr %16, align 8, !tbaa !20
  %116 = load ptr, ptr %10, align 8, !tbaa !5
  call void @png_free(ptr noundef nonnull %0, ptr noundef %116) #6
  store ptr %.6, ptr %10, align 8, !tbaa !5
  store i64 %.5141, ptr %4, align 8, !tbaa !29
  br label %122

117:                                              ; preds = %5
  call void @llvm.lifetime.start.p0(i64 50, ptr nonnull %7) #6
  %118 = call i32 (ptr, i64, ptr, ...) @snprintf(ptr noundef nonnull dereferenceable(1) %7, i64 noundef 50, ptr noundef nonnull @.str.9, i32 noundef %1) #6
  call void @png_warning(ptr noundef %0, ptr noundef nonnull %7) #6
  %119 = getelementptr inbounds i8, ptr %0, i64 1256
  %120 = load ptr, ptr %119, align 8, !tbaa !5
  %121 = getelementptr inbounds i8, ptr %120, i64 %3
  store i8 0, ptr %121, align 1, !tbaa !26
  store i64 %3, ptr %4, align 8, !tbaa !29
  call void @llvm.lifetime.end.p0(i64 50, ptr nonnull %7) #6
  br label %122

122:                                              ; preds = %117, %.loopexit
  ret void
}

declare i32 @inflate(ptr noundef, i32 noundef) local_unnamed_addr #1

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

declare i32 @inflateReset(ptr noundef) local_unnamed_addr #1

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

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

; Function Attrs: nofree nounwind
declare noundef i32 @snprintf(ptr noalias nocapture noundef writeonly, i64 noundef, ptr nocapture noundef readonly, ...) local_unnamed_addr #4

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.umin.i64(i64, i64) #5

attributes #0 = { mustprogress 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 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { 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 #4 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #6 = { 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, !9, i64 1256}
!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, !7, i64 272, !7, i64 273, !10, i64 280, !10, i64 288, !10, i64 296, !11, i64 304, !9, i64 416, !10, i64 424, !12, i64 432, !12, i64 436, !12, i64 440, !12, i64 444, !12, i64 448, !10, i64 456, !10, i64 464, !10, i64 472, !10, i64 480, !10, i64 488, !10, i64 496, !10, i64 504, !10, i64 512, !9, i64 520, !9, i64 528, !9, i64 536, !9, i64 544, !9, i64 552, !9, i64 560, !13, i64 568, !10, i64 592, !10, i64 600, !9, i64 608, !14, i64 616, !14, i64 618, !7, i64 620, !7, i64 625, !7, i64 626, !7, i64 627, !7, i64 628, !7, i64 629, !7, i64 630, !7, i64 631, !7, i64 632, !7, i64 633, !7, i64 634, !7, i64 635, !7, i64 636, !14, i64 638, !7, i64 640, !15, i64 644, !16, i64 648, !16, i64 658, !9, i64 672, !10, i64 680, !10, i64 688, !12, i64 696, !15, i64 700, !15, i64 704, !9, i64 712, !9, i64 720, !9, i64 728, !9, i64 736, !9, i64 744, !9, i64 752, !17, i64 760, !17, i64 765, !9, i64 776, !16, i64 784, !9, i64 800, !9, i64 808, !9, i64 816, !9, i64 824, !9, i64 832, !9, i64 840, !9, i64 848, !9, i64 856, !9, i64 864, !10, i64 872, !10, i64 880, !10, i64 888, !10, i64 896, !10, i64 904, !10, i64 912, !12, i64 920, !12, i64 924, !10, i64 928, !10, i64 936, !9, i64 944, !9, i64 952, !9, i64 960, !9, i64 968, !9, i64 976, !7, i64 984, !7, i64 985, !9, i64 992, !9, i64 1000, !9, i64 1008, !9, i64 1016, !9, i64 1024, !9, i64 1032, !10, i64 1040, !9, i64 1048, !9, i64 1056, !12, i64 1064, !9, i64 1072, !7, i64 1080, !14, i64 1082, !14, i64 1084, !14, i64 1086, !10, i64 1088, !10, i64 1096, !7, i64 1104, !7, i64 1105, !10, i64 1112, !10, i64 1120, !9, i64 1128, !9, i64 1136, !9, i64 1144, !9, i64 1152, !9, i64 1160, !9, i64 1168, !9, i64 1176, !7, i64 1184, !10, i64 1192, !10, i64 1200, !18, i64 1208, !10, i64 1240, !10, i64 1248, !9, i64 1256}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!"any pointer", !7, i64 0}
!10 = !{!"long", !7, i64 0}
!11 = !{!"z_stream_s", !9, i64 0, !12, i64 8, !10, i64 16, !9, i64 24, !12, i64 32, !10, i64 40, !9, i64 48, !9, i64 56, !9, i64 64, !9, i64 72, !9, i64 80, !12, i64 88, !10, i64 96, !10, i64 104}
!12 = !{!"int", !7, i64 0}
!13 = !{!"png_row_info_struct", !10, i64 0, !10, 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, !10, i64 16, !7, i64 24}
!19 = !{!6, !9, i64 304}
!20 = !{!6, !12, i64 312}
!21 = !{!6, !9, i64 416}
!22 = !{!6, !9, i64 328}
!23 = !{!6, !10, i64 424}
!24 = !{!6, !12, i64 336}
!25 = !{!6, !9, i64 352}
!26 = !{!7, !7, i64 0}
!27 = distinct !{!27, !28}
!28 = !{!"llvm.loop.mustprogress"}
!29 = !{!10, !10, i64 0}


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