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

; 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.Data = type <{ %"class.std::__cxx11::basic_string", %"class.std::vector", %"class.std::vector", i32, i32, %"class.lodepng::State", i32, i8, [3 x i8] }>
%"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] }
%"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.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 }
%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.88 = external hidden unnamed_addr constant [22 x i8], align 1
@_ZSt4cerr = external global %"class.std::basic_ostream", align 8
@.str.89 = external hidden unnamed_addr constant [40 x i8], align 1
@.str.90 = external hidden unnamed_addr constant [44 x i8], align 1
@.str.91 = external hidden unnamed_addr constant [45 x i8], align 1
@.str.92 = external hidden unnamed_addr constant [40 x i8], align 1
@.str.93 = external hidden unnamed_addr constant [28 x i8], align 1
@.str.94 = external hidden unnamed_addr constant [31 x i8], align 1
@.str.95 = external hidden unnamed_addr constant [27 x i8], align 1
@.str.96 = external hidden unnamed_addr constant [25 x i8], align 1
@.str.97 = external hidden unnamed_addr constant [29 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

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z9showErrorR4DataRK7Options(ptr noundef nonnull align 8 dereferenceable(605), ptr noundef nonnull align 4 dereferenceable(36)) #1

; Function Attrs: mustprogress uwtable
define dso_local void @_Z21loadWithErrorRecoveryR4DataRK7Optionsb(ptr noundef nonnull align 8 dereferenceable(605) %0, ptr noundef nonnull align 4 dereferenceable(36) %1, i1 noundef zeroext %2) #1 {
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca i8, align 1
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  store ptr %0, ptr %4, align 8, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !5
  %11 = zext i1 %2 to i8
  store i8 %11, ptr %6, align 1, !tbaa !9
  %12 = load ptr, ptr %5, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #3
  %13 = load ptr, ptr %4, align 8, !tbaa !5
  %14 = getelementptr inbounds %struct.Data, ptr %13, i32 0, i32 6
  store ptr %14, ptr %7, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #3
  %15 = load ptr, ptr %4, align 8, !tbaa !5
  %16 = getelementptr inbounds %struct.Data, ptr %15, i32 0, i32 5
  store ptr %16, ptr %8, align 8, !tbaa !5
  %17 = load ptr, ptr %4, align 8, !tbaa !5
  call void @_ZN4Data10loadPixelsEv(ptr noundef nonnull align 8 dereferenceable(605) %17)
  %18 = load i8, ptr %6, align 1, !tbaa !9, !range !11, !noundef !12
  %19 = trunc i8 %18 to i1
  br i1 %19, label %20, label %28

20:                                               ; preds = %3
  %21 = load ptr, ptr %7, align 8, !tbaa !5
  %22 = load i32, ptr %21, align 4, !tbaa !13
  %23 = icmp ne i32 %22, 0
  br i1 %23, label %27, label %24

24:                                               ; preds = %20
  %25 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef @.str.88)
  %26 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %25, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  br label %27

27:                                               ; preds = %24, %20
  store i32 1, ptr %9, align 4
  br label %162

28:                                               ; preds = %3
  br label %29

29:                                               ; preds = %146, %28
  %30 = load ptr, ptr %7, align 8, !tbaa !5
  %31 = load i32, ptr %30, align 4, !tbaa !13
  %32 = icmp ne i32 %31, 0
  br i1 %32, label %33, label %147

33:                                               ; preds = %29
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #3
  %34 = load ptr, ptr %7, align 8, !tbaa !5
  %35 = load i32, ptr %34, align 4, !tbaa !13
  store i32 %35, ptr %10, align 4, !tbaa !13
  %36 = load ptr, ptr %7, align 8, !tbaa !5
  %37 = load i32, ptr %36, align 4, !tbaa !13
  %38 = icmp eq i32 %37, 57
  br i1 %38, label %39, label %52

39:                                               ; preds = %33
  %40 = load ptr, ptr %4, align 8, !tbaa !5
  %41 = load ptr, ptr %5, align 8, !tbaa !5
  call void @_Z9showErrorR4DataRK7Options(ptr noundef nonnull align 8 dereferenceable(605) %40, ptr noundef nonnull align 4 dereferenceable(36) %41)
  %42 = load i8, ptr %6, align 1, !tbaa !9, !range !11, !noundef !12
  %43 = trunc i8 %42 to i1
  br i1 %43, label %47, label %44

44:                                               ; preds = %39
  %45 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cerr, ptr noundef @.str.89)
  %46 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %45, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  br label %47

47:                                               ; preds = %44, %39
  %48 = load ptr, ptr %8, align 8, !tbaa !5
  %49 = getelementptr inbounds %struct.LodePNGState, ptr %48, i32 0, i32 1
  %50 = getelementptr inbounds %struct.LodePNGDecoderSettings, ptr %49, i32 0, i32 1
  store i32 1, ptr %50, align 8, !tbaa !15
  %51 = load ptr, ptr %4, align 8, !tbaa !5
  call void @_ZN4Data12reloadPixelsEv(ptr noundef nonnull align 8 dereferenceable(605) %51)
  br label %120

52:                                               ; preds = %33
  %53 = load ptr, ptr %7, align 8, !tbaa !5
  %54 = load i32, ptr %53, align 4, !tbaa !13
  %55 = icmp eq i32 %54, 58
  br i1 %55, label %56, label %70

56:                                               ; preds = %52
  %57 = load ptr, ptr %4, align 8, !tbaa !5
  %58 = load ptr, ptr %5, align 8, !tbaa !5
  call void @_Z9showErrorR4DataRK7Options(ptr noundef nonnull align 8 dereferenceable(605) %57, ptr noundef nonnull align 4 dereferenceable(36) %58)
  %59 = load i8, ptr %6, align 1, !tbaa !9, !range !11, !noundef !12
  %60 = trunc i8 %59 to i1
  br i1 %60, label %64, label %61

61:                                               ; preds = %56
  %62 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cerr, ptr noundef @.str.90)
  %63 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %62, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  br label %64

64:                                               ; preds = %61, %56
  %65 = load ptr, ptr %8, align 8, !tbaa !5
  %66 = getelementptr inbounds %struct.LodePNGState, ptr %65, i32 0, i32 1
  %67 = getelementptr inbounds %struct.LodePNGDecoderSettings, ptr %66, i32 0, i32 0
  %68 = getelementptr inbounds %struct.LodePNGDecompressSettings, ptr %67, i32 0, i32 0
  store i32 1, ptr %68, align 8, !tbaa !27
  %69 = load ptr, ptr %4, align 8, !tbaa !5
  call void @_ZN4Data12reloadPixelsEv(ptr noundef nonnull align 8 dereferenceable(605) %69)
  br label %119

70:                                               ; preds = %52
  %71 = load ptr, ptr %7, align 8, !tbaa !5
  %72 = load i32, ptr %71, align 4, !tbaa !13
  %73 = icmp eq i32 %72, 69
  br i1 %73, label %74, label %87

74:                                               ; preds = %70
  %75 = load ptr, ptr %4, align 8, !tbaa !5
  %76 = load ptr, ptr %5, align 8, !tbaa !5
  call void @_Z9showErrorR4DataRK7Options(ptr noundef nonnull align 8 dereferenceable(605) %75, ptr noundef nonnull align 4 dereferenceable(36) %76)
  %77 = load i8, ptr %6, align 1, !tbaa !9, !range !11, !noundef !12
  %78 = trunc i8 %77 to i1
  br i1 %78, label %82, label %79

79:                                               ; preds = %74
  %80 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cerr, ptr noundef @.str.91)
  %81 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %80, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  br label %82

82:                                               ; preds = %79, %74
  %83 = load ptr, ptr %8, align 8, !tbaa !5
  %84 = getelementptr inbounds %struct.LodePNGState, ptr %83, i32 0, i32 1
  %85 = getelementptr inbounds %struct.LodePNGDecoderSettings, ptr %84, i32 0, i32 2
  store i32 1, ptr %85, align 4, !tbaa !28
  %86 = load ptr, ptr %4, align 8, !tbaa !5
  call void @_ZN4Data12reloadPixelsEv(ptr noundef nonnull align 8 dereferenceable(605) %86)
  br label %118

87:                                               ; preds = %70
  %88 = load ptr, ptr %7, align 8, !tbaa !5
  %89 = load i32, ptr %88, align 4, !tbaa !13
  %90 = icmp eq i32 %89, 30
  br i1 %90, label %95, label %91

91:                                               ; preds = %87
  %92 = load ptr, ptr %7, align 8, !tbaa !5
  %93 = load i32, ptr %92, align 4, !tbaa !13
  %94 = icmp eq i32 %93, 63
  br i1 %94, label %95, label %108

95:                                               ; preds = %91, %87
  %96 = load ptr, ptr %4, align 8, !tbaa !5
  %97 = load ptr, ptr %5, align 8, !tbaa !5
  call void @_Z9showErrorR4DataRK7Options(ptr noundef nonnull align 8 dereferenceable(605) %96, ptr noundef nonnull align 4 dereferenceable(36) %97)
  %98 = load i8, ptr %6, align 1, !tbaa !9, !range !11, !noundef !12
  %99 = trunc i8 %98 to i1
  br i1 %99, label %103, label %100

100:                                              ; preds = %95
  %101 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cerr, ptr noundef @.str.92)
  %102 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %101, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  br label %103

103:                                              ; preds = %100, %95
  %104 = load ptr, ptr %8, align 8, !tbaa !5
  %105 = getelementptr inbounds %struct.LodePNGState, ptr %104, i32 0, i32 1
  %106 = getelementptr inbounds %struct.LodePNGDecoderSettings, ptr %105, i32 0, i32 3
  store i32 1, ptr %106, align 8, !tbaa !29
  %107 = load ptr, ptr %4, align 8, !tbaa !5
  call void @_ZN4Data12reloadPixelsEv(ptr noundef nonnull align 8 dereferenceable(605) %107)
  br label %117

108:                                              ; preds = %91
  %109 = load ptr, ptr %4, align 8, !tbaa !5
  %110 = load ptr, ptr %5, align 8, !tbaa !5
  call void @_Z9showErrorR4DataRK7Options(ptr noundef nonnull align 8 dereferenceable(605) %109, ptr noundef nonnull align 4 dereferenceable(36) %110)
  %111 = load i8, ptr %6, align 1, !tbaa !9, !range !11, !noundef !12
  %112 = trunc i8 %111 to i1
  br i1 %112, label %116, label %113

113:                                              ; preds = %108
  %114 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cerr, ptr noundef @.str.93)
  %115 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %114, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  br label %116

116:                                              ; preds = %113, %108
  store i32 3, ptr %9, align 4
  br label %144

117:                                              ; preds = %103
  br label %118

118:                                              ; preds = %117, %82
  br label %119

119:                                              ; preds = %118, %64
  br label %120

120:                                              ; preds = %119, %47
  %121 = load i8, ptr %6, align 1, !tbaa !9, !range !11, !noundef !12
  %122 = trunc i8 %121 to i1
  br i1 %122, label %131, label %123

123:                                              ; preds = %120
  %124 = load ptr, ptr %7, align 8, !tbaa !5
  %125 = load i32, ptr %124, align 4, !tbaa !13
  %126 = icmp eq i32 %125, 0
  br i1 %126, label %127, label %130

127:                                              ; preds = %123
  %128 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cerr, ptr noundef @.str.94)
  %129 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %128, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  br label %130

130:                                              ; preds = %127, %123
  br label %131

131:                                              ; preds = %130, %120
  %132 = load ptr, ptr %7, align 8, !tbaa !5
  %133 = load i32, ptr %132, align 4, !tbaa !13
  %134 = load i32, ptr %10, align 4, !tbaa !13
  %135 = icmp eq i32 %133, %134
  br i1 %135, label %136, label %143

136:                                              ; preds = %131
  %137 = load i8, ptr %6, align 1, !tbaa !9, !range !11, !noundef !12
  %138 = trunc i8 %137 to i1
  br i1 %138, label %142, label %139

139:                                              ; preds = %136
  %140 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cerr, ptr noundef @.str.95)
  %141 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %140, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  br label %142

142:                                              ; preds = %139, %136
  store i32 3, ptr %9, align 4
  br label %144

143:                                              ; preds = %131
  store i32 0, ptr %9, align 4
  br label %144

144:                                              ; preds = %143, %142, %116
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #3
  %145 = load i32, ptr %9, align 4
  switch i32 %145, label %165 [
    i32 0, label %146
    i32 3, label %147
  ]

146:                                              ; preds = %144
  br label %29, !llvm.loop !30

147:                                              ; preds = %144, %29
  %148 = load i8, ptr %6, align 1, !tbaa !9, !range !11, !noundef !12
  %149 = trunc i8 %148 to i1
  br i1 %149, label %150, label %161

150:                                              ; preds = %147
  %151 = load ptr, ptr %7, align 8, !tbaa !5
  %152 = load i32, ptr %151, align 4, !tbaa !13
  %153 = icmp ne i32 %152, 0
  br i1 %153, label %157, label %154

154:                                              ; preds = %150
  %155 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef @.str.96)
  %156 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %155, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  br label %160

157:                                              ; preds = %150
  %158 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef @.str.97)
  %159 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %158, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  br label %160

160:                                              ; preds = %157, %154
  br label %161

161:                                              ; preds = %160, %147
  store i32 0, ptr %9, align 4
  br label %162

162:                                              ; preds = %161, %27
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #3
  %163 = load i32, ptr %9, align 4
  switch i32 %163, label %165 [
    i32 0, label %164
    i32 1, label %164
  ]

164:                                              ; preds = %162, %162
  ret void

165:                                              ; preds = %162, %144
  unreachable
}

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN4Data10loadPixelsEv(ptr noundef nonnull align 8 dereferenceable(605)) #1 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN4Data12reloadPixelsEv(ptr noundef nonnull align 8 dereferenceable(605)) #1 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 = { 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 = !{!"bool", !7, i64 0}
!11 = !{i8 0, i8 2}
!12 = !{}
!13 = !{!14, !14, i64 0}
!14 = !{!"int", !7, i64 0}
!15 = !{!16, !14, i64 40}
!16 = !{!"_ZTS12LodePNGState", !17, i64 8, !19, i64 64, !22, i64 152, !25, i64 192, !14, i64 504}
!17 = !{!"_ZTS22LodePNGDecoderSettings", !18, i64 0, !14, i64 32, !14, i64 36, !14, i64 40, !14, i64 44, !14, i64 48, !14, i64 52}
!18 = !{!"_ZTS25LodePNGDecompressSettings", !14, i64 0, !14, i64 4, !6, i64 8, !6, i64 16, !6, i64 24}
!19 = !{!"_ZTS22LodePNGEncoderSettings", !20, i64 0, !14, i64 48, !14, i64 52, !21, i64 56, !6, i64 64, !14, i64 72, !14, i64 76, !14, i64 80}
!20 = !{!"_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}
!21 = !{!"_ZTS21LodePNGFilterStrategy", !7, i64 0}
!22 = !{!"_ZTS16LodePNGColorMode", !23, i64 0, !14, i64 4, !6, i64 8, !24, i64 16, !14, i64 24, !14, i64 28, !14, i64 32, !14, i64 36}
!23 = !{!"_ZTS16LodePNGColorType", !7, i64 0}
!24 = !{!"long", !7, i64 0}
!25 = !{!"_ZTS11LodePNGInfo", !14, i64 0, !14, i64 4, !14, i64 8, !22, i64 16, !14, i64 56, !14, i64 60, !14, i64 64, !14, i64 68, !24, i64 72, !6, i64 80, !6, i64 88, !24, i64 96, !6, i64 104, !6, i64 112, !6, i64 120, !6, i64 128, !14, i64 136, !26, 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}
!26 = !{!"_ZTS11LodePNGTime", !14, i64 0, !14, i64 4, !14, i64 8, !14, i64 12, !14, i64 16, !14, i64 20}
!27 = !{!16, !14, i64 8}
!28 = !{!16, !14, i64 44}
!29 = !{!16, !14, i64 48}
!30 = distinct !{!30, !31}
!31 = !{!"llvm.loop.mustprogress"}


; Optimized IR (opt -passes='default<O3>'):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

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

@_ZSt4cout = external global %"class.std::basic_ostream", align 8
@.str.88 = external hidden unnamed_addr constant [22 x i8], align 1
@_ZSt4cerr = external global %"class.std::basic_ostream", align 8
@.str.89 = external hidden unnamed_addr constant [40 x i8], align 1
@.str.90 = external hidden unnamed_addr constant [44 x i8], align 1
@.str.91 = external hidden unnamed_addr constant [45 x i8], align 1
@.str.92 = external hidden unnamed_addr constant [40 x i8], align 1
@.str.93 = external hidden unnamed_addr constant [28 x i8], align 1
@.str.94 = external hidden unnamed_addr constant [31 x i8], align 1
@.str.95 = external hidden unnamed_addr constant [27 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 uwtable
declare dso_local void @_Z9showErrorR4DataRK7Options(ptr noundef nonnull align 8 dereferenceable(605), ptr noundef nonnull align 4 dereferenceable(36)) local_unnamed_addr #1

; Function Attrs: mustprogress uwtable
define dso_local void @_Z21loadWithErrorRecoveryR4DataRK7Optionsb(ptr noundef nonnull align 8 dereferenceable(605) %0, ptr noundef nonnull align 4 dereferenceable(36) %1, i1 noundef zeroext %2) local_unnamed_addr #1 {
  %4 = getelementptr inbounds i8, ptr %0, i64 600
  tail call void @_ZN4Data10loadPixelsEv(ptr noundef nonnull align 8 dereferenceable(605) %0)
  br i1 %2, label %9, label %.preheader

.preheader:                                       ; preds = %3
  %5 = getelementptr inbounds i8, ptr %0, i64 136
  %6 = getelementptr inbounds i8, ptr %0, i64 132
  %7 = getelementptr inbounds i8, ptr %0, i64 96
  %8 = getelementptr inbounds i8, ptr %0, i64 128
  %.pre = load i32, ptr %4, align 8, !tbaa !5
  br label %13

9:                                                ; preds = %3
  %10 = load i32, ptr %4, align 8, !tbaa !5
  %.not45 = icmp eq i32 %10, 0
  br i1 %.not45, label %11, label %.thread

11:                                               ; preds = %9
  %12 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef nonnull @.str.88)
  br label %.thread.sink.split

13:                                               ; preds = %33, %.preheader
  %14 = phi i32 [ %.pre, %.preheader ], [ %34, %33 ]
  switch i32 %14, label %.thread.thread50 [
    i32 0, label %.thread
    i32 57, label %15
    i32 58, label %18
    i32 69, label %21
    i32 30, label %24
    i32 63, label %24
  ]

15:                                               ; preds = %13
  tail call void @_Z9showErrorR4DataRK7Options(ptr noundef nonnull align 8 dereferenceable(605) %0, ptr noundef nonnull align 4 dereferenceable(36) %1)
  %16 = 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.89)
  %17 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %16, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  store i32 1, ptr %8, align 8, !tbaa !9
  br label %28

18:                                               ; preds = %13
  tail call void @_Z9showErrorR4DataRK7Options(ptr noundef nonnull align 8 dereferenceable(605) %0, ptr noundef nonnull align 4 dereferenceable(36) %1)
  %19 = 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.90)
  %20 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %19, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  store i32 1, ptr %7, align 8, !tbaa !22
  br label %28

21:                                               ; preds = %13
  tail call void @_Z9showErrorR4DataRK7Options(ptr noundef nonnull align 8 dereferenceable(605) %0, ptr noundef nonnull align 4 dereferenceable(36) %1)
  %22 = 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.91)
  %23 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %22, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  store i32 1, ptr %6, align 4, !tbaa !23
  br label %28

24:                                               ; preds = %13, %13
  tail call void @_Z9showErrorR4DataRK7Options(ptr noundef nonnull align 8 dereferenceable(605) %0, ptr noundef nonnull align 4 dereferenceable(36) %1)
  %25 = 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.92)
  %26 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %25, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  store i32 1, ptr %5, align 8, !tbaa !24
  br label %28

.thread.thread50:                                 ; preds = %13
  tail call void @_Z9showErrorR4DataRK7Options(ptr noundef nonnull align 8 dereferenceable(605) %0, ptr noundef nonnull align 4 dereferenceable(36) %1)
  %27 = 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.93)
  br label %.thread.sink.split

28:                                               ; preds = %18, %24, %21, %15
  tail call void @_ZN4Data12reloadPixelsEv(ptr noundef nonnull align 8 dereferenceable(605) %0)
  %29 = load i32, ptr %4, align 8
  %.not = icmp eq i32 %29, 0
  br i1 %.not, label %30, label %33

30:                                               ; preds = %28
  %31 = 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.94)
  %32 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %31, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  %.pre55 = load i32, ptr %4, align 8, !tbaa !5
  br label %33

33:                                               ; preds = %30, %28
  %34 = phi i32 [ %.pre55, %30 ], [ %29, %28 ]
  %.not56 = icmp eq i32 %34, %14
  br i1 %.not56, label %35, label %13

35:                                               ; preds = %33
  %36 = 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.95)
  br label %.thread.sink.split

.thread.sink.split:                               ; preds = %11, %.thread.thread50, %35
  %.sink = phi ptr [ %36, %35 ], [ %27, %.thread.thread50 ], [ %12, %11 ]
  %37 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %.sink, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  br label %.thread

.thread:                                          ; preds = %13, %.thread.sink.split, %9
  ret void
}

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN4Data10loadPixelsEv(ptr noundef nonnull align 8 dereferenceable(605)) local_unnamed_addr #1 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN4Data12reloadPixelsEv(ptr noundef nonnull align 8 dereferenceable(605)) local_unnamed_addr #1 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" }

!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 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !6, i64 40}
!10 = !{!"_ZTS12LodePNGState", !11, i64 8, !14, i64 64, !17, i64 152, !20, i64 192, !6, i64 504}
!11 = !{!"_ZTS22LodePNGDecoderSettings", !12, i64 0, !6, i64 32, !6, i64 36, !6, i64 40, !6, i64 44, !6, i64 48, !6, i64 52}
!12 = !{!"_ZTS25LodePNGDecompressSettings", !6, i64 0, !6, i64 4, !13, i64 8, !13, i64 16, !13, i64 24}
!13 = !{!"any pointer", !7, i64 0}
!14 = !{!"_ZTS22LodePNGEncoderSettings", !15, i64 0, !6, i64 48, !6, i64 52, !16, i64 56, !13, i64 64, !6, i64 72, !6, i64 76, !6, i64 80}
!15 = !{!"_ZTS23LodePNGCompressSettings", !6, i64 0, !6, i64 4, !6, i64 8, !6, i64 12, !6, i64 16, !6, i64 20, !13, i64 24, !13, i64 32, !13, i64 40}
!16 = !{!"_ZTS21LodePNGFilterStrategy", !7, i64 0}
!17 = !{!"_ZTS16LodePNGColorMode", !18, i64 0, !6, i64 4, !13, i64 8, !19, i64 16, !6, i64 24, !6, i64 28, !6, i64 32, !6, i64 36}
!18 = !{!"_ZTS16LodePNGColorType", !7, i64 0}
!19 = !{!"long", !7, i64 0}
!20 = !{!"_ZTS11LodePNGInfo", !6, i64 0, !6, i64 4, !6, i64 8, !17, i64 16, !6, i64 56, !6, i64 60, !6, i64 64, !6, i64 68, !19, i64 72, !13, i64 80, !13, i64 88, !19, i64 96, !13, i64 104, !13, i64 112, !13, i64 120, !13, i64 128, !6, i64 136, !21, i64 140, !6, i64 164, !6, i64 168, !6, i64 172, !6, i64 176, !6, i64 180, !6, i64 184, !6, i64 188, !6, i64 192, !6, i64 196, !6, i64 200, !6, i64 204, !6, i64 208, !6, i64 212, !6, i64 216, !6, i64 220, !6, i64 224, !6, i64 228, !6, i64 232, !13, i64 240, !13, i64 248, !6, i64 256, !7, i64 264, !7, i64 288}
!21 = !{!"_ZTS11LodePNGTime", !6, i64 0, !6, i64 4, !6, i64 8, !6, i64 12, !6, i64 16, !6, i64 20}
!22 = !{!10, !6, i64 8}
!23 = !{!10, !6, i64 44}
!24 = !{!10, !6, i64 48}


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