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

; Unoptimized IR (clang -disable-llvm-passes):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%struct.png_struct_def = type { [1 x %struct.__jmp_buf_tag], ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, i8, i8, i32, i32, i32, %struct.z_stream_s, ptr, i64, i32, i32, i32, i32, i32, i32, i32, i32, i32, i64, i64, i32, i32, ptr, ptr, ptr, ptr, ptr, ptr, %struct.png_row_info_struct, i32, i32, ptr, i16, i16, [5 x i8], i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i16, i8, float, %struct.png_color_16_struct, %struct.png_color_16_struct, ptr, i32, i32, i32, float, float, ptr, ptr, ptr, ptr, ptr, ptr, %struct.png_color_8_struct, %struct.png_color_8_struct, ptr, %struct.png_color_16_struct, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, i32, i32, i64, i64, i64, i64, i32, i32, i64, i64, ptr, ptr, ptr, ptr, ptr, i8, i8, ptr, ptr, ptr, ptr, ptr, ptr, i32, ptr, ptr, i32, ptr, i8, i16, i16, i16, i32, i32, i8, ptr, ptr, ptr, ptr, ptr, ptr, ptr, i8, i32, i32, i32, %struct.png_unknown_chunk_t, i32, i32, ptr, i32 }
%struct.__jmp_buf_tag = type { [8 x i64], i32, %struct.__sigset_t }
%struct.__sigset_t = type { [16 x i64] }
%struct.z_stream_s = type { ptr, i32, i64, ptr, i32, i64, ptr, ptr, ptr, ptr, ptr, i32, i64, i64 }
%struct.png_row_info_struct = type { i32, i64, i8, i8, i8, i8 }
%struct.png_color_8_struct = type { i8, i8, i8, i8, i8 }
%struct.png_color_16_struct = type { i8, i16, i16, i16, i16 }
%struct.png_unknown_chunk_t = type { [5 x i8], ptr, i64, i8 }
%struct.png_info_struct = type { i32, i32, i32, i64, ptr, i16, i16, i8, i8, i8, i8, i8, i8, i8, i8, [8 x i8], float, i8, i32, i32, ptr, %struct.png_time_struct, %struct.png_color_8_struct, ptr, %struct.png_color_16_struct, %struct.png_color_16_struct, i32, i32, i8, i32, i32, i8, ptr, float, float, float, float, float, float, float, float, ptr, i32, i32, ptr, ptr, i8, i8, i32, ptr, i64, ptr, ptr, i32, i8, ptr, i32, i8, double, double, ptr, ptr, ptr, i32, i32, i32, i32, i32, i32, i32, i32, i32 }
%struct.png_time_struct = type { i16, i8, i8, i8, i8, i8 }

@.str.63 = external hidden unnamed_addr constant [25 x i8], align 1
@.str.64 = external hidden unnamed_addr constant [24 x i8], align 1
@.str.65 = external hidden unnamed_addr constant [21 x i8], align 1
@.str.66 = external hidden unnamed_addr constant [28 x i8], align 1
@.str.67 = external hidden unnamed_addr constant [25 x i8], align 1
@.str.68 = external hidden unnamed_addr constant [23 x i8], align 1
@.str.69 = external hidden unnamed_addr constant [42 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

declare void @png_error(ptr noundef, ptr noundef) #1

; 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 noundef, ptr noundef, i64 noundef) #2

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

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

; Function Attrs: nounwind uwtable
define dso_local void @png_handle_tRNS(ptr noundef %0, ptr noundef %1, i32 noundef %2) #2 {
  %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) #3
  %11 = load ptr, ptr %4, align 8, !tbaa !5
  %12 = getelementptr inbounds %struct.png_struct_def, ptr %11, i32 0, i32 13
  %13 = load i32, ptr %12, align 4, !tbaa !11
  %14 = and i32 %13, 1
  %15 = icmp ne i32 %14, 0
  br i1 %15, label %18, label %16

16:                                               ; preds = %3
  %17 = load ptr, ptr %4, align 8, !tbaa !5
  call void @png_error(ptr noundef %17, ptr noundef @.str.63)
  br label %45

18:                                               ; preds = %3
  %19 = load ptr, ptr %4, align 8, !tbaa !5
  %20 = getelementptr inbounds %struct.png_struct_def, ptr %19, i32 0, i32 13
  %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
  call void @png_warning(ptr noundef %25, ptr noundef @.str.64)
  %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)
  store i32 1, ptr %8, align 4
  br label %217

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_struct, ptr %33, i32 0, i32 2
  %35 = load i32, ptr %34, align 8, !tbaa !21
  %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
  call void @png_warning(ptr noundef %39, ptr noundef @.str.65)
  %40 = load ptr, ptr %4, align 8, !tbaa !5
  %41 = load i32, ptr %6, align 4, !tbaa !9
  %42 = call i32 @png_crc_finish(ptr noundef %40, i32 noundef %41)
  store i32 1, ptr %8, align 4
  br label %217

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

44:                                               ; preds = %43
  br label %45

45:                                               ; preds = %44, %16
  %46 = load ptr, ptr %4, align 8, !tbaa !5
  %47 = getelementptr inbounds %struct.png_struct_def, ptr %46, i32 0, i32 50
  %48 = load i8, ptr %47, align 2, !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) #3
  %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
  call void @png_warning(ptr noundef %55, ptr noundef @.str.66)
  %56 = load ptr, ptr %4, align 8, !tbaa !5
  %57 = load i32, ptr %6, align 4, !tbaa !9
  %58 = call i32 @png_crc_finish(ptr noundef %56, i32 noundef %57)
  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, i64 noundef 2)
  %62 = load ptr, ptr %4, align 8, !tbaa !5
  %63 = getelementptr inbounds %struct.png_struct_def, ptr %62, i32 0, i32 43
  store i16 1, ptr %63, align 2, !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 77
  %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) #3
  %78 = load i32, ptr %8, align 4
  switch i32 %78, label %217 [
    i32 0, label %79
  ]

79:                                               ; preds = %77
  br label %200

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

86:                                               ; preds = %80
  call void @llvm.lifetime.start.p0(i64 6, ptr %10) #3
  %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
  call void @png_warning(ptr noundef %90, ptr noundef @.str.66)
  %91 = load ptr, ptr %4, align 8, !tbaa !5
  %92 = load i32, ptr %6, align 4, !tbaa !9
  %93 = call i32 @png_crc_finish(ptr noundef %91, i32 noundef %92)
  store i32 1, ptr %8, align 4
  br label %144

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

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

146:                                              ; preds = %144
  br label %199

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

153:                                              ; preds = %147
  %154 = load ptr, ptr %4, align 8, !tbaa !5
  %155 = getelementptr inbounds %struct.png_struct_def, ptr %154, i32 0, i32 13
  %156 = load i32, ptr %155, align 4, !tbaa !11
  %157 = and i32 %156, 2
  %158 = icmp ne i32 %157, 0
  br i1 %158, label %161, label %159

159:                                              ; preds = %153
  %160 = load ptr, ptr %4, align 8, !tbaa !5
  call void @png_warning(ptr noundef %160, ptr noundef @.str.67)
  br label %161

161:                                              ; preds = %159, %153
  %162 = load i32, ptr %6, align 4, !tbaa !9
  %163 = load ptr, ptr %4, align 8, !tbaa !5
  %164 = getelementptr inbounds %struct.png_struct_def, ptr %163, i32 0, i32 42
  %165 = load i16, ptr %164, align 8, !tbaa !32
  %166 = zext i16 %165 to i32
  %167 = icmp ugt i32 %162, %166
  br i1 %167, label %171, label %168

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

171:                                              ; preds = %168, %161
  %172 = load ptr, ptr %4, align 8, !tbaa !5
  call void @png_warning(ptr noundef %172, ptr noundef @.str.66)
  %173 = load ptr, ptr %4, align 8, !tbaa !5
  %174 = load i32, ptr %6, align 4, !tbaa !9
  %175 = call i32 @png_crc_finish(ptr noundef %173, i32 noundef %174)
  store i32 1, ptr %8, align 4
  br label %217

176:                                              ; preds = %168
  %177 = load i32, ptr %6, align 4, !tbaa !9
  %178 = icmp eq i32 %177, 0
  br i1 %178, label %179, label %184

179:                                              ; preds = %176
  %180 = load ptr, ptr %4, align 8, !tbaa !5
  call void @png_warning(ptr noundef %180, ptr noundef @.str.68)
  %181 = load ptr, ptr %4, align 8, !tbaa !5
  %182 = load i32, ptr %6, align 4, !tbaa !9
  %183 = call i32 @png_crc_finish(ptr noundef %181, i32 noundef %182)
  store i32 1, ptr %8, align 4
  br label %217

184:                                              ; preds = %176
  %185 = load ptr, ptr %4, align 8, !tbaa !5
  %186 = getelementptr inbounds [256 x i8], ptr %7, i64 0, i64 0
  %187 = load i32, ptr %6, align 4, !tbaa !9
  %188 = zext i32 %187 to i64
  call void @png_crc_read(ptr noundef %185, ptr noundef %186, i64 noundef %188)
  %189 = load i32, ptr %6, align 4, !tbaa !9
  %190 = trunc i32 %189 to i16
  %191 = load ptr, ptr %4, align 8, !tbaa !5
  %192 = getelementptr inbounds %struct.png_struct_def, ptr %191, i32 0, i32 43
  store i16 %190, ptr %192, align 2, !tbaa !26
  br label %198

193:                                              ; preds = %147
  %194 = load ptr, ptr %4, align 8, !tbaa !5
  call void @png_warning(ptr noundef %194, ptr noundef @.str.69)
  %195 = load ptr, ptr %4, align 8, !tbaa !5
  %196 = load i32, ptr %6, align 4, !tbaa !9
  %197 = call i32 @png_crc_finish(ptr noundef %195, i32 noundef %196)
  store i32 1, ptr %8, align 4
  br label %217

198:                                              ; preds = %184
  br label %199

199:                                              ; preds = %198, %146
  br label %200

200:                                              ; preds = %199, %79
  %201 = load ptr, ptr %4, align 8, !tbaa !5
  %202 = call i32 @png_crc_finish(ptr noundef %201, i32 noundef 0)
  %203 = icmp ne i32 %202, 0
  br i1 %203, label %204, label %207

204:                                              ; preds = %200
  %205 = load ptr, ptr %4, align 8, !tbaa !5
  %206 = getelementptr inbounds %struct.png_struct_def, ptr %205, i32 0, i32 43
  store i16 0, ptr %206, align 2, !tbaa !26
  store i32 1, ptr %8, align 4
  br label %217

207:                                              ; preds = %200
  %208 = load ptr, ptr %4, align 8, !tbaa !5
  %209 = load ptr, ptr %5, align 8, !tbaa !5
  %210 = getelementptr inbounds [256 x i8], ptr %7, i64 0, i64 0
  %211 = load ptr, ptr %4, align 8, !tbaa !5
  %212 = getelementptr inbounds %struct.png_struct_def, ptr %211, i32 0, i32 43
  %213 = load i16, ptr %212, align 2, !tbaa !26
  %214 = zext i16 %213 to i32
  %215 = load ptr, ptr %4, align 8, !tbaa !5
  %216 = getelementptr inbounds %struct.png_struct_def, ptr %215, i32 0, i32 77
  call void @png_set_tRNS(ptr noundef %208, ptr noundef %209, ptr noundef %210, i32 noundef %214, ptr noundef %216)
  store i32 0, ptr %8, align 4
  br label %217

217:                                              ; preds = %207, %204, %193, %179, %171, %144, %77, %38, %24
  call void @llvm.lifetime.end.p0(i64 256, ptr %7) #3
  %218 = load i32, ptr %8, align 4
  switch i32 %218, label %220 [
    i32 0, label %219
    i32 1, label %219
  ]

219:                                              ; preds = %217, %217
  ret void

220:                                              ; preds = %217
  unreachable
}

declare void @png_set_tRNS(ptr noundef, ptr noundef, ptr noundef, i32 noundef, ptr noundef) #1

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

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


; 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.63 = external hidden unnamed_addr constant [25 x i8], align 1
@.str.64 = external hidden unnamed_addr constant [24 x i8], align 1
@.str.65 = external hidden unnamed_addr constant [21 x i8], align 1
@.str.66 = external hidden unnamed_addr constant [28 x i8], align 1
@.str.67 = external hidden unnamed_addr constant [25 x i8], align 1
@.str.68 = external hidden unnamed_addr constant [23 x i8], align 1
@.str.69 = external hidden unnamed_addr constant [42 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

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

; 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 noundef, ptr noundef, i64 noundef) local_unnamed_addr #2

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

declare void @png_warning(ptr noundef, ptr noundef) local_unnamed_addr #1

; Function Attrs: nounwind uwtable
define dso_local void @png_handle_tRNS(ptr noundef %0, ptr noundef %1, i32 noundef %2) local_unnamed_addr #2 {
  %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) #3
  %7 = getelementptr inbounds i8, ptr %0, i64 284
  %8 = load i32, ptr %7, align 4, !tbaa !5
  %9 = and i32 %8, 1
  %.not = icmp eq i32 %9, 0
  br i1 %.not, label %10, label %11

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

11:                                               ; preds = %3
  %12 = and i32 %8, 4
  %.not63 = icmp eq i32 %12, 0
  br i1 %.not63, label %15, label %13

13:                                               ; preds = %11
  tail call void @png_warning(ptr noundef nonnull %0, ptr noundef nonnull @.str.64) #3
  %14 = tail call i32 @png_crc_finish(ptr noundef nonnull %0, i32 noundef %2)
  br label %97

15:                                               ; preds = %11
  %.not64 = icmp eq ptr %1, null
  br i1 %.not64, label %22, label %16

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

20:                                               ; preds = %16
  tail call void @png_warning(ptr noundef nonnull %0, ptr noundef nonnull @.str.65) #3
  %21 = tail call i32 @png_crc_finish(ptr noundef nonnull %0, i32 noundef %2)
  br label %97

22:                                               ; preds = %16, %15, %10
  %23 = getelementptr inbounds i8, ptr %0, i64 590
  %24 = load i8, ptr %23, align 2, !tbaa !23
  switch i8 %24, label %87 [
    i8 0, label %25
    i8 2, label %37
    i8 3, label %67
  ]

25:                                               ; preds = %22
  call void @llvm.lifetime.start.p0(i64 2, ptr nonnull %5) #3
  %.not68 = icmp eq i32 %2, 2
  br i1 %.not68, label %.thread, label %35

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

35:                                               ; preds = %25
  tail call void @png_warning(ptr noundef nonnull %0, ptr noundef nonnull @.str.66) #3
  %36 = tail call i32 @png_crc_finish(ptr noundef nonnull %0, i32 noundef %2)
  call void @llvm.lifetime.end.p0(i64 2, ptr nonnull %5) #3
  br label %97

37:                                               ; preds = %22
  call void @llvm.lifetime.start.p0(i64 6, ptr nonnull %6) #3
  %.not67 = icmp eq i32 %2, 6
  br i1 %.not67, label %.thread70, label %65

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

65:                                               ; preds = %37
  tail call void @png_warning(ptr noundef nonnull %0, ptr noundef nonnull @.str.66) #3
  %66 = tail call i32 @png_crc_finish(ptr noundef nonnull %0, i32 noundef %2)
  call void @llvm.lifetime.end.p0(i64 6, ptr nonnull %6) #3
  br label %97

67:                                               ; preds = %22
  %68 = load i32, ptr %7, align 4, !tbaa !5
  %69 = and i32 %68, 2
  %.not66 = icmp eq i32 %69, 0
  br i1 %.not66, label %70, label %71

70:                                               ; preds = %67
  tail call void @png_warning(ptr noundef nonnull %0, ptr noundef nonnull @.str.67) #3
  br label %71

71:                                               ; preds = %70, %67
  %72 = getelementptr inbounds i8, ptr %0, i64 576
  %73 = load i16, ptr %72, align 8, !tbaa !30
  %74 = zext i16 %73 to i32
  %75 = icmp ult i32 %74, %2
  %76 = icmp ugt i32 %2, 256
  %or.cond = or i1 %76, %75
  br i1 %or.cond, label %77, label %79

77:                                               ; preds = %71
  tail call void @png_warning(ptr noundef nonnull %0, ptr noundef nonnull @.str.66) #3
  %78 = tail call i32 @png_crc_finish(ptr noundef nonnull %0, i32 noundef %2)
  br label %97

79:                                               ; preds = %71
  %80 = icmp eq i32 %2, 0
  br i1 %80, label %81, label %83

81:                                               ; preds = %79
  tail call void @png_warning(ptr noundef nonnull %0, ptr noundef nonnull @.str.68) #3
  %82 = tail call i32 @png_crc_finish(ptr noundef nonnull %0, i32 noundef 0)
  br label %97

83:                                               ; preds = %79
  %84 = zext nneg i32 %2 to i64
  call void @png_crc_read(ptr noundef nonnull %0, ptr noundef nonnull %4, i64 noundef %84)
  %85 = trunc nuw nsw i32 %2 to i16
  %86 = getelementptr inbounds i8, ptr %0, i64 578
  store i16 %85, ptr %86, align 2, !tbaa !24
  br label %89

87:                                               ; preds = %22
  tail call void @png_warning(ptr noundef nonnull %0, ptr noundef nonnull @.str.69) #3
  %88 = tail call i32 @png_crc_finish(ptr noundef nonnull %0, i32 noundef %2)
  br label %97

89:                                               ; preds = %.thread70, %.thread, %83
  %90 = call i32 @png_crc_finish(ptr noundef nonnull %0, i32 noundef 0)
  %.not69 = icmp eq i32 %90, 0
  %91 = getelementptr inbounds i8, ptr %0, i64 578
  br i1 %.not69, label %93, label %92

92:                                               ; preds = %89
  store i16 0, ptr %91, align 2, !tbaa !24
  br label %97

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

97:                                               ; preds = %65, %35, %93, %92, %87, %81, %77, %20, %13
  call void @llvm.lifetime.end.p0(i64 256, ptr nonnull %4) #3
  ret void
}

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

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !10, i64 284}
!6 = !{!"png_struct_def", !7, i64 0, !9, i64 200, !9, i64 208, !9, i64 216, !9, i64 224, !9, i64 232, !9, i64 240, !9, i64 248, !9, i64 256, !9, i64 264, !9, i64 272, !7, i64 280, !7, i64 281, !10, i64 284, !10, i64 288, !10, i64 292, !11, i64 296, !9, i64 408, !12, i64 416, !10, i64 424, !10, i64 428, !10, i64 432, !10, i64 436, !10, i64 440, !10, i64 444, !10, i64 448, !10, i64 452, !10, i64 456, !12, i64 464, !12, i64 472, !10, i64 480, !10, i64 484, !9, i64 488, !9, i64 496, !9, i64 504, !9, i64 512, !9, i64 520, !9, i64 528, !13, i64 536, !10, i64 560, !10, i64 564, !9, i64 568, !14, i64 576, !14, i64 578, !7, i64 580, !7, i64 585, !7, i64 586, !7, i64 587, !7, i64 588, !7, i64 589, !7, i64 590, !7, i64 591, !7, i64 592, !7, i64 593, !7, i64 594, !7, i64 595, !7, i64 596, !14, i64 598, !7, i64 600, !15, i64 604, !16, i64 608, !16, i64 618, !9, i64 632, !10, i64 640, !10, i64 644, !10, i64 648, !15, i64 652, !15, i64 656, !9, i64 664, !9, i64 672, !9, i64 680, !9, i64 688, !9, i64 696, !9, i64 704, !17, i64 712, !17, i64 717, !9, i64 728, !16, i64 736, !9, i64 752, !9, i64 760, !9, i64 768, !9, i64 776, !9, i64 784, !9, i64 792, !9, i64 800, !9, i64 808, !9, i64 816, !10, i64 824, !10, i64 828, !12, i64 832, !12, i64 840, !12, i64 848, !12, i64 856, !10, i64 864, !10, i64 868, !12, i64 872, !12, i64 880, !9, i64 888, !9, i64 896, !9, i64 904, !9, i64 912, !9, i64 920, !7, i64 928, !7, i64 929, !9, i64 936, !9, i64 944, !9, i64 952, !9, i64 960, !9, i64 968, !9, i64 976, !10, i64 984, !9, i64 992, !9, i64 1000, !10, i64 1008, !9, i64 1016, !7, i64 1024, !14, i64 1026, !14, i64 1028, !14, i64 1030, !10, i64 1032, !10, i64 1036, !7, i64 1040, !9, i64 1048, !9, i64 1056, !9, i64 1064, !9, i64 1072, !9, i64 1080, !9, i64 1088, !9, i64 1096, !7, i64 1104, !10, i64 1108, !10, i64 1112, !10, i64 1116, !18, i64 1120, !10, i64 1152, !10, i64 1156, !9, i64 1160, !10, i64 1168}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!"any pointer", !7, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = !{!"z_stream_s", !9, i64 0, !10, i64 8, !12, i64 16, !9, i64 24, !10, i64 32, !12, i64 40, !9, i64 48, !9, i64 56, !9, i64 64, !9, i64 72, !9, i64 80, !10, i64 88, !12, i64 96, !12, i64 104}
!12 = !{!"long", !7, i64 0}
!13 = !{!"png_row_info_struct", !10, i64 0, !12, i64 8, !7, i64 16, !7, i64 17, !7, i64 18, !7, i64 19}
!14 = !{!"short", !7, i64 0}
!15 = !{!"float", !7, i64 0}
!16 = !{!"png_color_16_struct", !7, i64 0, !14, i64 2, !14, i64 4, !14, i64 6, !14, i64 8}
!17 = !{!"png_color_8_struct", !7, i64 0, !7, i64 1, !7, i64 2, !7, i64 3, !7, i64 4}
!18 = !{!"png_unknown_chunk_t", !7, i64 0, !9, i64 8, !12, i64 16, !7, i64 24}
!19 = !{!20, !10, i64 8}
!20 = !{!"png_info_struct", !10, i64 0, !10, i64 4, !10, i64 8, !12, i64 16, !9, i64 24, !14, i64 32, !14, i64 34, !7, i64 36, !7, i64 37, !7, i64 38, !7, i64 39, !7, i64 40, !7, i64 41, !7, i64 42, !7, i64 43, !7, i64 44, !15, i64 52, !7, i64 56, !10, i64 60, !10, i64 64, !9, i64 72, !21, i64 80, !17, i64 88, !9, i64 96, !16, i64 104, !16, i64 114, !10, i64 124, !10, i64 128, !7, i64 132, !10, i64 136, !10, i64 140, !7, i64 144, !9, i64 152, !15, i64 160, !15, i64 164, !15, i64 168, !15, i64 172, !15, i64 176, !15, i64 180, !15, i64 184, !15, i64 188, !9, i64 192, !10, i64 200, !10, i64 204, !9, i64 208, !9, i64 216, !7, i64 224, !7, i64 225, !10, i64 228, !9, i64 232, !12, i64 240, !9, i64 248, !9, i64 256, !10, i64 264, !7, i64 268, !9, i64 272, !10, i64 280, !7, i64 284, !22, i64 288, !22, i64 296, !9, i64 304, !9, i64 312, !9, i64 320, !10, i64 328, !10, i64 332, !10, i64 336, !10, i64 340, !10, i64 344, !10, i64 348, !10, i64 352, !10, i64 356, !10, i64 360}
!21 = !{!"png_time_struct", !14, i64 0, !7, i64 2, !7, i64 3, !7, i64 4, !7, i64 5, !7, i64 6}
!22 = !{!"double", !7, i64 0}
!23 = !{!6, !7, i64 590}
!24 = !{!6, !14, i64 578}
!25 = !{!7, !7, i64 0}
!26 = !{!6, !14, i64 744}
!27 = !{!6, !14, i64 738}
!28 = !{!6, !14, i64 740}
!29 = !{!6, !14, i64 742}
!30 = !{!6, !14, i64 576}


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