; LLVM IR from JayXon/Leanify :: formats/gz.ll (ZN2Gz7LeanifyEm)

; 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 }
%struct.LodePNGDecompressSettings = type { i32, i32, i64, ptr, ptr, ptr }
%"class.std::__cxx11::basic_string" = type { %"struct.std::__cxx11::basic_string<char>::_Alloc_hider", i64, %union.anon }
%"struct.std::__cxx11::basic_string<char>::_Alloc_hider" = type { ptr }
%union.anon = type { i64, [8 x i8] }
%struct.ZopfliOptions = type { i32, i32, i32, i32, i32, i32 }
%class.Format = type { ptr, ptr, i64 }

@_ZSt4cerr = external global %"class.std::basic_ostream", align 8
@.str = external hidden unnamed_addr constant [21 x i8], align 1
@depth = external global i32, align 4
@is_fast = external global i8, align 1
@lodepng_default_decompress_settings = external global %struct.LodePNGDecompressSettings, align 8
@.str.1 = external hidden unnamed_addr constant [14 x i8], align 1
@iterations = external global i32, align 4

; Function Attrs: mustprogress uwtable
define dso_local noundef i64 @_ZN2Gz7LeanifyEm(ptr noundef nonnull align 8 dereferenceable(24) %0, i64 noundef %1) unnamed_addr #0 align 2 personality ptr @__gxx_personality_v0 {
  %3 = alloca i64, align 8
  %4 = alloca ptr, align 8
  %5 = alloca i64, align 8
  %6 = alloca i8, align 1
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca %"class.std::__cxx11::basic_string", align 8
  %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
  %15 = alloca i64, align 8
  %16 = alloca i64, align 8
  %17 = alloca ptr, align 8
  %18 = alloca %struct.ZopfliOptions, align 4
  %19 = alloca i8, align 1
  %20 = alloca ptr, align 8
  %21 = alloca i64, align 8
  store ptr %0, ptr %4, align 8, !tbaa !5
  store i64 %1, ptr %5, align 8, !tbaa !9
  %22 = load ptr, ptr %4, align 8
  %23 = getelementptr inbounds %class.Format, ptr %22, i32 0, i32 2
  %24 = load i64, ptr %23, align 8, !tbaa !11
  %25 = icmp ule i64 %24, 18
  br i1 %25, label %26, label %31

26:                                               ; preds = %2
  %27 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cerr, ptr noundef @.str)
  %28 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %27, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  %29 = load i64, ptr %5, align 8, !tbaa !9
  %30 = call noundef i64 @_ZN6Format7LeanifyEm(ptr noundef nonnull align 8 dereferenceable(24) %22, i64 noundef %29)
  store i64 %30, ptr %3, align 8
  br label %317

31:                                               ; preds = %2
  %32 = load i32, ptr @depth, align 4, !tbaa !13
  %33 = add nsw i32 %32, 1
  store i32 %33, ptr @depth, align 4, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 1, ptr %6) #7
  %34 = getelementptr inbounds %class.Format, ptr %22, i32 0, i32 1
  %35 = load ptr, ptr %34, align 8, !tbaa !15
  %36 = getelementptr inbounds i8, ptr %35, i64 3
  %37 = load i8, ptr %36, align 1, !tbaa !16
  store i8 %37, ptr %6, align 1, !tbaa !16
  %38 = getelementptr inbounds %class.Format, ptr %22, i32 0, i32 1
  %39 = load ptr, ptr %38, align 8, !tbaa !15
  %40 = load i64, ptr %5, align 8, !tbaa !9
  %41 = sub i64 0, %40
  %42 = getelementptr inbounds i8, ptr %39, i64 %41
  %43 = getelementptr inbounds %class.Format, ptr %22, i32 0, i32 1
  %44 = load ptr, ptr %43, align 8, !tbaa !15
  call void @llvm.memmove.p0.p0.i64(ptr align 1 %42, ptr align 1 %44, i64 10, i1 false)
  %45 = getelementptr inbounds %class.Format, ptr %22, i32 0, i32 1
  %46 = load ptr, ptr %45, align 8, !tbaa !15
  %47 = getelementptr inbounds i8, ptr %46, i64 3
  %48 = load i64, ptr %5, align 8, !tbaa !9
  %49 = sub i64 0, %48
  %50 = getelementptr inbounds i8, ptr %47, i64 %49
  store i8 0, ptr %50, align 1, !tbaa !16
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #7
  %51 = getelementptr inbounds %class.Format, ptr %22, i32 0, i32 1
  %52 = load ptr, ptr %51, align 8, !tbaa !15
  %53 = getelementptr inbounds i8, ptr %52, i64 10
  store ptr %53, ptr %7, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #7
  %54 = load ptr, ptr %7, align 8, !tbaa !5
  %55 = load i64, ptr %5, align 8, !tbaa !9
  %56 = sub i64 0, %55
  %57 = getelementptr inbounds i8, ptr %54, i64 %56
  store ptr %57, ptr %8, align 8, !tbaa !5
  %58 = load ptr, ptr %8, align 8, !tbaa !5
  %59 = getelementptr inbounds i8, ptr %58, i64 -2
  store i8 2, ptr %59, align 1, !tbaa !16
  %60 = load i8, ptr %6, align 1, !tbaa !16
  %61 = zext i8 %60 to i32
  %62 = and i32 %61, 4
  %63 = icmp ne i32 %62, 0
  br i1 %63, label %64, label %72

64:                                               ; preds = %31
  %65 = load ptr, ptr %7, align 8, !tbaa !5
  %66 = load i16, ptr %65, align 2, !tbaa !17
  %67 = zext i16 %66 to i32
  %68 = add nsw i32 %67, 2
  %69 = load ptr, ptr %7, align 8, !tbaa !5
  %70 = sext i32 %68 to i64
  %71 = getelementptr inbounds i8, ptr %69, i64 %70
  store ptr %71, ptr %7, align 8, !tbaa !5
  br label %72

72:                                               ; preds = %64, %31
  call void @llvm.lifetime.start.p0(i64 32, ptr %9) #7
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2Ev(ptr noundef nonnull align 8 dereferenceable(32) %9) #7
  %73 = load i8, ptr %6, align 1, !tbaa !16
  %74 = zext i8 %73 to i32
  %75 = and i32 %74, 8
  %76 = icmp ne i32 %75, 0
  br i1 %76, label %77, label %103

77:                                               ; preds = %72
  %78 = load ptr, ptr %7, align 8, !tbaa !5
  %79 = invoke noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE6assignEPKc(ptr noundef nonnull align 8 dereferenceable(32) %9, ptr noundef %78)
          to label %80 unwind label %98

80:                                               ; preds = %77
  invoke void @_Z13PrintFileNameRKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(ptr noundef nonnull align 8 dereferenceable(32) %9)
          to label %81 unwind label %98

81:                                               ; preds = %80
  br label %82

82:                                               ; preds = %97, %81
  %83 = load ptr, ptr %7, align 8, !tbaa !5
  %84 = getelementptr inbounds %class.Format, ptr %22, i32 0, i32 1
  %85 = load ptr, ptr %84, align 8, !tbaa !15
  %86 = getelementptr inbounds %class.Format, ptr %22, i32 0, i32 2
  %87 = load i64, ptr %86, align 8, !tbaa !11
  %88 = getelementptr inbounds i8, ptr %85, i64 %87
  %89 = icmp ult ptr %83, %88
  br i1 %89, label %90, label %95

90:                                               ; preds = %82
  %91 = load ptr, ptr %7, align 8, !tbaa !5
  %92 = getelementptr inbounds i8, ptr %91, i32 1
  store ptr %92, ptr %7, align 8, !tbaa !5
  %93 = load i8, ptr %91, align 1, !tbaa !16
  %94 = icmp ne i8 %93, 0
  br label %95

95:                                               ; preds = %90, %82
  %96 = phi i1 [ false, %82 ], [ %94, %90 ]
  br i1 %96, label %97, label %102

97:                                               ; preds = %95
  br label %82, !llvm.loop !19

98:                                               ; preds = %80, %77
  %99 = landingpad { ptr, i32 }
          cleanup
  %100 = extractvalue { ptr, i32 } %99, 0
  store ptr %100, ptr %10, align 8
  %101 = extractvalue { ptr, i32 } %99, 1
  store i32 %101, ptr %11, align 4
  br label %316

102:                                              ; preds = %95
  br label %103

103:                                              ; preds = %102, %72
  %104 = load i8, ptr %6, align 1, !tbaa !16
  %105 = zext i8 %104 to i32
  %106 = and i32 %105, 16
  %107 = icmp ne i32 %106, 0
  br i1 %107, label %108, label %126

108:                                              ; preds = %103
  br label %109

109:                                              ; preds = %124, %108
  %110 = load ptr, ptr %7, align 8, !tbaa !5
  %111 = getelementptr inbounds %class.Format, ptr %22, i32 0, i32 1
  %112 = load ptr, ptr %111, align 8, !tbaa !15
  %113 = getelementptr inbounds %class.Format, ptr %22, i32 0, i32 2
  %114 = load i64, ptr %113, align 8, !tbaa !11
  %115 = getelementptr inbounds i8, ptr %112, i64 %114
  %116 = icmp ult ptr %110, %115
  br i1 %116, label %117, label %122

117:                                              ; preds = %109
  %118 = load ptr, ptr %7, align 8, !tbaa !5
  %119 = getelementptr inbounds i8, ptr %118, i32 1
  store ptr %119, ptr %7, align 8, !tbaa !5
  %120 = load i8, ptr %118, align 1, !tbaa !16
  %121 = icmp ne i8 %120, 0
  br label %122

122:                                              ; preds = %117, %109
  %123 = phi i1 [ false, %109 ], [ %121, %117 ]
  br i1 %123, label %124, label %125

124:                                              ; preds = %122
  br label %109, !llvm.loop !21

125:                                              ; preds = %122
  br label %126

126:                                              ; preds = %125, %103
  %127 = load i8, ptr %6, align 1, !tbaa !16
  %128 = zext i8 %127 to i32
  %129 = and i32 %128, 2
  %130 = icmp ne i32 %129, 0
  br i1 %130, label %131, label %134

131:                                              ; preds = %126
  %132 = load ptr, ptr %7, align 8, !tbaa !5
  %133 = getelementptr inbounds i8, ptr %132, i64 2
  store ptr %133, ptr %7, align 8, !tbaa !5
  br label %134

134:                                              ; preds = %131, %126
  %135 = load ptr, ptr %7, align 8, !tbaa !5
  %136 = getelementptr inbounds %class.Format, ptr %22, i32 0, i32 1
  %137 = load ptr, ptr %136, align 8, !tbaa !15
  %138 = getelementptr inbounds %class.Format, ptr %22, i32 0, i32 2
  %139 = load i64, ptr %138, align 8, !tbaa !11
  %140 = getelementptr inbounds i8, ptr %137, i64 %139
  %141 = icmp uge ptr %135, %140
  br i1 %141, label %142, label %152

142:                                              ; preds = %134
  %143 = load ptr, ptr %8, align 8, !tbaa !5
  %144 = getelementptr inbounds %class.Format, ptr %22, i32 0, i32 1
  %145 = load ptr, ptr %144, align 8, !tbaa !15
  %146 = getelementptr inbounds i8, ptr %145, i64 10
  %147 = getelementptr inbounds %class.Format, ptr %22, i32 0, i32 2
  %148 = load i64, ptr %147, align 8, !tbaa !11
  %149 = sub i64 %148, 10
  call void @llvm.memmove.p0.p0.i64(ptr align 1 %143, ptr align 1 %146, i64 %149, i1 false)
  %150 = getelementptr inbounds %class.Format, ptr %22, i32 0, i32 2
  %151 = load i64, ptr %150, align 8, !tbaa !11
  store i64 %151, ptr %3, align 8
  store i32 1, ptr %12, align 4
  br label %315

152:                                              ; preds = %134
  %153 = load i8, ptr @is_fast, align 1, !tbaa !22, !range !24, !noundef !25
  %154 = trunc i8 %153 to i1
  br i1 %154, label %155, label %175

155:                                              ; preds = %152
  %156 = load ptr, ptr %8, align 8, !tbaa !5
  %157 = load ptr, ptr %7, align 8, !tbaa !5
  %158 = getelementptr inbounds %class.Format, ptr %22, i32 0, i32 1
  %159 = load ptr, ptr %158, align 8, !tbaa !15
  %160 = getelementptr inbounds %class.Format, ptr %22, i32 0, i32 2
  %161 = load i64, ptr %160, align 8, !tbaa !11
  %162 = getelementptr inbounds i8, ptr %159, i64 %161
  %163 = load ptr, ptr %7, align 8, !tbaa !5
  %164 = ptrtoint ptr %162 to i64
  %165 = ptrtoint ptr %163 to i64
  %166 = sub i64 %164, %165
  call void @llvm.memmove.p0.p0.i64(ptr align 1 %156, ptr align 1 %157, i64 %166, i1 false)
  %167 = getelementptr inbounds %class.Format, ptr %22, i32 0, i32 2
  %168 = load i64, ptr %167, align 8, !tbaa !11
  %169 = load ptr, ptr %7, align 8, !tbaa !5
  %170 = load ptr, ptr %8, align 8, !tbaa !5
  %171 = ptrtoint ptr %169 to i64
  %172 = ptrtoint ptr %170 to i64
  %173 = sub i64 %171, %172
  %174 = sub i64 %168, %173
  store i64 %174, ptr %3, align 8
  store i32 1, ptr %12, align 4
  br label %315

175:                                              ; preds = %152
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #7
  %176 = getelementptr inbounds %class.Format, ptr %22, i32 0, i32 1
  %177 = load ptr, ptr %176, align 8, !tbaa !15
  %178 = getelementptr inbounds %class.Format, ptr %22, i32 0, i32 2
  %179 = load i64, ptr %178, align 8, !tbaa !11
  %180 = getelementptr inbounds i8, ptr %177, i64 %179
  %181 = getelementptr inbounds i8, ptr %180, i64 -4
  %182 = load i32, ptr %181, align 4, !tbaa !13
  store i32 %182, ptr %13, align 4, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #7
  %183 = getelementptr inbounds %class.Format, ptr %22, i32 0, i32 1
  %184 = load ptr, ptr %183, align 8, !tbaa !15
  %185 = getelementptr inbounds %class.Format, ptr %22, i32 0, i32 2
  %186 = load i64, ptr %185, align 8, !tbaa !11
  %187 = getelementptr inbounds i8, ptr %184, i64 %186
  %188 = getelementptr inbounds i8, ptr %187, i64 -8
  %189 = load i32, ptr %188, align 4, !tbaa !13
  store i32 %189, ptr %14, align 4, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #7
  %190 = getelementptr inbounds %class.Format, ptr %22, i32 0, i32 1
  %191 = load ptr, ptr %190, align 8, !tbaa !15
  %192 = getelementptr inbounds %class.Format, ptr %22, i32 0, i32 2
  %193 = load i64, ptr %192, align 8, !tbaa !11
  %194 = getelementptr inbounds i8, ptr %191, i64 %193
  %195 = getelementptr inbounds i8, ptr %194, i64 -8
  %196 = load ptr, ptr %7, align 8, !tbaa !5
  %197 = ptrtoint ptr %195 to i64
  %198 = ptrtoint ptr %196 to i64
  %199 = sub i64 %197, %198
  store i64 %199, ptr %15, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #7
  store i64 0, ptr %16, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #7
  store ptr null, ptr %17, align 8, !tbaa !5
  %200 = load ptr, ptr %7, align 8, !tbaa !5
  %201 = load i64, ptr %15, align 8, !tbaa !9
  %202 = invoke noundef i32 @_Z15lodepng_inflatePPhPmPKhmPK25LodePNGDecompressSettings(ptr noundef %17, ptr noundef %16, ptr noundef %200, i64 noundef %201, ptr noundef @lodepng_default_decompress_settings)
          to label %203 unwind label %239

203:                                              ; preds = %175
  %204 = icmp ne i32 %202, 0
  br i1 %204, label %221, label %205

205:                                              ; preds = %203
  %206 = load ptr, ptr %17, align 8, !tbaa !5
  %207 = icmp ne ptr %206, null
  br i1 %207, label %208, label %221

208:                                              ; preds = %205
  %209 = load i64, ptr %16, align 8, !tbaa !9
  %210 = load i32, ptr %13, align 4, !tbaa !13
  %211 = zext i32 %210 to i64
  %212 = icmp ne i64 %209, %211
  br i1 %212, label %221, label %213

213:                                              ; preds = %208
  %214 = load i32, ptr %14, align 4, !tbaa !13
  %215 = load ptr, ptr %17, align 8, !tbaa !5
  %216 = load i32, ptr %13, align 4, !tbaa !13
  %217 = zext i32 %216 to i64
  %218 = invoke noundef i32 @_Z13lodepng_crc32PKhm(ptr noundef %215, i64 noundef %217)
          to label %219 unwind label %239

219:                                              ; preds = %213
  %220 = icmp ne i32 %214, %218
  br i1 %220, label %221, label %243

221:                                              ; preds = %219, %208, %205, %203
  %222 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cerr, ptr noundef @.str.1)
          to label %223 unwind label %239

223:                                              ; preds = %221
  %224 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %222, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
          to label %225 unwind label %239

225:                                              ; preds = %223
  %226 = load ptr, ptr %17, align 8, !tbaa !5
  call void @free(ptr noundef %226) #7
  %227 = load ptr, ptr %8, align 8, !tbaa !5
  %228 = load ptr, ptr %7, align 8, !tbaa !5
  %229 = load i64, ptr %15, align 8, !tbaa !9
  %230 = add i64 %229, 8
  call void @llvm.memmove.p0.p0.i64(ptr align 1 %227, ptr align 1 %228, i64 %230, i1 false)
  %231 = getelementptr inbounds %class.Format, ptr %22, i32 0, i32 2
  %232 = load i64, ptr %231, align 8, !tbaa !11
  %233 = load ptr, ptr %7, align 8, !tbaa !5
  %234 = load ptr, ptr %8, align 8, !tbaa !5
  %235 = ptrtoint ptr %233 to i64
  %236 = ptrtoint ptr %234 to i64
  %237 = sub i64 %235, %236
  %238 = sub i64 %232, %237
  store i64 %238, ptr %3, align 8
  store i32 1, ptr %12, align 4
  br label %313

239:                                              ; preds = %243, %223, %221, %213, %175
  %240 = landingpad { ptr, i32 }
          cleanup
  %241 = extractvalue { ptr, i32 } %240, 0
  store ptr %241, ptr %10, align 8
  %242 = extractvalue { ptr, i32 } %240, 1
  store i32 %242, ptr %11, align 4
  br label %314

243:                                              ; preds = %219
  %244 = load ptr, ptr %17, align 8, !tbaa !5
  %245 = load i32, ptr %13, align 4, !tbaa !13
  %246 = zext i32 %245 to i64
  %247 = invoke noundef i64 @_Z11LeanifyFilePvmmRKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(ptr noundef %244, i64 noundef %246, i64 noundef 0, ptr noundef nonnull align 8 dereferenceable(32) %9)
          to label %248 unwind label %239

248:                                              ; preds = %243
  %249 = trunc i64 %247 to i32
  store i32 %249, ptr %13, align 4, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 24, ptr %18) #7
  invoke void @ZopfliInitOptions(ptr noundef %18)
          to label %250 unwind label %276

250:                                              ; preds = %248
  %251 = load i32, ptr @iterations, align 4, !tbaa !13
  %252 = getelementptr inbounds %struct.ZopfliOptions, ptr %18, i32 0, i32 2
  store i32 %251, ptr %252, align 4, !tbaa !26
  call void @llvm.lifetime.start.p0(i64 1, ptr %19) #7
  store i8 0, ptr %19, align 1, !tbaa !16
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #7
  store ptr null, ptr %20, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %21) #7
  store i64 0, ptr %21, align 8, !tbaa !9
  %253 = load ptr, ptr %17, align 8, !tbaa !5
  %254 = load i32, ptr %13, align 4, !tbaa !13
  %255 = zext i32 %254 to i64
  invoke void @ZopfliDeflate(ptr noundef %18, i32 noundef 2, i32 noundef 1, ptr noundef %253, i64 noundef %255, ptr noundef %19, ptr noundef %20, ptr noundef %21)
          to label %256 unwind label %280

256:                                              ; preds = %250
  %257 = load i64, ptr %21, align 8, !tbaa !9
  %258 = load i64, ptr %15, align 8, !tbaa !9
  %259 = icmp ult i64 %257, %258
  br i1 %259, label %260, label %284

260:                                              ; preds = %256
  %261 = load ptr, ptr %8, align 8, !tbaa !5
  %262 = load ptr, ptr %20, align 8, !tbaa !5
  %263 = load i64, ptr %21, align 8, !tbaa !9
  call void @llvm.memcpy.p0.p0.i64(ptr align 1 %261, ptr align 1 %262, i64 %263, i1 false)
  %264 = load i64, ptr %21, align 8, !tbaa !9
  %265 = load ptr, ptr %8, align 8, !tbaa !5
  %266 = getelementptr inbounds i8, ptr %265, i64 %264
  store ptr %266, ptr %8, align 8, !tbaa !5
  %267 = load ptr, ptr %17, align 8, !tbaa !5
  %268 = load i32, ptr %13, align 4, !tbaa !13
  %269 = zext i32 %268 to i64
  %270 = invoke noundef i32 @_Z13lodepng_crc32PKhm(ptr noundef %267, i64 noundef %269)
          to label %271 unwind label %280

271:                                              ; preds = %260
  %272 = load ptr, ptr %8, align 8, !tbaa !5
  store i32 %270, ptr %272, align 4, !tbaa !13
  %273 = load i32, ptr %13, align 4, !tbaa !13
  %274 = load ptr, ptr %8, align 8, !tbaa !5
  %275 = getelementptr inbounds i8, ptr %274, i64 4
  store i32 %273, ptr %275, align 4, !tbaa !13
  br label %292

276:                                              ; preds = %248
  %277 = landingpad { ptr, i32 }
          cleanup
  %278 = extractvalue { ptr, i32 } %277, 0
  store ptr %278, ptr %10, align 8
  %279 = extractvalue { ptr, i32 } %277, 1
  store i32 %279, ptr %11, align 4
  br label %312

280:                                              ; preds = %260, %250
  %281 = landingpad { ptr, i32 }
          cleanup
  %282 = extractvalue { ptr, i32 } %281, 0
  store ptr %282, ptr %10, align 8
  %283 = extractvalue { ptr, i32 } %281, 1
  store i32 %283, ptr %11, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #7
  call void @llvm.lifetime.end.p0(i64 1, ptr %19) #7
  br label %312

284:                                              ; preds = %256
  %285 = load ptr, ptr %8, align 8, !tbaa !5
  %286 = load ptr, ptr %7, align 8, !tbaa !5
  %287 = load i64, ptr %15, align 8, !tbaa !9
  %288 = add i64 %287, 8
  call void @llvm.memmove.p0.p0.i64(ptr align 1 %285, ptr align 1 %286, i64 %288, i1 false)
  %289 = load i64, ptr %15, align 8, !tbaa !9
  %290 = load ptr, ptr %8, align 8, !tbaa !5
  %291 = getelementptr inbounds i8, ptr %290, i64 %289
  store ptr %291, ptr %8, align 8, !tbaa !5
  br label %292

292:                                              ; preds = %284, %271
  %293 = load ptr, ptr %17, align 8, !tbaa !5
  call void @free(ptr noundef %293) #7
  %294 = load ptr, ptr %20, align 8, !tbaa !5
  call void @free(ptr noundef %294) #7
  %295 = load i32, ptr @depth, align 4, !tbaa !13
  %296 = add nsw i32 %295, -1
  store i32 %296, ptr @depth, align 4, !tbaa !13
  %297 = load i64, ptr %5, align 8, !tbaa !9
  %298 = getelementptr inbounds %class.Format, ptr %22, i32 0, i32 1
  %299 = load ptr, ptr %298, align 8, !tbaa !15
  %300 = sub i64 0, %297
  %301 = getelementptr inbounds i8, ptr %299, i64 %300
  store ptr %301, ptr %298, align 8, !tbaa !15
  %302 = load ptr, ptr %8, align 8, !tbaa !5
  %303 = getelementptr inbounds i8, ptr %302, i64 8
  %304 = getelementptr inbounds %class.Format, ptr %22, i32 0, i32 1
  %305 = load ptr, ptr %304, align 8, !tbaa !15
  %306 = ptrtoint ptr %303 to i64
  %307 = ptrtoint ptr %305 to i64
  %308 = sub i64 %306, %307
  %309 = getelementptr inbounds %class.Format, ptr %22, i32 0, i32 2
  store i64 %308, ptr %309, align 8, !tbaa !11
  %310 = getelementptr inbounds %class.Format, ptr %22, i32 0, i32 2
  %311 = load i64, ptr %310, align 8, !tbaa !11
  store i64 %311, ptr %3, align 8
  store i32 1, ptr %12, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #7
  call void @llvm.lifetime.end.p0(i64 1, ptr %19) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr %18) #7
  br label %313

312:                                              ; preds = %280, %276
  call void @llvm.lifetime.end.p0(i64 24, ptr %18) #7
  br label %314

313:                                              ; preds = %292, %225
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #7
  br label %315

314:                                              ; preds = %312, %239
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #7
  br label %316

315:                                              ; preds = %313, %155, %142
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %9) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr %9) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #7
  call void @llvm.lifetime.end.p0(i64 1, ptr %6) #7
  br label %317

316:                                              ; preds = %314, %98
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %9) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr %9) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #7
  call void @llvm.lifetime.end.p0(i64 1, ptr %6) #7
  br label %319

317:                                              ; preds = %315, %26
  %318 = load i64, ptr %3, align 8
  ret i64 %318

319:                                              ; preds = %316
  %320 = load ptr, ptr %10, align 8
  %321 = load i32, ptr %11, align 4
  %322 = insertvalue { ptr, i32 } poison, ptr %320, 0
  %323 = insertvalue { ptr, i32 } %322, i32 %321, 1
  resume { ptr, i32 } %323
}

; 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) #1

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) #0 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)) #1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZN6Format7LeanifyEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) unnamed_addr #2 align 2

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

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

; Function Attrs: mustprogress nounwind uwtable
declare void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2Ev(ptr noundef nonnull align 8 dereferenceable(32)) unnamed_addr #2 align 2

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE6assignEPKc(ptr noundef nonnull align 8 dereferenceable(32), ptr noundef) #0 align 2

declare i32 @__gxx_personality_v0(...)

declare void @_Z13PrintFileNameRKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(ptr noundef nonnull align 8 dereferenceable(32)) #5

declare noundef i32 @_Z15lodepng_inflatePPhPmPKhmPK25LodePNGDecompressSettings(ptr noundef, ptr noundef, ptr noundef, i64 noundef, ptr noundef) #5

declare noundef i32 @_Z13lodepng_crc32PKhm(ptr noundef, i64 noundef) #5

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

declare noundef i64 @_Z11LeanifyFilePvmmRKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(ptr noundef, i64 noundef, i64 noundef, ptr noundef nonnull align 8 dereferenceable(32)) #5

declare void @ZopfliInitOptions(ptr noundef) #5

declare void @ZopfliDeflate(ptr noundef, i32 noundef, i32 noundef, ptr noundef, i64 noundef, ptr noundef, ptr noundef, ptr noundef) #5

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

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

; Function Attrs: mustprogress nounwind uwtable
declare void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32)) unnamed_addr #2 align 2

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

!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, !10, i64 0}
!10 = !{!"long", !7, i64 0}
!11 = !{!12, !10, i64 16}
!12 = !{!"_ZTS6Format", !6, i64 8, !10, i64 16}
!13 = !{!14, !14, i64 0}
!14 = !{!"int", !7, i64 0}
!15 = !{!12, !6, i64 8}
!16 = !{!7, !7, i64 0}
!17 = !{!18, !18, i64 0}
!18 = !{!"short", !7, i64 0}
!19 = distinct !{!19, !20}
!20 = !{!"llvm.loop.mustprogress"}
!21 = distinct !{!21, !20}
!22 = !{!23, !23, i64 0}
!23 = !{!"bool", !7, i64 0}
!24 = !{i8 0, i8 2}
!25 = !{}
!26 = !{!27, !14, i64 8}
!27 = !{!"_ZTS13ZopfliOptions", !14, i64 0, !14, i64 4, !14, i64 8, !14, i64 12, !14, i64 16, !14, i64 20}


; 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 }
%struct.LodePNGDecompressSettings = type { i32, i32, i64, ptr, ptr, ptr }
%"class.std::__cxx11::basic_string" = type { %"struct.std::__cxx11::basic_string<char>::_Alloc_hider", i64, %union.anon }
%"struct.std::__cxx11::basic_string<char>::_Alloc_hider" = type { ptr }
%union.anon = type { i64, [8 x i8] }
%struct.ZopfliOptions = type { i32, i32, i32, i32, i32, i32 }

@_ZSt4cerr = external global %"class.std::basic_ostream", align 8
@.str = external hidden unnamed_addr constant [21 x i8], align 1
@depth = external local_unnamed_addr global i32, align 4
@is_fast = external local_unnamed_addr global i8, align 1
@lodepng_default_decompress_settings = external global %struct.LodePNGDecompressSettings, align 8
@.str.1 = external hidden unnamed_addr constant [14 x i8], align 1
@iterations = external local_unnamed_addr global i32, align 4

; Function Attrs: mustprogress uwtable
define dso_local noundef i64 @_ZN2Gz7LeanifyEm(ptr noundef nonnull align 8 dereferenceable(24) %0, i64 noundef %1) unnamed_addr #0 align 2 personality ptr @__gxx_personality_v0 {
  %3 = alloca %"class.std::__cxx11::basic_string", align 8
  %4 = alloca i64, align 8
  %5 = alloca ptr, align 8
  %6 = alloca %struct.ZopfliOptions, align 4
  %7 = alloca i8, align 1
  %8 = alloca ptr, align 8
  %9 = alloca i64, align 8
  %10 = getelementptr inbounds i8, ptr %0, i64 16
  %11 = load i64, ptr %10, align 8, !tbaa !5
  %12 = icmp ult i64 %11, 19
  br i1 %12, label %13, label %17

13:                                               ; preds = %2
  %14 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cerr, ptr noundef nonnull @.str)
  %15 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %14, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  %16 = tail call noundef i64 @_ZN6Format7LeanifyEm(ptr noundef nonnull align 8 dereferenceable(24) %0, i64 noundef %1)
  br label %153

17:                                               ; preds = %2
  %18 = load i32, ptr @depth, align 4, !tbaa !11
  %19 = add nsw i32 %18, 1
  store i32 %19, ptr @depth, align 4, !tbaa !11
  %20 = getelementptr inbounds i8, ptr %0, i64 8
  %21 = load ptr, ptr %20, align 8, !tbaa !13
  %22 = getelementptr inbounds i8, ptr %21, i64 3
  %23 = load i8, ptr %22, align 1, !tbaa !14
  %24 = sub i64 0, %1
  %25 = getelementptr inbounds i8, ptr %21, i64 %24
  tail call void @llvm.memmove.p0.p0.i64(ptr noundef nonnull align 1 dereferenceable(10) %25, ptr noundef nonnull align 1 dereferenceable(10) %21, i64 10, i1 false)
  %26 = load ptr, ptr %20, align 8, !tbaa !13
  %27 = getelementptr inbounds i8, ptr %26, i64 3
  %28 = getelementptr inbounds i8, ptr %27, i64 %24
  store i8 0, ptr %28, align 1, !tbaa !14
  %29 = load ptr, ptr %20, align 8, !tbaa !13
  %30 = getelementptr inbounds i8, ptr %29, i64 10
  %31 = getelementptr inbounds i8, ptr %30, i64 %24
  %32 = getelementptr inbounds i8, ptr %31, i64 -2
  store i8 2, ptr %32, align 1, !tbaa !14
  %33 = zext i8 %23 to i32
  %34 = and i32 %33, 4
  %.not = icmp eq i32 %34, 0
  br i1 %.not, label %40, label %35

35:                                               ; preds = %17
  %36 = load i16, ptr %30, align 2, !tbaa !15
  %37 = zext i16 %36 to i64
  %38 = getelementptr inbounds i8, ptr %30, i64 %37
  %39 = getelementptr inbounds i8, ptr %38, i64 2
  br label %40

40:                                               ; preds = %35, %17
  %.058 = phi ptr [ %39, %35 ], [ %30, %17 ]
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %3) #7
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2Ev(ptr noundef nonnull align 8 dereferenceable(32) %3) #7
  %41 = and i32 %33, 8
  %.not73 = icmp eq i32 %41, 0
  br i1 %.not73, label %..critedge_crit_edge, label %42

..critedge_crit_edge:                             ; preds = %40
  %.pre.pre = load ptr, ptr %20, align 8, !tbaa !13
  %.pre89.pre = load i64, ptr %10, align 8, !tbaa !5
  br label %.critedge

42:                                               ; preds = %40
  %43 = invoke noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE6assignEPKc(ptr noundef nonnull align 8 dereferenceable(32) %3, ptr noundef nonnull %.058)
          to label %44 unwind label %53

44:                                               ; preds = %42
  invoke void @_Z13PrintFileNameRKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(ptr noundef nonnull align 8 dereferenceable(32) %3)
          to label %.preheader88 unwind label %53

.preheader88:                                     ; preds = %44
  %45 = load ptr, ptr %20, align 8, !tbaa !13
  %46 = load i64, ptr %10, align 8, !tbaa !5
  %47 = getelementptr inbounds i8, ptr %45, i64 %46
  br label %48

48:                                               ; preds = %.preheader88, %50
  %.159 = phi ptr [ %51, %50 ], [ %.058, %.preheader88 ]
  %49 = icmp ult ptr %.159, %47
  br i1 %49, label %50, label %.critedge

50:                                               ; preds = %48
  %51 = getelementptr inbounds i8, ptr %.159, i64 1
  %52 = load i8, ptr %.159, align 1, !tbaa !14
  %.not74 = icmp eq i8 %52, 0
  br i1 %.not74, label %.critedge, label %48, !llvm.loop !17

53:                                               ; preds = %44, %42
  %54 = landingpad { ptr, i32 }
          cleanup
  br label %152

.critedge:                                        ; preds = %50, %48, %..critedge_crit_edge
  %.pre89 = phi i64 [ %.pre89.pre, %..critedge_crit_edge ], [ %46, %48 ], [ %46, %50 ]
  %.pre = phi ptr [ %.pre.pre, %..critedge_crit_edge ], [ %45, %48 ], [ %45, %50 ]
  %.260 = phi ptr [ %.058, %..critedge_crit_edge ], [ %51, %50 ], [ %.159, %48 ]
  %55 = and i32 %33, 16
  %.not75 = icmp eq i32 %55, 0
  br i1 %.not75, label %.critedge2, label %.preheader

.preheader:                                       ; preds = %.critedge
  %56 = getelementptr inbounds i8, ptr %.pre, i64 %.pre89
  br label %57

57:                                               ; preds = %.preheader, %59
  %.3 = phi ptr [ %60, %59 ], [ %.260, %.preheader ]
  %58 = icmp ult ptr %.3, %56
  br i1 %58, label %59, label %.critedge2

59:                                               ; preds = %57
  %60 = getelementptr inbounds i8, ptr %.3, i64 1
  %61 = load i8, ptr %.3, align 1, !tbaa !14
  %.not76 = icmp eq i8 %61, 0
  br i1 %.not76, label %.critedge2, label %57, !llvm.loop !19

.critedge2:                                       ; preds = %59, %57, %.critedge
  %.4 = phi ptr [ %.260, %.critedge ], [ %.3, %57 ], [ %60, %59 ]
  %62 = and i32 %33, 2
  %spec.select.idx = zext nneg i32 %62 to i64
  %spec.select = getelementptr inbounds i8, ptr %.4, i64 %spec.select.idx
  %63 = getelementptr inbounds i8, ptr %.pre, i64 %.pre89
  %.not78 = icmp ult ptr %spec.select, %63
  br i1 %.not78, label %68, label %64

64:                                               ; preds = %.critedge2
  %65 = getelementptr inbounds i8, ptr %.pre, i64 10
  %66 = add i64 %.pre89, -10
  call void @llvm.memmove.p0.p0.i64(ptr nonnull align 1 %31, ptr nonnull align 1 %65, i64 %66, i1 false)
  %67 = load i64, ptr %10, align 8, !tbaa !5
  br label %151

68:                                               ; preds = %.critedge2
  %69 = load i8, ptr @is_fast, align 1, !tbaa !20, !range !22, !noundef !23
  %70 = trunc nuw i8 %69 to i1
  br i1 %70, label %71, label %78

71:                                               ; preds = %68
  %72 = ptrtoint ptr %63 to i64
  %73 = ptrtoint ptr %spec.select to i64
  %74 = sub i64 %72, %73
  call void @llvm.memmove.p0.p0.i64(ptr nonnull align 1 %31, ptr nonnull align 1 %spec.select, i64 %74, i1 false)
  %75 = load i64, ptr %10, align 8, !tbaa !5
  %76 = ptrtoint ptr %31 to i64
  %.neg85 = sub i64 %76, %73
  %77 = add i64 %.neg85, %75
  br label %151

78:                                               ; preds = %68
  %79 = getelementptr inbounds i8, ptr %63, i64 -4
  %80 = load i32, ptr %79, align 4, !tbaa !11
  %81 = getelementptr inbounds i8, ptr %63, i64 -8
  %82 = load i32, ptr %81, align 4, !tbaa !11
  %83 = ptrtoint ptr %81 to i64
  %84 = ptrtoint ptr %spec.select to i64
  %85 = sub i64 %83, %84
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #7
  store i64 0, ptr %4, align 8, !tbaa !24
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #7
  store ptr null, ptr %5, align 8, !tbaa !25
  %86 = invoke noundef i32 @_Z15lodepng_inflatePPhPmPKhmPK25LodePNGDecompressSettings(ptr noundef nonnull %5, ptr noundef nonnull %4, ptr noundef nonnull %spec.select, i64 noundef %85, ptr noundef nonnull @lodepng_default_decompress_settings)
          to label %87 unwind label %107

87:                                               ; preds = %78
  %88 = icmp eq i32 %86, 0
  %89 = load ptr, ptr %5, align 8
  %90 = icmp ne ptr %89, null
  %or.cond = select i1 %88, i1 %90, i1 false
  br i1 %or.cond, label %91, label %97

91:                                               ; preds = %87
  %92 = load i64, ptr %4, align 8, !tbaa !24
  %93 = zext i32 %80 to i64
  %.not79 = icmp eq i64 %92, %93
  br i1 %.not79, label %94, label %97

94:                                               ; preds = %91
  %95 = invoke noundef i32 @_Z13lodepng_crc32PKhm(ptr noundef nonnull %89, i64 noundef %92)
          to label %96 unwind label %107

96:                                               ; preds = %94
  %.not80 = icmp eq i32 %82, %95
  br i1 %.not80, label %109, label %97

97:                                               ; preds = %96, %91, %87
  %98 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cerr, ptr noundef nonnull @.str.1)
          to label %99 unwind label %107

99:                                               ; preds = %97
  %100 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %98, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
          to label %101 unwind label %107

101:                                              ; preds = %99
  %102 = load ptr, ptr %5, align 8, !tbaa !25
  call void @free(ptr noundef %102) #7
  %103 = add i64 %85, 8
  call void @llvm.memmove.p0.p0.i64(ptr nonnull align 1 %31, ptr nonnull align 1 %spec.select, i64 %103, i1 false)
  %104 = load i64, ptr %10, align 8, !tbaa !5
  %105 = ptrtoint ptr %31 to i64
  %.neg = sub i64 %105, %84
  %106 = add i64 %.neg, %104
  br label %149

107:                                              ; preds = %109, %99, %97, %94, %78
  %108 = landingpad { ptr, i32 }
          cleanup
  br label %150

109:                                              ; preds = %96
  %110 = load ptr, ptr %5, align 8, !tbaa !25
  %111 = invoke noundef i64 @_Z11LeanifyFilePvmmRKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(ptr noundef %110, i64 noundef %92, i64 noundef 0, ptr noundef nonnull align 8 dereferenceable(32) %3)
          to label %112 unwind label %107

112:                                              ; preds = %109
  %113 = trunc i64 %111 to i32
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %6) #7
  invoke void @ZopfliInitOptions(ptr noundef nonnull %6)
          to label %114 unwind label %129

114:                                              ; preds = %112
  %115 = load i32, ptr @iterations, align 4, !tbaa !11
  %116 = getelementptr inbounds i8, ptr %6, i64 8
  store i32 %115, ptr %116, align 4, !tbaa !26
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %7) #7
  store i8 0, ptr %7, align 1, !tbaa !14
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %8) #7
  store ptr null, ptr %8, align 8, !tbaa !25
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %9) #7
  store i64 0, ptr %9, align 8, !tbaa !24
  %117 = load ptr, ptr %5, align 8, !tbaa !25
  %118 = and i64 %111, 4294967295
  invoke void @ZopfliDeflate(ptr noundef nonnull %6, i32 noundef 2, i32 noundef 1, ptr noundef %117, i64 noundef %118, ptr noundef nonnull %7, ptr noundef nonnull %8, ptr noundef nonnull %9)
          to label %119 unwind label %131

119:                                              ; preds = %114
  %120 = load i64, ptr %9, align 8, !tbaa !24
  %121 = icmp ult i64 %120, %85
  br i1 %121, label %122, label %133

122:                                              ; preds = %119
  %123 = load ptr, ptr %8, align 8, !tbaa !25
  call void @llvm.memcpy.p0.p0.i64(ptr nonnull align 1 %31, ptr align 1 %123, i64 %120, i1 false)
  %124 = load ptr, ptr %5, align 8, !tbaa !25
  %125 = invoke noundef i32 @_Z13lodepng_crc32PKhm(ptr noundef %124, i64 noundef %118)
          to label %126 unwind label %131

126:                                              ; preds = %122
  %127 = getelementptr inbounds i8, ptr %31, i64 %120
  store i32 %125, ptr %127, align 4, !tbaa !11
  %128 = getelementptr inbounds i8, ptr %127, i64 4
  store i32 %113, ptr %128, align 4, !tbaa !11
  br label %135

129:                                              ; preds = %112
  %130 = landingpad { ptr, i32 }
          cleanup
  br label %148

131:                                              ; preds = %122, %114
  %132 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %9) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #7
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %7) #7
  br label %148

133:                                              ; preds = %119
  %134 = add i64 %85, 8
  call void @llvm.memmove.p0.p0.i64(ptr nonnull align 1 %31, ptr nonnull align 1 %spec.select, i64 %134, i1 false)
  br label %135

135:                                              ; preds = %133, %126
  %136 = phi i64 [ %120, %126 ], [ %85, %133 ]
  %137 = getelementptr inbounds i8, ptr %31, i64 %136
  %138 = load ptr, ptr %5, align 8, !tbaa !25
  call void @free(ptr noundef %138) #7
  %139 = load ptr, ptr %8, align 8, !tbaa !25
  call void @free(ptr noundef %139) #7
  %140 = load i32, ptr @depth, align 4, !tbaa !11
  %141 = add nsw i32 %140, -1
  store i32 %141, ptr @depth, align 4, !tbaa !11
  %142 = load ptr, ptr %20, align 8, !tbaa !13
  %143 = getelementptr inbounds i8, ptr %142, i64 %24
  store ptr %143, ptr %20, align 8, !tbaa !13
  %144 = getelementptr inbounds i8, ptr %137, i64 8
  %145 = ptrtoint ptr %144 to i64
  %146 = ptrtoint ptr %143 to i64
  %147 = sub i64 %145, %146
  store i64 %147, ptr %10, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %9) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #7
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %7) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %6) #7
  br label %149

148:                                              ; preds = %131, %129
  %.pn = phi { ptr, i32 } [ %132, %131 ], [ %130, %129 ]
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %6) #7
  br label %150

149:                                              ; preds = %135, %101
  %.0 = phi i64 [ %106, %101 ], [ %147, %135 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #7
  br label %151

150:                                              ; preds = %148, %107
  %.pn82 = phi { ptr, i32 } [ %108, %107 ], [ %.pn, %148 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #7
  br label %152

151:                                              ; preds = %149, %71, %64
  %.1 = phi i64 [ %67, %64 ], [ %77, %71 ], [ %.0, %149 ]
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %3) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %3) #7
  br label %153

152:                                              ; preds = %150, %53
  %.pn82.pn = phi { ptr, i32 } [ %.pn82, %150 ], [ %54, %53 ]
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %3) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %3) #7
  resume { ptr, i32 } %.pn82.pn

153:                                              ; preds = %151, %13
  %.2 = phi i64 [ %16, %13 ], [ %.1, %151 ]
  ret i64 %.2
}

; 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 #1

; 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 #0 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)) #1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZN6Format7LeanifyEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) unnamed_addr #2 align 2

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

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

; Function Attrs: mustprogress nounwind uwtable
declare void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2Ev(ptr noundef nonnull align 8 dereferenceable(32)) unnamed_addr #2 align 2

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

declare i32 @__gxx_personality_v0(...)

declare void @_Z13PrintFileNameRKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(ptr noundef nonnull align 8 dereferenceable(32)) local_unnamed_addr #5

declare noundef i32 @_Z15lodepng_inflatePPhPmPKhmPK25LodePNGDecompressSettings(ptr noundef, ptr noundef, ptr noundef, i64 noundef, ptr noundef) local_unnamed_addr #5

declare noundef i32 @_Z13lodepng_crc32PKhm(ptr noundef, i64 noundef) local_unnamed_addr #5

; Function Attrs: mustprogress nounwind willreturn allockind("free") memory(argmem: readwrite, inaccessiblemem: readwrite)
declare void @free(ptr allocptr nocapture noundef) local_unnamed_addr #6

declare noundef i64 @_Z11LeanifyFilePvmmRKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(ptr noundef, i64 noundef, i64 noundef, ptr noundef nonnull align 8 dereferenceable(32)) local_unnamed_addr #5

declare void @ZopfliInitOptions(ptr noundef) local_unnamed_addr #5

declare void @ZopfliDeflate(ptr noundef, i32 noundef, i32 noundef, ptr noundef, i64 noundef, ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #5

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

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

; Function Attrs: mustprogress nounwind uwtable
declare void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32)) unnamed_addr #2 align 2

attributes #0 = { 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 #1 = { 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 #2 = { mustprogress 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 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #4 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #5 = { "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 = { mustprogress nounwind willreturn allockind("free") memory(argmem: readwrite, inaccessiblemem: readwrite) "alloc-family"="malloc" "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 }

!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 16}
!6 = !{!"_ZTS6Format", !7, i64 8, !10, i64 16}
!7 = !{!"any pointer", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!"long", !8, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"int", !8, i64 0}
!13 = !{!6, !7, i64 8}
!14 = !{!8, !8, i64 0}
!15 = !{!16, !16, i64 0}
!16 = !{!"short", !8, i64 0}
!17 = distinct !{!17, !18}
!18 = !{!"llvm.loop.mustprogress"}
!19 = distinct !{!19, !18}
!20 = !{!21, !21, i64 0}
!21 = !{!"bool", !8, i64 0}
!22 = !{i8 0, i8 2}
!23 = !{}
!24 = !{!10, !10, i64 0}
!25 = !{!7, !7, i64 0}
!26 = !{!27, !12, i64 8}
!27 = !{!"_ZTS13ZopfliOptions", !12, i64 0, !12, i64 4, !12, i64 8, !12, i64 12, !12, i64 16, !12, i64 20}


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