; LLVM IR from venumb/ZSPACE :: cpp/depends/lodePNG/pngdetail.ll (Z20displayPalettePixelsRKSt6vectorIhSaIhEERK7Options)

; 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.lodepng::State" = type { %struct.LodePNGState.base, [4 x i8] }
%struct.LodePNGState.base = type <{ ptr, %struct.LodePNGDecoderSettings, %struct.LodePNGEncoderSettings, %struct.LodePNGColorMode, %struct.LodePNGInfo, i32 }>
%struct.LodePNGDecoderSettings = type { %struct.LodePNGDecompressSettings, i32, i32, i32, i32, i32, i32 }
%struct.LodePNGDecompressSettings = type { i32, i32, ptr, ptr, ptr }
%struct.LodePNGEncoderSettings = type { %struct.LodePNGCompressSettings, i32, i32, i32, ptr, i32, i32, i32 }
%struct.LodePNGCompressSettings = type { i32, i32, i32, i32, i32, i32, ptr, ptr, ptr }
%struct.LodePNGColorMode = type { i32, i32, ptr, i64, i32, i32, i32, i32 }
%struct.LodePNGInfo = type { i32, i32, i32, %struct.LodePNGColorMode, i32, i32, i32, i32, i64, ptr, ptr, i64, ptr, ptr, ptr, ptr, i32, %struct.LodePNGTime, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, ptr, ptr, i32, [3 x ptr], [3 x i64] }
%struct.LodePNGTime = type { i32, i32, i32, i32, i32, i32 }
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<unsigned char, std::allocator<unsigned char>>::_Vector_impl" }
%"struct.std::_Vector_base<unsigned char, std::allocator<unsigned char>>::_Vector_impl" = type { %"struct.std::_Vector_base<unsigned char, std::allocator<unsigned char>>::_Vector_impl_data" }
%"struct.std::_Vector_base<unsigned char, std::allocator<unsigned char>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::vector.8" = type { %"struct.std::_Vector_base.9" }
%"struct.std::_Vector_base.9" = type { %"struct.std::_Vector_base<unsigned long, std::allocator<unsigned long>>::_Vector_impl" }
%"struct.std::_Vector_base<unsigned long, std::allocator<unsigned long>>::_Vector_impl" = type { %"struct.std::_Vector_base<unsigned long, std::allocator<unsigned long>>::_Vector_impl_data" }
%"struct.std::_Vector_base<unsigned long, std::allocator<unsigned long>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::allocator.10" = type { i8 }
%struct.Options = type { i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i32, i8, i32, i32, i8, i8, i8, i8, i8, i8, i8, i8 }
%struct.LodePNGState = type <{ ptr, %struct.LodePNGDecoderSettings, %struct.LodePNGEncoderSettings, %struct.LodePNGColorMode, %struct.LodePNGInfo, i32, [4 x i8] }>

@_ZSt4cout = external global %"class.std::basic_ostream", align 8
@.str.15 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.36 = external hidden unnamed_addr constant [16 x i8], align 1
@.str.37 = external hidden unnamed_addr constant [31 x i8], align 1
@.str.38 = external hidden unnamed_addr constant [23 x i8], align 1
@.str.39 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.40 = external hidden unnamed_addr constant [55 x i8], align 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) #0

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

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

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

declare i32 @__gxx_personality_v0(...)

declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8), i32 noundef) #3

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef nonnull align 8 dereferenceable(216) ptr @_ZSt3hexRSt8ios_base(ptr noundef nonnull align 8 dereferenceable(216)) #0

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef nonnull align 8 dereferenceable(216) ptr @_ZSt3decRSt8ios_base(ptr noundef nonnull align 8 dereferenceable(216)) #0

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEm(ptr noundef nonnull align 8 dereferenceable(8), i64 noundef) #1 align 2

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt6vectorImSaImEED2Ev(ptr noundef nonnull align 8 dereferenceable(24)) unnamed_addr #4 align 2

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt6vectorIhSaIhEED2Ev(ptr noundef nonnull align 8 dereferenceable(24)) unnamed_addr #4 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt6vectorIhSaIhEEC2Ev(ptr noundef nonnull align 8 dereferenceable(24)) unnamed_addr #4 align 2

; Function Attrs: mustprogress uwtable
define dso_local void @_Z20displayPalettePixelsRKSt6vectorIhSaIhEERK7Options(ptr noundef nonnull align 8 dereferenceable(24) %0, ptr noundef nonnull align 4 dereferenceable(36) %1) #1 personality ptr @__gxx_personality_v0 {
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca %"class.lodepng::State", align 8
  %8 = alloca %"class.std::vector", align 8
  %9 = alloca ptr, align 8
  %10 = alloca i32, align 4
  %11 = alloca %"class.std::vector.8", align 8
  %12 = alloca i64, align 8
  %13 = alloca %"class.std::allocator.10", align 1
  %14 = alloca i64, align 8
  %15 = alloca i64, align 8
  %16 = alloca i32, align 4
  %17 = alloca i64, align 8
  %18 = alloca i64, align 8
  %19 = alloca i32, align 4
  store ptr %0, ptr %3, align 8, !tbaa !5
  store ptr %1, ptr %4, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #6
  call void @llvm.lifetime.start.p0(i64 512, ptr %7) #6
  call void @_ZN7lodepng5StateC1Ev(ptr noundef nonnull align 8 dereferenceable(508) %7)
  call void @llvm.lifetime.start.p0(i64 24, ptr %8) #6
  call void @_ZNSt6vectorIhSaIhEEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %8) #6
  %20 = load ptr, ptr %4, align 8, !tbaa !5
  %21 = getelementptr inbounds %struct.Options, ptr %20, i32 0, i32 22
  %22 = load i8, ptr %21, align 1, !tbaa !9, !range !15, !noundef !16
  %23 = trunc i8 %22 to i1
  br i1 %23, label %24, label %25

24:                                               ; preds = %2
  br label %26

25:                                               ; preds = %2
  br label %26

26:                                               ; preds = %25, %24
  %27 = phi ptr [ @_ZSt3hexRSt8ios_base, %24 ], [ @_ZSt3decRSt8ios_base, %25 ]
  %28 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSt8ios_baseS0_E(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef %27)
          to label %29 unwind label %55

29:                                               ; preds = %26
  %30 = getelementptr inbounds %struct.LodePNGState, ptr %7, i32 0, i32 1
  %31 = getelementptr inbounds %struct.LodePNGDecoderSettings, ptr %30, i32 0, i32 4
  store i32 0, ptr %31, align 4, !tbaa !17
  %32 = load ptr, ptr %3, align 8, !tbaa !5
  %33 = invoke noundef i32 @_ZN7lodepng6decodeERSt6vectorIhSaIhEERjS4_RNS_5StateERKS2_(ptr noundef nonnull align 8 dereferenceable(24) %8, ptr noundef nonnull align 4 dereferenceable(4) %5, ptr noundef nonnull align 4 dereferenceable(4) %6, ptr noundef nonnull align 8 dereferenceable(508) %7, ptr noundef nonnull align 8 dereferenceable(24) %32)
          to label %34 unwind label %55

34:                                               ; preds = %29
  %35 = getelementptr inbounds %struct.LodePNGState, ptr %7, i32 0, i32 4
  %36 = getelementptr inbounds %struct.LodePNGInfo, ptr %35, i32 0, i32 3
  %37 = getelementptr inbounds %struct.LodePNGColorMode, ptr %36, i32 0, i32 0
  %38 = load i32, ptr %37, align 8, !tbaa !29
  %39 = icmp eq i32 %38, 3
  br i1 %39, label %40, label %184

40:                                               ; preds = %34
  %41 = load ptr, ptr %4, align 8, !tbaa !5
  %42 = getelementptr inbounds %struct.Options, ptr %41, i32 0, i32 7
  %43 = load i8, ptr %42, align 1, !tbaa !30, !range !15, !noundef !16
  %44 = trunc i8 %43 to i1
  br i1 %44, label %45, label %138

45:                                               ; preds = %40
  call void @llvm.lifetime.start.p0(i64 24, ptr %11) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #6
  store i64 0, ptr %12, align 8, !tbaa !31
  call void @llvm.lifetime.start.p0(i64 1, ptr %13) #6
  call void @_ZNSaImEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %13) #6
  invoke void @_ZNSt6vectorImSaImEEC2EmRKmRKS0_(ptr noundef nonnull align 8 dereferenceable(24) %11, i64 noundef 256, ptr noundef nonnull align 8 dereferenceable(8) %12, ptr noundef nonnull align 1 dereferenceable(1) %13)
          to label %46 unwind label %59

46:                                               ; preds = %45
  call void @_ZNSt15__new_allocatorImED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %13) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr %13) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #6
  store i64 0, ptr %14, align 8, !tbaa !31
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #6
  store i64 0, ptr %15, align 8, !tbaa !31
  br label %47

47:                                               ; preds = %90, %46
  %48 = load i64, ptr %15, align 8, !tbaa !31
  %49 = load i32, ptr %5, align 4, !tbaa !32
  %50 = load i32, ptr %6, align 4, !tbaa !32
  %51 = mul i32 %49, %50
  %52 = zext i32 %51 to i64
  %53 = icmp ult i64 %48, %52
  br i1 %53, label %63, label %54

54:                                               ; preds = %47
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #6
  br label %93

55:                                               ; preds = %186, %184, %140, %138, %29, %26
  %56 = landingpad { ptr, i32 }
          cleanup
  %57 = extractvalue { ptr, i32 } %56, 0
  store ptr %57, ptr %9, align 8
  %58 = extractvalue { ptr, i32 } %56, 1
  store i32 %58, ptr %10, align 4
  br label %190

59:                                               ; preds = %45
  %60 = landingpad { ptr, i32 }
          cleanup
  %61 = extractvalue { ptr, i32 } %60, 0
  store ptr %61, ptr %9, align 8
  %62 = extractvalue { ptr, i32 } %60, 1
  store i32 %62, ptr %10, align 4
  call void @_ZNSt15__new_allocatorImED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %13) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr %13) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #6
  br label %137

63:                                               ; preds = %47
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #6
  %64 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt6vectorIhSaIhEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %8, i64 noundef 0) #6
  %65 = load i64, ptr %15, align 8, !tbaa !31
  %66 = getelementptr inbounds %struct.LodePNGState, ptr %7, i32 0, i32 3
  %67 = getelementptr inbounds %struct.LodePNGColorMode, ptr %66, i32 0, i32 1
  %68 = load i32, ptr %67, align 4, !tbaa !33
  %69 = invoke noundef i32 @_ZN7lodepng15getPaletteValueEPKhmi(ptr noundef %64, i64 noundef %65, i32 noundef %68)
          to label %70 unwind label %85

70:                                               ; preds = %63
  store i32 %69, ptr %16, align 4, !tbaa !32
  %71 = load i32, ptr %16, align 4, !tbaa !32
  %72 = sext i32 %71 to i64
  %73 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorImSaImEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %11, i64 noundef %72) #6
  %74 = load i64, ptr %73, align 8, !tbaa !31
  %75 = add i64 %74, 1
  store i64 %75, ptr %73, align 8, !tbaa !31
  %76 = load i32, ptr %16, align 4, !tbaa !32
  %77 = getelementptr inbounds %struct.LodePNGState, ptr %7, i32 0, i32 3
  %78 = getelementptr inbounds %struct.LodePNGColorMode, ptr %77, i32 0, i32 3
  %79 = load i64, ptr %78, align 8, !tbaa !34
  %80 = trunc i64 %79 to i32
  %81 = icmp sge i32 %76, %80
  br i1 %81, label %82, label %89

82:                                               ; preds = %70
  %83 = load i64, ptr %14, align 8, !tbaa !31
  %84 = add i64 %83, 1
  store i64 %84, ptr %14, align 8, !tbaa !31
  br label %89

85:                                               ; preds = %63
  %86 = landingpad { ptr, i32 }
          cleanup
  %87 = extractvalue { ptr, i32 } %86, 0
  store ptr %87, ptr %9, align 8
  %88 = extractvalue { ptr, i32 } %86, 1
  store i32 %88, ptr %10, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #6
  br label %136

89:                                               ; preds = %82, %70
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #6
  br label %90

90:                                               ; preds = %89
  %91 = load i64, ptr %15, align 8, !tbaa !31
  %92 = add i64 %91, 1
  store i64 %92, ptr %15, align 8, !tbaa !31
  br label %47, !llvm.loop !35

93:                                               ; preds = %54
  %94 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef @.str.36)
          to label %95 unwind label %103

95:                                               ; preds = %93
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #6
  store i64 0, ptr %17, align 8, !tbaa !31
  br label %96

96:                                               ; preds = %115, %95
  %97 = load i64, ptr %17, align 8, !tbaa !31
  %98 = getelementptr inbounds %struct.LodePNGState, ptr %7, i32 0, i32 3
  %99 = getelementptr inbounds %struct.LodePNGColorMode, ptr %98, i32 0, i32 3
  %100 = load i64, ptr %99, align 8, !tbaa !34
  %101 = icmp ult i64 %97, %100
  br i1 %101, label %107, label %102

102:                                              ; preds = %96
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #6
  br label %122

103:                                              ; preds = %132, %129, %127, %122, %93
  %104 = landingpad { ptr, i32 }
          cleanup
  %105 = extractvalue { ptr, i32 } %104, 0
  store ptr %105, ptr %9, align 8
  %106 = extractvalue { ptr, i32 } %104, 1
  store i32 %106, ptr %10, align 4
  br label %136

107:                                              ; preds = %96
  %108 = load i64, ptr %17, align 8, !tbaa !31
  %109 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorImSaImEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %11, i64 noundef %108) #6
  %110 = load i64, ptr %109, align 8, !tbaa !31
  %111 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEm(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %110)
          to label %112 unwind label %118

112:                                              ; preds = %107
  %113 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %111, ptr noundef @.str.15)
          to label %114 unwind label %118

114:                                              ; preds = %112
  br label %115

115:                                              ; preds = %114
  %116 = load i64, ptr %17, align 8, !tbaa !31
  %117 = add i64 %116, 1
  store i64 %117, ptr %17, align 8, !tbaa !31
  br label %96, !llvm.loop !37

118:                                              ; preds = %112, %107
  %119 = landingpad { ptr, i32 }
          cleanup
  %120 = extractvalue { ptr, i32 } %119, 0
  store ptr %120, ptr %9, align 8
  %121 = extractvalue { ptr, i32 } %119, 1
  store i32 %121, ptr %10, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #6
  br label %136

122:                                              ; preds = %102
  %123 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
          to label %124 unwind label %103

124:                                              ; preds = %122
  %125 = load i64, ptr %14, align 8, !tbaa !31
  %126 = icmp ugt i64 %125, 0
  br i1 %126, label %127, label %135

127:                                              ; preds = %124
  %128 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef @.str.37)
          to label %129 unwind label %103

129:                                              ; preds = %127
  %130 = load i64, ptr %14, align 8, !tbaa !31
  %131 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEm(ptr noundef nonnull align 8 dereferenceable(8) %128, i64 noundef %130)
          to label %132 unwind label %103

132:                                              ; preds = %129
  %133 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %131, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
          to label %134 unwind label %103

134:                                              ; preds = %132
  br label %135

135:                                              ; preds = %134, %124
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #6
  call void @_ZNSt6vectorImSaImEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %11) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr %11) #6
  br label %138

136:                                              ; preds = %118, %103, %85
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #6
  call void @_ZNSt6vectorImSaImEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %11) #6
  br label %137

137:                                              ; preds = %136, %59
  call void @llvm.lifetime.end.p0(i64 24, ptr %11) #6
  br label %190

138:                                              ; preds = %135, %40
  %139 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef @.str.38)
          to label %140 unwind label %55

140:                                              ; preds = %138
  %141 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %139, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
          to label %142 unwind label %55

142:                                              ; preds = %140
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #6
  store i64 0, ptr %18, align 8, !tbaa !31
  br label %143

143:                                              ; preds = %180, %142
  %144 = load i64, ptr %18, align 8, !tbaa !31
  %145 = load i32, ptr %5, align 4, !tbaa !32
  %146 = load i32, ptr %6, align 4, !tbaa !32
  %147 = mul i32 %145, %146
  %148 = zext i32 %147 to i64
  %149 = icmp ult i64 %144, %148
  br i1 %149, label %151, label %150

150:                                              ; preds = %143
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #6
  br label %183

151:                                              ; preds = %143
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #6
  %152 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt6vectorIhSaIhEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %8, i64 noundef 0) #6
  %153 = load i64, ptr %18, align 8, !tbaa !31
  %154 = getelementptr inbounds %struct.LodePNGState, ptr %7, i32 0, i32 3
  %155 = getelementptr inbounds %struct.LodePNGColorMode, ptr %154, i32 0, i32 1
  %156 = load i32, ptr %155, align 4, !tbaa !33
  %157 = invoke noundef i32 @_ZN7lodepng15getPaletteValueEPKhmi(ptr noundef %152, i64 noundef %153, i32 noundef %156)
          to label %158 unwind label %175

158:                                              ; preds = %151
  store i32 %157, ptr %19, align 4, !tbaa !32
  %159 = load i32, ptr %19, align 4, !tbaa !32
  %160 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %159)
          to label %161 unwind label %175

161:                                              ; preds = %158
  %162 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %160, ptr noundef @.str.39)
          to label %163 unwind label %175

163:                                              ; preds = %161
  %164 = load i64, ptr %18, align 8, !tbaa !31
  %165 = load i32, ptr %5, align 4, !tbaa !32
  %166 = zext i32 %165 to i64
  %167 = urem i64 %164, %166
  %168 = load i32, ptr %5, align 4, !tbaa !32
  %169 = sub i32 %168, 1
  %170 = zext i32 %169 to i64
  %171 = icmp eq i64 %167, %170
  br i1 %171, label %172, label %179

172:                                              ; preds = %163
  %173 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
          to label %174 unwind label %175

174:                                              ; preds = %172
  br label %179

175:                                              ; preds = %172, %161, %158, %151
  %176 = landingpad { ptr, i32 }
          cleanup
  %177 = extractvalue { ptr, i32 } %176, 0
  store ptr %177, ptr %9, align 8
  %178 = extractvalue { ptr, i32 } %176, 1
  store i32 %178, ptr %10, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #6
  br label %190

179:                                              ; preds = %174, %163
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #6
  br label %180

180:                                              ; preds = %179
  %181 = load i64, ptr %18, align 8, !tbaa !31
  %182 = add i64 %181, 1
  store i64 %182, ptr %18, align 8, !tbaa !31
  br label %143, !llvm.loop !38

183:                                              ; preds = %150
  br label %189

184:                                              ; preds = %34
  %185 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef @.str.40)
          to label %186 unwind label %55

186:                                              ; preds = %184
  %187 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %185, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
          to label %188 unwind label %55

188:                                              ; preds = %186
  br label %189

189:                                              ; preds = %188, %183
  call void @_ZNSt6vectorIhSaIhEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %8) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr %8) #6
  call void @_ZN7lodepng5StateD1Ev(ptr noundef nonnull align 8 dereferenceable(508) %7) #6
  call void @llvm.lifetime.end.p0(i64 512, ptr %7) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #6
  ret void

190:                                              ; preds = %175, %137, %55
  call void @_ZNSt6vectorIhSaIhEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %8) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr %8) #6
  call void @_ZN7lodepng5StateD1Ev(ptr noundef nonnull align 8 dereferenceable(508) %7) #6
  call void @llvm.lifetime.end.p0(i64 512, ptr %7) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #6
  br label %191

191:                                              ; preds = %190
  %192 = load ptr, ptr %9, align 8
  %193 = load i32, ptr %10, align 4
  %194 = insertvalue { ptr, i32 } poison, ptr %192, 0
  %195 = insertvalue { ptr, i32 } %194, i32 %193, 1
  resume { ptr, i32 } %195
}

declare void @_ZN7lodepng5StateC1Ev(ptr noundef nonnull align 8 dereferenceable(508)) unnamed_addr #3

declare noundef i32 @_ZN7lodepng6decodeERSt6vectorIhSaIhEERjS4_RNS_5StateERKS2_(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 8 dereferenceable(508), ptr noundef nonnull align 8 dereferenceable(24)) #3

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSaImEC2Ev(ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #4 align 2

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

declare noundef i32 @_ZN7lodepng15getPaletteValueEPKhmi(ptr noundef, i64 noundef, i32 noundef) #3

; Function Attrs: nounwind
declare void @_ZN7lodepng5StateD1Ev(ptr noundef nonnull align 8 dereferenceable(508)) unnamed_addr #5

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt15__new_allocatorImED2Ev(ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #4 align 2

attributes #0 = { 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 #1 = { 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 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { 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 #5 = { 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 = { 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, !11, i64 35}
!10 = !{!"_ZTS7Options", !11, i64 0, !11, i64 1, !11, i64 2, !11, i64 3, !11, i64 4, !11, i64 5, !11, i64 6, !11, i64 7, !11, i64 8, !11, i64 9, !11, i64 10, !12, i64 12, !11, i64 16, !13, i64 20, !14, i64 24, !11, i64 28, !11, i64 29, !11, i64 30, !11, i64 31, !11, i64 32, !11, i64 33, !11, i64 34, !11, i64 35}
!11 = !{!"bool", !7, i64 0}
!12 = !{!"_ZTS9HexFormat", !7, i64 0}
!13 = !{!"_ZTS10RenderMode", !7, i64 0}
!14 = !{!"int", !7, i64 0}
!15 = !{i8 0, i8 2}
!16 = !{}
!17 = !{!18, !14, i64 52}
!18 = !{!"_ZTS12LodePNGState", !19, i64 8, !21, i64 64, !24, i64 152, !27, i64 192, !14, i64 504}
!19 = !{!"_ZTS22LodePNGDecoderSettings", !20, i64 0, !14, i64 32, !14, i64 36, !14, i64 40, !14, i64 44, !14, i64 48, !14, i64 52}
!20 = !{!"_ZTS25LodePNGDecompressSettings", !14, i64 0, !14, i64 4, !6, i64 8, !6, i64 16, !6, i64 24}
!21 = !{!"_ZTS22LodePNGEncoderSettings", !22, i64 0, !14, i64 48, !14, i64 52, !23, i64 56, !6, i64 64, !14, i64 72, !14, i64 76, !14, i64 80}
!22 = !{!"_ZTS23LodePNGCompressSettings", !14, i64 0, !14, i64 4, !14, i64 8, !14, i64 12, !14, i64 16, !14, i64 20, !6, i64 24, !6, i64 32, !6, i64 40}
!23 = !{!"_ZTS21LodePNGFilterStrategy", !7, i64 0}
!24 = !{!"_ZTS16LodePNGColorMode", !25, i64 0, !14, i64 4, !6, i64 8, !26, i64 16, !14, i64 24, !14, i64 28, !14, i64 32, !14, i64 36}
!25 = !{!"_ZTS16LodePNGColorType", !7, i64 0}
!26 = !{!"long", !7, i64 0}
!27 = !{!"_ZTS11LodePNGInfo", !14, i64 0, !14, i64 4, !14, i64 8, !24, i64 16, !14, i64 56, !14, i64 60, !14, i64 64, !14, i64 68, !26, i64 72, !6, i64 80, !6, i64 88, !26, i64 96, !6, i64 104, !6, i64 112, !6, i64 120, !6, i64 128, !14, i64 136, !28, i64 140, !14, i64 164, !14, i64 168, !14, i64 172, !14, i64 176, !14, i64 180, !14, i64 184, !14, i64 188, !14, i64 192, !14, i64 196, !14, i64 200, !14, i64 204, !14, i64 208, !14, i64 212, !14, i64 216, !14, i64 220, !14, i64 224, !14, i64 228, !14, i64 232, !6, i64 240, !6, i64 248, !14, i64 256, !7, i64 264, !7, i64 288}
!28 = !{!"_ZTS11LodePNGTime", !14, i64 0, !14, i64 4, !14, i64 8, !14, i64 12, !14, i64 16, !14, i64 20}
!29 = !{!18, !25, i64 208}
!30 = !{!10, !11, i64 7}
!31 = !{!26, !26, i64 0}
!32 = !{!14, !14, i64 0}
!33 = !{!18, !14, i64 156}
!34 = !{!18, !26, i64 168}
!35 = distinct !{!35, !36}
!36 = !{!"llvm.loop.mustprogress"}
!37 = distinct !{!37, !36}
!38 = distinct !{!38, !36}


; 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 }
%"class.lodepng::State" = type { %struct.LodePNGState.base, [4 x i8] }
%struct.LodePNGState.base = type <{ ptr, %struct.LodePNGDecoderSettings, %struct.LodePNGEncoderSettings, %struct.LodePNGColorMode, %struct.LodePNGInfo, i32 }>
%struct.LodePNGDecoderSettings = type { %struct.LodePNGDecompressSettings, i32, i32, i32, i32, i32, i32 }
%struct.LodePNGDecompressSettings = type { i32, i32, ptr, ptr, ptr }
%struct.LodePNGEncoderSettings = type { %struct.LodePNGCompressSettings, i32, i32, i32, ptr, i32, i32, i32 }
%struct.LodePNGCompressSettings = type { i32, i32, i32, i32, i32, i32, ptr, ptr, ptr }
%struct.LodePNGColorMode = type { i32, i32, ptr, i64, i32, i32, i32, i32 }
%struct.LodePNGInfo = type { i32, i32, i32, %struct.LodePNGColorMode, i32, i32, i32, i32, i64, ptr, ptr, i64, ptr, ptr, ptr, ptr, i32, %struct.LodePNGTime, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, ptr, ptr, i32, [3 x ptr], [3 x i64] }
%struct.LodePNGTime = type { i32, i32, i32, i32, i32, i32 }
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<unsigned char, std::allocator<unsigned char>>::_Vector_impl" }
%"struct.std::_Vector_base<unsigned char, std::allocator<unsigned char>>::_Vector_impl" = type { %"struct.std::_Vector_base<unsigned char, std::allocator<unsigned char>>::_Vector_impl_data" }
%"struct.std::_Vector_base<unsigned char, std::allocator<unsigned char>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::vector.8" = type { %"struct.std::_Vector_base.9" }
%"struct.std::_Vector_base.9" = type { %"struct.std::_Vector_base<unsigned long, std::allocator<unsigned long>>::_Vector_impl" }
%"struct.std::_Vector_base<unsigned long, std::allocator<unsigned long>>::_Vector_impl" = type { %"struct.std::_Vector_base<unsigned long, std::allocator<unsigned long>>::_Vector_impl_data" }
%"struct.std::_Vector_base<unsigned long, std::allocator<unsigned long>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::allocator.10" = type { i8 }

@_ZSt4cout = external global %"class.std::basic_ostream", align 8
@.str.15 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.36 = external hidden unnamed_addr constant [16 x i8], align 1
@.str.37 = external hidden unnamed_addr constant [31 x i8], align 1
@.str.38 = external hidden unnamed_addr constant [23 x i8], align 1
@.str.39 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.40 = external hidden unnamed_addr constant [55 x i8], align 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 #0

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

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

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

declare i32 @__gxx_personality_v0(...)

declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8), i32 noundef) local_unnamed_addr #3

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef nonnull align 8 dereferenceable(216) ptr @_ZSt3hexRSt8ios_base(ptr noundef nonnull align 8 dereferenceable(216)) #0

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef nonnull align 8 dereferenceable(216) ptr @_ZSt3decRSt8ios_base(ptr noundef nonnull align 8 dereferenceable(216)) #0

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt6vectorImSaImEED2Ev(ptr noundef nonnull align 8 dereferenceable(24)) unnamed_addr #4 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt6vectorIhSaIhEEixEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) local_unnamed_addr #4 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt6vectorIhSaIhEED2Ev(ptr noundef nonnull align 8 dereferenceable(24)) unnamed_addr #4 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt6vectorIhSaIhEEC2Ev(ptr noundef nonnull align 8 dereferenceable(24)) unnamed_addr #4 align 2

; Function Attrs: mustprogress uwtable
define dso_local void @_Z20displayPalettePixelsRKSt6vectorIhSaIhEERK7Options(ptr noundef nonnull align 8 dereferenceable(24) %0, ptr nocapture noundef nonnull readonly align 4 dereferenceable(36) %1) local_unnamed_addr #1 personality ptr @__gxx_personality_v0 {
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca %"class.lodepng::State", align 8
  %6 = alloca %"class.std::vector", align 8
  %7 = alloca %"class.std::vector.8", align 8
  %8 = alloca i64, align 8
  %9 = alloca %"class.std::allocator.10", align 1
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %4) #6
  call void @llvm.lifetime.start.p0(i64 512, ptr nonnull %5) #6
  call void @_ZN7lodepng5StateC1Ev(ptr noundef nonnull align 8 dereferenceable(508) %5)
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %6) #6
  call void @_ZNSt6vectorIhSaIhEEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %6) #6
  %10 = getelementptr inbounds i8, ptr %1, i64 35
  %11 = load i8, ptr %10, align 1, !tbaa !5, !range !13, !noundef !14
  %12 = trunc nuw i8 %11 to i1
  %_ZSt3hexRSt8ios_base._ZSt3decRSt8ios_base = select i1 %12, ptr @_ZSt3hexRSt8ios_base, ptr @_ZSt3decRSt8ios_base
  %13 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSt8ios_baseS0_E(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef nonnull %_ZSt3hexRSt8ios_base._ZSt3decRSt8ios_base)
          to label %14 unwind label %35

14:                                               ; preds = %2
  %15 = getelementptr inbounds i8, ptr %5, i64 52
  store i32 0, ptr %15, align 4, !tbaa !15
  %16 = invoke noundef i32 @_ZN7lodepng6decodeERSt6vectorIhSaIhEERjS4_RNS_5StateERKS2_(ptr noundef nonnull align 8 dereferenceable(24) %6, ptr noundef nonnull align 4 dereferenceable(4) %3, ptr noundef nonnull align 4 dereferenceable(4) %4, ptr noundef nonnull align 8 dereferenceable(508) %5, ptr noundef nonnull align 8 dereferenceable(24) %0)
          to label %17 unwind label %35

17:                                               ; preds = %14
  %18 = getelementptr inbounds i8, ptr %5, i64 208
  %19 = load i32, ptr %18, align 8, !tbaa !28
  %20 = icmp eq i32 %19, 3
  br i1 %20, label %21, label %115

21:                                               ; preds = %17
  %22 = getelementptr inbounds i8, ptr %1, i64 7
  %23 = load i8, ptr %22, align 1, !tbaa !29, !range !13, !noundef !14
  %24 = trunc nuw i8 %23 to i1
  br i1 %24, label %25, label %83

25:                                               ; preds = %21
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %7) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %8) #6
  store i64 0, ptr %8, align 8, !tbaa !30
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %9) #6
  call void @_ZNSaImEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %9) #6
  invoke void @_ZNSt6vectorImSaImEEC2EmRKmRKS0_(ptr noundef nonnull align 8 dereferenceable(24) %7, i64 noundef 256, ptr noundef nonnull align 8 dereferenceable(8) %8, ptr noundef nonnull align 1 dereferenceable(1) %9)
          to label %26 unwind label %37

26:                                               ; preds = %25
  call void @_ZNSt15__new_allocatorImED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %9) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %9) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #6
  %27 = load i32, ptr %3, align 4, !tbaa !31
  %28 = load i32, ptr %4, align 4, !tbaa !31
  %29 = mul i32 %28, %27
  %.not41 = icmp eq i32 %29, 0
  br i1 %.not41, label %._crit_edge, label %.lr.ph

.lr.ph:                                           ; preds = %26
  %30 = getelementptr inbounds i8, ptr %5, i64 156
  %31 = getelementptr inbounds i8, ptr %5, i64 168
  br label %39

._crit_edge:                                      ; preds = %43, %26
  %.026.lcssa = phi i64 [ 0, %26 ], [ %spec.select, %43 ]
  %32 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef nonnull @.str.36)
          to label %.preheader32 unwind label %60

.preheader32:                                     ; preds = %._crit_edge
  %33 = getelementptr inbounds i8, ptr %5, i64 168
  %34 = load i64, ptr %33, align 8, !tbaa !32
  %.not42 = icmp eq i64 %34, 0
  br i1 %.not42, label %._crit_edge38, label %.lr.ph37

35:                                               ; preds = %117, %115, %85, %83, %14, %2
  %36 = landingpad { ptr, i32 }
          cleanup
  br label %119

37:                                               ; preds = %25
  %38 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt15__new_allocatorImED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %9) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %9) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #6
  br label %82

39:                                               ; preds = %.lr.ph, %43
  %.02535 = phi i64 [ 0, %.lr.ph ], [ %51, %43 ]
  %.02634 = phi i64 [ 0, %.lr.ph ], [ %spec.select, %43 ]
  %40 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt6vectorIhSaIhEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %6, i64 noundef 0) #6
  %41 = load i32, ptr %30, align 4, !tbaa !33
  %42 = invoke noundef i32 @_ZN7lodepng15getPaletteValueEPKhmi(ptr noundef nonnull %40, i64 noundef %.02535, i32 noundef %41)
          to label %43 unwind label %57

43:                                               ; preds = %39
  %44 = sext i32 %42 to i64
  %45 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorImSaImEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %7, i64 noundef %44) #6
  %46 = load i64, ptr %45, align 8, !tbaa !30
  %47 = add i64 %46, 1
  store i64 %47, ptr %45, align 8, !tbaa !30
  %48 = load i64, ptr %31, align 8, !tbaa !32
  %49 = trunc i64 %48 to i32
  %.not31 = icmp sge i32 %42, %49
  %50 = zext i1 %.not31 to i64
  %spec.select = add i64 %.02634, %50
  %51 = add nuw nsw i64 %.02535, 1
  %52 = load i32, ptr %3, align 4, !tbaa !31
  %53 = load i32, ptr %4, align 4, !tbaa !31
  %54 = mul i32 %53, %52
  %55 = zext i32 %54 to i64
  %56 = icmp ult i64 %51, %55
  br i1 %56, label %39, label %._crit_edge, !llvm.loop !34

57:                                               ; preds = %39
  %58 = landingpad { ptr, i32 }
          cleanup
  br label %81

._crit_edge38:                                    ; preds = %67, %.preheader32
  %59 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
          to label %73 unwind label %60

60:                                               ; preds = %78, %76, %74, %._crit_edge38, %._crit_edge
  %61 = landingpad { ptr, i32 }
          cleanup
  br label %81

.lr.ph37:                                         ; preds = %.preheader32, %67
  %.02136 = phi i64 [ %68, %67 ], [ 0, %.preheader32 ]
  %62 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorImSaImEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %7, i64 noundef %.02136) #6
  %63 = load i64, ptr %62, align 8, !tbaa !30
  %64 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEm(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %63)
          to label %65 unwind label %71

65:                                               ; preds = %.lr.ph37
  %66 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %64, ptr noundef nonnull @.str.15)
          to label %67 unwind label %71

67:                                               ; preds = %65
  %68 = add nuw i64 %.02136, 1
  %69 = load i64, ptr %33, align 8, !tbaa !32
  %70 = icmp ult i64 %68, %69
  br i1 %70, label %.lr.ph37, label %._crit_edge38, !llvm.loop !36

71:                                               ; preds = %65, %.lr.ph37
  %72 = landingpad { ptr, i32 }
          cleanup
  br label %81

73:                                               ; preds = %._crit_edge38
  %.not = icmp eq i64 %.026.lcssa, 0
  br i1 %.not, label %80, label %74

74:                                               ; preds = %73
  %75 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef nonnull @.str.37)
          to label %76 unwind label %60

76:                                               ; preds = %74
  %77 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEm(ptr noundef nonnull align 8 dereferenceable(8) %75, i64 noundef %.026.lcssa)
          to label %78 unwind label %60

78:                                               ; preds = %76
  %79 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %77, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
          to label %80 unwind label %60

80:                                               ; preds = %78, %73
  call void @_ZNSt6vectorImSaImEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %7) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %7) #6
  br label %83

81:                                               ; preds = %71, %60, %57
  %.pn = phi { ptr, i32 } [ %58, %57 ], [ %72, %71 ], [ %61, %60 ]
  call void @_ZNSt6vectorImSaImEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %7) #6
  br label %82

82:                                               ; preds = %81, %37
  %.pn.pn = phi { ptr, i32 } [ %.pn, %81 ], [ %38, %37 ]
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %7) #6
  br label %119

83:                                               ; preds = %80, %21
  %84 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef nonnull @.str.38)
          to label %85 unwind label %35

85:                                               ; preds = %83
  %86 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %84, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
          to label %.preheader unwind label %35

.preheader:                                       ; preds = %85
  %87 = load i32, ptr %3, align 4, !tbaa !31
  %88 = load i32, ptr %4, align 4, !tbaa !31
  %89 = mul i32 %88, %87
  %.not43 = icmp eq i32 %89, 0
  br i1 %.not43, label %.loopexit, label %.lr.ph40

.lr.ph40:                                         ; preds = %.preheader
  %90 = getelementptr inbounds i8, ptr %5, i64 156
  br label %91

91:                                               ; preds = %.lr.ph40, %108
  %.02039 = phi i64 [ 0, %.lr.ph40 ], [ %110, %108 ]
  %92 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt6vectorIhSaIhEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %6, i64 noundef 0) #6
  %93 = load i32, ptr %90, align 4, !tbaa !33
  %94 = invoke noundef i32 @_ZN7lodepng15getPaletteValueEPKhmi(ptr noundef nonnull %92, i64 noundef %.02039, i32 noundef %93)
          to label %95 unwind label %106

95:                                               ; preds = %91
  %96 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %94)
          to label %97 unwind label %106

97:                                               ; preds = %95
  %98 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %96, ptr noundef nonnull @.str.39)
          to label %99 unwind label %106

99:                                               ; preds = %97
  %100 = load i32, ptr %3, align 4, !tbaa !31
  %.lhs.trunc = trunc i64 %.02039 to i32
  %101 = urem i32 %.lhs.trunc, %100
  %102 = add i32 %100, -1
  %103 = icmp eq i32 %101, %102
  br i1 %103, label %104, label %108

104:                                              ; preds = %99
  %105 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
          to label %._crit_edge44 unwind label %106

._crit_edge44:                                    ; preds = %104
  %.pre = load i32, ptr %3, align 4, !tbaa !31
  br label %108

106:                                              ; preds = %104, %97, %95, %91
  %107 = landingpad { ptr, i32 }
          cleanup
  br label %119

108:                                              ; preds = %._crit_edge44, %99
  %109 = phi i32 [ %.pre, %._crit_edge44 ], [ %100, %99 ]
  %110 = add nuw nsw i64 %.02039, 1
  %111 = load i32, ptr %4, align 4, !tbaa !31
  %112 = mul i32 %111, %109
  %113 = zext i32 %112 to i64
  %114 = icmp ult i64 %110, %113
  br i1 %114, label %91, label %.loopexit, !llvm.loop !37

115:                                              ; preds = %17
  %116 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef nonnull @.str.40)
          to label %117 unwind label %35

117:                                              ; preds = %115
  %118 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %116, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
          to label %.loopexit unwind label %35

.loopexit:                                        ; preds = %108, %.preheader, %117
  call void @_ZNSt6vectorIhSaIhEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %6) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %6) #6
  call void @_ZN7lodepng5StateD1Ev(ptr noundef nonnull align 8 dereferenceable(508) %5) #6
  call void @llvm.lifetime.end.p0(i64 512, ptr nonnull %5) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #6
  ret void

119:                                              ; preds = %106, %82, %35
  %.pn.pn.pn = phi { ptr, i32 } [ %.pn.pn, %82 ], [ %107, %106 ], [ %36, %35 ]
  call void @_ZNSt6vectorIhSaIhEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %6) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %6) #6
  call void @_ZN7lodepng5StateD1Ev(ptr noundef nonnull align 8 dereferenceable(508) %5) #6
  call void @llvm.lifetime.end.p0(i64 512, ptr nonnull %5) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #6
  resume { ptr, i32 } %.pn.pn.pn
}

declare void @_ZN7lodepng5StateC1Ev(ptr noundef nonnull align 8 dereferenceable(508)) unnamed_addr #3

declare noundef i32 @_ZN7lodepng6decodeERSt6vectorIhSaIhEERjS4_RNS_5StateERKS2_(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 8 dereferenceable(508), ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #3

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSaImEC2Ev(ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #4 align 2

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

declare noundef i32 @_ZN7lodepng15getPaletteValueEPKhmi(ptr noundef, i64 noundef, i32 noundef) local_unnamed_addr #3

; Function Attrs: nounwind
declare void @_ZN7lodepng5StateD1Ev(ptr noundef nonnull align 8 dereferenceable(508)) unnamed_addr #5

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt15__new_allocatorImED2Ev(ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #4 align 2

attributes #0 = { 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 #1 = { 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 nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { 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 #5 = { 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 = { nounwind }

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !7, i64 35}
!6 = !{!"_ZTS7Options", !7, i64 0, !7, i64 1, !7, i64 2, !7, i64 3, !7, i64 4, !7, i64 5, !7, i64 6, !7, i64 7, !7, i64 8, !7, i64 9, !7, i64 10, !10, i64 12, !7, i64 16, !11, i64 20, !12, i64 24, !7, i64 28, !7, i64 29, !7, i64 30, !7, i64 31, !7, i64 32, !7, i64 33, !7, i64 34, !7, i64 35}
!7 = !{!"bool", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!"_ZTS9HexFormat", !8, i64 0}
!11 = !{!"_ZTS10RenderMode", !8, i64 0}
!12 = !{!"int", !8, i64 0}
!13 = !{i8 0, i8 2}
!14 = !{}
!15 = !{!16, !12, i64 52}
!16 = !{!"_ZTS12LodePNGState", !17, i64 8, !20, i64 64, !23, i64 152, !26, i64 192, !12, i64 504}
!17 = !{!"_ZTS22LodePNGDecoderSettings", !18, i64 0, !12, i64 32, !12, i64 36, !12, i64 40, !12, i64 44, !12, i64 48, !12, i64 52}
!18 = !{!"_ZTS25LodePNGDecompressSettings", !12, i64 0, !12, i64 4, !19, i64 8, !19, i64 16, !19, i64 24}
!19 = !{!"any pointer", !8, i64 0}
!20 = !{!"_ZTS22LodePNGEncoderSettings", !21, i64 0, !12, i64 48, !12, i64 52, !22, i64 56, !19, i64 64, !12, i64 72, !12, i64 76, !12, i64 80}
!21 = !{!"_ZTS23LodePNGCompressSettings", !12, i64 0, !12, i64 4, !12, i64 8, !12, i64 12, !12, i64 16, !12, i64 20, !19, i64 24, !19, i64 32, !19, i64 40}
!22 = !{!"_ZTS21LodePNGFilterStrategy", !8, i64 0}
!23 = !{!"_ZTS16LodePNGColorMode", !24, i64 0, !12, i64 4, !19, i64 8, !25, i64 16, !12, i64 24, !12, i64 28, !12, i64 32, !12, i64 36}
!24 = !{!"_ZTS16LodePNGColorType", !8, i64 0}
!25 = !{!"long", !8, i64 0}
!26 = !{!"_ZTS11LodePNGInfo", !12, i64 0, !12, i64 4, !12, i64 8, !23, i64 16, !12, i64 56, !12, i64 60, !12, i64 64, !12, i64 68, !25, i64 72, !19, i64 80, !19, i64 88, !25, i64 96, !19, i64 104, !19, i64 112, !19, i64 120, !19, i64 128, !12, i64 136, !27, i64 140, !12, i64 164, !12, i64 168, !12, i64 172, !12, i64 176, !12, i64 180, !12, i64 184, !12, i64 188, !12, i64 192, !12, i64 196, !12, i64 200, !12, i64 204, !12, i64 208, !12, i64 212, !12, i64 216, !12, i64 220, !12, i64 224, !12, i64 228, !12, i64 232, !19, i64 240, !19, i64 248, !12, i64 256, !8, i64 264, !8, i64 288}
!27 = !{!"_ZTS11LodePNGTime", !12, i64 0, !12, i64 4, !12, i64 8, !12, i64 12, !12, i64 16, !12, i64 20}
!28 = !{!16, !24, i64 208}
!29 = !{!6, !7, i64 7}
!30 = !{!25, !25, i64 0}
!31 = !{!12, !12, i64 0}
!32 = !{!16, !25, i64 168}
!33 = !{!16, !12, i64 156}
!34 = distinct !{!34, !35}
!35 = !{!"llvm.loop.mustprogress"}
!36 = distinct !{!36, !35}
!37 = distinct !{!37, !35}


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