; LLVM IR from rdguez-mariano/fast_imas_IPOL :: io_png/libs/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, 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 }

@png_pass_yinc = external constant [7 x i32], align 16
@png_pass_ystart = external constant [7 x i32], align 16
@png_pass_inc = external constant [7 x i32], align 16
@png_pass_start = external constant [7 x i32], align 16

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

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

declare ptr @png_malloc(ptr noundef, i64 noundef) #1

; Function Attrs: nounwind uwtable
define dso_local void @png_write_start_row(ptr noundef %0) #2 {
  %2 = alloca ptr, align 8
  %3 = alloca i64, align 8
  store ptr %0, ptr %2, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %3) #4
  %4 = load ptr, ptr %2, align 8, !tbaa !5
  %5 = getelementptr inbounds %struct.png_struct_def, ptr %4, i32 0, i32 54
  %6 = load i8, ptr %5, align 1, !tbaa !9
  %7 = zext i8 %6 to i32
  %8 = load ptr, ptr %2, align 8, !tbaa !5
  %9 = getelementptr inbounds %struct.png_struct_def, ptr %8, i32 0, i32 51
  %10 = load i8, ptr %9, align 8, !tbaa !20
  %11 = zext i8 %10 to i32
  %12 = mul nsw i32 %7, %11
  %13 = icmp sge i32 %12, 8
  br i1 %13, label %14, label %30

14:                                               ; preds = %1
  %15 = load ptr, ptr %2, align 8, !tbaa !5
  %16 = getelementptr inbounds %struct.png_struct_def, ptr %15, i32 0, i32 23
  %17 = load i64, ptr %16, align 8, !tbaa !21
  %18 = load ptr, ptr %2, align 8, !tbaa !5
  %19 = getelementptr inbounds %struct.png_struct_def, ptr %18, i32 0, i32 54
  %20 = load i8, ptr %19, align 1, !tbaa !9
  %21 = zext i8 %20 to i32
  %22 = load ptr, ptr %2, align 8, !tbaa !5
  %23 = getelementptr inbounds %struct.png_struct_def, ptr %22, i32 0, i32 51
  %24 = load i8, ptr %23, align 8, !tbaa !20
  %25 = zext i8 %24 to i32
  %26 = mul nsw i32 %21, %25
  %27 = sext i32 %26 to i64
  %28 = lshr i64 %27, 3
  %29 = mul i64 %17, %28
  br label %47

30:                                               ; preds = %1
  %31 = load ptr, ptr %2, align 8, !tbaa !5
  %32 = getelementptr inbounds %struct.png_struct_def, ptr %31, i32 0, i32 23
  %33 = load i64, ptr %32, align 8, !tbaa !21
  %34 = load ptr, ptr %2, align 8, !tbaa !5
  %35 = getelementptr inbounds %struct.png_struct_def, ptr %34, i32 0, i32 54
  %36 = load i8, ptr %35, align 1, !tbaa !9
  %37 = zext i8 %36 to i32
  %38 = load ptr, ptr %2, align 8, !tbaa !5
  %39 = getelementptr inbounds %struct.png_struct_def, ptr %38, i32 0, i32 51
  %40 = load i8, ptr %39, align 8, !tbaa !20
  %41 = zext i8 %40 to i32
  %42 = mul nsw i32 %37, %41
  %43 = sext i32 %42 to i64
  %44 = mul i64 %33, %43
  %45 = add i64 %44, 7
  %46 = lshr i64 %45, 3
  br label %47

47:                                               ; preds = %30, %14
  %48 = phi i64 [ %29, %14 ], [ %46, %30 ]
  %49 = add i64 %48, 1
  store i64 %49, ptr %3, align 8, !tbaa !22
  %50 = load ptr, ptr %2, align 8, !tbaa !5
  %51 = load i64, ptr %3, align 8, !tbaa !22
  %52 = call ptr @png_malloc(ptr noundef %50, i64 noundef %51)
  %53 = load ptr, ptr %2, align 8, !tbaa !5
  %54 = getelementptr inbounds %struct.png_struct_def, ptr %53, i32 0, i32 32
  store ptr %52, ptr %54, align 8, !tbaa !23
  %55 = load ptr, ptr %2, align 8, !tbaa !5
  %56 = getelementptr inbounds %struct.png_struct_def, ptr %55, i32 0, i32 32
  %57 = load ptr, ptr %56, align 8, !tbaa !23
  %58 = getelementptr inbounds i8, ptr %57, i64 0
  store i8 0, ptr %58, align 1, !tbaa !24
  %59 = load ptr, ptr %2, align 8, !tbaa !5
  %60 = getelementptr inbounds %struct.png_struct_def, ptr %59, i32 0, i32 48
  %61 = load i8, ptr %60, align 1, !tbaa !25
  %62 = zext i8 %61 to i32
  %63 = and i32 %62, 16
  %64 = icmp ne i32 %63, 0
  br i1 %64, label %65, label %78

65:                                               ; preds = %47
  %66 = load ptr, ptr %2, align 8, !tbaa !5
  %67 = load ptr, ptr %2, align 8, !tbaa !5
  %68 = getelementptr inbounds %struct.png_struct_def, ptr %67, i32 0, i32 27
  %69 = load i64, ptr %68, align 8, !tbaa !26
  %70 = add i64 %69, 1
  %71 = call ptr @png_malloc(ptr noundef %66, i64 noundef %70)
  %72 = load ptr, ptr %2, align 8, !tbaa !5
  %73 = getelementptr inbounds %struct.png_struct_def, ptr %72, i32 0, i32 33
  store ptr %71, ptr %73, align 8, !tbaa !27
  %74 = load ptr, ptr %2, align 8, !tbaa !5
  %75 = getelementptr inbounds %struct.png_struct_def, ptr %74, i32 0, i32 33
  %76 = load ptr, ptr %75, align 8, !tbaa !27
  %77 = getelementptr inbounds i8, ptr %76, i64 0
  store i8 1, ptr %77, align 1, !tbaa !24
  br label %78

78:                                               ; preds = %65, %47
  %79 = load ptr, ptr %2, align 8, !tbaa !5
  %80 = getelementptr inbounds %struct.png_struct_def, ptr %79, i32 0, i32 48
  %81 = load i8, ptr %80, align 1, !tbaa !25
  %82 = zext i8 %81 to i32
  %83 = and i32 %82, 224
  %84 = icmp ne i32 %83, 0
  br i1 %84, label %85, label %155

85:                                               ; preds = %78
  %86 = load ptr, ptr %2, align 8, !tbaa !5
  %87 = load i64, ptr %3, align 8, !tbaa !22
  %88 = call ptr @png_malloc(ptr noundef %86, i64 noundef %87)
  %89 = load ptr, ptr %2, align 8, !tbaa !5
  %90 = getelementptr inbounds %struct.png_struct_def, ptr %89, i32 0, i32 31
  store ptr %88, ptr %90, align 8, !tbaa !28
  %91 = load ptr, ptr %2, align 8, !tbaa !5
  %92 = getelementptr inbounds %struct.png_struct_def, ptr %91, i32 0, i32 31
  %93 = load ptr, ptr %92, align 8, !tbaa !28
  %94 = load i64, ptr %3, align 8, !tbaa !22
  call void @llvm.memset.p0.i64(ptr align 1 %93, i8 0, i64 %94, i1 false)
  %95 = load ptr, ptr %2, align 8, !tbaa !5
  %96 = getelementptr inbounds %struct.png_struct_def, ptr %95, i32 0, i32 48
  %97 = load i8, ptr %96, align 1, !tbaa !25
  %98 = zext i8 %97 to i32
  %99 = and i32 %98, 32
  %100 = icmp ne i32 %99, 0
  br i1 %100, label %101, label %114

101:                                              ; preds = %85
  %102 = load ptr, ptr %2, align 8, !tbaa !5
  %103 = load ptr, ptr %2, align 8, !tbaa !5
  %104 = getelementptr inbounds %struct.png_struct_def, ptr %103, i32 0, i32 27
  %105 = load i64, ptr %104, align 8, !tbaa !26
  %106 = add i64 %105, 1
  %107 = call ptr @png_malloc(ptr noundef %102, i64 noundef %106)
  %108 = load ptr, ptr %2, align 8, !tbaa !5
  %109 = getelementptr inbounds %struct.png_struct_def, ptr %108, i32 0, i32 34
  store ptr %107, ptr %109, align 8, !tbaa !29
  %110 = load ptr, ptr %2, align 8, !tbaa !5
  %111 = getelementptr inbounds %struct.png_struct_def, ptr %110, i32 0, i32 34
  %112 = load ptr, ptr %111, align 8, !tbaa !29
  %113 = getelementptr inbounds i8, ptr %112, i64 0
  store i8 2, ptr %113, align 1, !tbaa !24
  br label %114

114:                                              ; preds = %101, %85
  %115 = load ptr, ptr %2, align 8, !tbaa !5
  %116 = getelementptr inbounds %struct.png_struct_def, ptr %115, i32 0, i32 48
  %117 = load i8, ptr %116, align 1, !tbaa !25
  %118 = zext i8 %117 to i32
  %119 = and i32 %118, 64
  %120 = icmp ne i32 %119, 0
  br i1 %120, label %121, label %134

121:                                              ; preds = %114
  %122 = load ptr, ptr %2, align 8, !tbaa !5
  %123 = load ptr, ptr %2, align 8, !tbaa !5
  %124 = getelementptr inbounds %struct.png_struct_def, ptr %123, i32 0, i32 27
  %125 = load i64, ptr %124, align 8, !tbaa !26
  %126 = add i64 %125, 1
  %127 = call ptr @png_malloc(ptr noundef %122, i64 noundef %126)
  %128 = load ptr, ptr %2, align 8, !tbaa !5
  %129 = getelementptr inbounds %struct.png_struct_def, ptr %128, i32 0, i32 35
  store ptr %127, ptr %129, align 8, !tbaa !30
  %130 = load ptr, ptr %2, align 8, !tbaa !5
  %131 = getelementptr inbounds %struct.png_struct_def, ptr %130, i32 0, i32 35
  %132 = load ptr, ptr %131, align 8, !tbaa !30
  %133 = getelementptr inbounds i8, ptr %132, i64 0
  store i8 3, ptr %133, align 1, !tbaa !24
  br label %134

134:                                              ; preds = %121, %114
  %135 = load ptr, ptr %2, align 8, !tbaa !5
  %136 = getelementptr inbounds %struct.png_struct_def, ptr %135, i32 0, i32 48
  %137 = load i8, ptr %136, align 1, !tbaa !25
  %138 = zext i8 %137 to i32
  %139 = and i32 %138, 128
  %140 = icmp ne i32 %139, 0
  br i1 %140, label %141, label %154

141:                                              ; preds = %134
  %142 = load ptr, ptr %2, align 8, !tbaa !5
  %143 = load ptr, ptr %2, align 8, !tbaa !5
  %144 = getelementptr inbounds %struct.png_struct_def, ptr %143, i32 0, i32 27
  %145 = load i64, ptr %144, align 8, !tbaa !26
  %146 = add i64 %145, 1
  %147 = call ptr @png_malloc(ptr noundef %142, i64 noundef %146)
  %148 = load ptr, ptr %2, align 8, !tbaa !5
  %149 = getelementptr inbounds %struct.png_struct_def, ptr %148, i32 0, i32 36
  store ptr %147, ptr %149, align 8, !tbaa !31
  %150 = load ptr, ptr %2, align 8, !tbaa !5
  %151 = getelementptr inbounds %struct.png_struct_def, ptr %150, i32 0, i32 36
  %152 = load ptr, ptr %151, align 8, !tbaa !31
  %153 = getelementptr inbounds i8, ptr %152, i64 0
  store i8 4, ptr %153, align 1, !tbaa !24
  br label %154

154:                                              ; preds = %141, %134
  br label %155

155:                                              ; preds = %154, %78
  %156 = load ptr, ptr %2, align 8, !tbaa !5
  %157 = getelementptr inbounds %struct.png_struct_def, ptr %156, i32 0, i32 46
  %158 = load i8, ptr %157, align 1, !tbaa !32
  %159 = icmp ne i8 %158, 0
  br i1 %159, label %160, label %209

160:                                              ; preds = %155
  %161 = load ptr, ptr %2, align 8, !tbaa !5
  %162 = getelementptr inbounds %struct.png_struct_def, ptr %161, i32 0, i32 14
  %163 = load i64, ptr %162, align 8, !tbaa !33
  %164 = and i64 %163, 2
  %165 = icmp ne i64 %164, 0
  br i1 %165, label %197, label %166

166:                                              ; preds = %160
  %167 = load ptr, ptr %2, align 8, !tbaa !5
  %168 = getelementptr inbounds %struct.png_struct_def, ptr %167, i32 0, i32 24
  %169 = load i64, ptr %168, align 8, !tbaa !34
  %170 = load i32, ptr @png_pass_yinc, align 16, !tbaa !35
  %171 = sext i32 %170 to i64
  %172 = add i64 %169, %171
  %173 = sub i64 %172, 1
  %174 = load i32, ptr @png_pass_ystart, align 16, !tbaa !35
  %175 = sext i32 %174 to i64
  %176 = sub i64 %173, %175
  %177 = load i32, ptr @png_pass_yinc, align 16, !tbaa !35
  %178 = sext i32 %177 to i64
  %179 = udiv i64 %176, %178
  %180 = load ptr, ptr %2, align 8, !tbaa !5
  %181 = getelementptr inbounds %struct.png_struct_def, ptr %180, i32 0, i32 25
  store i64 %179, ptr %181, align 8, !tbaa !36
  %182 = load ptr, ptr %2, align 8, !tbaa !5
  %183 = getelementptr inbounds %struct.png_struct_def, ptr %182, i32 0, i32 23
  %184 = load i64, ptr %183, align 8, !tbaa !21
  %185 = load i32, ptr @png_pass_inc, align 16, !tbaa !35
  %186 = sext i32 %185 to i64
  %187 = add i64 %184, %186
  %188 = sub i64 %187, 1
  %189 = load i32, ptr @png_pass_start, align 16, !tbaa !35
  %190 = sext i32 %189 to i64
  %191 = sub i64 %188, %190
  %192 = load i32, ptr @png_pass_inc, align 16, !tbaa !35
  %193 = sext i32 %192 to i64
  %194 = udiv i64 %191, %193
  %195 = load ptr, ptr %2, align 8, !tbaa !5
  %196 = getelementptr inbounds %struct.png_struct_def, ptr %195, i32 0, i32 26
  store i64 %194, ptr %196, align 8, !tbaa !37
  br label %208

197:                                              ; preds = %160
  %198 = load ptr, ptr %2, align 8, !tbaa !5
  %199 = getelementptr inbounds %struct.png_struct_def, ptr %198, i32 0, i32 24
  %200 = load i64, ptr %199, align 8, !tbaa !34
  %201 = load ptr, ptr %2, align 8, !tbaa !5
  %202 = getelementptr inbounds %struct.png_struct_def, ptr %201, i32 0, i32 25
  store i64 %200, ptr %202, align 8, !tbaa !36
  %203 = load ptr, ptr %2, align 8, !tbaa !5
  %204 = getelementptr inbounds %struct.png_struct_def, ptr %203, i32 0, i32 23
  %205 = load i64, ptr %204, align 8, !tbaa !21
  %206 = load ptr, ptr %2, align 8, !tbaa !5
  %207 = getelementptr inbounds %struct.png_struct_def, ptr %206, i32 0, i32 26
  store i64 %205, ptr %207, align 8, !tbaa !37
  br label %208

208:                                              ; preds = %197, %166
  br label %220

209:                                              ; preds = %155
  %210 = load ptr, ptr %2, align 8, !tbaa !5
  %211 = getelementptr inbounds %struct.png_struct_def, ptr %210, i32 0, i32 24
  %212 = load i64, ptr %211, align 8, !tbaa !34
  %213 = load ptr, ptr %2, align 8, !tbaa !5
  %214 = getelementptr inbounds %struct.png_struct_def, ptr %213, i32 0, i32 25
  store i64 %212, ptr %214, align 8, !tbaa !36
  %215 = load ptr, ptr %2, align 8, !tbaa !5
  %216 = getelementptr inbounds %struct.png_struct_def, ptr %215, i32 0, i32 23
  %217 = load i64, ptr %216, align 8, !tbaa !21
  %218 = load ptr, ptr %2, align 8, !tbaa !5
  %219 = getelementptr inbounds %struct.png_struct_def, ptr %218, i32 0, i32 26
  store i64 %217, ptr %219, align 8, !tbaa !37
  br label %220

220:                                              ; preds = %209, %208
  %221 = load ptr, ptr %2, align 8, !tbaa !5
  %222 = getelementptr inbounds %struct.png_struct_def, ptr %221, i32 0, i32 17
  %223 = load i64, ptr %222, align 8, !tbaa !38
  %224 = trunc i64 %223 to i32
  %225 = load ptr, ptr %2, align 8, !tbaa !5
  %226 = getelementptr inbounds %struct.png_struct_def, ptr %225, i32 0, i32 15
  %227 = getelementptr inbounds %struct.z_stream_s, ptr %226, i32 0, i32 4
  store i32 %224, ptr %227, align 8, !tbaa !39
  %228 = load ptr, ptr %2, align 8, !tbaa !5
  %229 = getelementptr inbounds %struct.png_struct_def, ptr %228, i32 0, i32 16
  %230 = load ptr, ptr %229, align 8, !tbaa !40
  %231 = load ptr, ptr %2, align 8, !tbaa !5
  %232 = getelementptr inbounds %struct.png_struct_def, ptr %231, i32 0, i32 15
  %233 = getelementptr inbounds %struct.z_stream_s, ptr %232, i32 0, i32 3
  store ptr %230, ptr %233, align 8, !tbaa !41
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #4
  ret void
}

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

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 = { nocallback nofree nounwind willreturn memory(argmem: write) }
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, !7, i64 635}
!10 = !{!"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, !11, i64 280, !11, i64 288, !11, i64 296, !12, i64 304, !6, i64 416, !11, i64 424, !13, i64 432, !13, i64 436, !13, i64 440, !13, i64 444, !13, i64 448, !11, i64 456, !11, i64 464, !11, i64 472, !11, i64 480, !11, i64 488, !11, i64 496, !11, i64 504, !11, i64 512, !6, i64 520, !6, i64 528, !6, i64 536, !6, i64 544, !6, i64 552, !6, i64 560, !14, i64 568, !11, i64 592, !11, i64 600, !6, i64 608, !15, i64 616, !15, 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, !15, i64 638, !7, i64 640, !16, i64 644, !17, i64 648, !17, i64 658, !6, i64 672, !11, i64 680, !11, i64 688, !13, i64 696, !16, i64 700, !16, i64 704, !6, i64 712, !6, i64 720, !6, i64 728, !6, i64 736, !6, i64 744, !6, i64 752, !18, i64 760, !18, i64 765, !6, i64 776, !17, 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, !11, i64 872, !11, i64 880, !11, i64 888, !11, i64 896, !11, i64 904, !11, i64 912, !13, i64 920, !13, i64 924, !11, i64 928, !11, 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, !11, i64 1040, !6, i64 1048, !6, i64 1056, !13, i64 1064, !6, i64 1072, !7, i64 1080, !15, i64 1082, !15, i64 1084, !15, i64 1086, !11, i64 1088, !11, i64 1096, !7, i64 1104, !7, i64 1105, !11, i64 1112, !11, 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, !11, i64 1192, !11, i64 1200, !19, i64 1208, !11, i64 1240, !11, i64 1248, !6, i64 1256}
!11 = !{!"long", !7, i64 0}
!12 = !{!"z_stream_s", !6, i64 0, !13, i64 8, !11, i64 16, !6, i64 24, !13, i64 32, !11, i64 40, !6, i64 48, !6, i64 56, !6, i64 64, !6, i64 72, !6, i64 80, !13, i64 88, !11, i64 96, !11, i64 104}
!13 = !{!"int", !7, i64 0}
!14 = !{!"png_row_info_struct", !11, i64 0, !11, i64 8, !7, i64 16, !7, i64 17, !7, i64 18, !7, i64 19}
!15 = !{!"short", !7, i64 0}
!16 = !{!"float", !7, i64 0}
!17 = !{!"png_color_16_struct", !7, i64 0, !15, i64 2, !15, i64 4, !15, i64 6, !15, i64 8}
!18 = !{!"png_color_8_struct", !7, i64 0, !7, i64 1, !7, i64 2, !7, i64 3, !7, i64 4}
!19 = !{!"png_unknown_chunk_t", !7, i64 0, !6, i64 8, !11, i64 16, !7, i64 24}
!20 = !{!10, !7, i64 632}
!21 = !{!10, !11, i64 456}
!22 = !{!11, !11, i64 0}
!23 = !{!10, !6, i64 528}
!24 = !{!7, !7, i64 0}
!25 = !{!10, !7, i64 629}
!26 = !{!10, !11, i64 488}
!27 = !{!10, !6, i64 536}
!28 = !{!10, !6, i64 520}
!29 = !{!10, !6, i64 544}
!30 = !{!10, !6, i64 552}
!31 = !{!10, !6, i64 560}
!32 = !{!10, !7, i64 627}
!33 = !{!10, !11, i64 296}
!34 = !{!10, !11, i64 464}
!35 = !{!13, !13, i64 0}
!36 = !{!10, !11, i64 472}
!37 = !{!10, !11, i64 480}
!38 = !{!10, !11, i64 424}
!39 = !{!10, !13, i64 336}
!40 = !{!10, !6, i64 416}
!41 = !{!10, !6, i64 328}


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

@png_pass_yinc = external local_unnamed_addr constant [7 x i32], align 16
@png_pass_ystart = external local_unnamed_addr constant [7 x i32], align 16
@png_pass_inc = external local_unnamed_addr constant [7 x i32], align 16
@png_pass_start = external local_unnamed_addr constant [7 x i32], align 16

declare ptr @png_malloc(ptr noundef, i64 noundef) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
define dso_local void @png_write_start_row(ptr noundef %0) local_unnamed_addr #1 {
  %2 = getelementptr inbounds i8, ptr %0, i64 635
  %3 = load i8, ptr %2, align 1, !tbaa !5
  %4 = zext i8 %3 to i32
  %5 = getelementptr inbounds i8, ptr %0, i64 632
  %6 = load i8, ptr %5, align 8, !tbaa !19
  %7 = zext i8 %6 to i32
  %8 = mul nuw nsw i32 %7, %4
  %9 = icmp ugt i32 %8, 7
  %10 = getelementptr inbounds i8, ptr %0, i64 456
  %11 = load i64, ptr %10, align 8, !tbaa !20
  br i1 %9, label %12, label %16

12:                                               ; preds = %1
  %13 = lshr i32 %8, 3
  %14 = zext nneg i32 %13 to i64
  %15 = mul i64 %11, %14
  br label %21

16:                                               ; preds = %1
  %17 = zext nneg i32 %8 to i64
  %18 = mul i64 %11, %17
  %19 = add i64 %18, 7
  %20 = lshr i64 %19, 3
  br label %21

21:                                               ; preds = %16, %12
  %22 = phi i64 [ %15, %12 ], [ %20, %16 ]
  %23 = add i64 %22, 1
  %24 = tail call ptr @png_malloc(ptr noundef nonnull %0, i64 noundef %23) #3
  %25 = getelementptr inbounds i8, ptr %0, i64 528
  store ptr %24, ptr %25, align 8, !tbaa !21
  store i8 0, ptr %24, align 1, !tbaa !22
  %26 = getelementptr inbounds i8, ptr %0, i64 629
  %27 = load i8, ptr %26, align 1, !tbaa !23
  %28 = and i8 %27, 16
  %.not = icmp eq i8 %28, 0
  br i1 %.not, label %35, label %29

29:                                               ; preds = %21
  %30 = getelementptr inbounds i8, ptr %0, i64 488
  %31 = load i64, ptr %30, align 8, !tbaa !24
  %32 = add i64 %31, 1
  %33 = tail call ptr @png_malloc(ptr noundef nonnull %0, i64 noundef %32) #3
  %34 = getelementptr inbounds i8, ptr %0, i64 536
  store ptr %33, ptr %34, align 8, !tbaa !25
  store i8 1, ptr %33, align 1, !tbaa !22
  %.pr = load i8, ptr %26, align 1, !tbaa !23
  br label %35

35:                                               ; preds = %29, %21
  %36 = phi i8 [ %.pr, %29 ], [ %27, %21 ]
  %.not55 = icmp ult i8 %36, 32
  br i1 %.not55, label %65, label %37

37:                                               ; preds = %35
  %38 = tail call ptr @png_malloc(ptr noundef nonnull %0, i64 noundef %23) #3
  %39 = getelementptr inbounds i8, ptr %0, i64 520
  store ptr %38, ptr %39, align 8, !tbaa !26
  tail call void @llvm.memset.p0.i64(ptr align 1 %38, i8 0, i64 %23, i1 false)
  %40 = load i8, ptr %26, align 1, !tbaa !23
  %41 = and i8 %40, 32
  %.not56 = icmp eq i8 %41, 0
  br i1 %.not56, label %48, label %42

42:                                               ; preds = %37
  %43 = getelementptr inbounds i8, ptr %0, i64 488
  %44 = load i64, ptr %43, align 8, !tbaa !24
  %45 = add i64 %44, 1
  %46 = tail call ptr @png_malloc(ptr noundef nonnull %0, i64 noundef %45) #3
  %47 = getelementptr inbounds i8, ptr %0, i64 544
  store ptr %46, ptr %47, align 8, !tbaa !27
  store i8 2, ptr %46, align 1, !tbaa !22
  %.pre = load i8, ptr %26, align 1, !tbaa !23
  br label %48

48:                                               ; preds = %42, %37
  %49 = phi i8 [ %.pre, %42 ], [ %40, %37 ]
  %50 = and i8 %49, 64
  %.not57 = icmp eq i8 %50, 0
  br i1 %.not57, label %57, label %51

51:                                               ; preds = %48
  %52 = getelementptr inbounds i8, ptr %0, i64 488
  %53 = load i64, ptr %52, align 8, !tbaa !24
  %54 = add i64 %53, 1
  %55 = tail call ptr @png_malloc(ptr noundef nonnull %0, i64 noundef %54) #3
  %56 = getelementptr inbounds i8, ptr %0, i64 552
  store ptr %55, ptr %56, align 8, !tbaa !28
  store i8 3, ptr %55, align 1, !tbaa !22
  %.pr61 = load i8, ptr %26, align 1, !tbaa !23
  br label %57

57:                                               ; preds = %51, %48
  %58 = phi i8 [ %.pr61, %51 ], [ %49, %48 ]
  %.not58 = icmp sgt i8 %58, -1
  br i1 %.not58, label %65, label %59

59:                                               ; preds = %57
  %60 = getelementptr inbounds i8, ptr %0, i64 488
  %61 = load i64, ptr %60, align 8, !tbaa !24
  %62 = add i64 %61, 1
  %63 = tail call ptr @png_malloc(ptr noundef nonnull %0, i64 noundef %62) #3
  %64 = getelementptr inbounds i8, ptr %0, i64 560
  store ptr %63, ptr %64, align 8, !tbaa !29
  store i8 4, ptr %63, align 1, !tbaa !22
  br label %65

65:                                               ; preds = %57, %59, %35
  %66 = getelementptr inbounds i8, ptr %0, i64 627
  %67 = load i8, ptr %66, align 1, !tbaa !30
  %.not59 = icmp eq i8 %67, 0
  br i1 %.not59, label %98, label %68

68:                                               ; preds = %65
  %69 = getelementptr inbounds i8, ptr %0, i64 296
  %70 = load i64, ptr %69, align 8, !tbaa !31
  %71 = and i64 %70, 2
  %.not60 = icmp eq i64 %71, 0
  %72 = getelementptr inbounds i8, ptr %0, i64 464
  %73 = load i64, ptr %72, align 8, !tbaa !32
  br i1 %.not60, label %74, label %94

74:                                               ; preds = %68
  %75 = load i32, ptr @png_pass_yinc, align 16, !tbaa !33
  %76 = sext i32 %75 to i64
  %77 = add i64 %73, %76
  %78 = load i32, ptr @png_pass_ystart, align 16, !tbaa !33
  %79 = xor i32 %78, -1
  %80 = sext i32 %79 to i64
  %81 = add i64 %77, %80
  %82 = udiv i64 %81, %76
  %83 = getelementptr inbounds i8, ptr %0, i64 472
  store i64 %82, ptr %83, align 8, !tbaa !34
  %84 = getelementptr inbounds i8, ptr %0, i64 456
  %85 = load i64, ptr %84, align 8, !tbaa !20
  %86 = load i32, ptr @png_pass_inc, align 16, !tbaa !33
  %87 = sext i32 %86 to i64
  %88 = add i64 %85, %87
  %89 = load i32, ptr @png_pass_start, align 16, !tbaa !33
  %90 = xor i32 %89, -1
  %91 = sext i32 %90 to i64
  %92 = add i64 %88, %91
  %93 = udiv i64 %92, %87
  br label %104

94:                                               ; preds = %68
  %95 = getelementptr inbounds i8, ptr %0, i64 472
  store i64 %73, ptr %95, align 8, !tbaa !34
  %96 = getelementptr inbounds i8, ptr %0, i64 456
  %97 = load i64, ptr %96, align 8, !tbaa !20
  br label %104

98:                                               ; preds = %65
  %99 = getelementptr inbounds i8, ptr %0, i64 464
  %100 = load i64, ptr %99, align 8, !tbaa !32
  %101 = getelementptr inbounds i8, ptr %0, i64 472
  store i64 %100, ptr %101, align 8, !tbaa !34
  %102 = getelementptr inbounds i8, ptr %0, i64 456
  %103 = load i64, ptr %102, align 8, !tbaa !20
  br label %104

104:                                              ; preds = %74, %94, %98
  %.sink = phi i64 [ %93, %74 ], [ %97, %94 ], [ %103, %98 ]
  %105 = getelementptr inbounds i8, ptr %0, i64 480
  store i64 %.sink, ptr %105, align 8, !tbaa !35
  %106 = getelementptr inbounds i8, ptr %0, i64 424
  %107 = load i64, ptr %106, align 8, !tbaa !36
  %108 = trunc i64 %107 to i32
  %109 = getelementptr inbounds i8, ptr %0, i64 336
  store i32 %108, ptr %109, align 8, !tbaa !37
  %110 = getelementptr inbounds i8, ptr %0, i64 416
  %111 = load ptr, ptr %110, align 8, !tbaa !38
  %112 = getelementptr inbounds i8, ptr %0, i64 328
  store ptr %111, ptr %112, align 8, !tbaa !39
  ret void
}

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

attributes #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 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
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, !7, i64 635}
!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 632}
!20 = !{!6, !10, i64 456}
!21 = !{!6, !9, i64 528}
!22 = !{!7, !7, i64 0}
!23 = !{!6, !7, i64 629}
!24 = !{!6, !10, i64 488}
!25 = !{!6, !9, i64 536}
!26 = !{!6, !9, i64 520}
!27 = !{!6, !9, i64 544}
!28 = !{!6, !9, i64 552}
!29 = !{!6, !9, i64 560}
!30 = !{!6, !7, i64 627}
!31 = !{!6, !10, i64 296}
!32 = !{!6, !10, i64 464}
!33 = !{!12, !12, i64 0}
!34 = !{!6, !10, i64 472}
!35 = !{!6, !10, i64 480}
!36 = !{!6, !10, i64 424}
!37 = !{!6, !12, i64 336}
!38 = !{!6, !9, i64 416}
!39 = !{!6, !9, i64 328}


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