#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 getCellIdAbove(int);
int getCellIdBelow(int);
int getCellIdLeft(int);
int getCellIdRight(int);
int isAllowedMoveQueen(int kingCellId, int newQueenCellId) {
  if (newQueenCellId == getCellIdLeft(kingCellId) ||
      newQueenCellId == getCellIdRight(kingCellId) ||
      newQueenCellId == getCellIdAbove(kingCellId) ||
      newQueenCellId == getCellIdBelow(kingCellId))
    return 0;
  return 1;
}


x86 assembly (clang, -O0):
<isAllowedMoveQueen>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <getCellIdLeft@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%eax
cmp    %ecx,%eax
je     11ba <isAllowedMoveQueen+0x7a>
mov    -0xc(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%edi
call   1050 <getCellIdRight@plt>
mov    %eax,%ecx
mov    -0x14(%rbp),%eax
cmp    %ecx,%eax
je     11ba <isAllowedMoveQueen+0x7a>
mov    -0xc(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x8(%rbp),%edi
call   1060 <getCellIdAbove@plt>
mov    %eax,%ecx
mov    -0x18(%rbp),%eax
cmp    %ecx,%eax
je     11ba <isAllowedMoveQueen+0x7a>
mov    -0xc(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x8(%rbp),%edi
call   1040 <getCellIdBelow@plt>
mov    %eax,%ecx
mov    -0x1c(%rbp),%eax
cmp    %ecx,%eax
jne    11c6 <isAllowedMoveQueen+0x86>
movl   $0x0,-0x4(%rbp)
jmp    11cd <isAllowedMoveQueen+0x8d>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isAllowedMoveQueen>:
push   %rbp
push   %r14
push   %rbx
mov    %esi,%ebx
mov    %edi,%ebp
call   1030 <getCellIdLeft@plt>
xor    %r14d,%r14d
cmp    %ebx,%eax
je     117a <isAllowedMoveQueen+0x3a>
mov    %ebp,%edi
call   1050 <getCellIdRight@plt>
cmp    %ebx,%eax
je     117a <isAllowedMoveQueen+0x3a>
mov    %ebp,%edi
call   1060 <getCellIdAbove@plt>
cmp    %ebx,%eax
je     117a <isAllowedMoveQueen+0x3a>
mov    %ebp,%edi
call   1040 <getCellIdBelow@plt>
xor    %r14d,%r14d
cmp    %ebx,%eax
setne  %r14b
mov    %r14d,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i32 @isAllowedMoveQueen(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
%6 = load i32, i32* %5
%7 = load i32, i32* %4
%8 = call i32 @getCellIdLeft(i32 %7)
%9 = icmp eq i32 %6, %8
br i1 %9, label %25, label %10
10: ; preds = %2
%11 = load i32, i32* %5
%12 = load i32, i32* %4
%13 = call i32 @getCellIdRight(i32 %12)
%14 = icmp eq i32 %11, %13
br i1 %14, label %25, label %15
15: ; preds = %10
%16 = load i32, i32* %5
%17 = load i32, i32* %4
%18 = call i32 @getCellIdAbove(i32 %17)
%19 = icmp eq i32 %16, %18
br i1 %19, label %25, label %20
20: ; preds = %15
%21 = load i32, i32* %5
%22 = load i32, i32* %4
%23 = call i32 @getCellIdBelow(i32 %22)
%24 = icmp eq i32 %21, %23
br i1 %24, label %25, label %26
25: ; preds = %20, %15, %10, %2
store i32 0, i32* %3
br label %27
26: ; preds = %20
store i32 1, i32* %3
br label %27
27: ; preds = %26, %25
%28 = load i32, i32* %3
ret i32 %28
}

LLVM IR (-O2):
define i32 @isAllowedMoveQueen(i32 %0, i32 %1) {
%3 = tail call i32 @getCellIdLeft(i32 %0)
%4 = icmp eq i32 %3, %1
br i1 %4, label %15, label %5
5: ; preds = %2
%6 = tail call i32 @getCellIdRight(i32 %0)
%7 = icmp eq i32 %6, %1
br i1 %7, label %15, label %8
8: ; preds = %5
%9 = tail call i32 @getCellIdAbove(i32 %0)
%10 = icmp eq i32 %9, %1
br i1 %10, label %15, label %11
11: ; preds = %8
%12 = tail call i32 @getCellIdBelow(i32 %0)
%13 = icmp ne i32 %12, %1
%14 = zext i1 %13 to i32
br label %15
15: ; preds = %11, %2, %5, %8
%16 = phi i32 [ 0, %8 ], [ 0, %5 ], [ 0, %2 ], [ %14, %11 ]
ret i32 %16
}