; LLVM IR from Try/Tempest :: Engine/thirdparty/libpng (pngset)

; 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_info_def = type { i32, i32, i32, i64, ptr, i16, i16, i8, i8, i8, i8, i8, i8, i8, i8, [8 x i8], %struct.png_colorspace, ptr, ptr, i32, i32, i32, ptr, %struct.png_time_struct, %struct.png_color_8_struct, ptr, %struct.png_color_16_struct, %struct.png_color_16_struct, i32, i32, i8, i32, i32, i8, i32, ptr, ptr, ptr, ptr, i32, i32, ptr, ptr, i8, i8, i32, ptr, i32, ptr, i32, i8, ptr, ptr, ptr }
%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 }
%struct.png_time_struct = type { i16, i8, 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_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_unknown_chunk_t = type { [5 x i8], ptr, i64, i8 }

@.str.39 = external hidden unnamed_addr constant [50 x i8], align 1

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #0

; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1

; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1

declare void @png_warning(ptr noundef, ptr noundef) #2

declare void @png_free_data(ptr noundef, ptr noundef, i32 noundef, i32 noundef) #2

; Function Attrs: nounwind uwtable
define dso_local void @png_set_tRNS(ptr noalias noundef %0, ptr noalias noundef %1, ptr noundef %2, i32 noundef %3, ptr noundef %4) #3 {
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca i32, align 4
  %10 = alloca ptr, align 8
  %11 = alloca i32, align 4
  store ptr %0, ptr %6, align 8, !tbaa !5
  store ptr %1, ptr %7, align 8, !tbaa !5
  store ptr %2, ptr %8, align 8, !tbaa !5
  store i32 %3, ptr %9, align 4, !tbaa !9
  store ptr %4, ptr %10, align 8, !tbaa !5
  %12 = load ptr, ptr %6, align 8, !tbaa !5
  %13 = icmp eq ptr %12, null
  br i1 %13, label %17, label %14

14:                                               ; preds = %5
  %15 = load ptr, ptr %7, align 8, !tbaa !5
  %16 = icmp eq ptr %15, null
  br i1 %16, label %17, label %18

17:                                               ; preds = %14, %5
  br label %128

18:                                               ; preds = %14
  %19 = load ptr, ptr %8, align 8, !tbaa !5
  %20 = icmp ne ptr %19, null
  br i1 %20, label %21, label %46

21:                                               ; preds = %18
  %22 = load ptr, ptr %6, align 8, !tbaa !5
  %23 = load ptr, ptr %7, align 8, !tbaa !5
  call void @png_free_data(ptr noundef %22, ptr noundef %23, i32 noundef 8192, i32 noundef 0)
  %24 = load i32, ptr %9, align 4, !tbaa !9
  %25 = icmp sgt i32 %24, 0
  br i1 %25, label %26, label %40

26:                                               ; preds = %21
  %27 = load i32, ptr %9, align 4, !tbaa !9
  %28 = icmp sle i32 %27, 256
  br i1 %28, label %29, label %40

29:                                               ; preds = %26
  %30 = load ptr, ptr %6, align 8, !tbaa !5
  %31 = call noalias ptr @png_malloc(ptr noundef %30, i64 noundef 256)
  %32 = load ptr, ptr %7, align 8, !tbaa !5
  %33 = getelementptr inbounds %struct.png_info_def, ptr %32, i32 0, i32 25
  store ptr %31, ptr %33, align 8, !tbaa !11
  %34 = load ptr, ptr %7, align 8, !tbaa !5
  %35 = getelementptr inbounds %struct.png_info_def, ptr %34, i32 0, i32 25
  %36 = load ptr, ptr %35, align 8, !tbaa !11
  %37 = load ptr, ptr %8, align 8, !tbaa !5
  %38 = load i32, ptr %9, align 4, !tbaa !9
  %39 = sext i32 %38 to i64
  call void @llvm.memcpy.p0.p0.i64(ptr align 1 %36, ptr align 1 %37, i64 %39, i1 false)
  br label %40

40:                                               ; preds = %29, %26, %21
  %41 = load ptr, ptr %7, align 8, !tbaa !5
  %42 = getelementptr inbounds %struct.png_info_def, ptr %41, i32 0, i32 25
  %43 = load ptr, ptr %42, align 8, !tbaa !11
  %44 = load ptr, ptr %6, align 8, !tbaa !5
  %45 = getelementptr inbounds %struct.png_struct_def, ptr %44, i32 0, i32 89
  store ptr %43, ptr %45, align 8, !tbaa !21
  br label %46

46:                                               ; preds = %40, %18
  %47 = load ptr, ptr %10, align 8, !tbaa !5
  %48 = icmp ne ptr %47, null
  br i1 %48, label %49, label %112

49:                                               ; preds = %46
  %50 = load ptr, ptr %7, align 8, !tbaa !5
  %51 = getelementptr inbounds %struct.png_info_def, ptr %50, i32 0, i32 7
  %52 = load i8, ptr %51, align 4, !tbaa !25
  %53 = zext i8 %52 to i32
  %54 = icmp slt i32 %53, 16
  br i1 %54, label %55, label %104

55:                                               ; preds = %49
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #4
  %56 = load ptr, ptr %7, align 8, !tbaa !5
  %57 = getelementptr inbounds %struct.png_info_def, ptr %56, i32 0, i32 7
  %58 = load i8, ptr %57, align 4, !tbaa !25
  %59 = zext i8 %58 to i32
  %60 = shl i32 1, %59
  %61 = sub nsw i32 %60, 1
  store i32 %61, ptr %11, align 4, !tbaa !9
  %62 = load ptr, ptr %7, align 8, !tbaa !5
  %63 = getelementptr inbounds %struct.png_info_def, ptr %62, i32 0, i32 8
  %64 = load i8, ptr %63, align 1, !tbaa !26
  %65 = zext i8 %64 to i32
  %66 = icmp eq i32 %65, 0
  br i1 %66, label %67, label %74

67:                                               ; preds = %55
  %68 = load ptr, ptr %10, align 8, !tbaa !5
  %69 = getelementptr inbounds %struct.png_color_16_struct, ptr %68, i32 0, i32 4
  %70 = load i16, ptr %69, align 2, !tbaa !27
  %71 = zext i16 %70 to i32
  %72 = load i32, ptr %11, align 4, !tbaa !9
  %73 = icmp sgt i32 %71, %72
  br i1 %73, label %101, label %74

74:                                               ; preds = %67, %55
  %75 = load ptr, ptr %7, align 8, !tbaa !5
  %76 = getelementptr inbounds %struct.png_info_def, ptr %75, i32 0, i32 8
  %77 = load i8, ptr %76, align 1, !tbaa !26
  %78 = zext i8 %77 to i32
  %79 = icmp eq i32 %78, 2
  br i1 %79, label %80, label %103

80:                                               ; preds = %74
  %81 = load ptr, ptr %10, align 8, !tbaa !5
  %82 = getelementptr inbounds %struct.png_color_16_struct, ptr %81, i32 0, i32 1
  %83 = load i16, ptr %82, align 2, !tbaa !28
  %84 = zext i16 %83 to i32
  %85 = load i32, ptr %11, align 4, !tbaa !9
  %86 = icmp sgt i32 %84, %85
  br i1 %86, label %101, label %87

87:                                               ; preds = %80
  %88 = load ptr, ptr %10, align 8, !tbaa !5
  %89 = getelementptr inbounds %struct.png_color_16_struct, ptr %88, i32 0, i32 2
  %90 = load i16, ptr %89, align 2, !tbaa !29
  %91 = zext i16 %90 to i32
  %92 = load i32, ptr %11, align 4, !tbaa !9
  %93 = icmp sgt i32 %91, %92
  br i1 %93, label %101, label %94

94:                                               ; preds = %87
  %95 = load ptr, ptr %10, align 8, !tbaa !5
  %96 = getelementptr inbounds %struct.png_color_16_struct, ptr %95, i32 0, i32 3
  %97 = load i16, ptr %96, align 2, !tbaa !30
  %98 = zext i16 %97 to i32
  %99 = load i32, ptr %11, align 4, !tbaa !9
  %100 = icmp sgt i32 %98, %99
  br i1 %100, label %101, label %103

101:                                              ; preds = %94, %87, %80, %67
  %102 = load ptr, ptr %6, align 8, !tbaa !5
  call void @png_warning(ptr noundef %102, ptr noundef @.str.39)
  br label %103

103:                                              ; preds = %101, %94, %74
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #4
  br label %104

104:                                              ; preds = %103, %49
  %105 = load ptr, ptr %7, align 8, !tbaa !5
  %106 = getelementptr inbounds %struct.png_info_def, ptr %105, i32 0, i32 26
  %107 = load ptr, ptr %10, align 8, !tbaa !5
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %106, ptr align 2 %107, i64 10, i1 false), !tbaa.struct !31
  %108 = load i32, ptr %9, align 4, !tbaa !9
  %109 = icmp eq i32 %108, 0
  br i1 %109, label %110, label %111

110:                                              ; preds = %104
  store i32 1, ptr %9, align 4, !tbaa !9
  br label %111

111:                                              ; preds = %110, %104
  br label %112

112:                                              ; preds = %111, %46
  %113 = load i32, ptr %9, align 4, !tbaa !9
  %114 = trunc i32 %113 to i16
  %115 = load ptr, ptr %7, align 8, !tbaa !5
  %116 = getelementptr inbounds %struct.png_info_def, ptr %115, i32 0, i32 6
  store i16 %114, ptr %116, align 2, !tbaa !34
  %117 = load i32, ptr %9, align 4, !tbaa !9
  %118 = icmp ne i32 %117, 0
  br i1 %118, label %119, label %128

119:                                              ; preds = %112
  %120 = load ptr, ptr %7, align 8, !tbaa !5
  %121 = getelementptr inbounds %struct.png_info_def, ptr %120, i32 0, i32 2
  %122 = load i32, ptr %121, align 8, !tbaa !35
  %123 = or i32 %122, 16
  store i32 %123, ptr %121, align 8, !tbaa !35
  %124 = load ptr, ptr %7, align 8, !tbaa !5
  %125 = getelementptr inbounds %struct.png_info_def, ptr %124, i32 0, i32 45
  %126 = load i32, ptr %125, align 4, !tbaa !36
  %127 = or i32 %126, 8192
  store i32 %127, ptr %125, align 4, !tbaa !36
  br label %128

128:                                              ; preds = %119, %112, %17
  ret void
}

declare noalias ptr @png_malloc(ptr noundef, i64 noundef) #2

attributes #0 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { "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 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 #4 = { 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 = !{!"int", !7, i64 0}
!11 = !{!12, !6, i64 184}
!12 = !{!"png_info_def", !10, i64 0, !10, i64 4, !10, i64 8, !13, i64 16, !6, i64 24, !14, i64 32, !14, i64 34, !7, i64 36, !7, i64 37, !7, i64 38, !7, i64 39, !7, i64 40, !7, i64 41, !7, i64 42, !7, i64 43, !7, i64 44, !15, i64 52, !6, i64 128, !6, i64 136, !10, i64 144, !10, i64 148, !10, i64 152, !6, i64 160, !18, i64 168, !19, i64 176, !6, i64 184, !20, i64 192, !20, i64 202, !10, i64 212, !10, i64 216, !7, i64 220, !10, i64 224, !10, i64 228, !7, i64 232, !10, i64 236, !6, i64 240, !6, i64 248, !6, i64 256, !6, i64 264, !10, i64 272, !10, i64 276, !6, i64 280, !6, i64 288, !7, i64 296, !7, i64 297, !10, i64 300, !6, i64 304, !10, i64 312, !6, i64 320, !10, i64 328, !7, i64 332, !6, i64 336, !6, i64 344, !6, i64 352}
!13 = !{!"long", !7, i64 0}
!14 = !{!"short", !7, i64 0}
!15 = !{!"png_colorspace", !10, i64 0, !16, i64 4, !17, i64 36, !14, i64 72, !14, i64 74}
!16 = !{!"png_xy", !10, i64 0, !10, i64 4, !10, i64 8, !10, i64 12, !10, i64 16, !10, i64 20, !10, i64 24, !10, i64 28}
!17 = !{!"png_XYZ", !10, i64 0, !10, i64 4, !10, i64 8, !10, i64 12, !10, i64 16, !10, i64 20, !10, i64 24, !10, i64 28, !10, i64 32}
!18 = !{!"png_time_struct", !14, i64 0, !7, i64 2, !7, i64 3, !7, i64 4, !7, i64 5, !7, i64 6}
!19 = !{!"png_color_8_struct", !7, i64 0, !7, i64 1, !7, i64 2, !7, i64 3, !7, i64 4}
!20 = !{!"png_color_16_struct", !7, i64 0, !14, i64 2, !14, i64 4, !14, i64 6, !14, i64 8}
!21 = !{!22, !6, i64 744}
!22 = !{!"png_struct_def", !7, i64 0, !6, i64 200, !6, i64 208, !13, 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, !10, i64 300, !10, i64 304, !10, i64 308, !10, i64 312, !23, i64 320, !6, i64 432, !10, i64 440, !10, i64 444, !10, i64 448, !10, i64 452, !10, i64 456, !10, i64 460, !10, i64 464, !10, i64 468, !10, i64 472, !10, i64 476, !10, i64 480, !10, i64 484, !10, i64 488, !10, i64 492, !10, i64 496, !10, i64 500, !10, i64 504, !10, i64 508, !10, i64 512, !10, i64 516, !13, i64 520, !10, i64 528, !10, i64 532, !10, i64 536, !6, i64 544, !6, i64 552, !6, i64 560, !6, i64 568, !13, i64 576, !10, i64 584, !10, i64 588, !6, i64 592, !14, i64 600, !10, 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, !10, i64 632, !20, i64 636, !20, i64 646, !6, i64 656, !10, i64 664, !10, i64 668, !10, i64 672, !10, i64 676, !6, i64 680, !6, i64 688, !6, i64 696, !6, i64 704, !6, i64 712, !6, i64 720, !19, i64 728, !19, i64 733, !6, i64 744, !20, 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, !10, i64 840, !10, i64 844, !13, i64 848, !13, i64 856, !13, i64 864, !13, i64 872, !10, i64 880, !10, i64 884, !6, i64 888, !6, i64 896, !10, i64 904, !7, i64 908, !10, i64 940, !6, i64 944, !6, i64 952, !10, i64 960, !10, i64 964, !6, i64 968, !7, i64 976, !7, i64 977, !14, i64 978, !14, i64 980, !10, 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, !10, i64 1052, !10, i64 1056, !10, i64 1060, !13, i64 1064, !24, i64 1072, !13, i64 1104, !6, i64 1112, !13, i64 1120, !10, i64 1128, !10, i64 1132, !6, i64 1136, !7, i64 1144, !15, i64 1176}
!23 = !{!"z_stream_s", !6, i64 0, !10, i64 8, !13, i64 16, !6, i64 24, !10, i64 32, !13, i64 40, !6, i64 48, !6, i64 56, !6, i64 64, !6, i64 72, !6, i64 80, !10, i64 88, !13, i64 96, !13, i64 104}
!24 = !{!"png_unknown_chunk_t", !7, i64 0, !6, i64 8, !13, i64 16, !7, i64 24}
!25 = !{!12, !7, i64 36}
!26 = !{!12, !7, i64 37}
!27 = !{!20, !14, i64 8}
!28 = !{!20, !14, i64 2}
!29 = !{!20, !14, i64 4}
!30 = !{!20, !14, i64 6}
!31 = !{i64 0, i64 1, !32, i64 2, i64 2, !33, i64 4, i64 2, !33, i64 6, i64 2, !33, i64 8, i64 2, !33}
!32 = !{!7, !7, i64 0}
!33 = !{!14, !14, i64 0}
!34 = !{!12, !14, i64 34}
!35 = !{!12, !10, i64 8}
!36 = !{!12, !10, i64 300}


; 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.39 = external hidden unnamed_addr constant [50 x i8], align 1

; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #0

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

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

; Function Attrs: nounwind uwtable
define dso_local void @png_set_tRNS(ptr noalias noundef %0, ptr noalias noundef %1, ptr noundef readonly %2, i32 noundef %3, ptr noundef readonly %4) local_unnamed_addr #2 {
  %6 = icmp eq ptr %0, null
  %7 = icmp eq ptr %1, null
  %or.cond = or i1 %6, %7
  br i1 %or.cond, label %62, label %8

8:                                                ; preds = %5
  %.not = icmp eq ptr %2, null
  br i1 %.not, label %18, label %9

9:                                                ; preds = %8
  tail call void @png_free_data(ptr noundef nonnull %0, ptr noundef nonnull %1, i32 noundef 8192, i32 noundef 0) #4
  %10 = add i32 %3, -1
  %or.cond3 = icmp ult i32 %10, 256
  br i1 %or.cond3, label %11, label %._crit_edge

._crit_edge:                                      ; preds = %9
  %.phi.trans.insert = getelementptr inbounds i8, ptr %1, i64 184
  %.pre = load ptr, ptr %.phi.trans.insert, align 8, !tbaa !5
  br label %15

11:                                               ; preds = %9
  %12 = tail call noalias ptr @png_malloc(ptr noundef nonnull %0, i64 noundef 256) #4
  %13 = getelementptr inbounds i8, ptr %1, i64 184
  store ptr %12, ptr %13, align 8, !tbaa !5
  %14 = zext nneg i32 %3 to i64
  tail call void @llvm.memcpy.p0.p0.i64(ptr align 1 %12, ptr nonnull align 1 %2, i64 %14, i1 false)
  br label %15

15:                                               ; preds = %._crit_edge, %11
  %16 = phi ptr [ %.pre, %._crit_edge ], [ %12, %11 ]
  %17 = getelementptr inbounds i8, ptr %0, i64 744
  store ptr %16, ptr %17, align 8, !tbaa !19
  br label %18

18:                                               ; preds = %15, %8
  %.not45 = icmp eq ptr %4, null
  br i1 %.not45, label %52, label %19

19:                                               ; preds = %18
  %20 = getelementptr inbounds i8, ptr %1, i64 36
  %21 = load i8, ptr %20, align 4, !tbaa !23
  %22 = icmp ult i8 %21, 16
  br i1 %22, label %23, label %.thread47

23:                                               ; preds = %19
  %24 = zext nneg i8 %21 to i32
  %notmask = shl nsw i32 -1, %24
  %25 = xor i32 %notmask, -1
  %26 = getelementptr inbounds i8, ptr %1, i64 37
  %27 = load i8, ptr %26, align 1, !tbaa !24
  switch i8 %27, label %.thread47 [
    i8 0, label %28
    i8 2, label %33
  ]

28:                                               ; preds = %23
  %29 = getelementptr inbounds i8, ptr %4, i64 8
  %30 = load i16, ptr %29, align 2, !tbaa !25
  %31 = zext i16 %30 to i32
  %32 = icmp ugt i32 %31, %25
  br i1 %32, label %48, label %.thread47

33:                                               ; preds = %23
  %34 = getelementptr inbounds i8, ptr %4, i64 2
  %35 = load i16, ptr %34, align 2, !tbaa !26
  %36 = zext i16 %35 to i32
  %37 = icmp ugt i32 %36, %25
  br i1 %37, label %48, label %38

38:                                               ; preds = %33
  %39 = getelementptr inbounds i8, ptr %4, i64 4
  %40 = load i16, ptr %39, align 2, !tbaa !27
  %41 = zext i16 %40 to i32
  %42 = icmp ugt i32 %41, %25
  br i1 %42, label %48, label %43

43:                                               ; preds = %38
  %44 = getelementptr inbounds i8, ptr %4, i64 6
  %45 = load i16, ptr %44, align 2, !tbaa !28
  %46 = zext i16 %45 to i32
  %47 = icmp ugt i32 %46, %25
  br i1 %47, label %48, label %.thread47

48:                                               ; preds = %43, %38, %33, %28
  tail call void @png_warning(ptr noundef nonnull %0, ptr noundef nonnull @.str.39) #4
  br label %.thread47

.thread47:                                        ; preds = %23, %19, %48, %43, %28
  %49 = getelementptr inbounds i8, ptr %1, i64 192
  tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(10) %49, ptr noundef nonnull align 2 dereferenceable(10) %4, i64 10, i1 false), !tbaa.struct !29
  %spec.store.select = tail call i32 @llvm.umax.i32(i32 %3, i32 1)
  %50 = trunc i32 %spec.store.select to i16
  %51 = getelementptr inbounds i8, ptr %1, i64 34
  store i16 %50, ptr %51, align 2, !tbaa !32
  br label %55

52:                                               ; preds = %18
  %53 = trunc i32 %3 to i16
  %54 = getelementptr inbounds i8, ptr %1, i64 34
  store i16 %53, ptr %54, align 2, !tbaa !32
  %.not46 = icmp eq i32 %3, 0
  br i1 %.not46, label %62, label %55

55:                                               ; preds = %.thread47, %52
  %56 = getelementptr inbounds i8, ptr %1, i64 8
  %57 = load i32, ptr %56, align 8, !tbaa !33
  %58 = or i32 %57, 16
  store i32 %58, ptr %56, align 8, !tbaa !33
  %59 = getelementptr inbounds i8, ptr %1, i64 300
  %60 = load i32, ptr %59, align 4, !tbaa !34
  %61 = or i32 %60, 8192
  store i32 %61, ptr %59, align 4, !tbaa !34
  br label %62

62:                                               ; preds = %5, %55, %52
  ret void
}

declare noalias ptr @png_malloc(ptr noundef, i64 noundef) local_unnamed_addr #1

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.umax.i32(i32, i32) #3

attributes #0 = { mustprogress nocallback nofree 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 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #4 = { 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 184}
!6 = !{!"png_info_def", !7, i64 0, !7, i64 4, !7, i64 8, !10, i64 16, !11, i64 24, !12, i64 32, !12, i64 34, !8, i64 36, !8, i64 37, !8, i64 38, !8, i64 39, !8, i64 40, !8, i64 41, !8, i64 42, !8, i64 43, !8, i64 44, !13, i64 52, !11, i64 128, !11, i64 136, !7, i64 144, !7, i64 148, !7, i64 152, !11, i64 160, !16, i64 168, !17, i64 176, !11, i64 184, !18, i64 192, !18, i64 202, !7, i64 212, !7, i64 216, !8, i64 220, !7, i64 224, !7, i64 228, !8, i64 232, !7, i64 236, !11, i64 240, !11, i64 248, !11, i64 256, !11, i64 264, !7, i64 272, !7, i64 276, !11, i64 280, !11, i64 288, !8, i64 296, !8, i64 297, !7, i64 300, !11, i64 304, !7, i64 312, !11, i64 320, !7, i64 328, !8, i64 332, !11, i64 336, !11, i64 344, !11, i64 352}
!7 = !{!"int", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"long", !8, i64 0}
!11 = !{!"any pointer", !8, i64 0}
!12 = !{!"short", !8, i64 0}
!13 = !{!"png_colorspace", !7, i64 0, !14, i64 4, !15, i64 36, !12, i64 72, !12, i64 74}
!14 = !{!"png_xy", !7, i64 0, !7, i64 4, !7, i64 8, !7, i64 12, !7, i64 16, !7, i64 20, !7, i64 24, !7, i64 28}
!15 = !{!"png_XYZ", !7, i64 0, !7, i64 4, !7, i64 8, !7, i64 12, !7, i64 16, !7, i64 20, !7, i64 24, !7, i64 28, !7, i64 32}
!16 = !{!"png_time_struct", !12, i64 0, !8, i64 2, !8, i64 3, !8, i64 4, !8, i64 5, !8, i64 6}
!17 = !{!"png_color_8_struct", !8, i64 0, !8, i64 1, !8, i64 2, !8, i64 3, !8, i64 4}
!18 = !{!"png_color_16_struct", !8, i64 0, !12, i64 2, !12, i64 4, !12, i64 6, !12, i64 8}
!19 = !{!20, !11, i64 744}
!20 = !{!"png_struct_def", !8, i64 0, !11, i64 200, !11, i64 208, !10, i64 216, !11, i64 224, !11, i64 232, !11, i64 240, !11, i64 248, !11, i64 256, !11, i64 264, !11, i64 272, !11, i64 280, !11, i64 288, !8, i64 296, !8, i64 297, !7, i64 300, !7, i64 304, !7, i64 308, !7, i64 312, !21, i64 320, !11, i64 432, !7, i64 440, !7, i64 444, !7, i64 448, !7, i64 452, !7, i64 456, !7, i64 460, !7, i64 464, !7, i64 468, !7, i64 472, !7, i64 476, !7, i64 480, !7, i64 484, !7, i64 488, !7, i64 492, !7, i64 496, !7, i64 500, !7, i64 504, !7, i64 508, !7, i64 512, !7, i64 516, !10, i64 520, !7, i64 528, !7, i64 532, !7, i64 536, !11, i64 544, !11, i64 552, !11, i64 560, !11, i64 568, !10, i64 576, !7, i64 584, !7, i64 588, !11, i64 592, !12, i64 600, !7, i64 604, !12, i64 608, !8, i64 610, !8, i64 611, !8, i64 612, !8, i64 613, !8, i64 614, !8, i64 615, !8, i64 616, !8, i64 617, !8, i64 618, !8, i64 619, !8, i64 620, !8, i64 621, !8, i64 622, !8, i64 623, !8, i64 624, !12, i64 626, !8, i64 628, !7, i64 632, !18, i64 636, !18, i64 646, !11, i64 656, !7, i64 664, !7, i64 668, !7, i64 672, !7, i64 676, !11, i64 680, !11, i64 688, !11, i64 696, !11, i64 704, !11, i64 712, !11, i64 720, !17, i64 728, !17, i64 733, !11, i64 744, !18, i64 752, !11, i64 768, !11, i64 776, !11, i64 784, !11, i64 792, !11, i64 800, !11, i64 808, !11, i64 816, !11, i64 824, !11, i64 832, !7, i64 840, !7, i64 844, !10, i64 848, !10, i64 856, !10, i64 864, !10, i64 872, !7, i64 880, !7, i64 884, !11, i64 888, !11, i64 896, !7, i64 904, !8, i64 908, !7, i64 940, !11, i64 944, !11, i64 952, !7, i64 960, !7, i64 964, !11, i64 968, !8, i64 976, !8, i64 977, !12, i64 978, !12, i64 980, !7, i64 984, !8, i64 988, !11, i64 992, !11, i64 1000, !11, i64 1008, !11, i64 1016, !11, i64 1024, !11, i64 1032, !11, i64 1040, !8, i64 1048, !7, i64 1052, !7, i64 1056, !7, i64 1060, !10, i64 1064, !22, i64 1072, !10, i64 1104, !11, i64 1112, !10, i64 1120, !7, i64 1128, !7, i64 1132, !11, i64 1136, !8, i64 1144, !13, i64 1176}
!21 = !{!"z_stream_s", !11, i64 0, !7, i64 8, !10, i64 16, !11, i64 24, !7, i64 32, !10, i64 40, !11, i64 48, !11, i64 56, !11, i64 64, !11, i64 72, !11, i64 80, !7, i64 88, !10, i64 96, !10, i64 104}
!22 = !{!"png_unknown_chunk_t", !8, i64 0, !11, i64 8, !10, i64 16, !8, i64 24}
!23 = !{!6, !8, i64 36}
!24 = !{!6, !8, i64 37}
!25 = !{!18, !12, i64 8}
!26 = !{!18, !12, i64 2}
!27 = !{!18, !12, i64 4}
!28 = !{!18, !12, i64 6}
!29 = !{i64 0, i64 1, !30, i64 2, i64 2, !31, i64 4, i64 2, !31, i64 6, i64 2, !31, i64 8, i64 2, !31}
!30 = !{!8, !8, i64 0}
!31 = !{!12, !12, i64 0}
!32 = !{!6, !12, i64 34}
!33 = !{!6, !7, i64 8}
!34 = !{!6, !7, i64 300}


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