; LLVM IR from Try/Tempest :: Engine/thirdparty/libpng (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, i64, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, i8, i8, i32, i32, i32, i32, %struct.z_stream_s, ptr, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i64, i32, i32, i32, ptr, ptr, ptr, ptr, i64, i32, i32, ptr, i16, i32, i16, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i16, i8, i32, %struct.png_color_16_struct, %struct.png_color_16_struct, ptr, i32, i32, i32, i32, ptr, ptr, ptr, ptr, ptr, ptr, %struct.png_color_8_struct, %struct.png_color_8_struct, ptr, %struct.png_color_16_struct, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, i32, i32, i64, i64, i64, i64, i32, i32, ptr, ptr, i32, [29 x i8], i32, ptr, ptr, i32, i32, ptr, i8, i8, i16, i16, i32, i8, ptr, ptr, ptr, ptr, ptr, ptr, ptr, i8, i32, i32, i32, i64, %struct.png_unknown_chunk_t, i64, ptr, i64, i32, i32, ptr, [4 x ptr], %struct.png_colorspace }
%struct.__jmp_buf_tag = type { [8 x i64], i32, %struct.__sigset_t }
%struct.__sigset_t = type { [16 x i64] }
%struct.z_stream_s = type { ptr, i32, i64, ptr, i32, i64, ptr, ptr, ptr, ptr, ptr, i32, i64, i64 }
%struct.png_color_8_struct = type { i8, i8, i8, i8, i8 }
%struct.png_color_16_struct = type { i8, i16, i16, i16, i16 }
%struct.png_unknown_chunk_t = type { [5 x i8], ptr, i64, i8 }
%struct.png_colorspace = type { i32, %struct.png_xy, %struct.png_XYZ, i16, i16 }
%struct.png_xy = type { i32, i32, i32, i32, i32, i32, i32, i32 }
%struct.png_XYZ = type { i32, i32, i32, i32, i32, i32, i32, i32, i32 }

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

7:                                                ; preds = %2
  br label %151

8:                                                ; preds = %2
  %9 = load ptr, ptr %3, align 8, !tbaa !5
  %10 = getelementptr inbounds %struct.png_struct_def, ptr %9, i32 0, i32 17
  %11 = load i32, ptr %10, align 4, !tbaa !9
  %12 = and i32 %11, 1048576
  %13 = icmp ne i32 %12, 0
  br i1 %13, label %14, label %30

14:                                               ; preds = %8
  %15 = load ptr, ptr %3, align 8, !tbaa !5
  %16 = getelementptr inbounds %struct.png_struct_def, ptr %15, i32 0, i32 11
  %17 = load ptr, ptr %16, align 8, !tbaa !21
  %18 = icmp ne ptr %17, null
  br i1 %18, label %19, label %29

19:                                               ; preds = %14
  %20 = load ptr, ptr %3, align 8, !tbaa !5
  %21 = getelementptr inbounds %struct.png_struct_def, ptr %20, i32 0, i32 11
  %22 = load ptr, ptr %21, align 8, !tbaa !21
  %23 = load ptr, ptr %3, align 8, !tbaa !5
  %24 = load ptr, ptr %4, align 8, !tbaa !5
  %25 = load ptr, ptr %3, align 8, !tbaa !5
  %26 = getelementptr inbounds %struct.png_struct_def, ptr %25, i32 0, i32 46
  %27 = load ptr, ptr %26, align 8, !tbaa !22
  %28 = getelementptr inbounds i8, ptr %27, i64 1
  call void %22(ptr noundef %23, ptr noundef %24, ptr noundef %28)
  br label %29

29:                                               ; preds = %19, %14
  br label %30

30:                                               ; preds = %29, %8
  %31 = load ptr, ptr %3, align 8, !tbaa !5
  %32 = getelementptr inbounds %struct.png_struct_def, ptr %31, i32 0, i32 17
  %33 = load i32, ptr %32, align 4, !tbaa !9
  %34 = and i32 %33, 32768
  %35 = icmp ne i32 %34, 0
  br i1 %35, label %36, label %49

36:                                               ; preds = %30
  %37 = load ptr, ptr %4, align 8, !tbaa !5
  %38 = load ptr, ptr %3, align 8, !tbaa !5
  %39 = getelementptr inbounds %struct.png_struct_def, ptr %38, i32 0, i32 46
  %40 = load ptr, ptr %39, align 8, !tbaa !22
  %41 = getelementptr inbounds i8, ptr %40, i64 1
  %42 = load ptr, ptr %3, align 8, !tbaa !5
  %43 = getelementptr inbounds %struct.png_struct_def, ptr %42, i32 0, i32 16
  %44 = load i32, ptr %43, align 8, !tbaa !23
  %45 = and i32 %44, 128
  %46 = icmp ne i32 %45, 0
  %47 = xor i1 %46, true
  %48 = zext i1 %47 to i32
  call void @png_do_strip_channel(ptr noundef %37, ptr noundef %41, i32 noundef %48)
  br label %49

49:                                               ; preds = %36, %30
  %50 = load ptr, ptr %3, align 8, !tbaa !5
  %51 = getelementptr inbounds %struct.png_struct_def, ptr %50, i32 0, i32 17
  %52 = load i32, ptr %51, align 4, !tbaa !9
  %53 = and i32 %52, 65536
  %54 = icmp ne i32 %53, 0
  br i1 %54, label %55, label %61

55:                                               ; preds = %49
  %56 = load ptr, ptr %4, align 8, !tbaa !5
  %57 = load ptr, ptr %3, align 8, !tbaa !5
  %58 = getelementptr inbounds %struct.png_struct_def, ptr %57, i32 0, i32 46
  %59 = load ptr, ptr %58, align 8, !tbaa !22
  %60 = getelementptr inbounds i8, ptr %59, i64 1
  call void @png_do_packswap(ptr noundef %56, ptr noundef %60)
  br label %61

61:                                               ; preds = %55, %49
  %62 = load ptr, ptr %3, align 8, !tbaa !5
  %63 = getelementptr inbounds %struct.png_struct_def, ptr %62, i32 0, i32 17
  %64 = load i32, ptr %63, align 4, !tbaa !9
  %65 = and i32 %64, 4
  %66 = icmp ne i32 %65, 0
  br i1 %66, label %67, label %77

67:                                               ; preds = %61
  %68 = load ptr, ptr %4, align 8, !tbaa !5
  %69 = load ptr, ptr %3, align 8, !tbaa !5
  %70 = getelementptr inbounds %struct.png_struct_def, ptr %69, i32 0, i32 46
  %71 = load ptr, ptr %70, align 8, !tbaa !22
  %72 = getelementptr inbounds i8, ptr %71, i64 1
  %73 = load ptr, ptr %3, align 8, !tbaa !5
  %74 = getelementptr inbounds %struct.png_struct_def, ptr %73, i32 0, i32 62
  %75 = load i8, ptr %74, align 8, !tbaa !24
  %76 = zext i8 %75 to i32
  call void @png_do_pack(ptr noundef %68, ptr noundef %72, i32 noundef %76)
  br label %77

77:                                               ; preds = %67, %61
  %78 = load ptr, ptr %3, align 8, !tbaa !5
  %79 = getelementptr inbounds %struct.png_struct_def, ptr %78, i32 0, i32 17
  %80 = load i32, ptr %79, align 4, !tbaa !9
  %81 = and i32 %80, 16
  %82 = icmp ne i32 %81, 0
  br i1 %82, label %83, label %89

83:                                               ; preds = %77
  %84 = load ptr, ptr %4, align 8, !tbaa !5
  %85 = load ptr, ptr %3, align 8, !tbaa !5
  %86 = getelementptr inbounds %struct.png_struct_def, ptr %85, i32 0, i32 46
  %87 = load ptr, ptr %86, align 8, !tbaa !22
  %88 = getelementptr inbounds i8, ptr %87, i64 1
  call void @png_do_swap(ptr noundef %84, ptr noundef %88)
  br label %89

89:                                               ; preds = %83, %77
  %90 = load ptr, ptr %3, align 8, !tbaa !5
  %91 = getelementptr inbounds %struct.png_struct_def, ptr %90, i32 0, i32 17
  %92 = load i32, ptr %91, align 4, !tbaa !9
  %93 = and i32 %92, 8
  %94 = icmp ne i32 %93, 0
  br i1 %94, label %95, label %103

95:                                               ; preds = %89
  %96 = load ptr, ptr %4, align 8, !tbaa !5
  %97 = load ptr, ptr %3, align 8, !tbaa !5
  %98 = getelementptr inbounds %struct.png_struct_def, ptr %97, i32 0, i32 46
  %99 = load ptr, ptr %98, align 8, !tbaa !22
  %100 = getelementptr inbounds i8, ptr %99, i64 1
  %101 = load ptr, ptr %3, align 8, !tbaa !5
  %102 = getelementptr inbounds %struct.png_struct_def, ptr %101, i32 0, i32 88
  call void @png_do_shift(ptr noundef %96, ptr noundef %100, ptr noundef %102)
  br label %103

103:                                              ; preds = %95, %89
  %104 = load ptr, ptr %3, align 8, !tbaa !5
  %105 = getelementptr inbounds %struct.png_struct_def, ptr %104, i32 0, i32 17
  %106 = load i32, ptr %105, align 4, !tbaa !9
  %107 = and i32 %106, 131072
  %108 = icmp ne i32 %107, 0
  br i1 %108, label %109, label %115

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

115:                                              ; preds = %109, %103
  %116 = load ptr, ptr %3, align 8, !tbaa !5
  %117 = getelementptr inbounds %struct.png_struct_def, ptr %116, i32 0, i32 17
  %118 = load i32, ptr %117, align 4, !tbaa !9
  %119 = and i32 %118, 524288
  %120 = icmp ne i32 %119, 0
  br i1 %120, label %121, label %127

121:                                              ; preds = %115
  %122 = load ptr, ptr %4, align 8, !tbaa !5
  %123 = load ptr, ptr %3, align 8, !tbaa !5
  %124 = getelementptr inbounds %struct.png_struct_def, ptr %123, i32 0, i32 46
  %125 = load ptr, ptr %124, align 8, !tbaa !22
  %126 = getelementptr inbounds i8, ptr %125, i64 1
  call void @png_do_write_invert_alpha(ptr noundef %122, ptr noundef %126)
  br label %127

127:                                              ; preds = %121, %115
  %128 = load ptr, ptr %3, align 8, !tbaa !5
  %129 = getelementptr inbounds %struct.png_struct_def, ptr %128, i32 0, i32 17
  %130 = load i32, ptr %129, align 4, !tbaa !9
  %131 = and i32 %130, 1
  %132 = icmp ne i32 %131, 0
  br i1 %132, label %133, label %139

133:                                              ; preds = %127
  %134 = load ptr, ptr %4, align 8, !tbaa !5
  %135 = load ptr, ptr %3, align 8, !tbaa !5
  %136 = getelementptr inbounds %struct.png_struct_def, ptr %135, i32 0, i32 46
  %137 = load ptr, ptr %136, align 8, !tbaa !22
  %138 = getelementptr inbounds i8, ptr %137, i64 1
  call void @png_do_bgr(ptr noundef %134, ptr noundef %138)
  br label %139

139:                                              ; preds = %133, %127
  %140 = load ptr, ptr %3, align 8, !tbaa !5
  %141 = getelementptr inbounds %struct.png_struct_def, ptr %140, i32 0, i32 17
  %142 = load i32, ptr %141, align 4, !tbaa !9
  %143 = and i32 %142, 32
  %144 = icmp ne i32 %143, 0
  br i1 %144, label %145, label %151

145:                                              ; preds = %139
  %146 = load ptr, ptr %4, align 8, !tbaa !5
  %147 = load ptr, ptr %3, align 8, !tbaa !5
  %148 = getelementptr inbounds %struct.png_struct_def, ptr %147, i32 0, i32 46
  %149 = load ptr, ptr %148, align 8, !tbaa !22
  %150 = getelementptr inbounds i8, ptr %149, i64 1
  call void @png_do_invert(ptr noundef %146, ptr noundef %150)
  br label %151

151:                                              ; preds = %145, %139, %7
  ret void
}

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

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

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

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

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

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

; Function Attrs: nounwind uwtable
declare hidden 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, !12, i64 308}
!10 = !{!"png_struct_def", !7, i64 0, !6, i64 200, !6, i64 208, !11, i64 216, !6, i64 224, !6, i64 232, !6, i64 240, !6, i64 248, !6, i64 256, !6, i64 264, !6, i64 272, !6, i64 280, !6, i64 288, !7, i64 296, !7, i64 297, !12, i64 300, !12, i64 304, !12, i64 308, !12, i64 312, !13, i64 320, !6, i64 432, !12, i64 440, !12, i64 444, !12, i64 448, !12, i64 452, !12, i64 456, !12, i64 460, !12, i64 464, !12, i64 468, !12, i64 472, !12, i64 476, !12, i64 480, !12, i64 484, !12, i64 488, !12, i64 492, !12, i64 496, !12, i64 500, !12, i64 504, !12, i64 508, !12, i64 512, !12, i64 516, !11, i64 520, !12, i64 528, !12, i64 532, !12, i64 536, !6, i64 544, !6, i64 552, !6, i64 560, !6, i64 568, !11, i64 576, !12, i64 584, !12, i64 588, !6, i64 592, !14, i64 600, !12, i64 604, !14, i64 608, !7, i64 610, !7, i64 611, !7, i64 612, !7, i64 613, !7, i64 614, !7, i64 615, !7, i64 616, !7, i64 617, !7, i64 618, !7, i64 619, !7, i64 620, !7, i64 621, !7, i64 622, !7, i64 623, !7, i64 624, !14, i64 626, !7, i64 628, !12, i64 632, !15, i64 636, !15, i64 646, !6, i64 656, !12, i64 664, !12, i64 668, !12, i64 672, !12, i64 676, !6, i64 680, !6, i64 688, !6, i64 696, !6, i64 704, !6, i64 712, !6, i64 720, !16, i64 728, !16, i64 733, !6, i64 744, !15, i64 752, !6, i64 768, !6, i64 776, !6, i64 784, !6, i64 792, !6, i64 800, !6, i64 808, !6, i64 816, !6, i64 824, !6, i64 832, !12, i64 840, !12, i64 844, !11, i64 848, !11, i64 856, !11, i64 864, !11, i64 872, !12, i64 880, !12, i64 884, !6, i64 888, !6, i64 896, !12, i64 904, !7, i64 908, !12, i64 940, !6, i64 944, !6, i64 952, !12, i64 960, !12, i64 964, !6, i64 968, !7, i64 976, !7, i64 977, !14, i64 978, !14, i64 980, !12, i64 984, !7, i64 988, !6, i64 992, !6, i64 1000, !6, i64 1008, !6, i64 1016, !6, i64 1024, !6, i64 1032, !6, i64 1040, !7, i64 1048, !12, i64 1052, !12, i64 1056, !12, i64 1060, !11, i64 1064, !17, i64 1072, !11, i64 1104, !6, i64 1112, !11, i64 1120, !12, i64 1128, !12, i64 1132, !6, i64 1136, !7, i64 1144, !18, i64 1176}
!11 = !{!"long", !7, i64 0}
!12 = !{!"int", !7, i64 0}
!13 = !{!"z_stream_s", !6, i64 0, !12, i64 8, !11, i64 16, !6, i64 24, !12, i64 32, !11, i64 40, !6, i64 48, !6, i64 56, !6, i64 64, !6, i64 72, !6, i64 80, !12, i64 88, !11, i64 96, !11, i64 104}
!14 = !{!"short", !7, i64 0}
!15 = !{!"png_color_16_struct", !7, i64 0, !14, i64 2, !14, i64 4, !14, i64 6, !14, i64 8}
!16 = !{!"png_color_8_struct", !7, i64 0, !7, i64 1, !7, i64 2, !7, i64 3, !7, i64 4}
!17 = !{!"png_unknown_chunk_t", !7, i64 0, !6, i64 8, !11, i64 16, !7, i64 24}
!18 = !{!"png_colorspace", !12, i64 0, !19, i64 4, !20, i64 36, !14, i64 72, !14, i64 74}
!19 = !{!"png_xy", !12, i64 0, !12, i64 4, !12, i64 8, !12, i64 12, !12, i64 16, !12, i64 20, !12, i64 24, !12, i64 28}
!20 = !{!"png_XYZ", !12, i64 0, !12, i64 4, !12, i64 8, !12, i64 12, !12, i64 16, !12, i64 20, !12, i64 24, !12, i64 28, !12, i64 32}
!21 = !{!10, !6, i64 280}
!22 = !{!10, !6, i64 552}
!23 = !{!10, !12, i64 304}
!24 = !{!10, !7, 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"

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

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

8:                                                ; preds = %4
  %9 = getelementptr inbounds i8, ptr %0, i64 280
  %10 = load ptr, ptr %9, align 8, !tbaa !20
  %.not38 = icmp eq ptr %10, null
  br i1 %.not38, label %15, label %11

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

15:                                               ; preds = %8, %11, %4
  %16 = phi i32 [ %6, %8 ], [ %.pre, %11 ], [ %6, %4 ]
  %17 = and i32 %16, 32768
  %.not39 = icmp eq i32 %17, 0
  br i1 %.not39, label %26, label %18

18:                                               ; preds = %15
  %19 = getelementptr inbounds i8, ptr %0, i64 552
  %20 = load ptr, ptr %19, align 8, !tbaa !21
  %21 = getelementptr inbounds i8, ptr %20, i64 1
  %22 = getelementptr inbounds i8, ptr %0, i64 304
  %23 = load i32, ptr %22, align 8, !tbaa !22
  %24 = lshr i32 %23, 7
  %.lobit = and i32 %24, 1
  %25 = xor i32 %.lobit, 1
  tail call void @png_do_strip_channel(ptr noundef %1, ptr noundef nonnull %21, i32 noundef %25) #2
  %.pre49 = load i32, ptr %5, align 4, !tbaa !5
  br label %26

26:                                               ; preds = %18, %15
  %27 = phi i32 [ %.pre49, %18 ], [ %16, %15 ]
  %28 = and i32 %27, 65536
  %.not41 = icmp eq i32 %28, 0
  br i1 %.not41, label %33, label %29

29:                                               ; preds = %26
  %30 = getelementptr inbounds i8, ptr %0, i64 552
  %31 = load ptr, ptr %30, align 8, !tbaa !21
  %32 = getelementptr inbounds i8, ptr %31, i64 1
  tail call void @png_do_packswap(ptr noundef %1, ptr noundef nonnull %32) #2
  %.pre50 = load i32, ptr %5, align 4, !tbaa !5
  br label %33

33:                                               ; preds = %29, %26
  %34 = phi i32 [ %.pre50, %29 ], [ %27, %26 ]
  %35 = and i32 %34, 4
  %.not42 = icmp eq i32 %35, 0
  br i1 %.not42, label %43, label %36

36:                                               ; preds = %33
  %37 = getelementptr inbounds i8, ptr %0, i64 552
  %38 = load ptr, ptr %37, align 8, !tbaa !21
  %39 = getelementptr inbounds i8, ptr %38, i64 1
  %40 = getelementptr inbounds i8, ptr %0, i64 616
  %41 = load i8, ptr %40, align 8, !tbaa !23
  %42 = zext i8 %41 to i32
  tail call void @png_do_pack(ptr noundef %1, ptr noundef nonnull %39, i32 noundef %42)
  %.pre51 = load i32, ptr %5, align 4, !tbaa !5
  br label %43

43:                                               ; preds = %36, %33
  %44 = phi i32 [ %.pre51, %36 ], [ %34, %33 ]
  %45 = and i32 %44, 16
  %.not43 = icmp eq i32 %45, 0
  br i1 %.not43, label %50, label %46

46:                                               ; preds = %43
  %47 = getelementptr inbounds i8, ptr %0, i64 552
  %48 = load ptr, ptr %47, align 8, !tbaa !21
  %49 = getelementptr inbounds i8, ptr %48, i64 1
  tail call void @png_do_swap(ptr noundef %1, ptr noundef nonnull %49) #2
  %.pre52 = load i32, ptr %5, align 4, !tbaa !5
  br label %50

50:                                               ; preds = %46, %43
  %51 = phi i32 [ %.pre52, %46 ], [ %44, %43 ]
  %52 = and i32 %51, 8
  %.not44 = icmp eq i32 %52, 0
  br i1 %.not44, label %58, label %53

53:                                               ; preds = %50
  %54 = getelementptr inbounds i8, ptr %0, i64 552
  %55 = load ptr, ptr %54, align 8, !tbaa !21
  %56 = getelementptr inbounds i8, ptr %55, i64 1
  %57 = getelementptr inbounds i8, ptr %0, i64 733
  tail call void @png_do_shift(ptr noundef %1, ptr noundef nonnull %56, ptr noundef nonnull %57)
  %.pre53 = load i32, ptr %5, align 4, !tbaa !5
  br label %58

58:                                               ; preds = %53, %50
  %59 = phi i32 [ %.pre53, %53 ], [ %51, %50 ]
  %60 = and i32 %59, 131072
  %.not45 = icmp eq i32 %60, 0
  br i1 %.not45, label %65, label %61

61:                                               ; preds = %58
  %62 = getelementptr inbounds i8, ptr %0, i64 552
  %63 = load ptr, ptr %62, align 8, !tbaa !21
  %64 = getelementptr inbounds i8, ptr %63, i64 1
  tail call void @png_do_write_swap_alpha(ptr noundef %1, ptr noundef nonnull %64)
  %.pre54 = load i32, ptr %5, align 4, !tbaa !5
  br label %65

65:                                               ; preds = %61, %58
  %66 = phi i32 [ %.pre54, %61 ], [ %59, %58 ]
  %67 = and i32 %66, 524288
  %.not46 = icmp eq i32 %67, 0
  br i1 %.not46, label %72, label %68

68:                                               ; preds = %65
  %69 = getelementptr inbounds i8, ptr %0, i64 552
  %70 = load ptr, ptr %69, align 8, !tbaa !21
  %71 = getelementptr inbounds i8, ptr %70, i64 1
  tail call void @png_do_write_invert_alpha(ptr noundef %1, ptr noundef nonnull %71)
  %.pre55 = load i32, ptr %5, align 4, !tbaa !5
  br label %72

72:                                               ; preds = %68, %65
  %73 = phi i32 [ %.pre55, %68 ], [ %66, %65 ]
  %74 = and i32 %73, 1
  %.not47 = icmp eq i32 %74, 0
  br i1 %.not47, label %79, label %75

75:                                               ; preds = %72
  %76 = getelementptr inbounds i8, ptr %0, i64 552
  %77 = load ptr, ptr %76, align 8, !tbaa !21
  %78 = getelementptr inbounds i8, ptr %77, i64 1
  tail call void @png_do_bgr(ptr noundef %1, ptr noundef nonnull %78) #2
  %.pre56 = load i32, ptr %5, align 4, !tbaa !5
  br label %79

79:                                               ; preds = %75, %72
  %80 = phi i32 [ %.pre56, %75 ], [ %73, %72 ]
  %81 = and i32 %80, 32
  %.not48 = icmp eq i32 %81, 0
  br i1 %.not48, label %86, label %82

82:                                               ; preds = %79
  %83 = getelementptr inbounds i8, ptr %0, i64 552
  %84 = load ptr, ptr %83, align 8, !tbaa !21
  %85 = getelementptr inbounds i8, ptr %84, i64 1
  tail call void @png_do_invert(ptr noundef %1, ptr noundef nonnull %85) #2
  br label %86

86:                                               ; preds = %2, %82, %79
  ret void
}

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

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

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

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

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

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

; Function Attrs: nounwind uwtable
declare hidden 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, !11, i64 308}
!6 = !{!"png_struct_def", !7, i64 0, !9, i64 200, !9, i64 208, !10, i64 216, !9, i64 224, !9, i64 232, !9, i64 240, !9, i64 248, !9, i64 256, !9, i64 264, !9, i64 272, !9, i64 280, !9, i64 288, !7, i64 296, !7, i64 297, !11, i64 300, !11, i64 304, !11, i64 308, !11, i64 312, !12, i64 320, !9, i64 432, !11, i64 440, !11, i64 444, !11, i64 448, !11, i64 452, !11, i64 456, !11, i64 460, !11, i64 464, !11, i64 468, !11, i64 472, !11, i64 476, !11, i64 480, !11, i64 484, !11, i64 488, !11, i64 492, !11, i64 496, !11, i64 500, !11, i64 504, !11, i64 508, !11, i64 512, !11, i64 516, !10, i64 520, !11, i64 528, !11, i64 532, !11, i64 536, !9, i64 544, !9, i64 552, !9, i64 560, !9, i64 568, !10, i64 576, !11, i64 584, !11, i64 588, !9, i64 592, !13, i64 600, !11, i64 604, !13, i64 608, !7, i64 610, !7, i64 611, !7, i64 612, !7, i64 613, !7, i64 614, !7, i64 615, !7, i64 616, !7, i64 617, !7, i64 618, !7, i64 619, !7, i64 620, !7, i64 621, !7, i64 622, !7, i64 623, !7, i64 624, !13, i64 626, !7, i64 628, !11, i64 632, !14, i64 636, !14, i64 646, !9, i64 656, !11, i64 664, !11, i64 668, !11, i64 672, !11, i64 676, !9, i64 680, !9, i64 688, !9, i64 696, !9, i64 704, !9, i64 712, !9, i64 720, !15, i64 728, !15, i64 733, !9, i64 744, !14, i64 752, !9, i64 768, !9, i64 776, !9, i64 784, !9, i64 792, !9, i64 800, !9, i64 808, !9, i64 816, !9, i64 824, !9, i64 832, !11, i64 840, !11, i64 844, !10, i64 848, !10, i64 856, !10, i64 864, !10, i64 872, !11, i64 880, !11, i64 884, !9, i64 888, !9, i64 896, !11, i64 904, !7, i64 908, !11, i64 940, !9, i64 944, !9, i64 952, !11, i64 960, !11, i64 964, !9, i64 968, !7, i64 976, !7, i64 977, !13, i64 978, !13, i64 980, !11, i64 984, !7, i64 988, !9, i64 992, !9, i64 1000, !9, i64 1008, !9, i64 1016, !9, i64 1024, !9, i64 1032, !9, i64 1040, !7, i64 1048, !11, i64 1052, !11, i64 1056, !11, i64 1060, !10, i64 1064, !16, i64 1072, !10, i64 1104, !9, i64 1112, !10, i64 1120, !11, i64 1128, !11, i64 1132, !9, i64 1136, !7, i64 1144, !17, i64 1176}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!"any pointer", !7, i64 0}
!10 = !{!"long", !7, i64 0}
!11 = !{!"int", !7, i64 0}
!12 = !{!"z_stream_s", !9, i64 0, !11, i64 8, !10, i64 16, !9, i64 24, !11, i64 32, !10, i64 40, !9, i64 48, !9, i64 56, !9, i64 64, !9, i64 72, !9, i64 80, !11, i64 88, !10, i64 96, !10, i64 104}
!13 = !{!"short", !7, i64 0}
!14 = !{!"png_color_16_struct", !7, i64 0, !13, i64 2, !13, i64 4, !13, i64 6, !13, i64 8}
!15 = !{!"png_color_8_struct", !7, i64 0, !7, i64 1, !7, i64 2, !7, i64 3, !7, i64 4}
!16 = !{!"png_unknown_chunk_t", !7, i64 0, !9, i64 8, !10, i64 16, !7, i64 24}
!17 = !{!"png_colorspace", !11, i64 0, !18, i64 4, !19, i64 36, !13, i64 72, !13, i64 74}
!18 = !{!"png_xy", !11, i64 0, !11, i64 4, !11, i64 8, !11, i64 12, !11, i64 16, !11, i64 20, !11, i64 24, !11, i64 28}
!19 = !{!"png_XYZ", !11, i64 0, !11, i64 4, !11, i64 8, !11, i64 12, !11, i64 16, !11, i64 20, !11, i64 24, !11, i64 28, !11, i64 32}
!20 = !{!6, !9, i64 280}
!21 = !{!6, !9, i64 552}
!22 = !{!6, !11, i64 304}
!23 = !{!6, !7, i64 616}


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