; 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.11 = external hidden unnamed_addr constant [30 x i8], align 1
@.str.12 = external hidden unnamed_addr constant [34 x i8], align 1
@.str.13 = external hidden unnamed_addr constant [32 x i8], align 1
@.str.14 = external hidden unnamed_addr constant [28 x i8], align 1
@.str.15 = external hidden unnamed_addr constant [30 x i8], align 1
@.str.16 = external hidden unnamed_addr constant [31 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

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

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

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

; Function Attrs: nounwind uwtable
define dso_local void @png_process_IDAT_data(ptr noalias noundef %0, ptr noundef %1, i64 noundef %2) #3 {
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca i64, align 8
  %7 = alloca i32, align 4
  %8 = 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
  %9 = load i64, ptr %6, align 8, !tbaa !9
  %10 = icmp ugt i64 %9, 0
  br i1 %10, label %11, label %14

11:                                               ; preds = %3
  %12 = load ptr, ptr %5, align 8, !tbaa !5
  %13 = icmp eq ptr %12, null
  br i1 %13, label %14, label %16

14:                                               ; preds = %11, %3
  %15 = load ptr, ptr %4, align 8, !tbaa !5
  call void @png_error(ptr noundef %15, ptr noundef @.str.11) #4
  unreachable

16:                                               ; preds = %11
  %17 = load ptr, ptr %5, align 8, !tbaa !5
  %18 = load ptr, ptr %4, align 8, !tbaa !5
  %19 = getelementptr inbounds %struct.png_struct_def, ptr %18, i32 0, i32 19
  %20 = getelementptr inbounds %struct.z_stream_s, ptr %19, i32 0, i32 0
  store ptr %17, ptr %20, align 8, !tbaa !11
  %21 = load i64, ptr %6, align 8, !tbaa !9
  %22 = trunc i64 %21 to i32
  %23 = load ptr, ptr %4, align 8, !tbaa !5
  %24 = getelementptr inbounds %struct.png_struct_def, ptr %23, i32 0, i32 19
  %25 = getelementptr inbounds %struct.z_stream_s, ptr %24, i32 0, i32 1
  store i32 %22, ptr %25, align 8, !tbaa !22
  br label %26

26:                                               ; preds = %178, %16
  %27 = load ptr, ptr %4, align 8, !tbaa !5
  %28 = getelementptr inbounds %struct.png_struct_def, ptr %27, i32 0, i32 19
  %29 = getelementptr inbounds %struct.z_stream_s, ptr %28, i32 0, i32 1
  %30 = load i32, ptr %29, align 8, !tbaa !22
  %31 = icmp ugt i32 %30, 0
  br i1 %31, label %32, label %38

32:                                               ; preds = %26
  %33 = load ptr, ptr %4, align 8, !tbaa !5
  %34 = getelementptr inbounds %struct.png_struct_def, ptr %33, i32 0, i32 16
  %35 = load i32, ptr %34, align 8, !tbaa !23
  %36 = and i32 %35, 8
  %37 = icmp eq i32 %36, 0
  br label %38

38:                                               ; preds = %32, %26
  %39 = phi i1 [ false, %26 ], [ %37, %32 ]
  br i1 %39, label %40, label %179

40:                                               ; preds = %38
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #5
  %41 = load ptr, ptr %4, align 8, !tbaa !5
  %42 = getelementptr inbounds %struct.png_struct_def, ptr %41, i32 0, i32 19
  %43 = getelementptr inbounds %struct.z_stream_s, ptr %42, i32 0, i32 4
  %44 = load i32, ptr %43, align 8, !tbaa !24
  %45 = icmp ugt i32 %44, 0
  br i1 %45, label %88, label %46

46:                                               ; preds = %40
  %47 = load ptr, ptr %4, align 8, !tbaa !5
  %48 = getelementptr inbounds %struct.png_struct_def, ptr %47, i32 0, i32 64
  %49 = load i8, ptr %48, align 2, !tbaa !25
  %50 = zext i8 %49 to i32
  %51 = icmp sge i32 %50, 8
  br i1 %51, label %52, label %63

52:                                               ; preds = %46
  %53 = load ptr, ptr %4, align 8, !tbaa !5
  %54 = getelementptr inbounds %struct.png_struct_def, ptr %53, i32 0, i32 42
  %55 = load i32, ptr %54, align 8, !tbaa !26
  %56 = zext i32 %55 to i64
  %57 = load ptr, ptr %4, align 8, !tbaa !5
  %58 = getelementptr inbounds %struct.png_struct_def, ptr %57, i32 0, i32 64
  %59 = load i8, ptr %58, align 2, !tbaa !25
  %60 = zext i8 %59 to i64
  %61 = lshr i64 %60, 3
  %62 = mul i64 %56, %61
  br label %75

63:                                               ; preds = %46
  %64 = load ptr, ptr %4, align 8, !tbaa !5
  %65 = getelementptr inbounds %struct.png_struct_def, ptr %64, i32 0, i32 42
  %66 = load i32, ptr %65, align 8, !tbaa !26
  %67 = zext i32 %66 to i64
  %68 = load ptr, ptr %4, align 8, !tbaa !5
  %69 = getelementptr inbounds %struct.png_struct_def, ptr %68, i32 0, i32 64
  %70 = load i8, ptr %69, align 2, !tbaa !25
  %71 = zext i8 %70 to i64
  %72 = mul i64 %67, %71
  %73 = add i64 %72, 7
  %74 = lshr i64 %73, 3
  br label %75

75:                                               ; preds = %63, %52
  %76 = phi i64 [ %62, %52 ], [ %74, %63 ]
  %77 = add i64 %76, 1
  %78 = trunc i64 %77 to i32
  %79 = load ptr, ptr %4, align 8, !tbaa !5
  %80 = getelementptr inbounds %struct.png_struct_def, ptr %79, i32 0, i32 19
  %81 = getelementptr inbounds %struct.z_stream_s, ptr %80, i32 0, i32 4
  store i32 %78, ptr %81, align 8, !tbaa !24
  %82 = load ptr, ptr %4, align 8, !tbaa !5
  %83 = getelementptr inbounds %struct.png_struct_def, ptr %82, i32 0, i32 46
  %84 = load ptr, ptr %83, align 8, !tbaa !27
  %85 = load ptr, ptr %4, align 8, !tbaa !5
  %86 = getelementptr inbounds %struct.png_struct_def, ptr %85, i32 0, i32 19
  %87 = getelementptr inbounds %struct.z_stream_s, ptr %86, i32 0, i32 3
  store ptr %84, ptr %87, align 8, !tbaa !28
  br label %88

88:                                               ; preds = %75, %40
  %89 = load ptr, ptr %4, align 8, !tbaa !5
  %90 = call i32 @png_zlib_inflate(ptr noundef %89, i32 noundef 2)
  store i32 %90, ptr %7, align 4, !tbaa !29
  %91 = load i32, ptr %7, align 4, !tbaa !29
  %92 = icmp ne i32 %91, 0
  br i1 %92, label %93, label %127

93:                                               ; preds = %88
  %94 = load i32, ptr %7, align 4, !tbaa !29
  %95 = icmp ne i32 %94, 1
  br i1 %95, label %96, label %127

96:                                               ; preds = %93
  %97 = load ptr, ptr %4, align 8, !tbaa !5
  %98 = getelementptr inbounds %struct.png_struct_def, ptr %97, i32 0, i32 16
  %99 = load i32, ptr %98, align 8, !tbaa !23
  %100 = or i32 %99, 8
  store i32 %100, ptr %98, align 8, !tbaa !23
  %101 = load ptr, ptr %4, align 8, !tbaa !5
  %102 = getelementptr inbounds %struct.png_struct_def, ptr %101, i32 0, i32 18
  store i32 0, ptr %102, align 8, !tbaa !30
  %103 = load ptr, ptr %4, align 8, !tbaa !5
  %104 = getelementptr inbounds %struct.png_struct_def, ptr %103, i32 0, i32 43
  %105 = load i32, ptr %104, align 4, !tbaa !31
  %106 = load ptr, ptr %4, align 8, !tbaa !5
  %107 = getelementptr inbounds %struct.png_struct_def, ptr %106, i32 0, i32 39
  %108 = load i32, ptr %107, align 8, !tbaa !32
  %109 = icmp uge i32 %105, %108
  br i1 %109, label %116, label %110

110:                                              ; preds = %96
  %111 = load ptr, ptr %4, align 8, !tbaa !5
  %112 = getelementptr inbounds %struct.png_struct_def, ptr %111, i32 0, i32 59
  %113 = load i8, ptr %112, align 1, !tbaa !33
  %114 = zext i8 %113 to i32
  %115 = icmp sgt i32 %114, 6
  br i1 %115, label %116, label %118

116:                                              ; preds = %110, %96
  %117 = load ptr, ptr %4, align 8, !tbaa !5
  call void @png_warning(ptr noundef %117, ptr noundef @.str.12)
  br label %126

118:                                              ; preds = %110
  %119 = load i32, ptr %7, align 4, !tbaa !29
  %120 = icmp eq i32 %119, -3
  br i1 %120, label %121, label %123

121:                                              ; preds = %118
  %122 = load ptr, ptr %4, align 8, !tbaa !5
  call void @png_benign_error(ptr noundef %122, ptr noundef @.str.13)
  br label %125

123:                                              ; preds = %118
  %124 = load ptr, ptr %4, align 8, !tbaa !5
  call void @png_error(ptr noundef %124, ptr noundef @.str.14) #4
  unreachable

125:                                              ; preds = %121
  br label %126

126:                                              ; preds = %125, %116
  store i32 1, ptr %8, align 4
  br label %176

127:                                              ; preds = %93, %88
  %128 = load ptr, ptr %4, align 8, !tbaa !5
  %129 = getelementptr inbounds %struct.png_struct_def, ptr %128, i32 0, i32 19
  %130 = getelementptr inbounds %struct.z_stream_s, ptr %129, i32 0, i32 3
  %131 = load ptr, ptr %130, align 8, !tbaa !28
  %132 = load ptr, ptr %4, align 8, !tbaa !5
  %133 = getelementptr inbounds %struct.png_struct_def, ptr %132, i32 0, i32 46
  %134 = load ptr, ptr %133, align 8, !tbaa !27
  %135 = icmp ne ptr %131, %134
  br i1 %135, label %136, label %167

136:                                              ; preds = %127
  %137 = load ptr, ptr %4, align 8, !tbaa !5
  %138 = getelementptr inbounds %struct.png_struct_def, ptr %137, i32 0, i32 43
  %139 = load i32, ptr %138, align 4, !tbaa !31
  %140 = load ptr, ptr %4, align 8, !tbaa !5
  %141 = getelementptr inbounds %struct.png_struct_def, ptr %140, i32 0, i32 39
  %142 = load i32, ptr %141, align 8, !tbaa !32
  %143 = icmp uge i32 %139, %142
  br i1 %143, label %150, label %144

144:                                              ; preds = %136
  %145 = load ptr, ptr %4, align 8, !tbaa !5
  %146 = getelementptr inbounds %struct.png_struct_def, ptr %145, i32 0, i32 59
  %147 = load i8, ptr %146, align 1, !tbaa !33
  %148 = zext i8 %147 to i32
  %149 = icmp sgt i32 %148, 6
  br i1 %149, label %150, label %158

150:                                              ; preds = %144, %136
  %151 = load ptr, ptr %4, align 8, !tbaa !5
  call void @png_warning(ptr noundef %151, ptr noundef @.str.15)
  %152 = load ptr, ptr %4, align 8, !tbaa !5
  %153 = getelementptr inbounds %struct.png_struct_def, ptr %152, i32 0, i32 16
  %154 = load i32, ptr %153, align 8, !tbaa !23
  %155 = or i32 %154, 8
  store i32 %155, ptr %153, align 8, !tbaa !23
  %156 = load ptr, ptr %4, align 8, !tbaa !5
  %157 = getelementptr inbounds %struct.png_struct_def, ptr %156, i32 0, i32 18
  store i32 0, ptr %157, align 8, !tbaa !30
  store i32 1, ptr %8, align 4
  br label %176

158:                                              ; preds = %144
  %159 = load ptr, ptr %4, align 8, !tbaa !5
  %160 = getelementptr inbounds %struct.png_struct_def, ptr %159, i32 0, i32 19
  %161 = getelementptr inbounds %struct.z_stream_s, ptr %160, i32 0, i32 4
  %162 = load i32, ptr %161, align 8, !tbaa !24
  %163 = icmp eq i32 %162, 0
  br i1 %163, label %164, label %166

164:                                              ; preds = %158
  %165 = load ptr, ptr %4, align 8, !tbaa !5
  call void @png_push_process_row(ptr noundef %165)
  br label %166

166:                                              ; preds = %164, %158
  br label %167

167:                                              ; preds = %166, %127
  %168 = load i32, ptr %7, align 4, !tbaa !29
  %169 = icmp eq i32 %168, 1
  br i1 %169, label %170, label %175

170:                                              ; preds = %167
  %171 = load ptr, ptr %4, align 8, !tbaa !5
  %172 = getelementptr inbounds %struct.png_struct_def, ptr %171, i32 0, i32 16
  %173 = load i32, ptr %172, align 8, !tbaa !23
  %174 = or i32 %173, 8
  store i32 %174, ptr %172, align 8, !tbaa !23
  br label %175

175:                                              ; preds = %170, %167
  store i32 0, ptr %8, align 4
  br label %176

176:                                              ; preds = %175, %150, %126
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #5
  %177 = load i32, ptr %8, align 4
  switch i32 %177, label %188 [
    i32 0, label %178
    i32 1, label %187
  ]

178:                                              ; preds = %176
  br label %26, !llvm.loop !34

179:                                              ; preds = %38
  %180 = load ptr, ptr %4, align 8, !tbaa !5
  %181 = getelementptr inbounds %struct.png_struct_def, ptr %180, i32 0, i32 19
  %182 = getelementptr inbounds %struct.z_stream_s, ptr %181, i32 0, i32 1
  %183 = load i32, ptr %182, align 8, !tbaa !22
  %184 = icmp ugt i32 %183, 0
  br i1 %184, label %185, label %187

185:                                              ; preds = %179
  %186 = load ptr, ptr %4, align 8, !tbaa !5
  call void @png_warning(ptr noundef %186, ptr noundef @.str.16)
  br label %187

187:                                              ; preds = %185, %179, %176
  ret void

188:                                              ; preds = %176
  unreachable
}

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

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

; Function Attrs: nounwind uwtable
declare dso_local void @png_push_process_row(ptr noalias noundef) #3

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

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"long", !7, i64 0}
!11 = !{!12, !6, i64 320}
!12 = !{!"png_struct_def", !7, i64 0, !6, i64 200, !6, i64 208, !10, 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, !13, i64 300, !13, i64 304, !13, i64 308, !13, i64 312, !14, i64 320, !6, i64 432, !13, i64 440, !13, i64 444, !13, i64 448, !13, i64 452, !13, i64 456, !13, i64 460, !13, i64 464, !13, i64 468, !13, i64 472, !13, i64 476, !13, i64 480, !13, i64 484, !13, i64 488, !13, i64 492, !13, i64 496, !13, i64 500, !13, i64 504, !13, i64 508, !13, i64 512, !13, i64 516, !10, i64 520, !13, i64 528, !13, i64 532, !13, i64 536, !6, i64 544, !6, i64 552, !6, i64 560, !6, i64 568, !10, i64 576, !13, i64 584, !13, i64 588, !6, i64 592, !15, i64 600, !13, i64 604, !15, 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, !15, i64 626, !7, i64 628, !13, i64 632, !16, i64 636, !16, i64 646, !6, i64 656, !13, i64 664, !13, i64 668, !13, i64 672, !13, i64 676, !6, i64 680, !6, i64 688, !6, i64 696, !6, i64 704, !6, i64 712, !6, i64 720, !17, i64 728, !17, i64 733, !6, i64 744, !16, 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, !13, i64 840, !13, i64 844, !10, i64 848, !10, i64 856, !10, i64 864, !10, i64 872, !13, i64 880, !13, i64 884, !6, i64 888, !6, i64 896, !13, i64 904, !7, i64 908, !13, i64 940, !6, i64 944, !6, i64 952, !13, i64 960, !13, i64 964, !6, i64 968, !7, i64 976, !7, i64 977, !15, i64 978, !15, i64 980, !13, 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, !13, i64 1052, !13, i64 1056, !13, i64 1060, !10, i64 1064, !18, i64 1072, !10, i64 1104, !6, i64 1112, !10, i64 1120, !13, i64 1128, !13, i64 1132, !6, i64 1136, !7, i64 1144, !19, i64 1176}
!13 = !{!"int", !7, i64 0}
!14 = !{!"z_stream_s", !6, i64 0, !13, i64 8, !10, i64 16, !6, i64 24, !13, i64 32, !10, i64 40, !6, i64 48, !6, i64 56, !6, i64 64, !6, i64 72, !6, i64 80, !13, i64 88, !10, i64 96, !10, i64 104}
!15 = !{!"short", !7, i64 0}
!16 = !{!"png_color_16_struct", !7, i64 0, !15, i64 2, !15, i64 4, !15, i64 6, !15, 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, !6, i64 8, !10, i64 16, !7, i64 24}
!19 = !{!"png_colorspace", !13, i64 0, !20, i64 4, !21, i64 36, !15, i64 72, !15, i64 74}
!20 = !{!"png_xy", !13, i64 0, !13, i64 4, !13, i64 8, !13, i64 12, !13, i64 16, !13, i64 20, !13, i64 24, !13, i64 28}
!21 = !{!"png_XYZ", !13, i64 0, !13, i64 4, !13, i64 8, !13, i64 12, !13, i64 16, !13, i64 20, !13, i64 24, !13, i64 28, !13, i64 32}
!22 = !{!12, !13, i64 328}
!23 = !{!12, !13, i64 304}
!24 = !{!12, !13, i64 352}
!25 = !{!12, !7, i64 618}
!26 = !{!12, !13, i64 528}
!27 = !{!12, !6, i64 552}
!28 = !{!12, !6, i64 344}
!29 = !{!13, !13, i64 0}
!30 = !{!12, !13, i64 312}
!31 = !{!12, !13, i64 532}
!32 = !{!12, !13, i64 512}
!33 = !{!12, !7, i64 613}
!34 = distinct !{!34, !35}
!35 = !{!"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.11 = external hidden unnamed_addr constant [30 x i8], align 1
@.str.12 = external hidden unnamed_addr constant [34 x i8], align 1
@.str.13 = external hidden unnamed_addr constant [32 x i8], align 1
@.str.14 = external hidden unnamed_addr constant [28 x i8], align 1
@.str.15 = external hidden unnamed_addr constant [30 x i8], align 1
@.str.16 = external hidden unnamed_addr constant [31 x i8], align 1

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

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

; Function Attrs: nounwind uwtable
define dso_local void @png_process_IDAT_data(ptr noalias noundef %0, ptr noundef %1, i64 noundef %2) local_unnamed_addr #2 {
  %4 = icmp eq i64 %2, 0
  %5 = icmp eq ptr %1, null
  %or.cond = or i1 %5, %4
  br i1 %or.cond, label %6, label %7

6:                                                ; preds = %3
  tail call void @png_error(ptr noundef %0, ptr noundef nonnull @.str.11) #3
  unreachable

7:                                                ; preds = %3
  %8 = getelementptr inbounds i8, ptr %0, i64 320
  store ptr %1, ptr %8, align 8, !tbaa !5
  %9 = trunc i64 %2 to i32
  %10 = getelementptr inbounds i8, ptr %0, i64 328
  store i32 %9, ptr %10, align 8, !tbaa !20
  %.not61 = icmp eq i32 %9, 0
  br i1 %.not61, label %.critedge.thread, label %.lr.ph

.lr.ph:                                           ; preds = %7
  %11 = getelementptr inbounds i8, ptr %0, i64 304
  %12 = getelementptr inbounds i8, ptr %0, i64 352
  %13 = getelementptr inbounds i8, ptr %0, i64 618
  %14 = getelementptr inbounds i8, ptr %0, i64 528
  %15 = getelementptr inbounds i8, ptr %0, i64 552
  %16 = getelementptr inbounds i8, ptr %0, i64 344
  %17 = getelementptr inbounds i8, ptr %0, i64 532
  %18 = getelementptr inbounds i8, ptr %0, i64 512
  %19 = getelementptr inbounds i8, ptr %0, i64 613
  br label %20

thread-pre-split:                                 ; preds = %80, %78
  %.pr = load i32, ptr %10, align 8, !tbaa !20
  %.not = icmp eq i32 %.pr, 0
  br i1 %.not, label %.critedge.thread, label %20

20:                                               ; preds = %.lr.ph, %thread-pre-split
  %21 = load i32, ptr %11, align 8, !tbaa !21
  %22 = and i32 %21, 8
  %23 = icmp eq i32 %22, 0
  br i1 %23, label %24, label %.critedge

24:                                               ; preds = %20
  %25 = load i32, ptr %12, align 8, !tbaa !22
  %.not51 = icmp eq i32 %25, 0
  br i1 %.not51, label %26, label %45

26:                                               ; preds = %24
  %27 = load i8, ptr %13, align 2, !tbaa !23
  %28 = icmp ugt i8 %27, 7
  %29 = load i32, ptr %14, align 8, !tbaa !24
  %30 = zext i32 %29 to i64
  br i1 %28, label %31, label %35

31:                                               ; preds = %26
  %32 = lshr i8 %27, 3
  %33 = zext nneg i8 %32 to i64
  %34 = mul nuw nsw i64 %30, %33
  br label %40

35:                                               ; preds = %26
  %36 = zext nneg i8 %27 to i64
  %37 = mul nuw nsw i64 %30, %36
  %38 = add nuw nsw i64 %37, 7
  %39 = lshr i64 %38, 3
  br label %40

40:                                               ; preds = %35, %31
  %41 = phi i64 [ %34, %31 ], [ %39, %35 ]
  %42 = trunc i64 %41 to i32
  %43 = add i32 %42, 1
  store i32 %43, ptr %12, align 8, !tbaa !22
  %44 = load ptr, ptr %15, align 8, !tbaa !25
  store ptr %44, ptr %16, align 8, !tbaa !26
  br label %45

45:                                               ; preds = %40, %24
  %46 = tail call i32 @png_zlib_inflate(ptr noundef nonnull %0, i32 noundef 2) #4
  %or.cond3 = icmp ugt i32 %46, 1
  br i1 %or.cond3, label %47, label %61

47:                                               ; preds = %45
  %48 = load i32, ptr %11, align 8, !tbaa !21
  %49 = or i32 %48, 8
  store i32 %49, ptr %11, align 8, !tbaa !21
  %50 = getelementptr inbounds i8, ptr %0, i64 312
  store i32 0, ptr %50, align 8, !tbaa !27
  %51 = load i32, ptr %17, align 4, !tbaa !28
  %52 = load i32, ptr %18, align 8, !tbaa !29
  %.not54 = icmp ult i32 %51, %52
  br i1 %.not54, label %53, label %56

53:                                               ; preds = %47
  %54 = load i8, ptr %19, align 1, !tbaa !30
  %55 = icmp ugt i8 %54, 6
  br i1 %55, label %56, label %57

56:                                               ; preds = %53, %47
  tail call void @png_warning(ptr noundef nonnull %0, ptr noundef nonnull @.str.12) #4
  br label %.critedge.thread

57:                                               ; preds = %53
  %58 = icmp eq i32 %46, -3
  br i1 %58, label %59, label %60

59:                                               ; preds = %57
  tail call void @png_benign_error(ptr noundef nonnull %0, ptr noundef nonnull @.str.13) #4
  br label %.critedge.thread

60:                                               ; preds = %57
  tail call void @png_error(ptr noundef nonnull %0, ptr noundef nonnull @.str.14) #3
  unreachable

61:                                               ; preds = %45
  %62 = load ptr, ptr %16, align 8, !tbaa !26
  %63 = load ptr, ptr %15, align 8, !tbaa !25
  %.not52 = icmp eq ptr %62, %63
  br i1 %.not52, label %78, label %64

64:                                               ; preds = %61
  %65 = load i32, ptr %17, align 4, !tbaa !28
  %66 = load i32, ptr %18, align 8, !tbaa !29
  %.not53 = icmp ult i32 %65, %66
  br i1 %.not53, label %67, label %70

67:                                               ; preds = %64
  %68 = load i8, ptr %19, align 1, !tbaa !30
  %69 = icmp ugt i8 %68, 6
  br i1 %69, label %70, label %74

70:                                               ; preds = %67, %64
  tail call void @png_warning(ptr noundef nonnull %0, ptr noundef nonnull @.str.15) #4
  %71 = load i32, ptr %11, align 8, !tbaa !21
  %72 = or i32 %71, 8
  store i32 %72, ptr %11, align 8, !tbaa !21
  %73 = getelementptr inbounds i8, ptr %0, i64 312
  store i32 0, ptr %73, align 8, !tbaa !27
  br label %.critedge.thread

74:                                               ; preds = %67
  %75 = load i32, ptr %12, align 8, !tbaa !22
  %76 = icmp eq i32 %75, 0
  br i1 %76, label %77, label %78

77:                                               ; preds = %74
  tail call void @png_push_process_row(ptr noundef nonnull %0)
  br label %78

78:                                               ; preds = %74, %77, %61
  %79 = icmp eq i32 %46, 1
  br i1 %79, label %80, label %thread-pre-split

80:                                               ; preds = %78
  %81 = load i32, ptr %11, align 8, !tbaa !21
  %82 = or i32 %81, 8
  store i32 %82, ptr %11, align 8, !tbaa !21
  br label %thread-pre-split

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

.critedge.thread:                                 ; preds = %thread-pre-split, %7, %56, %59, %70, %.critedge
  ret void
}

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

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

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

attributes #0 = { 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 #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 = { noreturn nounwind }
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, !9, i64 320}
!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 328}
!21 = !{!6, !11, i64 304}
!22 = !{!6, !11, i64 352}
!23 = !{!6, !7, i64 618}
!24 = !{!6, !11, i64 528}
!25 = !{!6, !9, i64 552}
!26 = !{!6, !9, i64 344}
!27 = !{!6, !11, i64 312}
!28 = !{!6, !11, i64 532}
!29 = !{!6, !11, i64 512}
!30 = !{!6, !7, i64 613}


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