; LLVM IR from santa01/graphene :: src (TgaImage)

; 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_ifstream" = type { %"class.std::basic_istream.base", %"class.std::basic_filebuf", %"class.std::basic_ios" }
%"class.std::basic_istream.base" = type { ptr, i64 }
%"class.std::basic_filebuf" = type { %"class.std::basic_streambuf", %union.pthread_mutex_t, %"class.std::__basic_file", i32, %struct.__mbstate_t, %struct.__mbstate_t, %struct.__mbstate_t, ptr, i64, i8, i8, i8, i8, ptr, ptr, i8, ptr, ptr, i64, ptr, ptr }
%"class.std::basic_streambuf" = type { ptr, ptr, ptr, ptr, ptr, ptr, ptr, %"class.std::locale" }
%"class.std::locale" = type { ptr }
%union.pthread_mutex_t = type { %struct.__pthread_mutex_s }
%struct.__pthread_mutex_s = type { i32, i32, i32, i32, i32, i16, i16, %struct.__pthread_internal_list }
%struct.__pthread_internal_list = type { ptr, ptr }
%"class.std::__basic_file" = type <{ ptr, i8, [7 x i8] }>
%struct.__mbstate_t = type { i32, %union.anon.2 }
%union.anon.2 = type { i32 }
%"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::__cxx11::basic_string" = type { %"struct.std::__cxx11::basic_string<char>::_Alloc_hider", i64, %union.anon }
%"struct.std::__cxx11::basic_string<char>::_Alloc_hider" = type { ptr }
%union.anon = type { i64, [8 x i8] }
%"struct.Graphene::Header" = type { i8, i8, i8, %"struct.Graphene::ColorMapSpec", %"struct.Graphene::ImageSpec" }
%"struct.Graphene::ColorMapSpec" = type <{ i16, i16, i8 }>
%"struct.Graphene::ImageSpec" = type { i16, i16, i16, i16, i8, %"struct.Graphene::ImageDescr" }
%"struct.Graphene::ImageDescr" = type { i8 }
%"class.std::fpos" = type { i64, %struct.__mbstate_t }
%"class.Graphene::TgaImage" = type { %"class.Graphene::Image", %"class.std::__cxx11::basic_string" }
%"class.Graphene::Image" = type { ptr, i32, i32, i32, i32, %"class.std::unique_ptr" }
%"class.std::unique_ptr" = type { %"struct.std::__uniq_ptr_data" }
%"struct.std::__uniq_ptr_data" = type { %"class.std::__uniq_ptr_impl" }
%"class.std::__uniq_ptr_impl" = type { %"class.std::tuple" }
%"class.std::tuple" = type { %"struct.std::_Tuple_impl" }
%"struct.std::_Tuple_impl" = type { %"struct.std::_Head_base.1" }
%"struct.std::_Head_base.1" = type { ptr }

@_ZTVN8Graphene8TgaImageE = external dso_local unnamed_addr constant { [4 x ptr] }, align 8
@.str = external hidden unnamed_addr constant [67 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [16 x i8], align 1
@_ZTISt13runtime_error = external constant ptr
@.str.2 = external hidden unnamed_addr constant [30 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [27 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [26 x i8], align 1

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN8Graphene8TgaImageC2ERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEb(ptr noundef nonnull align 8 dereferenceable(64) %0, ptr noundef nonnull align 8 dereferenceable(32) %1, i1 noundef zeroext %2) unnamed_addr #0 align 2 personality ptr @__gxx_personality_v0 {
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca i8, align 1
  %7 = alloca ptr, align 8
  %8 = alloca i32, align 4
  %9 = alloca %"class.std::basic_ifstream", align 8
  %10 = alloca %"class.std::__cxx11::basic_string", align 8
  %11 = alloca i1, align 1
  %12 = alloca %"struct.Graphene::Header", align 1
  %13 = alloca %"class.std::__cxx11::basic_string", align 8
  %14 = alloca i1, align 1
  %15 = alloca %"class.std::__cxx11::basic_string", align 8
  %16 = alloca i1, align 1
  %17 = alloca %"class.std::__cxx11::basic_string", align 8
  %18 = alloca i1, align 1
  %19 = alloca i32, align 4
  %20 = alloca i32, align 4
  %21 = alloca i8, align 1
  %22 = alloca i8, align 1
  %23 = alloca i32, align 4
  %24 = alloca i8, align 1
  %25 = alloca i8, align 1
  %26 = alloca %"class.std::fpos", align 8
  %27 = alloca i32, align 4
  %28 = alloca i32, align 4
  %29 = alloca i32, align 4
  %30 = alloca i32, align 4
  %31 = alloca i32, align 4
  store ptr %0, ptr %4, align 8, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !5
  %32 = zext i1 %2 to i8
  store i8 %32, ptr %6, align 1, !tbaa !9
  %33 = load ptr, ptr %4, align 8
  call void @_ZN8Graphene5ImageC2Ev(ptr noundef nonnull align 8 dereferenceable(32) %33) #8
  store ptr getelementptr inbounds inrange(-16, 16) ({ [4 x ptr] }, ptr @_ZTVN8Graphene8TgaImageE, i32 0, i32 0, i32 2), ptr %33, align 8, !tbaa !11
  %34 = getelementptr inbounds %"class.Graphene::TgaImage", ptr %33, i32 0, i32 1
  %35 = load ptr, ptr %5, align 8, !tbaa !5
  invoke void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2ERKS4_(ptr noundef nonnull align 8 dereferenceable(32) %34, ptr noundef nonnull align 8 dereferenceable(32) %35)
          to label %36 unwind label %52

36:                                               ; preds = %3
  call void @llvm.lifetime.start.p0(i64 520, ptr %9) #8
  %37 = getelementptr inbounds %"class.Graphene::TgaImage", ptr %33, i32 0, i32 1
  %38 = call noundef ptr @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE5c_strEv(ptr noundef nonnull align 8 dereferenceable(32) %37) #8
  invoke void @_ZNSt14basic_ifstreamIcSt11char_traitsIcEEC1EPKcSt13_Ios_Openmode(ptr noundef nonnull align 8 dereferenceable(256) %9, ptr noundef %38, i32 noundef 4)
          to label %39 unwind label %56

39:                                               ; preds = %36
  %40 = load ptr, ptr %9, align 8, !tbaa !11
  %41 = getelementptr i8, ptr %40, i64 -24
  %42 = load i64, ptr %41, align 8
  %43 = getelementptr inbounds i8, ptr %9, i64 %42
  %44 = invoke noundef zeroext i1 @_ZNKSt9basic_iosIcSt11char_traitsIcEEntEv(ptr noundef nonnull align 8 dereferenceable(264) %43)
          to label %45 unwind label %60

45:                                               ; preds = %39
  br i1 %44, label %46, label %76

46:                                               ; preds = %45
  store i1 true, ptr %11, align 1
  %47 = call ptr @__cxa_allocate_exception(i64 16) #8
  call void @llvm.lifetime.start.p0(i64 32, ptr %10) #8
  %48 = invoke noundef nonnull align 4 dereferenceable(4) ptr @_ZN8Graphene6Logger11getInstanceEv()
          to label %49 unwind label %64

49:                                               ; preds = %46
  invoke void (ptr, ptr, i32, ptr, ...) @_ZN8Graphene6Logger10formatLineB5cxx11EPKciS2_z(ptr dead_on_unwind writable sret(%"class.std::__cxx11::basic_string") align 8 %10, ptr noundef @.str, i32 noundef 87, ptr noundef @.str.1)
          to label %50 unwind label %64

50:                                               ; preds = %49
  invoke void @_ZNSt13runtime_errorC1ERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(ptr noundef nonnull align 8 dereferenceable(16) %47, ptr noundef nonnull align 8 dereferenceable(32) %10)
          to label %51 unwind label %68

51:                                               ; preds = %50
  store i1 false, ptr %11, align 1
  invoke void @__cxa_throw(ptr %47, ptr @_ZTISt13runtime_error, ptr @_ZNSt13runtime_errorD1Ev) #9
          to label %332 unwind label %68

52:                                               ; preds = %3
  %53 = landingpad { ptr, i32 }
          cleanup
  %54 = extractvalue { ptr, i32 } %53, 0
  store ptr %54, ptr %7, align 8
  %55 = extractvalue { ptr, i32 } %53, 1
  store i32 %55, ptr %8, align 4
  br label %326

56:                                               ; preds = %36
  %57 = landingpad { ptr, i32 }
          cleanup
  %58 = extractvalue { ptr, i32 } %57, 0
  store ptr %58, ptr %7, align 8
  %59 = extractvalue { ptr, i32 } %57, 1
  store i32 %59, ptr %8, align 4
  br label %325

60:                                               ; preds = %39
  %61 = landingpad { ptr, i32 }
          cleanup
  %62 = extractvalue { ptr, i32 } %61, 0
  store ptr %62, ptr %7, align 8
  %63 = extractvalue { ptr, i32 } %61, 1
  store i32 %63, ptr %8, align 4
  br label %324

64:                                               ; preds = %49, %46
  %65 = landingpad { ptr, i32 }
          cleanup
  %66 = extractvalue { ptr, i32 } %65, 0
  store ptr %66, ptr %7, align 8
  %67 = extractvalue { ptr, i32 } %65, 1
  store i32 %67, ptr %8, align 4
  br label %72

68:                                               ; preds = %51, %50
  %69 = landingpad { ptr, i32 }
          cleanup
  %70 = extractvalue { ptr, i32 } %69, 0
  store ptr %70, ptr %7, align 8
  %71 = extractvalue { ptr, i32 } %69, 1
  store i32 %71, ptr %8, align 4
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %10) #8
  br label %72

72:                                               ; preds = %68, %64
  call void @llvm.lifetime.end.p0(i64 32, ptr %10) #8
  %73 = load i1, ptr %11, align 1
  br i1 %73, label %74, label %75

74:                                               ; preds = %72
  call void @__cxa_free_exception(ptr %47) #8
  br label %75

75:                                               ; preds = %74, %72
  br label %324

76:                                               ; preds = %45
  call void @llvm.lifetime.start.p0(i64 18, ptr %12) #8
  call void @llvm.memset.p0.i64(ptr align 1 %12, i8 0, i64 18, i1 false)
  %77 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZNSi4readEPcl(ptr noundef nonnull align 8 dereferenceable(16) %9, ptr noundef %12, i64 noundef 18)
          to label %78 unwind label %88

78:                                               ; preds = %76
  %79 = getelementptr inbounds %"struct.Graphene::Header", ptr %12, i32 0, i32 1
  %80 = load i8, ptr %79, align 1, !tbaa !13
  %81 = icmp ne i8 %80, 0
  br i1 %81, label %82, label %104

82:                                               ; preds = %78
  store i1 true, ptr %14, align 1
  %83 = call ptr @__cxa_allocate_exception(i64 16) #8
  call void @llvm.lifetime.start.p0(i64 32, ptr %13) #8
  %84 = invoke noundef nonnull align 4 dereferenceable(4) ptr @_ZN8Graphene6Logger11getInstanceEv()
          to label %85 unwind label %92

85:                                               ; preds = %82
  invoke void (ptr, ptr, i32, ptr, ...) @_ZN8Graphene6Logger10formatLineB5cxx11EPKciS2_z(ptr dead_on_unwind writable sret(%"class.std::__cxx11::basic_string") align 8 %13, ptr noundef @.str, i32 noundef 94, ptr noundef @.str.2)
          to label %86 unwind label %92

86:                                               ; preds = %85
  invoke void @_ZNSt13runtime_errorC1ERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(ptr noundef nonnull align 8 dereferenceable(16) %83, ptr noundef nonnull align 8 dereferenceable(32) %13)
          to label %87 unwind label %96

87:                                               ; preds = %86
  store i1 false, ptr %14, align 1
  invoke void @__cxa_throw(ptr %83, ptr @_ZTISt13runtime_error, ptr @_ZNSt13runtime_errorD1Ev) #9
          to label %332 unwind label %96

88:                                               ; preds = %76
  %89 = landingpad { ptr, i32 }
          cleanup
  %90 = extractvalue { ptr, i32 } %89, 0
  store ptr %90, ptr %7, align 8
  %91 = extractvalue { ptr, i32 } %89, 1
  store i32 %91, ptr %8, align 4
  br label %323

92:                                               ; preds = %85, %82
  %93 = landingpad { ptr, i32 }
          cleanup
  %94 = extractvalue { ptr, i32 } %93, 0
  store ptr %94, ptr %7, align 8
  %95 = extractvalue { ptr, i32 } %93, 1
  store i32 %95, ptr %8, align 4
  br label %100

96:                                               ; preds = %87, %86
  %97 = landingpad { ptr, i32 }
          cleanup
  %98 = extractvalue { ptr, i32 } %97, 0
  store ptr %98, ptr %7, align 8
  %99 = extractvalue { ptr, i32 } %97, 1
  store i32 %99, ptr %8, align 4
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %13) #8
  br label %100

100:                                              ; preds = %96, %92
  call void @llvm.lifetime.end.p0(i64 32, ptr %13) #8
  %101 = load i1, ptr %14, align 1
  br i1 %101, label %102, label %103

102:                                              ; preds = %100
  call void @__cxa_free_exception(ptr %83) #8
  br label %103

103:                                              ; preds = %102, %100
  br label %323

104:                                              ; preds = %78
  %105 = getelementptr inbounds %"struct.Graphene::Header", ptr %12, i32 0, i32 2
  %106 = load i8, ptr %105, align 1, !tbaa !21
  %107 = icmp ne i8 %106, 2
  br i1 %107, label %108, label %126

108:                                              ; preds = %104
  store i1 true, ptr %16, align 1
  %109 = call ptr @__cxa_allocate_exception(i64 16) #8
  call void @llvm.lifetime.start.p0(i64 32, ptr %15) #8
  %110 = invoke noundef nonnull align 4 dereferenceable(4) ptr @_ZN8Graphene6Logger11getInstanceEv()
          to label %111 unwind label %114

111:                                              ; preds = %108
  invoke void (ptr, ptr, i32, ptr, ...) @_ZN8Graphene6Logger10formatLineB5cxx11EPKciS2_z(ptr dead_on_unwind writable sret(%"class.std::__cxx11::basic_string") align 8 %15, ptr noundef @.str, i32 noundef 98, ptr noundef @.str.3)
          to label %112 unwind label %114

112:                                              ; preds = %111
  invoke void @_ZNSt13runtime_errorC1ERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(ptr noundef nonnull align 8 dereferenceable(16) %109, ptr noundef nonnull align 8 dereferenceable(32) %15)
          to label %113 unwind label %118

113:                                              ; preds = %112
  store i1 false, ptr %16, align 1
  invoke void @__cxa_throw(ptr %109, ptr @_ZTISt13runtime_error, ptr @_ZNSt13runtime_errorD1Ev) #9
          to label %332 unwind label %118

114:                                              ; preds = %111, %108
  %115 = landingpad { ptr, i32 }
          cleanup
  %116 = extractvalue { ptr, i32 } %115, 0
  store ptr %116, ptr %7, align 8
  %117 = extractvalue { ptr, i32 } %115, 1
  store i32 %117, ptr %8, align 4
  br label %122

118:                                              ; preds = %113, %112
  %119 = landingpad { ptr, i32 }
          cleanup
  %120 = extractvalue { ptr, i32 } %119, 0
  store ptr %120, ptr %7, align 8
  %121 = extractvalue { ptr, i32 } %119, 1
  store i32 %121, ptr %8, align 4
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %15) #8
  br label %122

122:                                              ; preds = %118, %114
  call void @llvm.lifetime.end.p0(i64 32, ptr %15) #8
  %123 = load i1, ptr %16, align 1
  br i1 %123, label %124, label %125

124:                                              ; preds = %122
  call void @__cxa_free_exception(ptr %109) #8
  br label %125

125:                                              ; preds = %124, %122
  br label %323

126:                                              ; preds = %104
  %127 = getelementptr inbounds %"struct.Graphene::Header", ptr %12, i32 0, i32 4
  %128 = getelementptr inbounds %"struct.Graphene::ImageSpec", ptr %127, i32 0, i32 4
  %129 = load i8, ptr %128, align 1, !tbaa !22
  %130 = zext i8 %129 to i32
  %131 = icmp ne i32 %130, 32
  br i1 %131, label %139, label %132

132:                                              ; preds = %126
  %133 = getelementptr inbounds %"struct.Graphene::Header", ptr %12, i32 0, i32 4
  %134 = getelementptr inbounds %"struct.Graphene::ImageSpec", ptr %133, i32 0, i32 5
  %135 = load i8, ptr %134, align 1
  %136 = and i8 %135, 15
  %137 = zext i8 %136 to i32
  %138 = icmp ne i32 %137, 8
  br i1 %138, label %139, label %170

139:                                              ; preds = %132, %126
  %140 = getelementptr inbounds %"struct.Graphene::Header", ptr %12, i32 0, i32 4
  %141 = getelementptr inbounds %"struct.Graphene::ImageSpec", ptr %140, i32 0, i32 4
  %142 = load i8, ptr %141, align 1, !tbaa !22
  %143 = zext i8 %142 to i32
  %144 = icmp ne i32 %143, 24
  br i1 %144, label %152, label %145

145:                                              ; preds = %139
  %146 = getelementptr inbounds %"struct.Graphene::Header", ptr %12, i32 0, i32 4
  %147 = getelementptr inbounds %"struct.Graphene::ImageSpec", ptr %146, i32 0, i32 5
  %148 = load i8, ptr %147, align 1
  %149 = and i8 %148, 15
  %150 = zext i8 %149 to i32
  %151 = icmp ne i32 %150, 0
  br i1 %151, label %152, label %170

152:                                              ; preds = %145, %139
  store i1 true, ptr %18, align 1
  %153 = call ptr @__cxa_allocate_exception(i64 16) #8
  call void @llvm.lifetime.start.p0(i64 32, ptr %17) #8
  %154 = invoke noundef nonnull align 4 dereferenceable(4) ptr @_ZN8Graphene6Logger11getInstanceEv()
          to label %155 unwind label %158

155:                                              ; preds = %152
  invoke void (ptr, ptr, i32, ptr, ...) @_ZN8Graphene6Logger10formatLineB5cxx11EPKciS2_z(ptr dead_on_unwind writable sret(%"class.std::__cxx11::basic_string") align 8 %17, ptr noundef @.str, i32 noundef 104, ptr noundef @.str.4)
          to label %156 unwind label %158

156:                                              ; preds = %155
  invoke void @_ZNSt13runtime_errorC1ERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(ptr noundef nonnull align 8 dereferenceable(16) %153, ptr noundef nonnull align 8 dereferenceable(32) %17)
          to label %157 unwind label %162

157:                                              ; preds = %156
  store i1 false, ptr %18, align 1
  invoke void @__cxa_throw(ptr %153, ptr @_ZTISt13runtime_error, ptr @_ZNSt13runtime_errorD1Ev) #9
          to label %332 unwind label %162

158:                                              ; preds = %155, %152
  %159 = landingpad { ptr, i32 }
          cleanup
  %160 = extractvalue { ptr, i32 } %159, 0
  store ptr %160, ptr %7, align 8
  %161 = extractvalue { ptr, i32 } %159, 1
  store i32 %161, ptr %8, align 4
  br label %166

162:                                              ; preds = %157, %156
  %163 = landingpad { ptr, i32 }
          cleanup
  %164 = extractvalue { ptr, i32 } %163, 0
  store ptr %164, ptr %7, align 8
  %165 = extractvalue { ptr, i32 } %163, 1
  store i32 %165, ptr %8, align 4
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %17) #8
  br label %166

166:                                              ; preds = %162, %158
  call void @llvm.lifetime.end.p0(i64 32, ptr %17) #8
  %167 = load i1, ptr %18, align 1
  br i1 %167, label %168, label %169

168:                                              ; preds = %166
  call void @__cxa_free_exception(ptr %153) #8
  br label %169

169:                                              ; preds = %168, %166
  br label %323

170:                                              ; preds = %145, %132
  %171 = getelementptr inbounds %"struct.Graphene::Header", ptr %12, i32 0, i32 4
  %172 = getelementptr inbounds %"struct.Graphene::ImageSpec", ptr %171, i32 0, i32 2
  %173 = load i16, ptr %172, align 1, !tbaa !23
  %174 = zext i16 %173 to i32
  %175 = getelementptr inbounds %"class.Graphene::Image", ptr %33, i32 0, i32 1
  store i32 %174, ptr %175, align 8, !tbaa !24
  %176 = getelementptr inbounds %"struct.Graphene::Header", ptr %12, i32 0, i32 4
  %177 = getelementptr inbounds %"struct.Graphene::ImageSpec", ptr %176, i32 0, i32 3
  %178 = load i16, ptr %177, align 1, !tbaa !33
  %179 = zext i16 %178 to i32
  %180 = getelementptr inbounds %"class.Graphene::Image", ptr %33, i32 0, i32 2
  store i32 %179, ptr %180, align 4, !tbaa !34
  %181 = getelementptr inbounds %"struct.Graphene::Header", ptr %12, i32 0, i32 4
  %182 = getelementptr inbounds %"struct.Graphene::ImageSpec", ptr %181, i32 0, i32 4
  %183 = load i8, ptr %182, align 1, !tbaa !22
  %184 = zext i8 %183 to i32
  %185 = getelementptr inbounds %"class.Graphene::Image", ptr %33, i32 0, i32 3
  store i32 %184, ptr %185, align 8, !tbaa !35
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #8
  %186 = getelementptr inbounds %"class.Graphene::Image", ptr %33, i32 0, i32 3
  %187 = load i32, ptr %186, align 8, !tbaa !35
  %188 = ashr i32 %187, 3
  store i32 %188, ptr %19, align 4, !tbaa !36
  call void @llvm.lifetime.start.p0(i64 4, ptr %20) #8
  %189 = getelementptr inbounds %"class.Graphene::Image", ptr %33, i32 0, i32 1
  %190 = load i32, ptr %189, align 8, !tbaa !24
  %191 = load i32, ptr %19, align 4, !tbaa !36
  %192 = mul nsw i32 %190, %191
  store i32 %192, ptr %20, align 4, !tbaa !36
  %193 = getelementptr inbounds %"class.Graphene::Image", ptr %33, i32 0, i32 2
  %194 = load i32, ptr %193, align 4, !tbaa !34
  %195 = load i32, ptr %20, align 4, !tbaa !36
  %196 = mul nsw i32 %194, %195
  %197 = getelementptr inbounds %"class.Graphene::Image", ptr %33, i32 0, i32 4
  store i32 %196, ptr %197, align 4, !tbaa !37
  %198 = getelementptr inbounds %"class.Graphene::Image", ptr %33, i32 0, i32 5
  %199 = getelementptr inbounds %"class.Graphene::Image", ptr %33, i32 0, i32 4
  %200 = load i32, ptr %199, align 4, !tbaa !37
  %201 = sext i32 %200 to i64
  %202 = invoke noalias noundef nonnull ptr @_Znam(i64 noundef %201) #10
          to label %203 unwind label %253

203:                                              ; preds = %170
  call void @_ZNSt10unique_ptrIA_cSt14default_deleteIS0_EE5resetIPcvEEvT_(ptr noundef nonnull align 8 dereferenceable(8) %198, ptr noundef %202) #8
  call void @llvm.lifetime.start.p0(i64 1, ptr %21) #8
  %204 = getelementptr inbounds %"struct.Graphene::Header", ptr %12, i32 0, i32 4
  %205 = getelementptr inbounds %"struct.Graphene::ImageSpec", ptr %204, i32 0, i32 5
  %206 = load i8, ptr %205, align 1
  %207 = lshr i8 %206, 5
  %208 = and i8 %207, 1
  store i8 %208, ptr %21, align 1, !tbaa !38
  call void @llvm.lifetime.start.p0(i64 1, ptr %22) #8
  %209 = getelementptr inbounds %"struct.Graphene::Header", ptr %12, i32 0, i32 4
  %210 = getelementptr inbounds %"struct.Graphene::ImageSpec", ptr %209, i32 0, i32 5
  %211 = load i8, ptr %210, align 1
  %212 = lshr i8 %211, 4
  %213 = and i8 %212, 1
  store i8 %213, ptr %22, align 1, !tbaa !38
  call void @llvm.lifetime.start.p0(i64 4, ptr %23) #8
  %214 = load i8, ptr %6, align 1, !tbaa !9, !range !39, !noundef !40
  %215 = trunc i8 %214 to i1
  %216 = zext i1 %215 to i64
  %217 = select i1 %215, i32 0, i32 1
  store i32 %217, ptr %23, align 4, !tbaa !41
  call void @llvm.lifetime.start.p0(i64 1, ptr %24) #8
  %218 = load i8, ptr %21, align 1, !tbaa !38
  %219 = zext i8 %218 to i32
  %220 = load i32, ptr %23, align 4, !tbaa !41
  %221 = icmp ne i32 %219, %220
  %222 = zext i1 %221 to i8
  store i8 %222, ptr %24, align 1, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 1, ptr %25) #8
  %223 = load i8, ptr %22, align 1, !tbaa !38
  %224 = zext i8 %223 to i32
  %225 = icmp ne i32 %224, 0
  %226 = zext i1 %225 to i8
  store i8 %226, ptr %25, align 1, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 16, ptr %26) #8
  %227 = getelementptr inbounds %"struct.Graphene::Header", ptr %12, i32 0, i32 0
  %228 = load i8, ptr %227, align 1, !tbaa !43
  %229 = zext i8 %228 to i64
  %230 = add i64 18, %229
  %231 = getelementptr inbounds %"struct.Graphene::Header", ptr %12, i32 0, i32 3
  %232 = getelementptr inbounds %"struct.Graphene::ColorMapSpec", ptr %231, i32 0, i32 1
  %233 = load i16, ptr %232, align 1, !tbaa !44
  %234 = zext i16 %233 to i32
  %235 = getelementptr inbounds %"struct.Graphene::Header", ptr %12, i32 0, i32 3
  %236 = getelementptr inbounds %"struct.Graphene::ColorMapSpec", ptr %235, i32 0, i32 2
  %237 = load i8, ptr %236, align 1, !tbaa !45
  %238 = zext i8 %237 to i32
  %239 = mul nsw i32 %234, %238
  %240 = sext i32 %239 to i64
  %241 = add i64 %230, %240
  invoke void @_ZNSt4fposI11__mbstate_tEC2El(ptr noundef nonnull align 8 dereferenceable(16) %26, i64 noundef %241)
          to label %242 unwind label %257

242:                                              ; preds = %203
  %243 = invoke noundef i64 @_ZNKSt4fposI11__mbstate_tEcvlEv(ptr noundef nonnull align 8 dereferenceable(16) %26)
          to label %244 unwind label %257

244:                                              ; preds = %242
  %245 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZNSi5seekgElSt12_Ios_Seekdir(ptr noundef nonnull align 8 dereferenceable(16) %9, i64 noundef %243, i32 noundef 0)
          to label %246 unwind label %257

246:                                              ; preds = %244
  call void @llvm.lifetime.start.p0(i64 4, ptr %27) #8
  store i32 0, ptr %27, align 4, !tbaa !36
  br label %247

247:                                              ; preds = %317, %246
  %248 = load i32, ptr %27, align 4, !tbaa !36
  %249 = getelementptr inbounds %"class.Graphene::Image", ptr %33, i32 0, i32 2
  %250 = load i32, ptr %249, align 4, !tbaa !34
  %251 = icmp slt i32 %248, %250
  br i1 %251, label %261, label %252

252:                                              ; preds = %247
  store i32 2, ptr %28, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %27) #8
  br label %320

253:                                              ; preds = %170
  %254 = landingpad { ptr, i32 }
          cleanup
  %255 = extractvalue { ptr, i32 } %254, 0
  store ptr %255, ptr %7, align 8
  %256 = extractvalue { ptr, i32 } %254, 1
  store i32 %256, ptr %8, align 4
  br label %322

257:                                              ; preds = %244, %242, %203
  %258 = landingpad { ptr, i32 }
          cleanup
  %259 = extractvalue { ptr, i32 } %258, 0
  store ptr %259, ptr %7, align 8
  %260 = extractvalue { ptr, i32 } %258, 1
  store i32 %260, ptr %8, align 4
  br label %321

261:                                              ; preds = %247
  call void @llvm.lifetime.start.p0(i64 4, ptr %29) #8
  %262 = load i8, ptr %24, align 1, !tbaa !9, !range !39, !noundef !40
  %263 = trunc i8 %262 to i1
  br i1 %263, label %264, label %270

264:                                              ; preds = %261
  %265 = getelementptr inbounds %"class.Graphene::Image", ptr %33, i32 0, i32 2
  %266 = load i32, ptr %265, align 4, !tbaa !34
  %267 = load i32, ptr %27, align 4, !tbaa !36
  %268 = sub nsw i32 %266, %267
  %269 = sub nsw i32 %268, 1
  br label %272

270:                                              ; preds = %261
  %271 = load i32, ptr %27, align 4, !tbaa !36
  br label %272

272:                                              ; preds = %270, %264
  %273 = phi i32 [ %269, %264 ], [ %271, %270 ]
  %274 = load i32, ptr %20, align 4, !tbaa !36
  %275 = mul nsw i32 %273, %274
  store i32 %275, ptr %29, align 4, !tbaa !36
  call void @llvm.lifetime.start.p0(i64 4, ptr %30) #8
  store i32 0, ptr %30, align 4, !tbaa !36
  br label %276

276:                                              ; preds = %309, %272
  %277 = load i32, ptr %30, align 4, !tbaa !36
  %278 = getelementptr inbounds %"class.Graphene::Image", ptr %33, i32 0, i32 1
  %279 = load i32, ptr %278, align 8, !tbaa !24
  %280 = icmp slt i32 %277, %279
  br i1 %280, label %282, label %281

281:                                              ; preds = %276
  store i32 5, ptr %28, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %30) #8
  br label %316

282:                                              ; preds = %276
  call void @llvm.lifetime.start.p0(i64 4, ptr %31) #8
  %283 = load i8, ptr %25, align 1, !tbaa !9, !range !39, !noundef !40
  %284 = trunc i8 %283 to i1
  br i1 %284, label %285, label %291

285:                                              ; preds = %282
  %286 = getelementptr inbounds %"class.Graphene::Image", ptr %33, i32 0, i32 1
  %287 = load i32, ptr %286, align 8, !tbaa !24
  %288 = load i32, ptr %30, align 4, !tbaa !36
  %289 = sub nsw i32 %287, %288
  %290 = sub nsw i32 %289, 1
  br label %293

291:                                              ; preds = %282
  %292 = load i32, ptr %30, align 4, !tbaa !36
  br label %293

293:                                              ; preds = %291, %285
  %294 = phi i32 [ %290, %285 ], [ %292, %291 ]
  %295 = load i32, ptr %19, align 4, !tbaa !36
  %296 = mul nsw i32 %294, %295
  store i32 %296, ptr %31, align 4, !tbaa !36
  %297 = getelementptr inbounds %"class.Graphene::Image", ptr %33, i32 0, i32 5
  %298 = call noundef ptr @_ZNKSt10unique_ptrIA_cSt14default_deleteIS0_EE3getEv(ptr noundef nonnull align 8 dereferenceable(8) %297) #8
  %299 = load i32, ptr %29, align 4, !tbaa !36
  %300 = sext i32 %299 to i64
  %301 = getelementptr inbounds i8, ptr %298, i64 %300
  %302 = load i32, ptr %31, align 4, !tbaa !36
  %303 = sext i32 %302 to i64
  %304 = getelementptr inbounds i8, ptr %301, i64 %303
  %305 = load i32, ptr %19, align 4, !tbaa !36
  %306 = sext i32 %305 to i64
  %307 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZNSi4readEPcl(ptr noundef nonnull align 8 dereferenceable(16) %9, ptr noundef %304, i64 noundef %306)
          to label %308 unwind label %312

308:                                              ; preds = %293
  call void @llvm.lifetime.end.p0(i64 4, ptr %31) #8
  br label %309

309:                                              ; preds = %308
  %310 = load i32, ptr %30, align 4, !tbaa !36
  %311 = add nsw i32 %310, 1
  store i32 %311, ptr %30, align 4, !tbaa !36
  br label %276, !llvm.loop !46

312:                                              ; preds = %293
  %313 = landingpad { ptr, i32 }
          cleanup
  %314 = extractvalue { ptr, i32 } %313, 0
  store ptr %314, ptr %7, align 8
  %315 = extractvalue { ptr, i32 } %313, 1
  store i32 %315, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %31) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %30) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %29) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %27) #8
  br label %321

316:                                              ; preds = %281
  call void @llvm.lifetime.end.p0(i64 4, ptr %29) #8
  br label %317

317:                                              ; preds = %316
  %318 = load i32, ptr %27, align 4, !tbaa !36
  %319 = add nsw i32 %318, 1
  store i32 %319, ptr %27, align 4, !tbaa !36
  br label %247, !llvm.loop !48

320:                                              ; preds = %252
  call void @llvm.lifetime.end.p0(i64 16, ptr %26) #8
  call void @llvm.lifetime.end.p0(i64 1, ptr %25) #8
  call void @llvm.lifetime.end.p0(i64 1, ptr %24) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %23) #8
  call void @llvm.lifetime.end.p0(i64 1, ptr %22) #8
  call void @llvm.lifetime.end.p0(i64 1, ptr %21) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #8
  call void @llvm.lifetime.end.p0(i64 18, ptr %12) #8
  call void @_ZNSt14basic_ifstreamIcSt11char_traitsIcEED1Ev(ptr noundef nonnull align 8 dereferenceable(256) %9) #8
  call void @llvm.lifetime.end.p0(i64 520, ptr %9) #8
  ret void

321:                                              ; preds = %312, %257
  call void @llvm.lifetime.end.p0(i64 16, ptr %26) #8
  call void @llvm.lifetime.end.p0(i64 1, ptr %25) #8
  call void @llvm.lifetime.end.p0(i64 1, ptr %24) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %23) #8
  call void @llvm.lifetime.end.p0(i64 1, ptr %22) #8
  call void @llvm.lifetime.end.p0(i64 1, ptr %21) #8
  br label %322

322:                                              ; preds = %321, %253
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #8
  br label %323

323:                                              ; preds = %322, %169, %125, %103, %88
  call void @llvm.lifetime.end.p0(i64 18, ptr %12) #8
  br label %324

324:                                              ; preds = %323, %75, %60
  call void @_ZNSt14basic_ifstreamIcSt11char_traitsIcEED1Ev(ptr noundef nonnull align 8 dereferenceable(256) %9) #8
  br label %325

325:                                              ; preds = %324, %56
  call void @llvm.lifetime.end.p0(i64 520, ptr %9) #8
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %34) #8
  br label %326

326:                                              ; preds = %325, %52
  call void @_ZN8Graphene5ImageD2Ev(ptr noundef nonnull align 8 dereferenceable(32) %33) #8
  br label %327

327:                                              ; preds = %326
  %328 = load ptr, ptr %7, align 8
  %329 = load i32, ptr %8, align 4
  %330 = insertvalue { ptr, i32 } poison, ptr %328, 0
  %331 = insertvalue { ptr, i32 } %330, i32 %329, 1
  resume { ptr, i32 } %331

332:                                              ; preds = %157, %113, %87, %51
  unreachable
}

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

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

declare i32 @__gxx_personality_v0(...)

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

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

; Function Attrs: mustprogress uwtable
declare void @_ZNSt14basic_ifstreamIcSt11char_traitsIcEEC1EPKcSt13_Ios_Openmode(ptr noundef nonnull align 8 dereferenceable(256), ptr noundef, i32 noundef) unnamed_addr #0 align 2

; Function Attrs: mustprogress uwtable
declare noundef zeroext i1 @_ZNKSt9basic_iosIcSt11char_traitsIcEEntEv(ptr noundef nonnull align 8 dereferenceable(264)) #0 align 2

declare ptr @__cxa_allocate_exception(i64)

declare noundef nonnull align 4 dereferenceable(4) ptr @_ZN8Graphene6Logger11getInstanceEv() #4

declare void @_ZN8Graphene6Logger10formatLineB5cxx11EPKciS2_z(ptr dead_on_unwind writable sret(%"class.std::__cxx11::basic_string") align 8, ptr noundef, i32 noundef, ptr noundef, ...) #4

declare void @_ZNSt13runtime_errorC1ERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(32)) unnamed_addr #4

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

declare void @__cxa_throw(ptr, ptr, ptr)

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

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

declare void @__cxa_free_exception(ptr)

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #6

declare noundef nonnull align 8 dereferenceable(16) ptr @_ZNSi4readEPcl(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef, i64 noundef) #4

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt4fposI11__mbstate_tEC2El(ptr noundef nonnull align 8 dereferenceable(16), i64 noundef) unnamed_addr #3 align 2

declare noundef nonnull align 8 dereferenceable(16) ptr @_ZNSi5seekgElSt12_Ios_Seekdir(ptr noundef nonnull align 8 dereferenceable(16), i64 noundef, i32 noundef) #4

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZNKSt4fposI11__mbstate_tEcvlEv(ptr noundef nonnull align 8 dereferenceable(16)) #3 align 2

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

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

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

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

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"bool", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"vtable pointer", !8, i64 0}
!13 = !{!14, !15, i64 1}
!14 = !{!"_ZTSN8Graphene6HeaderE", !7, i64 0, !15, i64 1, !16, i64 2, !17, i64 3, !19, i64 8}
!15 = !{!"_ZTSN8Graphene12ColorMapTypeE", !7, i64 0}
!16 = !{!"_ZTSN8Graphene9ImageTypeE", !7, i64 0}
!17 = !{!"_ZTSN8Graphene12ColorMapSpecE", !18, i64 0, !18, i64 2, !7, i64 4}
!18 = !{!"short", !7, i64 0}
!19 = !{!"_ZTSN8Graphene9ImageSpecE", !18, i64 0, !18, i64 2, !18, i64 4, !18, i64 6, !7, i64 8, !20, i64 9}
!20 = !{!"_ZTSN8Graphene10ImageDescrE", !7, i64 0, !7, i64 0, !7, i64 0, !7, i64 0}
!21 = !{!14, !16, i64 2}
!22 = !{!14, !7, i64 16}
!23 = !{!14, !18, i64 12}
!24 = !{!25, !26, i64 8}
!25 = !{!"_ZTSN8Graphene5ImageE", !26, i64 8, !26, i64 12, !26, i64 16, !26, i64 20, !27, i64 24}
!26 = !{!"int", !7, i64 0}
!27 = !{!"_ZTSSt10unique_ptrIA_cSt14default_deleteIS0_EE", !28, i64 0}
!28 = !{!"_ZTSSt15__uniq_ptr_dataIcSt14default_deleteIA_cELb1ELb1EE", !29, i64 0}
!29 = !{!"_ZTSSt15__uniq_ptr_implIcSt14default_deleteIA_cEE", !30, i64 0}
!30 = !{!"_ZTSSt5tupleIJPcSt14default_deleteIA_cEEE", !31, i64 0}
!31 = !{!"_ZTSSt11_Tuple_implILm0EJPcSt14default_deleteIA_cEEE", !32, i64 0}
!32 = !{!"_ZTSSt10_Head_baseILm0EPcLb0EE", !6, i64 0}
!33 = !{!14, !18, i64 14}
!34 = !{!25, !26, i64 12}
!35 = !{!25, !26, i64 16}
!36 = !{!26, !26, i64 0}
!37 = !{!25, !26, i64 20}
!38 = !{!7, !7, i64 0}
!39 = !{i8 0, i8 2}
!40 = !{}
!41 = !{!42, !42, i64 0}
!42 = !{!"_ZTSN8Graphene11RowOrderingE", !7, i64 0}
!43 = !{!14, !7, i64 0}
!44 = !{!14, !18, i64 5}
!45 = !{!14, !7, i64 7}
!46 = distinct !{!46, !47}
!47 = !{!"llvm.loop.mustprogress"}
!48 = distinct !{!48, !47}


; 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_ifstream" = type { %"class.std::basic_istream.base", %"class.std::basic_filebuf", %"class.std::basic_ios" }
%"class.std::basic_istream.base" = type { ptr, i64 }
%"class.std::basic_filebuf" = type { %"class.std::basic_streambuf", %union.pthread_mutex_t, %"class.std::__basic_file", i32, %struct.__mbstate_t, %struct.__mbstate_t, %struct.__mbstate_t, ptr, i64, i8, i8, i8, i8, ptr, ptr, i8, ptr, ptr, i64, ptr, ptr }
%"class.std::basic_streambuf" = type { ptr, ptr, ptr, ptr, ptr, ptr, ptr, %"class.std::locale" }
%"class.std::locale" = type { ptr }
%union.pthread_mutex_t = type { %struct.__pthread_mutex_s }
%struct.__pthread_mutex_s = type { i32, i32, i32, i32, i32, i16, i16, %struct.__pthread_internal_list }
%struct.__pthread_internal_list = type { ptr, ptr }
%"class.std::__basic_file" = type <{ ptr, i8, [7 x i8] }>
%struct.__mbstate_t = type { i32, %union.anon.2 }
%union.anon.2 = type { i32 }
%"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::__cxx11::basic_string" = type { %"struct.std::__cxx11::basic_string<char>::_Alloc_hider", i64, %union.anon }
%"struct.std::__cxx11::basic_string<char>::_Alloc_hider" = type { ptr }
%union.anon = type { i64, [8 x i8] }
%"struct.Graphene::Header" = type { i8, i8, i8, %"struct.Graphene::ColorMapSpec", %"struct.Graphene::ImageSpec" }
%"struct.Graphene::ColorMapSpec" = type <{ i16, i16, i8 }>
%"struct.Graphene::ImageSpec" = type { i16, i16, i16, i16, i8, %"struct.Graphene::ImageDescr" }
%"struct.Graphene::ImageDescr" = type { i8 }
%"class.std::fpos" = type { i64, %struct.__mbstate_t }

@_ZTVN8Graphene8TgaImageE = external dso_local unnamed_addr constant { [4 x ptr] }, align 8
@.str = external hidden unnamed_addr constant [67 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [16 x i8], align 1
@_ZTISt13runtime_error = external constant ptr
@.str.2 = external hidden unnamed_addr constant [30 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [27 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [26 x i8], align 1

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN8Graphene8TgaImageC2ERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEb(ptr noundef nonnull align 8 dereferenceable(64) %0, ptr noundef nonnull align 8 dereferenceable(32) %1, i1 noundef zeroext %2) unnamed_addr #0 align 2 personality ptr @__gxx_personality_v0 {
  %4 = alloca %"class.std::basic_ifstream", align 8
  %5 = alloca %"class.std::__cxx11::basic_string", align 8
  %6 = alloca %"struct.Graphene::Header", align 1
  %7 = alloca %"class.std::__cxx11::basic_string", align 8
  %8 = alloca %"class.std::__cxx11::basic_string", align 8
  %9 = alloca %"class.std::__cxx11::basic_string", align 8
  %10 = alloca %"class.std::fpos", align 8
  tail call void @_ZN8Graphene5ImageC2Ev(ptr noundef nonnull align 8 dereferenceable(32) %0) #8
  store ptr getelementptr inbounds inrange(-16, 16) (i8, ptr @_ZTVN8Graphene8TgaImageE, i64 16), ptr %0, align 8, !tbaa !5
  %11 = getelementptr inbounds i8, ptr %0, i64 32
  invoke void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2ERKS4_(ptr noundef nonnull align 8 dereferenceable(32) %11, ptr noundef nonnull align 8 dereferenceable(32) %1)
          to label %12 unwind label %28

12:                                               ; preds = %3
  call void @llvm.lifetime.start.p0(i64 520, ptr nonnull %4) #8
  %13 = tail call noundef ptr @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE5c_strEv(ptr noundef nonnull align 8 dereferenceable(32) %11) #8
  invoke void @_ZNSt14basic_ifstreamIcSt11char_traitsIcEEC1EPKcSt13_Ios_Openmode(ptr noundef nonnull align 8 dereferenceable(256) %4, ptr noundef %13, i32 noundef 4)
          to label %14 unwind label %30

14:                                               ; preds = %12
  %15 = load ptr, ptr %4, align 8, !tbaa !5
  %16 = getelementptr i8, ptr %15, i64 -24
  %17 = load i64, ptr %16, align 8
  %18 = getelementptr inbounds i8, ptr %4, i64 %17
  %19 = invoke noundef zeroext i1 @_ZNKSt9basic_iosIcSt11char_traitsIcEEntEv(ptr noundef nonnull align 8 dereferenceable(264) %18)
          to label %20 unwind label %32

20:                                               ; preds = %14
  br i1 %19, label %21, label %38

21:                                               ; preds = %20
  %22 = call ptr @__cxa_allocate_exception(i64 16) #8
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %5) #8
  %23 = invoke noundef nonnull align 4 dereferenceable(4) ptr @_ZN8Graphene6Logger11getInstanceEv()
          to label %24 unwind label %.thread

24:                                               ; preds = %21
  invoke void (ptr, ptr, i32, ptr, ...) @_ZN8Graphene6Logger10formatLineB5cxx11EPKciS2_z(ptr dead_on_unwind nonnull writable sret(%"class.std::__cxx11::basic_string") align 8 %5, ptr noundef nonnull @.str, i32 noundef 87, ptr noundef nonnull @.str.1)
          to label %25 unwind label %.thread

25:                                               ; preds = %24
  invoke void @_ZNSt13runtime_errorC1ERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(ptr noundef nonnull align 8 dereferenceable(16) %22, ptr noundef nonnull align 8 dereferenceable(32) %5)
          to label %27 unwind label %.thread74

.thread74:                                        ; preds = %25
  %26 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %5) #8
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %5) #8
  br label %37

27:                                               ; preds = %25
  invoke void @__cxa_throw(ptr nonnull %22, ptr nonnull @_ZTISt13runtime_error, ptr nonnull @_ZNSt13runtime_errorD1Ev) #9
          to label %178 unwind label %35

28:                                               ; preds = %3
  %29 = landingpad { ptr, i32 }
          cleanup
  br label %177

30:                                               ; preds = %12
  %31 = landingpad { ptr, i32 }
          cleanup
  br label %176

32:                                               ; preds = %14
  %33 = landingpad { ptr, i32 }
          cleanup
  br label %175

.thread:                                          ; preds = %21, %24
  %34 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %5) #8
  br label %37

35:                                               ; preds = %27
  %36 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %5) #8
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %5) #8
  br label %175

37:                                               ; preds = %.thread74, %.thread
  %.pn6673 = phi { ptr, i32 } [ %34, %.thread ], [ %26, %.thread74 ]
  call void @__cxa_free_exception(ptr %22) #8
  br label %175

38:                                               ; preds = %20
  call void @llvm.lifetime.start.p0(i64 18, ptr nonnull %6) #8
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(18) %6, i8 0, i64 18, i1 false)
  %39 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZNSi4readEPcl(ptr noundef nonnull align 8 dereferenceable(16) %4, ptr noundef nonnull %6, i64 noundef 18)
          to label %40 unwind label %50

40:                                               ; preds = %38
  %41 = getelementptr inbounds i8, ptr %6, i64 1
  %42 = load i8, ptr %41, align 1, !tbaa !8
  %.not = icmp eq i8 %42, 0
  br i1 %.not, label %56, label %43

43:                                               ; preds = %40
  %44 = call ptr @__cxa_allocate_exception(i64 16) #8
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %7) #8
  %45 = invoke noundef nonnull align 4 dereferenceable(4) ptr @_ZN8Graphene6Logger11getInstanceEv()
          to label %46 unwind label %.thread76

46:                                               ; preds = %43
  invoke void (ptr, ptr, i32, ptr, ...) @_ZN8Graphene6Logger10formatLineB5cxx11EPKciS2_z(ptr dead_on_unwind nonnull writable sret(%"class.std::__cxx11::basic_string") align 8 %7, ptr noundef nonnull @.str, i32 noundef 94, ptr noundef nonnull @.str.2)
          to label %47 unwind label %.thread76

47:                                               ; preds = %46
  invoke void @_ZNSt13runtime_errorC1ERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(ptr noundef nonnull align 8 dereferenceable(16) %44, ptr noundef nonnull align 8 dereferenceable(32) %7)
          to label %49 unwind label %.thread80

.thread80:                                        ; preds = %47
  %48 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %7) #8
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %7) #8
  br label %55

49:                                               ; preds = %47
  invoke void @__cxa_throw(ptr nonnull %44, ptr nonnull @_ZTISt13runtime_error, ptr nonnull @_ZNSt13runtime_errorD1Ev) #9
          to label %178 unwind label %53

50:                                               ; preds = %38
  %51 = landingpad { ptr, i32 }
          cleanup
  br label %174

.thread76:                                        ; preds = %43, %46
  %52 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %7) #8
  br label %55

53:                                               ; preds = %49
  %54 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %7) #8
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %7) #8
  br label %174

55:                                               ; preds = %.thread80, %.thread76
  %.pn6379 = phi { ptr, i32 } [ %52, %.thread76 ], [ %48, %.thread80 ]
  call void @__cxa_free_exception(ptr %44) #8
  br label %174

56:                                               ; preds = %40
  %57 = getelementptr inbounds i8, ptr %6, i64 2
  %58 = load i8, ptr %57, align 1, !tbaa !17
  %.not50 = icmp eq i8 %58, 2
  br i1 %.not50, label %70, label %59

59:                                               ; preds = %56
  %60 = call ptr @__cxa_allocate_exception(i64 16) #8
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %8) #8
  %61 = invoke noundef nonnull align 4 dereferenceable(4) ptr @_ZN8Graphene6Logger11getInstanceEv()
          to label %62 unwind label %.thread82

62:                                               ; preds = %59
  invoke void (ptr, ptr, i32, ptr, ...) @_ZN8Graphene6Logger10formatLineB5cxx11EPKciS2_z(ptr dead_on_unwind nonnull writable sret(%"class.std::__cxx11::basic_string") align 8 %8, ptr noundef nonnull @.str, i32 noundef 98, ptr noundef nonnull @.str.3)
          to label %63 unwind label %.thread82

63:                                               ; preds = %62
  invoke void @_ZNSt13runtime_errorC1ERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(ptr noundef nonnull align 8 dereferenceable(16) %60, ptr noundef nonnull align 8 dereferenceable(32) %8)
          to label %65 unwind label %.thread86

.thread86:                                        ; preds = %63
  %64 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %8) #8
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %8) #8
  br label %69

65:                                               ; preds = %63
  invoke void @__cxa_throw(ptr nonnull %60, ptr nonnull @_ZTISt13runtime_error, ptr nonnull @_ZNSt13runtime_errorD1Ev) #9
          to label %178 unwind label %67

.thread82:                                        ; preds = %59, %62
  %66 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %8) #8
  br label %69

67:                                               ; preds = %65
  %68 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %8) #8
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %8) #8
  br label %174

69:                                               ; preds = %.thread86, %.thread82
  %.pn6185 = phi { ptr, i32 } [ %66, %.thread82 ], [ %64, %.thread86 ]
  call void @__cxa_free_exception(ptr %60) #8
  br label %174

70:                                               ; preds = %56
  %71 = getelementptr inbounds i8, ptr %6, i64 16
  %72 = load i8, ptr %71, align 1, !tbaa !18
  switch i8 %72, label %.thread88 [
    i8 32, label %73
    i8 24, label %77
  ]

73:                                               ; preds = %70
  %74 = getelementptr inbounds i8, ptr %6, i64 17
  %75 = load i8, ptr %74, align 1
  %76 = and i8 %75, 15
  %.not52 = icmp eq i8 %76, 8
  br i1 %.not52, label %91, label %.thread88

77:                                               ; preds = %70
  %78 = getelementptr inbounds i8, ptr %6, i64 17
  %79 = load i8, ptr %78, align 1
  %80 = and i8 %79, 15
  %.not54 = icmp eq i8 %80, 0
  br i1 %.not54, label %91, label %.thread88

.thread88:                                        ; preds = %70, %73, %77
  %81 = call ptr @__cxa_allocate_exception(i64 16) #8
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %9) #8
  %82 = invoke noundef nonnull align 4 dereferenceable(4) ptr @_ZN8Graphene6Logger11getInstanceEv()
          to label %83 unwind label %.thread90

83:                                               ; preds = %.thread88
  invoke void (ptr, ptr, i32, ptr, ...) @_ZN8Graphene6Logger10formatLineB5cxx11EPKciS2_z(ptr dead_on_unwind nonnull writable sret(%"class.std::__cxx11::basic_string") align 8 %9, ptr noundef nonnull @.str, i32 noundef 104, ptr noundef nonnull @.str.4)
          to label %84 unwind label %.thread90

84:                                               ; preds = %83
  invoke void @_ZNSt13runtime_errorC1ERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(ptr noundef nonnull align 8 dereferenceable(16) %81, ptr noundef nonnull align 8 dereferenceable(32) %9)
          to label %86 unwind label %.thread94

.thread94:                                        ; preds = %84
  %85 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %9) #8
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %9) #8
  br label %90

86:                                               ; preds = %84
  invoke void @__cxa_throw(ptr nonnull %81, ptr nonnull @_ZTISt13runtime_error, ptr nonnull @_ZNSt13runtime_errorD1Ev) #9
          to label %178 unwind label %88

.thread90:                                        ; preds = %.thread88, %83
  %87 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %9) #8
  br label %90

88:                                               ; preds = %86
  %89 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %9) #8
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %9) #8
  br label %174

90:                                               ; preds = %.thread94, %.thread90
  %.pn5993 = phi { ptr, i32 } [ %87, %.thread90 ], [ %85, %.thread94 ]
  call void @__cxa_free_exception(ptr %81) #8
  br label %174

91:                                               ; preds = %77, %73
  %92 = getelementptr inbounds i8, ptr %6, i64 12
  %93 = load i16, ptr %92, align 1, !tbaa !19
  %94 = zext i16 %93 to i32
  %95 = getelementptr inbounds i8, ptr %0, i64 8
  store i32 %94, ptr %95, align 8, !tbaa !20
  %96 = getelementptr inbounds i8, ptr %6, i64 14
  %97 = load i16, ptr %96, align 1, !tbaa !30
  %98 = zext i16 %97 to i32
  %99 = getelementptr inbounds i8, ptr %0, i64 12
  store i32 %98, ptr %99, align 4, !tbaa !31
  %100 = zext nneg i8 %72 to i32
  %101 = getelementptr inbounds i8, ptr %0, i64 16
  store i32 %100, ptr %101, align 8, !tbaa !32
  %102 = lshr i32 %100, 3
  %103 = mul nuw nsw i32 %102, %94
  %104 = mul nuw nsw i32 %103, %98
  %105 = getelementptr inbounds i8, ptr %0, i64 20
  store i32 %104, ptr %105, align 4, !tbaa !33
  %106 = getelementptr inbounds i8, ptr %0, i64 24
  %107 = zext nneg i32 %104 to i64
  %108 = invoke noalias noundef nonnull ptr @_Znam(i64 noundef %107) #10
          to label %109 unwind label %133

109:                                              ; preds = %91
  call void @_ZNSt10unique_ptrIA_cSt14default_deleteIS0_EE5resetIPcvEEvT_(ptr noundef nonnull align 8 dereferenceable(8) %106, ptr noundef nonnull %108) #8
  %110 = getelementptr inbounds i8, ptr %6, i64 17
  %111 = load i8, ptr %110, align 1
  %.fr100 = freeze i8 %111
  %112 = and i8 %.fr100, 32
  %113 = icmp ne i8 %112, 0
  %.not55 = xor i1 %113, %2
  %114 = and i8 %.fr100, 16
  %.not56 = icmp eq i8 %114, 0
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %10) #8
  %115 = load i8, ptr %6, align 1, !tbaa !34
  %116 = zext i8 %115 to i64
  %117 = add nuw nsw i64 %116, 18
  %118 = getelementptr inbounds i8, ptr %6, i64 5
  %119 = load i16, ptr %118, align 1, !tbaa !35
  %120 = zext i16 %119 to i64
  %121 = getelementptr inbounds i8, ptr %6, i64 7
  %122 = load i8, ptr %121, align 1, !tbaa !36
  %123 = zext i8 %122 to i64
  %124 = mul nuw nsw i64 %123, %120
  %125 = add nuw nsw i64 %117, %124
  call void @_ZNSt4fposI11__mbstate_tEC2El(ptr noundef nonnull align 8 dereferenceable(16) %10, i64 noundef %125)
  %126 = call noundef i64 @_ZNKSt4fposI11__mbstate_tEcvlEv(ptr noundef nonnull align 8 dereferenceable(16) %10)
  %127 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZNSi5seekgElSt12_Ios_Seekdir(ptr noundef nonnull align 8 dereferenceable(16) %4, i64 noundef %126, i32 noundef 0)
          to label %.preheader unwind label %135

.preheader:                                       ; preds = %109
  %128 = load i32, ptr %99, align 4, !tbaa !31
  %129 = icmp sgt i32 %128, 0
  br i1 %129, label %.lr.ph98, label %._crit_edge99

.lr.ph98:                                         ; preds = %.preheader
  %130 = zext nneg i32 %102 to i64
  %131 = load i32, ptr %95, align 8, !tbaa !20
  %132 = icmp sgt i32 %131, 0
  br i1 %132, label %.lr.ph98.split, label %._crit_edge99

._crit_edge99:                                    ; preds = %._crit_edge, %.lr.ph98, %.preheader
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %10) #8
  call void @llvm.lifetime.end.p0(i64 18, ptr nonnull %6) #8
  call void @_ZNSt14basic_ifstreamIcSt11char_traitsIcEED1Ev(ptr noundef nonnull align 8 dereferenceable(256) %4) #8
  call void @llvm.lifetime.end.p0(i64 520, ptr nonnull %4) #8
  ret void

133:                                              ; preds = %91
  %134 = landingpad { ptr, i32 }
          cleanup
  br label %174

135:                                              ; preds = %109
  %136 = landingpad { ptr, i32 }
          cleanup
  br label %173

.lr.ph98.split:                                   ; preds = %.lr.ph98, %._crit_edge
  %137 = phi i32 [ %155, %._crit_edge ], [ %131, %.lr.ph98 ]
  %138 = phi i32 [ %157, %._crit_edge ], [ %128, %.lr.ph98 ]
  %.03997 = phi i32 [ %156, %._crit_edge ], [ 0, %.lr.ph98 ]
  %139 = icmp sgt i32 %137, 0
  br i1 %139, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %.lr.ph98.split
  %140 = xor i32 %.03997, -1
  %141 = add i32 %138, %140
  %142 = select i1 %.not55, i32 %.03997, i32 %141
  %143 = mul nsw i32 %142, %103
  %144 = sext i32 %143 to i64
  br i1 %.not56, label %.lr.ph.split.us, label %.lr.ph.split

.lr.ph.split.us:                                  ; preds = %.lr.ph, %150
  %indvars.iv = phi i64 [ %indvars.iv.next, %150 ], [ 0, %.lr.ph ]
  %145 = mul nuw nsw i64 %indvars.iv, %130
  %146 = call noundef ptr @_ZNKSt10unique_ptrIA_cSt14default_deleteIS0_EE3getEv(ptr noundef nonnull align 8 dereferenceable(8) %106) #8
  %147 = getelementptr inbounds i8, ptr %146, i64 %144
  %148 = getelementptr inbounds i8, ptr %147, i64 %145
  %149 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZNSi4readEPcl(ptr noundef nonnull align 8 dereferenceable(16) %4, ptr noundef %148, i64 noundef %130)
          to label %150 unwind label %.split.us

150:                                              ; preds = %.lr.ph.split.us
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %151 = load i32, ptr %95, align 8, !tbaa !20
  %152 = sext i32 %151 to i64
  %153 = icmp slt i64 %indvars.iv.next, %152
  br i1 %153, label %.lr.ph.split.us, label %._crit_edge, !llvm.loop !37

.split.us:                                        ; preds = %.lr.ph.split.us
  %154 = landingpad { ptr, i32 }
          cleanup
  br label %173

._crit_edge:                                      ; preds = %168, %150, %.lr.ph98.split
  %155 = phi i32 [ %137, %.lr.ph98.split ], [ %151, %150 ], [ %170, %168 ]
  %156 = add nuw nsw i32 %.03997, 1
  %157 = load i32, ptr %99, align 4, !tbaa !31
  %158 = icmp slt i32 %156, %157
  br i1 %158, label %.lr.ph98.split, label %._crit_edge99, !llvm.loop !39

.lr.ph.split:                                     ; preds = %.lr.ph, %168
  %159 = phi i32 [ %170, %168 ], [ %137, %.lr.ph ]
  %.02896 = phi i32 [ %169, %168 ], [ 0, %.lr.ph ]
  %160 = xor i32 %.02896, -1
  %161 = add i32 %159, %160
  %162 = mul nsw i32 %161, %102
  %163 = call noundef ptr @_ZNKSt10unique_ptrIA_cSt14default_deleteIS0_EE3getEv(ptr noundef nonnull align 8 dereferenceable(8) %106) #8
  %164 = getelementptr inbounds i8, ptr %163, i64 %144
  %165 = sext i32 %162 to i64
  %166 = getelementptr inbounds i8, ptr %164, i64 %165
  %167 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZNSi4readEPcl(ptr noundef nonnull align 8 dereferenceable(16) %4, ptr noundef %166, i64 noundef %130)
          to label %168 unwind label %.split

168:                                              ; preds = %.lr.ph.split
  %169 = add nuw nsw i32 %.02896, 1
  %170 = load i32, ptr %95, align 8, !tbaa !20
  %171 = icmp slt i32 %169, %170
  br i1 %171, label %.lr.ph.split, label %._crit_edge, !llvm.loop !37

.split:                                           ; preds = %.lr.ph.split
  %172 = landingpad { ptr, i32 }
          cleanup
  br label %173

173:                                              ; preds = %.split, %.split.us, %135
  %.pn = phi { ptr, i32 } [ %136, %135 ], [ %172, %.split ], [ %154, %.split.us ]
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %10) #8
  br label %174

174:                                              ; preds = %88, %67, %53, %133, %173, %90, %69, %55, %50
  %.pn63.pn = phi { ptr, i32 } [ %.pn6379, %55 ], [ %54, %53 ], [ %.pn6185, %69 ], [ %68, %67 ], [ %.pn5993, %90 ], [ %89, %88 ], [ %51, %50 ], [ %.pn, %173 ], [ %134, %133 ]
  call void @llvm.lifetime.end.p0(i64 18, ptr nonnull %6) #8
  br label %175

175:                                              ; preds = %35, %37, %174, %32
  %.pn66.pn = phi { ptr, i32 } [ %.pn6673, %37 ], [ %36, %35 ], [ %.pn63.pn, %174 ], [ %33, %32 ]
  call void @_ZNSt14basic_ifstreamIcSt11char_traitsIcEED1Ev(ptr noundef nonnull align 8 dereferenceable(256) %4) #8
  br label %176

176:                                              ; preds = %175, %30
  %.pn66.pn.pn = phi { ptr, i32 } [ %.pn66.pn, %175 ], [ %31, %30 ]
  call void @llvm.lifetime.end.p0(i64 520, ptr nonnull %4) #8
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %11) #8
  br label %177

177:                                              ; preds = %176, %28
  %.pn66.pn.pn.pn = phi { ptr, i32 } [ %.pn66.pn.pn, %176 ], [ %29, %28 ]
  call void @_ZN8Graphene5ImageD2Ev(ptr noundef nonnull align 8 dereferenceable(32) %0) #8
  resume { ptr, i32 } %.pn66.pn.pn.pn

178:                                              ; preds = %86, %65, %49, %27
  unreachable
}

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

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

declare i32 @__gxx_personality_v0(...)

; 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 nounwind uwtable
declare noundef ptr @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE5c_strEv(ptr noundef nonnull align 8 dereferenceable(32)) local_unnamed_addr #3 align 2

; Function Attrs: mustprogress uwtable
declare void @_ZNSt14basic_ifstreamIcSt11char_traitsIcEEC1EPKcSt13_Ios_Openmode(ptr noundef nonnull align 8 dereferenceable(256), ptr noundef, i32 noundef) unnamed_addr #0 align 2

; Function Attrs: mustprogress uwtable
declare noundef zeroext i1 @_ZNKSt9basic_iosIcSt11char_traitsIcEEntEv(ptr noundef nonnull align 8 dereferenceable(264)) local_unnamed_addr #0 align 2

declare ptr @__cxa_allocate_exception(i64) local_unnamed_addr

declare noundef nonnull align 4 dereferenceable(4) ptr @_ZN8Graphene6Logger11getInstanceEv() local_unnamed_addr #4

declare void @_ZN8Graphene6Logger10formatLineB5cxx11EPKciS2_z(ptr dead_on_unwind writable sret(%"class.std::__cxx11::basic_string") align 8, ptr noundef, i32 noundef, ptr noundef, ...) local_unnamed_addr #4

declare void @_ZNSt13runtime_errorC1ERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(32)) unnamed_addr #4

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

declare void @__cxa_throw(ptr, ptr, ptr) local_unnamed_addr

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

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

declare void @__cxa_free_exception(ptr) local_unnamed_addr

; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #6

declare noundef nonnull align 8 dereferenceable(16) ptr @_ZNSi4readEPcl(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef, i64 noundef) local_unnamed_addr #4

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt4fposI11__mbstate_tEC2El(ptr noundef nonnull align 8 dereferenceable(16), i64 noundef) unnamed_addr #3 align 2

declare noundef nonnull align 8 dereferenceable(16) ptr @_ZNSi5seekgElSt12_Ios_Seekdir(ptr noundef nonnull align 8 dereferenceable(16), i64 noundef, i32 noundef) local_unnamed_addr #4

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZNKSt4fposI11__mbstate_tEcvlEv(ptr noundef nonnull align 8 dereferenceable(16)) local_unnamed_addr #3 align 2

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

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

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

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

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"vtable pointer", !7, i64 0}
!7 = !{!"Simple C++ TBAA"}
!8 = !{!9, !11, i64 1}
!9 = !{!"_ZTSN8Graphene6HeaderE", !10, i64 0, !11, i64 1, !12, i64 2, !13, i64 3, !15, i64 8}
!10 = !{!"omnipotent char", !7, i64 0}
!11 = !{!"_ZTSN8Graphene12ColorMapTypeE", !10, i64 0}
!12 = !{!"_ZTSN8Graphene9ImageTypeE", !10, i64 0}
!13 = !{!"_ZTSN8Graphene12ColorMapSpecE", !14, i64 0, !14, i64 2, !10, i64 4}
!14 = !{!"short", !10, i64 0}
!15 = !{!"_ZTSN8Graphene9ImageSpecE", !14, i64 0, !14, i64 2, !14, i64 4, !14, i64 6, !10, i64 8, !16, i64 9}
!16 = !{!"_ZTSN8Graphene10ImageDescrE", !10, i64 0, !10, i64 0, !10, i64 0, !10, i64 0}
!17 = !{!9, !12, i64 2}
!18 = !{!9, !10, i64 16}
!19 = !{!9, !14, i64 12}
!20 = !{!21, !22, i64 8}
!21 = !{!"_ZTSN8Graphene5ImageE", !22, i64 8, !22, i64 12, !22, i64 16, !22, i64 20, !23, i64 24}
!22 = !{!"int", !10, i64 0}
!23 = !{!"_ZTSSt10unique_ptrIA_cSt14default_deleteIS0_EE", !24, i64 0}
!24 = !{!"_ZTSSt15__uniq_ptr_dataIcSt14default_deleteIA_cELb1ELb1EE", !25, i64 0}
!25 = !{!"_ZTSSt15__uniq_ptr_implIcSt14default_deleteIA_cEE", !26, i64 0}
!26 = !{!"_ZTSSt5tupleIJPcSt14default_deleteIA_cEEE", !27, i64 0}
!27 = !{!"_ZTSSt11_Tuple_implILm0EJPcSt14default_deleteIA_cEEE", !28, i64 0}
!28 = !{!"_ZTSSt10_Head_baseILm0EPcLb0EE", !29, i64 0}
!29 = !{!"any pointer", !10, i64 0}
!30 = !{!9, !14, i64 14}
!31 = !{!21, !22, i64 12}
!32 = !{!21, !22, i64 16}
!33 = !{!21, !22, i64 20}
!34 = !{!9, !10, i64 0}
!35 = !{!9, !14, i64 5}
!36 = !{!9, !10, i64 7}
!37 = distinct !{!37, !38}
!38 = !{!"llvm.loop.mustprogress"}
!39 = distinct !{!39, !38, !40}
!40 = !{!"llvm.loop.unswitch.partial.disable"}


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