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

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

@__const.png_write_IHDR.png_IHDR = external hidden unnamed_addr constant [5 x i8], align 1
@.str = external hidden unnamed_addr constant [38 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [32 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [37 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [44 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [33 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [35 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [35 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [30 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [33 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [54 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [53 x i8], align 1
@.str.12 = external hidden unnamed_addr constant [50 x i8], align 1
@.str.13 = external hidden unnamed_addr constant [37 x i8], align 1

; Function Attrs: nounwind uwtable
declare dso_local void @png_save_uint_32(ptr noundef, i32 noundef) #0

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

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #2

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

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

; Function Attrs: nounwind uwtable
define dso_local void @png_write_IHDR(ptr noundef %0, i32 noundef %1, i32 noundef %2, i32 noundef %3, i32 noundef %4, i32 noundef %5, i32 noundef %6, i32 noundef %7) #0 {
  %9 = alloca ptr, align 8
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  %15 = alloca i32, align 4
  %16 = alloca i32, align 4
  %17 = alloca [5 x i8], align 1
  %18 = alloca i32, align 4
  %19 = alloca [13 x i8], align 1
  store ptr %0, ptr %9, align 8, !tbaa !5
  store i32 %1, ptr %10, align 4, !tbaa !9
  store i32 %2, ptr %11, align 4, !tbaa !9
  store i32 %3, ptr %12, align 4, !tbaa !9
  store i32 %4, ptr %13, align 4, !tbaa !9
  store i32 %5, ptr %14, align 4, !tbaa !9
  store i32 %6, ptr %15, align 4, !tbaa !9
  store i32 %7, ptr %16, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 5, ptr %17) #4
  call void @llvm.memcpy.p0.p0.i64(ptr align 1 %17, ptr align 1 @__const.png_write_IHDR.png_IHDR, i64 5, i1 false)
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #4
  call void @llvm.lifetime.start.p0(i64 13, ptr %19) #4
  %20 = load i32, ptr %13, align 4, !tbaa !9
  switch i32 %20, label %70 [
    i32 0, label %21
    i32 2, label %29
    i32 3, label %40
    i32 4, label %48
    i32 6, label %59
  ]

21:                                               ; preds = %8
  %22 = load i32, ptr %12, align 4, !tbaa !9
  switch i32 %22, label %26 [
    i32 1, label %23
    i32 2, label %23
    i32 4, label %23
    i32 8, label %23
    i32 16, label %23
  ]

23:                                               ; preds = %21, %21, %21, %21, %21
  %24 = load ptr, ptr %9, align 8, !tbaa !5
  %25 = getelementptr inbounds %struct.png_struct_def, ptr %24, i32 0, i32 54
  store i8 1, ptr %25, align 2, !tbaa !11
  br label %28

26:                                               ; preds = %21
  %27 = load ptr, ptr %9, align 8, !tbaa !5
  call void @png_error(ptr noundef %27, ptr noundef @.str)
  br label %28

28:                                               ; preds = %26, %23
  br label %72

29:                                               ; preds = %8
  %30 = load i32, ptr %12, align 4, !tbaa !9
  %31 = icmp ne i32 %30, 8
  br i1 %31, label %32, label %37

32:                                               ; preds = %29
  %33 = load i32, ptr %12, align 4, !tbaa !9
  %34 = icmp ne i32 %33, 16
  br i1 %34, label %35, label %37

35:                                               ; preds = %32
  %36 = load ptr, ptr %9, align 8, !tbaa !5
  call void @png_error(ptr noundef %36, ptr noundef @.str.1)
  br label %37

37:                                               ; preds = %35, %32, %29
  %38 = load ptr, ptr %9, align 8, !tbaa !5
  %39 = getelementptr inbounds %struct.png_struct_def, ptr %38, i32 0, i32 54
  store i8 3, ptr %39, align 2, !tbaa !11
  br label %72

40:                                               ; preds = %8
  %41 = load i32, ptr %12, align 4, !tbaa !9
  switch i32 %41, label %45 [
    i32 1, label %42
    i32 2, label %42
    i32 4, label %42
    i32 8, label %42
  ]

42:                                               ; preds = %40, %40, %40, %40
  %43 = load ptr, ptr %9, align 8, !tbaa !5
  %44 = getelementptr inbounds %struct.png_struct_def, ptr %43, i32 0, i32 54
  store i8 1, ptr %44, align 2, !tbaa !11
  br label %47

45:                                               ; preds = %40
  %46 = load ptr, ptr %9, align 8, !tbaa !5
  call void @png_error(ptr noundef %46, ptr noundef @.str.2)
  br label %47

47:                                               ; preds = %45, %42
  br label %72

48:                                               ; preds = %8
  %49 = load i32, ptr %12, align 4, !tbaa !9
  %50 = icmp ne i32 %49, 8
  br i1 %50, label %51, label %56

51:                                               ; preds = %48
  %52 = load i32, ptr %12, align 4, !tbaa !9
  %53 = icmp ne i32 %52, 16
  br i1 %53, label %54, label %56

54:                                               ; preds = %51
  %55 = load ptr, ptr %9, align 8, !tbaa !5
  call void @png_error(ptr noundef %55, ptr noundef @.str.3)
  br label %56

56:                                               ; preds = %54, %51, %48
  %57 = load ptr, ptr %9, align 8, !tbaa !5
  %58 = getelementptr inbounds %struct.png_struct_def, ptr %57, i32 0, i32 54
  store i8 2, ptr %58, align 2, !tbaa !11
  br label %72

59:                                               ; preds = %8
  %60 = load i32, ptr %12, align 4, !tbaa !9
  %61 = icmp ne i32 %60, 8
  br i1 %61, label %62, label %67

62:                                               ; preds = %59
  %63 = load i32, ptr %12, align 4, !tbaa !9
  %64 = icmp ne i32 %63, 16
  br i1 %64, label %65, label %67

65:                                               ; preds = %62
  %66 = load ptr, ptr %9, align 8, !tbaa !5
  call void @png_error(ptr noundef %66, ptr noundef @.str.4)
  br label %67

67:                                               ; preds = %65, %62, %59
  %68 = load ptr, ptr %9, align 8, !tbaa !5
  %69 = getelementptr inbounds %struct.png_struct_def, ptr %68, i32 0, i32 54
  store i8 4, ptr %69, align 2, !tbaa !11
  br label %72

70:                                               ; preds = %8
  %71 = load ptr, ptr %9, align 8, !tbaa !5
  call void @png_error(ptr noundef %71, ptr noundef @.str.5)
  br label %72

72:                                               ; preds = %70, %67, %56, %47, %37, %28
  %73 = load i32, ptr %14, align 4, !tbaa !9
  %74 = icmp ne i32 %73, 0
  br i1 %74, label %75, label %77

75:                                               ; preds = %72
  %76 = load ptr, ptr %9, align 8, !tbaa !5
  call void @png_warning(ptr noundef %76, ptr noundef @.str.6)
  store i32 0, ptr %14, align 4, !tbaa !9
  br label %77

77:                                               ; preds = %75, %72
  %78 = load ptr, ptr %9, align 8, !tbaa !5
  %79 = getelementptr inbounds %struct.png_struct_def, ptr %78, i32 0, i32 119
  %80 = load i32, ptr %79, align 8, !tbaa !21
  %81 = and i32 %80, 4
  %82 = icmp ne i32 %81, 0
  br i1 %82, label %83, label %98

83:                                               ; preds = %77
  %84 = load ptr, ptr %9, align 8, !tbaa !5
  %85 = getelementptr inbounds %struct.png_struct_def, ptr %84, i32 0, i32 13
  %86 = load i32, ptr %85, align 4, !tbaa !22
  %87 = and i32 %86, 4096
  %88 = icmp eq i32 %87, 0
  br i1 %88, label %89, label %98

89:                                               ; preds = %83
  %90 = load i32, ptr %13, align 4, !tbaa !9
  %91 = icmp eq i32 %90, 2
  br i1 %91, label %95, label %92

92:                                               ; preds = %89
  %93 = load i32, ptr %13, align 4, !tbaa !9
  %94 = icmp eq i32 %93, 6
  br i1 %94, label %95, label %98

95:                                               ; preds = %92, %89
  %96 = load i32, ptr %15, align 4, !tbaa !9
  %97 = icmp eq i32 %96, 64
  br i1 %97, label %103, label %98

98:                                               ; preds = %95, %92, %83, %77
  %99 = load i32, ptr %15, align 4, !tbaa !9
  %100 = icmp ne i32 %99, 0
  br i1 %100, label %101, label %103

101:                                              ; preds = %98
  %102 = load ptr, ptr %9, align 8, !tbaa !5
  call void @png_warning(ptr noundef %102, ptr noundef @.str.7)
  store i32 0, ptr %15, align 4, !tbaa !9
  br label %103

103:                                              ; preds = %101, %98, %95
  %104 = load i32, ptr %16, align 4, !tbaa !9
  %105 = icmp ne i32 %104, 0
  br i1 %105, label %106, label %111

106:                                              ; preds = %103
  %107 = load i32, ptr %16, align 4, !tbaa !9
  %108 = icmp ne i32 %107, 1
  br i1 %108, label %109, label %111

109:                                              ; preds = %106
  %110 = load ptr, ptr %9, align 8, !tbaa !5
  call void @png_warning(ptr noundef %110, ptr noundef @.str.8)
  store i32 1, ptr %16, align 4, !tbaa !9
  br label %111

111:                                              ; preds = %109, %106, %103
  %112 = load i32, ptr %12, align 4, !tbaa !9
  %113 = trunc i32 %112 to i8
  %114 = load ptr, ptr %9, align 8, !tbaa !5
  %115 = getelementptr inbounds %struct.png_struct_def, ptr %114, i32 0, i32 51
  store i8 %113, ptr %115, align 1, !tbaa !23
  %116 = load i32, ptr %13, align 4, !tbaa !9
  %117 = trunc i32 %116 to i8
  %118 = load ptr, ptr %9, align 8, !tbaa !5
  %119 = getelementptr inbounds %struct.png_struct_def, ptr %118, i32 0, i32 50
  store i8 %117, ptr %119, align 2, !tbaa !24
  %120 = load i32, ptr %16, align 4, !tbaa !9
  %121 = trunc i32 %120 to i8
  %122 = load ptr, ptr %9, align 8, !tbaa !5
  %123 = getelementptr inbounds %struct.png_struct_def, ptr %122, i32 0, i32 47
  store i8 %121, ptr %123, align 1, !tbaa !25
  %124 = load i32, ptr %15, align 4, !tbaa !9
  %125 = trunc i32 %124 to i8
  %126 = load ptr, ptr %9, align 8, !tbaa !5
  %127 = getelementptr inbounds %struct.png_struct_def, ptr %126, i32 0, i32 121
  store i8 %125, ptr %127, align 8, !tbaa !26
  %128 = load i32, ptr %14, align 4, !tbaa !9
  %129 = trunc i32 %128 to i8
  %130 = load ptr, ptr %9, align 8, !tbaa !5
  %131 = getelementptr inbounds %struct.png_struct_def, ptr %130, i32 0, i32 129
  store i8 %129, ptr %131, align 8, !tbaa !27
  %132 = load i32, ptr %10, align 4, !tbaa !9
  %133 = load ptr, ptr %9, align 8, !tbaa !5
  %134 = getelementptr inbounds %struct.png_struct_def, ptr %133, i32 0, i32 24
  store i32 %132, ptr %134, align 4, !tbaa !28
  %135 = load i32, ptr %11, align 4, !tbaa !9
  %136 = load ptr, ptr %9, align 8, !tbaa !5
  %137 = getelementptr inbounds %struct.png_struct_def, ptr %136, i32 0, i32 25
  store i32 %135, ptr %137, align 8, !tbaa !29
  %138 = load i32, ptr %12, align 4, !tbaa !9
  %139 = load ptr, ptr %9, align 8, !tbaa !5
  %140 = getelementptr inbounds %struct.png_struct_def, ptr %139, i32 0, i32 54
  %141 = load i8, ptr %140, align 2, !tbaa !11
  %142 = zext i8 %141 to i32
  %143 = mul nsw i32 %138, %142
  %144 = trunc i32 %143 to i8
  %145 = load ptr, ptr %9, align 8, !tbaa !5
  %146 = getelementptr inbounds %struct.png_struct_def, ptr %145, i32 0, i32 53
  store i8 %144, ptr %146, align 1, !tbaa !30
  %147 = load ptr, ptr %9, align 8, !tbaa !5
  %148 = getelementptr inbounds %struct.png_struct_def, ptr %147, i32 0, i32 53
  %149 = load i8, ptr %148, align 1, !tbaa !30
  %150 = zext i8 %149 to i32
  %151 = icmp sge i32 %150, 8
  br i1 %151, label %152, label %161

152:                                              ; preds = %111
  %153 = load i32, ptr %10, align 4, !tbaa !9
  %154 = zext i32 %153 to i64
  %155 = load ptr, ptr %9, align 8, !tbaa !5
  %156 = getelementptr inbounds %struct.png_struct_def, ptr %155, i32 0, i32 53
  %157 = load i8, ptr %156, align 1, !tbaa !30
  %158 = zext i8 %157 to i64
  %159 = lshr i64 %158, 3
  %160 = mul i64 %154, %159
  br label %171

161:                                              ; preds = %111
  %162 = load i32, ptr %10, align 4, !tbaa !9
  %163 = zext i32 %162 to i64
  %164 = load ptr, ptr %9, align 8, !tbaa !5
  %165 = getelementptr inbounds %struct.png_struct_def, ptr %164, i32 0, i32 53
  %166 = load i8, ptr %165, align 1, !tbaa !30
  %167 = zext i8 %166 to i64
  %168 = mul i64 %163, %167
  %169 = add i64 %168, 7
  %170 = lshr i64 %169, 3
  br label %171

171:                                              ; preds = %161, %152
  %172 = phi i64 [ %160, %152 ], [ %170, %161 ]
  %173 = load ptr, ptr %9, align 8, !tbaa !5
  %174 = getelementptr inbounds %struct.png_struct_def, ptr %173, i32 0, i32 28
  store i64 %172, ptr %174, align 8, !tbaa !31
  %175 = load ptr, ptr %9, align 8, !tbaa !5
  %176 = getelementptr inbounds %struct.png_struct_def, ptr %175, i32 0, i32 24
  %177 = load i32, ptr %176, align 4, !tbaa !28
  %178 = load ptr, ptr %9, align 8, !tbaa !5
  %179 = getelementptr inbounds %struct.png_struct_def, ptr %178, i32 0, i32 27
  store i32 %177, ptr %179, align 8, !tbaa !32
  %180 = load ptr, ptr %9, align 8, !tbaa !5
  %181 = getelementptr inbounds %struct.png_struct_def, ptr %180, i32 0, i32 51
  %182 = load i8, ptr %181, align 1, !tbaa !23
  %183 = load ptr, ptr %9, align 8, !tbaa !5
  %184 = getelementptr inbounds %struct.png_struct_def, ptr %183, i32 0, i32 52
  store i8 %182, ptr %184, align 8, !tbaa !33
  %185 = load ptr, ptr %9, align 8, !tbaa !5
  %186 = getelementptr inbounds %struct.png_struct_def, ptr %185, i32 0, i32 54
  %187 = load i8, ptr %186, align 2, !tbaa !11
  %188 = load ptr, ptr %9, align 8, !tbaa !5
  %189 = getelementptr inbounds %struct.png_struct_def, ptr %188, i32 0, i32 55
  store i8 %187, ptr %189, align 1, !tbaa !34
  %190 = getelementptr inbounds [13 x i8], ptr %19, i64 0, i64 0
  %191 = load i32, ptr %10, align 4, !tbaa !9
  call void @png_save_uint_32(ptr noundef %190, i32 noundef %191)
  %192 = getelementptr inbounds [13 x i8], ptr %19, i64 0, i64 0
  %193 = getelementptr inbounds i8, ptr %192, i64 4
  %194 = load i32, ptr %11, align 4, !tbaa !9
  call void @png_save_uint_32(ptr noundef %193, i32 noundef %194)
  %195 = load i32, ptr %12, align 4, !tbaa !9
  %196 = trunc i32 %195 to i8
  %197 = getelementptr inbounds [13 x i8], ptr %19, i64 0, i64 8
  store i8 %196, ptr %197, align 1, !tbaa !35
  %198 = load i32, ptr %13, align 4, !tbaa !9
  %199 = trunc i32 %198 to i8
  %200 = getelementptr inbounds [13 x i8], ptr %19, i64 0, i64 9
  store i8 %199, ptr %200, align 1, !tbaa !35
  %201 = load i32, ptr %14, align 4, !tbaa !9
  %202 = trunc i32 %201 to i8
  %203 = getelementptr inbounds [13 x i8], ptr %19, i64 0, i64 10
  store i8 %202, ptr %203, align 1, !tbaa !35
  %204 = load i32, ptr %15, align 4, !tbaa !9
  %205 = trunc i32 %204 to i8
  %206 = getelementptr inbounds [13 x i8], ptr %19, i64 0, i64 11
  store i8 %205, ptr %206, align 1, !tbaa !35
  %207 = load i32, ptr %16, align 4, !tbaa !9
  %208 = trunc i32 %207 to i8
  %209 = getelementptr inbounds [13 x i8], ptr %19, i64 0, i64 12
  store i8 %208, ptr %209, align 1, !tbaa !35
  %210 = load ptr, ptr %9, align 8, !tbaa !5
  %211 = getelementptr inbounds [5 x i8], ptr %17, i64 0, i64 0
  %212 = getelementptr inbounds [13 x i8], ptr %19, i64 0, i64 0
  call void @png_write_chunk(ptr noundef %210, ptr noundef %211, ptr noundef %212, i64 noundef 13)
  %213 = load ptr, ptr %9, align 8, !tbaa !5
  %214 = getelementptr inbounds %struct.png_struct_def, ptr %213, i32 0, i32 16
  %215 = getelementptr inbounds %struct.z_stream_s, ptr %214, i32 0, i32 8
  store ptr @png_zalloc, ptr %215, align 8, !tbaa !36
  %216 = load ptr, ptr %9, align 8, !tbaa !5
  %217 = getelementptr inbounds %struct.png_struct_def, ptr %216, i32 0, i32 16
  %218 = getelementptr inbounds %struct.z_stream_s, ptr %217, i32 0, i32 9
  store ptr @png_zfree, ptr %218, align 8, !tbaa !37
  %219 = load ptr, ptr %9, align 8, !tbaa !5
  %220 = load ptr, ptr %9, align 8, !tbaa !5
  %221 = getelementptr inbounds %struct.png_struct_def, ptr %220, i32 0, i32 16
  %222 = getelementptr inbounds %struct.z_stream_s, ptr %221, i32 0, i32 10
  store ptr %219, ptr %222, align 8, !tbaa !38
  %223 = load ptr, ptr %9, align 8, !tbaa !5
  %224 = getelementptr inbounds %struct.png_struct_def, ptr %223, i32 0, i32 49
  %225 = load i8, ptr %224, align 1, !tbaa !39
  %226 = icmp ne i8 %225, 0
  br i1 %226, label %246, label %227

227:                                              ; preds = %171
  %228 = load ptr, ptr %9, align 8, !tbaa !5
  %229 = getelementptr inbounds %struct.png_struct_def, ptr %228, i32 0, i32 50
  %230 = load i8, ptr %229, align 2, !tbaa !24
  %231 = zext i8 %230 to i32
  %232 = icmp eq i32 %231, 3
  br i1 %232, label %239, label %233

233:                                              ; preds = %227
  %234 = load ptr, ptr %9, align 8, !tbaa !5
  %235 = getelementptr inbounds %struct.png_struct_def, ptr %234, i32 0, i32 51
  %236 = load i8, ptr %235, align 1, !tbaa !23
  %237 = zext i8 %236 to i32
  %238 = icmp slt i32 %237, 8
  br i1 %238, label %239, label %242

239:                                              ; preds = %233, %227
  %240 = load ptr, ptr %9, align 8, !tbaa !5
  %241 = getelementptr inbounds %struct.png_struct_def, ptr %240, i32 0, i32 49
  store i8 8, ptr %241, align 1, !tbaa !39
  br label %245

242:                                              ; preds = %233
  %243 = load ptr, ptr %9, align 8, !tbaa !5
  %244 = getelementptr inbounds %struct.png_struct_def, ptr %243, i32 0, i32 49
  store i8 -8, ptr %244, align 1, !tbaa !39
  br label %245

245:                                              ; preds = %242, %239
  br label %246

246:                                              ; preds = %245, %171
  %247 = load ptr, ptr %9, align 8, !tbaa !5
  %248 = getelementptr inbounds %struct.png_struct_def, ptr %247, i32 0, i32 14
  %249 = load i32, ptr %248, align 8, !tbaa !40
  %250 = and i32 %249, 1
  %251 = icmp ne i32 %250, 0
  br i1 %251, label %265, label %252

252:                                              ; preds = %246
  %253 = load ptr, ptr %9, align 8, !tbaa !5
  %254 = getelementptr inbounds %struct.png_struct_def, ptr %253, i32 0, i32 49
  %255 = load i8, ptr %254, align 1, !tbaa !39
  %256 = zext i8 %255 to i32
  %257 = icmp ne i32 %256, 8
  br i1 %257, label %258, label %261

258:                                              ; preds = %252
  %259 = load ptr, ptr %9, align 8, !tbaa !5
  %260 = getelementptr inbounds %struct.png_struct_def, ptr %259, i32 0, i32 23
  store i32 1, ptr %260, align 8, !tbaa !41
  br label %264

261:                                              ; preds = %252
  %262 = load ptr, ptr %9, align 8, !tbaa !5
  %263 = getelementptr inbounds %struct.png_struct_def, ptr %262, i32 0, i32 23
  store i32 0, ptr %263, align 8, !tbaa !41
  br label %264

264:                                              ; preds = %261, %258
  br label %265

265:                                              ; preds = %264, %246
  %266 = load ptr, ptr %9, align 8, !tbaa !5
  %267 = getelementptr inbounds %struct.png_struct_def, ptr %266, i32 0, i32 14
  %268 = load i32, ptr %267, align 8, !tbaa !40
  %269 = and i32 %268, 2
  %270 = icmp ne i32 %269, 0
  br i1 %270, label %274, label %271

271:                                              ; preds = %265
  %272 = load ptr, ptr %9, align 8, !tbaa !5
  %273 = getelementptr inbounds %struct.png_struct_def, ptr %272, i32 0, i32 19
  store i32 -1, ptr %273, align 8, !tbaa !42
  br label %274

274:                                              ; preds = %271, %265
  %275 = load ptr, ptr %9, align 8, !tbaa !5
  %276 = getelementptr inbounds %struct.png_struct_def, ptr %275, i32 0, i32 14
  %277 = load i32, ptr %276, align 8, !tbaa !40
  %278 = and i32 %277, 4
  %279 = icmp ne i32 %278, 0
  br i1 %279, label %283, label %280

280:                                              ; preds = %274
  %281 = load ptr, ptr %9, align 8, !tbaa !5
  %282 = getelementptr inbounds %struct.png_struct_def, ptr %281, i32 0, i32 22
  store i32 8, ptr %282, align 4, !tbaa !43
  br label %283

283:                                              ; preds = %280, %274
  %284 = load ptr, ptr %9, align 8, !tbaa !5
  %285 = getelementptr inbounds %struct.png_struct_def, ptr %284, i32 0, i32 14
  %286 = load i32, ptr %285, align 8, !tbaa !40
  %287 = and i32 %286, 8
  %288 = icmp ne i32 %287, 0
  br i1 %288, label %292, label %289

289:                                              ; preds = %283
  %290 = load ptr, ptr %9, align 8, !tbaa !5
  %291 = getelementptr inbounds %struct.png_struct_def, ptr %290, i32 0, i32 21
  store i32 15, ptr %291, align 8, !tbaa !44
  br label %292

292:                                              ; preds = %289, %283
  %293 = load ptr, ptr %9, align 8, !tbaa !5
  %294 = getelementptr inbounds %struct.png_struct_def, ptr %293, i32 0, i32 14
  %295 = load i32, ptr %294, align 8, !tbaa !40
  %296 = and i32 %295, 16
  %297 = icmp ne i32 %296, 0
  br i1 %297, label %301, label %298

298:                                              ; preds = %292
  %299 = load ptr, ptr %9, align 8, !tbaa !5
  %300 = getelementptr inbounds %struct.png_struct_def, ptr %299, i32 0, i32 20
  store i32 8, ptr %300, align 4, !tbaa !45
  br label %301

301:                                              ; preds = %298, %292
  %302 = load ptr, ptr %9, align 8, !tbaa !5
  %303 = getelementptr inbounds %struct.png_struct_def, ptr %302, i32 0, i32 16
  %304 = load ptr, ptr %9, align 8, !tbaa !5
  %305 = getelementptr inbounds %struct.png_struct_def, ptr %304, i32 0, i32 19
  %306 = load i32, ptr %305, align 8, !tbaa !42
  %307 = load ptr, ptr %9, align 8, !tbaa !5
  %308 = getelementptr inbounds %struct.png_struct_def, ptr %307, i32 0, i32 20
  %309 = load i32, ptr %308, align 4, !tbaa !45
  %310 = load ptr, ptr %9, align 8, !tbaa !5
  %311 = getelementptr inbounds %struct.png_struct_def, ptr %310, i32 0, i32 21
  %312 = load i32, ptr %311, align 8, !tbaa !44
  %313 = load ptr, ptr %9, align 8, !tbaa !5
  %314 = getelementptr inbounds %struct.png_struct_def, ptr %313, i32 0, i32 22
  %315 = load i32, ptr %314, align 4, !tbaa !43
  %316 = load ptr, ptr %9, align 8, !tbaa !5
  %317 = getelementptr inbounds %struct.png_struct_def, ptr %316, i32 0, i32 23
  %318 = load i32, ptr %317, align 8, !tbaa !41
  %319 = call i32 @deflateInit2_(ptr noundef %303, i32 noundef %306, i32 noundef %309, i32 noundef %312, i32 noundef %315, i32 noundef %318, ptr noundef @.str.9, i32 noundef 112)
  store i32 %319, ptr %18, align 4, !tbaa !9
  %320 = load i32, ptr %18, align 4, !tbaa !9
  %321 = icmp ne i32 %320, 0
  br i1 %321, label %322, label %339

322:                                              ; preds = %301
  %323 = load i32, ptr %18, align 4, !tbaa !9
  %324 = icmp eq i32 %323, -6
  br i1 %324, label %325, label %327

325:                                              ; preds = %322
  %326 = load ptr, ptr %9, align 8, !tbaa !5
  call void @png_error(ptr noundef %326, ptr noundef @.str.10)
  br label %327

327:                                              ; preds = %325, %322
  %328 = load i32, ptr %18, align 4, !tbaa !9
  %329 = icmp eq i32 %328, -2
  br i1 %329, label %330, label %332

330:                                              ; preds = %327
  %331 = load ptr, ptr %9, align 8, !tbaa !5
  call void @png_error(ptr noundef %331, ptr noundef @.str.11)
  br label %332

332:                                              ; preds = %330, %327
  %333 = load i32, ptr %18, align 4, !tbaa !9
  %334 = icmp eq i32 %333, -4
  br i1 %334, label %335, label %337

335:                                              ; preds = %332
  %336 = load ptr, ptr %9, align 8, !tbaa !5
  call void @png_error(ptr noundef %336, ptr noundef @.str.12)
  br label %337

337:                                              ; preds = %335, %332
  %338 = load ptr, ptr %9, align 8, !tbaa !5
  call void @png_error(ptr noundef %338, ptr noundef @.str.13)
  br label %339

339:                                              ; preds = %337, %301
  %340 = load ptr, ptr %9, align 8, !tbaa !5
  %341 = getelementptr inbounds %struct.png_struct_def, ptr %340, i32 0, i32 17
  %342 = load ptr, ptr %341, align 8, !tbaa !46
  %343 = load ptr, ptr %9, align 8, !tbaa !5
  %344 = getelementptr inbounds %struct.png_struct_def, ptr %343, i32 0, i32 16
  %345 = getelementptr inbounds %struct.z_stream_s, ptr %344, i32 0, i32 3
  store ptr %342, ptr %345, align 8, !tbaa !47
  %346 = load ptr, ptr %9, align 8, !tbaa !5
  %347 = getelementptr inbounds %struct.png_struct_def, ptr %346, i32 0, i32 18
  %348 = load i64, ptr %347, align 8, !tbaa !48
  %349 = trunc i64 %348 to i32
  %350 = load ptr, ptr %9, align 8, !tbaa !5
  %351 = getelementptr inbounds %struct.png_struct_def, ptr %350, i32 0, i32 16
  %352 = getelementptr inbounds %struct.z_stream_s, ptr %351, i32 0, i32 4
  store i32 %349, ptr %352, align 8, !tbaa !49
  %353 = load ptr, ptr %9, align 8, !tbaa !5
  %354 = getelementptr inbounds %struct.png_struct_def, ptr %353, i32 0, i32 16
  %355 = getelementptr inbounds %struct.z_stream_s, ptr %354, i32 0, i32 11
  store i32 0, ptr %355, align 8, !tbaa !50
  %356 = load ptr, ptr %9, align 8, !tbaa !5
  %357 = getelementptr inbounds %struct.png_struct_def, ptr %356, i32 0, i32 13
  store i32 1, ptr %357, align 4, !tbaa !22
  call void @llvm.lifetime.end.p0(i64 13, ptr %19) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #4
  call void @llvm.lifetime.end.p0(i64 5, ptr %17) #4
  ret void
}

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

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

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

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

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

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

!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, !7, i64 594}
!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 = !{!12, !10, i64 1032}
!22 = !{!12, !10, i64 284}
!23 = !{!12, !7, i64 591}
!24 = !{!12, !7, i64 590}
!25 = !{!12, !7, i64 587}
!26 = !{!12, !7, i64 1040}
!27 = !{!12, !7, i64 1104}
!28 = !{!12, !10, i64 444}
!29 = !{!12, !10, i64 448}
!30 = !{!12, !7, i64 593}
!31 = !{!12, !14, i64 464}
!32 = !{!12, !10, i64 456}
!33 = !{!12, !7, i64 592}
!34 = !{!12, !7, i64 595}
!35 = !{!7, !7, i64 0}
!36 = !{!12, !6, i64 360}
!37 = !{!12, !6, i64 368}
!38 = !{!12, !6, i64 376}
!39 = !{!12, !7, i64 589}
!40 = !{!12, !10, i64 288}
!41 = !{!12, !10, i64 440}
!42 = !{!12, !10, i64 424}
!43 = !{!12, !10, i64 436}
!44 = !{!12, !10, i64 432}
!45 = !{!12, !10, i64 428}
!46 = !{!12, !6, i64 408}
!47 = !{!12, !6, i64 320}
!48 = !{!12, !14, i64 416}
!49 = !{!12, !10, i64 328}
!50 = !{!12, !10, i64 384}


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

@__const.png_write_IHDR.png_IHDR = external hidden unnamed_addr constant [5 x i8], align 1
@.str = external hidden unnamed_addr constant [38 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [32 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [37 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [44 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [33 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [35 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [35 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [30 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [33 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [54 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [53 x i8], align 1
@.str.12 = external hidden unnamed_addr constant [50 x i8], align 1
@.str.13 = external hidden unnamed_addr constant [37 x i8], align 1

; Function Attrs: nounwind uwtable
declare dso_local void @png_save_uint_32(ptr noundef, i32 noundef) local_unnamed_addr #0

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

; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #2

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

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

; Function Attrs: nounwind uwtable
define dso_local void @png_write_IHDR(ptr noundef %0, i32 noundef %1, i32 noundef %2, i32 noundef %3, i32 noundef %4, i32 noundef %5, i32 noundef %6, i32 noundef %7) local_unnamed_addr #0 {
  %9 = alloca [5 x i8], align 1
  %10 = alloca [13 x i8], align 1
  call void @llvm.lifetime.start.p0(i64 5, ptr nonnull %9) #4
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 1 dereferenceable(5) %9, ptr noundef nonnull align 1 dereferenceable(5) @__const.png_write_IHDR.png_IHDR, i64 5, i1 false)
  call void @llvm.lifetime.start.p0(i64 13, ptr nonnull %10) #4
  switch i32 %4, label %31 [
    i32 0, label %11
    i32 2, label %15
    i32 3, label %19
    i32 4, label %23
    i32 6, label %27
  ]

11:                                               ; preds = %8
  switch i32 %3, label %14 [
    i32 1, label %12
    i32 2, label %12
    i32 4, label %12
    i32 8, label %12
    i32 16, label %12
  ]

12:                                               ; preds = %11, %11, %11, %11, %11
  %13 = getelementptr inbounds i8, ptr %0, i64 594
  store i8 1, ptr %13, align 2, !tbaa !5
  br label %32

14:                                               ; preds = %11
  tail call void @png_error(ptr noundef %0, ptr noundef nonnull @.str) #4
  br label %32

15:                                               ; preds = %8
  switch i32 %3, label %16 [
    i32 16, label %17
    i32 8, label %17
  ]

16:                                               ; preds = %15
  tail call void @png_error(ptr noundef %0, ptr noundef nonnull @.str.1) #4
  br label %17

17:                                               ; preds = %15, %15, %16
  %18 = getelementptr inbounds i8, ptr %0, i64 594
  store i8 3, ptr %18, align 2, !tbaa !5
  br label %32

19:                                               ; preds = %8
  switch i32 %3, label %22 [
    i32 1, label %20
    i32 2, label %20
    i32 4, label %20
    i32 8, label %20
  ]

20:                                               ; preds = %19, %19, %19, %19
  %21 = getelementptr inbounds i8, ptr %0, i64 594
  store i8 1, ptr %21, align 2, !tbaa !5
  br label %32

22:                                               ; preds = %19
  tail call void @png_error(ptr noundef %0, ptr noundef nonnull @.str.2) #4
  br label %32

23:                                               ; preds = %8
  switch i32 %3, label %24 [
    i32 16, label %25
    i32 8, label %25
  ]

24:                                               ; preds = %23
  tail call void @png_error(ptr noundef %0, ptr noundef nonnull @.str.3) #4
  br label %25

25:                                               ; preds = %23, %23, %24
  %26 = getelementptr inbounds i8, ptr %0, i64 594
  store i8 2, ptr %26, align 2, !tbaa !5
  br label %32

27:                                               ; preds = %8
  switch i32 %3, label %28 [
    i32 16, label %29
    i32 8, label %29
  ]

28:                                               ; preds = %27
  tail call void @png_error(ptr noundef %0, ptr noundef nonnull @.str.4) #4
  br label %29

29:                                               ; preds = %27, %27, %28
  %30 = getelementptr inbounds i8, ptr %0, i64 594
  store i8 4, ptr %30, align 2, !tbaa !5
  br label %32

31:                                               ; preds = %8
  tail call void @png_error(ptr noundef %0, ptr noundef nonnull @.str.5) #4
  br label %32

32:                                               ; preds = %20, %22, %12, %14, %31, %29, %25, %17
  %.not = icmp eq i32 %5, 0
  br i1 %.not, label %34, label %33

33:                                               ; preds = %32
  tail call void @png_warning(ptr noundef %0, ptr noundef nonnull @.str.6) #4
  br label %34

34:                                               ; preds = %33, %32
  %35 = getelementptr inbounds i8, ptr %0, i64 1032
  %36 = load i32, ptr %35, align 8, !tbaa !19
  %37 = and i32 %36, 4
  %.not129 = icmp eq i32 %37, 0
  br i1 %.not129, label %47, label %38

38:                                               ; preds = %34
  %39 = getelementptr inbounds i8, ptr %0, i64 284
  %40 = load i32, ptr %39, align 4, !tbaa !20
  %41 = and i32 %40, 4096
  %42 = icmp eq i32 %41, 0
  br i1 %42, label %43, label %47

43:                                               ; preds = %38
  %44 = and i32 %4, -5
  %or.cond7 = icmp ne i32 %44, 2
  %45 = icmp ne i32 %6, 64
  %or.cond9.not131 = or i1 %or.cond7, %45
  %46 = icmp ne i32 %6, 0
  %or.cond11 = and i1 %46, %or.cond9.not131
  br i1 %or.cond11, label %48, label %49

47:                                               ; preds = %38, %34
  %.old10.not = icmp eq i32 %6, 0
  br i1 %.old10.not, label %49, label %48

48:                                               ; preds = %43, %47
  tail call void @png_warning(ptr noundef nonnull %0, ptr noundef nonnull @.str.7) #4
  br label %49

49:                                               ; preds = %43, %48, %47
  %.0125 = phi i32 [ 0, %48 ], [ %6, %43 ], [ 0, %47 ]
  %or.cond14 = icmp ugt i32 %7, 1
  br i1 %or.cond14, label %50, label %51

50:                                               ; preds = %49
  tail call void @png_warning(ptr noundef nonnull %0, ptr noundef nonnull @.str.8) #4
  br label %51

51:                                               ; preds = %50, %49
  %.0124 = phi i32 [ 1, %50 ], [ %7, %49 ]
  %52 = trunc i32 %3 to i8
  %53 = getelementptr inbounds i8, ptr %0, i64 591
  store i8 %52, ptr %53, align 1, !tbaa !21
  %54 = trunc i32 %4 to i8
  %55 = getelementptr inbounds i8, ptr %0, i64 590
  store i8 %54, ptr %55, align 2, !tbaa !22
  %56 = trunc nuw i32 %.0124 to i8
  %57 = getelementptr inbounds i8, ptr %0, i64 587
  store i8 %56, ptr %57, align 1, !tbaa !23
  %58 = trunc i32 %.0125 to i8
  %59 = getelementptr inbounds i8, ptr %0, i64 1040
  store i8 %58, ptr %59, align 8, !tbaa !24
  %60 = getelementptr inbounds i8, ptr %0, i64 1104
  store i8 0, ptr %60, align 8, !tbaa !25
  %61 = getelementptr inbounds i8, ptr %0, i64 444
  store i32 %1, ptr %61, align 4, !tbaa !26
  %62 = getelementptr inbounds i8, ptr %0, i64 448
  store i32 %2, ptr %62, align 8, !tbaa !27
  %63 = getelementptr inbounds i8, ptr %0, i64 594
  %64 = load i8, ptr %63, align 2, !tbaa !5
  %65 = mul i8 %64, %52
  %66 = getelementptr inbounds i8, ptr %0, i64 593
  store i8 %65, ptr %66, align 1, !tbaa !28
  %67 = icmp ugt i8 %65, 7
  %68 = zext i32 %1 to i64
  br i1 %67, label %69, label %73

69:                                               ; preds = %51
  %70 = lshr i8 %65, 3
  %71 = zext nneg i8 %70 to i64
  %72 = mul nuw nsw i64 %71, %68
  br label %78

73:                                               ; preds = %51
  %74 = zext nneg i8 %65 to i64
  %75 = mul nuw nsw i64 %74, %68
  %76 = add nuw nsw i64 %75, 7
  %77 = lshr i64 %76, 3
  br label %78

78:                                               ; preds = %73, %69
  %79 = phi i64 [ %72, %69 ], [ %77, %73 ]
  %80 = getelementptr inbounds i8, ptr %0, i64 464
  store i64 %79, ptr %80, align 8, !tbaa !29
  %81 = getelementptr inbounds i8, ptr %0, i64 456
  store i32 %1, ptr %81, align 8, !tbaa !30
  %82 = getelementptr inbounds i8, ptr %0, i64 592
  store i8 %52, ptr %82, align 8, !tbaa !31
  %83 = getelementptr inbounds i8, ptr %0, i64 595
  store i8 %64, ptr %83, align 1, !tbaa !32
  call void @png_save_uint_32(ptr noundef nonnull %10, i32 noundef %1)
  %84 = getelementptr inbounds i8, ptr %10, i64 4
  call void @png_save_uint_32(ptr noundef nonnull %84, i32 noundef %2)
  %85 = getelementptr inbounds i8, ptr %10, i64 8
  store i8 %52, ptr %85, align 1, !tbaa !33
  %86 = getelementptr inbounds i8, ptr %10, i64 9
  store i8 %54, ptr %86, align 1, !tbaa !33
  %87 = getelementptr inbounds i8, ptr %10, i64 10
  store i8 0, ptr %87, align 1, !tbaa !33
  %88 = getelementptr inbounds i8, ptr %10, i64 11
  store i8 %58, ptr %88, align 1, !tbaa !33
  %89 = getelementptr inbounds i8, ptr %10, i64 12
  store i8 %56, ptr %89, align 1, !tbaa !33
  call void @png_write_chunk(ptr noundef nonnull %0, ptr noundef nonnull %9, ptr noundef nonnull %10, i64 noundef 13)
  %90 = getelementptr inbounds i8, ptr %0, i64 296
  %91 = getelementptr inbounds i8, ptr %0, i64 360
  store ptr @png_zalloc, ptr %91, align 8, !tbaa !34
  %92 = getelementptr inbounds i8, ptr %0, i64 368
  store ptr @png_zfree, ptr %92, align 8, !tbaa !35
  %93 = getelementptr inbounds i8, ptr %0, i64 376
  store ptr %0, ptr %93, align 8, !tbaa !36
  %94 = getelementptr inbounds i8, ptr %0, i64 589
  %95 = load i8, ptr %94, align 1, !tbaa !37
  %.not132 = icmp eq i8 %95, 0
  br i1 %.not132, label %96, label %103

96:                                               ; preds = %78
  %97 = load i8, ptr %55, align 2, !tbaa !22
  %98 = icmp eq i8 %97, 3
  br i1 %98, label %102, label %99

99:                                               ; preds = %96
  %100 = load i8, ptr %53, align 1, !tbaa !21
  %101 = icmp ult i8 %100, 8
  br i1 %101, label %102, label %.thread

102:                                              ; preds = %99, %96
  store i8 8, ptr %94, align 1, !tbaa !37
  br label %103

103:                                              ; preds = %102, %78
  %104 = phi i8 [ 8, %102 ], [ %95, %78 ]
  %105 = getelementptr inbounds i8, ptr %0, i64 288
  %106 = load i32, ptr %105, align 8, !tbaa !38
  %107 = and i32 %106, 1
  %.not133 = icmp eq i32 %107, 0
  br i1 %.not133, label %111, label %113

.thread:                                          ; preds = %99
  store i8 -8, ptr %94, align 1, !tbaa !37
  %108 = getelementptr inbounds i8, ptr %0, i64 288
  %109 = load i32, ptr %108, align 8, !tbaa !38
  %110 = and i32 %109, 1
  %.not133140 = icmp eq i32 %110, 0
  br i1 %.not133140, label %.sink.split, label %113

111:                                              ; preds = %103
  %.not134 = icmp ne i8 %104, 8
  %spec.select = zext i1 %.not134 to i32
  br label %.sink.split

.sink.split:                                      ; preds = %111, %.thread
  %.sink = phi i32 [ 1, %.thread ], [ %spec.select, %111 ]
  %.ph = phi i32 [ %109, %.thread ], [ %106, %111 ]
  %112 = getelementptr inbounds i8, ptr %0, i64 440
  store i32 %.sink, ptr %112, align 8, !tbaa !39
  br label %113

113:                                              ; preds = %.sink.split, %.thread, %103
  %114 = phi i32 [ %109, %.thread ], [ %106, %103 ], [ %.ph, %.sink.split ]
  %115 = and i32 %114, 2
  %.not135 = icmp eq i32 %115, 0
  br i1 %.not135, label %116, label %118

116:                                              ; preds = %113
  %117 = getelementptr inbounds i8, ptr %0, i64 424
  store i32 -1, ptr %117, align 8, !tbaa !40
  br label %118

118:                                              ; preds = %116, %113
  %119 = and i32 %114, 4
  %.not136 = icmp eq i32 %119, 0
  br i1 %.not136, label %120, label %122

120:                                              ; preds = %118
  %121 = getelementptr inbounds i8, ptr %0, i64 436
  store i32 8, ptr %121, align 4, !tbaa !41
  br label %122

122:                                              ; preds = %120, %118
  %123 = and i32 %114, 8
  %.not137 = icmp eq i32 %123, 0
  br i1 %.not137, label %124, label %126

124:                                              ; preds = %122
  %125 = getelementptr inbounds i8, ptr %0, i64 432
  store i32 15, ptr %125, align 8, !tbaa !42
  br label %126

126:                                              ; preds = %124, %122
  %127 = and i32 %114, 16
  %.not138 = icmp eq i32 %127, 0
  %128 = getelementptr inbounds i8, ptr %0, i64 428
  br i1 %.not138, label %129, label %._crit_edge

._crit_edge:                                      ; preds = %126
  %.pre = load i32, ptr %128, align 4, !tbaa !43
  br label %130

129:                                              ; preds = %126
  store i32 8, ptr %128, align 4, !tbaa !43
  br label %130

130:                                              ; preds = %._crit_edge, %129
  %131 = phi i32 [ %.pre, %._crit_edge ], [ 8, %129 ]
  %132 = getelementptr inbounds i8, ptr %0, i64 424
  %133 = load i32, ptr %132, align 8, !tbaa !40
  %134 = getelementptr inbounds i8, ptr %0, i64 432
  %135 = load i32, ptr %134, align 8, !tbaa !42
  %136 = getelementptr inbounds i8, ptr %0, i64 436
  %137 = load i32, ptr %136, align 4, !tbaa !41
  %138 = getelementptr inbounds i8, ptr %0, i64 440
  %139 = load i32, ptr %138, align 8, !tbaa !39
  %140 = call i32 @deflateInit2_(ptr noundef nonnull %90, i32 noundef %133, i32 noundef %131, i32 noundef %135, i32 noundef %137, i32 noundef %139, ptr noundef nonnull @.str.9, i32 noundef 112) #4
  switch i32 %140, label %143 [
    i32 0, label %144
    i32 -6, label %.sink.split144
    i32 -2, label %141
    i32 -4, label %142
  ]

141:                                              ; preds = %130
  br label %.sink.split144

142:                                              ; preds = %130
  br label %.sink.split144

.sink.split144:                                   ; preds = %130, %142, %141
  %.str.11.sink = phi ptr [ @.str.11, %141 ], [ @.str.12, %142 ], [ @.str.10, %130 ]
  call void @png_error(ptr noundef nonnull %0, ptr noundef nonnull %.str.11.sink) #4
  br label %143

143:                                              ; preds = %.sink.split144, %130
  call void @png_error(ptr noundef nonnull %0, ptr noundef nonnull @.str.13) #4
  br label %144

144:                                              ; preds = %130, %143
  %145 = getelementptr inbounds i8, ptr %0, i64 408
  %146 = load ptr, ptr %145, align 8, !tbaa !44
  %147 = getelementptr inbounds i8, ptr %0, i64 320
  store ptr %146, ptr %147, align 8, !tbaa !45
  %148 = getelementptr inbounds i8, ptr %0, i64 416
  %149 = load i64, ptr %148, align 8, !tbaa !46
  %150 = trunc i64 %149 to i32
  %151 = getelementptr inbounds i8, ptr %0, i64 328
  store i32 %150, ptr %151, align 8, !tbaa !47
  %152 = getelementptr inbounds i8, ptr %0, i64 384
  store i32 0, ptr %152, align 8, !tbaa !48
  %153 = getelementptr inbounds i8, ptr %0, i64 284
  store i32 1, ptr %153, align 4, !tbaa !20
  call void @llvm.lifetime.end.p0(i64 13, ptr nonnull %10) #4
  call void @llvm.lifetime.end.p0(i64 5, ptr nonnull %9) #4
  ret void
}

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

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

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

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

declare i32 @deflateInit2_(ptr noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef, ptr noundef, i32 noundef) local_unnamed_addr #3

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

!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, !7, i64 594}
!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 = !{!6, !10, i64 1032}
!20 = !{!6, !10, i64 284}
!21 = !{!6, !7, i64 591}
!22 = !{!6, !7, i64 590}
!23 = !{!6, !7, i64 587}
!24 = !{!6, !7, i64 1040}
!25 = !{!6, !7, i64 1104}
!26 = !{!6, !10, i64 444}
!27 = !{!6, !10, i64 448}
!28 = !{!6, !7, i64 593}
!29 = !{!6, !12, i64 464}
!30 = !{!6, !10, i64 456}
!31 = !{!6, !7, i64 592}
!32 = !{!6, !7, i64 595}
!33 = !{!7, !7, i64 0}
!34 = !{!6, !9, i64 360}
!35 = !{!6, !9, i64 368}
!36 = !{!6, !9, i64 376}
!37 = !{!6, !7, i64 589}
!38 = !{!6, !10, i64 288}
!39 = !{!6, !10, i64 440}
!40 = !{!6, !10, i64 424}
!41 = !{!6, !10, i64 436}
!42 = !{!6, !10, i64 432}
!43 = !{!6, !10, i64 428}
!44 = !{!6, !9, i64 408}
!45 = !{!6, !9, i64 320}
!46 = !{!6, !12, i64 416}
!47 = !{!6, !10, i64 328}
!48 = !{!6, !10, i64 384}


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