; LLVM IR from Try/Tempest :: Engine/thirdparty/libpng (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, i64, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, i8, i8, i32, i32, i32, i32, %struct.z_stream_s, ptr, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i64, i32, i32, i32, ptr, ptr, ptr, ptr, i64, i32, i32, ptr, i16, i32, i16, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i16, i8, i32, %struct.png_color_16_struct, %struct.png_color_16_struct, ptr, i32, i32, i32, i32, 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, ptr, ptr, i32, [29 x i8], i32, ptr, ptr, i32, i32, ptr, i8, i8, i16, i16, i32, i8, ptr, ptr, ptr, ptr, ptr, ptr, ptr, i8, i32, i32, i32, i64, %struct.png_unknown_chunk_t, i64, ptr, i64, i32, i32, ptr, [4 x ptr], %struct.png_colorspace }
%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_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_colorspace = type { i32, %struct.png_xy, %struct.png_XYZ, i16, i16 }
%struct.png_xy = type { i32, i32, i32, i32, i32, i32, i32, i32 }
%struct.png_XYZ = type { i32, i32, i32, i32, i32, i32, i32, i32, i32 }

@.str.10 = external hidden unnamed_addr constant [27 x i8], align 1

; Function Attrs: nounwind uwtable
declare dso_local void @png_push_save_buffer(ptr noalias 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: nounwind uwtable
define dso_local void @png_push_read_IDAT(ptr noalias noundef %0) #0 {
  %2 = alloca ptr, align 8
  %3 = alloca [4 x i8], align 1
  %4 = alloca [4 x i8], align 1
  %5 = alloca i32, align 4
  %6 = alloca i64, align 8
  %7 = alloca i32, align 4
  %8 = alloca i64, align 8
  %9 = alloca i32, align 4
  store ptr %0, ptr %2, align 8, !tbaa !5
  %10 = load ptr, ptr %2, align 8, !tbaa !5
  %11 = getelementptr inbounds %struct.png_struct_def, ptr %10, i32 0, i32 15
  %12 = load i32, ptr %11, align 4, !tbaa !9
  %13 = and i32 %12, 256
  %14 = icmp eq i32 %13, 0
  br i1 %14, label %15, label %86

15:                                               ; preds = %1
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #4
  %16 = load ptr, ptr %2, align 8, !tbaa !5
  %17 = getelementptr inbounds %struct.png_struct_def, ptr %16, i32 0, i32 104
  %18 = load i64, ptr %17, align 8, !tbaa !21
  %19 = icmp ult i64 %18, 8
  br i1 %19, label %20, label %22

20:                                               ; preds = %15
  %21 = load ptr, ptr %2, align 8, !tbaa !5
  call void @png_push_save_buffer(ptr noundef %21)
  store i32 1, ptr %5, align 4
  br label %83

22:                                               ; preds = %15
  %23 = load ptr, ptr %2, align 8, !tbaa !5
  %24 = getelementptr inbounds [4 x i8], ptr %3, i64 0, i64 0
  call void @png_push_fill_buffer(ptr noundef %23, ptr noundef %24, i64 noundef 4)
  %25 = load ptr, ptr %2, align 8, !tbaa !5
  %26 = getelementptr inbounds [4 x i8], ptr %3, i64 0, i64 0
  %27 = call i32 @png_get_uint_31(ptr noundef %25, ptr noundef %26)
  %28 = load ptr, ptr %2, align 8, !tbaa !5
  %29 = getelementptr inbounds %struct.png_struct_def, ptr %28, i32 0, i32 100
  store i32 %27, ptr %29, align 8, !tbaa !22
  %30 = load ptr, ptr %2, align 8, !tbaa !5
  call void @png_reset_crc(ptr noundef %30)
  %31 = load ptr, ptr %2, align 8, !tbaa !5
  %32 = getelementptr inbounds [4 x i8], ptr %4, i64 0, i64 0
  call void @png_crc_read(ptr noundef %31, ptr noundef %32, i32 noundef 4)
  %33 = getelementptr inbounds [4 x i8], ptr %4, i64 0, i64 0
  %34 = load i8, ptr %33, align 1, !tbaa !23
  %35 = zext i8 %34 to i32
  %36 = and i32 255, %35
  %37 = shl i32 %36, 24
  %38 = getelementptr inbounds [4 x i8], ptr %4, i64 0, i64 1
  %39 = load i8, ptr %38, align 1, !tbaa !23
  %40 = zext i8 %39 to i32
  %41 = and i32 255, %40
  %42 = shl i32 %41, 16
  %43 = or i32 %37, %42
  %44 = getelementptr inbounds [4 x i8], ptr %4, i64 0, i64 2
  %45 = load i8, ptr %44, align 1, !tbaa !23
  %46 = zext i8 %45 to i32
  %47 = and i32 255, %46
  %48 = shl i32 %47, 8
  %49 = or i32 %43, %48
  %50 = getelementptr inbounds [4 x i8], ptr %4, i64 0, i64 3
  %51 = load i8, ptr %50, align 1, !tbaa !23
  %52 = zext i8 %51 to i32
  %53 = and i32 255, %52
  %54 = shl i32 %53, 0
  %55 = or i32 %49, %54
  %56 = load ptr, ptr %2, align 8, !tbaa !5
  %57 = getelementptr inbounds %struct.png_struct_def, ptr %56, i32 0, i32 44
  store i32 %55, ptr %57, align 8, !tbaa !24
  %58 = load ptr, ptr %2, align 8, !tbaa !5
  %59 = getelementptr inbounds %struct.png_struct_def, ptr %58, i32 0, i32 15
  %60 = load i32, ptr %59, align 4, !tbaa !9
  %61 = or i32 %60, 256
  store i32 %61, ptr %59, align 4, !tbaa !9
  %62 = load ptr, ptr %2, align 8, !tbaa !5
  %63 = getelementptr inbounds %struct.png_struct_def, ptr %62, i32 0, i32 44
  %64 = load i32, ptr %63, align 8, !tbaa !24
  %65 = icmp ne i32 %64, 1229209940
  br i1 %65, label %66, label %77

66:                                               ; preds = %22
  %67 = load ptr, ptr %2, align 8, !tbaa !5
  %68 = getelementptr inbounds %struct.png_struct_def, ptr %67, i32 0, i32 106
  store i32 1, ptr %68, align 8, !tbaa !25
  %69 = load ptr, ptr %2, align 8, !tbaa !5
  %70 = getelementptr inbounds %struct.png_struct_def, ptr %69, i32 0, i32 16
  %71 = load i32, ptr %70, align 8, !tbaa !26
  %72 = and i32 %71, 8
  %73 = icmp eq i32 %72, 0
  br i1 %73, label %74, label %76

74:                                               ; preds = %66
  %75 = load ptr, ptr %2, align 8, !tbaa !5
  call void @png_error(ptr noundef %75, ptr noundef @.str.10) #5
  unreachable

76:                                               ; preds = %66
  store i32 1, ptr %5, align 4
  br label %83

77:                                               ; preds = %22
  %78 = load ptr, ptr %2, align 8, !tbaa !5
  %79 = getelementptr inbounds %struct.png_struct_def, ptr %78, i32 0, i32 100
  %80 = load i32, ptr %79, align 8, !tbaa !22
  %81 = load ptr, ptr %2, align 8, !tbaa !5
  %82 = getelementptr inbounds %struct.png_struct_def, ptr %81, i32 0, i32 50
  store i32 %80, ptr %82, align 8, !tbaa !27
  store i32 0, ptr %5, align 4
  br label %83

83:                                               ; preds = %77, %76, %20
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #4
  %84 = load i32, ptr %5, align 4
  switch i32 %84, label %228 [
    i32 0, label %85
    i32 1, label %227
  ]

85:                                               ; preds = %83
  br label %86

86:                                               ; preds = %85, %1
  %87 = load ptr, ptr %2, align 8, !tbaa !5
  %88 = getelementptr inbounds %struct.png_struct_def, ptr %87, i32 0, i32 50
  %89 = load i32, ptr %88, align 8, !tbaa !27
  %90 = icmp ne i32 %89, 0
  br i1 %90, label %91, label %144

91:                                               ; preds = %86
  %92 = load ptr, ptr %2, align 8, !tbaa !5
  %93 = getelementptr inbounds %struct.png_struct_def, ptr %92, i32 0, i32 102
  %94 = load i64, ptr %93, align 8, !tbaa !28
  %95 = icmp ne i64 %94, 0
  br i1 %95, label %96, label %144

96:                                               ; preds = %91
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #4
  %97 = load ptr, ptr %2, align 8, !tbaa !5
  %98 = getelementptr inbounds %struct.png_struct_def, ptr %97, i32 0, i32 102
  %99 = load i64, ptr %98, align 8, !tbaa !28
  store i64 %99, ptr %6, align 8, !tbaa !29
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #4
  %100 = load ptr, ptr %2, align 8, !tbaa !5
  %101 = getelementptr inbounds %struct.png_struct_def, ptr %100, i32 0, i32 50
  %102 = load i32, ptr %101, align 8, !tbaa !27
  store i32 %102, ptr %7, align 4, !tbaa !30
  %103 = load i32, ptr %7, align 4, !tbaa !30
  %104 = zext i32 %103 to i64
  %105 = load i64, ptr %6, align 8, !tbaa !29
  %106 = icmp ult i64 %104, %105
  br i1 %106, label %107, label %110

107:                                              ; preds = %96
  %108 = load i32, ptr %7, align 4, !tbaa !30
  %109 = zext i32 %108 to i64
  store i64 %109, ptr %6, align 8, !tbaa !29
  br label %113

110:                                              ; preds = %96
  %111 = load i64, ptr %6, align 8, !tbaa !29
  %112 = trunc i64 %111 to i32
  store i32 %112, ptr %7, align 4, !tbaa !30
  br label %113

113:                                              ; preds = %110, %107
  %114 = load ptr, ptr %2, align 8, !tbaa !5
  %115 = load ptr, ptr %2, align 8, !tbaa !5
  %116 = getelementptr inbounds %struct.png_struct_def, ptr %115, i32 0, i32 96
  %117 = load ptr, ptr %116, align 8, !tbaa !31
  %118 = load i64, ptr %6, align 8, !tbaa !29
  call void @png_calculate_crc(ptr noundef %114, ptr noundef %117, i64 noundef %118)
  %119 = load ptr, ptr %2, align 8, !tbaa !5
  %120 = load ptr, ptr %2, align 8, !tbaa !5
  %121 = getelementptr inbounds %struct.png_struct_def, ptr %120, i32 0, i32 96
  %122 = load ptr, ptr %121, align 8, !tbaa !31
  %123 = load i64, ptr %6, align 8, !tbaa !29
  call void @png_process_IDAT_data(ptr noundef %119, ptr noundef %122, i64 noundef %123)
  %124 = load i32, ptr %7, align 4, !tbaa !30
  %125 = load ptr, ptr %2, align 8, !tbaa !5
  %126 = getelementptr inbounds %struct.png_struct_def, ptr %125, i32 0, i32 50
  %127 = load i32, ptr %126, align 8, !tbaa !27
  %128 = sub i32 %127, %124
  store i32 %128, ptr %126, align 8, !tbaa !27
  %129 = load i64, ptr %6, align 8, !tbaa !29
  %130 = load ptr, ptr %2, align 8, !tbaa !5
  %131 = getelementptr inbounds %struct.png_struct_def, ptr %130, i32 0, i32 104
  %132 = load i64, ptr %131, align 8, !tbaa !21
  %133 = sub i64 %132, %129
  store i64 %133, ptr %131, align 8, !tbaa !21
  %134 = load i64, ptr %6, align 8, !tbaa !29
  %135 = load ptr, ptr %2, align 8, !tbaa !5
  %136 = getelementptr inbounds %struct.png_struct_def, ptr %135, i32 0, i32 102
  %137 = load i64, ptr %136, align 8, !tbaa !28
  %138 = sub i64 %137, %134
  store i64 %138, ptr %136, align 8, !tbaa !28
  %139 = load i64, ptr %6, align 8, !tbaa !29
  %140 = load ptr, ptr %2, align 8, !tbaa !5
  %141 = getelementptr inbounds %struct.png_struct_def, ptr %140, i32 0, i32 96
  %142 = load ptr, ptr %141, align 8, !tbaa !31
  %143 = getelementptr inbounds i8, ptr %142, i64 %139
  store ptr %143, ptr %141, align 8, !tbaa !31
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #4
  br label %144

144:                                              ; preds = %113, %91, %86
  %145 = load ptr, ptr %2, align 8, !tbaa !5
  %146 = getelementptr inbounds %struct.png_struct_def, ptr %145, i32 0, i32 50
  %147 = load i32, ptr %146, align 8, !tbaa !27
  %148 = icmp ne i32 %147, 0
  br i1 %148, label %149, label %202

149:                                              ; preds = %144
  %150 = load ptr, ptr %2, align 8, !tbaa !5
  %151 = getelementptr inbounds %struct.png_struct_def, ptr %150, i32 0, i32 105
  %152 = load i64, ptr %151, align 8, !tbaa !32
  %153 = icmp ne i64 %152, 0
  br i1 %153, label %154, label %202

154:                                              ; preds = %149
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #4
  %155 = load ptr, ptr %2, align 8, !tbaa !5
  %156 = getelementptr inbounds %struct.png_struct_def, ptr %155, i32 0, i32 105
  %157 = load i64, ptr %156, align 8, !tbaa !32
  store i64 %157, ptr %8, align 8, !tbaa !29
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #4
  %158 = load ptr, ptr %2, align 8, !tbaa !5
  %159 = getelementptr inbounds %struct.png_struct_def, ptr %158, i32 0, i32 50
  %160 = load i32, ptr %159, align 8, !tbaa !27
  store i32 %160, ptr %9, align 4, !tbaa !30
  %161 = load i32, ptr %9, align 4, !tbaa !30
  %162 = zext i32 %161 to i64
  %163 = load i64, ptr %8, align 8, !tbaa !29
  %164 = icmp ult i64 %162, %163
  br i1 %164, label %165, label %168

165:                                              ; preds = %154
  %166 = load i32, ptr %9, align 4, !tbaa !30
  %167 = zext i32 %166 to i64
  store i64 %167, ptr %8, align 8, !tbaa !29
  br label %171

168:                                              ; preds = %154
  %169 = load i64, ptr %8, align 8, !tbaa !29
  %170 = trunc i64 %169 to i32
  store i32 %170, ptr %9, align 4, !tbaa !30
  br label %171

171:                                              ; preds = %168, %165
  %172 = load ptr, ptr %2, align 8, !tbaa !5
  %173 = load ptr, ptr %2, align 8, !tbaa !5
  %174 = getelementptr inbounds %struct.png_struct_def, ptr %173, i32 0, i32 98
  %175 = load ptr, ptr %174, align 8, !tbaa !33
  %176 = load i64, ptr %8, align 8, !tbaa !29
  call void @png_calculate_crc(ptr noundef %172, ptr noundef %175, i64 noundef %176)
  %177 = load ptr, ptr %2, align 8, !tbaa !5
  %178 = load ptr, ptr %2, align 8, !tbaa !5
  %179 = getelementptr inbounds %struct.png_struct_def, ptr %178, i32 0, i32 98
  %180 = load ptr, ptr %179, align 8, !tbaa !33
  %181 = load i64, ptr %8, align 8, !tbaa !29
  call void @png_process_IDAT_data(ptr noundef %177, ptr noundef %180, i64 noundef %181)
  %182 = load i32, ptr %9, align 4, !tbaa !30
  %183 = load ptr, ptr %2, align 8, !tbaa !5
  %184 = getelementptr inbounds %struct.png_struct_def, ptr %183, i32 0, i32 50
  %185 = load i32, ptr %184, align 8, !tbaa !27
  %186 = sub i32 %185, %182
  store i32 %186, ptr %184, align 8, !tbaa !27
  %187 = load i64, ptr %8, align 8, !tbaa !29
  %188 = load ptr, ptr %2, align 8, !tbaa !5
  %189 = getelementptr inbounds %struct.png_struct_def, ptr %188, i32 0, i32 104
  %190 = load i64, ptr %189, align 8, !tbaa !21
  %191 = sub i64 %190, %187
  store i64 %191, ptr %189, align 8, !tbaa !21
  %192 = load i64, ptr %8, align 8, !tbaa !29
  %193 = load ptr, ptr %2, align 8, !tbaa !5
  %194 = getelementptr inbounds %struct.png_struct_def, ptr %193, i32 0, i32 105
  %195 = load i64, ptr %194, align 8, !tbaa !32
  %196 = sub i64 %195, %192
  store i64 %196, ptr %194, align 8, !tbaa !32
  %197 = load i64, ptr %8, align 8, !tbaa !29
  %198 = load ptr, ptr %2, align 8, !tbaa !5
  %199 = getelementptr inbounds %struct.png_struct_def, ptr %198, i32 0, i32 98
  %200 = load ptr, ptr %199, align 8, !tbaa !33
  %201 = getelementptr inbounds i8, ptr %200, i64 %197
  store ptr %201, ptr %199, align 8, !tbaa !33
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #4
  br label %202

202:                                              ; preds = %171, %149, %144
  %203 = load ptr, ptr %2, align 8, !tbaa !5
  %204 = getelementptr inbounds %struct.png_struct_def, ptr %203, i32 0, i32 50
  %205 = load i32, ptr %204, align 8, !tbaa !27
  %206 = icmp eq i32 %205, 0
  br i1 %206, label %207, label %227

207:                                              ; preds = %202
  %208 = load ptr, ptr %2, align 8, !tbaa !5
  %209 = getelementptr inbounds %struct.png_struct_def, ptr %208, i32 0, i32 104
  %210 = load i64, ptr %209, align 8, !tbaa !21
  %211 = icmp ult i64 %210, 4
  br i1 %211, label %212, label %214

212:                                              ; preds = %207
  %213 = load ptr, ptr %2, align 8, !tbaa !5
  call void @png_push_save_buffer(ptr noundef %213)
  br label %227

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

227:                                              ; preds = %214, %212, %202, %83
  ret void

228:                                              ; preds = %83
  unreachable
}

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

; Function Attrs: noreturn
declare void @png_error(ptr noundef, ptr noundef) #2

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

declare void @png_reset_crc(ptr noundef) #3

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

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

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

declare i32 @png_crc_finish(ptr noundef, i32 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 = { noreturn "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 = { "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 }
attributes #5 = { noreturn }

!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, !12, i64 300}
!10 = !{!"png_struct_def", !7, i64 0, !6, i64 200, !6, i64 208, !11, i64 216, !6, i64 224, !6, i64 232, !6, i64 240, !6, i64 248, !6, i64 256, !6, i64 264, !6, i64 272, !6, i64 280, !6, i64 288, !7, i64 296, !7, i64 297, !12, i64 300, !12, i64 304, !12, i64 308, !12, i64 312, !13, i64 320, !6, i64 432, !12, i64 440, !12, i64 444, !12, i64 448, !12, i64 452, !12, i64 456, !12, i64 460, !12, i64 464, !12, i64 468, !12, i64 472, !12, i64 476, !12, i64 480, !12, i64 484, !12, i64 488, !12, i64 492, !12, i64 496, !12, i64 500, !12, i64 504, !12, i64 508, !12, i64 512, !12, i64 516, !11, i64 520, !12, i64 528, !12, i64 532, !12, i64 536, !6, i64 544, !6, i64 552, !6, i64 560, !6, i64 568, !11, i64 576, !12, i64 584, !12, i64 588, !6, i64 592, !14, i64 600, !12, i64 604, !14, i64 608, !7, i64 610, !7, i64 611, !7, i64 612, !7, i64 613, !7, i64 614, !7, i64 615, !7, i64 616, !7, i64 617, !7, i64 618, !7, i64 619, !7, i64 620, !7, i64 621, !7, i64 622, !7, i64 623, !7, i64 624, !14, i64 626, !7, i64 628, !12, i64 632, !15, i64 636, !15, i64 646, !6, i64 656, !12, i64 664, !12, i64 668, !12, i64 672, !12, i64 676, !6, i64 680, !6, i64 688, !6, i64 696, !6, i64 704, !6, i64 712, !6, i64 720, !16, i64 728, !16, i64 733, !6, i64 744, !15, i64 752, !6, i64 768, !6, i64 776, !6, i64 784, !6, i64 792, !6, i64 800, !6, i64 808, !6, i64 816, !6, i64 824, !6, i64 832, !12, i64 840, !12, i64 844, !11, i64 848, !11, i64 856, !11, i64 864, !11, i64 872, !12, i64 880, !12, i64 884, !6, i64 888, !6, i64 896, !12, i64 904, !7, i64 908, !12, i64 940, !6, i64 944, !6, i64 952, !12, i64 960, !12, i64 964, !6, i64 968, !7, i64 976, !7, i64 977, !14, i64 978, !14, i64 980, !12, i64 984, !7, i64 988, !6, i64 992, !6, i64 1000, !6, i64 1008, !6, i64 1016, !6, i64 1024, !6, i64 1032, !6, i64 1040, !7, i64 1048, !12, i64 1052, !12, i64 1056, !12, i64 1060, !11, i64 1064, !17, i64 1072, !11, i64 1104, !6, i64 1112, !11, i64 1120, !12, i64 1128, !12, i64 1132, !6, i64 1136, !7, i64 1144, !18, i64 1176}
!11 = !{!"long", !7, i64 0}
!12 = !{!"int", !7, i64 0}
!13 = !{!"z_stream_s", !6, i64 0, !12, i64 8, !11, i64 16, !6, i64 24, !12, i64 32, !11, i64 40, !6, i64 48, !6, i64 56, !6, i64 64, !6, i64 72, !6, i64 80, !12, i64 88, !11, i64 96, !11, i64 104}
!14 = !{!"short", !7, i64 0}
!15 = !{!"png_color_16_struct", !7, i64 0, !14, i64 2, !14, i64 4, !14, i64 6, !14, i64 8}
!16 = !{!"png_color_8_struct", !7, i64 0, !7, i64 1, !7, i64 2, !7, i64 3, !7, i64 4}
!17 = !{!"png_unknown_chunk_t", !7, i64 0, !6, i64 8, !11, i64 16, !7, i64 24}
!18 = !{!"png_colorspace", !12, i64 0, !19, i64 4, !20, i64 36, !14, i64 72, !14, i64 74}
!19 = !{!"png_xy", !12, i64 0, !12, i64 4, !12, i64 8, !12, i64 12, !12, i64 16, !12, i64 20, !12, i64 24, !12, i64 28}
!20 = !{!"png_XYZ", !12, i64 0, !12, i64 4, !12, i64 8, !12, i64 12, !12, i64 16, !12, i64 20, !12, i64 24, !12, i64 28, !12, i64 32}
!21 = !{!10, !11, i64 864}
!22 = !{!10, !12, i64 840}
!23 = !{!7, !7, i64 0}
!24 = !{!10, !12, i64 536}
!25 = !{!10, !12, i64 880}
!26 = !{!10, !12, i64 304}
!27 = !{!10, !12, i64 584}
!28 = !{!10, !11, i64 848}
!29 = !{!11, !11, i64 0}
!30 = !{!12, !12, i64 0}
!31 = !{!10, !6, i64 808}
!32 = !{!10, !11, i64 872}
!33 = !{!10, !6, i64 824}
!34 = !{!10, !12, i64 312}


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

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

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

; 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
define dso_local void @png_push_read_IDAT(ptr noalias noundef %0) local_unnamed_addr #0 {
  %2 = alloca [4 x i8], align 1
  %3 = alloca [4 x i8], align 1
  %4 = getelementptr inbounds i8, ptr %0, i64 300
  %5 = load i32, ptr %4, align 4, !tbaa !5
  %6 = and i32 %5, 256
  %7 = icmp eq i32 %6, 0
  br i1 %7, label %8, label %._crit_edge

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

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

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

13:                                               ; preds = %8
  call void @png_push_fill_buffer(ptr noundef nonnull %0, ptr noundef nonnull %2, i64 noundef 4)
  %14 = call i32 @png_get_uint_31(ptr noundef nonnull %0, ptr noundef nonnull %2) #5
  %15 = getelementptr inbounds i8, ptr %0, i64 840
  store i32 %14, ptr %15, align 8, !tbaa !22
  call void @png_reset_crc(ptr noundef nonnull %0) #5
  call void @png_crc_read(ptr noundef nonnull %0, ptr noundef nonnull %3, i32 noundef 4) #5
  %16 = load i8, ptr %3, align 1, !tbaa !23
  %17 = zext i8 %16 to i32
  %18 = shl nuw i32 %17, 24
  %19 = getelementptr inbounds i8, ptr %3, i64 1
  %20 = load i8, ptr %19, align 1, !tbaa !23
  %21 = zext i8 %20 to i32
  %22 = shl nuw nsw i32 %21, 16
  %23 = or disjoint i32 %22, %18
  %24 = getelementptr inbounds i8, ptr %3, i64 2
  %25 = load i8, ptr %24, align 1, !tbaa !23
  %26 = zext i8 %25 to i32
  %27 = shl nuw nsw i32 %26, 8
  %28 = or disjoint i32 %23, %27
  %29 = getelementptr inbounds i8, ptr %3, i64 3
  %30 = load i8, ptr %29, align 1, !tbaa !23
  %31 = zext i8 %30 to i32
  %32 = or disjoint i32 %28, %31
  %33 = getelementptr inbounds i8, ptr %0, i64 536
  store i32 %32, ptr %33, align 8, !tbaa !24
  %34 = load i32, ptr %4, align 4, !tbaa !5
  %35 = or i32 %34, 256
  store i32 %35, ptr %4, align 4, !tbaa !5
  %.not = icmp eq i32 %32, 1229209940
  br i1 %.not, label %43, label %36

36:                                               ; preds = %13
  %37 = getelementptr inbounds i8, ptr %0, i64 880
  store i32 1, ptr %37, align 8, !tbaa !25
  %38 = getelementptr inbounds i8, ptr %0, i64 304
  %39 = load i32, ptr %38, align 8, !tbaa !26
  %40 = and i32 %39, 8
  %41 = icmp eq i32 %40, 0
  br i1 %41, label %42, label %.thread

42:                                               ; preds = %36
  call void @png_error(ptr noundef nonnull %0, ptr noundef nonnull @.str.10) #6
  unreachable

.thread:                                          ; preds = %12, %36
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #5
  br label %.thread95

43:                                               ; preds = %13
  %44 = load i32, ptr %15, align 8, !tbaa !22
  %45 = getelementptr inbounds i8, ptr %0, i64 584
  store i32 %44, ptr %45, align 8, !tbaa !20
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #5
  br label %46

46:                                               ; preds = %._crit_edge, %43
  %47 = phi i32 [ %.pre, %._crit_edge ], [ %44, %43 ]
  %48 = getelementptr inbounds i8, ptr %0, i64 584
  %.not77 = icmp eq i32 %47, 0
  br i1 %.not77, label %.thread88, label %49

49:                                               ; preds = %46
  %50 = getelementptr inbounds i8, ptr %0, i64 848
  %51 = load i64, ptr %50, align 8, !tbaa !27
  %.not78 = icmp eq i64 %51, 0
  br i1 %.not78, label %.thread91, label %52

52:                                               ; preds = %49
  %53 = zext i32 %47 to i64
  %54 = icmp ugt i64 %51, %53
  %55 = trunc nuw i64 %51 to i32
  %.069 = call i64 @llvm.umin.i64(i64 %51, i64 %53)
  %.068 = select i1 %54, i32 %47, i32 %55
  %56 = getelementptr inbounds i8, ptr %0, i64 808
  %57 = load ptr, ptr %56, align 8, !tbaa !28
  call void @png_calculate_crc(ptr noundef nonnull %0, ptr noundef %57, i64 noundef %.069) #5
  %58 = load ptr, ptr %56, align 8, !tbaa !28
  call void @png_process_IDAT_data(ptr noundef nonnull %0, ptr noundef %58, i64 noundef %.069)
  %59 = load i32, ptr %48, align 8, !tbaa !20
  %60 = sub i32 %59, %.068
  store i32 %60, ptr %48, align 8, !tbaa !20
  %61 = getelementptr inbounds i8, ptr %0, i64 864
  %62 = load i64, ptr %61, align 8, !tbaa !21
  %63 = sub i64 %62, %.069
  store i64 %63, ptr %61, align 8, !tbaa !21
  %64 = load i64, ptr %50, align 8, !tbaa !27
  %65 = sub i64 %64, %.069
  store i64 %65, ptr %50, align 8, !tbaa !27
  %66 = load ptr, ptr %56, align 8, !tbaa !28
  %67 = getelementptr inbounds i8, ptr %66, i64 %.069
  store ptr %67, ptr %56, align 8, !tbaa !28
  %.not79 = icmp eq i32 %60, 0
  br i1 %.not79, label %.thread88, label %.thread91

.thread91:                                        ; preds = %49, %52
  %.pr94 = phi i32 [ %60, %52 ], [ %47, %49 ]
  %68 = getelementptr inbounds i8, ptr %0, i64 872
  %69 = load i64, ptr %68, align 8, !tbaa !29
  %.not80 = icmp eq i64 %69, 0
  br i1 %.not80, label %.thread95, label %70

70:                                               ; preds = %.thread91
  %71 = zext i32 %.pr94 to i64
  %72 = icmp ugt i64 %69, %71
  %73 = trunc nuw i64 %69 to i32
  %.067 = call i64 @llvm.umin.i64(i64 %69, i64 %71)
  %.0 = select i1 %72, i32 %.pr94, i32 %73
  %74 = getelementptr inbounds i8, ptr %0, i64 824
  %75 = load ptr, ptr %74, align 8, !tbaa !30
  call void @png_calculate_crc(ptr noundef nonnull %0, ptr noundef %75, i64 noundef %.067) #5
  %76 = load ptr, ptr %74, align 8, !tbaa !30
  call void @png_process_IDAT_data(ptr noundef nonnull %0, ptr noundef %76, i64 noundef %.067)
  %77 = load i32, ptr %48, align 8, !tbaa !20
  %78 = sub i32 %77, %.0
  store i32 %78, ptr %48, align 8, !tbaa !20
  %79 = getelementptr inbounds i8, ptr %0, i64 864
  %80 = load <2 x i64>, ptr %79, align 8, !tbaa !31
  %81 = insertelement <2 x i64> poison, i64 %.067, i64 0
  %82 = shufflevector <2 x i64> %81, <2 x i64> poison, <2 x i32> zeroinitializer
  %83 = sub <2 x i64> %80, %82
  store <2 x i64> %83, ptr %79, align 8, !tbaa !31
  %84 = load ptr, ptr %74, align 8, !tbaa !30
  %85 = getelementptr inbounds i8, ptr %84, i64 %.067
  store ptr %85, ptr %74, align 8, !tbaa !30
  %86 = icmp eq i32 %77, %.0
  br i1 %86, label %.thread88, label %.thread95

.thread88:                                        ; preds = %46, %52, %70
  %87 = getelementptr inbounds i8, ptr %0, i64 864
  %88 = load i64, ptr %87, align 8, !tbaa !21
  %89 = icmp ult i64 %88, 4
  br i1 %89, label %90, label %91

90:                                               ; preds = %.thread88
  call void @png_push_save_buffer(ptr noundef nonnull %0)
  br label %.thread95

91:                                               ; preds = %.thread88
  %92 = call i32 @png_crc_finish(ptr noundef nonnull %0, i32 noundef 0) #5
  %93 = load i32, ptr %4, align 4, !tbaa !5
  %94 = and i32 %93, -265
  %95 = or disjoint i32 %94, 8
  store i32 %95, ptr %4, align 4, !tbaa !5
  %96 = getelementptr inbounds i8, ptr %0, i64 312
  store i32 0, ptr %96, align 8, !tbaa !32
  br label %.thread95

.thread95:                                        ; preds = %.thread91, %.thread, %91, %90, %70
  ret void
}

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

; Function Attrs: noreturn
declare void @png_error(ptr noundef, ptr noundef) local_unnamed_addr #2

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

declare void @png_reset_crc(ptr noundef) local_unnamed_addr #3

declare void @png_crc_read(ptr noundef, ptr noundef, i32 noundef) local_unnamed_addr #3

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

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

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

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

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 = { noreturn "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 = { "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 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #5 = { nounwind }
attributes #6 = { noreturn 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, !11, i64 300}
!6 = !{!"png_struct_def", !7, i64 0, !9, i64 200, !9, i64 208, !10, i64 216, !9, i64 224, !9, i64 232, !9, i64 240, !9, i64 248, !9, i64 256, !9, i64 264, !9, i64 272, !9, i64 280, !9, i64 288, !7, i64 296, !7, i64 297, !11, i64 300, !11, i64 304, !11, i64 308, !11, i64 312, !12, i64 320, !9, i64 432, !11, i64 440, !11, i64 444, !11, i64 448, !11, i64 452, !11, i64 456, !11, i64 460, !11, i64 464, !11, i64 468, !11, i64 472, !11, i64 476, !11, i64 480, !11, i64 484, !11, i64 488, !11, i64 492, !11, i64 496, !11, i64 500, !11, i64 504, !11, i64 508, !11, i64 512, !11, i64 516, !10, i64 520, !11, i64 528, !11, i64 532, !11, i64 536, !9, i64 544, !9, i64 552, !9, i64 560, !9, i64 568, !10, i64 576, !11, i64 584, !11, i64 588, !9, i64 592, !13, i64 600, !11, i64 604, !13, i64 608, !7, i64 610, !7, i64 611, !7, i64 612, !7, i64 613, !7, i64 614, !7, i64 615, !7, i64 616, !7, i64 617, !7, i64 618, !7, i64 619, !7, i64 620, !7, i64 621, !7, i64 622, !7, i64 623, !7, i64 624, !13, i64 626, !7, i64 628, !11, i64 632, !14, i64 636, !14, i64 646, !9, i64 656, !11, i64 664, !11, i64 668, !11, i64 672, !11, i64 676, !9, i64 680, !9, i64 688, !9, i64 696, !9, i64 704, !9, i64 712, !9, i64 720, !15, i64 728, !15, i64 733, !9, i64 744, !14, i64 752, !9, i64 768, !9, i64 776, !9, i64 784, !9, i64 792, !9, i64 800, !9, i64 808, !9, i64 816, !9, i64 824, !9, i64 832, !11, i64 840, !11, i64 844, !10, i64 848, !10, i64 856, !10, i64 864, !10, i64 872, !11, i64 880, !11, i64 884, !9, i64 888, !9, i64 896, !11, i64 904, !7, i64 908, !11, i64 940, !9, i64 944, !9, i64 952, !11, i64 960, !11, i64 964, !9, i64 968, !7, i64 976, !7, i64 977, !13, i64 978, !13, i64 980, !11, i64 984, !7, i64 988, !9, i64 992, !9, i64 1000, !9, i64 1008, !9, i64 1016, !9, i64 1024, !9, i64 1032, !9, i64 1040, !7, i64 1048, !11, i64 1052, !11, i64 1056, !11, i64 1060, !10, i64 1064, !16, i64 1072, !10, i64 1104, !9, i64 1112, !10, i64 1120, !11, i64 1128, !11, i64 1132, !9, i64 1136, !7, i64 1144, !17, i64 1176}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!"any pointer", !7, i64 0}
!10 = !{!"long", !7, i64 0}
!11 = !{!"int", !7, i64 0}
!12 = !{!"z_stream_s", !9, i64 0, !11, i64 8, !10, i64 16, !9, i64 24, !11, i64 32, !10, i64 40, !9, i64 48, !9, i64 56, !9, i64 64, !9, i64 72, !9, i64 80, !11, i64 88, !10, i64 96, !10, i64 104}
!13 = !{!"short", !7, i64 0}
!14 = !{!"png_color_16_struct", !7, i64 0, !13, i64 2, !13, i64 4, !13, i64 6, !13, i64 8}
!15 = !{!"png_color_8_struct", !7, i64 0, !7, i64 1, !7, i64 2, !7, i64 3, !7, i64 4}
!16 = !{!"png_unknown_chunk_t", !7, i64 0, !9, i64 8, !10, i64 16, !7, i64 24}
!17 = !{!"png_colorspace", !11, i64 0, !18, i64 4, !19, i64 36, !13, i64 72, !13, i64 74}
!18 = !{!"png_xy", !11, i64 0, !11, i64 4, !11, i64 8, !11, i64 12, !11, i64 16, !11, i64 20, !11, i64 24, !11, i64 28}
!19 = !{!"png_XYZ", !11, i64 0, !11, i64 4, !11, i64 8, !11, i64 12, !11, i64 16, !11, i64 20, !11, i64 24, !11, i64 28, !11, i64 32}
!20 = !{!6, !11, i64 584}
!21 = !{!6, !10, i64 864}
!22 = !{!6, !11, i64 840}
!23 = !{!7, !7, i64 0}
!24 = !{!6, !11, i64 536}
!25 = !{!6, !11, i64 880}
!26 = !{!6, !11, i64 304}
!27 = !{!6, !10, i64 848}
!28 = !{!6, !9, i64 808}
!29 = !{!6, !10, i64 872}
!30 = !{!6, !9, i64 824}
!31 = !{!10, !10, i64 0}
!32 = !{!6, !11, i64 312}


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