; 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 }
%struct.png_info_struct = type { i64, i64, i64, i64, ptr, i16, i16, i8, i8, i8, i8, i8, i8, i8, i8, [8 x i8], float, i8, i32, i32, ptr, %struct.png_time_struct, %struct.png_color_8_struct, ptr, %struct.png_color_16_struct, %struct.png_color_16_struct, i64, i64, i8, i64, i64, i8, ptr, float, float, float, float, float, float, float, float, ptr, i64, i64, ptr, ptr, i8, i8, i64, ptr, i64, ptr, ptr, i64, i8, ptr, i64, i8, double, double, ptr, ptr, ptr, i64, i64, i64, i64, i64, i64, i64, i64, i64 }
%struct.png_time_struct = type { i16, i8, i8, i8, i8, i8 }

@.str.49 = external hidden unnamed_addr constant [25 x i8], align 1
@.str.50 = external hidden unnamed_addr constant [24 x i8], align 1
@.str.51 = external hidden unnamed_addr constant [24 x i8], align 1
@.str.52 = external hidden unnamed_addr constant [21 x i8], align 1
@.str.53 = external hidden unnamed_addr constant [21 x i8], align 1
@.str.54 = external hidden unnamed_addr constant [48 x i8], align 1
@.str.55 = external hidden unnamed_addr constant [43 x i8], align 1
@.str.56 = 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: nounwind uwtable
declare dso_local void @png_crc_read(ptr noundef, ptr noundef, i64 noundef) #2

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

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

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

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

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

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

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

30:                                               ; preds = %24
  %31 = load ptr, ptr %4, align 8, !tbaa !5
  call void @png_warning(ptr noundef %31, ptr noundef @.str.50)
  %32 = load ptr, ptr %4, align 8, !tbaa !5
  %33 = load i64, ptr %6, align 8, !tbaa !9
  %34 = call i32 @png_crc_finish(ptr noundef %32, i64 noundef %33)
  store i32 1, ptr %16, align 4
  br label %226

35:                                               ; preds = %24
  %36 = load ptr, ptr %4, align 8, !tbaa !5
  %37 = getelementptr inbounds %struct.png_struct_def, ptr %36, i32 0, i32 12
  %38 = load i64, ptr %37, align 8, !tbaa !11
  %39 = and i64 %38, 2
  %40 = icmp ne i64 %39, 0
  br i1 %40, label %41, label %43

41:                                               ; preds = %35
  %42 = load ptr, ptr %4, align 8, !tbaa !5
  call void @png_warning(ptr noundef %42, ptr noundef @.str.51)
  br label %43

43:                                               ; preds = %41, %35
  br label %44

44:                                               ; preds = %43
  br label %45

45:                                               ; preds = %44, %22
  %46 = load ptr, ptr %5, align 8, !tbaa !5
  %47 = icmp ne ptr %46, null
  br i1 %47, label %48, label %59

48:                                               ; preds = %45
  %49 = load ptr, ptr %5, align 8, !tbaa !5
  %50 = getelementptr inbounds %struct.png_info_struct, ptr %49, i32 0, i32 2
  %51 = load i64, ptr %50, align 8, !tbaa !21
  %52 = and i64 %51, 4096
  %53 = icmp ne i64 %52, 0
  br i1 %53, label %54, label %59

54:                                               ; preds = %48
  %55 = load ptr, ptr %4, align 8, !tbaa !5
  call void @png_warning(ptr noundef %55, ptr noundef @.str.52)
  %56 = load ptr, ptr %4, align 8, !tbaa !5
  %57 = load i64, ptr %6, align 8, !tbaa !9
  %58 = call i32 @png_crc_finish(ptr noundef %56, i64 noundef %57)
  store i32 1, ptr %16, align 4
  br label %226

59:                                               ; preds = %48, %45
  %60 = load ptr, ptr %4, align 8, !tbaa !5
  %61 = load ptr, ptr %4, align 8, !tbaa !5
  %62 = getelementptr inbounds %struct.png_struct_def, ptr %61, i32 0, i32 137
  %63 = load ptr, ptr %62, align 8, !tbaa !25
  call void @png_free(ptr noundef %60, ptr noundef %63)
  %64 = load ptr, ptr %4, align 8, !tbaa !5
  %65 = load i64, ptr %6, align 8, !tbaa !9
  %66 = add i64 %65, 1
  %67 = call ptr @png_malloc(ptr noundef %64, i64 noundef %66)
  %68 = load ptr, ptr %4, align 8, !tbaa !5
  %69 = getelementptr inbounds %struct.png_struct_def, ptr %68, i32 0, i32 137
  store ptr %67, ptr %69, align 8, !tbaa !25
  %70 = load i64, ptr %6, align 8, !tbaa !9
  store i64 %70, ptr %13, align 8, !tbaa !9
  %71 = load ptr, ptr %4, align 8, !tbaa !5
  %72 = load ptr, ptr %4, align 8, !tbaa !5
  %73 = getelementptr inbounds %struct.png_struct_def, ptr %72, i32 0, i32 137
  %74 = load ptr, ptr %73, align 8, !tbaa !25
  %75 = load i64, ptr %13, align 8, !tbaa !9
  call void @png_crc_read(ptr noundef %71, ptr noundef %74, i64 noundef %75)
  %76 = load ptr, ptr %4, align 8, !tbaa !5
  %77 = load i64, ptr %10, align 8, !tbaa !9
  %78 = call i32 @png_crc_finish(ptr noundef %76, i64 noundef %77)
  %79 = icmp ne i32 %78, 0
  br i1 %79, label %80, label %87

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

87:                                               ; preds = %59
  %88 = load ptr, ptr %4, align 8, !tbaa !5
  %89 = getelementptr inbounds %struct.png_struct_def, ptr %88, i32 0, i32 137
  %90 = load ptr, ptr %89, align 8, !tbaa !25
  %91 = load i64, ptr %13, align 8, !tbaa !9
  %92 = getelementptr inbounds i8, ptr %90, i64 %91
  store i8 0, ptr %92, align 1, !tbaa !26
  %93 = load ptr, ptr %4, align 8, !tbaa !5
  %94 = getelementptr inbounds %struct.png_struct_def, ptr %93, i32 0, i32 137
  %95 = load ptr, ptr %94, align 8, !tbaa !25
  store ptr %95, ptr %9, align 8, !tbaa !5
  br label %96

96:                                               ; preds = %101, %87
  %97 = load ptr, ptr %9, align 8, !tbaa !5
  %98 = load i8, ptr %97, align 1, !tbaa !26
  %99 = icmp ne i8 %98, 0
  br i1 %99, label %100, label %104

100:                                              ; preds = %96
  br label %101

101:                                              ; preds = %100
  %102 = load ptr, ptr %9, align 8, !tbaa !5
  %103 = getelementptr inbounds i8, ptr %102, i32 1
  store ptr %103, ptr %9, align 8, !tbaa !5
  br label %96, !llvm.loop !27

104:                                              ; preds = %96
  %105 = load ptr, ptr %9, align 8, !tbaa !5
  %106 = getelementptr inbounds i8, ptr %105, i32 1
  store ptr %106, ptr %9, align 8, !tbaa !5
  %107 = load ptr, ptr %9, align 8, !tbaa !5
  %108 = load ptr, ptr %4, align 8, !tbaa !5
  %109 = getelementptr inbounds %struct.png_struct_def, ptr %108, i32 0, i32 137
  %110 = load ptr, ptr %109, align 8, !tbaa !25
  %111 = load i64, ptr %13, align 8, !tbaa !9
  %112 = getelementptr inbounds i8, ptr %110, i64 %111
  %113 = getelementptr inbounds i8, ptr %112, i64 -1
  %114 = icmp uge ptr %107, %113
  br i1 %114, label %115, label %123

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

123:                                              ; preds = %104
  %124 = load ptr, ptr %9, align 8, !tbaa !5
  %125 = getelementptr inbounds i8, ptr %124, i32 1
  store ptr %125, ptr %9, align 8, !tbaa !5
  %126 = load i8, ptr %124, align 1, !tbaa !26
  store i8 %126, ptr %7, align 1, !tbaa !26
  %127 = load i8, ptr %7, align 1, !tbaa !26
  %128 = icmp ne i8 %127, 0
  br i1 %128, label %129, label %131

129:                                              ; preds = %123
  %130 = load ptr, ptr %4, align 8, !tbaa !5
  call void @png_warning(ptr noundef %130, ptr noundef @.str.54)
  store i8 0, ptr %7, align 1, !tbaa !26
  br label %131

131:                                              ; preds = %129, %123
  %132 = load ptr, ptr %9, align 8, !tbaa !5
  %133 = load ptr, ptr %4, align 8, !tbaa !5
  %134 = getelementptr inbounds %struct.png_struct_def, ptr %133, i32 0, i32 137
  %135 = load ptr, ptr %134, align 8, !tbaa !25
  %136 = ptrtoint ptr %132 to i64
  %137 = ptrtoint ptr %135 to i64
  %138 = sub i64 %136, %137
  store i64 %138, ptr %14, align 8, !tbaa !9
  %139 = load ptr, ptr %4, align 8, !tbaa !5
  %140 = load i8, ptr %7, align 1, !tbaa !26
  %141 = zext i8 %140 to i32
  %142 = load i64, ptr %13, align 8, !tbaa !9
  %143 = load i64, ptr %14, align 8, !tbaa !9
  call void @png_decompress_chunk(ptr noundef %139, i32 noundef %141, i64 noundef %142, i64 noundef %143, ptr noundef %15)
  %144 = load i64, ptr %15, align 8, !tbaa !9
  %145 = load i64, ptr %14, align 8, !tbaa !9
  %146 = sub i64 %144, %145
  store i64 %146, ptr %12, align 8, !tbaa !9
  %147 = load i64, ptr %14, align 8, !tbaa !9
  %148 = load i64, ptr %15, align 8, !tbaa !9
  %149 = icmp ugt i64 %147, %148
  br i1 %149, label %153, label %150

150:                                              ; preds = %131
  %151 = load i64, ptr %12, align 8, !tbaa !9
  %152 = icmp ult i64 %151, 4
  br i1 %152, label %153, label %161

153:                                              ; preds = %150, %131
  %154 = load ptr, ptr %4, align 8, !tbaa !5
  %155 = load ptr, ptr %4, align 8, !tbaa !5
  %156 = getelementptr inbounds %struct.png_struct_def, ptr %155, i32 0, i32 137
  %157 = load ptr, ptr %156, align 8, !tbaa !25
  call void @png_free(ptr noundef %154, ptr noundef %157)
  %158 = load ptr, ptr %4, align 8, !tbaa !5
  %159 = getelementptr inbounds %struct.png_struct_def, ptr %158, i32 0, i32 137
  store ptr null, ptr %159, align 8, !tbaa !25
  %160 = load ptr, ptr %4, align 8, !tbaa !5
  call void @png_warning(ptr noundef %160, ptr noundef @.str.55)
  store i32 1, ptr %16, align 4
  br label %226

161:                                              ; preds = %150
  %162 = load ptr, ptr %4, align 8, !tbaa !5
  %163 = getelementptr inbounds %struct.png_struct_def, ptr %162, i32 0, i32 137
  %164 = load ptr, ptr %163, align 8, !tbaa !25
  %165 = load i64, ptr %14, align 8, !tbaa !9
  %166 = getelementptr inbounds i8, ptr %164, i64 %165
  store ptr %166, ptr %8, align 8, !tbaa !5
  %167 = load ptr, ptr %8, align 8, !tbaa !5
  %168 = load i8, ptr %167, align 1, !tbaa !26
  %169 = zext i8 %168 to i32
  %170 = shl i32 %169, 24
  %171 = load ptr, ptr %8, align 8, !tbaa !5
  %172 = getelementptr inbounds i8, ptr %171, i64 1
  %173 = load i8, ptr %172, align 1, !tbaa !26
  %174 = zext i8 %173 to i32
  %175 = shl i32 %174, 16
  %176 = or i32 %170, %175
  %177 = load ptr, ptr %8, align 8, !tbaa !5
  %178 = getelementptr inbounds i8, ptr %177, i64 2
  %179 = load i8, ptr %178, align 1, !tbaa !26
  %180 = zext i8 %179 to i32
  %181 = shl i32 %180, 8
  %182 = or i32 %176, %181
  %183 = load ptr, ptr %8, align 8, !tbaa !5
  %184 = getelementptr inbounds i8, ptr %183, i64 3
  %185 = load i8, ptr %184, align 1, !tbaa !26
  %186 = zext i8 %185 to i32
  %187 = or i32 %182, %186
  %188 = sext i32 %187 to i64
  store i64 %188, ptr %11, align 8, !tbaa !9
  %189 = load i64, ptr %11, align 8, !tbaa !9
  %190 = load i64, ptr %12, align 8, !tbaa !9
  %191 = icmp ult i64 %189, %190
  br i1 %191, label %192, label %194

192:                                              ; preds = %161
  %193 = load i64, ptr %11, align 8, !tbaa !9
  store i64 %193, ptr %12, align 8, !tbaa !9
  br label %194

194:                                              ; preds = %192, %161
  %195 = load i64, ptr %11, align 8, !tbaa !9
  %196 = load i64, ptr %12, align 8, !tbaa !9
  %197 = icmp ugt i64 %195, %196
  br i1 %197, label %198, label %206

198:                                              ; preds = %194
  %199 = load ptr, ptr %4, align 8, !tbaa !5
  %200 = load ptr, ptr %4, align 8, !tbaa !5
  %201 = getelementptr inbounds %struct.png_struct_def, ptr %200, i32 0, i32 137
  %202 = load ptr, ptr %201, align 8, !tbaa !25
  call void @png_free(ptr noundef %199, ptr noundef %202)
  %203 = load ptr, ptr %4, align 8, !tbaa !5
  %204 = getelementptr inbounds %struct.png_struct_def, ptr %203, i32 0, i32 137
  store ptr null, ptr %204, align 8, !tbaa !25
  %205 = load ptr, ptr %4, align 8, !tbaa !5
  call void @png_warning(ptr noundef %205, ptr noundef @.str.56)
  store i32 1, ptr %16, align 4
  br label %226

206:                                              ; preds = %194
  %207 = load ptr, ptr %4, align 8, !tbaa !5
  %208 = load ptr, ptr %5, align 8, !tbaa !5
  %209 = load ptr, ptr %4, align 8, !tbaa !5
  %210 = getelementptr inbounds %struct.png_struct_def, ptr %209, i32 0, i32 137
  %211 = load ptr, ptr %210, align 8, !tbaa !25
  %212 = load i8, ptr %7, align 1, !tbaa !26
  %213 = zext i8 %212 to i32
  %214 = load ptr, ptr %4, align 8, !tbaa !5
  %215 = getelementptr inbounds %struct.png_struct_def, ptr %214, i32 0, i32 137
  %216 = load ptr, ptr %215, align 8, !tbaa !25
  %217 = load i64, ptr %14, align 8, !tbaa !9
  %218 = getelementptr inbounds i8, ptr %216, i64 %217
  %219 = load i64, ptr %12, align 8, !tbaa !9
  call void @png_set_iCCP(ptr noundef %207, ptr noundef %208, ptr noundef %211, i32 noundef %213, ptr noundef %218, i64 noundef %219)
  %220 = load ptr, ptr %4, align 8, !tbaa !5
  %221 = load ptr, ptr %4, align 8, !tbaa !5
  %222 = getelementptr inbounds %struct.png_struct_def, ptr %221, i32 0, i32 137
  %223 = load ptr, ptr %222, align 8, !tbaa !25
  call void @png_free(ptr noundef %220, ptr noundef %223)
  %224 = load ptr, ptr %4, align 8, !tbaa !5
  %225 = getelementptr inbounds %struct.png_struct_def, ptr %224, i32 0, i32 137
  store ptr null, ptr %225, align 8, !tbaa !25
  store i32 0, ptr %16, align 4
  br label %226

226:                                              ; preds = %206, %198, %153, %115, %80, %54, %30
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #3
  call void @llvm.lifetime.end.p0(i64 1, ptr %7) #3
  %227 = load i32, ptr %16, align 4
  switch i32 %227, label %229 [
    i32 0, label %228
    i32 1, label %228
  ]

228:                                              ; preds = %226, %226
  ret void

229:                                              ; preds = %226
  unreachable
}

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

declare void @png_set_iCCP(ptr noundef, ptr noundef, ptr noundef, i32 noundef, ptr noundef, i64 noundef) #1

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

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"long", !7, i64 0}
!11 = !{!12, !10, i64 280}
!12 = !{!"png_struct_def", !7, i64 0, !6, i64 200, !6, i64 208, !6, i64 216, !6, i64 224, !6, i64 232, !6, i64 240, !6, i64 248, !6, i64 256, !6, i64 264, !7, i64 272, !7, i64 273, !10, i64 280, !10, i64 288, !10, i64 296, !13, i64 304, !6, i64 416, !10, i64 424, !14, i64 432, !14, i64 436, !14, i64 440, !14, i64 444, !14, 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, !6, i64 520, !6, i64 528, !6, i64 536, !6, i64 544, !6, i64 552, !6, i64 560, !15, i64 568, !10, i64 592, !10, i64 600, !6, i64 608, !16, i64 616, !16, 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, !16, i64 638, !7, i64 640, !17, i64 644, !18, i64 648, !18, i64 658, !6, i64 672, !10, i64 680, !10, i64 688, !14, i64 696, !17, i64 700, !17, i64 704, !6, i64 712, !6, i64 720, !6, i64 728, !6, i64 736, !6, i64 744, !6, i64 752, !19, i64 760, !19, i64 765, !6, i64 776, !18, 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, !10, i64 872, !10, i64 880, !10, i64 888, !10, i64 896, !10, i64 904, !10, i64 912, !14, i64 920, !14, i64 924, !10, i64 928, !10, 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, !10, i64 1040, !6, i64 1048, !6, i64 1056, !14, i64 1064, !6, i64 1072, !7, i64 1080, !16, i64 1082, !16, i64 1084, !16, i64 1086, !10, i64 1088, !10, i64 1096, !7, i64 1104, !7, i64 1105, !10, i64 1112, !10, 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, !10, i64 1192, !10, i64 1200, !20, i64 1208, !10, i64 1240, !10, i64 1248, !6, i64 1256}
!13 = !{!"z_stream_s", !6, i64 0, !14, i64 8, !10, i64 16, !6, i64 24, !14, i64 32, !10, i64 40, !6, i64 48, !6, i64 56, !6, i64 64, !6, i64 72, !6, i64 80, !14, i64 88, !10, i64 96, !10, i64 104}
!14 = !{!"int", !7, i64 0}
!15 = !{!"png_row_info_struct", !10, i64 0, !10, i64 8, !7, i64 16, !7, i64 17, !7, i64 18, !7, i64 19}
!16 = !{!"short", !7, i64 0}
!17 = !{!"float", !7, i64 0}
!18 = !{!"png_color_16_struct", !7, i64 0, !16, i64 2, !16, i64 4, !16, i64 6, !16, i64 8}
!19 = !{!"png_color_8_struct", !7, i64 0, !7, i64 1, !7, i64 2, !7, i64 3, !7, i64 4}
!20 = !{!"png_unknown_chunk_t", !7, i64 0, !6, i64 8, !10, i64 16, !7, i64 24}
!21 = !{!22, !10, i64 16}
!22 = !{!"png_info_struct", !10, i64 0, !10, i64 8, !10, i64 16, !10, i64 24, !6, i64 32, !16, i64 40, !16, i64 42, !7, i64 44, !7, i64 45, !7, i64 46, !7, i64 47, !7, i64 48, !7, i64 49, !7, i64 50, !7, i64 51, !7, i64 52, !17, i64 60, !7, i64 64, !14, i64 68, !14, i64 72, !6, i64 80, !23, i64 88, !19, i64 96, !6, i64 104, !18, i64 112, !18, i64 122, !10, i64 136, !10, i64 144, !7, i64 152, !10, i64 160, !10, i64 168, !7, i64 176, !6, i64 184, !17, i64 192, !17, i64 196, !17, i64 200, !17, i64 204, !17, i64 208, !17, i64 212, !17, i64 216, !17, i64 220, !6, i64 224, !10, i64 232, !10, i64 240, !6, i64 248, !6, i64 256, !7, i64 264, !7, i64 265, !10, i64 272, !6, i64 280, !10, i64 288, !6, i64 296, !6, i64 304, !10, i64 312, !7, i64 320, !6, i64 328, !10, i64 336, !7, i64 344, !24, i64 352, !24, i64 360, !6, i64 368, !6, i64 376, !6, i64 384, !10, i64 392, !10, i64 400, !10, i64 408, !10, i64 416, !10, i64 424, !10, i64 432, !10, i64 440, !10, i64 448, !10, i64 456}
!23 = !{!"png_time_struct", !16, i64 0, !7, i64 2, !7, i64 3, !7, i64 4, !7, i64 5, !7, i64 6}
!24 = !{!"double", !7, i64 0}
!25 = !{!12, !6, i64 1256}
!26 = !{!7, !7, i64 0}
!27 = distinct !{!27, !28}
!28 = !{!"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"

@.str.49 = external hidden unnamed_addr constant [25 x i8], align 1
@.str.50 = external hidden unnamed_addr constant [24 x i8], align 1
@.str.51 = external hidden unnamed_addr constant [24 x i8], align 1
@.str.52 = external hidden unnamed_addr constant [21 x i8], align 1
@.str.53 = external hidden unnamed_addr constant [21 x i8], align 1
@.str.54 = external hidden unnamed_addr constant [48 x i8], align 1
@.str.55 = external hidden unnamed_addr constant [43 x i8], align 1
@.str.56 = 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: nounwind uwtable
declare dso_local void @png_crc_read(ptr noundef, ptr noundef, i64 noundef) local_unnamed_addr #2

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

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

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

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

; Function Attrs: nounwind uwtable
define dso_local void @png_handle_iCCP(ptr noundef %0, ptr noundef %1, i64 noundef %2) local_unnamed_addr #2 {
  %4 = alloca i64, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #3
  %5 = getelementptr inbounds i8, ptr %0, i64 280
  %6 = load i64, ptr %5, align 8, !tbaa !5
  %7 = and i64 %6, 1
  %.not = icmp eq i64 %7, 0
  br i1 %.not, label %8, label %9

8:                                                ; preds = %3
  tail call void @png_error(ptr noundef nonnull %0, ptr noundef nonnull @.str.49) #3
  br label %16

9:                                                ; preds = %3
  %10 = and i64 %6, 4
  %.not89 = icmp eq i64 %10, 0
  br i1 %.not89, label %13, label %11

11:                                               ; preds = %9
  tail call void @png_warning(ptr noundef nonnull %0, ptr noundef nonnull @.str.50) #3
  %12 = tail call i32 @png_crc_finish(ptr noundef nonnull %0, i64 noundef %2)
  br label %80

13:                                               ; preds = %9
  %14 = and i64 %6, 2
  %.not90 = icmp eq i64 %14, 0
  br i1 %.not90, label %16, label %15

15:                                               ; preds = %13
  tail call void @png_warning(ptr noundef nonnull %0, ptr noundef nonnull @.str.51) #3
  br label %16

16:                                               ; preds = %15, %13, %8
  %.not91 = icmp eq ptr %1, null
  br i1 %.not91, label %23, label %17

17:                                               ; preds = %16
  %18 = getelementptr inbounds i8, ptr %1, i64 16
  %19 = load i64, ptr %18, align 8, !tbaa !19
  %20 = and i64 %19, 4096
  %.not92 = icmp eq i64 %20, 0
  br i1 %.not92, label %23, label %21

21:                                               ; preds = %17
  tail call void @png_warning(ptr noundef nonnull %0, ptr noundef nonnull @.str.52) #3
  %22 = tail call i32 @png_crc_finish(ptr noundef nonnull %0, i64 noundef %2)
  br label %80

23:                                               ; preds = %17, %16
  %24 = getelementptr inbounds i8, ptr %0, i64 1256
  %25 = load ptr, ptr %24, align 8, !tbaa !23
  tail call void @png_free(ptr noundef nonnull %0, ptr noundef %25) #3
  %26 = add i64 %2, 1
  %27 = tail call ptr @png_malloc(ptr noundef nonnull %0, i64 noundef %26) #3
  store ptr %27, ptr %24, align 8, !tbaa !23
  tail call void @png_crc_read(ptr noundef nonnull %0, ptr noundef %27, i64 noundef %2)
  %28 = tail call i32 @png_crc_finish(ptr noundef nonnull %0, i64 noundef 0)
  %.not93 = icmp eq i32 %28, 0
  %29 = load ptr, ptr %24, align 8, !tbaa !23
  br i1 %.not93, label %31, label %30

30:                                               ; preds = %23
  tail call void @png_free(ptr noundef nonnull %0, ptr noundef %29) #3
  store ptr null, ptr %24, align 8, !tbaa !23
  br label %80

31:                                               ; preds = %23
  %32 = getelementptr inbounds i8, ptr %29, i64 %2
  store i8 0, ptr %32, align 1, !tbaa !24
  %33 = load ptr, ptr %24, align 8, !tbaa !23
  br label %34

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

37:                                               ; preds = %34
  %38 = getelementptr inbounds i8, ptr %33, i64 %2
  %39 = getelementptr inbounds i8, ptr %38, i64 -1
  %.not95 = icmp ult ptr %36, %39
  br i1 %.not95, label %41, label %40

40:                                               ; preds = %37
  tail call void @png_free(ptr noundef %0, ptr noundef %33) #3
  store ptr null, ptr %24, align 8, !tbaa !23
  tail call void @png_warning(ptr noundef %0, ptr noundef nonnull @.str.53) #3
  br label %80

41:                                               ; preds = %37
  %42 = getelementptr inbounds i8, ptr %.081, i64 2
  %43 = load i8, ptr %36, align 1, !tbaa !24
  %.not96 = icmp eq i8 %43, 0
  br i1 %.not96, label %45, label %44

44:                                               ; preds = %41
  tail call void @png_warning(ptr noundef %0, ptr noundef nonnull @.str.54) #3
  %.pre = load ptr, ptr %24, align 8, !tbaa !23
  br label %45

45:                                               ; preds = %44, %41
  %46 = phi ptr [ %.pre, %44 ], [ %33, %41 ]
  %47 = ptrtoint ptr %42 to i64
  %48 = ptrtoint ptr %46 to i64
  %49 = sub i64 %47, %48
  call void @png_decompress_chunk(ptr noundef %0, i32 noundef 0, i64 noundef %2, i64 noundef %49, ptr noundef nonnull %4)
  %50 = load i64, ptr %4, align 8, !tbaa !27
  %51 = sub i64 %50, %49
  %52 = icmp ugt i64 %49, %50
  %53 = icmp ult i64 %51, 4
  %or.cond = or i1 %52, %53
  %54 = load ptr, ptr %24, align 8, !tbaa !23
  br i1 %or.cond, label %55, label %56

55:                                               ; preds = %45
  call void @png_free(ptr noundef nonnull %0, ptr noundef %54) #3
  store ptr null, ptr %24, align 8, !tbaa !23
  call void @png_warning(ptr noundef nonnull %0, ptr noundef nonnull @.str.55) #3
  br label %80

56:                                               ; preds = %45
  %57 = getelementptr inbounds i8, ptr %54, i64 %49
  %58 = load i8, ptr %57, align 1, !tbaa !24
  %59 = zext i8 %58 to i32
  %60 = shl nuw i32 %59, 24
  %61 = getelementptr inbounds i8, ptr %57, i64 1
  %62 = load i8, ptr %61, align 1, !tbaa !24
  %63 = zext i8 %62 to i32
  %64 = shl nuw nsw i32 %63, 16
  %65 = or disjoint i32 %64, %60
  %66 = getelementptr inbounds i8, ptr %57, i64 2
  %67 = load i8, ptr %66, align 1, !tbaa !24
  %68 = zext i8 %67 to i32
  %69 = shl nuw nsw i32 %68, 8
  %70 = or disjoint i32 %65, %69
  %71 = getelementptr inbounds i8, ptr %57, i64 3
  %72 = load i8, ptr %71, align 1, !tbaa !24
  %73 = zext i8 %72 to i32
  %74 = or disjoint i32 %70, %73
  %75 = sext i32 %74 to i64
  %76 = icmp ult i64 %51, %75
  br i1 %76, label %77, label %78

77:                                               ; preds = %56
  call void @png_free(ptr noundef nonnull %0, ptr noundef nonnull %54) #3
  store ptr null, ptr %24, align 8, !tbaa !23
  call void @png_warning(ptr noundef nonnull %0, ptr noundef nonnull @.str.56) #3
  br label %80

78:                                               ; preds = %56
  call void @png_set_iCCP(ptr noundef nonnull %0, ptr noundef %1, ptr noundef nonnull %54, i32 noundef 0, ptr noundef nonnull %57, i64 noundef %75) #3
  %79 = load ptr, ptr %24, align 8, !tbaa !23
  call void @png_free(ptr noundef nonnull %0, ptr noundef %79) #3
  store ptr null, ptr %24, align 8, !tbaa !23
  br label %80

80:                                               ; preds = %78, %77, %55, %40, %30, %21, %11
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #3
  ret void
}

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

declare void @png_set_iCCP(ptr noundef, ptr noundef, ptr noundef, i32 noundef, ptr noundef, i64 noundef) local_unnamed_addr #1

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 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !10, i64 280}
!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 = !{!20, !10, i64 16}
!20 = !{!"png_info_struct", !10, i64 0, !10, i64 8, !10, i64 16, !10, i64 24, !9, i64 32, !14, i64 40, !14, i64 42, !7, i64 44, !7, i64 45, !7, i64 46, !7, i64 47, !7, i64 48, !7, i64 49, !7, i64 50, !7, i64 51, !7, i64 52, !15, i64 60, !7, i64 64, !12, i64 68, !12, i64 72, !9, i64 80, !21, i64 88, !17, i64 96, !9, i64 104, !16, i64 112, !16, i64 122, !10, i64 136, !10, i64 144, !7, i64 152, !10, i64 160, !10, i64 168, !7, i64 176, !9, i64 184, !15, i64 192, !15, i64 196, !15, i64 200, !15, i64 204, !15, i64 208, !15, i64 212, !15, i64 216, !15, i64 220, !9, i64 224, !10, i64 232, !10, i64 240, !9, i64 248, !9, i64 256, !7, i64 264, !7, i64 265, !10, i64 272, !9, i64 280, !10, i64 288, !9, i64 296, !9, i64 304, !10, i64 312, !7, i64 320, !9, i64 328, !10, i64 336, !7, i64 344, !22, i64 352, !22, i64 360, !9, i64 368, !9, i64 376, !9, i64 384, !10, i64 392, !10, i64 400, !10, i64 408, !10, i64 416, !10, i64 424, !10, i64 432, !10, i64 440, !10, i64 448, !10, i64 456}
!21 = !{!"png_time_struct", !14, i64 0, !7, i64 2, !7, i64 3, !7, i64 4, !7, i64 5, !7, i64 6}
!22 = !{!"double", !7, i64 0}
!23 = !{!6, !9, i64 1256}
!24 = !{!7, !7, i64 0}
!25 = distinct !{!25, !26}
!26 = !{!"llvm.loop.mustprogress"}
!27 = !{!10, !10, i64 0}


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