; LLVM IR from rdguez-mariano/fast_imas_IPOL :: io_png/libs/png (pngrutil)

; Unoptimized IR (clang -disable-llvm-passes):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%struct.png_color_struct = type { i8, i8, i8 }
%struct.png_struct_def = type { [1 x %struct.__jmp_buf_tag], ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, i8, i8, i64, i64, i64, %struct.z_stream_s, ptr, i64, i32, i32, i32, i32, i32, i64, i64, i64, i64, i64, i64, i64, i64, ptr, ptr, ptr, ptr, ptr, ptr, %struct.png_row_info_struct, i64, i64, ptr, i16, i16, [5 x i8], i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i16, i8, float, %struct.png_color_16_struct, %struct.png_color_16_struct, ptr, i64, i64, i32, float, float, ptr, ptr, ptr, ptr, ptr, ptr, %struct.png_color_8_struct, %struct.png_color_8_struct, ptr, %struct.png_color_16_struct, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, i64, i64, i64, i64, i64, i64, i32, i32, i64, i64, ptr, ptr, ptr, ptr, ptr, i8, i8, ptr, ptr, ptr, ptr, ptr, ptr, i64, ptr, ptr, i32, ptr, i8, i16, i16, i16, i64, i64, i8, i8, i64, i64, ptr, ptr, ptr, ptr, ptr, ptr, ptr, i8, i64, i64, %struct.png_unknown_chunk_t, i64, i64, ptr }
%struct.__jmp_buf_tag = type { [8 x i64], i32, %struct.__sigset_t }
%struct.__sigset_t = type { [16 x i64] }
%struct.z_stream_s = type { ptr, i32, i64, ptr, i32, i64, ptr, ptr, ptr, ptr, ptr, i32, i64, i64 }
%struct.png_row_info_struct = type { i64, i64, i8, i8, i8, i8 }
%struct.png_color_8_struct = type { i8, i8, i8, i8, i8 }
%struct.png_color_16_struct = type { i8, i16, i16, i16, i16 }
%struct.png_unknown_chunk_t = type { [5 x i8], ptr, i64, i8 }
%struct.png_info_struct = type { i64, i64, i64, i64, ptr, i16, i16, i8, i8, i8, i8, i8, i8, i8, i8, [8 x i8], float, i8, i32, i32, ptr, %struct.png_time_struct, %struct.png_color_8_struct, ptr, %struct.png_color_16_struct, %struct.png_color_16_struct, i64, i64, i8, i64, i64, i8, ptr, float, float, float, float, float, float, float, float, ptr, i64, i64, ptr, ptr, i8, i8, i64, ptr, i64, ptr, ptr, i64, i8, ptr, i64, i8, double, double, ptr, ptr, ptr, i64, i64, i64, i64, i64, i64, i64, i64, i64 }
%struct.png_time_struct = type { i16, i8, i8, i8, i8, i8 }

@.str.12 = external hidden unnamed_addr constant [25 x i8], align 1
@.str.13 = external hidden unnamed_addr constant [24 x i8], align 1
@.str.14 = external hidden unnamed_addr constant [21 x i8], align 1
@.str.15 = external hidden unnamed_addr constant [37 x i8], align 1
@.str.16 = external hidden unnamed_addr constant [22 x i8], align 1
@.str.17 = external hidden unnamed_addr constant [39 x i8], align 1
@.str.18 = external hidden unnamed_addr constant [44 x i8], align 1

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

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

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

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

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

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

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

18:                                               ; preds = %3
  %19 = load ptr, ptr %4, align 8, !tbaa !5
  call void @png_error(ptr noundef %19, ptr noundef @.str.12)
  br label %41

20:                                               ; preds = %3
  %21 = load ptr, ptr %4, align 8, !tbaa !5
  %22 = getelementptr inbounds %struct.png_struct_def, ptr %21, i32 0, i32 12
  %23 = load i64, ptr %22, align 8, !tbaa !11
  %24 = and i64 %23, 4
  %25 = icmp ne i64 %24, 0
  br i1 %25, label %26, label %31

26:                                               ; preds = %20
  %27 = load ptr, ptr %4, align 8, !tbaa !5
  call void @png_warning(ptr noundef %27, ptr noundef @.str.13)
  %28 = load ptr, ptr %4, align 8, !tbaa !5
  %29 = load i64, ptr %6, align 8, !tbaa !9
  %30 = call i32 @png_crc_finish(ptr noundef %28, i64 noundef %29)
  store i32 1, ptr %11, align 4
  br label %161

31:                                               ; preds = %20
  %32 = load ptr, ptr %4, align 8, !tbaa !5
  %33 = getelementptr inbounds %struct.png_struct_def, ptr %32, i32 0, i32 12
  %34 = load i64, ptr %33, align 8, !tbaa !11
  %35 = and i64 %34, 2
  %36 = icmp ne i64 %35, 0
  br i1 %36, label %37, label %39

37:                                               ; preds = %31
  %38 = load ptr, ptr %4, align 8, !tbaa !5
  call void @png_error(ptr noundef %38, ptr noundef @.str.14)
  br label %39

39:                                               ; preds = %37, %31
  br label %40

40:                                               ; preds = %39
  br label %41

41:                                               ; preds = %40, %18
  %42 = load ptr, ptr %4, align 8, !tbaa !5
  %43 = getelementptr inbounds %struct.png_struct_def, ptr %42, i32 0, i32 12
  %44 = load i64, ptr %43, align 8, !tbaa !11
  %45 = or i64 %44, 2
  store i64 %45, ptr %43, align 8, !tbaa !11
  %46 = load ptr, ptr %4, align 8, !tbaa !5
  %47 = getelementptr inbounds %struct.png_struct_def, ptr %46, i32 0, i32 49
  %48 = load i8, ptr %47, align 2, !tbaa !21
  %49 = zext i8 %48 to i32
  %50 = and i32 %49, 2
  %51 = icmp ne i32 %50, 0
  br i1 %51, label %57, label %52

52:                                               ; preds = %41
  %53 = load ptr, ptr %4, align 8, !tbaa !5
  call void @png_warning(ptr noundef %53, ptr noundef @.str.15)
  %54 = load ptr, ptr %4, align 8, !tbaa !5
  %55 = load i64, ptr %6, align 8, !tbaa !9
  %56 = call i32 @png_crc_finish(ptr noundef %54, i64 noundef %55)
  store i32 1, ptr %11, align 4
  br label %161

57:                                               ; preds = %41
  %58 = load i64, ptr %6, align 8, !tbaa !9
  %59 = icmp ugt i64 %58, 768
  br i1 %59, label %64, label %60

60:                                               ; preds = %57
  %61 = load i64, ptr %6, align 8, !tbaa !9
  %62 = urem i64 %61, 3
  %63 = icmp ne i64 %62, 0
  br i1 %63, label %64, label %78

64:                                               ; preds = %60, %57
  %65 = load ptr, ptr %4, align 8, !tbaa !5
  %66 = getelementptr inbounds %struct.png_struct_def, ptr %65, i32 0, i32 49
  %67 = load i8, ptr %66, align 2, !tbaa !21
  %68 = zext i8 %67 to i32
  %69 = icmp ne i32 %68, 3
  br i1 %69, label %70, label %75

70:                                               ; preds = %64
  %71 = load ptr, ptr %4, align 8, !tbaa !5
  call void @png_warning(ptr noundef %71, ptr noundef @.str.16)
  %72 = load ptr, ptr %4, align 8, !tbaa !5
  %73 = load i64, ptr %6, align 8, !tbaa !9
  %74 = call i32 @png_crc_finish(ptr noundef %72, i64 noundef %73)
  store i32 1, ptr %11, align 4
  br label %161

75:                                               ; preds = %64
  %76 = load ptr, ptr %4, align 8, !tbaa !5
  call void @png_error(ptr noundef %76, ptr noundef @.str.16)
  br label %77

77:                                               ; preds = %75
  br label %78

78:                                               ; preds = %77, %60
  %79 = load i64, ptr %6, align 8, !tbaa !9
  %80 = trunc i64 %79 to i32
  %81 = sdiv i32 %80, 3
  store i32 %81, ptr %8, align 4, !tbaa !22
  store i32 0, ptr %9, align 4, !tbaa !22
  %82 = getelementptr inbounds [256 x %struct.png_color_struct], ptr %7, i64 0, i64 0
  store ptr %82, ptr %10, align 8, !tbaa !5
  br label %83

83:                                               ; preds = %102, %78
  %84 = load i32, ptr %9, align 4, !tbaa !22
  %85 = load i32, ptr %8, align 4, !tbaa !22
  %86 = icmp slt i32 %84, %85
  br i1 %86, label %87, label %107

87:                                               ; preds = %83
  call void @llvm.lifetime.start.p0(i64 3, ptr %12) #3
  %88 = load ptr, ptr %4, align 8, !tbaa !5
  %89 = getelementptr inbounds [3 x i8], ptr %12, i64 0, i64 0
  call void @png_crc_read(ptr noundef %88, ptr noundef %89, i64 noundef 3)
  %90 = getelementptr inbounds [3 x i8], ptr %12, i64 0, i64 0
  %91 = load i8, ptr %90, align 1, !tbaa !23
  %92 = load ptr, ptr %10, align 8, !tbaa !5
  %93 = getelementptr inbounds %struct.png_color_struct, ptr %92, i32 0, i32 0
  store i8 %91, ptr %93, align 1, !tbaa !24
  %94 = getelementptr inbounds [3 x i8], ptr %12, i64 0, i64 1
  %95 = load i8, ptr %94, align 1, !tbaa !23
  %96 = load ptr, ptr %10, align 8, !tbaa !5
  %97 = getelementptr inbounds %struct.png_color_struct, ptr %96, i32 0, i32 1
  store i8 %95, ptr %97, align 1, !tbaa !26
  %98 = getelementptr inbounds [3 x i8], ptr %12, i64 0, i64 2
  %99 = load i8, ptr %98, align 1, !tbaa !23
  %100 = load ptr, ptr %10, align 8, !tbaa !5
  %101 = getelementptr inbounds %struct.png_color_struct, ptr %100, i32 0, i32 2
  store i8 %99, ptr %101, align 1, !tbaa !27
  call void @llvm.lifetime.end.p0(i64 3, ptr %12) #3
  br label %102

102:                                              ; preds = %87
  %103 = load i32, ptr %9, align 4, !tbaa !22
  %104 = add nsw i32 %103, 1
  store i32 %104, ptr %9, align 4, !tbaa !22
  %105 = load ptr, ptr %10, align 8, !tbaa !5
  %106 = getelementptr inbounds %struct.png_color_struct, ptr %105, i32 1
  store ptr %106, ptr %10, align 8, !tbaa !5
  br label %83, !llvm.loop !28

107:                                              ; preds = %83
  %108 = load ptr, ptr %4, align 8, !tbaa !5
  %109 = call i32 @png_crc_finish(ptr noundef %108, i64 noundef 0)
  %110 = load ptr, ptr %4, align 8, !tbaa !5
  %111 = load ptr, ptr %5, align 8, !tbaa !5
  %112 = getelementptr inbounds [256 x %struct.png_color_struct], ptr %7, i64 0, i64 0
  %113 = load i32, ptr %8, align 4, !tbaa !22
  call void @png_set_PLTE(ptr noundef %110, ptr noundef %111, ptr noundef %112, i32 noundef %113)
  %114 = load ptr, ptr %4, align 8, !tbaa !5
  %115 = getelementptr inbounds %struct.png_struct_def, ptr %114, i32 0, i32 49
  %116 = load i8, ptr %115, align 2, !tbaa !21
  %117 = zext i8 %116 to i32
  %118 = icmp eq i32 %117, 3
  br i1 %118, label %119, label %160

119:                                              ; preds = %107
  %120 = load ptr, ptr %5, align 8, !tbaa !5
  %121 = icmp ne ptr %120, null
  br i1 %121, label %122, label %159

122:                                              ; preds = %119
  %123 = load ptr, ptr %5, align 8, !tbaa !5
  %124 = getelementptr inbounds %struct.png_info_struct, ptr %123, i32 0, i32 2
  %125 = load i64, ptr %124, align 8, !tbaa !30
  %126 = and i64 %125, 16
  %127 = icmp ne i64 %126, 0
  br i1 %127, label %128, label %159

128:                                              ; preds = %122
  %129 = load ptr, ptr %4, align 8, !tbaa !5
  %130 = getelementptr inbounds %struct.png_struct_def, ptr %129, i32 0, i32 42
  %131 = load i16, ptr %130, align 2, !tbaa !34
  %132 = zext i16 %131 to i32
  %133 = load i32, ptr %8, align 4, !tbaa !22
  %134 = trunc i32 %133 to i16
  %135 = zext i16 %134 to i32
  %136 = icmp sgt i32 %132, %135
  br i1 %136, label %137, label %143

137:                                              ; preds = %128
  %138 = load ptr, ptr %4, align 8, !tbaa !5
  call void @png_warning(ptr noundef %138, ptr noundef @.str.17)
  %139 = load i32, ptr %8, align 4, !tbaa !22
  %140 = trunc i32 %139 to i16
  %141 = load ptr, ptr %4, align 8, !tbaa !5
  %142 = getelementptr inbounds %struct.png_struct_def, ptr %141, i32 0, i32 42
  store i16 %140, ptr %142, align 2, !tbaa !34
  br label %143

143:                                              ; preds = %137, %128
  %144 = load ptr, ptr %5, align 8, !tbaa !5
  %145 = getelementptr inbounds %struct.png_info_struct, ptr %144, i32 0, i32 6
  %146 = load i16, ptr %145, align 2, !tbaa !35
  %147 = zext i16 %146 to i32
  %148 = load i32, ptr %8, align 4, !tbaa !22
  %149 = trunc i32 %148 to i16
  %150 = zext i16 %149 to i32
  %151 = icmp sgt i32 %147, %150
  br i1 %151, label %152, label %158

152:                                              ; preds = %143
  %153 = load ptr, ptr %4, align 8, !tbaa !5
  call void @png_warning(ptr noundef %153, ptr noundef @.str.18)
  %154 = load i32, ptr %8, align 4, !tbaa !22
  %155 = trunc i32 %154 to i16
  %156 = load ptr, ptr %5, align 8, !tbaa !5
  %157 = getelementptr inbounds %struct.png_info_struct, ptr %156, i32 0, i32 6
  store i16 %155, ptr %157, align 2, !tbaa !35
  br label %158

158:                                              ; preds = %152, %143
  br label %159

159:                                              ; preds = %158, %122, %119
  br label %160

160:                                              ; preds = %159, %107
  store i32 0, ptr %11, align 4
  br label %161

161:                                              ; preds = %160, %70, %52, %26
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #3
  call void @llvm.lifetime.end.p0(i64 768, ptr %7) #3
  %162 = load i32, ptr %11, align 4
  switch i32 %162, label %164 [
    i32 0, label %163
    i32 1, label %163
  ]

163:                                              ; preds = %161, %161
  ret void

164:                                              ; preds = %161
  unreachable
}

declare void @png_set_PLTE(ptr noundef, ptr noundef, ptr noundef, i32 noundef) #1

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

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"long", !7, i64 0}
!11 = !{!12, !10, i64 280}
!12 = !{!"png_struct_def", !7, i64 0, !6, i64 200, !6, i64 208, !6, i64 216, !6, i64 224, !6, i64 232, !6, i64 240, !6, i64 248, !6, i64 256, !6, i64 264, !7, i64 272, !7, i64 273, !10, i64 280, !10, i64 288, !10, i64 296, !13, i64 304, !6, i64 416, !10, i64 424, !14, i64 432, !14, i64 436, !14, i64 440, !14, i64 444, !14, i64 448, !10, i64 456, !10, i64 464, !10, i64 472, !10, i64 480, !10, i64 488, !10, i64 496, !10, i64 504, !10, i64 512, !6, i64 520, !6, i64 528, !6, i64 536, !6, i64 544, !6, i64 552, !6, i64 560, !15, i64 568, !10, i64 592, !10, i64 600, !6, i64 608, !16, i64 616, !16, i64 618, !7, i64 620, !7, i64 625, !7, i64 626, !7, i64 627, !7, i64 628, !7, i64 629, !7, i64 630, !7, i64 631, !7, i64 632, !7, i64 633, !7, i64 634, !7, i64 635, !7, i64 636, !16, i64 638, !7, i64 640, !17, i64 644, !18, i64 648, !18, i64 658, !6, i64 672, !10, i64 680, !10, i64 688, !14, i64 696, !17, i64 700, !17, i64 704, !6, i64 712, !6, i64 720, !6, i64 728, !6, i64 736, !6, i64 744, !6, i64 752, !19, i64 760, !19, i64 765, !6, i64 776, !18, i64 784, !6, i64 800, !6, i64 808, !6, i64 816, !6, i64 824, !6, i64 832, !6, i64 840, !6, i64 848, !6, i64 856, !6, i64 864, !10, i64 872, !10, i64 880, !10, i64 888, !10, i64 896, !10, i64 904, !10, i64 912, !14, i64 920, !14, i64 924, !10, i64 928, !10, i64 936, !6, i64 944, !6, i64 952, !6, i64 960, !6, i64 968, !6, i64 976, !7, i64 984, !7, i64 985, !6, i64 992, !6, i64 1000, !6, i64 1008, !6, i64 1016, !6, i64 1024, !6, i64 1032, !10, i64 1040, !6, i64 1048, !6, i64 1056, !14, i64 1064, !6, i64 1072, !7, i64 1080, !16, i64 1082, !16, i64 1084, !16, i64 1086, !10, i64 1088, !10, i64 1096, !7, i64 1104, !7, i64 1105, !10, i64 1112, !10, i64 1120, !6, i64 1128, !6, i64 1136, !6, i64 1144, !6, i64 1152, !6, i64 1160, !6, i64 1168, !6, i64 1176, !7, i64 1184, !10, i64 1192, !10, i64 1200, !20, i64 1208, !10, i64 1240, !10, i64 1248, !6, i64 1256}
!13 = !{!"z_stream_s", !6, i64 0, !14, i64 8, !10, i64 16, !6, i64 24, !14, i64 32, !10, i64 40, !6, i64 48, !6, i64 56, !6, i64 64, !6, i64 72, !6, i64 80, !14, i64 88, !10, i64 96, !10, i64 104}
!14 = !{!"int", !7, i64 0}
!15 = !{!"png_row_info_struct", !10, i64 0, !10, i64 8, !7, i64 16, !7, i64 17, !7, i64 18, !7, i64 19}
!16 = !{!"short", !7, i64 0}
!17 = !{!"float", !7, i64 0}
!18 = !{!"png_color_16_struct", !7, i64 0, !16, i64 2, !16, i64 4, !16, i64 6, !16, i64 8}
!19 = !{!"png_color_8_struct", !7, i64 0, !7, i64 1, !7, i64 2, !7, i64 3, !7, i64 4}
!20 = !{!"png_unknown_chunk_t", !7, i64 0, !6, i64 8, !10, i64 16, !7, i64 24}
!21 = !{!12, !7, i64 630}
!22 = !{!14, !14, i64 0}
!23 = !{!7, !7, i64 0}
!24 = !{!25, !7, i64 0}
!25 = !{!"png_color_struct", !7, i64 0, !7, i64 1, !7, i64 2}
!26 = !{!25, !7, i64 1}
!27 = !{!25, !7, i64 2}
!28 = distinct !{!28, !29}
!29 = !{!"llvm.loop.mustprogress"}
!30 = !{!31, !10, i64 16}
!31 = !{!"png_info_struct", !10, i64 0, !10, i64 8, !10, i64 16, !10, i64 24, !6, i64 32, !16, i64 40, !16, i64 42, !7, i64 44, !7, i64 45, !7, i64 46, !7, i64 47, !7, i64 48, !7, i64 49, !7, i64 50, !7, i64 51, !7, i64 52, !17, i64 60, !7, i64 64, !14, i64 68, !14, i64 72, !6, i64 80, !32, i64 88, !19, i64 96, !6, i64 104, !18, i64 112, !18, i64 122, !10, i64 136, !10, i64 144, !7, i64 152, !10, i64 160, !10, i64 168, !7, i64 176, !6, i64 184, !17, i64 192, !17, i64 196, !17, i64 200, !17, i64 204, !17, i64 208, !17, i64 212, !17, i64 216, !17, i64 220, !6, i64 224, !10, i64 232, !10, i64 240, !6, i64 248, !6, i64 256, !7, i64 264, !7, i64 265, !10, i64 272, !6, i64 280, !10, i64 288, !6, i64 296, !6, i64 304, !10, i64 312, !7, i64 320, !6, i64 328, !10, i64 336, !7, i64 344, !33, i64 352, !33, i64 360, !6, i64 368, !6, i64 376, !6, i64 384, !10, i64 392, !10, i64 400, !10, i64 408, !10, i64 416, !10, i64 424, !10, i64 432, !10, i64 440, !10, i64 448, !10, i64 456}
!32 = !{!"png_time_struct", !16, i64 0, !7, i64 2, !7, i64 3, !7, i64 4, !7, i64 5, !7, i64 6}
!33 = !{!"double", !7, i64 0}
!34 = !{!12, !16, i64 618}
!35 = !{!31, !16, i64 42}


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

%struct.png_color_struct = type { i8, i8, i8 }

@.str.12 = external hidden unnamed_addr constant [25 x i8], align 1
@.str.13 = external hidden unnamed_addr constant [24 x i8], align 1
@.str.14 = external hidden unnamed_addr constant [21 x i8], align 1
@.str.15 = external hidden unnamed_addr constant [37 x i8], align 1
@.str.16 = external hidden unnamed_addr constant [22 x i8], align 1
@.str.17 = external hidden unnamed_addr constant [39 x i8], align 1
@.str.18 = external hidden unnamed_addr constant [44 x i8], align 1

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

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

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

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

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

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

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

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

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

13:                                               ; preds = %9
  %14 = and i64 %7, 2
  %.not51 = icmp eq i64 %14, 0
  br i1 %.not51, label %15, label %.sink.split

.sink.split:                                      ; preds = %13, %3
  %.str.14.sink = phi ptr [ @.str.12, %3 ], [ @.str.14, %13 ]
  tail call void @png_error(ptr noundef nonnull %0, ptr noundef nonnull %.str.14.sink) #3
  br label %15

15:                                               ; preds = %.sink.split, %13
  %16 = load i64, ptr %6, align 8, !tbaa !5
  %17 = or i64 %16, 2
  store i64 %17, ptr %6, align 8, !tbaa !5
  %18 = getelementptr inbounds i8, ptr %0, i64 630
  %19 = load i8, ptr %18, align 2, !tbaa !19
  %20 = and i8 %19, 2
  %.not52 = icmp eq i8 %20, 0
  br i1 %.not52, label %21, label %23

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

23:                                               ; preds = %15
  %24 = icmp ult i64 %2, 769
  %25 = urem i64 %2, 3
  %.not53 = icmp eq i64 %25, 0
  %or.cond56 = and i1 %24, %.not53
  br i1 %or.cond56, label %30, label %26

26:                                               ; preds = %23
  %.not54 = icmp eq i8 %19, 3
  br i1 %.not54, label %29, label %27

27:                                               ; preds = %26
  tail call void @png_warning(ptr noundef nonnull %0, ptr noundef nonnull @.str.16) #3
  %28 = tail call i32 @png_crc_finish(ptr noundef nonnull %0, i64 noundef %2)
  br label %66

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

30:                                               ; preds = %23, %29
  %31 = trunc i64 %2 to i32
  %32 = sdiv i32 %31, 3
  %33 = icmp sgt i32 %31, 2
  br i1 %33, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %30
  %34 = getelementptr inbounds i8, ptr %5, i64 1
  %35 = getelementptr inbounds i8, ptr %5, i64 2
  br label %36

36:                                               ; preds = %.lr.ph, %36
  %.058 = phi ptr [ %4, %.lr.ph ], [ %43, %36 ]
  %.04657 = phi i32 [ 0, %.lr.ph ], [ %42, %36 ]
  call void @llvm.lifetime.start.p0(i64 3, ptr nonnull %5) #3
  call void @png_crc_read(ptr noundef %0, ptr noundef nonnull %5, i64 noundef 3)
  %37 = load i8, ptr %5, align 1, !tbaa !20
  store i8 %37, ptr %.058, align 1, !tbaa !21
  %38 = load i8, ptr %34, align 1, !tbaa !20
  %39 = getelementptr inbounds i8, ptr %.058, i64 1
  store i8 %38, ptr %39, align 1, !tbaa !23
  %40 = load i8, ptr %35, align 1, !tbaa !20
  %41 = getelementptr inbounds i8, ptr %.058, i64 2
  store i8 %40, ptr %41, align 1, !tbaa !24
  call void @llvm.lifetime.end.p0(i64 3, ptr nonnull %5) #3
  %42 = add nuw nsw i32 %.04657, 1
  %43 = getelementptr inbounds i8, ptr %.058, i64 3
  %exitcond.not = icmp eq i32 %42, %32
  br i1 %exitcond.not, label %._crit_edge, label %36, !llvm.loop !25

._crit_edge:                                      ; preds = %36, %30
  %44 = call i32 @png_crc_finish(ptr noundef %0, i64 noundef 0)
  call void @png_set_PLTE(ptr noundef %0, ptr noundef %1, ptr noundef nonnull %4, i32 noundef %32) #3
  %45 = load i8, ptr %18, align 2, !tbaa !19
  %46 = icmp eq i8 %45, 3
  %47 = icmp ne ptr %1, null
  %or.cond = and i1 %47, %46
  br i1 %or.cond, label %48, label %66

48:                                               ; preds = %._crit_edge
  %49 = getelementptr inbounds i8, ptr %1, i64 16
  %50 = load i64, ptr %49, align 8, !tbaa !27
  %51 = and i64 %50, 16
  %.not55 = icmp eq i64 %51, 0
  br i1 %.not55, label %66, label %52

52:                                               ; preds = %48
  %53 = getelementptr inbounds i8, ptr %0, i64 618
  %54 = load i16, ptr %53, align 2, !tbaa !31
  %55 = zext i16 %54 to i32
  %56 = trunc i32 %32 to i16
  %57 = and i32 %32, 65535
  %58 = icmp ult i32 %57, %55
  br i1 %58, label %59, label %60

59:                                               ; preds = %52
  call void @png_warning(ptr noundef nonnull %0, ptr noundef nonnull @.str.17) #3
  store i16 %56, ptr %53, align 2, !tbaa !31
  br label %60

60:                                               ; preds = %59, %52
  %61 = getelementptr inbounds i8, ptr %1, i64 42
  %62 = load i16, ptr %61, align 2, !tbaa !32
  %63 = zext i16 %62 to i32
  %64 = icmp ult i32 %57, %63
  br i1 %64, label %65, label %66

65:                                               ; preds = %60
  call void @png_warning(ptr noundef nonnull %0, ptr noundef nonnull @.str.18) #3
  store i16 %56, ptr %61, align 2, !tbaa !32
  br label %66

66:                                               ; preds = %._crit_edge, %60, %65, %48, %27, %21, %11
  call void @llvm.lifetime.end.p0(i64 768, ptr nonnull %4) #3
  ret void
}

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

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

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !10, i64 280}
!6 = !{!"png_struct_def", !7, i64 0, !9, i64 200, !9, i64 208, !9, i64 216, !9, i64 224, !9, i64 232, !9, i64 240, !9, i64 248, !9, i64 256, !9, i64 264, !7, i64 272, !7, i64 273, !10, i64 280, !10, i64 288, !10, i64 296, !11, i64 304, !9, i64 416, !10, i64 424, !12, i64 432, !12, i64 436, !12, i64 440, !12, i64 444, !12, i64 448, !10, i64 456, !10, i64 464, !10, i64 472, !10, i64 480, !10, i64 488, !10, i64 496, !10, i64 504, !10, i64 512, !9, i64 520, !9, i64 528, !9, i64 536, !9, i64 544, !9, i64 552, !9, i64 560, !13, i64 568, !10, i64 592, !10, i64 600, !9, i64 608, !14, i64 616, !14, i64 618, !7, i64 620, !7, i64 625, !7, i64 626, !7, i64 627, !7, i64 628, !7, i64 629, !7, i64 630, !7, i64 631, !7, i64 632, !7, i64 633, !7, i64 634, !7, i64 635, !7, i64 636, !14, i64 638, !7, i64 640, !15, i64 644, !16, i64 648, !16, i64 658, !9, i64 672, !10, i64 680, !10, i64 688, !12, i64 696, !15, i64 700, !15, i64 704, !9, i64 712, !9, i64 720, !9, i64 728, !9, i64 736, !9, i64 744, !9, i64 752, !17, i64 760, !17, i64 765, !9, i64 776, !16, i64 784, !9, i64 800, !9, i64 808, !9, i64 816, !9, i64 824, !9, i64 832, !9, i64 840, !9, i64 848, !9, i64 856, !9, i64 864, !10, i64 872, !10, i64 880, !10, i64 888, !10, i64 896, !10, i64 904, !10, i64 912, !12, i64 920, !12, i64 924, !10, i64 928, !10, i64 936, !9, i64 944, !9, i64 952, !9, i64 960, !9, i64 968, !9, i64 976, !7, i64 984, !7, i64 985, !9, i64 992, !9, i64 1000, !9, i64 1008, !9, i64 1016, !9, i64 1024, !9, i64 1032, !10, i64 1040, !9, i64 1048, !9, i64 1056, !12, i64 1064, !9, i64 1072, !7, i64 1080, !14, i64 1082, !14, i64 1084, !14, i64 1086, !10, i64 1088, !10, i64 1096, !7, i64 1104, !7, i64 1105, !10, i64 1112, !10, i64 1120, !9, i64 1128, !9, i64 1136, !9, i64 1144, !9, i64 1152, !9, i64 1160, !9, i64 1168, !9, i64 1176, !7, i64 1184, !10, i64 1192, !10, i64 1200, !18, i64 1208, !10, i64 1240, !10, i64 1248, !9, i64 1256}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!"any pointer", !7, i64 0}
!10 = !{!"long", !7, i64 0}
!11 = !{!"z_stream_s", !9, i64 0, !12, i64 8, !10, i64 16, !9, i64 24, !12, i64 32, !10, i64 40, !9, i64 48, !9, i64 56, !9, i64 64, !9, i64 72, !9, i64 80, !12, i64 88, !10, i64 96, !10, i64 104}
!12 = !{!"int", !7, i64 0}
!13 = !{!"png_row_info_struct", !10, i64 0, !10, i64 8, !7, i64 16, !7, i64 17, !7, i64 18, !7, i64 19}
!14 = !{!"short", !7, i64 0}
!15 = !{!"float", !7, i64 0}
!16 = !{!"png_color_16_struct", !7, i64 0, !14, i64 2, !14, i64 4, !14, i64 6, !14, i64 8}
!17 = !{!"png_color_8_struct", !7, i64 0, !7, i64 1, !7, i64 2, !7, i64 3, !7, i64 4}
!18 = !{!"png_unknown_chunk_t", !7, i64 0, !9, i64 8, !10, i64 16, !7, i64 24}
!19 = !{!6, !7, i64 630}
!20 = !{!7, !7, i64 0}
!21 = !{!22, !7, i64 0}
!22 = !{!"png_color_struct", !7, i64 0, !7, i64 1, !7, i64 2}
!23 = !{!22, !7, i64 1}
!24 = !{!22, !7, i64 2}
!25 = distinct !{!25, !26}
!26 = !{!"llvm.loop.mustprogress"}
!27 = !{!28, !10, i64 16}
!28 = !{!"png_info_struct", !10, i64 0, !10, i64 8, !10, i64 16, !10, i64 24, !9, i64 32, !14, i64 40, !14, i64 42, !7, i64 44, !7, i64 45, !7, i64 46, !7, i64 47, !7, i64 48, !7, i64 49, !7, i64 50, !7, i64 51, !7, i64 52, !15, i64 60, !7, i64 64, !12, i64 68, !12, i64 72, !9, i64 80, !29, i64 88, !17, i64 96, !9, i64 104, !16, i64 112, !16, i64 122, !10, i64 136, !10, i64 144, !7, i64 152, !10, i64 160, !10, i64 168, !7, i64 176, !9, i64 184, !15, i64 192, !15, i64 196, !15, i64 200, !15, i64 204, !15, i64 208, !15, i64 212, !15, i64 216, !15, i64 220, !9, i64 224, !10, i64 232, !10, i64 240, !9, i64 248, !9, i64 256, !7, i64 264, !7, i64 265, !10, i64 272, !9, i64 280, !10, i64 288, !9, i64 296, !9, i64 304, !10, i64 312, !7, i64 320, !9, i64 328, !10, i64 336, !7, i64 344, !30, i64 352, !30, i64 360, !9, i64 368, !9, i64 376, !9, i64 384, !10, i64 392, !10, i64 400, !10, i64 408, !10, i64 416, !10, i64 424, !10, i64 432, !10, i64 440, !10, i64 448, !10, i64 456}
!29 = !{!"png_time_struct", !14, i64 0, !7, i64 2, !7, i64 3, !7, i64 4, !7, i64 5, !7, i64 6}
!30 = !{!"double", !7, i64 0}
!31 = !{!6, !14, i64 618}
!32 = !{!28, !14, i64 42}


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