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

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

@_ZZN5Gowin14displayReadRegEPKcjE4desc = external hidden global [19 x ptr], align 16
@_ZZN5Gowin14displayReadRegEPKcjE9gw5a_desc = external hidden global [32 x ptr], align 16
@_ZZN5Gowin14displayReadRegEPKcjE11gw5ast_desc = external hidden global [3 x ptr], align 16
@_ZZN5Gowin14displayReadRegEPKcjE19gw5a_sync_det_retry = external hidden global [4 x ptr], align 16
@_ZZN5Gowin14displayReadRegEPKcjE18gw5a_cpu_bus_width = external hidden global [4 x ptr], align 16
@.str.641 = external hidden unnamed_addr constant [25 x i8], align 1
@.str.642 = external hidden unnamed_addr constant [17 x i8], align 1
@.str.643 = external hidden unnamed_addr constant [14 x i8], align 1
@.str.644 = external hidden unnamed_addr constant [5 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: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #0

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN5Gowin14displayReadRegEPKcj(ptr noundef nonnull align 8 dereferenceable(192) %0, ptr noundef %1, i32 noundef %2) #1 align 2 {
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca i32, align 4
  %7 = alloca i8, align 1
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  store ptr %0, ptr %4, align 8, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !5
  store i32 %2, ptr %6, align 4, !tbaa !9
  %12 = load ptr, ptr %4, align 8
  %13 = load ptr, ptr %5, align 8, !tbaa !5
  %14 = load i32, ptr %6, align 4, !tbaa !9
  %15 = call i32 (ptr, ...) @printf(ptr noundef @.str.641, ptr noundef %13, i32 noundef %14)
  %16 = getelementptr inbounds %class.Gowin, ptr %12, i32 0, i32 10
  %17 = load i8, ptr %16, align 8, !tbaa !11, !range !27, !noundef !28
  %18 = trunc i8 %17 to i1
  br i1 %18, label %19, label %110

19:                                               ; preds = %3
  call void @llvm.lifetime.start.p0(i64 1, ptr %7) #3
  %20 = getelementptr inbounds %class.Gowin, ptr %12, i32 0, i32 5
  %21 = load i32, ptr %20, align 8, !tbaa !29
  %22 = icmp eq i32 %21, 67611
  %23 = zext i1 %22 to i64
  %24 = select i1 %22, i32 24, i32 32
  %25 = trunc i32 %24 to i8
  store i8 %25, ptr %7, align 1, !tbaa !30
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #3
  store i32 0, ptr %8, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #3
  store i32 1, ptr %9, align 4, !tbaa !9
  br label %26

26:                                               ; preds = %104, %19
  %27 = load i32, ptr %8, align 4, !tbaa !9
  %28 = load i8, ptr %7, align 1, !tbaa !30
  %29 = zext i8 %28 to i32
  %30 = icmp ult i32 %27, %29
  br i1 %30, label %32, label %31

31:                                               ; preds = %26
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #3
  br label %109

32:                                               ; preds = %26
  %33 = load i32, ptr %8, align 4, !tbaa !9
  switch i32 %33, label %74 [
    i32 23, label %34
    i32 25, label %54
  ]

34:                                               ; preds = %32
  %35 = load i32, ptr %8, align 4, !tbaa !9
  %36 = add i32 %35, 1
  %37 = load i32, ptr %8, align 4, !tbaa !9
  %38 = load i32, ptr %8, align 4, !tbaa !9
  %39 = zext i32 %38 to i64
  %40 = getelementptr inbounds [32 x ptr], ptr @_ZZN5Gowin14displayReadRegEPKcjE9gw5a_desc, i64 0, i64 %39
  %41 = load ptr, ptr %40, align 8, !tbaa !5
  %42 = load i32, ptr %6, align 4, !tbaa !9
  %43 = load i32, ptr %8, align 4, !tbaa !9
  %44 = lshr i32 %42, %43
  %45 = and i32 %44, 3
  %46 = zext i32 %45 to i64
  %47 = getelementptr inbounds [4 x ptr], ptr @_ZZN5Gowin14displayReadRegEPKcjE18gw5a_cpu_bus_width, i64 0, i64 %46
  %48 = load ptr, ptr %47, align 8, !tbaa !5
  %49 = call i32 (ptr, ...) @printf(ptr noundef @.str.642, i32 noundef %36, i32 noundef %37, ptr noundef %41, ptr noundef %48)
  %50 = load i32, ptr %9, align 4, !tbaa !9
  %51 = shl i32 %50, 1
  store i32 %51, ptr %9, align 4, !tbaa !9
  %52 = load i32, ptr %8, align 4, !tbaa !9
  %53 = add i32 %52, 1
  store i32 %53, ptr %8, align 4, !tbaa !9
  br label %103

54:                                               ; preds = %32
  %55 = load i32, ptr %8, align 4, !tbaa !9
  %56 = add i32 %55, 1
  %57 = load i32, ptr %8, align 4, !tbaa !9
  %58 = load i32, ptr %8, align 4, !tbaa !9
  %59 = zext i32 %58 to i64
  %60 = getelementptr inbounds [32 x ptr], ptr @_ZZN5Gowin14displayReadRegEPKcjE9gw5a_desc, i64 0, i64 %59
  %61 = load ptr, ptr %60, align 8, !tbaa !5
  %62 = load i32, ptr %6, align 4, !tbaa !9
  %63 = load i32, ptr %8, align 4, !tbaa !9
  %64 = lshr i32 %62, %63
  %65 = and i32 %64, 3
  %66 = zext i32 %65 to i64
  %67 = getelementptr inbounds [4 x ptr], ptr @_ZZN5Gowin14displayReadRegEPKcjE19gw5a_sync_det_retry, i64 0, i64 %66
  %68 = load ptr, ptr %67, align 8, !tbaa !5
  %69 = call i32 (ptr, ...) @printf(ptr noundef @.str.642, i32 noundef %56, i32 noundef %57, ptr noundef %61, ptr noundef %68)
  %70 = load i32, ptr %9, align 4, !tbaa !9
  %71 = shl i32 %70, 1
  store i32 %71, ptr %9, align 4, !tbaa !9
  %72 = load i32, ptr %8, align 4, !tbaa !9
  %73 = add i32 %72, 1
  store i32 %73, ptr %8, align 4, !tbaa !9
  br label %103

74:                                               ; preds = %32
  %75 = load i32, ptr %6, align 4, !tbaa !9
  %76 = load i32, ptr %9, align 4, !tbaa !9
  %77 = and i32 %75, %76
  %78 = icmp ne i32 %77, 0
  br i1 %78, label %79, label %102

79:                                               ; preds = %74
  %80 = getelementptr inbounds %class.Gowin, ptr %12, i32 0, i32 5
  %81 = load i32, ptr %80, align 8, !tbaa !29
  %82 = icmp eq i32 %81, 67611
  br i1 %82, label %83, label %94

83:                                               ; preds = %79
  %84 = load i32, ptr %8, align 4, !tbaa !9
  %85 = icmp uge i32 %84, 20
  br i1 %85, label %86, label %94

86:                                               ; preds = %83
  %87 = load i32, ptr %8, align 4, !tbaa !9
  %88 = load i32, ptr %8, align 4, !tbaa !9
  %89 = sub i32 %88, 20
  %90 = zext i32 %89 to i64
  %91 = getelementptr inbounds [3 x ptr], ptr @_ZZN5Gowin14displayReadRegEPKcjE11gw5ast_desc, i64 0, i64 %90
  %92 = load ptr, ptr %91, align 8, !tbaa !5
  %93 = call i32 (ptr, ...) @printf(ptr noundef @.str.643, i32 noundef %87, ptr noundef %92)
  br label %101

94:                                               ; preds = %83, %79
  %95 = load i32, ptr %8, align 4, !tbaa !9
  %96 = load i32, ptr %8, align 4, !tbaa !9
  %97 = zext i32 %96 to i64
  %98 = getelementptr inbounds [32 x ptr], ptr @_ZZN5Gowin14displayReadRegEPKcjE9gw5a_desc, i64 0, i64 %97
  %99 = load ptr, ptr %98, align 8, !tbaa !5
  %100 = call i32 (ptr, ...) @printf(ptr noundef @.str.643, i32 noundef %95, ptr noundef %99)
  br label %101

101:                                              ; preds = %94, %86
  br label %102

102:                                              ; preds = %101, %74
  br label %103

103:                                              ; preds = %102, %54, %34
  br label %104

104:                                              ; preds = %103
  %105 = load i32, ptr %8, align 4, !tbaa !9
  %106 = add i32 %105, 1
  store i32 %106, ptr %8, align 4, !tbaa !9
  %107 = load i32, ptr %9, align 4, !tbaa !9
  %108 = shl i32 %107, 1
  store i32 %108, ptr %9, align 4, !tbaa !9
  br label %26, !llvm.loop !31

109:                                              ; preds = %31
  call void @llvm.lifetime.end.p0(i64 1, ptr %7) #3
  br label %133

110:                                              ; preds = %3
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #3
  store i32 0, ptr %10, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #3
  store i32 1, ptr %11, align 4, !tbaa !9
  br label %111

111:                                              ; preds = %127, %110
  %112 = load i32, ptr %10, align 4, !tbaa !9
  %113 = icmp ult i32 %112, 19
  br i1 %113, label %115, label %114

114:                                              ; preds = %111
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #3
  br label %132

115:                                              ; preds = %111
  %116 = load i32, ptr %6, align 4, !tbaa !9
  %117 = load i32, ptr %11, align 4, !tbaa !9
  %118 = and i32 %116, %117
  %119 = icmp ne i32 %118, 0
  br i1 %119, label %120, label %126

120:                                              ; preds = %115
  %121 = load i32, ptr %10, align 4, !tbaa !9
  %122 = zext i32 %121 to i64
  %123 = getelementptr inbounds [19 x ptr], ptr @_ZZN5Gowin14displayReadRegEPKcjE4desc, i64 0, i64 %122
  %124 = load ptr, ptr %123, align 8, !tbaa !5
  %125 = call i32 (ptr, ...) @printf(ptr noundef @.str.644, ptr noundef %124)
  br label %126

126:                                              ; preds = %120, %115
  br label %127

127:                                              ; preds = %126
  %128 = load i32, ptr %10, align 4, !tbaa !9
  %129 = add i32 %128, 1
  store i32 %129, ptr %10, align 4, !tbaa !9
  %130 = load i32, ptr %11, align 4, !tbaa !9
  %131 = shl i32 %130, 1
  store i32 %131, ptr %11, align 4, !tbaa !9
  br label %111, !llvm.loop !33

132:                                              ; preds = %114
  br label %133

133:                                              ; preds = %132, %109
  ret void
}

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

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #2 = { "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 = { 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 = !{!12, !10, i64 168}
!30 = !{!7, !7, i64 0}
!31 = distinct !{!31, !32}
!32 = !{!"llvm.loop.mustprogress"}
!33 = distinct !{!33, !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"

@_ZZN5Gowin14displayReadRegEPKcjE4desc = external hidden local_unnamed_addr global [19 x ptr], align 16
@_ZZN5Gowin14displayReadRegEPKcjE9gw5a_desc = external hidden local_unnamed_addr global [32 x ptr], align 16
@_ZZN5Gowin14displayReadRegEPKcjE11gw5ast_desc = external hidden local_unnamed_addr global [3 x ptr], align 16
@_ZZN5Gowin14displayReadRegEPKcjE19gw5a_sync_det_retry = external hidden local_unnamed_addr global [4 x ptr], align 16
@_ZZN5Gowin14displayReadRegEPKcjE18gw5a_cpu_bus_width = external hidden local_unnamed_addr global [4 x ptr], align 16
@.str.641 = external hidden unnamed_addr constant [25 x i8], align 1
@.str.642 = external hidden unnamed_addr constant [17 x i8], align 1
@.str.643 = external hidden unnamed_addr constant [14 x i8], align 1
@.str.644 = external hidden unnamed_addr constant [5 x i8], align 1

; Function Attrs: mustprogress nofree nounwind uwtable
define dso_local void @_ZN5Gowin14displayReadRegEPKcj(ptr nocapture noundef nonnull readonly align 8 dereferenceable(192) %0, ptr noundef %1, i32 noundef %2) local_unnamed_addr #0 align 2 {
  %4 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.641, ptr noundef %1, i32 noundef %2)
  %5 = getelementptr inbounds i8, ptr %0, i64 176
  %6 = load i8, ptr %5, align 8, !tbaa !5, !range !25, !noundef !26
  %7 = trunc nuw i8 %6 to i1
  br i1 %7, label %9, label %.preheader.preheader

.preheader.preheader:                             ; preds = %3
  %8 = and i32 %2, 1
  %.not = icmp eq i32 %8, 0
  br i1 %.not, label %.preheader.1, label %54

9:                                                ; preds = %3
  %10 = getelementptr inbounds i8, ptr %0, i64 168
  %11 = load i32, ptr %10, align 8, !tbaa !27
  %12 = icmp eq i32 %11, 67611
  %13 = select i1 %12, i32 24, i32 32
  %14 = lshr i32 %2, 25
  %15 = and i32 %14, 3
  %16 = zext nneg i32 %15 to i64
  %17 = getelementptr inbounds [4 x ptr], ptr @_ZZN5Gowin14displayReadRegEPKcjE19gw5a_sync_det_retry, i64 0, i64 %16
  %18 = lshr i32 %2, 23
  %19 = and i32 %18, 3
  %20 = zext nneg i32 %19 to i64
  %21 = getelementptr inbounds [4 x ptr], ptr @_ZZN5Gowin14displayReadRegEPKcjE18gw5a_cpu_bus_width, i64 0, i64 %20
  br label %22

22:                                               ; preds = %9, %50
  %.03644 = phi i32 [ 1, %9 ], [ %52, %50 ]
  %.03743 = phi i32 [ 0, %9 ], [ %51, %50 ]
  switch i32 %.03743, label %33 [
    i32 23, label %23
    i32 25, label %28
  ]

23:                                               ; preds = %22
  %24 = load ptr, ptr getelementptr inbounds (i8, ptr @_ZZN5Gowin14displayReadRegEPKcjE9gw5a_desc, i64 184), align 8, !tbaa !28
  %25 = load ptr, ptr %21, align 8, !tbaa !28
  %26 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.642, i32 noundef 24, i32 noundef 23, ptr noundef %24, ptr noundef %25)
  %27 = shl i32 %.03644, 1
  br label %50

28:                                               ; preds = %22
  %29 = load ptr, ptr getelementptr inbounds (i8, ptr @_ZZN5Gowin14displayReadRegEPKcjE9gw5a_desc, i64 200), align 8, !tbaa !28
  %30 = load ptr, ptr %17, align 8, !tbaa !28
  %31 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.642, i32 noundef 26, i32 noundef 25, ptr noundef %29, ptr noundef %30)
  %32 = shl i32 %.03644, 1
  br label %50

33:                                               ; preds = %22
  %34 = and i32 %.03644, %2
  %.not39 = icmp eq i32 %34, 0
  br i1 %.not39, label %50, label %35

35:                                               ; preds = %33
  %36 = load i32, ptr %10, align 8, !tbaa !27
  %37 = icmp eq i32 %36, 67611
  %38 = icmp ugt i32 %.03743, 19
  %or.cond = and i1 %38, %37
  br i1 %or.cond, label %39, label %45

39:                                               ; preds = %35
  %40 = add nsw i32 %.03743, -20
  %41 = zext nneg i32 %40 to i64
  %42 = getelementptr inbounds [3 x ptr], ptr @_ZZN5Gowin14displayReadRegEPKcjE11gw5ast_desc, i64 0, i64 %41
  %43 = load ptr, ptr %42, align 8, !tbaa !28
  %44 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.643, i32 noundef %.03743, ptr noundef %43)
  br label %50

45:                                               ; preds = %35
  %46 = zext nneg i32 %.03743 to i64
  %47 = getelementptr inbounds [32 x ptr], ptr @_ZZN5Gowin14displayReadRegEPKcjE9gw5a_desc, i64 0, i64 %46
  %48 = load ptr, ptr %47, align 8, !tbaa !28
  %49 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.643, i32 noundef %.03743, ptr noundef %48)
  br label %50

50:                                               ; preds = %23, %28, %39, %45, %33
  %.138 = phi i32 [ %.03743, %39 ], [ %.03743, %45 ], [ %.03743, %33 ], [ 26, %28 ], [ 24, %23 ]
  %.1 = phi i32 [ %.03644, %39 ], [ %.03644, %45 ], [ %.03644, %33 ], [ %32, %28 ], [ %27, %23 ]
  %51 = add nuw nsw i32 %.138, 1
  %52 = shl i32 %.1, 1
  %53 = icmp ult i32 %51, %13
  br i1 %53, label %22, label %.loopexit, !llvm.loop !29

54:                                               ; preds = %.preheader.preheader
  %55 = load ptr, ptr @_ZZN5Gowin14displayReadRegEPKcjE4desc, align 16, !tbaa !28
  %56 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.644, ptr noundef %55)
  br label %.preheader.1

.preheader.1:                                     ; preds = %.preheader.preheader, %54
  %57 = and i32 %2, 2
  %.not.1 = icmp eq i32 %57, 0
  br i1 %.not.1, label %.preheader.2, label %58

58:                                               ; preds = %.preheader.1
  %59 = load ptr, ptr getelementptr inbounds (i8, ptr @_ZZN5Gowin14displayReadRegEPKcjE4desc, i64 8), align 8, !tbaa !28
  %60 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.644, ptr noundef %59)
  br label %.preheader.2

.preheader.2:                                     ; preds = %58, %.preheader.1
  %61 = and i32 %2, 4
  %.not.2 = icmp eq i32 %61, 0
  br i1 %.not.2, label %.preheader.3, label %62

62:                                               ; preds = %.preheader.2
  %63 = load ptr, ptr getelementptr inbounds (i8, ptr @_ZZN5Gowin14displayReadRegEPKcjE4desc, i64 16), align 16, !tbaa !28
  %64 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.644, ptr noundef %63)
  br label %.preheader.3

.preheader.3:                                     ; preds = %62, %.preheader.2
  %65 = and i32 %2, 8
  %.not.3 = icmp eq i32 %65, 0
  br i1 %.not.3, label %.preheader.4, label %66

66:                                               ; preds = %.preheader.3
  %67 = load ptr, ptr getelementptr inbounds (i8, ptr @_ZZN5Gowin14displayReadRegEPKcjE4desc, i64 24), align 8, !tbaa !28
  %68 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.644, ptr noundef %67)
  br label %.preheader.4

.preheader.4:                                     ; preds = %66, %.preheader.3
  %69 = and i32 %2, 16
  %.not.4 = icmp eq i32 %69, 0
  br i1 %.not.4, label %.preheader.5, label %70

70:                                               ; preds = %.preheader.4
  %71 = load ptr, ptr getelementptr inbounds (i8, ptr @_ZZN5Gowin14displayReadRegEPKcjE4desc, i64 32), align 16, !tbaa !28
  %72 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.644, ptr noundef %71)
  br label %.preheader.5

.preheader.5:                                     ; preds = %70, %.preheader.4
  %73 = and i32 %2, 32
  %.not.5 = icmp eq i32 %73, 0
  br i1 %.not.5, label %.preheader.6, label %74

74:                                               ; preds = %.preheader.5
  %75 = load ptr, ptr getelementptr inbounds (i8, ptr @_ZZN5Gowin14displayReadRegEPKcjE4desc, i64 40), align 8, !tbaa !28
  %76 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.644, ptr noundef %75)
  br label %.preheader.6

.preheader.6:                                     ; preds = %74, %.preheader.5
  %77 = and i32 %2, 64
  %.not.6 = icmp eq i32 %77, 0
  br i1 %.not.6, label %.preheader.7, label %78

78:                                               ; preds = %.preheader.6
  %79 = load ptr, ptr getelementptr inbounds (i8, ptr @_ZZN5Gowin14displayReadRegEPKcjE4desc, i64 48), align 16, !tbaa !28
  %80 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.644, ptr noundef %79)
  br label %.preheader.7

.preheader.7:                                     ; preds = %78, %.preheader.6
  %81 = and i32 %2, 128
  %.not.7 = icmp eq i32 %81, 0
  br i1 %.not.7, label %.preheader.8, label %82

82:                                               ; preds = %.preheader.7
  %83 = load ptr, ptr getelementptr inbounds (i8, ptr @_ZZN5Gowin14displayReadRegEPKcjE4desc, i64 56), align 8, !tbaa !28
  %84 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.644, ptr noundef %83)
  br label %.preheader.8

.preheader.8:                                     ; preds = %82, %.preheader.7
  %85 = and i32 %2, 256
  %.not.8 = icmp eq i32 %85, 0
  br i1 %.not.8, label %.preheader.9, label %86

86:                                               ; preds = %.preheader.8
  %87 = load ptr, ptr getelementptr inbounds (i8, ptr @_ZZN5Gowin14displayReadRegEPKcjE4desc, i64 64), align 16, !tbaa !28
  %88 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.644, ptr noundef %87)
  br label %.preheader.9

.preheader.9:                                     ; preds = %86, %.preheader.8
  %89 = and i32 %2, 512
  %.not.9 = icmp eq i32 %89, 0
  br i1 %.not.9, label %.preheader.10, label %90

90:                                               ; preds = %.preheader.9
  %91 = load ptr, ptr getelementptr inbounds (i8, ptr @_ZZN5Gowin14displayReadRegEPKcjE4desc, i64 72), align 8, !tbaa !28
  %92 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.644, ptr noundef %91)
  br label %.preheader.10

.preheader.10:                                    ; preds = %90, %.preheader.9
  %93 = and i32 %2, 1024
  %.not.10 = icmp eq i32 %93, 0
  br i1 %.not.10, label %.preheader.11, label %94

94:                                               ; preds = %.preheader.10
  %95 = load ptr, ptr getelementptr inbounds (i8, ptr @_ZZN5Gowin14displayReadRegEPKcjE4desc, i64 80), align 16, !tbaa !28
  %96 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.644, ptr noundef %95)
  br label %.preheader.11

.preheader.11:                                    ; preds = %94, %.preheader.10
  %97 = and i32 %2, 2048
  %.not.11 = icmp eq i32 %97, 0
  br i1 %.not.11, label %.preheader.12, label %98

98:                                               ; preds = %.preheader.11
  %99 = load ptr, ptr getelementptr inbounds (i8, ptr @_ZZN5Gowin14displayReadRegEPKcjE4desc, i64 88), align 8, !tbaa !28
  %100 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.644, ptr noundef %99)
  br label %.preheader.12

.preheader.12:                                    ; preds = %98, %.preheader.11
  %101 = and i32 %2, 4096
  %.not.12 = icmp eq i32 %101, 0
  br i1 %.not.12, label %.preheader.13, label %102

102:                                              ; preds = %.preheader.12
  %103 = load ptr, ptr getelementptr inbounds (i8, ptr @_ZZN5Gowin14displayReadRegEPKcjE4desc, i64 96), align 16, !tbaa !28
  %104 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.644, ptr noundef %103)
  br label %.preheader.13

.preheader.13:                                    ; preds = %102, %.preheader.12
  %105 = and i32 %2, 8192
  %.not.13 = icmp eq i32 %105, 0
  br i1 %.not.13, label %.preheader.14, label %106

106:                                              ; preds = %.preheader.13
  %107 = load ptr, ptr getelementptr inbounds (i8, ptr @_ZZN5Gowin14displayReadRegEPKcjE4desc, i64 104), align 8, !tbaa !28
  %108 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.644, ptr noundef %107)
  br label %.preheader.14

.preheader.14:                                    ; preds = %106, %.preheader.13
  %109 = and i32 %2, 16384
  %.not.14 = icmp eq i32 %109, 0
  br i1 %.not.14, label %.preheader.15, label %110

110:                                              ; preds = %.preheader.14
  %111 = load ptr, ptr getelementptr inbounds (i8, ptr @_ZZN5Gowin14displayReadRegEPKcjE4desc, i64 112), align 16, !tbaa !28
  %112 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.644, ptr noundef %111)
  br label %.preheader.15

.preheader.15:                                    ; preds = %110, %.preheader.14
  %113 = and i32 %2, 32768
  %.not.15 = icmp eq i32 %113, 0
  br i1 %.not.15, label %.preheader.16, label %114

114:                                              ; preds = %.preheader.15
  %115 = load ptr, ptr getelementptr inbounds (i8, ptr @_ZZN5Gowin14displayReadRegEPKcjE4desc, i64 120), align 8, !tbaa !28
  %116 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.644, ptr noundef %115)
  br label %.preheader.16

.preheader.16:                                    ; preds = %114, %.preheader.15
  %117 = and i32 %2, 65536
  %.not.16 = icmp eq i32 %117, 0
  br i1 %.not.16, label %.preheader.17, label %118

118:                                              ; preds = %.preheader.16
  %119 = load ptr, ptr getelementptr inbounds (i8, ptr @_ZZN5Gowin14displayReadRegEPKcjE4desc, i64 128), align 16, !tbaa !28
  %120 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.644, ptr noundef %119)
  br label %.preheader.17

.preheader.17:                                    ; preds = %118, %.preheader.16
  %121 = and i32 %2, 131072
  %.not.17 = icmp eq i32 %121, 0
  br i1 %.not.17, label %.preheader.18, label %122

122:                                              ; preds = %.preheader.17
  %123 = load ptr, ptr getelementptr inbounds (i8, ptr @_ZZN5Gowin14displayReadRegEPKcjE4desc, i64 136), align 8, !tbaa !28
  %124 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.644, ptr noundef %123)
  br label %.preheader.18

.preheader.18:                                    ; preds = %122, %.preheader.17
  %125 = and i32 %2, 262144
  %.not.18 = icmp eq i32 %125, 0
  br i1 %.not.18, label %.loopexit, label %126

126:                                              ; preds = %.preheader.18
  %127 = load ptr, ptr getelementptr inbounds (i8, ptr @_ZZN5Gowin14displayReadRegEPKcjE4desc, i64 144), align 16, !tbaa !28
  %128 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.644, ptr noundef %127)
  br label %.loopexit

.loopexit:                                        ; preds = %50, %.preheader.18, %126
  ret void
}

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

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

!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 = !{!6, !17, i64 168}
!28 = !{!8, !8, i64 0}
!29 = distinct !{!29, !30}
!30 = !{!"llvm.loop.mustprogress"}


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