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

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

@.str.723 = external hidden unnamed_addr constant [30 x i8], align 1
@.str.724 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.725 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.726 = external hidden unnamed_addr constant [27 x i8], align 1
@.str.727 = external hidden unnamed_addr constant [19 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 nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #1

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

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

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

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

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

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

; Function Attrs: mustprogress uwtable
define dso_local noundef zeroext i1 @_ZN7Lattice26programFeatureRow_MachXO3DEPh(ptr noundef nonnull align 8 dereferenceable(152) %0, ptr noundef %1) #3 align 2 {
  %3 = alloca i1, align 1
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca [16 x i8], align 16
  %7 = alloca [15 x i8], align 1
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  store ptr %0, ptr %4, align 8, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !5
  %13 = load ptr, ptr %4, align 8
  call void @llvm.lifetime.start.p0(i64 16, ptr %6) #4
  call void @llvm.memset.p0.i64(ptr align 16 %6, i8 0, i64 16, i1 false)
  call void @llvm.lifetime.start.p0(i64 15, ptr %7) #4
  call void @llvm.memset.p0.i64(ptr align 1 %7, i8 0, i64 15, i1 false)
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #4
  store i32 0, ptr %8, align 4, !tbaa !9
  br label %14

14:                                               ; preds = %27, %2
  %15 = load i32, ptr %8, align 4, !tbaa !9
  %16 = icmp slt i32 %15, 12
  br i1 %16, label %18, label %17

17:                                               ; preds = %14
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #4
  br label %30

18:                                               ; preds = %14
  %19 = load ptr, ptr %5, align 8, !tbaa !5
  %20 = load i32, ptr %8, align 4, !tbaa !9
  %21 = sext i32 %20 to i64
  %22 = getelementptr inbounds i8, ptr %19, i64 %21
  %23 = load i8, ptr %22, align 1, !tbaa !11
  %24 = load i32, ptr %8, align 4, !tbaa !9
  %25 = sext i32 %24 to i64
  %26 = getelementptr inbounds [16 x i8], ptr %6, i64 0, i64 %25
  store i8 %23, ptr %26, align 1, !tbaa !11
  br label %27

27:                                               ; preds = %18
  %28 = load i32, ptr %8, align 4, !tbaa !9
  %29 = add nsw i32 %28, 1
  store i32 %29, ptr %8, align 4, !tbaa !9
  br label %14, !llvm.loop !12

30:                                               ; preds = %17
  %31 = getelementptr inbounds %class.Device, ptr %13, i32 0, i32 6
  %32 = load i8, ptr %31, align 1, !tbaa !14, !range !21, !noundef !22
  %33 = trunc i8 %32 to i1
  br i1 %33, label %34, label %53

34:                                               ; preds = %30
  %35 = call i32 (ptr, ...) @printf(ptr noundef @.str.723)
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #4
  store i32 11, ptr %9, align 4, !tbaa !9
  br label %36

36:                                               ; preds = %48, %34
  %37 = load i32, ptr %9, align 4, !tbaa !9
  %38 = icmp sge i32 %37, 0
  br i1 %38, label %40, label %39

39:                                               ; preds = %36
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #4
  br label %51

40:                                               ; preds = %36
  %41 = load ptr, ptr %5, align 8, !tbaa !5
  %42 = load i32, ptr %9, align 4, !tbaa !9
  %43 = sext i32 %42 to i64
  %44 = getelementptr inbounds i8, ptr %41, i64 %43
  %45 = load i8, ptr %44, align 1, !tbaa !11
  %46 = zext i8 %45 to i32
  %47 = call i32 (ptr, ...) @printf(ptr noundef @.str.724, i32 noundef %46)
  br label %48

48:                                               ; preds = %40
  %49 = load i32, ptr %9, align 4, !tbaa !9
  %50 = add nsw i32 %49, -1
  store i32 %50, ptr %9, align 4, !tbaa !9
  br label %36, !llvm.loop !23

51:                                               ; preds = %39
  %52 = call i32 (ptr, ...) @printf(ptr noundef @.str.725)
  br label %53

53:                                               ; preds = %51, %30
  %54 = getelementptr inbounds [16 x i8], ptr %6, i64 0, i64 0
  %55 = call noundef zeroext i1 @_ZN7Lattice5wr_rdEhPhiS0_ib(ptr noundef nonnull align 8 dereferenceable(152) %13, i8 noundef zeroext -28, ptr noundef %54, i32 noundef 16, ptr noundef null, i32 noundef 0, i1 noundef zeroext false)
  %56 = getelementptr inbounds %class.Device, ptr %13, i32 0, i32 1
  %57 = load ptr, ptr %56, align 8, !tbaa !24
  call void @_ZN4Jtag9set_stateENS_10tapState_tEh(ptr noundef nonnull align 8 dereferenceable(193) %57, i32 noundef 1, i8 noundef zeroext 1)
  %58 = getelementptr inbounds %class.Device, ptr %13, i32 0, i32 1
  %59 = load ptr, ptr %58, align 8, !tbaa !24
  call void @_ZN4Jtag9toggleClkEi(ptr noundef nonnull align 8 dereferenceable(193) %59, i32 noundef 2)
  %60 = call noundef zeroext i1 @_ZN7Lattice5wr_rdEhPhiS0_ib(ptr noundef nonnull align 8 dereferenceable(152) %13, i8 noundef zeroext -1, ptr noundef null, i32 noundef 0, ptr noundef null, i32 noundef 0, i1 noundef zeroext false)
  %61 = call noundef zeroext i1 @_ZN7Lattice12pollBusyFlagEb(ptr noundef nonnull align 8 dereferenceable(152) %13, i1 noundef zeroext false)
  br i1 %61, label %63, label %62

62:                                               ; preds = %53
  store i1 false, ptr %3, align 1
  store i32 1, ptr %10, align 4
  br label %132

63:                                               ; preds = %53
  %64 = getelementptr inbounds %class.Device, ptr %13, i32 0, i32 6
  %65 = load i8, ptr %64, align 1, !tbaa !14, !range !21, !noundef !22
  %66 = trunc i8 %65 to i1
  br i1 %66, label %71, label %67

67:                                               ; preds = %63
  %68 = getelementptr inbounds %class.Device, ptr %13, i32 0, i32 5
  %69 = load i8, ptr %68, align 4, !tbaa !25, !range !21, !noundef !22
  %70 = trunc i8 %69 to i1
  br i1 %70, label %71, label %78

71:                                               ; preds = %67, %63
  %72 = getelementptr inbounds [15 x i8], ptr %7, i64 0, i64 0
  %73 = call noundef zeroext i1 @_ZN7Lattice5wr_rdEhPhiS0_ib(ptr noundef nonnull align 8 dereferenceable(152) %13, i8 noundef zeroext -25, ptr noundef null, i32 noundef 0, ptr noundef %72, i32 noundef 15, i1 noundef zeroext false)
  %74 = getelementptr inbounds %class.Device, ptr %13, i32 0, i32 1
  %75 = load ptr, ptr %74, align 8, !tbaa !24
  call void @_ZN4Jtag9set_stateENS_10tapState_tEh(ptr noundef nonnull align 8 dereferenceable(193) %75, i32 noundef 1, i8 noundef zeroext 1)
  %76 = getelementptr inbounds %class.Device, ptr %13, i32 0, i32 1
  %77 = load ptr, ptr %76, align 8, !tbaa !24
  call void @_ZN4Jtag9toggleClkEi(ptr noundef nonnull align 8 dereferenceable(193) %77, i32 noundef 2)
  br label %78

78:                                               ; preds = %71, %67
  %79 = getelementptr inbounds %class.Device, ptr %13, i32 0, i32 6
  %80 = load i8, ptr %79, align 1, !tbaa !14, !range !21, !noundef !22
  %81 = trunc i8 %80 to i1
  br i1 %81, label %82, label %100

82:                                               ; preds = %78
  %83 = call i32 (ptr, ...) @printf(ptr noundef @.str.726)
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #4
  store i32 11, ptr %11, align 4, !tbaa !9
  br label %84

84:                                               ; preds = %95, %82
  %85 = load i32, ptr %11, align 4, !tbaa !9
  %86 = icmp sge i32 %85, 0
  br i1 %86, label %88, label %87

87:                                               ; preds = %84
  store i32 8, ptr %10, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #4
  br label %98

88:                                               ; preds = %84
  %89 = load i32, ptr %11, align 4, !tbaa !9
  %90 = sext i32 %89 to i64
  %91 = getelementptr inbounds [15 x i8], ptr %7, i64 0, i64 %90
  %92 = load i8, ptr %91, align 1, !tbaa !11
  %93 = zext i8 %92 to i32
  %94 = call i32 (ptr, ...) @printf(ptr noundef @.str.724, i32 noundef %93)
  br label %95

95:                                               ; preds = %88
  %96 = load i32, ptr %11, align 4, !tbaa !9
  %97 = add nsw i32 %96, -1
  store i32 %97, ptr %11, align 4, !tbaa !9
  br label %84, !llvm.loop !26

98:                                               ; preds = %87
  %99 = call i32 (ptr, ...) @printf(ptr noundef @.str.725)
  br label %100

100:                                              ; preds = %98, %78
  %101 = getelementptr inbounds %class.Device, ptr %13, i32 0, i32 5
  %102 = load i8, ptr %101, align 4, !tbaa !25, !range !21, !noundef !22
  %103 = trunc i8 %102 to i1
  br i1 %103, label %104, label %131

104:                                              ; preds = %100
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #4
  store i32 0, ptr %12, align 4, !tbaa !9
  br label %105

105:                                              ; preds = %125, %104
  %106 = load i32, ptr %12, align 4, !tbaa !9
  %107 = icmp slt i32 %106, 15
  br i1 %107, label %109, label %108

108:                                              ; preds = %105
  store i32 11, ptr %10, align 4
  br label %128

109:                                              ; preds = %105
  %110 = load ptr, ptr %5, align 8, !tbaa !5
  %111 = load i32, ptr %12, align 4, !tbaa !9
  %112 = sext i32 %111 to i64
  %113 = getelementptr inbounds i8, ptr %110, i64 %112
  %114 = load i8, ptr %113, align 1, !tbaa !11
  %115 = zext i8 %114 to i32
  %116 = load i32, ptr %12, align 4, !tbaa !9
  %117 = sext i32 %116 to i64
  %118 = getelementptr inbounds [15 x i8], ptr %7, i64 0, i64 %117
  %119 = load i8, ptr %118, align 1, !tbaa !11
  %120 = zext i8 %119 to i32
  %121 = icmp ne i32 %115, %120
  br i1 %121, label %122, label %124

122:                                              ; preds = %109
  %123 = call i32 (ptr, ...) @printf(ptr noundef @.str.727)
  store i1 false, ptr %3, align 1
  store i32 1, ptr %10, align 4
  br label %128

124:                                              ; preds = %109
  br label %125

125:                                              ; preds = %124
  %126 = load i32, ptr %12, align 4, !tbaa !9
  %127 = add nsw i32 %126, 1
  store i32 %127, ptr %12, align 4, !tbaa !9
  br label %105, !llvm.loop !27

128:                                              ; preds = %122, %108
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #4
  %129 = load i32, ptr %10, align 4
  switch i32 %129, label %132 [
    i32 11, label %130
  ]

130:                                              ; preds = %128
  br label %131

131:                                              ; preds = %130, %100
  store i1 true, ptr %3, align 1
  store i32 1, ptr %10, align 4
  br label %132

132:                                              ; preds = %131, %128, %62
  call void @llvm.lifetime.end.p0(i64 15, ptr %7) #4
  call void @llvm.lifetime.end.p0(i64 16, ptr %6) #4
  %133 = load i1, ptr %3, align 1
  ret i1 %133
}

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { nocallback nofree nounwind willreturn memory(argmem: write) }
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 = { 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 #4 = { 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 = !{!7, !7, i64 0}
!12 = distinct !{!12, !13}
!13 = !{!"llvm.loop.mustprogress"}
!14 = !{!15, !20, i64 85}
!15 = !{!"_ZTS6Device", !6, i64 8, !16, i64 16, !16, i64 48, !19, i64 80, !20, i64 84, !20, i64 85, !20, i64 86}
!16 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE", !17, i64 0, !18, i64 8, !7, i64 16}
!17 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_Alloc_hiderE", !6, i64 0}
!18 = !{!"long", !7, i64 0}
!19 = !{!"_ZTSN6Device9prog_modeE", !7, i64 0}
!20 = !{!"bool", !7, i64 0}
!21 = !{i8 0, i8 2}
!22 = !{}
!23 = distinct !{!23, !13}
!24 = !{!15, !6, i64 8}
!25 = !{!15, !20, i64 84}
!26 = distinct !{!26, !13}
!27 = distinct !{!27, !13}


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

@.str.723 = external hidden unnamed_addr constant [30 x i8], align 1
@.str.724 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.725 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.726 = external hidden unnamed_addr constant [27 x i8], align 1
@.str.727 = external hidden unnamed_addr constant [19 x i8], align 1

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

; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #1

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

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

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

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

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

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

; Function Attrs: mustprogress uwtable
define dso_local noundef zeroext i1 @_ZN7Lattice26programFeatureRow_MachXO3DEPh(ptr noundef nonnull align 8 dereferenceable(152) %0, ptr nocapture noundef readonly %1) local_unnamed_addr #3 align 2 {
  %3 = alloca [16 x i8], align 16
  %4 = alloca [15 x i8], align 1
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %3) #6
  call void @llvm.lifetime.start.p0(i64 15, ptr nonnull %4) #6
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(15) %4, i8 0, i64 15, i1 false)
  %5 = getelementptr inbounds i8, ptr %3, i64 12
  store i32 0, ptr %5, align 4
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 16 dereferenceable(12) %3, ptr noundef nonnull align 1 dereferenceable(12) %1, i64 12, i1 false), !tbaa !5
  %6 = getelementptr inbounds i8, ptr %0, i64 85
  %7 = load i8, ptr %6, align 1, !tbaa !8, !range !16, !noundef !17
  %8 = trunc nuw i8 %7 to i1
  br i1 %8, label %9, label %59

9:                                                ; preds = %2
  %10 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.723)
  %11 = getelementptr inbounds i8, ptr %1, i64 11
  %12 = load i8, ptr %11, align 1, !tbaa !5
  %13 = zext i8 %12 to i32
  %14 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.724, i32 noundef %13)
  %15 = getelementptr inbounds i8, ptr %1, i64 10
  %16 = load i8, ptr %15, align 1, !tbaa !5
  %17 = zext i8 %16 to i32
  %18 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.724, i32 noundef %17)
  %19 = getelementptr inbounds i8, ptr %1, i64 9
  %20 = load i8, ptr %19, align 1, !tbaa !5
  %21 = zext i8 %20 to i32
  %22 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.724, i32 noundef %21)
  %23 = getelementptr inbounds i8, ptr %1, i64 8
  %24 = load i8, ptr %23, align 1, !tbaa !5
  %25 = zext i8 %24 to i32
  %26 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.724, i32 noundef %25)
  %27 = getelementptr inbounds i8, ptr %1, i64 7
  %28 = load i8, ptr %27, align 1, !tbaa !5
  %29 = zext i8 %28 to i32
  %30 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.724, i32 noundef %29)
  %31 = getelementptr inbounds i8, ptr %1, i64 6
  %32 = load i8, ptr %31, align 1, !tbaa !5
  %33 = zext i8 %32 to i32
  %34 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.724, i32 noundef %33)
  %35 = getelementptr inbounds i8, ptr %1, i64 5
  %36 = load i8, ptr %35, align 1, !tbaa !5
  %37 = zext i8 %36 to i32
  %38 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.724, i32 noundef %37)
  %39 = getelementptr inbounds i8, ptr %1, i64 4
  %40 = load i8, ptr %39, align 1, !tbaa !5
  %41 = zext i8 %40 to i32
  %42 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.724, i32 noundef %41)
  %43 = getelementptr inbounds i8, ptr %1, i64 3
  %44 = load i8, ptr %43, align 1, !tbaa !5
  %45 = zext i8 %44 to i32
  %46 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.724, i32 noundef %45)
  %47 = getelementptr inbounds i8, ptr %1, i64 2
  %48 = load i8, ptr %47, align 1, !tbaa !5
  %49 = zext i8 %48 to i32
  %50 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.724, i32 noundef %49)
  %51 = getelementptr inbounds i8, ptr %1, i64 1
  %52 = load i8, ptr %51, align 1, !tbaa !5
  %53 = zext i8 %52 to i32
  %54 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.724, i32 noundef %53)
  %55 = load i8, ptr %1, align 1, !tbaa !5
  %56 = zext i8 %55 to i32
  %57 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.724, i32 noundef %56)
  %58 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.725)
  br label %59

59:                                               ; preds = %9, %2
  %60 = call noundef zeroext i1 @_ZN7Lattice5wr_rdEhPhiS0_ib(ptr noundef nonnull align 8 dereferenceable(152) %0, i8 noundef zeroext -28, ptr noundef nonnull %3, i32 noundef 16, ptr noundef null, i32 noundef 0, i1 noundef zeroext false)
  %61 = getelementptr inbounds i8, ptr %0, i64 8
  %62 = load ptr, ptr %61, align 8, !tbaa !18
  call void @_ZN4Jtag9set_stateENS_10tapState_tEh(ptr noundef nonnull align 8 dereferenceable(193) %62, i32 noundef 1, i8 noundef zeroext 1)
  %63 = load ptr, ptr %61, align 8, !tbaa !18
  call void @_ZN4Jtag9toggleClkEi(ptr noundef nonnull align 8 dereferenceable(193) %63, i32 noundef 2)
  %64 = call noundef zeroext i1 @_ZN7Lattice5wr_rdEhPhiS0_ib(ptr noundef nonnull align 8 dereferenceable(152) %0, i8 noundef zeroext -1, ptr noundef null, i32 noundef 0, ptr noundef null, i32 noundef 0, i1 noundef zeroext false)
  %65 = call noundef zeroext i1 @_ZN7Lattice12pollBusyFlagEb(ptr noundef nonnull align 8 dereferenceable(152) %0, i1 noundef zeroext false)
  br i1 %65, label %66, label %.critedge

66:                                               ; preds = %59
  %67 = load i8, ptr %6, align 1, !tbaa !8, !range !16, !noundef !17
  %68 = trunc nuw i8 %67 to i1
  br i1 %68, label %73, label %69

69:                                               ; preds = %66
  %70 = getelementptr inbounds i8, ptr %0, i64 84
  %71 = load i8, ptr %70, align 4, !tbaa !19, !range !16, !noundef !17
  %72 = trunc nuw i8 %71 to i1
  br i1 %72, label %73, label %77

73:                                               ; preds = %69, %66
  %74 = call noundef zeroext i1 @_ZN7Lattice5wr_rdEhPhiS0_ib(ptr noundef nonnull align 8 dereferenceable(152) %0, i8 noundef zeroext -25, ptr noundef null, i32 noundef 0, ptr noundef nonnull %4, i32 noundef 15, i1 noundef zeroext false)
  %75 = load ptr, ptr %61, align 8, !tbaa !18
  call void @_ZN4Jtag9set_stateENS_10tapState_tEh(ptr noundef nonnull align 8 dereferenceable(193) %75, i32 noundef 1, i8 noundef zeroext 1)
  %76 = load ptr, ptr %61, align 8, !tbaa !18
  call void @_ZN4Jtag9toggleClkEi(ptr noundef nonnull align 8 dereferenceable(193) %76, i32 noundef 2)
  %.pre = load i8, ptr %6, align 1, !tbaa !8, !range !16
  br label %77

77:                                               ; preds = %73, %69
  %78 = phi i8 [ %.pre, %73 ], [ %67, %69 ]
  %79 = trunc nuw i8 %78 to i1
  br i1 %79, label %80, label %130

80:                                               ; preds = %77
  %81 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.726)
  %82 = getelementptr inbounds i8, ptr %4, i64 11
  %83 = load i8, ptr %82, align 1, !tbaa !5
  %84 = zext i8 %83 to i32
  %85 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.724, i32 noundef %84)
  %86 = getelementptr inbounds i8, ptr %4, i64 10
  %87 = load i8, ptr %86, align 1, !tbaa !5
  %88 = zext i8 %87 to i32
  %89 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.724, i32 noundef %88)
  %90 = getelementptr inbounds i8, ptr %4, i64 9
  %91 = load i8, ptr %90, align 1, !tbaa !5
  %92 = zext i8 %91 to i32
  %93 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.724, i32 noundef %92)
  %94 = getelementptr inbounds i8, ptr %4, i64 8
  %95 = load i8, ptr %94, align 1, !tbaa !5
  %96 = zext i8 %95 to i32
  %97 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.724, i32 noundef %96)
  %98 = getelementptr inbounds i8, ptr %4, i64 7
  %99 = load i8, ptr %98, align 1, !tbaa !5
  %100 = zext i8 %99 to i32
  %101 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.724, i32 noundef %100)
  %102 = getelementptr inbounds i8, ptr %4, i64 6
  %103 = load i8, ptr %102, align 1, !tbaa !5
  %104 = zext i8 %103 to i32
  %105 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.724, i32 noundef %104)
  %106 = getelementptr inbounds i8, ptr %4, i64 5
  %107 = load i8, ptr %106, align 1, !tbaa !5
  %108 = zext i8 %107 to i32
  %109 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.724, i32 noundef %108)
  %110 = getelementptr inbounds i8, ptr %4, i64 4
  %111 = load i8, ptr %110, align 1, !tbaa !5
  %112 = zext i8 %111 to i32
  %113 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.724, i32 noundef %112)
  %114 = getelementptr inbounds i8, ptr %4, i64 3
  %115 = load i8, ptr %114, align 1, !tbaa !5
  %116 = zext i8 %115 to i32
  %117 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.724, i32 noundef %116)
  %118 = getelementptr inbounds i8, ptr %4, i64 2
  %119 = load i8, ptr %118, align 1, !tbaa !5
  %120 = zext i8 %119 to i32
  %121 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.724, i32 noundef %120)
  %122 = getelementptr inbounds i8, ptr %4, i64 1
  %123 = load i8, ptr %122, align 1, !tbaa !5
  %124 = zext i8 %123 to i32
  %125 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.724, i32 noundef %124)
  %126 = load i8, ptr %4, align 1, !tbaa !5
  %127 = zext i8 %126 to i32
  %128 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.724, i32 noundef %127)
  %129 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.725)
  br label %130

130:                                              ; preds = %80, %77
  %131 = getelementptr inbounds i8, ptr %0, i64 84
  %132 = load i8, ptr %131, align 4, !tbaa !19, !range !16, !noundef !17
  %133 = trunc nuw i8 %132 to i1
  br i1 %133, label %.preheader.preheader, label %.critedge

.preheader.preheader:                             ; preds = %130
  %134 = load i8, ptr %1, align 1, !tbaa !5
  %135 = load i8, ptr %4, align 1, !tbaa !5
  %.not = icmp eq i8 %134, %135
  br i1 %.not, label %.preheader.1, label %192

.preheader.1:                                     ; preds = %.preheader.preheader
  %136 = getelementptr inbounds i8, ptr %1, i64 1
  %137 = load i8, ptr %136, align 1, !tbaa !5
  %138 = getelementptr inbounds i8, ptr %4, i64 1
  %139 = load i8, ptr %138, align 1, !tbaa !5
  %.not.1 = icmp eq i8 %137, %139
  br i1 %.not.1, label %.preheader.2, label %192

.preheader.2:                                     ; preds = %.preheader.1
  %140 = getelementptr inbounds i8, ptr %1, i64 2
  %141 = load i8, ptr %140, align 1, !tbaa !5
  %142 = getelementptr inbounds i8, ptr %4, i64 2
  %143 = load i8, ptr %142, align 1, !tbaa !5
  %.not.2 = icmp eq i8 %141, %143
  br i1 %.not.2, label %.preheader.3, label %192

.preheader.3:                                     ; preds = %.preheader.2
  %144 = getelementptr inbounds i8, ptr %1, i64 3
  %145 = load i8, ptr %144, align 1, !tbaa !5
  %146 = getelementptr inbounds i8, ptr %4, i64 3
  %147 = load i8, ptr %146, align 1, !tbaa !5
  %.not.3 = icmp eq i8 %145, %147
  br i1 %.not.3, label %.preheader.4, label %192

.preheader.4:                                     ; preds = %.preheader.3
  %148 = getelementptr inbounds i8, ptr %1, i64 4
  %149 = load i8, ptr %148, align 1, !tbaa !5
  %150 = getelementptr inbounds i8, ptr %4, i64 4
  %151 = load i8, ptr %150, align 1, !tbaa !5
  %.not.4 = icmp eq i8 %149, %151
  br i1 %.not.4, label %.preheader.5, label %192

.preheader.5:                                     ; preds = %.preheader.4
  %152 = getelementptr inbounds i8, ptr %1, i64 5
  %153 = load i8, ptr %152, align 1, !tbaa !5
  %154 = getelementptr inbounds i8, ptr %4, i64 5
  %155 = load i8, ptr %154, align 1, !tbaa !5
  %.not.5 = icmp eq i8 %153, %155
  br i1 %.not.5, label %.preheader.6, label %192

.preheader.6:                                     ; preds = %.preheader.5
  %156 = getelementptr inbounds i8, ptr %1, i64 6
  %157 = load i8, ptr %156, align 1, !tbaa !5
  %158 = getelementptr inbounds i8, ptr %4, i64 6
  %159 = load i8, ptr %158, align 1, !tbaa !5
  %.not.6 = icmp eq i8 %157, %159
  br i1 %.not.6, label %.preheader.7, label %192

.preheader.7:                                     ; preds = %.preheader.6
  %160 = getelementptr inbounds i8, ptr %1, i64 7
  %161 = load i8, ptr %160, align 1, !tbaa !5
  %162 = getelementptr inbounds i8, ptr %4, i64 7
  %163 = load i8, ptr %162, align 1, !tbaa !5
  %.not.7 = icmp eq i8 %161, %163
  br i1 %.not.7, label %.preheader.8, label %192

.preheader.8:                                     ; preds = %.preheader.7
  %164 = getelementptr inbounds i8, ptr %1, i64 8
  %165 = load i8, ptr %164, align 1, !tbaa !5
  %166 = getelementptr inbounds i8, ptr %4, i64 8
  %167 = load i8, ptr %166, align 1, !tbaa !5
  %.not.8 = icmp eq i8 %165, %167
  br i1 %.not.8, label %.preheader.9, label %192

.preheader.9:                                     ; preds = %.preheader.8
  %168 = getelementptr inbounds i8, ptr %1, i64 9
  %169 = load i8, ptr %168, align 1, !tbaa !5
  %170 = getelementptr inbounds i8, ptr %4, i64 9
  %171 = load i8, ptr %170, align 1, !tbaa !5
  %.not.9 = icmp eq i8 %169, %171
  br i1 %.not.9, label %.preheader.10, label %192

.preheader.10:                                    ; preds = %.preheader.9
  %172 = getelementptr inbounds i8, ptr %1, i64 10
  %173 = load i8, ptr %172, align 1, !tbaa !5
  %174 = getelementptr inbounds i8, ptr %4, i64 10
  %175 = load i8, ptr %174, align 1, !tbaa !5
  %.not.10 = icmp eq i8 %173, %175
  br i1 %.not.10, label %.preheader.11, label %192

.preheader.11:                                    ; preds = %.preheader.10
  %176 = getelementptr inbounds i8, ptr %1, i64 11
  %177 = load i8, ptr %176, align 1, !tbaa !5
  %178 = getelementptr inbounds i8, ptr %4, i64 11
  %179 = load i8, ptr %178, align 1, !tbaa !5
  %.not.11 = icmp eq i8 %177, %179
  br i1 %.not.11, label %.preheader.12, label %192

.preheader.12:                                    ; preds = %.preheader.11
  %180 = getelementptr inbounds i8, ptr %1, i64 12
  %181 = load i8, ptr %180, align 1, !tbaa !5
  %182 = getelementptr inbounds i8, ptr %4, i64 12
  %183 = load i8, ptr %182, align 1, !tbaa !5
  %.not.12 = icmp eq i8 %181, %183
  br i1 %.not.12, label %.preheader.13, label %192

.preheader.13:                                    ; preds = %.preheader.12
  %184 = getelementptr inbounds i8, ptr %1, i64 13
  %185 = load i8, ptr %184, align 1, !tbaa !5
  %186 = getelementptr inbounds i8, ptr %4, i64 13
  %187 = load i8, ptr %186, align 1, !tbaa !5
  %.not.13 = icmp eq i8 %185, %187
  br i1 %.not.13, label %.preheader.14, label %192

.preheader.14:                                    ; preds = %.preheader.13
  %188 = getelementptr inbounds i8, ptr %1, i64 14
  %189 = load i8, ptr %188, align 1, !tbaa !5
  %190 = getelementptr inbounds i8, ptr %4, i64 14
  %191 = load i8, ptr %190, align 1, !tbaa !5
  %.not.14 = icmp eq i8 %189, %191
  br i1 %.not.14, label %.critedge, label %192

192:                                              ; preds = %.preheader.14, %.preheader.13, %.preheader.12, %.preheader.11, %.preheader.10, %.preheader.9, %.preheader.8, %.preheader.7, %.preheader.6, %.preheader.5, %.preheader.4, %.preheader.3, %.preheader.2, %.preheader.1, %.preheader.preheader
  %193 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.727)
  br label %.critedge

.critedge:                                        ; preds = %.preheader.14, %130, %192, %59
  %.1 = phi i1 [ false, %192 ], [ false, %59 ], [ true, %130 ], [ true, %.preheader.14 ]
  call void @llvm.lifetime.end.p0(i64 15, ptr nonnull %4) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %3) #6
  ret i1 %.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) #5

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


; Effective O3 passes: EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LoopIdiomRecognizePass,LoopRotatePass,LoopSimplifyPass,MemCpyOptPass,PostOrderFunctionAttrsPass,SROAPass,SimplifyCFGPass,TailCallElimPass