#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 */
unsigned long long const get_some_moves(unsigned long long const,
                                        unsigned long long const, int);
unsigned long long get_moves(const unsigned long long P,
                             const unsigned long long O) {
  const unsigned long long mask = O & 0x7E7E7E7E7E7E7E7Eull;
  return (get_some_moves(P, mask, 1) | get_some_moves(P, O, 8) |
          get_some_moves(P, mask, 7) | get_some_moves(P, mask, 9)) &
         ~(P | O);
}


x86 assembly (clang, -O0):
<get_moves>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movabs $0x7e7e7e7e7e7e7e7e,%rax
7e 7e 7e
and    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    $0x1,%edx
call   1030 <get_some_moves@plt>
mov    %rax,-0x30(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    $0x8,%edx
call   1030 <get_some_moves@plt>
mov    %rax,%rcx
mov    -0x30(%rbp),%rax
or     %rcx,%rax
mov    %rax,-0x28(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    $0x7,%edx
call   1030 <get_some_moves@plt>
mov    %rax,%rcx
mov    -0x28(%rbp),%rax
or     %rcx,%rax
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    $0x9,%edx
call   1030 <get_some_moves@plt>
mov    %rax,%rcx
mov    -0x20(%rbp),%rax
or     %rcx,%rax
mov    -0x8(%rbp),%rcx
or     -0x10(%rbp),%rcx
xor    $0xffffffffffffffff,%rcx
and    %rcx,%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_moves>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
mov    %rsi,%rbx
mov    %rdi,%r14
movabs $0x7e7e7e7e7e7e7e7e,%r15
7e 7e 7e
and    %rsi,%r15
mov    %r15,%rsi
mov    $0x1,%edx
call   1030 <get_some_moves@plt>
mov    %rax,%r12
mov    %r14,%rdi
mov    %rbx,%rsi
mov    $0x8,%edx
call   1030 <get_some_moves@plt>
mov    %rax,%r13
or     %r12,%r13
mov    %r14,%rdi
mov    %r15,%rsi
mov    $0x7,%edx
call   1030 <get_some_moves@plt>
mov    %rax,%r12
mov    %r14,%rdi
mov    %r15,%rsi
mov    $0x9,%edx
call   1030 <get_some_moves@plt>
or     %r12,%rax
or     %r13,%rax
or     %r14,%rbx
not    %rbx
and    %rbx,%rax
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i64 @get_moves(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%6 = load i64, i64* %4
%7 = and i64 %6, 9114861777597660798
store i64 %7, i64* %5
%8 = load i64, i64* %3
%9 = load i64, i64* %5
%10 = call i64 @get_some_moves(i64 %8, i64 %9, i32 1)
%11 = load i64, i64* %3
%12 = load i64, i64* %4
%13 = call i64 @get_some_moves(i64 %11, i64 %12, i32 8)
%14 = or i64 %10, %13
%15 = load i64, i64* %3
%16 = load i64, i64* %5
%17 = call i64 @get_some_moves(i64 %15, i64 %16, i32 7)
%18 = or i64 %14, %17
%19 = load i64, i64* %3
%20 = load i64, i64* %5
%21 = call i64 @get_some_moves(i64 %19, i64 %20, i32 9)
%22 = or i64 %18, %21
%23 = load i64, i64* %3
%24 = load i64, i64* %4
%25 = or i64 %23, %24
%26 = xor i64 %25, -1
%27 = and i64 %22, %26
ret i64 %27
}

LLVM IR (-O2):
define i64 @get_moves(i64 %0, i64 %1) {
%3 = and i64 %1, 9114861777597660798
%4 = tail call i64 @get_some_moves(i64 %0, i64 %3, i32 1)
%5 = tail call i64 @get_some_moves(i64 %0, i64 %1, i32 8)
%6 = or i64 %5, %4
%7 = tail call i64 @get_some_moves(i64 %0, i64 %3, i32 7)
%8 = or i64 %6, %7
%9 = tail call i64 @get_some_moves(i64 %0, i64 %3, i32 9)
%10 = or i64 %8, %9
%11 = or i64 %1, %0
%12 = xor i64 %11, -1
%13 = and i64 %10, %12
ret i64 %13
}