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

; 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.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.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.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 }
%class.Device = type <{ ptr, ptr, %"class.std::__cxx11::basic_string", %"class.std::__cxx11::basic_string", i32, i8, i8, i8, i8 }>

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

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

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

; 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) #1

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #3

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN4Jtag5flushEv(ptr noundef nonnull align 8 dereferenceable(193)) #2 align 2

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

; Function Attrs: nocallback nofree nosync nounwind willreturn
declare ptr @llvm.stacksave.p0() #4

; Function Attrs: nocallback nofree nosync nounwind willreturn
declare void @llvm.stackrestore.p0(ptr) #4

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_ZN5Gowin7spi_putEPKhPhj(ptr noundef nonnull align 8 dereferenceable(192) %0, ptr noundef %1, ptr noundef %2, i32 noundef %3) unnamed_addr #2 align 2 {
  %5 = alloca i32, align 4
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca i32, align 4
  %10 = alloca ptr, align 8
  %11 = alloca i64, align 8
  %12 = alloca i32, align 4
  %13 = alloca ptr, align 8
  %14 = alloca i64, align 8
  %15 = alloca i64, align 8
  %16 = alloca i32, align 4
  %17 = alloca i8, align 1
  %18 = alloca i32, align 4
  %19 = alloca i32, align 4
  %20 = alloca i8, align 1
  %21 = alloca i32, align 4
  %22 = alloca i8, align 1
  %23 = alloca i8, align 1
  %24 = alloca i8, align 1
  store ptr %0, ptr %6, align 8, !tbaa !5
  store ptr %1, ptr %7, align 8, !tbaa !5
  store ptr %2, ptr %8, align 8, !tbaa !5
  store i32 %3, ptr %9, align 4, !tbaa !9
  %25 = load ptr, ptr %6, align 8
  %26 = getelementptr inbounds %class.Gowin, ptr %25, i32 0, i32 10
  %27 = load i8, ptr %26, align 8, !tbaa !11, !range !27, !noundef !28
  %28 = trunc i8 %27 to i1
  br i1 %28, label %29, label %67

29:                                               ; preds = %4
  %30 = load i32, ptr %9, align 4, !tbaa !9
  %31 = zext i32 %30 to i64
  %32 = call ptr @llvm.stacksave.p0()
  store ptr %32, ptr %10, align 8
  %33 = alloca i8, i64 %31, align 16
  store i64 %31, ptr %11, align 8
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #6
  %34 = load ptr, ptr %7, align 8, !tbaa !5
  %35 = getelementptr inbounds i8, ptr %34, i64 0
  %36 = load i8, ptr %35, align 1, !tbaa !29
  %37 = load i32, ptr %9, align 4, !tbaa !9
  %38 = icmp ugt i32 %37, 1
  br i1 %38, label %39, label %42

39:                                               ; preds = %29
  %40 = load ptr, ptr %7, align 8, !tbaa !5
  %41 = getelementptr inbounds i8, ptr %40, i64 1
  br label %43

42:                                               ; preds = %29
  br label %43

43:                                               ; preds = %42, %39
  %44 = phi ptr [ %41, %39 ], [ null, %42 ]
  %45 = load ptr, ptr %8, align 8, !tbaa !5
  %46 = icmp ne ptr %45, null
  br i1 %46, label %47, label %48

47:                                               ; preds = %43
  br label %49

48:                                               ; preds = %43
  br label %49

49:                                               ; preds = %48, %47
  %50 = phi ptr [ %33, %47 ], [ null, %48 ]
  %51 = load i32, ptr %9, align 4, !tbaa !9
  %52 = sub i32 %51, 1
  %53 = call noundef i32 @_ZN5Gowin12spi_put_gw5aEhPKhPhj(ptr noundef nonnull align 8 dereferenceable(192) %25, i8 noundef zeroext %36, ptr noundef %44, ptr noundef %50, i32 noundef %52)
  store i32 %53, ptr %12, align 4, !tbaa !9
  %54 = load ptr, ptr %8, align 8, !tbaa !5
  %55 = icmp ne ptr %54, null
  br i1 %55, label %56, label %64

56:                                               ; preds = %49
  %57 = load ptr, ptr %8, align 8, !tbaa !5
  %58 = getelementptr inbounds i8, ptr %57, i64 0
  store i8 0, ptr %58, align 1, !tbaa !29
  %59 = load ptr, ptr %8, align 8, !tbaa !5
  %60 = getelementptr inbounds i8, ptr %59, i64 1
  %61 = load i32, ptr %9, align 4, !tbaa !9
  %62 = sub i32 %61, 1
  %63 = zext i32 %62 to i64
  call void @llvm.memcpy.p0.p0.i64(ptr align 1 %60, ptr align 16 %33, i64 %63, i1 false)
  br label %64

64:                                               ; preds = %56, %49
  %65 = load i32, ptr %12, align 4, !tbaa !9
  store i32 %65, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #6
  %66 = load ptr, ptr %10, align 8
  call void @llvm.stackrestore.p0(ptr %66)
  br label %303

67:                                               ; preds = %4
  %68 = getelementptr inbounds %class.Gowin, ptr %25, i32 0, i32 9
  %69 = load i8, ptr %68, align 1, !tbaa !30, !range !27, !noundef !28
  %70 = trunc i8 %69 to i1
  br i1 %70, label %71, label %167

71:                                               ; preds = %67
  %72 = load i32, ptr %9, align 4, !tbaa !9
  %73 = zext i32 %72 to i64
  %74 = call ptr @llvm.stacksave.p0()
  store ptr %74, ptr %13, align 8
  %75 = alloca i8, i64 %73, align 16
  store i64 %73, ptr %14, align 8
  %76 = load i32, ptr %9, align 4, !tbaa !9
  %77 = zext i32 %76 to i64
  %78 = alloca i8, i64 %77, align 16
  store i64 %77, ptr %15, align 8
  %79 = load ptr, ptr %8, align 8, !tbaa !5
  %80 = icmp ne ptr %79, null
  br i1 %80, label %81, label %84

81:                                               ; preds = %71
  %82 = load i32, ptr %9, align 4, !tbaa !9
  %83 = add i32 %82, 1
  store i32 %83, ptr %9, align 4, !tbaa !9
  br label %84

84:                                               ; preds = %81, %71
  %85 = load ptr, ptr %7, align 8, !tbaa !5
  %86 = icmp ne ptr %85, null
  br i1 %86, label %87, label %107

87:                                               ; preds = %84
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #6
  store i32 0, ptr %16, align 4, !tbaa !9
  br label %88

88:                                               ; preds = %103, %87
  %89 = load i32, ptr %16, align 4, !tbaa !9
  %90 = load i32, ptr %9, align 4, !tbaa !9
  %91 = icmp ult i32 %89, %90
  br i1 %91, label %93, label %92

92:                                               ; preds = %88
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #6
  br label %106

93:                                               ; preds = %88
  %94 = load ptr, ptr %7, align 8, !tbaa !5
  %95 = load i32, ptr %16, align 4, !tbaa !9
  %96 = zext i32 %95 to i64
  %97 = getelementptr inbounds i8, ptr %94, i64 %96
  %98 = load i8, ptr %97, align 1, !tbaa !29
  %99 = call noundef zeroext i8 @_ZN21ConfigBitstreamParser11reverseByteEh(i8 noundef zeroext %98)
  %100 = load i32, ptr %16, align 4, !tbaa !9
  %101 = zext i32 %100 to i64
  %102 = getelementptr inbounds i8, ptr %75, i64 %101
  store i8 %99, ptr %102, align 1, !tbaa !29
  br label %103

103:                                              ; preds = %93
  %104 = load i32, ptr %16, align 4, !tbaa !9
  %105 = add i32 %104, 1
  store i32 %105, ptr %16, align 4, !tbaa !9
  br label %88, !llvm.loop !31

106:                                              ; preds = %92
  br label %107

107:                                              ; preds = %106, %84
  call void @llvm.lifetime.start.p0(i64 1, ptr %17) #6
  %108 = call noundef zeroext i1 @_ZN5Gowin12send_commandEh(ptr noundef nonnull align 8 dereferenceable(192) %25, i8 noundef zeroext 22)
  %109 = zext i1 %108 to i8
  store i8 %109, ptr %17, align 1, !tbaa !33
  %110 = load i8, ptr %17, align 1, !tbaa !33, !range !27, !noundef !28
  %111 = trunc i8 %110 to i1
  br i1 %111, label %113, label %112

112:                                              ; preds = %107
  store i32 -1, ptr %5, align 4
  store i32 1, ptr %18, align 4
  br label %163

113:                                              ; preds = %107
  %114 = getelementptr inbounds %class.Device, ptr %25, i32 0, i32 1
  %115 = load ptr, ptr %114, align 8, !tbaa !34
  call void @_ZN4Jtag9set_stateENS_10tapState_tEh(ptr noundef nonnull align 8 dereferenceable(193) %115, i32 noundef 7, i8 noundef zeroext 1)
  %116 = getelementptr inbounds %class.Device, ptr %25, i32 0, i32 1
  %117 = load ptr, ptr %116, align 8, !tbaa !34
  %118 = load ptr, ptr %8, align 8, !tbaa !5
  %119 = icmp ne ptr %118, null
  br i1 %119, label %120, label %121

120:                                              ; preds = %113
  br label %122

121:                                              ; preds = %113
  br label %122

122:                                              ; preds = %121, %120
  %123 = phi ptr [ %78, %120 ], [ null, %121 ]
  %124 = load i32, ptr %9, align 4, !tbaa !9
  %125 = mul i32 8, %124
  %126 = call noundef i32 @_ZN4Jtag7shiftDREPKhPhiNS_10tapState_tE(ptr noundef nonnull align 8 dereferenceable(193) %117, ptr noundef %75, ptr noundef %123, i32 noundef %125, i32 noundef 1)
  %127 = load ptr, ptr %8, align 8, !tbaa !5
  %128 = icmp ne ptr %127, null
  br i1 %128, label %129, label %162

129:                                              ; preds = %122
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #6
  store i32 0, ptr %19, align 4, !tbaa !9
  br label %130

130:                                              ; preds = %158, %129
  %131 = load i32, ptr %19, align 4, !tbaa !9
  %132 = load i32, ptr %9, align 4, !tbaa !9
  %133 = icmp ult i32 %131, %132
  br i1 %133, label %135, label %134

134:                                              ; preds = %130
  store i32 5, ptr %18, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #6
  br label %161

135:                                              ; preds = %130
  %136 = load i32, ptr %19, align 4, !tbaa !9
  %137 = zext i32 %136 to i64
  %138 = getelementptr inbounds i8, ptr %78, i64 %137
  %139 = load i8, ptr %138, align 1, !tbaa !29
  %140 = zext i8 %139 to i32
  %141 = ashr i32 %140, 1
  %142 = trunc i32 %141 to i8
  %143 = call noundef zeroext i8 @_ZN21ConfigBitstreamParser11reverseByteEh(i8 noundef zeroext %142)
  %144 = zext i8 %143 to i32
  %145 = load i32, ptr %19, align 4, !tbaa !9
  %146 = add i32 %145, 1
  %147 = zext i32 %146 to i64
  %148 = getelementptr inbounds i8, ptr %78, i64 %147
  %149 = load i8, ptr %148, align 1, !tbaa !29
  %150 = zext i8 %149 to i32
  %151 = and i32 %150, 1
  %152 = or i32 %144, %151
  %153 = trunc i32 %152 to i8
  %154 = load ptr, ptr %8, align 8, !tbaa !5
  %155 = load i32, ptr %19, align 4, !tbaa !9
  %156 = zext i32 %155 to i64
  %157 = getelementptr inbounds i8, ptr %154, i64 %156
  store i8 %153, ptr %157, align 1, !tbaa !29
  br label %158

158:                                              ; preds = %135
  %159 = load i32, ptr %19, align 4, !tbaa !9
  %160 = add i32 %159, 1
  store i32 %160, ptr %19, align 4, !tbaa !9
  br label %130, !llvm.loop !35

161:                                              ; preds = %134
  br label %162

162:                                              ; preds = %161, %122
  store i32 0, ptr %18, align 4
  br label %163

163:                                              ; preds = %162, %112
  call void @llvm.lifetime.end.p0(i64 1, ptr %17) #6
  %164 = load ptr, ptr %13, align 8
  call void @llvm.stackrestore.p0(ptr %164)
  %165 = load i32, ptr %18, align 4
  switch i32 %165, label %305 [
    i32 0, label %166
    i32 1, label %303
  ]

166:                                              ; preds = %163
  br label %302

167:                                              ; preds = %67
  call void @llvm.lifetime.start.p0(i64 1, ptr %20) #6
  %168 = getelementptr inbounds %class.Gowin, ptr %25, i32 0, i32 17
  %169 = load i8, ptr %168, align 1, !tbaa !36
  %170 = zext i8 %169 to i32
  %171 = getelementptr inbounds %class.Gowin, ptr %25, i32 0, i32 16
  %172 = load i8, ptr %171, align 2, !tbaa !37
  %173 = zext i8 %172 to i32
  %174 = or i32 %170, %173
  %175 = trunc i32 %174 to i8
  store i8 %175, ptr %20, align 1, !tbaa !29
  %176 = getelementptr inbounds %class.Gowin, ptr %25, i32 0, i32 14
  %177 = load i8, ptr %176, align 4, !tbaa !38
  %178 = zext i8 %177 to i32
  %179 = xor i32 %178, -1
  %180 = load i8, ptr %20, align 1, !tbaa !29
  %181 = zext i8 %180 to i32
  %182 = and i32 %181, %179
  %183 = trunc i32 %182 to i8
  store i8 %183, ptr %20, align 1, !tbaa !29
  call void @_ZN5Gowin15spi_gowin_writeEPKhPhj(ptr noundef nonnull align 8 dereferenceable(192) %25, ptr noundef %20, ptr noundef null, i32 noundef 8)
  %184 = getelementptr inbounds %class.Device, ptr %25, i32 0, i32 1
  %185 = load ptr, ptr %184, align 8, !tbaa !34
  call void @_ZN4Jtag5flushEv(ptr noundef nonnull align 8 dereferenceable(193) %185)
  call void @llvm.lifetime.start.p0(i64 4, ptr %21) #6
  store i32 0, ptr %21, align 4, !tbaa !9
  br label %186

186:                                              ; preds = %281, %167
  %187 = load i32, ptr %21, align 4, !tbaa !9
  %188 = load i32, ptr %9, align 4, !tbaa !9
  %189 = icmp ult i32 %187, %188
  br i1 %189, label %191, label %190

190:                                              ; preds = %186
  store i32 8, ptr %18, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %21) #6
  br label %284

191:                                              ; preds = %186
  %192 = load ptr, ptr %8, align 8, !tbaa !5
  %193 = icmp ne ptr %192, null
  br i1 %193, label %194, label %199

194:                                              ; preds = %191
  %195 = load ptr, ptr %8, align 8, !tbaa !5
  %196 = load i32, ptr %21, align 4, !tbaa !9
  %197 = zext i32 %196 to i64
  %198 = getelementptr inbounds i8, ptr %195, i64 %197
  store i8 0, ptr %198, align 1, !tbaa !29
  br label %199

199:                                              ; preds = %194, %191
  call void @llvm.lifetime.start.p0(i64 1, ptr %22) #6
  store i8 0, ptr %22, align 1, !tbaa !29
  call void @llvm.lifetime.start.p0(i64 1, ptr %23) #6
  store i8 -128, ptr %23, align 1, !tbaa !29
  br label %200

200:                                              ; preds = %273, %199
  %201 = load i8, ptr %22, align 1, !tbaa !29
  %202 = zext i8 %201 to i32
  %203 = icmp slt i32 %202, 8
  br i1 %203, label %205, label %204

204:                                              ; preds = %200
  store i32 11, ptr %18, align 4
  call void @llvm.lifetime.end.p0(i64 1, ptr %23) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr %22) #6
  br label %280

205:                                              ; preds = %200
  call void @llvm.lifetime.start.p0(i64 1, ptr %24) #6
  %206 = getelementptr inbounds %class.Gowin, ptr %25, i32 0, i32 17
  %207 = load i8, ptr %206, align 1, !tbaa !36
  %208 = zext i8 %207 to i32
  %209 = getelementptr inbounds %class.Gowin, ptr %25, i32 0, i32 16
  %210 = load i8, ptr %209, align 2, !tbaa !37
  %211 = zext i8 %210 to i32
  %212 = or i32 %208, %211
  %213 = trunc i32 %212 to i8
  store i8 %213, ptr %20, align 1, !tbaa !29
  %214 = load ptr, ptr %7, align 8, !tbaa !5
  %215 = icmp ne ptr %214, null
  br i1 %215, label %216, label %235

216:                                              ; preds = %205
  %217 = load ptr, ptr %7, align 8, !tbaa !5
  %218 = load i32, ptr %21, align 4, !tbaa !9
  %219 = zext i32 %218 to i64
  %220 = getelementptr inbounds i8, ptr %217, i64 %219
  %221 = load i8, ptr %220, align 1, !tbaa !29
  %222 = zext i8 %221 to i32
  %223 = load i8, ptr %23, align 1, !tbaa !29
  %224 = zext i8 %223 to i32
  %225 = and i32 %222, %224
  %226 = icmp ne i32 %225, 0
  br i1 %226, label %227, label %235

227:                                              ; preds = %216
  %228 = getelementptr inbounds %class.Gowin, ptr %25, i32 0, i32 15
  %229 = load i8, ptr %228, align 1, !tbaa !39
  %230 = zext i8 %229 to i32
  %231 = load i8, ptr %20, align 1, !tbaa !29
  %232 = zext i8 %231 to i32
  %233 = or i32 %232, %230
  %234 = trunc i32 %233 to i8
  store i8 %234, ptr %20, align 1, !tbaa !29
  br label %235

235:                                              ; preds = %227, %216, %205
  call void @_ZN5Gowin15spi_gowin_writeEPKhPhj(ptr noundef nonnull align 8 dereferenceable(192) %25, ptr noundef %20, ptr noundef null, i32 noundef 8)
  %236 = getelementptr inbounds %class.Gowin, ptr %25, i32 0, i32 13
  %237 = load i8, ptr %236, align 1, !tbaa !40
  %238 = zext i8 %237 to i32
  %239 = load i8, ptr %20, align 1, !tbaa !29
  %240 = zext i8 %239 to i32
  %241 = or i32 %240, %238
  %242 = trunc i32 %241 to i8
  store i8 %242, ptr %20, align 1, !tbaa !29
  %243 = load ptr, ptr %8, align 8, !tbaa !5
  %244 = icmp ne ptr %243, null
  br i1 %244, label %245, label %246

245:                                              ; preds = %235
  br label %247

246:                                              ; preds = %235
  br label %247

247:                                              ; preds = %246, %245
  %248 = phi ptr [ %24, %245 ], [ null, %246 ]
  call void @_ZN5Gowin15spi_gowin_writeEPKhPhj(ptr noundef nonnull align 8 dereferenceable(192) %25, ptr noundef %20, ptr noundef %248, i32 noundef 8)
  %249 = getelementptr inbounds %class.Device, ptr %25, i32 0, i32 1
  %250 = load ptr, ptr %249, align 8, !tbaa !34
  call void @_ZN4Jtag5flushEv(ptr noundef nonnull align 8 dereferenceable(193) %250)
  %251 = load ptr, ptr %8, align 8, !tbaa !5
  %252 = icmp ne ptr %251, null
  br i1 %252, label %253, label %272

253:                                              ; preds = %247
  %254 = load i8, ptr %24, align 1, !tbaa !29
  %255 = zext i8 %254 to i32
  %256 = getelementptr inbounds %class.Gowin, ptr %25, i32 0, i32 16
  %257 = load i8, ptr %256, align 2, !tbaa !37
  %258 = zext i8 %257 to i32
  %259 = and i32 %255, %258
  %260 = icmp ne i32 %259, 0
  br i1 %260, label %261, label %272

261:                                              ; preds = %253
  %262 = load i8, ptr %23, align 1, !tbaa !29
  %263 = zext i8 %262 to i32
  %264 = load ptr, ptr %8, align 8, !tbaa !5
  %265 = load i32, ptr %21, align 4, !tbaa !9
  %266 = zext i32 %265 to i64
  %267 = getelementptr inbounds i8, ptr %264, i64 %266
  %268 = load i8, ptr %267, align 1, !tbaa !29
  %269 = zext i8 %268 to i32
  %270 = or i32 %269, %263
  %271 = trunc i32 %270 to i8
  store i8 %271, ptr %267, align 1, !tbaa !29
  br label %272

272:                                              ; preds = %261, %253, %247
  call void @llvm.lifetime.end.p0(i64 1, ptr %24) #6
  br label %273

273:                                              ; preds = %272
  %274 = load i8, ptr %22, align 1, !tbaa !29
  %275 = add i8 %274, 1
  store i8 %275, ptr %22, align 1, !tbaa !29
  %276 = load i8, ptr %23, align 1, !tbaa !29
  %277 = zext i8 %276 to i32
  %278 = ashr i32 %277, 1
  %279 = trunc i32 %278 to i8
  store i8 %279, ptr %23, align 1, !tbaa !29
  br label %200, !llvm.loop !41

280:                                              ; preds = %204
  br label %281

281:                                              ; preds = %280
  %282 = load i32, ptr %21, align 4, !tbaa !9
  %283 = add i32 %282, 1
  store i32 %283, ptr %21, align 4, !tbaa !9
  br label %186, !llvm.loop !42

284:                                              ; preds = %190
  %285 = getelementptr inbounds %class.Gowin, ptr %25, i32 0, i32 13
  %286 = load i8, ptr %285, align 1, !tbaa !40
  %287 = zext i8 %286 to i32
  %288 = xor i32 %287, -1
  %289 = load i8, ptr %20, align 1, !tbaa !29
  %290 = zext i8 %289 to i32
  %291 = and i32 %290, %288
  %292 = trunc i32 %291 to i8
  store i8 %292, ptr %20, align 1, !tbaa !29
  %293 = getelementptr inbounds %class.Gowin, ptr %25, i32 0, i32 14
  %294 = load i8, ptr %293, align 4, !tbaa !38
  %295 = zext i8 %294 to i32
  %296 = load i8, ptr %20, align 1, !tbaa !29
  %297 = zext i8 %296 to i32
  %298 = or i32 %297, %295
  %299 = trunc i32 %298 to i8
  store i8 %299, ptr %20, align 1, !tbaa !29
  call void @_ZN5Gowin15spi_gowin_writeEPKhPhj(ptr noundef nonnull align 8 dereferenceable(192) %25, ptr noundef %20, ptr noundef null, i32 noundef 8)
  %300 = getelementptr inbounds %class.Device, ptr %25, i32 0, i32 1
  %301 = load ptr, ptr %300, align 8, !tbaa !34
  call void @_ZN4Jtag5flushEv(ptr noundef nonnull align 8 dereferenceable(193) %301)
  call void @llvm.lifetime.end.p0(i64 1, ptr %20) #6
  br label %302

302:                                              ; preds = %284, %166
  store i32 0, ptr %5, align 4
  br label %303

303:                                              ; preds = %302, %163, %64
  %304 = load i32, ptr %5, align 4
  ret i32 %304

305:                                              ; preds = %163
  unreachable
}

declare noundef zeroext i8 @_ZN21ConfigBitstreamParser11reverseByteEh(i8 noundef zeroext) #1

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

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { "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: readwrite) }
attributes #4 = { nocallback nofree nosync nounwind willreturn }
attributes #5 = { inlinehint 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 #6 = { nounwind }

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = !{!12, !18, i64 176}
!12 = !{!"_ZTS5Gowin", !13, i64 0, !19, i64 88, !20, i64 144, !20, i64 152, !20, i64 160, !10, i64 168, !18, i64 172, !18, i64 173, !18, i64 174, !18, i64 175, !18, i64 176, !18, i64 177, !18, i64 178, !7, i64 179, !7, i64 180, !7, i64 181, !7, i64 182, !7, i64 183, !26, i64 184, !26, i64 188}
!13 = !{!"_ZTS6Device", !6, i64 8, !14, i64 16, !14, i64 48, !17, i64 80, !18, i64 84, !18, i64 85, !18, i64 86}
!14 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE", !15, i64 0, !16, i64 8, !7, i64 16}
!15 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_Alloc_hiderE", !6, i64 0}
!16 = !{!"long", !7, i64 0}
!17 = !{!"_ZTSN6Device9prog_modeE", !7, i64 0}
!18 = !{!"bool", !7, i64 0}
!19 = !{!"_ZTS12SPIInterface", !7, i64 8, !10, i64 12, !18, i64 16, !18, i64 17, !18, i64 18, !14, i64 24}
!20 = !{!"_ZTSSt10unique_ptrI21ConfigBitstreamParserSt14default_deleteIS0_EE", !21, i64 0}
!21 = !{!"_ZTSSt15__uniq_ptr_dataI21ConfigBitstreamParserSt14default_deleteIS0_ELb1ELb1EE", !22, i64 0}
!22 = !{!"_ZTSSt15__uniq_ptr_implI21ConfigBitstreamParserSt14default_deleteIS0_EE", !23, i64 0}
!23 = !{!"_ZTSSt5tupleIJP21ConfigBitstreamParserSt14default_deleteIS0_EEE", !24, i64 0}
!24 = !{!"_ZTSSt11_Tuple_implILm0EJP21ConfigBitstreamParserSt14default_deleteIS0_EEE", !25, i64 0}
!25 = !{!"_ZTSSt10_Head_baseILm0EP21ConfigBitstreamParserLb0EE", !6, i64 0}
!26 = !{!"_ZTSN13JtagInterface10tck_edge_tE", !7, i64 0}
!27 = !{i8 0, i8 2}
!28 = !{}
!29 = !{!7, !7, i64 0}
!30 = !{!12, !18, i64 175}
!31 = distinct !{!31, !32}
!32 = !{!"llvm.loop.mustprogress"}
!33 = !{!18, !18, i64 0}
!34 = !{!13, !6, i64 8}
!35 = distinct !{!35, !32}
!36 = !{!12, !7, i64 183}
!37 = !{!12, !7, i64 182}
!38 = !{!12, !7, i64 180}
!39 = !{!12, !7, i64 181}
!40 = !{!12, !7, i64 179}
!41 = distinct !{!41, !32}
!42 = distinct !{!42, !32}


; 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"

; 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 nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #0

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

; 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 #1

; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #3

; 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 uwtable
declare dso_local noundef i32 @_ZN5Gowin12spi_put_gw5aEhPKhPhj(ptr noundef nonnull align 8 dereferenceable(192), i8 noundef zeroext, ptr noundef, ptr noundef, i32 noundef) local_unnamed_addr #2 align 2

; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare ptr @llvm.stacksave.p0() #4

; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare void @llvm.stackrestore.p0(ptr) #4

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_ZN5Gowin7spi_putEPKhPhj(ptr noundef nonnull align 8 dereferenceable(192) %0, ptr noundef %1, ptr noundef %2, i32 noundef %3) unnamed_addr #2 align 2 {
  %5 = alloca i8, align 1
  %6 = alloca i8, align 1
  %7 = getelementptr inbounds i8, ptr %0, i64 176
  %8 = load i8, ptr %7, align 8, !tbaa !5, !range !25, !noundef !26
  %9 = trunc nuw i8 %8 to i1
  br i1 %9, label %10, label %25

10:                                               ; preds = %4
  %11 = zext i32 %3 to i64
  %12 = tail call ptr @llvm.stacksave.p0()
  %13 = alloca i8, i64 %11, align 16
  %14 = load i8, ptr %1, align 1, !tbaa !27
  %15 = icmp ugt i32 %3, 1
  %16 = getelementptr inbounds i8, ptr %1, i64 1
  %17 = select i1 %15, ptr %16, ptr null
  %.not73 = icmp eq ptr %2, null
  %18 = select i1 %.not73, ptr null, ptr %13
  %19 = add i32 %3, -1
  %20 = call noundef i32 @_ZN5Gowin12spi_put_gw5aEhPKhPhj(ptr noundef nonnull align 8 dereferenceable(192) %0, i8 noundef zeroext %14, ptr noundef %17, ptr noundef %18, i32 noundef %19)
  br i1 %.not73, label %24, label %21

21:                                               ; preds = %10
  store i8 0, ptr %2, align 1, !tbaa !27
  %22 = getelementptr inbounds i8, ptr %2, i64 1
  %23 = zext i32 %19 to i64
  call void @llvm.memcpy.p0.p0.i64(ptr nonnull align 1 %22, ptr nonnull align 16 %13, i64 %23, i1 false)
  br label %24

24:                                               ; preds = %21, %10
  call void @llvm.stackrestore.p0(ptr %12)
  br label %263

25:                                               ; preds = %4
  %26 = getelementptr inbounds i8, ptr %0, i64 175
  %27 = load i8, ptr %26, align 1, !tbaa !28, !range !25, !noundef !26
  %28 = trunc nuw i8 %27 to i1
  br i1 %28, label %29, label %55

29:                                               ; preds = %25
  %30 = zext i32 %3 to i64
  %31 = tail call ptr @llvm.stacksave.p0()
  %32 = alloca i8, i64 %30, align 16
  %33 = alloca i8, i64 %30, align 16
  %.not71 = icmp eq ptr %2, null
  %34 = add i32 %3, 1
  %spec.select = select i1 %.not71, i32 %3, i32 %34
  %.not72 = icmp ne ptr %1, null
  %35 = icmp ne i32 %spec.select, 0
  %or.cond = and i1 %.not72, %35
  br i1 %or.cond, label %.lr.ph84.preheader, label %.loopexit

.lr.ph84.preheader:                               ; preds = %29
  %wide.trip.count105 = zext i32 %spec.select to i64
  br label %.lr.ph84

.lr.ph84:                                         ; preds = %.lr.ph84.preheader, %.lr.ph84
  %indvars.iv102 = phi i64 [ 0, %.lr.ph84.preheader ], [ %indvars.iv.next103, %.lr.ph84 ]
  %36 = getelementptr inbounds i8, ptr %1, i64 %indvars.iv102
  %37 = load i8, ptr %36, align 1, !tbaa !27
  %38 = tail call noundef zeroext i8 @_ZN21ConfigBitstreamParser11reverseByteEh(i8 noundef zeroext %37)
  %39 = getelementptr inbounds i8, ptr %32, i64 %indvars.iv102
  store i8 %38, ptr %39, align 1, !tbaa !27
  %indvars.iv.next103 = add nuw nsw i64 %indvars.iv102, 1
  %exitcond106.not = icmp eq i64 %indvars.iv.next103, %wide.trip.count105
  br i1 %exitcond106.not, label %.loopexit, label %.lr.ph84, !llvm.loop !29

.loopexit:                                        ; preds = %.lr.ph84, %29
  %40 = tail call noundef zeroext i1 @_ZN5Gowin12send_commandEh(ptr noundef nonnull align 8 dereferenceable(192) %0, i8 noundef zeroext 22)
  br i1 %40, label %41, label %.thread75

.thread75:                                        ; preds = %.loopexit
  tail call void @llvm.stackrestore.p0(ptr %31)
  br label %263

41:                                               ; preds = %.loopexit
  %42 = getelementptr inbounds i8, ptr %0, i64 8
  %43 = load ptr, ptr %42, align 8, !tbaa !31
  tail call void @_ZN4Jtag9set_stateENS_10tapState_tEh(ptr noundef nonnull align 8 dereferenceable(193) %43, i32 noundef 7, i8 noundef zeroext 1)
  %44 = load ptr, ptr %42, align 8, !tbaa !31
  %. = select i1 %.not71, ptr null, ptr %33
  %45 = shl i32 %spec.select, 3
  %46 = call noundef i32 @_ZN4Jtag7shiftDREPKhPhiNS_10tapState_tE(ptr noundef nonnull align 8 dereferenceable(193) %44, ptr noundef nonnull %32, ptr noundef %., i32 noundef %45, i32 noundef 1)
  br i1 %.not71, label %.thread, label %.preheader

.preheader:                                       ; preds = %41
  %.not89 = icmp eq i32 %34, 0
  br i1 %.not89, label %._crit_edge87, label %.lr.ph86.preheader

.lr.ph86.preheader:                               ; preds = %.preheader
  %wide.trip.count110 = zext i32 %34 to i64
  %.pre = load i8, ptr %33, align 16, !tbaa !27
  br label %.lr.ph86

.thread:                                          ; preds = %41
  call void @llvm.stackrestore.p0(ptr %31)
  br label %263

.lr.ph86:                                         ; preds = %.lr.ph86.preheader, %.lr.ph86
  %47 = phi i8 [ %.pre, %.lr.ph86.preheader ], [ %51, %.lr.ph86 ]
  %indvars.iv107 = phi i64 [ 0, %.lr.ph86.preheader ], [ %indvars.iv.next108, %.lr.ph86 ]
  %48 = lshr i8 %47, 1
  %49 = call noundef zeroext i8 @_ZN21ConfigBitstreamParser11reverseByteEh(i8 noundef zeroext %48)
  %indvars.iv.next108 = add nuw nsw i64 %indvars.iv107, 1
  %50 = getelementptr inbounds i8, ptr %33, i64 %indvars.iv.next108
  %51 = load i8, ptr %50, align 1, !tbaa !27
  %52 = and i8 %51, 1
  %53 = or i8 %52, %49
  %54 = getelementptr inbounds i8, ptr %2, i64 %indvars.iv107
  store i8 %53, ptr %54, align 1, !tbaa !27
  %exitcond111.not = icmp eq i64 %indvars.iv.next108, %wide.trip.count110
  br i1 %exitcond111.not, label %._crit_edge87, label %.lr.ph86, !llvm.loop !32

._crit_edge87:                                    ; preds = %.lr.ph86, %.preheader
  call void @llvm.stackrestore.p0(ptr %31)
  br label %263

55:                                               ; preds = %25
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %5) #6
  %56 = getelementptr inbounds i8, ptr %0, i64 183
  %57 = load i8, ptr %56, align 1, !tbaa !33
  %58 = getelementptr inbounds i8, ptr %0, i64 182
  %59 = load i8, ptr %58, align 2, !tbaa !34
  %60 = or i8 %59, %57
  %61 = getelementptr inbounds i8, ptr %0, i64 180
  %62 = load i8, ptr %61, align 4, !tbaa !35
  %63 = xor i8 %62, -1
  %64 = and i8 %60, %63
  store i8 %64, ptr %5, align 1, !tbaa !27
  call void @_ZN5Gowin15spi_gowin_writeEPKhPhj(ptr noundef nonnull align 8 dereferenceable(192) %0, ptr noundef nonnull %5, ptr noundef null, i32 noundef 8)
  %65 = getelementptr inbounds i8, ptr %0, i64 8
  %66 = load ptr, ptr %65, align 8, !tbaa !31
  call void @_ZN4Jtag5flushEv(ptr noundef nonnull align 8 dereferenceable(193) %66)
  %.not88 = icmp eq i32 %3, 0
  br i1 %.not88, label %._crit_edge, label %.lr.ph

.lr.ph:                                           ; preds = %55
  %.not = icmp eq ptr %2, null
  %.not68 = icmp eq ptr %1, null
  %67 = getelementptr inbounds i8, ptr %0, i64 181
  %68 = getelementptr inbounds i8, ptr %0, i64 179
  %.1 = select i1 %.not, ptr null, ptr %6
  br i1 %.not, label %.lr.ph.split.us, label %.split.preheader

.split.preheader:                                 ; preds = %.lr.ph
  %wide.trip.count = zext i32 %3 to i64
  br label %.split

.lr.ph.split.us:                                  ; preds = %.lr.ph
  br i1 %.not68, label %.split.us.us.us, label %.split.us.us.preheader

.split.us.us.preheader:                           ; preds = %.lr.ph.split.us
  %wide.trip.count98 = zext i32 %3 to i64
  br label %.split.us.us

.split.us.us.us:                                  ; preds = %.lr.ph.split.us, %.split.us.us.us
  %.05782.us.us = phi i32 [ %125, %.split.us.us.us ], [ 0, %.lr.ph.split.us ]
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %6) #6
  %69 = load i8, ptr %56, align 1, !tbaa !33
  %70 = load i8, ptr %58, align 2, !tbaa !34
  %71 = or i8 %70, %69
  store i8 %71, ptr %5, align 1, !tbaa !27
  call void @_ZN5Gowin15spi_gowin_writeEPKhPhj(ptr noundef nonnull align 8 dereferenceable(192) %0, ptr noundef nonnull %5, ptr noundef null, i32 noundef 8)
  %72 = load i8, ptr %68, align 1, !tbaa !36
  %73 = load i8, ptr %5, align 1, !tbaa !27
  %74 = or i8 %73, %72
  store i8 %74, ptr %5, align 1, !tbaa !27
  call void @_ZN5Gowin15spi_gowin_writeEPKhPhj(ptr noundef nonnull align 8 dereferenceable(192) %0, ptr noundef nonnull %5, ptr noundef %.1, i32 noundef 8)
  %75 = load ptr, ptr %65, align 8, !tbaa !31
  call void @_ZN4Jtag5flushEv(ptr noundef nonnull align 8 dereferenceable(193) %75)
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %6) #6
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %6) #6
  %76 = load i8, ptr %56, align 1, !tbaa !33
  %77 = load i8, ptr %58, align 2, !tbaa !34
  %78 = or i8 %77, %76
  store i8 %78, ptr %5, align 1, !tbaa !27
  call void @_ZN5Gowin15spi_gowin_writeEPKhPhj(ptr noundef nonnull align 8 dereferenceable(192) %0, ptr noundef nonnull %5, ptr noundef null, i32 noundef 8)
  %79 = load i8, ptr %68, align 1, !tbaa !36
  %80 = load i8, ptr %5, align 1, !tbaa !27
  %81 = or i8 %80, %79
  store i8 %81, ptr %5, align 1, !tbaa !27
  call void @_ZN5Gowin15spi_gowin_writeEPKhPhj(ptr noundef nonnull align 8 dereferenceable(192) %0, ptr noundef nonnull %5, ptr noundef %.1, i32 noundef 8)
  %82 = load ptr, ptr %65, align 8, !tbaa !31
  call void @_ZN4Jtag5flushEv(ptr noundef nonnull align 8 dereferenceable(193) %82)
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %6) #6
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %6) #6
  %83 = load i8, ptr %56, align 1, !tbaa !33
  %84 = load i8, ptr %58, align 2, !tbaa !34
  %85 = or i8 %84, %83
  store i8 %85, ptr %5, align 1, !tbaa !27
  call void @_ZN5Gowin15spi_gowin_writeEPKhPhj(ptr noundef nonnull align 8 dereferenceable(192) %0, ptr noundef nonnull %5, ptr noundef null, i32 noundef 8)
  %86 = load i8, ptr %68, align 1, !tbaa !36
  %87 = load i8, ptr %5, align 1, !tbaa !27
  %88 = or i8 %87, %86
  store i8 %88, ptr %5, align 1, !tbaa !27
  call void @_ZN5Gowin15spi_gowin_writeEPKhPhj(ptr noundef nonnull align 8 dereferenceable(192) %0, ptr noundef nonnull %5, ptr noundef %.1, i32 noundef 8)
  %89 = load ptr, ptr %65, align 8, !tbaa !31
  call void @_ZN4Jtag5flushEv(ptr noundef nonnull align 8 dereferenceable(193) %89)
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %6) #6
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %6) #6
  %90 = load i8, ptr %56, align 1, !tbaa !33
  %91 = load i8, ptr %58, align 2, !tbaa !34
  %92 = or i8 %91, %90
  store i8 %92, ptr %5, align 1, !tbaa !27
  call void @_ZN5Gowin15spi_gowin_writeEPKhPhj(ptr noundef nonnull align 8 dereferenceable(192) %0, ptr noundef nonnull %5, ptr noundef null, i32 noundef 8)
  %93 = load i8, ptr %68, align 1, !tbaa !36
  %94 = load i8, ptr %5, align 1, !tbaa !27
  %95 = or i8 %94, %93
  store i8 %95, ptr %5, align 1, !tbaa !27
  call void @_ZN5Gowin15spi_gowin_writeEPKhPhj(ptr noundef nonnull align 8 dereferenceable(192) %0, ptr noundef nonnull %5, ptr noundef %.1, i32 noundef 8)
  %96 = load ptr, ptr %65, align 8, !tbaa !31
  call void @_ZN4Jtag5flushEv(ptr noundef nonnull align 8 dereferenceable(193) %96)
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %6) #6
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %6) #6
  %97 = load i8, ptr %56, align 1, !tbaa !33
  %98 = load i8, ptr %58, align 2, !tbaa !34
  %99 = or i8 %98, %97
  store i8 %99, ptr %5, align 1, !tbaa !27
  call void @_ZN5Gowin15spi_gowin_writeEPKhPhj(ptr noundef nonnull align 8 dereferenceable(192) %0, ptr noundef nonnull %5, ptr noundef null, i32 noundef 8)
  %100 = load i8, ptr %68, align 1, !tbaa !36
  %101 = load i8, ptr %5, align 1, !tbaa !27
  %102 = or i8 %101, %100
  store i8 %102, ptr %5, align 1, !tbaa !27
  call void @_ZN5Gowin15spi_gowin_writeEPKhPhj(ptr noundef nonnull align 8 dereferenceable(192) %0, ptr noundef nonnull %5, ptr noundef %.1, i32 noundef 8)
  %103 = load ptr, ptr %65, align 8, !tbaa !31
  call void @_ZN4Jtag5flushEv(ptr noundef nonnull align 8 dereferenceable(193) %103)
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %6) #6
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %6) #6
  %104 = load i8, ptr %56, align 1, !tbaa !33
  %105 = load i8, ptr %58, align 2, !tbaa !34
  %106 = or i8 %105, %104
  store i8 %106, ptr %5, align 1, !tbaa !27
  call void @_ZN5Gowin15spi_gowin_writeEPKhPhj(ptr noundef nonnull align 8 dereferenceable(192) %0, ptr noundef nonnull %5, ptr noundef null, i32 noundef 8)
  %107 = load i8, ptr %68, align 1, !tbaa !36
  %108 = load i8, ptr %5, align 1, !tbaa !27
  %109 = or i8 %108, %107
  store i8 %109, ptr %5, align 1, !tbaa !27
  call void @_ZN5Gowin15spi_gowin_writeEPKhPhj(ptr noundef nonnull align 8 dereferenceable(192) %0, ptr noundef nonnull %5, ptr noundef %.1, i32 noundef 8)
  %110 = load ptr, ptr %65, align 8, !tbaa !31
  call void @_ZN4Jtag5flushEv(ptr noundef nonnull align 8 dereferenceable(193) %110)
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %6) #6
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %6) #6
  %111 = load i8, ptr %56, align 1, !tbaa !33
  %112 = load i8, ptr %58, align 2, !tbaa !34
  %113 = or i8 %112, %111
  store i8 %113, ptr %5, align 1, !tbaa !27
  call void @_ZN5Gowin15spi_gowin_writeEPKhPhj(ptr noundef nonnull align 8 dereferenceable(192) %0, ptr noundef nonnull %5, ptr noundef null, i32 noundef 8)
  %114 = load i8, ptr %68, align 1, !tbaa !36
  %115 = load i8, ptr %5, align 1, !tbaa !27
  %116 = or i8 %115, %114
  store i8 %116, ptr %5, align 1, !tbaa !27
  call void @_ZN5Gowin15spi_gowin_writeEPKhPhj(ptr noundef nonnull align 8 dereferenceable(192) %0, ptr noundef nonnull %5, ptr noundef %.1, i32 noundef 8)
  %117 = load ptr, ptr %65, align 8, !tbaa !31
  call void @_ZN4Jtag5flushEv(ptr noundef nonnull align 8 dereferenceable(193) %117)
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %6) #6
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %6) #6
  %118 = load i8, ptr %56, align 1, !tbaa !33
  %119 = load i8, ptr %58, align 2, !tbaa !34
  %120 = or i8 %119, %118
  store i8 %120, ptr %5, align 1, !tbaa !27
  call void @_ZN5Gowin15spi_gowin_writeEPKhPhj(ptr noundef nonnull align 8 dereferenceable(192) %0, ptr noundef nonnull %5, ptr noundef null, i32 noundef 8)
  %121 = load i8, ptr %68, align 1, !tbaa !36
  %122 = load i8, ptr %5, align 1, !tbaa !27
  %123 = or i8 %122, %121
  store i8 %123, ptr %5, align 1, !tbaa !27
  call void @_ZN5Gowin15spi_gowin_writeEPKhPhj(ptr noundef nonnull align 8 dereferenceable(192) %0, ptr noundef nonnull %5, ptr noundef %.1, i32 noundef 8)
  %124 = load ptr, ptr %65, align 8, !tbaa !31
  call void @_ZN4Jtag5flushEv(ptr noundef nonnull align 8 dereferenceable(193) %124)
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %6) #6
  %125 = add nuw i32 %.05782.us.us, 1
  %exitcond101.not = icmp eq i32 %125, %3
  br i1 %exitcond101.not, label %._crit_edge, label %.split.us.us.us, !llvm.loop !37

.split.us.us:                                     ; preds = %.split.us.us.preheader, %.split81.us.us.split
  %indvars.iv95 = phi i64 [ 0, %.split.us.us.preheader ], [ %indvars.iv.next96, %.split81.us.us.split ]
  %126 = getelementptr inbounds i8, ptr %1, i64 %indvars.iv95
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %6) #6
  %127 = load i8, ptr %56, align 1, !tbaa !33
  %128 = load i8, ptr %58, align 2, !tbaa !34
  %129 = or i8 %128, %127
  store i8 %129, ptr %5, align 1, !tbaa !27
  %130 = load i8, ptr %126, align 1, !tbaa !27
  %.not69.us.us = icmp sgt i8 %130, -1
  br i1 %.not69.us.us, label %134, label %131

131:                                              ; preds = %.split.us.us
  %132 = load i8, ptr %67, align 1, !tbaa !38
  %133 = or i8 %132, %129
  store i8 %133, ptr %5, align 1, !tbaa !27
  br label %134

134:                                              ; preds = %131, %.split.us.us
  call void @_ZN5Gowin15spi_gowin_writeEPKhPhj(ptr noundef nonnull align 8 dereferenceable(192) %0, ptr noundef nonnull %5, ptr noundef null, i32 noundef 8)
  %135 = load i8, ptr %68, align 1, !tbaa !36
  %136 = load i8, ptr %5, align 1, !tbaa !27
  %137 = or i8 %136, %135
  store i8 %137, ptr %5, align 1, !tbaa !27
  call void @_ZN5Gowin15spi_gowin_writeEPKhPhj(ptr noundef nonnull align 8 dereferenceable(192) %0, ptr noundef nonnull %5, ptr noundef %.1, i32 noundef 8)
  %138 = load ptr, ptr %65, align 8, !tbaa !31
  call void @_ZN4Jtag5flushEv(ptr noundef nonnull align 8 dereferenceable(193) %138)
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %6) #6
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %6) #6
  %139 = load i8, ptr %56, align 1, !tbaa !33
  %140 = load i8, ptr %58, align 2, !tbaa !34
  %141 = or i8 %140, %139
  store i8 %141, ptr %5, align 1, !tbaa !27
  %142 = load i8, ptr %126, align 1, !tbaa !27
  %143 = and i8 %142, 64
  %.not69.us.us.1 = icmp eq i8 %143, 0
  br i1 %.not69.us.us.1, label %147, label %144

144:                                              ; preds = %134
  %145 = load i8, ptr %67, align 1, !tbaa !38
  %146 = or i8 %145, %141
  store i8 %146, ptr %5, align 1, !tbaa !27
  br label %147

147:                                              ; preds = %144, %134
  call void @_ZN5Gowin15spi_gowin_writeEPKhPhj(ptr noundef nonnull align 8 dereferenceable(192) %0, ptr noundef nonnull %5, ptr noundef null, i32 noundef 8)
  %148 = load i8, ptr %68, align 1, !tbaa !36
  %149 = load i8, ptr %5, align 1, !tbaa !27
  %150 = or i8 %149, %148
  store i8 %150, ptr %5, align 1, !tbaa !27
  call void @_ZN5Gowin15spi_gowin_writeEPKhPhj(ptr noundef nonnull align 8 dereferenceable(192) %0, ptr noundef nonnull %5, ptr noundef %.1, i32 noundef 8)
  %151 = load ptr, ptr %65, align 8, !tbaa !31
  call void @_ZN4Jtag5flushEv(ptr noundef nonnull align 8 dereferenceable(193) %151)
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %6) #6
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %6) #6
  %152 = load i8, ptr %56, align 1, !tbaa !33
  %153 = load i8, ptr %58, align 2, !tbaa !34
  %154 = or i8 %153, %152
  store i8 %154, ptr %5, align 1, !tbaa !27
  %155 = load i8, ptr %126, align 1, !tbaa !27
  %156 = and i8 %155, 32
  %.not69.us.us.2 = icmp eq i8 %156, 0
  br i1 %.not69.us.us.2, label %160, label %157

157:                                              ; preds = %147
  %158 = load i8, ptr %67, align 1, !tbaa !38
  %159 = or i8 %158, %154
  store i8 %159, ptr %5, align 1, !tbaa !27
  br label %160

160:                                              ; preds = %157, %147
  call void @_ZN5Gowin15spi_gowin_writeEPKhPhj(ptr noundef nonnull align 8 dereferenceable(192) %0, ptr noundef nonnull %5, ptr noundef null, i32 noundef 8)
  %161 = load i8, ptr %68, align 1, !tbaa !36
  %162 = load i8, ptr %5, align 1, !tbaa !27
  %163 = or i8 %162, %161
  store i8 %163, ptr %5, align 1, !tbaa !27
  call void @_ZN5Gowin15spi_gowin_writeEPKhPhj(ptr noundef nonnull align 8 dereferenceable(192) %0, ptr noundef nonnull %5, ptr noundef %.1, i32 noundef 8)
  %164 = load ptr, ptr %65, align 8, !tbaa !31
  call void @_ZN4Jtag5flushEv(ptr noundef nonnull align 8 dereferenceable(193) %164)
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %6) #6
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %6) #6
  %165 = load i8, ptr %56, align 1, !tbaa !33
  %166 = load i8, ptr %58, align 2, !tbaa !34
  %167 = or i8 %166, %165
  store i8 %167, ptr %5, align 1, !tbaa !27
  %168 = load i8, ptr %126, align 1, !tbaa !27
  %169 = and i8 %168, 16
  %.not69.us.us.3 = icmp eq i8 %169, 0
  br i1 %.not69.us.us.3, label %173, label %170

170:                                              ; preds = %160
  %171 = load i8, ptr %67, align 1, !tbaa !38
  %172 = or i8 %171, %167
  store i8 %172, ptr %5, align 1, !tbaa !27
  br label %173

173:                                              ; preds = %170, %160
  call void @_ZN5Gowin15spi_gowin_writeEPKhPhj(ptr noundef nonnull align 8 dereferenceable(192) %0, ptr noundef nonnull %5, ptr noundef null, i32 noundef 8)
  %174 = load i8, ptr %68, align 1, !tbaa !36
  %175 = load i8, ptr %5, align 1, !tbaa !27
  %176 = or i8 %175, %174
  store i8 %176, ptr %5, align 1, !tbaa !27
  call void @_ZN5Gowin15spi_gowin_writeEPKhPhj(ptr noundef nonnull align 8 dereferenceable(192) %0, ptr noundef nonnull %5, ptr noundef %.1, i32 noundef 8)
  %177 = load ptr, ptr %65, align 8, !tbaa !31
  call void @_ZN4Jtag5flushEv(ptr noundef nonnull align 8 dereferenceable(193) %177)
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %6) #6
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %6) #6
  %178 = load i8, ptr %56, align 1, !tbaa !33
  %179 = load i8, ptr %58, align 2, !tbaa !34
  %180 = or i8 %179, %178
  store i8 %180, ptr %5, align 1, !tbaa !27
  %181 = load i8, ptr %126, align 1, !tbaa !27
  %182 = and i8 %181, 8
  %.not69.us.us.4 = icmp eq i8 %182, 0
  br i1 %.not69.us.us.4, label %186, label %183

183:                                              ; preds = %173
  %184 = load i8, ptr %67, align 1, !tbaa !38
  %185 = or i8 %184, %180
  store i8 %185, ptr %5, align 1, !tbaa !27
  br label %186

186:                                              ; preds = %183, %173
  call void @_ZN5Gowin15spi_gowin_writeEPKhPhj(ptr noundef nonnull align 8 dereferenceable(192) %0, ptr noundef nonnull %5, ptr noundef null, i32 noundef 8)
  %187 = load i8, ptr %68, align 1, !tbaa !36
  %188 = load i8, ptr %5, align 1, !tbaa !27
  %189 = or i8 %188, %187
  store i8 %189, ptr %5, align 1, !tbaa !27
  call void @_ZN5Gowin15spi_gowin_writeEPKhPhj(ptr noundef nonnull align 8 dereferenceable(192) %0, ptr noundef nonnull %5, ptr noundef %.1, i32 noundef 8)
  %190 = load ptr, ptr %65, align 8, !tbaa !31
  call void @_ZN4Jtag5flushEv(ptr noundef nonnull align 8 dereferenceable(193) %190)
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %6) #6
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %6) #6
  %191 = load i8, ptr %56, align 1, !tbaa !33
  %192 = load i8, ptr %58, align 2, !tbaa !34
  %193 = or i8 %192, %191
  store i8 %193, ptr %5, align 1, !tbaa !27
  %194 = load i8, ptr %126, align 1, !tbaa !27
  %195 = and i8 %194, 4
  %.not69.us.us.5 = icmp eq i8 %195, 0
  br i1 %.not69.us.us.5, label %199, label %196

196:                                              ; preds = %186
  %197 = load i8, ptr %67, align 1, !tbaa !38
  %198 = or i8 %197, %193
  store i8 %198, ptr %5, align 1, !tbaa !27
  br label %199

199:                                              ; preds = %196, %186
  call void @_ZN5Gowin15spi_gowin_writeEPKhPhj(ptr noundef nonnull align 8 dereferenceable(192) %0, ptr noundef nonnull %5, ptr noundef null, i32 noundef 8)
  %200 = load i8, ptr %68, align 1, !tbaa !36
  %201 = load i8, ptr %5, align 1, !tbaa !27
  %202 = or i8 %201, %200
  store i8 %202, ptr %5, align 1, !tbaa !27
  call void @_ZN5Gowin15spi_gowin_writeEPKhPhj(ptr noundef nonnull align 8 dereferenceable(192) %0, ptr noundef nonnull %5, ptr noundef %.1, i32 noundef 8)
  %203 = load ptr, ptr %65, align 8, !tbaa !31
  call void @_ZN4Jtag5flushEv(ptr noundef nonnull align 8 dereferenceable(193) %203)
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %6) #6
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %6) #6
  %204 = load i8, ptr %56, align 1, !tbaa !33
  %205 = load i8, ptr %58, align 2, !tbaa !34
  %206 = or i8 %205, %204
  store i8 %206, ptr %5, align 1, !tbaa !27
  %207 = load i8, ptr %126, align 1, !tbaa !27
  %208 = and i8 %207, 2
  %.not69.us.us.6 = icmp eq i8 %208, 0
  br i1 %.not69.us.us.6, label %212, label %209

209:                                              ; preds = %199
  %210 = load i8, ptr %67, align 1, !tbaa !38
  %211 = or i8 %210, %206
  store i8 %211, ptr %5, align 1, !tbaa !27
  br label %212

212:                                              ; preds = %209, %199
  call void @_ZN5Gowin15spi_gowin_writeEPKhPhj(ptr noundef nonnull align 8 dereferenceable(192) %0, ptr noundef nonnull %5, ptr noundef null, i32 noundef 8)
  %213 = load i8, ptr %68, align 1, !tbaa !36
  %214 = load i8, ptr %5, align 1, !tbaa !27
  %215 = or i8 %214, %213
  store i8 %215, ptr %5, align 1, !tbaa !27
  call void @_ZN5Gowin15spi_gowin_writeEPKhPhj(ptr noundef nonnull align 8 dereferenceable(192) %0, ptr noundef nonnull %5, ptr noundef %.1, i32 noundef 8)
  %216 = load ptr, ptr %65, align 8, !tbaa !31
  call void @_ZN4Jtag5flushEv(ptr noundef nonnull align 8 dereferenceable(193) %216)
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %6) #6
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %6) #6
  %217 = load i8, ptr %56, align 1, !tbaa !33
  %218 = load i8, ptr %58, align 2, !tbaa !34
  %219 = or i8 %218, %217
  store i8 %219, ptr %5, align 1, !tbaa !27
  %220 = load i8, ptr %126, align 1, !tbaa !27
  %221 = and i8 %220, 1
  %.not69.us.us.7 = icmp eq i8 %221, 0
  br i1 %.not69.us.us.7, label %.split81.us.us.split, label %222

222:                                              ; preds = %212
  %223 = load i8, ptr %67, align 1, !tbaa !38
  %224 = or i8 %223, %219
  store i8 %224, ptr %5, align 1, !tbaa !27
  br label %.split81.us.us.split

.split81.us.us.split:                             ; preds = %222, %212
  call void @_ZN5Gowin15spi_gowin_writeEPKhPhj(ptr noundef nonnull align 8 dereferenceable(192) %0, ptr noundef nonnull %5, ptr noundef null, i32 noundef 8)
  %225 = load i8, ptr %68, align 1, !tbaa !36
  %226 = load i8, ptr %5, align 1, !tbaa !27
  %227 = or i8 %226, %225
  store i8 %227, ptr %5, align 1, !tbaa !27
  call void @_ZN5Gowin15spi_gowin_writeEPKhPhj(ptr noundef nonnull align 8 dereferenceable(192) %0, ptr noundef nonnull %5, ptr noundef %.1, i32 noundef 8)
  %228 = load ptr, ptr %65, align 8, !tbaa !31
  call void @_ZN4Jtag5flushEv(ptr noundef nonnull align 8 dereferenceable(193) %228)
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %6) #6
  %indvars.iv.next96 = add nuw nsw i64 %indvars.iv95, 1
  %exitcond99.not = icmp eq i64 %indvars.iv.next96, %wide.trip.count98
  br i1 %exitcond99.not, label %._crit_edge, label %.split.us.us, !llvm.loop !37

._crit_edge:                                      ; preds = %.split81, %.split81.us.us.split, %.split.us.us.us, %55
  %229 = getelementptr inbounds i8, ptr %0, i64 179
  %230 = load i8, ptr %229, align 1, !tbaa !36
  %231 = xor i8 %230, -1
  %232 = load i8, ptr %5, align 1, !tbaa !27
  %233 = and i8 %232, %231
  %234 = load i8, ptr %61, align 4, !tbaa !35
  %235 = or i8 %234, %233
  store i8 %235, ptr %5, align 1, !tbaa !27
  call void @_ZN5Gowin15spi_gowin_writeEPKhPhj(ptr noundef nonnull align 8 dereferenceable(192) %0, ptr noundef nonnull %5, ptr noundef null, i32 noundef 8)
  %236 = load ptr, ptr %65, align 8, !tbaa !31
  call void @_ZN4Jtag5flushEv(ptr noundef nonnull align 8 dereferenceable(193) %236)
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %5) #6
  br label %263

.split:                                           ; preds = %.split.preheader, %.split81
  %indvars.iv = phi i64 [ 0, %.split.preheader ], [ %indvars.iv.next, %.split81 ]
  %237 = getelementptr inbounds i8, ptr %2, i64 %indvars.iv
  store i8 0, ptr %237, align 1, !tbaa !27
  %238 = getelementptr inbounds i8, ptr %1, i64 %indvars.iv
  br label %239

.split81:                                         ; preds = %260
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond93.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
  br i1 %exitcond93.not, label %._crit_edge, label %.split, !llvm.loop !37

239:                                              ; preds = %.split, %260
  %.079 = phi i8 [ -128, %.split ], [ %262, %260 ]
  %.05678 = phi i8 [ 0, %.split ], [ %261, %260 ]
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %6) #6
  %240 = load i8, ptr %56, align 1, !tbaa !33
  %241 = load i8, ptr %58, align 2, !tbaa !34
  %242 = or i8 %241, %240
  store i8 %242, ptr %5, align 1, !tbaa !27
  br i1 %.not68, label %249, label %243

243:                                              ; preds = %239
  %244 = load i8, ptr %238, align 1, !tbaa !27
  %245 = and i8 %244, %.079
  %.not69 = icmp eq i8 %245, 0
  br i1 %.not69, label %249, label %246

246:                                              ; preds = %243
  %247 = load i8, ptr %67, align 1, !tbaa !38
  %248 = or i8 %247, %242
  store i8 %248, ptr %5, align 1, !tbaa !27
  br label %249

249:                                              ; preds = %246, %243, %239
  call void @_ZN5Gowin15spi_gowin_writeEPKhPhj(ptr noundef nonnull align 8 dereferenceable(192) %0, ptr noundef nonnull %5, ptr noundef null, i32 noundef 8)
  %250 = load i8, ptr %68, align 1, !tbaa !36
  %251 = load i8, ptr %5, align 1, !tbaa !27
  %252 = or i8 %251, %250
  store i8 %252, ptr %5, align 1, !tbaa !27
  call void @_ZN5Gowin15spi_gowin_writeEPKhPhj(ptr noundef nonnull align 8 dereferenceable(192) %0, ptr noundef nonnull %5, ptr noundef %.1, i32 noundef 8)
  %253 = load ptr, ptr %65, align 8, !tbaa !31
  call void @_ZN4Jtag5flushEv(ptr noundef nonnull align 8 dereferenceable(193) %253)
  %254 = load i8, ptr %6, align 1, !tbaa !27
  %255 = load i8, ptr %58, align 2, !tbaa !34
  %256 = and i8 %255, %254
  %.not70 = icmp eq i8 %256, 0
  br i1 %.not70, label %260, label %257

257:                                              ; preds = %249
  %258 = load i8, ptr %237, align 1, !tbaa !27
  %259 = or i8 %258, %.079
  store i8 %259, ptr %237, align 1, !tbaa !27
  br label %260

260:                                              ; preds = %257, %249
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %6) #6
  %261 = add nuw nsw i8 %.05678, 1
  %262 = lshr i8 %.079, 1
  %exitcond.not = icmp eq i8 %261, 8
  br i1 %exitcond.not, label %.split81, label %239, !llvm.loop !39

263:                                              ; preds = %._crit_edge, %.thread, %._crit_edge87, %.thread75, %24
  %.161 = phi i32 [ %20, %24 ], [ -1, %.thread75 ], [ 0, %._crit_edge87 ], [ 0, %.thread ], [ 0, %._crit_edge ]
  ret i32 %.161
}

declare noundef zeroext i8 @_ZN21ConfigBitstreamParser11reverseByteEh(i8 noundef zeroext) local_unnamed_addr #1

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

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { "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: readwrite) }
attributes #4 = { mustprogress nocallback nofree nosync nounwind willreturn }
attributes #5 = { inlinehint 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 #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, !15, i64 176}
!6 = !{!"_ZTS5Gowin", !7, i64 0, !16, i64 88, !18, i64 144, !18, i64 152, !18, i64 160, !17, i64 168, !15, i64 172, !15, i64 173, !15, i64 174, !15, i64 175, !15, i64 176, !15, i64 177, !15, i64 178, !9, i64 179, !9, i64 180, !9, i64 181, !9, i64 182, !9, i64 183, !24, i64 184, !24, i64 188}
!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 = !{!"_ZTSSt10unique_ptrI21ConfigBitstreamParserSt14default_deleteIS0_EE", !19, i64 0}
!19 = !{!"_ZTSSt15__uniq_ptr_dataI21ConfigBitstreamParserSt14default_deleteIS0_ELb1ELb1EE", !20, i64 0}
!20 = !{!"_ZTSSt15__uniq_ptr_implI21ConfigBitstreamParserSt14default_deleteIS0_EE", !21, i64 0}
!21 = !{!"_ZTSSt5tupleIJP21ConfigBitstreamParserSt14default_deleteIS0_EEE", !22, i64 0}
!22 = !{!"_ZTSSt11_Tuple_implILm0EJP21ConfigBitstreamParserSt14default_deleteIS0_EEE", !23, i64 0}
!23 = !{!"_ZTSSt10_Head_baseILm0EP21ConfigBitstreamParserLb0EE", !8, i64 0}
!24 = !{!"_ZTSN13JtagInterface10tck_edge_tE", !9, i64 0}
!25 = !{i8 0, i8 2}
!26 = !{}
!27 = !{!9, !9, i64 0}
!28 = !{!6, !15, i64 175}
!29 = distinct !{!29, !30}
!30 = !{!"llvm.loop.mustprogress"}
!31 = !{!7, !8, i64 8}
!32 = distinct !{!32, !30}
!33 = !{!6, !9, i64 183}
!34 = !{!6, !9, i64 182}
!35 = !{!6, !9, i64 180}
!36 = !{!6, !9, i64 179}
!37 = distinct !{!37, !30}
!38 = !{!6, !9, i64 181}
!39 = distinct !{!39, !30}


; Effective O3 passes: BDCEPass,CorrelatedValuePropagationPass,DSEPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferAlignmentPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LICMPass,LoopInstSimplifyPass,LoopRotatePass,LoopSimplifyCFGPass,LoopSimplifyPass,LoopUnrollPass,ReassociatePass,SCCPPass,SROAPass,SimplifyCFGPass,TailCallElimPass