; LLVM IR from niessner/Matterport :: code/gaps/pkgs/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, ptr, i8, i8, i32, i32, i32, %struct.z_stream_s, ptr, i64, i32, i32, i32, i32, i32, i32, i32, i32, i32, i64, i64, i32, i32, ptr, ptr, ptr, ptr, ptr, ptr, %struct.png_row_info_struct, i32, i32, 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, i32, i32, 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, i32, i32, i64, i64, i64, i64, i32, i32, i64, i64, ptr, ptr, ptr, ptr, ptr, i8, i8, ptr, ptr, ptr, ptr, ptr, ptr, i32, ptr, ptr, i32, ptr, i8, i16, i16, i16, i32, i32, i8, ptr, ptr, ptr, ptr, ptr, ptr, ptr, i8, i32, i32, i32, %struct.png_unknown_chunk_t, i32, i32, ptr, i32 }
%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 { i32, 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 %160

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

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

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

29:                                               ; preds = %18, %13
  br label %30

30:                                               ; preds = %29, %6
  %31 = load ptr, ptr %2, align 8, !tbaa !5
  %32 = getelementptr inbounds %struct.png_struct_def, ptr %31, i32 0, i32 15
  %33 = load i32, ptr %32, align 4, !tbaa !9
  %34 = zext i32 %33 to i64
  %35 = and i64 %34, 32768
  %36 = icmp ne i64 %35, 0
  br i1 %36, label %37, label %47

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

47:                                               ; preds = %37, %30
  %48 = load ptr, ptr %2, align 8, !tbaa !5
  %49 = getelementptr inbounds %struct.png_struct_def, ptr %48, i32 0, i32 15
  %50 = load i32, ptr %49, align 4, !tbaa !9
  %51 = zext i32 %50 to i64
  %52 = and i64 %51, 65536
  %53 = icmp ne i64 %52, 0
  br i1 %53, label %54, label %61

54:                                               ; preds = %47
  %55 = load ptr, ptr %2, align 8, !tbaa !5
  %56 = getelementptr inbounds %struct.png_struct_def, ptr %55, i32 0, i32 38
  %57 = load ptr, ptr %2, align 8, !tbaa !5
  %58 = getelementptr inbounds %struct.png_struct_def, ptr %57, i32 0, i32 33
  %59 = load ptr, ptr %58, align 8, !tbaa !21
  %60 = getelementptr inbounds i8, ptr %59, i64 1
  call void @png_do_packswap(ptr noundef %56, ptr noundef %60)
  br label %61

61:                                               ; preds = %54, %47
  %62 = load ptr, ptr %2, align 8, !tbaa !5
  %63 = getelementptr inbounds %struct.png_struct_def, ptr %62, i32 0, i32 15
  %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 %78

67:                                               ; preds = %61
  %68 = load ptr, ptr %2, align 8, !tbaa !5
  %69 = getelementptr inbounds %struct.png_struct_def, ptr %68, i32 0, i32 38
  %70 = load ptr, ptr %2, align 8, !tbaa !5
  %71 = getelementptr inbounds %struct.png_struct_def, ptr %70, i32 0, i32 33
  %72 = load ptr, ptr %71, align 8, !tbaa !21
  %73 = getelementptr inbounds i8, ptr %72, i64 1
  %74 = load ptr, ptr %2, align 8, !tbaa !5
  %75 = getelementptr inbounds %struct.png_struct_def, ptr %74, i32 0, i32 51
  %76 = load i8, ptr %75, align 1, !tbaa !23
  %77 = zext i8 %76 to i32
  call void @png_do_pack(ptr noundef %69, ptr noundef %73, i32 noundef %77)
  br label %78

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

84:                                               ; preds = %78
  %85 = load ptr, ptr %2, align 8, !tbaa !5
  %86 = getelementptr inbounds %struct.png_struct_def, ptr %85, i32 0, i32 38
  %87 = load ptr, ptr %2, align 8, !tbaa !5
  %88 = getelementptr inbounds %struct.png_struct_def, ptr %87, i32 0, i32 33
  %89 = load ptr, ptr %88, align 8, !tbaa !21
  %90 = getelementptr inbounds i8, ptr %89, i64 1
  call void @png_do_swap(ptr noundef %86, ptr noundef %90)
  br label %91

91:                                               ; preds = %84, %78
  %92 = load ptr, ptr %2, align 8, !tbaa !5
  %93 = getelementptr inbounds %struct.png_struct_def, ptr %92, i32 0, i32 15
  %94 = load i32, ptr %93, align 4, !tbaa !9
  %95 = and i32 %94, 8
  %96 = icmp ne i32 %95, 0
  br i1 %96, label %97, label %106

97:                                               ; preds = %91
  %98 = load ptr, ptr %2, align 8, !tbaa !5
  %99 = getelementptr inbounds %struct.png_struct_def, ptr %98, i32 0, i32 38
  %100 = load ptr, ptr %2, align 8, !tbaa !5
  %101 = getelementptr inbounds %struct.png_struct_def, ptr %100, i32 0, i32 33
  %102 = load ptr, ptr %101, align 8, !tbaa !21
  %103 = getelementptr inbounds i8, ptr %102, i64 1
  %104 = load ptr, ptr %2, align 8, !tbaa !5
  %105 = getelementptr inbounds %struct.png_struct_def, ptr %104, i32 0, i32 75
  call void @png_do_shift(ptr noundef %99, ptr noundef %103, ptr noundef %105)
  br label %106

106:                                              ; preds = %97, %91
  %107 = load ptr, ptr %2, align 8, !tbaa !5
  %108 = getelementptr inbounds %struct.png_struct_def, ptr %107, i32 0, i32 15
  %109 = load i32, ptr %108, align 4, !tbaa !9
  %110 = zext i32 %109 to i64
  %111 = and i64 %110, 131072
  %112 = icmp ne i64 %111, 0
  br i1 %112, label %113, label %120

113:                                              ; preds = %106
  %114 = load ptr, ptr %2, align 8, !tbaa !5
  %115 = getelementptr inbounds %struct.png_struct_def, ptr %114, i32 0, i32 38
  %116 = load ptr, ptr %2, align 8, !tbaa !5
  %117 = getelementptr inbounds %struct.png_struct_def, ptr %116, i32 0, i32 33
  %118 = load ptr, ptr %117, align 8, !tbaa !21
  %119 = getelementptr inbounds i8, ptr %118, i64 1
  call void @png_do_write_swap_alpha(ptr noundef %115, ptr noundef %119)
  br label %120

120:                                              ; preds = %113, %106
  %121 = load ptr, ptr %2, align 8, !tbaa !5
  %122 = getelementptr inbounds %struct.png_struct_def, ptr %121, i32 0, i32 15
  %123 = load i32, ptr %122, align 4, !tbaa !9
  %124 = zext i32 %123 to i64
  %125 = and i64 %124, 524288
  %126 = icmp ne i64 %125, 0
  br i1 %126, label %127, label %134

127:                                              ; preds = %120
  %128 = load ptr, ptr %2, align 8, !tbaa !5
  %129 = getelementptr inbounds %struct.png_struct_def, ptr %128, i32 0, i32 38
  %130 = load ptr, ptr %2, align 8, !tbaa !5
  %131 = getelementptr inbounds %struct.png_struct_def, ptr %130, i32 0, i32 33
  %132 = load ptr, ptr %131, align 8, !tbaa !21
  %133 = getelementptr inbounds i8, ptr %132, i64 1
  call void @png_do_write_invert_alpha(ptr noundef %129, ptr noundef %133)
  br label %134

134:                                              ; preds = %127, %120
  %135 = load ptr, ptr %2, align 8, !tbaa !5
  %136 = getelementptr inbounds %struct.png_struct_def, ptr %135, i32 0, i32 15
  %137 = load i32, ptr %136, align 4, !tbaa !9
  %138 = and i32 %137, 1
  %139 = icmp ne i32 %138, 0
  br i1 %139, label %140, label %147

140:                                              ; preds = %134
  %141 = load ptr, ptr %2, align 8, !tbaa !5
  %142 = getelementptr inbounds %struct.png_struct_def, ptr %141, i32 0, i32 38
  %143 = load ptr, ptr %2, align 8, !tbaa !5
  %144 = getelementptr inbounds %struct.png_struct_def, ptr %143, i32 0, i32 33
  %145 = load ptr, ptr %144, align 8, !tbaa !21
  %146 = getelementptr inbounds i8, ptr %145, i64 1
  call void @png_do_bgr(ptr noundef %142, ptr noundef %146)
  br label %147

147:                                              ; preds = %140, %134
  %148 = load ptr, ptr %2, align 8, !tbaa !5
  %149 = getelementptr inbounds %struct.png_struct_def, ptr %148, i32 0, i32 15
  %150 = load i32, ptr %149, align 4, !tbaa !9
  %151 = and i32 %150, 32
  %152 = icmp ne i32 %151, 0
  br i1 %152, label %153, label %160

153:                                              ; preds = %147
  %154 = load ptr, ptr %2, align 8, !tbaa !5
  %155 = getelementptr inbounds %struct.png_struct_def, ptr %154, i32 0, i32 38
  %156 = load ptr, ptr %2, align 8, !tbaa !5
  %157 = getelementptr inbounds %struct.png_struct_def, ptr %156, i32 0, i32 33
  %158 = load ptr, ptr %157, align 8, !tbaa !21
  %159 = getelementptr inbounds i8, ptr %158, i64 1
  call void @png_do_invert(ptr noundef %155, ptr noundef %159)
  br label %160

160:                                              ; preds = %153, %147, %5
  ret void
}

declare void @png_do_strip_filler(ptr noundef, ptr noundef, i32 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, i32 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 292}
!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, !6, i64 272, !7, i64 280, !7, i64 281, !11, i64 284, !11, i64 288, !11, i64 292, !12, i64 296, !6, i64 408, !13, i64 416, !11, i64 424, !11, i64 428, !11, i64 432, !11, i64 436, !11, i64 440, !11, i64 444, !11, i64 448, !11, i64 452, !11, i64 456, !13, i64 464, !13, i64 472, !11, i64 480, !11, i64 484, !6, i64 488, !6, i64 496, !6, i64 504, !6, i64 512, !6, i64 520, !6, i64 528, !14, i64 536, !11, i64 560, !11, i64 564, !6, i64 568, !15, i64 576, !15, i64 578, !7, i64 580, !7, i64 585, !7, i64 586, !7, i64 587, !7, i64 588, !7, i64 589, !7, i64 590, !7, i64 591, !7, i64 592, !7, i64 593, !7, i64 594, !7, i64 595, !7, i64 596, !15, i64 598, !7, i64 600, !16, i64 604, !17, i64 608, !17, i64 618, !6, i64 632, !11, i64 640, !11, i64 644, !11, i64 648, !16, i64 652, !16, i64 656, !6, i64 664, !6, i64 672, !6, i64 680, !6, i64 688, !6, i64 696, !6, i64 704, !18, i64 712, !18, i64 717, !6, i64 728, !17, i64 736, !6, i64 752, !6, i64 760, !6, i64 768, !6, i64 776, !6, i64 784, !6, i64 792, !6, i64 800, !6, i64 808, !6, i64 816, !11, i64 824, !11, i64 828, !13, i64 832, !13, i64 840, !13, i64 848, !13, i64 856, !11, i64 864, !11, i64 868, !13, i64 872, !13, i64 880, !6, i64 888, !6, i64 896, !6, i64 904, !6, i64 912, !6, i64 920, !7, i64 928, !7, i64 929, !6, i64 936, !6, i64 944, !6, i64 952, !6, i64 960, !6, i64 968, !6, i64 976, !11, i64 984, !6, i64 992, !6, i64 1000, !11, i64 1008, !6, i64 1016, !7, i64 1024, !15, i64 1026, !15, i64 1028, !15, i64 1030, !11, i64 1032, !11, i64 1036, !7, i64 1040, !6, i64 1048, !6, i64 1056, !6, i64 1064, !6, i64 1072, !6, i64 1080, !6, i64 1088, !6, i64 1096, !7, i64 1104, !11, i64 1108, !11, i64 1112, !11, i64 1116, !19, i64 1120, !11, i64 1152, !11, i64 1156, !6, i64 1160, !11, i64 1168}
!11 = !{!"int", !7, i64 0}
!12 = !{!"z_stream_s", !6, i64 0, !11, i64 8, !13, i64 16, !6, i64 24, !11, i64 32, !13, i64 40, !6, i64 48, !6, i64 56, !6, i64 64, !6, i64 72, !6, i64 80, !11, i64 88, !13, i64 96, !13, i64 104}
!13 = !{!"long", !7, i64 0}
!14 = !{!"png_row_info_struct", !11, i64 0, !13, 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, !13, i64 16, !7, i64 24}
!20 = !{!10, !6, i64 264}
!21 = !{!10, !6, i64 496}
!22 = !{!10, !11, i64 288}
!23 = !{!10, !7, i64 591}


; 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 292
  %5 = load i32, ptr %4, align 4, !tbaa !5
  %6 = and i32 %5, 1048576
  %.not = icmp eq i32 %6, 0
  br i1 %.not, label %15, label %7

7:                                                ; preds = %3
  %8 = getelementptr inbounds i8, ptr %0, i64 264
  %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 536
  %12 = getelementptr inbounds i8, ptr %0, i64 496
  %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 i32, ptr %4, align 4, !tbaa !5
  br label %15

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

18:                                               ; preds = %15
  %19 = getelementptr inbounds i8, ptr %0, i64 536
  %20 = getelementptr inbounds i8, ptr %0, i64 496
  %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 i32, ptr %23, align 8, !tbaa !21
  tail call void @png_do_strip_filler(ptr noundef nonnull %19, ptr noundef nonnull %22, i32 noundef %24) #2
  %.pre48 = load i32, ptr %4, align 4, !tbaa !5
  br label %25

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

28:                                               ; preds = %25
  %29 = getelementptr inbounds i8, ptr %0, i64 536
  %30 = getelementptr inbounds i8, ptr %0, i64 496
  %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 i32, ptr %4, align 4, !tbaa !5
  br label %33

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

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

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

47:                                               ; preds = %44
  %48 = getelementptr inbounds i8, ptr %0, i64 536
  %49 = getelementptr inbounds i8, ptr %0, i64 496
  %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 i32, ptr %4, align 4, !tbaa !5
  br label %52

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

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

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

64:                                               ; preds = %61
  %65 = getelementptr inbounds i8, ptr %0, i64 536
  %66 = getelementptr inbounds i8, ptr %0, i64 496
  %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 i32, ptr %4, align 4, !tbaa !5
  br label %69

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

72:                                               ; preds = %69
  %73 = getelementptr inbounds i8, ptr %0, i64 536
  %74 = getelementptr inbounds i8, ptr %0, i64 496
  %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 i32, ptr %4, align 4, !tbaa !5
  br label %77

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

80:                                               ; preds = %77
  %81 = getelementptr inbounds i8, ptr %0, i64 536
  %82 = getelementptr inbounds i8, ptr %0, i64 496
  %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 i32, ptr %4, align 4, !tbaa !5
  br label %85

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

88:                                               ; preds = %85
  %89 = getelementptr inbounds i8, ptr %0, i64 536
  %90 = getelementptr inbounds i8, ptr %0, i64 496
  %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, i32 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, i32 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 292}
!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, !9, i64 272, !7, i64 280, !7, i64 281, !10, i64 284, !10, i64 288, !10, i64 292, !11, i64 296, !9, i64 408, !12, i64 416, !10, i64 424, !10, i64 428, !10, i64 432, !10, i64 436, !10, i64 440, !10, i64 444, !10, i64 448, !10, i64 452, !10, i64 456, !12, i64 464, !12, i64 472, !10, i64 480, !10, i64 484, !9, i64 488, !9, i64 496, !9, i64 504, !9, i64 512, !9, i64 520, !9, i64 528, !13, i64 536, !10, i64 560, !10, i64 564, !9, i64 568, !14, i64 576, !14, i64 578, !7, i64 580, !7, i64 585, !7, i64 586, !7, i64 587, !7, i64 588, !7, i64 589, !7, i64 590, !7, i64 591, !7, i64 592, !7, i64 593, !7, i64 594, !7, i64 595, !7, i64 596, !14, i64 598, !7, i64 600, !15, i64 604, !16, i64 608, !16, i64 618, !9, i64 632, !10, i64 640, !10, i64 644, !10, i64 648, !15, i64 652, !15, i64 656, !9, i64 664, !9, i64 672, !9, i64 680, !9, i64 688, !9, i64 696, !9, i64 704, !17, i64 712, !17, i64 717, !9, i64 728, !16, i64 736, !9, i64 752, !9, i64 760, !9, i64 768, !9, i64 776, !9, i64 784, !9, i64 792, !9, i64 800, !9, i64 808, !9, i64 816, !10, i64 824, !10, i64 828, !12, i64 832, !12, i64 840, !12, i64 848, !12, i64 856, !10, i64 864, !10, i64 868, !12, i64 872, !12, i64 880, !9, i64 888, !9, i64 896, !9, i64 904, !9, i64 912, !9, i64 920, !7, i64 928, !7, i64 929, !9, i64 936, !9, i64 944, !9, i64 952, !9, i64 960, !9, i64 968, !9, i64 976, !10, i64 984, !9, i64 992, !9, i64 1000, !10, i64 1008, !9, i64 1016, !7, i64 1024, !14, i64 1026, !14, i64 1028, !14, i64 1030, !10, i64 1032, !10, i64 1036, !7, i64 1040, !9, i64 1048, !9, i64 1056, !9, i64 1064, !9, i64 1072, !9, i64 1080, !9, i64 1088, !9, i64 1096, !7, i64 1104, !10, i64 1108, !10, i64 1112, !10, i64 1116, !18, i64 1120, !10, i64 1152, !10, i64 1156, !9, i64 1160, !10, i64 1168}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!"any pointer", !7, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = !{!"z_stream_s", !9, i64 0, !10, i64 8, !12, i64 16, !9, i64 24, !10, i64 32, !12, i64 40, !9, i64 48, !9, i64 56, !9, i64 64, !9, i64 72, !9, i64 80, !10, i64 88, !12, i64 96, !12, i64 104}
!12 = !{!"long", !7, i64 0}
!13 = !{!"png_row_info_struct", !10, i64 0, !12, 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, !12, i64 16, !7, i64 24}
!19 = !{!6, !9, i64 264}
!20 = !{!6, !9, i64 496}
!21 = !{!6, !10, i64 288}
!22 = !{!6, !7, i64 591}


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