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

; 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::map" = type { %"class.std::_Rb_tree" }
%"class.std::_Rb_tree" = type { %"struct.std::_Rb_tree<unsigned int, std::pair<const unsigned int, flash_t>, std::_Select1st<std::pair<const unsigned int, flash_t>>, std::less<unsigned int>>::_Rb_tree_impl" }
%"struct.std::_Rb_tree<unsigned int, std::pair<const unsigned int, flash_t>, std::_Select1st<std::pair<const unsigned int, flash_t>>, std::less<unsigned int>>::_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 }
%"struct.std::_Rb_tree_iterator" = type { ptr }
%"class.std::__cxx11::basic_string" = type { %"struct.std::__cxx11::basic_string<char>::_Alloc_hider", i64, %union.anon }
%"struct.std::__cxx11::basic_string<char>::_Alloc_hider" = type { ptr }
%union.anon = type { i64, [8 x i8] }
%"class.std::allocator.0" = type { i8 }
%class.SPIFlash = type <{ ptr, ptr, i8, [3 x i8], i32, ptr, i8, [7 x i8] }>
%"struct.std::pair" = type { i32, [4 x i8], %struct.flash_t }
%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] }>

@_ZL10flash_list = external hidden global %"class.std::map", align 8
@.str.72 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.73 = external hidden unnamed_addr constant [15 x i8], align 1
@_ZTISt13runtime_error = external constant ptr
@.str.74 = external hidden unnamed_addr constant [9 x i8], align 1
@.str.75 = external hidden unnamed_addr constant [17 x i8], align 1
@.str.76 = external hidden unnamed_addr constant [38 x i8], align 1
@.str.77 = external hidden unnamed_addr constant [10 x i8], align 1
@.str.78 = external hidden unnamed_addr constant [26 x i8], align 1
@.str.79 = external hidden unnamed_addr constant [26 x i8], align 1
@.str.80 = external hidden unnamed_addr constant [26 x i8], align 1
@.str.81 = external hidden unnamed_addr constant [26 x i8], align 1
@.str.82 = external hidden unnamed_addr constant [30 x i8], align 1
@.str.83 = external hidden unnamed_addr constant [21 x i8], align 1
@.str.84 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.85 = external hidden unnamed_addr constant [2 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

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

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN8SPIFlash7read_idEv(ptr noundef nonnull align 8 dereferenceable(33) %0) unnamed_addr #2 align 2 personality ptr @__gxx_personality_v0 {
  %2 = alloca ptr, align 8
  %3 = alloca i32, align 4
  %4 = alloca [512 x i8], align 16
  %5 = alloca i8, align 1
  %6 = alloca i32, align 4
  %7 = alloca ptr, align 8
  %8 = alloca i32, align 4
  %9 = alloca %"struct.std::_Rb_tree_iterator", align 8
  %10 = alloca i32, align 4
  %11 = alloca %"struct.std::_Rb_tree_iterator", align 8
  %12 = alloca [256 x i8], align 16
  %13 = alloca %"class.std::__cxx11::basic_string", align 8
  %14 = alloca %"class.std::allocator.0", align 1
  %15 = alloca %"class.std::__cxx11::basic_string", align 8
  %16 = alloca %"class.std::allocator.0", align 1
  %17 = alloca i32, align 4
  store ptr %0, ptr %2, align 8, !tbaa !5
  %18 = load ptr, ptr %2, align 8
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #5
  store i32 4, ptr %3, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 512, ptr %4) #5
  call void @llvm.lifetime.start.p0(i64 1, ptr %5) #5
  store i8 0, ptr %5, align 1, !tbaa !11
  %19 = getelementptr inbounds %class.SPIFlash, ptr %18, i32 0, i32 1
  %20 = load ptr, ptr %19, align 8, !tbaa !13
  %21 = getelementptr inbounds [512 x i8], ptr %4, i64 0, i64 0
  %22 = load ptr, ptr %20, align 8, !tbaa !15
  %23 = getelementptr inbounds ptr, ptr %22, i64 2
  %24 = load ptr, ptr %23, align 8
  %25 = call noundef i32 %24(ptr noundef nonnull align 8 dereferenceable(56) %20, i8 noundef zeroext -97, ptr noundef null, ptr noundef %21, i32 noundef 4)
  %26 = getelementptr inbounds %class.SPIFlash, ptr %18, i32 0, i32 4
  store i32 0, ptr %26, align 4, !tbaa !17
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #5
  store i32 0, ptr %6, align 4, !tbaa !9
  br label %27

27:                                               ; preds = %57, %1
  %28 = load i32, ptr %6, align 4, !tbaa !9
  %29 = icmp slt i32 %28, 4
  br i1 %29, label %31, label %30

30:                                               ; preds = %27
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #5
  br label %60

31:                                               ; preds = %27
  %32 = getelementptr inbounds %class.SPIFlash, ptr %18, i32 0, i32 4
  %33 = load i32, ptr %32, align 4, !tbaa !17
  %34 = shl i32 %33, 8
  %35 = getelementptr inbounds %class.SPIFlash, ptr %18, i32 0, i32 4
  store i32 %34, ptr %35, align 4, !tbaa !17
  %36 = load i32, ptr %6, align 4, !tbaa !9
  %37 = sext i32 %36 to i64
  %38 = getelementptr inbounds [512 x i8], ptr %4, i64 0, i64 %37
  %39 = load i8, ptr %38, align 1, !tbaa !18
  %40 = zext i8 %39 to i32
  %41 = and i32 255, %40
  %42 = getelementptr inbounds %class.SPIFlash, ptr %18, i32 0, i32 4
  %43 = load i32, ptr %42, align 4, !tbaa !17
  %44 = or i32 %43, %41
  store i32 %44, ptr %42, align 4, !tbaa !17
  %45 = getelementptr inbounds %class.SPIFlash, ptr %18, i32 0, i32 2
  %46 = load i8, ptr %45, align 8, !tbaa !19
  %47 = sext i8 %46 to i32
  %48 = icmp sgt i32 %47, 0
  br i1 %48, label %49, label %56

49:                                               ; preds = %31
  %50 = load i32, ptr %6, align 4, !tbaa !9
  %51 = sext i32 %50 to i64
  %52 = getelementptr inbounds [512 x i8], ptr %4, i64 0, i64 %51
  %53 = load i8, ptr %52, align 1, !tbaa !18
  %54 = zext i8 %53 to i32
  %55 = call i32 (ptr, ...) @printf(ptr noundef @.str.72, i32 noundef %54)
  br label %56

56:                                               ; preds = %49, %31
  br label %57

57:                                               ; preds = %56
  %58 = load i32, ptr %6, align 4, !tbaa !9
  %59 = add nsw i32 %58, 1
  store i32 %59, ptr %6, align 4, !tbaa !9
  br label %27, !llvm.loop !20

60:                                               ; preds = %30
  %61 = getelementptr inbounds %class.SPIFlash, ptr %18, i32 0, i32 4
  %62 = load i32, ptr %61, align 4, !tbaa !17
  %63 = lshr i32 %62, 8
  %64 = icmp eq i32 %63, 65535
  br i1 %64, label %70, label %65

65:                                               ; preds = %60
  %66 = getelementptr inbounds %class.SPIFlash, ptr %18, i32 0, i32 4
  %67 = load i32, ptr %66, align 4, !tbaa !17
  %68 = lshr i32 %67, 8
  %69 = icmp eq i32 %68, 0
  br i1 %69, label %70, label %77

70:                                               ; preds = %65, %60
  %71 = call ptr @__cxa_allocate_exception(i64 16) #5
  invoke void @_ZNSt13runtime_errorC1EPKc(ptr noundef nonnull align 8 dereferenceable(16) %71, ptr noundef @.str.73)
          to label %72 unwind label %73

72:                                               ; preds = %70
  call void @__cxa_throw(ptr %71, ptr @_ZTISt13runtime_error, ptr @_ZNSt13runtime_errorD1Ev) #6
  unreachable

73:                                               ; preds = %70
  %74 = landingpad { ptr, i32 }
          cleanup
  %75 = extractvalue { ptr, i32 } %74, 0
  store ptr %75, ptr %7, align 8
  %76 = extractvalue { ptr, i32 } %74, 1
  store i32 %76, ptr %8, align 4
  call void @__cxa_free_exception(ptr %71) #5
  br label %205

77:                                               ; preds = %65
  %78 = getelementptr inbounds %class.SPIFlash, ptr %18, i32 0, i32 2
  %79 = load i8, ptr %78, align 8, !tbaa !19
  %80 = sext i8 %79 to i32
  %81 = icmp sgt i32 %80, 0
  br i1 %81, label %82, label %86

82:                                               ; preds = %77
  %83 = getelementptr inbounds %class.SPIFlash, ptr %18, i32 0, i32 4
  %84 = load i32, ptr %83, align 4, !tbaa !17
  %85 = call i32 (ptr, ...) @printf(ptr noundef @.str.74, i32 noundef %84)
  br label %86

86:                                               ; preds = %82, %77
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #5
  %87 = getelementptr inbounds %class.SPIFlash, ptr %18, i32 0, i32 4
  %88 = load i32, ptr %87, align 4, !tbaa !17
  %89 = lshr i32 %88, 8
  store i32 %89, ptr %10, align 4, !tbaa !9
  %90 = call ptr @_ZNSt3mapIj7flash_tSt4lessIjESaISt4pairIKjS0_EEE4findERS4_(ptr noundef nonnull align 8 dereferenceable(48) @_ZL10flash_list, ptr noundef nonnull align 4 dereferenceable(4) %10)
  %91 = getelementptr inbounds %"struct.std::_Rb_tree_iterator", ptr %9, i32 0, i32 0
  store ptr %90, ptr %91, align 8
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #5
  %92 = call ptr @_ZNSt3mapIj7flash_tSt4lessIjESaISt4pairIKjS0_EEE3endEv(ptr noundef nonnull align 8 dereferenceable(48) @_ZL10flash_list) #5
  %93 = getelementptr inbounds %"struct.std::_Rb_tree_iterator", ptr %11, i32 0, i32 0
  store ptr %92, ptr %93, align 8
  %94 = call noundef zeroext i1 @_ZStneRKSt17_Rb_tree_iteratorISt4pairIKj7flash_tEES6_(ptr noundef nonnull align 8 dereferenceable(8) %9, ptr noundef nonnull align 8 dereferenceable(8) %11) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #5
  br i1 %94, label %95, label %149

95:                                               ; preds = %86
  %96 = call noundef nonnull align 8 dereferenceable(104) ptr @_ZNKSt17_Rb_tree_iteratorISt4pairIKj7flash_tEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %9) #5
  %97 = getelementptr inbounds %"struct.std::pair", ptr %96, i32 0, i32 2
  %98 = getelementptr inbounds %class.SPIFlash, ptr %18, i32 0, i32 5
  store ptr %97, ptr %98, align 8, !tbaa !22
  call void @llvm.lifetime.start.p0(i64 256, ptr %12) #5
  %99 = getelementptr inbounds [256 x i8], ptr %12, i64 0, i64 0
  %100 = getelementptr inbounds %class.SPIFlash, ptr %18, i32 0, i32 4
  %101 = load i32, ptr %100, align 4, !tbaa !17
  %102 = lshr i32 %101, 8
  %103 = call i32 (ptr, i64, ptr, ...) @snprintf(ptr noundef %99, i64 noundef 256, ptr noundef @.str.75, i32 noundef %102) #5
  call void @llvm.lifetime.start.p0(i64 32, ptr %13) #5
  %104 = getelementptr inbounds [256 x i8], ptr %12, i64 0, i64 0
  call void @llvm.lifetime.start.p0(i64 1, ptr %14) #5
  call void @_ZNSaIcEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %14) #5
  invoke void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_(ptr noundef nonnull align 8 dereferenceable(32) %13, ptr noundef %104, ptr noundef nonnull align 1 dereferenceable(1) %14)
          to label %105 unwind label %130

105:                                              ; preds = %95
  invoke void @_Z9printInfoRKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEb(ptr noundef nonnull align 8 dereferenceable(32) %13, i1 noundef zeroext true)
          to label %106 unwind label %134

106:                                              ; preds = %105
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %13) #5
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %14) #5
  call void @llvm.lifetime.end.p0(i64 1, ptr %14) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr %13) #5
  %107 = getelementptr inbounds [256 x i8], ptr %12, i64 0, i64 0
  %108 = getelementptr inbounds %class.SPIFlash, ptr %18, i32 0, i32 5
  %109 = load ptr, ptr %108, align 8, !tbaa !22
  %110 = getelementptr inbounds %struct.flash_t, ptr %109, i32 0, i32 0
  %111 = call noundef ptr @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE5c_strEv(ptr noundef nonnull align 8 dereferenceable(32) %110) #5
  %112 = getelementptr inbounds %class.SPIFlash, ptr %18, i32 0, i32 5
  %113 = load ptr, ptr %112, align 8, !tbaa !22
  %114 = getelementptr inbounds %struct.flash_t, ptr %113, i32 0, i32 1
  %115 = call noundef ptr @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE5c_strEv(ptr noundef nonnull align 8 dereferenceable(32) %114) #5
  %116 = getelementptr inbounds %class.SPIFlash, ptr %18, i32 0, i32 5
  %117 = load ptr, ptr %116, align 8, !tbaa !22
  %118 = getelementptr inbounds %struct.flash_t, ptr %117, i32 0, i32 2
  %119 = load i32, ptr %118, align 8, !tbaa !23
  %120 = getelementptr inbounds %class.SPIFlash, ptr %18, i32 0, i32 5
  %121 = load ptr, ptr %120, align 8, !tbaa !22
  %122 = getelementptr inbounds %struct.flash_t, ptr %121, i32 0, i32 2
  %123 = load i32, ptr %122, align 8, !tbaa !23
  %124 = mul i32 %123, 524288
  %125 = udiv i32 %124, 1048576
  %126 = call i32 (ptr, i64, ptr, ...) @snprintf(ptr noundef %107, i64 noundef 256, ptr noundef @.str.76, ptr noundef %111, ptr noundef %115, i32 noundef %119, i32 noundef %125) #5
  call void @llvm.lifetime.start.p0(i64 32, ptr %15) #5
  %127 = getelementptr inbounds [256 x i8], ptr %12, i64 0, i64 0
  call void @llvm.lifetime.start.p0(i64 1, ptr %16) #5
  call void @_ZNSaIcEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %16) #5
  invoke void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_(ptr noundef nonnull align 8 dereferenceable(32) %15, ptr noundef %127, ptr noundef nonnull align 1 dereferenceable(1) %16)
          to label %128 unwind label %139

128:                                              ; preds = %106
  invoke void @_Z9printInfoRKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEb(ptr noundef nonnull align 8 dereferenceable(32) %15, i1 noundef zeroext true)
          to label %129 unwind label %143

129:                                              ; preds = %128
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %15) #5
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %16) #5
  call void @llvm.lifetime.end.p0(i64 1, ptr %16) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr %15) #5
  call void @llvm.lifetime.end.p0(i64 256, ptr %12) #5
  br label %204

130:                                              ; preds = %95
  %131 = landingpad { ptr, i32 }
          cleanup
  %132 = extractvalue { ptr, i32 } %131, 0
  store ptr %132, ptr %7, align 8
  %133 = extractvalue { ptr, i32 } %131, 1
  store i32 %133, ptr %8, align 4
  br label %138

134:                                              ; preds = %105
  %135 = landingpad { ptr, i32 }
          cleanup
  %136 = extractvalue { ptr, i32 } %135, 0
  store ptr %136, ptr %7, align 8
  %137 = extractvalue { ptr, i32 } %135, 1
  store i32 %137, ptr %8, align 4
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %13) #5
  br label %138

138:                                              ; preds = %134, %130
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %14) #5
  call void @llvm.lifetime.end.p0(i64 1, ptr %14) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr %13) #5
  br label %148

139:                                              ; preds = %106
  %140 = landingpad { ptr, i32 }
          cleanup
  %141 = extractvalue { ptr, i32 } %140, 0
  store ptr %141, ptr %7, align 8
  %142 = extractvalue { ptr, i32 } %140, 1
  store i32 %142, ptr %8, align 4
  br label %147

143:                                              ; preds = %128
  %144 = landingpad { ptr, i32 }
          cleanup
  %145 = extractvalue { ptr, i32 } %144, 0
  store ptr %145, ptr %7, align 8
  %146 = extractvalue { ptr, i32 } %144, 1
  store i32 %146, ptr %8, align 4
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %15) #5
  br label %147

147:                                              ; preds = %143, %139
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %16) #5
  call void @llvm.lifetime.end.p0(i64 1, ptr %16) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr %15) #5
  br label %148

148:                                              ; preds = %147, %138
  call void @llvm.lifetime.end.p0(i64 256, ptr %12) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #5
  br label %205

149:                                              ; preds = %86
  %150 = call i32 (ptr, ...) @printf(ptr noundef @.str.77)
  %151 = getelementptr inbounds [512 x i8], ptr %4, i64 0, i64 0
  %152 = load i8, ptr %151, align 16, !tbaa !18
  %153 = zext i8 %152 to i32
  %154 = call i32 (ptr, ...) @printf(ptr noundef @.str.78, i32 noundef %153)
  %155 = getelementptr inbounds [512 x i8], ptr %4, i64 0, i64 1
  %156 = load i8, ptr %155, align 1, !tbaa !18
  %157 = zext i8 %156 to i32
  %158 = call i32 (ptr, ...) @printf(ptr noundef @.str.79, i32 noundef %157)
  %159 = getelementptr inbounds [512 x i8], ptr %4, i64 0, i64 2
  %160 = load i8, ptr %159, align 2, !tbaa !18
  %161 = zext i8 %160 to i32
  %162 = call i32 (ptr, ...) @printf(ptr noundef @.str.80, i32 noundef %161)
  %163 = load i8, ptr %5, align 1, !tbaa !11, !range !30, !noundef !31
  %164 = trunc i8 %163 to i1
  br i1 %164, label %165, label %203

165:                                              ; preds = %149
  %166 = getelementptr inbounds [512 x i8], ptr %4, i64 0, i64 3
  %167 = load i8, ptr %166, align 1, !tbaa !18
  %168 = zext i8 %167 to i32
  %169 = call i32 (ptr, ...) @printf(ptr noundef @.str.81, i32 noundef %168)
  %170 = getelementptr inbounds [512 x i8], ptr %4, i64 0, i64 5
  %171 = load i8, ptr %170, align 1, !tbaa !18
  %172 = zext i8 %171 to i32
  %173 = getelementptr inbounds [512 x i8], ptr %4, i64 0, i64 4
  %174 = load i8, ptr %173, align 4, !tbaa !18
  %175 = zext i8 %174 to i32
  %176 = call i32 (ptr, ...) @printf(ptr noundef @.str.82, i32 noundef %172, i32 noundef %175)
  %177 = call i32 (ptr, ...) @printf(ptr noundef @.str.83)
  %178 = getelementptr inbounds %class.SPIFlash, ptr %18, i32 0, i32 2
  %179 = load i8, ptr %178, align 8, !tbaa !19
  %180 = sext i8 %179 to i32
  %181 = icmp sgt i32 %180, 0
  br i1 %181, label %182, label %200

182:                                              ; preds = %165
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #5
  store i32 6, ptr %17, align 4, !tbaa !9
  br label %183

183:                                              ; preds = %195, %182
  %184 = load i32, ptr %17, align 4, !tbaa !9
  %185 = load i32, ptr %3, align 4, !tbaa !9
  %186 = icmp slt i32 %184, %185
  br i1 %186, label %188, label %187

187:                                              ; preds = %183
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #5
  br label %198

188:                                              ; preds = %183
  %189 = load i32, ptr %17, align 4, !tbaa !9
  %190 = sext i32 %189 to i64
  %191 = getelementptr inbounds [512 x i8], ptr %4, i64 0, i64 %190
  %192 = load i8, ptr %191, align 1, !tbaa !18
  %193 = zext i8 %192 to i32
  %194 = call i32 (ptr, ...) @printf(ptr noundef @.str.84, i32 noundef %193)
  br label %195

195:                                              ; preds = %188
  %196 = load i32, ptr %17, align 4, !tbaa !9
  %197 = add nsw i32 %196, 1
  store i32 %197, ptr %17, align 4, !tbaa !9
  br label %183, !llvm.loop !32

198:                                              ; preds = %187
  %199 = call i32 (ptr, ...) @printf(ptr noundef @.str.85)
  br label %202

200:                                              ; preds = %165
  %201 = call i32 (ptr, ...) @printf(ptr noundef @.str.85)
  br label %202

202:                                              ; preds = %200, %198
  br label %203

203:                                              ; preds = %202, %149
  br label %204

204:                                              ; preds = %203, %129
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #5
  call void @llvm.lifetime.end.p0(i64 1, ptr %5) #5
  call void @llvm.lifetime.end.p0(i64 512, ptr %4) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #5
  ret void

205:                                              ; preds = %148, %73
  call void @llvm.lifetime.end.p0(i64 1, ptr %5) #5
  call void @llvm.lifetime.end.p0(i64 512, ptr %4) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #5
  br label %206

206:                                              ; preds = %205
  %207 = load ptr, ptr %7, align 8
  %208 = load i32, ptr %8, align 4
  %209 = insertvalue { ptr, i32 } poison, ptr %207, 0
  %210 = insertvalue { ptr, i32 } %209, i32 %208, 1
  resume { ptr, i32 } %210
}

declare ptr @__cxa_allocate_exception(i64)

declare void @_ZNSt13runtime_errorC1EPKc(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef) unnamed_addr #3

declare void @__cxa_free_exception(ptr)

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

declare void @__cxa_throw(ptr, ptr, ptr)

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZStneRKSt17_Rb_tree_iteratorISt4pairIKj7flash_tEES6_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) #1

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

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

; Function Attrs: nounwind
declare i32 @snprintf(ptr noundef, i64 noundef, ptr noundef, ...) #4

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 = { 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 = { nounwind }
attributes #6 = { noreturn }

!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, !12, i64 0}
!12 = !{!"bool", !7, i64 0}
!13 = !{!14, !6, i64 8}
!14 = !{!"_ZTS8SPIFlash", !6, i64 8, !7, i64 16, !10, i64 20, !6, i64 24, !12, i64 32}
!15 = !{!16, !16, i64 0}
!16 = !{!"vtable pointer", !8, i64 0}
!17 = !{!14, !10, i64 20}
!18 = !{!7, !7, i64 0}
!19 = !{!14, !7, i64 16}
!20 = distinct !{!20, !21}
!21 = !{!"llvm.loop.mustprogress"}
!22 = !{!14, !6, i64 24}
!23 = !{!24, !10, i64 64}
!24 = !{!"_ZTS7flash_t", !25, i64 0, !25, i64 32, !10, i64 64, !12, i64 68, !12, i64 69, !12, i64 70, !12, i64 71, !7, i64 72, !28, i64 76, !7, i64 80, !7, i64 81, !28, i64 88, !29, i64 92}
!25 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE", !26, i64 0, !27, i64 8, !7, i64 16}
!26 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_Alloc_hiderE", !6, i64 0}
!27 = !{!"long", !7, i64 0}
!28 = !{!"_ZTS8tb_loc_t", !7, i64 0}
!29 = !{!"short", !7, i64 0}
!30 = !{i8 0, i8 2}
!31 = !{}
!32 = distinct !{!32, !21}


; 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::map" = type { %"class.std::_Rb_tree" }
%"class.std::_Rb_tree" = type { %"struct.std::_Rb_tree<unsigned int, std::pair<const unsigned int, flash_t>, std::_Select1st<std::pair<const unsigned int, flash_t>>, std::less<unsigned int>>::_Rb_tree_impl" }
%"struct.std::_Rb_tree<unsigned int, std::pair<const unsigned int, flash_t>, std::_Select1st<std::pair<const unsigned int, flash_t>>, std::less<unsigned int>>::_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 }
%"struct.std::_Rb_tree_iterator" = type { ptr }
%"class.std::__cxx11::basic_string" = type { %"struct.std::__cxx11::basic_string<char>::_Alloc_hider", i64, %union.anon }
%"struct.std::__cxx11::basic_string<char>::_Alloc_hider" = type { ptr }
%union.anon = type { i64, [8 x i8] }
%"class.std::allocator.0" = type { i8 }

@_ZL10flash_list = external hidden global %"class.std::map", align 8
@.str.72 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.73 = external hidden unnamed_addr constant [15 x i8], align 1
@_ZTISt13runtime_error = external constant ptr
@.str.74 = external hidden unnamed_addr constant [9 x i8], align 1
@.str.75 = external hidden unnamed_addr constant [17 x i8], align 1
@.str.76 = external hidden unnamed_addr constant [38 x i8], align 1
@.str.77 = external hidden unnamed_addr constant [10 x i8], align 1
@.str.78 = external hidden unnamed_addr constant [26 x i8], align 1
@.str.79 = external hidden unnamed_addr constant [26 x i8], align 1
@.str.80 = external hidden unnamed_addr constant [26 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: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN8SPIFlash7read_idEv(ptr nocapture noundef nonnull align 8 dereferenceable(33) %0) unnamed_addr #2 align 2 personality ptr @__gxx_personality_v0 {
  %2 = alloca [512 x i8], align 16
  %3 = alloca %"struct.std::_Rb_tree_iterator", align 8
  %4 = alloca i32, align 4
  %5 = alloca %"struct.std::_Rb_tree_iterator", align 8
  %6 = alloca [256 x i8], align 16
  %7 = alloca %"class.std::__cxx11::basic_string", align 8
  %8 = alloca %"class.std::allocator.0", align 1
  %9 = alloca %"class.std::__cxx11::basic_string", align 8
  %10 = alloca %"class.std::allocator.0", align 1
  call void @llvm.lifetime.start.p0(i64 512, ptr nonnull %2) #6
  %11 = getelementptr inbounds i8, ptr %0, i64 8
  %12 = load ptr, ptr %11, align 8, !tbaa !5
  %13 = load ptr, ptr %12, align 8, !tbaa !12
  %14 = getelementptr inbounds i8, ptr %13, i64 16
  %15 = load ptr, ptr %14, align 8
  %16 = call noundef i32 %15(ptr noundef nonnull align 8 dereferenceable(56) %12, i8 noundef zeroext -97, ptr noundef null, ptr noundef nonnull %2, i32 noundef 4)
  %17 = getelementptr inbounds i8, ptr %0, i64 20
  store i32 0, ptr %17, align 4, !tbaa !14
  %18 = getelementptr inbounds i8, ptr %0, i64 16
  %19 = load i8, ptr %18, align 8, !tbaa !15
  %20 = icmp sgt i8 %19, 0
  %21 = load i8, ptr %2, align 16, !tbaa !16
  %22 = zext i8 %21 to i32
  br i1 %20, label %.split.1, label %.split.us

.split.us:                                        ; preds = %1
  %23 = getelementptr inbounds i8, ptr %2, i64 1
  %24 = load i8, ptr %23, align 1, !tbaa !16
  %25 = zext i8 %24 to i32
  %26 = shl nuw nsw i32 %22, 16
  %27 = shl nuw nsw i32 %25, 8
  %28 = or disjoint i32 %26, %27
  %29 = getelementptr inbounds i8, ptr %2, i64 2
  %30 = load i8, ptr %29, align 2, !tbaa !16
  %31 = zext i8 %30 to i32
  %32 = or disjoint i32 %28, %31
  %33 = shl nuw i32 %32, 8
  %34 = getelementptr inbounds i8, ptr %2, i64 3
  %35 = load i8, ptr %34, align 1, !tbaa !16
  %36 = zext i8 %35 to i32
  %37 = or disjoint i32 %33, %36
  store i32 %37, ptr %17, align 4, !tbaa !14
  br label %.split26

.split26:                                         ; preds = %.split.3, %72, %.split.3.thread, %.split.us
  %38 = phi i32 [ %37, %.split.us ], [ %.pre34.pre, %72 ], [ %71, %.split.3 ], [ %64, %.split.3.thread ]
  %.mask = and i32 %38, -256
  %39 = icmp eq i32 %.mask, 16776960
  %40 = icmp ult i32 %38, 256
  %or.cond = or i1 %40, %39
  br i1 %or.cond, label %74, label %79

.split.1:                                         ; preds = %1
  store i32 %22, ptr %17, align 4, !tbaa !14
  %41 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.72, i32 noundef %22)
  %.pre29 = load i8, ptr %18, align 8, !tbaa !15
  %.pre = load i32, ptr %17, align 4, !tbaa !14
  %42 = shl i32 %.pre, 8
  %43 = getelementptr inbounds i8, ptr %2, i64 1
  %44 = load i8, ptr %43, align 1, !tbaa !16
  %45 = zext i8 %44 to i32
  %46 = or disjoint i32 %42, %45
  store i32 %46, ptr %17, align 4, !tbaa !14
  %47 = icmp sgt i8 %.pre29, 0
  br i1 %47, label %.split.2, label %.split.2.thread

.split.2.thread:                                  ; preds = %.split.1
  %48 = shl i32 %46, 8
  %49 = getelementptr inbounds i8, ptr %2, i64 2
  %50 = load i8, ptr %49, align 2, !tbaa !16
  %51 = zext i8 %50 to i32
  %52 = or disjoint i32 %48, %51
  store i32 %52, ptr %17, align 4, !tbaa !14
  br label %.split.3.thread

.split.2:                                         ; preds = %.split.1
  %53 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.72, i32 noundef %45)
  %.pre30 = load i32, ptr %17, align 4, !tbaa !14
  %.pre31 = load i8, ptr %18, align 8, !tbaa !15
  %54 = icmp sgt i8 %.pre31, 0
  %55 = shl i32 %.pre30, 8
  %56 = getelementptr inbounds i8, ptr %2, i64 2
  %57 = load i8, ptr %56, align 2, !tbaa !16
  %58 = zext i8 %57 to i32
  %59 = or disjoint i32 %55, %58
  store i32 %59, ptr %17, align 4, !tbaa !14
  br i1 %54, label %.split.3, label %.split.3.thread

.split.3.thread:                                  ; preds = %.split.2, %.split.2.thread
  %.ph = phi i32 [ %52, %.split.2.thread ], [ %59, %.split.2 ]
  %60 = shl i32 %.ph, 8
  %61 = getelementptr inbounds i8, ptr %2, i64 3
  %62 = load i8, ptr %61, align 1, !tbaa !16
  %63 = zext i8 %62 to i32
  %64 = or disjoint i32 %60, %63
  store i32 %64, ptr %17, align 4, !tbaa !14
  br label %.split26

.split.3:                                         ; preds = %.split.2
  %65 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.72, i32 noundef %58)
  %.pre32 = load i32, ptr %17, align 4, !tbaa !14
  %.pre33 = load i8, ptr %18, align 8, !tbaa !15
  %66 = icmp sgt i8 %.pre33, 0
  %67 = shl i32 %.pre32, 8
  %68 = getelementptr inbounds i8, ptr %2, i64 3
  %69 = load i8, ptr %68, align 1, !tbaa !16
  %70 = zext i8 %69 to i32
  %71 = or disjoint i32 %67, %70
  store i32 %71, ptr %17, align 4, !tbaa !14
  br i1 %66, label %72, label %.split26

72:                                               ; preds = %.split.3
  %73 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.72, i32 noundef %70)
  %.pre34.pre = load i32, ptr %17, align 4, !tbaa !14
  br label %.split26

74:                                               ; preds = %.split26
  %75 = call ptr @__cxa_allocate_exception(i64 16) #6
  invoke void @_ZNSt13runtime_errorC1EPKc(ptr noundef nonnull align 8 dereferenceable(16) %75, ptr noundef nonnull @.str.73)
          to label %76 unwind label %77

76:                                               ; preds = %74
  call void @__cxa_throw(ptr nonnull %75, ptr nonnull @_ZTISt13runtime_error, ptr nonnull @_ZNSt13runtime_errorD1Ev) #7
  unreachable

77:                                               ; preds = %74
  %78 = landingpad { ptr, i32 }
          cleanup
  call void @__cxa_free_exception(ptr %75) #6
  br label %137

79:                                               ; preds = %.split26
  %80 = load i8, ptr %18, align 8, !tbaa !15
  %81 = icmp sgt i8 %80, 0
  br i1 %81, label %82, label %84

82:                                               ; preds = %79
  %83 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.74, i32 noundef %38)
  %.pre35 = load i32, ptr %17, align 4, !tbaa !14
  br label %84

84:                                               ; preds = %82, %79
  %85 = phi i32 [ %.pre35, %82 ], [ %38, %79 ]
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %4) #6
  %86 = lshr i32 %85, 8
  store i32 %86, ptr %4, align 4, !tbaa !17
  %87 = call ptr @_ZNSt3mapIj7flash_tSt4lessIjESaISt4pairIKjS0_EEE4findERS4_(ptr noundef nonnull align 8 dereferenceable(48) @_ZL10flash_list, ptr noundef nonnull align 4 dereferenceable(4) %4)
  store ptr %87, ptr %3, align 8
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #6
  %88 = call ptr @_ZNSt3mapIj7flash_tSt4lessIjESaISt4pairIKjS0_EEE3endEv(ptr noundef nonnull align 8 dereferenceable(48) @_ZL10flash_list) #6
  store ptr %88, ptr %5, align 8
  %89 = call noundef zeroext i1 @_ZStneRKSt17_Rb_tree_iteratorISt4pairIKj7flash_tEES6_(ptr noundef nonnull align 8 dereferenceable(8) %3, ptr noundef nonnull align 8 dereferenceable(8) %5) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #6
  br i1 %89, label %90, label %123

90:                                               ; preds = %84
  %91 = call noundef nonnull align 8 dereferenceable(104) ptr @_ZNKSt17_Rb_tree_iteratorISt4pairIKj7flash_tEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %3) #6
  %92 = getelementptr inbounds i8, ptr %91, i64 8
  %93 = getelementptr inbounds i8, ptr %0, i64 24
  store ptr %92, ptr %93, align 8, !tbaa !18
  call void @llvm.lifetime.start.p0(i64 256, ptr nonnull %6) #6
  %94 = load i32, ptr %17, align 4, !tbaa !14
  %95 = lshr i32 %94, 8
  %96 = call i32 (ptr, i64, ptr, ...) @snprintf(ptr noundef nonnull dereferenceable(1) %6, i64 noundef 256, ptr noundef nonnull @.str.75, i32 noundef %95) #6
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %7) #6
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %8) #6
  call void @_ZNSaIcEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %8) #6
  invoke void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_(ptr noundef nonnull align 8 dereferenceable(32) %7, ptr noundef nonnull %6, ptr noundef nonnull align 1 dereferenceable(1) %8)
          to label %97 unwind label %112

97:                                               ; preds = %90
  invoke void @_Z9printInfoRKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEb(ptr noundef nonnull align 8 dereferenceable(32) %7, i1 noundef zeroext true)
          to label %98 unwind label %114

98:                                               ; preds = %97
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %7) #6
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %8) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %8) #6
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %7) #6
  %99 = load ptr, ptr %93, align 8, !tbaa !18
  %100 = call noundef ptr @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE5c_strEv(ptr noundef nonnull align 8 dereferenceable(32) %99) #6
  %101 = load ptr, ptr %93, align 8, !tbaa !18
  %102 = getelementptr inbounds i8, ptr %101, i64 32
  %103 = call noundef ptr @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE5c_strEv(ptr noundef nonnull align 8 dereferenceable(32) %102) #6
  %104 = load ptr, ptr %93, align 8, !tbaa !18
  %105 = getelementptr inbounds i8, ptr %104, i64 64
  %106 = load i32, ptr %105, align 8, !tbaa !19
  %107 = lshr i32 %106, 1
  %108 = and i32 %107, 4095
  %109 = call i32 (ptr, i64, ptr, ...) @snprintf(ptr noundef nonnull dereferenceable(1) %6, i64 noundef 256, ptr noundef nonnull @.str.76, ptr noundef %100, ptr noundef %103, i32 noundef %106, i32 noundef %108) #6
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %9) #6
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %10) #6
  call void @_ZNSaIcEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %10) #6
  invoke void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_(ptr noundef nonnull align 8 dereferenceable(32) %9, ptr noundef nonnull %6, ptr noundef nonnull align 1 dereferenceable(1) %10)
          to label %110 unwind label %117

110:                                              ; preds = %98
  invoke void @_Z9printInfoRKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEb(ptr noundef nonnull align 8 dereferenceable(32) %9, i1 noundef zeroext true)
          to label %111 unwind label %119

111:                                              ; preds = %110
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %9) #6
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %10) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %10) #6
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %9) #6
  call void @llvm.lifetime.end.p0(i64 256, ptr nonnull %6) #6
  br label %136

112:                                              ; preds = %90
  %113 = landingpad { ptr, i32 }
          cleanup
  br label %116

114:                                              ; preds = %97
  %115 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %7) #6
  br label %116

116:                                              ; preds = %114, %112
  %.pn = phi { ptr, i32 } [ %115, %114 ], [ %113, %112 ]
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %8) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %8) #6
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %7) #6
  br label %122

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

119:                                              ; preds = %110
  %120 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %9) #6
  br label %121

121:                                              ; preds = %119, %117
  %.pn19 = phi { ptr, i32 } [ %120, %119 ], [ %118, %117 ]
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %10) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %10) #6
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %9) #6
  br label %122

122:                                              ; preds = %121, %116
  %.pn19.pn = phi { ptr, i32 } [ %.pn19, %121 ], [ %.pn, %116 ]
  call void @llvm.lifetime.end.p0(i64 256, ptr nonnull %6) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #6
  br label %137

123:                                              ; preds = %84
  %124 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.77)
  %125 = load i8, ptr %2, align 16, !tbaa !16
  %126 = zext i8 %125 to i32
  %127 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.78, i32 noundef %126)
  %128 = getelementptr inbounds i8, ptr %2, i64 1
  %129 = load i8, ptr %128, align 1, !tbaa !16
  %130 = zext i8 %129 to i32
  %131 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.79, i32 noundef %130)
  %132 = getelementptr inbounds i8, ptr %2, i64 2
  %133 = load i8, ptr %132, align 2, !tbaa !16
  %134 = zext i8 %133 to i32
  %135 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.80, i32 noundef %134)
  br label %136

136:                                              ; preds = %123, %111
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #6
  call void @llvm.lifetime.end.p0(i64 512, ptr nonnull %2) #6
  ret void

137:                                              ; preds = %122, %77
  %.pn22 = phi { ptr, i32 } [ %78, %77 ], [ %.pn19.pn, %122 ]
  call void @llvm.lifetime.end.p0(i64 512, ptr nonnull %2) #6
  resume { ptr, i32 } %.pn22
}

declare ptr @__cxa_allocate_exception(i64) local_unnamed_addr

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

declare void @__cxa_free_exception(ptr) local_unnamed_addr

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

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZStneRKSt17_Rb_tree_iteratorISt4pairIKj7flash_tEES6_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #1

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

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

; Function Attrs: nofree nounwind
declare noundef i32 @snprintf(ptr noalias nocapture noundef writeonly, i64 noundef, ptr nocapture noundef readonly, ...) 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 = { 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 #4 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { nounwind }
attributes #7 = { noreturn }

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !7, i64 8}
!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, !10, i64 20}
!15 = !{!6, !8, i64 16}
!16 = !{!8, !8, i64 0}
!17 = !{!10, !10, i64 0}
!18 = !{!6, !7, i64 24}
!19 = !{!20, !10, i64 64}
!20 = !{!"_ZTS7flash_t", !21, i64 0, !21, i64 32, !10, i64 64, !11, i64 68, !11, i64 69, !11, i64 70, !11, i64 71, !8, i64 72, !24, i64 76, !8, i64 80, !8, i64 81, !24, i64 88, !25, i64 92}
!21 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE", !22, i64 0, !23, i64 8, !8, i64 16}
!22 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_Alloc_hiderE", !7, i64 0}
!23 = !{!"long", !8, i64 0}
!24 = !{!"_ZTS8tb_loc_t", !8, i64 0}
!25 = !{!"short", !8, i64 0}


; Effective O3 passes: DSEPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferAlignmentPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LCSSAPass,LICMPass,LoopRotatePass,LoopSimplifyCFGPass,LoopSimplifyPass,PostOrderFunctionAttrsPass,ReassociatePass,SCCPPass,SROAPass,SimpleLoopUnswitchPass,SimplifyCFGPass