; LLVM IR from trabucayre/openFPGALoader :: src (lattice)

; 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.ProgressBar = type <{ %"class.std::__cxx11::basic_string", i32, i32, %"class.std::chrono::time_point", i8, i8, [6 x i8] }>
%"class.std::__cxx11::basic_string" = type { %"struct.std::__cxx11::basic_string<char>::_Alloc_hider", i64, %union.anon }
%"struct.std::__cxx11::basic_string<char>::_Alloc_hider" = type { ptr }
%union.anon = type { i64, [8 x i8] }
%"class.std::chrono::time_point" = type { %"class.std::chrono::duration" }
%"class.std::chrono::duration" = type { i64 }
%"class.std::allocator.0" = type { i8 }
%class.Lattice = type { %class.Device.base, %class.SPIInterface, i32, i32 }
%class.Device.base = type <{ ptr, ptr, %"class.std::__cxx11::basic_string", %"class.std::__cxx11::basic_string", i32, i8, i8, i8 }>
%class.SPIInterface = type { ptr, i8, i32, i8, i8, i8, %"class.std::__cxx11::basic_string" }
%class.Device = type <{ ptr, ptr, %"class.std::__cxx11::basic_string", %"class.std::__cxx11::basic_string", i32, i8, i8, i8, i8 }>

@.str.716 = external hidden unnamed_addr constant [10 x i8], align 1
@.str.717 = external hidden unnamed_addr constant [24 x i8], align 1
@.str.718 = external hidden unnamed_addr constant [16 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 nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #3

; 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 i32 @printf(ptr noundef, ...) #4

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

declare void @_ZN4Jtag9set_stateENS_10tapState_tEh(ptr noundef nonnull align 8 dereferenceable(193), i32 noundef, i8 noundef zeroext) #4

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZN7Lattice9EnableISCEh(ptr noundef nonnull align 8 dereferenceable(152), i8 noundef zeroext) #2 align 2

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

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

declare noundef i32 @_ZN4Jtag7shiftDREPKhPhiNS_10tapState_tE(ptr noundef nonnull align 8 dereferenceable(193), ptr noundef, ptr noundef, i32 noundef, i32 noundef) #4

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

declare void @_ZN11ProgressBar4failEv(ptr noundef nonnull align 8 dereferenceable(50)) #4

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

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

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

; Function Attrs: mustprogress uwtable
define dso_local noundef zeroext i1 @_ZN7Lattice6VerifyESt6vectorINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESaIS6_EEbj(ptr noundef nonnull align 8 dereferenceable(152) %0, ptr noundef %1, i1 noundef zeroext %2, i32 noundef %3) #2 align 2 personality ptr @__gxx_personality_v0 {
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca i8, align 1
  %8 = alloca i32, align 4
  %9 = alloca [16 x i8], align 16
  %10 = alloca [16 x i8], align 16
  %11 = alloca [2 x i8], align 1
  %12 = alloca i8, align 1
  %13 = alloca %class.ProgressBar, align 8
  %14 = alloca %"class.std::__cxx11::basic_string", align 8
  %15 = alloca %"class.std::allocator.0", align 1
  %16 = alloca ptr, align 8
  %17 = alloca i32, align 4
  %18 = alloca i64, align 8
  %19 = alloca i32, align 4
  %20 = alloca i64, align 8
  store ptr %0, ptr %5, align 8, !tbaa !5
  store ptr %1, ptr %6, align 8, !tbaa !5
  %21 = zext i1 %2 to i8
  store i8 %21, ptr %7, align 1, !tbaa !9
  store i32 %3, ptr %8, align 4, !tbaa !11
  %22 = load ptr, ptr %5, align 8
  call void @llvm.lifetime.start.p0(i64 16, ptr %9) #6
  call void @llvm.lifetime.start.p0(i64 16, ptr %10) #6
  %23 = load i8, ptr %7, align 1, !tbaa !9, !range !13, !noundef !14
  %24 = trunc i8 %23 to i1
  br i1 %24, label %25, label %27

25:                                               ; preds = %4
  %26 = call noundef zeroext i1 @_ZN7Lattice9EnableISCEh(ptr noundef nonnull align 8 dereferenceable(152) %22, i8 noundef zeroext 8)
  br label %27

27:                                               ; preds = %25, %4
  %28 = getelementptr inbounds %class.Lattice, ptr %22, i32 0, i32 2
  %29 = load i32, ptr %28, align 8, !tbaa !15
  %30 = icmp eq i32 %29, 2
  br i1 %30, label %31, label %43

31:                                               ; preds = %27
  call void @llvm.lifetime.start.p0(i64 2, ptr %11) #6
  %32 = load i32, ptr %8, align 4, !tbaa !11
  %33 = lshr i32 %32, 8
  %34 = and i32 %33, 255
  %35 = trunc i32 %34 to i8
  store i8 %35, ptr %11, align 1, !tbaa !25
  %36 = getelementptr inbounds i8, ptr %11, i64 1
  %37 = load i32, ptr %8, align 4, !tbaa !11
  %38 = lshr i32 %37, 16
  %39 = and i32 %38, 255
  %40 = trunc i32 %39 to i8
  store i8 %40, ptr %36, align 1, !tbaa !25
  %41 = getelementptr inbounds [2 x i8], ptr %11, i64 0, i64 0
  %42 = call noundef zeroext i1 @_ZN7Lattice5wr_rdEhPhiS0_ib(ptr noundef nonnull align 8 dereferenceable(152) %22, i8 noundef zeroext 70, ptr noundef %41, i32 noundef 2, ptr noundef null, i32 noundef 0, i1 noundef zeroext false)
  call void @llvm.lifetime.end.p0(i64 2, ptr %11) #6
  br label %45

43:                                               ; preds = %27
  %44 = call noundef zeroext i1 @_ZN7Lattice5wr_rdEhPhiS0_ib(ptr noundef nonnull align 8 dereferenceable(152) %22, i8 noundef zeroext 70, ptr noundef null, i32 noundef 0, ptr noundef null, i32 noundef 0, i1 noundef zeroext false)
  br label %45

45:                                               ; preds = %43, %31
  %46 = getelementptr inbounds %class.Device, ptr %22, i32 0, i32 1
  %47 = load ptr, ptr %46, align 8, !tbaa !26
  call void @_ZN4Jtag9set_stateENS_10tapState_tEh(ptr noundef nonnull align 8 dereferenceable(193) %47, i32 noundef 1, i8 noundef zeroext 1)
  %48 = getelementptr inbounds %class.Device, ptr %22, i32 0, i32 1
  %49 = load ptr, ptr %48, align 8, !tbaa !26
  call void @_ZN4Jtag9toggleClkEi(ptr noundef nonnull align 8 dereferenceable(193) %49, i32 noundef 1000)
  %50 = getelementptr inbounds [16 x i8], ptr %9, i64 0, i64 0
  store i8 115, ptr %50, align 16, !tbaa !25
  %51 = getelementptr inbounds %class.Device, ptr %22, i32 0, i32 1
  %52 = load ptr, ptr %51, align 8, !tbaa !26
  %53 = getelementptr inbounds [16 x i8], ptr %9, i64 0, i64 0
  %54 = call noundef i32 @_ZN4Jtag7shiftIREPhS0_iNS_10tapState_tE(ptr noundef nonnull align 8 dereferenceable(193) %52, ptr noundef %53, ptr noundef null, i32 noundef 8, i32 noundef 13)
  %55 = getelementptr inbounds [16 x i8], ptr %9, i64 0, i64 0
  call void @llvm.memset.p0.i64(ptr align 16 %55, i8 0, i64 16, i1 false)
  call void @llvm.lifetime.start.p0(i64 1, ptr %12) #6
  store i8 0, ptr %12, align 1, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 56, ptr %13) #6
  call void @llvm.lifetime.start.p0(i64 32, ptr %14) #6
  call void @llvm.lifetime.start.p0(i64 1, ptr %15) #6
  call void @_ZNSaIcEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %15) #6
  invoke void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_(ptr noundef nonnull align 8 dereferenceable(32) %14, ptr noundef @.str.716, ptr noundef nonnull align 1 dereferenceable(1) %15)
          to label %56 unwind label %68

56:                                               ; preds = %45
  %57 = call noundef i64 @_ZNKSt6vectorINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESaIS5_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %1) #6
  %58 = trunc i64 %57 to i32
  %59 = getelementptr inbounds %class.Device, ptr %22, i32 0, i32 7
  %60 = load i8, ptr %59, align 2, !tbaa !27, !range !13, !noundef !14
  %61 = trunc i8 %60 to i1
  invoke void @_ZN11ProgressBarC1ERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEiib(ptr noundef nonnull align 8 dereferenceable(50) %13, ptr noundef nonnull align 8 dereferenceable(32) %14, i32 noundef %58, i32 noundef 50, i1 noundef zeroext %61)
          to label %62 unwind label %72

62:                                               ; preds = %56
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %14) #6
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %15) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr %15) #6
  call void @llvm.lifetime.end.p0(i64 32, ptr %14) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #6
  store i64 0, ptr %18, align 8, !tbaa !28
  br label %63

63:                                               ; preds = %148, %62
  %64 = load i64, ptr %18, align 8, !tbaa !28
  %65 = call noundef i64 @_ZNKSt6vectorINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESaIS5_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %1) #6
  %66 = icmp ult i64 %64, %65
  br i1 %66, label %77, label %67

67:                                               ; preds = %63
  store i32 2, ptr %19, align 4
  br label %151

68:                                               ; preds = %45
  %69 = landingpad { ptr, i32 }
          cleanup
  %70 = extractvalue { ptr, i32 } %69, 0
  store ptr %70, ptr %16, align 8
  %71 = extractvalue { ptr, i32 } %69, 1
  store i32 %71, ptr %17, align 4
  br label %76

72:                                               ; preds = %56
  %73 = landingpad { ptr, i32 }
          cleanup
  %74 = extractvalue { ptr, i32 } %73, 0
  store ptr %74, ptr %16, align 8
  %75 = extractvalue { ptr, i32 } %73, 1
  store i32 %75, ptr %17, align 4
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %14) #6
  br label %76

76:                                               ; preds = %72, %68
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %15) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr %15) #6
  call void @llvm.lifetime.end.p0(i64 32, ptr %14) #6
  br label %175

77:                                               ; preds = %63
  %78 = getelementptr inbounds %class.Device, ptr %22, i32 0, i32 1
  %79 = load ptr, ptr %78, align 8, !tbaa !26
  invoke void @_ZN4Jtag9set_stateENS_10tapState_tEh(ptr noundef nonnull align 8 dereferenceable(193) %79, i32 noundef 1, i8 noundef zeroext 1)
          to label %80 unwind label %97

80:                                               ; preds = %77
  %81 = getelementptr inbounds %class.Device, ptr %22, i32 0, i32 1
  %82 = load ptr, ptr %81, align 8, !tbaa !26
  invoke void @_ZN4Jtag9toggleClkEi(ptr noundef nonnull align 8 dereferenceable(193) %82, i32 noundef 2)
          to label %83 unwind label %97

83:                                               ; preds = %80
  %84 = getelementptr inbounds %class.Device, ptr %22, i32 0, i32 1
  %85 = load ptr, ptr %84, align 8, !tbaa !26
  %86 = getelementptr inbounds [16 x i8], ptr %9, i64 0, i64 0
  %87 = getelementptr inbounds [16 x i8], ptr %10, i64 0, i64 0
  %88 = invoke noundef i32 @_ZN4Jtag7shiftDREPKhPhiNS_10tapState_tE(ptr noundef nonnull align 8 dereferenceable(193) %85, ptr noundef %86, ptr noundef %87, i32 noundef 128, i32 noundef 6)
          to label %89 unwind label %97

89:                                               ; preds = %83
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #6
  store i64 0, ptr %20, align 8, !tbaa !28
  br label %90

90:                                               ; preds = %135, %89
  %91 = load i64, ptr %20, align 8, !tbaa !28
  %92 = load i64, ptr %18, align 8, !tbaa !28
  %93 = call noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt6vectorINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESaIS5_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %1, i64 noundef %92) #6
  %94 = call noundef i64 @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(32) %93) #6
  %95 = icmp ult i64 %91, %94
  br i1 %95, label %101, label %96

96:                                               ; preds = %90
  store i32 5, ptr %19, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #6
  br label %138

97:                                               ; preds = %144, %141, %83, %80, %77
  %98 = landingpad { ptr, i32 }
          cleanup
  %99 = extractvalue { ptr, i32 } %98, 0
  store ptr %99, ptr %16, align 8
  %100 = extractvalue { ptr, i32 } %98, 1
  store i32 %100, ptr %17, align 4
  br label %152

101:                                              ; preds = %90
  %102 = load i64, ptr %20, align 8, !tbaa !28
  %103 = getelementptr inbounds [16 x i8], ptr %10, i64 0, i64 %102
  %104 = load i8, ptr %103, align 1, !tbaa !25
  %105 = zext i8 %104 to i32
  %106 = load i64, ptr %18, align 8, !tbaa !28
  %107 = call noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt6vectorINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESaIS5_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %1, i64 noundef %106) #6
  %108 = load i64, ptr %20, align 8, !tbaa !28
  %109 = invoke noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %107, i64 noundef %108)
          to label %110 unwind label %130

110:                                              ; preds = %101
  %111 = load i8, ptr %109, align 1, !tbaa !25
  %112 = zext i8 %111 to i32
  %113 = icmp ne i32 %105, %112
  br i1 %113, label %114, label %134

114:                                              ; preds = %110
  %115 = load i64, ptr %18, align 8, !tbaa !28
  %116 = load i64, ptr %20, align 8, !tbaa !28
  %117 = load i64, ptr %20, align 8, !tbaa !28
  %118 = getelementptr inbounds [16 x i8], ptr %10, i64 0, i64 %117
  %119 = load i8, ptr %118, align 1, !tbaa !25
  %120 = zext i8 %119 to i32
  %121 = load i64, ptr %18, align 8, !tbaa !28
  %122 = call noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt6vectorINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESaIS5_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %1, i64 noundef %121) #6
  %123 = load i64, ptr %20, align 8, !tbaa !28
  %124 = invoke noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %122, i64 noundef %123)
          to label %125 unwind label %130

125:                                              ; preds = %114
  %126 = load i8, ptr %124, align 1, !tbaa !25
  %127 = zext i8 %126 to i32
  %128 = invoke i32 (ptr, ...) @printf(ptr noundef @.str.717, i64 noundef %115, i64 noundef %116, i32 noundef %120, i32 noundef %127)
          to label %129 unwind label %130

129:                                              ; preds = %125
  store i8 1, ptr %12, align 1, !tbaa !9
  br label %134

130:                                              ; preds = %125, %114, %101
  %131 = landingpad { ptr, i32 }
          cleanup
  %132 = extractvalue { ptr, i32 } %131, 0
  store ptr %132, ptr %16, align 8
  %133 = extractvalue { ptr, i32 } %131, 1
  store i32 %133, ptr %17, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #6
  br label %152

134:                                              ; preds = %129, %110
  br label %135

135:                                              ; preds = %134
  %136 = load i64, ptr %20, align 8, !tbaa !28
  %137 = add i64 %136, 1
  store i64 %137, ptr %20, align 8, !tbaa !28
  br label %90, !llvm.loop !29

138:                                              ; preds = %96
  %139 = load i8, ptr %12, align 1, !tbaa !9, !range !13, !noundef !14
  %140 = trunc i8 %139 to i1
  br i1 %140, label %141, label %144

141:                                              ; preds = %138
  %142 = invoke i32 (ptr, ...) @printf(ptr noundef @.str.718)
          to label %143 unwind label %97

143:                                              ; preds = %141
  store i32 2, ptr %19, align 4
  br label %151

144:                                              ; preds = %138
  %145 = load i64, ptr %18, align 8, !tbaa !28
  %146 = trunc i64 %145 to i32
  invoke void @_ZN11ProgressBar7displayEic(ptr noundef nonnull align 8 dereferenceable(50) %13, i32 noundef %146, i8 noundef signext 0)
          to label %147 unwind label %97

147:                                              ; preds = %144
  br label %148

148:                                              ; preds = %147
  %149 = load i64, ptr %18, align 8, !tbaa !28
  %150 = add i64 %149, 1
  store i64 %150, ptr %18, align 8, !tbaa !28
  br label %63, !llvm.loop !31

151:                                              ; preds = %143, %67
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #6
  br label %153

152:                                              ; preds = %130, %97
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #6
  br label %174

153:                                              ; preds = %151
  %154 = load i8, ptr %7, align 1, !tbaa !9, !range !13, !noundef !14
  %155 = trunc i8 %154 to i1
  br i1 %155, label %156, label %163

156:                                              ; preds = %153
  %157 = invoke noundef zeroext i1 @_ZN7Lattice10DisableISCEv(ptr noundef nonnull align 8 dereferenceable(152) %22)
          to label %158 unwind label %159

158:                                              ; preds = %156
  br label %163

159:                                              ; preds = %168, %166, %156
  %160 = landingpad { ptr, i32 }
          cleanup
  %161 = extractvalue { ptr, i32 } %160, 0
  store ptr %161, ptr %16, align 8
  %162 = extractvalue { ptr, i32 } %160, 1
  store i32 %162, ptr %17, align 4
  br label %174

163:                                              ; preds = %158, %153
  %164 = load i8, ptr %12, align 1, !tbaa !9, !range !13, !noundef !14
  %165 = trunc i8 %164 to i1
  br i1 %165, label %166, label %168

166:                                              ; preds = %163
  invoke void @_ZN11ProgressBar4failEv(ptr noundef nonnull align 8 dereferenceable(50) %13)
          to label %167 unwind label %159

167:                                              ; preds = %166
  br label %170

168:                                              ; preds = %163
  invoke void @_ZN11ProgressBar4doneEv(ptr noundef nonnull align 8 dereferenceable(50) %13)
          to label %169 unwind label %159

169:                                              ; preds = %168
  br label %170

170:                                              ; preds = %169, %167
  %171 = load i8, ptr %12, align 1, !tbaa !9, !range !13, !noundef !14
  %172 = trunc i8 %171 to i1
  %173 = xor i1 %172, true
  store i32 1, ptr %19, align 4
  call void @_ZN11ProgressBarD2Ev(ptr noundef nonnull align 8 dereferenceable(50) %13) #6
  call void @llvm.lifetime.end.p0(i64 56, ptr %13) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr %12) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr %10) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr %9) #6
  ret i1 %173

174:                                              ; preds = %159, %152
  call void @_ZN11ProgressBarD2Ev(ptr noundef nonnull align 8 dereferenceable(50) %13) #6
  br label %175

175:                                              ; preds = %174, %76
  call void @llvm.lifetime.end.p0(i64 56, ptr %13) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr %12) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr %10) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr %9) #6
  br label %176

176:                                              ; preds = %175
  %177 = load ptr, ptr %16, align 8
  %178 = load i32, ptr %17, align 4
  %179 = insertvalue { ptr, i32 } poison, ptr %177, 0
  %180 = insertvalue { ptr, i32 } %179, i32 %178, 1
  resume { ptr, i32 } %180
}

declare noundef i32 @_ZN4Jtag7shiftIREPhS0_iNS_10tapState_tE(ptr noundef nonnull align 8 dereferenceable(193), ptr noundef, ptr noundef, i32 noundef, i32 noundef) #4

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt6vectorINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESaIS5_EEixEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) #1 align 2

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

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

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

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"bool", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"int", !7, i64 0}
!13 = !{i8 0, i8 2}
!14 = !{}
!15 = !{!16, !23, i64 144}
!16 = !{!"_ZTS7Lattice", !17, i64 0, !22, i64 88, !23, i64 144, !24, i64 148}
!17 = !{!"_ZTS6Device", !6, i64 8, !18, i64 16, !18, i64 48, !21, i64 80, !10, i64 84, !10, i64 85, !10, i64 86}
!18 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE", !19, i64 0, !20, i64 8, !7, i64 16}
!19 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_Alloc_hiderE", !6, i64 0}
!20 = !{!"long", !7, i64 0}
!21 = !{!"_ZTSN6Device9prog_modeE", !7, i64 0}
!22 = !{!"_ZTS12SPIInterface", !7, i64 8, !12, i64 12, !10, i64 16, !10, i64 17, !10, i64 18, !18, i64 24}
!23 = !{!"_ZTSN7Lattice16lattice_family_tE", !7, i64 0}
!24 = !{!"_ZTSN7Lattice22lattice_flash_sector_tE", !7, i64 0}
!25 = !{!7, !7, i64 0}
!26 = !{!17, !6, i64 8}
!27 = !{!17, !10, i64 86}
!28 = !{!20, !20, i64 0}
!29 = distinct !{!29, !30}
!30 = !{!"llvm.loop.mustprogress"}
!31 = distinct !{!31, !30}


; 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.ProgressBar = type <{ %"class.std::__cxx11::basic_string", i32, i32, %"class.std::chrono::time_point", i8, i8, [6 x i8] }>
%"class.std::__cxx11::basic_string" = type { %"struct.std::__cxx11::basic_string<char>::_Alloc_hider", i64, %union.anon }
%"struct.std::__cxx11::basic_string<char>::_Alloc_hider" = type { ptr }
%union.anon = type { i64, [8 x i8] }
%"class.std::chrono::time_point" = type { %"class.std::chrono::duration" }
%"class.std::chrono::duration" = type { i64 }
%"class.std::allocator.0" = type { i8 }

@.str.716 = external hidden unnamed_addr constant [10 x i8], align 1
@.str.717 = external hidden unnamed_addr constant [24 x i8], align 1
@.str.718 = external hidden unnamed_addr constant [16 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 nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #3

; 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

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

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

declare void @_ZN4Jtag9set_stateENS_10tapState_tEh(ptr noundef nonnull align 8 dereferenceable(193), i32 noundef, i8 noundef zeroext) local_unnamed_addr #5

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZN7Lattice9EnableISCEh(ptr noundef nonnull align 8 dereferenceable(152), i8 noundef zeroext) local_unnamed_addr #2 align 2

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

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

declare noundef i32 @_ZN4Jtag7shiftDREPKhPhiNS_10tapState_tE(ptr noundef nonnull align 8 dereferenceable(193), ptr noundef, ptr noundef, i32 noundef, i32 noundef) local_unnamed_addr #5

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

declare void @_ZN11ProgressBar4failEv(ptr noundef nonnull align 8 dereferenceable(50)) local_unnamed_addr #5

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

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

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

; Function Attrs: mustprogress uwtable
define dso_local noundef zeroext i1 @_ZN7Lattice6VerifyESt6vectorINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESaIS6_EEbj(ptr noundef nonnull align 8 dereferenceable(152) %0, ptr noundef %1, i1 noundef zeroext %2, i32 noundef %3) local_unnamed_addr #2 align 2 personality ptr @__gxx_personality_v0 {
  %5 = alloca [16 x i8], align 16
  %6 = alloca [16 x i8], align 16
  %7 = alloca [2 x i8], align 1
  %8 = alloca %class.ProgressBar, align 8
  %9 = alloca %"class.std::__cxx11::basic_string", align 8
  %10 = alloca %"class.std::allocator.0", align 1
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %5) #7
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %6) #7
  br i1 %2, label %11, label %13

11:                                               ; preds = %4
  %12 = tail call noundef zeroext i1 @_ZN7Lattice9EnableISCEh(ptr noundef nonnull align 8 dereferenceable(152) %0, i8 noundef zeroext 8)
  br label %13

13:                                               ; preds = %11, %4
  %14 = getelementptr inbounds i8, ptr %0, i64 144
  %15 = load i32, ptr %14, align 8, !tbaa !5
  %16 = icmp eq i32 %15, 2
  br i1 %16, label %17, label %24

17:                                               ; preds = %13
  call void @llvm.lifetime.start.p0(i64 2, ptr nonnull %7) #7
  %18 = lshr i32 %3, 8
  %19 = trunc i32 %18 to i8
  store i8 %19, ptr %7, align 1, !tbaa !20
  %20 = getelementptr inbounds i8, ptr %7, i64 1
  %21 = lshr i32 %3, 16
  %22 = trunc i32 %21 to i8
  store i8 %22, ptr %20, align 1, !tbaa !20
  %23 = call noundef zeroext i1 @_ZN7Lattice5wr_rdEhPhiS0_ib(ptr noundef nonnull align 8 dereferenceable(152) %0, i8 noundef zeroext 70, ptr noundef nonnull %7, i32 noundef 2, ptr noundef null, i32 noundef 0, i1 noundef zeroext false)
  call void @llvm.lifetime.end.p0(i64 2, ptr nonnull %7) #7
  br label %26

24:                                               ; preds = %13
  %25 = tail call noundef zeroext i1 @_ZN7Lattice5wr_rdEhPhiS0_ib(ptr noundef nonnull align 8 dereferenceable(152) %0, i8 noundef zeroext 70, ptr noundef null, i32 noundef 0, ptr noundef null, i32 noundef 0, i1 noundef zeroext false)
  br label %26

26:                                               ; preds = %24, %17
  %27 = getelementptr inbounds i8, ptr %0, i64 8
  %28 = load ptr, ptr %27, align 8, !tbaa !21
  call void @_ZN4Jtag9set_stateENS_10tapState_tEh(ptr noundef nonnull align 8 dereferenceable(193) %28, i32 noundef 1, i8 noundef zeroext 1)
  %29 = load ptr, ptr %27, align 8, !tbaa !21
  call void @_ZN4Jtag9toggleClkEi(ptr noundef nonnull align 8 dereferenceable(193) %29, i32 noundef 1000)
  store i8 115, ptr %5, align 16, !tbaa !20
  %30 = load ptr, ptr %27, align 8, !tbaa !21
  %31 = call noundef i32 @_ZN4Jtag7shiftIREPhS0_iNS_10tapState_tE(ptr noundef nonnull align 8 dereferenceable(193) %30, ptr noundef nonnull %5, ptr noundef null, i32 noundef 8, i32 noundef 13)
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(16) %5, i8 0, i64 16, i1 false)
  call void @llvm.lifetime.start.p0(i64 56, ptr nonnull %8) #7
  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.716, ptr noundef nonnull align 1 dereferenceable(1) %10)
          to label %32 unwind label %40

32:                                               ; preds = %26
  %33 = call noundef i64 @_ZNKSt6vectorINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESaIS5_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %1) #7
  %34 = trunc i64 %33 to i32
  %35 = getelementptr inbounds i8, ptr %0, i64 86
  %36 = load i8, ptr %35, align 2, !tbaa !22, !range !23, !noundef !24
  %37 = trunc nuw i8 %36 to i1
  invoke void @_ZN11ProgressBarC1ERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEiib(ptr noundef nonnull align 8 dereferenceable(50) %8, ptr noundef nonnull align 8 dereferenceable(32) %9, i32 noundef %34, i32 noundef 50, i1 noundef zeroext %37)
          to label %38 unwind label %42

38:                                               ; preds = %32
  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
  %39 = call noundef i64 @_ZNKSt6vectorINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESaIS5_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %1) #7
  %.not44 = icmp eq i64 %39, 0
  br i1 %.not44, label %.loopexit, label %.lr.ph42

40:                                               ; preds = %26
  %41 = landingpad { ptr, i32 }
          cleanup
  br label %44

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

44:                                               ; preds = %42, %40
  %.pn = phi { ptr, i32 } [ %43, %42 ], [ %41, %40 ]
  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 %93

.lr.ph42:                                         ; preds = %38, %78
  %.02340 = phi i64 [ %79, %78 ], [ 0, %38 ]
  %.02839 = phi i8 [ %.129.lcssa, %78 ], [ 0, %38 ]
  %45 = load ptr, ptr %27, align 8, !tbaa !21
  invoke void @_ZN4Jtag9set_stateENS_10tapState_tEh(ptr noundef nonnull align 8 dereferenceable(193) %45, i32 noundef 1, i8 noundef zeroext 1)
          to label %46 unwind label %54

46:                                               ; preds = %.lr.ph42
  %47 = load ptr, ptr %27, align 8, !tbaa !21
  invoke void @_ZN4Jtag9toggleClkEi(ptr noundef nonnull align 8 dereferenceable(193) %47, i32 noundef 2)
          to label %48 unwind label %54

48:                                               ; preds = %46
  %49 = load ptr, ptr %27, align 8, !tbaa !21
  %50 = invoke noundef i32 @_ZN4Jtag7shiftDREPKhPhiNS_10tapState_tE(ptr noundef nonnull align 8 dereferenceable(193) %49, ptr noundef nonnull %5, ptr noundef nonnull %6, i32 noundef 128, i32 noundef 6)
          to label %.preheader unwind label %54

.preheader:                                       ; preds = %48
  %51 = call noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt6vectorINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESaIS5_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %1, i64 noundef %.02340) #7
  %52 = call noundef i64 @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(32) %51) #7
  %.not45 = icmp eq i64 %52, 0
  br i1 %.not45, label %._crit_edge, label %.lr.ph

._crit_edge:                                      ; preds = %69, %.preheader
  %.129.lcssa = phi i8 [ %.02839, %.preheader ], [ %.230, %69 ]
  %53 = trunc nuw i8 %.129.lcssa to i1
  br i1 %53, label %74, label %76

54:                                               ; preds = %76, %48, %46, %.lr.ph42
  %55 = landingpad { ptr, i32 }
          cleanup
  br label %92

.lr.ph:                                           ; preds = %.preheader, %69
  %.038 = phi i64 [ %70, %69 ], [ 0, %.preheader ]
  %.12937 = phi i8 [ %.230, %69 ], [ %.02839, %.preheader ]
  %56 = getelementptr inbounds [16 x i8], ptr %6, i64 0, i64 %.038
  %57 = load i8, ptr %56, align 1, !tbaa !20
  %58 = call noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt6vectorINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESaIS5_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %1, i64 noundef %.02340) #7
  %59 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %58, i64 noundef %.038)
  %60 = load i8, ptr %59, align 1, !tbaa !20
  %.not = icmp eq i8 %57, %60
  br i1 %.not, label %69, label %61

61:                                               ; preds = %.lr.ph
  %62 = load i8, ptr %56, align 1, !tbaa !20
  %63 = zext i8 %62 to i32
  %64 = call noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt6vectorINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESaIS5_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %1, i64 noundef %.02340) #7
  %65 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %64, i64 noundef %.038)
  %66 = load i8, ptr %65, align 1, !tbaa !20
  %67 = zext i8 %66 to i32
  %68 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.717, i64 noundef %.02340, i64 noundef %.038, i32 noundef %63, i32 noundef %67)
  br label %69

69:                                               ; preds = %.lr.ph, %61
  %.230 = phi i8 [ 1, %61 ], [ %.12937, %.lr.ph ]
  %70 = add nuw i64 %.038, 1
  %71 = call noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt6vectorINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESaIS5_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %1, i64 noundef %.02340) #7
  %72 = call noundef i64 @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(32) %71) #7
  %73 = icmp ult i64 %70, %72
  br i1 %73, label %.lr.ph, label %._crit_edge, !llvm.loop !25

74:                                               ; preds = %._crit_edge
  %75 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.718)
  br label %.loopexit

76:                                               ; preds = %._crit_edge
  %77 = trunc i64 %.02340 to i32
  invoke void @_ZN11ProgressBar7displayEic(ptr noundef nonnull align 8 dereferenceable(50) %8, i32 noundef %77, i8 noundef signext 0)
          to label %78 unwind label %54

78:                                               ; preds = %76
  %79 = add nuw i64 %.02340, 1
  %80 = call noundef i64 @_ZNKSt6vectorINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESaIS5_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %1) #7
  %81 = icmp ult i64 %79, %80
  br i1 %81, label %.lr.ph42, label %.loopexit, !llvm.loop !27

.loopexit:                                        ; preds = %78, %38, %74
  %.3 = phi i8 [ %.129.lcssa, %74 ], [ 0, %38 ], [ %.129.lcssa, %78 ]
  br i1 %2, label %82, label %86

82:                                               ; preds = %.loopexit
  %83 = invoke noundef zeroext i1 @_ZN7Lattice10DisableISCEv(ptr noundef nonnull align 8 dereferenceable(152) %0)
          to label %86 unwind label %84

84:                                               ; preds = %89, %88, %82
  %85 = landingpad { ptr, i32 }
          cleanup
  br label %92

86:                                               ; preds = %82, %.loopexit
  %87 = trunc nuw i8 %.3 to i1
  br i1 %87, label %88, label %89

88:                                               ; preds = %86
  invoke void @_ZN11ProgressBar4failEv(ptr noundef nonnull align 8 dereferenceable(50) %8)
          to label %90 unwind label %84

89:                                               ; preds = %86
  invoke void @_ZN11ProgressBar4doneEv(ptr noundef nonnull align 8 dereferenceable(50) %8)
          to label %90 unwind label %84

90:                                               ; preds = %89, %88
  %91 = xor i1 %87, true
  call void @_ZN11ProgressBarD2Ev(ptr noundef nonnull align 8 dereferenceable(50) %8) #7
  call void @llvm.lifetime.end.p0(i64 56, ptr nonnull %8) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %6) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %5) #7
  ret i1 %91

92:                                               ; preds = %84, %54
  %.pn32 = phi { ptr, i32 } [ %85, %84 ], [ %55, %54 ]
  call void @_ZN11ProgressBarD2Ev(ptr noundef nonnull align 8 dereferenceable(50) %8) #7
  br label %93

93:                                               ; preds = %92, %44
  %.pn32.pn = phi { ptr, i32 } [ %.pn32, %92 ], [ %.pn, %44 ]
  call void @llvm.lifetime.end.p0(i64 56, ptr nonnull %8) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %6) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %5) #7
  resume { ptr, i32 } %.pn32.pn
}

declare noundef i32 @_ZN4Jtag7shiftIREPhS0_iNS_10tapState_tE(ptr noundef nonnull align 8 dereferenceable(193), ptr noundef, ptr noundef, i32 noundef, i32 noundef) local_unnamed_addr #5

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt6vectorINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESaIS5_EEixEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) local_unnamed_addr #1 align 2

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

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

; 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 = { 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 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #4 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { "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 = { 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 #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, !18, i64 144}
!6 = !{!"_ZTS7Lattice", !7, i64 0, !16, i64 88, !18, i64 144, !19, i64 148}
!7 = !{!"_ZTS6Device", !8, i64 8, !11, i64 16, !11, i64 48, !14, i64 80, !15, i64 84, !15, i64 85, !15, i64 86}
!8 = !{!"any pointer", !9, i64 0}
!9 = !{!"omnipotent char", !10, i64 0}
!10 = !{!"Simple C++ TBAA"}
!11 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE", !12, i64 0, !13, i64 8, !9, i64 16}
!12 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_Alloc_hiderE", !8, i64 0}
!13 = !{!"long", !9, i64 0}
!14 = !{!"_ZTSN6Device9prog_modeE", !9, i64 0}
!15 = !{!"bool", !9, i64 0}
!16 = !{!"_ZTS12SPIInterface", !9, i64 8, !17, i64 12, !15, i64 16, !15, i64 17, !15, i64 18, !11, i64 24}
!17 = !{!"int", !9, i64 0}
!18 = !{!"_ZTSN7Lattice16lattice_family_tE", !9, i64 0}
!19 = !{!"_ZTSN7Lattice22lattice_flash_sector_tE", !9, i64 0}
!20 = !{!9, !9, i64 0}
!21 = !{!7, !8, i64 8}
!22 = !{!7, !15, i64 86}
!23 = !{i8 0, i8 2}
!24 = !{}
!25 = distinct !{!25, !26}
!26 = !{!"llvm.loop.mustprogress"}
!27 = distinct !{!27, !26}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,SROAPass,SimplifyCFGPass,TailCallElimPass