; 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.29 = external hidden unnamed_addr constant [25 x i8], align 1
@.str.30 = external hidden unnamed_addr constant [24 x i8], align 1
@.str.31 = external hidden unnamed_addr constant [24 x i8], align 1
@.str.32 = external hidden unnamed_addr constant [21 x i8], align 1
@.str.33 = external hidden unnamed_addr constant [28 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_sBIT(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 i64, align 8
  %8 = alloca [4 x i8], align 1
  %9 = 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
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #3
  %10 = getelementptr inbounds [4 x i8], ptr %8, i64 0, i64 3
  store i8 0, ptr %10, align 1, !tbaa !11
  %11 = getelementptr inbounds [4 x i8], ptr %8, i64 0, i64 2
  store i8 0, ptr %11, align 1, !tbaa !11
  %12 = getelementptr inbounds [4 x i8], ptr %8, i64 0, i64 1
  store i8 0, ptr %12, align 1, !tbaa !11
  %13 = getelementptr inbounds [4 x i8], ptr %8, i64 0, i64 0
  store i8 0, ptr %13, align 1, !tbaa !11
  %14 = load ptr, ptr %4, align 8, !tbaa !5
  %15 = getelementptr inbounds %struct.png_struct_def, ptr %14, i32 0, i32 12
  %16 = load i64, ptr %15, align 8, !tbaa !12
  %17 = and i64 %16, 1
  %18 = icmp ne i64 %17, 0
  br i1 %18, label %21, label %19

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

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

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

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

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

40:                                               ; preds = %38, %32
  br label %41

41:                                               ; preds = %40
  br label %42

42:                                               ; preds = %41, %19
  %43 = load ptr, ptr %5, align 8, !tbaa !5
  %44 = icmp ne ptr %43, null
  br i1 %44, label %45, label %56

45:                                               ; preds = %42
  %46 = load ptr, ptr %5, align 8, !tbaa !5
  %47 = getelementptr inbounds %struct.png_info_struct, ptr %46, i32 0, i32 2
  %48 = load i64, ptr %47, align 8, !tbaa !22
  %49 = and i64 %48, 2
  %50 = icmp ne i64 %49, 0
  br i1 %50, label %51, label %56

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

56:                                               ; preds = %45, %42
  %57 = load ptr, ptr %4, align 8, !tbaa !5
  %58 = getelementptr inbounds %struct.png_struct_def, ptr %57, i32 0, i32 49
  %59 = load i8, ptr %58, align 2, !tbaa !26
  %60 = zext i8 %59 to i32
  %61 = icmp eq i32 %60, 3
  br i1 %61, label %62, label %63

62:                                               ; preds = %56
  store i64 3, ptr %7, align 8, !tbaa !9
  br label %68

63:                                               ; preds = %56
  %64 = load ptr, ptr %4, align 8, !tbaa !5
  %65 = getelementptr inbounds %struct.png_struct_def, ptr %64, i32 0, i32 53
  %66 = load i8, ptr %65, align 2, !tbaa !27
  %67 = zext i8 %66 to i64
  store i64 %67, ptr %7, align 8, !tbaa !9
  br label %68

68:                                               ; preds = %63, %62
  %69 = load i64, ptr %6, align 8, !tbaa !9
  %70 = load i64, ptr %7, align 8, !tbaa !9
  %71 = icmp ne i64 %69, %70
  br i1 %71, label %75, label %72

72:                                               ; preds = %68
  %73 = load i64, ptr %6, align 8, !tbaa !9
  %74 = icmp ugt i64 %73, 4
  br i1 %74, label %75, label %80

75:                                               ; preds = %72, %68
  %76 = load ptr, ptr %4, align 8, !tbaa !5
  call void @png_warning(ptr noundef %76, ptr noundef @.str.33)
  %77 = load ptr, ptr %4, align 8, !tbaa !5
  %78 = load i64, ptr %6, align 8, !tbaa !9
  %79 = call i32 @png_crc_finish(ptr noundef %77, i64 noundef %78)
  store i32 1, ptr %9, align 4
  br label %147

80:                                               ; preds = %72
  %81 = load ptr, ptr %4, align 8, !tbaa !5
  %82 = getelementptr inbounds [4 x i8], ptr %8, i64 0, i64 0
  %83 = load i64, ptr %7, align 8, !tbaa !9
  call void @png_crc_read(ptr noundef %81, ptr noundef %82, i64 noundef %83)
  %84 = load ptr, ptr %4, align 8, !tbaa !5
  %85 = call i32 @png_crc_finish(ptr noundef %84, i64 noundef 0)
  %86 = icmp ne i32 %85, 0
  br i1 %86, label %87, label %88

87:                                               ; preds = %80
  store i32 1, ptr %9, align 4
  br label %147

88:                                               ; preds = %80
  %89 = load ptr, ptr %4, align 8, !tbaa !5
  %90 = getelementptr inbounds %struct.png_struct_def, ptr %89, i32 0, i32 49
  %91 = load i8, ptr %90, align 2, !tbaa !26
  %92 = zext i8 %91 to i32
  %93 = and i32 %92, 2
  %94 = icmp ne i32 %93, 0
  br i1 %94, label %95, label %116

95:                                               ; preds = %88
  %96 = getelementptr inbounds [4 x i8], ptr %8, i64 0, i64 0
  %97 = load i8, ptr %96, align 1, !tbaa !11
  %98 = load ptr, ptr %4, align 8, !tbaa !5
  %99 = getelementptr inbounds %struct.png_struct_def, ptr %98, i32 0, i32 73
  %100 = getelementptr inbounds %struct.png_color_8_struct, ptr %99, i32 0, i32 0
  store i8 %97, ptr %100, align 8, !tbaa !28
  %101 = getelementptr inbounds [4 x i8], ptr %8, i64 0, i64 1
  %102 = load i8, ptr %101, align 1, !tbaa !11
  %103 = load ptr, ptr %4, align 8, !tbaa !5
  %104 = getelementptr inbounds %struct.png_struct_def, ptr %103, i32 0, i32 73
  %105 = getelementptr inbounds %struct.png_color_8_struct, ptr %104, i32 0, i32 1
  store i8 %102, ptr %105, align 1, !tbaa !29
  %106 = getelementptr inbounds [4 x i8], ptr %8, i64 0, i64 2
  %107 = load i8, ptr %106, align 1, !tbaa !11
  %108 = load ptr, ptr %4, align 8, !tbaa !5
  %109 = getelementptr inbounds %struct.png_struct_def, ptr %108, i32 0, i32 73
  %110 = getelementptr inbounds %struct.png_color_8_struct, ptr %109, i32 0, i32 2
  store i8 %107, ptr %110, align 2, !tbaa !30
  %111 = getelementptr inbounds [4 x i8], ptr %8, i64 0, i64 3
  %112 = load i8, ptr %111, align 1, !tbaa !11
  %113 = load ptr, ptr %4, align 8, !tbaa !5
  %114 = getelementptr inbounds %struct.png_struct_def, ptr %113, i32 0, i32 73
  %115 = getelementptr inbounds %struct.png_color_8_struct, ptr %114, i32 0, i32 4
  store i8 %112, ptr %115, align 4, !tbaa !31
  br label %142

116:                                              ; preds = %88
  %117 = getelementptr inbounds [4 x i8], ptr %8, i64 0, i64 0
  %118 = load i8, ptr %117, align 1, !tbaa !11
  %119 = load ptr, ptr %4, align 8, !tbaa !5
  %120 = getelementptr inbounds %struct.png_struct_def, ptr %119, i32 0, i32 73
  %121 = getelementptr inbounds %struct.png_color_8_struct, ptr %120, i32 0, i32 3
  store i8 %118, ptr %121, align 1, !tbaa !32
  %122 = getelementptr inbounds [4 x i8], ptr %8, i64 0, i64 0
  %123 = load i8, ptr %122, align 1, !tbaa !11
  %124 = load ptr, ptr %4, align 8, !tbaa !5
  %125 = getelementptr inbounds %struct.png_struct_def, ptr %124, i32 0, i32 73
  %126 = getelementptr inbounds %struct.png_color_8_struct, ptr %125, i32 0, i32 0
  store i8 %123, ptr %126, align 8, !tbaa !28
  %127 = getelementptr inbounds [4 x i8], ptr %8, i64 0, i64 0
  %128 = load i8, ptr %127, align 1, !tbaa !11
  %129 = load ptr, ptr %4, align 8, !tbaa !5
  %130 = getelementptr inbounds %struct.png_struct_def, ptr %129, i32 0, i32 73
  %131 = getelementptr inbounds %struct.png_color_8_struct, ptr %130, i32 0, i32 1
  store i8 %128, ptr %131, align 1, !tbaa !29
  %132 = getelementptr inbounds [4 x i8], ptr %8, i64 0, i64 0
  %133 = load i8, ptr %132, align 1, !tbaa !11
  %134 = load ptr, ptr %4, align 8, !tbaa !5
  %135 = getelementptr inbounds %struct.png_struct_def, ptr %134, i32 0, i32 73
  %136 = getelementptr inbounds %struct.png_color_8_struct, ptr %135, i32 0, i32 2
  store i8 %133, ptr %136, align 2, !tbaa !30
  %137 = getelementptr inbounds [4 x i8], ptr %8, i64 0, i64 1
  %138 = load i8, ptr %137, align 1, !tbaa !11
  %139 = load ptr, ptr %4, align 8, !tbaa !5
  %140 = getelementptr inbounds %struct.png_struct_def, ptr %139, i32 0, i32 73
  %141 = getelementptr inbounds %struct.png_color_8_struct, ptr %140, i32 0, i32 4
  store i8 %138, ptr %141, align 4, !tbaa !31
  br label %142

142:                                              ; preds = %116, %95
  %143 = load ptr, ptr %4, align 8, !tbaa !5
  %144 = load ptr, ptr %5, align 8, !tbaa !5
  %145 = load ptr, ptr %4, align 8, !tbaa !5
  %146 = getelementptr inbounds %struct.png_struct_def, ptr %145, i32 0, i32 73
  call void @png_set_sBIT(ptr noundef %143, ptr noundef %144, ptr noundef %146)
  store i32 0, ptr %9, align 4
  br label %147

147:                                              ; preds = %142, %87, %75, %51, %27
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #3
  %148 = load i32, ptr %9, align 4
  switch i32 %148, label %150 [
    i32 0, label %149
    i32 1, label %149
  ]

149:                                              ; preds = %147, %147
  ret void

150:                                              ; preds = %147
  unreachable
}

declare void @png_set_sBIT(ptr noundef, ptr 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 = !{!7, !7, i64 0}
!12 = !{!13, !10, i64 280}
!13 = !{!"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, !14, i64 304, !6, i64 416, !10, i64 424, !15, i64 432, !15, i64 436, !15, i64 440, !15, i64 444, !15, 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, !16, i64 568, !10, i64 592, !10, i64 600, !6, i64 608, !17, i64 616, !17, 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, !17, i64 638, !7, i64 640, !18, i64 644, !19, i64 648, !19, i64 658, !6, i64 672, !10, i64 680, !10, i64 688, !15, i64 696, !18, i64 700, !18, i64 704, !6, i64 712, !6, i64 720, !6, i64 728, !6, i64 736, !6, i64 744, !6, i64 752, !20, i64 760, !20, i64 765, !6, i64 776, !19, 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, !15, i64 920, !15, 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, !15, i64 1064, !6, i64 1072, !7, i64 1080, !17, i64 1082, !17, i64 1084, !17, 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, !21, i64 1208, !10, i64 1240, !10, i64 1248, !6, i64 1256}
!14 = !{!"z_stream_s", !6, i64 0, !15, i64 8, !10, i64 16, !6, i64 24, !15, i64 32, !10, i64 40, !6, i64 48, !6, i64 56, !6, i64 64, !6, i64 72, !6, i64 80, !15, i64 88, !10, i64 96, !10, i64 104}
!15 = !{!"int", !7, i64 0}
!16 = !{!"png_row_info_struct", !10, i64 0, !10, i64 8, !7, i64 16, !7, i64 17, !7, i64 18, !7, i64 19}
!17 = !{!"short", !7, i64 0}
!18 = !{!"float", !7, i64 0}
!19 = !{!"png_color_16_struct", !7, i64 0, !17, i64 2, !17, i64 4, !17, i64 6, !17, i64 8}
!20 = !{!"png_color_8_struct", !7, i64 0, !7, i64 1, !7, i64 2, !7, i64 3, !7, i64 4}
!21 = !{!"png_unknown_chunk_t", !7, i64 0, !6, i64 8, !10, i64 16, !7, i64 24}
!22 = !{!23, !10, i64 16}
!23 = !{!"png_info_struct", !10, i64 0, !10, i64 8, !10, i64 16, !10, i64 24, !6, i64 32, !17, i64 40, !17, 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, !18, i64 60, !7, i64 64, !15, i64 68, !15, i64 72, !6, i64 80, !24, i64 88, !20, i64 96, !6, i64 104, !19, i64 112, !19, i64 122, !10, i64 136, !10, i64 144, !7, i64 152, !10, i64 160, !10, i64 168, !7, i64 176, !6, i64 184, !18, i64 192, !18, i64 196, !18, i64 200, !18, i64 204, !18, i64 208, !18, i64 212, !18, i64 216, !18, 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, !25, i64 352, !25, 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}
!24 = !{!"png_time_struct", !17, i64 0, !7, i64 2, !7, i64 3, !7, i64 4, !7, i64 5, !7, i64 6}
!25 = !{!"double", !7, i64 0}
!26 = !{!13, !7, i64 630}
!27 = !{!13, !7, i64 634}
!28 = !{!13, !7, i64 760}
!29 = !{!13, !7, i64 761}
!30 = !{!13, !7, i64 762}
!31 = !{!13, !7, i64 764}
!32 = !{!13, !7, i64 763}


; 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.29 = external hidden unnamed_addr constant [25 x i8], align 1
@.str.30 = external hidden unnamed_addr constant [24 x i8], align 1
@.str.31 = external hidden unnamed_addr constant [24 x i8], align 1
@.str.32 = external hidden unnamed_addr constant [21 x i8], align 1
@.str.33 = external hidden unnamed_addr constant [28 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_sBIT(ptr noundef %0, ptr noundef %1, i64 noundef %2) local_unnamed_addr #2 {
  %4 = alloca [4 x i8], align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %4) #3
  %5 = getelementptr inbounds i8, ptr %4, i64 3
  %6 = getelementptr inbounds i8, ptr %4, i64 2
  %7 = getelementptr inbounds i8, ptr %4, i64 1
  %8 = getelementptr inbounds i8, ptr %0, i64 280
  store i32 0, ptr %4, align 4
  %9 = load i64, ptr %8, align 8, !tbaa !5
  %10 = and i64 %9, 1
  %.not = icmp eq i64 %10, 0
  br i1 %.not, label %11, label %12

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

12:                                               ; preds = %3
  %13 = and i64 %9, 4
  %.not38 = icmp eq i64 %13, 0
  br i1 %.not38, label %16, label %14

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

16:                                               ; preds = %12
  %17 = and i64 %9, 2
  %.not39 = icmp eq i64 %17, 0
  br i1 %.not39, label %19, label %18

18:                                               ; preds = %16
  tail call void @png_warning(ptr noundef nonnull %0, ptr noundef nonnull @.str.31) #3
  br label %19

19:                                               ; preds = %18, %16, %11
  %.not40 = icmp eq ptr %1, null
  br i1 %.not40, label %26, label %20

20:                                               ; preds = %19
  %21 = getelementptr inbounds i8, ptr %1, i64 16
  %22 = load i64, ptr %21, align 8, !tbaa !19
  %23 = and i64 %22, 2
  %.not41 = icmp eq i64 %23, 0
  br i1 %.not41, label %26, label %24

24:                                               ; preds = %20
  tail call void @png_warning(ptr noundef nonnull %0, ptr noundef nonnull @.str.32) #3
  %25 = tail call i32 @png_crc_finish(ptr noundef nonnull %0, i64 noundef %2)
  br label %56

26:                                               ; preds = %20, %19
  %27 = getelementptr inbounds i8, ptr %0, i64 630
  %28 = load i8, ptr %27, align 2, !tbaa !23
  %29 = icmp eq i8 %28, 3
  br i1 %29, label %34, label %30

30:                                               ; preds = %26
  %31 = getelementptr inbounds i8, ptr %0, i64 634
  %32 = load i8, ptr %31, align 2, !tbaa !24
  %33 = zext i8 %32 to i64
  br label %34

34:                                               ; preds = %26, %30
  %.0 = phi i64 [ %33, %30 ], [ 3, %26 ]
  %35 = icmp ne i64 %.0, %2
  %36 = icmp ugt i64 %2, 4
  %or.cond = or i1 %36, %35
  br i1 %or.cond, label %37, label %39

37:                                               ; preds = %34
  tail call void @png_warning(ptr noundef nonnull %0, ptr noundef nonnull @.str.33) #3
  %38 = tail call i32 @png_crc_finish(ptr noundef nonnull %0, i64 noundef %2)
  br label %56

39:                                               ; preds = %34
  call void @png_crc_read(ptr noundef nonnull %0, ptr noundef nonnull %4, i64 noundef %2)
  %40 = call i32 @png_crc_finish(ptr noundef nonnull %0, i64 noundef 0)
  %.not42 = icmp eq i32 %40, 0
  br i1 %.not42, label %41, label %56

41:                                               ; preds = %39
  %42 = load i8, ptr %27, align 2, !tbaa !23
  %43 = and i8 %42, 2
  %.not43 = icmp eq i8 %43, 0
  %44 = load i8, ptr %4, align 4, !tbaa !25
  br i1 %.not43, label %48, label %45

45:                                               ; preds = %41
  %46 = load i8, ptr %7, align 1, !tbaa !25
  %47 = load i8, ptr %6, align 2, !tbaa !25
  br label %50

48:                                               ; preds = %41
  %49 = getelementptr inbounds i8, ptr %0, i64 763
  store i8 %44, ptr %49, align 1, !tbaa !26
  br label %50

50:                                               ; preds = %48, %45
  %.sink47 = phi ptr [ %7, %48 ], [ %5, %45 ]
  %.sink45 = phi i8 [ %44, %48 ], [ %46, %45 ]
  %.sink44 = phi i8 [ %44, %48 ], [ %47, %45 ]
  %51 = load i8, ptr %.sink47, align 1, !tbaa !25
  %52 = getelementptr inbounds i8, ptr %0, i64 760
  store i8 %44, ptr %52, align 8
  %53 = getelementptr inbounds i8, ptr %0, i64 761
  store i8 %.sink45, ptr %53, align 1
  %54 = getelementptr inbounds i8, ptr %0, i64 762
  store i8 %.sink44, ptr %54, align 2
  %55 = getelementptr inbounds i8, ptr %0, i64 764
  store i8 %51, ptr %55, align 4
  call void @png_set_sBIT(ptr noundef nonnull %0, ptr noundef %1, ptr noundef nonnull %52) #3
  br label %56

56:                                               ; preds = %39, %50, %37, %24, %14
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #3
  ret void
}

declare void @png_set_sBIT(ptr noundef, ptr 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, !7, i64 634}
!25 = !{!7, !7, i64 0}
!26 = !{!6, !7, i64 763}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,InferAlignmentPass,InferFunctionAttrsPass,InstCombinePass,MemCpyOptPass,MergedLoadStoreMotionPass,ReassociatePass,SROAPass,SimplifyCFGPass,TailCallElimPass