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

; 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.724 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.725 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.727 = external hidden unnamed_addr constant [19 x i8], align 1
@.str.728 = external hidden unnamed_addr constant [26 x i8], align 1
@.str.729 = external hidden unnamed_addr constant [23 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 @_ZN7Lattice23programFeabits_MachXO3DEj(ptr noundef nonnull align 8 dereferenceable(152) %0, i32 noundef %1) #3 align 2 {
  %3 = alloca i1, align 1
  %4 = alloca ptr, align 8
  %5 = alloca i32, align 4
  %6 = alloca [4 x i8], align 1
  %7 = alloca [5 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 i32 %1, ptr %5, align 4, !tbaa !9
  %13 = load ptr, ptr %4, align 8
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #4
  call void @llvm.memset.p0.i64(ptr align 1 %6, i8 0, i64 4, i1 false)
  call void @llvm.lifetime.start.p0(i64 5, ptr %7) #4
  call void @llvm.memset.p0.i64(ptr align 1 %7, i8 0, i64 5, i1 false)
  %14 = getelementptr inbounds [4 x i8], ptr %6, i64 0, i64 0
  call void @llvm.memset.p0.i64(ptr align 1 %14, i8 0, i64 4, i1 false)
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #4
  store i32 0, ptr %8, align 4, !tbaa !9
  br label %15

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

18:                                               ; preds = %15
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #4
  br label %32

19:                                               ; preds = %15
  %20 = load i32, ptr %5, align 4, !tbaa !9
  %21 = load i32, ptr %8, align 4, !tbaa !9
  %22 = mul nsw i32 8, %21
  %23 = lshr i32 %20, %22
  %24 = and i32 %23, 255
  %25 = trunc i32 %24 to i8
  %26 = load i32, ptr %8, align 4, !tbaa !9
  %27 = sext i32 %26 to i64
  %28 = getelementptr inbounds [4 x i8], ptr %6, i64 0, i64 %27
  store i8 %25, ptr %28, align 1, !tbaa !11
  br label %29

29:                                               ; preds = %19
  %30 = load i32, ptr %8, align 4, !tbaa !9
  %31 = add nsw i32 %30, 1
  store i32 %31, ptr %8, align 4, !tbaa !9
  br label %15, !llvm.loop !12

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

36:                                               ; preds = %32
  %37 = call i32 (ptr, ...) @printf(ptr noundef @.str.728)
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #4
  store i32 3, ptr %9, align 4, !tbaa !9
  br label %38

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

41:                                               ; preds = %38
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #4
  br label %52

42:                                               ; preds = %38
  %43 = load i32, ptr %9, align 4, !tbaa !9
  %44 = sext i32 %43 to i64
  %45 = getelementptr inbounds [4 x i8], ptr %6, i64 0, i64 %44
  %46 = load i8, ptr %45, align 1, !tbaa !11
  %47 = zext i8 %46 to i32
  %48 = call i32 (ptr, ...) @printf(ptr noundef @.str.724, i32 noundef %47)
  br label %49

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

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

54:                                               ; preds = %52, %32
  %55 = getelementptr inbounds [4 x i8], ptr %6, i64 0, i64 0
  %56 = call noundef zeroext i1 @_ZN7Lattice5wr_rdEhPhiS0_ib(ptr noundef nonnull align 8 dereferenceable(152) %13, i8 noundef zeroext -8, ptr noundef %55, i32 noundef 4, ptr noundef null, i32 noundef 0, i1 noundef zeroext false)
  %57 = getelementptr inbounds %class.Device, ptr %13, i32 0, i32 1
  %58 = load ptr, ptr %57, align 8, !tbaa !24
  call void @_ZN4Jtag9set_stateENS_10tapState_tEh(ptr noundef nonnull align 8 dereferenceable(193) %58, i32 noundef 1, i8 noundef zeroext 1)
  %59 = getelementptr inbounds %class.Device, ptr %13, i32 0, i32 1
  %60 = load ptr, ptr %59, align 8, !tbaa !24
  call void @_ZN4Jtag9toggleClkEi(ptr noundef nonnull align 8 dereferenceable(193) %60, i32 noundef 2)
  %61 = 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)
  %62 = call noundef zeroext i1 @_ZN7Lattice12pollBusyFlagEb(ptr noundef nonnull align 8 dereferenceable(152) %13, i1 noundef zeroext false)
  br i1 %62, label %64, label %63

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

110:                                              ; preds = %106
  %111 = load i32, ptr %5, align 4, !tbaa !9
  %112 = load i32, ptr %12, align 4, !tbaa !9
  %113 = mul nsw i32 8, %112
  %114 = lshr i32 %111, %113
  %115 = and i32 %114, 255
  %116 = load i32, ptr %12, align 4, !tbaa !9
  %117 = sext i32 %116 to i64
  %118 = getelementptr inbounds [5 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 = %110
  %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 = %110
  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 %106, !llvm.loop !27

128:                                              ; preds = %122, %109
  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, %101
  store i1 true, ptr %3, align 1
  store i32 1, ptr %10, align 4
  br label %132

132:                                              ; preds = %131, %128, %63
  call void @llvm.lifetime.end.p0(i64 5, ptr %7) #4
  call void @llvm.lifetime.end.p0(i64 4, 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.724 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.725 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.727 = external hidden unnamed_addr constant [19 x i8], align 1
@.str.728 = external hidden unnamed_addr constant [26 x i8], align 1
@.str.729 = external hidden unnamed_addr constant [23 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 @_ZN7Lattice23programFeabits_MachXO3DEj(ptr noundef nonnull align 8 dereferenceable(152) %0, i32 noundef %1) local_unnamed_addr #3 align 2 {
  %3 = alloca [4 x i8], align 1
  %4 = alloca [5 x i8], align 1
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #5
  call void @llvm.lifetime.start.p0(i64 5, ptr nonnull %4) #5
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(5) %4, i8 0, i64 5, i1 false)
  %5 = trunc i32 %1 to i8
  store i8 %5, ptr %3, align 1, !tbaa !5
  %6 = lshr i32 %1, 8
  %7 = trunc i32 %6 to i8
  %8 = getelementptr inbounds i8, ptr %3, i64 1
  store i8 %7, ptr %8, align 1, !tbaa !5
  %9 = lshr i32 %1, 16
  %10 = trunc i32 %9 to i8
  %11 = getelementptr inbounds i8, ptr %3, i64 2
  store i8 %10, ptr %11, align 1, !tbaa !5
  %12 = lshr i32 %1, 24
  %13 = trunc nuw i32 %12 to i8
  %14 = getelementptr inbounds i8, ptr %3, i64 3
  store i8 %13, ptr %14, align 1, !tbaa !5
  %15 = getelementptr inbounds i8, ptr %0, i64 85
  %16 = load i8, ptr %15, align 1, !tbaa !8, !range !16, !noundef !17
  %17 = trunc nuw i8 %16 to i1
  br i1 %17, label %18, label %28

18:                                               ; preds = %2
  %19 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.728)
  %20 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.724, i32 noundef %12)
  %21 = and i32 %9, 255
  %22 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.724, i32 noundef %21)
  %23 = and i32 %6, 255
  %24 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.724, i32 noundef %23)
  %25 = and i32 %1, 255
  %26 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.724, i32 noundef %25)
  %27 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.725)
  br label %28

28:                                               ; preds = %18, %2
  %29 = call noundef zeroext i1 @_ZN7Lattice5wr_rdEhPhiS0_ib(ptr noundef nonnull align 8 dereferenceable(152) %0, i8 noundef zeroext -8, ptr noundef nonnull %3, i32 noundef 4, ptr noundef null, i32 noundef 0, i1 noundef zeroext false)
  %30 = getelementptr inbounds i8, ptr %0, i64 8
  %31 = load ptr, ptr %30, align 8, !tbaa !18
  call void @_ZN4Jtag9set_stateENS_10tapState_tEh(ptr noundef nonnull align 8 dereferenceable(193) %31, i32 noundef 1, i8 noundef zeroext 1)
  %32 = load ptr, ptr %30, align 8, !tbaa !18
  call void @_ZN4Jtag9toggleClkEi(ptr noundef nonnull align 8 dereferenceable(193) %32, i32 noundef 2)
  %33 = 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)
  %34 = call noundef zeroext i1 @_ZN7Lattice12pollBusyFlagEb(ptr noundef nonnull align 8 dereferenceable(152) %0, i1 noundef zeroext false)
  br i1 %34, label %35, label %.critedge

35:                                               ; preds = %28
  %36 = load i8, ptr %15, align 1, !tbaa !8, !range !16, !noundef !17
  %37 = trunc nuw i8 %36 to i1
  br i1 %37, label %42, label %38

38:                                               ; preds = %35
  %39 = getelementptr inbounds i8, ptr %0, i64 84
  %40 = load i8, ptr %39, align 4, !tbaa !19, !range !16, !noundef !17
  %41 = trunc nuw i8 %40 to i1
  br i1 %41, label %42, label %46

42:                                               ; preds = %38, %35
  %43 = call noundef zeroext i1 @_ZN7Lattice5wr_rdEhPhiS0_ib(ptr noundef nonnull align 8 dereferenceable(152) %0, i8 noundef zeroext -5, ptr noundef null, i32 noundef 0, ptr noundef nonnull %4, i32 noundef 5, i1 noundef zeroext false)
  %44 = load ptr, ptr %30, align 8, !tbaa !18
  call void @_ZN4Jtag9set_stateENS_10tapState_tEh(ptr noundef nonnull align 8 dereferenceable(193) %44, i32 noundef 1, i8 noundef zeroext 1)
  %45 = load ptr, ptr %30, align 8, !tbaa !18
  call void @_ZN4Jtag9toggleClkEi(ptr noundef nonnull align 8 dereferenceable(193) %45, i32 noundef 2)
  %.pre = load i8, ptr %15, align 1, !tbaa !8, !range !16
  br label %46

46:                                               ; preds = %42, %38
  %47 = phi i8 [ %.pre, %42 ], [ %36, %38 ]
  %48 = trunc nuw i8 %47 to i1
  br i1 %48, label %49, label %71

49:                                               ; preds = %46
  %50 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.729)
  %51 = getelementptr inbounds i8, ptr %4, i64 4
  %52 = load i8, ptr %51, align 1, !tbaa !5
  %53 = zext i8 %52 to i32
  %54 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.724, i32 noundef %53)
  %55 = getelementptr inbounds i8, ptr %4, i64 3
  %56 = load i8, ptr %55, align 1, !tbaa !5
  %57 = zext i8 %56 to i32
  %58 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.724, i32 noundef %57)
  %59 = getelementptr inbounds i8, ptr %4, i64 2
  %60 = load i8, ptr %59, align 1, !tbaa !5
  %61 = zext i8 %60 to i32
  %62 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.724, i32 noundef %61)
  %63 = getelementptr inbounds i8, ptr %4, i64 1
  %64 = load i8, ptr %63, align 1, !tbaa !5
  %65 = zext i8 %64 to i32
  %66 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.724, i32 noundef %65)
  %67 = load i8, ptr %4, align 1, !tbaa !5
  %68 = zext i8 %67 to i32
  %69 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.724, i32 noundef %68)
  %70 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.725)
  br label %71

71:                                               ; preds = %49, %46
  %72 = getelementptr inbounds i8, ptr %0, i64 84
  %73 = load i8, ptr %72, align 4, !tbaa !19, !range !16, !noundef !17
  %74 = trunc nuw i8 %73 to i1
  br i1 %74, label %.preheader.preheader, label %.critedge

.preheader.preheader:                             ; preds = %71
  %75 = load i8, ptr %4, align 1, !tbaa !5
  %.not = icmp eq i8 %75, %5
  %76 = getelementptr inbounds i8, ptr %4, i64 1
  %77 = load i8, ptr %76, align 1
  %.not.1 = icmp eq i8 %77, %7
  %or.cond = select i1 %.not, i1 %.not.1, i1 false
  %78 = getelementptr inbounds i8, ptr %4, i64 2
  %79 = load i8, ptr %78, align 1
  %.not.2 = icmp eq i8 %79, %10
  %or.cond33 = select i1 %or.cond, i1 %.not.2, i1 false
  %80 = getelementptr inbounds i8, ptr %4, i64 3
  %81 = load i8, ptr %80, align 1
  %.not.3 = icmp eq i8 %81, %13
  %or.cond35 = select i1 %or.cond33, i1 %.not.3, i1 false
  br i1 %or.cond35, label %.critedge, label %82

82:                                               ; preds = %.preheader.preheader
  %83 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.727)
  br label %.critedge

.critedge:                                        ; preds = %.preheader.preheader, %71, %82, %28
  %.1 = phi i1 [ false, %82 ], [ false, %28 ], [ true, %71 ], [ true, %.preheader.preheader ]
  call void @llvm.lifetime.end.p0(i64 5, ptr nonnull %4) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #5
  ret i1 %.1
}

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 = { 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: DSEPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LoopRotatePass,LoopSimplifyPass,SCCPPass,SROAPass,SimplifyCFGPass,TailCallElimPass