; 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
@.str.25 = external hidden unnamed_addr constant [27 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_tRNS(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 [256 x i8], align 16
  %8 = alloca i32, align 4
  %9 = alloca [2 x i8], align 1
  %10 = alloca [6 x i8], align 1
  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 256, ptr %7) #4
  %11 = load ptr, ptr %4, align 8, !tbaa !5
  %12 = getelementptr inbounds %struct.png_struct_def, ptr %11, i32 0, i32 15
  %13 = load i32, ptr %12, align 4, !tbaa !11
  %14 = and i32 %13, 1
  %15 = icmp eq i32 %14, 0
  br i1 %15, label %16, label %18

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

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

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

29:                                               ; preds = %18
  %30 = load ptr, ptr %5, align 8, !tbaa !5
  %31 = icmp ne ptr %30, null
  br i1 %31, label %32, label %43

32:                                               ; preds = %29
  %33 = load ptr, ptr %5, align 8, !tbaa !5
  %34 = getelementptr inbounds %struct.png_info_def, ptr %33, i32 0, i32 2
  %35 = load i32, ptr %34, align 8, !tbaa !22
  %36 = and i32 %35, 16
  %37 = icmp ne i32 %36, 0
  br i1 %37, label %38, label %43

38:                                               ; preds = %32
  %39 = load ptr, ptr %4, align 8, !tbaa !5
  %40 = load i32, ptr %6, align 4, !tbaa !9
  %41 = call i32 @png_crc_finish(ptr noundef %39, i32 noundef %40)
  %42 = load ptr, ptr %4, align 8, !tbaa !5
  call void @png_chunk_benign_error(ptr noundef %42, ptr noundef @.str.8)
  store i32 1, ptr %8, align 4
  br label %213

43:                                               ; preds = %32, %29
  br label %44

44:                                               ; preds = %43
  br label %45

45:                                               ; preds = %44
  %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, 0
  br i1 %50, label %51, label %80

51:                                               ; preds = %45
  call void @llvm.lifetime.start.p0(i64 2, ptr %9) #4
  %52 = load i32, ptr %6, align 4, !tbaa !9
  %53 = icmp ne i32 %52, 2
  br i1 %53, label %54, label %59

54:                                               ; preds = %51
  %55 = load ptr, ptr %4, align 8, !tbaa !5
  %56 = load i32, ptr %6, align 4, !tbaa !9
  %57 = call i32 @png_crc_finish(ptr noundef %55, i32 noundef %56)
  %58 = load ptr, ptr %4, align 8, !tbaa !5
  call void @png_chunk_benign_error(ptr noundef %58, ptr noundef @.str.6)
  store i32 1, ptr %8, align 4
  br label %77

59:                                               ; preds = %51
  %60 = load ptr, ptr %4, align 8, !tbaa !5
  %61 = getelementptr inbounds [2 x i8], ptr %9, i64 0, i64 0
  call void @png_crc_read(ptr noundef %60, ptr noundef %61, i32 noundef 2)
  %62 = load ptr, ptr %4, align 8, !tbaa !5
  %63 = getelementptr inbounds %struct.png_struct_def, ptr %62, i32 0, i32 55
  store i16 1, ptr %63, align 8, !tbaa !26
  %64 = getelementptr inbounds [2 x i8], ptr %9, i64 0, i64 0
  %65 = load i8, ptr %64, align 1, !tbaa !27
  %66 = zext i8 %65 to i32
  %67 = shl i32 %66, 8
  %68 = getelementptr inbounds [2 x i8], ptr %9, i64 0, i64 0
  %69 = getelementptr inbounds i8, ptr %68, i64 1
  %70 = load i8, ptr %69, align 1, !tbaa !27
  %71 = zext i8 %70 to i32
  %72 = add i32 %67, %71
  %73 = trunc i32 %72 to i16
  %74 = load ptr, ptr %4, align 8, !tbaa !5
  %75 = getelementptr inbounds %struct.png_struct_def, ptr %74, i32 0, i32 90
  %76 = getelementptr inbounds %struct.png_color_16_struct, ptr %75, i32 0, i32 4
  store i16 %73, ptr %76, align 8, !tbaa !28
  store i32 0, ptr %8, align 4
  br label %77

77:                                               ; preds = %59, %54
  call void @llvm.lifetime.end.p0(i64 2, ptr %9) #4
  %78 = load i32, ptr %8, align 4
  switch i32 %78, label %213 [
    i32 0, label %79
  ]

79:                                               ; preds = %77
  br label %196

80:                                               ; preds = %45
  %81 = load ptr, ptr %4, align 8, !tbaa !5
  %82 = getelementptr inbounds %struct.png_struct_def, ptr %81, i32 0, i32 61
  %83 = load i8, ptr %82, align 1, !tbaa !25
  %84 = zext i8 %83 to i32
  %85 = icmp eq i32 %84, 2
  br i1 %85, label %86, label %146

86:                                               ; preds = %80
  call void @llvm.lifetime.start.p0(i64 6, ptr %10) #4
  %87 = load i32, ptr %6, align 4, !tbaa !9
  %88 = icmp ne i32 %87, 6
  br i1 %88, label %89, label %94

89:                                               ; preds = %86
  %90 = load ptr, ptr %4, align 8, !tbaa !5
  %91 = load i32, ptr %6, align 4, !tbaa !9
  %92 = call i32 @png_crc_finish(ptr noundef %90, i32 noundef %91)
  %93 = load ptr, ptr %4, align 8, !tbaa !5
  call void @png_chunk_benign_error(ptr noundef %93, ptr noundef @.str.6)
  store i32 1, ptr %8, align 4
  br label %143

94:                                               ; preds = %86
  %95 = load ptr, ptr %4, align 8, !tbaa !5
  %96 = getelementptr inbounds [6 x i8], ptr %10, i64 0, i64 0
  %97 = load i32, ptr %6, align 4, !tbaa !9
  call void @png_crc_read(ptr noundef %95, ptr noundef %96, i32 noundef %97)
  %98 = load ptr, ptr %4, align 8, !tbaa !5
  %99 = getelementptr inbounds %struct.png_struct_def, ptr %98, i32 0, i32 55
  store i16 1, ptr %99, align 8, !tbaa !26
  %100 = getelementptr inbounds [6 x i8], ptr %10, i64 0, i64 0
  %101 = load i8, ptr %100, align 1, !tbaa !27
  %102 = zext i8 %101 to i32
  %103 = shl i32 %102, 8
  %104 = getelementptr inbounds [6 x i8], ptr %10, i64 0, i64 0
  %105 = getelementptr inbounds i8, ptr %104, i64 1
  %106 = load i8, ptr %105, align 1, !tbaa !27
  %107 = zext i8 %106 to i32
  %108 = add i32 %103, %107
  %109 = trunc i32 %108 to i16
  %110 = load ptr, ptr %4, align 8, !tbaa !5
  %111 = getelementptr inbounds %struct.png_struct_def, ptr %110, i32 0, i32 90
  %112 = getelementptr inbounds %struct.png_color_16_struct, ptr %111, i32 0, i32 1
  store i16 %109, ptr %112, align 2, !tbaa !29
  %113 = getelementptr inbounds [6 x i8], ptr %10, i64 0, i64 0
  %114 = getelementptr inbounds i8, ptr %113, i64 2
  %115 = load i8, ptr %114, align 1, !tbaa !27
  %116 = zext i8 %115 to i32
  %117 = shl i32 %116, 8
  %118 = getelementptr inbounds [6 x i8], ptr %10, i64 0, i64 0
  %119 = getelementptr inbounds i8, ptr %118, i64 2
  %120 = getelementptr inbounds i8, ptr %119, i64 1
  %121 = load i8, ptr %120, align 1, !tbaa !27
  %122 = zext i8 %121 to i32
  %123 = add i32 %117, %122
  %124 = trunc i32 %123 to i16
  %125 = load ptr, ptr %4, align 8, !tbaa !5
  %126 = getelementptr inbounds %struct.png_struct_def, ptr %125, i32 0, i32 90
  %127 = getelementptr inbounds %struct.png_color_16_struct, ptr %126, i32 0, i32 2
  store i16 %124, ptr %127, align 4, !tbaa !30
  %128 = getelementptr inbounds [6 x i8], ptr %10, i64 0, i64 0
  %129 = getelementptr inbounds i8, ptr %128, i64 4
  %130 = load i8, ptr %129, align 1, !tbaa !27
  %131 = zext i8 %130 to i32
  %132 = shl i32 %131, 8
  %133 = getelementptr inbounds [6 x i8], ptr %10, i64 0, i64 0
  %134 = getelementptr inbounds i8, ptr %133, i64 4
  %135 = getelementptr inbounds i8, ptr %134, i64 1
  %136 = load i8, ptr %135, align 1, !tbaa !27
  %137 = zext i8 %136 to i32
  %138 = add i32 %132, %137
  %139 = trunc i32 %138 to i16
  %140 = load ptr, ptr %4, align 8, !tbaa !5
  %141 = getelementptr inbounds %struct.png_struct_def, ptr %140, i32 0, i32 90
  %142 = getelementptr inbounds %struct.png_color_16_struct, ptr %141, i32 0, i32 3
  store i16 %139, ptr %142, align 2, !tbaa !31
  store i32 0, ptr %8, align 4
  br label %143

143:                                              ; preds = %94, %89
  call void @llvm.lifetime.end.p0(i64 6, ptr %10) #4
  %144 = load i32, ptr %8, align 4
  switch i32 %144, label %213 [
    i32 0, label %145
  ]

145:                                              ; preds = %143
  br label %195

146:                                              ; preds = %80
  %147 = load ptr, ptr %4, align 8, !tbaa !5
  %148 = getelementptr inbounds %struct.png_struct_def, ptr %147, i32 0, i32 61
  %149 = load i8, ptr %148, align 1, !tbaa !25
  %150 = zext i8 %149 to i32
  %151 = icmp eq i32 %150, 3
  br i1 %151, label %152, label %189

152:                                              ; preds = %146
  %153 = load ptr, ptr %4, align 8, !tbaa !5
  %154 = getelementptr inbounds %struct.png_struct_def, ptr %153, i32 0, i32 15
  %155 = load i32, ptr %154, align 4, !tbaa !11
  %156 = and i32 %155, 2
  %157 = icmp eq i32 %156, 0
  br i1 %157, label %158, label %163

158:                                              ; preds = %152
  %159 = load ptr, ptr %4, align 8, !tbaa !5
  %160 = load i32, ptr %6, align 4, !tbaa !9
  %161 = call i32 @png_crc_finish(ptr noundef %159, i32 noundef %160)
  %162 = load ptr, ptr %4, align 8, !tbaa !5
  call void @png_chunk_benign_error(ptr noundef %162, ptr noundef @.str.5)
  store i32 1, ptr %8, align 4
  br label %213

163:                                              ; preds = %152
  %164 = load i32, ptr %6, align 4, !tbaa !9
  %165 = load ptr, ptr %4, align 8, !tbaa !5
  %166 = getelementptr inbounds %struct.png_struct_def, ptr %165, i32 0, i32 53
  %167 = load i16, ptr %166, align 8, !tbaa !32
  %168 = zext i16 %167 to i32
  %169 = icmp ugt i32 %164, %168
  br i1 %169, label %176, label %170

170:                                              ; preds = %163
  %171 = load i32, ptr %6, align 4, !tbaa !9
  %172 = icmp ugt i32 %171, 256
  br i1 %172, label %176, label %173

173:                                              ; preds = %170
  %174 = load i32, ptr %6, align 4, !tbaa !9
  %175 = icmp eq i32 %174, 0
  br i1 %175, label %176, label %181

176:                                              ; preds = %173, %170, %163
  %177 = load ptr, ptr %4, align 8, !tbaa !5
  %178 = load i32, ptr %6, align 4, !tbaa !9
  %179 = call i32 @png_crc_finish(ptr noundef %177, i32 noundef %178)
  %180 = load ptr, ptr %4, align 8, !tbaa !5
  call void @png_chunk_benign_error(ptr noundef %180, ptr noundef @.str.6)
  store i32 1, ptr %8, align 4
  br label %213

181:                                              ; preds = %173
  %182 = load ptr, ptr %4, align 8, !tbaa !5
  %183 = getelementptr inbounds [256 x i8], ptr %7, i64 0, i64 0
  %184 = load i32, ptr %6, align 4, !tbaa !9
  call void @png_crc_read(ptr noundef %182, ptr noundef %183, i32 noundef %184)
  %185 = load i32, ptr %6, align 4, !tbaa !9
  %186 = trunc i32 %185 to i16
  %187 = load ptr, ptr %4, align 8, !tbaa !5
  %188 = getelementptr inbounds %struct.png_struct_def, ptr %187, i32 0, i32 55
  store i16 %186, ptr %188, align 8, !tbaa !26
  br label %194

189:                                              ; preds = %146
  %190 = load ptr, ptr %4, align 8, !tbaa !5
  %191 = load i32, ptr %6, align 4, !tbaa !9
  %192 = call i32 @png_crc_finish(ptr noundef %190, i32 noundef %191)
  %193 = load ptr, ptr %4, align 8, !tbaa !5
  call void @png_chunk_benign_error(ptr noundef %193, ptr noundef @.str.25)
  store i32 1, ptr %8, align 4
  br label %213

194:                                              ; preds = %181
  br label %195

195:                                              ; preds = %194, %145
  br label %196

196:                                              ; preds = %195, %79
  %197 = load ptr, ptr %4, align 8, !tbaa !5
  %198 = call i32 @png_crc_finish(ptr noundef %197, i32 noundef 0)
  %199 = icmp ne i32 %198, 0
  br i1 %199, label %200, label %203

200:                                              ; preds = %196
  %201 = load ptr, ptr %4, align 8, !tbaa !5
  %202 = getelementptr inbounds %struct.png_struct_def, ptr %201, i32 0, i32 55
  store i16 0, ptr %202, align 8, !tbaa !26
  store i32 1, ptr %8, align 4
  br label %213

203:                                              ; preds = %196
  %204 = load ptr, ptr %4, align 8, !tbaa !5
  %205 = load ptr, ptr %5, align 8, !tbaa !5
  %206 = getelementptr inbounds [256 x i8], ptr %7, i64 0, i64 0
  %207 = load ptr, ptr %4, align 8, !tbaa !5
  %208 = getelementptr inbounds %struct.png_struct_def, ptr %207, i32 0, i32 55
  %209 = load i16, ptr %208, align 8, !tbaa !26
  %210 = zext i16 %209 to i32
  %211 = load ptr, ptr %4, align 8, !tbaa !5
  %212 = getelementptr inbounds %struct.png_struct_def, ptr %211, i32 0, i32 90
  call void @png_set_tRNS(ptr noundef %204, ptr noundef %205, ptr noundef %206, i32 noundef %210, ptr noundef %212)
  store i32 0, ptr %8, align 4
  br label %213

213:                                              ; preds = %203, %200, %189, %176, %158, %143, %77, %38, %24
  call void @llvm.lifetime.end.p0(i64 256, ptr %7) #4
  %214 = load i32, ptr %8, align 4
  switch i32 %214, label %216 [
    i32 0, label %215
    i32 1, label %215
  ]

215:                                              ; preds = %213, %213
  ret void

216:                                              ; preds = %213
  unreachable
}

declare void @png_set_tRNS(ptr noundef, ptr noundef, ptr noundef, i32 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 = !{!12, !15, i64 608}
!27 = !{!7, !7, i64 0}
!28 = !{!12, !15, i64 760}
!29 = !{!12, !15, i64 754}
!30 = !{!12, !15, i64 756}
!31 = !{!12, !15, i64 758}
!32 = !{!12, !15, i64 600}


; 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
@.str.25 = external hidden unnamed_addr constant [27 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_tRNS(ptr noalias noundef %0, ptr noalias noundef %1, i32 noundef %2) local_unnamed_addr #1 {
  %4 = alloca [256 x i8], align 16
  %5 = alloca [2 x i8], align 1
  %6 = alloca [6 x i8], align 1
  call void @llvm.lifetime.start.p0(i64 256, ptr nonnull %4) #4
  %7 = getelementptr inbounds i8, ptr %0, i64 300
  %8 = load i32, ptr %7, align 4, !tbaa !5
  %9 = and i32 %8, 1
  %10 = icmp eq i32 %9, 0
  br i1 %10, label %11, label %12

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

12:                                               ; preds = %3
  %13 = and i32 %8, 4
  %.not = icmp eq i32 %13, 0
  br i1 %.not, label %16, label %14

14:                                               ; preds = %12
  %15 = 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) #4
  br label %95

16:                                               ; preds = %12
  %.not64 = icmp eq ptr %1, null
  br i1 %.not64, label %23, label %17

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

21:                                               ; preds = %17
  %22 = 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) #4
  br label %95

23:                                               ; preds = %17, %16
  %24 = getelementptr inbounds i8, ptr %0, i64 615
  %25 = load i8, ptr %24, align 1, !tbaa !23
  switch i8 %25, label %85 [
    i8 0, label %26
    i8 2, label %38
    i8 3, label %68
  ]

26:                                               ; preds = %23
  call void @llvm.lifetime.start.p0(i64 2, ptr nonnull %5) #4
  %.not67 = icmp eq i32 %2, 2
  br i1 %.not67, label %.thread, label %36

.thread:                                          ; preds = %26
  call void @png_crc_read(ptr noundef nonnull %0, ptr noundef nonnull %5, i32 noundef 2)
  %27 = getelementptr inbounds i8, ptr %0, i64 608
  store i16 1, ptr %27, align 8, !tbaa !24
  %28 = load i8, ptr %5, align 1, !tbaa !25
  %29 = zext i8 %28 to i16
  %30 = shl nuw i16 %29, 8
  %31 = getelementptr inbounds i8, ptr %5, i64 1
  %32 = load i8, ptr %31, align 1, !tbaa !25
  %33 = zext i8 %32 to i16
  %34 = or disjoint i16 %30, %33
  %35 = getelementptr inbounds i8, ptr %0, i64 760
  store i16 %34, ptr %35, align 8, !tbaa !26
  call void @llvm.lifetime.end.p0(i64 2, ptr nonnull %5) #4
  br label %87

36:                                               ; preds = %26
  %37 = 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.6) #4
  call void @llvm.lifetime.end.p0(i64 2, ptr nonnull %5) #4
  br label %95

38:                                               ; preds = %23
  call void @llvm.lifetime.start.p0(i64 6, ptr nonnull %6) #4
  %.not66 = icmp eq i32 %2, 6
  br i1 %.not66, label %.thread69, label %66

.thread69:                                        ; preds = %38
  call void @png_crc_read(ptr noundef nonnull %0, ptr noundef nonnull %6, i32 noundef 6)
  %39 = getelementptr inbounds i8, ptr %0, i64 608
  store i16 1, ptr %39, align 8, !tbaa !24
  %40 = load i8, ptr %6, align 1, !tbaa !25
  %41 = zext i8 %40 to i16
  %42 = shl nuw i16 %41, 8
  %43 = getelementptr inbounds i8, ptr %6, i64 1
  %44 = load i8, ptr %43, align 1, !tbaa !25
  %45 = zext i8 %44 to i16
  %46 = or disjoint i16 %42, %45
  %47 = getelementptr inbounds i8, ptr %0, i64 754
  store i16 %46, ptr %47, align 2, !tbaa !27
  %48 = getelementptr inbounds i8, ptr %6, i64 2
  %49 = load i8, ptr %48, align 1, !tbaa !25
  %50 = zext i8 %49 to i16
  %51 = shl nuw i16 %50, 8
  %52 = getelementptr inbounds i8, ptr %6, i64 3
  %53 = load i8, ptr %52, align 1, !tbaa !25
  %54 = zext i8 %53 to i16
  %55 = or disjoint i16 %51, %54
  %56 = getelementptr inbounds i8, ptr %0, i64 756
  store i16 %55, ptr %56, align 4, !tbaa !28
  %57 = getelementptr inbounds i8, ptr %6, i64 4
  %58 = load i8, ptr %57, align 1, !tbaa !25
  %59 = zext i8 %58 to i16
  %60 = shl nuw i16 %59, 8
  %61 = getelementptr inbounds i8, ptr %6, i64 5
  %62 = load i8, ptr %61, align 1, !tbaa !25
  %63 = zext i8 %62 to i16
  %64 = or disjoint i16 %60, %63
  %65 = getelementptr inbounds i8, ptr %0, i64 758
  store i16 %64, ptr %65, align 2, !tbaa !29
  call void @llvm.lifetime.end.p0(i64 6, ptr nonnull %6) #4
  br label %87

66:                                               ; preds = %38
  %67 = 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.6) #4
  call void @llvm.lifetime.end.p0(i64 6, ptr nonnull %6) #4
  br label %95

68:                                               ; preds = %23
  %69 = and i32 %8, 2
  %70 = icmp eq i32 %69, 0
  br i1 %70, label %71, label %73

71:                                               ; preds = %68
  %72 = 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) #4
  br label %95

73:                                               ; preds = %68
  %74 = getelementptr inbounds i8, ptr %0, i64 600
  %75 = load i16, ptr %74, align 8, !tbaa !30
  %76 = zext i16 %75 to i32
  %77 = icmp ugt i32 %2, 256
  %78 = add i32 %2, -1
  %79 = icmp uge i32 %78, %76
  %or.cond4 = or i1 %77, %79
  br i1 %or.cond4, label %80, label %82

80:                                               ; preds = %73
  %81 = 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.6) #4
  br label %95

82:                                               ; preds = %73
  call void @png_crc_read(ptr noundef nonnull %0, ptr noundef nonnull %4, i32 noundef %2)
  %83 = trunc nuw nsw i32 %2 to i16
  %84 = getelementptr inbounds i8, ptr %0, i64 608
  store i16 %83, ptr %84, align 8, !tbaa !24
  br label %87

85:                                               ; preds = %23
  %86 = 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.25) #4
  br label %95

87:                                               ; preds = %.thread69, %.thread, %82
  %88 = call i32 @png_crc_finish(ptr noundef nonnull %0, i32 noundef 0)
  %.not68 = icmp eq i32 %88, 0
  %89 = getelementptr inbounds i8, ptr %0, i64 608
  br i1 %.not68, label %91, label %90

90:                                               ; preds = %87
  store i16 0, ptr %89, align 8, !tbaa !24
  br label %95

91:                                               ; preds = %87
  %92 = load i16, ptr %89, align 8, !tbaa !24
  %93 = zext i16 %92 to i32
  %94 = getelementptr inbounds i8, ptr %0, i64 752
  call void @png_set_tRNS(ptr noundef nonnull %0, ptr noundef %1, ptr noundef nonnull %4, i32 noundef %93, ptr noundef nonnull %94) #4
  br label %95

95:                                               ; preds = %66, %36, %91, %90, %85, %80, %71, %21, %14
  call void @llvm.lifetime.end.p0(i64 256, ptr nonnull %4) #4
  ret void
}

declare void @png_set_tRNS(ptr noundef, ptr noundef, ptr noundef, i32 noundef, ptr noundef) local_unnamed_addr #3

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 = { nounwind }
attributes #5 = { 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, !13, i64 608}
!25 = !{!7, !7, i64 0}
!26 = !{!6, !13, i64 760}
!27 = !{!6, !13, i64 754}
!28 = !{!6, !13, i64 756}
!29 = !{!6, !13, i64 758}
!30 = !{!6, !13, i64 600}


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