#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 */
struct node {
  int dummy;
};

/* Variables and functions */
char get_piece(char *, char, char);
int is_occupied(char *, char, char);
struct node *store_move(struct node *, char *, int, struct node *, char, char,
                        char, char);
struct node *get_knight_moves_white(struct node *currentNode, char *board,
                                    struct node *parentNode) {
  char x, y;
  int numMoves = 0;
  for (x = 'a'; x <= 'h'; x++) {
    for (y = '1'; y <= '8'; y++) {
      char p = get_piece(board, x, y);
      if (p == 'N') {
        if ((x < 'h') && (y < '7') && (is_occupied(board, x + 1, y + 2) != 1)) {
          currentNode =
              store_move(currentNode, board, 1, parentNode, x, y, x + 1, y + 2);
          numMoves++;
        }
        if ((x < 'g') && (y < '8') && (is_occupied(board, x + 2, y + 1) != 1)) {
          currentNode =
              store_move(currentNode, board, 1, parentNode, x, y, x + 2, y + 1);
          numMoves++;
        }
        if ((x < 'g') && (y > '1') && (is_occupied(board, x + 2, y - 1) != 1)) {
          currentNode =
              store_move(currentNode, board, 1, parentNode, x, y, x + 2, y - 1);
          numMoves++;
        }
        if ((x < 'h') && (y > '2') && (is_occupied(board, x + 1, y - 2) != 1)) {
          currentNode =
              store_move(currentNode, board, 1, parentNode, x, y, x + 1, y - 2);
          numMoves++;
        }
        if ((x > 'a') && (y > '2') && (is_occupied(board, x - 1, y - 2) != 1)) {
          currentNode =
              store_move(currentNode, board, 1, parentNode, x, y, x - 1, y - 2);
          numMoves++;
        }
        if ((x > 'b') && (y > '1') && (is_occupied(board, x - 2, y - 1) != 1)) {
          currentNode =
              store_move(currentNode, board, 1, parentNode, x, y, x - 2, y - 1);
          numMoves++;
        }
        if ((x > 'b') && (y < '8') && (is_occupied(board, x - 2, y + 1) != 1)) {
          currentNode =
              store_move(currentNode, board, 1, parentNode, x, y, x - 2, y + 1);
          numMoves++;
        }
        if ((x > 'a') && (y < '7') && (is_occupied(board, x - 1, y + 2) != 1)) {
          currentNode =
              store_move(currentNode, board, 1, parentNode, x, y, x - 1, y + 2);
          numMoves++;
        }
      }
    }
  }
  return currentNode;
}


x86 assembly (clang, -O0):
<get_knight_moves_white>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
movl   $0x0,-0x20(%rbp)
movb   $0x61,-0x19(%rbp)
movsbl -0x19(%rbp),%eax
cmp    $0x68,%eax
jg     1661 <get_knight_moves_white+0x531>
movb   $0x31,-0x1a(%rbp)
movsbl -0x1a(%rbp),%eax
cmp    $0x38,%eax
jg     164f <get_knight_moves_white+0x51f>
mov    -0x10(%rbp),%rdi
mov    -0x19(%rbp),%al
movsbl %al,%esi
movsbl -0x1a(%rbp),%edx
call   1040 <get_piece@plt>
mov    %al,-0x21(%rbp)
movsbl -0x21(%rbp),%eax
cmp    $0x4e,%eax
jne    163d <get_knight_moves_white+0x50d>
movsbl -0x19(%rbp),%eax
cmp    $0x68,%eax
jge    1225 <get_knight_moves_white+0xf5>
movsbl -0x1a(%rbp),%eax
cmp    $0x37,%eax
jge    1225 <get_knight_moves_white+0xf5>
mov    -0x10(%rbp),%rdi
movsbl -0x19(%rbp),%eax
add    $0x1,%eax
mov    %al,%cl
movsbl -0x1a(%rbp),%eax
add    $0x2,%eax
movsbl %cl,%esi
movsbl %al,%edx
call   1030 <is_occupied@plt>
cmp    $0x1,%eax
je     1225 <get_knight_moves_white+0xf5>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rcx
mov    -0x19(%rbp),%r8b
mov    -0x1a(%rbp),%r9b
movsbl -0x19(%rbp),%eax
add    $0x1,%eax
mov    %al,%r10b
movsbl -0x1a(%rbp),%eax
add    $0x2,%eax
mov    $0x1,%edx
movsbl %r8b,%r8d
movsbl %r9b,%r9d
movsbl %r10b,%r10d
mov    %r10d,(%rsp)
movsbl %al,%eax
mov    %eax,0x8(%rsp)
call   1050 <store_move@plt>
mov    %rax,-0x8(%rbp)
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
movsbl -0x19(%rbp),%eax
cmp    $0x67,%eax
jge    12ba <get_knight_moves_white+0x18a>
movsbl -0x1a(%rbp),%eax
cmp    $0x38,%eax
jge    12ba <get_knight_moves_white+0x18a>
mov    -0x10(%rbp),%rdi
movsbl -0x19(%rbp),%eax
add    $0x2,%eax
mov    %al,%cl
movsbl -0x1a(%rbp),%eax
add    $0x1,%eax
movsbl %cl,%esi
movsbl %al,%edx
call   1030 <is_occupied@plt>
cmp    $0x1,%eax
je     12ba <get_knight_moves_white+0x18a>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rcx
mov    -0x19(%rbp),%r8b
mov    -0x1a(%rbp),%r9b
movsbl -0x19(%rbp),%eax
add    $0x2,%eax
mov    %al,%r10b
movsbl -0x1a(%rbp),%eax
add    $0x1,%eax
mov    $0x1,%edx
movsbl %r8b,%r8d
movsbl %r9b,%r9d
movsbl %r10b,%r10d
mov    %r10d,(%rsp)
movsbl %al,%eax
mov    %eax,0x8(%rsp)
call   1050 <store_move@plt>
mov    %rax,-0x8(%rbp)
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
movsbl -0x19(%rbp),%eax
cmp    $0x67,%eax
jge    134f <get_knight_moves_white+0x21f>
movsbl -0x1a(%rbp),%eax
cmp    $0x31,%eax
jle    134f <get_knight_moves_white+0x21f>
mov    -0x10(%rbp),%rdi
movsbl -0x19(%rbp),%eax
add    $0x2,%eax
mov    %al,%cl
movsbl -0x1a(%rbp),%eax
sub    $0x1,%eax
movsbl %cl,%esi
movsbl %al,%edx
call   1030 <is_occupied@plt>
cmp    $0x1,%eax
je     134f <get_knight_moves_white+0x21f>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rcx
mov    -0x19(%rbp),%r8b
mov    -0x1a(%rbp),%r9b
movsbl -0x19(%rbp),%eax
add    $0x2,%eax
mov    %al,%r10b
movsbl -0x1a(%rbp),%eax
sub    $0x1,%eax
mov    $0x1,%edx
movsbl %r8b,%r8d
movsbl %r9b,%r9d
movsbl %r10b,%r10d
mov    %r10d,(%rsp)
movsbl %al,%eax
mov    %eax,0x8(%rsp)
call   1050 <store_move@plt>
mov    %rax,-0x8(%rbp)
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
movsbl -0x19(%rbp),%eax
cmp    $0x68,%eax
jge    13e4 <get_knight_moves_white+0x2b4>
movsbl -0x1a(%rbp),%eax
cmp    $0x32,%eax
jle    13e4 <get_knight_moves_white+0x2b4>
mov    -0x10(%rbp),%rdi
movsbl -0x19(%rbp),%eax
add    $0x1,%eax
mov    %al,%cl
movsbl -0x1a(%rbp),%eax
sub    $0x2,%eax
movsbl %cl,%esi
movsbl %al,%edx
call   1030 <is_occupied@plt>
cmp    $0x1,%eax
je     13e4 <get_knight_moves_white+0x2b4>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rcx
mov    -0x19(%rbp),%r8b
mov    -0x1a(%rbp),%r9b
movsbl -0x19(%rbp),%eax
add    $0x1,%eax
mov    %al,%r10b
movsbl -0x1a(%rbp),%eax
sub    $0x2,%eax
mov    $0x1,%edx
movsbl %r8b,%r8d
movsbl %r9b,%r9d
movsbl %r10b,%r10d
mov    %r10d,(%rsp)
movsbl %al,%eax
mov    %eax,0x8(%rsp)
call   1050 <store_move@plt>
mov    %rax,-0x8(%rbp)
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
movsbl -0x19(%rbp),%eax
cmp    $0x61,%eax
jle    1479 <get_knight_moves_white+0x349>
movsbl -0x1a(%rbp),%eax
cmp    $0x32,%eax
jle    1479 <get_knight_moves_white+0x349>
mov    -0x10(%rbp),%rdi
movsbl -0x19(%rbp),%eax
sub    $0x1,%eax
mov    %al,%cl
movsbl -0x1a(%rbp),%eax
sub    $0x2,%eax
movsbl %cl,%esi
movsbl %al,%edx
call   1030 <is_occupied@plt>
cmp    $0x1,%eax
je     1479 <get_knight_moves_white+0x349>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rcx
mov    -0x19(%rbp),%r8b
mov    -0x1a(%rbp),%r9b
movsbl -0x19(%rbp),%eax
sub    $0x1,%eax
mov    %al,%r10b
movsbl -0x1a(%rbp),%eax
sub    $0x2,%eax
mov    $0x1,%edx
movsbl %r8b,%r8d
movsbl %r9b,%r9d
movsbl %r10b,%r10d
mov    %r10d,(%rsp)
movsbl %al,%eax
mov    %eax,0x8(%rsp)
call   1050 <store_move@plt>
mov    %rax,-0x8(%rbp)
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
movsbl -0x19(%rbp),%eax
cmp    $0x62,%eax
jle    150e <get_knight_moves_white+0x3de>
movsbl -0x1a(%rbp),%eax
cmp    $0x31,%eax
jle    150e <get_knight_moves_white+0x3de>
mov    -0x10(%rbp),%rdi
movsbl -0x19(%rbp),%eax
sub    $0x2,%eax
mov    %al,%cl
movsbl -0x1a(%rbp),%eax
sub    $0x1,%eax
movsbl %cl,%esi
movsbl %al,%edx
call   1030 <is_occupied@plt>
cmp    $0x1,%eax
je     150e <get_knight_moves_white+0x3de>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rcx
mov    -0x19(%rbp),%r8b
mov    -0x1a(%rbp),%r9b
movsbl -0x19(%rbp),%eax
sub    $0x2,%eax
mov    %al,%r10b
movsbl -0x1a(%rbp),%eax
sub    $0x1,%eax
mov    $0x1,%edx
movsbl %r8b,%r8d
movsbl %r9b,%r9d
movsbl %r10b,%r10d
mov    %r10d,(%rsp)
movsbl %al,%eax
mov    %eax,0x8(%rsp)
call   1050 <store_move@plt>
mov    %rax,-0x8(%rbp)
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
movsbl -0x19(%rbp),%eax
cmp    $0x62,%eax
jle    15a3 <get_knight_moves_white+0x473>
movsbl -0x1a(%rbp),%eax
cmp    $0x38,%eax
jge    15a3 <get_knight_moves_white+0x473>
mov    -0x10(%rbp),%rdi
movsbl -0x19(%rbp),%eax
sub    $0x2,%eax
mov    %al,%cl
movsbl -0x1a(%rbp),%eax
add    $0x1,%eax
movsbl %cl,%esi
movsbl %al,%edx
call   1030 <is_occupied@plt>
cmp    $0x1,%eax
je     15a3 <get_knight_moves_white+0x473>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rcx
mov    -0x19(%rbp),%r8b
mov    -0x1a(%rbp),%r9b
movsbl -0x19(%rbp),%eax
sub    $0x2,%eax
mov    %al,%r10b
movsbl -0x1a(%rbp),%eax
add    $0x1,%eax
mov    $0x1,%edx
movsbl %r8b,%r8d
movsbl %r9b,%r9d
movsbl %r10b,%r10d
mov    %r10d,(%rsp)
movsbl %al,%eax
mov    %eax,0x8(%rsp)
call   1050 <store_move@plt>
mov    %rax,-0x8(%rbp)
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
movsbl -0x19(%rbp),%eax
cmp    $0x61,%eax
jle    1638 <get_knight_moves_white+0x508>
movsbl -0x1a(%rbp),%eax
cmp    $0x37,%eax
jge    1638 <get_knight_moves_white+0x508>
mov    -0x10(%rbp),%rdi
movsbl -0x19(%rbp),%eax
sub    $0x1,%eax
mov    %al,%cl
movsbl -0x1a(%rbp),%eax
add    $0x2,%eax
movsbl %cl,%esi
movsbl %al,%edx
call   1030 <is_occupied@plt>
cmp    $0x1,%eax
je     1638 <get_knight_moves_white+0x508>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rcx
mov    -0x19(%rbp),%r8b
mov    -0x1a(%rbp),%r9b
movsbl -0x19(%rbp),%eax
sub    $0x1,%eax
mov    %al,%r10b
movsbl -0x1a(%rbp),%eax
add    $0x2,%eax
mov    $0x1,%edx
movsbl %r8b,%r8d
movsbl %r9b,%r9d
movsbl %r10b,%r10d
mov    %r10d,(%rsp)
movsbl %al,%eax
mov    %eax,0x8(%rsp)
call   1050 <store_move@plt>
mov    %rax,-0x8(%rbp)
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    163d <get_knight_moves_white+0x50d>
jmp    1642 <get_knight_moves_white+0x512>
mov    -0x1a(%rbp),%al
add    $0x1,%al
mov    %al,-0x1a(%rbp)
jmp    1160 <get_knight_moves_white+0x30>
jmp    1654 <get_knight_moves_white+0x524>
mov    -0x19(%rbp),%al
add    $0x1,%al
mov    %al,-0x19(%rbp)
jmp    114f <get_knight_moves_white+0x1f>
mov    -0x8(%rbp),%rax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_knight_moves_white>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x38,%rsp
mov    %rdx,0x18(%rsp)
mov    %rsi,%r14
mov    %rdi,0x8(%rsp)
mov    $0x61,%r15b
mov    %rsi,0x30(%rsp)
jmp    116f <get_knight_moves_white+0x3f>
cs nopw 0x0(%rax,%rax,1)
nop
mov    0x20(%rsp),%eax
mov    %eax,%r15d
cmp    $0x69,%al
je     14b3 <get_knight_moves_white+0x383>
lea    0x1(%r15),%eax
mov    %eax,0x20(%rsp)
lea    0x2(%r15),%eax
mov    %eax,0x2c(%rsp)
lea    -0x1(%r15),%eax
mov    %eax,0x28(%rsp)
lea    -0x2(%r15),%eax
mov    %eax,0x24(%rsp)
mov    $0x2f,%r13b
jmp    11aa <get_knight_moves_white+0x7a>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
add    $0x1,%r13b
cmp    $0x37,%r13b
je     1160 <get_knight_moves_white+0x30>
lea    0x2(%r13),%r12d
movsbl %r15b,%ebx
movsbl %r12b,%ebp
mov    %r14,%rdi
mov    %ebx,%esi
mov    %ebp,%edx
call   1040 <get_piece@plt>
cmp    $0x4e,%al
jne    11a0 <get_knight_moves_white+0x70>
cmp    $0x67,%r15b
mov    %ebx,0x14(%rsp)
mov    %ebp,0x10(%rsp)
ja     122b <get_knight_moves_white+0xfb>
cmp    $0x36,%r12b
ja     122b <get_knight_moves_white+0xfb>
lea    0x4(%r13),%eax
movsbl 0x20(%rsp),%ebp
movsbl %al,%r14d
mov    0x30(%rsp),%rbx
mov    %rbx,%rdi
mov    %ebp,%esi
mov    %r14d,%edx
call   1030 <is_occupied@plt>
cmp    $0x1,%eax
je     122b <get_knight_moves_white+0xfb>
mov    0x8(%rsp),%rdi
mov    %rbx,%rsi
mov    $0x1,%edx
mov    0x18(%rsp),%rcx
mov    0x14(%rsp),%r8d
mov    0x10(%rsp),%r9d
push   %r14
push   %rbp
call   1050 <store_move@plt>
add    $0x10,%rsp
mov    %rax,0x8(%rsp)
cmp    $0x66,%r15b
ja     149f <get_knight_moves_white+0x36f>
cmp    $0x37,%r12b
ja     1291 <get_knight_moves_white+0x161>
lea    0x3(%r13),%eax
movsbl 0x2c(%rsp),%ebp
movsbl %al,%ebx
mov    0x30(%rsp),%r14
mov    %r14,%rdi
mov    %ebp,%esi
mov    %ebx,%edx
call   1030 <is_occupied@plt>
cmp    $0x1,%eax
je     1296 <get_knight_moves_white+0x166>
mov    0x8(%rsp),%rdi
mov    %r14,%rsi
mov    $0x1,%edx
mov    0x18(%rsp),%rcx
mov    0x14(%rsp),%r8d
mov    0x10(%rsp),%r9d
push   %rbx
push   %rbp
call   1050 <store_move@plt>
add    $0x10,%rsp
mov    %rax,0x8(%rsp)
cmp    $0x66,%r15b
jbe    129c <get_knight_moves_white+0x16c>
jmp    12eb <get_knight_moves_white+0x1bb>
mov    0x30(%rsp),%r14
cmp    $0x66,%r15b
ja     12eb <get_knight_moves_white+0x1bb>
cmp    $0x32,%r12b
jb     12eb <get_knight_moves_white+0x1bb>
lea    0x1(%r13),%eax
movsbl 0x2c(%rsp),%ebp
movsbl %al,%ebx
mov    %r14,%rdi
mov    %ebp,%esi
mov    %ebx,%edx
call   1030 <is_occupied@plt>
cmp    $0x1,%eax
je     12eb <get_knight_moves_white+0x1bb>
mov    0x8(%rsp),%rdi
mov    %r14,%rsi
mov    $0x1,%edx
mov    0x18(%rsp),%rcx
mov    0x14(%rsp),%r8d
mov    0x10(%rsp),%r9d
push   %rbx
push   %rbp
call   1050 <store_move@plt>
add    $0x10,%rsp
mov    %rax,0x8(%rsp)
cmp    $0x67,%r15b
ja     133d <get_knight_moves_white+0x20d>
cmp    $0x33,%r12b
jb     133d <get_knight_moves_white+0x20d>
movsbl 0x20(%rsp),%ebp
movsbl %r13b,%ebx
mov    %r14,%rdi
mov    %ebp,%esi
mov    %ebx,%edx
call   1030 <is_occupied@plt>
cmp    $0x1,%eax
je     133d <get_knight_moves_white+0x20d>
mov    0x8(%rsp),%rdi
mov    %r14,%rsi
mov    $0x1,%edx
mov    0x18(%rsp),%rcx
mov    0x14(%rsp),%r8d
mov    0x10(%rsp),%r9d
push   %rbx
push   %rbp
call   1050 <store_move@plt>
add    $0x10,%rsp
mov    %rax,0x8(%rsp)
cmp    $0x62,%r15b
jb     138f <get_knight_moves_white+0x25f>
cmp    $0x33,%r12b
jb     138f <get_knight_moves_white+0x25f>
movsbl 0x28(%rsp),%ebp
movsbl %r13b,%ebx
mov    %r14,%rdi
mov    %ebp,%esi
mov    %ebx,%edx
call   1030 <is_occupied@plt>
cmp    $0x1,%eax
je     138f <get_knight_moves_white+0x25f>
mov    0x8(%rsp),%rdi
mov    %r14,%rsi
mov    $0x1,%edx
mov    0x18(%rsp),%rcx
mov    0x14(%rsp),%r8d
mov    0x10(%rsp),%r9d
push   %rbx
push   %rbp
call   1050 <store_move@plt>
add    $0x10,%rsp
mov    %rax,0x8(%rsp)
cmp    $0x63,%r15b
jb     13e4 <get_knight_moves_white+0x2b4>
cmp    $0x32,%r12b
jb     13e4 <get_knight_moves_white+0x2b4>
lea    0x1(%r13),%eax
movsbl 0x24(%rsp),%ebp
movsbl %al,%ebx
mov    %r14,%rdi
mov    %ebp,%esi
mov    %ebx,%edx
call   1030 <is_occupied@plt>
cmp    $0x1,%eax
je     13e4 <get_knight_moves_white+0x2b4>
mov    0x8(%rsp),%rdi
mov    %r14,%rsi
mov    $0x1,%edx
mov    0x18(%rsp),%rcx
mov    0x14(%rsp),%r8d
mov    0x10(%rsp),%r9d
push   %rbx
push   %rbp
call   1050 <store_move@plt>
add    $0x10,%rsp
mov    %rax,0x8(%rsp)
cmp    $0x63,%r15b
jb     1439 <get_knight_moves_white+0x309>
cmp    $0x37,%r12b
ja     1439 <get_knight_moves_white+0x309>
lea    0x3(%r13),%eax
movsbl 0x24(%rsp),%ebp
movsbl %al,%ebx
mov    %r14,%rdi
mov    %ebp,%esi
mov    %ebx,%edx
call   1030 <is_occupied@plt>
cmp    $0x1,%eax
je     1439 <get_knight_moves_white+0x309>
mov    0x8(%rsp),%rdi
mov    %r14,%rsi
mov    $0x1,%edx
mov    0x18(%rsp),%rcx
mov    0x14(%rsp),%r8d
mov    0x10(%rsp),%r9d
push   %rbx
push   %rbp
call   1050 <store_move@plt>
add    $0x10,%rsp
mov    %rax,0x8(%rsp)
cmp    $0x62,%r15b
jb     11a0 <get_knight_moves_white+0x70>
cmp    $0x36,%r12b
ja     11a0 <get_knight_moves_white+0x70>
lea    0x4(%r13),%eax
movsbl 0x28(%rsp),%ebp
movsbl %al,%ebx
mov    %r14,%rdi
mov    %ebp,%esi
mov    %ebx,%edx
call   1030 <is_occupied@plt>
cmp    $0x1,%eax
je     11a0 <get_knight_moves_white+0x70>
mov    0x8(%rsp),%rdi
mov    %r14,%rsi
mov    $0x1,%edx
mov    0x18(%rsp),%rcx
mov    0x14(%rsp),%r8d
mov    0x10(%rsp),%r9d
push   %rbx
push   %rbp
call   1050 <store_move@plt>
add    $0x10,%rsp
mov    %rax,0x8(%rsp)
jmp    11a0 <get_knight_moves_white+0x70>
mov    0x30(%rsp),%r14
cmp    $0x66,%r15b
jbe    129c <get_knight_moves_white+0x16c>
jmp    12eb <get_knight_moves_white+0x1bb>
mov    0x8(%rsp),%rax
add    $0x38,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
%struct.node = type { i32 }
define %struct.node* @get_knight_moves_white(%struct.node* %0, i8* %1, %struct.node* %2) {
%4 = alloca %struct.node*
%5 = alloca i8*
%6 = alloca %struct.node*
%7 = alloca i8
%8 = alloca i8
%9 = alloca i32
%10 = alloca i8
store %struct.node* %0, %struct.node** %4
store i8* %1, i8** %5
store %struct.node* %2, %struct.node** %6
store i32 0, i32* %9
store i8 97, i8* %7
br label %11
11: ; preds = %330, %3
%12 = load i8, i8* %7
%13 = sext i8 %12 to i32
%14 = icmp sle i32 %13, 104
br i1 %14, label %15, label %333
15: ; preds = %11
store i8 49, i8* %8
br label %16
16: ; preds = %326, %15
%17 = load i8, i8* %8
%18 = sext i8 %17 to i32
%19 = icmp sle i32 %18, 56
br i1 %19, label %20, label %329
20: ; preds = %16
%21 = load i8*, i8** %5
%22 = load i8, i8* %7
%23 = load i8, i8* %8
%24 = call signext i8 @get_piece(i8* %21, i8 signext %22, i8 signext %23)
store i8 %24, i8* %10
%25 = load i8, i8* %10
%26 = sext i8 %25 to i32
%27 = icmp eq i32 %26, 78
br i1 %27, label %28, label %325
28: ; preds = %20
%29 = load i8, i8* %7
%30 = sext i8 %29 to i32
%31 = icmp slt i32 %30, 104
br i1 %31, label %32, label %65
32: ; preds = %28
%33 = load i8, i8* %8
%34 = sext i8 %33 to i32
%35 = icmp slt i32 %34, 55
br i1 %35, label %36, label %65
36: ; preds = %32
%37 = load i8*, i8** %5
%38 = load i8, i8* %7
%39 = sext i8 %38 to i32
%40 = add nsw i32 %39, 1
%41 = trunc i32 %40 to i8
%42 = load i8, i8* %8
%43 = sext i8 %42 to i32
%44 = add nsw i32 %43, 2
%45 = trunc i32 %44 to i8
%46 = call i32 @is_occupied(i8* %37, i8 signext %41, i8 signext %45)
%47 = icmp ne i32 %46, 1
br i1 %47, label %48, label %65
48: ; preds = %36
%49 = load %struct.node*, %struct.node** %4
%50 = load i8*, i8** %5
%51 = load %struct.node*, %struct.node** %6
%52 = load i8, i8* %7
%53 = load i8, i8* %8
%54 = load i8, i8* %7
%55 = sext i8 %54 to i32
%56 = add nsw i32 %55, 1
%57 = trunc i32 %56 to i8
%58 = load i8, i8* %8
%59 = sext i8 %58 to i32
%60 = add nsw i32 %59, 2
%61 = trunc i32 %60 to i8
%62 = call %struct.node* @store_move(%struct.node* %49, i8* %50, i32 1, %struct.node* %51, i8 signext %52, i8 signext %53, i8 signext %57, i8 signext %61)
store %struct.node* %62, %struct.node** %4
%63 = load i32, i32* %9
%64 = add nsw i32 %63, 1
store i32 %64, i32* %9
br label %65
65: ; preds = %48, %36, %32, %28
%66 = load i8, i8* %7
%67 = sext i8 %66 to i32
%68 = icmp slt i32 %67, 103
br i1 %68, label %69, label %102
69: ; preds = %65
%70 = load i8, i8* %8
%71 = sext i8 %70 to i32
%72 = icmp slt i32 %71, 56
br i1 %72, label %73, label %102
73: ; preds = %69
%74 = load i8*, i8** %5
%75 = load i8, i8* %7
%76 = sext i8 %75 to i32
%77 = add nsw i32 %76, 2
%78 = trunc i32 %77 to i8
%79 = load i8, i8* %8
%80 = sext i8 %79 to i32
%81 = add nsw i32 %80, 1
%82 = trunc i32 %81 to i8
%83 = call i32 @is_occupied(i8* %74, i8 signext %78, i8 signext %82)
%84 = icmp ne i32 %83, 1
br i1 %84, label %85, label %102
85: ; preds = %73
%86 = load %struct.node*, %struct.node** %4
%87 = load i8*, i8** %5
%88 = load %struct.node*, %struct.node** %6
%89 = load i8, i8* %7
%90 = load i8, i8* %8
%91 = load i8, i8* %7
%92 = sext i8 %91 to i32
%93 = add nsw i32 %92, 2
%94 = trunc i32 %93 to i8
%95 = load i8, i8* %8
%96 = sext i8 %95 to i32
%97 = add nsw i32 %96, 1
%98 = trunc i32 %97 to i8
%99 = call %struct.node* @store_move(%struct.node* %86, i8* %87, i32 1, %struct.node* %88, i8 signext %89, i8 signext %90, i8 signext %94, i8 signext %98)
store %struct.node* %99, %struct.node** %4
%100 = load i32, i32* %9
%101 = add nsw i32 %100, 1
store i32 %101, i32* %9
br label %102
102: ; preds = %85, %73, %69, %65
%103 = load i8, i8* %7
%104 = sext i8 %103 to i32
%105 = icmp slt i32 %104, 103
br i1 %105, label %106, label %139
106: ; preds = %102
%107 = load i8, i8* %8
%108 = sext i8 %107 to i32
%109 = icmp sgt i32 %108, 49
br i1 %109, label %110, label %139
110: ; preds = %106
%111 = load i8*, i8** %5
%112 = load i8, i8* %7
%113 = sext i8 %112 to i32
%114 = add nsw i32 %113, 2
%115 = trunc i32 %114 to i8
%116 = load i8, i8* %8
%117 = sext i8 %116 to i32
%118 = sub nsw i32 %117, 1
%119 = trunc i32 %118 to i8
%120 = call i32 @is_occupied(i8* %111, i8 signext %115, i8 signext %119)
%121 = icmp ne i32 %120, 1
br i1 %121, label %122, label %139
122: ; preds = %110
%123 = load %struct.node*, %struct.node** %4
%124 = load i8*, i8** %5
%125 = load %struct.node*, %struct.node** %6
%126 = load i8, i8* %7
%127 = load i8, i8* %8
%128 = load i8, i8* %7
%129 = sext i8 %128 to i32
%130 = add nsw i32 %129, 2
%131 = trunc i32 %130 to i8
%132 = load i8, i8* %8
%133 = sext i8 %132 to i32
%134 = sub nsw i32 %133, 1
%135 = trunc i32 %134 to i8
%136 = call %struct.node* @store_move(%struct.node* %123, i8* %124, i32 1, %struct.node* %125, i8 signext %126, i8 signext %127, i8 signext %131, i8 signext %135)
store %struct.node* %136, %struct.node** %4
%137 = load i32, i32* %9
%138 = add nsw i32 %137, 1
store i32 %138, i32* %9
br label %139
139: ; preds = %122, %110, %106, %102
%140 = load i8, i8* %7
%141 = sext i8 %140 to i32
%142 = icmp slt i32 %141, 104
br i1 %142, label %143, label %176
143: ; preds = %139
%144 = load i8, i8* %8
%145 = sext i8 %144 to i32
%146 = icmp sgt i32 %145, 50
br i1 %146, label %147, label %176
147: ; preds = %143
%148 = load i8*, i8** %5
%149 = load i8, i8* %7
%150 = sext i8 %149 to i32
%151 = add nsw i32 %150, 1
%152 = trunc i32 %151 to i8
%153 = load i8, i8* %8
%154 = sext i8 %153 to i32
%155 = sub nsw i32 %154, 2
%156 = trunc i32 %155 to i8
%157 = call i32 @is_occupied(i8* %148, i8 signext %152, i8 signext %156)
%158 = icmp ne i32 %157, 1
br i1 %158, label %159, label %176
159: ; preds = %147
%160 = load %struct.node*, %struct.node** %4
%161 = load i8*, i8** %5
%162 = load %struct.node*, %struct.node** %6
%163 = load i8, i8* %7
%164 = load i8, i8* %8
%165 = load i8, i8* %7
%166 = sext i8 %165 to i32
%167 = add nsw i32 %166, 1
%168 = trunc i32 %167 to i8
%169 = load i8, i8* %8
%170 = sext i8 %169 to i32
%171 = sub nsw i32 %170, 2
%172 = trunc i32 %171 to i8
%173 = call %struct.node* @store_move(%struct.node* %160, i8* %161, i32 1, %struct.node* %162, i8 signext %163, i8 signext %164, i8 signext %168, i8 signext %172)
store %struct.node* %173, %struct.node** %4
%174 = load i32, i32* %9
%175 = add nsw i32 %174, 1
store i32 %175, i32* %9
br label %176
176: ; preds = %159, %147, %143, %139
%177 = load i8, i8* %7
%178 = sext i8 %177 to i32
%179 = icmp sgt i32 %178, 97
br i1 %179, label %180, label %213
180: ; preds = %176
%181 = load i8, i8* %8
%182 = sext i8 %181 to i32
%183 = icmp sgt i32 %182, 50
br i1 %183, label %184, label %213
184: ; preds = %180
%185 = load i8*, i8** %5
%186 = load i8, i8* %7
%187 = sext i8 %186 to i32
%188 = sub nsw i32 %187, 1
%189 = trunc i32 %188 to i8
%190 = load i8, i8* %8
%191 = sext i8 %190 to i32
%192 = sub nsw i32 %191, 2
%193 = trunc i32 %192 to i8
%194 = call i32 @is_occupied(i8* %185, i8 signext %189, i8 signext %193)
%195 = icmp ne i32 %194, 1
br i1 %195, label %196, label %213
196: ; preds = %184
%197 = load %struct.node*, %struct.node** %4
%198 = load i8*, i8** %5
%199 = load %struct.node*, %struct.node** %6
%200 = load i8, i8* %7
%201 = load i8, i8* %8
%202 = load i8, i8* %7
%203 = sext i8 %202 to i32
%204 = sub nsw i32 %203, 1
%205 = trunc i32 %204 to i8
%206 = load i8, i8* %8
%207 = sext i8 %206 to i32
%208 = sub nsw i32 %207, 2
%209 = trunc i32 %208 to i8
%210 = call %struct.node* @store_move(%struct.node* %197, i8* %198, i32 1, %struct.node* %199, i8 signext %200, i8 signext %201, i8 signext %205, i8 signext %209)
store %struct.node* %210, %struct.node** %4
%211 = load i32, i32* %9
%212 = add nsw i32 %211, 1
store i32 %212, i32* %9
br label %213
213: ; preds = %196, %184, %180, %176
%214 = load i8, i8* %7
%215 = sext i8 %214 to i32
%216 = icmp sgt i32 %215, 98
br i1 %216, label %217, label %250
217: ; preds = %213
%218 = load i8, i8* %8
%219 = sext i8 %218 to i32
%220 = icmp sgt i32 %219, 49
br i1 %220, label %221, label %250
221: ; preds = %217
%222 = load i8*, i8** %5
%223 = load i8, i8* %7
%224 = sext i8 %223 to i32
%225 = sub nsw i32 %224, 2
%226 = trunc i32 %225 to i8
%227 = load i8, i8* %8
%228 = sext i8 %227 to i32
%229 = sub nsw i32 %228, 1
%230 = trunc i32 %229 to i8
%231 = call i32 @is_occupied(i8* %222, i8 signext %226, i8 signext %230)
%232 = icmp ne i32 %231, 1
br i1 %232, label %233, label %250
233: ; preds = %221
%234 = load %struct.node*, %struct.node** %4
%235 = load i8*, i8** %5
%236 = load %struct.node*, %struct.node** %6
%237 = load i8, i8* %7
%238 = load i8, i8* %8
%239 = load i8, i8* %7
%240 = sext i8 %239 to i32
%241 = sub nsw i32 %240, 2
%242 = trunc i32 %241 to i8
%243 = load i8, i8* %8
%244 = sext i8 %243 to i32
%245 = sub nsw i32 %244, 1
%246 = trunc i32 %245 to i8
%247 = call %struct.node* @store_move(%struct.node* %234, i8* %235, i32 1, %struct.node* %236, i8 signext %237, i8 signext %238, i8 signext %242, i8 signext %246)
store %struct.node* %247, %struct.node** %4
%248 = load i32, i32* %9
%249 = add nsw i32 %248, 1
store i32 %249, i32* %9
br label %250
250: ; preds = %233, %221, %217, %213
%251 = load i8, i8* %7
%252 = sext i8 %251 to i32
%253 = icmp sgt i32 %252, 98
br i1 %253, label %254, label %287
254: ; preds = %250
%255 = load i8, i8* %8
%256 = sext i8 %255 to i32
%257 = icmp slt i32 %256, 56
br i1 %257, label %258, label %287
258: ; preds = %254
%259 = load i8*, i8** %5
%260 = load i8, i8* %7
%261 = sext i8 %260 to i32
%262 = sub nsw i32 %261, 2
%263 = trunc i32 %262 to i8
%264 = load i8, i8* %8
%265 = sext i8 %264 to i32
%266 = add nsw i32 %265, 1
%267 = trunc i32 %266 to i8
%268 = call i32 @is_occupied(i8* %259, i8 signext %263, i8 signext %267)
%269 = icmp ne i32 %268, 1
br i1 %269, label %270, label %287
270: ; preds = %258
%271 = load %struct.node*, %struct.node** %4
%272 = load i8*, i8** %5
%273 = load %struct.node*, %struct.node** %6
%274 = load i8, i8* %7
%275 = load i8, i8* %8
%276 = load i8, i8* %7
%277 = sext i8 %276 to i32
%278 = sub nsw i32 %277, 2
%279 = trunc i32 %278 to i8
%280 = load i8, i8* %8
%281 = sext i8 %280 to i32
%282 = add nsw i32 %281, 1
%283 = trunc i32 %282 to i8
%284 = call %struct.node* @store_move(%struct.node* %271, i8* %272, i32 1, %struct.node* %273, i8 signext %274, i8 signext %275, i8 signext %279, i8 signext %283)
store %struct.node* %284, %struct.node** %4
%285 = load i32, i32* %9
%286 = add nsw i32 %285, 1
store i32 %286, i32* %9
br label %287
287: ; preds = %270, %258, %254, %250
%288 = load i8, i8* %7
%289 = sext i8 %288 to i32
%290 = icmp sgt i32 %289, 97
br i1 %290, label %291, label %324
291: ; preds = %287
%292 = load i8, i8* %8
%293 = sext i8 %292 to i32
%294 = icmp slt i32 %293, 55
br i1 %294, label %295, label %324
295: ; preds = %291
%296 = load i8*, i8** %5
%297 = load i8, i8* %7
%298 = sext i8 %297 to i32
%299 = sub nsw i32 %298, 1
%300 = trunc i32 %299 to i8
%301 = load i8, i8* %8
%302 = sext i8 %301 to i32
%303 = add nsw i32 %302, 2
%304 = trunc i32 %303 to i8
%305 = call i32 @is_occupied(i8* %296, i8 signext %300, i8 signext %304)
%306 = icmp ne i32 %305, 1
br i1 %306, label %307, label %324
307: ; preds = %295
%308 = load %struct.node*, %struct.node** %4
%309 = load i8*, i8** %5
%310 = load %struct.node*, %struct.node** %6
%311 = load i8, i8* %7
%312 = load i8, i8* %8
%313 = load i8, i8* %7
%314 = sext i8 %313 to i32
%315 = sub nsw i32 %314, 1
%316 = trunc i32 %315 to i8
%317 = load i8, i8* %8
%318 = sext i8 %317 to i32
%319 = add nsw i32 %318, 2
%320 = trunc i32 %319 to i8
%321 = call %struct.node* @store_move(%struct.node* %308, i8* %309, i32 1, %struct.node* %310, i8 signext %311, i8 signext %312, i8 signext %316, i8 signext %320)
store %struct.node* %321, %struct.node** %4
%322 = load i32, i32* %9
%323 = add nsw i32 %322, 1
store i32 %323, i32* %9
br label %324
324: ; preds = %307, %295, %291, %287
br label %325
325: ; preds = %324, %20
br label %326
326: ; preds = %325
%327 = load i8, i8* %8
%328 = add i8 %327, 1
store i8 %328, i8* %8
br label %16
329: ; preds = %16
br label %330
330: ; preds = %329
%331 = load i8, i8* %7
%332 = add i8 %331, 1
store i8 %332, i8* %7
br label %11
333: ; preds = %11
%334 = load %struct.node*, %struct.node** %4
ret %struct.node* %334
}

LLVM IR (-O2):
%struct.node = type { i32 }
define %struct.node* @get_knight_moves_white(%struct.node* %0, i8* %1, %struct.node* %2) {
br label %4
4: ; preds = %3, %99
%5 = phi %struct.node* [ %0, %3 ], [ %96, %99 ]
%6 = phi i8 [ 97, %3 ], [ %8, %99 ]
%7 = icmp ult i8 %6, 104
%8 = add nuw nsw i8 %6, 1
%9 = icmp ult i8 %6, 103
%10 = add nuw nsw i8 %6, 2
%11 = icmp ugt i8 %6, 97
%12 = add nsw i8 %6, -1
%13 = icmp ugt i8 %6, 98
%14 = add nsw i8 %6, -2
br label %15
15: ; preds = %4, %95
%16 = phi %struct.node* [ %5, %4 ], [ %96, %95 ]
%17 = phi i8 [ 49, %4 ], [ %97, %95 ]
%18 = tail call signext i8 @get_piece(i8* %1, i8 signext %6, i8 signext %17)
%19 = icmp eq i8 %18, 78
br i1 %19, label %20, label %95
20: ; preds = %15
%21 = icmp ult i8 %17, 55
%22 = and i1 %7, %21
br i1 %22, label %23, label %29
23: ; preds = %20
%24 = add nuw nsw i8 %17, 2
%25 = tail call i32 @is_occupied(i8* %1, i8 signext %8, i8 signext %24)
%26 = icmp eq i32 %25, 1
br i1 %26, label %29, label %27
27: ; preds = %23
%28 = tail call %struct.node* @store_move(%struct.node* %16, i8* %1, i32 1, %struct.node* %2, i8 signext %6, i8 signext %17, i8 signext %8, i8 signext %24)
br label %29
29: ; preds = %27, %23, %20
%30 = phi %struct.node* [ %28, %27 ], [ %16, %23 ], [ %16, %20 ]
%31 = icmp ult i8 %17, 56
%32 = and i1 %9, %31
br i1 %32, label %33, label %39
33: ; preds = %29
%34 = add nuw nsw i8 %17, 1
%35 = tail call i32 @is_occupied(i8* %1, i8 signext %10, i8 signext %34)
%36 = icmp eq i32 %35, 1
br i1 %36, label %39, label %37
37: ; preds = %33
%38 = tail call %struct.node* @store_move(%struct.node* %30, i8* %1, i32 1, %struct.node* %2, i8 signext %6, i8 signext %17, i8 signext %10, i8 signext %34)
br label %39
39: ; preds = %37, %33, %29
%40 = phi %struct.node* [ %38, %37 ], [ %30, %33 ], [ %30, %29 ]
%41 = icmp ugt i8 %17, 49
%42 = and i1 %9, %41
br i1 %42, label %43, label %49
43: ; preds = %39
%44 = add nsw i8 %17, -1
%45 = tail call i32 @is_occupied(i8* %1, i8 signext %10, i8 signext %44)
%46 = icmp eq i32 %45, 1
br i1 %46, label %49, label %47
47: ; preds = %43
%48 = tail call %struct.node* @store_move(%struct.node* %40, i8* %1, i32 1, %struct.node* %2, i8 signext %6, i8 signext %17, i8 signext %10, i8 signext %44)
br label %49
49: ; preds = %47, %43, %39
%50 = phi %struct.node* [ %48, %47 ], [ %40, %43 ], [ %40, %39 ]
%51 = icmp ugt i8 %17, 50
%52 = and i1 %7, %51
br i1 %52, label %53, label %59
53: ; preds = %49
%54 = add nsw i8 %17, -2
%55 = tail call i32 @is_occupied(i8* %1, i8 signext %8, i8 signext %54)
%56 = icmp eq i32 %55, 1
br i1 %56, label %59, label %57
57: ; preds = %53
%58 = tail call %struct.node* @store_move(%struct.node* %50, i8* %1, i32 1, %struct.node* %2, i8 signext %6, i8 signext %17, i8 signext %8, i8 signext %54)
br label %59
59: ; preds = %57, %53, %49
%60 = phi %struct.node* [ %58, %57 ], [ %50, %53 ], [ %50, %49 ]
%61 = and i1 %11, %51
br i1 %61, label %62, label %68
62: ; preds = %59
%63 = add nsw i8 %17, -2
%64 = tail call i32 @is_occupied(i8* %1, i8 signext %12, i8 signext %63)
%65 = icmp eq i32 %64, 1
br i1 %65, label %68, label %66
66: ; preds = %62
%67 = tail call %struct.node* @store_move(%struct.node* %60, i8* %1, i32 1, %struct.node* %2, i8 signext %6, i8 signext %17, i8 signext %12, i8 signext %63)
br label %68
68: ; preds = %66, %62, %59
%69 = phi %struct.node* [ %67, %66 ], [ %60, %62 ], [ %60, %59 ]
%70 = and i1 %13, %41
br i1 %70, label %71, label %77
71: ; preds = %68
%72 = add nsw i8 %17, -1
%73 = tail call i32 @is_occupied(i8* %1, i8 signext %14, i8 signext %72)
%74 = icmp eq i32 %73, 1
br i1 %74, label %77, label %75
75: ; preds = %71
%76 = tail call %struct.node* @store_move(%struct.node* %69, i8* %1, i32 1, %struct.node* %2, i8 signext %6, i8 signext %17, i8 signext %14, i8 signext %72)
br label %77
77: ; preds = %75, %71, %68
%78 = phi %struct.node* [ %76, %75 ], [ %69, %71 ], [ %69, %68 ]
%79 = and i1 %13, %31
br i1 %79, label %80, label %86
80: ; preds = %77
%81 = add nuw nsw i8 %17, 1
%82 = tail call i32 @is_occupied(i8* %1, i8 signext %14, i8 signext %81)
%83 = icmp eq i32 %82, 1
br i1 %83, label %86, label %84
84: ; preds = %80
%85 = tail call %struct.node* @store_move(%struct.node* %78, i8* %1, i32 1, %struct.node* %2, i8 signext %6, i8 signext %17, i8 signext %14, i8 signext %81)
br label %86
86: ; preds = %84, %80, %77
%87 = phi %struct.node* [ %85, %84 ], [ %78, %80 ], [ %78, %77 ]
%88 = and i1 %11, %21
br i1 %88, label %89, label %95
89: ; preds = %86
%90 = add nuw nsw i8 %17, 2
%91 = tail call i32 @is_occupied(i8* %1, i8 signext %12, i8 signext %90)
%92 = icmp eq i32 %91, 1
br i1 %92, label %95, label %93
93: ; preds = %89
%94 = tail call %struct.node* @store_move(%struct.node* %87, i8* %1, i32 1, %struct.node* %2, i8 signext %6, i8 signext %17, i8 signext %12, i8 signext %90)
br label %95
95: ; preds = %86, %89, %93, %15
%96 = phi %struct.node* [ %94, %93 ], [ %87, %89 ], [ %87, %86 ], [ %16, %15 ]
%97 = add nuw nsw i8 %17, 1
%98 = icmp eq i8 %97, 57
br i1 %98, label %99, label %15
99: ; preds = %95
%100 = icmp eq i8 %8, 105
br i1 %100, label %101, label %4
101: ; preds = %99
ret %struct.node* %96
}