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

@__const.png_push_read_IDAT.png_IDAT = external hidden unnamed_addr constant [5 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [27 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [33 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local void @png_push_read_IDAT(ptr noundef %0) #0 {
  %2 = alloca ptr, align 8
  %3 = alloca [5 x i8], align 1
  %4 = alloca [4 x i8], align 1
  %5 = alloca i32, align 4
  %6 = alloca i64, align 8
  %7 = alloca i64, align 8
  store ptr %0, ptr %2, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 5, ptr %3) #5
  call void @llvm.memcpy.p0.p0.i64(ptr align 1 %3, ptr align 1 @__const.png_push_read_IDAT.png_IDAT, i64 5, i1 false)
  %8 = load ptr, ptr %2, align 8, !tbaa !5
  %9 = getelementptr inbounds %struct.png_struct_def, ptr %8, i32 0, i32 13
  %10 = load i32, ptr %9, align 4, !tbaa !9
  %11 = and i32 %10, 256
  %12 = icmp ne i32 %11, 0
  br i1 %12, label %63, label %13

13:                                               ; preds = %1
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #5
  %14 = load ptr, ptr %2, 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 !20
  %17 = icmp ult i64 %16, 8
  br i1 %17, label %18, label %20

18:                                               ; preds = %13
  %19 = load ptr, ptr %2, align 8, !tbaa !5
  call void @png_push_save_buffer(ptr noundef %19)
  store i32 1, ptr %5, align 4
  br label %60

20:                                               ; preds = %13
  %21 = load ptr, ptr %2, align 8, !tbaa !5
  %22 = getelementptr inbounds [4 x i8], ptr %4, i64 0, i64 0
  call void @png_push_fill_buffer(ptr noundef %21, ptr noundef %22, i64 noundef 4)
  %23 = load ptr, ptr %2, align 8, !tbaa !5
  %24 = getelementptr inbounds [4 x i8], ptr %4, i64 0, i64 0
  %25 = call i32 @png_get_uint_31(ptr noundef %23, ptr noundef %24)
  %26 = load ptr, ptr %2, align 8, !tbaa !5
  %27 = getelementptr inbounds %struct.png_struct_def, ptr %26, i32 0, i32 87
  store i32 %25, ptr %27, align 8, !tbaa !21
  %28 = load ptr, ptr %2, align 8, !tbaa !5
  call void @png_reset_crc(ptr noundef %28)
  %29 = load ptr, ptr %2, align 8, !tbaa !5
  %30 = load ptr, ptr %2, align 8, !tbaa !5
  %31 = getelementptr inbounds %struct.png_struct_def, ptr %30, i32 0, i32 44
  %32 = getelementptr inbounds [5 x i8], ptr %31, i64 0, i64 0
  call void @png_crc_read(ptr noundef %29, ptr noundef %32, i64 noundef 4)
  %33 = load ptr, ptr %2, align 8, !tbaa !5
  %34 = getelementptr inbounds %struct.png_struct_def, ptr %33, i32 0, i32 13
  %35 = load i32, ptr %34, align 4, !tbaa !9
  %36 = or i32 %35, 256
  store i32 %36, ptr %34, align 4, !tbaa !9
  %37 = load ptr, ptr %2, align 8, !tbaa !5
  %38 = getelementptr inbounds %struct.png_struct_def, ptr %37, i32 0, i32 44
  %39 = getelementptr inbounds [5 x i8], ptr %38, i64 0, i64 0
  %40 = getelementptr inbounds [5 x i8], ptr %3, i64 0, i64 0
  %41 = call i32 @memcmp(ptr noundef %39, ptr noundef %40, i64 noundef 4) #6
  %42 = icmp ne i32 %41, 0
  br i1 %42, label %43, label %54

43:                                               ; preds = %20
  %44 = load ptr, ptr %2, align 8, !tbaa !5
  %45 = getelementptr inbounds %struct.png_struct_def, ptr %44, i32 0, i32 93
  store i32 1, ptr %45, align 8, !tbaa !22
  %46 = load ptr, ptr %2, align 8, !tbaa !5
  %47 = getelementptr inbounds %struct.png_struct_def, ptr %46, i32 0, i32 14
  %48 = load i32, ptr %47, align 8, !tbaa !23
  %49 = and i32 %48, 32
  %50 = icmp ne i32 %49, 0
  br i1 %50, label %53, label %51

51:                                               ; preds = %43
  %52 = load ptr, ptr %2, align 8, !tbaa !5
  call void @png_error(ptr noundef %52, ptr noundef @.str.8)
  br label %53

53:                                               ; preds = %51, %43
  store i32 1, ptr %5, align 4
  br label %60

54:                                               ; preds = %20
  %55 = load ptr, ptr %2, align 8, !tbaa !5
  %56 = getelementptr inbounds %struct.png_struct_def, ptr %55, i32 0, i32 87
  %57 = load i32, ptr %56, align 8, !tbaa !21
  %58 = load ptr, ptr %2, align 8, !tbaa !5
  %59 = getelementptr inbounds %struct.png_struct_def, ptr %58, i32 0, i32 39
  store i32 %57, ptr %59, align 8, !tbaa !24
  store i32 0, ptr %5, align 4
  br label %60

60:                                               ; preds = %54, %53, %18
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #5
  %61 = load i32, ptr %5, align 4
  switch i32 %61, label %227 [
    i32 0, label %62
  ]

62:                                               ; preds = %60
  br label %63

63:                                               ; preds = %62, %1
  %64 = load ptr, ptr %2, align 8, !tbaa !5
  %65 = getelementptr inbounds %struct.png_struct_def, ptr %64, i32 0, i32 39
  %66 = load i32, ptr %65, align 8, !tbaa !24
  %67 = icmp ne i32 %66, 0
  br i1 %67, label %68, label %133

68:                                               ; preds = %63
  %69 = load ptr, ptr %2, align 8, !tbaa !5
  %70 = getelementptr inbounds %struct.png_struct_def, ptr %69, i32 0, i32 89
  %71 = load i64, ptr %70, align 8, !tbaa !25
  %72 = icmp ne i64 %71, 0
  br i1 %72, label %73, label %133

73:                                               ; preds = %68
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #5
  %74 = load ptr, ptr %2, align 8, !tbaa !5
  %75 = getelementptr inbounds %struct.png_struct_def, ptr %74, i32 0, i32 39
  %76 = load i32, ptr %75, align 8, !tbaa !24
  %77 = load ptr, ptr %2, align 8, !tbaa !5
  %78 = getelementptr inbounds %struct.png_struct_def, ptr %77, i32 0, i32 89
  %79 = load i64, ptr %78, align 8, !tbaa !25
  %80 = trunc i64 %79 to i32
  %81 = icmp ult i32 %76, %80
  br i1 %81, label %82, label %96

82:                                               ; preds = %73
  %83 = load ptr, ptr %2, align 8, !tbaa !5
  %84 = getelementptr inbounds %struct.png_struct_def, ptr %83, i32 0, i32 39
  %85 = load i32, ptr %84, align 8, !tbaa !24
  %86 = zext i32 %85 to i64
  store i64 %86, ptr %6, align 8, !tbaa !26
  %87 = load i64, ptr %6, align 8, !tbaa !26
  %88 = trunc i64 %87 to i32
  %89 = load ptr, ptr %2, align 8, !tbaa !5
  %90 = getelementptr inbounds %struct.png_struct_def, ptr %89, i32 0, i32 39
  %91 = load i32, ptr %90, align 8, !tbaa !24
  %92 = icmp ne i32 %88, %91
  br i1 %92, label %93, label %95

93:                                               ; preds = %82
  %94 = load ptr, ptr %2, align 8, !tbaa !5
  call void @png_error(ptr noundef %94, ptr noundef @.str.9)
  br label %95

95:                                               ; preds = %93, %82
  br label %100

96:                                               ; preds = %73
  %97 = load ptr, ptr %2, align 8, !tbaa !5
  %98 = getelementptr inbounds %struct.png_struct_def, ptr %97, i32 0, i32 89
  %99 = load i64, ptr %98, align 8, !tbaa !25
  store i64 %99, ptr %6, align 8, !tbaa !26
  br label %100

100:                                              ; preds = %96, %95
  %101 = load ptr, ptr %2, align 8, !tbaa !5
  %102 = load ptr, ptr %2, align 8, !tbaa !5
  %103 = getelementptr inbounds %struct.png_struct_def, ptr %102, i32 0, i32 83
  %104 = load ptr, ptr %103, align 8, !tbaa !27
  %105 = load i64, ptr %6, align 8, !tbaa !26
  call void @png_calculate_crc(ptr noundef %101, ptr noundef %104, i64 noundef %105)
  %106 = load ptr, ptr %2, align 8, !tbaa !5
  %107 = load ptr, ptr %2, align 8, !tbaa !5
  %108 = getelementptr inbounds %struct.png_struct_def, ptr %107, i32 0, i32 83
  %109 = load ptr, ptr %108, align 8, !tbaa !27
  %110 = load i64, ptr %6, align 8, !tbaa !26
  call void @png_process_IDAT_data(ptr noundef %106, ptr noundef %109, i64 noundef %110)
  %111 = load i64, ptr %6, align 8, !tbaa !26
  %112 = load ptr, ptr %2, align 8, !tbaa !5
  %113 = getelementptr inbounds %struct.png_struct_def, ptr %112, i32 0, i32 39
  %114 = load i32, ptr %113, align 8, !tbaa !24
  %115 = zext i32 %114 to i64
  %116 = sub i64 %115, %111
  %117 = trunc i64 %116 to i32
  store i32 %117, ptr %113, align 8, !tbaa !24
  %118 = load i64, ptr %6, align 8, !tbaa !26
  %119 = load ptr, ptr %2, align 8, !tbaa !5
  %120 = getelementptr inbounds %struct.png_struct_def, ptr %119, i32 0, i32 91
  %121 = load i64, ptr %120, align 8, !tbaa !20
  %122 = sub i64 %121, %118
  store i64 %122, ptr %120, align 8, !tbaa !20
  %123 = load i64, ptr %6, align 8, !tbaa !26
  %124 = load ptr, ptr %2, align 8, !tbaa !5
  %125 = getelementptr inbounds %struct.png_struct_def, ptr %124, i32 0, i32 89
  %126 = load i64, ptr %125, align 8, !tbaa !25
  %127 = sub i64 %126, %123
  store i64 %127, ptr %125, align 8, !tbaa !25
  %128 = load i64, ptr %6, align 8, !tbaa !26
  %129 = load ptr, ptr %2, align 8, !tbaa !5
  %130 = getelementptr inbounds %struct.png_struct_def, ptr %129, i32 0, i32 83
  %131 = load ptr, ptr %130, align 8, !tbaa !27
  %132 = getelementptr inbounds i8, ptr %131, i64 %128
  store ptr %132, ptr %130, align 8, !tbaa !27
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #5
  br label %133

133:                                              ; preds = %100, %68, %63
  %134 = load ptr, ptr %2, align 8, !tbaa !5
  %135 = getelementptr inbounds %struct.png_struct_def, ptr %134, i32 0, i32 39
  %136 = load i32, ptr %135, align 8, !tbaa !24
  %137 = icmp ne i32 %136, 0
  br i1 %137, label %138, label %203

138:                                              ; preds = %133
  %139 = load ptr, ptr %2, align 8, !tbaa !5
  %140 = getelementptr inbounds %struct.png_struct_def, ptr %139, i32 0, i32 92
  %141 = load i64, ptr %140, align 8, !tbaa !28
  %142 = icmp ne i64 %141, 0
  br i1 %142, label %143, label %203

143:                                              ; preds = %138
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #5
  %144 = load ptr, ptr %2, align 8, !tbaa !5
  %145 = getelementptr inbounds %struct.png_struct_def, ptr %144, i32 0, i32 39
  %146 = load i32, ptr %145, align 8, !tbaa !24
  %147 = load ptr, ptr %2, align 8, !tbaa !5
  %148 = getelementptr inbounds %struct.png_struct_def, ptr %147, i32 0, i32 92
  %149 = load i64, ptr %148, align 8, !tbaa !28
  %150 = trunc i64 %149 to i32
  %151 = icmp ult i32 %146, %150
  br i1 %151, label %152, label %166

152:                                              ; preds = %143
  %153 = load ptr, ptr %2, align 8, !tbaa !5
  %154 = getelementptr inbounds %struct.png_struct_def, ptr %153, i32 0, i32 39
  %155 = load i32, ptr %154, align 8, !tbaa !24
  %156 = zext i32 %155 to i64
  store i64 %156, ptr %7, align 8, !tbaa !26
  %157 = load i64, ptr %7, align 8, !tbaa !26
  %158 = trunc i64 %157 to i32
  %159 = load ptr, ptr %2, align 8, !tbaa !5
  %160 = getelementptr inbounds %struct.png_struct_def, ptr %159, i32 0, i32 39
  %161 = load i32, ptr %160, align 8, !tbaa !24
  %162 = icmp ne i32 %158, %161
  br i1 %162, label %163, label %165

163:                                              ; preds = %152
  %164 = load ptr, ptr %2, align 8, !tbaa !5
  call void @png_error(ptr noundef %164, ptr noundef @.str.9)
  br label %165

165:                                              ; preds = %163, %152
  br label %170

166:                                              ; preds = %143
  %167 = load ptr, ptr %2, align 8, !tbaa !5
  %168 = getelementptr inbounds %struct.png_struct_def, ptr %167, i32 0, i32 92
  %169 = load i64, ptr %168, align 8, !tbaa !28
  store i64 %169, ptr %7, align 8, !tbaa !26
  br label %170

170:                                              ; preds = %166, %165
  %171 = load ptr, ptr %2, align 8, !tbaa !5
  %172 = load ptr, ptr %2, align 8, !tbaa !5
  %173 = getelementptr inbounds %struct.png_struct_def, ptr %172, i32 0, i32 85
  %174 = load ptr, ptr %173, align 8, !tbaa !29
  %175 = load i64, ptr %7, align 8, !tbaa !26
  call void @png_calculate_crc(ptr noundef %171, ptr noundef %174, i64 noundef %175)
  %176 = load ptr, ptr %2, align 8, !tbaa !5
  %177 = load ptr, ptr %2, align 8, !tbaa !5
  %178 = getelementptr inbounds %struct.png_struct_def, ptr %177, i32 0, i32 85
  %179 = load ptr, ptr %178, align 8, !tbaa !29
  %180 = load i64, ptr %7, align 8, !tbaa !26
  call void @png_process_IDAT_data(ptr noundef %176, ptr noundef %179, i64 noundef %180)
  %181 = load i64, ptr %7, align 8, !tbaa !26
  %182 = load ptr, ptr %2, align 8, !tbaa !5
  %183 = getelementptr inbounds %struct.png_struct_def, ptr %182, i32 0, i32 39
  %184 = load i32, ptr %183, align 8, !tbaa !24
  %185 = zext i32 %184 to i64
  %186 = sub i64 %185, %181
  %187 = trunc i64 %186 to i32
  store i32 %187, ptr %183, align 8, !tbaa !24
  %188 = load i64, ptr %7, align 8, !tbaa !26
  %189 = load ptr, ptr %2, align 8, !tbaa !5
  %190 = getelementptr inbounds %struct.png_struct_def, ptr %189, i32 0, i32 91
  %191 = load i64, ptr %190, align 8, !tbaa !20
  %192 = sub i64 %191, %188
  store i64 %192, ptr %190, align 8, !tbaa !20
  %193 = load i64, ptr %7, align 8, !tbaa !26
  %194 = load ptr, ptr %2, align 8, !tbaa !5
  %195 = getelementptr inbounds %struct.png_struct_def, ptr %194, i32 0, i32 92
  %196 = load i64, ptr %195, align 8, !tbaa !28
  %197 = sub i64 %196, %193
  store i64 %197, ptr %195, align 8, !tbaa !28
  %198 = load i64, ptr %7, align 8, !tbaa !26
  %199 = load ptr, ptr %2, align 8, !tbaa !5
  %200 = getelementptr inbounds %struct.png_struct_def, ptr %199, i32 0, i32 85
  %201 = load ptr, ptr %200, align 8, !tbaa !29
  %202 = getelementptr inbounds i8, ptr %201, i64 %198
  store ptr %202, ptr %200, align 8, !tbaa !29
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #5
  br label %203

203:                                              ; preds = %170, %138, %133
  %204 = load ptr, ptr %2, align 8, !tbaa !5
  %205 = getelementptr inbounds %struct.png_struct_def, ptr %204, i32 0, i32 39
  %206 = load i32, ptr %205, align 8, !tbaa !24
  %207 = icmp ne i32 %206, 0
  br i1 %207, label %226, label %208

208:                                              ; preds = %203
  %209 = load ptr, ptr %2, align 8, !tbaa !5
  %210 = getelementptr inbounds %struct.png_struct_def, ptr %209, i32 0, i32 91
  %211 = load i64, ptr %210, align 8, !tbaa !20
  %212 = icmp ult i64 %211, 4
  br i1 %212, label %213, label %215

213:                                              ; preds = %208
  %214 = load ptr, ptr %2, align 8, !tbaa !5
  call void @png_push_save_buffer(ptr noundef %214)
  store i32 1, ptr %5, align 4
  br label %227

215:                                              ; preds = %208
  %216 = load ptr, ptr %2, align 8, !tbaa !5
  %217 = call i32 @png_crc_finish(ptr noundef %216, i32 noundef 0)
  %218 = load ptr, ptr %2, align 8, !tbaa !5
  %219 = getelementptr inbounds %struct.png_struct_def, ptr %218, i32 0, i32 13
  %220 = load i32, ptr %219, align 4, !tbaa !9
  %221 = and i32 %220, -257
  store i32 %221, ptr %219, align 4, !tbaa !9
  %222 = load ptr, ptr %2, align 8, !tbaa !5
  %223 = getelementptr inbounds %struct.png_struct_def, ptr %222, i32 0, i32 13
  %224 = load i32, ptr %223, align 4, !tbaa !9
  %225 = or i32 %224, 8
  store i32 %225, ptr %223, align 4, !tbaa !9
  br label %226

226:                                              ; preds = %215, %203
  store i32 0, ptr %5, align 4
  br label %227

227:                                              ; preds = %226, %213, %60
  call void @llvm.lifetime.end.p0(i64 5, ptr %3) #5
  %228 = load i32, ptr %5, align 4
  switch i32 %228, label %230 [
    i32 0, label %229
    i32 1, label %229
  ]

229:                                              ; preds = %227, %227
  ret void

230:                                              ; preds = %227
  unreachable
}

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

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

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

; 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) #3

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

declare i32 @png_get_uint_31(ptr noundef, ptr noundef) #2

declare void @png_reset_crc(ptr noundef) #2

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

; Function Attrs: nounwind willreturn memory(read)
declare i32 @memcmp(ptr noundef, ptr noundef, i64 noundef) #4

declare void @png_calculate_crc(ptr noundef, ptr noundef, i64 noundef) #2

declare i32 @png_crc_finish(ptr noundef, i32 noundef) #2

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

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 = { "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: readwrite) }
attributes #4 = { nounwind willreturn memory(read) "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 }
attributes #6 = { nounwind willreturn memory(read) }

!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, !11, i64 284}
!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 848}
!21 = !{!10, !11, i64 824}
!22 = !{!10, !11, i64 864}
!23 = !{!10, !11, i64 288}
!24 = !{!10, !11, i64 560}
!25 = !{!10, !13, i64 832}
!26 = !{!13, !13, i64 0}
!27 = !{!10, !6, i64 792}
!28 = !{!10, !13, i64 856}
!29 = !{!10, !6, i64 808}


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

@__const.png_push_read_IDAT.png_IDAT = external hidden unnamed_addr constant [5 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [27 x i8], align 1

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

._crit_edge:                                      ; preds = %1
  %.phi.trans.insert = getelementptr inbounds i8, ptr %0, i64 560
  %.pre = load i32, ptr %.phi.trans.insert, align 8, !tbaa !19
  br label %26

6:                                                ; preds = %1
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #4
  %7 = getelementptr inbounds i8, ptr %0, i64 848
  %8 = load i64, ptr %7, align 8, !tbaa !20
  %9 = icmp ult i64 %8, 8
  br i1 %9, label %10, label %11

10:                                               ; preds = %6
  tail call void @png_push_save_buffer(ptr noundef nonnull %0)
  br label %.critedge

11:                                               ; preds = %6
  call void @png_push_fill_buffer(ptr noundef nonnull %0, ptr noundef nonnull %2, i64 noundef 4)
  %12 = call i32 @png_get_uint_31(ptr noundef nonnull %0, ptr noundef nonnull %2) #4
  %13 = getelementptr inbounds i8, ptr %0, i64 824
  store i32 %12, ptr %13, align 8, !tbaa !21
  call void @png_reset_crc(ptr noundef nonnull %0) #4
  %14 = getelementptr inbounds i8, ptr %0, i64 580
  call void @png_crc_read(ptr noundef nonnull %0, ptr noundef nonnull %14, i64 noundef 4) #4
  %15 = load i32, ptr %3, align 4, !tbaa !5
  %16 = or i32 %15, 256
  store i32 %16, ptr %3, align 4, !tbaa !5
  %bcmp = call i32 @bcmp(ptr noundef nonnull dereferenceable(4) %14, ptr noundef nonnull dereferenceable(4) @__const.png_push_read_IDAT.png_IDAT, i64 4)
  %.not74 = icmp eq i32 %bcmp, 0
  br i1 %.not74, label %23, label %17

17:                                               ; preds = %11
  %18 = getelementptr inbounds i8, ptr %0, i64 864
  store i32 1, ptr %18, align 8, !tbaa !22
  %19 = getelementptr inbounds i8, ptr %0, i64 288
  %20 = load i32, ptr %19, align 8, !tbaa !23
  %21 = and i32 %20, 32
  %.not75 = icmp eq i32 %21, 0
  br i1 %.not75, label %22, label %.critedge

22:                                               ; preds = %17
  call void @png_error(ptr noundef nonnull %0, ptr noundef nonnull @.str.8) #4
  br label %.critedge

23:                                               ; preds = %11
  %24 = load i32, ptr %13, align 8, !tbaa !21
  %25 = getelementptr inbounds i8, ptr %0, i64 560
  store i32 %24, ptr %25, align 8, !tbaa !19
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #4
  br label %26

26:                                               ; preds = %._crit_edge, %23
  %27 = phi i32 [ %.pre, %._crit_edge ], [ %24, %23 ]
  %28 = getelementptr inbounds i8, ptr %0, i64 560
  %.not76 = icmp eq i32 %27, 0
  br i1 %.not76, label %.thread84, label %29

29:                                               ; preds = %26
  %30 = getelementptr inbounds i8, ptr %0, i64 832
  %31 = load i64, ptr %30, align 8, !tbaa !24
  %.not77 = icmp eq i64 %31, 0
  br i1 %.not77, label %.thread, label %32

32:                                               ; preds = %29
  %33 = trunc i64 %31 to i32
  %34 = icmp ult i32 %27, %33
  %35 = zext i32 %27 to i64
  %.068 = select i1 %34, i64 %35, i64 %31
  %36 = getelementptr inbounds i8, ptr %0, i64 792
  %37 = load ptr, ptr %36, align 8, !tbaa !25
  call void @png_calculate_crc(ptr noundef nonnull %0, ptr noundef %37, i64 noundef %.068) #4
  %38 = load ptr, ptr %36, align 8, !tbaa !25
  call void @png_process_IDAT_data(ptr noundef nonnull %0, ptr noundef %38, i64 noundef %.068)
  %39 = load i32, ptr %28, align 8, !tbaa !19
  %40 = trunc i64 %.068 to i32
  %41 = sub i32 %39, %40
  store i32 %41, ptr %28, align 8, !tbaa !19
  %42 = getelementptr inbounds i8, ptr %0, i64 848
  %43 = load i64, ptr %42, align 8, !tbaa !20
  %44 = sub i64 %43, %.068
  store i64 %44, ptr %42, align 8, !tbaa !20
  %45 = load i64, ptr %30, align 8, !tbaa !24
  %46 = sub i64 %45, %.068
  store i64 %46, ptr %30, align 8, !tbaa !24
  %47 = load ptr, ptr %36, align 8, !tbaa !25
  %48 = getelementptr inbounds i8, ptr %47, i64 %.068
  store ptr %48, ptr %36, align 8, !tbaa !25
  %.not78 = icmp eq i32 %41, 0
  br i1 %.not78, label %.thread84, label %.thread

.thread:                                          ; preds = %29, %32
  %.pr90 = phi i32 [ %41, %32 ], [ %27, %29 ]
  %49 = getelementptr inbounds i8, ptr %0, i64 856
  %50 = load i64, ptr %49, align 8, !tbaa !26
  %.not79 = icmp eq i64 %50, 0
  br i1 %.not79, label %.thread91, label %51

51:                                               ; preds = %.thread
  %52 = trunc i64 %50 to i32
  %53 = icmp ult i32 %.pr90, %52
  %54 = zext i32 %.pr90 to i64
  %.0 = select i1 %53, i64 %54, i64 %50
  %55 = getelementptr inbounds i8, ptr %0, i64 808
  %56 = load ptr, ptr %55, align 8, !tbaa !27
  call void @png_calculate_crc(ptr noundef nonnull %0, ptr noundef %56, i64 noundef %.0) #4
  %57 = load ptr, ptr %55, align 8, !tbaa !27
  call void @png_process_IDAT_data(ptr noundef nonnull %0, ptr noundef %57, i64 noundef %.0)
  %58 = load i32, ptr %28, align 8, !tbaa !19
  %59 = trunc i64 %.0 to i32
  %60 = sub i32 %58, %59
  store i32 %60, ptr %28, align 8, !tbaa !19
  %61 = getelementptr inbounds i8, ptr %0, i64 848
  %62 = load <2 x i64>, ptr %61, align 8, !tbaa !28
  %63 = insertelement <2 x i64> poison, i64 %.0, i64 0
  %64 = shufflevector <2 x i64> %63, <2 x i64> poison, <2 x i32> zeroinitializer
  %65 = sub <2 x i64> %62, %64
  store <2 x i64> %65, ptr %61, align 8, !tbaa !28
  %66 = load ptr, ptr %55, align 8, !tbaa !27
  %67 = getelementptr inbounds i8, ptr %66, i64 %.0
  store ptr %67, ptr %55, align 8, !tbaa !27
  %68 = icmp eq i32 %58, %59
  br i1 %68, label %.thread84, label %.thread91

.thread84:                                        ; preds = %26, %32, %51
  %69 = getelementptr inbounds i8, ptr %0, i64 848
  %70 = load i64, ptr %69, align 8, !tbaa !20
  %71 = icmp ult i64 %70, 4
  br i1 %71, label %72, label %73

72:                                               ; preds = %.thread84
  call void @png_push_save_buffer(ptr noundef nonnull %0)
  br label %.thread91

73:                                               ; preds = %.thread84
  %74 = call i32 @png_crc_finish(ptr noundef nonnull %0, i32 noundef 0) #4
  %75 = load i32, ptr %3, align 4, !tbaa !5
  %76 = and i32 %75, -265
  %77 = or disjoint i32 %76, 8
  store i32 %77, ptr %3, align 4, !tbaa !5
  br label %.thread91

.critedge:                                        ; preds = %17, %22, %10
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #4
  br label %.thread91

.thread91:                                        ; preds = %.thread, %51, %73, %.critedge, %72
  ret void
}

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

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

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

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

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

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

declare void @png_reset_crc(ptr noundef) local_unnamed_addr #2

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

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

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

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

; Function Attrs: nofree nounwind willreturn memory(argmem: read)
declare i32 @bcmp(ptr nocapture, ptr nocapture, i64) local_unnamed_addr #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 nosync 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 = { nofree nounwind willreturn memory(argmem: read) }
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, !10, i64 284}
!6 = !{!"png_struct_def", !7, i64 0, !9, i64 200, !9, i64 208, !9, i64 216, !9, i64 224, !9, i64 232, !9, i64 240, !9, i64 248, !9, i64 256, !9, i64 264, !9, i64 272, !7, i64 280, !7, i64 281, !10, i64 284, !10, i64 288, !10, i64 292, !11, i64 296, !9, i64 408, !12, i64 416, !10, i64 424, !10, i64 428, !10, i64 432, !10, i64 436, !10, i64 440, !10, i64 444, !10, i64 448, !10, i64 452, !10, i64 456, !12, i64 464, !12, i64 472, !10, i64 480, !10, i64 484, !9, i64 488, !9, i64 496, !9, i64 504, !9, i64 512, !9, i64 520, !9, i64 528, !13, i64 536, !10, i64 560, !10, i64 564, !9, i64 568, !14, i64 576, !14, i64 578, !7, i64 580, !7, i64 585, !7, i64 586, !7, i64 587, !7, i64 588, !7, i64 589, !7, i64 590, !7, i64 591, !7, i64 592, !7, i64 593, !7, i64 594, !7, i64 595, !7, i64 596, !14, i64 598, !7, i64 600, !15, i64 604, !16, i64 608, !16, i64 618, !9, i64 632, !10, i64 640, !10, i64 644, !10, i64 648, !15, i64 652, !15, i64 656, !9, i64 664, !9, i64 672, !9, i64 680, !9, i64 688, !9, i64 696, !9, i64 704, !17, i64 712, !17, i64 717, !9, i64 728, !16, i64 736, !9, i64 752, !9, i64 760, !9, i64 768, !9, i64 776, !9, i64 784, !9, i64 792, !9, i64 800, !9, i64 808, !9, i64 816, !10, i64 824, !10, i64 828, !12, i64 832, !12, i64 840, !12, i64 848, !12, i64 856, !10, i64 864, !10, i64 868, !12, i64 872, !12, i64 880, !9, i64 888, !9, i64 896, !9, i64 904, !9, i64 912, !9, i64 920, !7, i64 928, !7, i64 929, !9, i64 936, !9, i64 944, !9, i64 952, !9, i64 960, !9, i64 968, !9, i64 976, !10, i64 984, !9, i64 992, !9, i64 1000, !10, i64 1008, !9, i64 1016, !7, i64 1024, !14, i64 1026, !14, i64 1028, !14, i64 1030, !10, i64 1032, !10, i64 1036, !7, i64 1040, !9, i64 1048, !9, i64 1056, !9, i64 1064, !9, i64 1072, !9, i64 1080, !9, i64 1088, !9, i64 1096, !7, i64 1104, !10, i64 1108, !10, i64 1112, !10, i64 1116, !18, i64 1120, !10, i64 1152, !10, i64 1156, !9, i64 1160, !10, i64 1168}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!"any pointer", !7, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = !{!"z_stream_s", !9, i64 0, !10, i64 8, !12, i64 16, !9, i64 24, !10, i64 32, !12, i64 40, !9, i64 48, !9, i64 56, !9, i64 64, !9, i64 72, !9, i64 80, !10, i64 88, !12, i64 96, !12, i64 104}
!12 = !{!"long", !7, i64 0}
!13 = !{!"png_row_info_struct", !10, i64 0, !12, i64 8, !7, i64 16, !7, i64 17, !7, i64 18, !7, i64 19}
!14 = !{!"short", !7, i64 0}
!15 = !{!"float", !7, i64 0}
!16 = !{!"png_color_16_struct", !7, i64 0, !14, i64 2, !14, i64 4, !14, i64 6, !14, i64 8}
!17 = !{!"png_color_8_struct", !7, i64 0, !7, i64 1, !7, i64 2, !7, i64 3, !7, i64 4}
!18 = !{!"png_unknown_chunk_t", !7, i64 0, !9, i64 8, !12, i64 16, !7, i64 24}
!19 = !{!6, !10, i64 560}
!20 = !{!6, !12, i64 848}
!21 = !{!6, !10, i64 824}
!22 = !{!6, !10, i64 864}
!23 = !{!6, !10, i64 288}
!24 = !{!6, !12, i64 832}
!25 = !{!6, !9, i64 792}
!26 = !{!6, !12, i64 856}
!27 = !{!6, !9, i64 808}
!28 = !{!12, !12, i64 0}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,SLPVectorizerPass,SROAPass,SimplifyCFGPass,TailCallElimPass