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

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

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

@.str.63 = external hidden unnamed_addr constant [25 x i8], align 1
@.str.64 = external hidden unnamed_addr constant [24 x i8], align 1
@.str.65 = external hidden unnamed_addr constant [21 x i8], align 1
@.str.66 = external hidden unnamed_addr constant [28 x i8], align 1
@.str.67 = external hidden unnamed_addr constant [25 x i8], align 1
@.str.68 = external hidden unnamed_addr constant [23 x i8], align 1
@.str.69 = external hidden unnamed_addr constant [42 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 zeroext i16 @png_get_uint_16(ptr noundef) #2

; 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_tRNS(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 i8], align 16
  %8 = alloca i32, align 4
  %9 = alloca [2 x i8], align 1
  %10 = alloca [6 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 256, ptr %7) #3
  %11 = load ptr, ptr %4, align 8, !tbaa !5
  %12 = getelementptr inbounds %struct.png_struct_def, ptr %11, i32 0, i32 12
  %13 = load i64, ptr %12, align 8, !tbaa !11
  %14 = and i64 %13, 1
  %15 = icmp ne i64 %14, 0
  br i1 %15, label %18, label %16

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

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

24:                                               ; preds = %18
  %25 = load ptr, ptr %4, align 8, !tbaa !5
  call void @png_warning(ptr noundef %25, ptr noundef @.str.64)
  %26 = load ptr, ptr %4, align 8, !tbaa !5
  %27 = load i64, ptr %6, align 8, !tbaa !9
  %28 = call i32 @png_crc_finish(ptr noundef %26, i64 noundef %27)
  store i32 1, ptr %8, align 4
  br label %181

29:                                               ; preds = %18
  %30 = load ptr, ptr %5, align 8, !tbaa !5
  %31 = icmp ne ptr %30, null
  br i1 %31, label %32, label %43

32:                                               ; preds = %29
  %33 = load ptr, ptr %5, align 8, !tbaa !5
  %34 = getelementptr inbounds %struct.png_info_struct, ptr %33, i32 0, i32 2
  %35 = load i64, ptr %34, align 8, !tbaa !21
  %36 = and i64 %35, 16
  %37 = icmp ne i64 %36, 0
  br i1 %37, label %38, label %43

38:                                               ; preds = %32
  %39 = load ptr, ptr %4, align 8, !tbaa !5
  call void @png_warning(ptr noundef %39, ptr noundef @.str.65)
  %40 = load ptr, ptr %4, align 8, !tbaa !5
  %41 = load i64, ptr %6, align 8, !tbaa !9
  %42 = call i32 @png_crc_finish(ptr noundef %40, i64 noundef %41)
  store i32 1, ptr %8, align 4
  br label %181

43:                                               ; preds = %32, %29
  br label %44

44:                                               ; preds = %43
  br label %45

45:                                               ; preds = %44, %16
  %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 !25
  %49 = zext i8 %48 to i32
  %50 = icmp eq i32 %49, 0
  br i1 %50, label %51, label %72

51:                                               ; preds = %45
  call void @llvm.lifetime.start.p0(i64 2, ptr %9) #3
  %52 = load i64, ptr %6, align 8, !tbaa !9
  %53 = icmp ne i64 %52, 2
  br i1 %53, label %54, label %59

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

59:                                               ; preds = %51
  %60 = load ptr, ptr %4, align 8, !tbaa !5
  %61 = getelementptr inbounds [2 x i8], ptr %9, i64 0, i64 0
  call void @png_crc_read(ptr noundef %60, ptr noundef %61, i64 noundef 2)
  %62 = load ptr, ptr %4, align 8, !tbaa !5
  %63 = getelementptr inbounds %struct.png_struct_def, ptr %62, i32 0, i32 42
  store i16 1, ptr %63, align 2, !tbaa !26
  %64 = getelementptr inbounds [2 x i8], ptr %9, i64 0, i64 0
  %65 = call zeroext i16 @png_get_uint_16(ptr noundef %64)
  %66 = load ptr, ptr %4, align 8, !tbaa !5
  %67 = getelementptr inbounds %struct.png_struct_def, ptr %66, i32 0, i32 76
  %68 = getelementptr inbounds %struct.png_color_16_struct, ptr %67, i32 0, i32 4
  store i16 %65, ptr %68, align 8, !tbaa !27
  store i32 0, ptr %8, align 4
  br label %69

69:                                               ; preds = %59, %54
  call void @llvm.lifetime.end.p0(i64 2, ptr %9) #3
  %70 = load i32, ptr %8, align 4
  switch i32 %70, label %181 [
    i32 0, label %71
  ]

71:                                               ; preds = %69
  br label %164

72:                                               ; preds = %45
  %73 = load ptr, ptr %4, align 8, !tbaa !5
  %74 = getelementptr inbounds %struct.png_struct_def, ptr %73, i32 0, i32 49
  %75 = load i8, ptr %74, align 2, !tbaa !25
  %76 = zext i8 %75 to i32
  %77 = icmp eq i32 %76, 2
  br i1 %77, label %78, label %112

78:                                               ; preds = %72
  call void @llvm.lifetime.start.p0(i64 6, ptr %10) #3
  %79 = load i64, ptr %6, align 8, !tbaa !9
  %80 = icmp ne i64 %79, 6
  br i1 %80, label %81, label %86

81:                                               ; preds = %78
  %82 = load ptr, ptr %4, align 8, !tbaa !5
  call void @png_warning(ptr noundef %82, ptr noundef @.str.66)
  %83 = load ptr, ptr %4, align 8, !tbaa !5
  %84 = load i64, ptr %6, align 8, !tbaa !9
  %85 = call i32 @png_crc_finish(ptr noundef %83, i64 noundef %84)
  store i32 1, ptr %8, align 4
  br label %109

86:                                               ; preds = %78
  %87 = load ptr, ptr %4, align 8, !tbaa !5
  %88 = getelementptr inbounds [6 x i8], ptr %10, i64 0, i64 0
  %89 = load i64, ptr %6, align 8, !tbaa !9
  call void @png_crc_read(ptr noundef %87, ptr noundef %88, i64 noundef %89)
  %90 = load ptr, ptr %4, align 8, !tbaa !5
  %91 = getelementptr inbounds %struct.png_struct_def, ptr %90, i32 0, i32 42
  store i16 1, ptr %91, align 2, !tbaa !26
  %92 = getelementptr inbounds [6 x i8], ptr %10, i64 0, i64 0
  %93 = call zeroext i16 @png_get_uint_16(ptr noundef %92)
  %94 = load ptr, ptr %4, align 8, !tbaa !5
  %95 = getelementptr inbounds %struct.png_struct_def, ptr %94, i32 0, i32 76
  %96 = getelementptr inbounds %struct.png_color_16_struct, ptr %95, i32 0, i32 1
  store i16 %93, ptr %96, align 2, !tbaa !28
  %97 = getelementptr inbounds [6 x i8], ptr %10, i64 0, i64 0
  %98 = getelementptr inbounds i8, ptr %97, i64 2
  %99 = call zeroext i16 @png_get_uint_16(ptr noundef %98)
  %100 = load ptr, ptr %4, align 8, !tbaa !5
  %101 = getelementptr inbounds %struct.png_struct_def, ptr %100, i32 0, i32 76
  %102 = getelementptr inbounds %struct.png_color_16_struct, ptr %101, i32 0, i32 2
  store i16 %99, ptr %102, align 4, !tbaa !29
  %103 = getelementptr inbounds [6 x i8], ptr %10, i64 0, i64 0
  %104 = getelementptr inbounds i8, ptr %103, i64 4
  %105 = call zeroext i16 @png_get_uint_16(ptr noundef %104)
  %106 = load ptr, ptr %4, align 8, !tbaa !5
  %107 = getelementptr inbounds %struct.png_struct_def, ptr %106, i32 0, i32 76
  %108 = getelementptr inbounds %struct.png_color_16_struct, ptr %107, i32 0, i32 3
  store i16 %105, ptr %108, align 2, !tbaa !30
  store i32 0, ptr %8, align 4
  br label %109

109:                                              ; preds = %86, %81
  call void @llvm.lifetime.end.p0(i64 6, ptr %10) #3
  %110 = load i32, ptr %8, align 4
  switch i32 %110, label %181 [
    i32 0, label %111
  ]

111:                                              ; preds = %109
  br label %163

112:                                              ; preds = %72
  %113 = load ptr, ptr %4, align 8, !tbaa !5
  %114 = getelementptr inbounds %struct.png_struct_def, ptr %113, i32 0, i32 49
  %115 = load i8, ptr %114, align 2, !tbaa !25
  %116 = zext i8 %115 to i32
  %117 = icmp eq i32 %116, 3
  br i1 %117, label %118, label %157

118:                                              ; preds = %112
  %119 = load ptr, ptr %4, align 8, !tbaa !5
  %120 = getelementptr inbounds %struct.png_struct_def, ptr %119, i32 0, i32 12
  %121 = load i64, ptr %120, align 8, !tbaa !11
  %122 = and i64 %121, 2
  %123 = icmp ne i64 %122, 0
  br i1 %123, label %126, label %124

124:                                              ; preds = %118
  %125 = load ptr, ptr %4, align 8, !tbaa !5
  call void @png_warning(ptr noundef %125, ptr noundef @.str.67)
  br label %126

126:                                              ; preds = %124, %118
  %127 = load i64, ptr %6, align 8, !tbaa !9
  %128 = load ptr, ptr %4, align 8, !tbaa !5
  %129 = getelementptr inbounds %struct.png_struct_def, ptr %128, i32 0, i32 41
  %130 = load i16, ptr %129, align 8, !tbaa !31
  %131 = zext i16 %130 to i64
  %132 = icmp ugt i64 %127, %131
  br i1 %132, label %136, label %133

133:                                              ; preds = %126
  %134 = load i64, ptr %6, align 8, !tbaa !9
  %135 = icmp ugt i64 %134, 256
  br i1 %135, label %136, label %141

136:                                              ; preds = %133, %126
  %137 = load ptr, ptr %4, align 8, !tbaa !5
  call void @png_warning(ptr noundef %137, ptr noundef @.str.66)
  %138 = load ptr, ptr %4, align 8, !tbaa !5
  %139 = load i64, ptr %6, align 8, !tbaa !9
  %140 = call i32 @png_crc_finish(ptr noundef %138, i64 noundef %139)
  store i32 1, ptr %8, align 4
  br label %181

141:                                              ; preds = %133
  %142 = load i64, ptr %6, align 8, !tbaa !9
  %143 = icmp eq i64 %142, 0
  br i1 %143, label %144, label %149

144:                                              ; preds = %141
  %145 = load ptr, ptr %4, align 8, !tbaa !5
  call void @png_warning(ptr noundef %145, ptr noundef @.str.68)
  %146 = load ptr, ptr %4, align 8, !tbaa !5
  %147 = load i64, ptr %6, align 8, !tbaa !9
  %148 = call i32 @png_crc_finish(ptr noundef %146, i64 noundef %147)
  store i32 1, ptr %8, align 4
  br label %181

149:                                              ; preds = %141
  %150 = load ptr, ptr %4, align 8, !tbaa !5
  %151 = getelementptr inbounds [256 x i8], ptr %7, i64 0, i64 0
  %152 = load i64, ptr %6, align 8, !tbaa !9
  call void @png_crc_read(ptr noundef %150, ptr noundef %151, i64 noundef %152)
  %153 = load i64, ptr %6, align 8, !tbaa !9
  %154 = trunc i64 %153 to i16
  %155 = load ptr, ptr %4, align 8, !tbaa !5
  %156 = getelementptr inbounds %struct.png_struct_def, ptr %155, i32 0, i32 42
  store i16 %154, ptr %156, align 2, !tbaa !26
  br label %162

157:                                              ; preds = %112
  %158 = load ptr, ptr %4, align 8, !tbaa !5
  call void @png_warning(ptr noundef %158, ptr noundef @.str.69)
  %159 = load ptr, ptr %4, align 8, !tbaa !5
  %160 = load i64, ptr %6, align 8, !tbaa !9
  %161 = call i32 @png_crc_finish(ptr noundef %159, i64 noundef %160)
  store i32 1, ptr %8, align 4
  br label %181

162:                                              ; preds = %149
  br label %163

163:                                              ; preds = %162, %111
  br label %164

164:                                              ; preds = %163, %71
  %165 = load ptr, ptr %4, align 8, !tbaa !5
  %166 = call i32 @png_crc_finish(ptr noundef %165, i64 noundef 0)
  %167 = icmp ne i32 %166, 0
  br i1 %167, label %168, label %171

168:                                              ; preds = %164
  %169 = load ptr, ptr %4, align 8, !tbaa !5
  %170 = getelementptr inbounds %struct.png_struct_def, ptr %169, i32 0, i32 42
  store i16 0, ptr %170, align 2, !tbaa !26
  store i32 1, ptr %8, align 4
  br label %181

171:                                              ; preds = %164
  %172 = load ptr, ptr %4, align 8, !tbaa !5
  %173 = load ptr, ptr %5, align 8, !tbaa !5
  %174 = getelementptr inbounds [256 x i8], ptr %7, i64 0, i64 0
  %175 = load ptr, ptr %4, align 8, !tbaa !5
  %176 = getelementptr inbounds %struct.png_struct_def, ptr %175, i32 0, i32 42
  %177 = load i16, ptr %176, align 2, !tbaa !26
  %178 = zext i16 %177 to i32
  %179 = load ptr, ptr %4, align 8, !tbaa !5
  %180 = getelementptr inbounds %struct.png_struct_def, ptr %179, i32 0, i32 76
  call void @png_set_tRNS(ptr noundef %172, ptr noundef %173, ptr noundef %174, i32 noundef %178, ptr noundef %180)
  store i32 0, ptr %8, align 4
  br label %181

181:                                              ; preds = %171, %168, %157, %144, %136, %109, %69, %38, %24
  call void @llvm.lifetime.end.p0(i64 256, ptr %7) #3
  %182 = load i32, ptr %8, align 4
  switch i32 %182, label %184 [
    i32 0, label %183
    i32 1, label %183
  ]

183:                                              ; preds = %181, %181
  ret void

184:                                              ; preds = %181
  unreachable
}

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

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

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

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


; 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.63 = external hidden unnamed_addr constant [25 x i8], align 1
@.str.64 = external hidden unnamed_addr constant [24 x i8], align 1
@.str.65 = external hidden unnamed_addr constant [21 x i8], align 1
@.str.66 = external hidden unnamed_addr constant [28 x i8], align 1
@.str.67 = external hidden unnamed_addr constant [25 x i8], align 1
@.str.68 = external hidden unnamed_addr constant [23 x i8], align 1
@.str.69 = external hidden unnamed_addr constant [42 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 zeroext i16 @png_get_uint_16(ptr noundef) local_unnamed_addr #2

; 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_tRNS(ptr noundef %0, ptr noundef %1, i64 noundef %2) local_unnamed_addr #2 {
  %4 = alloca [256 x i8], align 16
  %5 = alloca [2 x i8], align 1
  %6 = alloca [6 x i8], align 1
  call void @llvm.lifetime.start.p0(i64 256, ptr nonnull %4) #3
  %7 = getelementptr inbounds i8, ptr %0, i64 280
  %8 = load i64, ptr %7, align 8, !tbaa !5
  %9 = and i64 %8, 1
  %.not = icmp eq i64 %9, 0
  br i1 %.not, label %10, label %11

10:                                               ; preds = %3
  tail call void @png_error(ptr noundef nonnull %0, ptr noundef nonnull @.str.63) #3
  br label %22

11:                                               ; preds = %3
  %12 = and i64 %8, 4
  %.not63 = icmp eq i64 %12, 0
  br i1 %.not63, label %15, label %13

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

15:                                               ; preds = %11
  %.not64 = icmp eq ptr %1, null
  br i1 %.not64, label %22, label %16

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

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

22:                                               ; preds = %16, %15, %10
  %23 = getelementptr inbounds i8, ptr %0, i64 630
  %24 = load i8, ptr %23, align 2, !tbaa !23
  switch i8 %24, label %62 [
    i8 0, label %25
    i8 2, label %31
    i8 3, label %43
  ]

25:                                               ; preds = %22
  call void @llvm.lifetime.start.p0(i64 2, ptr nonnull %5) #3
  %.not68 = icmp eq i64 %2, 2
  br i1 %.not68, label %.thread, label %29

.thread:                                          ; preds = %25
  call void @png_crc_read(ptr noundef nonnull %0, ptr noundef nonnull %5, i64 noundef 2)
  %26 = getelementptr inbounds i8, ptr %0, i64 618
  store i16 1, ptr %26, align 2, !tbaa !24
  %27 = call zeroext i16 @png_get_uint_16(ptr noundef nonnull %5)
  %28 = getelementptr inbounds i8, ptr %0, i64 792
  store i16 %27, ptr %28, align 8, !tbaa !25
  call void @llvm.lifetime.end.p0(i64 2, ptr nonnull %5) #3
  br label %64

29:                                               ; preds = %25
  tail call void @png_warning(ptr noundef nonnull %0, ptr noundef nonnull @.str.66) #3
  %30 = tail call i32 @png_crc_finish(ptr noundef nonnull %0, i64 noundef %2)
  call void @llvm.lifetime.end.p0(i64 2, ptr nonnull %5) #3
  br label %72

31:                                               ; preds = %22
  call void @llvm.lifetime.start.p0(i64 6, ptr nonnull %6) #3
  %.not67 = icmp eq i64 %2, 6
  br i1 %.not67, label %.thread70, label %41

.thread70:                                        ; preds = %31
  call void @png_crc_read(ptr noundef nonnull %0, ptr noundef nonnull %6, i64 noundef 6)
  %32 = getelementptr inbounds i8, ptr %0, i64 618
  store i16 1, ptr %32, align 2, !tbaa !24
  %33 = call zeroext i16 @png_get_uint_16(ptr noundef nonnull %6)
  %34 = getelementptr inbounds i8, ptr %0, i64 786
  store i16 %33, ptr %34, align 2, !tbaa !26
  %35 = getelementptr inbounds i8, ptr %6, i64 2
  %36 = call zeroext i16 @png_get_uint_16(ptr noundef nonnull %35)
  %37 = getelementptr inbounds i8, ptr %0, i64 788
  store i16 %36, ptr %37, align 4, !tbaa !27
  %38 = getelementptr inbounds i8, ptr %6, i64 4
  %39 = call zeroext i16 @png_get_uint_16(ptr noundef nonnull %38)
  %40 = getelementptr inbounds i8, ptr %0, i64 790
  store i16 %39, ptr %40, align 2, !tbaa !28
  call void @llvm.lifetime.end.p0(i64 6, ptr nonnull %6) #3
  br label %64

41:                                               ; preds = %31
  tail call void @png_warning(ptr noundef nonnull %0, ptr noundef nonnull @.str.66) #3
  %42 = tail call i32 @png_crc_finish(ptr noundef nonnull %0, i64 noundef %2)
  call void @llvm.lifetime.end.p0(i64 6, ptr nonnull %6) #3
  br label %72

43:                                               ; preds = %22
  %44 = load i64, ptr %7, align 8, !tbaa !5
  %45 = and i64 %44, 2
  %.not66 = icmp eq i64 %45, 0
  br i1 %.not66, label %46, label %47

46:                                               ; preds = %43
  tail call void @png_warning(ptr noundef nonnull %0, ptr noundef nonnull @.str.67) #3
  br label %47

47:                                               ; preds = %46, %43
  %48 = getelementptr inbounds i8, ptr %0, i64 616
  %49 = load i16, ptr %48, align 8, !tbaa !29
  %50 = zext i16 %49 to i64
  %51 = icmp ult i64 %50, %2
  %52 = icmp ugt i64 %2, 256
  %or.cond = or i1 %52, %51
  br i1 %or.cond, label %53, label %55

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

55:                                               ; preds = %47
  %56 = icmp eq i64 %2, 0
  br i1 %56, label %57, label %59

57:                                               ; preds = %55
  tail call void @png_warning(ptr noundef nonnull %0, ptr noundef nonnull @.str.68) #3
  %58 = tail call i32 @png_crc_finish(ptr noundef nonnull %0, i64 noundef 0)
  br label %72

59:                                               ; preds = %55
  call void @png_crc_read(ptr noundef nonnull %0, ptr noundef nonnull %4, i64 noundef %2)
  %60 = trunc nuw nsw i64 %2 to i16
  %61 = getelementptr inbounds i8, ptr %0, i64 618
  store i16 %60, ptr %61, align 2, !tbaa !24
  br label %64

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

64:                                               ; preds = %.thread70, %.thread, %59
  %65 = call i32 @png_crc_finish(ptr noundef nonnull %0, i64 noundef 0)
  %.not69 = icmp eq i32 %65, 0
  %66 = getelementptr inbounds i8, ptr %0, i64 618
  br i1 %.not69, label %68, label %67

67:                                               ; preds = %64
  store i16 0, ptr %66, align 2, !tbaa !24
  br label %72

68:                                               ; preds = %64
  %69 = load i16, ptr %66, align 2, !tbaa !24
  %70 = zext i16 %69 to i32
  %71 = getelementptr inbounds i8, ptr %0, i64 784
  call void @png_set_tRNS(ptr noundef nonnull %0, ptr noundef %1, ptr noundef nonnull %4, i32 noundef %70, ptr noundef nonnull %71) #3
  br label %72

72:                                               ; preds = %41, %29, %68, %67, %62, %57, %53, %20, %13
  call void @llvm.lifetime.end.p0(i64 256, ptr nonnull %4) #3
  ret void
}

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

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

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

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


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