; LLVM IR from niessner/Matterport :: code/gaps/pkgs/png (pngrutil)

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

@.str.7 = external hidden unnamed_addr constant [18 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [19 x i8], align 1

; Function Attrs: nounwind uwtable
declare dso_local i32 @png_get_uint_31(ptr noundef, ptr noundef) #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_error(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

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

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

; Function Attrs: nounwind uwtable
define dso_local void @png_handle_IHDR(ptr noundef %0, ptr noundef %1, i32 noundef %2) #0 {
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca i32, align 4
  %7 = alloca [13 x i8], align 1
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  store ptr %0, ptr %4, align 8, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !5
  store i32 %2, ptr %6, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 13, ptr %7) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #3
  %15 = load ptr, ptr %4, align 8, !tbaa !5
  %16 = getelementptr inbounds %struct.png_struct_def, ptr %15, i32 0, i32 13
  %17 = load i32, ptr %16, align 4, !tbaa !11
  %18 = and i32 %17, 1
  %19 = icmp ne i32 %18, 0
  br i1 %19, label %20, label %22

20:                                               ; preds = %3
  %21 = load ptr, ptr %4, align 8, !tbaa !5
  call void @png_error(ptr noundef %21, ptr noundef @.str.7)
  br label %22

22:                                               ; preds = %20, %3
  %23 = load i32, ptr %6, align 4, !tbaa !9
  %24 = icmp ne i32 %23, 13
  br i1 %24, label %25, label %27

25:                                               ; preds = %22
  %26 = load ptr, ptr %4, align 8, !tbaa !5
  call void @png_error(ptr noundef %26, ptr noundef @.str.8)
  br label %27

27:                                               ; preds = %25, %22
  %28 = load ptr, ptr %4, align 8, !tbaa !5
  %29 = getelementptr inbounds %struct.png_struct_def, ptr %28, i32 0, i32 13
  %30 = load i32, ptr %29, align 4, !tbaa !11
  %31 = or i32 %30, 1
  store i32 %31, ptr %29, align 4, !tbaa !11
  %32 = load ptr, ptr %4, align 8, !tbaa !5
  %33 = getelementptr inbounds [13 x i8], ptr %7, i64 0, i64 0
  call void @png_crc_read(ptr noundef %32, ptr noundef %33, i64 noundef 13)
  %34 = load ptr, ptr %4, align 8, !tbaa !5
  %35 = call i32 @png_crc_finish(ptr noundef %34, i32 noundef 0)
  %36 = load ptr, ptr %4, align 8, !tbaa !5
  %37 = getelementptr inbounds [13 x i8], ptr %7, i64 0, i64 0
  %38 = call i32 @png_get_uint_31(ptr noundef %36, ptr noundef %37)
  store i32 %38, ptr %8, align 4, !tbaa !9
  %39 = load ptr, ptr %4, align 8, !tbaa !5
  %40 = getelementptr inbounds [13 x i8], ptr %7, i64 0, i64 0
  %41 = getelementptr inbounds i8, ptr %40, i64 4
  %42 = call i32 @png_get_uint_31(ptr noundef %39, ptr noundef %41)
  store i32 %42, ptr %9, align 4, !tbaa !9
  %43 = getelementptr inbounds [13 x i8], ptr %7, i64 0, i64 8
  %44 = load i8, ptr %43, align 1, !tbaa !21
  %45 = zext i8 %44 to i32
  store i32 %45, ptr %10, align 4, !tbaa !9
  %46 = getelementptr inbounds [13 x i8], ptr %7, i64 0, i64 9
  %47 = load i8, ptr %46, align 1, !tbaa !21
  %48 = zext i8 %47 to i32
  store i32 %48, ptr %11, align 4, !tbaa !9
  %49 = getelementptr inbounds [13 x i8], ptr %7, i64 0, i64 10
  %50 = load i8, ptr %49, align 1, !tbaa !21
  %51 = zext i8 %50 to i32
  store i32 %51, ptr %12, align 4, !tbaa !9
  %52 = getelementptr inbounds [13 x i8], ptr %7, i64 0, i64 11
  %53 = load i8, ptr %52, align 1, !tbaa !21
  %54 = zext i8 %53 to i32
  store i32 %54, ptr %13, align 4, !tbaa !9
  %55 = getelementptr inbounds [13 x i8], ptr %7, i64 0, i64 12
  %56 = load i8, ptr %55, align 1, !tbaa !21
  %57 = zext i8 %56 to i32
  store i32 %57, ptr %14, align 4, !tbaa !9
  %58 = load i32, ptr %8, align 4, !tbaa !9
  %59 = load ptr, ptr %4, align 8, !tbaa !5
  %60 = getelementptr inbounds %struct.png_struct_def, ptr %59, i32 0, i32 24
  store i32 %58, ptr %60, align 4, !tbaa !22
  %61 = load i32, ptr %9, align 4, !tbaa !9
  %62 = load ptr, ptr %4, align 8, !tbaa !5
  %63 = getelementptr inbounds %struct.png_struct_def, ptr %62, i32 0, i32 25
  store i32 %61, ptr %63, align 8, !tbaa !23
  %64 = load i32, ptr %10, align 4, !tbaa !9
  %65 = trunc i32 %64 to i8
  %66 = load ptr, ptr %4, align 8, !tbaa !5
  %67 = getelementptr inbounds %struct.png_struct_def, ptr %66, i32 0, i32 51
  store i8 %65, ptr %67, align 1, !tbaa !24
  %68 = load i32, ptr %14, align 4, !tbaa !9
  %69 = trunc i32 %68 to i8
  %70 = load ptr, ptr %4, align 8, !tbaa !5
  %71 = getelementptr inbounds %struct.png_struct_def, ptr %70, i32 0, i32 47
  store i8 %69, ptr %71, align 1, !tbaa !25
  %72 = load i32, ptr %11, align 4, !tbaa !9
  %73 = trunc i32 %72 to i8
  %74 = load ptr, ptr %4, align 8, !tbaa !5
  %75 = getelementptr inbounds %struct.png_struct_def, ptr %74, i32 0, i32 50
  store i8 %73, ptr %75, align 2, !tbaa !26
  %76 = load i32, ptr %13, align 4, !tbaa !9
  %77 = trunc i32 %76 to i8
  %78 = load ptr, ptr %4, align 8, !tbaa !5
  %79 = getelementptr inbounds %struct.png_struct_def, ptr %78, i32 0, i32 121
  store i8 %77, ptr %79, align 8, !tbaa !27
  %80 = load i32, ptr %12, align 4, !tbaa !9
  %81 = trunc i32 %80 to i8
  %82 = load ptr, ptr %4, align 8, !tbaa !5
  %83 = getelementptr inbounds %struct.png_struct_def, ptr %82, i32 0, i32 129
  store i8 %81, ptr %83, align 8, !tbaa !28
  %84 = load ptr, ptr %4, align 8, !tbaa !5
  %85 = getelementptr inbounds %struct.png_struct_def, ptr %84, i32 0, i32 50
  %86 = load i8, ptr %85, align 2, !tbaa !26
  %87 = zext i8 %86 to i32
  switch i32 %87, label %100 [
    i32 0, label %88
    i32 3, label %88
    i32 2, label %91
    i32 4, label %94
    i32 6, label %97
  ]

88:                                               ; preds = %27, %27
  %89 = load ptr, ptr %4, align 8, !tbaa !5
  %90 = getelementptr inbounds %struct.png_struct_def, ptr %89, i32 0, i32 54
  store i8 1, ptr %90, align 2, !tbaa !29
  br label %100

91:                                               ; preds = %27
  %92 = load ptr, ptr %4, align 8, !tbaa !5
  %93 = getelementptr inbounds %struct.png_struct_def, ptr %92, i32 0, i32 54
  store i8 3, ptr %93, align 2, !tbaa !29
  br label %100

94:                                               ; preds = %27
  %95 = load ptr, ptr %4, align 8, !tbaa !5
  %96 = getelementptr inbounds %struct.png_struct_def, ptr %95, i32 0, i32 54
  store i8 2, ptr %96, align 2, !tbaa !29
  br label %100

97:                                               ; preds = %27
  %98 = load ptr, ptr %4, align 8, !tbaa !5
  %99 = getelementptr inbounds %struct.png_struct_def, ptr %98, i32 0, i32 54
  store i8 4, ptr %99, align 2, !tbaa !29
  br label %100

100:                                              ; preds = %97, %94, %91, %88, %27
  %101 = load ptr, ptr %4, align 8, !tbaa !5
  %102 = getelementptr inbounds %struct.png_struct_def, ptr %101, i32 0, i32 51
  %103 = load i8, ptr %102, align 1, !tbaa !24
  %104 = zext i8 %103 to i32
  %105 = load ptr, ptr %4, align 8, !tbaa !5
  %106 = getelementptr inbounds %struct.png_struct_def, ptr %105, i32 0, i32 54
  %107 = load i8, ptr %106, align 2, !tbaa !29
  %108 = zext i8 %107 to i32
  %109 = mul nsw i32 %104, %108
  %110 = trunc i32 %109 to i8
  %111 = load ptr, ptr %4, align 8, !tbaa !5
  %112 = getelementptr inbounds %struct.png_struct_def, ptr %111, i32 0, i32 53
  store i8 %110, ptr %112, align 1, !tbaa !30
  %113 = load ptr, ptr %4, align 8, !tbaa !5
  %114 = getelementptr inbounds %struct.png_struct_def, ptr %113, i32 0, i32 53
  %115 = load i8, ptr %114, align 1, !tbaa !30
  %116 = zext i8 %115 to i32
  %117 = icmp sge i32 %116, 8
  br i1 %117, label %118, label %129

118:                                              ; preds = %100
  %119 = load ptr, ptr %4, align 8, !tbaa !5
  %120 = getelementptr inbounds %struct.png_struct_def, ptr %119, i32 0, i32 24
  %121 = load i32, ptr %120, align 4, !tbaa !22
  %122 = zext i32 %121 to i64
  %123 = load ptr, ptr %4, align 8, !tbaa !5
  %124 = getelementptr inbounds %struct.png_struct_def, ptr %123, i32 0, i32 53
  %125 = load i8, ptr %124, align 1, !tbaa !30
  %126 = zext i8 %125 to i64
  %127 = lshr i64 %126, 3
  %128 = mul i64 %122, %127
  br label %141

129:                                              ; preds = %100
  %130 = load ptr, ptr %4, align 8, !tbaa !5
  %131 = getelementptr inbounds %struct.png_struct_def, ptr %130, i32 0, i32 24
  %132 = load i32, ptr %131, align 4, !tbaa !22
  %133 = zext i32 %132 to i64
  %134 = load ptr, ptr %4, align 8, !tbaa !5
  %135 = getelementptr inbounds %struct.png_struct_def, ptr %134, i32 0, i32 53
  %136 = load i8, ptr %135, align 1, !tbaa !30
  %137 = zext i8 %136 to i64
  %138 = mul i64 %133, %137
  %139 = add i64 %138, 7
  %140 = lshr i64 %139, 3
  br label %141

141:                                              ; preds = %129, %118
  %142 = phi i64 [ %128, %118 ], [ %140, %129 ]
  %143 = load ptr, ptr %4, align 8, !tbaa !5
  %144 = getelementptr inbounds %struct.png_struct_def, ptr %143, i32 0, i32 28
  store i64 %142, ptr %144, align 8, !tbaa !31
  %145 = load ptr, ptr %4, align 8, !tbaa !5
  %146 = load ptr, ptr %5, align 8, !tbaa !5
  %147 = load i32, ptr %8, align 4, !tbaa !9
  %148 = load i32, ptr %9, align 4, !tbaa !9
  %149 = load i32, ptr %10, align 4, !tbaa !9
  %150 = load i32, ptr %11, align 4, !tbaa !9
  %151 = load i32, ptr %14, align 4, !tbaa !9
  %152 = load i32, ptr %12, align 4, !tbaa !9
  %153 = load i32, ptr %13, align 4, !tbaa !9
  call void @png_set_IHDR(ptr noundef %145, ptr noundef %146, i32 noundef %147, i32 noundef %148, i32 noundef %149, i32 noundef %150, i32 noundef %151, i32 noundef %152, i32 noundef %153)
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #3
  call void @llvm.lifetime.end.p0(i64 13, ptr %7) #3
  ret void
}

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

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 = { 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 }

!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, !10, i64 284}
!12 = !{!"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, !13, i64 296, !6, i64 408, !14, 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, !14, i64 464, !14, 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, !15, i64 536, !10, i64 560, !10, i64 564, !6, i64 568, !16, i64 576, !16, 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, !16, i64 598, !7, i64 600, !17, i64 604, !18, i64 608, !18, i64 618, !6, i64 632, !10, i64 640, !10, i64 644, !10, i64 648, !17, i64 652, !17, i64 656, !6, i64 664, !6, i64 672, !6, i64 680, !6, i64 688, !6, i64 696, !6, i64 704, !19, i64 712, !19, 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, !14, i64 832, !14, i64 840, !14, i64 848, !14, i64 856, !10, i64 864, !10, i64 868, !14, i64 872, !14, 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, !16, i64 1026, !16, i64 1028, !16, 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, !20, i64 1120, !10, i64 1152, !10, i64 1156, !6, i64 1160, !10, i64 1168}
!13 = !{!"z_stream_s", !6, i64 0, !10, i64 8, !14, i64 16, !6, i64 24, !10, i64 32, !14, i64 40, !6, i64 48, !6, i64 56, !6, i64 64, !6, i64 72, !6, i64 80, !10, i64 88, !14, i64 96, !14, i64 104}
!14 = !{!"long", !7, i64 0}
!15 = !{!"png_row_info_struct", !10, i64 0, !14, i64 8, !7, i64 16, !7, i64 17, !7, i64 18, !7, i64 19}
!16 = !{!"short", !7, i64 0}
!17 = !{!"float", !7, i64 0}
!18 = !{!"png_color_16_struct", !7, i64 0, !16, i64 2, !16, i64 4, !16, i64 6, !16, i64 8}
!19 = !{!"png_color_8_struct", !7, i64 0, !7, i64 1, !7, i64 2, !7, i64 3, !7, i64 4}
!20 = !{!"png_unknown_chunk_t", !7, i64 0, !6, i64 8, !14, i64 16, !7, i64 24}
!21 = !{!7, !7, i64 0}
!22 = !{!12, !10, i64 444}
!23 = !{!12, !10, i64 448}
!24 = !{!12, !7, i64 591}
!25 = !{!12, !7, i64 587}
!26 = !{!12, !7, i64 590}
!27 = !{!12, !7, i64 1040}
!28 = !{!12, !7, i64 1104}
!29 = !{!12, !7, i64 594}
!30 = !{!12, !7, i64 593}
!31 = !{!12, !14, i64 464}


; 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.7 = external hidden unnamed_addr constant [18 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [19 x i8], align 1

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

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

declare void @png_error(ptr noundef, ptr noundef) local_unnamed_addr #2

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

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

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

; Function Attrs: nounwind uwtable
define dso_local void @png_handle_IHDR(ptr noundef %0, ptr noundef %1, i32 noundef %2) local_unnamed_addr #0 {
  %4 = alloca [13 x i8], align 1
  call void @llvm.lifetime.start.p0(i64 13, ptr nonnull %4) #3
  %5 = getelementptr inbounds i8, ptr %0, i64 284
  %6 = load i32, ptr %5, align 4, !tbaa !5
  %7 = and i32 %6, 1
  %.not = icmp eq i32 %7, 0
  br i1 %.not, label %9, label %8

8:                                                ; preds = %3
  tail call void @png_error(ptr noundef nonnull %0, ptr noundef nonnull @.str.7) #3
  br label %9

9:                                                ; preds = %8, %3
  %.not45 = icmp eq i32 %2, 13
  br i1 %.not45, label %11, label %10

10:                                               ; preds = %9
  tail call void @png_error(ptr noundef nonnull %0, ptr noundef nonnull @.str.8) #3
  br label %11

11:                                               ; preds = %10, %9
  %12 = load i32, ptr %5, align 4, !tbaa !5
  %13 = or i32 %12, 1
  store i32 %13, ptr %5, align 4, !tbaa !5
  call void @png_crc_read(ptr noundef nonnull %0, ptr noundef nonnull %4, i64 noundef 13)
  %14 = call i32 @png_crc_finish(ptr noundef nonnull %0, i32 noundef 0)
  %15 = call i32 @png_get_uint_31(ptr noundef nonnull %0, ptr noundef nonnull %4)
  %16 = getelementptr inbounds i8, ptr %4, i64 4
  %17 = call i32 @png_get_uint_31(ptr noundef nonnull %0, ptr noundef nonnull %16)
  %18 = getelementptr inbounds i8, ptr %4, i64 8
  %19 = load i8, ptr %18, align 1, !tbaa !19
  %20 = getelementptr inbounds i8, ptr %4, i64 9
  %21 = load i8, ptr %20, align 1, !tbaa !19
  %22 = getelementptr inbounds i8, ptr %4, i64 10
  %23 = load i8, ptr %22, align 1, !tbaa !19
  %24 = getelementptr inbounds i8, ptr %4, i64 11
  %25 = load i8, ptr %24, align 1, !tbaa !19
  %26 = getelementptr inbounds i8, ptr %4, i64 12
  %27 = load i8, ptr %26, align 1, !tbaa !19
  %28 = getelementptr inbounds i8, ptr %0, i64 444
  store i32 %15, ptr %28, align 4, !tbaa !20
  %29 = getelementptr inbounds i8, ptr %0, i64 448
  store i32 %17, ptr %29, align 8, !tbaa !21
  %30 = getelementptr inbounds i8, ptr %0, i64 591
  store i8 %19, ptr %30, align 1, !tbaa !22
  %31 = getelementptr inbounds i8, ptr %0, i64 587
  store i8 %27, ptr %31, align 1, !tbaa !23
  %32 = getelementptr inbounds i8, ptr %0, i64 590
  store i8 %21, ptr %32, align 2, !tbaa !24
  %33 = getelementptr inbounds i8, ptr %0, i64 1040
  store i8 %25, ptr %33, align 8, !tbaa !25
  %34 = getelementptr inbounds i8, ptr %0, i64 1104
  store i8 %23, ptr %34, align 8, !tbaa !26
  switch i8 %21, label %._crit_edge [
    i8 0, label %35
    i8 3, label %35
    i8 2, label %37
    i8 4, label %39
    i8 6, label %41
  ]

._crit_edge:                                      ; preds = %11
  %.phi.trans.insert = getelementptr inbounds i8, ptr %0, i64 594
  %.pre = load i8, ptr %.phi.trans.insert, align 2, !tbaa !27
  br label %43

35:                                               ; preds = %11, %11
  %36 = getelementptr inbounds i8, ptr %0, i64 594
  store i8 1, ptr %36, align 2, !tbaa !27
  br label %43

37:                                               ; preds = %11
  %38 = getelementptr inbounds i8, ptr %0, i64 594
  store i8 3, ptr %38, align 2, !tbaa !27
  br label %43

39:                                               ; preds = %11
  %40 = getelementptr inbounds i8, ptr %0, i64 594
  store i8 2, ptr %40, align 2, !tbaa !27
  br label %43

41:                                               ; preds = %11
  %42 = getelementptr inbounds i8, ptr %0, i64 594
  store i8 4, ptr %42, align 2, !tbaa !27
  br label %43

43:                                               ; preds = %._crit_edge, %41, %39, %37, %35
  %44 = phi i8 [ %.pre, %._crit_edge ], [ 4, %41 ], [ 2, %39 ], [ 3, %37 ], [ 1, %35 ]
  %45 = mul i8 %44, %19
  %46 = getelementptr inbounds i8, ptr %0, i64 593
  store i8 %45, ptr %46, align 1, !tbaa !28
  %47 = icmp ugt i8 %45, 7
  %48 = zext i32 %15 to i64
  br i1 %47, label %49, label %53

49:                                               ; preds = %43
  %50 = lshr i8 %45, 3
  %51 = zext nneg i8 %50 to i64
  %52 = mul nuw nsw i64 %51, %48
  br label %58

53:                                               ; preds = %43
  %54 = zext nneg i8 %45 to i64
  %55 = mul nuw nsw i64 %54, %48
  %56 = add nuw nsw i64 %55, 7
  %57 = lshr i64 %56, 3
  br label %58

58:                                               ; preds = %53, %49
  %59 = phi i64 [ %52, %49 ], [ %57, %53 ]
  %60 = zext i8 %27 to i32
  %61 = zext i8 %25 to i32
  %62 = zext i8 %23 to i32
  %63 = zext i8 %21 to i32
  %64 = zext i8 %19 to i32
  %65 = getelementptr inbounds i8, ptr %0, i64 464
  store i64 %59, ptr %65, align 8, !tbaa !29
  call void @png_set_IHDR(ptr noundef nonnull %0, ptr noundef %1, i32 noundef %15, i32 noundef %17, i32 noundef %64, i32 noundef %63, i32 noundef %60, i32 noundef %62, i32 noundef %61) #3
  call void @llvm.lifetime.end.p0(i64 13, ptr nonnull %4) #3
  ret void
}

declare void @png_set_IHDR(ptr noundef, ptr noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef) local_unnamed_addr #2

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 = { mustprogress 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 }

!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 284}
!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 = !{!7, !7, i64 0}
!20 = !{!6, !10, i64 444}
!21 = !{!6, !10, i64 448}
!22 = !{!6, !7, i64 591}
!23 = !{!6, !7, i64 587}
!24 = !{!6, !7, i64 590}
!25 = !{!6, !7, i64 1040}
!26 = !{!6, !7, i64 1104}
!27 = !{!6, !7, i64 594}
!28 = !{!6, !7, i64 593}
!29 = !{!6, !12, i64 464}


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