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

; 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_text_struct = type { i32, ptr, ptr, i64 }

@.str.3 = external hidden unnamed_addr constant [35 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [27 x i8], align 1

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

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

declare i32 @png_handle_as_unknown(ptr noundef, ptr noundef) #0

declare void @png_write_chunk(ptr noundef, ptr noundef, ptr noundef, i64 noundef) #0

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

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

declare void @png_write_tIME(ptr noundef, ptr noundef) #0

declare void @png_write_zTXt(ptr noundef, ptr noundef, ptr noundef, i64 noundef, i32 noundef) #0

declare void @png_write_tEXt(ptr noundef, ptr noundef, ptr noundef, i64 noundef) #0

; Function Attrs: nounwind uwtable
define dso_local void @png_write_end(ptr noundef %0, ptr noundef %1) #2 {
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca i32, align 4
  %6 = alloca ptr, align 8
  %7 = alloca i32, align 4
  store ptr %0, ptr %3, align 8, !tbaa !5
  store ptr %1, ptr %4, align 8, !tbaa !5
  %8 = load ptr, ptr %3, align 8, !tbaa !5
  %9 = icmp eq ptr %8, null
  br i1 %9, label %10, label %11

10:                                               ; preds = %2
  br label %228

11:                                               ; preds = %2
  %12 = load ptr, ptr %3, align 8, !tbaa !5
  %13 = getelementptr inbounds %struct.png_struct_def, ptr %12, i32 0, i32 12
  %14 = load i64, ptr %13, align 8, !tbaa !9
  %15 = and i64 %14, 4
  %16 = icmp ne i64 %15, 0
  br i1 %16, label %19, label %17

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

19:                                               ; preds = %17, %11
  %20 = load ptr, ptr %4, align 8, !tbaa !5
  %21 = icmp ne ptr %20, null
  br i1 %21, label %22, label %222

22:                                               ; preds = %19
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #3
  %23 = load ptr, ptr %4, align 8, !tbaa !5
  %24 = getelementptr inbounds %struct.png_info_struct, ptr %23, i32 0, i32 2
  %25 = load i64, ptr %24, align 8, !tbaa !20
  %26 = and i64 %25, 512
  %27 = icmp ne i64 %26, 0
  br i1 %27, label %28, label %38

28:                                               ; preds = %22
  %29 = load ptr, ptr %3, align 8, !tbaa !5
  %30 = getelementptr inbounds %struct.png_struct_def, ptr %29, i32 0, i32 12
  %31 = load i64, ptr %30, align 8, !tbaa !9
  %32 = and i64 %31, 512
  %33 = icmp ne i64 %32, 0
  br i1 %33, label %38, label %34

34:                                               ; preds = %28
  %35 = load ptr, ptr %3, align 8, !tbaa !5
  %36 = load ptr, ptr %4, align 8, !tbaa !5
  %37 = getelementptr inbounds %struct.png_info_struct, ptr %36, i32 0, i32 21
  call void @png_write_tIME(ptr noundef %35, ptr noundef %37)
  br label %38

38:                                               ; preds = %34, %28, %22
  store i32 0, ptr %5, align 4, !tbaa !24
  br label %39

39:                                               ; preds = %145, %38
  %40 = load i32, ptr %5, align 4, !tbaa !24
  %41 = load ptr, ptr %4, align 8, !tbaa !5
  %42 = getelementptr inbounds %struct.png_info_struct, ptr %41, i32 0, i32 18
  %43 = load i32, ptr %42, align 4, !tbaa !25
  %44 = icmp slt i32 %40, %43
  br i1 %44, label %45, label %148

45:                                               ; preds = %39
  %46 = load ptr, ptr %4, align 8, !tbaa !5
  %47 = getelementptr inbounds %struct.png_info_struct, ptr %46, i32 0, i32 20
  %48 = load ptr, ptr %47, align 8, !tbaa !26
  %49 = load i32, ptr %5, align 4, !tbaa !24
  %50 = sext i32 %49 to i64
  %51 = getelementptr inbounds %struct.png_text_struct, ptr %48, i64 %50
  %52 = getelementptr inbounds %struct.png_text_struct, ptr %51, i32 0, i32 0
  %53 = load i32, ptr %52, align 8, !tbaa !27
  %54 = icmp sgt i32 %53, 0
  br i1 %54, label %55, label %64

55:                                               ; preds = %45
  %56 = load ptr, ptr %3, align 8, !tbaa !5
  call void @png_warning(ptr noundef %56, ptr noundef @.str.3)
  %57 = load ptr, ptr %4, align 8, !tbaa !5
  %58 = getelementptr inbounds %struct.png_info_struct, ptr %57, i32 0, i32 20
  %59 = load ptr, ptr %58, align 8, !tbaa !26
  %60 = load i32, ptr %5, align 4, !tbaa !24
  %61 = sext i32 %60 to i64
  %62 = getelementptr inbounds %struct.png_text_struct, ptr %59, i64 %61
  %63 = getelementptr inbounds %struct.png_text_struct, ptr %62, i32 0, i32 0
  store i32 -3, ptr %63, align 8, !tbaa !27
  br label %144

64:                                               ; preds = %45
  %65 = load ptr, ptr %4, align 8, !tbaa !5
  %66 = getelementptr inbounds %struct.png_info_struct, ptr %65, i32 0, i32 20
  %67 = load ptr, ptr %66, align 8, !tbaa !26
  %68 = load i32, ptr %5, align 4, !tbaa !24
  %69 = sext i32 %68 to i64
  %70 = getelementptr inbounds %struct.png_text_struct, ptr %67, i64 %69
  %71 = getelementptr inbounds %struct.png_text_struct, ptr %70, i32 0, i32 0
  %72 = load i32, ptr %71, align 8, !tbaa !27
  %73 = icmp sge i32 %72, 0
  br i1 %73, label %74, label %107

74:                                               ; preds = %64
  %75 = load ptr, ptr %3, align 8, !tbaa !5
  %76 = load ptr, ptr %4, align 8, !tbaa !5
  %77 = getelementptr inbounds %struct.png_info_struct, ptr %76, i32 0, i32 20
  %78 = load ptr, ptr %77, align 8, !tbaa !26
  %79 = load i32, ptr %5, align 4, !tbaa !24
  %80 = sext i32 %79 to i64
  %81 = getelementptr inbounds %struct.png_text_struct, ptr %78, i64 %80
  %82 = getelementptr inbounds %struct.png_text_struct, ptr %81, i32 0, i32 1
  %83 = load ptr, ptr %82, align 8, !tbaa !29
  %84 = load ptr, ptr %4, align 8, !tbaa !5
  %85 = getelementptr inbounds %struct.png_info_struct, ptr %84, i32 0, i32 20
  %86 = load ptr, ptr %85, align 8, !tbaa !26
  %87 = load i32, ptr %5, align 4, !tbaa !24
  %88 = sext i32 %87 to i64
  %89 = getelementptr inbounds %struct.png_text_struct, ptr %86, i64 %88
  %90 = getelementptr inbounds %struct.png_text_struct, ptr %89, i32 0, i32 2
  %91 = load ptr, ptr %90, align 8, !tbaa !30
  %92 = load ptr, ptr %4, align 8, !tbaa !5
  %93 = getelementptr inbounds %struct.png_info_struct, ptr %92, i32 0, i32 20
  %94 = load ptr, ptr %93, align 8, !tbaa !26
  %95 = load i32, ptr %5, align 4, !tbaa !24
  %96 = sext i32 %95 to i64
  %97 = getelementptr inbounds %struct.png_text_struct, ptr %94, i64 %96
  %98 = getelementptr inbounds %struct.png_text_struct, ptr %97, i32 0, i32 0
  %99 = load i32, ptr %98, align 8, !tbaa !27
  call void @png_write_zTXt(ptr noundef %75, ptr noundef %83, ptr noundef %91, i64 noundef 0, i32 noundef %99)
  %100 = load ptr, ptr %4, align 8, !tbaa !5
  %101 = getelementptr inbounds %struct.png_info_struct, ptr %100, i32 0, i32 20
  %102 = load ptr, ptr %101, align 8, !tbaa !26
  %103 = load i32, ptr %5, align 4, !tbaa !24
  %104 = sext i32 %103 to i64
  %105 = getelementptr inbounds %struct.png_text_struct, ptr %102, i64 %104
  %106 = getelementptr inbounds %struct.png_text_struct, ptr %105, i32 0, i32 0
  store i32 -2, ptr %106, align 8, !tbaa !27
  br label %143

107:                                              ; preds = %64
  %108 = load ptr, ptr %4, align 8, !tbaa !5
  %109 = getelementptr inbounds %struct.png_info_struct, ptr %108, i32 0, i32 20
  %110 = load ptr, ptr %109, align 8, !tbaa !26
  %111 = load i32, ptr %5, align 4, !tbaa !24
  %112 = sext i32 %111 to i64
  %113 = getelementptr inbounds %struct.png_text_struct, ptr %110, i64 %112
  %114 = getelementptr inbounds %struct.png_text_struct, ptr %113, i32 0, i32 0
  %115 = load i32, ptr %114, align 8, !tbaa !27
  %116 = icmp eq i32 %115, -1
  br i1 %116, label %117, label %142

117:                                              ; preds = %107
  %118 = load ptr, ptr %3, align 8, !tbaa !5
  %119 = load ptr, ptr %4, align 8, !tbaa !5
  %120 = getelementptr inbounds %struct.png_info_struct, ptr %119, i32 0, i32 20
  %121 = load ptr, ptr %120, align 8, !tbaa !26
  %122 = load i32, ptr %5, align 4, !tbaa !24
  %123 = sext i32 %122 to i64
  %124 = getelementptr inbounds %struct.png_text_struct, ptr %121, i64 %123
  %125 = getelementptr inbounds %struct.png_text_struct, ptr %124, i32 0, i32 1
  %126 = load ptr, ptr %125, align 8, !tbaa !29
  %127 = load ptr, ptr %4, align 8, !tbaa !5
  %128 = getelementptr inbounds %struct.png_info_struct, ptr %127, i32 0, i32 20
  %129 = load ptr, ptr %128, align 8, !tbaa !26
  %130 = load i32, ptr %5, align 4, !tbaa !24
  %131 = sext i32 %130 to i64
  %132 = getelementptr inbounds %struct.png_text_struct, ptr %129, i64 %131
  %133 = getelementptr inbounds %struct.png_text_struct, ptr %132, i32 0, i32 2
  %134 = load ptr, ptr %133, align 8, !tbaa !30
  call void @png_write_tEXt(ptr noundef %118, ptr noundef %126, ptr noundef %134, i64 noundef 0)
  %135 = load ptr, ptr %4, align 8, !tbaa !5
  %136 = getelementptr inbounds %struct.png_info_struct, ptr %135, i32 0, i32 20
  %137 = load ptr, ptr %136, align 8, !tbaa !26
  %138 = load i32, ptr %5, align 4, !tbaa !24
  %139 = sext i32 %138 to i64
  %140 = getelementptr inbounds %struct.png_text_struct, ptr %137, i64 %139
  %141 = getelementptr inbounds %struct.png_text_struct, ptr %140, i32 0, i32 0
  store i32 -3, ptr %141, align 8, !tbaa !27
  br label %142

142:                                              ; preds = %117, %107
  br label %143

143:                                              ; preds = %142, %74
  br label %144

144:                                              ; preds = %143, %55
  br label %145

145:                                              ; preds = %144
  %146 = load i32, ptr %5, align 4, !tbaa !24
  %147 = add nsw i32 %146, 1
  store i32 %147, ptr %5, align 4, !tbaa !24
  br label %39, !llvm.loop !31

148:                                              ; preds = %39
  %149 = load ptr, ptr %4, align 8, !tbaa !5
  %150 = getelementptr inbounds %struct.png_info_struct, ptr %149, i32 0, i32 50
  %151 = load i64, ptr %150, align 8, !tbaa !33
  %152 = icmp ne i64 %151, 0
  br i1 %152, label %153, label %221

153:                                              ; preds = %148
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #3
  %154 = load ptr, ptr %4, align 8, !tbaa !5
  %155 = getelementptr inbounds %struct.png_info_struct, ptr %154, i32 0, i32 49
  %156 = load ptr, ptr %155, align 8, !tbaa !34
  store ptr %156, ptr %6, align 8, !tbaa !5
  br label %157

157:                                              ; preds = %217, %153
  %158 = load ptr, ptr %6, align 8, !tbaa !5
  %159 = load ptr, ptr %4, align 8, !tbaa !5
  %160 = getelementptr inbounds %struct.png_info_struct, ptr %159, i32 0, i32 49
  %161 = load ptr, ptr %160, align 8, !tbaa !34
  %162 = load ptr, ptr %4, align 8, !tbaa !5
  %163 = getelementptr inbounds %struct.png_info_struct, ptr %162, i32 0, i32 50
  %164 = load i64, ptr %163, align 8, !tbaa !33
  %165 = getelementptr inbounds %struct.png_unknown_chunk_t, ptr %161, i64 %164
  %166 = icmp ult ptr %158, %165
  br i1 %166, label %167, label %220

167:                                              ; preds = %157
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #3
  %168 = load ptr, ptr %3, align 8, !tbaa !5
  %169 = load ptr, ptr %6, align 8, !tbaa !5
  %170 = getelementptr inbounds %struct.png_unknown_chunk_t, ptr %169, i32 0, i32 0
  %171 = getelementptr inbounds [5 x i8], ptr %170, i64 0, i64 0
  %172 = call i32 @png_handle_as_unknown(ptr noundef %168, ptr noundef %171)
  store i32 %172, ptr %7, align 4, !tbaa !24
  %173 = load i32, ptr %7, align 4, !tbaa !24
  %174 = icmp ne i32 %173, 1
  br i1 %174, label %175, label %216

175:                                              ; preds = %167
  %176 = load ptr, ptr %6, align 8, !tbaa !5
  %177 = getelementptr inbounds %struct.png_unknown_chunk_t, ptr %176, i32 0, i32 3
  %178 = load i8, ptr %177, align 8, !tbaa !35
  %179 = zext i8 %178 to i32
  %180 = icmp ne i32 %179, 0
  br i1 %180, label %181, label %216

181:                                              ; preds = %175
  %182 = load ptr, ptr %6, align 8, !tbaa !5
  %183 = getelementptr inbounds %struct.png_unknown_chunk_t, ptr %182, i32 0, i32 3
  %184 = load i8, ptr %183, align 8, !tbaa !35
  %185 = zext i8 %184 to i32
  %186 = and i32 %185, 8
  %187 = icmp ne i32 %186, 0
  br i1 %187, label %188, label %216

188:                                              ; preds = %181
  %189 = load ptr, ptr %6, align 8, !tbaa !5
  %190 = getelementptr inbounds %struct.png_unknown_chunk_t, ptr %189, i32 0, i32 0
  %191 = getelementptr inbounds [5 x i8], ptr %190, i64 0, i64 3
  %192 = load i8, ptr %191, align 1, !tbaa !36
  %193 = zext i8 %192 to i32
  %194 = and i32 %193, 32
  %195 = icmp ne i32 %194, 0
  br i1 %195, label %205, label %196

196:                                              ; preds = %188
  %197 = load i32, ptr %7, align 4, !tbaa !24
  %198 = icmp eq i32 %197, 3
  br i1 %198, label %205, label %199

199:                                              ; preds = %196
  %200 = load ptr, ptr %3, align 8, !tbaa !5
  %201 = getelementptr inbounds %struct.png_struct_def, ptr %200, i32 0, i32 13
  %202 = load i64, ptr %201, align 8, !tbaa !37
  %203 = and i64 %202, 65536
  %204 = icmp ne i64 %203, 0
  br i1 %204, label %205, label %216

205:                                              ; preds = %199, %196, %188
  %206 = load ptr, ptr %3, align 8, !tbaa !5
  %207 = load ptr, ptr %6, align 8, !tbaa !5
  %208 = getelementptr inbounds %struct.png_unknown_chunk_t, ptr %207, i32 0, i32 0
  %209 = getelementptr inbounds [5 x i8], ptr %208, i64 0, i64 0
  %210 = load ptr, ptr %6, align 8, !tbaa !5
  %211 = getelementptr inbounds %struct.png_unknown_chunk_t, ptr %210, i32 0, i32 1
  %212 = load ptr, ptr %211, align 8, !tbaa !38
  %213 = load ptr, ptr %6, align 8, !tbaa !5
  %214 = getelementptr inbounds %struct.png_unknown_chunk_t, ptr %213, i32 0, i32 2
  %215 = load i64, ptr %214, align 8, !tbaa !39
  call void @png_write_chunk(ptr noundef %206, ptr noundef %209, ptr noundef %212, i64 noundef %215)
  br label %216

216:                                              ; preds = %205, %199, %181, %175, %167
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #3
  br label %217

217:                                              ; preds = %216
  %218 = load ptr, ptr %6, align 8, !tbaa !5
  %219 = getelementptr inbounds %struct.png_unknown_chunk_t, ptr %218, i32 1
  store ptr %219, ptr %6, align 8, !tbaa !5
  br label %157, !llvm.loop !40

220:                                              ; preds = %157
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #3
  br label %221

221:                                              ; preds = %220, %148
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #3
  br label %222

222:                                              ; preds = %221, %19
  %223 = load ptr, ptr %3, align 8, !tbaa !5
  %224 = getelementptr inbounds %struct.png_struct_def, ptr %223, i32 0, i32 12
  %225 = load i64, ptr %224, align 8, !tbaa !9
  %226 = or i64 %225, 8
  store i64 %226, ptr %224, align 8, !tbaa !9
  %227 = load ptr, ptr %3, align 8, !tbaa !5
  call void @png_write_IEND(ptr noundef %227)
  br label %228

228:                                              ; preds = %222, %10
  ret void
}

declare void @png_write_IEND(ptr noundef) #0

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 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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, !11, i64 280}
!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 = !{!21, !11, i64 16}
!21 = !{!"png_info_struct", !11, i64 0, !11, i64 8, !11, i64 16, !11, i64 24, !6, i64 32, !15, i64 40, !15, 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, !16, i64 60, !7, i64 64, !13, i64 68, !13, i64 72, !6, i64 80, !22, i64 88, !18, i64 96, !6, i64 104, !17, i64 112, !17, i64 122, !11, i64 136, !11, i64 144, !7, i64 152, !11, i64 160, !11, i64 168, !7, i64 176, !6, i64 184, !16, i64 192, !16, i64 196, !16, i64 200, !16, i64 204, !16, i64 208, !16, i64 212, !16, i64 216, !16, i64 220, !6, i64 224, !11, i64 232, !11, i64 240, !6, i64 248, !6, i64 256, !7, i64 264, !7, i64 265, !11, i64 272, !6, i64 280, !11, i64 288, !6, i64 296, !6, i64 304, !11, i64 312, !7, i64 320, !6, i64 328, !11, i64 336, !7, i64 344, !23, i64 352, !23, i64 360, !6, i64 368, !6, i64 376, !6, i64 384, !11, i64 392, !11, i64 400, !11, i64 408, !11, i64 416, !11, i64 424, !11, i64 432, !11, i64 440, !11, i64 448, !11, i64 456}
!22 = !{!"png_time_struct", !15, i64 0, !7, i64 2, !7, i64 3, !7, i64 4, !7, i64 5, !7, i64 6}
!23 = !{!"double", !7, i64 0}
!24 = !{!13, !13, i64 0}
!25 = !{!21, !13, i64 68}
!26 = !{!21, !6, i64 80}
!27 = !{!28, !13, i64 0}
!28 = !{!"png_text_struct", !13, i64 0, !6, i64 8, !6, i64 16, !11, i64 24}
!29 = !{!28, !6, i64 8}
!30 = !{!28, !6, i64 16}
!31 = distinct !{!31, !32}
!32 = !{!"llvm.loop.mustprogress"}
!33 = !{!21, !11, i64 288}
!34 = !{!21, !6, i64 280}
!35 = !{!19, !7, i64 24}
!36 = !{!7, !7, i64 0}
!37 = !{!10, !11, i64 288}
!38 = !{!19, !6, i64 8}
!39 = !{!19, !11, i64 16}
!40 = distinct !{!40, !32}


; 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_text_struct = type { i32, ptr, ptr, i64 }
%struct.png_unknown_chunk_t = type { [5 x i8], ptr, i64, i8 }

@.str.3 = external hidden unnamed_addr constant [35 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [27 x i8], align 1

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

declare i32 @png_handle_as_unknown(ptr noundef, ptr noundef) local_unnamed_addr #0

declare void @png_write_chunk(ptr noundef, ptr noundef, ptr noundef, i64 noundef) local_unnamed_addr #0

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

declare void @png_write_tIME(ptr noundef, ptr noundef) local_unnamed_addr #0

declare void @png_write_zTXt(ptr noundef, ptr noundef, ptr noundef, i64 noundef, i32 noundef) local_unnamed_addr #0

declare void @png_write_tEXt(ptr noundef, ptr noundef, ptr noundef, i64 noundef) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
define dso_local void @png_write_end(ptr noundef %0, ptr noundef %1) local_unnamed_addr #1 {
  %3 = icmp eq ptr %0, null
  br i1 %3, label %86, label %4

4:                                                ; preds = %2
  %5 = getelementptr inbounds i8, ptr %0, i64 280
  %6 = load i64, ptr %5, align 8, !tbaa !5
  %7 = and i64 %6, 4
  %.not = icmp eq i64 %7, 0
  br i1 %.not, label %8, label %9

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

9:                                                ; preds = %8, %4
  %.not62 = icmp eq ptr %1, null
  br i1 %.not62, label %.loopexit, label %10

10:                                               ; preds = %9
  %11 = getelementptr inbounds i8, ptr %1, i64 16
  %12 = load i64, ptr %11, align 8, !tbaa !19
  %13 = and i64 %12, 512
  %.not63 = icmp eq i64 %13, 0
  br i1 %.not63, label %19, label %14

14:                                               ; preds = %10
  %15 = load i64, ptr %5, align 8, !tbaa !5
  %16 = and i64 %15, 512
  %.not64 = icmp eq i64 %16, 0
  br i1 %.not64, label %17, label %19

17:                                               ; preds = %14
  %18 = getelementptr inbounds i8, ptr %1, i64 88
  tail call void @png_write_tIME(ptr noundef nonnull %0, ptr noundef nonnull %18) #2
  br label %19

19:                                               ; preds = %17, %14, %10
  %20 = getelementptr inbounds i8, ptr %1, i64 68
  %21 = load i32, ptr %20, align 4, !tbaa !23
  %22 = icmp sgt i32 %21, 0
  br i1 %22, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %19
  %23 = getelementptr inbounds i8, ptr %1, i64 80
  %.pre = load ptr, ptr %23, align 8, !tbaa !24
  br label %24

24:                                               ; preds = %.lr.ph, %46
  %25 = phi ptr [ %.pre, %.lr.ph ], [ %47, %46 ]
  %indvars.iv = phi i64 [ 0, %.lr.ph ], [ %indvars.iv.next, %46 ]
  %26 = getelementptr inbounds %struct.png_text_struct, ptr %25, i64 %indvars.iv
  %27 = load i32, ptr %26, align 8, !tbaa !25
  %28 = icmp sgt i32 %27, 0
  br i1 %28, label %29, label %30

29:                                               ; preds = %24
  tail call void @png_warning(ptr noundef nonnull %0, ptr noundef nonnull @.str.3) #2
  br label %.sink.split

30:                                               ; preds = %24
  %31 = icmp sgt i32 %27, -1
  br i1 %31, label %32, label %37

32:                                               ; preds = %30
  %33 = getelementptr inbounds i8, ptr %26, i64 8
  %34 = load ptr, ptr %33, align 8, !tbaa !27
  %35 = getelementptr inbounds i8, ptr %26, i64 16
  %36 = load ptr, ptr %35, align 8, !tbaa !28
  tail call void @png_write_zTXt(ptr noundef nonnull %0, ptr noundef %34, ptr noundef %36, i64 noundef 0, i32 noundef 0) #2
  br label %.sink.split

37:                                               ; preds = %30
  %38 = icmp eq i32 %27, -1
  br i1 %38, label %39, label %46

39:                                               ; preds = %37
  %40 = getelementptr inbounds i8, ptr %26, i64 8
  %41 = load ptr, ptr %40, align 8, !tbaa !27
  %42 = getelementptr inbounds i8, ptr %26, i64 16
  %43 = load ptr, ptr %42, align 8, !tbaa !28
  tail call void @png_write_tEXt(ptr noundef nonnull %0, ptr noundef %41, ptr noundef %43, i64 noundef 0) #2
  br label %.sink.split

.sink.split:                                      ; preds = %32, %39, %29
  %.sink = phi i32 [ -3, %29 ], [ -3, %39 ], [ -2, %32 ]
  %44 = load ptr, ptr %23, align 8, !tbaa !24
  %45 = getelementptr inbounds %struct.png_text_struct, ptr %44, i64 %indvars.iv
  store i32 %.sink, ptr %45, align 8, !tbaa !25
  br label %46

46:                                               ; preds = %.sink.split, %37
  %47 = phi ptr [ %25, %37 ], [ %44, %.sink.split ]
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %48 = load i32, ptr %20, align 4, !tbaa !23
  %49 = sext i32 %48 to i64
  %50 = icmp slt i64 %indvars.iv.next, %49
  br i1 %50, label %24, label %._crit_edge, !llvm.loop !29

._crit_edge:                                      ; preds = %46, %19
  %51 = getelementptr inbounds i8, ptr %1, i64 288
  %52 = load i64, ptr %51, align 8, !tbaa !31
  %.not65 = icmp eq i64 %52, 0
  br i1 %.not65, label %.loopexit, label %53

53:                                               ; preds = %._crit_edge
  %54 = getelementptr inbounds i8, ptr %1, i64 280
  %55 = icmp sgt i64 %52, 0
  br i1 %55, label %.lr.ph74, label %.loopexit

.lr.ph74:                                         ; preds = %53
  %56 = load ptr, ptr %54, align 8, !tbaa !32
  %57 = getelementptr inbounds i8, ptr %0, i64 288
  br label %58

58:                                               ; preds = %.lr.ph74, %78
  %.05672 = phi ptr [ %56, %.lr.ph74 ], [ %79, %78 ]
  %59 = tail call i32 @png_handle_as_unknown(ptr noundef nonnull %0, ptr noundef %.05672) #2
  %.not66 = icmp eq i32 %59, 1
  br i1 %.not66, label %78, label %60

60:                                               ; preds = %58
  %61 = getelementptr inbounds i8, ptr %.05672, i64 24
  %62 = load i8, ptr %61, align 8, !tbaa !33
  %63 = and i8 %62, 8
  %.not68 = icmp eq i8 %63, 0
  br i1 %.not68, label %78, label %64

64:                                               ; preds = %60
  %65 = getelementptr inbounds i8, ptr %.05672, i64 3
  %66 = load i8, ptr %65, align 1, !tbaa !34
  %67 = and i8 %66, 32
  %68 = icmp ne i8 %67, 0
  %69 = icmp eq i32 %59, 3
  %or.cond = or i1 %69, %68
  br i1 %or.cond, label %73, label %70

70:                                               ; preds = %64
  %71 = load i64, ptr %57, align 8, !tbaa !35
  %72 = and i64 %71, 65536
  %.not69 = icmp eq i64 %72, 0
  br i1 %.not69, label %78, label %73

73:                                               ; preds = %70, %64
  %74 = getelementptr inbounds i8, ptr %.05672, i64 8
  %75 = load ptr, ptr %74, align 8, !tbaa !36
  %76 = getelementptr inbounds i8, ptr %.05672, i64 16
  %77 = load i64, ptr %76, align 8, !tbaa !37
  tail call void @png_write_chunk(ptr noundef nonnull %0, ptr noundef nonnull %.05672, ptr noundef %75, i64 noundef %77) #2
  br label %78

78:                                               ; preds = %73, %70, %60, %58
  %79 = getelementptr inbounds i8, ptr %.05672, i64 32
  %80 = load ptr, ptr %54, align 8, !tbaa !32
  %81 = load i64, ptr %51, align 8, !tbaa !31
  %82 = getelementptr inbounds %struct.png_unknown_chunk_t, ptr %80, i64 %81
  %83 = icmp ult ptr %79, %82
  br i1 %83, label %58, label %.loopexit, !llvm.loop !38

.loopexit:                                        ; preds = %78, %53, %._crit_edge, %9
  %84 = load i64, ptr %5, align 8, !tbaa !5
  %85 = or i64 %84, 8
  store i64 %85, ptr %5, align 8, !tbaa !5
  tail call void @png_write_IEND(ptr noundef nonnull %0) #2
  br label %86

86:                                               ; preds = %2, %.loopexit
  ret void
}

declare void @png_write_IEND(ptr noundef) local_unnamed_addr #0

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 = { 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 = !{!20, !10, i64 16}
!20 = !{!"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, !21, 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, !22, i64 352, !22, 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}
!21 = !{!"png_time_struct", !14, i64 0, !7, i64 2, !7, i64 3, !7, i64 4, !7, i64 5, !7, i64 6}
!22 = !{!"double", !7, i64 0}
!23 = !{!20, !12, i64 68}
!24 = !{!20, !9, i64 80}
!25 = !{!26, !12, i64 0}
!26 = !{!"png_text_struct", !12, i64 0, !9, i64 8, !9, i64 16, !10, i64 24}
!27 = !{!26, !9, i64 8}
!28 = !{!26, !9, i64 16}
!29 = distinct !{!29, !30}
!30 = !{!"llvm.loop.mustprogress"}
!31 = !{!20, !10, i64 288}
!32 = !{!20, !9, i64 280}
!33 = !{!18, !7, i64 24}
!34 = !{!7, !7, i64 0}
!35 = !{!6, !10, i64 288}
!36 = !{!18, !9, i64 8}
!37 = !{!18, !10, i64 16}
!38 = distinct !{!38, !30}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LICMPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,ReassociatePass,SROAPass,SimplifyCFGPass,TailCallElimPass