; LLVM IR from trabucayre/openFPGALoader :: src/gowin.ll (ZN5Gowin10eraseFLASHEv)

; Unoptimized IR (clang -disable-llvm-passes):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%"class.std::__cxx11::basic_string" = type { %"struct.std::__cxx11::basic_string<char>::_Alloc_hider", i64, %union.anon }
%"struct.std::__cxx11::basic_string<char>::_Alloc_hider" = type { ptr }
%union.anon = type { i64, [8 x i8] }
%"class.std::allocator.0" = type { i8 }
%class.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 }>
%class.Gowin = type { %class.Device.base, %class.SPIInterface, %"class.std::unique_ptr", %"class.std::unique_ptr", %"class.std::unique_ptr", i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, 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.std::unique_ptr" = type { %"struct.std::__uniq_ptr_data" }
%"struct.std::__uniq_ptr_data" = type { %"class.std::__uniq_ptr_impl" }
%"class.std::__uniq_ptr_impl" = type { %"class.std::tuple" }
%"class.std::tuple" = type { %"struct.std::_Tuple_impl" }
%"struct.std::_Tuple_impl" = type { %"struct.std::_Head_base.68" }
%"struct.std::_Head_base.68" = type { ptr }

@.str.572 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.574 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.652 = external hidden unnamed_addr constant [13 x i8], align 1
@.str.653 = external hidden unnamed_addr constant [14 x i8], align 1
@.str.654 = external hidden unnamed_addr constant [19 x i8], align 1
@.str.655 = external hidden unnamed_addr constant [18 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 void @_Z9printInfoRKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEb(ptr noundef nonnull align 8 dereferenceable(32), i1 noundef zeroext) #4

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

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

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

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

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

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

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

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

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

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

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

27:                                               ; preds = %26
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %4) #6
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %5) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr %5) #6
  call void @llvm.lifetime.end.p0(i64 32, ptr %4) #6
  call void @llvm.lifetime.start.p0(i64 56, ptr %8) #6
  call void @llvm.lifetime.start.p0(i64 32, ptr %9) #6
  call void @llvm.lifetime.start.p0(i64 1, ptr %10) #6
  call void @_ZNSaIcEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %10) #6
  invoke void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_(ptr noundef nonnull align 8 dereferenceable(32) %9, ptr noundef @.str.653, ptr noundef nonnull align 1 dereferenceable(1) %10)
          to label %28 unwind label %46

28:                                               ; preds = %27
  %29 = getelementptr inbounds %class.Device, ptr %25, i32 0, i32 7
  %30 = load i8, ptr %29, align 2, !tbaa !9, !range !16, !noundef !17
  %31 = trunc i8 %30 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 100, i32 noundef 50, i1 noundef zeroext %31)
          to label %32 unwind label %50

32:                                               ; preds = %28
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %9) #6
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %10) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr %10) #6
  call void @llvm.lifetime.end.p0(i64 32, ptr %9) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #6
  store i32 0, ptr %11, align 4, !tbaa !18
  br label %33

33:                                               ; preds = %163, %32
  %34 = load i32, ptr %11, align 4, !tbaa !18
  %35 = icmp ult i32 %34, 100
  br i1 %35, label %55, label %36

36:                                               ; preds = %33
  store i32 2, ptr %12, align 4
  br label %167

37:                                               ; preds = %1
  %38 = landingpad { ptr, i32 }
          cleanup
  %39 = extractvalue { ptr, i32 } %38, 0
  store ptr %39, ptr %6, align 8
  %40 = extractvalue { ptr, i32 } %38, 1
  store i32 %40, ptr %7, align 4
  br label %45

41:                                               ; preds = %26
  %42 = landingpad { ptr, i32 }
          cleanup
  %43 = extractvalue { ptr, i32 } %42, 0
  store ptr %43, ptr %6, align 8
  %44 = extractvalue { ptr, i32 } %42, 1
  store i32 %44, ptr %7, align 4
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %4) #6
  br label %45

45:                                               ; preds = %41, %37
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %5) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr %5) #6
  call void @llvm.lifetime.end.p0(i64 32, ptr %4) #6
  br label %209

46:                                               ; preds = %27
  %47 = landingpad { ptr, i32 }
          cleanup
  %48 = extractvalue { ptr, i32 } %47, 0
  store ptr %48, ptr %6, align 8
  %49 = extractvalue { ptr, i32 } %47, 1
  store i32 %49, ptr %7, align 4
  br label %54

50:                                               ; preds = %28
  %51 = landingpad { ptr, i32 }
          cleanup
  %52 = extractvalue { ptr, i32 } %51, 0
  store ptr %52, ptr %6, align 8
  %53 = extractvalue { ptr, i32 } %51, 1
  store i32 %53, ptr %7, align 4
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %9) #6
  br label %54

54:                                               ; preds = %50, %46
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %10) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr %10) #6
  call void @llvm.lifetime.end.p0(i64 32, ptr %9) #6
  br label %208

55:                                               ; preds = %33
  %56 = getelementptr inbounds %class.Device, ptr %25, i32 0, i32 6
  %57 = load i8, ptr %56, align 1, !tbaa !20, !range !16, !noundef !17
  %58 = trunc i8 %57 to i1
  br i1 %58, label %59, label %67

59:                                               ; preds = %55
  %60 = invoke noundef i32 @_ZN5Gowin13readStatusRegEv(ptr noundef nonnull align 8 dereferenceable(192) %25)
          to label %61 unwind label %63

61:                                               ; preds = %59
  invoke void @_ZN5Gowin14displayReadRegEPKcj(ptr noundef nonnull align 8 dereferenceable(192) %25, ptr noundef @.str.654, i32 noundef %60)
          to label %62 unwind label %63

62:                                               ; preds = %61
  br label %67

63:                                               ; preds = %85, %83, %72, %67, %61, %59
  %64 = landingpad { ptr, i32 }
          cleanup
  %65 = extractvalue { ptr, i32 } %64, 0
  store ptr %65, ptr %6, align 8
  %66 = extractvalue { ptr, i32 } %64, 1
  store i32 %66, ptr %7, align 4
  br label %169

67:                                               ; preds = %62, %55
  %68 = invoke noundef zeroext i1 @_ZN5Gowin9enableCfgEv(ptr noundef nonnull align 8 dereferenceable(192) %25)
          to label %69 unwind label %63

69:                                               ; preds = %67
  br i1 %68, label %83, label %70

70:                                               ; preds = %69
  call void @llvm.lifetime.start.p0(i64 32, ptr %13) #6
  call void @llvm.lifetime.start.p0(i64 1, ptr %14) #6
  call void @_ZNSaIcEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %14) #6
  invoke void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_(ptr noundef nonnull align 8 dereferenceable(32) %13, ptr noundef @.str.572, ptr noundef nonnull align 1 dereferenceable(1) %14)
          to label %71 unwind label %74

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

72:                                               ; preds = %71
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %13) #6
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %14) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr %14) #6
  call void @llvm.lifetime.end.p0(i64 32, ptr %13) #6
  invoke void @_ZN11ProgressBar4failEv(ptr noundef nonnull align 8 dereferenceable(50) %8)
          to label %73 unwind label %63

73:                                               ; preds = %72
  store i1 false, ptr %2, align 1
  store i32 1, ptr %12, align 4
  br label %167

74:                                               ; preds = %70
  %75 = landingpad { ptr, i32 }
          cleanup
  %76 = extractvalue { ptr, i32 } %75, 0
  store ptr %76, ptr %6, align 8
  %77 = extractvalue { ptr, i32 } %75, 1
  store i32 %77, ptr %7, align 4
  br label %82

78:                                               ; preds = %71
  %79 = landingpad { ptr, i32 }
          cleanup
  %80 = extractvalue { ptr, i32 } %79, 0
  store ptr %80, ptr %6, align 8
  %81 = extractvalue { ptr, i32 } %79, 1
  store i32 %81, ptr %7, align 4
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %13) #6
  br label %82

82:                                               ; preds = %78, %74
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %14) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr %14) #6
  call void @llvm.lifetime.end.p0(i64 32, ptr %13) #6
  br label %169

83:                                               ; preds = %69
  %84 = invoke noundef zeroext i1 @_ZN5Gowin12send_commandEh(ptr noundef nonnull align 8 dereferenceable(192) %25, i8 noundef zeroext 117)
          to label %85 unwind label %63

85:                                               ; preds = %83
  %86 = getelementptr inbounds %class.Device, ptr %25, i32 0, i32 1
  %87 = load ptr, ptr %86, align 8, !tbaa !21
  invoke void @_ZN4Jtag9set_stateENS_10tapState_tEh(ptr noundef nonnull align 8 dereferenceable(193) %87, i32 noundef 1, i8 noundef zeroext 1)
          to label %88 unwind label %63

88:                                               ; preds = %85
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #6
  %89 = getelementptr inbounds %class.Gowin, ptr %25, i32 0, i32 6
  %90 = load i8, ptr %89, align 4, !tbaa !22, !range !16, !noundef !17
  %91 = trunc i8 %90 to i1
  %92 = zext i1 %91 to i64
  %93 = select i1 %91, i32 65, i32 1
  store i32 %93, ptr %15, align 4, !tbaa !18
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #6
  call void @llvm.memset.p0.i64(ptr align 1 %16, i8 0, i64 4, i1 false)
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #6
  store i32 0, ptr %17, align 4, !tbaa !18
  br label %94

94:                                               ; preds = %105, %88
  %95 = load i32, ptr %17, align 4, !tbaa !18
  %96 = load i32, ptr %15, align 4, !tbaa !18
  %97 = icmp slt i32 %95, %96
  br i1 %97, label %99, label %98

98:                                               ; preds = %94
  store i32 5, ptr %12, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #6
  br label %112

99:                                               ; preds = %94
  %100 = getelementptr inbounds %class.Device, ptr %25, i32 0, i32 1
  %101 = load ptr, ptr %100, align 8, !tbaa !21
  %102 = getelementptr inbounds [4 x i8], ptr %16, i64 0, i64 0
  %103 = invoke noundef i32 @_ZN4Jtag7shiftDREPKhPhiNS_10tapState_tE(ptr noundef nonnull align 8 dereferenceable(193) %101, ptr noundef %102, ptr noundef null, i32 noundef 32, i32 noundef 1)
          to label %104 unwind label %108

104:                                              ; preds = %99
  br label %105

105:                                              ; preds = %104
  %106 = load i32, ptr %17, align 4, !tbaa !18
  %107 = add nsw i32 %106, 1
  store i32 %107, ptr %17, align 4, !tbaa !18
  br label %94, !llvm.loop !32

108:                                              ; preds = %99
  %109 = landingpad { ptr, i32 }
          cleanup
  %110 = extractvalue { ptr, i32 } %109, 0
  store ptr %110, ptr %6, align 8
  %111 = extractvalue { ptr, i32 } %109, 1
  store i32 %111, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #6
  br label %166

112:                                              ; preds = %98
  invoke void @_ZN5Gowin9sendClkUsEj(ptr noundef nonnull align 8 dereferenceable(192) %25, i32 noundef 150000)
          to label %113 unwind label %120

113:                                              ; preds = %112
  %114 = invoke noundef zeroext i1 @_ZN5Gowin10disableCfgEv(ptr noundef nonnull align 8 dereferenceable(192) %25)
          to label %115 unwind label %120

115:                                              ; preds = %113
  br i1 %114, label %133, label %116

116:                                              ; preds = %115
  call void @llvm.lifetime.start.p0(i64 32, ptr %18) #6
  call void @llvm.lifetime.start.p0(i64 1, ptr %19) #6
  call void @_ZNSaIcEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %19) #6
  invoke void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_(ptr noundef nonnull align 8 dereferenceable(32) %18, ptr noundef @.str.572, ptr noundef nonnull align 1 dereferenceable(1) %19)
          to label %117 unwind label %124

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

118:                                              ; preds = %117
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %18) #6
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %19) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr %19) #6
  call void @llvm.lifetime.end.p0(i64 32, ptr %18) #6
  invoke void @_ZN11ProgressBar4failEv(ptr noundef nonnull align 8 dereferenceable(50) %8)
          to label %119 unwind label %120

119:                                              ; preds = %118
  store i1 false, ptr %2, align 1
  store i32 1, ptr %12, align 4
  br label %160

120:                                              ; preds = %136, %133, %118, %113, %112
  %121 = landingpad { ptr, i32 }
          cleanup
  %122 = extractvalue { ptr, i32 } %121, 0
  store ptr %122, ptr %6, align 8
  %123 = extractvalue { ptr, i32 } %121, 1
  store i32 %123, ptr %7, align 4
  br label %166

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

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

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

133:                                              ; preds = %115
  %134 = getelementptr inbounds %class.Device, ptr %25, i32 0, i32 1
  %135 = load ptr, ptr %134, align 8, !tbaa !21
  invoke void @_ZN4Jtag5flushEv(ptr noundef nonnull align 8 dereferenceable(193) %135)
          to label %136 unwind label %120

136:                                              ; preds = %133
  %137 = invoke i32 @usleep(i32 noundef 500000)
          to label %138 unwind label %120

138:                                              ; preds = %136
  call void @llvm.lifetime.start.p0(i64 4, ptr %20) #6
  %139 = invoke noundef i32 @_ZN5Gowin13readStatusRegEv(ptr noundef nonnull align 8 dereferenceable(192) %25)
          to label %140 unwind label %147

140:                                              ; preds = %138
  store i32 %139, ptr %20, align 4, !tbaa !18
  %141 = getelementptr inbounds %class.Device, ptr %25, i32 0, i32 6
  %142 = load i8, ptr %141, align 1, !tbaa !20, !range !16, !noundef !17
  %143 = trunc i8 %142 to i1
  br i1 %143, label %144, label %151

144:                                              ; preds = %140
  %145 = load i32, ptr %20, align 4, !tbaa !18
  invoke void @_ZN5Gowin14displayReadRegEPKcj(ptr noundef nonnull align 8 dereferenceable(192) %25, ptr noundef @.str.655, i32 noundef %145)
          to label %146 unwind label %147

146:                                              ; preds = %144
  br label %151

147:                                              ; preds = %151, %144, %138
  %148 = landingpad { ptr, i32 }
          cleanup
  %149 = extractvalue { ptr, i32 } %148, 0
  store ptr %149, ptr %6, align 8
  %150 = extractvalue { ptr, i32 } %148, 1
  store i32 %150, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #6
  br label %166

151:                                              ; preds = %146, %140
  %152 = load i32, ptr %11, align 4, !tbaa !18
  invoke void @_ZN11ProgressBar7displayEic(ptr noundef nonnull align 8 dereferenceable(50) %8, i32 noundef %152, i8 noundef signext 0)
          to label %153 unwind label %147

153:                                              ; preds = %151
  %154 = load i32, ptr %20, align 4, !tbaa !18
  %155 = and i32 %154, 8192
  %156 = icmp ne i32 %155, 0
  br i1 %156, label %158, label %157

157:                                              ; preds = %153
  store i32 2, ptr %12, align 4
  br label %159

158:                                              ; preds = %153
  store i32 0, ptr %12, align 4
  br label %159

159:                                              ; preds = %158, %157
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #6
  br label %160

160:                                              ; preds = %159, %119
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #6
  %161 = load i32, ptr %12, align 4
  switch i32 %161, label %167 [
    i32 0, label %162
  ]

162:                                              ; preds = %160
  br label %163

163:                                              ; preds = %162
  %164 = load i32, ptr %11, align 4, !tbaa !18
  %165 = add i32 %164, 1
  store i32 %165, ptr %11, align 4, !tbaa !18
  br label %33, !llvm.loop !34

166:                                              ; preds = %147, %132, %120, %108
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #6
  br label %169

167:                                              ; preds = %160, %73, %36
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #6
  %168 = load i32, ptr %12, align 4
  switch i32 %168, label %205 [
    i32 2, label %170
  ]

169:                                              ; preds = %166, %82, %63
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #6
  br label %207

170:                                              ; preds = %167
  %171 = invoke noundef i32 @_ZN5Gowin13readStatusRegEv(ptr noundef nonnull align 8 dereferenceable(192) %25)
          to label %172 unwind label %179

172:                                              ; preds = %170
  %173 = and i32 %171, 8192
  %174 = icmp ne i32 %173, 0
  br i1 %174, label %175, label %192

175:                                              ; preds = %172
  call void @llvm.lifetime.start.p0(i64 32, ptr %21) #6
  call void @llvm.lifetime.start.p0(i64 1, ptr %22) #6
  call void @_ZNSaIcEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %22) #6
  invoke void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_(ptr noundef nonnull align 8 dereferenceable(32) %21, ptr noundef @.str.572, ptr noundef nonnull align 1 dereferenceable(1) %22)
          to label %176 unwind label %183

176:                                              ; preds = %175
  invoke void @_Z10printErrorRKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEb(ptr noundef nonnull align 8 dereferenceable(32) %21, i1 noundef zeroext true)
          to label %177 unwind label %187

177:                                              ; preds = %176
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %21) #6
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %22) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr %22) #6
  call void @llvm.lifetime.end.p0(i64 32, ptr %21) #6
  invoke void @_ZN11ProgressBar4failEv(ptr noundef nonnull align 8 dereferenceable(50) %8)
          to label %178 unwind label %179

178:                                              ; preds = %177
  store i1 false, ptr %2, align 1
  store i32 1, ptr %12, align 4
  br label %205

179:                                              ; preds = %194, %177, %170
  %180 = landingpad { ptr, i32 }
          cleanup
  %181 = extractvalue { ptr, i32 } %180, 0
  store ptr %181, ptr %6, align 8
  %182 = extractvalue { ptr, i32 } %180, 1
  store i32 %182, ptr %7, align 4
  br label %207

183:                                              ; preds = %175
  %184 = landingpad { ptr, i32 }
          cleanup
  %185 = extractvalue { ptr, i32 } %184, 0
  store ptr %185, ptr %6, align 8
  %186 = extractvalue { ptr, i32 } %184, 1
  store i32 %186, ptr %7, align 4
  br label %191

187:                                              ; preds = %176
  %188 = landingpad { ptr, i32 }
          cleanup
  %189 = extractvalue { ptr, i32 } %188, 0
  store ptr %189, ptr %6, align 8
  %190 = extractvalue { ptr, i32 } %188, 1
  store i32 %190, ptr %7, align 4
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %21) #6
  br label %191

191:                                              ; preds = %187, %183
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %22) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr %22) #6
  call void @llvm.lifetime.end.p0(i64 32, ptr %21) #6
  br label %207

192:                                              ; preds = %172
  call void @llvm.lifetime.start.p0(i64 32, ptr %23) #6
  call void @llvm.lifetime.start.p0(i64 1, ptr %24) #6
  call void @_ZNSaIcEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %24) #6
  invoke void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_(ptr noundef nonnull align 8 dereferenceable(32) %23, ptr noundef @.str.574, ptr noundef nonnull align 1 dereferenceable(1) %24)
          to label %193 unwind label %196

193:                                              ; preds = %192
  invoke void @_Z12printSuccessRKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEb(ptr noundef nonnull align 8 dereferenceable(32) %23, i1 noundef zeroext true)
          to label %194 unwind label %200

194:                                              ; preds = %193
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %23) #6
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %24) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr %24) #6
  call void @llvm.lifetime.end.p0(i64 32, ptr %23) #6
  invoke void @_ZN11ProgressBar4doneEv(ptr noundef nonnull align 8 dereferenceable(50) %8)
          to label %195 unwind label %179

195:                                              ; preds = %194
  store i1 true, ptr %2, align 1
  store i32 1, ptr %12, align 4
  br label %205

196:                                              ; preds = %192
  %197 = landingpad { ptr, i32 }
          cleanup
  %198 = extractvalue { ptr, i32 } %197, 0
  store ptr %198, ptr %6, align 8
  %199 = extractvalue { ptr, i32 } %197, 1
  store i32 %199, ptr %7, align 4
  br label %204

200:                                              ; preds = %193
  %201 = landingpad { ptr, i32 }
          cleanup
  %202 = extractvalue { ptr, i32 } %201, 0
  store ptr %202, ptr %6, align 8
  %203 = extractvalue { ptr, i32 } %201, 1
  store i32 %203, ptr %7, align 4
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %23) #6
  br label %204

204:                                              ; preds = %200, %196
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %24) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr %24) #6
  call void @llvm.lifetime.end.p0(i64 32, ptr %23) #6
  br label %207

205:                                              ; preds = %195, %178, %167
  call void @_ZN11ProgressBarD2Ev(ptr noundef nonnull align 8 dereferenceable(50) %8) #6
  call void @llvm.lifetime.end.p0(i64 56, ptr %8) #6
  %206 = load i1, ptr %2, align 1
  ret i1 %206

207:                                              ; preds = %204, %191, %179, %169
  call void @_ZN11ProgressBarD2Ev(ptr noundef nonnull align 8 dereferenceable(50) %8) #6
  br label %208

208:                                              ; preds = %207, %54
  call void @llvm.lifetime.end.p0(i64 56, ptr %8) #6
  br label %209

209:                                              ; preds = %208, %45
  %210 = load ptr, ptr %6, align 8
  %211 = load i32, ptr %7, align 4
  %212 = insertvalue { ptr, i32 } poison, ptr %210, 0
  %213 = insertvalue { ptr, i32 } %212, i32 %211, 1
  resume { ptr, i32 } %213
}

declare i32 @usleep(i32 noundef) #4

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 void @_ZN11ProgressBar4doneEv(ptr noundef nonnull align 8 dereferenceable(50)) #4

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN4Jtag5flushEv(ptr noundef nonnull align 8 dereferenceable(193)) #2 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, !15, i64 86}
!10 = !{!"_ZTS6Device", !6, i64 8, !11, i64 16, !11, i64 48, !14, i64 80, !15, i64 84, !15, i64 85, !15, i64 86}
!11 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE", !12, i64 0, !13, i64 8, !7, i64 16}
!12 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_Alloc_hiderE", !6, i64 0}
!13 = !{!"long", !7, i64 0}
!14 = !{!"_ZTSN6Device9prog_modeE", !7, i64 0}
!15 = !{!"bool", !7, i64 0}
!16 = !{i8 0, i8 2}
!17 = !{}
!18 = !{!19, !19, i64 0}
!19 = !{!"int", !7, i64 0}
!20 = !{!10, !15, i64 85}
!21 = !{!10, !6, i64 8}
!22 = !{!23, !15, i64 172}
!23 = !{!"_ZTS5Gowin", !10, i64 0, !24, i64 88, !25, i64 144, !25, i64 152, !25, i64 160, !19, i64 168, !15, i64 172, !15, i64 173, !15, i64 174, !15, i64 175, !15, i64 176, !15, i64 177, !15, i64 178, !7, i64 179, !7, i64 180, !7, i64 181, !7, i64 182, !7, i64 183, !31, i64 184, !31, i64 188}
!24 = !{!"_ZTS12SPIInterface", !7, i64 8, !19, i64 12, !15, i64 16, !15, i64 17, !15, i64 18, !11, i64 24}
!25 = !{!"_ZTSSt10unique_ptrI21ConfigBitstreamParserSt14default_deleteIS0_EE", !26, i64 0}
!26 = !{!"_ZTSSt15__uniq_ptr_dataI21ConfigBitstreamParserSt14default_deleteIS0_ELb1ELb1EE", !27, i64 0}
!27 = !{!"_ZTSSt15__uniq_ptr_implI21ConfigBitstreamParserSt14default_deleteIS0_EE", !28, i64 0}
!28 = !{!"_ZTSSt5tupleIJP21ConfigBitstreamParserSt14default_deleteIS0_EEE", !29, i64 0}
!29 = !{!"_ZTSSt11_Tuple_implILm0EJP21ConfigBitstreamParserSt14default_deleteIS0_EEE", !30, i64 0}
!30 = !{!"_ZTSSt10_Head_baseILm0EP21ConfigBitstreamParserLb0EE", !6, i64 0}
!31 = !{!"_ZTSN13JtagInterface10tck_edge_tE", !7, i64 0}
!32 = distinct !{!32, !33}
!33 = !{!"llvm.loop.mustprogress"}
!34 = distinct !{!34, !33}


; Optimized IR (opt -passes='default<O3>'):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%"class.std::__cxx11::basic_string" = type { %"struct.std::__cxx11::basic_string<char>::_Alloc_hider", i64, %union.anon }
%"struct.std::__cxx11::basic_string<char>::_Alloc_hider" = type { ptr }
%union.anon = type { i64, [8 x i8] }
%"class.std::allocator.0" = type { i8 }
%class.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 [5 x i8], align 1
@.str.574 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.652 = external hidden unnamed_addr constant [13 x i8], align 1
@.str.653 = external hidden unnamed_addr constant [14 x i8], align 1
@.str.654 = external hidden unnamed_addr constant [19 x i8], align 1
@.str.655 = external hidden unnamed_addr constant [18 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 void @_Z9printInfoRKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEb(ptr noundef nonnull align 8 dereferenceable(32), i1 noundef zeroext) local_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 @_ZN4Jtag9set_stateENS_10tapState_tEh(ptr noundef nonnull align 8 dereferenceable(193), i32 noundef, i8 noundef zeroext) local_unnamed_addr #3

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

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

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

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

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

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

; Function Attrs: mustprogress uwtable
define dso_local noundef zeroext i1 @_ZN5Gowin10eraseFLASHEv(ptr noundef nonnull align 8 dereferenceable(192) %0) local_unnamed_addr #2 align 2 personality ptr @__gxx_personality_v0 {
  %2 = alloca %"class.std::__cxx11::basic_string", align 8
  %3 = alloca %"class.std::allocator.0", align 1
  %4 = alloca %class.ProgressBar, 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 [4 x i8], align 4
  %10 = alloca %"class.std::__cxx11::basic_string", align 8
  %11 = alloca %"class.std::allocator.0", align 1
  %12 = alloca %"class.std::__cxx11::basic_string", align 8
  %13 = alloca %"class.std::allocator.0", align 1
  %14 = alloca %"class.std::__cxx11::basic_string", align 8
  %15 = alloca %"class.std::allocator.0", align 1
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %2) #5
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %3) #5
  call void @_ZNSaIcEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %3) #5
  invoke void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_(ptr noundef nonnull align 8 dereferenceable(32) %2, ptr noundef nonnull @.str.652, ptr noundef nonnull align 1 dereferenceable(1) %3)
          to label %16 unwind label %26

16:                                               ; preds = %1
  invoke void @_Z9printInfoRKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEb(ptr noundef nonnull align 8 dereferenceable(32) %2, i1 noundef zeroext false)
          to label %17 unwind label %28

17:                                               ; preds = %16
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %2) #5
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %3) #5
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %3) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %2) #5
  call void @llvm.lifetime.start.p0(i64 56, ptr nonnull %4) #5
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %5) #5
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %6) #5
  call void @_ZNSaIcEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %6) #5
  invoke void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_(ptr noundef nonnull align 8 dereferenceable(32) %5, ptr noundef nonnull @.str.653, ptr noundef nonnull align 1 dereferenceable(1) %6)
          to label %18 unwind label %31

18:                                               ; preds = %17
  %19 = getelementptr inbounds i8, ptr %0, i64 86
  %20 = load i8, ptr %19, align 2, !tbaa !5, !range !15, !noundef !16
  %21 = trunc nuw i8 %20 to i1
  invoke void @_ZN11ProgressBarC1ERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEiib(ptr noundef nonnull align 8 dereferenceable(50) %4, ptr noundef nonnull align 8 dereferenceable(32) %5, i32 noundef 100, i32 noundef 50, i1 noundef zeroext %21)
          to label %22 unwind label %33

22:                                               ; preds = %18
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %5) #5
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %6) #5
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %6) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %5) #5
  %23 = getelementptr inbounds i8, ptr %0, i64 85
  %24 = getelementptr inbounds i8, ptr %0, i64 8
  %25 = getelementptr inbounds i8, ptr %0, i64 172
  br label %36

26:                                               ; preds = %1
  %27 = landingpad { ptr, i32 }
          cleanup
  br label %30

28:                                               ; preds = %16
  %29 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %2) #5
  br label %30

30:                                               ; preds = %28, %26
  %.pn = phi { ptr, i32 } [ %29, %28 ], [ %27, %26 ]
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %3) #5
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %3) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %2) #5
  br label %122

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

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

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

36:                                               ; preds = %94, %22
  %.02269 = phi i32 [ 0, %22 ], [ %96, %94 ]
  %37 = load i8, ptr %23, align 1, !tbaa !17, !range !15, !noundef !16
  %38 = trunc nuw i8 %37 to i1
  br i1 %38, label %39, label %42

39:                                               ; preds = %36
  %40 = invoke noundef i32 @_ZN5Gowin13readStatusRegEv(ptr noundef nonnull align 8 dereferenceable(192) %0)
          to label %41 unwind label %.loopexit

41:                                               ; preds = %39
  invoke void @_ZN5Gowin14displayReadRegEPKcj(ptr noundef nonnull align 8 dereferenceable(192) %0, ptr noundef nonnull @.str.654, i32 noundef %40)
          to label %42 unwind label %.loopexit

.loopexit:                                        ; preds = %39, %41, %42, %53, %55
  %lpad.loopexit = landingpad { ptr, i32 }
          cleanup
  br label %120

.loopexit.split-lp:                               ; preds = %47
  %lpad.loopexit.split-lp = landingpad { ptr, i32 }
          cleanup
  br label %120

42:                                               ; preds = %41, %36
  %43 = invoke noundef zeroext i1 @_ZN5Gowin9enableCfgEv(ptr noundef nonnull align 8 dereferenceable(192) %0)
          to label %44 unwind label %.loopexit

44:                                               ; preds = %42
  br i1 %43, label %53, label %45

45:                                               ; preds = %44
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %7) #5
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %8) #5
  call void @_ZNSaIcEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %8) #5
  invoke void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_(ptr noundef nonnull align 8 dereferenceable(32) %7, ptr noundef nonnull @.str.572, ptr noundef nonnull align 1 dereferenceable(1) %8)
          to label %46 unwind label %48

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

47:                                               ; preds = %46
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %7) #5
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %8) #5
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %8) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %7) #5
  invoke void @_ZN11ProgressBar4failEv(ptr noundef nonnull align 8 dereferenceable(50) %4)
          to label %.thread57 unwind label %.loopexit.split-lp

48:                                               ; preds = %45
  %49 = landingpad { ptr, i32 }
          cleanup
  br label %52

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

52:                                               ; preds = %50, %48
  %.pn37 = phi { ptr, i32 } [ %51, %50 ], [ %49, %48 ]
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %8) #5
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %8) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %7) #5
  br label %120

53:                                               ; preds = %44
  %54 = invoke noundef zeroext i1 @_ZN5Gowin12send_commandEh(ptr noundef nonnull align 8 dereferenceable(192) %0, i8 noundef zeroext 117)
          to label %55 unwind label %.loopexit

55:                                               ; preds = %53
  %56 = load ptr, ptr %24, align 8, !tbaa !18
  invoke void @_ZN4Jtag9set_stateENS_10tapState_tEh(ptr noundef nonnull align 8 dereferenceable(193) %56, i32 noundef 1, i8 noundef zeroext 1)
          to label %57 unwind label %.loopexit

57:                                               ; preds = %55
  %58 = load i8, ptr %25, align 4, !tbaa !19, !range !15, !noundef !16
  %59 = trunc nuw i8 %58 to i1
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %9) #5
  store i32 0, ptr %9, align 4
  br label %61

60:                                               ; preds = %64
  invoke void @_ZN5Gowin9sendClkUsEj(ptr noundef nonnull align 8 dereferenceable(192) %0, i32 noundef 150000)
          to label %70 unwind label %.loopexit63

61:                                               ; preds = %57, %64
  %.01468 = phi i32 [ 0, %57 ], [ %65, %64 ]
  %62 = load ptr, ptr %24, align 8, !tbaa !18
  %63 = invoke noundef i32 @_ZN4Jtag7shiftDREPKhPhiNS_10tapState_tE(ptr noundef nonnull align 8 dereferenceable(193) %62, ptr noundef nonnull %9, ptr noundef null, i32 noundef 32, i32 noundef 1)
          to label %64 unwind label %68

64:                                               ; preds = %61
  %65 = add nuw nsw i32 %.01468, 1
  %66 = icmp ult i32 %.01468, 64
  %67 = select i1 %59, i1 %66, i1 false
  br i1 %67, label %61, label %60, !llvm.loop !30

68:                                               ; preds = %61
  %69 = landingpad { ptr, i32 }
          cleanup
  br label %97

70:                                               ; preds = %60
  %71 = invoke noundef zeroext i1 @_ZN5Gowin10disableCfgEv(ptr noundef nonnull align 8 dereferenceable(192) %0)
          to label %72 unwind label %.loopexit63

72:                                               ; preds = %70
  br i1 %71, label %81, label %73

73:                                               ; preds = %72
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %10) #5
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %11) #5
  call void @_ZNSaIcEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %11) #5
  invoke void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_(ptr noundef nonnull align 8 dereferenceable(32) %10, ptr noundef nonnull @.str.572, ptr noundef nonnull align 1 dereferenceable(1) %11)
          to label %74 unwind label %76

74:                                               ; preds = %73
  invoke void @_Z10printErrorRKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEb(ptr noundef nonnull align 8 dereferenceable(32) %10, i1 noundef zeroext true)
          to label %75 unwind label %78

75:                                               ; preds = %74
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %10) #5
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %11) #5
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %11) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %10) #5
  invoke void @_ZN11ProgressBar4failEv(ptr noundef nonnull align 8 dereferenceable(50) %4)
          to label %98 unwind label %.loopexit.split-lp64

.loopexit63:                                      ; preds = %60, %70, %81, %83
  %lpad.loopexit65 = landingpad { ptr, i32 }
          cleanup
  br label %97

.loopexit.split-lp64:                             ; preds = %75
  %lpad.loopexit.split-lp66 = landingpad { ptr, i32 }
          cleanup
  br label %97

76:                                               ; preds = %73
  %77 = landingpad { ptr, i32 }
          cleanup
  br label %80

78:                                               ; preds = %74
  %79 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %10) #5
  br label %80

80:                                               ; preds = %78, %76
  %.pn39 = phi { ptr, i32 } [ %79, %78 ], [ %77, %76 ]
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %11) #5
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %11) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %10) #5
  br label %97

81:                                               ; preds = %72
  %82 = load ptr, ptr %24, align 8, !tbaa !18
  invoke void @_ZN4Jtag5flushEv(ptr noundef nonnull align 8 dereferenceable(193) %82)
          to label %83 unwind label %.loopexit63

83:                                               ; preds = %81
  %84 = invoke i32 @usleep(i32 noundef 500000)
          to label %85 unwind label %.loopexit63

85:                                               ; preds = %83
  %86 = invoke noundef i32 @_ZN5Gowin13readStatusRegEv(ptr noundef nonnull align 8 dereferenceable(192) %0)
          to label %87 unwind label %91

87:                                               ; preds = %85
  %88 = load i8, ptr %23, align 1, !tbaa !17, !range !15, !noundef !16
  %89 = trunc nuw i8 %88 to i1
  br i1 %89, label %90, label %93

90:                                               ; preds = %87
  invoke void @_ZN5Gowin14displayReadRegEPKcj(ptr noundef nonnull align 8 dereferenceable(192) %0, ptr noundef nonnull @.str.655, i32 noundef %86)
          to label %93 unwind label %91

91:                                               ; preds = %93, %90, %85
  %92 = landingpad { ptr, i32 }
          cleanup
  br label %97

93:                                               ; preds = %90, %87
  invoke void @_ZN11ProgressBar7displayEic(ptr noundef nonnull align 8 dereferenceable(50) %4, i32 noundef %.02269, i8 noundef signext 0)
          to label %94 unwind label %91

94:                                               ; preds = %93
  %95 = and i32 %86, 8192
  %.not = icmp eq i32 %95, 0
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %9) #5
  %96 = add nuw nsw i32 %.02269, 1
  %exitcond.not = icmp eq i32 %96, 100
  %or.cond = select i1 %.not, i1 true, i1 %exitcond.not
  br i1 %or.cond, label %.thread54, label %36, !llvm.loop !32

97:                                               ; preds = %.loopexit63, %.loopexit.split-lp64, %91, %80, %68
  %.pn46 = phi { ptr, i32 } [ %69, %68 ], [ %92, %91 ], [ %.pn39, %80 ], [ %lpad.loopexit65, %.loopexit63 ], [ %lpad.loopexit.split-lp66, %.loopexit.split-lp64 ]
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %9) #5
  br label %120

98:                                               ; preds = %75
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %9) #5
  br label %.thread57

.thread54:                                        ; preds = %94
  %99 = invoke noundef i32 @_ZN5Gowin13readStatusRegEv(ptr noundef nonnull align 8 dereferenceable(192) %0)
          to label %100 unwind label %105

100:                                              ; preds = %.thread54
  %101 = and i32 %99, 8192
  %.not41 = icmp eq i32 %101, 0
  br i1 %.not41, label %112, label %102

102:                                              ; preds = %100
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %12) #5
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %13) #5
  call void @_ZNSaIcEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %13) #5
  invoke void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_(ptr noundef nonnull align 8 dereferenceable(32) %12, ptr noundef nonnull @.str.572, ptr noundef nonnull align 1 dereferenceable(1) %13)
          to label %103 unwind label %107

103:                                              ; preds = %102
  invoke void @_Z10printErrorRKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEb(ptr noundef nonnull align 8 dereferenceable(32) %12, i1 noundef zeroext true)
          to label %104 unwind label %109

104:                                              ; preds = %103
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %12) #5
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %13) #5
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %13) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %12) #5
  invoke void @_ZN11ProgressBar4failEv(ptr noundef nonnull align 8 dereferenceable(50) %4)
          to label %.thread57 unwind label %105

105:                                              ; preds = %114, %104, %.thread54
  %106 = landingpad { ptr, i32 }
          cleanup
  br label %120

107:                                              ; preds = %102
  %108 = landingpad { ptr, i32 }
          cleanup
  br label %111

109:                                              ; preds = %103
  %110 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %12) #5
  br label %111

111:                                              ; preds = %109, %107
  %.pn44 = phi { ptr, i32 } [ %110, %109 ], [ %108, %107 ]
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %13) #5
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %13) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %12) #5
  br label %120

112:                                              ; preds = %100
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %14) #5
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %15) #5
  call void @_ZNSaIcEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %15) #5
  invoke void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_(ptr noundef nonnull align 8 dereferenceable(32) %14, ptr noundef nonnull @.str.574, ptr noundef nonnull align 1 dereferenceable(1) %15)
          to label %113 unwind label %115

113:                                              ; preds = %112
  invoke void @_Z12printSuccessRKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEb(ptr noundef nonnull align 8 dereferenceable(32) %14, i1 noundef zeroext true)
          to label %114 unwind label %117

114:                                              ; preds = %113
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %14) #5
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %15) #5
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %15) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %14) #5
  invoke void @_ZN11ProgressBar4doneEv(ptr noundef nonnull align 8 dereferenceable(50) %4)
          to label %.thread57 unwind label %105

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

117:                                              ; preds = %113
  %118 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %14) #5
  br label %119

119:                                              ; preds = %117, %115
  %.pn42 = phi { ptr, i32 } [ %118, %117 ], [ %116, %115 ]
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %15) #5
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %15) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %14) #5
  br label %120

.thread57:                                        ; preds = %47, %98, %114, %104
  %.3 = phi i1 [ false, %98 ], [ false, %104 ], [ true, %114 ], [ false, %47 ]
  call void @_ZN11ProgressBarD2Ev(ptr noundef nonnull align 8 dereferenceable(50) %4) #5
  call void @llvm.lifetime.end.p0(i64 56, ptr nonnull %4) #5
  ret i1 %.3

120:                                              ; preds = %.loopexit, %.loopexit.split-lp, %52, %97, %119, %111, %105
  %.pn46.pn.pn = phi { ptr, i32 } [ %106, %105 ], [ %.pn44, %111 ], [ %.pn42, %119 ], [ %.pn46, %97 ], [ %.pn37, %52 ], [ %lpad.loopexit, %.loopexit ], [ %lpad.loopexit.split-lp, %.loopexit.split-lp ]
  call void @_ZN11ProgressBarD2Ev(ptr noundef nonnull align 8 dereferenceable(50) %4) #5
  br label %121

121:                                              ; preds = %120, %35
  %.pn46.pn.pn.pn = phi { ptr, i32 } [ %.pn46.pn.pn, %120 ], [ %.pn35, %35 ]
  call void @llvm.lifetime.end.p0(i64 56, ptr nonnull %4) #5
  br label %122

122:                                              ; preds = %121, %30
  %.pn46.pn.pn.pn.pn = phi { ptr, i32 } [ %.pn46.pn.pn.pn, %121 ], [ %.pn, %30 ]
  resume { ptr, i32 } %.pn46.pn.pn.pn.pn
}

declare i32 @usleep(i32 noundef) 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 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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN4Jtag5flushEv(ptr noundef nonnull align 8 dereferenceable(193)) local_unnamed_addr #2 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 = { "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 }

!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, !14, i64 86}
!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 = !{i8 0, i8 2}
!16 = !{}
!17 = !{!6, !14, i64 85}
!18 = !{!6, !7, i64 8}
!19 = !{!20, !14, i64 172}
!20 = !{!"_ZTS5Gowin", !6, i64 0, !21, i64 88, !23, i64 144, !23, i64 152, !23, i64 160, !22, i64 168, !14, i64 172, !14, i64 173, !14, i64 174, !14, i64 175, !14, i64 176, !14, i64 177, !14, i64 178, !8, i64 179, !8, i64 180, !8, i64 181, !8, i64 182, !8, i64 183, !29, i64 184, !29, i64 188}
!21 = !{!"_ZTS12SPIInterface", !8, i64 8, !22, i64 12, !14, i64 16, !14, i64 17, !14, i64 18, !10, i64 24}
!22 = !{!"int", !8, i64 0}
!23 = !{!"_ZTSSt10unique_ptrI21ConfigBitstreamParserSt14default_deleteIS0_EE", !24, i64 0}
!24 = !{!"_ZTSSt15__uniq_ptr_dataI21ConfigBitstreamParserSt14default_deleteIS0_ELb1ELb1EE", !25, i64 0}
!25 = !{!"_ZTSSt15__uniq_ptr_implI21ConfigBitstreamParserSt14default_deleteIS0_EE", !26, i64 0}
!26 = !{!"_ZTSSt5tupleIJP21ConfigBitstreamParserSt14default_deleteIS0_EEE", !27, i64 0}
!27 = !{!"_ZTSSt11_Tuple_implILm0EJP21ConfigBitstreamParserSt14default_deleteIS0_EEE", !28, i64 0}
!28 = !{!"_ZTSSt10_Head_baseILm0EP21ConfigBitstreamParserLb0EE", !7, i64 0}
!29 = !{!"_ZTSN13JtagInterface10tck_edge_tE", !8, i64 0}
!30 = distinct !{!30, !31}
!31 = !{!"llvm.loop.mustprogress"}
!32 = distinct !{!32, !31}


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