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

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

; Function Attrs: nounwind uwtable
define dso_local void @png_do_write_transformations(ptr noundef %0) #0 {
  %2 = alloca ptr, align 8
  store ptr %0, ptr %2, align 8, !tbaa !5
  %3 = load ptr, ptr %2, align 8, !tbaa !5
  %4 = icmp eq ptr %3, null
  br i1 %4, label %5, label %6

5:                                                ; preds = %1
  br label %155

6:                                                ; preds = %1
  %7 = load ptr, ptr %2, align 8, !tbaa !5
  %8 = getelementptr inbounds %struct.png_struct_def, ptr %7, i32 0, i32 14
  %9 = load i64, ptr %8, align 8, !tbaa !9
  %10 = and i64 %9, 1048576
  %11 = icmp ne i64 %10, 0
  br i1 %11, label %12, label %29

12:                                               ; preds = %6
  %13 = load ptr, ptr %2, align 8, !tbaa !5
  %14 = getelementptr inbounds %struct.png_struct_def, ptr %13, i32 0, i32 8
  %15 = load ptr, ptr %14, align 8, !tbaa !20
  %16 = icmp ne ptr %15, null
  br i1 %16, label %17, label %28

17:                                               ; preds = %12
  %18 = load ptr, ptr %2, align 8, !tbaa !5
  %19 = getelementptr inbounds %struct.png_struct_def, ptr %18, i32 0, i32 8
  %20 = load ptr, ptr %19, align 8, !tbaa !20
  %21 = load ptr, ptr %2, align 8, !tbaa !5
  %22 = load ptr, ptr %2, align 8, !tbaa !5
  %23 = getelementptr inbounds %struct.png_struct_def, ptr %22, i32 0, i32 37
  %24 = load ptr, ptr %2, align 8, !tbaa !5
  %25 = getelementptr inbounds %struct.png_struct_def, ptr %24, i32 0, i32 32
  %26 = load ptr, ptr %25, align 8, !tbaa !21
  %27 = getelementptr inbounds i8, ptr %26, i64 1
  call void %20(ptr noundef %21, ptr noundef %23, ptr noundef %27)
  br label %28

28:                                               ; preds = %17, %12
  br label %29

29:                                               ; preds = %28, %6
  %30 = load ptr, ptr %2, align 8, !tbaa !5
  %31 = getelementptr inbounds %struct.png_struct_def, ptr %30, i32 0, i32 14
  %32 = load i64, ptr %31, align 8, !tbaa !9
  %33 = and i64 %32, 32768
  %34 = icmp ne i64 %33, 0
  br i1 %34, label %35, label %45

35:                                               ; preds = %29
  %36 = load ptr, ptr %2, align 8, !tbaa !5
  %37 = getelementptr inbounds %struct.png_struct_def, ptr %36, i32 0, i32 37
  %38 = load ptr, ptr %2, align 8, !tbaa !5
  %39 = getelementptr inbounds %struct.png_struct_def, ptr %38, i32 0, i32 32
  %40 = load ptr, ptr %39, align 8, !tbaa !21
  %41 = getelementptr inbounds i8, ptr %40, i64 1
  %42 = load ptr, ptr %2, align 8, !tbaa !5
  %43 = getelementptr inbounds %struct.png_struct_def, ptr %42, i32 0, i32 13
  %44 = load i64, ptr %43, align 8, !tbaa !22
  call void @png_do_strip_filler(ptr noundef %37, ptr noundef %41, i64 noundef %44)
  br label %45

45:                                               ; preds = %35, %29
  %46 = load ptr, ptr %2, align 8, !tbaa !5
  %47 = getelementptr inbounds %struct.png_struct_def, ptr %46, i32 0, i32 14
  %48 = load i64, ptr %47, align 8, !tbaa !9
  %49 = and i64 %48, 65536
  %50 = icmp ne i64 %49, 0
  br i1 %50, label %51, label %58

51:                                               ; preds = %45
  %52 = load ptr, ptr %2, align 8, !tbaa !5
  %53 = getelementptr inbounds %struct.png_struct_def, ptr %52, i32 0, i32 37
  %54 = load ptr, ptr %2, align 8, !tbaa !5
  %55 = getelementptr inbounds %struct.png_struct_def, ptr %54, i32 0, i32 32
  %56 = load ptr, ptr %55, align 8, !tbaa !21
  %57 = getelementptr inbounds i8, ptr %56, i64 1
  call void @png_do_packswap(ptr noundef %53, ptr noundef %57)
  br label %58

58:                                               ; preds = %51, %45
  %59 = load ptr, ptr %2, align 8, !tbaa !5
  %60 = getelementptr inbounds %struct.png_struct_def, ptr %59, i32 0, i32 14
  %61 = load i64, ptr %60, align 8, !tbaa !9
  %62 = and i64 %61, 4
  %63 = icmp ne i64 %62, 0
  br i1 %63, label %64, label %75

64:                                               ; preds = %58
  %65 = load ptr, ptr %2, align 8, !tbaa !5
  %66 = getelementptr inbounds %struct.png_struct_def, ptr %65, i32 0, i32 37
  %67 = load ptr, ptr %2, align 8, !tbaa !5
  %68 = getelementptr inbounds %struct.png_struct_def, ptr %67, i32 0, i32 32
  %69 = load ptr, ptr %68, align 8, !tbaa !21
  %70 = getelementptr inbounds i8, ptr %69, i64 1
  %71 = load ptr, ptr %2, align 8, !tbaa !5
  %72 = getelementptr inbounds %struct.png_struct_def, ptr %71, i32 0, i32 50
  %73 = load i8, ptr %72, align 1, !tbaa !23
  %74 = zext i8 %73 to i64
  call void @png_do_pack(ptr noundef %66, ptr noundef %70, i64 noundef %74)
  br label %75

75:                                               ; preds = %64, %58
  %76 = load ptr, ptr %2, align 8, !tbaa !5
  %77 = getelementptr inbounds %struct.png_struct_def, ptr %76, i32 0, i32 14
  %78 = load i64, ptr %77, align 8, !tbaa !9
  %79 = and i64 %78, 16
  %80 = icmp ne i64 %79, 0
  br i1 %80, label %81, label %88

81:                                               ; preds = %75
  %82 = load ptr, ptr %2, align 8, !tbaa !5
  %83 = getelementptr inbounds %struct.png_struct_def, ptr %82, i32 0, i32 37
  %84 = load ptr, ptr %2, align 8, !tbaa !5
  %85 = getelementptr inbounds %struct.png_struct_def, ptr %84, i32 0, i32 32
  %86 = load ptr, ptr %85, align 8, !tbaa !21
  %87 = getelementptr inbounds i8, ptr %86, i64 1
  call void @png_do_swap(ptr noundef %83, ptr noundef %87)
  br label %88

88:                                               ; preds = %81, %75
  %89 = load ptr, ptr %2, align 8, !tbaa !5
  %90 = getelementptr inbounds %struct.png_struct_def, ptr %89, i32 0, i32 14
  %91 = load i64, ptr %90, align 8, !tbaa !9
  %92 = and i64 %91, 8
  %93 = icmp ne i64 %92, 0
  br i1 %93, label %94, label %103

94:                                               ; preds = %88
  %95 = load ptr, ptr %2, align 8, !tbaa !5
  %96 = getelementptr inbounds %struct.png_struct_def, ptr %95, i32 0, i32 37
  %97 = load ptr, ptr %2, align 8, !tbaa !5
  %98 = getelementptr inbounds %struct.png_struct_def, ptr %97, i32 0, i32 32
  %99 = load ptr, ptr %98, align 8, !tbaa !21
  %100 = getelementptr inbounds i8, ptr %99, i64 1
  %101 = load ptr, ptr %2, align 8, !tbaa !5
  %102 = getelementptr inbounds %struct.png_struct_def, ptr %101, i32 0, i32 74
  call void @png_do_shift(ptr noundef %96, ptr noundef %100, ptr noundef %102)
  br label %103

103:                                              ; preds = %94, %88
  %104 = load ptr, ptr %2, align 8, !tbaa !5
  %105 = getelementptr inbounds %struct.png_struct_def, ptr %104, i32 0, i32 14
  %106 = load i64, ptr %105, align 8, !tbaa !9
  %107 = and i64 %106, 131072
  %108 = icmp ne i64 %107, 0
  br i1 %108, label %109, label %116

109:                                              ; preds = %103
  %110 = load ptr, ptr %2, align 8, !tbaa !5
  %111 = getelementptr inbounds %struct.png_struct_def, ptr %110, i32 0, i32 37
  %112 = load ptr, ptr %2, align 8, !tbaa !5
  %113 = getelementptr inbounds %struct.png_struct_def, ptr %112, i32 0, i32 32
  %114 = load ptr, ptr %113, align 8, !tbaa !21
  %115 = getelementptr inbounds i8, ptr %114, i64 1
  call void @png_do_write_swap_alpha(ptr noundef %111, ptr noundef %115)
  br label %116

116:                                              ; preds = %109, %103
  %117 = load ptr, ptr %2, align 8, !tbaa !5
  %118 = getelementptr inbounds %struct.png_struct_def, ptr %117, i32 0, i32 14
  %119 = load i64, ptr %118, align 8, !tbaa !9
  %120 = and i64 %119, 524288
  %121 = icmp ne i64 %120, 0
  br i1 %121, label %122, label %129

122:                                              ; preds = %116
  %123 = load ptr, ptr %2, align 8, !tbaa !5
  %124 = getelementptr inbounds %struct.png_struct_def, ptr %123, i32 0, i32 37
  %125 = load ptr, ptr %2, align 8, !tbaa !5
  %126 = getelementptr inbounds %struct.png_struct_def, ptr %125, i32 0, i32 32
  %127 = load ptr, ptr %126, align 8, !tbaa !21
  %128 = getelementptr inbounds i8, ptr %127, i64 1
  call void @png_do_write_invert_alpha(ptr noundef %124, ptr noundef %128)
  br label %129

129:                                              ; preds = %122, %116
  %130 = load ptr, ptr %2, align 8, !tbaa !5
  %131 = getelementptr inbounds %struct.png_struct_def, ptr %130, i32 0, i32 14
  %132 = load i64, ptr %131, align 8, !tbaa !9
  %133 = and i64 %132, 1
  %134 = icmp ne i64 %133, 0
  br i1 %134, label %135, label %142

135:                                              ; preds = %129
  %136 = load ptr, ptr %2, align 8, !tbaa !5
  %137 = getelementptr inbounds %struct.png_struct_def, ptr %136, i32 0, i32 37
  %138 = load ptr, ptr %2, align 8, !tbaa !5
  %139 = getelementptr inbounds %struct.png_struct_def, ptr %138, i32 0, i32 32
  %140 = load ptr, ptr %139, align 8, !tbaa !21
  %141 = getelementptr inbounds i8, ptr %140, i64 1
  call void @png_do_bgr(ptr noundef %137, ptr noundef %141)
  br label %142

142:                                              ; preds = %135, %129
  %143 = load ptr, ptr %2, align 8, !tbaa !5
  %144 = getelementptr inbounds %struct.png_struct_def, ptr %143, i32 0, i32 14
  %145 = load i64, ptr %144, align 8, !tbaa !9
  %146 = and i64 %145, 32
  %147 = icmp ne i64 %146, 0
  br i1 %147, label %148, label %155

148:                                              ; preds = %142
  %149 = load ptr, ptr %2, align 8, !tbaa !5
  %150 = getelementptr inbounds %struct.png_struct_def, ptr %149, i32 0, i32 37
  %151 = load ptr, ptr %2, align 8, !tbaa !5
  %152 = getelementptr inbounds %struct.png_struct_def, ptr %151, i32 0, i32 32
  %153 = load ptr, ptr %152, align 8, !tbaa !21
  %154 = getelementptr inbounds i8, ptr %153, i64 1
  call void @png_do_invert(ptr noundef %150, ptr noundef %154)
  br label %155

155:                                              ; preds = %148, %142, %5
  ret void
}

declare void @png_do_strip_filler(ptr noundef, ptr noundef, i64 noundef) #1

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

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

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

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

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

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

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

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

attributes #0 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { "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" }

!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, !11, i64 296}
!10 = !{!"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, !11, i64 280, !11, i64 288, !11, i64 296, !12, i64 304, !6, i64 416, !11, i64 424, !13, i64 432, !13, i64 436, !13, i64 440, !13, i64 444, !13, i64 448, !11, i64 456, !11, i64 464, !11, i64 472, !11, i64 480, !11, i64 488, !11, i64 496, !11, i64 504, !11, i64 512, !6, i64 520, !6, i64 528, !6, i64 536, !6, i64 544, !6, i64 552, !6, i64 560, !14, i64 568, !11, i64 592, !11, i64 600, !6, i64 608, !15, i64 616, !15, 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, !15, i64 638, !7, i64 640, !16, i64 644, !17, i64 648, !17, i64 658, !6, i64 672, !11, i64 680, !11, i64 688, !13, i64 696, !16, i64 700, !16, i64 704, !6, i64 712, !6, i64 720, !6, i64 728, !6, i64 736, !6, i64 744, !6, i64 752, !18, i64 760, !18, i64 765, !6, i64 776, !17, 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, !11, i64 872, !11, i64 880, !11, i64 888, !11, i64 896, !11, i64 904, !11, i64 912, !13, i64 920, !13, i64 924, !11, i64 928, !11, 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, !11, i64 1040, !6, i64 1048, !6, i64 1056, !13, i64 1064, !6, i64 1072, !7, i64 1080, !15, i64 1082, !15, i64 1084, !15, i64 1086, !11, i64 1088, !11, i64 1096, !7, i64 1104, !7, i64 1105, !11, i64 1112, !11, 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, !11, i64 1192, !11, i64 1200, !19, i64 1208, !11, i64 1240, !11, i64 1248, !6, i64 1256}
!11 = !{!"long", !7, i64 0}
!12 = !{!"z_stream_s", !6, i64 0, !13, i64 8, !11, i64 16, !6, i64 24, !13, i64 32, !11, i64 40, !6, i64 48, !6, i64 56, !6, i64 64, !6, i64 72, !6, i64 80, !13, i64 88, !11, i64 96, !11, i64 104}
!13 = !{!"int", !7, i64 0}
!14 = !{!"png_row_info_struct", !11, i64 0, !11, i64 8, !7, i64 16, !7, i64 17, !7, i64 18, !7, i64 19}
!15 = !{!"short", !7, i64 0}
!16 = !{!"float", !7, i64 0}
!17 = !{!"png_color_16_struct", !7, i64 0, !15, i64 2, !15, i64 4, !15, i64 6, !15, i64 8}
!18 = !{!"png_color_8_struct", !7, i64 0, !7, i64 1, !7, i64 2, !7, i64 3, !7, i64 4}
!19 = !{!"png_unknown_chunk_t", !7, i64 0, !6, i64 8, !11, i64 16, !7, i64 24}
!20 = !{!10, !6, i64 256}
!21 = !{!10, !6, i64 528}
!22 = !{!10, !11, i64 288}
!23 = !{!10, !7, i64 631}


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

; Function Attrs: nounwind uwtable
define dso_local void @png_do_write_transformations(ptr noundef %0) local_unnamed_addr #0 {
  %2 = icmp eq ptr %0, null
  br i1 %2, label %93, label %3

3:                                                ; preds = %1
  %4 = getelementptr inbounds i8, ptr %0, i64 296
  %5 = load i64, ptr %4, align 8, !tbaa !5
  %6 = and i64 %5, 1048576
  %.not = icmp eq i64 %6, 0
  br i1 %.not, label %15, label %7

7:                                                ; preds = %3
  %8 = getelementptr inbounds i8, ptr %0, i64 256
  %9 = load ptr, ptr %8, align 8, !tbaa !19
  %.not38 = icmp eq ptr %9, null
  br i1 %.not38, label %15, label %10

10:                                               ; preds = %7
  %11 = getelementptr inbounds i8, ptr %0, i64 568
  %12 = getelementptr inbounds i8, ptr %0, i64 528
  %13 = load ptr, ptr %12, align 8, !tbaa !20
  %14 = getelementptr inbounds i8, ptr %13, i64 1
  tail call void %9(ptr noundef nonnull %0, ptr noundef nonnull %11, ptr noundef nonnull %14) #2
  %.pre = load i64, ptr %4, align 8, !tbaa !5
  br label %15

15:                                               ; preds = %7, %10, %3
  %16 = phi i64 [ %5, %7 ], [ %.pre, %10 ], [ %5, %3 ]
  %17 = and i64 %16, 32768
  %.not39 = icmp eq i64 %17, 0
  br i1 %.not39, label %25, label %18

18:                                               ; preds = %15
  %19 = getelementptr inbounds i8, ptr %0, i64 568
  %20 = getelementptr inbounds i8, ptr %0, i64 528
  %21 = load ptr, ptr %20, align 8, !tbaa !20
  %22 = getelementptr inbounds i8, ptr %21, i64 1
  %23 = getelementptr inbounds i8, ptr %0, i64 288
  %24 = load i64, ptr %23, align 8, !tbaa !21
  tail call void @png_do_strip_filler(ptr noundef nonnull %19, ptr noundef nonnull %22, i64 noundef %24) #2
  %.pre48 = load i64, ptr %4, align 8, !tbaa !5
  br label %25

25:                                               ; preds = %18, %15
  %26 = phi i64 [ %.pre48, %18 ], [ %16, %15 ]
  %27 = and i64 %26, 65536
  %.not40 = icmp eq i64 %27, 0
  br i1 %.not40, label %33, label %28

28:                                               ; preds = %25
  %29 = getelementptr inbounds i8, ptr %0, i64 568
  %30 = getelementptr inbounds i8, ptr %0, i64 528
  %31 = load ptr, ptr %30, align 8, !tbaa !20
  %32 = getelementptr inbounds i8, ptr %31, i64 1
  tail call void @png_do_packswap(ptr noundef nonnull %29, ptr noundef nonnull %32) #2
  %.pre49 = load i64, ptr %4, align 8, !tbaa !5
  br label %33

33:                                               ; preds = %28, %25
  %34 = phi i64 [ %.pre49, %28 ], [ %26, %25 ]
  %35 = and i64 %34, 4
  %.not41 = icmp eq i64 %35, 0
  br i1 %.not41, label %44, label %36

36:                                               ; preds = %33
  %37 = getelementptr inbounds i8, ptr %0, i64 568
  %38 = getelementptr inbounds i8, ptr %0, i64 528
  %39 = load ptr, ptr %38, align 8, !tbaa !20
  %40 = getelementptr inbounds i8, ptr %39, i64 1
  %41 = getelementptr inbounds i8, ptr %0, i64 631
  %42 = load i8, ptr %41, align 1, !tbaa !22
  %43 = zext i8 %42 to i64
  tail call void @png_do_pack(ptr noundef nonnull %37, ptr noundef nonnull %40, i64 noundef %43)
  %.pre50 = load i64, ptr %4, align 8, !tbaa !5
  br label %44

44:                                               ; preds = %36, %33
  %45 = phi i64 [ %.pre50, %36 ], [ %34, %33 ]
  %46 = and i64 %45, 16
  %.not42 = icmp eq i64 %46, 0
  br i1 %.not42, label %52, label %47

47:                                               ; preds = %44
  %48 = getelementptr inbounds i8, ptr %0, i64 568
  %49 = getelementptr inbounds i8, ptr %0, i64 528
  %50 = load ptr, ptr %49, align 8, !tbaa !20
  %51 = getelementptr inbounds i8, ptr %50, i64 1
  tail call void @png_do_swap(ptr noundef nonnull %48, ptr noundef nonnull %51) #2
  %.pre51 = load i64, ptr %4, align 8, !tbaa !5
  br label %52

52:                                               ; preds = %47, %44
  %53 = phi i64 [ %.pre51, %47 ], [ %45, %44 ]
  %54 = and i64 %53, 8
  %.not43 = icmp eq i64 %54, 0
  br i1 %.not43, label %61, label %55

55:                                               ; preds = %52
  %56 = getelementptr inbounds i8, ptr %0, i64 568
  %57 = getelementptr inbounds i8, ptr %0, i64 528
  %58 = load ptr, ptr %57, align 8, !tbaa !20
  %59 = getelementptr inbounds i8, ptr %58, i64 1
  %60 = getelementptr inbounds i8, ptr %0, i64 765
  tail call void @png_do_shift(ptr noundef nonnull %56, ptr noundef nonnull %59, ptr noundef nonnull %60)
  %.pre52 = load i64, ptr %4, align 8, !tbaa !5
  br label %61

61:                                               ; preds = %55, %52
  %62 = phi i64 [ %.pre52, %55 ], [ %53, %52 ]
  %63 = and i64 %62, 131072
  %.not44 = icmp eq i64 %63, 0
  br i1 %.not44, label %69, label %64

64:                                               ; preds = %61
  %65 = getelementptr inbounds i8, ptr %0, i64 568
  %66 = getelementptr inbounds i8, ptr %0, i64 528
  %67 = load ptr, ptr %66, align 8, !tbaa !20
  %68 = getelementptr inbounds i8, ptr %67, i64 1
  tail call void @png_do_write_swap_alpha(ptr noundef nonnull %65, ptr noundef nonnull %68)
  %.pre53 = load i64, ptr %4, align 8, !tbaa !5
  br label %69

69:                                               ; preds = %64, %61
  %70 = phi i64 [ %.pre53, %64 ], [ %62, %61 ]
  %71 = and i64 %70, 524288
  %.not45 = icmp eq i64 %71, 0
  br i1 %.not45, label %77, label %72

72:                                               ; preds = %69
  %73 = getelementptr inbounds i8, ptr %0, i64 568
  %74 = getelementptr inbounds i8, ptr %0, i64 528
  %75 = load ptr, ptr %74, align 8, !tbaa !20
  %76 = getelementptr inbounds i8, ptr %75, i64 1
  tail call void @png_do_write_invert_alpha(ptr noundef nonnull %73, ptr noundef nonnull %76)
  %.pre54 = load i64, ptr %4, align 8, !tbaa !5
  br label %77

77:                                               ; preds = %72, %69
  %78 = phi i64 [ %.pre54, %72 ], [ %70, %69 ]
  %79 = and i64 %78, 1
  %.not46 = icmp eq i64 %79, 0
  br i1 %.not46, label %85, label %80

80:                                               ; preds = %77
  %81 = getelementptr inbounds i8, ptr %0, i64 568
  %82 = getelementptr inbounds i8, ptr %0, i64 528
  %83 = load ptr, ptr %82, align 8, !tbaa !20
  %84 = getelementptr inbounds i8, ptr %83, i64 1
  tail call void @png_do_bgr(ptr noundef nonnull %81, ptr noundef nonnull %84) #2
  %.pre55 = load i64, ptr %4, align 8, !tbaa !5
  br label %85

85:                                               ; preds = %80, %77
  %86 = phi i64 [ %.pre55, %80 ], [ %78, %77 ]
  %87 = and i64 %86, 32
  %.not47 = icmp eq i64 %87, 0
  br i1 %.not47, label %93, label %88

88:                                               ; preds = %85
  %89 = getelementptr inbounds i8, ptr %0, i64 568
  %90 = getelementptr inbounds i8, ptr %0, i64 528
  %91 = load ptr, ptr %90, align 8, !tbaa !20
  %92 = getelementptr inbounds i8, ptr %91, i64 1
  tail call void @png_do_invert(ptr noundef nonnull %89, ptr noundef nonnull %92) #2
  br label %93

93:                                               ; preds = %1, %88, %85
  ret void
}

declare void @png_do_strip_filler(ptr noundef, ptr noundef, i64 noundef) local_unnamed_addr #1

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

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

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

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

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

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

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

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

attributes #0 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { "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 }

!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 296}
!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, !9, i64 256}
!20 = !{!6, !9, i64 528}
!21 = !{!6, !10, i64 288}
!22 = !{!6, !7, i64 631}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,InstCombinePass,SROAPass,SimplifyCFGPass,TailCallElimPass