; LLVM IR from intel/intel-ipsec-mb :: test/common (utils)

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

@print_tested_arch.arch_str_tab = external hidden global [5 x ptr], align 16
@.str.22 = external hidden unnamed_addr constant [1 x i8], align 1
@.str.23 = external hidden unnamed_addr constant [12 x i8], align 1
@.str.24 = external hidden unnamed_addr constant [18 x i8], align 1
@.str.25 = external hidden unnamed_addr constant [19 x i8], align 1
@.str.26 = external hidden unnamed_addr constant [41 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: nounwind uwtable
define dso_local void @print_tested_arch(i64 noundef %0, i32 noundef %1) #1 {
  %3 = alloca i64, align 8
  %4 = alloca i32, align 4
  %5 = alloca ptr, align 8
  %6 = alloca i32, align 4
  store i64 %0, ptr %3, align 8, !tbaa !5
  store i32 %1, ptr %4, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #3
  store ptr @.str.22, ptr %5, align 8, !tbaa !11
  %7 = load i32, ptr %4, align 4, !tbaa !9
  switch i32 %7, label %34 [
    i32 2, label %8
    i32 4, label %8
    i32 1, label %9
    i32 3, label %20
  ]

8:                                                ; preds = %2, %2
  br label %36

9:                                                ; preds = %2
  %10 = load i64, ptr %3, align 8, !tbaa !5
  %11 = and i64 %10, 1
  %12 = icmp ne i64 %11, 0
  br i1 %12, label %13, label %19

13:                                               ; preds = %9
  %14 = load i64, ptr %3, align 8, !tbaa !5
  %15 = and i64 %14, 65536
  %16 = icmp ne i64 %15, 0
  br i1 %16, label %17, label %18

17:                                               ; preds = %13
  store ptr @.str.23, ptr %5, align 8, !tbaa !11
  br label %18

18:                                               ; preds = %17, %13
  br label %19

19:                                               ; preds = %18, %9
  br label %36

20:                                               ; preds = %2
  %21 = load i64, ptr %3, align 8, !tbaa !5
  %22 = and i64 %21, 4096
  %23 = icmp ne i64 %22, 0
  br i1 %23, label %24, label %33

24:                                               ; preds = %20
  %25 = load i64, ptr %3, align 8, !tbaa !5
  %26 = and i64 %25, 65536
  %27 = icmp ne i64 %26, 0
  br i1 %27, label %28, label %33

28:                                               ; preds = %24
  %29 = load i64, ptr %3, align 8, !tbaa !5
  %30 = and i64 %29, 8192
  %31 = icmp ne i64 %30, 0
  br i1 %31, label %32, label %33

32:                                               ; preds = %28
  store ptr @.str.24, ptr %5, align 8, !tbaa !11
  br label %33

33:                                               ; preds = %32, %28, %24, %20
  br label %36

34:                                               ; preds = %2
  %35 = call i32 (ptr, ...) @printf(ptr noundef @.str.25)
  store i32 1, ptr %6, align 4
  br label %47

36:                                               ; preds = %33, %19, %8
  %37 = load i32, ptr %4, align 4, !tbaa !9
  %38 = zext i32 %37 to i64
  %39 = getelementptr inbounds [5 x ptr], ptr @print_tested_arch.arch_str_tab, i64 0, i64 %38
  %40 = load ptr, ptr %39, align 8, !tbaa !11
  %41 = load i32, ptr %4, align 4, !tbaa !9
  %42 = zext i32 %41 to i64
  %43 = getelementptr inbounds [5 x ptr], ptr @print_tested_arch.arch_str_tab, i64 0, i64 %42
  %44 = load ptr, ptr %43, align 8, !tbaa !11
  %45 = load ptr, ptr %5, align 8, !tbaa !11
  %46 = call i32 (ptr, ...) @printf(ptr noundef @.str.26, ptr noundef %40, ptr noundef %44, ptr noundef %45)
  store i32 0, ptr %6, align 4
  br label %47

47:                                               ; preds = %36, %34
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #3
  %48 = load i32, ptr %6, align 4
  switch i32 %48, label %50 [
    i32 0, label %49
    i32 1, label %49
  ]

49:                                               ; preds = %47, %47
  ret void

50:                                               ; preds = %47
  unreachable
}

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

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #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 = !{!"long", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"any pointer", !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"

@print_tested_arch.arch_str_tab = external hidden local_unnamed_addr global [5 x ptr], align 16
@.str.22 = external hidden unnamed_addr constant [1 x i8], align 1
@.str.23 = external hidden unnamed_addr constant [12 x i8], align 1
@.str.24 = external hidden unnamed_addr constant [18 x i8], align 1
@.str.25 = external hidden unnamed_addr constant [19 x i8], align 1
@.str.26 = external hidden unnamed_addr constant [41 x i8], align 1

; Function Attrs: nofree nounwind uwtable
define dso_local void @print_tested_arch(i64 noundef %0, i32 noundef %1) local_unnamed_addr #0 {
  switch i32 %1, label %7 [
    i32 2, label %9
    i32 4, label %9
    i32 1, label %3
    i32 3, label %5
  ]

3:                                                ; preds = %2
  %4 = and i64 %0, 65537
  %or.cond.not = icmp eq i64 %4, 65537
  %spec.select = select i1 %or.cond.not, ptr @.str.23, ptr @.str.22
  br label %9

5:                                                ; preds = %2
  %6 = and i64 %0, 77824
  %or.cond13.not = icmp eq i64 %6, 77824
  %spec.select14 = select i1 %or.cond13.not, ptr @.str.24, ptr @.str.22
  br label %9

7:                                                ; preds = %2
  %8 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.25)
  br label %14

9:                                                ; preds = %5, %3, %2, %2
  %.0 = phi ptr [ @.str.22, %2 ], [ @.str.22, %2 ], [ %spec.select, %3 ], [ %spec.select14, %5 ]
  %10 = zext nneg i32 %1 to i64
  %11 = getelementptr inbounds [5 x ptr], ptr @print_tested_arch.arch_str_tab, i64 0, i64 %10
  %12 = load ptr, ptr %11, align 8, !tbaa !5
  %13 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.26, ptr noundef %12, ptr noundef %12, ptr noundef nonnull %.0)
  br label %14

14:                                               ; preds = %9, %7
  ret void
}

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

attributes #0 = { 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, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}


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