; LLVM IR from niessner/Matterport :: code/gaps/pkgs/png (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_struct = type { i32, i32, i32, i64, ptr, i16, i16, i8, i8, i8, i8, i8, i8, i8, i8, [8 x i8], float, i8, i32, i32, ptr, %struct.png_time_struct, %struct.png_color_8_struct, ptr, %struct.png_color_16_struct, %struct.png_color_16_struct, i32, i32, i8, i32, i32, i8, ptr, float, float, float, float, float, float, float, float, ptr, i32, i32, ptr, ptr, i8, i8, i32, ptr, i64, ptr, ptr, i32, i8, ptr, i32, i8, double, double, ptr, ptr, ptr, 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, 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_unknown_chunk_t = type { [5 x i8], ptr, i64, i8 }

@.str.13 = 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

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

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

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 noundef %0, ptr 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 %117

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

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 ptr, ptr %6, align 8, !tbaa !5
  %25 = call ptr @png_malloc(ptr noundef %24, i64 noundef 256)
  %26 = load ptr, ptr %7, align 8, !tbaa !5
  %27 = getelementptr inbounds %struct.png_info_struct, ptr %26, i32 0, i32 23
  store ptr %25, ptr %27, align 8, !tbaa !11
  %28 = load ptr, ptr %6, align 8, !tbaa !5
  %29 = getelementptr inbounds %struct.png_struct_def, ptr %28, i32 0, i32 76
  store ptr %25, ptr %29, align 8, !tbaa !20
  %30 = load i32, ptr %9, align 4, !tbaa !9
  %31 = icmp sgt i32 %30, 0
  br i1 %31, label %32, label %42

32:                                               ; preds = %21
  %33 = load i32, ptr %9, align 4, !tbaa !9
  %34 = icmp sle i32 %33, 256
  br i1 %34, label %35, label %42

35:                                               ; preds = %32
  %36 = load ptr, ptr %7, align 8, !tbaa !5
  %37 = getelementptr inbounds %struct.png_info_struct, ptr %36, i32 0, i32 23
  %38 = load ptr, ptr %37, align 8, !tbaa !11
  %39 = load ptr, ptr %8, align 8, !tbaa !5
  %40 = load i32, ptr %9, align 4, !tbaa !9
  %41 = sext i32 %40 to i64
  call void @llvm.memcpy.p0.p0.i64(ptr align 1 %38, ptr align 1 %39, i64 %41, i1 false)
  br label %42

42:                                               ; preds = %35, %32, %21
  br label %43

43:                                               ; preds = %42, %18
  %44 = load ptr, ptr %10, align 8, !tbaa !5
  %45 = icmp ne ptr %44, null
  br i1 %45, label %46, label %101

46:                                               ; preds = %43
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #4
  %47 = load ptr, ptr %7, align 8, !tbaa !5
  %48 = getelementptr inbounds %struct.png_info_struct, ptr %47, i32 0, i32 7
  %49 = load i8, ptr %48, align 4, !tbaa !25
  %50 = zext i8 %49 to i32
  %51 = shl i32 1, %50
  store i32 %51, ptr %11, align 4, !tbaa !9
  %52 = load ptr, ptr %7, align 8, !tbaa !5
  %53 = getelementptr inbounds %struct.png_info_struct, ptr %52, i32 0, i32 8
  %54 = load i8, ptr %53, align 1, !tbaa !26
  %55 = zext i8 %54 to i32
  %56 = icmp eq i32 %55, 0
  br i1 %56, label %57, label %64

57:                                               ; preds = %46
  %58 = load ptr, ptr %10, align 8, !tbaa !5
  %59 = getelementptr inbounds %struct.png_color_16_struct, ptr %58, i32 0, i32 4
  %60 = load i16, ptr %59, align 2, !tbaa !27
  %61 = zext i16 %60 to i32
  %62 = load i32, ptr %11, align 4, !tbaa !9
  %63 = icmp sgt i32 %61, %62
  br i1 %63, label %91, label %64

64:                                               ; preds = %57, %46
  %65 = load ptr, ptr %7, align 8, !tbaa !5
  %66 = getelementptr inbounds %struct.png_info_struct, ptr %65, i32 0, i32 8
  %67 = load i8, ptr %66, align 1, !tbaa !26
  %68 = zext i8 %67 to i32
  %69 = icmp eq i32 %68, 2
  br i1 %69, label %70, label %93

70:                                               ; preds = %64
  %71 = load ptr, ptr %10, align 8, !tbaa !5
  %72 = getelementptr inbounds %struct.png_color_16_struct, ptr %71, i32 0, i32 1
  %73 = load i16, ptr %72, align 2, !tbaa !28
  %74 = zext i16 %73 to i32
  %75 = load i32, ptr %11, align 4, !tbaa !9
  %76 = icmp sgt i32 %74, %75
  br i1 %76, label %91, label %77

77:                                               ; preds = %70
  %78 = load ptr, ptr %10, align 8, !tbaa !5
  %79 = getelementptr inbounds %struct.png_color_16_struct, ptr %78, i32 0, i32 2
  %80 = load i16, ptr %79, align 2, !tbaa !29
  %81 = zext i16 %80 to i32
  %82 = load i32, ptr %11, align 4, !tbaa !9
  %83 = icmp sgt i32 %81, %82
  br i1 %83, label %91, label %84

84:                                               ; preds = %77
  %85 = load ptr, ptr %10, align 8, !tbaa !5
  %86 = getelementptr inbounds %struct.png_color_16_struct, ptr %85, i32 0, i32 3
  %87 = load i16, ptr %86, align 2, !tbaa !30
  %88 = zext i16 %87 to i32
  %89 = load i32, ptr %11, align 4, !tbaa !9
  %90 = icmp sgt i32 %88, %89
  br i1 %90, label %91, label %93

91:                                               ; preds = %84, %77, %70, %57
  %92 = load ptr, ptr %6, align 8, !tbaa !5
  call void @png_warning(ptr noundef %92, ptr noundef @.str.13)
  br label %93

93:                                               ; preds = %91, %84, %64
  %94 = load ptr, ptr %7, align 8, !tbaa !5
  %95 = getelementptr inbounds %struct.png_info_struct, ptr %94, i32 0, i32 24
  %96 = load ptr, ptr %10, align 8, !tbaa !5
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %95, ptr align 2 %96, i64 10, i1 false)
  %97 = load i32, ptr %9, align 4, !tbaa !9
  %98 = icmp eq i32 %97, 0
  br i1 %98, label %99, label %100

99:                                               ; preds = %93
  store i32 1, ptr %9, align 4, !tbaa !9
  br label %100

100:                                              ; preds = %99, %93
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #4
  br label %101

101:                                              ; preds = %100, %43
  %102 = load i32, ptr %9, align 4, !tbaa !9
  %103 = trunc i32 %102 to i16
  %104 = load ptr, ptr %7, align 8, !tbaa !5
  %105 = getelementptr inbounds %struct.png_info_struct, ptr %104, i32 0, i32 6
  store i16 %103, ptr %105, align 2, !tbaa !31
  %106 = load i32, ptr %9, align 4, !tbaa !9
  %107 = icmp ne i32 %106, 0
  br i1 %107, label %108, label %117

108:                                              ; preds = %101
  %109 = load ptr, ptr %7, align 8, !tbaa !5
  %110 = getelementptr inbounds %struct.png_info_struct, ptr %109, i32 0, i32 2
  %111 = load i32, ptr %110, align 8, !tbaa !32
  %112 = or i32 %111, 16
  store i32 %112, ptr %110, align 8, !tbaa !32
  %113 = load ptr, ptr %7, align 8, !tbaa !5
  %114 = getelementptr inbounds %struct.png_info_struct, ptr %113, i32 0, i32 48
  %115 = load i32, ptr %114, align 4, !tbaa !33
  %116 = or i32 %115, 8192
  store i32 %116, ptr %114, align 4, !tbaa !33
  br label %117

117:                                              ; preds = %108, %101, %17
  ret void
}

declare 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 96}
!12 = !{!"png_info_struct", !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, !7, i64 56, !10, i64 60, !10, i64 64, !6, i64 72, !16, i64 80, !17, i64 88, !6, i64 96, !18, i64 104, !18, i64 114, !10, i64 124, !10, i64 128, !7, i64 132, !10, i64 136, !10, i64 140, !7, i64 144, !6, i64 152, !15, i64 160, !15, i64 164, !15, i64 168, !15, i64 172, !15, i64 176, !15, i64 180, !15, i64 184, !15, i64 188, !6, i64 192, !10, i64 200, !10, i64 204, !6, i64 208, !6, i64 216, !7, i64 224, !7, i64 225, !10, i64 228, !6, i64 232, !13, i64 240, !6, i64 248, !6, i64 256, !10, i64 264, !7, i64 268, !6, i64 272, !10, i64 280, !7, i64 284, !19, i64 288, !19, i64 296, !6, i64 304, !6, i64 312, !6, i64 320, !10, i64 328, !10, i64 332, !10, i64 336, !10, i64 340, !10, i64 344, !10, i64 348, !10, i64 352, !10, i64 356, !10, i64 360}
!13 = !{!"long", !7, i64 0}
!14 = !{!"short", !7, i64 0}
!15 = !{!"float", !7, i64 0}
!16 = !{!"png_time_struct", !14, i64 0, !7, i64 2, !7, i64 3, !7, i64 4, !7, i64 5, !7, i64 6}
!17 = !{!"png_color_8_struct", !7, i64 0, !7, i64 1, !7, i64 2, !7, i64 3, !7, i64 4}
!18 = !{!"png_color_16_struct", !7, i64 0, !14, i64 2, !14, i64 4, !14, i64 6, !14, i64 8}
!19 = !{!"double", !7, i64 0}
!20 = !{!21, !6, i64 728}
!21 = !{!"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, !10, i64 284, !10, i64 288, !10, i64 292, !22, i64 296, !6, i64 408, !13, 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, !13, i64 464, !13, i64 472, !10, i64 480, !10, i64 484, !6, i64 488, !6, i64 496, !6, i64 504, !6, i64 512, !6, i64 520, !6, i64 528, !23, i64 536, !10, i64 560, !10, i64 564, !6, 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, !18, i64 608, !18, i64 618, !6, i64 632, !10, i64 640, !10, i64 644, !10, i64 648, !15, i64 652, !15, i64 656, !6, i64 664, !6, i64 672, !6, i64 680, !6, i64 688, !6, i64 696, !6, i64 704, !17, i64 712, !17, i64 717, !6, i64 728, !18, 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, !10, i64 824, !10, i64 828, !13, i64 832, !13, i64 840, !13, i64 848, !13, i64 856, !10, i64 864, !10, 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, !10, i64 984, !6, i64 992, !6, i64 1000, !10, i64 1008, !6, i64 1016, !7, i64 1024, !14, i64 1026, !14, i64 1028, !14, i64 1030, !10, i64 1032, !10, 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, !10, i64 1108, !10, i64 1112, !10, i64 1116, !24, i64 1120, !10, i64 1152, !10, i64 1156, !6, i64 1160, !10, i64 1168}
!22 = !{!"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}
!23 = !{!"png_row_info_struct", !10, i64 0, !13, i64 8, !7, i64 16, !7, i64 17, !7, i64 18, !7, i64 19}
!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 = !{!18, !14, i64 8}
!28 = !{!18, !14, i64 2}
!29 = !{!18, !14, i64 4}
!30 = !{!18, !14, i64 6}
!31 = !{!12, !14, i64 34}
!32 = !{!12, !10, i64 8}
!33 = !{!12, !10, i64 228}


; 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.13 = 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 noundef %0, ptr 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 %58, label %8

8:                                                ; preds = %5
  %.not = icmp eq ptr %2, null
  br i1 %.not, label %16, 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 = tail call ptr @png_malloc(ptr noundef nonnull %0, i64 noundef 256) #4
  %11 = getelementptr inbounds i8, ptr %1, i64 96
  store ptr %10, ptr %11, align 8, !tbaa !5
  %12 = getelementptr inbounds i8, ptr %0, i64 728
  store ptr %10, ptr %12, align 8, !tbaa !18
  %13 = add i32 %3, -1
  %or.cond3 = icmp ult i32 %13, 256
  br i1 %or.cond3, label %14, label %16

14:                                               ; preds = %9
  %15 = zext nneg i32 %3 to i64
  tail call void @llvm.memcpy.p0.p0.i64(ptr align 1 %10, ptr nonnull align 1 %2, i64 %15, i1 false)
  br label %16

16:                                               ; preds = %9, %14, %8
  %.not42 = icmp eq ptr %4, null
  br i1 %.not42, label %48, label %17

17:                                               ; preds = %16
  %18 = getelementptr inbounds i8, ptr %1, i64 36
  %19 = load i8, ptr %18, align 4, !tbaa !23
  %20 = zext nneg i8 %19 to i32
  %21 = shl nuw i32 1, %20
  %22 = getelementptr inbounds i8, ptr %1, i64 37
  %23 = load i8, ptr %22, align 1, !tbaa !24
  switch i8 %23, label %.thread44 [
    i8 0, label %24
    i8 2, label %29
  ]

24:                                               ; preds = %17
  %25 = getelementptr inbounds i8, ptr %4, i64 8
  %26 = load i16, ptr %25, align 2, !tbaa !25
  %27 = zext i16 %26 to i32
  %28 = icmp slt i32 %21, %27
  br i1 %28, label %44, label %.thread44

29:                                               ; preds = %17
  %30 = getelementptr inbounds i8, ptr %4, i64 2
  %31 = load i16, ptr %30, align 2, !tbaa !26
  %32 = zext i16 %31 to i32
  %33 = icmp slt i32 %21, %32
  br i1 %33, label %44, label %34

34:                                               ; preds = %29
  %35 = getelementptr inbounds i8, ptr %4, i64 4
  %36 = load i16, ptr %35, align 2, !tbaa !27
  %37 = zext i16 %36 to i32
  %38 = icmp ult i32 %21, %37
  br i1 %38, label %44, label %39

39:                                               ; preds = %34
  %40 = getelementptr inbounds i8, ptr %4, i64 6
  %41 = load i16, ptr %40, align 2, !tbaa !28
  %42 = zext i16 %41 to i32
  %43 = icmp ult i32 %21, %42
  br i1 %43, label %44, label %.thread44

44:                                               ; preds = %39, %34, %29, %24
  tail call void @png_warning(ptr noundef nonnull %0, ptr noundef nonnull @.str.13) #4
  br label %.thread44

.thread44:                                        ; preds = %17, %39, %44, %24
  %45 = getelementptr inbounds i8, ptr %1, i64 104
  tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(10) %45, ptr noundef nonnull align 2 dereferenceable(10) %4, i64 10, i1 false)
  %spec.store.select = tail call i32 @llvm.umax.i32(i32 %3, i32 1)
  %46 = trunc i32 %spec.store.select to i16
  %47 = getelementptr inbounds i8, ptr %1, i64 34
  store i16 %46, ptr %47, align 2, !tbaa !29
  br label %51

48:                                               ; preds = %16
  %49 = trunc i32 %3 to i16
  %50 = getelementptr inbounds i8, ptr %1, i64 34
  store i16 %49, ptr %50, align 2, !tbaa !29
  %.not43 = icmp eq i32 %3, 0
  br i1 %.not43, label %58, label %51

51:                                               ; preds = %.thread44, %48
  %52 = getelementptr inbounds i8, ptr %1, i64 8
  %53 = load i32, ptr %52, align 8, !tbaa !30
  %54 = or i32 %53, 16
  store i32 %54, ptr %52, align 8, !tbaa !30
  %55 = getelementptr inbounds i8, ptr %1, i64 228
  %56 = load i32, ptr %55, align 4, !tbaa !31
  %57 = or i32 %56, 8192
  store i32 %57, ptr %55, align 4, !tbaa !31
  br label %58

58:                                               ; preds = %5, %51, %48
  ret void
}

declare 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 96}
!6 = !{!"png_info_struct", !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, !8, i64 56, !7, i64 60, !7, i64 64, !11, i64 72, !14, i64 80, !15, i64 88, !11, i64 96, !16, i64 104, !16, i64 114, !7, i64 124, !7, i64 128, !8, i64 132, !7, i64 136, !7, i64 140, !8, i64 144, !11, i64 152, !13, i64 160, !13, i64 164, !13, i64 168, !13, i64 172, !13, i64 176, !13, i64 180, !13, i64 184, !13, i64 188, !11, i64 192, !7, i64 200, !7, i64 204, !11, i64 208, !11, i64 216, !8, i64 224, !8, i64 225, !7, i64 228, !11, i64 232, !10, i64 240, !11, i64 248, !11, i64 256, !7, i64 264, !8, i64 268, !11, i64 272, !7, i64 280, !8, i64 284, !17, i64 288, !17, i64 296, !11, i64 304, !11, i64 312, !11, i64 320, !7, i64 328, !7, i64 332, !7, i64 336, !7, i64 340, !7, i64 344, !7, i64 348, !7, i64 352, !7, i64 356, !7, i64 360}
!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 = !{!"float", !8, i64 0}
!14 = !{!"png_time_struct", !12, i64 0, !8, i64 2, !8, i64 3, !8, i64 4, !8, i64 5, !8, i64 6}
!15 = !{!"png_color_8_struct", !8, i64 0, !8, i64 1, !8, i64 2, !8, i64 3, !8, i64 4}
!16 = !{!"png_color_16_struct", !8, i64 0, !12, i64 2, !12, i64 4, !12, i64 6, !12, i64 8}
!17 = !{!"double", !8, i64 0}
!18 = !{!19, !11, i64 728}
!19 = !{!"png_struct_def", !8, i64 0, !11, i64 200, !11, i64 208, !11, i64 216, !11, i64 224, !11, i64 232, !11, i64 240, !11, i64 248, !11, i64 256, !11, i64 264, !11, i64 272, !8, i64 280, !8, i64 281, !7, i64 284, !7, i64 288, !7, i64 292, !20, i64 296, !11, i64 408, !10, i64 416, !7, i64 424, !7, i64 428, !7, i64 432, !7, i64 436, !7, i64 440, !7, i64 444, !7, i64 448, !7, i64 452, !7, i64 456, !10, i64 464, !10, i64 472, !7, i64 480, !7, i64 484, !11, i64 488, !11, i64 496, !11, i64 504, !11, i64 512, !11, i64 520, !11, i64 528, !21, i64 536, !7, i64 560, !7, i64 564, !11, i64 568, !12, i64 576, !12, i64 578, !8, i64 580, !8, i64 585, !8, i64 586, !8, i64 587, !8, i64 588, !8, i64 589, !8, i64 590, !8, i64 591, !8, i64 592, !8, i64 593, !8, i64 594, !8, i64 595, !8, i64 596, !12, i64 598, !8, i64 600, !13, i64 604, !16, i64 608, !16, i64 618, !11, i64 632, !7, i64 640, !7, i64 644, !7, i64 648, !13, i64 652, !13, i64 656, !11, i64 664, !11, i64 672, !11, i64 680, !11, i64 688, !11, i64 696, !11, i64 704, !15, i64 712, !15, i64 717, !11, i64 728, !16, i64 736, !11, i64 752, !11, i64 760, !11, i64 768, !11, i64 776, !11, i64 784, !11, i64 792, !11, i64 800, !11, i64 808, !11, i64 816, !7, i64 824, !7, i64 828, !10, i64 832, !10, i64 840, !10, i64 848, !10, i64 856, !7, i64 864, !7, i64 868, !10, i64 872, !10, i64 880, !11, i64 888, !11, i64 896, !11, i64 904, !11, i64 912, !11, i64 920, !8, i64 928, !8, i64 929, !11, i64 936, !11, i64 944, !11, i64 952, !11, i64 960, !11, i64 968, !11, i64 976, !7, i64 984, !11, i64 992, !11, i64 1000, !7, i64 1008, !11, i64 1016, !8, i64 1024, !12, i64 1026, !12, i64 1028, !12, i64 1030, !7, i64 1032, !7, i64 1036, !8, i64 1040, !11, i64 1048, !11, i64 1056, !11, i64 1064, !11, i64 1072, !11, i64 1080, !11, i64 1088, !11, i64 1096, !8, i64 1104, !7, i64 1108, !7, i64 1112, !7, i64 1116, !22, i64 1120, !7, i64 1152, !7, i64 1156, !11, i64 1160, !7, i64 1168}
!20 = !{!"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}
!21 = !{!"png_row_info_struct", !7, i64 0, !10, i64 8, !8, i64 16, !8, i64 17, !8, i64 18, !8, i64 19}
!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 = !{!16, !12, i64 8}
!26 = !{!16, !12, i64 2}
!27 = !{!16, !12, i64 4}
!28 = !{!16, !12, i64 6}
!29 = !{!6, !12, i64 34}
!30 = !{!6, !7, i64 8}
!31 = !{!6, !7, i64 228}


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