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

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

@.str.594 = external hidden unnamed_addr constant [44 x i8], align 1
@.str.595 = external hidden unnamed_addr constant [30 x i8], align 1
@.str.596 = external hidden unnamed_addr constant [64 x i8], align 1
@.str.597 = external hidden unnamed_addr constant [34 x i8], align 1
@.str.598 = external hidden unnamed_addr constant [9 x i8], align 1
@.str.599 = external hidden unnamed_addr constant [48 x i8], align 1
@.str.600 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.601 = external hidden unnamed_addr constant [8 x i8], align 1
@.str.602 = external hidden unnamed_addr constant [48 x i8], align 1
@.str.603 = external hidden unnamed_addr constant [48 x i8], align 1
@.str.604 = external hidden unnamed_addr constant [48 x i8], align 1
@.str.605 = external hidden unnamed_addr constant [48 x i8], align 1
@.str.606 = external hidden unnamed_addr constant [48 x i8], align 1
@.str.607 = external hidden unnamed_addr constant [48 x i8], align 1
@.str.608 = external hidden unnamed_addr constant [48 x i8], align 1
@.str.609 = external hidden unnamed_addr constant [48 x i8], align 1
@.str.610 = external hidden unnamed_addr constant [8 x i8], align 1
@.str.611 = external hidden unnamed_addr constant [9 x i8], align 1
@.str.612 = external hidden unnamed_addr constant [48 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 @_Z14displayFeabitst(i16 noundef zeroext %0) #1 {
  %2 = alloca i16, align 2
  %3 = alloca i8, align 1
  %4 = alloca i8, align 1
  store i16 %0, ptr %2, align 2, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 1, ptr %3) #3
  %5 = load i16, ptr %2, align 2, !tbaa !5
  %6 = zext i16 %5 to i32
  %7 = ashr i32 %6, 12
  %8 = and i32 %7, 3
  %9 = trunc i32 %8 to i8
  store i8 %9, ptr %3, align 1, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 1, ptr %4) #3
  %10 = load i16, ptr %2, align 2, !tbaa !5
  %11 = zext i16 %10 to i32
  %12 = ashr i32 %11, 11
  %13 = and i32 %12, 1
  %14 = trunc i32 %13 to i8
  store i8 %14, ptr %4, align 1, !tbaa !9
  %15 = call i32 (ptr, ...) @printf(ptr noundef @.str.594)
  %16 = load i8, ptr %3, align 1, !tbaa !9
  %17 = zext i8 %16 to i32
  switch i32 %17, label %36 [
    i32 0, label %18
    i32 1, label %27
  ]

18:                                               ; preds = %1
  %19 = load i8, ptr %4, align 1, !tbaa !9
  %20 = zext i8 %19 to i32
  %21 = icmp ne i32 %20, 1
  br i1 %21, label %22, label %24

22:                                               ; preds = %18
  %23 = call i32 (ptr, ...) @printf(ptr noundef @.str.595)
  br label %26

24:                                               ; preds = %18
  %25 = call i32 (ptr, ...) @printf(ptr noundef @.str.596)
  br label %26

26:                                               ; preds = %24, %22
  br label %38

27:                                               ; preds = %1
  %28 = load i8, ptr %4, align 1, !tbaa !9
  %29 = zext i8 %28 to i32
  %30 = icmp eq i32 %29, 1
  br i1 %30, label %31, label %33

31:                                               ; preds = %27
  %32 = call i32 (ptr, ...) @printf(ptr noundef @.str.597)
  br label %35

33:                                               ; preds = %27
  %34 = call i32 (ptr, ...) @printf(ptr noundef @.str.598)
  br label %35

35:                                               ; preds = %33, %31
  br label %38

36:                                               ; preds = %1
  %37 = call i32 (ptr, ...) @printf(ptr noundef @.str.598)
  br label %38

38:                                               ; preds = %36, %35, %26
  %39 = load i16, ptr %2, align 2, !tbaa !5
  %40 = zext i16 %39 to i32
  %41 = ashr i32 %40, 11
  %42 = and i32 %41, 1
  %43 = icmp ne i32 %42, 0
  %44 = zext i1 %43 to i64
  %45 = select i1 %43, ptr @.str.600, ptr @.str.601
  %46 = call i32 (ptr, ...) @printf(ptr noundef @.str.599, ptr noundef %45)
  %47 = load i16, ptr %2, align 2, !tbaa !5
  %48 = zext i16 %47 to i32
  %49 = ashr i32 %48, 10
  %50 = and i32 %49, 1
  %51 = icmp ne i32 %50, 0
  %52 = zext i1 %51 to i64
  %53 = select i1 %51, ptr @.str.601, ptr @.str.600
  %54 = call i32 (ptr, ...) @printf(ptr noundef @.str.602, ptr noundef %53)
  %55 = load i16, ptr %2, align 2, !tbaa !5
  %56 = zext i16 %55 to i32
  %57 = ashr i32 %56, 9
  %58 = and i32 %57, 1
  %59 = icmp ne i32 %58, 0
  %60 = zext i1 %59 to i64
  %61 = select i1 %59, ptr @.str.601, ptr @.str.600
  %62 = call i32 (ptr, ...) @printf(ptr noundef @.str.603, ptr noundef %61)
  %63 = load i16, ptr %2, align 2, !tbaa !5
  %64 = zext i16 %63 to i32
  %65 = ashr i32 %64, 8
  %66 = and i32 %65, 1
  %67 = icmp ne i32 %66, 0
  %68 = zext i1 %67 to i64
  %69 = select i1 %67, ptr @.str.601, ptr @.str.600
  %70 = call i32 (ptr, ...) @printf(ptr noundef @.str.604, ptr noundef %69)
  %71 = load i16, ptr %2, align 2, !tbaa !5
  %72 = zext i16 %71 to i32
  %73 = ashr i32 %72, 7
  %74 = and i32 %73, 1
  %75 = icmp ne i32 %74, 0
  %76 = zext i1 %75 to i64
  %77 = select i1 %75, ptr @.str.600, ptr @.str.601
  %78 = call i32 (ptr, ...) @printf(ptr noundef @.str.605, ptr noundef %77)
  %79 = load i16, ptr %2, align 2, !tbaa !5
  %80 = zext i16 %79 to i32
  %81 = ashr i32 %80, 6
  %82 = and i32 %81, 1
  %83 = icmp ne i32 %82, 0
  %84 = zext i1 %83 to i64
  %85 = select i1 %83, ptr @.str.600, ptr @.str.601
  %86 = call i32 (ptr, ...) @printf(ptr noundef @.str.606, ptr noundef %85)
  %87 = load i16, ptr %2, align 2, !tbaa !5
  %88 = zext i16 %87 to i32
  %89 = ashr i32 %88, 5
  %90 = and i32 %89, 1
  %91 = icmp ne i32 %90, 0
  %92 = zext i1 %91 to i64
  %93 = select i1 %91, ptr @.str.601, ptr @.str.600
  %94 = call i32 (ptr, ...) @printf(ptr noundef @.str.607, ptr noundef %93)
  %95 = load i16, ptr %2, align 2, !tbaa !5
  %96 = zext i16 %95 to i32
  %97 = ashr i32 %96, 4
  %98 = and i32 %97, 1
  %99 = icmp ne i32 %98, 0
  %100 = zext i1 %99 to i64
  %101 = select i1 %99, ptr @.str.600, ptr @.str.601
  %102 = call i32 (ptr, ...) @printf(ptr noundef @.str.608, ptr noundef %101)
  %103 = load i16, ptr %2, align 2, !tbaa !5
  %104 = zext i16 %103 to i32
  %105 = ashr i32 %104, 3
  %106 = and i32 %105, 1
  %107 = icmp ne i32 %106, 0
  %108 = zext i1 %107 to i64
  %109 = select i1 %107, ptr @.str.610, ptr @.str.611
  %110 = call i32 (ptr, ...) @printf(ptr noundef @.str.609, ptr noundef %109)
  %111 = load i16, ptr %2, align 2, !tbaa !5
  %112 = zext i16 %111 to i32
  %113 = ashr i32 %112, 2
  %114 = and i32 %113, 1
  %115 = icmp ne i32 %114, 0
  %116 = zext i1 %115 to i64
  %117 = select i1 %115, ptr @.str.610, ptr @.str.611
  %118 = call i32 (ptr, ...) @printf(ptr noundef @.str.612, ptr noundef %117)
  call void @llvm.lifetime.end.p0(i64 1, ptr %4) #3
  call void @llvm.lifetime.end.p0(i64 1, ptr %3) #3
  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 = !{!"short", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!7, !7, i64 0}


; 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.594 = external hidden unnamed_addr constant [44 x i8], align 1
@.str.595 = external hidden unnamed_addr constant [30 x i8], align 1
@.str.596 = external hidden unnamed_addr constant [64 x i8], align 1
@.str.597 = external hidden unnamed_addr constant [34 x i8], align 1
@.str.598 = external hidden unnamed_addr constant [9 x i8], align 1
@.str.599 = external hidden unnamed_addr constant [48 x i8], align 1
@.str.600 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.601 = external hidden unnamed_addr constant [8 x i8], align 1
@.str.602 = external hidden unnamed_addr constant [48 x i8], align 1
@.str.603 = external hidden unnamed_addr constant [48 x i8], align 1
@.str.604 = external hidden unnamed_addr constant [48 x i8], align 1
@.str.605 = external hidden unnamed_addr constant [48 x i8], align 1
@.str.606 = external hidden unnamed_addr constant [48 x i8], align 1
@.str.607 = external hidden unnamed_addr constant [48 x i8], align 1
@.str.608 = external hidden unnamed_addr constant [48 x i8], align 1
@.str.609 = external hidden unnamed_addr constant [48 x i8], align 1
@.str.610 = external hidden unnamed_addr constant [8 x i8], align 1
@.str.611 = external hidden unnamed_addr constant [9 x i8], align 1
@.str.612 = external hidden unnamed_addr constant [48 x i8], align 1

; Function Attrs: mustprogress nofree nounwind uwtable
define dso_local void @_Z14displayFeabitst(i16 noundef zeroext %0) local_unnamed_addr #0 {
  %2 = zext i16 %0 to i32
  %3 = lshr i16 %0, 12
  %4 = and i16 %3, 3
  %5 = lshr i32 %2, 11
  %6 = and i32 %5, 1
  %7 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.594)
  switch i16 %4, label %10 [
    i16 0, label %8
    i16 1, label %9
  ]

8:                                                ; preds = %1
  %.not15.not = icmp eq i32 %6, 0
  %.str.595..str.596 = select i1 %.not15.not, ptr @.str.595, ptr @.str.596
  br label %10

9:                                                ; preds = %1
  %.not = icmp eq i32 %6, 0
  %.str.598..str.597 = select i1 %.not, ptr @.str.598, ptr @.str.597
  br label %10

10:                                               ; preds = %1, %9, %8
  %.str.597.sink = phi ptr [ %.str.595..str.596, %8 ], [ %.str.598..str.597, %9 ], [ @.str.598, %1 ]
  %11 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.597.sink)
  %.not16 = icmp eq i32 %6, 0
  %12 = select i1 %.not16, ptr @.str.601, ptr @.str.600
  %13 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.599, ptr noundef nonnull %12)
  %14 = and i32 %2, 1024
  %.not17 = icmp eq i32 %14, 0
  %15 = select i1 %.not17, ptr @.str.600, ptr @.str.601
  %16 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.602, ptr noundef nonnull %15)
  %17 = insertelement <8 x i32> poison, i32 %2, i64 0
  %18 = shufflevector <8 x i32> %17, <8 x i32> poison, <8 x i32> zeroinitializer
  %19 = and <8 x i32> %18, <i32 4, i32 8, i32 16, i32 32, i32 64, i32 128, i32 256, i32 512>
  %20 = icmp eq <8 x i32> %19, zeroinitializer
  %21 = extractelement <8 x i1> %20, i64 7
  %22 = select i1 %21, ptr @.str.600, ptr @.str.601
  %23 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.603, ptr noundef nonnull %22)
  %24 = extractelement <8 x i1> %20, i64 6
  %25 = select i1 %24, ptr @.str.600, ptr @.str.601
  %26 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.604, ptr noundef nonnull %25)
  %27 = extractelement <8 x i1> %20, i64 5
  %28 = select i1 %27, ptr @.str.601, ptr @.str.600
  %29 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.605, ptr noundef nonnull %28)
  %30 = extractelement <8 x i1> %20, i64 4
  %31 = select i1 %30, ptr @.str.601, ptr @.str.600
  %32 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.606, ptr noundef nonnull %31)
  %33 = extractelement <8 x i1> %20, i64 3
  %34 = select i1 %33, ptr @.str.600, ptr @.str.601
  %35 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.607, ptr noundef nonnull %34)
  %36 = extractelement <8 x i1> %20, i64 2
  %37 = select i1 %36, ptr @.str.601, ptr @.str.600
  %38 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.608, ptr noundef nonnull %37)
  %39 = extractelement <8 x i1> %20, i64 1
  %40 = select i1 %39, ptr @.str.611, ptr @.str.610
  %41 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.609, ptr noundef nonnull %40)
  %42 = extractelement <8 x i1> %20, i64 0
  %43 = select i1 %42, ptr @.str.611, ptr @.str.610
  %44 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.612, ptr noundef nonnull %43)
  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)"}


; Effective O3 passes: EarlyCSEPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,PostOrderFunctionAttrsPass,SLPVectorizerPass,SROAPass,SimplifyCFGPass,TailCallElimPass