; LLVM IR from niessner/Matterport :: code/gaps/pkgs/png (pngpread)

; 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_text_struct = type { i32, ptr, ptr, i64, i64, ptr, ptr }

@.str.16 = external hidden unnamed_addr constant [40 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local void @png_push_read_zTXt(ptr noundef %0, ptr noundef %1) #0 {
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca i64, align 8
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca i32, align 4
  %10 = alloca i64, align 8
  %11 = alloca i64, align 8
  %12 = alloca i32, align 4
  %13 = alloca ptr, align 8
  store ptr %0, ptr %3, align 8, !tbaa !5
  store ptr %1, ptr %4, align 8, !tbaa !5
  %14 = load ptr, ptr %3, align 8, !tbaa !5
  %15 = getelementptr inbounds %struct.png_struct_def, ptr %14, i32 0, i32 91
  %16 = load i64, ptr %15, align 8, !tbaa !9
  %17 = icmp ne i64 %16, 0
  br i1 %17, label %18, label %57

18:                                               ; preds = %2
  %19 = load ptr, ptr %3, align 8, !tbaa !5
  %20 = getelementptr inbounds %struct.png_struct_def, ptr %19, i32 0, i32 96
  %21 = load i64, ptr %20, align 8, !tbaa !20
  %22 = icmp ne i64 %21, 0
  br i1 %22, label %23, label %57

23:                                               ; preds = %18
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #4
  %24 = load ptr, ptr %3, align 8, !tbaa !5
  %25 = getelementptr inbounds %struct.png_struct_def, ptr %24, i32 0, i32 91
  %26 = load i64, ptr %25, align 8, !tbaa !9
  %27 = load ptr, ptr %3, align 8, !tbaa !5
  %28 = getelementptr inbounds %struct.png_struct_def, ptr %27, i32 0, i32 96
  %29 = load i64, ptr %28, align 8, !tbaa !20
  %30 = trunc i64 %29 to i32
  %31 = zext i32 %30 to i64
  %32 = icmp ult i64 %26, %31
  br i1 %32, label %33, label %37

33:                                               ; preds = %23
  %34 = load ptr, ptr %3, align 8, !tbaa !5
  %35 = getelementptr inbounds %struct.png_struct_def, ptr %34, i32 0, i32 91
  %36 = load i64, ptr %35, align 8, !tbaa !9
  store i64 %36, ptr %5, align 8, !tbaa !21
  br label %41

37:                                               ; preds = %23
  %38 = load ptr, ptr %3, align 8, !tbaa !5
  %39 = getelementptr inbounds %struct.png_struct_def, ptr %38, i32 0, i32 96
  %40 = load i64, ptr %39, align 8, !tbaa !20
  store i64 %40, ptr %5, align 8, !tbaa !21
  br label %41

41:                                               ; preds = %37, %33
  %42 = load ptr, ptr %3, align 8, !tbaa !5
  %43 = load ptr, ptr %3, align 8, !tbaa !5
  %44 = getelementptr inbounds %struct.png_struct_def, ptr %43, i32 0, i32 98
  %45 = load ptr, ptr %44, align 8, !tbaa !22
  %46 = load i64, ptr %5, align 8, !tbaa !21
  call void @png_crc_read(ptr noundef %42, ptr noundef %45, i64 noundef %46)
  %47 = load i64, ptr %5, align 8, !tbaa !21
  %48 = load ptr, ptr %3, align 8, !tbaa !5
  %49 = getelementptr inbounds %struct.png_struct_def, ptr %48, i32 0, i32 96
  %50 = load i64, ptr %49, align 8, !tbaa !20
  %51 = sub i64 %50, %47
  store i64 %51, ptr %49, align 8, !tbaa !20
  %52 = load i64, ptr %5, align 8, !tbaa !21
  %53 = load ptr, ptr %3, align 8, !tbaa !5
  %54 = getelementptr inbounds %struct.png_struct_def, ptr %53, i32 0, i32 98
  %55 = load ptr, ptr %54, align 8, !tbaa !22
  %56 = getelementptr inbounds i8, ptr %55, i64 %52
  store ptr %56, ptr %54, align 8, !tbaa !22
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #4
  br label %57

57:                                               ; preds = %41, %18, %2
  %58 = load ptr, ptr %3, align 8, !tbaa !5
  %59 = getelementptr inbounds %struct.png_struct_def, ptr %58, i32 0, i32 96
  %60 = load i64, ptr %59, align 8, !tbaa !20
  %61 = icmp ne i64 %60, 0
  br i1 %61, label %362, label %62

62:                                               ; preds = %57
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #4
  %63 = load ptr, ptr %3, align 8, !tbaa !5
  %64 = getelementptr inbounds %struct.png_struct_def, ptr %63, i32 0, i32 91
  %65 = load i64, ptr %64, align 8, !tbaa !9
  %66 = icmp ult i64 %65, 4
  br i1 %66, label %67, label %69

67:                                               ; preds = %62
  %68 = load ptr, ptr %3, align 8, !tbaa !5
  call void @png_push_save_buffer(ptr noundef %68)
  store i32 1, ptr %12, align 4
  br label %359

69:                                               ; preds = %62
  %70 = load ptr, ptr %3, align 8, !tbaa !5
  call void @png_push_crc_finish(ptr noundef %70)
  %71 = load ptr, ptr %3, align 8, !tbaa !5
  %72 = getelementptr inbounds %struct.png_struct_def, ptr %71, i32 0, i32 97
  %73 = load ptr, ptr %72, align 8, !tbaa !23
  store ptr %73, ptr %8, align 8, !tbaa !5
  %74 = load ptr, ptr %8, align 8, !tbaa !5
  store ptr %74, ptr %7, align 8, !tbaa !5
  br label %75

75:                                               ; preds = %80, %69
  %76 = load ptr, ptr %7, align 8, !tbaa !5
  %77 = load i8, ptr %76, align 1, !tbaa !24
  %78 = icmp ne i8 %77, 0
  br i1 %78, label %79, label %83

79:                                               ; preds = %75
  br label %80

80:                                               ; preds = %79
  %81 = load ptr, ptr %7, align 8, !tbaa !5
  %82 = getelementptr inbounds i8, ptr %81, i32 1
  store ptr %82, ptr %7, align 8, !tbaa !5
  br label %75, !llvm.loop !25

83:                                               ; preds = %75
  %84 = load ptr, ptr %7, align 8, !tbaa !5
  %85 = load ptr, ptr %8, align 8, !tbaa !5
  %86 = load ptr, ptr %3, align 8, !tbaa !5
  %87 = getelementptr inbounds %struct.png_struct_def, ptr %86, i32 0, i32 95
  %88 = load i64, ptr %87, align 8, !tbaa !27
  %89 = getelementptr inbounds i8, ptr %85, i64 %88
  %90 = icmp uge ptr %84, %89
  br i1 %90, label %91, label %96

91:                                               ; preds = %83
  %92 = load ptr, ptr %3, align 8, !tbaa !5
  %93 = getelementptr inbounds %struct.png_struct_def, ptr %92, i32 0, i32 97
  store ptr null, ptr %93, align 8, !tbaa !23
  %94 = load ptr, ptr %3, align 8, !tbaa !5
  %95 = load ptr, ptr %8, align 8, !tbaa !5
  call void @png_free(ptr noundef %94, ptr noundef %95)
  store i32 1, ptr %12, align 4
  br label %359

96:                                               ; preds = %83
  %97 = load ptr, ptr %7, align 8, !tbaa !5
  %98 = getelementptr inbounds i8, ptr %97, i32 1
  store ptr %98, ptr %7, align 8, !tbaa !5
  %99 = load ptr, ptr %7, align 8, !tbaa !5
  %100 = load i8, ptr %99, align 1, !tbaa !24
  %101 = sext i8 %100 to i32
  %102 = icmp ne i32 %101, 0
  br i1 %102, label %103, label %108

103:                                              ; preds = %96
  %104 = load ptr, ptr %3, align 8, !tbaa !5
  %105 = getelementptr inbounds %struct.png_struct_def, ptr %104, i32 0, i32 97
  store ptr null, ptr %105, align 8, !tbaa !23
  %106 = load ptr, ptr %3, align 8, !tbaa !5
  %107 = load ptr, ptr %8, align 8, !tbaa !5
  call void @png_free(ptr noundef %106, ptr noundef %107)
  store i32 1, ptr %12, align 4
  br label %359

108:                                              ; preds = %96
  %109 = load ptr, ptr %7, align 8, !tbaa !5
  %110 = getelementptr inbounds i8, ptr %109, i32 1
  store ptr %110, ptr %7, align 8, !tbaa !5
  %111 = load ptr, ptr %7, align 8, !tbaa !5
  %112 = load ptr, ptr %3, align 8, !tbaa !5
  %113 = getelementptr inbounds %struct.png_struct_def, ptr %112, i32 0, i32 16
  %114 = getelementptr inbounds %struct.z_stream_s, ptr %113, i32 0, i32 0
  store ptr %111, ptr %114, align 8, !tbaa !28
  %115 = load ptr, ptr %3, align 8, !tbaa !5
  %116 = getelementptr inbounds %struct.png_struct_def, ptr %115, i32 0, i32 95
  %117 = load i64, ptr %116, align 8, !tbaa !27
  %118 = load ptr, ptr %7, align 8, !tbaa !5
  %119 = load ptr, ptr %8, align 8, !tbaa !5
  %120 = ptrtoint ptr %118 to i64
  %121 = ptrtoint ptr %119 to i64
  %122 = sub i64 %120, %121
  %123 = sub i64 %117, %122
  %124 = trunc i64 %123 to i32
  %125 = load ptr, ptr %3, align 8, !tbaa !5
  %126 = getelementptr inbounds %struct.png_struct_def, ptr %125, i32 0, i32 16
  %127 = getelementptr inbounds %struct.z_stream_s, ptr %126, i32 0, i32 1
  store i32 %124, ptr %127, align 8, !tbaa !29
  %128 = load ptr, ptr %3, align 8, !tbaa !5
  %129 = getelementptr inbounds %struct.png_struct_def, ptr %128, i32 0, i32 17
  %130 = load ptr, ptr %129, align 8, !tbaa !30
  %131 = load ptr, ptr %3, align 8, !tbaa !5
  %132 = getelementptr inbounds %struct.png_struct_def, ptr %131, i32 0, i32 16
  %133 = getelementptr inbounds %struct.z_stream_s, ptr %132, i32 0, i32 3
  store ptr %130, ptr %133, align 8, !tbaa !31
  %134 = load ptr, ptr %3, align 8, !tbaa !5
  %135 = getelementptr inbounds %struct.png_struct_def, ptr %134, i32 0, i32 18
  %136 = load i64, ptr %135, align 8, !tbaa !32
  %137 = trunc i64 %136 to i32
  %138 = load ptr, ptr %3, align 8, !tbaa !5
  %139 = getelementptr inbounds %struct.png_struct_def, ptr %138, i32 0, i32 16
  %140 = getelementptr inbounds %struct.z_stream_s, ptr %139, i32 0, i32 4
  store i32 %137, ptr %140, align 8, !tbaa !33
  %141 = load ptr, ptr %7, align 8, !tbaa !5
  %142 = load ptr, ptr %8, align 8, !tbaa !5
  %143 = ptrtoint ptr %141 to i64
  %144 = ptrtoint ptr %142 to i64
  %145 = sub i64 %143, %144
  store i64 %145, ptr %11, align 8, !tbaa !21
  store i64 0, ptr %10, align 8, !tbaa !21
  store ptr null, ptr %7, align 8, !tbaa !5
  store i32 1, ptr %9, align 4, !tbaa !34
  br label %146

146:                                              ; preds = %306, %108
  %147 = load ptr, ptr %3, align 8, !tbaa !5
  %148 = getelementptr inbounds %struct.png_struct_def, ptr %147, i32 0, i32 16
  %149 = getelementptr inbounds %struct.z_stream_s, ptr %148, i32 0, i32 1
  %150 = load i32, ptr %149, align 8, !tbaa !29
  %151 = icmp ne i32 %150, 0
  br i1 %151, label %152, label %307

152:                                              ; preds = %146
  %153 = load ptr, ptr %3, align 8, !tbaa !5
  %154 = getelementptr inbounds %struct.png_struct_def, ptr %153, i32 0, i32 16
  %155 = call i32 @inflate(ptr noundef %154, i32 noundef 1)
  store i32 %155, ptr %9, align 4, !tbaa !34
  %156 = load i32, ptr %9, align 4, !tbaa !34
  %157 = icmp ne i32 %156, 0
  br i1 %157, label %158, label %174

158:                                              ; preds = %152
  %159 = load i32, ptr %9, align 4, !tbaa !34
  %160 = icmp ne i32 %159, 1
  br i1 %160, label %161, label %174

161:                                              ; preds = %158
  %162 = load ptr, ptr %3, align 8, !tbaa !5
  %163 = getelementptr inbounds %struct.png_struct_def, ptr %162, i32 0, i32 16
  %164 = call i32 @inflateReset(ptr noundef %163)
  %165 = load ptr, ptr %3, align 8, !tbaa !5
  %166 = getelementptr inbounds %struct.png_struct_def, ptr %165, i32 0, i32 16
  %167 = getelementptr inbounds %struct.z_stream_s, ptr %166, i32 0, i32 1
  store i32 0, ptr %167, align 8, !tbaa !29
  %168 = load ptr, ptr %3, align 8, !tbaa !5
  %169 = getelementptr inbounds %struct.png_struct_def, ptr %168, i32 0, i32 97
  store ptr null, ptr %169, align 8, !tbaa !23
  %170 = load ptr, ptr %3, align 8, !tbaa !5
  %171 = load ptr, ptr %8, align 8, !tbaa !5
  call void @png_free(ptr noundef %170, ptr noundef %171)
  %172 = load ptr, ptr %3, align 8, !tbaa !5
  %173 = load ptr, ptr %7, align 8, !tbaa !5
  call void @png_free(ptr noundef %172, ptr noundef %173)
  store i32 1, ptr %12, align 4
  br label %359

174:                                              ; preds = %158, %152
  %175 = load ptr, ptr %3, align 8, !tbaa !5
  %176 = getelementptr inbounds %struct.png_struct_def, ptr %175, i32 0, i32 16
  %177 = getelementptr inbounds %struct.z_stream_s, ptr %176, i32 0, i32 4
  %178 = load i32, ptr %177, align 8, !tbaa !33
  %179 = icmp ne i32 %178, 0
  br i1 %179, label %180, label %183

180:                                              ; preds = %174
  %181 = load i32, ptr %9, align 4, !tbaa !34
  %182 = icmp eq i32 %181, 1
  br i1 %182, label %183, label %301

183:                                              ; preds = %180, %174
  %184 = load ptr, ptr %7, align 8, !tbaa !5
  %185 = icmp eq ptr %184, null
  br i1 %185, label %186, label %233

186:                                              ; preds = %183
  %187 = load ptr, ptr %3, align 8, !tbaa !5
  %188 = load ptr, ptr %3, align 8, !tbaa !5
  %189 = getelementptr inbounds %struct.png_struct_def, ptr %188, i32 0, i32 18
  %190 = load i64, ptr %189, align 8, !tbaa !32
  %191 = load ptr, ptr %3, align 8, !tbaa !5
  %192 = getelementptr inbounds %struct.png_struct_def, ptr %191, i32 0, i32 16
  %193 = getelementptr inbounds %struct.z_stream_s, ptr %192, i32 0, i32 4
  %194 = load i32, ptr %193, align 8, !tbaa !33
  %195 = zext i32 %194 to i64
  %196 = sub i64 %190, %195
  %197 = load i64, ptr %11, align 8, !tbaa !21
  %198 = add i64 %196, %197
  %199 = add i64 %198, 1
  %200 = call ptr @png_malloc(ptr noundef %187, i64 noundef %199)
  store ptr %200, ptr %7, align 8, !tbaa !5
  %201 = load ptr, ptr %7, align 8, !tbaa !5
  %202 = load i64, ptr %11, align 8, !tbaa !21
  %203 = getelementptr inbounds i8, ptr %201, i64 %202
  %204 = load ptr, ptr %3, align 8, !tbaa !5
  %205 = getelementptr inbounds %struct.png_struct_def, ptr %204, i32 0, i32 17
  %206 = load ptr, ptr %205, align 8, !tbaa !30
  %207 = load ptr, ptr %3, align 8, !tbaa !5
  %208 = getelementptr inbounds %struct.png_struct_def, ptr %207, i32 0, i32 18
  %209 = load i64, ptr %208, align 8, !tbaa !32
  %210 = load ptr, ptr %3, align 8, !tbaa !5
  %211 = getelementptr inbounds %struct.png_struct_def, ptr %210, i32 0, i32 16
  %212 = getelementptr inbounds %struct.z_stream_s, ptr %211, i32 0, i32 4
  %213 = load i32, ptr %212, align 8, !tbaa !33
  %214 = zext i32 %213 to i64
  %215 = sub i64 %209, %214
  call void @llvm.memcpy.p0.p0.i64(ptr align 1 %203, ptr align 1 %206, i64 %215, i1 false)
  %216 = load ptr, ptr %7, align 8, !tbaa !5
  %217 = load ptr, ptr %8, align 8, !tbaa !5
  %218 = load i64, ptr %11, align 8, !tbaa !21
  call void @llvm.memcpy.p0.p0.i64(ptr align 1 %216, ptr align 1 %217, i64 %218, i1 false)
  %219 = load i64, ptr %11, align 8, !tbaa !21
  %220 = load ptr, ptr %3, align 8, !tbaa !5
  %221 = getelementptr inbounds %struct.png_struct_def, ptr %220, i32 0, i32 18
  %222 = load i64, ptr %221, align 8, !tbaa !32
  %223 = add i64 %219, %222
  %224 = load ptr, ptr %3, align 8, !tbaa !5
  %225 = getelementptr inbounds %struct.png_struct_def, ptr %224, i32 0, i32 16
  %226 = getelementptr inbounds %struct.z_stream_s, ptr %225, i32 0, i32 4
  %227 = load i32, ptr %226, align 8, !tbaa !33
  %228 = zext i32 %227 to i64
  %229 = sub i64 %223, %228
  store i64 %229, ptr %10, align 8, !tbaa !21
  %230 = load ptr, ptr %7, align 8, !tbaa !5
  %231 = load i64, ptr %10, align 8, !tbaa !21
  %232 = getelementptr inbounds i8, ptr %230, i64 %231
  store i8 0, ptr %232, align 1, !tbaa !24
  br label %283

233:                                              ; preds = %183
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #4
  %234 = load ptr, ptr %7, align 8, !tbaa !5
  store ptr %234, ptr %13, align 8, !tbaa !5
  %235 = load ptr, ptr %3, align 8, !tbaa !5
  %236 = load i64, ptr %10, align 8, !tbaa !21
  %237 = load ptr, ptr %3, align 8, !tbaa !5
  %238 = getelementptr inbounds %struct.png_struct_def, ptr %237, i32 0, i32 18
  %239 = load i64, ptr %238, align 8, !tbaa !32
  %240 = load ptr, ptr %3, align 8, !tbaa !5
  %241 = getelementptr inbounds %struct.png_struct_def, ptr %240, i32 0, i32 16
  %242 = getelementptr inbounds %struct.z_stream_s, ptr %241, i32 0, i32 4
  %243 = load i32, ptr %242, align 8, !tbaa !33
  %244 = zext i32 %243 to i64
  %245 = sub i64 %239, %244
  %246 = add i64 %245, 1
  %247 = add i64 %236, %246
  %248 = call ptr @png_malloc(ptr noundef %235, i64 noundef %247)
  store ptr %248, ptr %7, align 8, !tbaa !5
  %249 = load ptr, ptr %7, align 8, !tbaa !5
  %250 = load ptr, ptr %13, align 8, !tbaa !5
  %251 = load i64, ptr %10, align 8, !tbaa !21
  call void @llvm.memcpy.p0.p0.i64(ptr align 1 %249, ptr align 1 %250, i64 %251, i1 false)
  %252 = load ptr, ptr %3, align 8, !tbaa !5
  %253 = load ptr, ptr %13, align 8, !tbaa !5
  call void @png_free(ptr noundef %252, ptr noundef %253)
  %254 = load ptr, ptr %7, align 8, !tbaa !5
  %255 = load i64, ptr %10, align 8, !tbaa !21
  %256 = getelementptr inbounds i8, ptr %254, i64 %255
  %257 = load ptr, ptr %3, align 8, !tbaa !5
  %258 = getelementptr inbounds %struct.png_struct_def, ptr %257, i32 0, i32 17
  %259 = load ptr, ptr %258, align 8, !tbaa !30
  %260 = load ptr, ptr %3, align 8, !tbaa !5
  %261 = getelementptr inbounds %struct.png_struct_def, ptr %260, i32 0, i32 18
  %262 = load i64, ptr %261, align 8, !tbaa !32
  %263 = load ptr, ptr %3, align 8, !tbaa !5
  %264 = getelementptr inbounds %struct.png_struct_def, ptr %263, i32 0, i32 16
  %265 = getelementptr inbounds %struct.z_stream_s, ptr %264, i32 0, i32 4
  %266 = load i32, ptr %265, align 8, !tbaa !33
  %267 = zext i32 %266 to i64
  %268 = sub i64 %262, %267
  call void @llvm.memcpy.p0.p0.i64(ptr align 1 %256, ptr align 1 %259, i64 %268, i1 false)
  %269 = load ptr, ptr %3, align 8, !tbaa !5
  %270 = getelementptr inbounds %struct.png_struct_def, ptr %269, i32 0, i32 18
  %271 = load i64, ptr %270, align 8, !tbaa !32
  %272 = load ptr, ptr %3, align 8, !tbaa !5
  %273 = getelementptr inbounds %struct.png_struct_def, ptr %272, i32 0, i32 16
  %274 = getelementptr inbounds %struct.z_stream_s, ptr %273, i32 0, i32 4
  %275 = load i32, ptr %274, align 8, !tbaa !33
  %276 = zext i32 %275 to i64
  %277 = sub i64 %271, %276
  %278 = load i64, ptr %10, align 8, !tbaa !21
  %279 = add i64 %278, %277
  store i64 %279, ptr %10, align 8, !tbaa !21
  %280 = load ptr, ptr %7, align 8, !tbaa !5
  %281 = load i64, ptr %10, align 8, !tbaa !21
  %282 = getelementptr inbounds i8, ptr %280, i64 %281
  store i8 0, ptr %282, align 1, !tbaa !24
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #4
  br label %283

283:                                              ; preds = %233, %186
  %284 = load i32, ptr %9, align 4, !tbaa !34
  %285 = icmp ne i32 %284, 1
  br i1 %285, label %286, label %300

286:                                              ; preds = %283
  %287 = load ptr, ptr %3, align 8, !tbaa !5
  %288 = getelementptr inbounds %struct.png_struct_def, ptr %287, i32 0, i32 17
  %289 = load ptr, ptr %288, align 8, !tbaa !30
  %290 = load ptr, ptr %3, align 8, !tbaa !5
  %291 = getelementptr inbounds %struct.png_struct_def, ptr %290, i32 0, i32 16
  %292 = getelementptr inbounds %struct.z_stream_s, ptr %291, i32 0, i32 3
  store ptr %289, ptr %292, align 8, !tbaa !31
  %293 = load ptr, ptr %3, align 8, !tbaa !5
  %294 = getelementptr inbounds %struct.png_struct_def, ptr %293, i32 0, i32 18
  %295 = load i64, ptr %294, align 8, !tbaa !32
  %296 = trunc i64 %295 to i32
  %297 = load ptr, ptr %3, align 8, !tbaa !5
  %298 = getelementptr inbounds %struct.png_struct_def, ptr %297, i32 0, i32 16
  %299 = getelementptr inbounds %struct.z_stream_s, ptr %298, i32 0, i32 4
  store i32 %296, ptr %299, align 8, !tbaa !33
  br label %300

300:                                              ; preds = %286, %283
  br label %302

301:                                              ; preds = %180
  br label %307

302:                                              ; preds = %300
  %303 = load i32, ptr %9, align 4, !tbaa !34
  %304 = icmp eq i32 %303, 1
  br i1 %304, label %305, label %306

305:                                              ; preds = %302
  br label %307

306:                                              ; preds = %302
  br label %146, !llvm.loop !35

307:                                              ; preds = %305, %301, %146
  %308 = load ptr, ptr %3, align 8, !tbaa !5
  %309 = getelementptr inbounds %struct.png_struct_def, ptr %308, i32 0, i32 16
  %310 = call i32 @inflateReset(ptr noundef %309)
  %311 = load ptr, ptr %3, align 8, !tbaa !5
  %312 = getelementptr inbounds %struct.png_struct_def, ptr %311, i32 0, i32 16
  %313 = getelementptr inbounds %struct.z_stream_s, ptr %312, i32 0, i32 1
  store i32 0, ptr %313, align 8, !tbaa !29
  %314 = load i32, ptr %9, align 4, !tbaa !34
  %315 = icmp ne i32 %314, 1
  br i1 %315, label %316, label %323

316:                                              ; preds = %307
  %317 = load ptr, ptr %3, align 8, !tbaa !5
  %318 = getelementptr inbounds %struct.png_struct_def, ptr %317, i32 0, i32 97
  store ptr null, ptr %318, align 8, !tbaa !23
  %319 = load ptr, ptr %3, align 8, !tbaa !5
  %320 = load ptr, ptr %8, align 8, !tbaa !5
  call void @png_free(ptr noundef %319, ptr noundef %320)
  %321 = load ptr, ptr %3, align 8, !tbaa !5
  %322 = load ptr, ptr %7, align 8, !tbaa !5
  call void @png_free(ptr noundef %321, ptr noundef %322)
  store i32 1, ptr %12, align 4
  br label %359

323:                                              ; preds = %307
  %324 = load ptr, ptr %3, align 8, !tbaa !5
  %325 = getelementptr inbounds %struct.png_struct_def, ptr %324, i32 0, i32 97
  store ptr null, ptr %325, align 8, !tbaa !23
  %326 = load ptr, ptr %3, align 8, !tbaa !5
  %327 = load ptr, ptr %8, align 8, !tbaa !5
  call void @png_free(ptr noundef %326, ptr noundef %327)
  %328 = load ptr, ptr %7, align 8, !tbaa !5
  store ptr %328, ptr %8, align 8, !tbaa !5
  %329 = load i64, ptr %11, align 8, !tbaa !21
  %330 = load ptr, ptr %7, align 8, !tbaa !5
  %331 = getelementptr inbounds i8, ptr %330, i64 %329
  store ptr %331, ptr %7, align 8, !tbaa !5
  %332 = load ptr, ptr %3, align 8, !tbaa !5
  %333 = call ptr @png_malloc(ptr noundef %332, i64 noundef 56)
  store ptr %333, ptr %6, align 8, !tbaa !5
  %334 = load ptr, ptr %6, align 8, !tbaa !5
  %335 = getelementptr inbounds %struct.png_text_struct, ptr %334, i32 0, i32 0
  store i32 0, ptr %335, align 8, !tbaa !36
  %336 = load ptr, ptr %8, align 8, !tbaa !5
  %337 = load ptr, ptr %6, align 8, !tbaa !5
  %338 = getelementptr inbounds %struct.png_text_struct, ptr %337, i32 0, i32 1
  store ptr %336, ptr %338, align 8, !tbaa !38
  %339 = load ptr, ptr %6, align 8, !tbaa !5
  %340 = getelementptr inbounds %struct.png_text_struct, ptr %339, i32 0, i32 5
  store ptr null, ptr %340, align 8, !tbaa !39
  %341 = load ptr, ptr %6, align 8, !tbaa !5
  %342 = getelementptr inbounds %struct.png_text_struct, ptr %341, i32 0, i32 6
  store ptr null, ptr %342, align 8, !tbaa !40
  %343 = load ptr, ptr %7, align 8, !tbaa !5
  %344 = load ptr, ptr %6, align 8, !tbaa !5
  %345 = getelementptr inbounds %struct.png_text_struct, ptr %344, i32 0, i32 2
  store ptr %343, ptr %345, align 8, !tbaa !41
  %346 = load ptr, ptr %3, align 8, !tbaa !5
  %347 = load ptr, ptr %4, align 8, !tbaa !5
  %348 = load ptr, ptr %6, align 8, !tbaa !5
  %349 = call i32 @png_set_text_2(ptr noundef %346, ptr noundef %347, ptr noundef %348, i32 noundef 1)
  store i32 %349, ptr %9, align 4, !tbaa !34
  %350 = load ptr, ptr %3, align 8, !tbaa !5
  %351 = load ptr, ptr %8, align 8, !tbaa !5
  call void @png_free(ptr noundef %350, ptr noundef %351)
  %352 = load ptr, ptr %3, align 8, !tbaa !5
  %353 = load ptr, ptr %6, align 8, !tbaa !5
  call void @png_free(ptr noundef %352, ptr noundef %353)
  %354 = load i32, ptr %9, align 4, !tbaa !34
  %355 = icmp ne i32 %354, 0
  br i1 %355, label %356, label %358

356:                                              ; preds = %323
  %357 = load ptr, ptr %3, align 8, !tbaa !5
  call void @png_warning(ptr noundef %357, ptr noundef @.str.16)
  br label %358

358:                                              ; preds = %356, %323
  store i32 0, ptr %12, align 4
  br label %359

359:                                              ; preds = %358, %316, %161, %103, %91, %67
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #4
  %360 = load i32, ptr %12, align 4
  switch i32 %360, label %363 [
    i32 0, label %361
    i32 1, label %362
  ]

361:                                              ; preds = %359
  br label %362

362:                                              ; preds = %361, %359, %57
  ret void

363:                                              ; preds = %359
  unreachable
}

; Function Attrs: nounwind uwtable
declare dso_local void @png_push_crc_finish(ptr noundef) #0

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

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

; 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
declare dso_local void @png_push_save_buffer(ptr noundef) #0

declare void @png_crc_read(ptr noundef, ptr noundef, i64 noundef) #3

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

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

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

declare ptr @png_malloc(ptr noundef, i64 noundef) #3

declare i32 @png_set_text_2(ptr noundef, ptr noundef, ptr noundef, i32 noundef) #3

declare i32 @inflateReset(ptr noundef) #3

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

!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, !13, i64 848}
!10 = !{!"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, !11, i64 284, !11, i64 288, !11, i64 292, !12, i64 296, !6, i64 408, !13, i64 416, !11, i64 424, !11, i64 428, !11, i64 432, !11, i64 436, !11, i64 440, !11, i64 444, !11, i64 448, !11, i64 452, !11, i64 456, !13, i64 464, !13, i64 472, !11, i64 480, !11, i64 484, !6, i64 488, !6, i64 496, !6, i64 504, !6, i64 512, !6, i64 520, !6, i64 528, !14, i64 536, !11, i64 560, !11, i64 564, !6, i64 568, !15, i64 576, !15, 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, !15, i64 598, !7, i64 600, !16, i64 604, !17, i64 608, !17, i64 618, !6, i64 632, !11, i64 640, !11, i64 644, !11, i64 648, !16, i64 652, !16, i64 656, !6, i64 664, !6, i64 672, !6, i64 680, !6, i64 688, !6, i64 696, !6, i64 704, !18, i64 712, !18, i64 717, !6, i64 728, !17, 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, !11, i64 824, !11, i64 828, !13, i64 832, !13, i64 840, !13, i64 848, !13, i64 856, !11, i64 864, !11, i64 868, !13, i64 872, !13, 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, !11, i64 984, !6, i64 992, !6, i64 1000, !11, i64 1008, !6, i64 1016, !7, i64 1024, !15, i64 1026, !15, i64 1028, !15, i64 1030, !11, i64 1032, !11, 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, !11, i64 1108, !11, i64 1112, !11, i64 1116, !19, i64 1120, !11, i64 1152, !11, i64 1156, !6, i64 1160, !11, i64 1168}
!11 = !{!"int", !7, i64 0}
!12 = !{!"z_stream_s", !6, i64 0, !11, i64 8, !13, i64 16, !6, i64 24, !11, i64 32, !13, i64 40, !6, i64 48, !6, i64 56, !6, i64 64, !6, i64 72, !6, i64 80, !11, i64 88, !13, i64 96, !13, i64 104}
!13 = !{!"long", !7, i64 0}
!14 = !{!"png_row_info_struct", !11, i64 0, !13, i64 8, !7, i64 16, !7, i64 17, !7, i64 18, !7, i64 19}
!15 = !{!"short", !7, i64 0}
!16 = !{!"float", !7, i64 0}
!17 = !{!"png_color_16_struct", !7, i64 0, !15, i64 2, !15, i64 4, !15, i64 6, !15, i64 8}
!18 = !{!"png_color_8_struct", !7, i64 0, !7, i64 1, !7, i64 2, !7, i64 3, !7, i64 4}
!19 = !{!"png_unknown_chunk_t", !7, i64 0, !6, i64 8, !13, i64 16, !7, i64 24}
!20 = !{!10, !13, i64 880}
!21 = !{!13, !13, i64 0}
!22 = !{!10, !6, i64 896}
!23 = !{!10, !6, i64 888}
!24 = !{!7, !7, i64 0}
!25 = distinct !{!25, !26}
!26 = !{!"llvm.loop.mustprogress"}
!27 = !{!10, !13, i64 872}
!28 = !{!10, !6, i64 296}
!29 = !{!10, !11, i64 304}
!30 = !{!10, !6, i64 408}
!31 = !{!10, !6, i64 320}
!32 = !{!10, !13, i64 416}
!33 = !{!10, !11, i64 328}
!34 = !{!11, !11, i64 0}
!35 = distinct !{!35, !26}
!36 = !{!37, !11, i64 0}
!37 = !{!"png_text_struct", !11, i64 0, !6, i64 8, !6, i64 16, !13, i64 24, !13, i64 32, !6, i64 40, !6, i64 48}
!38 = !{!37, !6, i64 8}
!39 = !{!37, !6, i64 40}
!40 = !{!37, !6, i64 48}
!41 = !{!37, !6, i64 16}


; 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.16 = external hidden unnamed_addr constant [40 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local void @png_push_read_zTXt(ptr noundef %0, ptr noundef %1) local_unnamed_addr #0 {
  %3 = getelementptr inbounds i8, ptr %0, i64 848
  %4 = load i64, ptr %3, align 8, !tbaa !5
  %.not = icmp eq i64 %4, 0
  %.phi.trans.insert = getelementptr inbounds i8, ptr %0, i64 880
  %.pre = load i64, ptr %.phi.trans.insert, align 8, !tbaa !19
  br i1 %.not, label %._crit_edge183, label %5

5:                                                ; preds = %2
  %.not145 = icmp eq i64 %.pre, 0
  br i1 %.not145, label %.thread, label %6

6:                                                ; preds = %5
  %7 = and i64 %.pre, 4294967295
  %8 = icmp ult i64 %4, %7
  %. = select i1 %8, i64 %4, i64 %.pre
  %9 = getelementptr inbounds i8, ptr %0, i64 896
  %10 = load ptr, ptr %9, align 8, !tbaa !20
  tail call void @png_crc_read(ptr noundef nonnull %0, ptr noundef %10, i64 noundef %.) #4
  %11 = load i64, ptr %.phi.trans.insert, align 8, !tbaa !19
  %12 = sub i64 %11, %.
  store i64 %12, ptr %.phi.trans.insert, align 8, !tbaa !19
  %13 = load ptr, ptr %9, align 8, !tbaa !20
  %14 = getelementptr inbounds i8, ptr %13, i64 %.
  store ptr %14, ptr %9, align 8, !tbaa !20
  br label %._crit_edge183

._crit_edge183:                                   ; preds = %2, %6
  %15 = phi i64 [ %12, %6 ], [ %.pre, %2 ]
  %.not146 = icmp eq i64 %15, 0
  br i1 %.not146, label %.thread, label %108

.thread:                                          ; preds = %5, %._crit_edge183
  %16 = load i64, ptr %3, align 8, !tbaa !5
  %17 = icmp ult i64 %16, 4
  br i1 %17, label %18, label %19

18:                                               ; preds = %.thread
  tail call void @png_push_save_buffer(ptr noundef nonnull %0)
  br label %108

19:                                               ; preds = %.thread
  tail call void @png_push_crc_finish(ptr noundef nonnull %0)
  %20 = getelementptr inbounds i8, ptr %0, i64 888
  %21 = load ptr, ptr %20, align 8, !tbaa !21
  br label %22

22:                                               ; preds = %22, %19
  %.0135 = phi ptr [ %21, %19 ], [ %24, %22 ]
  %23 = load i8, ptr %.0135, align 1, !tbaa !22
  %.not147 = icmp eq i8 %23, 0
  %24 = getelementptr inbounds i8, ptr %.0135, i64 1
  br i1 %.not147, label %25, label %22, !llvm.loop !23

25:                                               ; preds = %22
  %26 = getelementptr inbounds i8, ptr %0, i64 872
  %27 = load i64, ptr %26, align 8, !tbaa !25
  %28 = getelementptr inbounds i8, ptr %21, i64 %27
  %.not148 = icmp ult ptr %.0135, %28
  br i1 %.not148, label %30, label %29

29:                                               ; preds = %25
  store ptr null, ptr %20, align 8, !tbaa !21
  tail call void @png_free(ptr noundef nonnull %0, ptr noundef %21) #4
  br label %108

30:                                               ; preds = %25
  %31 = load i8, ptr %24, align 1, !tbaa !22
  %.not149 = icmp eq i8 %31, 0
  br i1 %.not149, label %33, label %32

32:                                               ; preds = %30
  store ptr null, ptr %20, align 8, !tbaa !21
  tail call void @png_free(ptr noundef nonnull %0, ptr noundef %21) #4
  br label %108

33:                                               ; preds = %30
  %34 = getelementptr inbounds i8, ptr %.0135, i64 2
  %35 = getelementptr inbounds i8, ptr %0, i64 296
  store ptr %34, ptr %35, align 8, !tbaa !26
  %36 = ptrtoint ptr %34 to i64
  %37 = ptrtoint ptr %21 to i64
  %38 = sub i64 %36, %37
  %39 = sub i64 %27, %38
  %40 = trunc i64 %39 to i32
  %41 = getelementptr inbounds i8, ptr %0, i64 304
  store i32 %40, ptr %41, align 8, !tbaa !27
  %42 = getelementptr inbounds i8, ptr %0, i64 408
  %43 = load ptr, ptr %42, align 8, !tbaa !28
  %44 = getelementptr inbounds i8, ptr %0, i64 320
  store ptr %43, ptr %44, align 8, !tbaa !29
  %45 = getelementptr inbounds i8, ptr %0, i64 416
  %46 = getelementptr inbounds i8, ptr %0, i64 328
  %storemerge.in173 = load i64, ptr %45, align 8, !tbaa !30
  %storemerge174 = trunc i64 %storemerge.in173 to i32
  store i32 %storemerge174, ptr %46, align 8, !tbaa !31
  %.not150175 = icmp eq i32 %40, 0
  br i1 %.not150175, label %.sink.split, label %.lr.ph

.lr.ph:                                           ; preds = %33
  %47 = add i64 %38, 1
  br label %48

48:                                               ; preds = %.lr.ph, %94
  %.1177 = phi ptr [ null, %.lr.ph ], [ %.2, %94 ]
  %.0136176 = phi i64 [ 0, %.lr.ph ], [ %.1137, %94 ]
  %49 = tail call i32 @inflate(ptr noundef nonnull %35, i32 noundef 1) #4
  %.not151 = icmp eq i32 %49, 1
  %or.cond = icmp ugt i32 %49, 1
  br i1 %or.cond, label %50, label %52

50:                                               ; preds = %48
  %51 = tail call i32 @inflateReset(ptr noundef nonnull %35) #4
  store i32 0, ptr %41, align 8, !tbaa !27
  store ptr null, ptr %20, align 8, !tbaa !21
  tail call void @png_free(ptr noundef nonnull %0, ptr noundef %21) #4
  tail call void @png_free(ptr noundef nonnull %0, ptr noundef %.1177) #4
  br label %108

52:                                               ; preds = %48
  %53 = load i32, ptr %46, align 8, !tbaa !31
  %54 = icmp eq i32 %53, 0
  %or.cond3 = or i1 %.not151, %54
  br i1 %or.cond3, label %56, label %.thread159

.thread159:                                       ; preds = %52
  %55 = tail call i32 @inflateReset(ptr noundef nonnull %35) #4
  store i32 0, ptr %41, align 8, !tbaa !27
  br label %98

56:                                               ; preds = %52
  %57 = icmp eq ptr %.1177, null
  %58 = load i64, ptr %45, align 8, !tbaa !30
  %59 = zext i32 %53 to i64
  br i1 %57, label %60, label %76

60:                                               ; preds = %56
  %61 = sub i64 %47, %59
  %62 = add i64 %61, %58
  %63 = tail call ptr @png_malloc(ptr noundef nonnull %0, i64 noundef %62) #4
  %64 = getelementptr inbounds i8, ptr %63, i64 %38
  %65 = load ptr, ptr %42, align 8, !tbaa !28
  %66 = load i64, ptr %45, align 8, !tbaa !30
  %67 = load i32, ptr %46, align 8, !tbaa !31
  %68 = zext i32 %67 to i64
  %69 = sub i64 %66, %68
  tail call void @llvm.memcpy.p0.p0.i64(ptr align 1 %64, ptr align 1 %65, i64 %69, i1 false)
  tail call void @llvm.memcpy.p0.p0.i64(ptr align 1 %63, ptr align 1 %21, i64 %38, i1 false)
  %70 = load i64, ptr %45, align 8, !tbaa !30
  %71 = add i64 %70, %38
  %72 = load i32, ptr %46, align 8, !tbaa !31
  %73 = zext i32 %72 to i64
  %74 = sub i64 %71, %73
  %75 = getelementptr inbounds i8, ptr %63, i64 %74
  br label %93

76:                                               ; preds = %56
  %77 = add i64 %.0136176, 1
  %78 = sub i64 %77, %59
  %79 = add i64 %78, %58
  %80 = tail call ptr @png_malloc(ptr noundef nonnull %0, i64 noundef %79) #4
  tail call void @llvm.memcpy.p0.p0.i64(ptr align 1 %80, ptr nonnull align 1 %.1177, i64 %.0136176, i1 false)
  tail call void @png_free(ptr noundef nonnull %0, ptr noundef nonnull %.1177) #4
  %81 = getelementptr inbounds i8, ptr %80, i64 %.0136176
  %82 = load ptr, ptr %42, align 8, !tbaa !28
  %83 = load i64, ptr %45, align 8, !tbaa !30
  %84 = load i32, ptr %46, align 8, !tbaa !31
  %85 = zext i32 %84 to i64
  %86 = sub i64 %83, %85
  tail call void @llvm.memcpy.p0.p0.i64(ptr align 1 %81, ptr align 1 %82, i64 %86, i1 false)
  %87 = load i64, ptr %45, align 8, !tbaa !30
  %88 = load i32, ptr %46, align 8, !tbaa !31
  %89 = zext i32 %88 to i64
  %90 = sub i64 %87, %89
  %91 = add i64 %90, %.0136176
  %92 = getelementptr inbounds i8, ptr %80, i64 %91
  br label %93

93:                                               ; preds = %76, %60
  %.sink = phi ptr [ %92, %76 ], [ %75, %60 ]
  %.1137 = phi i64 [ %91, %76 ], [ %74, %60 ]
  %.2 = phi ptr [ %80, %76 ], [ %63, %60 ]
  store i8 0, ptr %.sink, align 1, !tbaa !22
  br i1 %.not151, label %.sink.split, label %94

94:                                               ; preds = %93
  %95 = load ptr, ptr %42, align 8, !tbaa !28
  store ptr %95, ptr %44, align 8, !tbaa !29
  %storemerge.in = load i64, ptr %45, align 8, !tbaa !30
  %storemerge = trunc i64 %storemerge.in to i32
  store i32 %storemerge, ptr %46, align 8, !tbaa !31
  %96 = load i32, ptr %41, align 8, !tbaa !27
  %.not150 = icmp eq i32 %96, 0
  br i1 %.not150, label %._crit_edge, label %48, !llvm.loop !32

._crit_edge:                                      ; preds = %94
  %97 = tail call i32 @inflateReset(ptr noundef nonnull %35) #4
  store i32 0, ptr %41, align 8, !tbaa !27
  br i1 %.not150175, label %100, label %98

98:                                               ; preds = %.thread159, %._crit_edge
  %.1169 = phi ptr [ %.1177, %.thread159 ], [ %.2, %._crit_edge ]
  store ptr null, ptr %20, align 8, !tbaa !21
  tail call void @png_free(ptr noundef nonnull %0, ptr noundef %21) #4
  tail call void @png_free(ptr noundef nonnull %0, ptr noundef %.1169) #4
  br label %108

.sink.split:                                      ; preds = %93, %33
  %.3158.ph = phi ptr [ null, %33 ], [ %.2, %93 ]
  %99 = tail call i32 @inflateReset(ptr noundef nonnull %35) #4
  store i32 0, ptr %41, align 8, !tbaa !27
  br label %100

100:                                              ; preds = %.sink.split, %._crit_edge
  %.3158 = phi ptr [ %.2, %._crit_edge ], [ %.3158.ph, %.sink.split ]
  store ptr null, ptr %20, align 8, !tbaa !21
  tail call void @png_free(ptr noundef nonnull %0, ptr noundef %21) #4
  %101 = getelementptr inbounds i8, ptr %.3158, i64 %38
  %102 = tail call ptr @png_malloc(ptr noundef nonnull %0, i64 noundef 56) #4
  store i32 0, ptr %102, align 8, !tbaa !33
  %103 = getelementptr inbounds i8, ptr %102, i64 8
  store ptr %.3158, ptr %103, align 8, !tbaa !35
  %104 = getelementptr inbounds i8, ptr %102, i64 40
  %105 = getelementptr inbounds i8, ptr %102, i64 16
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %104, i8 0, i64 16, i1 false)
  store ptr %101, ptr %105, align 8, !tbaa !36
  %106 = tail call i32 @png_set_text_2(ptr noundef nonnull %0, ptr noundef %1, ptr noundef nonnull %102, i32 noundef 1) #4
  tail call void @png_free(ptr noundef nonnull %0, ptr noundef %.3158) #4
  tail call void @png_free(ptr noundef nonnull %0, ptr noundef nonnull %102) #4
  %.not153 = icmp eq i32 %106, 0
  br i1 %.not153, label %108, label %107

107:                                              ; preds = %100
  tail call void @png_warning(ptr noundef nonnull %0, ptr noundef nonnull @.str.16) #4
  br label %108

108:                                              ; preds = %18, %29, %32, %50, %98, %107, %100, %._crit_edge183
  ret void
}

; Function Attrs: nounwind uwtable
declare dso_local void @png_push_crc_finish(ptr noundef) local_unnamed_addr #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) #1

; Function Attrs: nounwind uwtable
declare dso_local void @png_push_save_buffer(ptr noundef) local_unnamed_addr #0

declare void @png_crc_read(ptr noundef, ptr noundef, i64 noundef) local_unnamed_addr #2

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

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

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

declare ptr @png_malloc(ptr noundef, i64 noundef) local_unnamed_addr #2

declare i32 @png_set_text_2(ptr noundef, ptr noundef, ptr noundef, i32 noundef) local_unnamed_addr #2

declare i32 @inflateReset(ptr noundef) local_unnamed_addr #2

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

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

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !12, i64 848}
!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 = !{!6, !12, i64 880}
!20 = !{!6, !9, i64 896}
!21 = !{!6, !9, i64 888}
!22 = !{!7, !7, i64 0}
!23 = distinct !{!23, !24}
!24 = !{!"llvm.loop.mustprogress"}
!25 = !{!6, !12, i64 872}
!26 = !{!6, !9, i64 296}
!27 = !{!6, !10, i64 304}
!28 = !{!6, !9, i64 408}
!29 = !{!6, !9, i64 320}
!30 = !{!6, !12, i64 416}
!31 = !{!6, !10, i64 328}
!32 = distinct !{!32, !24}
!33 = !{!34, !10, i64 0}
!34 = !{!"png_text_struct", !10, i64 0, !9, i64 8, !9, i64 16, !12, i64 24, !12, i64 32, !9, i64 40, !9, i64 48}
!35 = !{!34, !9, i64 8}
!36 = !{!34, !9, i64 16}


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