; LLVM IR from rdguez-mariano/fast_imas_IPOL :: io_png/libs/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, i8, i8, i64, i64, i64, %struct.z_stream_s, ptr, i64, i32, i32, i32, i32, i32, i64, i64, i64, i64, i64, i64, i64, i64, ptr, ptr, ptr, ptr, ptr, ptr, %struct.png_row_info_struct, i64, i64, 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, i64, i64, 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, i64, i64, i64, i64, i64, i64, i32, i32, i64, i64, ptr, ptr, ptr, ptr, ptr, i8, i8, ptr, ptr, ptr, ptr, ptr, ptr, i64, ptr, ptr, i32, ptr, i8, i16, i16, i16, i64, i64, i8, i8, i64, i64, ptr, ptr, ptr, ptr, ptr, ptr, ptr, i8, i64, i64, %struct.png_unknown_chunk_t, i64, i64, ptr }
%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 { i64, 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 }

@png_IDAT = external global [5 x i8], align 1
@.str.118 = external hidden unnamed_addr constant [23 x i8], align 1
@.str.119 = external hidden unnamed_addr constant [20 x i8], align 1

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

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

; 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) #1

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

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

declare void @png_chunk_error(ptr noundef, ptr noundef) #3

declare void @png_free(ptr noundef, ptr noundef) #3

declare ptr @png_malloc(ptr noundef, i64 noundef) #3

; Function Attrs: nounwind uwtable
define dso_local void @png_handle_unknown(ptr noundef %0, ptr noundef %1, i64 noundef %2) #2 {
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca i64, align 8
  %7 = alloca i64, align 8
  %8 = alloca i32, align 4
  store ptr %0, ptr %4, align 8, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !5
  store i64 %2, ptr %6, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #5
  store i64 0, ptr %7, align 8, !tbaa !9
  %9 = load ptr, ptr %4, align 8, !tbaa !5
  %10 = getelementptr inbounds %struct.png_struct_def, ptr %9, i32 0, i32 12
  %11 = load i64, ptr %10, align 8, !tbaa !11
  %12 = and i64 %11, 4
  %13 = icmp ne i64 %12, 0
  br i1 %13, label %14, label %26

14:                                               ; preds = %3
  %15 = load ptr, ptr %4, align 8, !tbaa !5
  %16 = getelementptr inbounds %struct.png_struct_def, ptr %15, i32 0, i32 43
  %17 = getelementptr inbounds [5 x i8], ptr %16, i64 0, i64 0
  %18 = call i32 @memcmp(ptr noundef %17, ptr noundef @png_IDAT, i64 noundef 4) #6
  %19 = icmp ne i32 %18, 0
  br i1 %19, label %20, label %25

20:                                               ; preds = %14
  %21 = load ptr, ptr %4, align 8, !tbaa !5
  %22 = getelementptr inbounds %struct.png_struct_def, ptr %21, i32 0, i32 12
  %23 = load i64, ptr %22, align 8, !tbaa !11
  %24 = or i64 %23, 8
  store i64 %24, ptr %22, align 8, !tbaa !11
  br label %25

25:                                               ; preds = %20, %14
  br label %26

26:                                               ; preds = %25, %3
  %27 = load ptr, ptr %4, align 8, !tbaa !5
  %28 = getelementptr inbounds %struct.png_struct_def, ptr %27, i32 0, i32 43
  %29 = getelementptr inbounds [5 x i8], ptr %28, i64 0, i64 0
  %30 = load i8, ptr %29, align 4, !tbaa !21
  %31 = zext i8 %30 to i32
  %32 = and i32 %31, 32
  %33 = icmp ne i32 %32, 0
  br i1 %33, label %49, label %34

34:                                               ; preds = %26
  %35 = load ptr, ptr %4, align 8, !tbaa !5
  %36 = load ptr, ptr %4, align 8, !tbaa !5
  %37 = getelementptr inbounds %struct.png_struct_def, ptr %36, i32 0, i32 43
  %38 = getelementptr inbounds [5 x i8], ptr %37, i64 0, i64 0
  %39 = call i32 @png_handle_as_unknown(ptr noundef %35, ptr noundef %38)
  %40 = icmp ne i32 %39, 3
  br i1 %40, label %41, label %48

41:                                               ; preds = %34
  %42 = load ptr, ptr %4, align 8, !tbaa !5
  %43 = getelementptr inbounds %struct.png_struct_def, ptr %42, i32 0, i32 111
  %44 = load ptr, ptr %43, align 8, !tbaa !22
  %45 = icmp eq ptr %44, null
  br i1 %45, label %46, label %48

46:                                               ; preds = %41
  %47 = load ptr, ptr %4, align 8, !tbaa !5
  call void @png_chunk_error(ptr noundef %47, ptr noundef @.str.118)
  br label %48

48:                                               ; preds = %46, %41, %34
  br label %49

49:                                               ; preds = %48, %26
  %50 = load ptr, ptr %4, align 8, !tbaa !5
  %51 = getelementptr inbounds %struct.png_struct_def, ptr %50, i32 0, i32 13
  %52 = load i64, ptr %51, align 8, !tbaa !23
  %53 = and i64 %52, 32768
  %54 = icmp ne i64 %53, 0
  br i1 %54, label %60, label %55

55:                                               ; preds = %49
  %56 = load ptr, ptr %4, align 8, !tbaa !5
  %57 = getelementptr inbounds %struct.png_struct_def, ptr %56, i32 0, i32 111
  %58 = load ptr, ptr %57, align 8, !tbaa !22
  %59 = icmp ne ptr %58, null
  br i1 %59, label %60, label %153

60:                                               ; preds = %55, %49
  %61 = load ptr, ptr %4, align 8, !tbaa !5
  %62 = getelementptr inbounds %struct.png_struct_def, ptr %61, i32 0, i32 134
  %63 = getelementptr inbounds %struct.png_unknown_chunk_t, ptr %62, i32 0, i32 0
  %64 = getelementptr inbounds [5 x i8], ptr %63, i64 0, i64 0
  %65 = load ptr, ptr %4, align 8, !tbaa !5
  %66 = getelementptr inbounds %struct.png_struct_def, ptr %65, i32 0, i32 43
  %67 = getelementptr inbounds [5 x i8], ptr %66, i64 0, i64 0
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %64, ptr align 4 %67, i64 5, i1 false)
  %68 = load ptr, ptr %4, align 8, !tbaa !5
  %69 = getelementptr inbounds %struct.png_struct_def, ptr %68, i32 0, i32 134
  %70 = getelementptr inbounds %struct.png_unknown_chunk_t, ptr %69, i32 0, i32 0
  %71 = getelementptr inbounds [5 x i8], ptr %70, i64 0, i64 4
  store i8 0, ptr %71, align 4, !tbaa !21
  %72 = load i64, ptr %6, align 8, !tbaa !9
  %73 = load ptr, ptr %4, align 8, !tbaa !5
  %74 = getelementptr inbounds %struct.png_struct_def, ptr %73, i32 0, i32 134
  %75 = getelementptr inbounds %struct.png_unknown_chunk_t, ptr %74, i32 0, i32 2
  store i64 %72, ptr %75, align 8, !tbaa !24
  %76 = load i64, ptr %6, align 8, !tbaa !9
  %77 = icmp eq i64 %76, 0
  br i1 %77, label %78, label %82

78:                                               ; preds = %60
  %79 = load ptr, ptr %4, align 8, !tbaa !5
  %80 = getelementptr inbounds %struct.png_struct_def, ptr %79, i32 0, i32 134
  %81 = getelementptr inbounds %struct.png_unknown_chunk_t, ptr %80, i32 0, i32 1
  store ptr null, ptr %81, align 8, !tbaa !25
  br label %95

82:                                               ; preds = %60
  %83 = load ptr, ptr %4, align 8, !tbaa !5
  %84 = load i64, ptr %6, align 8, !tbaa !9
  %85 = call ptr @png_malloc(ptr noundef %83, i64 noundef %84)
  %86 = load ptr, ptr %4, align 8, !tbaa !5
  %87 = getelementptr inbounds %struct.png_struct_def, ptr %86, i32 0, i32 134
  %88 = getelementptr inbounds %struct.png_unknown_chunk_t, ptr %87, i32 0, i32 1
  store ptr %85, ptr %88, align 8, !tbaa !25
  %89 = load ptr, ptr %4, align 8, !tbaa !5
  %90 = load ptr, ptr %4, align 8, !tbaa !5
  %91 = getelementptr inbounds %struct.png_struct_def, ptr %90, i32 0, i32 134
  %92 = getelementptr inbounds %struct.png_unknown_chunk_t, ptr %91, i32 0, i32 1
  %93 = load ptr, ptr %92, align 8, !tbaa !25
  %94 = load i64, ptr %6, align 8, !tbaa !9
  call void @png_crc_read(ptr noundef %89, ptr noundef %93, i64 noundef %94)
  br label %95

95:                                               ; preds = %82, %78
  %96 = load ptr, ptr %4, align 8, !tbaa !5
  %97 = getelementptr inbounds %struct.png_struct_def, ptr %96, i32 0, i32 111
  %98 = load ptr, ptr %97, align 8, !tbaa !22
  %99 = icmp ne ptr %98, null
  br i1 %99, label %100, label %139

100:                                              ; preds = %95
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #5
  %101 = load ptr, ptr %4, align 8, !tbaa !5
  %102 = getelementptr inbounds %struct.png_struct_def, ptr %101, i32 0, i32 111
  %103 = load ptr, ptr %102, align 8, !tbaa !22
  %104 = load ptr, ptr %4, align 8, !tbaa !5
  %105 = load ptr, ptr %4, align 8, !tbaa !5
  %106 = getelementptr inbounds %struct.png_struct_def, ptr %105, i32 0, i32 134
  %107 = call i32 %103(ptr noundef %104, ptr noundef %106)
  store i32 %107, ptr %8, align 4, !tbaa !26
  %108 = load i32, ptr %8, align 4, !tbaa !26
  %109 = icmp slt i32 %108, 0
  br i1 %109, label %110, label %112

110:                                              ; preds = %100
  %111 = load ptr, ptr %4, align 8, !tbaa !5
  call void @png_chunk_error(ptr noundef %111, ptr noundef @.str.119)
  br label %112

112:                                              ; preds = %110, %100
  %113 = load i32, ptr %8, align 4, !tbaa !26
  %114 = icmp eq i32 %113, 0
  br i1 %114, label %115, label %138

115:                                              ; preds = %112
  %116 = load ptr, ptr %4, align 8, !tbaa !5
  %117 = getelementptr inbounds %struct.png_struct_def, ptr %116, i32 0, i32 43
  %118 = getelementptr inbounds [5 x i8], ptr %117, i64 0, i64 0
  %119 = load i8, ptr %118, align 4, !tbaa !21
  %120 = zext i8 %119 to i32
  %121 = and i32 %120, 32
  %122 = icmp ne i32 %121, 0
  br i1 %122, label %133, label %123

123:                                              ; preds = %115
  %124 = load ptr, ptr %4, align 8, !tbaa !5
  %125 = load ptr, ptr %4, align 8, !tbaa !5
  %126 = getelementptr inbounds %struct.png_struct_def, ptr %125, i32 0, i32 43
  %127 = getelementptr inbounds [5 x i8], ptr %126, i64 0, i64 0
  %128 = call i32 @png_handle_as_unknown(ptr noundef %124, ptr noundef %127)
  %129 = icmp ne i32 %128, 3
  br i1 %129, label %130, label %132

130:                                              ; preds = %123
  %131 = load ptr, ptr %4, align 8, !tbaa !5
  call void @png_chunk_error(ptr noundef %131, ptr noundef @.str.118)
  br label %132

132:                                              ; preds = %130, %123
  br label %133

133:                                              ; preds = %132, %115
  %134 = load ptr, ptr %4, align 8, !tbaa !5
  %135 = load ptr, ptr %5, align 8, !tbaa !5
  %136 = load ptr, ptr %4, align 8, !tbaa !5
  %137 = getelementptr inbounds %struct.png_struct_def, ptr %136, i32 0, i32 134
  call void @png_set_unknown_chunks(ptr noundef %134, ptr noundef %135, ptr noundef %137, i32 noundef 1)
  br label %138

138:                                              ; preds = %133, %112
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #5
  br label %144

139:                                              ; preds = %95
  %140 = load ptr, ptr %4, align 8, !tbaa !5
  %141 = load ptr, ptr %5, align 8, !tbaa !5
  %142 = load ptr, ptr %4, align 8, !tbaa !5
  %143 = getelementptr inbounds %struct.png_struct_def, ptr %142, i32 0, i32 134
  call void @png_set_unknown_chunks(ptr noundef %140, ptr noundef %141, ptr noundef %143, i32 noundef 1)
  br label %144

144:                                              ; preds = %139, %138
  %145 = load ptr, ptr %4, align 8, !tbaa !5
  %146 = load ptr, ptr %4, align 8, !tbaa !5
  %147 = getelementptr inbounds %struct.png_struct_def, ptr %146, i32 0, i32 134
  %148 = getelementptr inbounds %struct.png_unknown_chunk_t, ptr %147, i32 0, i32 1
  %149 = load ptr, ptr %148, align 8, !tbaa !25
  call void @png_free(ptr noundef %145, ptr noundef %149)
  %150 = load ptr, ptr %4, align 8, !tbaa !5
  %151 = getelementptr inbounds %struct.png_struct_def, ptr %150, i32 0, i32 134
  %152 = getelementptr inbounds %struct.png_unknown_chunk_t, ptr %151, i32 0, i32 1
  store ptr null, ptr %152, align 8, !tbaa !25
  br label %155

153:                                              ; preds = %55
  %154 = load i64, ptr %6, align 8, !tbaa !9
  store i64 %154, ptr %7, align 8, !tbaa !9
  br label %155

155:                                              ; preds = %153, %144
  %156 = load ptr, ptr %4, align 8, !tbaa !5
  %157 = load i64, ptr %7, align 8, !tbaa !9
  %158 = call i32 @png_crc_finish(ptr noundef %156, i64 noundef %157)
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #5
  ret void
}

; Function Attrs: nounwind willreturn memory(read)
declare i32 @memcmp(ptr noundef, ptr noundef, i64 noundef) #4

declare i32 @png_handle_as_unknown(ptr noundef, ptr noundef) #3

declare void @png_set_unknown_chunks(ptr noundef, ptr noundef, ptr noundef, i32 noundef) #3

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
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 = { "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 willreturn memory(read) "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 #5 = { nounwind }
attributes #6 = { nounwind willreturn memory(read) }

!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 = !{!"long", !7, i64 0}
!11 = !{!12, !10, i64 280}
!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, !7, i64 272, !7, i64 273, !10, i64 280, !10, i64 288, !10, i64 296, !13, i64 304, !6, i64 416, !10, i64 424, !14, i64 432, !14, i64 436, !14, i64 440, !14, i64 444, !14, i64 448, !10, i64 456, !10, i64 464, !10, i64 472, !10, i64 480, !10, i64 488, !10, i64 496, !10, i64 504, !10, i64 512, !6, i64 520, !6, i64 528, !6, i64 536, !6, i64 544, !6, i64 552, !6, i64 560, !15, i64 568, !10, i64 592, !10, i64 600, !6, i64 608, !16, i64 616, !16, i64 618, !7, i64 620, !7, i64 625, !7, i64 626, !7, i64 627, !7, i64 628, !7, i64 629, !7, i64 630, !7, i64 631, !7, i64 632, !7, i64 633, !7, i64 634, !7, i64 635, !7, i64 636, !16, i64 638, !7, i64 640, !17, i64 644, !18, i64 648, !18, i64 658, !6, i64 672, !10, i64 680, !10, i64 688, !14, i64 696, !17, i64 700, !17, i64 704, !6, i64 712, !6, i64 720, !6, i64 728, !6, i64 736, !6, i64 744, !6, i64 752, !19, i64 760, !19, i64 765, !6, i64 776, !18, i64 784, !6, i64 800, !6, i64 808, !6, i64 816, !6, i64 824, !6, i64 832, !6, i64 840, !6, i64 848, !6, i64 856, !6, i64 864, !10, i64 872, !10, i64 880, !10, i64 888, !10, i64 896, !10, i64 904, !10, i64 912, !14, i64 920, !14, i64 924, !10, i64 928, !10, i64 936, !6, i64 944, !6, i64 952, !6, i64 960, !6, i64 968, !6, i64 976, !7, i64 984, !7, i64 985, !6, i64 992, !6, i64 1000, !6, i64 1008, !6, i64 1016, !6, i64 1024, !6, i64 1032, !10, i64 1040, !6, i64 1048, !6, i64 1056, !14, i64 1064, !6, i64 1072, !7, i64 1080, !16, i64 1082, !16, i64 1084, !16, i64 1086, !10, i64 1088, !10, i64 1096, !7, i64 1104, !7, i64 1105, !10, i64 1112, !10, i64 1120, !6, i64 1128, !6, i64 1136, !6, i64 1144, !6, i64 1152, !6, i64 1160, !6, i64 1168, !6, i64 1176, !7, i64 1184, !10, i64 1192, !10, i64 1200, !20, i64 1208, !10, i64 1240, !10, i64 1248, !6, i64 1256}
!13 = !{!"z_stream_s", !6, i64 0, !14, i64 8, !10, i64 16, !6, i64 24, !14, i64 32, !10, i64 40, !6, i64 48, !6, i64 56, !6, i64 64, !6, i64 72, !6, i64 80, !14, i64 88, !10, i64 96, !10, i64 104}
!14 = !{!"int", !7, i64 0}
!15 = !{!"png_row_info_struct", !10, i64 0, !10, 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, !10, i64 16, !7, i64 24}
!21 = !{!7, !7, i64 0}
!22 = !{!12, !6, i64 1056}
!23 = !{!12, !10, i64 288}
!24 = !{!12, !10, i64 1224}
!25 = !{!12, !6, i64 1216}
!26 = !{!14, !14, i64 0}


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

@png_IDAT = external global [5 x i8], align 1
@.str.118 = external hidden unnamed_addr constant [23 x i8], align 1
@.str.119 = external hidden unnamed_addr constant [20 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

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

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

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

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

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

; Function Attrs: nounwind uwtable
define dso_local void @png_handle_unknown(ptr noundef %0, ptr noundef %1, i64 noundef %2) local_unnamed_addr #1 {
  %4 = getelementptr inbounds i8, ptr %0, i64 280
  %5 = load i64, ptr %4, align 8, !tbaa !5
  %6 = and i64 %5, 4
  %.not = icmp eq i64 %6, 0
  br i1 %.not, label %11, label %7

7:                                                ; preds = %3
  %8 = getelementptr inbounds i8, ptr %0, i64 620
  %bcmp = tail call i32 @bcmp(ptr noundef nonnull dereferenceable(4) %8, ptr noundef nonnull dereferenceable(4) @png_IDAT, i64 4)
  %.not47 = icmp eq i32 %bcmp, 0
  br i1 %.not47, label %11, label %9

9:                                                ; preds = %7
  %10 = or i64 %5, 8
  store i64 %10, ptr %4, align 8, !tbaa !5
  br label %11

11:                                               ; preds = %7, %9, %3
  %12 = getelementptr inbounds i8, ptr %0, i64 620
  %13 = load i8, ptr %12, align 4, !tbaa !19
  %14 = and i8 %13, 32
  %.not48 = icmp eq i8 %14, 0
  br i1 %.not48, label %15, label %22

15:                                               ; preds = %11
  %16 = tail call i32 @png_handle_as_unknown(ptr noundef nonnull %0, ptr noundef nonnull %12) #4
  %.not49 = icmp eq i32 %16, 3
  br i1 %.not49, label %22, label %17

17:                                               ; preds = %15
  %18 = getelementptr inbounds i8, ptr %0, i64 1056
  %19 = load ptr, ptr %18, align 8, !tbaa !20
  %20 = icmp eq ptr %19, null
  br i1 %20, label %21, label %22

21:                                               ; preds = %17
  tail call void @png_chunk_error(ptr noundef nonnull %0, ptr noundef nonnull @.str.118) #4
  br label %22

22:                                               ; preds = %15, %17, %21, %11
  %23 = getelementptr inbounds i8, ptr %0, i64 288
  %24 = load i64, ptr %23, align 8, !tbaa !21
  %25 = and i64 %24, 32768
  %.not50 = icmp eq i64 %25, 0
  br i1 %.not50, label %26, label %29

26:                                               ; preds = %22
  %27 = getelementptr inbounds i8, ptr %0, i64 1056
  %28 = load ptr, ptr %27, align 8, !tbaa !20
  %.not51 = icmp eq ptr %28, null
  br i1 %.not51, label %58, label %29

29:                                               ; preds = %26, %22
  %30 = getelementptr inbounds i8, ptr %0, i64 1208
  tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(5) %30, ptr noundef nonnull align 4 dereferenceable(5) %12, i64 5, i1 false)
  %31 = getelementptr inbounds i8, ptr %0, i64 1212
  store i8 0, ptr %31, align 4, !tbaa !19
  %32 = getelementptr inbounds i8, ptr %0, i64 1224
  store i64 %2, ptr %32, align 8, !tbaa !22
  %33 = icmp eq i64 %2, 0
  br i1 %33, label %34, label %36

34:                                               ; preds = %29
  %35 = getelementptr inbounds i8, ptr %0, i64 1216
  store ptr null, ptr %35, align 8, !tbaa !23
  br label %39

36:                                               ; preds = %29
  %37 = tail call ptr @png_malloc(ptr noundef nonnull %0, i64 noundef %2) #4
  %38 = getelementptr inbounds i8, ptr %0, i64 1216
  store ptr %37, ptr %38, align 8, !tbaa !23
  tail call void @png_crc_read(ptr noundef nonnull %0, ptr noundef %37, i64 noundef %2)
  br label %39

39:                                               ; preds = %36, %34
  %40 = getelementptr inbounds i8, ptr %0, i64 1056
  %41 = load ptr, ptr %40, align 8, !tbaa !20
  %.not52 = icmp eq ptr %41, null
  br i1 %.not52, label %54, label %42

42:                                               ; preds = %39
  %43 = tail call i32 %41(ptr noundef nonnull %0, ptr noundef nonnull %30) #4
  %44 = icmp slt i32 %43, 0
  br i1 %44, label %.thread, label %45

.thread:                                          ; preds = %42
  tail call void @png_chunk_error(ptr noundef nonnull %0, ptr noundef nonnull @.str.119) #4
  br label %55

45:                                               ; preds = %42
  %46 = icmp eq i32 %43, 0
  br i1 %46, label %47, label %55

47:                                               ; preds = %45
  %48 = load i8, ptr %12, align 4, !tbaa !19
  %49 = and i8 %48, 32
  %.not53 = icmp eq i8 %49, 0
  br i1 %.not53, label %50, label %53

50:                                               ; preds = %47
  %51 = tail call i32 @png_handle_as_unknown(ptr noundef nonnull %0, ptr noundef nonnull %12) #4
  %.not54 = icmp eq i32 %51, 3
  br i1 %.not54, label %53, label %52

52:                                               ; preds = %50
  tail call void @png_chunk_error(ptr noundef nonnull %0, ptr noundef nonnull @.str.118) #4
  br label %53

53:                                               ; preds = %50, %52, %47
  tail call void @png_set_unknown_chunks(ptr noundef nonnull %0, ptr noundef %1, ptr noundef nonnull %30, i32 noundef 1) #4
  br label %55

54:                                               ; preds = %39
  tail call void @png_set_unknown_chunks(ptr noundef nonnull %0, ptr noundef %1, ptr noundef nonnull %30, i32 noundef 1) #4
  br label %55

55:                                               ; preds = %.thread, %45, %53, %54
  %56 = getelementptr inbounds i8, ptr %0, i64 1216
  %57 = load ptr, ptr %56, align 8, !tbaa !23
  tail call void @png_free(ptr noundef nonnull %0, ptr noundef %57) #4
  store ptr null, ptr %56, align 8, !tbaa !23
  br label %58

58:                                               ; preds = %26, %55
  %.0 = phi i64 [ 0, %55 ], [ %2, %26 ]
  %59 = tail call i32 @png_crc_finish(ptr noundef nonnull %0, i64 noundef %.0)
  ret void
}

declare i32 @png_handle_as_unknown(ptr noundef, ptr noundef) local_unnamed_addr #2

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

; Function Attrs: nofree nounwind willreturn memory(argmem: read)
declare i32 @bcmp(ptr nocapture, ptr nocapture, i64) local_unnamed_addr #3

attributes #0 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #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 = { nofree nounwind willreturn memory(argmem: read) }
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, !10, i64 280}
!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, !7, i64 272, !7, i64 273, !10, i64 280, !10, i64 288, !10, i64 296, !11, i64 304, !9, i64 416, !10, i64 424, !12, i64 432, !12, i64 436, !12, i64 440, !12, i64 444, !12, i64 448, !10, i64 456, !10, i64 464, !10, i64 472, !10, i64 480, !10, i64 488, !10, i64 496, !10, i64 504, !10, i64 512, !9, i64 520, !9, i64 528, !9, i64 536, !9, i64 544, !9, i64 552, !9, i64 560, !13, i64 568, !10, i64 592, !10, i64 600, !9, i64 608, !14, i64 616, !14, i64 618, !7, i64 620, !7, i64 625, !7, i64 626, !7, i64 627, !7, i64 628, !7, i64 629, !7, i64 630, !7, i64 631, !7, i64 632, !7, i64 633, !7, i64 634, !7, i64 635, !7, i64 636, !14, i64 638, !7, i64 640, !15, i64 644, !16, i64 648, !16, i64 658, !9, i64 672, !10, i64 680, !10, i64 688, !12, i64 696, !15, i64 700, !15, i64 704, !9, i64 712, !9, i64 720, !9, i64 728, !9, i64 736, !9, i64 744, !9, i64 752, !17, i64 760, !17, i64 765, !9, i64 776, !16, i64 784, !9, i64 800, !9, i64 808, !9, i64 816, !9, i64 824, !9, i64 832, !9, i64 840, !9, i64 848, !9, i64 856, !9, i64 864, !10, i64 872, !10, i64 880, !10, i64 888, !10, i64 896, !10, i64 904, !10, i64 912, !12, i64 920, !12, i64 924, !10, i64 928, !10, i64 936, !9, i64 944, !9, i64 952, !9, i64 960, !9, i64 968, !9, i64 976, !7, i64 984, !7, i64 985, !9, i64 992, !9, i64 1000, !9, i64 1008, !9, i64 1016, !9, i64 1024, !9, i64 1032, !10, i64 1040, !9, i64 1048, !9, i64 1056, !12, i64 1064, !9, i64 1072, !7, i64 1080, !14, i64 1082, !14, i64 1084, !14, i64 1086, !10, i64 1088, !10, i64 1096, !7, i64 1104, !7, i64 1105, !10, i64 1112, !10, i64 1120, !9, i64 1128, !9, i64 1136, !9, i64 1144, !9, i64 1152, !9, i64 1160, !9, i64 1168, !9, i64 1176, !7, i64 1184, !10, i64 1192, !10, i64 1200, !18, i64 1208, !10, i64 1240, !10, i64 1248, !9, i64 1256}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!"any pointer", !7, i64 0}
!10 = !{!"long", !7, i64 0}
!11 = !{!"z_stream_s", !9, i64 0, !12, i64 8, !10, i64 16, !9, i64 24, !12, i64 32, !10, i64 40, !9, i64 48, !9, i64 56, !9, i64 64, !9, i64 72, !9, i64 80, !12, i64 88, !10, i64 96, !10, i64 104}
!12 = !{!"int", !7, i64 0}
!13 = !{!"png_row_info_struct", !10, i64 0, !10, 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, !10, i64 16, !7, i64 24}
!19 = !{!7, !7, i64 0}
!20 = !{!6, !9, i64 1056}
!21 = !{!6, !10, i64 288}
!22 = !{!6, !10, i64 1224}
!23 = !{!6, !9, i64 1216}


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