; LLVM IR from trabucayre/openFPGALoader :: src/spiFlash.ll (ZN8SPIFlash14erase_and_progEiPKhi)

; 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::__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::allocator.0" = type { i8 }
%"class.std::map.6" = type { %"class.std::_Rb_tree.7" }
%"class.std::_Rb_tree.7" = type { %"struct.std::_Rb_tree<std::__cxx11::basic_string<char>, std::pair<const std::__cxx11::basic_string<char>, unsigned int>, std::_Select1st<std::pair<const std::__cxx11::basic_string<char>, unsigned int>>, std::less<std::__cxx11::basic_string<char>>>::_Rb_tree_impl" }
%"struct.std::_Rb_tree<std::__cxx11::basic_string<char>, std::pair<const std::__cxx11::basic_string<char>, unsigned int>, std::_Select1st<std::pair<const std::__cxx11::basic_string<char>, unsigned int>>, std::less<std::__cxx11::basic_string<char>>>::_Rb_tree_impl" = type { [8 x i8], %"struct.std::_Rb_tree_header" }
%"struct.std::_Rb_tree_header" = type { %"struct.std::_Rb_tree_node_base", i64 }
%"struct.std::_Rb_tree_node_base" = type { i32, ptr, ptr, ptr }
%class.ProgressBar = type <{ %"class.std::__cxx11::basic_string", i32, i32, %"class.std::chrono::time_point", i8, i8, [6 x i8] }>
%"class.std::chrono::time_point" = type { %"class.std::chrono::duration" }
%"class.std::chrono::duration" = type { i64 }
%class.SPIFlash = type <{ ptr, ptr, i8, [3 x i8], i32, ptr, i8, [7 x i8] }>
%struct.flash_t = type <{ %"class.std::__cxx11::basic_string", %"class.std::__cxx11::basic_string", i32, i8, i8, i8, i8, i8, [3 x i8], i32, i8, [4 x i8], [3 x i8], i32, i16, [2 x i8] }>

@.str.51 = external hidden unnamed_addr constant [46 x i8], align 1
@_ZTISt9exception = external constant ptr
@.str.62 = external hidden unnamed_addr constant [15 x i8], align 1
@.str.63 = external hidden unnamed_addr constant [21 x i8], align 1
@.str.64 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.65 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.66 = external hidden unnamed_addr constant [51 x i8], align 1
@.str.67 = external hidden unnamed_addr constant [15 x i8], align 1
@.str.68 = external hidden unnamed_addr constant [31 x i8], align 1
@.str.69 = external hidden unnamed_addr constant [8 x i8], align 1

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

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

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

declare i32 @__gxx_personality_v0(...)

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i8 @_ZN8SPIFlash6get_bpEv(ptr noundef nonnull align 8 dereferenceable(33)) #2 align 2

declare void @_Z10printErrorRKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEb(ptr noundef nonnull align 8 dereferenceable(32), i1 noundef zeroext) #3

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_ZN8SPIFlash18disable_protectionEv(ptr noundef nonnull align 8 dereferenceable(33)) #2 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_ZN8SPIFlash17enable_protectionEh(ptr noundef nonnull align 8 dereferenceable(33), i8 noundef zeroext) #2 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_ZN8SPIFlash13sectors_eraseEii(ptr noundef nonnull align 8 dereferenceable(33), i32 noundef, i32 noundef) #2 align 2

declare void @_ZN11ProgressBarC1ERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEiib(ptr noundef nonnull align 8 dereferenceable(50), ptr noundef nonnull align 8 dereferenceable(32), i32 noundef, i32 noundef, i1 noundef zeroext) unnamed_addr #3

declare i32 @printf(ptr noundef, ...) #3

declare void @_ZN11ProgressBar7displayEic(ptr noundef nonnull align 8 dereferenceable(50), i32 noundef, i8 noundef signext) #3

declare void @_ZN11ProgressBar4doneEv(ptr noundef nonnull align 8 dereferenceable(50)) #3

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_ZN8SPIFlash10write_pageEiPKhi(ptr noundef nonnull align 8 dereferenceable(33), i32 noundef, ptr noundef, i32 noundef) #2 align 2

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_ZN8SPIFlash14erase_and_progEiPKhi(ptr noundef nonnull align 8 dereferenceable(33) %0, i32 noundef %1, ptr noundef %2, i32 noundef %3) #2 align 2 personality ptr @__gxx_personality_v0 {
  %5 = alloca i32, align 4
  %6 = alloca ptr, align 8
  %7 = alloca i32, align 4
  %8 = alloca ptr, align 8
  %9 = alloca i32, align 4
  %10 = alloca ptr, align 8
  %11 = alloca i32, align 4
  %12 = alloca ptr, align 8
  %13 = alloca %"class.std::__cxx11::basic_string", align 8
  %14 = alloca %"class.std::allocator.0", align 1
  %15 = alloca i8, align 1
  %16 = alloca i32, align 4
  %17 = alloca i8, align 1
  %18 = alloca %"class.std::__cxx11::basic_string", align 8
  %19 = alloca %"class.std::allocator.0", align 1
  %20 = alloca i8, align 1
  %21 = alloca %"class.std::map.6", align 8
  %22 = alloca %"class.std::__cxx11::basic_string", align 8
  %23 = alloca %"class.std::allocator.0", align 1
  %24 = alloca %"class.std::__cxx11::basic_string", align 8
  %25 = alloca %"class.std::allocator.0", align 1
  %26 = alloca %"class.std::__cxx11::basic_string", align 8
  %27 = alloca %"class.std::allocator.0", align 1
  %28 = alloca %"class.std::__cxx11::basic_string", align 8
  %29 = alloca i1, align 1
  %30 = alloca %"class.std::allocator.0", align 1
  %31 = alloca i1, align 1
  %32 = alloca i1, align 1
  %33 = alloca i1, align 1
  %34 = alloca %"class.std::__cxx11::basic_string", align 8
  %35 = alloca %"class.std::allocator.0", align 1
  %36 = alloca %"class.std::__cxx11::basic_string", align 8
  %37 = alloca %"class.std::allocator.0", align 1
  %38 = alloca %"class.std::__cxx11::basic_string", align 8
  %39 = alloca %"class.std::allocator.0", align 1
  %40 = alloca %"class.std::__cxx11::basic_string", align 8
  %41 = alloca %"class.std::allocator.0", align 1
  %42 = alloca %"class.std::__cxx11::basic_string", align 8
  %43 = alloca %"class.std::allocator.0", align 1
  %44 = alloca %class.ProgressBar, align 8
  %45 = alloca %"class.std::__cxx11::basic_string", align 8
  %46 = alloca %"class.std::allocator.0", align 1
  %47 = alloca ptr, align 8
  %48 = alloca i32, align 4
  %49 = alloca i32, align 4
  store ptr %0, ptr %6, align 8, !tbaa !5
  store i32 %1, ptr %7, align 4, !tbaa !9
  store ptr %2, ptr %8, align 8, !tbaa !5
  store i32 %3, ptr %9, align 4, !tbaa !9
  %50 = load ptr, ptr %6, align 8
  %51 = getelementptr inbounds %class.SPIFlash, ptr %50, i32 0, i32 4
  %52 = load i32, ptr %51, align 4, !tbaa !11
  %53 = icmp eq i32 %52, 0
  br i1 %53, label %54, label %88

54:                                               ; preds = %4
  %55 = load ptr, ptr %50, align 8, !tbaa !14
  %56 = getelementptr inbounds ptr, ptr %55, i64 3
  %57 = load ptr, ptr %56, align 8
  invoke void %57(ptr noundef nonnull align 8 dereferenceable(33) %50)
          to label %58 unwind label %59

58:                                               ; preds = %54
  br label %87

59:                                               ; preds = %54
  %60 = landingpad { ptr, i32 }
          catch ptr @_ZTISt9exception
  %61 = extractvalue { ptr, i32 } %60, 0
  store ptr %61, ptr %10, align 8
  %62 = extractvalue { ptr, i32 } %60, 1
  store i32 %62, ptr %11, align 4
  br label %63

63:                                               ; preds = %59
  %64 = load i32, ptr %11, align 4
  %65 = call i32 @llvm.eh.typeid.for.p0(ptr @_ZTISt9exception) #7
  %66 = icmp eq i32 %64, %65
  br i1 %66, label %67, label %478

67:                                               ; preds = %63
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #7
  %68 = load ptr, ptr %10, align 8
  %69 = call ptr @__cxa_begin_catch(ptr %68) #7
  store ptr %69, ptr %12, align 8
  call void @llvm.lifetime.start.p0(i64 32, ptr %13) #7
  %70 = load ptr, ptr %12, align 8, !tbaa !5
  %71 = load ptr, ptr %70, align 8, !tbaa !14
  %72 = getelementptr inbounds ptr, ptr %71, i64 2
  %73 = load ptr, ptr %72, align 8
  %74 = call noundef ptr %73(ptr noundef nonnull align 8 dereferenceable(8) %70) #7
  call void @llvm.lifetime.start.p0(i64 1, ptr %14) #7
  call void @_ZNSaIcEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %14) #7
  invoke void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_(ptr noundef nonnull align 8 dereferenceable(32) %13, ptr noundef %74, ptr noundef nonnull align 1 dereferenceable(1) %14)
          to label %75 unwind label %77

75:                                               ; preds = %67
  invoke void @_Z10printErrorRKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEb(ptr noundef nonnull align 8 dereferenceable(32) %13, i1 noundef zeroext true)
          to label %76 unwind label %81

76:                                               ; preds = %75
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %13) #7
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %14) #7
  call void @llvm.lifetime.end.p0(i64 1, ptr %14) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr %13) #7
  store i32 -1, ptr %5, align 4
  call void @__cxa_end_catch()
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #7
  br label %476

77:                                               ; preds = %67
  %78 = landingpad { ptr, i32 }
          cleanup
  %79 = extractvalue { ptr, i32 } %78, 0
  store ptr %79, ptr %10, align 8
  %80 = extractvalue { ptr, i32 } %78, 1
  store i32 %80, ptr %11, align 4
  br label %85

81:                                               ; preds = %75
  %82 = landingpad { ptr, i32 }
          cleanup
  %83 = extractvalue { ptr, i32 } %82, 0
  store ptr %83, ptr %10, align 8
  %84 = extractvalue { ptr, i32 } %82, 1
  store i32 %84, ptr %11, align 4
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %13) #7
  br label %85

85:                                               ; preds = %81, %77
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %14) #7
  call void @llvm.lifetime.end.p0(i64 1, ptr %14) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr %13) #7
  invoke void @__cxa_end_catch()
          to label %86 unwind label %483

86:                                               ; preds = %85
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #7
  br label %478

87:                                               ; preds = %58
  br label %88

88:                                               ; preds = %87, %4
  call void @llvm.lifetime.start.p0(i64 1, ptr %15) #7
  store i8 0, ptr %15, align 1, !tbaa !16
  %89 = getelementptr inbounds %class.SPIFlash, ptr %50, i32 0, i32 4
  %90 = load i32, ptr %89, align 4, !tbaa !11
  %91 = icmp eq i32 %90, -1088011585
  br i1 %91, label %92, label %96

92:                                               ; preds = %88
  %93 = call noundef zeroext i1 @_ZN8SPIFlash13global_unlockEv(ptr noundef nonnull align 8 dereferenceable(33) %50)
  br i1 %93, label %95, label %94

94:                                               ; preds = %92
  store i32 -1, ptr %5, align 4
  store i32 1, ptr %16, align 4
  br label %475

95:                                               ; preds = %92
  br label %96

96:                                               ; preds = %95, %88
  call void @llvm.lifetime.start.p0(i64 1, ptr %17) #7
  %97 = call noundef zeroext i8 @_ZN8SPIFlash15read_status_regEv(ptr noundef nonnull align 8 dereferenceable(33) %50)
  %98 = zext i8 %97 to i32
  %99 = and i32 %98, -4
  %100 = trunc i32 %99 to i8
  store i8 %100, ptr %17, align 1, !tbaa !17
  %101 = getelementptr inbounds %class.SPIFlash, ptr %50, i32 0, i32 2
  %102 = load i8, ptr %101, align 8, !tbaa !18
  %103 = sext i8 %102 to i32
  %104 = icmp sgt i32 %103, 0
  br i1 %104, label %105, label %107

105:                                              ; preds = %96
  %106 = load i8, ptr %17, align 1, !tbaa !17
  call void @_ZN8SPIFlash18display_status_regEh(ptr noundef nonnull align 8 dereferenceable(33) %50, i8 noundef zeroext %106)
  br label %107

107:                                              ; preds = %105, %96
  %108 = getelementptr inbounds %class.SPIFlash, ptr %50, i32 0, i32 5
  %109 = load ptr, ptr %108, align 8, !tbaa !19
  %110 = icmp ne ptr %109, null
  br i1 %110, label %111, label %314

111:                                              ; preds = %107
  %112 = load i32, ptr %7, align 4, !tbaa !9
  %113 = load i32, ptr %9, align 4, !tbaa !9
  %114 = add nsw i32 %112, %113
  %115 = getelementptr inbounds %class.SPIFlash, ptr %50, i32 0, i32 5
  %116 = load ptr, ptr %115, align 8, !tbaa !19
  %117 = getelementptr inbounds %struct.flash_t, ptr %116, i32 0, i32 2
  %118 = load i32, ptr %117, align 8, !tbaa !20
  %119 = mul i32 %118, 65536
  %120 = icmp ugt i32 %114, %119
  br i1 %120, label %121, label %133

121:                                              ; preds = %111
  call void @llvm.lifetime.start.p0(i64 32, ptr %18) #7
  call void @llvm.lifetime.start.p0(i64 1, ptr %19) #7
  call void @_ZNSaIcEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %19) #7
  invoke void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_(ptr noundef nonnull align 8 dereferenceable(32) %18, ptr noundef @.str.62, ptr noundef nonnull align 1 dereferenceable(1) %19)
          to label %122 unwind label %124

122:                                              ; preds = %121
  invoke void @_Z10printErrorRKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEb(ptr noundef nonnull align 8 dereferenceable(32) %18, i1 noundef zeroext true)
          to label %123 unwind label %128

123:                                              ; preds = %122
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %18) #7
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %19) #7
  call void @llvm.lifetime.end.p0(i64 1, ptr %19) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr %18) #7
  store i32 -1, ptr %5, align 4
  store i32 1, ptr %16, align 4
  br label %473

124:                                              ; preds = %121
  %125 = landingpad { ptr, i32 }
          cleanup
  %126 = extractvalue { ptr, i32 } %125, 0
  store ptr %126, ptr %10, align 8
  %127 = extractvalue { ptr, i32 } %125, 1
  store i32 %127, ptr %11, align 4
  br label %132

128:                                              ; preds = %122
  %129 = landingpad { ptr, i32 }
          cleanup
  %130 = extractvalue { ptr, i32 } %129, 0
  store ptr %130, ptr %10, align 8
  %131 = extractvalue { ptr, i32 } %129, 1
  store i32 %131, ptr %11, align 4
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %18) #7
  br label %132

132:                                              ; preds = %128, %124
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %19) #7
  call void @llvm.lifetime.end.p0(i64 1, ptr %19) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr %18) #7
  br label %474

133:                                              ; preds = %111
  %134 = getelementptr inbounds %class.SPIFlash, ptr %50, i32 0, i32 5
  %135 = load ptr, ptr %134, align 8, !tbaa !19
  %136 = getelementptr inbounds %struct.flash_t, ptr %135, i32 0, i32 10
  %137 = load i8, ptr %136, align 8, !tbaa !27
  %138 = zext i8 %137 to i32
  %139 = icmp ne i32 %138, 0
  br i1 %139, label %140, label %313

140:                                              ; preds = %133
  call void @llvm.lifetime.start.p0(i64 1, ptr %20) #7
  %141 = call noundef signext i8 @_ZN8SPIFlash6get_tbEv(ptr noundef nonnull align 8 dereferenceable(33) %50)
  store i8 %141, ptr %20, align 1, !tbaa !17
  %142 = load i8, ptr %20, align 1, !tbaa !17
  %143 = sext i8 %142 to i32
  %144 = icmp eq i32 %143, -1
  br i1 %144, label %145, label %146

145:                                              ; preds = %140
  store i32 -1, ptr %5, align 4
  store i32 1, ptr %16, align 4
  br label %309

146:                                              ; preds = %140
  call void @llvm.lifetime.start.p0(i64 48, ptr %21) #7
  %147 = load i8, ptr %17, align 1, !tbaa !17
  %148 = load i8, ptr %20, align 1, !tbaa !17
  call void @_ZN8SPIFlash9bp_to_lenB5cxx11Ehh(ptr dead_on_unwind writable sret(%"class.std::map.6") align 8 %21, ptr noundef nonnull align 8 dereferenceable(33) %50, i8 noundef zeroext %147, i8 noundef zeroext %148)
  %149 = load i32, ptr %7, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 32, ptr %22) #7
  call void @llvm.lifetime.start.p0(i64 1, ptr %23) #7
  call void @_ZNSaIcEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %23) #7
  invoke void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_(ptr noundef nonnull align 8 dereferenceable(32) %22, ptr noundef @.str.64, ptr noundef nonnull align 1 dereferenceable(1) %23)
          to label %150 unwind label %199

150:                                              ; preds = %146
  %151 = invoke noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt3mapINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEjSt4lessIS5_ESaISt4pairIKS5_jEEEixEOS5_(ptr noundef nonnull align 8 dereferenceable(48) %21, ptr noundef nonnull align 8 dereferenceable(32) %22)
          to label %152 unwind label %203

152:                                              ; preds = %150
  %153 = load i32, ptr %151, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 32, ptr %24) #7
  call void @llvm.lifetime.start.p0(i64 1, ptr %25) #7
  call void @_ZNSaIcEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %25) #7
  invoke void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_(ptr noundef nonnull align 8 dereferenceable(32) %24, ptr noundef @.str.65, ptr noundef nonnull align 1 dereferenceable(1) %25)
          to label %154 unwind label %207

154:                                              ; preds = %152
  %155 = invoke noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt3mapINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEjSt4lessIS5_ESaISt4pairIKS5_jEEEixEOS5_(ptr noundef nonnull align 8 dereferenceable(48) %21, ptr noundef nonnull align 8 dereferenceable(32) %24)
          to label %156 unwind label %211

156:                                              ; preds = %154
  %157 = load i32, ptr %155, align 4, !tbaa !9
  %158 = load i8, ptr %17, align 1, !tbaa !17
  %159 = zext i8 %158 to i32
  %160 = invoke i32 (ptr, ...) @printf(ptr noundef @.str.63, i32 noundef %149, i32 noundef %153, i32 noundef %157, i32 noundef %159)
          to label %161 unwind label %211

161:                                              ; preds = %156
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %24) #7
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %25) #7
  call void @llvm.lifetime.end.p0(i64 1, ptr %25) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr %24) #7
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %22) #7
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %23) #7
  call void @llvm.lifetime.end.p0(i64 1, ptr %23) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr %22) #7
  call void @llvm.lifetime.start.p0(i64 32, ptr %26) #7
  call void @llvm.lifetime.start.p0(i64 1, ptr %27) #7
  call void @_ZNSaIcEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %27) #7
  store i1 false, ptr %29, align 1
  store i1 false, ptr %31, align 1
  store i1 false, ptr %32, align 1
  store i1 false, ptr %33, align 1
  invoke void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_(ptr noundef nonnull align 8 dereferenceable(32) %26, ptr noundef @.str.64, ptr noundef nonnull align 1 dereferenceable(1) %27)
          to label %162 unwind label %218

162:                                              ; preds = %161
  %163 = invoke noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt3mapINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEjSt4lessIS5_ESaISt4pairIKS5_jEEEixEOS5_(ptr noundef nonnull align 8 dereferenceable(48) %21, ptr noundef nonnull align 8 dereferenceable(32) %26)
          to label %164 unwind label %222

164:                                              ; preds = %162
  %165 = load i32, ptr %163, align 4, !tbaa !9
  %166 = icmp ne i32 %165, 0
  br i1 %166, label %173, label %167

167:                                              ; preds = %164
  call void @llvm.lifetime.start.p0(i64 32, ptr %28) #7
  store i1 true, ptr %29, align 1
  call void @llvm.lifetime.start.p0(i64 1, ptr %30) #7
  store i1 true, ptr %31, align 1
  call void @_ZNSaIcEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %30) #7
  store i1 true, ptr %32, align 1
  invoke void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_(ptr noundef nonnull align 8 dereferenceable(32) %28, ptr noundef @.str.65, ptr noundef nonnull align 1 dereferenceable(1) %30)
          to label %168 unwind label %226

168:                                              ; preds = %167
  store i1 true, ptr %33, align 1
  %169 = invoke noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt3mapINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEjSt4lessIS5_ESaISt4pairIKS5_jEEEixEOS5_(ptr noundef nonnull align 8 dereferenceable(48) %21, ptr noundef nonnull align 8 dereferenceable(32) %28)
          to label %170 unwind label %230

170:                                              ; preds = %168
  %171 = load i32, ptr %169, align 4, !tbaa !9
  %172 = icmp ne i32 %171, 0
  br label %173

173:                                              ; preds = %170, %164
  %174 = phi i1 [ true, %164 ], [ %172, %170 ]
  %175 = load i1, ptr %33, align 1
  br i1 %175, label %176, label %177

176:                                              ; preds = %173
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %28) #7
  br label %177

177:                                              ; preds = %176, %173
  %178 = load i1, ptr %32, align 1
  br i1 %178, label %179, label %180

179:                                              ; preds = %177
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %30) #7
  br label %180

180:                                              ; preds = %179, %177
  %181 = load i1, ptr %31, align 1
  br i1 %181, label %182, label %183

182:                                              ; preds = %180
  call void @llvm.lifetime.end.p0(i64 1, ptr %30) #7
  br label %183

183:                                              ; preds = %182, %180
  %184 = load i1, ptr %29, align 1
  br i1 %184, label %185, label %186

185:                                              ; preds = %183
  call void @llvm.lifetime.end.p0(i64 32, ptr %28) #7
  br label %186

186:                                              ; preds = %185, %183
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %26) #7
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %27) #7
  call void @llvm.lifetime.end.p0(i64 1, ptr %27) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr %26) #7
  br i1 %174, label %187, label %280

187:                                              ; preds = %186
  %188 = load i8, ptr %20, align 1, !tbaa !17
  %189 = sext i8 %188 to i32
  %190 = icmp eq i32 %189, 1
  br i1 %190, label %191, label %259

191:                                              ; preds = %187
  %192 = load i32, ptr %7, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 32, ptr %34) #7
  call void @llvm.lifetime.start.p0(i64 1, ptr %35) #7
  call void @_ZNSaIcEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %35) #7
  invoke void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_(ptr noundef nonnull align 8 dereferenceable(32) %34, ptr noundef @.str.65, ptr noundef nonnull align 1 dereferenceable(1) %35)
          to label %193 unwind label %249

193:                                              ; preds = %191
  %194 = invoke noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt3mapINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEjSt4lessIS5_ESaISt4pairIKS5_jEEEixEOS5_(ptr noundef nonnull align 8 dereferenceable(48) %21, ptr noundef nonnull align 8 dereferenceable(32) %34)
          to label %195 unwind label %253

195:                                              ; preds = %193
  %196 = load i32, ptr %194, align 4, !tbaa !9
  %197 = icmp ule i32 %192, %196
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %34) #7
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %35) #7
  call void @llvm.lifetime.end.p0(i64 1, ptr %35) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr %34) #7
  br i1 %197, label %198, label %258

198:                                              ; preds = %195
  store i8 1, ptr %15, align 1, !tbaa !16
  br label %258

199:                                              ; preds = %146
  %200 = landingpad { ptr, i32 }
          cleanup
  %201 = extractvalue { ptr, i32 } %200, 0
  store ptr %201, ptr %10, align 8
  %202 = extractvalue { ptr, i32 } %200, 1
  store i32 %202, ptr %11, align 4
  br label %217

203:                                              ; preds = %150
  %204 = landingpad { ptr, i32 }
          cleanup
  %205 = extractvalue { ptr, i32 } %204, 0
  store ptr %205, ptr %10, align 8
  %206 = extractvalue { ptr, i32 } %204, 1
  store i32 %206, ptr %11, align 4
  br label %216

207:                                              ; preds = %152
  %208 = landingpad { ptr, i32 }
          cleanup
  %209 = extractvalue { ptr, i32 } %208, 0
  store ptr %209, ptr %10, align 8
  %210 = extractvalue { ptr, i32 } %208, 1
  store i32 %210, ptr %11, align 4
  br label %215

211:                                              ; preds = %156, %154
  %212 = landingpad { ptr, i32 }
          cleanup
  %213 = extractvalue { ptr, i32 } %212, 0
  store ptr %213, ptr %10, align 8
  %214 = extractvalue { ptr, i32 } %212, 1
  store i32 %214, ptr %11, align 4
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %24) #7
  br label %215

215:                                              ; preds = %211, %207
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %25) #7
  call void @llvm.lifetime.end.p0(i64 1, ptr %25) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr %24) #7
  br label %216

216:                                              ; preds = %215, %203
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %22) #7
  br label %217

217:                                              ; preds = %216, %199
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %23) #7
  call void @llvm.lifetime.end.p0(i64 1, ptr %23) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr %22) #7
  br label %312

218:                                              ; preds = %161
  %219 = landingpad { ptr, i32 }
          cleanup
  %220 = extractvalue { ptr, i32 } %219, 0
  store ptr %220, ptr %10, align 8
  %221 = extractvalue { ptr, i32 } %219, 1
  store i32 %221, ptr %11, align 4
  br label %248

222:                                              ; preds = %162
  %223 = landingpad { ptr, i32 }
          cleanup
  %224 = extractvalue { ptr, i32 } %223, 0
  store ptr %224, ptr %10, align 8
  %225 = extractvalue { ptr, i32 } %223, 1
  store i32 %225, ptr %11, align 4
  br label %247

226:                                              ; preds = %167
  %227 = landingpad { ptr, i32 }
          cleanup
  %228 = extractvalue { ptr, i32 } %227, 0
  store ptr %228, ptr %10, align 8
  %229 = extractvalue { ptr, i32 } %227, 1
  store i32 %229, ptr %11, align 4
  br label %237

230:                                              ; preds = %168
  %231 = landingpad { ptr, i32 }
          cleanup
  %232 = extractvalue { ptr, i32 } %231, 0
  store ptr %232, ptr %10, align 8
  %233 = extractvalue { ptr, i32 } %231, 1
  store i32 %233, ptr %11, align 4
  %234 = load i1, ptr %33, align 1
  br i1 %234, label %235, label %236

235:                                              ; preds = %230
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %28) #7
  br label %236

236:                                              ; preds = %235, %230
  br label %237

237:                                              ; preds = %236, %226
  %238 = load i1, ptr %32, align 1
  br i1 %238, label %239, label %240

239:                                              ; preds = %237
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %30) #7
  br label %240

240:                                              ; preds = %239, %237
  %241 = load i1, ptr %31, align 1
  br i1 %241, label %242, label %243

242:                                              ; preds = %240
  call void @llvm.lifetime.end.p0(i64 1, ptr %30) #7
  br label %243

243:                                              ; preds = %242, %240
  %244 = load i1, ptr %29, align 1
  br i1 %244, label %245, label %246

245:                                              ; preds = %243
  call void @llvm.lifetime.end.p0(i64 32, ptr %28) #7
  br label %246

246:                                              ; preds = %245, %243
  br label %247

247:                                              ; preds = %246, %222
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %26) #7
  br label %248

248:                                              ; preds = %247, %218
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %27) #7
  call void @llvm.lifetime.end.p0(i64 1, ptr %27) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr %26) #7
  br label %312

249:                                              ; preds = %191
  %250 = landingpad { ptr, i32 }
          cleanup
  %251 = extractvalue { ptr, i32 } %250, 0
  store ptr %251, ptr %10, align 8
  %252 = extractvalue { ptr, i32 } %250, 1
  store i32 %252, ptr %11, align 4
  br label %257

253:                                              ; preds = %193
  %254 = landingpad { ptr, i32 }
          cleanup
  %255 = extractvalue { ptr, i32 } %254, 0
  store ptr %255, ptr %10, align 8
  %256 = extractvalue { ptr, i32 } %254, 1
  store i32 %256, ptr %11, align 4
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %34) #7
  br label %257

257:                                              ; preds = %253, %249
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %35) #7
  call void @llvm.lifetime.end.p0(i64 1, ptr %35) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr %34) #7
  br label %312

258:                                              ; preds = %198, %195
  br label %279

259:                                              ; preds = %187
  %260 = load i32, ptr %7, align 4, !tbaa !9
  %261 = load i32, ptr %9, align 4, !tbaa !9
  %262 = add nsw i32 %260, %261
  call void @llvm.lifetime.start.p0(i64 32, ptr %36) #7
  call void @llvm.lifetime.start.p0(i64 1, ptr %37) #7
  call void @_ZNSaIcEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %37) #7
  invoke void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_(ptr noundef nonnull align 8 dereferenceable(32) %36, ptr noundef @.str.64, ptr noundef nonnull align 1 dereferenceable(1) %37)
          to label %263 unwind label %269

263:                                              ; preds = %259
  %264 = invoke noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt3mapINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEjSt4lessIS5_ESaISt4pairIKS5_jEEEixEOS5_(ptr noundef nonnull align 8 dereferenceable(48) %21, ptr noundef nonnull align 8 dereferenceable(32) %36)
          to label %265 unwind label %273

265:                                              ; preds = %263
  %266 = load i32, ptr %264, align 4, !tbaa !9
  %267 = icmp uge i32 %262, %266
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %36) #7
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %37) #7
  call void @llvm.lifetime.end.p0(i64 1, ptr %37) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr %36) #7
  br i1 %267, label %268, label %278

268:                                              ; preds = %265
  store i8 1, ptr %15, align 1, !tbaa !16
  br label %278

269:                                              ; preds = %259
  %270 = landingpad { ptr, i32 }
          cleanup
  %271 = extractvalue { ptr, i32 } %270, 0
  store ptr %271, ptr %10, align 8
  %272 = extractvalue { ptr, i32 } %270, 1
  store i32 %272, ptr %11, align 4
  br label %277

273:                                              ; preds = %263
  %274 = landingpad { ptr, i32 }
          cleanup
  %275 = extractvalue { ptr, i32 } %274, 0
  store ptr %275, ptr %10, align 8
  %276 = extractvalue { ptr, i32 } %274, 1
  store i32 %276, ptr %11, align 4
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %36) #7
  br label %277

277:                                              ; preds = %273, %269
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %37) #7
  call void @llvm.lifetime.end.p0(i64 1, ptr %37) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr %36) #7
  br label %312

278:                                              ; preds = %268, %265
  br label %279

279:                                              ; preds = %278, %258
  br label %280

280:                                              ; preds = %279, %186
  %281 = getelementptr inbounds %class.SPIFlash, ptr %50, i32 0, i32 4
  %282 = load i32, ptr %281, align 4, !tbaa !11
  %283 = lshr i32 %282, 8
  %284 = icmp eq i32 %283, 10313750
  br i1 %284, label %285, label %294

285:                                              ; preds = %280
  %286 = load i8, ptr %20, align 1, !tbaa !17
  %287 = sext i8 %286 to i32
  %288 = icmp eq i32 %287, 1
  br i1 %288, label %289, label %294

289:                                              ; preds = %285
  %290 = load i32, ptr %7, align 4, !tbaa !9
  %291 = icmp ne i32 %290, 0
  br i1 %291, label %292, label %294

292:                                              ; preds = %289
  %293 = getelementptr inbounds %class.SPIFlash, ptr %50, i32 0, i32 6
  store i8 1, ptr %293, align 8, !tbaa !28
  store i8 1, ptr %15, align 1, !tbaa !16
  br label %294

294:                                              ; preds = %292, %289, %285, %280
  %295 = getelementptr inbounds %class.SPIFlash, ptr %50, i32 0, i32 4
  %296 = load i32, ptr %295, align 4, !tbaa !11
  %297 = lshr i32 %296, 8
  %298 = icmp eq i32 %297, 2105365
  br i1 %298, label %299, label %308

299:                                              ; preds = %294
  %300 = load i8, ptr %20, align 1, !tbaa !17
  %301 = sext i8 %300 to i32
  %302 = icmp eq i32 %301, 1
  br i1 %302, label %303, label %308

303:                                              ; preds = %299
  %304 = load i32, ptr %7, align 4, !tbaa !9
  %305 = icmp ne i32 %304, 0
  br i1 %305, label %306, label %308

306:                                              ; preds = %303
  %307 = getelementptr inbounds %class.SPIFlash, ptr %50, i32 0, i32 6
  store i8 1, ptr %307, align 8, !tbaa !28
  store i8 1, ptr %15, align 1, !tbaa !16
  br label %308

308:                                              ; preds = %306, %303, %299, %294
  call void @_ZNSt3mapINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEjSt4lessIS5_ESaISt4pairIKS5_jEEED2Ev(ptr noundef nonnull align 8 dereferenceable(48) %21) #7
  call void @llvm.lifetime.end.p0(i64 48, ptr %21) #7
  store i32 0, ptr %16, align 4
  br label %309

309:                                              ; preds = %308, %145
  call void @llvm.lifetime.end.p0(i64 1, ptr %20) #7
  %310 = load i32, ptr %16, align 4
  switch i32 %310, label %473 [
    i32 0, label %311
  ]

311:                                              ; preds = %309
  br label %313

312:                                              ; preds = %277, %257, %248, %217
  call void @_ZNSt3mapINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEjSt4lessIS5_ESaISt4pairIKS5_jEEED2Ev(ptr noundef nonnull align 8 dereferenceable(48) %21) #7
  call void @llvm.lifetime.end.p0(i64 48, ptr %21) #7
  call void @llvm.lifetime.end.p0(i64 1, ptr %20) #7
  br label %474

313:                                              ; preds = %311, %133
  br label %331

314:                                              ; preds = %107
  call void @llvm.lifetime.start.p0(i64 32, ptr %38) #7
  call void @llvm.lifetime.start.p0(i64 1, ptr %39) #7
  call void @_ZNSaIcEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %39) #7
  invoke void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_(ptr noundef nonnull align 8 dereferenceable(32) %38, ptr noundef @.str.66, ptr noundef nonnull align 1 dereferenceable(1) %39)
          to label %315 unwind label %321

315:                                              ; preds = %314
  invoke void @_Z9printWarnRKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEb(ptr noundef nonnull align 8 dereferenceable(32) %38, i1 noundef zeroext true)
          to label %316 unwind label %325

316:                                              ; preds = %315
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %38) #7
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %39) #7
  call void @llvm.lifetime.end.p0(i64 1, ptr %39) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr %38) #7
  %317 = call noundef zeroext i8 @_ZN8SPIFlash6get_bpEv(ptr noundef nonnull align 8 dereferenceable(33) %50)
  %318 = zext i8 %317 to i32
  %319 = icmp ne i32 %318, 0
  br i1 %319, label %320, label %330

320:                                              ; preds = %316
  store i8 1, ptr %15, align 1, !tbaa !16
  br label %330

321:                                              ; preds = %314
  %322 = landingpad { ptr, i32 }
          cleanup
  %323 = extractvalue { ptr, i32 } %322, 0
  store ptr %323, ptr %10, align 8
  %324 = extractvalue { ptr, i32 } %322, 1
  store i32 %324, ptr %11, align 4
  br label %329

325:                                              ; preds = %315
  %326 = landingpad { ptr, i32 }
          cleanup
  %327 = extractvalue { ptr, i32 } %326, 0
  store ptr %327, ptr %10, align 8
  %328 = extractvalue { ptr, i32 } %326, 1
  store i32 %328, ptr %11, align 4
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %38) #7
  br label %329

329:                                              ; preds = %325, %321
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %39) #7
  call void @llvm.lifetime.end.p0(i64 1, ptr %39) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr %38) #7
  br label %474

330:                                              ; preds = %320, %316
  br label %331

331:                                              ; preds = %330, %313
  %332 = load i8, ptr %15, align 1, !tbaa !16, !range !29, !noundef !30
  %333 = trunc i8 %332 to i1
  br i1 %333, label %334, label %368

334:                                              ; preds = %331
  %335 = call i32 (ptr, ...) @printf(ptr noundef @.str.67)
  %336 = getelementptr inbounds %class.SPIFlash, ptr %50, i32 0, i32 6
  %337 = load i8, ptr %336, align 8, !tbaa !28, !range !29, !noundef !30
  %338 = trunc i8 %337 to i1
  br i1 %338, label %362, label %339

339:                                              ; preds = %334
  call void @llvm.lifetime.start.p0(i64 32, ptr %40) #7
  call void @llvm.lifetime.start.p0(i64 1, ptr %41) #7
  call void @_ZNSaIcEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %41) #7
  invoke void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_(ptr noundef nonnull align 8 dereferenceable(32) %40, ptr noundef @.str.68, ptr noundef nonnull align 1 dereferenceable(1) %41)
          to label %340 unwind label %344

340:                                              ; preds = %339
  invoke void @_Z10printErrorRKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEb(ptr noundef nonnull align 8 dereferenceable(32) %40, i1 noundef zeroext true)
          to label %341 unwind label %348

341:                                              ; preds = %340
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %40) #7
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %41) #7
  call void @llvm.lifetime.end.p0(i64 1, ptr %41) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr %40) #7
  call void @llvm.lifetime.start.p0(i64 32, ptr %42) #7
  call void @llvm.lifetime.start.p0(i64 1, ptr %43) #7
  call void @_ZNSaIcEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %43) #7
  invoke void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_(ptr noundef nonnull align 8 dereferenceable(32) %42, ptr noundef @.str.51, ptr noundef nonnull align 1 dereferenceable(1) %43)
          to label %342 unwind label %353

342:                                              ; preds = %341
  invoke void @_Z10printErrorRKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEb(ptr noundef nonnull align 8 dereferenceable(32) %42, i1 noundef zeroext true)
          to label %343 unwind label %357

343:                                              ; preds = %342
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %42) #7
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %43) #7
  call void @llvm.lifetime.end.p0(i64 1, ptr %43) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr %42) #7
  store i32 -1, ptr %5, align 4
  store i32 1, ptr %16, align 4
  br label %473

344:                                              ; preds = %339
  %345 = landingpad { ptr, i32 }
          cleanup
  %346 = extractvalue { ptr, i32 } %345, 0
  store ptr %346, ptr %10, align 8
  %347 = extractvalue { ptr, i32 } %345, 1
  store i32 %347, ptr %11, align 4
  br label %352

348:                                              ; preds = %340
  %349 = landingpad { ptr, i32 }
          cleanup
  %350 = extractvalue { ptr, i32 } %349, 0
  store ptr %350, ptr %10, align 8
  %351 = extractvalue { ptr, i32 } %349, 1
  store i32 %351, ptr %11, align 4
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %40) #7
  br label %352

352:                                              ; preds = %348, %344
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %41) #7
  call void @llvm.lifetime.end.p0(i64 1, ptr %41) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr %40) #7
  br label %474

353:                                              ; preds = %341
  %354 = landingpad { ptr, i32 }
          cleanup
  %355 = extractvalue { ptr, i32 } %354, 0
  store ptr %355, ptr %10, align 8
  %356 = extractvalue { ptr, i32 } %354, 1
  store i32 %356, ptr %11, align 4
  br label %361

357:                                              ; preds = %342
  %358 = landingpad { ptr, i32 }
          cleanup
  %359 = extractvalue { ptr, i32 } %358, 0
  store ptr %359, ptr %10, align 8
  %360 = extractvalue { ptr, i32 } %358, 1
  store i32 %360, ptr %11, align 4
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %42) #7
  br label %361

361:                                              ; preds = %357, %353
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %43) #7
  call void @llvm.lifetime.end.p0(i64 1, ptr %43) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr %42) #7
  br label %474

362:                                              ; preds = %334
  %363 = call noundef i32 @_ZN8SPIFlash18disable_protectionEv(ptr noundef nonnull align 8 dereferenceable(33) %50)
  %364 = icmp ne i32 %363, 0
  br i1 %364, label %365, label %366

365:                                              ; preds = %362
  store i32 -1, ptr %5, align 4
  store i32 1, ptr %16, align 4
  br label %473

366:                                              ; preds = %362
  br label %367

367:                                              ; preds = %366
  br label %368

368:                                              ; preds = %367, %331
  call void @llvm.lifetime.start.p0(i64 56, ptr %44) #7
  call void @llvm.lifetime.start.p0(i64 32, ptr %45) #7
  call void @llvm.lifetime.start.p0(i64 1, ptr %46) #7
  call void @_ZNSaIcEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %46) #7
  invoke void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_(ptr noundef nonnull align 8 dereferenceable(32) %45, ptr noundef @.str.69, ptr noundef nonnull align 1 dereferenceable(1) %46)
          to label %369 unwind label %382

369:                                              ; preds = %368
  %370 = load i32, ptr %9, align 4, !tbaa !9
  %371 = getelementptr inbounds %class.SPIFlash, ptr %50, i32 0, i32 2
  %372 = load i8, ptr %371, align 8, !tbaa !18
  %373 = sext i8 %372 to i32
  %374 = icmp slt i32 %373, 0
  invoke void @_ZN11ProgressBarC1ERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEiib(ptr noundef nonnull align 8 dereferenceable(50) %44, ptr noundef nonnull align 8 dereferenceable(32) %45, i32 noundef %370, i32 noundef 50, i1 noundef zeroext %374)
          to label %375 unwind label %386

375:                                              ; preds = %369
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %45) #7
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %46) #7
  call void @llvm.lifetime.end.p0(i64 1, ptr %46) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr %45) #7
  %376 = load i32, ptr %7, align 4, !tbaa !9
  %377 = load i32, ptr %9, align 4, !tbaa !9
  %378 = invoke noundef i32 @_ZN8SPIFlash13sectors_eraseEii(ptr noundef nonnull align 8 dereferenceable(33) %50, i32 noundef %376, i32 noundef %377)
          to label %379 unwind label %391

379:                                              ; preds = %375
  %380 = icmp eq i32 %378, -1
  br i1 %380, label %381, label %395

381:                                              ; preds = %379
  store i32 -1, ptr %5, align 4
  store i32 1, ptr %16, align 4
  br label %470

382:                                              ; preds = %368
  %383 = landingpad { ptr, i32 }
          cleanup
  %384 = extractvalue { ptr, i32 } %383, 0
  store ptr %384, ptr %10, align 8
  %385 = extractvalue { ptr, i32 } %383, 1
  store i32 %385, ptr %11, align 4
  br label %390

386:                                              ; preds = %369
  %387 = landingpad { ptr, i32 }
          cleanup
  %388 = extractvalue { ptr, i32 } %387, 0
  store ptr %388, ptr %10, align 8
  %389 = extractvalue { ptr, i32 } %387, 1
  store i32 %389, ptr %11, align 4
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %45) #7
  br label %390

390:                                              ; preds = %386, %382
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %46) #7
  call void @llvm.lifetime.end.p0(i64 1, ptr %46) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr %45) #7
  br label %472

391:                                              ; preds = %375
  %392 = landingpad { ptr, i32 }
          cleanup
  %393 = extractvalue { ptr, i32 } %392, 0
  store ptr %393, ptr %10, align 8
  %394 = extractvalue { ptr, i32 } %392, 1
  store i32 %394, ptr %11, align 4
  br label %471

395:                                              ; preds = %379
  call void @llvm.lifetime.start.p0(i64 8, ptr %47) #7
  %396 = load ptr, ptr %8, align 8, !tbaa !5
  store ptr %396, ptr %47, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %48) #7
  store i32 0, ptr %48, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %49) #7
  store i32 0, ptr %49, align 4, !tbaa !9
  br label %397

397:                                              ; preds = %436, %395
  %398 = load i32, ptr %49, align 4, !tbaa !9
  %399 = load i32, ptr %9, align 4, !tbaa !9
  %400 = icmp slt i32 %398, %399
  br i1 %400, label %402, label %401

401:                                              ; preds = %397
  store i32 2, ptr %16, align 4
  br label %444

402:                                              ; preds = %397
  %403 = load i32, ptr %49, align 4, !tbaa !9
  %404 = add nsw i32 %403, 256
  %405 = load i32, ptr %9, align 4, !tbaa !9
  %406 = icmp sgt i32 %404, %405
  br i1 %406, label %407, label %411

407:                                              ; preds = %402
  %408 = load i32, ptr %9, align 4, !tbaa !9
  %409 = load i32, ptr %49, align 4, !tbaa !9
  %410 = sub nsw i32 %408, %409
  br label %412

411:                                              ; preds = %402
  br label %412

412:                                              ; preds = %411, %407
  %413 = phi i32 [ %410, %407 ], [ 256, %411 ]
  store i32 %413, ptr %48, align 4, !tbaa !9
  %414 = getelementptr inbounds %class.SPIFlash, ptr %50, i32 0, i32 4
  %415 = load i32, ptr %414, align 4, !tbaa !11
  %416 = lshr i32 %415, 8
  %417 = icmp eq i32 %416, 12526989
  br i1 %417, label %418, label %419

418:                                              ; preds = %412
  store i32 1, ptr %48, align 4, !tbaa !9
  br label %419

419:                                              ; preds = %418, %412
  %420 = load i32, ptr %7, align 4, !tbaa !9
  %421 = load i32, ptr %49, align 4, !tbaa !9
  %422 = add nsw i32 %420, %421
  %423 = load ptr, ptr %47, align 8, !tbaa !5
  %424 = load i32, ptr %48, align 4, !tbaa !9
  %425 = invoke noundef i32 @_ZN8SPIFlash10write_pageEiPKhi(ptr noundef nonnull align 8 dereferenceable(33) %50, i32 noundef %422, ptr noundef %423, i32 noundef %424)
          to label %426 unwind label %429

426:                                              ; preds = %419
  %427 = icmp eq i32 %425, -1
  br i1 %427, label %428, label %433

428:                                              ; preds = %426
  store i32 -1, ptr %5, align 4
  store i32 1, ptr %16, align 4
  br label %444

429:                                              ; preds = %433, %419
  %430 = landingpad { ptr, i32 }
          cleanup
  %431 = extractvalue { ptr, i32 } %430, 0
  store ptr %431, ptr %10, align 8
  %432 = extractvalue { ptr, i32 } %430, 1
  store i32 %432, ptr %11, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %49) #7
  br label %469

433:                                              ; preds = %426
  %434 = load i32, ptr %49, align 4, !tbaa !9
  invoke void @_ZN11ProgressBar7displayEic(ptr noundef nonnull align 8 dereferenceable(50) %44, i32 noundef %434, i8 noundef signext 0)
          to label %435 unwind label %429

435:                                              ; preds = %433
  br label %436

436:                                              ; preds = %435
  %437 = load i32, ptr %48, align 4, !tbaa !9
  %438 = load i32, ptr %49, align 4, !tbaa !9
  %439 = add nsw i32 %438, %437
  store i32 %439, ptr %49, align 4, !tbaa !9
  %440 = load i32, ptr %48, align 4, !tbaa !9
  %441 = load ptr, ptr %47, align 8, !tbaa !5
  %442 = sext i32 %440 to i64
  %443 = getelementptr inbounds i8, ptr %441, i64 %442
  store ptr %443, ptr %47, align 8, !tbaa !5
  br label %397, !llvm.loop !31

444:                                              ; preds = %428, %401
  call void @llvm.lifetime.end.p0(i64 4, ptr %49) #7
  %445 = load i32, ptr %16, align 4
  switch i32 %445, label %468 [
    i32 2, label %446
  ]

446:                                              ; preds = %444
  invoke void @_ZN11ProgressBar4doneEv(ptr noundef nonnull align 8 dereferenceable(50) %44)
          to label %447 unwind label %462

447:                                              ; preds = %446
  %448 = load i8, ptr %15, align 1, !tbaa !16, !range !29, !noundef !30
  %449 = trunc i8 %448 to i1
  br i1 %449, label %450, label %467

450:                                              ; preds = %447
  %451 = load i8, ptr %17, align 1, !tbaa !17
  %452 = invoke noundef i32 @_ZN8SPIFlash17enable_protectionEh(ptr noundef nonnull align 8 dereferenceable(33) %50, i8 noundef zeroext %451)
          to label %453 unwind label %462

453:                                              ; preds = %450
  %454 = getelementptr inbounds %class.SPIFlash, ptr %50, i32 0, i32 2
  %455 = load i8, ptr %454, align 8, !tbaa !18
  %456 = sext i8 %455 to i32
  %457 = icmp sgt i32 %456, 0
  br i1 %457, label %458, label %466

458:                                              ; preds = %453
  %459 = invoke noundef zeroext i8 @_ZN8SPIFlash15read_status_regEv(ptr noundef nonnull align 8 dereferenceable(33) %50)
          to label %460 unwind label %462

460:                                              ; preds = %458
  invoke void @_ZN8SPIFlash18display_status_regEh(ptr noundef nonnull align 8 dereferenceable(33) %50, i8 noundef zeroext %459)
          to label %461 unwind label %462

461:                                              ; preds = %460
  br label %466

462:                                              ; preds = %460, %458, %450, %446
  %463 = landingpad { ptr, i32 }
          cleanup
  %464 = extractvalue { ptr, i32 } %463, 0
  store ptr %464, ptr %10, align 8
  %465 = extractvalue { ptr, i32 } %463, 1
  store i32 %465, ptr %11, align 4
  br label %469

466:                                              ; preds = %461, %453
  br label %467

467:                                              ; preds = %466, %447
  store i32 0, ptr %5, align 4
  store i32 1, ptr %16, align 4
  br label %468

468:                                              ; preds = %467, %444
  call void @llvm.lifetime.end.p0(i64 4, ptr %48) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %47) #7
  br label %470

469:                                              ; preds = %462, %429
  call void @llvm.lifetime.end.p0(i64 4, ptr %48) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %47) #7
  br label %471

470:                                              ; preds = %468, %381
  call void @_ZN11ProgressBarD2Ev(ptr noundef nonnull align 8 dereferenceable(50) %44) #7
  call void @llvm.lifetime.end.p0(i64 56, ptr %44) #7
  br label %473

471:                                              ; preds = %469, %391
  call void @_ZN11ProgressBarD2Ev(ptr noundef nonnull align 8 dereferenceable(50) %44) #7
  br label %472

472:                                              ; preds = %471, %390
  call void @llvm.lifetime.end.p0(i64 56, ptr %44) #7
  br label %474

473:                                              ; preds = %470, %365, %343, %309, %123
  call void @llvm.lifetime.end.p0(i64 1, ptr %17) #7
  br label %475

474:                                              ; preds = %472, %361, %352, %329, %312, %132
  call void @llvm.lifetime.end.p0(i64 1, ptr %17) #7
  call void @llvm.lifetime.end.p0(i64 1, ptr %15) #7
  br label %478

475:                                              ; preds = %473, %94
  call void @llvm.lifetime.end.p0(i64 1, ptr %15) #7
  br label %476

476:                                              ; preds = %475, %76
  %477 = load i32, ptr %5, align 4
  ret i32 %477

478:                                              ; preds = %474, %86, %63
  %479 = load ptr, ptr %10, align 8
  %480 = load i32, ptr %11, align 4
  %481 = insertvalue { ptr, i32 } poison, ptr %479, 0
  %482 = insertvalue { ptr, i32 } %481, i32 %480, 1
  resume { ptr, i32 } %482

483:                                              ; preds = %85
  %484 = landingpad { ptr, i32 }
          catch ptr null
  %485 = extractvalue { ptr, i32 } %484, 0
  call void @__clang_call_terminate(ptr %485) #8
  unreachable
}

; Function Attrs: nounwind memory(none)
declare i32 @llvm.eh.typeid.for.p0(ptr) #5

declare ptr @__cxa_begin_catch(ptr)

declare void @__cxa_end_catch()

; Function Attrs: noinline noreturn nounwind uwtable
declare hidden void @__clang_call_terminate(ptr noundef) #6

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZN8SPIFlash13global_unlockEv(ptr noundef nonnull align 8 dereferenceable(33)) #2 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i8 @_ZN8SPIFlash15read_status_regEv(ptr noundef nonnull align 8 dereferenceable(33)) #2 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN8SPIFlash18display_status_regEh(ptr noundef nonnull align 8 dereferenceable(33), i8 noundef zeroext) #2 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef signext i8 @_ZN8SPIFlash6get_tbEv(ptr noundef nonnull align 8 dereferenceable(33)) #2 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN8SPIFlash9bp_to_lenB5cxx11Ehh(ptr dead_on_unwind noalias writable sret(%"class.std::map.6") align 8, ptr noundef nonnull align 8 dereferenceable(33), i8 noundef zeroext, i8 noundef zeroext) #2 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt3mapINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEjSt4lessIS5_ESaISt4pairIKS5_jEEEixEOS5_(ptr noundef nonnull align 8 dereferenceable(48), ptr noundef nonnull align 8 dereferenceable(32)) #2 align 2

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

declare void @_Z9printWarnRKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEb(ptr noundef nonnull align 8 dereferenceable(32), i1 noundef zeroext) #3

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { "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 = { 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 #5 = { nounwind memory(none) }
attributes #6 = { noinline noreturn nounwind uwtable "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #7 = { nounwind }
attributes #8 = { noreturn 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 = !{!"int", !7, i64 0}
!11 = !{!12, !10, i64 20}
!12 = !{!"_ZTS8SPIFlash", !6, i64 8, !7, i64 16, !10, i64 20, !6, i64 24, !13, i64 32}
!13 = !{!"bool", !7, i64 0}
!14 = !{!15, !15, i64 0}
!15 = !{!"vtable pointer", !8, i64 0}
!16 = !{!13, !13, i64 0}
!17 = !{!7, !7, i64 0}
!18 = !{!12, !7, i64 16}
!19 = !{!12, !6, i64 24}
!20 = !{!21, !10, i64 64}
!21 = !{!"_ZTS7flash_t", !22, i64 0, !22, i64 32, !10, i64 64, !13, i64 68, !13, i64 69, !13, i64 70, !13, i64 71, !7, i64 72, !25, i64 76, !7, i64 80, !7, i64 81, !25, i64 88, !26, i64 92}
!22 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE", !23, i64 0, !24, i64 8, !7, i64 16}
!23 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_Alloc_hiderE", !6, i64 0}
!24 = !{!"long", !7, i64 0}
!25 = !{!"_ZTS8tb_loc_t", !7, i64 0}
!26 = !{!"short", !7, i64 0}
!27 = !{!21, !7, i64 80}
!28 = !{!12, !13, i64 32}
!29 = !{i8 0, i8 2}
!30 = !{}
!31 = distinct !{!31, !32}
!32 = !{!"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::__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::allocator.0" = type { i8 }
%"class.std::map.6" = type { %"class.std::_Rb_tree.7" }
%"class.std::_Rb_tree.7" = type { %"struct.std::_Rb_tree<std::__cxx11::basic_string<char>, std::pair<const std::__cxx11::basic_string<char>, unsigned int>, std::_Select1st<std::pair<const std::__cxx11::basic_string<char>, unsigned int>>, std::less<std::__cxx11::basic_string<char>>>::_Rb_tree_impl" }
%"struct.std::_Rb_tree<std::__cxx11::basic_string<char>, std::pair<const std::__cxx11::basic_string<char>, unsigned int>, std::_Select1st<std::pair<const std::__cxx11::basic_string<char>, unsigned int>>, std::less<std::__cxx11::basic_string<char>>>::_Rb_tree_impl" = type { [8 x i8], %"struct.std::_Rb_tree_header" }
%"struct.std::_Rb_tree_header" = type { %"struct.std::_Rb_tree_node_base", i64 }
%"struct.std::_Rb_tree_node_base" = type { i32, ptr, ptr, ptr }
%class.ProgressBar = type <{ %"class.std::__cxx11::basic_string", i32, i32, %"class.std::chrono::time_point", i8, i8, [6 x i8] }>
%"class.std::chrono::time_point" = type { %"class.std::chrono::duration" }
%"class.std::chrono::duration" = type { i64 }

@.str.51 = external hidden unnamed_addr constant [46 x i8], align 1
@_ZTISt9exception = external constant ptr
@.str.62 = external hidden unnamed_addr constant [15 x i8], align 1
@.str.63 = external hidden unnamed_addr constant [21 x i8], align 1
@.str.64 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.65 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.66 = external hidden unnamed_addr constant [51 x i8], align 1
@.str.67 = external hidden unnamed_addr constant [15 x i8], align 1
@.str.68 = external hidden unnamed_addr constant [31 x i8], align 1
@.str.69 = external hidden unnamed_addr constant [8 x i8], align 1

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

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

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

declare i32 @__gxx_personality_v0(...)

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i8 @_ZN8SPIFlash6get_bpEv(ptr noundef nonnull align 8 dereferenceable(33)) local_unnamed_addr #2 align 2

declare void @_Z10printErrorRKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEb(ptr noundef nonnull align 8 dereferenceable(32), i1 noundef zeroext) local_unnamed_addr #3

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_ZN8SPIFlash18disable_protectionEv(ptr noundef nonnull align 8 dereferenceable(33)) local_unnamed_addr #2 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_ZN8SPIFlash17enable_protectionEh(ptr noundef nonnull align 8 dereferenceable(33), i8 noundef zeroext) local_unnamed_addr #2 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_ZN8SPIFlash13sectors_eraseEii(ptr noundef nonnull align 8 dereferenceable(33), i32 noundef, i32 noundef) local_unnamed_addr #2 align 2

declare void @_ZN11ProgressBarC1ERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEiib(ptr noundef nonnull align 8 dereferenceable(50), ptr noundef nonnull align 8 dereferenceable(32), i32 noundef, i32 noundef, i1 noundef zeroext) unnamed_addr #3

; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #4

declare void @_ZN11ProgressBar7displayEic(ptr noundef nonnull align 8 dereferenceable(50), i32 noundef, i8 noundef signext) local_unnamed_addr #3

declare void @_ZN11ProgressBar4doneEv(ptr noundef nonnull align 8 dereferenceable(50)) local_unnamed_addr #3

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN11ProgressBarD2Ev(ptr noundef nonnull align 8 dereferenceable(50)) unnamed_addr #5 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_ZN8SPIFlash10write_pageEiPKhi(ptr noundef nonnull align 8 dereferenceable(33), i32 noundef, ptr noundef, i32 noundef) local_unnamed_addr #2 align 2

; Function Attrs: mustprogress uwtable
define dso_local noundef range(i32 -1, 1) i32 @_ZN8SPIFlash14erase_and_progEiPKhi(ptr noundef nonnull align 8 dereferenceable(33) %0, i32 noundef %1, ptr noundef %2, i32 noundef %3) local_unnamed_addr #2 align 2 personality ptr @__gxx_personality_v0 {
  %5 = alloca %"class.std::__cxx11::basic_string", align 8
  %6 = alloca %"class.std::allocator.0", align 1
  %7 = alloca %"class.std::__cxx11::basic_string", align 8
  %8 = alloca %"class.std::allocator.0", align 1
  %9 = alloca %"class.std::map.6", align 8
  %10 = alloca %"class.std::__cxx11::basic_string", align 8
  %11 = alloca %"class.std::allocator.0", align 1
  %12 = alloca %"class.std::__cxx11::basic_string", align 8
  %13 = alloca %"class.std::allocator.0", align 1
  %14 = alloca %"class.std::__cxx11::basic_string", align 8
  %15 = alloca %"class.std::allocator.0", align 1
  %16 = alloca %"class.std::__cxx11::basic_string", align 8
  %17 = alloca %"class.std::allocator.0", align 1
  %18 = alloca %"class.std::__cxx11::basic_string", align 8
  %19 = alloca %"class.std::allocator.0", align 1
  %20 = alloca %"class.std::__cxx11::basic_string", align 8
  %21 = alloca %"class.std::allocator.0", align 1
  %22 = alloca %"class.std::__cxx11::basic_string", align 8
  %23 = alloca %"class.std::allocator.0", align 1
  %24 = alloca %"class.std::__cxx11::basic_string", align 8
  %25 = alloca %"class.std::allocator.0", align 1
  %26 = alloca %"class.std::__cxx11::basic_string", align 8
  %27 = alloca %"class.std::allocator.0", align 1
  %28 = alloca %class.ProgressBar, align 8
  %29 = alloca %"class.std::__cxx11::basic_string", align 8
  %30 = alloca %"class.std::allocator.0", align 1
  %31 = getelementptr inbounds i8, ptr %0, i64 20
  %32 = load i32, ptr %31, align 4, !tbaa !5
  %33 = icmp eq i32 %32, 0
  br i1 %33, label %34, label %57

34:                                               ; preds = %4
  %35 = load ptr, ptr %0, align 8, !tbaa !12
  %36 = getelementptr inbounds i8, ptr %35, i64 24
  %37 = load ptr, ptr %36, align 8
  invoke void %37(ptr noundef nonnull align 8 dereferenceable(33) %0)
          to label %thread-pre-split unwind label %38

38:                                               ; preds = %34
  %39 = landingpad { ptr, i32 }
          catch ptr @_ZTISt9exception
  %40 = extractvalue { ptr, i32 } %39, 1
  %41 = tail call i32 @llvm.eh.typeid.for.p0(ptr nonnull @_ZTISt9exception) #8
  %42 = icmp eq i32 %40, %41
  br i1 %42, label %43, label %239

43:                                               ; preds = %38
  %44 = extractvalue { ptr, i32 } %39, 0
  %45 = tail call ptr @__cxa_begin_catch(ptr %44) #8
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %5) #8
  %46 = load ptr, ptr %45, align 8, !tbaa !12
  %47 = getelementptr inbounds i8, ptr %46, i64 16
  %48 = load ptr, ptr %47, align 8
  %49 = tail call noundef ptr %48(ptr noundef nonnull align 8 dereferenceable(8) %45) #8
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %6) #8
  call void @_ZNSaIcEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %6) #8
  invoke void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_(ptr noundef nonnull align 8 dereferenceable(32) %5, ptr noundef %49, ptr noundef nonnull align 1 dereferenceable(1) %6)
          to label %50 unwind label %52

50:                                               ; preds = %43
  invoke void @_Z10printErrorRKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEb(ptr noundef nonnull align 8 dereferenceable(32) %5, i1 noundef zeroext true)
          to label %51 unwind label %54

51:                                               ; preds = %50
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %5) #8
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %6) #8
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %6) #8
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %5) #8
  call void @__cxa_end_catch()
  br label %.thread159

52:                                               ; preds = %43
  %53 = landingpad { ptr, i32 }
          cleanup
  br label %56

54:                                               ; preds = %50
  %55 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %5) #8
  br label %56

56:                                               ; preds = %54, %52
  %.pn = phi { ptr, i32 } [ %55, %54 ], [ %53, %52 ]
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %6) #8
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %6) #8
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %5) #8
  invoke void @__cxa_end_catch()
          to label %239 unwind label %240

thread-pre-split:                                 ; preds = %34
  %.pr = load i32, ptr %31, align 4, !tbaa !5
  br label %57

57:                                               ; preds = %thread-pre-split, %4
  %58 = phi i32 [ %.pr, %thread-pre-split ], [ %32, %4 ]
  %59 = icmp eq i32 %58, -1088011585
  br i1 %59, label %60, label %62

60:                                               ; preds = %57
  %61 = tail call noundef zeroext i1 @_ZN8SPIFlash13global_unlockEv(ptr noundef nonnull align 8 dereferenceable(33) %0)
  br i1 %61, label %62, label %.thread159

62:                                               ; preds = %60, %57
  %63 = tail call noundef zeroext i8 @_ZN8SPIFlash15read_status_regEv(ptr noundef nonnull align 8 dereferenceable(33) %0)
  %64 = and i8 %63, -4
  %65 = getelementptr inbounds i8, ptr %0, i64 16
  %66 = load i8, ptr %65, align 8, !tbaa !14
  %67 = icmp sgt i8 %66, 0
  br i1 %67, label %68, label %69

68:                                               ; preds = %62
  tail call void @_ZN8SPIFlash18display_status_regEh(ptr noundef nonnull align 8 dereferenceable(33) %0, i8 noundef zeroext %64)
  br label %69

69:                                               ; preds = %68, %62
  %70 = getelementptr inbounds i8, ptr %0, i64 24
  %71 = load ptr, ptr %70, align 8, !tbaa !15
  %.not = icmp eq ptr %71, null
  br i1 %.not, label %164, label %72

72:                                               ; preds = %69
  %73 = add nsw i32 %3, %1
  %74 = getelementptr inbounds i8, ptr %71, i64 64
  %75 = load i32, ptr %74, align 8, !tbaa !16
  %76 = shl i32 %75, 16
  %77 = icmp ugt i32 %73, %76
  br i1 %77, label %78, label %86

78:                                               ; preds = %72
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %7) #8
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %8) #8
  call void @_ZNSaIcEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %8) #8
  invoke void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_(ptr noundef nonnull align 8 dereferenceable(32) %7, ptr noundef nonnull @.str.62, ptr noundef nonnull align 1 dereferenceable(1) %8)
          to label %79 unwind label %81

79:                                               ; preds = %78
  invoke void @_Z10printErrorRKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEb(ptr noundef nonnull align 8 dereferenceable(32) %7, i1 noundef zeroext true)
          to label %80 unwind label %83

80:                                               ; preds = %79
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %7) #8
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %8) #8
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %8) #8
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %7) #8
  br label %.thread159

81:                                               ; preds = %78
  %82 = landingpad { ptr, i32 }
          cleanup
  br label %85

83:                                               ; preds = %79
  %84 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %7) #8
  br label %85

85:                                               ; preds = %83, %81
  %.pn146 = phi { ptr, i32 } [ %84, %83 ], [ %82, %81 ]
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %8) #8
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %8) #8
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %7) #8
  br label %239

86:                                               ; preds = %72
  %87 = getelementptr inbounds i8, ptr %71, i64 80
  %88 = load i8, ptr %87, align 8, !tbaa !23
  %.not114 = icmp eq i8 %88, 0
  br i1 %.not114, label %.thread161, label %89

89:                                               ; preds = %86
  %90 = tail call noundef signext i8 @_ZN8SPIFlash6get_tbEv(ptr noundef nonnull align 8 dereferenceable(33) %0)
  %.not132 = icmp eq i8 %90, -1
  br i1 %.not132, label %.thread159, label %91

91:                                               ; preds = %89
  call void @llvm.lifetime.start.p0(i64 48, ptr nonnull %9) #8
  call void @_ZN8SPIFlash9bp_to_lenB5cxx11Ehh(ptr dead_on_unwind nonnull writable sret(%"class.std::map.6") align 8 %9, ptr noundef nonnull align 8 dereferenceable(33) %0, i8 noundef zeroext %64, i8 noundef zeroext %90)
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %10) #8
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %11) #8
  call void @_ZNSaIcEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %11) #8
  invoke void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_(ptr noundef nonnull align 8 dereferenceable(32) %10, ptr noundef nonnull @.str.64, ptr noundef nonnull align 1 dereferenceable(1) %11)
          to label %92 unwind label %117

92:                                               ; preds = %91
  %93 = invoke noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt3mapINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEjSt4lessIS5_ESaISt4pairIKS5_jEEEixEOS5_(ptr noundef nonnull align 8 dereferenceable(48) %9, ptr noundef nonnull align 8 dereferenceable(32) %10)
          to label %94 unwind label %119

94:                                               ; preds = %92
  %95 = load i32, ptr %93, align 4, !tbaa !24
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %12) #8
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %13) #8
  call void @_ZNSaIcEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %13) #8
  invoke void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_(ptr noundef nonnull align 8 dereferenceable(32) %12, ptr noundef nonnull @.str.65, ptr noundef nonnull align 1 dereferenceable(1) %13)
          to label %96 unwind label %121

96:                                               ; preds = %94
  %97 = invoke noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt3mapINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEjSt4lessIS5_ESaISt4pairIKS5_jEEEixEOS5_(ptr noundef nonnull align 8 dereferenceable(48) %9, ptr noundef nonnull align 8 dereferenceable(32) %12)
          to label %98 unwind label %123

98:                                               ; preds = %96
  %99 = load i32, ptr %97, align 4, !tbaa !24
  %100 = zext i8 %64 to i32
  %101 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.63, i32 noundef %1, i32 noundef %95, i32 noundef %99, i32 noundef %100)
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %12) #8
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %13) #8
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %13) #8
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %12) #8
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %10) #8
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %11) #8
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %11) #8
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %10) #8
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %14) #8
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %15) #8
  call void @_ZNSaIcEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %15) #8
  invoke void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_(ptr noundef nonnull align 8 dereferenceable(32) %14, ptr noundef nonnull @.str.64, ptr noundef nonnull align 1 dereferenceable(1) %15)
          to label %102 unwind label %128

102:                                              ; preds = %98
  %103 = invoke noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt3mapINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEjSt4lessIS5_ESaISt4pairIKS5_jEEEixEOS5_(ptr noundef nonnull align 8 dereferenceable(48) %9, ptr noundef nonnull align 8 dereferenceable(32) %14)
          to label %104 unwind label %130

104:                                              ; preds = %102
  %105 = load i32, ptr %103, align 4, !tbaa !24
  %.not119 = icmp eq i32 %105, 0
  br i1 %.not119, label %106, label %.critedge167

106:                                              ; preds = %104
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %16) #8
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %17) #8
  call void @_ZNSaIcEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %17) #8
  invoke void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_(ptr noundef nonnull align 8 dereferenceable(32) %16, ptr noundef nonnull @.str.65, ptr noundef nonnull align 1 dereferenceable(1) %17)
          to label %107 unwind label %132

107:                                              ; preds = %106
  %108 = invoke noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt3mapINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEjSt4lessIS5_ESaISt4pairIKS5_jEEEixEOS5_(ptr noundef nonnull align 8 dereferenceable(48) %9, ptr noundef nonnull align 8 dereferenceable(32) %16)
          to label %.critedge unwind label %134

.critedge:                                        ; preds = %107
  %109 = load i32, ptr %108, align 4, !tbaa !24
  %.not168 = icmp eq i32 %109, 0
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %16) #8
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %17) #8
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %17) #8
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %16) #8
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %14) #8
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %15) #8
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %15) #8
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %14) #8
  br i1 %.not168, label %154, label %110

.critedge167:                                     ; preds = %104
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %14) #8
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %15) #8
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %15) #8
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %14) #8
  br label %110

110:                                              ; preds = %.critedge167, %.critedge
  %111 = icmp eq i8 %90, 1
  br i1 %111, label %112, label %144

112:                                              ; preds = %110
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %18) #8
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %19) #8
  call void @_ZNSaIcEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %19) #8
  invoke void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_(ptr noundef nonnull align 8 dereferenceable(32) %18, ptr noundef nonnull @.str.65, ptr noundef nonnull align 1 dereferenceable(1) %19)
          to label %113 unwind label %139

113:                                              ; preds = %112
  %114 = invoke noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt3mapINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEjSt4lessIS5_ESaISt4pairIKS5_jEEEixEOS5_(ptr noundef nonnull align 8 dereferenceable(48) %9, ptr noundef nonnull align 8 dereferenceable(32) %18)
          to label %115 unwind label %141

115:                                              ; preds = %113
  %116 = load i32, ptr %114, align 4, !tbaa !24
  %.not130 = icmp uge i32 %116, %1
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %18) #8
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %19) #8
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %19) #8
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %18) #8
  br label %154

117:                                              ; preds = %91
  %118 = landingpad { ptr, i32 }
          cleanup
  br label %127

119:                                              ; preds = %92
  %120 = landingpad { ptr, i32 }
          cleanup
  br label %126

121:                                              ; preds = %94
  %122 = landingpad { ptr, i32 }
          cleanup
  br label %125

123:                                              ; preds = %96
  %124 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %12) #8
  br label %125

125:                                              ; preds = %123, %121
  %.pn115 = phi { ptr, i32 } [ %124, %123 ], [ %122, %121 ]
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %13) #8
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %13) #8
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %12) #8
  br label %126

126:                                              ; preds = %125, %119
  %.pn115.pn = phi { ptr, i32 } [ %.pn115, %125 ], [ %120, %119 ]
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %10) #8
  br label %127

127:                                              ; preds = %126, %117
  %.pn115.pn.pn = phi { ptr, i32 } [ %.pn115.pn, %126 ], [ %118, %117 ]
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %11) #8
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %11) #8
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %10) #8
  br label %163

128:                                              ; preds = %98
  %129 = landingpad { ptr, i32 }
          cleanup
  br label %138

130:                                              ; preds = %102
  %131 = landingpad { ptr, i32 }
          cleanup
  br label %137

132:                                              ; preds = %106
  %133 = landingpad { ptr, i32 }
          cleanup
  br label %136

134:                                              ; preds = %107
  %135 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %16) #8
  br label %136

136:                                              ; preds = %132, %134
  %.pn120 = phi { ptr, i32 } [ %135, %134 ], [ %133, %132 ]
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %17) #8
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %17) #8
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %16) #8
  br label %137

137:                                              ; preds = %136, %130
  %.pn120.pn = phi { ptr, i32 } [ %.pn120, %136 ], [ %131, %130 ]
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %14) #8
  br label %138

138:                                              ; preds = %137, %128
  %.pn120.pn.pn = phi { ptr, i32 } [ %.pn120.pn, %137 ], [ %129, %128 ]
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %15) #8
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %15) #8
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %14) #8
  br label %163

139:                                              ; preds = %112
  %140 = landingpad { ptr, i32 }
          cleanup
  br label %143

141:                                              ; preds = %113
  %142 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %18) #8
  br label %143

143:                                              ; preds = %141, %139
  %.pn127 = phi { ptr, i32 } [ %142, %141 ], [ %140, %139 ]
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %19) #8
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %19) #8
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %18) #8
  br label %163

144:                                              ; preds = %110
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %20) #8
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %21) #8
  call void @_ZNSaIcEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %21) #8
  invoke void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_(ptr noundef nonnull align 8 dereferenceable(32) %20, ptr noundef nonnull @.str.64, ptr noundef nonnull align 1 dereferenceable(1) %21)
          to label %145 unwind label %149

145:                                              ; preds = %144
  %146 = invoke noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt3mapINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEjSt4lessIS5_ESaISt4pairIKS5_jEEEixEOS5_(ptr noundef nonnull align 8 dereferenceable(48) %9, ptr noundef nonnull align 8 dereferenceable(32) %20)
          to label %147 unwind label %151

147:                                              ; preds = %145
  %148 = load i32, ptr %146, align 4, !tbaa !24
  %.not126 = icmp uge i32 %73, %148
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %20) #8
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %21) #8
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %21) #8
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %20) #8
  br label %154

149:                                              ; preds = %144
  %150 = landingpad { ptr, i32 }
          cleanup
  br label %153

151:                                              ; preds = %145
  %152 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %20) #8
  br label %153

153:                                              ; preds = %151, %149
  %.pn124 = phi { ptr, i32 } [ %152, %151 ], [ %150, %149 ]
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %21) #8
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %21) #8
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %20) #8
  br label %163

154:                                              ; preds = %147, %115, %.critedge
  %.080 = phi i1 [ false, %.critedge ], [ %.not130, %115 ], [ %.not126, %147 ]
  %155 = load i32, ptr %31, align 4, !tbaa !5
  %.mask = and i32 %155, -256
  %156 = icmp eq i32 %.mask, -1654647296
  %157 = icmp eq i8 %90, 1
  %or.cond = and i1 %157, %156
  %158 = icmp ne i32 %1, 0
  %or.cond5 = and i1 %158, %or.cond
  br i1 %or.cond5, label %.thread165, label %159

159:                                              ; preds = %154
  %160 = icmp eq i32 %.mask, 538973440
  %or.cond8 = and i1 %157, %160
  %or.cond10 = and i1 %158, %or.cond8
  br i1 %or.cond10, label %.thread165, label %162

.thread165:                                       ; preds = %159, %154
  %161 = getelementptr inbounds i8, ptr %0, i64 32
  store i8 1, ptr %161, align 8, !tbaa !25
  call void @_ZNSt3mapINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEjSt4lessIS5_ESaISt4pairIKS5_jEEED2Ev(ptr noundef nonnull align 8 dereferenceable(48) %9) #8
  call void @llvm.lifetime.end.p0(i64 48, ptr nonnull %9) #8
  br label %173

162:                                              ; preds = %159
  call void @_ZNSt3mapINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEjSt4lessIS5_ESaISt4pairIKS5_jEEED2Ev(ptr noundef nonnull align 8 dereferenceable(48) %9) #8
  call void @llvm.lifetime.end.p0(i64 48, ptr nonnull %9) #8
  br i1 %.080, label %173, label %.thread161

163:                                              ; preds = %153, %143, %138, %127
  %.pn127.pn = phi { ptr, i32 } [ %.pn127, %143 ], [ %.pn124, %153 ], [ %.pn120.pn.pn, %138 ], [ %.pn115.pn.pn, %127 ]
  call void @_ZNSt3mapINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEjSt4lessIS5_ESaISt4pairIKS5_jEEED2Ev(ptr noundef nonnull align 8 dereferenceable(48) %9) #8
  call void @llvm.lifetime.end.p0(i64 48, ptr nonnull %9) #8
  br label %239

164:                                              ; preds = %69
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %22) #8
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %23) #8
  call void @_ZNSaIcEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %23) #8
  invoke void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_(ptr noundef nonnull align 8 dereferenceable(32) %22, ptr noundef nonnull @.str.66, ptr noundef nonnull align 1 dereferenceable(1) %23)
          to label %165 unwind label %166

165:                                              ; preds = %164
  invoke void @_Z9printWarnRKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEb(ptr noundef nonnull align 8 dereferenceable(32) %22, i1 noundef zeroext true)
          to label %171 unwind label %168

166:                                              ; preds = %164
  %167 = landingpad { ptr, i32 }
          cleanup
  br label %170

168:                                              ; preds = %165
  %169 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %22) #8
  br label %170

170:                                              ; preds = %168, %166
  %.pn111 = phi { ptr, i32 } [ %169, %168 ], [ %167, %166 ]
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %23) #8
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %23) #8
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %22) #8
  br label %239

171:                                              ; preds = %165
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %22) #8
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %23) #8
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %23) #8
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %22) #8
  %172 = call noundef zeroext i8 @_ZN8SPIFlash6get_bpEv(ptr noundef nonnull align 8 dereferenceable(33) %0)
  %.not113.not = icmp eq i8 %172, 0
  br i1 %.not113.not, label %.thread161, label %173

173:                                              ; preds = %.thread165, %162, %171
  %174 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.67)
  %175 = getelementptr inbounds i8, ptr %0, i64 32
  %176 = load i8, ptr %175, align 8, !tbaa !25, !range !26, !noundef !27
  %177 = trunc nuw i8 %176 to i1
  br i1 %177, label %193, label %178

178:                                              ; preds = %173
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %24) #8
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %25) #8
  call void @_ZNSaIcEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %25) #8
  invoke void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_(ptr noundef nonnull align 8 dereferenceable(32) %24, ptr noundef nonnull @.str.68, ptr noundef nonnull align 1 dereferenceable(1) %25)
          to label %179 unwind label %183

179:                                              ; preds = %178
  invoke void @_Z10printErrorRKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEb(ptr noundef nonnull align 8 dereferenceable(32) %24, i1 noundef zeroext true)
          to label %180 unwind label %185

180:                                              ; preds = %179
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %24) #8
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %25) #8
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %25) #8
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %24) #8
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %26) #8
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %27) #8
  call void @_ZNSaIcEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %27) #8
  invoke void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_(ptr noundef nonnull align 8 dereferenceable(32) %26, ptr noundef nonnull @.str.51, ptr noundef nonnull align 1 dereferenceable(1) %27)
          to label %181 unwind label %188

181:                                              ; preds = %180
  invoke void @_Z10printErrorRKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEb(ptr noundef nonnull align 8 dereferenceable(32) %26, i1 noundef zeroext true)
          to label %182 unwind label %190

182:                                              ; preds = %181
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %26) #8
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %27) #8
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %27) #8
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %26) #8
  br label %.thread159

183:                                              ; preds = %178
  %184 = landingpad { ptr, i32 }
          cleanup
  br label %187

185:                                              ; preds = %179
  %186 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %24) #8
  br label %187

187:                                              ; preds = %185, %183
  %.pn133 = phi { ptr, i32 } [ %186, %185 ], [ %184, %183 ]
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %25) #8
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %25) #8
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %24) #8
  br label %239

188:                                              ; preds = %180
  %189 = landingpad { ptr, i32 }
          cleanup
  br label %192

190:                                              ; preds = %181
  %191 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %26) #8
  br label %192

192:                                              ; preds = %190, %188
  %.pn135 = phi { ptr, i32 } [ %191, %190 ], [ %189, %188 ]
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %27) #8
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %27) #8
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %26) #8
  br label %239

193:                                              ; preds = %173
  %194 = call noundef i32 @_ZN8SPIFlash18disable_protectionEv(ptr noundef nonnull align 8 dereferenceable(33) %0)
  %.not137 = icmp eq i32 %194, 0
  br i1 %.not137, label %.thread161, label %.thread159

.thread161:                                       ; preds = %86, %162, %193, %171
  %.484163 = phi i1 [ true, %193 ], [ false, %171 ], [ false, %162 ], [ false, %86 ]
  call void @llvm.lifetime.start.p0(i64 56, ptr nonnull %28) #8
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %29) #8
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %30) #8
  call void @_ZNSaIcEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %30) #8
  invoke void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_(ptr noundef nonnull align 8 dereferenceable(32) %29, ptr noundef nonnull @.str.69, ptr noundef nonnull align 1 dereferenceable(1) %30)
          to label %195 unwind label %202

195:                                              ; preds = %.thread161
  %196 = load i8, ptr %65, align 8, !tbaa !14
  %197 = icmp slt i8 %196, 0
  invoke void @_ZN11ProgressBarC1ERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEiib(ptr noundef nonnull align 8 dereferenceable(50) %28, ptr noundef nonnull align 8 dereferenceable(32) %29, i32 noundef %3, i32 noundef 50, i1 noundef zeroext %197)
          to label %198 unwind label %204

198:                                              ; preds = %195
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %29) #8
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %30) #8
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %30) #8
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %29) #8
  %199 = invoke noundef i32 @_ZN8SPIFlash13sectors_eraseEii(ptr noundef nonnull align 8 dereferenceable(33) %0, i32 noundef %1, i32 noundef %3)
          to label %200 unwind label %207

200:                                              ; preds = %198
  %201 = icmp eq i32 %199, -1
  br i1 %201, label %.loopexit, label %.preheader

.preheader:                                       ; preds = %200
  %.not141169 = icmp sgt i32 %3, 0
  br i1 %.not141169, label %.lr.ph, label %.critedge154

202:                                              ; preds = %.thread161
  %203 = landingpad { ptr, i32 }
          cleanup
  br label %206

204:                                              ; preds = %195
  %205 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %29) #8
  br label %206

206:                                              ; preds = %204, %202
  %.pn138 = phi { ptr, i32 } [ %205, %204 ], [ %203, %202 ]
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %30) #8
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %30) #8
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %29) #8
  br label %238

207:                                              ; preds = %198
  %208 = landingpad { ptr, i32 }
          cleanup
  br label %237

.lr.ph:                                           ; preds = %.preheader, %222
  %.0171 = phi i32 [ %223, %222 ], [ 0, %.preheader ]
  %.064170 = phi ptr [ %225, %222 ], [ %2, %.preheader ]
  %209 = add nsw i32 %.0171, 256
  %210 = icmp sgt i32 %209, %3
  %211 = sub nsw i32 %3, %.0171
  %212 = select i1 %210, i32 %211, i32 256
  %213 = load i32, ptr %31, align 4, !tbaa !5
  %.mask140 = and i32 %213, -256
  %214 = icmp eq i32 %.mask140, -1088058112
  %spec.store.select = select i1 %214, i32 1, i32 %212
  %215 = add nsw i32 %.0171, %1
  %216 = invoke noundef i32 @_ZN8SPIFlash10write_pageEiPKhi(ptr noundef nonnull align 8 dereferenceable(33) %0, i32 noundef %215, ptr noundef %.064170, i32 noundef %spec.store.select)
          to label %217 unwind label %219

217:                                              ; preds = %.lr.ph
  %218 = icmp eq i32 %216, -1
  br i1 %218, label %.loopexit, label %221

219:                                              ; preds = %221, %.lr.ph
  %220 = landingpad { ptr, i32 }
          cleanup
  br label %237

221:                                              ; preds = %217
  invoke void @_ZN11ProgressBar7displayEic(ptr noundef nonnull align 8 dereferenceable(50) %28, i32 noundef %.0171, i8 noundef signext 0)
          to label %222 unwind label %219

222:                                              ; preds = %221
  %223 = add nsw i32 %spec.store.select, %.0171
  %224 = sext i32 %spec.store.select to i64
  %225 = getelementptr inbounds i8, ptr %.064170, i64 %224
  %.not141 = icmp slt i32 %223, %3
  br i1 %.not141, label %.lr.ph, label %.critedge154, !llvm.loop !28

.critedge154:                                     ; preds = %222, %.preheader
  invoke void @_ZN11ProgressBar4doneEv(ptr noundef nonnull align 8 dereferenceable(50) %28)
          to label %226 unwind label %235

226:                                              ; preds = %.critedge154
  br i1 %.484163, label %227, label %.loopexit

227:                                              ; preds = %226
  %228 = invoke noundef i32 @_ZN8SPIFlash17enable_protectionEh(ptr noundef nonnull align 8 dereferenceable(33) %0, i8 noundef zeroext %64)
          to label %229 unwind label %235

229:                                              ; preds = %227
  %230 = load i8, ptr %65, align 8, !tbaa !14
  %231 = icmp sgt i8 %230, 0
  br i1 %231, label %232, label %.loopexit

232:                                              ; preds = %229
  %233 = invoke noundef zeroext i8 @_ZN8SPIFlash15read_status_regEv(ptr noundef nonnull align 8 dereferenceable(33) %0)
          to label %234 unwind label %235

234:                                              ; preds = %232
  invoke void @_ZN8SPIFlash18display_status_regEh(ptr noundef nonnull align 8 dereferenceable(33) %0, i8 noundef zeroext %233)
          to label %.loopexit unwind label %235

235:                                              ; preds = %234, %232, %227, %.critedge154
  %236 = landingpad { ptr, i32 }
          cleanup
  br label %237

.loopexit:                                        ; preds = %217, %229, %234, %226, %200
  %.4 = phi i32 [ -1, %200 ], [ 0, %229 ], [ 0, %234 ], [ 0, %226 ], [ -1, %217 ]
  call void @_ZN11ProgressBarD2Ev(ptr noundef nonnull align 8 dereferenceable(50) %28) #8
  call void @llvm.lifetime.end.p0(i64 56, ptr nonnull %28) #8
  br label %.thread159

237:                                              ; preds = %219, %235, %207
  %.pn142.pn = phi { ptr, i32 } [ %208, %207 ], [ %236, %235 ], [ %220, %219 ]
  call void @_ZN11ProgressBarD2Ev(ptr noundef nonnull align 8 dereferenceable(50) %28) #8
  br label %238

238:                                              ; preds = %237, %206
  %.pn142.pn.pn = phi { ptr, i32 } [ %.pn142.pn, %237 ], [ %.pn138, %206 ]
  call void @llvm.lifetime.end.p0(i64 56, ptr nonnull %28) #8
  br label %239

.thread159:                                       ; preds = %89, %60, %193, %.loopexit, %182, %80, %51
  %.7 = phi i32 [ -1, %51 ], [ -1, %60 ], [ -1, %80 ], [ %.4, %.loopexit ], [ -1, %182 ], [ -1, %193 ], [ -1, %89 ]
  ret i32 %.7

239:                                              ; preds = %85, %163, %170, %187, %192, %238, %56, %38
  %.merged = phi { ptr, i32 } [ %39, %38 ], [ %.pn, %56 ], [ %.pn146, %85 ], [ %.pn142.pn.pn, %238 ], [ %.pn135, %192 ], [ %.pn133, %187 ], [ %.pn127.pn, %163 ], [ %.pn111, %170 ]
  resume { ptr, i32 } %.merged

240:                                              ; preds = %56
  %241 = landingpad { ptr, i32 }
          catch ptr null
  %242 = extractvalue { ptr, i32 } %241, 0
  call void @__clang_call_terminate(ptr %242) #9
  unreachable
}

; Function Attrs: nofree nosync nounwind memory(none)
declare i32 @llvm.eh.typeid.for.p0(ptr) #6

declare ptr @__cxa_begin_catch(ptr) local_unnamed_addr

declare void @__cxa_end_catch() local_unnamed_addr

; Function Attrs: noinline noreturn nounwind uwtable
declare hidden void @__clang_call_terminate(ptr noundef) local_unnamed_addr #7

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZN8SPIFlash13global_unlockEv(ptr noundef nonnull align 8 dereferenceable(33)) local_unnamed_addr #2 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i8 @_ZN8SPIFlash15read_status_regEv(ptr noundef nonnull align 8 dereferenceable(33)) local_unnamed_addr #2 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN8SPIFlash18display_status_regEh(ptr noundef nonnull align 8 dereferenceable(33), i8 noundef zeroext) local_unnamed_addr #2 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef signext i8 @_ZN8SPIFlash6get_tbEv(ptr noundef nonnull align 8 dereferenceable(33)) local_unnamed_addr #2 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN8SPIFlash9bp_to_lenB5cxx11Ehh(ptr dead_on_unwind noalias writable sret(%"class.std::map.6") align 8, ptr noundef nonnull align 8 dereferenceable(33), i8 noundef zeroext, i8 noundef zeroext) local_unnamed_addr #2 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt3mapINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEjSt4lessIS5_ESaISt4pairIKS5_jEEEixEOS5_(ptr noundef nonnull align 8 dereferenceable(48), ptr noundef nonnull align 8 dereferenceable(32)) local_unnamed_addr #2 align 2

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

declare void @_Z9printWarnRKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEb(ptr noundef nonnull align 8 dereferenceable(32), i1 noundef zeroext) local_unnamed_addr #3

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

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !10, i64 20}
!6 = !{!"_ZTS8SPIFlash", !7, i64 8, !8, i64 16, !10, i64 20, !7, i64 24, !11, i64 32}
!7 = !{!"any pointer", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!"int", !8, i64 0}
!11 = !{!"bool", !8, i64 0}
!12 = !{!13, !13, i64 0}
!13 = !{!"vtable pointer", !9, i64 0}
!14 = !{!6, !8, i64 16}
!15 = !{!6, !7, i64 24}
!16 = !{!17, !10, i64 64}
!17 = !{!"_ZTS7flash_t", !18, i64 0, !18, i64 32, !10, i64 64, !11, i64 68, !11, i64 69, !11, i64 70, !11, i64 71, !8, i64 72, !21, i64 76, !8, i64 80, !8, i64 81, !21, i64 88, !22, i64 92}
!18 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE", !19, i64 0, !20, i64 8, !8, i64 16}
!19 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_Alloc_hiderE", !7, i64 0}
!20 = !{!"long", !8, i64 0}
!21 = !{!"_ZTS8tb_loc_t", !8, i64 0}
!22 = !{!"short", !8, i64 0}
!23 = !{!17, !8, i64 80}
!24 = !{!10, !10, i64 0}
!25 = !{!6, !11, i64 32}
!26 = !{i8 0, i8 2}
!27 = !{}
!28 = distinct !{!28, !29}
!29 = !{!"llvm.loop.mustprogress"}


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