; LLVM IR from Try/Tempest :: Engine/thirdparty/libpng (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, 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_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 }
%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_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_time_struct = type { i16, i8, i8, i8, i8, i8 }

@.str.5 = external hidden unnamed_addr constant [13 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [8 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [13 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [10 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: nounwind uwtable
declare dso_local void @png_crc_read(ptr noalias noundef, ptr noundef, i32 noundef) #1

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

; Function Attrs: noreturn
declare void @png_chunk_error(ptr noundef, ptr noundef) #2

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

; Function Attrs: nounwind uwtable
define dso_local void @png_handle_sBIT(ptr noalias noundef %0, ptr noalias noundef %1, i32 noundef %2) #1 {
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca i8, align 1
  %10 = alloca [4 x i8], align 1
  %11 = 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 4, ptr %7) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #4
  call void @llvm.lifetime.start.p0(i64 1, ptr %9) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #4
  %12 = load ptr, ptr %4, align 8, !tbaa !5
  %13 = getelementptr inbounds %struct.png_struct_def, ptr %12, i32 0, i32 15
  %14 = load i32, ptr %13, align 4, !tbaa !11
  %15 = and i32 %14, 1
  %16 = icmp eq i32 %15, 0
  br i1 %16, label %17, label %19

17:                                               ; preds = %3
  %18 = load ptr, ptr %4, align 8, !tbaa !5
  call void @png_chunk_error(ptr noundef %18, ptr noundef @.str.7) #5
  unreachable

19:                                               ; preds = %3
  %20 = load ptr, ptr %4, align 8, !tbaa !5
  %21 = getelementptr inbounds %struct.png_struct_def, ptr %20, i32 0, i32 15
  %22 = load i32, ptr %21, align 4, !tbaa !11
  %23 = and i32 %22, 6
  %24 = icmp ne i32 %23, 0
  br i1 %24, label %25, label %30

25:                                               ; preds = %19
  %26 = load ptr, ptr %4, align 8, !tbaa !5
  %27 = load i32, ptr %6, align 4, !tbaa !9
  %28 = call i32 @png_crc_finish(ptr noundef %26, i32 noundef %27)
  %29 = load ptr, ptr %4, align 8, !tbaa !5
  call void @png_chunk_benign_error(ptr noundef %29, ptr noundef @.str.5)
  store i32 1, ptr %11, align 4
  br label %171

30:                                               ; preds = %19
  br label %31

31:                                               ; preds = %30
  %32 = load ptr, ptr %5, align 8, !tbaa !5
  %33 = icmp ne ptr %32, null
  br i1 %33, label %34, label %45

34:                                               ; preds = %31
  %35 = load ptr, ptr %5, align 8, !tbaa !5
  %36 = getelementptr inbounds %struct.png_info_def, ptr %35, i32 0, i32 2
  %37 = load i32, ptr %36, align 8, !tbaa !22
  %38 = and i32 %37, 2
  %39 = icmp ne i32 %38, 0
  br i1 %39, label %40, label %45

40:                                               ; preds = %34
  %41 = load ptr, ptr %4, align 8, !tbaa !5
  %42 = load i32, ptr %6, align 4, !tbaa !9
  %43 = call i32 @png_crc_finish(ptr noundef %41, i32 noundef %42)
  %44 = load ptr, ptr %4, align 8, !tbaa !5
  call void @png_chunk_benign_error(ptr noundef %44, ptr noundef @.str.8)
  store i32 1, ptr %11, align 4
  br label %171

45:                                               ; preds = %34, %31
  %46 = load ptr, ptr %4, align 8, !tbaa !5
  %47 = getelementptr inbounds %struct.png_struct_def, ptr %46, i32 0, i32 61
  %48 = load i8, ptr %47, align 1, !tbaa !25
  %49 = zext i8 %48 to i32
  %50 = icmp eq i32 %49, 3
  br i1 %50, label %51, label %52

51:                                               ; preds = %45
  store i32 3, ptr %7, align 4, !tbaa !9
  store i8 8, ptr %9, align 1, !tbaa !26
  br label %60

52:                                               ; preds = %45
  %53 = load ptr, ptr %4, align 8, !tbaa !5
  %54 = getelementptr inbounds %struct.png_struct_def, ptr %53, i32 0, i32 65
  %55 = load i8, ptr %54, align 1, !tbaa !27
  %56 = zext i8 %55 to i32
  store i32 %56, ptr %7, align 4, !tbaa !9
  %57 = load ptr, ptr %4, align 8, !tbaa !5
  %58 = getelementptr inbounds %struct.png_struct_def, ptr %57, i32 0, i32 62
  %59 = load i8, ptr %58, align 8, !tbaa !28
  store i8 %59, ptr %9, align 1, !tbaa !26
  br label %60

60:                                               ; preds = %52, %51
  %61 = load i32, ptr %6, align 4, !tbaa !9
  %62 = load i32, ptr %7, align 4, !tbaa !9
  %63 = icmp ne i32 %61, %62
  br i1 %63, label %67, label %64

64:                                               ; preds = %60
  %65 = load i32, ptr %6, align 4, !tbaa !9
  %66 = icmp ugt i32 %65, 4
  br i1 %66, label %67, label %72

67:                                               ; preds = %64, %60
  %68 = load ptr, ptr %4, align 8, !tbaa !5
  call void @png_chunk_benign_error(ptr noundef %68, ptr noundef @.str.6)
  %69 = load ptr, ptr %4, align 8, !tbaa !5
  %70 = load i32, ptr %6, align 4, !tbaa !9
  %71 = call i32 @png_crc_finish(ptr noundef %69, i32 noundef %70)
  store i32 1, ptr %11, align 4
  br label %171

72:                                               ; preds = %64
  %73 = load i8, ptr %9, align 1, !tbaa !26
  %74 = getelementptr inbounds [4 x i8], ptr %10, i64 0, i64 3
  store i8 %73, ptr %74, align 1, !tbaa !26
  %75 = getelementptr inbounds [4 x i8], ptr %10, i64 0, i64 2
  store i8 %73, ptr %75, align 1, !tbaa !26
  %76 = getelementptr inbounds [4 x i8], ptr %10, i64 0, i64 1
  store i8 %73, ptr %76, align 1, !tbaa !26
  %77 = getelementptr inbounds [4 x i8], ptr %10, i64 0, i64 0
  store i8 %73, ptr %77, align 1, !tbaa !26
  %78 = load ptr, ptr %4, align 8, !tbaa !5
  %79 = getelementptr inbounds [4 x i8], ptr %10, i64 0, i64 0
  %80 = load i32, ptr %7, align 4, !tbaa !9
  call void @png_crc_read(ptr noundef %78, ptr noundef %79, i32 noundef %80)
  %81 = load ptr, ptr %4, align 8, !tbaa !5
  %82 = call i32 @png_crc_finish(ptr noundef %81, i32 noundef 0)
  %83 = icmp ne i32 %82, 0
  br i1 %83, label %84, label %85

84:                                               ; preds = %72
  store i32 1, ptr %11, align 4
  br label %171

85:                                               ; preds = %72
  store i32 0, ptr %8, align 4, !tbaa !9
  br label %86

86:                                               ; preds = %109, %85
  %87 = load i32, ptr %8, align 4, !tbaa !9
  %88 = load i32, ptr %7, align 4, !tbaa !9
  %89 = icmp ult i32 %87, %88
  br i1 %89, label %90, label %112

90:                                               ; preds = %86
  %91 = load i32, ptr %8, align 4, !tbaa !9
  %92 = zext i32 %91 to i64
  %93 = getelementptr inbounds [4 x i8], ptr %10, i64 0, i64 %92
  %94 = load i8, ptr %93, align 1, !tbaa !26
  %95 = zext i8 %94 to i32
  %96 = icmp eq i32 %95, 0
  br i1 %96, label %106, label %97

97:                                               ; preds = %90
  %98 = load i32, ptr %8, align 4, !tbaa !9
  %99 = zext i32 %98 to i64
  %100 = getelementptr inbounds [4 x i8], ptr %10, i64 0, i64 %99
  %101 = load i8, ptr %100, align 1, !tbaa !26
  %102 = zext i8 %101 to i32
  %103 = load i8, ptr %9, align 1, !tbaa !26
  %104 = zext i8 %103 to i32
  %105 = icmp sgt i32 %102, %104
  br i1 %105, label %106, label %108

106:                                              ; preds = %97, %90
  %107 = load ptr, ptr %4, align 8, !tbaa !5
  call void @png_chunk_benign_error(ptr noundef %107, ptr noundef @.str.6)
  store i32 1, ptr %11, align 4
  br label %171

108:                                              ; preds = %97
  br label %109

109:                                              ; preds = %108
  %110 = load i32, ptr %8, align 4, !tbaa !9
  %111 = add i32 %110, 1
  store i32 %111, ptr %8, align 4, !tbaa !9
  br label %86, !llvm.loop !29

112:                                              ; preds = %86
  %113 = load ptr, ptr %4, align 8, !tbaa !5
  %114 = getelementptr inbounds %struct.png_struct_def, ptr %113, i32 0, i32 61
  %115 = load i8, ptr %114, align 1, !tbaa !25
  %116 = zext i8 %115 to i32
  %117 = and i32 %116, 2
  %118 = icmp ne i32 %117, 0
  br i1 %118, label %119, label %140

119:                                              ; preds = %112
  %120 = getelementptr inbounds [4 x i8], ptr %10, i64 0, i64 0
  %121 = load i8, ptr %120, align 1, !tbaa !26
  %122 = load ptr, ptr %4, align 8, !tbaa !5
  %123 = getelementptr inbounds %struct.png_struct_def, ptr %122, i32 0, i32 87
  %124 = getelementptr inbounds %struct.png_color_8_struct, ptr %123, i32 0, i32 0
  store i8 %121, ptr %124, align 8, !tbaa !31
  %125 = getelementptr inbounds [4 x i8], ptr %10, i64 0, i64 1
  %126 = load i8, ptr %125, align 1, !tbaa !26
  %127 = load ptr, ptr %4, align 8, !tbaa !5
  %128 = getelementptr inbounds %struct.png_struct_def, ptr %127, i32 0, i32 87
  %129 = getelementptr inbounds %struct.png_color_8_struct, ptr %128, i32 0, i32 1
  store i8 %126, ptr %129, align 1, !tbaa !32
  %130 = getelementptr inbounds [4 x i8], ptr %10, i64 0, i64 2
  %131 = load i8, ptr %130, align 1, !tbaa !26
  %132 = load ptr, ptr %4, align 8, !tbaa !5
  %133 = getelementptr inbounds %struct.png_struct_def, ptr %132, i32 0, i32 87
  %134 = getelementptr inbounds %struct.png_color_8_struct, ptr %133, i32 0, i32 2
  store i8 %131, ptr %134, align 2, !tbaa !33
  %135 = getelementptr inbounds [4 x i8], ptr %10, i64 0, i64 3
  %136 = load i8, ptr %135, align 1, !tbaa !26
  %137 = load ptr, ptr %4, align 8, !tbaa !5
  %138 = getelementptr inbounds %struct.png_struct_def, ptr %137, i32 0, i32 87
  %139 = getelementptr inbounds %struct.png_color_8_struct, ptr %138, i32 0, i32 4
  store i8 %136, ptr %139, align 4, !tbaa !34
  br label %166

140:                                              ; preds = %112
  %141 = getelementptr inbounds [4 x i8], ptr %10, i64 0, i64 0
  %142 = load i8, ptr %141, align 1, !tbaa !26
  %143 = load ptr, ptr %4, align 8, !tbaa !5
  %144 = getelementptr inbounds %struct.png_struct_def, ptr %143, i32 0, i32 87
  %145 = getelementptr inbounds %struct.png_color_8_struct, ptr %144, i32 0, i32 3
  store i8 %142, ptr %145, align 1, !tbaa !35
  %146 = getelementptr inbounds [4 x i8], ptr %10, i64 0, i64 0
  %147 = load i8, ptr %146, align 1, !tbaa !26
  %148 = load ptr, ptr %4, align 8, !tbaa !5
  %149 = getelementptr inbounds %struct.png_struct_def, ptr %148, i32 0, i32 87
  %150 = getelementptr inbounds %struct.png_color_8_struct, ptr %149, i32 0, i32 0
  store i8 %147, ptr %150, align 8, !tbaa !31
  %151 = getelementptr inbounds [4 x i8], ptr %10, i64 0, i64 0
  %152 = load i8, ptr %151, align 1, !tbaa !26
  %153 = load ptr, ptr %4, align 8, !tbaa !5
  %154 = getelementptr inbounds %struct.png_struct_def, ptr %153, i32 0, i32 87
  %155 = getelementptr inbounds %struct.png_color_8_struct, ptr %154, i32 0, i32 1
  store i8 %152, ptr %155, align 1, !tbaa !32
  %156 = getelementptr inbounds [4 x i8], ptr %10, i64 0, i64 0
  %157 = load i8, ptr %156, align 1, !tbaa !26
  %158 = load ptr, ptr %4, align 8, !tbaa !5
  %159 = getelementptr inbounds %struct.png_struct_def, ptr %158, i32 0, i32 87
  %160 = getelementptr inbounds %struct.png_color_8_struct, ptr %159, i32 0, i32 2
  store i8 %157, ptr %160, align 2, !tbaa !33
  %161 = getelementptr inbounds [4 x i8], ptr %10, i64 0, i64 1
  %162 = load i8, ptr %161, align 1, !tbaa !26
  %163 = load ptr, ptr %4, align 8, !tbaa !5
  %164 = getelementptr inbounds %struct.png_struct_def, ptr %163, i32 0, i32 87
  %165 = getelementptr inbounds %struct.png_color_8_struct, ptr %164, i32 0, i32 4
  store i8 %162, ptr %165, align 4, !tbaa !34
  br label %166

166:                                              ; preds = %140, %119
  %167 = load ptr, ptr %4, align 8, !tbaa !5
  %168 = load ptr, ptr %5, align 8, !tbaa !5
  %169 = load ptr, ptr %4, align 8, !tbaa !5
  %170 = getelementptr inbounds %struct.png_struct_def, ptr %169, i32 0, i32 87
  call void @png_set_sBIT(ptr noundef %167, ptr noundef %168, ptr noundef %170)
  store i32 0, ptr %11, align 4
  br label %171

171:                                              ; preds = %166, %106, %84, %67, %40, %25
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #4
  call void @llvm.lifetime.end.p0(i64 1, ptr %9) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #4
  %172 = load i32, ptr %11, align 4
  switch i32 %172, label %174 [
    i32 0, label %173
    i32 1, label %173
  ]

173:                                              ; preds = %171, %171
  ret void

174:                                              ; preds = %171
  unreachable
}

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

attributes #0 = { nocallback nofree nosync 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 = { noreturn "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 }
attributes #5 = { noreturn }

!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 300}
!12 = !{!"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, !14, 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, !15, i64 600, !10, i64 604, !15, 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, !15, i64 626, !7, i64 628, !10, i64 632, !16, i64 636, !16, 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, !17, i64 728, !17, i64 733, !6, i64 744, !16, 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, !15, i64 978, !15, 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, !18, i64 1072, !13, i64 1104, !6, i64 1112, !13, i64 1120, !10, i64 1128, !10, i64 1132, !6, i64 1136, !7, i64 1144, !19, i64 1176}
!13 = !{!"long", !7, i64 0}
!14 = !{!"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}
!15 = !{!"short", !7, i64 0}
!16 = !{!"png_color_16_struct", !7, i64 0, !15, i64 2, !15, i64 4, !15, i64 6, !15, 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, !6, i64 8, !13, i64 16, !7, i64 24}
!19 = !{!"png_colorspace", !10, i64 0, !20, i64 4, !21, i64 36, !15, i64 72, !15, i64 74}
!20 = !{!"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}
!21 = !{!"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}
!22 = !{!23, !10, i64 8}
!23 = !{!"png_info_def", !10, i64 0, !10, i64 4, !10, i64 8, !13, i64 16, !6, i64 24, !15, i64 32, !15, 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, !19, i64 52, !6, i64 128, !6, i64 136, !10, i64 144, !10, i64 148, !10, i64 152, !6, i64 160, !24, i64 168, !17, i64 176, !6, i64 184, !16, i64 192, !16, 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}
!24 = !{!"png_time_struct", !15, i64 0, !7, i64 2, !7, i64 3, !7, i64 4, !7, i64 5, !7, i64 6}
!25 = !{!12, !7, i64 615}
!26 = !{!7, !7, i64 0}
!27 = !{!12, !7, i64 619}
!28 = !{!12, !7, i64 616}
!29 = distinct !{!29, !30}
!30 = !{!"llvm.loop.mustprogress"}
!31 = !{!12, !7, i64 728}
!32 = !{!12, !7, i64 729}
!33 = !{!12, !7, i64 730}
!34 = !{!12, !7, i64 732}
!35 = !{!12, !7, i64 731}


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

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

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

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

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

; Function Attrs: noreturn
declare void @png_chunk_error(ptr noundef, ptr noundef) local_unnamed_addr #2

declare void @png_chunk_benign_error(ptr noundef, ptr noundef) local_unnamed_addr #3

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

9:                                                ; preds = %3
  tail call void @png_chunk_error(ptr noundef nonnull %0, ptr noundef nonnull @.str.7) #6
  unreachable

10:                                               ; preds = %3
  %11 = and i32 %6, 6
  %.not = icmp eq i32 %11, 0
  br i1 %.not, label %14, label %12

12:                                               ; preds = %10
  %13 = tail call i32 @png_crc_finish(ptr noundef nonnull %0, i32 noundef %2)
  tail call void @png_chunk_benign_error(ptr noundef nonnull %0, ptr noundef nonnull @.str.5) #5
  br label %71

14:                                               ; preds = %10
  %.not48 = icmp eq ptr %1, null
  br i1 %.not48, label %21, label %15

15:                                               ; preds = %14
  %16 = getelementptr inbounds i8, ptr %1, i64 8
  %17 = load i32, ptr %16, align 8, !tbaa !20
  %18 = and i32 %17, 2
  %.not49 = icmp eq i32 %18, 0
  br i1 %.not49, label %21, label %19

19:                                               ; preds = %15
  %20 = tail call i32 @png_crc_finish(ptr noundef nonnull %0, i32 noundef %2)
  tail call void @png_chunk_benign_error(ptr noundef nonnull %0, ptr noundef nonnull @.str.8) #5
  br label %71

21:                                               ; preds = %15, %14
  %22 = getelementptr inbounds i8, ptr %0, i64 615
  %23 = load i8, ptr %22, align 1, !tbaa !23
  %24 = icmp eq i8 %23, 3
  br i1 %24, label %32, label %25

25:                                               ; preds = %21
  %26 = getelementptr inbounds i8, ptr %0, i64 619
  %27 = load i8, ptr %26, align 1, !tbaa !24
  %28 = zext i8 %27 to i32
  %29 = getelementptr inbounds i8, ptr %0, i64 616
  %30 = load i8, ptr %29, align 8, !tbaa !25
  %31 = freeze i8 %30
  br label %32

32:                                               ; preds = %21, %25
  %.045 = phi i32 [ %28, %25 ], [ 3, %21 ]
  %.0 = phi i8 [ %31, %25 ], [ 8, %21 ]
  %33 = icmp ne i32 %.045, %2
  %34 = icmp ugt i32 %2, 4
  %or.cond = or i1 %34, %33
  br i1 %or.cond, label %35, label %37

35:                                               ; preds = %32
  tail call void @png_chunk_benign_error(ptr noundef nonnull %0, ptr noundef nonnull @.str.6) #5
  %36 = tail call i32 @png_crc_finish(ptr noundef nonnull %0, i32 noundef %2)
  br label %71

37:                                               ; preds = %32
  %38 = getelementptr inbounds i8, ptr %4, i64 3
  %39 = getelementptr inbounds i8, ptr %4, i64 2
  %40 = getelementptr inbounds i8, ptr %4, i64 1
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(4) %4, i8 %.0, i64 4, i1 false)
  call void @png_crc_read(ptr noundef nonnull %0, ptr noundef nonnull %4, i32 noundef %2)
  %41 = call i32 @png_crc_finish(ptr noundef nonnull %0, i32 noundef 0)
  %.not50 = icmp eq i32 %41, 0
  br i1 %.not50, label %.preheader, label %71

.preheader:                                       ; preds = %37
  %.not54 = icmp eq i32 %2, 0
  br i1 %.not54, label %._crit_edge, label %.lr.ph

42:                                               ; preds = %.lr.ph
  %exitcond.not = icmp eq i32 %2, 1
  br i1 %exitcond.not, label %._crit_edge, label %.lr.ph.1, !llvm.loop !26

.lr.ph.1:                                         ; preds = %42
  %43 = getelementptr inbounds i8, ptr %4, i64 1
  %44 = load i8, ptr %43, align 1, !tbaa !28
  %45 = add i8 %44, -1
  %or.cond52.not.1 = icmp ult i8 %45, %.0
  br i1 %or.cond52.not.1, label %46, label %56

46:                                               ; preds = %.lr.ph.1
  %exitcond.not.1 = icmp eq i32 %2, 2
  br i1 %exitcond.not.1, label %._crit_edge, label %.lr.ph.2, !llvm.loop !26

.lr.ph.2:                                         ; preds = %46
  %47 = getelementptr inbounds i8, ptr %4, i64 2
  %48 = load i8, ptr %47, align 1, !tbaa !28
  %49 = add i8 %48, -1
  %or.cond52.not.2 = icmp ult i8 %49, %.0
  br i1 %or.cond52.not.2, label %50, label %56

50:                                               ; preds = %.lr.ph.2
  %exitcond.not.2 = icmp eq i32 %2, 3
  br i1 %exitcond.not.2, label %._crit_edge, label %.lr.ph.3, !llvm.loop !26

.lr.ph.3:                                         ; preds = %50
  %51 = getelementptr inbounds i8, ptr %4, i64 3
  %52 = load i8, ptr %51, align 1, !tbaa !28
  %53 = add i8 %52, -1
  %or.cond52.not.3 = icmp ult i8 %53, %.0
  br i1 %or.cond52.not.3, label %._crit_edge, label %56

.lr.ph:                                           ; preds = %.preheader
  %54 = load i8, ptr %4, align 1, !tbaa !28
  %55 = add i8 %54, -1
  %or.cond52.not = icmp ult i8 %55, %.0
  br i1 %or.cond52.not, label %42, label %56

56:                                               ; preds = %.lr.ph.3, %.lr.ph.2, %.lr.ph.1, %.lr.ph
  call void @png_chunk_benign_error(ptr noundef %0, ptr noundef nonnull @.str.6) #5
  br label %71

._crit_edge:                                      ; preds = %42, %46, %50, %.lr.ph.3, %.preheader
  %57 = load i8, ptr %22, align 1, !tbaa !23
  %58 = and i8 %57, 2
  %.not51 = icmp eq i8 %58, 0
  %59 = load i8, ptr %4, align 1, !tbaa !28
  br i1 %.not51, label %63, label %60

60:                                               ; preds = %._crit_edge
  %61 = load i8, ptr %40, align 1, !tbaa !28
  %62 = load i8, ptr %39, align 1, !tbaa !28
  br label %65

63:                                               ; preds = %._crit_edge
  %64 = getelementptr inbounds i8, ptr %0, i64 731
  store i8 %59, ptr %64, align 1, !tbaa !29
  br label %65

65:                                               ; preds = %63, %60
  %.sink59 = phi ptr [ %40, %63 ], [ %38, %60 ]
  %.sink57 = phi i8 [ %59, %63 ], [ %61, %60 ]
  %.sink56 = phi i8 [ %59, %63 ], [ %62, %60 ]
  %66 = load i8, ptr %.sink59, align 1, !tbaa !28
  %67 = getelementptr inbounds i8, ptr %0, i64 728
  store i8 %59, ptr %67, align 8
  %68 = getelementptr inbounds i8, ptr %0, i64 729
  store i8 %.sink57, ptr %68, align 1
  %69 = getelementptr inbounds i8, ptr %0, i64 730
  store i8 %.sink56, ptr %69, align 2
  %70 = getelementptr inbounds i8, ptr %0, i64 732
  store i8 %66, ptr %70, align 4
  call void @png_set_sBIT(ptr noundef nonnull %0, ptr noundef %1, ptr noundef nonnull %67) #5
  br label %71

71:                                               ; preds = %37, %65, %56, %35, %19, %12
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #5
  ret void
}

declare void @png_set_sBIT(ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #3

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #4

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


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,MemCpyOptPass,MergedLoadStoreMotionPass,ReassociatePass,SROAPass,SimplifyCFGPass,TailCallElimPass