#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 */
char *getPlayerInput();
int /*<<< orphan*/ memcpy(char *, char const *, int);
int /*<<< orphan*/ printf(char *, char *, char *, char *, char *, char *, ...);
scalar_t__ strcmp(char *, char *);
int /*<<< orphan*/ strcpy(char *, char *);
char *pieceConflict(const char *piece_pos, const char p) {
  static char *temp, fpiece[3], name[7];
  switch (p) {
  case 'P':
    strcpy(name, "Pawn");
    break;
  case 'B':
    strcpy(name, "Bishop");
    break;
  case 'R':
    strcpy(name, "Rook");
    break;
  case 'N':
    strcpy(name, "Knight");
    break;
  default:
    strcpy(name, " ");
    break;
  }
  if (piece_pos[0] != piece_pos[2]) {
    printf("%s %s %s %s?\n%s", "Did you mean to move the left", name,
           "or the right", name,
           "Please specify with either 'left'/'LEFT' or 'right'/'RIGHT': ");
    do {
      temp = getPlayerInput();
    } while (strcmp(temp, "left") && strcmp(temp, "right") &&
             strcmp(temp, "LEFT") && strcmp(temp, "RIGHT"));
    if (((!strcmp(temp, "right") || !strcmp(temp, "RIGHT")) &&
         piece_pos[0] < piece_pos[2]) ||
        ((!strcmp(temp, "left") || !strcmp(temp, "LEFT")) &&
         piece_pos[0] > piece_pos[2])) {
      fpiece[0] = piece_pos[2];
      fpiece[1] = piece_pos[3];
    } else {
      memcpy(fpiece, piece_pos, 2);
    }
  } else {
    printf("%s %s %s %s %s\n%s", "Did you mean to move the", name,
           "above or the", name, "below?",
           "Please specify with either 'up'/'UP' or 'down'/'DOWN': ");
    do {
      temp = getPlayerInput();
    } while (strcmp(temp, "up") && strcmp(temp, "down") && strcmp(temp, "UP") &&
             strcmp(temp, "DOWN"));
    if (((!strcmp(temp, "up") || !strcmp(temp, "UP")) &&
         piece_pos[1] > piece_pos[3]) ||
        ((!strcmp(temp, "down") || !strcmp(temp, "DOWN")) &&
         piece_pos[1] < piece_pos[3])) {
      fpiece[0] = piece_pos[2];
      fpiece[1] = piece_pos[3];
    } else {
      memcpy(fpiece, piece_pos, 2);
    }
  }
  fpiece[2] = '\0';
  return fpiece;
}


x86 assembly (clang, -O0):
<pieceConflict>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
movsbl -0x9(%rbp),%eax
add    $0xffffffbe,%eax
mov    %eax,%ecx
mov    %rcx,-0x18(%rbp)
sub    $0x10,%eax
ja     11ec <pieceConflict+0x9c>
mov    -0x18(%rbp),%rax
lea    0xe7d(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
lea    0x2ec8(%rip),%rdi
lea    0xeaa(%rip),%rsi
call   1030 <strcpy@plt>
jmp    11ff <pieceConflict+0xaf>
lea    0x2eb0(%rip),%rdi
lea    0xe97(%rip),%rsi
call   1030 <strcpy@plt>
jmp    11ff <pieceConflict+0xaf>
lea    0x2e98(%rip),%rdi
lea    0xe86(%rip),%rsi
call   1030 <strcpy@plt>
jmp    11ff <pieceConflict+0xaf>
lea    0x2e80(%rip),%rdi
lea    0xe73(%rip),%rsi
call   1030 <strcpy@plt>
jmp    11ff <pieceConflict+0xaf>
lea    0x2e68(%rip),%rdi
lea    0xf5b(%rip),%rsi
call   1030 <strcpy@plt>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
mov    -0x8(%rbp),%rcx
movsbl 0x2(%rcx),%ecx
cmp    %ecx,%eax
je     13c3 <pieceConflict+0x273>
lea    0xe3f(%rip),%rdi
lea    0xe48(%rip),%rsi
lea    0x2e30(%rip),%r8
lea    0xe58(%rip),%rcx
lea    0xe5e(%rip),%r9
mov    %r8,%rdx
mov    $0x0,%al
call   1040 <printf@plt>
mov    $0x0,%al
call   1070 <getPlayerInput@plt>
mov    %rax,0x2dff(%rip)
mov    0x2df8(%rip),%rdi
lea    0xe26(%rip),%rsi
call   1050 <strcmp@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    $0x0,%rcx
mov    %al,-0x19(%rbp)
je     12dd <pieceConflict+0x18d>
mov    0x2dd3(%rip),%rdi
lea    0xe0d(%rip),%rsi
call   1050 <strcmp@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    $0x0,%rcx
mov    %al,-0x19(%rbp)
je     12dd <pieceConflict+0x18d>
mov    0x2dae(%rip),%rdi
lea    0xe2c(%rip),%rsi
call   1050 <strcmp@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    $0x0,%rcx
mov    %al,-0x19(%rbp)
je     12dd <pieceConflict+0x18d>
mov    0x2d89(%rip),%rdi
lea    0xe0c(%rip),%rsi
call   1050 <strcmp@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x19(%rbp)
mov    -0x19(%rbp),%al
test   $0x1,%al
jne    1243 <pieceConflict+0xf3>
mov    0x2d61(%rip),%rdi
lea    0xd9b(%rip),%rsi
call   1050 <strcmp@plt>
cmp    $0x0,%rax
je     1322 <pieceConflict+0x1d2>
mov    0x2d44(%rip),%rdi
lea    0xdc7(%rip),%rsi
call   1050 <strcmp@plt>
cmp    $0x0,%rax
jne    1339 <pieceConflict+0x1e9>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
mov    -0x8(%rbp),%rcx
movsbl 0x2(%rcx),%ecx
cmp    %ecx,%eax
jl     138a <pieceConflict+0x23a>
mov    0x2d10(%rip),%rdi
lea    0xd3e(%rip),%rsi
call   1050 <strcmp@plt>
cmp    $0x0,%rax
je     1373 <pieceConflict+0x223>
mov    0x2cf3(%rip),%rdi
lea    0xd71(%rip),%rsi
call   1050 <strcmp@plt>
cmp    $0x0,%rax
jne    13a9 <pieceConflict+0x259>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
mov    -0x8(%rbp),%rcx
movsbl 0x2(%rcx),%ecx
cmp    %ecx,%eax
jle    13a9 <pieceConflict+0x259>
mov    -0x8(%rbp),%rax
mov    0x2(%rax),%al
mov    %al,0x2cc1(%rip)
mov    -0x8(%rbp),%rax
mov    0x3(%rax),%al
mov    %al,0x2cb5(%rip)
jmp    13be <pieceConflict+0x26e>
mov    -0x8(%rbp),%rsi
lea    0x2ca4(%rip),%rdi
mov    $0x2,%edx
call   1060 <memcpy@plt>
jmp    157d <pieceConflict+0x42d>
lea    0xd16(%rip),%rdi
lea    0xd21(%rip),%rsi
lea    0x2c83(%rip),%r8
lea    0xd2c(%rip),%rcx
lea    0xd32(%rip),%r9
lea    0xd32(%rip),%rax
mov    %r8,%rdx
mov    %rax,(%rsp)
mov    $0x0,%al
call   1040 <printf@plt>
mov    $0x0,%al
call   1070 <getPlayerInput@plt>
mov    %rax,0x2c47(%rip)
mov    0x2c40(%rip),%rdi
lea    0xd40(%rip),%rsi
call   1050 <strcmp@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    $0x0,%rcx
mov    %al,-0x1a(%rbp)
je     1495 <pieceConflict+0x345>
mov    0x2c1b(%rip),%rdi
lea    0xd1e(%rip),%rsi
call   1050 <strcmp@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    $0x0,%rcx
mov    %al,-0x1a(%rbp)
je     1495 <pieceConflict+0x345>
mov    0x2bf6(%rip),%rdi
lea    0xcfe(%rip),%rsi
call   1050 <strcmp@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    $0x0,%rcx
mov    %al,-0x1a(%rbp)
je     1495 <pieceConflict+0x345>
mov    0x2bd1(%rip),%rdi
lea    0xcdc(%rip),%rsi
call   1050 <strcmp@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x1a(%rbp)
mov    -0x1a(%rbp),%al
test   $0x1,%al
jne    13fb <pieceConflict+0x2ab>
mov    0x2ba9(%rip),%rdi
lea    0xca9(%rip),%rsi
call   1050 <strcmp@plt>
cmp    $0x0,%rax
je     14da <pieceConflict+0x38a>
mov    0x2b8c(%rip),%rdi
lea    0xc94(%rip),%rsi
call   1050 <strcmp@plt>
cmp    $0x0,%rax
jne    14f2 <pieceConflict+0x3a2>
mov    -0x8(%rbp),%rax
movsbl 0x1(%rax),%eax
mov    -0x8(%rbp),%rcx
movsbl 0x3(%rcx),%ecx
cmp    %ecx,%eax
jg     1544 <pieceConflict+0x3f4>
mov    0x2b57(%rip),%rdi
lea    0xc5a(%rip),%rsi
call   1050 <strcmp@plt>
cmp    $0x0,%rax
je     152c <pieceConflict+0x3dc>
mov    0x2b3a(%rip),%rdi
lea    0xc45(%rip),%rsi
call   1050 <strcmp@plt>
cmp    $0x0,%rax
jne    1563 <pieceConflict+0x413>
mov    -0x8(%rbp),%rax
movsbl 0x1(%rax),%eax
mov    -0x8(%rbp),%rcx
movsbl 0x3(%rcx),%ecx
cmp    %ecx,%eax
jge    1563 <pieceConflict+0x413>
mov    -0x8(%rbp),%rax
mov    0x2(%rax),%al
mov    %al,0x2b07(%rip)
mov    -0x8(%rbp),%rax
mov    0x3(%rax),%al
mov    %al,0x2afb(%rip)
jmp    1578 <pieceConflict+0x428>
mov    -0x8(%rbp),%rsi
lea    0x2aea(%rip),%rdi
mov    $0x2,%edx
call   1060 <memcpy@plt>
jmp    157d <pieceConflict+0x42d>
movb   $0x0,0x2ad6(%rip)
lea    0x2acd(%rip),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pieceConflict>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%r14
add    $0xffffffbe,%esi
ror    %esi
cmp    $0x8,%esi
ja     117d <pieceConflict+0x2d>
movslq %esi,%rax
lea    0xfb0(%rip),%rcx
movslq (%rcx,%rax,4),%rsi
add    %rcx,%rsi
jmp    1184 <pieceConflict+0x34>
lea    0xf8d(%rip),%rsi
lea    0x2ed0(%rip),%rdi
call   1030 <strcpy@plt>
mov    (%r14),%al
cmp    0x2(%r14),%al
jne    12eb <pieceConflict+0x19b>
lea    0xf37(%rip),%rax
mov    %rax,(%rsp)
lea    0xeed(%rip),%rdi
lea    0xef8(%rip),%rsi
lea    0xf0a(%rip),%rcx
lea    0x2e97(%rip),%rdx
lea    0xf09(%rip),%r9
mov    %rdx,%r8
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xf37(%rip),%rbx
lea    0xf33(%rip),%r15
lea    0xf31(%rip),%r12
lea    0xf2d(%rip),%r13
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1070 <getPlayerInput@plt>
mov    %rax,0x2e42(%rip)
mov    %rax,%rdi
mov    %rbx,%rsi
call   1050 <strcmp@plt>
test   %rax,%rax
je     125a <pieceConflict+0x10a>
mov    0x2e2b(%rip),%rdi
mov    %r15,%rsi
call   1050 <strcmp@plt>
test   %rax,%rax
je     125a <pieceConflict+0x10a>
mov    0x2e17(%rip),%rdi
mov    %r12,%rsi
call   1050 <strcmp@plt>
test   %rax,%rax
je     125a <pieceConflict+0x10a>
mov    0x2e03(%rip),%rdi
mov    %r13,%rsi
call   1050 <strcmp@plt>
test   %rax,%rax
jne    1200 <pieceConflict+0xb0>
mov    0x2def(%rip),%rdi
lea    0xeab(%rip),%rsi
call   1050 <strcmp@plt>
test   %rax,%rax
je     128a <pieceConflict+0x13a>
mov    0x2dd7(%rip),%rdi
lea    0xe9b(%rip),%rsi
call   1050 <strcmp@plt>
test   %rax,%rax
jne    1294 <pieceConflict+0x144>
mov    0x3(%r14),%al
cmp    %al,0x1(%r14)
jg     12d6 <pieceConflict+0x186>
mov    0x2db5(%rip),%rdi
lea    0xe74(%rip),%rsi
call   1050 <strcmp@plt>
test   %rax,%rax
je     12c8 <pieceConflict+0x178>
mov    0x2d9d(%rip),%rdi
lea    0xe64(%rip),%rsi
call   1050 <strcmp@plt>
test   %rax,%rax
jne    141e <pieceConflict+0x2ce>
mov    0x3(%r14),%al
cmp    %al,0x1(%r14)
jge    141e <pieceConflict+0x2ce>
mov    0x2(%r14),%cl
mov    %cl,0x2d78(%rip)
mov    %al,0x2d73(%rip)
jmp    1432 <pieceConflict+0x2e2>
lea    0xd26(%rip),%rdi
lea    0xd2f(%rip),%rsi
lea    0xd46(%rip),%rcx
lea    0x2d54(%rip),%rdx
lea    0xd45(%rip),%r9
mov    %rdx,%r8
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xd22(%rip),%rbx
lea    0xd27(%rip),%r15
lea    0xd64(%rip),%r12
lea    0xd62(%rip),%r13
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
xor    %eax,%eax
call   1070 <getPlayerInput@plt>
mov    %rax,0x2d02(%rip)
mov    %rax,%rdi
mov    %rbx,%rsi
call   1050 <strcmp@plt>
test   %rax,%rax
je     139a <pieceConflict+0x24a>
mov    0x2ceb(%rip),%rdi
mov    %r15,%rsi
call   1050 <strcmp@plt>
test   %rax,%rax
je     139a <pieceConflict+0x24a>
mov    0x2cd7(%rip),%rdi
mov    %r12,%rsi
call   1050 <strcmp@plt>
test   %rax,%rax
je     139a <pieceConflict+0x24a>
mov    0x2cc3(%rip),%rdi
mov    %r13,%rsi
call   1050 <strcmp@plt>
test   %rax,%rax
jne    1340 <pieceConflict+0x1f0>
mov    0x2caf(%rip),%rdi
lea    0xca5(%rip),%rsi
call   1050 <strcmp@plt>
test   %rax,%rax
je     13ca <pieceConflict+0x27a>
mov    0x2c97(%rip),%rdi
lea    0xcd6(%rip),%rsi
call   1050 <strcmp@plt>
test   %rax,%rax
jne    13d3 <pieceConflict+0x283>
mov    0x2(%r14),%al
cmp    %al,(%r14)
jl     140c <pieceConflict+0x2bc>
mov    0x2c76(%rip),%rdi
lea    0xc60(%rip),%rsi
call   1050 <strcmp@plt>
test   %rax,%rax
je     1403 <pieceConflict+0x2b3>
mov    0x2c5e(%rip),%rdi
lea    0xc98(%rip),%rsi
call   1050 <strcmp@plt>
test   %rax,%rax
jne    141e <pieceConflict+0x2ce>
mov    0x2(%r14),%al
cmp    %al,(%r14)
jle    141e <pieceConflict+0x2ce>
mov    %al,0x2c46(%rip)
mov    0x3(%r14),%al
mov    %al,0x2c3d(%rip)
jmp    1432 <pieceConflict+0x2e2>
lea    0x2c33(%rip),%rdi
mov    %r14,%rsi
mov    $0x2,%edx
call   1060 <memcpy@plt>
movb   $0x0,0x2c21(%rip)
lea    0x2c18(%rip),%rax
add    $0x10,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@pieceConflict.temp = internal global i8* null
@pieceConflict.fpiece = internal global [3 x i8] zeroinitializer
@pieceConflict.name = internal global [7 x i8] zeroinitializer
@.str = [5 x i8] c"Pawn\00"
@.str.1 = [7 x i8] c"Bishop\00"
@.str.2 = [5 x i8] c"Rook\00"
@.str.3 = [7 x i8] c"Knight\00"
@.str.4 = [2 x i8] c" \00"
@.str.5 = [16 x i8] c"%s %s %s %s?\0A%s\00"
@.str.6 = [30 x i8] c"Did you mean to move the left\00"
@.str.7 = [13 x i8] c"or the right\00"
@.str.8 = [62 x i8] c"Please specify with either 'left'/'LEFT' or 'right'/'RIGHT': \00"
@.str.9 = [5 x i8] c"left\00"
@.str.10 = [6 x i8] c"right\00"
@.str.11 = [5 x i8] c"LEFT\00"
@.str.12 = [6 x i8] c"RIGHT\00"
@.str.13 = [18 x i8] c"%s %s %s %s %s\0A%s\00"
@.str.14 = [25 x i8] c"Did you mean to move the\00"
@.str.15 = [13 x i8] c"above or the\00"
@.str.16 = [7 x i8] c"below?\00"
@.str.17 = [56 x i8] c"Please specify with either 'up'/'UP' or 'down'/'DOWN': \00"
@.str.18 = [3 x i8] c"up\00"
@.str.19 = [5 x i8] c"down\00"
@.str.20 = [3 x i8] c"UP\00"
@.str.21 = [5 x i8] c"DOWN\00"
define i8* @pieceConflict(i8* %0, i8 signext %1) {
%3 = alloca i8*
%4 = alloca i8
store i8* %0, i8** %3
store i8 %1, i8* %4
%5 = load i8, i8* %4
%6 = sext i8 %5 to i32
switch i32 %6, label %15 [
i32 80, label %7
i32 66, label %9
i32 82, label %11
i32 78, label %13
]
7: ; preds = %2
%8 = call i32 @strcpy(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @pieceConflict.name, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
br label %17
9: ; preds = %2
%10 = call i32 @strcpy(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @pieceConflict.name, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
br label %17
11: ; preds = %2
%12 = call i32 @strcpy(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @pieceConflict.name, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0))
br label %17
13: ; preds = %2
%14 = call i32 @strcpy(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @pieceConflict.name, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0))
br label %17
15: ; preds = %2
%16 = call i32 @strcpy(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @pieceConflict.name, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
br label %17
17: ; preds = %15, %13, %11, %9, %7
%18 = load i8*, i8** %3
%19 = getelementptr inbounds i8, i8* %18, i64 0
%20 = load i8, i8* %19
%21 = sext i8 %20 to i32
%22 = load i8*, i8** %3
%23 = getelementptr inbounds i8, i8* %22, i64 2
%24 = load i8, i8* %23
%25 = sext i8 %24 to i32
%26 = icmp ne i32 %21, %25
br i1 %26, label %27, label %96
27: ; preds = %17
%28 = call i32 (i8*, i8*, i8*, i8*, i8*, i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.6, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @pieceConflict.name, i64 0, i64 0), i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.7, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @pieceConflict.name, i64 0, i64 0), i8* getelementptr inbounds ([62 x i8], [62 x i8]* @.str.8, i64 0, i64 0))
br label %29
29: ; preds = %47, %27
%30 = call i8* (...) @getPlayerInput()
store i8* %30, i8** @pieceConflict.temp
br label %31
31: ; preds = %29
%32 = load i8*, i8** @pieceConflict.temp
%33 = call i64 @strcmp(i8* %32, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.9, i64 0, i64 0))
%34 = icmp ne i64 %33, 0
br i1 %34, label %35, label %47
35: ; preds = %31
%36 = load i8*, i8** @pieceConflict.temp
%37 = call i64 @strcmp(i8* %36, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.10, i64 0, i64 0))
%38 = icmp ne i64 %37, 0
br i1 %38, label %39, label %47
39: ; preds = %35
%40 = load i8*, i8** @pieceConflict.temp
%41 = call i64 @strcmp(i8* %40, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.11, i64 0, i64 0))
%42 = icmp ne i64 %41, 0
br i1 %42, label %43, label %47
43: ; preds = %39
%44 = load i8*, i8** @pieceConflict.temp
%45 = call i64 @strcmp(i8* %44, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.12, i64 0, i64 0))
%46 = icmp ne i64 %45, 0
br label %47
47: ; preds = %43, %39, %35, %31
%48 = phi i1 [ false, %39 ], [ false, %35 ], [ false, %31 ], [ %46, %43 ]
br i1 %48, label %29, label %49
49: ; preds = %47
%50 = load i8*, i8** @pieceConflict.temp
%51 = call i64 @strcmp(i8* %50, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.10, i64 0, i64 0))
%52 = icmp ne i64 %51, 0
br i1 %52, label %53, label %57
53: ; preds = %49
%54 = load i8*, i8** @pieceConflict.temp
%55 = call i64 @strcmp(i8* %54, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.12, i64 0, i64 0))
%56 = icmp ne i64 %55, 0
br i1 %56, label %67, label %57
57: ; preds = %53, %49
%58 = load i8*, i8** %3
%59 = getelementptr inbounds i8, i8* %58, i64 0
%60 = load i8, i8* %59
%61 = sext i8 %60 to i32
%62 = load i8*, i8** %3
%63 = getelementptr inbounds i8, i8* %62, i64 2
%64 = load i8, i8* %63
%65 = sext i8 %64 to i32
%66 = icmp slt i32 %61, %65
br i1 %66, label %85, label %67
67: ; preds = %57, %53
%68 = load i8*, i8** @pieceConflict.temp
%69 = call i64 @strcmp(i8* %68, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.9, i64 0, i64 0))
%70 = icmp ne i64 %69, 0
br i1 %70, label %71, label %75
71: ; preds = %67
%72 = load i8*, i8** @pieceConflict.temp
%73 = call i64 @strcmp(i8* %72, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.11, i64 0, i64 0))
%74 = icmp ne i64 %73, 0
br i1 %74, label %92, label %75
75: ; preds = %71, %67
%76 = load i8*, i8** %3
%77 = getelementptr inbounds i8, i8* %76, i64 0
%78 = load i8, i8* %77
%79 = sext i8 %78 to i32
%80 = load i8*, i8** %3
%81 = getelementptr inbounds i8, i8* %80, i64 2
%82 = load i8, i8* %81
%83 = sext i8 %82 to i32
%84 = icmp sgt i32 %79, %83
br i1 %84, label %85, label %92
85: ; preds = %75, %57
%86 = load i8*, i8** %3
%87 = getelementptr inbounds i8, i8* %86, i64 2
%88 = load i8, i8* %87
store i8 %88, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @pieceConflict.fpiece, i64 0, i64 0)
%89 = load i8*, i8** %3
%90 = getelementptr inbounds i8, i8* %89, i64 3
%91 = load i8, i8* %90
store i8 %91, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @pieceConflict.fpiece, i64 0, i64 1)
br label %95
92: ; preds = %75, %71
%93 = load i8*, i8** %3
%94 = call i32 @memcpy(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @pieceConflict.fpiece, i64 0, i64 0), i8* %93, i32 2)
br label %95
95: ; preds = %92, %85
br label %165
96: ; preds = %17
%97 = call i32 (i8*, i8*, i8*, i8*, i8*, i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.13, i64 0, i64 0), i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.14, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @pieceConflict.name, i64 0, i64 0), i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.15, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @pieceConflict.name, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.16, i64 0, i64 0), i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str.17, i64 0, i64 0))
br label %98
98: ; preds = %116, %96
%99 = call i8* (...) @getPlayerInput()
store i8* %99, i8** @pieceConflict.temp
br label %100
100: ; preds = %98
%101 = load i8*, i8** @pieceConflict.temp
%102 = call i64 @strcmp(i8* %101, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.18, i64 0, i64 0))
%103 = icmp ne i64 %102, 0
br i1 %103, label %104, label %116
104: ; preds = %100
%105 = load i8*, i8** @pieceConflict.temp
%106 = call i64 @strcmp(i8* %105, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.19, i64 0, i64 0))
%107 = icmp ne i64 %106, 0
br i1 %107, label %108, label %116
108: ; preds = %104
%109 = load i8*, i8** @pieceConflict.temp
%110 = call i64 @strcmp(i8* %109, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.20, i64 0, i64 0))
%111 = icmp ne i64 %110, 0
br i1 %111, label %112, label %116
112: ; preds = %108
%113 = load i8*, i8** @pieceConflict.temp
%114 = call i64 @strcmp(i8* %113, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.21, i64 0, i64 0))
%115 = icmp ne i64 %114, 0
br label %116
116: ; preds = %112, %108, %104, %100
%117 = phi i1 [ false, %108 ], [ false, %104 ], [ false, %100 ], [ %115, %112 ]
br i1 %117, label %98, label %118
118: ; preds = %116
%119 = load i8*, i8** @pieceConflict.temp
%120 = call i64 @strcmp(i8* %119, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.18, i64 0, i64 0))
%121 = icmp ne i64 %120, 0
br i1 %121, label %122, label %126
122: ; preds = %118
%123 = load i8*, i8** @pieceConflict.temp
%124 = call i64 @strcmp(i8* %123, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.20, i64 0, i64 0))
%125 = icmp ne i64 %124, 0
br i1 %125, label %136, label %126
126: ; preds = %122, %118
%127 = load i8*, i8** %3
%128 = getelementptr inbounds i8, i8* %127, i64 1
%129 = load i8, i8* %128
%130 = sext i8 %129 to i32
%131 = load i8*, i8** %3
%132 = getelementptr inbounds i8, i8* %131, i64 3
%133 = load i8, i8* %132
%134 = sext i8 %133 to i32
%135 = icmp sgt i32 %130, %134
br i1 %135, label %154, label %136
136: ; preds = %126, %122
%137 = load i8*, i8** @pieceConflict.temp
%138 = call i64 @strcmp(i8* %137, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.19, i64 0, i64 0))
%139 = icmp ne i64 %138, 0
br i1 %139, label %140, label %144
140: ; preds = %136
%141 = load i8*, i8** @pieceConflict.temp
%142 = call i64 @strcmp(i8* %141, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.21, i64 0, i64 0))
%143 = icmp ne i64 %142, 0
br i1 %143, label %161, label %144
144: ; preds = %140, %136
%145 = load i8*, i8** %3
%146 = getelementptr inbounds i8, i8* %145, i64 1
%147 = load i8, i8* %146
%148 = sext i8 %147 to i32
%149 = load i8*, i8** %3
%150 = getelementptr inbounds i8, i8* %149, i64 3
%151 = load i8, i8* %150
%152 = sext i8 %151 to i32
%153 = icmp slt i32 %148, %152
br i1 %153, label %154, label %161
154: ; preds = %144, %126
%155 = load i8*, i8** %3
%156 = getelementptr inbounds i8, i8* %155, i64 2
%157 = load i8, i8* %156
store i8 %157, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @pieceConflict.fpiece, i64 0, i64 0)
%158 = load i8*, i8** %3
%159 = getelementptr inbounds i8, i8* %158, i64 3
%160 = load i8, i8* %159
store i8 %160, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @pieceConflict.fpiece, i64 0, i64 1)
br label %164
161: ; preds = %144, %140
%162 = load i8*, i8** %3
%163 = call i32 @memcpy(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @pieceConflict.fpiece, i64 0, i64 0), i8* %162, i32 2)
br label %164
164: ; preds = %161, %154
br label %165
165: ; preds = %164, %95
store i8 0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @pieceConflict.fpiece, i64 0, i64 2)
ret i8* getelementptr inbounds ([3 x i8], [3 x i8]* @pieceConflict.fpiece, i64 0, i64 0)
}

LLVM IR (-O2):
@pieceConflict.temp = internal unnamed_addr global i8* null
@pieceConflict.fpiece = internal global [3 x i8] zeroinitializer
@pieceConflict.name = internal global [7 x i8] zeroinitializer
@.str = [5 x i8] c"Pawn\00"
@.str.1 = [7 x i8] c"Bishop\00"
@.str.2 = [5 x i8] c"Rook\00"
@.str.3 = [7 x i8] c"Knight\00"
@.str.4 = [2 x i8] c" \00"
@.str.5 = [16 x i8] c"%s %s %s %s?\0A%s\00"
@.str.6 = [30 x i8] c"Did you mean to move the left\00"
@.str.7 = [13 x i8] c"or the right\00"
@.str.8 = [62 x i8] c"Please specify with either 'left'/'LEFT' or 'right'/'RIGHT': \00"
@.str.9 = [5 x i8] c"left\00"
@.str.10 = [6 x i8] c"right\00"
@.str.11 = [5 x i8] c"LEFT\00"
@.str.12 = [6 x i8] c"RIGHT\00"
@.str.13 = [18 x i8] c"%s %s %s %s %s\0A%s\00"
@.str.14 = [25 x i8] c"Did you mean to move the\00"
@.str.15 = [13 x i8] c"above or the\00"
@.str.16 = [7 x i8] c"below?\00"
@.str.17 = [56 x i8] c"Please specify with either 'up'/'UP' or 'down'/'DOWN': \00"
@.str.18 = [3 x i8] c"up\00"
@.str.19 = [5 x i8] c"down\00"
@.str.20 = [3 x i8] c"UP\00"
@.str.21 = [5 x i8] c"DOWN\00"
@reltable.pieceConflict = [9 x i32] [i32 trunc (i64 sub (i64 ptrtoint ([7 x i8]* @.str.1 to i64), i64 ptrtoint ([9 x i32]* @reltable.pieceConflict to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([2 x i8]* @.str.4 to i64), i64 ptrtoint ([9 x i32]* @reltable.pieceConflict to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([2 x i8]* @.str.4 to i64), i64 ptrtoint ([9 x i32]* @reltable.pieceConflict to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([2 x i8]* @.str.4 to i64), i64 ptrtoint ([9 x i32]* @reltable.pieceConflict to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([2 x i8]* @.str.4 to i64), i64 ptrtoint ([9 x i32]* @reltable.pieceConflict to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([2 x i8]* @.str.4 to i64), i64 ptrtoint ([9 x i32]* @reltable.pieceConflict to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([7 x i8]* @.str.3 to i64), i64 ptrtoint ([9 x i32]* @reltable.pieceConflict to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([5 x i8]* @.str to i64), i64 ptrtoint ([9 x i32]* @reltable.pieceConflict to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([5 x i8]* @.str.2 to i64), i64 ptrtoint ([9 x i32]* @reltable.pieceConflict to i64)) to i32)]
define i8* @pieceConflict(i8* %0, i8 signext %1) {
%3 = sext i8 %1 to i32
%4 = add nsw i32 %3, -66
%5 = tail call i32 @llvm.fshl.i32(i32 %4, i32 %4, i32 31)
%6 = icmp ult i32 %5, 9
br i1 %6, label %7, label %11
7: ; preds = %2
%8 = sext i32 %5 to i64
%9 = shl i64 %8, 2
%10 = call i8* @llvm.load.relative.i64(i8* bitcast ([9 x i32]* @reltable.pieceConflict to i8*), i64 %9)
br label %11
11: ; preds = %2, %7
%12 = phi i8* [ %10, %7 ], [ getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0), %2 ]
%13 = tail call i32 @strcpy(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @pieceConflict.name, i64 0, i64 0), i8* %12)
%14 = load i8, i8* %0
%15 = getelementptr inbounds i8, i8* %0, i64 2
%16 = load i8, i8* %15
%17 = icmp eq i8 %14, %16
br i1 %17, label %66, label %18
18: ; preds = %11
%19 = tail call i32 (i8*, i8*, i8*, i8*, i8*, i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.6, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @pieceConflict.name, i64 0, i64 0), i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.7, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @pieceConflict.name, i64 0, i64 0), i8* getelementptr inbounds ([62 x i8], [62 x i8]* @.str.8, i64 0, i64 0))
br label %20
20: ; preds = %32, %18
%21 = tail call i8* (...) @getPlayerInput()
store i8* %21, i8** @pieceConflict.temp
%22 = tail call i64 @strcmp(i8* %21, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.9, i64 0, i64 0))
%23 = icmp eq i64 %22, 0
br i1 %23, label %36, label %24
24: ; preds = %20
%25 = load i8*, i8** @pieceConflict.temp
%26 = tail call i64 @strcmp(i8* %25, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.10, i64 0, i64 0))
%27 = icmp eq i64 %26, 0
br i1 %27, label %36, label %28
28: ; preds = %24
%29 = load i8*, i8** @pieceConflict.temp
%30 = tail call i64 @strcmp(i8* %29, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.11, i64 0, i64 0))
%31 = icmp eq i64 %30, 0
br i1 %31, label %36, label %32
32: ; preds = %28
%33 = load i8*, i8** @pieceConflict.temp
%34 = tail call i64 @strcmp(i8* %33, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.12, i64 0, i64 0))
%35 = icmp eq i64 %34, 0
br i1 %35, label %36, label %20
36: ; preds = %20, %24, %28, %32
%37 = load i8*, i8** @pieceConflict.temp
%38 = tail call i64 @strcmp(i8* %37, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.10, i64 0, i64 0))
%39 = icmp eq i64 %38, 0
br i1 %39, label %44, label %40
40: ; preds = %36
%41 = load i8*, i8** @pieceConflict.temp
%42 = tail call i64 @strcmp(i8* %41, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.12, i64 0, i64 0))
%43 = icmp eq i64 %42, 0
br i1 %43, label %44, label %48
44: ; preds = %40, %36
%45 = load i8, i8* %0
%46 = load i8, i8* %15
%47 = icmp slt i8 %45, %46
br i1 %47, label %60, label %48
48: ; preds = %44, %40
%49 = load i8*, i8** @pieceConflict.temp
%50 = tail call i64 @strcmp(i8* %49, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.9, i64 0, i64 0))
%51 = icmp eq i64 %50, 0
br i1 %51, label %56, label %52
52: ; preds = %48
%53 = load i8*, i8** @pieceConflict.temp
%54 = tail call i64 @strcmp(i8* %53, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.11, i64 0, i64 0))
%55 = icmp eq i64 %54, 0
br i1 %55, label %56, label %64
56: ; preds = %52, %48
%57 = load i8, i8* %0
%58 = load i8, i8* %15
%59 = icmp sgt i8 %57, %58
br i1 %59, label %60, label %64
60: ; preds = %56, %44
%61 = phi i8 [ %58, %56 ], [ %46, %44 ]
store i8 %61, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @pieceConflict.fpiece, i64 0, i64 0)
%62 = getelementptr inbounds i8, i8* %0, i64 3
%63 = load i8, i8* %62
store i8 %63, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @pieceConflict.fpiece, i64 0, i64 1)
br label %117
64: ; preds = %56, %52
%65 = tail call i32 @memcpy(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @pieceConflict.fpiece, i64 0, i64 0), i8* %0, i32 2)
br label %117
66: ; preds = %11
%67 = tail call i32 (i8*, i8*, i8*, i8*, i8*, i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.13, i64 0, i64 0), i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.14, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @pieceConflict.name, i64 0, i64 0), i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.15, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @pieceConflict.name, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.16, i64 0, i64 0), i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str.17, i64 0, i64 0))
br label %68
68: ; preds = %80, %66
%69 = tail call i8* (...) @getPlayerInput()
store i8* %69, i8** @pieceConflict.temp
%70 = tail call i64 @strcmp(i8* %69, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.18, i64 0, i64 0))
%71 = icmp eq i64 %70, 0
br i1 %71, label %84, label %72
72: ; preds = %68
%73 = load i8*, i8** @pieceConflict.temp
%74 = tail call i64 @strcmp(i8* %73, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.19, i64 0, i64 0))
%75 = icmp eq i64 %74, 0
br i1 %75, label %84, label %76
76: ; preds = %72
%77 = load i8*, i8** @pieceConflict.temp
%78 = tail call i64 @strcmp(i8* %77, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.20, i64 0, i64 0))
%79 = icmp eq i64 %78, 0
br i1 %79, label %84, label %80
80: ; preds = %76
%81 = load i8*, i8** @pieceConflict.temp
%82 = tail call i64 @strcmp(i8* %81, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.21, i64 0, i64 0))
%83 = icmp eq i64 %82, 0
br i1 %83, label %84, label %68
84: ; preds = %68, %72, %76, %80
%85 = load i8*, i8** @pieceConflict.temp
%86 = tail call i64 @strcmp(i8* %85, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.18, i64 0, i64 0))
%87 = icmp eq i64 %86, 0
br i1 %87, label %92, label %88
88: ; preds = %84
%89 = load i8*, i8** @pieceConflict.temp
%90 = tail call i64 @strcmp(i8* %89, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.20, i64 0, i64 0))
%91 = icmp eq i64 %90, 0
br i1 %91, label %92, label %98
92: ; preds = %88, %84
%93 = getelementptr inbounds i8, i8* %0, i64 1
%94 = load i8, i8* %93
%95 = getelementptr inbounds i8, i8* %0, i64 3
%96 = load i8, i8* %95
%97 = icmp sgt i8 %94, %96
br i1 %97, label %112, label %98
98: ; preds = %92, %88
%99 = load i8*, i8** @pieceConflict.temp
%100 = tail call i64 @strcmp(i8* %99, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.19, i64 0, i64 0))
%101 = icmp eq i64 %100, 0
br i1 %101, label %106, label %102
102: ; preds = %98
%103 = load i8*, i8** @pieceConflict.temp
%104 = tail call i64 @strcmp(i8* %103, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.21, i64 0, i64 0))
%105 = icmp eq i64 %104, 0
br i1 %105, label %106, label %115
106: ; preds = %102, %98
%107 = getelementptr inbounds i8, i8* %0, i64 1
%108 = load i8, i8* %107
%109 = getelementptr inbounds i8, i8* %0, i64 3
%110 = load i8, i8* %109
%111 = icmp slt i8 %108, %110
br i1 %111, label %112, label %115
112: ; preds = %106, %92
%113 = phi i8 [ %110, %106 ], [ %96, %92 ]
%114 = load i8, i8* %15
store i8 %114, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @pieceConflict.fpiece, i64 0, i64 0)
store i8 %113, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @pieceConflict.fpiece, i64 0, i64 1)
br label %117
115: ; preds = %106, %102
%116 = tail call i32 @memcpy(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @pieceConflict.fpiece, i64 0, i64 0), i8* %0, i32 2)
br label %117
117: ; preds = %112, %115, %60, %64
store i8 0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @pieceConflict.fpiece, i64 0, i64 2)
ret i8* getelementptr inbounds ([3 x i8], [3 x i8]* @pieceConflict.fpiece, i64 0, i64 0)
}