; LLVM IR from facebook/redex :: libredex/DexOpcode.ll (ZN10dex_opcode14is_commutativeE9DexOpcode)

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

; Function Attrs: mustprogress nounwind uwtable
define dso_local noundef zeroext i1 @_ZN10dex_opcode14is_commutativeE9DexOpcode(i16 noundef zeroext %0) #0 {
  %2 = alloca i16, align 2
  store i16 %0, ptr %2, align 2, !tbaa !5
  %3 = load i16, ptr %2, align 2, !tbaa !5
  %4 = zext i16 %3 to i32
  %5 = icmp eq i32 %4, 144
  br i1 %5, label %50, label %6

6:                                                ; preds = %1
  %7 = load i16, ptr %2, align 2, !tbaa !5
  %8 = zext i16 %7 to i32
  %9 = icmp eq i32 %8, 146
  br i1 %9, label %50, label %10

10:                                               ; preds = %6
  %11 = load i16, ptr %2, align 2, !tbaa !5
  %12 = zext i16 %11 to i32
  %13 = icmp sge i32 %12, 149
  br i1 %13, label %14, label %18

14:                                               ; preds = %10
  %15 = load i16, ptr %2, align 2, !tbaa !5
  %16 = zext i16 %15 to i32
  %17 = icmp sle i32 %16, 151
  br i1 %17, label %50, label %18

18:                                               ; preds = %14, %10
  %19 = load i16, ptr %2, align 2, !tbaa !5
  %20 = zext i16 %19 to i32
  %21 = icmp eq i32 %20, 155
  br i1 %21, label %50, label %22

22:                                               ; preds = %18
  %23 = load i16, ptr %2, align 2, !tbaa !5
  %24 = zext i16 %23 to i32
  %25 = icmp eq i32 %24, 157
  br i1 %25, label %50, label %26

26:                                               ; preds = %22
  %27 = load i16, ptr %2, align 2, !tbaa !5
  %28 = zext i16 %27 to i32
  %29 = icmp sge i32 %28, 160
  br i1 %29, label %30, label %34

30:                                               ; preds = %26
  %31 = load i16, ptr %2, align 2, !tbaa !5
  %32 = zext i16 %31 to i32
  %33 = icmp sle i32 %32, 162
  br i1 %33, label %50, label %34

34:                                               ; preds = %30, %26
  %35 = load i16, ptr %2, align 2, !tbaa !5
  %36 = zext i16 %35 to i32
  %37 = icmp eq i32 %36, 166
  br i1 %37, label %50, label %38

38:                                               ; preds = %34
  %39 = load i16, ptr %2, align 2, !tbaa !5
  %40 = zext i16 %39 to i32
  %41 = icmp eq i32 %40, 168
  br i1 %41, label %50, label %42

42:                                               ; preds = %38
  %43 = load i16, ptr %2, align 2, !tbaa !5
  %44 = zext i16 %43 to i32
  %45 = icmp eq i32 %44, 171
  br i1 %45, label %50, label %46

46:                                               ; preds = %42
  %47 = load i16, ptr %2, align 2, !tbaa !5
  %48 = zext i16 %47 to i32
  %49 = icmp eq i32 %48, 173
  br label %50

50:                                               ; preds = %46, %42, %38, %34, %30, %22, %18, %14, %6, %1
  %51 = phi i1 [ true, %42 ], [ true, %38 ], [ true, %34 ], [ true, %30 ], [ true, %22 ], [ true, %18 ], [ true, %14 ], [ true, %6 ], [ true, %1 ], [ %49, %46 ]
  ret i1 %51
}

attributes #0 = { mustprogress 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" }

!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 = !{!"_ZTS9DexOpcode", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}


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

; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable
define dso_local noundef zeroext i1 @_ZN10dex_opcode14is_commutativeE9DexOpcode(i16 noundef zeroext %0) local_unnamed_addr #0 {
  %2 = and i16 %0, -3
  %or.cond = icmp eq i16 %2, 144
  br i1 %or.cond, label %switch.edge, label %3

3:                                                ; preds = %1
  %switch.tableidx = add i16 %0, -149
  %4 = icmp ult i16 %switch.tableidx, 25
  br i1 %4, label %switch.lookup, label %switch.edge

switch.lookup:                                    ; preds = %3
  %switch.cast = zext nneg i16 %switch.tableidx to i25
  %switch.downshift = lshr i25 -11912889, %switch.cast
  %switch.masked = trunc i25 %switch.downshift to i1
  br label %switch.edge

switch.edge:                                      ; preds = %3, %switch.lookup, %1
  %5 = phi i1 [ true, %1 ], [ %switch.masked, %switch.lookup ], [ false, %3 ]
  ret i1 %5
}

attributes #0 = { mustprogress nofree norecurse nosync nounwind willreturn memory(none) 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" }

!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,InstCombinePass,PostOrderFunctionAttrsPass,SROAPass,SimplifyCFGPass