#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_potential_moves(unsigned long long const,
                                                  int);
unsigned long long get_potential_moves(const unsigned long long P,
                                       const unsigned long long O) {
  return (get_some_potential_moves(O & 0x7E7E7E7E7E7E7E7Eull, 1) |
          get_some_potential_moves(O & 0x00FFFFFFFFFFFF00ull, 8) |
          get_some_potential_moves(O & 0x007E7E7E7E7E7E00ull, 7) |
          get_some_potential_moves(O & 0x007E7E7E7E7E7E00ull, 9)) &
         ~(P | O);
}


x86 assembly (clang, -O0):
<get_potential_moves>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movabs $0x7e7e7e7e7e7e7e7e,%rdi
7e 7e 7e
and    -0x10(%rbp),%rdi
mov    $0x1,%esi
call   1030 <get_some_potential_moves@plt>
mov    %rax,-0x28(%rbp)
movabs $0xffffffffffff00,%rdi
and    -0x10(%rbp),%rdi
mov    $0x8,%esi
call   1030 <get_some_potential_moves@plt>
mov    %rax,%rcx
mov    -0x28(%rbp),%rax
or     %rcx,%rax
mov    %rax,-0x20(%rbp)
movabs $0x7e7e7e7e7e7e00,%rdi
and    -0x10(%rbp),%rdi
mov    $0x7,%esi
call   1030 <get_some_potential_moves@plt>
mov    %rax,%rcx
mov    -0x20(%rbp),%rax
or     %rcx,%rax
mov    %rax,-0x18(%rbp)
movabs $0x7e7e7e7e7e7e00,%rdi
and    -0x10(%rbp),%rdi
mov    $0x9,%esi
call   1030 <get_some_potential_moves@plt>
mov    %rax,%rcx
mov    -0x18(%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_potential_moves>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
mov    %rsi,%r14
mov    %rdi,%r12
movabs $0x7e7e7e7e7e7e7e7e,%rdi
7e 7e 7e
and    %rsi,%rdi
mov    $0x1,%esi
call   1030 <get_some_potential_moves@plt>
mov    %rax,%r15
movabs $0xffffffffffff00,%rdi
and    %r14,%rdi
mov    $0x8,%esi
call   1030 <get_some_potential_moves@plt>
mov    %rax,%r13
or     %r15,%r13
movabs $0x7e7e7e7e7e7e00,%rbx
and    %r14,%rbx
mov    %rbx,%rdi
mov    $0x7,%esi
call   1030 <get_some_potential_moves@plt>
mov    %rax,%r15
mov    %rbx,%rdi
mov    $0x9,%esi
call   1030 <get_some_potential_moves@plt>
or     %r15,%rax
or     %r13,%rax
or     %r14,%r12
not    %r12
and    %r12,%rax
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
ret

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

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