; LLVM IR from rdguez-mariano/fast_imas_IPOL :: io_png/libs/png (pngrutil)

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

%struct.png_struct_def = type { [1 x %struct.__jmp_buf_tag], ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, i8, i8, i64, i64, i64, %struct.z_stream_s, ptr, i64, i32, i32, i32, i32, i32, i64, i64, i64, i64, i64, i64, i64, i64, ptr, ptr, ptr, ptr, ptr, ptr, %struct.png_row_info_struct, i64, i64, ptr, i16, i16, [5 x i8], i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i16, i8, float, %struct.png_color_16_struct, %struct.png_color_16_struct, ptr, i64, i64, i32, float, float, ptr, ptr, ptr, ptr, ptr, ptr, %struct.png_color_8_struct, %struct.png_color_8_struct, ptr, %struct.png_color_16_struct, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, i64, i64, i64, i64, i64, i64, i32, i32, i64, i64, ptr, ptr, ptr, ptr, ptr, i8, i8, ptr, ptr, ptr, ptr, ptr, ptr, i64, ptr, ptr, i32, ptr, i8, i16, i16, i16, i64, i64, i8, i8, i64, i64, ptr, ptr, ptr, ptr, ptr, ptr, ptr, i8, i64, i64, %struct.png_unknown_chunk_t, i64, i64, ptr }
%struct.__jmp_buf_tag = type { [8 x i64], i32, %struct.__sigset_t }
%struct.__sigset_t = type { [16 x i64] }
%struct.z_stream_s = type { ptr, i32, i64, ptr, i32, i64, ptr, ptr, ptr, ptr, ptr, i32, i64, i64 }
%struct.png_row_info_struct = type { i64, i64, i8, i8, i8, i8 }
%struct.png_color_8_struct = type { i8, i8, i8, i8, i8 }
%struct.png_color_16_struct = type { i8, i16, i16, i16, i16 }
%struct.png_unknown_chunk_t = type { [5 x i8], ptr, i64, i8 }
%struct.png_info_struct = type { i64, i64, i64, 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, i64, i64, i8, i64, i64, i8, ptr, float, float, float, float, float, float, float, float, ptr, i64, i64, ptr, ptr, i8, i8, i64, ptr, i64, ptr, ptr, i64, i8, ptr, i64, i8, double, double, ptr, ptr, ptr, i64, i64, i64, i64, i64, i64, i64, i64, i64 }
%struct.png_time_struct = type { i16, i8, i8, i8, i8, i8 }
%struct.png_color_struct = type { i8, i8, i8 }

@.str.70 = external hidden unnamed_addr constant [25 x i8], align 1
@.str.71 = external hidden unnamed_addr constant [24 x i8], align 1
@.str.72 = external hidden unnamed_addr constant [25 x i8], align 1
@.str.73 = external hidden unnamed_addr constant [21 x i8], align 1
@.str.74 = external hidden unnamed_addr constant [28 x i8], align 1
@.str.75 = external hidden unnamed_addr constant [33 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 zeroext i16 @png_get_uint_16(ptr noundef) #2

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

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

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

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

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

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

23:                                               ; preds = %17
  %24 = load ptr, ptr %4, align 8, !tbaa !5
  call void @png_warning(ptr noundef %24, ptr noundef @.str.71)
  %25 = load ptr, ptr %4, align 8, !tbaa !5
  %26 = load i64, ptr %6, align 8, !tbaa !9
  %27 = call i32 @png_crc_finish(ptr noundef %25, i64 noundef %26)
  store i32 1, ptr %9, align 4
  br label %214

28:                                               ; preds = %17
  %29 = load ptr, ptr %4, align 8, !tbaa !5
  %30 = getelementptr inbounds %struct.png_struct_def, ptr %29, i32 0, i32 49
  %31 = load i8, ptr %30, align 2, !tbaa !21
  %32 = zext i8 %31 to i32
  %33 = icmp eq i32 %32, 3
  br i1 %33, label %34, label %45

34:                                               ; preds = %28
  %35 = load ptr, ptr %4, align 8, !tbaa !5
  %36 = getelementptr inbounds %struct.png_struct_def, ptr %35, i32 0, i32 12
  %37 = load i64, ptr %36, align 8, !tbaa !11
  %38 = and i64 %37, 2
  %39 = icmp ne i64 %38, 0
  br i1 %39, label %45, label %40

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

45:                                               ; preds = %34, %28
  %46 = load ptr, ptr %5, align 8, !tbaa !5
  %47 = icmp ne ptr %46, null
  br i1 %47, label %48, label %59

48:                                               ; preds = %45
  %49 = load ptr, ptr %5, align 8, !tbaa !5
  %50 = getelementptr inbounds %struct.png_info_struct, ptr %49, i32 0, i32 2
  %51 = load i64, ptr %50, align 8, !tbaa !22
  %52 = and i64 %51, 32
  %53 = icmp ne i64 %52, 0
  br i1 %53, label %54, label %59

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

59:                                               ; preds = %48, %45
  br label %60

60:                                               ; preds = %59
  br label %61

61:                                               ; preds = %60
  br label %62

62:                                               ; preds = %61, %15
  %63 = load ptr, ptr %4, align 8, !tbaa !5
  %64 = getelementptr inbounds %struct.png_struct_def, ptr %63, i32 0, i32 49
  %65 = load i8, ptr %64, align 2, !tbaa !21
  %66 = zext i8 %65 to i32
  %67 = icmp eq i32 %66, 3
  br i1 %67, label %68, label %69

68:                                               ; preds = %62
  store i64 1, ptr %7, align 8, !tbaa !9
  br label %79

69:                                               ; preds = %62
  %70 = load ptr, ptr %4, align 8, !tbaa !5
  %71 = getelementptr inbounds %struct.png_struct_def, ptr %70, i32 0, i32 49
  %72 = load i8, ptr %71, align 2, !tbaa !21
  %73 = zext i8 %72 to i32
  %74 = and i32 %73, 2
  %75 = icmp ne i32 %74, 0
  br i1 %75, label %76, label %77

76:                                               ; preds = %69
  store i64 6, ptr %7, align 8, !tbaa !9
  br label %78

77:                                               ; preds = %69
  store i64 2, ptr %7, align 8, !tbaa !9
  br label %78

78:                                               ; preds = %77, %76
  br label %79

79:                                               ; preds = %78, %68
  %80 = load i64, ptr %6, align 8, !tbaa !9
  %81 = load i64, ptr %7, align 8, !tbaa !9
  %82 = icmp ne i64 %80, %81
  br i1 %82, label %83, label %88

83:                                               ; preds = %79
  %84 = load ptr, ptr %4, align 8, !tbaa !5
  call void @png_warning(ptr noundef %84, ptr noundef @.str.74)
  %85 = load ptr, ptr %4, align 8, !tbaa !5
  %86 = load i64, ptr %6, align 8, !tbaa !9
  %87 = call i32 @png_crc_finish(ptr noundef %85, i64 noundef %86)
  store i32 1, ptr %9, align 4
  br label %214

88:                                               ; preds = %79
  %89 = load ptr, ptr %4, align 8, !tbaa !5
  %90 = getelementptr inbounds [6 x i8], ptr %8, i64 0, i64 0
  %91 = load i64, ptr %7, align 8, !tbaa !9
  call void @png_crc_read(ptr noundef %89, ptr noundef %90, i64 noundef %91)
  %92 = load ptr, ptr %4, align 8, !tbaa !5
  %93 = call i32 @png_crc_finish(ptr noundef %92, i64 noundef 0)
  %94 = icmp ne i32 %93, 0
  br i1 %94, label %95, label %96

95:                                               ; preds = %88
  store i32 1, ptr %9, align 4
  br label %214

96:                                               ; preds = %88
  %97 = load ptr, ptr %4, align 8, !tbaa !5
  %98 = getelementptr inbounds %struct.png_struct_def, ptr %97, i32 0, i32 49
  %99 = load i8, ptr %98, align 2, !tbaa !21
  %100 = zext i8 %99 to i32
  %101 = icmp eq i32 %100, 3
  br i1 %101, label %102, label %168

102:                                              ; preds = %96
  %103 = getelementptr inbounds [6 x i8], ptr %8, i64 0, i64 0
  %104 = load i8, ptr %103, align 1, !tbaa !26
  %105 = load ptr, ptr %4, align 8, !tbaa !5
  %106 = getelementptr inbounds %struct.png_struct_def, ptr %105, i32 0, i32 59
  %107 = getelementptr inbounds %struct.png_color_16_struct, ptr %106, i32 0, i32 0
  store i8 %104, ptr %107, align 8, !tbaa !27
  %108 = load ptr, ptr %5, align 8, !tbaa !5
  %109 = icmp ne ptr %108, null
  br i1 %109, label %110, label %167

110:                                              ; preds = %102
  %111 = load ptr, ptr %5, align 8, !tbaa !5
  %112 = getelementptr inbounds %struct.png_info_struct, ptr %111, i32 0, i32 5
  %113 = load i16, ptr %112, align 8, !tbaa !28
  %114 = zext i16 %113 to i32
  %115 = icmp ne i32 %114, 0
  br i1 %115, label %116, label %167

116:                                              ; preds = %110
  %117 = getelementptr inbounds [6 x i8], ptr %8, i64 0, i64 0
  %118 = load i8, ptr %117, align 1, !tbaa !26
  %119 = zext i8 %118 to i32
  %120 = load ptr, ptr %5, align 8, !tbaa !5
  %121 = getelementptr inbounds %struct.png_info_struct, ptr %120, i32 0, i32 5
  %122 = load i16, ptr %121, align 8, !tbaa !28
  %123 = zext i16 %122 to i32
  %124 = icmp sge i32 %119, %123
  br i1 %124, label %125, label %127

125:                                              ; preds = %116
  %126 = load ptr, ptr %4, align 8, !tbaa !5
  call void @png_warning(ptr noundef %126, ptr noundef @.str.75)
  store i32 1, ptr %9, align 4
  br label %214

127:                                              ; preds = %116
  %128 = load ptr, ptr %4, align 8, !tbaa !5
  %129 = getelementptr inbounds %struct.png_struct_def, ptr %128, i32 0, i32 40
  %130 = load ptr, ptr %129, align 8, !tbaa !29
  %131 = getelementptr inbounds [6 x i8], ptr %8, i64 0, i64 0
  %132 = load i8, ptr %131, align 1, !tbaa !26
  %133 = zext i8 %132 to i64
  %134 = getelementptr inbounds %struct.png_color_struct, ptr %130, i64 %133
  %135 = getelementptr inbounds %struct.png_color_struct, ptr %134, i32 0, i32 0
  %136 = load i8, ptr %135, align 1, !tbaa !30
  %137 = zext i8 %136 to i16
  %138 = load ptr, ptr %4, align 8, !tbaa !5
  %139 = getelementptr inbounds %struct.png_struct_def, ptr %138, i32 0, i32 59
  %140 = getelementptr inbounds %struct.png_color_16_struct, ptr %139, i32 0, i32 1
  store i16 %137, ptr %140, align 2, !tbaa !32
  %141 = load ptr, ptr %4, align 8, !tbaa !5
  %142 = getelementptr inbounds %struct.png_struct_def, ptr %141, i32 0, i32 40
  %143 = load ptr, ptr %142, align 8, !tbaa !29
  %144 = getelementptr inbounds [6 x i8], ptr %8, i64 0, i64 0
  %145 = load i8, ptr %144, align 1, !tbaa !26
  %146 = zext i8 %145 to i64
  %147 = getelementptr inbounds %struct.png_color_struct, ptr %143, i64 %146
  %148 = getelementptr inbounds %struct.png_color_struct, ptr %147, i32 0, i32 1
  %149 = load i8, ptr %148, align 1, !tbaa !33
  %150 = zext i8 %149 to i16
  %151 = load ptr, ptr %4, align 8, !tbaa !5
  %152 = getelementptr inbounds %struct.png_struct_def, ptr %151, i32 0, i32 59
  %153 = getelementptr inbounds %struct.png_color_16_struct, ptr %152, i32 0, i32 2
  store i16 %150, ptr %153, align 4, !tbaa !34
  %154 = load ptr, ptr %4, align 8, !tbaa !5
  %155 = getelementptr inbounds %struct.png_struct_def, ptr %154, i32 0, i32 40
  %156 = load ptr, ptr %155, align 8, !tbaa !29
  %157 = getelementptr inbounds [6 x i8], ptr %8, i64 0, i64 0
  %158 = load i8, ptr %157, align 1, !tbaa !26
  %159 = zext i8 %158 to i64
  %160 = getelementptr inbounds %struct.png_color_struct, ptr %156, i64 %159
  %161 = getelementptr inbounds %struct.png_color_struct, ptr %160, i32 0, i32 2
  %162 = load i8, ptr %161, align 1, !tbaa !35
  %163 = zext i8 %162 to i16
  %164 = load ptr, ptr %4, align 8, !tbaa !5
  %165 = getelementptr inbounds %struct.png_struct_def, ptr %164, i32 0, i32 59
  %166 = getelementptr inbounds %struct.png_color_16_struct, ptr %165, i32 0, i32 3
  store i16 %163, ptr %166, align 2, !tbaa !36
  br label %167

167:                                              ; preds = %127, %110, %102
  br label %209

168:                                              ; preds = %96
  %169 = load ptr, ptr %4, align 8, !tbaa !5
  %170 = getelementptr inbounds %struct.png_struct_def, ptr %169, i32 0, i32 49
  %171 = load i8, ptr %170, align 2, !tbaa !21
  %172 = zext i8 %171 to i32
  %173 = and i32 %172, 2
  %174 = icmp ne i32 %173, 0
  br i1 %174, label %190, label %175

175:                                              ; preds = %168
  %176 = getelementptr inbounds [6 x i8], ptr %8, i64 0, i64 0
  %177 = call zeroext i16 @png_get_uint_16(ptr noundef %176)
  %178 = load ptr, ptr %4, align 8, !tbaa !5
  %179 = getelementptr inbounds %struct.png_struct_def, ptr %178, i32 0, i32 59
  %180 = getelementptr inbounds %struct.png_color_16_struct, ptr %179, i32 0, i32 4
  store i16 %177, ptr %180, align 8, !tbaa !37
  %181 = load ptr, ptr %4, align 8, !tbaa !5
  %182 = getelementptr inbounds %struct.png_struct_def, ptr %181, i32 0, i32 59
  %183 = getelementptr inbounds %struct.png_color_16_struct, ptr %182, i32 0, i32 3
  store i16 %177, ptr %183, align 2, !tbaa !36
  %184 = load ptr, ptr %4, align 8, !tbaa !5
  %185 = getelementptr inbounds %struct.png_struct_def, ptr %184, i32 0, i32 59
  %186 = getelementptr inbounds %struct.png_color_16_struct, ptr %185, i32 0, i32 2
  store i16 %177, ptr %186, align 4, !tbaa !34
  %187 = load ptr, ptr %4, align 8, !tbaa !5
  %188 = getelementptr inbounds %struct.png_struct_def, ptr %187, i32 0, i32 59
  %189 = getelementptr inbounds %struct.png_color_16_struct, ptr %188, i32 0, i32 1
  store i16 %177, ptr %189, align 2, !tbaa !32
  br label %208

190:                                              ; preds = %168
  %191 = getelementptr inbounds [6 x i8], ptr %8, i64 0, i64 0
  %192 = call zeroext i16 @png_get_uint_16(ptr noundef %191)
  %193 = load ptr, ptr %4, align 8, !tbaa !5
  %194 = getelementptr inbounds %struct.png_struct_def, ptr %193, i32 0, i32 59
  %195 = getelementptr inbounds %struct.png_color_16_struct, ptr %194, i32 0, i32 1
  store i16 %192, ptr %195, align 2, !tbaa !32
  %196 = getelementptr inbounds [6 x i8], ptr %8, i64 0, i64 0
  %197 = getelementptr inbounds i8, ptr %196, i64 2
  %198 = call zeroext i16 @png_get_uint_16(ptr noundef %197)
  %199 = load ptr, ptr %4, align 8, !tbaa !5
  %200 = getelementptr inbounds %struct.png_struct_def, ptr %199, i32 0, i32 59
  %201 = getelementptr inbounds %struct.png_color_16_struct, ptr %200, i32 0, i32 2
  store i16 %198, ptr %201, align 4, !tbaa !34
  %202 = getelementptr inbounds [6 x i8], ptr %8, i64 0, i64 0
  %203 = getelementptr inbounds i8, ptr %202, i64 4
  %204 = call zeroext i16 @png_get_uint_16(ptr noundef %203)
  %205 = load ptr, ptr %4, align 8, !tbaa !5
  %206 = getelementptr inbounds %struct.png_struct_def, ptr %205, i32 0, i32 59
  %207 = getelementptr inbounds %struct.png_color_16_struct, ptr %206, i32 0, i32 3
  store i16 %204, ptr %207, align 2, !tbaa !36
  br label %208

208:                                              ; preds = %190, %175
  br label %209

209:                                              ; preds = %208, %167
  %210 = load ptr, ptr %4, align 8, !tbaa !5
  %211 = load ptr, ptr %5, align 8, !tbaa !5
  %212 = load ptr, ptr %4, align 8, !tbaa !5
  %213 = getelementptr inbounds %struct.png_struct_def, ptr %212, i32 0, i32 59
  call void @png_set_bKGD(ptr noundef %210, ptr noundef %211, ptr noundef %213)
  store i32 0, ptr %9, align 4
  br label %214

214:                                              ; preds = %209, %125, %95, %83, %54, %40, %23
  call void @llvm.lifetime.end.p0(i64 6, ptr %8) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #3
  %215 = load i32, ptr %9, align 4
  switch i32 %215, label %217 [
    i32 0, label %216
    i32 1, label %216
  ]

216:                                              ; preds = %214, %214
  ret void

217:                                              ; preds = %214
  unreachable
}

declare void @png_set_bKGD(ptr noundef, ptr 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 = !{!"long", !7, i64 0}
!11 = !{!12, !10, i64 280}
!12 = !{!"png_struct_def", !7, i64 0, !6, i64 200, !6, i64 208, !6, i64 216, !6, i64 224, !6, i64 232, !6, i64 240, !6, i64 248, !6, i64 256, !6, i64 264, !7, i64 272, !7, i64 273, !10, i64 280, !10, i64 288, !10, i64 296, !13, i64 304, !6, i64 416, !10, i64 424, !14, i64 432, !14, i64 436, !14, i64 440, !14, i64 444, !14, i64 448, !10, i64 456, !10, i64 464, !10, i64 472, !10, i64 480, !10, i64 488, !10, i64 496, !10, i64 504, !10, i64 512, !6, i64 520, !6, i64 528, !6, i64 536, !6, i64 544, !6, i64 552, !6, i64 560, !15, i64 568, !10, i64 592, !10, i64 600, !6, i64 608, !16, i64 616, !16, i64 618, !7, i64 620, !7, i64 625, !7, i64 626, !7, i64 627, !7, i64 628, !7, i64 629, !7, i64 630, !7, i64 631, !7, i64 632, !7, i64 633, !7, i64 634, !7, i64 635, !7, i64 636, !16, i64 638, !7, i64 640, !17, i64 644, !18, i64 648, !18, i64 658, !6, i64 672, !10, i64 680, !10, i64 688, !14, i64 696, !17, i64 700, !17, i64 704, !6, i64 712, !6, i64 720, !6, i64 728, !6, i64 736, !6, i64 744, !6, i64 752, !19, i64 760, !19, i64 765, !6, i64 776, !18, i64 784, !6, i64 800, !6, i64 808, !6, i64 816, !6, i64 824, !6, i64 832, !6, i64 840, !6, i64 848, !6, i64 856, !6, i64 864, !10, i64 872, !10, i64 880, !10, i64 888, !10, i64 896, !10, i64 904, !10, i64 912, !14, i64 920, !14, i64 924, !10, i64 928, !10, i64 936, !6, i64 944, !6, i64 952, !6, i64 960, !6, i64 968, !6, i64 976, !7, i64 984, !7, i64 985, !6, i64 992, !6, i64 1000, !6, i64 1008, !6, i64 1016, !6, i64 1024, !6, i64 1032, !10, i64 1040, !6, i64 1048, !6, i64 1056, !14, i64 1064, !6, i64 1072, !7, i64 1080, !16, i64 1082, !16, i64 1084, !16, i64 1086, !10, i64 1088, !10, i64 1096, !7, i64 1104, !7, i64 1105, !10, i64 1112, !10, i64 1120, !6, i64 1128, !6, i64 1136, !6, i64 1144, !6, i64 1152, !6, i64 1160, !6, i64 1168, !6, i64 1176, !7, i64 1184, !10, i64 1192, !10, i64 1200, !20, i64 1208, !10, i64 1240, !10, i64 1248, !6, i64 1256}
!13 = !{!"z_stream_s", !6, i64 0, !14, i64 8, !10, i64 16, !6, i64 24, !14, i64 32, !10, i64 40, !6, i64 48, !6, i64 56, !6, i64 64, !6, i64 72, !6, i64 80, !14, i64 88, !10, i64 96, !10, i64 104}
!14 = !{!"int", !7, i64 0}
!15 = !{!"png_row_info_struct", !10, i64 0, !10, i64 8, !7, i64 16, !7, i64 17, !7, i64 18, !7, i64 19}
!16 = !{!"short", !7, i64 0}
!17 = !{!"float", !7, i64 0}
!18 = !{!"png_color_16_struct", !7, i64 0, !16, i64 2, !16, i64 4, !16, i64 6, !16, i64 8}
!19 = !{!"png_color_8_struct", !7, i64 0, !7, i64 1, !7, i64 2, !7, i64 3, !7, i64 4}
!20 = !{!"png_unknown_chunk_t", !7, i64 0, !6, i64 8, !10, i64 16, !7, i64 24}
!21 = !{!12, !7, i64 630}
!22 = !{!23, !10, i64 16}
!23 = !{!"png_info_struct", !10, i64 0, !10, i64 8, !10, i64 16, !10, i64 24, !6, i64 32, !16, i64 40, !16, i64 42, !7, i64 44, !7, i64 45, !7, i64 46, !7, i64 47, !7, i64 48, !7, i64 49, !7, i64 50, !7, i64 51, !7, i64 52, !17, i64 60, !7, i64 64, !14, i64 68, !14, i64 72, !6, i64 80, !24, i64 88, !19, i64 96, !6, i64 104, !18, i64 112, !18, i64 122, !10, i64 136, !10, i64 144, !7, i64 152, !10, i64 160, !10, i64 168, !7, i64 176, !6, i64 184, !17, i64 192, !17, i64 196, !17, i64 200, !17, i64 204, !17, i64 208, !17, i64 212, !17, i64 216, !17, i64 220, !6, i64 224, !10, i64 232, !10, i64 240, !6, i64 248, !6, i64 256, !7, i64 264, !7, i64 265, !10, i64 272, !6, i64 280, !10, i64 288, !6, i64 296, !6, i64 304, !10, i64 312, !7, i64 320, !6, i64 328, !10, i64 336, !7, i64 344, !25, i64 352, !25, i64 360, !6, i64 368, !6, i64 376, !6, i64 384, !10, i64 392, !10, i64 400, !10, i64 408, !10, i64 416, !10, i64 424, !10, i64 432, !10, i64 440, !10, i64 448, !10, i64 456}
!24 = !{!"png_time_struct", !16, i64 0, !7, i64 2, !7, i64 3, !7, i64 4, !7, i64 5, !7, i64 6}
!25 = !{!"double", !7, i64 0}
!26 = !{!7, !7, i64 0}
!27 = !{!12, !7, i64 648}
!28 = !{!23, !16, i64 40}
!29 = !{!12, !6, i64 608}
!30 = !{!31, !7, i64 0}
!31 = !{!"png_color_struct", !7, i64 0, !7, i64 1, !7, i64 2}
!32 = !{!12, !16, i64 650}
!33 = !{!31, !7, i64 1}
!34 = !{!12, !16, i64 652}
!35 = !{!31, !7, i64 2}
!36 = !{!12, !16, i64 654}
!37 = !{!12, !16, i64 656}


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

%struct.png_color_struct = type { i8, i8, i8 }

@.str.70 = external hidden unnamed_addr constant [25 x i8], align 1
@.str.71 = external hidden unnamed_addr constant [24 x i8], align 1
@.str.72 = external hidden unnamed_addr constant [25 x i8], align 1
@.str.73 = external hidden unnamed_addr constant [21 x i8], align 1
@.str.74 = external hidden unnamed_addr constant [28 x i8], align 1
@.str.75 = external hidden unnamed_addr constant [33 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 zeroext i16 @png_get_uint_16(ptr noundef) local_unnamed_addr #2

; 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, i64 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_bKGD(ptr noundef %0, ptr noundef %1, i64 noundef %2) local_unnamed_addr #2 {
  %4 = alloca [6 x i8], align 1
  call void @llvm.lifetime.start.p0(i64 6, ptr nonnull %4) #3
  %5 = getelementptr inbounds i8, ptr %0, i64 280
  %6 = load i64, ptr %5, align 8, !tbaa !5
  %7 = and i64 %6, 1
  %.not = icmp eq i64 %7, 0
  br i1 %.not, label %8, label %9

8:                                                ; preds = %3
  tail call void @png_error(ptr noundef nonnull %0, ptr noundef nonnull @.str.70) #3
  %.phi.trans.insert = getelementptr inbounds i8, ptr %0, i64 630
  %.pre = load i8, ptr %.phi.trans.insert, align 2, !tbaa !19
  br label %27

9:                                                ; preds = %3
  %10 = and i64 %6, 4
  %.not53 = icmp eq i64 %10, 0
  br i1 %.not53, label %13, label %11

11:                                               ; preds = %9
  tail call void @png_warning(ptr noundef nonnull %0, ptr noundef nonnull @.str.71) #3
  %12 = tail call i32 @png_crc_finish(ptr noundef nonnull %0, i64 noundef %2)
  br label %79

13:                                               ; preds = %9
  %14 = getelementptr inbounds i8, ptr %0, i64 630
  %15 = load i8, ptr %14, align 2, !tbaa !19
  %16 = icmp eq i8 %15, 3
  %17 = and i64 %6, 2
  %.not54 = icmp eq i64 %17, 0
  %or.cond = and i1 %.not54, %16
  br i1 %or.cond, label %18, label %20

18:                                               ; preds = %13
  tail call void @png_warning(ptr noundef nonnull %0, ptr noundef nonnull @.str.72) #3
  %19 = tail call i32 @png_crc_finish(ptr noundef nonnull %0, i64 noundef %2)
  br label %79

20:                                               ; preds = %13
  %.not55 = icmp eq ptr %1, null
  br i1 %.not55, label %27, label %21

21:                                               ; preds = %20
  %22 = getelementptr inbounds i8, ptr %1, i64 16
  %23 = load i64, ptr %22, align 8, !tbaa !20
  %24 = and i64 %23, 32
  %.not56 = icmp eq i64 %24, 0
  br i1 %.not56, label %27, label %25

25:                                               ; preds = %21
  tail call void @png_warning(ptr noundef nonnull %0, ptr noundef nonnull @.str.73) #3
  %26 = tail call i32 @png_crc_finish(ptr noundef nonnull %0, i64 noundef %2)
  br label %79

27:                                               ; preds = %20, %21, %8
  %28 = phi i8 [ %15, %20 ], [ %15, %21 ], [ %.pre, %8 ]
  %29 = getelementptr inbounds i8, ptr %0, i64 630
  %30 = icmp eq i8 %28, 3
  %31 = and i8 %28, 2
  %.not57 = icmp eq i8 %31, 0
  %. = select i1 %.not57, i64 2, i64 6
  %.0 = select i1 %30, i64 1, i64 %.
  %.not58 = icmp eq i64 %.0, %2
  br i1 %.not58, label %34, label %32

32:                                               ; preds = %27
  tail call void @png_warning(ptr noundef nonnull %0, ptr noundef nonnull @.str.74) #3
  %33 = tail call i32 @png_crc_finish(ptr noundef nonnull %0, i64 noundef %2)
  br label %79

34:                                               ; preds = %27
  call void @png_crc_read(ptr noundef nonnull %0, ptr noundef nonnull %4, i64 noundef %2)
  %35 = call i32 @png_crc_finish(ptr noundef nonnull %0, i64 noundef 0)
  %.not59 = icmp eq i32 %35, 0
  br i1 %.not59, label %36, label %79

36:                                               ; preds = %34
  %37 = load i8, ptr %29, align 2, !tbaa !19
  %38 = icmp eq i8 %37, 3
  br i1 %38, label %39, label %63

39:                                               ; preds = %36
  %40 = load i8, ptr %4, align 1, !tbaa !24
  %41 = getelementptr inbounds i8, ptr %0, i64 648
  store i8 %40, ptr %41, align 8, !tbaa !25
  %.not61 = icmp eq ptr %1, null
  br i1 %.not61, label %77, label %42

42:                                               ; preds = %39
  %43 = getelementptr inbounds i8, ptr %1, i64 40
  %44 = load i16, ptr %43, align 8, !tbaa !26
  %.not62 = icmp eq i16 %44, 0
  br i1 %.not62, label %77, label %45

45:                                               ; preds = %42
  %46 = zext i8 %40 to i16
  %.not63 = icmp ugt i16 %44, %46
  br i1 %.not63, label %48, label %47

47:                                               ; preds = %45
  call void @png_warning(ptr noundef nonnull %0, ptr noundef nonnull @.str.75) #3
  br label %79

48:                                               ; preds = %45
  %49 = getelementptr inbounds i8, ptr %0, i64 608
  %50 = load ptr, ptr %49, align 8, !tbaa !27
  %51 = zext i8 %40 to i64
  %52 = getelementptr inbounds %struct.png_color_struct, ptr %50, i64 %51
  %53 = load i8, ptr %52, align 1, !tbaa !28
  %54 = zext i8 %53 to i16
  %55 = getelementptr inbounds i8, ptr %0, i64 650
  store i16 %54, ptr %55, align 2, !tbaa !30
  %56 = getelementptr inbounds %struct.png_color_struct, ptr %50, i64 %51, i32 1
  %57 = load i8, ptr %56, align 1, !tbaa !31
  %58 = zext i8 %57 to i16
  %59 = getelementptr inbounds i8, ptr %0, i64 652
  store i16 %58, ptr %59, align 4, !tbaa !32
  %60 = getelementptr inbounds %struct.png_color_struct, ptr %50, i64 %51, i32 2
  %61 = load i8, ptr %60, align 1, !tbaa !33
  %62 = zext i8 %61 to i16
  br label %.sink.split

63:                                               ; preds = %36
  %64 = and i8 %37, 2
  %.not60 = icmp eq i8 %64, 0
  %65 = call zeroext i16 @png_get_uint_16(ptr noundef nonnull %4)
  %66 = getelementptr inbounds i8, ptr %0, i64 652
  br i1 %.not60, label %67, label %70

67:                                               ; preds = %63
  %68 = getelementptr inbounds i8, ptr %0, i64 656
  store i16 %65, ptr %68, align 8, !tbaa !34
  %69 = getelementptr inbounds i8, ptr %0, i64 654
  store i16 %65, ptr %69, align 2, !tbaa !35
  store i16 %65, ptr %66, align 4, !tbaa !32
  br label %.sink.split

70:                                               ; preds = %63
  %71 = getelementptr inbounds i8, ptr %0, i64 650
  store i16 %65, ptr %71, align 2, !tbaa !30
  %72 = getelementptr inbounds i8, ptr %4, i64 2
  %73 = call zeroext i16 @png_get_uint_16(ptr noundef nonnull %72)
  store i16 %73, ptr %66, align 4, !tbaa !32
  %74 = getelementptr inbounds i8, ptr %4, i64 4
  %75 = call zeroext i16 @png_get_uint_16(ptr noundef nonnull %74)
  br label %.sink.split

.sink.split:                                      ; preds = %48, %70, %67
  %.sink65 = phi i64 [ 650, %67 ], [ 654, %70 ], [ 654, %48 ]
  %.sink = phi i16 [ %65, %67 ], [ %75, %70 ], [ %62, %48 ]
  %76 = getelementptr inbounds i8, ptr %0, i64 %.sink65
  store i16 %.sink, ptr %76, align 2, !tbaa !36
  br label %77

77:                                               ; preds = %.sink.split, %39, %42
  %78 = getelementptr inbounds i8, ptr %0, i64 648
  call void @png_set_bKGD(ptr noundef nonnull %0, ptr noundef %1, ptr noundef nonnull %78) #3
  br label %79

79:                                               ; preds = %34, %77, %47, %32, %25, %18, %11
  call void @llvm.lifetime.end.p0(i64 6, ptr nonnull %4) #3
  ret void
}

declare void @png_set_bKGD(ptr noundef, ptr 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 280}
!6 = !{!"png_struct_def", !7, i64 0, !9, i64 200, !9, i64 208, !9, i64 216, !9, i64 224, !9, i64 232, !9, i64 240, !9, i64 248, !9, i64 256, !9, i64 264, !7, i64 272, !7, i64 273, !10, i64 280, !10, i64 288, !10, i64 296, !11, i64 304, !9, i64 416, !10, i64 424, !12, i64 432, !12, i64 436, !12, i64 440, !12, i64 444, !12, i64 448, !10, i64 456, !10, i64 464, !10, i64 472, !10, i64 480, !10, i64 488, !10, i64 496, !10, i64 504, !10, i64 512, !9, i64 520, !9, i64 528, !9, i64 536, !9, i64 544, !9, i64 552, !9, i64 560, !13, i64 568, !10, i64 592, !10, i64 600, !9, i64 608, !14, i64 616, !14, i64 618, !7, i64 620, !7, i64 625, !7, i64 626, !7, i64 627, !7, i64 628, !7, i64 629, !7, i64 630, !7, i64 631, !7, i64 632, !7, i64 633, !7, i64 634, !7, i64 635, !7, i64 636, !14, i64 638, !7, i64 640, !15, i64 644, !16, i64 648, !16, i64 658, !9, i64 672, !10, i64 680, !10, i64 688, !12, i64 696, !15, i64 700, !15, i64 704, !9, i64 712, !9, i64 720, !9, i64 728, !9, i64 736, !9, i64 744, !9, i64 752, !17, i64 760, !17, i64 765, !9, i64 776, !16, i64 784, !9, i64 800, !9, i64 808, !9, i64 816, !9, i64 824, !9, i64 832, !9, i64 840, !9, i64 848, !9, i64 856, !9, i64 864, !10, i64 872, !10, i64 880, !10, i64 888, !10, i64 896, !10, i64 904, !10, i64 912, !12, i64 920, !12, i64 924, !10, i64 928, !10, i64 936, !9, i64 944, !9, i64 952, !9, i64 960, !9, i64 968, !9, i64 976, !7, i64 984, !7, i64 985, !9, i64 992, !9, i64 1000, !9, i64 1008, !9, i64 1016, !9, i64 1024, !9, i64 1032, !10, i64 1040, !9, i64 1048, !9, i64 1056, !12, i64 1064, !9, i64 1072, !7, i64 1080, !14, i64 1082, !14, i64 1084, !14, i64 1086, !10, i64 1088, !10, i64 1096, !7, i64 1104, !7, i64 1105, !10, i64 1112, !10, i64 1120, !9, i64 1128, !9, i64 1136, !9, i64 1144, !9, i64 1152, !9, i64 1160, !9, i64 1168, !9, i64 1176, !7, i64 1184, !10, i64 1192, !10, i64 1200, !18, i64 1208, !10, i64 1240, !10, i64 1248, !9, i64 1256}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!"any pointer", !7, i64 0}
!10 = !{!"long", !7, i64 0}
!11 = !{!"z_stream_s", !9, i64 0, !12, i64 8, !10, i64 16, !9, i64 24, !12, i64 32, !10, i64 40, !9, i64 48, !9, i64 56, !9, i64 64, !9, i64 72, !9, i64 80, !12, i64 88, !10, i64 96, !10, i64 104}
!12 = !{!"int", !7, i64 0}
!13 = !{!"png_row_info_struct", !10, i64 0, !10, i64 8, !7, i64 16, !7, i64 17, !7, i64 18, !7, i64 19}
!14 = !{!"short", !7, i64 0}
!15 = !{!"float", !7, i64 0}
!16 = !{!"png_color_16_struct", !7, i64 0, !14, i64 2, !14, i64 4, !14, i64 6, !14, i64 8}
!17 = !{!"png_color_8_struct", !7, i64 0, !7, i64 1, !7, i64 2, !7, i64 3, !7, i64 4}
!18 = !{!"png_unknown_chunk_t", !7, i64 0, !9, i64 8, !10, i64 16, !7, i64 24}
!19 = !{!6, !7, i64 630}
!20 = !{!21, !10, i64 16}
!21 = !{!"png_info_struct", !10, i64 0, !10, i64 8, !10, i64 16, !10, i64 24, !9, i64 32, !14, i64 40, !14, i64 42, !7, i64 44, !7, i64 45, !7, i64 46, !7, i64 47, !7, i64 48, !7, i64 49, !7, i64 50, !7, i64 51, !7, i64 52, !15, i64 60, !7, i64 64, !12, i64 68, !12, i64 72, !9, i64 80, !22, i64 88, !17, i64 96, !9, i64 104, !16, i64 112, !16, i64 122, !10, i64 136, !10, i64 144, !7, i64 152, !10, i64 160, !10, i64 168, !7, i64 176, !9, i64 184, !15, i64 192, !15, i64 196, !15, i64 200, !15, i64 204, !15, i64 208, !15, i64 212, !15, i64 216, !15, i64 220, !9, i64 224, !10, i64 232, !10, i64 240, !9, i64 248, !9, i64 256, !7, i64 264, !7, i64 265, !10, i64 272, !9, i64 280, !10, i64 288, !9, i64 296, !9, i64 304, !10, i64 312, !7, i64 320, !9, i64 328, !10, i64 336, !7, i64 344, !23, i64 352, !23, i64 360, !9, i64 368, !9, i64 376, !9, i64 384, !10, i64 392, !10, i64 400, !10, i64 408, !10, i64 416, !10, i64 424, !10, i64 432, !10, i64 440, !10, i64 448, !10, i64 456}
!22 = !{!"png_time_struct", !14, i64 0, !7, i64 2, !7, i64 3, !7, i64 4, !7, i64 5, !7, i64 6}
!23 = !{!"double", !7, i64 0}
!24 = !{!7, !7, i64 0}
!25 = !{!6, !7, i64 648}
!26 = !{!21, !14, i64 40}
!27 = !{!6, !9, i64 608}
!28 = !{!29, !7, i64 0}
!29 = !{!"png_color_struct", !7, i64 0, !7, i64 1, !7, i64 2}
!30 = !{!6, !14, i64 650}
!31 = !{!29, !7, i64 1}
!32 = !{!6, !14, i64 652}
!33 = !{!29, !7, i64 2}
!34 = !{!6, !14, i64 656}
!35 = !{!6, !14, i64 654}
!36 = !{!14, !14, i64 0}


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