; LLVM IR from trabucayre/openFPGALoader :: src/anlogic.ll (ZN7Anlogic7programEjb)

; 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.AnlogicBitParser = type <{ %class.ConfigBitstreamParser, i8, [7 x i8] }>
%class.ConfigBitstreamParser = type { ptr, %"class.std::__cxx11::basic_string", i32, i32, i8, %"class.std::vector", %"class.std::__cxx11::basic_string", %"class.std::map.81" }
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<unsigned char, std::allocator<unsigned char>>::_Vector_impl" }
%"struct.std::_Vector_base<unsigned char, std::allocator<unsigned char>>::_Vector_impl" = type { %"struct.std::_Vector_base<unsigned char, std::allocator<unsigned char>>::_Vector_impl_data" }
%"struct.std::_Vector_base<unsigned char, std::allocator<unsigned char>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::__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::map.81" = type { %"class.std::_Rb_tree.82" }
%"class.std::_Rb_tree.82" = type { %"struct.std::_Rb_tree<std::__cxx11::basic_string<char>, std::pair<const std::__cxx11::basic_string<char>, std::__cxx11::basic_string<char>>, std::_Select1st<std::pair<const std::__cxx11::basic_string<char>, std::__cxx11::basic_string<char>>>, 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>, std::__cxx11::basic_string<char>>, std::_Select1st<std::pair<const std::__cxx11::basic_string<char>, std::__cxx11::basic_string<char>>>, 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.std::allocator.0" = type { i8 }
%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.Device = type <{ ptr, ptr, %"class.std::__cxx11::basic_string", %"class.std::__cxx11::basic_string", i32, i8, i8, i8, i8 }>

@.str.572 = external hidden unnamed_addr constant [12 x i8], align 1
@.str.573 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.574 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.575 = 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 void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32)) unnamed_addr #1 align 2

declare noundef i32 @_ZN4Jtag7shiftIREhiNS_10tapState_tE(ptr noundef nonnull align 8 dereferenceable(193), i8 noundef zeroext, i32 noundef, i32 noundef) #3

declare void @_ZN4Jtag9toggleClkEi(ptr noundef nonnull align 8 dereferenceable(193), i32 noundef) #3

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN7Anlogic7programEjb(ptr noundef nonnull align 8 dereferenceable(144) %0, i32 noundef %1, i1 noundef zeroext %2) unnamed_addr #2 align 2 personality ptr @__gxx_personality_v0 {
  %4 = alloca ptr, align 8
  %5 = alloca i32, align 4
  %6 = alloca i8, align 1
  %7 = alloca %class.AnlogicBitParser, align 8
  %8 = alloca %"class.std::__cxx11::basic_string", align 8
  %9 = alloca %"class.std::allocator.0", align 1
  %10 = alloca ptr, align 8
  %11 = alloca i32, align 4
  %12 = alloca %"class.std::__cxx11::basic_string", align 8
  %13 = alloca %"class.std::allocator.0", align 1
  %14 = alloca i32, align 4
  %15 = alloca %"class.std::__cxx11::basic_string", align 8
  %16 = alloca %"class.std::allocator.0", align 1
  %17 = alloca ptr, align 8
  %18 = alloca i32, align 4
  %19 = alloca %class.ProgressBar, align 8
  %20 = alloca %"class.std::__cxx11::basic_string", align 8
  %21 = alloca %"class.std::allocator.0", align 1
  %22 = alloca i32, align 4
  %23 = alloca ptr, align 8
  %24 = alloca i32, align 4
  %25 = alloca i32, align 4
  store ptr %0, ptr %4, align 8, !tbaa !5
  store i32 %1, ptr %5, align 4, !tbaa !9
  %26 = zext i1 %2 to i8
  store i8 %26, ptr %6, align 1, !tbaa !11
  %27 = load ptr, ptr %4, align 8
  %28 = getelementptr inbounds %class.Device, ptr %27, i32 0, i32 4
  %29 = load i32, ptr %28, align 8, !tbaa !13
  %30 = icmp eq i32 %29, 0
  br i1 %30, label %31, label %32

31:                                               ; preds = %3
  br label %262

32:                                               ; preds = %3
  call void @llvm.lifetime.start.p0(i64 168, ptr %7) #6
  %33 = getelementptr inbounds %class.Device, ptr %27, i32 0, i32 2
  %34 = getelementptr inbounds %class.Device, ptr %27, i32 0, i32 4
  %35 = load i32, ptr %34, align 8, !tbaa !13
  %36 = icmp eq i32 %35, 2
  %37 = getelementptr inbounds %class.Device, ptr %27, i32 0, i32 6
  %38 = load i8, ptr %37, align 1, !tbaa !19, !range !20, !noundef !21
  %39 = trunc i8 %38 to i1
  call void @_ZN16AnlogicBitParserC1ERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEbb(ptr noundef nonnull align 8 dereferenceable(161) %7, ptr noundef nonnull align 8 dereferenceable(32) %33, i1 noundef zeroext %36, i1 noundef zeroext %39)
  call void @llvm.lifetime.start.p0(i64 32, ptr %8) #6
  call void @llvm.lifetime.start.p0(i64 1, ptr %9) #6
  call void @_ZNSaIcEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %9) #6
  invoke void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_(ptr noundef nonnull align 8 dereferenceable(32) %8, ptr noundef @.str.572, ptr noundef nonnull align 1 dereferenceable(1) %9)
          to label %40 unwind label %48

40:                                               ; preds = %32
  invoke void @_Z9printInfoRKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEb(ptr noundef nonnull align 8 dereferenceable(32) %8, i1 noundef zeroext false)
          to label %41 unwind label %52

41:                                               ; preds = %40
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %8) #6
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %9) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr %9) #6
  call void @llvm.lifetime.end.p0(i64 32, ptr %8) #6
  %42 = invoke noundef i32 @_ZN16AnlogicBitParser5parseEv(ptr noundef nonnull align 8 dereferenceable(161) %7)
          to label %43 unwind label %57

43:                                               ; preds = %41
  %44 = icmp eq i32 %42, 1
  br i1 %44, label %45, label %70

45:                                               ; preds = %43
  call void @llvm.lifetime.start.p0(i64 32, ptr %12) #6
  call void @llvm.lifetime.start.p0(i64 1, ptr %13) #6
  call void @_ZNSaIcEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %13) #6
  invoke void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_(ptr noundef nonnull align 8 dereferenceable(32) %12, ptr noundef @.str.573, ptr noundef nonnull align 1 dereferenceable(1) %13)
          to label %46 unwind label %61

46:                                               ; preds = %45
  invoke void @_Z10printErrorRKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEb(ptr noundef nonnull align 8 dereferenceable(32) %12, i1 noundef zeroext true)
          to label %47 unwind label %65

47:                                               ; preds = %46
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %12) #6
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %13) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr %13) #6
  call void @llvm.lifetime.end.p0(i64 32, ptr %12) #6
  store i32 1, ptr %14, align 4
  br label %260

48:                                               ; preds = %32
  %49 = landingpad { ptr, i32 }
          cleanup
  %50 = extractvalue { ptr, i32 } %49, 0
  store ptr %50, ptr %10, align 8
  %51 = extractvalue { ptr, i32 } %49, 1
  store i32 %51, ptr %11, align 4
  br label %56

52:                                               ; preds = %40
  %53 = landingpad { ptr, i32 }
          cleanup
  %54 = extractvalue { ptr, i32 } %53, 0
  store ptr %54, ptr %10, align 8
  %55 = extractvalue { ptr, i32 } %53, 1
  store i32 %55, ptr %11, align 4
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %8) #6
  br label %56

56:                                               ; preds = %52, %48
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %9) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr %9) #6
  call void @llvm.lifetime.end.p0(i64 32, ptr %8) #6
  br label %265

57:                                               ; preds = %76, %41
  %58 = landingpad { ptr, i32 }
          cleanup
  %59 = extractvalue { ptr, i32 } %58, 0
  store ptr %59, ptr %10, align 8
  %60 = extractvalue { ptr, i32 } %58, 1
  store i32 %60, ptr %11, align 4
  br label %265

61:                                               ; preds = %45
  %62 = landingpad { ptr, i32 }
          cleanup
  %63 = extractvalue { ptr, i32 } %62, 0
  store ptr %63, ptr %10, align 8
  %64 = extractvalue { ptr, i32 } %62, 1
  store i32 %64, ptr %11, align 4
  br label %69

65:                                               ; preds = %46
  %66 = landingpad { ptr, i32 }
          cleanup
  %67 = extractvalue { ptr, i32 } %66, 0
  store ptr %67, ptr %10, align 8
  %68 = extractvalue { ptr, i32 } %66, 1
  store i32 %68, ptr %11, align 4
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %12) #6
  br label %69

69:                                               ; preds = %65, %61
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %13) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr %13) #6
  call void @llvm.lifetime.end.p0(i64 32, ptr %12) #6
  br label %265

70:                                               ; preds = %43
  call void @llvm.lifetime.start.p0(i64 32, ptr %15) #6
  call void @llvm.lifetime.start.p0(i64 1, ptr %16) #6
  call void @_ZNSaIcEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %16) #6
  invoke void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_(ptr noundef nonnull align 8 dereferenceable(32) %15, ptr noundef @.str.574, ptr noundef nonnull align 1 dereferenceable(1) %16)
          to label %71 unwind label %78

71:                                               ; preds = %70
  invoke void @_Z12printSuccessRKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEb(ptr noundef nonnull align 8 dereferenceable(32) %15, i1 noundef zeroext true)
          to label %72 unwind label %82

72:                                               ; preds = %71
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %15) #6
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %16) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr %16) #6
  call void @llvm.lifetime.end.p0(i64 32, ptr %15) #6
  %73 = getelementptr inbounds %class.Device, ptr %27, i32 0, i32 6
  %74 = load i8, ptr %73, align 1, !tbaa !19, !range !20, !noundef !21
  %75 = trunc i8 %74 to i1
  br i1 %75, label %76, label %87

76:                                               ; preds = %72
  invoke void @_ZN21ConfigBitstreamParser13displayHeaderEv(ptr noundef nonnull align 8 dereferenceable(160) %7)
          to label %77 unwind label %57

77:                                               ; preds = %76
  br label %87

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

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

86:                                               ; preds = %82, %78
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %16) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr %16) #6
  call void @llvm.lifetime.end.p0(i64 32, ptr %15) #6
  br label %265

87:                                               ; preds = %77, %72
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #6
  %88 = invoke noundef ptr @_ZNK21ConfigBitstreamParser7getDataEv(ptr noundef nonnull align 8 dereferenceable(160) %7)
          to label %89 unwind label %105

89:                                               ; preds = %87
  store ptr %88, ptr %17, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #6
  %90 = invoke noundef i32 @_ZN21ConfigBitstreamParser9getLengthEv(ptr noundef nonnull align 8 dereferenceable(160) %7)
          to label %91 unwind label %109

91:                                               ; preds = %89
  %92 = sdiv i32 %90, 8
  store i32 %92, ptr %18, align 4, !tbaa !9
  %93 = getelementptr inbounds %class.Device, ptr %27, i32 0, i32 4
  %94 = load i32, ptr %93, align 8, !tbaa !13
  %95 = icmp eq i32 %94, 1
  br i1 %95, label %96, label %113

96:                                               ; preds = %91
  %97 = getelementptr inbounds i8, ptr %27, i64 88
  %98 = load i32, ptr %5, align 4, !tbaa !9
  %99 = load ptr, ptr %17, align 8, !tbaa !5
  %100 = load i32, ptr %18, align 4, !tbaa !9
  %101 = load i8, ptr %6, align 1, !tbaa !11, !range !20, !noundef !21
  %102 = trunc i8 %101 to i1
  %103 = invoke noundef zeroext i1 @_ZN12SPIInterface5writeEjPKhjb(ptr noundef nonnull align 8 dereferenceable(56) %97, i32 noundef %98, ptr noundef %99, i32 noundef %100, i1 noundef zeroext %102)
          to label %104 unwind label %109

104:                                              ; preds = %96
  store i32 1, ptr %14, align 4
  br label %259

105:                                              ; preds = %87
  %106 = landingpad { ptr, i32 }
          cleanup
  %107 = extractvalue { ptr, i32 } %106, 0
  store ptr %107, ptr %10, align 8
  %108 = extractvalue { ptr, i32 } %106, 1
  store i32 %108, ptr %11, align 4
  br label %264

109:                                              ; preds = %151, %147, %144, %140, %137, %133, %129, %125, %121, %117, %96, %89
  %110 = landingpad { ptr, i32 }
          cleanup
  %111 = extractvalue { ptr, i32 } %110, 0
  store ptr %111, ptr %10, align 8
  %112 = extractvalue { ptr, i32 } %110, 1
  store i32 %112, ptr %11, align 4
  br label %263

113:                                              ; preds = %91
  %114 = getelementptr inbounds %class.Device, ptr %27, i32 0, i32 4
  %115 = load i32, ptr %114, align 8, !tbaa !13
  %116 = icmp eq i32 %115, 2
  br i1 %116, label %117, label %258

117:                                              ; preds = %113
  %118 = getelementptr inbounds %class.Device, ptr %27, i32 0, i32 1
  %119 = load ptr, ptr %118, align 8, !tbaa !22
  %120 = invoke noundef i32 @_ZN4Jtag7shiftIREhiNS_10tapState_tE(ptr noundef nonnull align 8 dereferenceable(193) %119, i8 noundef zeroext -1, i32 noundef 8, i32 noundef 1)
          to label %121 unwind label %109

121:                                              ; preds = %117
  %122 = getelementptr inbounds %class.Device, ptr %27, i32 0, i32 1
  %123 = load ptr, ptr %122, align 8, !tbaa !22
  %124 = invoke noundef i32 @_ZN4Jtag7shiftIREhiNS_10tapState_tE(ptr noundef nonnull align 8 dereferenceable(193) %123, i8 noundef zeroext -1, i32 noundef 8, i32 noundef 1)
          to label %125 unwind label %109

125:                                              ; preds = %121
  %126 = getelementptr inbounds %class.Device, ptr %27, i32 0, i32 1
  %127 = load ptr, ptr %126, align 8, !tbaa !22
  %128 = invoke noundef i32 @_ZN4Jtag7shiftIREhiNS_10tapState_tE(ptr noundef nonnull align 8 dereferenceable(193) %127, i8 noundef zeroext 1, i32 noundef 8, i32 noundef 1)
          to label %129 unwind label %109

129:                                              ; preds = %125
  %130 = getelementptr inbounds %class.Device, ptr %27, i32 0, i32 1
  %131 = load ptr, ptr %130, align 8, !tbaa !22
  %132 = invoke noundef i32 @_ZN4Jtag7shiftIREhiNS_10tapState_tE(ptr noundef nonnull align 8 dereferenceable(193) %131, i8 noundef zeroext -1, i32 noundef 8, i32 noundef 1)
          to label %133 unwind label %109

133:                                              ; preds = %129
  %134 = getelementptr inbounds %class.Device, ptr %27, i32 0, i32 1
  %135 = load ptr, ptr %134, align 8, !tbaa !22
  %136 = invoke noundef i32 @_ZN4Jtag7shiftIREhiNS_10tapState_tE(ptr noundef nonnull align 8 dereferenceable(193) %135, i8 noundef zeroext 57, i32 noundef 8, i32 noundef 1)
          to label %137 unwind label %109

137:                                              ; preds = %133
  %138 = getelementptr inbounds %class.Device, ptr %27, i32 0, i32 1
  %139 = load ptr, ptr %138, align 8, !tbaa !22
  invoke void @_ZN4Jtag9toggleClkEi(ptr noundef nonnull align 8 dereferenceable(193) %139, i32 noundef 50000)
          to label %140 unwind label %109

140:                                              ; preds = %137
  %141 = getelementptr inbounds %class.Device, ptr %27, i32 0, i32 1
  %142 = load ptr, ptr %141, align 8, !tbaa !22
  %143 = invoke noundef i32 @_ZN4Jtag7shiftIREhiNS_10tapState_tE(ptr noundef nonnull align 8 dereferenceable(193) %142, i8 noundef zeroext 48, i32 noundef 8, i32 noundef 1)
          to label %144 unwind label %109

144:                                              ; preds = %140
  %145 = getelementptr inbounds %class.Device, ptr %27, i32 0, i32 1
  %146 = load ptr, ptr %145, align 8, !tbaa !22
  invoke void @_ZN4Jtag9toggleClkEi(ptr noundef nonnull align 8 dereferenceable(193) %146, i32 noundef 15)
          to label %147 unwind label %109

147:                                              ; preds = %144
  %148 = getelementptr inbounds %class.Device, ptr %27, i32 0, i32 1
  %149 = load ptr, ptr %148, align 8, !tbaa !22
  %150 = invoke noundef i32 @_ZN4Jtag7shiftIREhiNS_10tapState_tE(ptr noundef nonnull align 8 dereferenceable(193) %149, i8 noundef zeroext 59, i32 noundef 8, i32 noundef 1)
          to label %151 unwind label %109

151:                                              ; preds = %147
  %152 = getelementptr inbounds %class.Device, ptr %27, i32 0, i32 1
  %153 = load ptr, ptr %152, align 8, !tbaa !22
  invoke void @_ZN4Jtag9toggleClkEi(ptr noundef nonnull align 8 dereferenceable(193) %153, i32 noundef 15)
          to label %154 unwind label %109

154:                                              ; preds = %151
  call void @llvm.lifetime.start.p0(i64 56, ptr %19) #6
  call void @llvm.lifetime.start.p0(i64 32, ptr %20) #6
  call void @llvm.lifetime.start.p0(i64 1, ptr %21) #6
  call void @_ZNSaIcEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %21) #6
  invoke void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_(ptr noundef nonnull align 8 dereferenceable(32) %20, ptr noundef @.str.575, ptr noundef nonnull align 1 dereferenceable(1) %21)
          to label %155 unwind label %199

155:                                              ; preds = %154
  %156 = load i32, ptr %18, align 4, !tbaa !9
  %157 = getelementptr inbounds %class.Device, ptr %27, i32 0, i32 7
  %158 = load i8, ptr %157, align 2, !tbaa !23, !range !20, !noundef !21
  %159 = trunc i8 %158 to i1
  invoke void @_ZN11ProgressBarC1ERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEiib(ptr noundef nonnull align 8 dereferenceable(50) %19, ptr noundef nonnull align 8 dereferenceable(32) %20, i32 noundef %156, i32 noundef 50, i1 noundef zeroext %159)
          to label %160 unwind label %203

160:                                              ; preds = %155
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %20) #6
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %21) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr %21) #6
  call void @llvm.lifetime.end.p0(i64 32, ptr %20) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %22) #6
  store i32 0, ptr %22, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %23) #6
  %161 = load ptr, ptr %17, align 8, !tbaa !5
  store ptr %161, ptr %23, align 8, !tbaa !5
  br label %162

162:                                              ; preds = %191, %160
  %163 = load i32, ptr %18, align 4, !tbaa !9
  %164 = icmp sgt i32 %163, 0
  br i1 %164, label %165, label %212

165:                                              ; preds = %162
  call void @llvm.lifetime.start.p0(i64 4, ptr %24) #6
  %166 = load i32, ptr %18, align 4, !tbaa !9
  %167 = icmp sgt i32 %166, 512
  br i1 %167, label %168, label %169

168:                                              ; preds = %165
  br label %171

169:                                              ; preds = %165
  %170 = load i32, ptr %18, align 4, !tbaa !9
  br label %171

171:                                              ; preds = %169, %168
  %172 = phi i32 [ 512, %168 ], [ %170, %169 ]
  store i32 %172, ptr %24, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %25) #6
  %173 = load i32, ptr %18, align 4, !tbaa !9
  %174 = load i32, ptr %24, align 4, !tbaa !9
  %175 = sub nsw i32 %173, %174
  %176 = icmp ne i32 %175, 0
  %177 = zext i1 %176 to i64
  %178 = select i1 %176, i32 4, i32 1
  store i32 %178, ptr %25, align 4, !tbaa !24
  %179 = getelementptr inbounds %class.Device, ptr %27, i32 0, i32 1
  %180 = load ptr, ptr %179, align 8, !tbaa !22
  %181 = load ptr, ptr %23, align 8, !tbaa !5
  %182 = load i32, ptr %24, align 4, !tbaa !9
  %183 = mul nsw i32 %182, 8
  %184 = load i32, ptr %25, align 4, !tbaa !24
  %185 = invoke noundef i32 @_ZN4Jtag7shiftDREPKhPhiNS_10tapState_tE(ptr noundef nonnull align 8 dereferenceable(193) %180, ptr noundef %181, ptr noundef null, i32 noundef %183, i32 noundef %184)
          to label %186 unwind label %208

186:                                              ; preds = %171
  %187 = load i32, ptr %24, align 4, !tbaa !9
  %188 = load i32, ptr %18, align 4, !tbaa !9
  %189 = sub nsw i32 %188, %187
  store i32 %189, ptr %18, align 4, !tbaa !9
  %190 = load i32, ptr %22, align 4, !tbaa !9
  invoke void @_ZN11ProgressBar7displayEic(ptr noundef nonnull align 8 dereferenceable(50) %19, i32 noundef %190, i8 noundef signext 0)
          to label %191 unwind label %208

191:                                              ; preds = %186
  %192 = load i32, ptr %24, align 4, !tbaa !9
  %193 = load i32, ptr %22, align 4, !tbaa !9
  %194 = add nsw i32 %193, %192
  store i32 %194, ptr %22, align 4, !tbaa !9
  %195 = load i32, ptr %24, align 4, !tbaa !9
  %196 = load ptr, ptr %23, align 8, !tbaa !5
  %197 = sext i32 %195 to i64
  %198 = getelementptr inbounds i8, ptr %196, i64 %197
  store ptr %198, ptr %23, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr %25) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %24) #6
  br label %162, !llvm.loop !26

199:                                              ; preds = %154
  %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 %207

203:                                              ; preds = %155
  %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
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %20) #6
  br label %207

207:                                              ; preds = %203, %199
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %21) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr %21) #6
  call void @llvm.lifetime.end.p0(i64 32, ptr %20) #6
  br label %257

208:                                              ; preds = %186, %171
  %209 = landingpad { ptr, i32 }
          cleanup
  %210 = extractvalue { ptr, i32 } %209, 0
  store ptr %210, ptr %10, align 8
  %211 = extractvalue { ptr, i32 } %209, 1
  store i32 %211, ptr %11, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %25) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %24) #6
  br label %256

212:                                              ; preds = %162
  invoke void @_ZN11ProgressBar4doneEv(ptr noundef nonnull align 8 dereferenceable(50) %19)
          to label %213 unwind label %252

213:                                              ; preds = %212
  %214 = getelementptr inbounds %class.Device, ptr %27, i32 0, i32 1
  %215 = load ptr, ptr %214, align 8, !tbaa !22
  invoke void @_ZN4Jtag9toggleClkEi(ptr noundef nonnull align 8 dereferenceable(193) %215, i32 noundef 100)
          to label %216 unwind label %252

216:                                              ; preds = %213
  %217 = getelementptr inbounds %class.Device, ptr %27, i32 0, i32 1
  %218 = load ptr, ptr %217, align 8, !tbaa !22
  %219 = invoke noundef i32 @_ZN4Jtag7shiftIREhiNS_10tapState_tE(ptr noundef nonnull align 8 dereferenceable(193) %218, i8 noundef zeroext 61, i32 noundef 8, i32 noundef 1)
          to label %220 unwind label %252

220:                                              ; preds = %216
  %221 = getelementptr inbounds %class.Device, ptr %27, i32 0, i32 1
  %222 = load ptr, ptr %221, align 8, !tbaa !22
  invoke void @_ZN4Jtag9toggleClkEi(ptr noundef nonnull align 8 dereferenceable(193) %222, i32 noundef 15)
          to label %223 unwind label %252

223:                                              ; preds = %220
  %224 = getelementptr inbounds %class.Device, ptr %27, i32 0, i32 1
  %225 = load ptr, ptr %224, align 8, !tbaa !22
  %226 = invoke noundef i32 @_ZN4Jtag7shiftIREhiNS_10tapState_tE(ptr noundef nonnull align 8 dereferenceable(193) %225, i8 noundef zeroext -1, i32 noundef 8, i32 noundef 1)
          to label %227 unwind label %252

227:                                              ; preds = %223
  %228 = getelementptr inbounds %class.Device, ptr %27, i32 0, i32 1
  %229 = load ptr, ptr %228, align 8, !tbaa !22
  invoke void @_ZN4Jtag9toggleClkEi(ptr noundef nonnull align 8 dereferenceable(193) %229, i32 noundef 1000)
          to label %230 unwind label %252

230:                                              ; preds = %227
  %231 = getelementptr inbounds %class.Device, ptr %27, i32 0, i32 1
  %232 = load ptr, ptr %231, align 8, !tbaa !22
  %233 = invoke noundef i32 @_ZN4Jtag7shiftIREhiNS_10tapState_tE(ptr noundef nonnull align 8 dereferenceable(193) %232, i8 noundef zeroext 49, i32 noundef 8, i32 noundef 1)
          to label %234 unwind label %252

234:                                              ; preds = %230
  %235 = getelementptr inbounds %class.Device, ptr %27, i32 0, i32 1
  %236 = load ptr, ptr %235, align 8, !tbaa !22
  invoke void @_ZN4Jtag9toggleClkEi(ptr noundef nonnull align 8 dereferenceable(193) %236, i32 noundef 100)
          to label %237 unwind label %252

237:                                              ; preds = %234
  %238 = getelementptr inbounds %class.Device, ptr %27, i32 0, i32 1
  %239 = load ptr, ptr %238, align 8, !tbaa !22
  %240 = invoke noundef i32 @_ZN4Jtag7shiftIREhiNS_10tapState_tE(ptr noundef nonnull align 8 dereferenceable(193) %239, i8 noundef zeroext 61, i32 noundef 8, i32 noundef 1)
          to label %241 unwind label %252

241:                                              ; preds = %237
  %242 = getelementptr inbounds %class.Device, ptr %27, i32 0, i32 1
  %243 = load ptr, ptr %242, align 8, !tbaa !22
  invoke void @_ZN4Jtag9toggleClkEi(ptr noundef nonnull align 8 dereferenceable(193) %243, i32 noundef 15)
          to label %244 unwind label %252

244:                                              ; preds = %241
  %245 = getelementptr inbounds %class.Device, ptr %27, i32 0, i32 1
  %246 = load ptr, ptr %245, align 8, !tbaa !22
  %247 = invoke noundef i32 @_ZN4Jtag7shiftIREhiNS_10tapState_tE(ptr noundef nonnull align 8 dereferenceable(193) %246, i8 noundef zeroext -1, i32 noundef 8, i32 noundef 1)
          to label %248 unwind label %252

248:                                              ; preds = %244
  %249 = getelementptr inbounds %class.Device, ptr %27, i32 0, i32 1
  %250 = load ptr, ptr %249, align 8, !tbaa !22
  invoke void @_ZN4Jtag9toggleClkEi(ptr noundef nonnull align 8 dereferenceable(193) %250, i32 noundef 15)
          to label %251 unwind label %252

251:                                              ; preds = %248
  call void @llvm.lifetime.end.p0(i64 8, ptr %23) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %22) #6
  call void @_ZN11ProgressBarD2Ev(ptr noundef nonnull align 8 dereferenceable(50) %19) #6
  call void @llvm.lifetime.end.p0(i64 56, ptr %19) #6
  br label %258

252:                                              ; preds = %248, %244, %241, %237, %234, %230, %227, %223, %220, %216, %213, %212
  %253 = landingpad { ptr, i32 }
          cleanup
  %254 = extractvalue { ptr, i32 } %253, 0
  store ptr %254, ptr %10, align 8
  %255 = extractvalue { ptr, i32 } %253, 1
  store i32 %255, ptr %11, align 4
  br label %256

256:                                              ; preds = %252, %208
  call void @llvm.lifetime.end.p0(i64 8, ptr %23) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %22) #6
  call void @_ZN11ProgressBarD2Ev(ptr noundef nonnull align 8 dereferenceable(50) %19) #6
  br label %257

257:                                              ; preds = %256, %207
  call void @llvm.lifetime.end.p0(i64 56, ptr %19) #6
  br label %263

258:                                              ; preds = %251, %113
  store i32 0, ptr %14, align 4
  br label %259

259:                                              ; preds = %258, %104
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #6
  br label %260

260:                                              ; preds = %259, %47
  call void @_ZN16AnlogicBitParserD1Ev(ptr noundef nonnull align 8 dereferenceable(161) %7) #6
  call void @llvm.lifetime.end.p0(i64 168, ptr %7) #6
  %261 = load i32, ptr %14, align 4
  switch i32 %261, label %271 [
    i32 0, label %262
    i32 1, label %262
  ]

262:                                              ; preds = %260, %260, %31
  ret void

263:                                              ; preds = %257, %109
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #6
  br label %264

264:                                              ; preds = %263, %105
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #6
  br label %265

265:                                              ; preds = %264, %86, %69, %57, %56
  call void @_ZN16AnlogicBitParserD1Ev(ptr noundef nonnull align 8 dereferenceable(161) %7) #6
  call void @llvm.lifetime.end.p0(i64 168, ptr %7) #6
  br label %266

266:                                              ; preds = %265
  %267 = load ptr, ptr %10, align 8
  %268 = load i32, ptr %11, align 4
  %269 = insertvalue { ptr, i32 } poison, ptr %267, 0
  %270 = insertvalue { ptr, i32 } %269, i32 %268, 1
  resume { ptr, i32 } %270

271:                                              ; preds = %260
  unreachable
}

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

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

declare noundef i32 @_ZN16AnlogicBitParser5parseEv(ptr noundef nonnull align 8 dereferenceable(161)) unnamed_addr #3

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

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

declare void @_ZN21ConfigBitstreamParser13displayHeaderEv(ptr noundef nonnull align 8 dereferenceable(160)) unnamed_addr #3

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

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

declare noundef zeroext i1 @_ZN12SPIInterface5writeEjPKhjb(ptr noundef nonnull align 8 dereferenceable(56), i32 noundef, ptr noundef, i32 noundef, i1 noundef zeroext) #3

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 noundef i32 @_ZN4Jtag7shiftDREPKhPhiNS_10tapState_tE(ptr noundef nonnull align 8 dereferenceable(193), ptr noundef, ptr noundef, i32 noundef, i32 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: nounwind
declare void @_ZN16AnlogicBitParserD1Ev(ptr noundef nonnull align 8 dereferenceable(161)) unnamed_addr #5

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

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 "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { nounwind }

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"bool", !7, i64 0}
!13 = !{!14, !18, i64 80}
!14 = !{!"_ZTS6Device", !6, i64 8, !15, i64 16, !15, i64 48, !18, i64 80, !12, i64 84, !12, i64 85, !12, i64 86}
!15 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE", !16, i64 0, !17, i64 8, !7, i64 16}
!16 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_Alloc_hiderE", !6, i64 0}
!17 = !{!"long", !7, i64 0}
!18 = !{!"_ZTSN6Device9prog_modeE", !7, i64 0}
!19 = !{!14, !12, i64 85}
!20 = !{i8 0, i8 2}
!21 = !{}
!22 = !{!14, !6, i64 8}
!23 = !{!14, !12, i64 86}
!24 = !{!25, !25, i64 0}
!25 = !{!"_ZTSN4Jtag10tapState_tE", !7, i64 0}
!26 = distinct !{!26, !27}
!27 = !{!"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.AnlogicBitParser = type <{ %class.ConfigBitstreamParser, i8, [7 x i8] }>
%class.ConfigBitstreamParser = type { ptr, %"class.std::__cxx11::basic_string", i32, i32, i8, %"class.std::vector", %"class.std::__cxx11::basic_string", %"class.std::map.81" }
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<unsigned char, std::allocator<unsigned char>>::_Vector_impl" }
%"struct.std::_Vector_base<unsigned char, std::allocator<unsigned char>>::_Vector_impl" = type { %"struct.std::_Vector_base<unsigned char, std::allocator<unsigned char>>::_Vector_impl_data" }
%"struct.std::_Vector_base<unsigned char, std::allocator<unsigned char>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::__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::map.81" = type { %"class.std::_Rb_tree.82" }
%"class.std::_Rb_tree.82" = type { %"struct.std::_Rb_tree<std::__cxx11::basic_string<char>, std::pair<const std::__cxx11::basic_string<char>, std::__cxx11::basic_string<char>>, std::_Select1st<std::pair<const std::__cxx11::basic_string<char>, std::__cxx11::basic_string<char>>>, 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>, std::__cxx11::basic_string<char>>, std::_Select1st<std::pair<const std::__cxx11::basic_string<char>, std::__cxx11::basic_string<char>>>, 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.std::allocator.0" = type { i8 }
%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.572 = external hidden unnamed_addr constant [12 x i8], align 1
@.str.573 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.574 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.575 = 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 void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32)) unnamed_addr #1 align 2

declare noundef i32 @_ZN4Jtag7shiftIREhiNS_10tapState_tE(ptr noundef nonnull align 8 dereferenceable(193), i8 noundef zeroext, i32 noundef, i32 noundef) local_unnamed_addr #3

declare void @_ZN4Jtag9toggleClkEi(ptr noundef nonnull align 8 dereferenceable(193), i32 noundef) local_unnamed_addr #3

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN7Anlogic7programEjb(ptr noundef nonnull align 8 dereferenceable(144) %0, i32 noundef %1, i1 noundef zeroext %2) unnamed_addr #2 align 2 personality ptr @__gxx_personality_v0 {
  %4 = alloca %class.AnlogicBitParser, align 8
  %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::__cxx11::basic_string", align 8
  %10 = alloca %"class.std::allocator.0", align 1
  %11 = alloca %class.ProgressBar, align 8
  %12 = alloca %"class.std::__cxx11::basic_string", align 8
  %13 = alloca %"class.std::allocator.0", align 1
  %14 = getelementptr inbounds i8, ptr %0, i64 80
  %15 = load i32, ptr %14, align 8, !tbaa !5
  %16 = icmp eq i32 %15, 0
  br i1 %16, label %151, label %17

17:                                               ; preds = %3
  call void @llvm.lifetime.start.p0(i64 168, ptr nonnull %4) #7
  %18 = getelementptr inbounds i8, ptr %0, i64 16
  %19 = icmp eq i32 %15, 2
  %20 = getelementptr inbounds i8, ptr %0, i64 85
  %21 = load i8, ptr %20, align 1, !tbaa !15, !range !16, !noundef !17
  %22 = trunc nuw i8 %21 to i1
  call void @_ZN16AnlogicBitParserC1ERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEbb(ptr noundef nonnull align 8 dereferenceable(161) %4, ptr noundef nonnull align 8 dereferenceable(32) %18, i1 noundef zeroext %19, i1 noundef zeroext %22)
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %5) #7
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %6) #7
  call void @_ZNSaIcEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %6) #7
  invoke void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_(ptr noundef nonnull align 8 dereferenceable(32) %5, ptr noundef nonnull @.str.572, ptr noundef nonnull align 1 dereferenceable(1) %6)
          to label %23 unwind label %31

23:                                               ; preds = %17
  invoke void @_Z9printInfoRKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEb(ptr noundef nonnull align 8 dereferenceable(32) %5, i1 noundef zeroext false)
          to label %24 unwind label %33

24:                                               ; preds = %23
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %5) #7
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %6) #7
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %6) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %5) #7
  %25 = invoke noundef i32 @_ZN16AnlogicBitParser5parseEv(ptr noundef nonnull align 8 dereferenceable(161) %4)
          to label %26 unwind label %36

26:                                               ; preds = %24
  %27 = icmp eq i32 %25, 1
  br i1 %27, label %28, label %43

28:                                               ; preds = %26
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %7) #7
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %8) #7
  call void @_ZNSaIcEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %8) #7
  invoke void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_(ptr noundef nonnull align 8 dereferenceable(32) %7, ptr noundef nonnull @.str.573, ptr noundef nonnull align 1 dereferenceable(1) %8)
          to label %29 unwind label %38

29:                                               ; preds = %28
  invoke void @_Z10printErrorRKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEb(ptr noundef nonnull align 8 dereferenceable(32) %7, i1 noundef zeroext true)
          to label %30 unwind label %40

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

31:                                               ; preds = %17
  %32 = landingpad { ptr, i32 }
          cleanup
  br label %35

33:                                               ; preds = %23
  %34 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %5) #7
  br label %35

35:                                               ; preds = %33, %31
  %.pn = phi { ptr, i32 } [ %34, %33 ], [ %32, %31 ]
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %6) #7
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %6) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %5) #7
  br label %152

36:                                               ; preds = %48, %24
  %37 = landingpad { ptr, i32 }
          cleanup
  br label %152

38:                                               ; preds = %28
  %39 = landingpad { ptr, i32 }
          cleanup
  br label %42

40:                                               ; preds = %29
  %41 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %7) #7
  br label %42

42:                                               ; preds = %40, %38
  %.pn45 = phi { ptr, i32 } [ %41, %40 ], [ %39, %38 ]
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %8) #7
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %8) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %7) #7
  br label %152

43:                                               ; preds = %26
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %9) #7
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %10) #7
  call void @_ZNSaIcEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %10) #7
  invoke void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_(ptr noundef nonnull align 8 dereferenceable(32) %9, ptr noundef nonnull @.str.574, ptr noundef nonnull align 1 dereferenceable(1) %10)
          to label %44 unwind label %49

44:                                               ; preds = %43
  invoke void @_Z12printSuccessRKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEb(ptr noundef nonnull align 8 dereferenceable(32) %9, i1 noundef zeroext true)
          to label %45 unwind label %51

45:                                               ; preds = %44
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %9) #7
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %10) #7
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %10) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %9) #7
  %46 = load i8, ptr %20, align 1, !tbaa !15, !range !16, !noundef !17
  %47 = trunc nuw i8 %46 to i1
  br i1 %47, label %48, label %54

48:                                               ; preds = %45
  invoke void @_ZN21ConfigBitstreamParser13displayHeaderEv(ptr noundef nonnull align 8 dereferenceable(160) %4)
          to label %54 unwind label %36

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

51:                                               ; preds = %44
  %52 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %9) #7
  br label %53

53:                                               ; preds = %51, %49
  %.pn36 = phi { ptr, i32 } [ %52, %51 ], [ %50, %49 ]
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %10) #7
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %10) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %9) #7
  br label %152

54:                                               ; preds = %48, %45
  %55 = call noundef ptr @_ZNK21ConfigBitstreamParser7getDataEv(ptr noundef nonnull align 8 dereferenceable(160) %4)
  %56 = call noundef i32 @_ZN21ConfigBitstreamParser9getLengthEv(ptr noundef nonnull align 8 dereferenceable(160) %4)
  %57 = sdiv i32 %56, 8
  %58 = load i32, ptr %14, align 8, !tbaa !5
  switch i32 %58, label %150 [
    i32 1, label %59
    i32 2, label %64
  ]

59:                                               ; preds = %54
  %60 = getelementptr inbounds i8, ptr %0, i64 88
  %61 = invoke noundef zeroext i1 @_ZN12SPIInterface5writeEjPKhjb(ptr noundef nonnull align 8 dereferenceable(56) %60, i32 noundef %1, ptr noundef %55, i32 noundef %57, i1 noundef zeroext %2)
          to label %150 unwind label %62

62:                                               ; preds = %90, %87, %85, %82, %80, %77, %74, %71, %68, %64, %59
  %63 = landingpad { ptr, i32 }
          cleanup
  br label %152

64:                                               ; preds = %54
  %65 = getelementptr inbounds i8, ptr %0, i64 8
  %66 = load ptr, ptr %65, align 8, !tbaa !18
  %67 = invoke noundef i32 @_ZN4Jtag7shiftIREhiNS_10tapState_tE(ptr noundef nonnull align 8 dereferenceable(193) %66, i8 noundef zeroext -1, i32 noundef 8, i32 noundef 1)
          to label %68 unwind label %62

68:                                               ; preds = %64
  %69 = load ptr, ptr %65, align 8, !tbaa !18
  %70 = invoke noundef i32 @_ZN4Jtag7shiftIREhiNS_10tapState_tE(ptr noundef nonnull align 8 dereferenceable(193) %69, i8 noundef zeroext -1, i32 noundef 8, i32 noundef 1)
          to label %71 unwind label %62

71:                                               ; preds = %68
  %72 = load ptr, ptr %65, align 8, !tbaa !18
  %73 = invoke noundef i32 @_ZN4Jtag7shiftIREhiNS_10tapState_tE(ptr noundef nonnull align 8 dereferenceable(193) %72, i8 noundef zeroext 1, i32 noundef 8, i32 noundef 1)
          to label %74 unwind label %62

74:                                               ; preds = %71
  %75 = load ptr, ptr %65, align 8, !tbaa !18
  %76 = invoke noundef i32 @_ZN4Jtag7shiftIREhiNS_10tapState_tE(ptr noundef nonnull align 8 dereferenceable(193) %75, i8 noundef zeroext -1, i32 noundef 8, i32 noundef 1)
          to label %77 unwind label %62

77:                                               ; preds = %74
  %78 = load ptr, ptr %65, align 8, !tbaa !18
  %79 = invoke noundef i32 @_ZN4Jtag7shiftIREhiNS_10tapState_tE(ptr noundef nonnull align 8 dereferenceable(193) %78, i8 noundef zeroext 57, i32 noundef 8, i32 noundef 1)
          to label %80 unwind label %62

80:                                               ; preds = %77
  %81 = load ptr, ptr %65, align 8, !tbaa !18
  invoke void @_ZN4Jtag9toggleClkEi(ptr noundef nonnull align 8 dereferenceable(193) %81, i32 noundef 50000)
          to label %82 unwind label %62

82:                                               ; preds = %80
  %83 = load ptr, ptr %65, align 8, !tbaa !18
  %84 = invoke noundef i32 @_ZN4Jtag7shiftIREhiNS_10tapState_tE(ptr noundef nonnull align 8 dereferenceable(193) %83, i8 noundef zeroext 48, i32 noundef 8, i32 noundef 1)
          to label %85 unwind label %62

85:                                               ; preds = %82
  %86 = load ptr, ptr %65, align 8, !tbaa !18
  invoke void @_ZN4Jtag9toggleClkEi(ptr noundef nonnull align 8 dereferenceable(193) %86, i32 noundef 15)
          to label %87 unwind label %62

87:                                               ; preds = %85
  %88 = load ptr, ptr %65, align 8, !tbaa !18
  %89 = invoke noundef i32 @_ZN4Jtag7shiftIREhiNS_10tapState_tE(ptr noundef nonnull align 8 dereferenceable(193) %88, i8 noundef zeroext 59, i32 noundef 8, i32 noundef 1)
          to label %90 unwind label %62

90:                                               ; preds = %87
  %91 = load ptr, ptr %65, align 8, !tbaa !18
  invoke void @_ZN4Jtag9toggleClkEi(ptr noundef nonnull align 8 dereferenceable(193) %91, i32 noundef 15)
          to label %92 unwind label %62

92:                                               ; preds = %90
  call void @llvm.lifetime.start.p0(i64 56, ptr nonnull %11) #7
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %12) #7
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %13) #7
  call void @_ZNSaIcEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %13) #7
  invoke void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_(ptr noundef nonnull align 8 dereferenceable(32) %12, ptr noundef nonnull @.str.575, ptr noundef nonnull align 1 dereferenceable(1) %13)
          to label %93 unwind label %111

93:                                               ; preds = %92
  %94 = getelementptr inbounds i8, ptr %0, i64 86
  %95 = load i8, ptr %94, align 2, !tbaa !19, !range !16, !noundef !17
  %96 = trunc nuw i8 %95 to i1
  invoke void @_ZN11ProgressBarC1ERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEiib(ptr noundef nonnull align 8 dereferenceable(50) %11, ptr noundef nonnull align 8 dereferenceable(32) %12, i32 noundef %57, i32 noundef 50, i1 noundef zeroext %96)
          to label %97 unwind label %113

97:                                               ; preds = %93
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %12) #7
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %13) #7
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %13) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %12) #7
  %98 = icmp sgt i32 %56, 7
  br i1 %98, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %97, %106
  %.03150 = phi ptr [ %109, %106 ], [ %55, %97 ]
  %.03249 = phi i32 [ %107, %106 ], [ 0, %97 ]
  %.03348 = phi i32 [ %100, %106 ], [ %57, %97 ]
  %99 = call i32 @llvm.umin.i32(i32 %.03348, i32 512)
  %100 = sub nsw i32 %.03348, %99
  %.not = icmp eq i32 %100, 0
  %101 = select i1 %.not, i32 1, i32 4
  %102 = load ptr, ptr %65, align 8, !tbaa !18
  %103 = shl nuw nsw i32 %99, 3
  %104 = invoke noundef i32 @_ZN4Jtag7shiftDREPKhPhiNS_10tapState_tE(ptr noundef nonnull align 8 dereferenceable(193) %102, ptr noundef %.03150, ptr noundef null, i32 noundef %103, i32 noundef %101)
          to label %105 unwind label %116

105:                                              ; preds = %.lr.ph
  invoke void @_ZN11ProgressBar7displayEic(ptr noundef nonnull align 8 dereferenceable(50) %11, i32 noundef %.03249, i8 noundef signext 0)
          to label %106 unwind label %116

106:                                              ; preds = %105
  %107 = add nuw nsw i32 %.03249, %99
  %108 = zext nneg i32 %99 to i64
  %109 = getelementptr inbounds i8, ptr %.03150, i64 %108
  %110 = icmp sgt i32 %100, 0
  br i1 %110, label %.lr.ph, label %._crit_edge, !llvm.loop !20

111:                                              ; preds = %92
  %112 = landingpad { ptr, i32 }
          cleanup
  br label %115

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

115:                                              ; preds = %113, %111
  %.pn38 = phi { ptr, i32 } [ %114, %113 ], [ %112, %111 ]
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %13) #7
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %13) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %12) #7
  br label %149

116:                                              ; preds = %105, %.lr.ph
  %117 = landingpad { ptr, i32 }
          cleanup
  br label %148

._crit_edge:                                      ; preds = %106, %97
  invoke void @_ZN11ProgressBar4doneEv(ptr noundef nonnull align 8 dereferenceable(50) %11)
          to label %118 unwind label %146

118:                                              ; preds = %._crit_edge
  %119 = load ptr, ptr %65, align 8, !tbaa !18
  invoke void @_ZN4Jtag9toggleClkEi(ptr noundef nonnull align 8 dereferenceable(193) %119, i32 noundef 100)
          to label %120 unwind label %146

120:                                              ; preds = %118
  %121 = load ptr, ptr %65, align 8, !tbaa !18
  %122 = invoke noundef i32 @_ZN4Jtag7shiftIREhiNS_10tapState_tE(ptr noundef nonnull align 8 dereferenceable(193) %121, i8 noundef zeroext 61, i32 noundef 8, i32 noundef 1)
          to label %123 unwind label %146

123:                                              ; preds = %120
  %124 = load ptr, ptr %65, align 8, !tbaa !18
  invoke void @_ZN4Jtag9toggleClkEi(ptr noundef nonnull align 8 dereferenceable(193) %124, i32 noundef 15)
          to label %125 unwind label %146

125:                                              ; preds = %123
  %126 = load ptr, ptr %65, align 8, !tbaa !18
  %127 = invoke noundef i32 @_ZN4Jtag7shiftIREhiNS_10tapState_tE(ptr noundef nonnull align 8 dereferenceable(193) %126, i8 noundef zeroext -1, i32 noundef 8, i32 noundef 1)
          to label %128 unwind label %146

128:                                              ; preds = %125
  %129 = load ptr, ptr %65, align 8, !tbaa !18
  invoke void @_ZN4Jtag9toggleClkEi(ptr noundef nonnull align 8 dereferenceable(193) %129, i32 noundef 1000)
          to label %130 unwind label %146

130:                                              ; preds = %128
  %131 = load ptr, ptr %65, align 8, !tbaa !18
  %132 = invoke noundef i32 @_ZN4Jtag7shiftIREhiNS_10tapState_tE(ptr noundef nonnull align 8 dereferenceable(193) %131, i8 noundef zeroext 49, i32 noundef 8, i32 noundef 1)
          to label %133 unwind label %146

133:                                              ; preds = %130
  %134 = load ptr, ptr %65, align 8, !tbaa !18
  invoke void @_ZN4Jtag9toggleClkEi(ptr noundef nonnull align 8 dereferenceable(193) %134, i32 noundef 100)
          to label %135 unwind label %146

135:                                              ; preds = %133
  %136 = load ptr, ptr %65, align 8, !tbaa !18
  %137 = invoke noundef i32 @_ZN4Jtag7shiftIREhiNS_10tapState_tE(ptr noundef nonnull align 8 dereferenceable(193) %136, i8 noundef zeroext 61, i32 noundef 8, i32 noundef 1)
          to label %138 unwind label %146

138:                                              ; preds = %135
  %139 = load ptr, ptr %65, align 8, !tbaa !18
  invoke void @_ZN4Jtag9toggleClkEi(ptr noundef nonnull align 8 dereferenceable(193) %139, i32 noundef 15)
          to label %140 unwind label %146

140:                                              ; preds = %138
  %141 = load ptr, ptr %65, align 8, !tbaa !18
  %142 = invoke noundef i32 @_ZN4Jtag7shiftIREhiNS_10tapState_tE(ptr noundef nonnull align 8 dereferenceable(193) %141, i8 noundef zeroext -1, i32 noundef 8, i32 noundef 1)
          to label %143 unwind label %146

143:                                              ; preds = %140
  %144 = load ptr, ptr %65, align 8, !tbaa !18
  invoke void @_ZN4Jtag9toggleClkEi(ptr noundef nonnull align 8 dereferenceable(193) %144, i32 noundef 15)
          to label %145 unwind label %146

145:                                              ; preds = %143
  call void @_ZN11ProgressBarD2Ev(ptr noundef nonnull align 8 dereferenceable(50) %11) #7
  call void @llvm.lifetime.end.p0(i64 56, ptr nonnull %11) #7
  br label %150

146:                                              ; preds = %143, %140, %138, %135, %133, %130, %128, %125, %123, %120, %118, %._crit_edge
  %147 = landingpad { ptr, i32 }
          cleanup
  br label %148

148:                                              ; preds = %146, %116
  %.pn40 = phi { ptr, i32 } [ %117, %116 ], [ %147, %146 ]
  call void @_ZN11ProgressBarD2Ev(ptr noundef nonnull align 8 dereferenceable(50) %11) #7
  br label %149

149:                                              ; preds = %148, %115
  %.pn40.pn = phi { ptr, i32 } [ %.pn40, %148 ], [ %.pn38, %115 ]
  call void @llvm.lifetime.end.p0(i64 56, ptr nonnull %11) #7
  br label %152

150:                                              ; preds = %59, %54, %145, %30
  call void @_ZN16AnlogicBitParserD1Ev(ptr noundef nonnull align 8 dereferenceable(161) %4) #7
  call void @llvm.lifetime.end.p0(i64 168, ptr nonnull %4) #7
  br label %151

151:                                              ; preds = %3, %150
  ret void

152:                                              ; preds = %62, %149, %53, %42, %36, %35
  %.pn45.pn = phi { ptr, i32 } [ %.pn45, %42 ], [ %37, %36 ], [ %.pn36, %53 ], [ %.pn, %35 ], [ %63, %62 ], [ %.pn40.pn, %149 ]
  call void @_ZN16AnlogicBitParserD1Ev(ptr noundef nonnull align 8 dereferenceable(161) %4) #7
  call void @llvm.lifetime.end.p0(i64 168, ptr nonnull %4) #7
  resume { ptr, i32 } %.pn45.pn
}

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

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

declare noundef i32 @_ZN16AnlogicBitParser5parseEv(ptr noundef nonnull align 8 dereferenceable(161)) unnamed_addr #3

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

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

declare void @_ZN21ConfigBitstreamParser13displayHeaderEv(ptr noundef nonnull align 8 dereferenceable(160)) unnamed_addr #3

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

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

declare noundef zeroext i1 @_ZN12SPIInterface5writeEjPKhjb(ptr noundef nonnull align 8 dereferenceable(56), i32 noundef, ptr noundef, i32 noundef, i1 noundef zeroext) local_unnamed_addr #3

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 noundef i32 @_ZN4Jtag7shiftDREPKhPhiNS_10tapState_tE(ptr noundef nonnull align 8 dereferenceable(193), ptr noundef, ptr noundef, i32 noundef, i32 noundef) local_unnamed_addr #3

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 #4 align 2

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

; 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: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.umin.i32(i32, i32) #6

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 = { 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 "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #7 = { 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, !13, i64 80}
!6 = !{!"_ZTS6Device", !7, i64 8, !10, i64 16, !10, i64 48, !13, i64 80, !14, i64 84, !14, i64 85, !14, i64 86}
!7 = !{!"any pointer", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE", !11, i64 0, !12, i64 8, !8, i64 16}
!11 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_Alloc_hiderE", !7, i64 0}
!12 = !{!"long", !8, i64 0}
!13 = !{!"_ZTSN6Device9prog_modeE", !8, i64 0}
!14 = !{!"bool", !8, i64 0}
!15 = !{!6, !14, i64 85}
!16 = !{i8 0, i8 2}
!17 = !{}
!18 = !{!6, !7, i64 8}
!19 = !{!6, !14, i64 86}
!20 = distinct !{!20, !21}
!21 = !{!"llvm.loop.mustprogress"}


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