#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 */
int index2bb(int);
char isDoublePush(int leaving, int arriving) {
  if ((index2bb(leaving) & (0x000000000000FF00)) &&
      (index2bb(arriving) & (0x00000000FF000000)))
    return (1);
  if ((index2bb(leaving) & (0x00FF000000000000)) &&
      (index2bb(arriving) & (0x000000FF00000000)))
    return (1);
  return (0);
}


x86 assembly (clang, -O0):
<isDoublePush>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <index2bb@plt>
and    $0xff00,%eax
cmp    $0x0,%eax
je     1153 <isDoublePush+0x43>
mov    -0xc(%rbp),%edi
call   1030 <index2bb@plt>
and    $0xff000000,%eax
cmp    $0x0,%eax
je     1153 <isDoublePush+0x43>
movb   $0x1,-0x1(%rbp)
jmp    11a2 <isDoublePush+0x92>
mov    -0x8(%rbp),%edi
call   1030 <index2bb@plt>
cltq
movabs $0xff000000000000,%rcx
and    %rcx,%rax
cmp    $0x0,%rax
je     119e <isDoublePush+0x8e>
mov    -0xc(%rbp),%edi
call   1030 <index2bb@plt>
cltq
movabs $0xff00000000,%rcx
and    %rcx,%rax
cmp    $0x0,%rax
je     119e <isDoublePush+0x8e>
movb   $0x1,-0x1(%rbp)
jmp    11a2 <isDoublePush+0x92>
movb   $0x0,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isDoublePush>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
call   1030 <index2bb@plt>
test   $0xff00,%eax
je     1136 <isDoublePush+0x26>
mov    %ebx,%edi
call   1030 <index2bb@plt>
mov    %eax,%ecx
mov    $0x1,%al
cmp    $0xffffff,%ecx
ja     116b <isDoublePush+0x5b>
mov    %ebp,%edi
call   1030 <index2bb@plt>
cltq
movabs $0xff000000000000,%rcx
test   %rcx,%rax
je     1169 <isDoublePush+0x59>
mov    %ebx,%edi
call   1030 <index2bb@plt>
movslq %eax,%rcx
mov    $0x1,%al
movabs $0xff00000000,%rdx
test   %rdx,%rcx
jne    116b <isDoublePush+0x5b>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define signext i8 @isDoublePush(i32 %0, i32 %1) {
%3 = alloca i8
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
%6 = load i32, i32* %4
%7 = call i32 @index2bb(i32 %6)
%8 = and i32 %7, 65280
%9 = icmp ne i32 %8, 0
br i1 %9, label %10, label %16
10: ; preds = %2
%11 = load i32, i32* %5
%12 = call i32 @index2bb(i32 %11)
%13 = and i32 %12, -16777216
%14 = icmp ne i32 %13, 0
br i1 %14, label %15, label %16
15: ; preds = %10
store i8 1, i8* %3
br label %30
16: ; preds = %10, %2
%17 = load i32, i32* %4
%18 = call i32 @index2bb(i32 %17)
%19 = sext i32 %18 to i64
%20 = and i64 %19, 71776119061217280
%21 = icmp ne i64 %20, 0
br i1 %21, label %22, label %29
22: ; preds = %16
%23 = load i32, i32* %5
%24 = call i32 @index2bb(i32 %23)
%25 = sext i32 %24 to i64
%26 = and i64 %25, 1095216660480
%27 = icmp ne i64 %26, 0
br i1 %27, label %28, label %29
28: ; preds = %22
store i8 1, i8* %3
br label %30
29: ; preds = %22, %16
store i8 0, i8* %3
br label %30
30: ; preds = %29, %28, %15
%31 = load i8, i8* %3
ret i8 %31
}

LLVM IR (-O2):
define signext i8 @isDoublePush(i32 %0, i32 %1) {
%3 = tail call i32 @index2bb(i32 %0)
%4 = and i32 %3, 65280
%5 = icmp eq i32 %4, 0
br i1 %5, label %9, label %6
6: ; preds = %2
%7 = tail call i32 @index2bb(i32 %1)
%8 = icmp ult i32 %7, 16777216
br i1 %8, label %9, label %20
9: ; preds = %6, %2
%10 = tail call i32 @index2bb(i32 %0)
%11 = sext i32 %10 to i64
%12 = and i64 %11, 71776119061217280
%13 = icmp eq i64 %12, 0
br i1 %13, label %19, label %14
14: ; preds = %9
%15 = tail call i32 @index2bb(i32 %1)
%16 = sext i32 %15 to i64
%17 = and i64 %16, 1095216660480
%18 = icmp eq i64 %17, 0
br i1 %18, label %19, label %20
19: ; preds = %14, %9
br label %20
20: ; preds = %14, %6, %19
%21 = phi i8 [ 0, %19 ], [ 1, %6 ], [ 1, %14 ]
ret i8 %21
}