; LLVM IR from ox-vgg/vise :: src/search_engine/relja_retrival/external/KMCode_relja/ImageContent/ImageConten_ce4bea11 (ZN12ImageContent8writePNGEPKc)

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

%"class.std::basic_ostream" = type { ptr, %"class.std::basic_ios" }
%"class.std::basic_ios" = type { %"class.std::ios_base", ptr, i8, i8, ptr, ptr, ptr, ptr }
%"class.std::ios_base" = type { ptr, i64, i64, i32, i32, i32, ptr, %"struct.std::ios_base::_Words", [8 x %"struct.std::ios_base::_Words"], i32, ptr, %"class.std::locale" }
%"struct.std::ios_base::_Words" = type { ptr, i64 }
%"class.std::locale" = type { ptr }
%class.ImageContent = type { i32, i32, i32, i32, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr }
%struct.__jmp_buf_tag = type { [8 x i64], i32, %struct.__sigset_t }
%struct.__sigset_t = type { [16 x i64] }

@_ZSt4cout = external global %"class.std::basic_ostream", align 8
@.str.13 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.16 = external hidden unnamed_addr constant [35 x i8], align 1
@.str.17 = external hidden unnamed_addr constant [34 x i8], align 1
@.str.18 = external hidden unnamed_addr constant [18 x i8], align 1
@.str.19 = external hidden unnamed_addr constant [3 x i8], align 1

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

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

declare noalias ptr @fopen(ptr noundef, ptr noundef) #1

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) #2

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) #3 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_(ptr noundef nonnull align 8 dereferenceable(8)) #2

declare i32 @fclose(ptr noundef) #1

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare { i64, i1 } @llvm.umul.with.overflow.i64(i64, i64) #4

; Function Attrs: nobuiltin allocsize(0)
declare noundef nonnull ptr @_Znam(i64 noundef) #5

; Function Attrs: nobuiltin nounwind
declare void @_ZdaPv(ptr noundef) #6

declare noalias ptr @png_create_info_struct(ptr noundef) #1

; Function Attrs: nounwind returns_twice
declare i32 @_setjmp(ptr noundef) #7

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

; Function Attrs: noreturn nounwind
declare void @longjmp(ptr noundef, i32 noundef) #8

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN12ImageContent8writePNGEPKc(ptr noundef nonnull align 8 dereferenceable(80) %0, ptr noundef %1) #3 align 2 {
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca ptr, align 8
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  store ptr %0, ptr %3, align 8, !tbaa !5
  store ptr %1, ptr %4, align 8, !tbaa !5
  %15 = load ptr, ptr %3, align 8
  %16 = getelementptr inbounds %class.ImageContent, ptr %15, i32 0, i32 3
  %17 = load i32, ptr %16, align 4, !tbaa !9
  %18 = icmp eq i32 %17, 0
  br i1 %18, label %19, label %20

19:                                               ; preds = %2
  br label %292

20:                                               ; preds = %2
  call void @_ZN12ImageContent10float2charEv(ptr noundef nonnull align 8 dereferenceable(80) %15)
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #9
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #9
  %21 = call noalias ptr @png_create_write_struct(ptr noundef @.str.13, ptr noundef null, ptr noundef null, ptr noundef null)
  store ptr %21, ptr %5, align 8, !tbaa !5
  %22 = load ptr, ptr %5, align 8, !tbaa !5
  %23 = icmp eq ptr %22, null
  br i1 %23, label %24, label %27

24:                                               ; preds = %20
  %25 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef @.str.16)
  %26 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %25, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  call void @exit(i32 noundef 0) #10
  unreachable

27:                                               ; preds = %20
  %28 = load ptr, ptr %5, align 8, !tbaa !5
  %29 = call noalias ptr @png_create_info_struct(ptr noundef %28)
  store ptr %29, ptr %6, align 8, !tbaa !5
  %30 = load ptr, ptr %6, align 8, !tbaa !5
  %31 = icmp eq ptr %30, null
  br i1 %31, label %32, label %35

32:                                               ; preds = %27
  call void @png_destroy_write_struct(ptr noundef %5, ptr noundef null)
  %33 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef @.str.17)
  %34 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %33, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  call void @exit(i32 noundef 0) #10
  unreachable

35:                                               ; preds = %27
  %36 = load ptr, ptr %5, align 8, !tbaa !5
  %37 = call ptr @png_set_longjmp_fn(ptr noundef %36, ptr noundef @longjmp, i64 noundef 200)
  %38 = getelementptr inbounds [1 x %struct.__jmp_buf_tag], ptr %37, i64 0, i64 0
  %39 = call i32 @_setjmp(ptr noundef %38) #11
  %40 = icmp ne i32 %39, 0
  br i1 %40, label %41, label %44

41:                                               ; preds = %35
  call void @png_destroy_write_struct(ptr noundef %5, ptr noundef %6)
  %42 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef @.str.18)
  %43 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %42, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  call void @exit(i32 noundef 0) #10
  unreachable

44:                                               ; preds = %35
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #9
  %45 = load ptr, ptr %4, align 8, !tbaa !5
  %46 = call noalias ptr @fopen(ptr noundef %45, ptr noundef @.str.19)
  store ptr %46, ptr %7, align 8, !tbaa !5
  %47 = load ptr, ptr %7, align 8, !tbaa !5
  %48 = icmp eq ptr %47, null
  br i1 %48, label %49, label %50

49:                                               ; preds = %44
  store i32 1, ptr %8, align 4
  br label %290

50:                                               ; preds = %44
  %51 = load ptr, ptr %5, align 8, !tbaa !5
  %52 = load ptr, ptr %7, align 8, !tbaa !5
  call void @png_init_io(ptr noundef %51, ptr noundef %52)
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #9
  store i32 8, ptr %9, align 4, !tbaa !12
  %53 = getelementptr inbounds %class.ImageContent, ptr %15, i32 0, i32 3
  %54 = load i32, ptr %53, align 4, !tbaa !9
  %55 = icmp eq i32 %54, 1
  br i1 %55, label %60, label %56

56:                                               ; preds = %50
  %57 = getelementptr inbounds %class.ImageContent, ptr %15, i32 0, i32 3
  %58 = load i32, ptr %57, align 4, !tbaa !9
  %59 = icmp eq i32 %58, 3
  br i1 %59, label %60, label %92

60:                                               ; preds = %56, %50
  %61 = load ptr, ptr %5, align 8, !tbaa !5
  %62 = load ptr, ptr %6, align 8, !tbaa !5
  %63 = getelementptr inbounds %class.ImageContent, ptr %15, i32 0, i32 0
  %64 = load i32, ptr %63, align 8, !tbaa !13
  %65 = getelementptr inbounds %class.ImageContent, ptr %15, i32 0, i32 1
  %66 = load i32, ptr %65, align 4, !tbaa !14
  %67 = load i32, ptr %9, align 4, !tbaa !12
  call void @png_set_IHDR(ptr noundef %61, ptr noundef %62, i32 noundef %64, i32 noundef %66, i32 noundef %67, i32 noundef 0, i32 noundef 0, i32 noundef 0, i32 noundef 0)
  %68 = load ptr, ptr %5, align 8, !tbaa !5
  %69 = load ptr, ptr %6, align 8, !tbaa !5
  %70 = getelementptr inbounds %class.ImageContent, ptr %15, i32 0, i32 8
  %71 = load ptr, ptr %70, align 8, !tbaa !15
  call void @png_set_rows(ptr noundef %68, ptr noundef %69, ptr noundef %71)
  %72 = load ptr, ptr %5, align 8, !tbaa !5
  %73 = load ptr, ptr %6, align 8, !tbaa !5
  call void @png_write_png(ptr noundef %72, ptr noundef %73, i32 noundef 0, ptr noundef null)
  %74 = getelementptr inbounds %class.ImageContent, ptr %15, i32 0, i32 3
  %75 = load i32, ptr %74, align 4, !tbaa !9
  %76 = icmp eq i32 %75, 3
  br i1 %76, label %77, label %91

77:                                               ; preds = %60
  %78 = getelementptr inbounds %class.ImageContent, ptr %15, i32 0, i32 8
  %79 = load ptr, ptr %78, align 8, !tbaa !15
  %80 = getelementptr inbounds ptr, ptr %79, i64 0
  %81 = load ptr, ptr %80, align 8, !tbaa !5
  %82 = icmp eq ptr %81, null
  br i1 %82, label %84, label %83

83:                                               ; preds = %77
  call void @_ZdaPv(ptr noundef %81) #12
  br label %84

84:                                               ; preds = %83, %77
  %85 = getelementptr inbounds %class.ImageContent, ptr %15, i32 0, i32 8
  %86 = load ptr, ptr %85, align 8, !tbaa !15
  %87 = icmp eq ptr %86, null
  br i1 %87, label %89, label %88

88:                                               ; preds = %84
  call void @_ZdaPv(ptr noundef %86) #12
  br label %89

89:                                               ; preds = %88, %84
  %90 = getelementptr inbounds %class.ImageContent, ptr %15, i32 0, i32 3
  store i32 2, ptr %90, align 4, !tbaa !9
  br label %91

91:                                               ; preds = %89, %60
  br label %92

92:                                               ; preds = %91, %56
  %93 = getelementptr inbounds %class.ImageContent, ptr %15, i32 0, i32 3
  %94 = load i32, ptr %93, align 4, !tbaa !9
  %95 = icmp eq i32 %94, 5
  br i1 %95, label %100, label %96

96:                                               ; preds = %92
  %97 = getelementptr inbounds %class.ImageContent, ptr %15, i32 0, i32 3
  %98 = load i32, ptr %97, align 4, !tbaa !9
  %99 = icmp eq i32 %98, 12
  br i1 %99, label %100, label %287

100:                                              ; preds = %96, %92
  %101 = load ptr, ptr %5, align 8, !tbaa !5
  %102 = load ptr, ptr %6, align 8, !tbaa !5
  %103 = getelementptr inbounds %class.ImageContent, ptr %15, i32 0, i32 0
  %104 = load i32, ptr %103, align 8, !tbaa !13
  %105 = getelementptr inbounds %class.ImageContent, ptr %15, i32 0, i32 1
  %106 = load i32, ptr %105, align 4, !tbaa !14
  %107 = load i32, ptr %9, align 4, !tbaa !12
  call void @png_set_IHDR(ptr noundef %101, ptr noundef %102, i32 noundef %104, i32 noundef %106, i32 noundef %107, i32 noundef 2, i32 noundef 0, i32 noundef 0, i32 noundef 0)
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #9
  %108 = getelementptr inbounds %class.ImageContent, ptr %15, i32 0, i32 1
  %109 = load i32, ptr %108, align 4, !tbaa !14
  %110 = zext i32 %109 to i64
  %111 = call { i64, i1 } @llvm.umul.with.overflow.i64(i64 %110, i64 8)
  %112 = extractvalue { i64, i1 } %111, 1
  %113 = extractvalue { i64, i1 } %111, 0
  %114 = select i1 %112, i64 -1, i64 %113
  %115 = call noalias noundef nonnull ptr @_Znam(i64 noundef %114) #13
  store ptr %115, ptr %10, align 8, !tbaa !5
  %116 = getelementptr inbounds %class.ImageContent, ptr %15, i32 0, i32 2
  %117 = load i32, ptr %116, align 8, !tbaa !16
  %118 = mul i32 3, %117
  %119 = zext i32 %118 to i64
  %120 = call noalias noundef nonnull ptr @_Znam(i64 noundef %119) #13
  %121 = load ptr, ptr %10, align 8, !tbaa !5
  %122 = getelementptr inbounds ptr, ptr %121, i64 0
  store ptr %120, ptr %122, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #9
  store i32 1, ptr %11, align 4, !tbaa !12
  br label %123

123:                                              ; preds = %144, %100
  %124 = load i32, ptr %11, align 4, !tbaa !12
  %125 = getelementptr inbounds %class.ImageContent, ptr %15, i32 0, i32 1
  %126 = load i32, ptr %125, align 4, !tbaa !14
  %127 = icmp ult i32 %124, %126
  br i1 %127, label %129, label %128

128:                                              ; preds = %123
  store i32 2, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #9
  br label %147

129:                                              ; preds = %123
  %130 = load ptr, ptr %10, align 8, !tbaa !5
  %131 = getelementptr inbounds ptr, ptr %130, i64 0
  %132 = load ptr, ptr %131, align 8, !tbaa !5
  %133 = load i32, ptr %11, align 4, !tbaa !12
  %134 = mul i32 %133, 3
  %135 = getelementptr inbounds %class.ImageContent, ptr %15, i32 0, i32 0
  %136 = load i32, ptr %135, align 8, !tbaa !13
  %137 = mul i32 %134, %136
  %138 = zext i32 %137 to i64
  %139 = getelementptr inbounds i8, ptr %132, i64 %138
  %140 = load ptr, ptr %10, align 8, !tbaa !5
  %141 = load i32, ptr %11, align 4, !tbaa !12
  %142 = zext i32 %141 to i64
  %143 = getelementptr inbounds ptr, ptr %140, i64 %142
  store ptr %139, ptr %143, align 8, !tbaa !5
  br label %144

144:                                              ; preds = %129
  %145 = load i32, ptr %11, align 4, !tbaa !12
  %146 = add i32 %145, 1
  store i32 %146, ptr %11, align 4, !tbaa !12
  br label %123, !llvm.loop !17

147:                                              ; preds = %128
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #9
  store i32 0, ptr %12, align 4, !tbaa !12
  br label %148

148:                                              ; preds = %223, %147
  %149 = load i32, ptr %12, align 4, !tbaa !12
  %150 = getelementptr inbounds %class.ImageContent, ptr %15, i32 0, i32 1
  %151 = load i32, ptr %150, align 4, !tbaa !14
  %152 = icmp ult i32 %149, %151
  br i1 %152, label %154, label %153

153:                                              ; preds = %148
  store i32 5, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #9
  br label %226

154:                                              ; preds = %148
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #9
  store i32 0, ptr %13, align 4, !tbaa !12
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #9
  store i32 0, ptr %14, align 4, !tbaa !12
  br label %155

155:                                              ; preds = %219, %154
  %156 = load i32, ptr %13, align 4, !tbaa !12
  %157 = getelementptr inbounds %class.ImageContent, ptr %15, i32 0, i32 0
  %158 = load i32, ptr %157, align 8, !tbaa !13
  %159 = icmp ult i32 %156, %158
  br i1 %159, label %161, label %160

160:                                              ; preds = %155
  store i32 8, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #9
  br label %222

161:                                              ; preds = %155
  %162 = getelementptr inbounds %class.ImageContent, ptr %15, i32 0, i32 9
  %163 = load ptr, ptr %162, align 8, !tbaa !19
  %164 = load i32, ptr %12, align 4, !tbaa !12
  %165 = zext i32 %164 to i64
  %166 = getelementptr inbounds ptr, ptr %163, i64 %165
  %167 = load ptr, ptr %166, align 8, !tbaa !5
  %168 = load i32, ptr %13, align 4, !tbaa !12
  %169 = zext i32 %168 to i64
  %170 = getelementptr inbounds i8, ptr %167, i64 %169
  %171 = load i8, ptr %170, align 1, !tbaa !20
  %172 = load ptr, ptr %10, align 8, !tbaa !5
  %173 = load i32, ptr %12, align 4, !tbaa !12
  %174 = zext i32 %173 to i64
  %175 = getelementptr inbounds ptr, ptr %172, i64 %174
  %176 = load ptr, ptr %175, align 8, !tbaa !5
  %177 = load i32, ptr %14, align 4, !tbaa !12
  %178 = add i32 %177, 1
  store i32 %178, ptr %14, align 4, !tbaa !12
  %179 = zext i32 %177 to i64
  %180 = getelementptr inbounds i8, ptr %176, i64 %179
  store i8 %171, ptr %180, align 1, !tbaa !20
  %181 = getelementptr inbounds %class.ImageContent, ptr %15, i32 0, i32 10
  %182 = load ptr, ptr %181, align 8, !tbaa !21
  %183 = load i32, ptr %12, align 4, !tbaa !12
  %184 = zext i32 %183 to i64
  %185 = getelementptr inbounds ptr, ptr %182, i64 %184
  %186 = load ptr, ptr %185, align 8, !tbaa !5
  %187 = load i32, ptr %13, align 4, !tbaa !12
  %188 = zext i32 %187 to i64
  %189 = getelementptr inbounds i8, ptr %186, i64 %188
  %190 = load i8, ptr %189, align 1, !tbaa !20
  %191 = load ptr, ptr %10, align 8, !tbaa !5
  %192 = load i32, ptr %12, align 4, !tbaa !12
  %193 = zext i32 %192 to i64
  %194 = getelementptr inbounds ptr, ptr %191, i64 %193
  %195 = load ptr, ptr %194, align 8, !tbaa !5
  %196 = load i32, ptr %14, align 4, !tbaa !12
  %197 = add i32 %196, 1
  store i32 %197, ptr %14, align 4, !tbaa !12
  %198 = zext i32 %196 to i64
  %199 = getelementptr inbounds i8, ptr %195, i64 %198
  store i8 %190, ptr %199, align 1, !tbaa !20
  %200 = getelementptr inbounds %class.ImageContent, ptr %15, i32 0, i32 11
  %201 = load ptr, ptr %200, align 8, !tbaa !22
  %202 = load i32, ptr %12, align 4, !tbaa !12
  %203 = zext i32 %202 to i64
  %204 = getelementptr inbounds ptr, ptr %201, i64 %203
  %205 = load ptr, ptr %204, align 8, !tbaa !5
  %206 = load i32, ptr %13, align 4, !tbaa !12
  %207 = zext i32 %206 to i64
  %208 = getelementptr inbounds i8, ptr %205, i64 %207
  %209 = load i8, ptr %208, align 1, !tbaa !20
  %210 = load ptr, ptr %10, align 8, !tbaa !5
  %211 = load i32, ptr %12, align 4, !tbaa !12
  %212 = zext i32 %211 to i64
  %213 = getelementptr inbounds ptr, ptr %210, i64 %212
  %214 = load ptr, ptr %213, align 8, !tbaa !5
  %215 = load i32, ptr %14, align 4, !tbaa !12
  %216 = add i32 %215, 1
  store i32 %216, ptr %14, align 4, !tbaa !12
  %217 = zext i32 %215 to i64
  %218 = getelementptr inbounds i8, ptr %214, i64 %217
  store i8 %209, ptr %218, align 1, !tbaa !20
  br label %219

219:                                              ; preds = %161
  %220 = load i32, ptr %13, align 4, !tbaa !12
  %221 = add i32 %220, 1
  store i32 %221, ptr %13, align 4, !tbaa !12
  br label %155, !llvm.loop !23

222:                                              ; preds = %160
  br label %223

223:                                              ; preds = %222
  %224 = load i32, ptr %12, align 4, !tbaa !12
  %225 = add i32 %224, 1
  store i32 %225, ptr %12, align 4, !tbaa !12
  br label %148, !llvm.loop !24

226:                                              ; preds = %153
  %227 = load ptr, ptr %5, align 8, !tbaa !5
  %228 = load ptr, ptr %6, align 8, !tbaa !5
  %229 = load ptr, ptr %10, align 8, !tbaa !5
  call void @png_set_rows(ptr noundef %227, ptr noundef %228, ptr noundef %229)
  %230 = load ptr, ptr %5, align 8, !tbaa !5
  %231 = load ptr, ptr %6, align 8, !tbaa !5
  call void @png_write_png(ptr noundef %230, ptr noundef %231, i32 noundef 0, ptr noundef null)
  %232 = load ptr, ptr %10, align 8, !tbaa !5
  %233 = getelementptr inbounds ptr, ptr %232, i64 0
  %234 = load ptr, ptr %233, align 8, !tbaa !5
  %235 = icmp eq ptr %234, null
  br i1 %235, label %237, label %236

236:                                              ; preds = %226
  call void @_ZdaPv(ptr noundef %234) #12
  br label %237

237:                                              ; preds = %236, %226
  %238 = load ptr, ptr %10, align 8, !tbaa !5
  %239 = icmp eq ptr %238, null
  br i1 %239, label %241, label %240

240:                                              ; preds = %237
  call void @_ZdaPv(ptr noundef %238) #12
  br label %241

241:                                              ; preds = %240, %237
  store ptr null, ptr %10, align 8, !tbaa !5
  %242 = getelementptr inbounds %class.ImageContent, ptr %15, i32 0, i32 3
  %243 = load i32, ptr %242, align 4, !tbaa !9
  %244 = icmp eq i32 %243, 12
  br i1 %244, label %245, label %286

245:                                              ; preds = %241
  %246 = getelementptr inbounds %class.ImageContent, ptr %15, i32 0, i32 9
  %247 = load ptr, ptr %246, align 8, !tbaa !19
  %248 = getelementptr inbounds ptr, ptr %247, i64 0
  %249 = load ptr, ptr %248, align 8, !tbaa !5
  %250 = icmp eq ptr %249, null
  br i1 %250, label %252, label %251

251:                                              ; preds = %245
  call void @_ZdaPv(ptr noundef %249) #12
  br label %252

252:                                              ; preds = %251, %245
  %253 = getelementptr inbounds %class.ImageContent, ptr %15, i32 0, i32 9
  %254 = load ptr, ptr %253, align 8, !tbaa !19
  %255 = icmp eq ptr %254, null
  br i1 %255, label %257, label %256

256:                                              ; preds = %252
  call void @_ZdaPv(ptr noundef %254) #12
  br label %257

257:                                              ; preds = %256, %252
  %258 = getelementptr inbounds %class.ImageContent, ptr %15, i32 0, i32 9
  store ptr null, ptr %258, align 8, !tbaa !19
  %259 = getelementptr inbounds %class.ImageContent, ptr %15, i32 0, i32 10
  %260 = load ptr, ptr %259, align 8, !tbaa !21
  %261 = getelementptr inbounds ptr, ptr %260, i64 0
  %262 = load ptr, ptr %261, align 8, !tbaa !5
  %263 = icmp eq ptr %262, null
  br i1 %263, label %265, label %264

264:                                              ; preds = %257
  call void @_ZdaPv(ptr noundef %262) #12
  br label %265

265:                                              ; preds = %264, %257
  %266 = getelementptr inbounds %class.ImageContent, ptr %15, i32 0, i32 10
  %267 = load ptr, ptr %266, align 8, !tbaa !21
  %268 = icmp eq ptr %267, null
  br i1 %268, label %270, label %269

269:                                              ; preds = %265
  call void @_ZdaPv(ptr noundef %267) #12
  br label %270

270:                                              ; preds = %269, %265
  %271 = getelementptr inbounds %class.ImageContent, ptr %15, i32 0, i32 10
  store ptr null, ptr %271, align 8, !tbaa !21
  %272 = getelementptr inbounds %class.ImageContent, ptr %15, i32 0, i32 11
  %273 = load ptr, ptr %272, align 8, !tbaa !22
  %274 = getelementptr inbounds ptr, ptr %273, i64 0
  %275 = load ptr, ptr %274, align 8, !tbaa !5
  %276 = icmp eq ptr %275, null
  br i1 %276, label %278, label %277

277:                                              ; preds = %270
  call void @_ZdaPv(ptr noundef %275) #12
  br label %278

278:                                              ; preds = %277, %270
  %279 = getelementptr inbounds %class.ImageContent, ptr %15, i32 0, i32 11
  %280 = load ptr, ptr %279, align 8, !tbaa !22
  %281 = icmp eq ptr %280, null
  br i1 %281, label %283, label %282

282:                                              ; preds = %278
  call void @_ZdaPv(ptr noundef %280) #12
  br label %283

283:                                              ; preds = %282, %278
  %284 = getelementptr inbounds %class.ImageContent, ptr %15, i32 0, i32 11
  store ptr null, ptr %284, align 8, !tbaa !22
  %285 = getelementptr inbounds %class.ImageContent, ptr %15, i32 0, i32 3
  store i32 8, ptr %285, align 4, !tbaa !9
  br label %286

286:                                              ; preds = %283, %241
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #9
  br label %287

287:                                              ; preds = %286, %96
  call void @png_destroy_write_struct(ptr noundef %5, ptr noundef %6)
  %288 = load ptr, ptr %7, align 8, !tbaa !5
  %289 = call i32 @fclose(ptr noundef %288)
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #9
  store i32 0, ptr %8, align 4
  br label %290

290:                                              ; preds = %287, %49
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #9
  %291 = load i32, ptr %8, align 4
  switch i32 %291, label %293 [
    i32 0, label %292
    i32 1, label %292
  ]

292:                                              ; preds = %290, %290, %19
  ret void

293:                                              ; preds = %290
  unreachable
}

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN12ImageContent10float2charEv(ptr noundef nonnull align 8 dereferenceable(80)) #3 align 2

declare noalias ptr @png_create_write_struct(ptr noundef, ptr noundef, ptr noundef, ptr noundef) #1

; Function Attrs: noreturn nounwind
declare void @exit(i32 noundef) #8

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

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

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

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

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { inlinehint mustprogress 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 = { mustprogress 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 #4 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #5 = { nobuiltin allocsize(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 #6 = { nobuiltin nounwind "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 #7 = { nounwind returns_twice "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 #8 = { noreturn nounwind "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 #9 = { nounwind }
attributes #10 = { noreturn nounwind }
attributes #11 = { nounwind returns_twice }
attributes #12 = { builtin nounwind }
attributes #13 = { builtin allocsize(0) }

!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++ TBAA"}
!9 = !{!10, !11, i64 12}
!10 = !{!"_ZTS12ImageContent", !11, i64 0, !11, i64 4, !11, i64 8, !11, i64 12, !6, i64 16, !6, i64 24, !6, i64 32, !6, i64 40, !6, i64 48, !6, i64 56, !6, i64 64, !6, i64 72}
!11 = !{!"int", !7, i64 0}
!12 = !{!11, !11, i64 0}
!13 = !{!10, !11, i64 0}
!14 = !{!10, !11, i64 4}
!15 = !{!10, !6, i64 48}
!16 = !{!10, !11, i64 8}
!17 = distinct !{!17, !18}
!18 = !{!"llvm.loop.mustprogress"}
!19 = !{!10, !6, i64 56}
!20 = !{!7, !7, i64 0}
!21 = !{!10, !6, i64 64}
!22 = !{!10, !6, i64 72}
!23 = distinct !{!23, !18}
!24 = distinct !{!24, !18}


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

%"class.std::basic_ostream" = type { ptr, %"class.std::basic_ios" }
%"class.std::basic_ios" = type { %"class.std::ios_base", ptr, i8, i8, ptr, ptr, ptr, ptr }
%"class.std::ios_base" = type { ptr, i64, i64, i32, i32, i32, ptr, %"struct.std::ios_base::_Words", [8 x %"struct.std::ios_base::_Words"], i32, ptr, %"class.std::locale" }
%"struct.std::ios_base::_Words" = type { ptr, i64 }
%"class.std::locale" = type { ptr }

@_ZSt4cout = external global %"class.std::basic_ostream", align 8
@.str.13 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.16 = external hidden unnamed_addr constant [35 x i8], align 1
@.str.17 = external hidden unnamed_addr constant [34 x i8], align 1
@.str.18 = external hidden unnamed_addr constant [18 x i8], align 1
@.str.19 = external hidden unnamed_addr constant [3 x i8], align 1

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

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

; Function Attrs: nofree nounwind
declare noalias noundef ptr @fopen(ptr nocapture noundef readonly, ptr nocapture noundef readonly) local_unnamed_addr #1

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) local_unnamed_addr #2

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) local_unnamed_addr #3 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_(ptr noundef nonnull align 8 dereferenceable(8)) #2

; Function Attrs: nofree nounwind
declare noundef i32 @fclose(ptr nocapture noundef) local_unnamed_addr #1

; Function Attrs: nobuiltin allocsize(0)
declare noundef nonnull ptr @_Znam(i64 noundef) local_unnamed_addr #4

; Function Attrs: nobuiltin nounwind
declare void @_ZdaPv(ptr noundef) local_unnamed_addr #5

declare noalias ptr @png_create_info_struct(ptr noundef) local_unnamed_addr #6

; Function Attrs: nounwind returns_twice
declare i32 @_setjmp(ptr noundef) local_unnamed_addr #7

declare ptr @png_set_longjmp_fn(ptr noundef, ptr noundef, i64 noundef) local_unnamed_addr #6

; Function Attrs: noreturn nounwind
declare void @longjmp(ptr noundef, i32 noundef) #8

declare void @png_init_io(ptr noundef, ptr noundef) local_unnamed_addr #6

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN12ImageContent8writePNGEPKc(ptr noundef nonnull align 8 dereferenceable(80) %0, ptr nocapture noundef readonly %1) local_unnamed_addr #3 align 2 {
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = getelementptr inbounds i8, ptr %0, i64 12
  %6 = load i32, ptr %5, align 4, !tbaa !5
  %7 = icmp eq i32 %6, 0
  br i1 %7, label %174, label %8

8:                                                ; preds = %2
  call void @_ZN12ImageContent10float2charEv(ptr noundef nonnull align 8 dereferenceable(80) %0)
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #9
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #9
  %9 = call noalias ptr @png_create_write_struct(ptr noundef nonnull @.str.13, ptr noundef null, ptr noundef null, ptr noundef null)
  store ptr %9, ptr %3, align 8, !tbaa !11
  %10 = icmp eq ptr %9, null
  br i1 %10, label %11, label %14

11:                                               ; preds = %8
  %12 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef nonnull @.str.16)
  %13 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %12, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  call void @exit(i32 noundef 0) #10
  unreachable

14:                                               ; preds = %8
  %15 = call noalias ptr @png_create_info_struct(ptr noundef nonnull %9)
  store ptr %15, ptr %4, align 8, !tbaa !11
  %16 = icmp eq ptr %15, null
  br i1 %16, label %17, label %20

17:                                               ; preds = %14
  call void @png_destroy_write_struct(ptr noundef nonnull %3, ptr noundef null)
  %18 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef nonnull @.str.17)
  %19 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %18, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  call void @exit(i32 noundef 0) #10
  unreachable

20:                                               ; preds = %14
  %21 = load ptr, ptr %3, align 8, !tbaa !11
  %22 = call ptr @png_set_longjmp_fn(ptr noundef %21, ptr noundef nonnull @longjmp, i64 noundef 200)
  %23 = call i32 @_setjmp(ptr noundef %22) #11
  %.not = icmp eq i32 %23, 0
  br i1 %.not, label %27, label %24

24:                                               ; preds = %20
  call void @png_destroy_write_struct(ptr noundef nonnull %3, ptr noundef nonnull %4)
  %25 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef nonnull @.str.18)
  %26 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %25, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  call void @exit(i32 noundef 0) #10
  unreachable

27:                                               ; preds = %20
  %28 = call noalias ptr @fopen(ptr noundef %1, ptr noundef nonnull @.str.19)
  %29 = icmp eq ptr %28, null
  br i1 %29, label %173, label %30

30:                                               ; preds = %27
  %31 = load ptr, ptr %3, align 8, !tbaa !11
  call void @png_init_io(ptr noundef %31, ptr noundef nonnull %28)
  %32 = load i32, ptr %5, align 4, !tbaa !5
  switch i32 %32, label %54 [
    i32 1, label %33
    i32 3, label %33
  ]

33:                                               ; preds = %30, %30
  %34 = load ptr, ptr %3, align 8, !tbaa !11
  %35 = load ptr, ptr %4, align 8, !tbaa !11
  %36 = load i32, ptr %0, align 8, !tbaa !12
  %37 = getelementptr inbounds i8, ptr %0, i64 4
  %38 = load i32, ptr %37, align 4, !tbaa !13
  call void @png_set_IHDR(ptr noundef %34, ptr noundef %35, i32 noundef %36, i32 noundef %38, i32 noundef 8, i32 noundef 0, i32 noundef 0, i32 noundef 0, i32 noundef 0)
  %39 = load ptr, ptr %3, align 8, !tbaa !11
  %40 = load ptr, ptr %4, align 8, !tbaa !11
  %41 = getelementptr inbounds i8, ptr %0, i64 48
  %42 = load ptr, ptr %41, align 8, !tbaa !14
  call void @png_set_rows(ptr noundef %39, ptr noundef %40, ptr noundef %42)
  %43 = load ptr, ptr %3, align 8, !tbaa !11
  %44 = load ptr, ptr %4, align 8, !tbaa !11
  call void @png_write_png(ptr noundef %43, ptr noundef %44, i32 noundef 0, ptr noundef null)
  %45 = load i32, ptr %5, align 4, !tbaa !5
  %46 = icmp eq i32 %45, 3
  br i1 %46, label %47, label %54

47:                                               ; preds = %33
  %48 = load ptr, ptr %41, align 8, !tbaa !14
  %49 = load ptr, ptr %48, align 8, !tbaa !11
  %50 = icmp eq ptr %49, null
  br i1 %50, label %.thread73, label %51

51:                                               ; preds = %47
  call void @_ZdaPv(ptr noundef nonnull %49) #12
  %.pr = load ptr, ptr %41, align 8, !tbaa !14
  %52 = icmp eq ptr %.pr, null
  br i1 %52, label %.sink.split, label %.thread73

.thread73:                                        ; preds = %47, %51
  %53 = phi ptr [ %.pr, %51 ], [ %48, %47 ]
  call void @_ZdaPv(ptr noundef nonnull %53) #12
  br label %.sink.split

54:                                               ; preds = %30, %33
  %55 = phi i32 [ %32, %30 ], [ %45, %33 ]
  switch i32 %55, label %171 [
    i32 5, label %56
    i32 12, label %56
  ]

56:                                               ; preds = %54, %54
  %57 = load ptr, ptr %3, align 8, !tbaa !11
  %58 = load ptr, ptr %4, align 8, !tbaa !11
  %59 = load i32, ptr %0, align 8, !tbaa !12
  %60 = getelementptr inbounds i8, ptr %0, i64 4
  %61 = load i32, ptr %60, align 4, !tbaa !13
  call void @png_set_IHDR(ptr noundef %57, ptr noundef %58, i32 noundef %59, i32 noundef %61, i32 noundef 8, i32 noundef 2, i32 noundef 0, i32 noundef 0, i32 noundef 0)
  %62 = load i32, ptr %60, align 4, !tbaa !13
  %63 = zext i32 %62 to i64
  %64 = shl nuw nsw i64 %63, 3
  %65 = call noalias noundef nonnull ptr @_Znam(i64 noundef %64) #13
  %66 = getelementptr inbounds i8, ptr %0, i64 8
  %67 = load i32, ptr %66, align 8, !tbaa !15
  %68 = mul i32 %67, 3
  %69 = zext i32 %68 to i64
  %70 = call noalias noundef nonnull ptr @_Znam(i64 noundef %69) #13
  store ptr %70, ptr %65, align 8, !tbaa !11
  %71 = icmp ugt i32 %62, 1
  br i1 %71, label %.lr.ph, label %.preheader54

.lr.ph:                                           ; preds = %56
  %72 = load i32, ptr %0, align 8, !tbaa !12
  %factor.op.mul = mul i32 %72, 3
  %73 = add nsw i64 %63, -1
  %74 = add nsw i64 %63, -2
  %xtraiter = and i64 %73, 3
  %75 = icmp ult i64 %74, 3
  br i1 %75, label %.preheader54.loopexit.unr-lcssa, label %.lr.ph.new

.lr.ph.new:                                       ; preds = %.lr.ph
  %unroll_iter = and i64 %73, -4
  br label %84

.preheader54.loopexit.unr-lcssa:                  ; preds = %84, %.lr.ph
  %indvars.iv.unr = phi i64 [ 1, %.lr.ph ], [ %indvars.iv.next.3, %84 ]
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br i1 %lcmp.mod.not, label %.preheader54, label %.epil.preheader

.epil.preheader:                                  ; preds = %.preheader54.loopexit.unr-lcssa, %.epil.preheader
  %indvars.iv.epil = phi i64 [ %indvars.iv.next.epil, %.epil.preheader ], [ %indvars.iv.unr, %.preheader54.loopexit.unr-lcssa ]
  %epil.iter = phi i64 [ %epil.iter.next, %.epil.preheader ], [ 0, %.preheader54.loopexit.unr-lcssa ]
  %76 = trunc nuw i64 %indvars.iv.epil to i32
  %.reass.epil = mul i32 %factor.op.mul, %76
  %77 = zext i32 %.reass.epil to i64
  %78 = getelementptr inbounds i8, ptr %70, i64 %77
  %79 = getelementptr inbounds ptr, ptr %65, i64 %indvars.iv.epil
  store ptr %78, ptr %79, align 8, !tbaa !11
  %indvars.iv.next.epil = add nuw nsw i64 %indvars.iv.epil, 1
  %epil.iter.next = add i64 %epil.iter, 1
  %epil.iter.cmp.not = icmp eq i64 %epil.iter.next, %xtraiter
  br i1 %epil.iter.cmp.not, label %.preheader54, label %.epil.preheader, !llvm.loop !16

.preheader54:                                     ; preds = %.preheader54.loopexit.unr-lcssa, %.epil.preheader, %56
  %.not61 = icmp eq i32 %62, 0
  br i1 %.not61, label %._crit_edge60, label %.preheader.lr.ph

.preheader.lr.ph:                                 ; preds = %.preheader54
  %80 = getelementptr inbounds i8, ptr %0, i64 56
  %81 = getelementptr inbounds i8, ptr %0, i64 64
  %82 = getelementptr inbounds i8, ptr %0, i64 72
  %83 = load i32, ptr %0, align 8, !tbaa !12
  %.not62 = icmp eq i32 %83, 0
  br i1 %.not62, label %._crit_edge60, label %.preheader

84:                                               ; preds = %84, %.lr.ph.new
  %indvars.iv = phi i64 [ 1, %.lr.ph.new ], [ %indvars.iv.next.3, %84 ]
  %niter = phi i64 [ 0, %.lr.ph.new ], [ %niter.next.3, %84 ]
  %85 = trunc nuw i64 %indvars.iv to i32
  %.reass = mul i32 %factor.op.mul, %85
  %86 = zext i32 %.reass to i64
  %87 = getelementptr inbounds i8, ptr %70, i64 %86
  %88 = getelementptr inbounds ptr, ptr %65, i64 %indvars.iv
  store ptr %87, ptr %88, align 8, !tbaa !11
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %89 = trunc nuw i64 %indvars.iv.next to i32
  %.reass.1 = mul i32 %factor.op.mul, %89
  %90 = zext i32 %.reass.1 to i64
  %91 = getelementptr inbounds i8, ptr %70, i64 %90
  %92 = getelementptr inbounds ptr, ptr %65, i64 %indvars.iv.next
  store ptr %91, ptr %92, align 8, !tbaa !11
  %indvars.iv.next.1 = add nuw nsw i64 %indvars.iv, 2
  %93 = trunc nuw i64 %indvars.iv.next.1 to i32
  %.reass.2 = mul i32 %factor.op.mul, %93
  %94 = zext i32 %.reass.2 to i64
  %95 = getelementptr inbounds i8, ptr %70, i64 %94
  %96 = getelementptr inbounds ptr, ptr %65, i64 %indvars.iv.next.1
  store ptr %95, ptr %96, align 8, !tbaa !11
  %indvars.iv.next.2 = add nuw nsw i64 %indvars.iv, 3
  %97 = trunc nuw i64 %indvars.iv.next.2 to i32
  %.reass.3 = mul i32 %factor.op.mul, %97
  %98 = zext i32 %.reass.3 to i64
  %99 = getelementptr inbounds i8, ptr %70, i64 %98
  %100 = getelementptr inbounds ptr, ptr %65, i64 %indvars.iv.next.2
  store ptr %99, ptr %100, align 8, !tbaa !11
  %indvars.iv.next.3 = add nuw nsw i64 %indvars.iv, 4
  %niter.next.3 = add i64 %niter, 4
  %niter.ncmp.3 = icmp eq i64 %niter.next.3, %unroll_iter
  br i1 %niter.ncmp.3, label %.preheader54.loopexit.unr-lcssa, label %84, !llvm.loop !18

.preheader:                                       ; preds = %.preheader.lr.ph, %._crit_edge
  %101 = phi i32 [ %110, %._crit_edge ], [ %62, %.preheader.lr.ph ]
  %102 = phi i32 [ %111, %._crit_edge ], [ 1, %.preheader.lr.ph ]
  %indvars.iv69 = phi i64 [ %indvars.iv.next70, %._crit_edge ], [ 0, %.preheader.lr.ph ]
  %.not63 = icmp eq i32 %102, 0
  br i1 %.not63, label %._crit_edge, label %.lr.ph58

.lr.ph58:                                         ; preds = %.preheader
  %103 = getelementptr inbounds ptr, ptr %65, i64 %indvars.iv69
  %.pre = load ptr, ptr %103, align 8, !tbaa !11
  br label %114

._crit_edge60:                                    ; preds = %._crit_edge, %.preheader.lr.ph, %.preheader54
  %104 = load ptr, ptr %3, align 8, !tbaa !11
  %105 = load ptr, ptr %4, align 8, !tbaa !11
  call void @png_set_rows(ptr noundef %104, ptr noundef %105, ptr noundef nonnull %65)
  %106 = load ptr, ptr %3, align 8, !tbaa !11
  %107 = load ptr, ptr %4, align 8, !tbaa !11
  call void @png_write_png(ptr noundef %106, ptr noundef %107, i32 noundef 0, ptr noundef null)
  %108 = load ptr, ptr %65, align 8, !tbaa !11
  %109 = icmp eq ptr %108, null
  br i1 %109, label %143, label %142

._crit_edge.loopexit:                             ; preds = %114
  %.pre72 = load i32, ptr %60, align 4, !tbaa !13
  br label %._crit_edge

._crit_edge:                                      ; preds = %._crit_edge.loopexit, %.preheader
  %110 = phi i32 [ %.pre72, %._crit_edge.loopexit ], [ %101, %.preheader ]
  %111 = phi i32 [ %139, %._crit_edge.loopexit ], [ 0, %.preheader ]
  %indvars.iv.next70 = add nuw nsw i64 %indvars.iv69, 1
  %112 = zext i32 %110 to i64
  %113 = icmp ult i64 %indvars.iv.next70, %112
  br i1 %113, label %.preheader, label %._crit_edge60, !llvm.loop !20

114:                                              ; preds = %.lr.ph58, %114
  %indvars.iv66 = phi i64 [ 0, %.lr.ph58 ], [ %indvars.iv.next67, %114 ]
  %.057 = phi i32 [ 0, %.lr.ph58 ], [ %136, %114 ]
  %115 = load ptr, ptr %80, align 8, !tbaa !22
  %116 = getelementptr inbounds ptr, ptr %115, i64 %indvars.iv69
  %117 = load ptr, ptr %116, align 8, !tbaa !11
  %118 = getelementptr inbounds i8, ptr %117, i64 %indvars.iv66
  %119 = load i8, ptr %118, align 1, !tbaa !23
  %120 = add i32 %.057, 1
  %121 = zext i32 %.057 to i64
  %122 = getelementptr inbounds i8, ptr %.pre, i64 %121
  store i8 %119, ptr %122, align 1, !tbaa !23
  %123 = load ptr, ptr %81, align 8, !tbaa !24
  %124 = getelementptr inbounds ptr, ptr %123, i64 %indvars.iv69
  %125 = load ptr, ptr %124, align 8, !tbaa !11
  %126 = getelementptr inbounds i8, ptr %125, i64 %indvars.iv66
  %127 = load i8, ptr %126, align 1, !tbaa !23
  %128 = add i32 %.057, 2
  %129 = zext i32 %120 to i64
  %130 = getelementptr inbounds i8, ptr %.pre, i64 %129
  store i8 %127, ptr %130, align 1, !tbaa !23
  %131 = load ptr, ptr %82, align 8, !tbaa !25
  %132 = getelementptr inbounds ptr, ptr %131, i64 %indvars.iv69
  %133 = load ptr, ptr %132, align 8, !tbaa !11
  %134 = getelementptr inbounds i8, ptr %133, i64 %indvars.iv66
  %135 = load i8, ptr %134, align 1, !tbaa !23
  %136 = add i32 %.057, 3
  %137 = zext i32 %128 to i64
  %138 = getelementptr inbounds i8, ptr %.pre, i64 %137
  store i8 %135, ptr %138, align 1, !tbaa !23
  %indvars.iv.next67 = add nuw nsw i64 %indvars.iv66, 1
  %139 = load i32, ptr %0, align 8, !tbaa !12
  %140 = zext i32 %139 to i64
  %141 = icmp ult i64 %indvars.iv.next67, %140
  br i1 %141, label %114, label %._crit_edge.loopexit, !llvm.loop !26

142:                                              ; preds = %._crit_edge60
  call void @_ZdaPv(ptr noundef nonnull %108) #12
  br label %143

143:                                              ; preds = %._crit_edge60, %142
  call void @_ZdaPv(ptr noundef nonnull %65) #12
  %144 = load i32, ptr %5, align 4, !tbaa !5
  %145 = icmp eq i32 %144, 12
  br i1 %145, label %146, label %171

146:                                              ; preds = %143
  %147 = getelementptr inbounds i8, ptr %0, i64 56
  %148 = load ptr, ptr %147, align 8, !tbaa !22
  %149 = load ptr, ptr %148, align 8, !tbaa !11
  %150 = icmp eq ptr %149, null
  br i1 %150, label %.thread74, label %151

151:                                              ; preds = %146
  call void @_ZdaPv(ptr noundef nonnull %149) #12
  %.pr51 = load ptr, ptr %147, align 8, !tbaa !22
  %152 = icmp eq ptr %.pr51, null
  br i1 %152, label %154, label %.thread74

.thread74:                                        ; preds = %146, %151
  %153 = phi ptr [ %.pr51, %151 ], [ %148, %146 ]
  call void @_ZdaPv(ptr noundef nonnull %153) #12
  br label %154

154:                                              ; preds = %.thread74, %151
  store ptr null, ptr %147, align 8, !tbaa !22
  %155 = getelementptr inbounds i8, ptr %0, i64 64
  %156 = load ptr, ptr %155, align 8, !tbaa !24
  %157 = load ptr, ptr %156, align 8, !tbaa !11
  %158 = icmp eq ptr %157, null
  br i1 %158, label %.thread75, label %159

159:                                              ; preds = %154
  call void @_ZdaPv(ptr noundef nonnull %157) #12
  %.pr52 = load ptr, ptr %155, align 8, !tbaa !24
  %160 = icmp eq ptr %.pr52, null
  br i1 %160, label %162, label %.thread75

.thread75:                                        ; preds = %154, %159
  %161 = phi ptr [ %.pr52, %159 ], [ %156, %154 ]
  call void @_ZdaPv(ptr noundef nonnull %161) #12
  br label %162

162:                                              ; preds = %.thread75, %159
  store ptr null, ptr %155, align 8, !tbaa !24
  %163 = getelementptr inbounds i8, ptr %0, i64 72
  %164 = load ptr, ptr %163, align 8, !tbaa !25
  %165 = load ptr, ptr %164, align 8, !tbaa !11
  %166 = icmp eq ptr %165, null
  br i1 %166, label %.thread76, label %167

167:                                              ; preds = %162
  call void @_ZdaPv(ptr noundef nonnull %165) #12
  %.pr53 = load ptr, ptr %163, align 8, !tbaa !25
  %168 = icmp eq ptr %.pr53, null
  br i1 %168, label %170, label %.thread76

.thread76:                                        ; preds = %162, %167
  %169 = phi ptr [ %.pr53, %167 ], [ %164, %162 ]
  call void @_ZdaPv(ptr noundef nonnull %169) #12
  br label %170

170:                                              ; preds = %.thread76, %167
  store ptr null, ptr %163, align 8, !tbaa !25
  br label %.sink.split

.sink.split:                                      ; preds = %.thread73, %51, %170
  %.sink = phi i32 [ 8, %170 ], [ 2, %51 ], [ 2, %.thread73 ]
  store i32 %.sink, ptr %5, align 4, !tbaa !5
  br label %171

171:                                              ; preds = %.sink.split, %143, %54
  call void @png_destroy_write_struct(ptr noundef nonnull %3, ptr noundef nonnull %4)
  %172 = call i32 @fclose(ptr noundef nonnull %28)
  br label %173

173:                                              ; preds = %27, %171
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #9
  br label %174

174:                                              ; preds = %2, %173
  ret void
}

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN12ImageContent10float2charEv(ptr noundef nonnull align 8 dereferenceable(80)) local_unnamed_addr #3 align 2

declare noalias ptr @png_create_write_struct(ptr noundef, ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #6

; Function Attrs: noreturn nounwind
declare void @exit(i32 noundef) local_unnamed_addr #8

declare void @png_destroy_write_struct(ptr noundef, ptr noundef) local_unnamed_addr #6

declare void @png_set_IHDR(ptr noundef, ptr noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef) local_unnamed_addr #6

declare void @png_set_rows(ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #6

declare void @png_write_png(ptr noundef, ptr noundef, i32 noundef, ptr noundef) local_unnamed_addr #6

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { nofree nounwind "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 = { inlinehint mustprogress 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 = { mustprogress 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 #4 = { nobuiltin allocsize(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 #5 = { nobuiltin nounwind "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 #6 = { "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 #7 = { nounwind returns_twice "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 #8 = { noreturn nounwind "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 #9 = { nounwind }
attributes #10 = { noreturn nounwind }
attributes #11 = { nounwind returns_twice }
attributes #12 = { builtin nounwind }
attributes #13 = { builtin allocsize(0) }

!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 12}
!6 = !{!"_ZTS12ImageContent", !7, i64 0, !7, i64 4, !7, i64 8, !7, i64 12, !10, i64 16, !10, i64 24, !10, i64 32, !10, i64 40, !10, i64 48, !10, i64 56, !10, i64 64, !10, i64 72}
!7 = !{!"int", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!"any pointer", !8, i64 0}
!11 = !{!10, !10, i64 0}
!12 = !{!6, !7, i64 0}
!13 = !{!6, !7, i64 4}
!14 = !{!6, !10, i64 48}
!15 = !{!6, !7, i64 8}
!16 = distinct !{!16, !17}
!17 = !{!"llvm.loop.unroll.disable"}
!18 = distinct !{!18, !19}
!19 = !{!"llvm.loop.mustprogress"}
!20 = distinct !{!20, !19, !21}
!21 = !{!"llvm.loop.unswitch.partial.disable"}
!22 = !{!6, !10, i64 56}
!23 = !{!8, !8, i64 0}
!24 = !{!6, !10, i64 64}
!25 = !{!6, !10, i64 72}
!26 = distinct !{!26, !19}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LICMPass,LoopRotatePass,LoopSimplifyCFGPass,LoopSimplifyPass,LoopUnrollPass,PostOrderFunctionAttrsPass,SROAPass,SimpleLoopUnswitchPass,SimplifyCFGPass