#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */

/* Variables and functions */
scalar_t__ Abc_Tt4CheckTwoLevel(int);
int Abc_Tt4CountOnes(int);
int Abc_Tt4Check(int t) {
  int Count, tn = 0xFFFF & ~t;
  if (t == 0x6996 || tn == 0x6996)
    return 1;
  if ((t & (t - 1)) == 0)
    return 1;
  if ((tn & (tn - 1)) == 0)
    return 1;
  Count = Abc_Tt4CountOnes(t);
  if (Count == 7 && Abc_Tt4CheckTwoLevel(t) > 0)
    return 1;
  if (Count == 9 && Abc_Tt4CheckTwoLevel(tn) > 0)
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<Abc_Tt4Check>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
xor    $0xffffffff,%eax
and    $0xffff,%eax
mov    %eax,-0x10(%rbp)
cmpl   $0x6996,-0x8(%rbp)
je     1153 <Abc_Tt4Check+0x33>
cmpl   $0x6996,-0x10(%rbp)
jne    115f <Abc_Tt4Check+0x3f>
movl   $0x1,-0x4(%rbp)
jmp    1201 <Abc_Tt4Check+0xe1>
mov    -0x8(%rbp),%eax
mov    -0x8(%rbp),%ecx
sub    $0x1,%ecx
and    %ecx,%eax
cmp    $0x0,%eax
jne    117f <Abc_Tt4Check+0x5f>
movl   $0x1,-0x4(%rbp)
jmp    1201 <Abc_Tt4Check+0xe1>
mov    -0x10(%rbp),%eax
mov    -0x10(%rbp),%ecx
sub    $0x1,%ecx
and    %ecx,%eax
cmp    $0x0,%eax
jne    119f <Abc_Tt4Check+0x7f>
movl   $0x1,-0x4(%rbp)
jmp    1201 <Abc_Tt4Check+0xe1>
mov    -0x8(%rbp),%edi
call   1030 <Abc_Tt4CountOnes@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x7,-0xc(%rbp)
jne    11d2 <Abc_Tt4Check+0xb2>
mov    -0x8(%rbp),%edi
call   1040 <Abc_Tt4CheckTwoLevel@plt>
cmp    $0x0,%rax
jle    11d2 <Abc_Tt4Check+0xb2>
movl   $0x1,-0x4(%rbp)
jmp    1201 <Abc_Tt4Check+0xe1>
cmpl   $0x9,-0xc(%rbp)
jne    11fa <Abc_Tt4Check+0xda>
mov    -0x10(%rbp),%edi
call   1040 <Abc_Tt4CheckTwoLevel@plt>
cmp    $0x0,%rax
jle    11fa <Abc_Tt4Check+0xda>
movl   $0x1,-0x4(%rbp)
jmp    1201 <Abc_Tt4Check+0xe1>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Abc_Tt4Check>:
push   %rbp
push   %r14
push   %rbx
mov    %edi,%ebx
lea    -0x1(%rbx),%eax
mov    $0x1,%r14d
test   %eax,%edi
je     117d <Abc_Tt4Check+0x5d>
cmp    $0x6996,%ebx
je     117d <Abc_Tt4Check+0x5d>
movzwl %bx,%eax
mov    %eax,%ebp
xor    $0xffff,%ebp
cmp    $0x6996,%ebp
je     117d <Abc_Tt4Check+0x5d>
mov    $0xfffe,%ecx
sub    %eax,%ecx
test   %ecx,%ebp
je     117d <Abc_Tt4Check+0x5d>
mov    %ebx,%edi
call   1030 <Abc_Tt4CountOnes@plt>
cmp    $0x9,%eax
je     116e <Abc_Tt4Check+0x4e>
cmp    $0x7,%eax
jne    117a <Abc_Tt4Check+0x5a>
mov    %ebx,%edi
jmp    1170 <Abc_Tt4Check+0x50>
mov    %ebp,%edi
call   1040 <Abc_Tt4CheckTwoLevel@plt>
test   %rax,%rax
jg     117d <Abc_Tt4Check+0x5d>
xor    %r14d,%r14d
mov    %r14d,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i32 @Abc_Tt4Check(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
%6 = load i32, i32* %3
%7 = xor i32 %6, -1
%8 = and i32 65535, %7
store i32 %8, i32* %5
%9 = load i32, i32* %3
%10 = icmp eq i32 %9, 27030
br i1 %10, label %14, label %11
11: ; preds = %1
%12 = load i32, i32* %5
%13 = icmp eq i32 %12, 27030
br i1 %13, label %14, label %15
14: ; preds = %11, %1
store i32 1, i32* %2
br label %48
15: ; preds = %11
%16 = load i32, i32* %3
%17 = load i32, i32* %3
%18 = sub nsw i32 %17, 1
%19 = and i32 %16, %18
%20 = icmp eq i32 %19, 0
br i1 %20, label %21, label %22
21: ; preds = %15
store i32 1, i32* %2
br label %48
22: ; preds = %15
%23 = load i32, i32* %5
%24 = load i32, i32* %5
%25 = sub nsw i32 %24, 1
%26 = and i32 %23, %25
%27 = icmp eq i32 %26, 0
br i1 %27, label %28, label %29
28: ; preds = %22
store i32 1, i32* %2
br label %48
29: ; preds = %22
%30 = load i32, i32* %3
%31 = call i32 @Abc_Tt4CountOnes(i32 %30)
store i32 %31, i32* %4
%32 = load i32, i32* %4
%33 = icmp eq i32 %32, 7
br i1 %33, label %34, label %39
34: ; preds = %29
%35 = load i32, i32* %3
%36 = call i64 @Abc_Tt4CheckTwoLevel(i32 %35)
%37 = icmp sgt i64 %36, 0
br i1 %37, label %38, label %39
38: ; preds = %34
store i32 1, i32* %2
br label %48
39: ; preds = %34, %29
%40 = load i32, i32* %4
%41 = icmp eq i32 %40, 9
br i1 %41, label %42, label %47
42: ; preds = %39
%43 = load i32, i32* %5
%44 = call i64 @Abc_Tt4CheckTwoLevel(i32 %43)
%45 = icmp sgt i64 %44, 0
br i1 %45, label %46, label %47
46: ; preds = %42
store i32 1, i32* %2
br label %48
47: ; preds = %42, %39
store i32 0, i32* %2
br label %48
48: ; preds = %47, %46, %38, %28, %21, %14
%49 = load i32, i32* %2
ret i32 %49
}

LLVM IR (-O2):
define i32 @Abc_Tt4Check(i32 %0) {
%2 = and i32 %0, 65535
%3 = xor i32 %2, 65535
%4 = icmp eq i32 %0, 27030
%5 = icmp eq i32 %3, 27030
%6 = or i1 %4, %5
%7 = tail call i32 @llvm.ctpop.i32(i32 %0)
%8 = icmp ult i32 %7, 2
%9 = or i1 %8, %6
br i1 %9, label %23, label %10
10: ; preds = %1
%11 = sub nsw i32 65534, %2
%12 = and i32 %3, %11
%13 = icmp eq i32 %12, 0
br i1 %13, label %23, label %14
14: ; preds = %10
%15 = tail call i32 @Abc_Tt4CountOnes(i32 %0)
switch i32 %15, label %22 [
i32 7, label %16
i32 9, label %19
]
16: ; preds = %14
%17 = tail call i64 @Abc_Tt4CheckTwoLevel(i32 %0)
%18 = icmp sgt i64 %17, 0
br i1 %18, label %23, label %22
19: ; preds = %14
%20 = tail call i64 @Abc_Tt4CheckTwoLevel(i32 %3)
%21 = icmp sgt i64 %20, 0
br i1 %21, label %23, label %22
22: ; preds = %16, %14, %19
br label %23
23: ; preds = %19, %16, %10, %1, %22
%24 = phi i32 [ 0, %22 ], [ 1, %1 ], [ 1, %10 ], [ 1, %16 ], [ 1, %19 ]
ret i32 %24
}