#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 /*<<< orphan*/ moverecord(int *);
scalar_t__ piececount(int *, int, int);
void movegen(int *mover, int *movee) {
  extern int i, j, l, m, count;
  extern int die1, die2;
  int k;
  for (i = 0; i <= 24; i++) {
    count = 0;
    if (mover[i] == 0)
      continue;
    if ((k = 25 - i - die1) > 0 && movee[k] >= 2)
      if (mover[0] > 0)
        break;
      else
        continue;
    if (k <= 0) {
      if (piececount(mover, 0, 18) != 0)
        break;
      if ((i + die1) != 25 && piececount(mover, 19, 24 - die1) != 0)
        break;
    }
    mover[i]--;
    mover[i + die1]++;
    count = 1;
    for (j = 0; j <= 24; j++) {
      if (mover[j] == 0)
        continue;
      if ((k = 25 - j - die2) > 0 && movee[k] >= 2)
        if (mover[0] > 0)
          break;
        else
          continue;
      if (k <= 0) {
        if (piececount(mover, 0, 18) != 0)
          break;
        if ((j + die2) != 25 && piececount(mover, 19, 24 - die2) != 0)
          break;
      }
      mover[j]--;
      mover[j + die2]++;
      count = 2;
      if (die1 != die2) {
        moverecord(mover);
        if (mover[0] > 0)
          break;
        else
          continue;
      }
      for (l = 0; l <= 24; l++) {
        if (mover[l] == 0)
          continue;
        if ((k = 25 - l - die1) > 0 && movee[k] >= 2)
          if (mover[0] > 0)
            break;
          else
            continue;
        if (k <= 0) {
          if (piececount(mover, 0, 18) != 0)
            break;
          if ((l + die2) != 25 && piececount(mover, 19, 24 - die1) != 0)
            break;
        }
        mover[l]--;
        mover[l + die1]++;
        count = 3;
        for (m = 0; m <= 24; m++) {
          if (mover[m] == 0)
            continue;
          if ((k = 25 - m - die1) >= 0 && movee[k] >= 2)
            if (mover[0] > 0)
              break;
            else
              continue;
          if (k <= 0) {
            if (piececount(mover, 0, 18) != 0)
              break;
            if ((m + die2) != 25 && piececount(mover, 19, 24 - die1) != 0)
              break;
          }
          count = 4;
          moverecord(mover);
          if (mover[0] > 0)
            break;
        }
        if (count == 3)
          moverecord(mover);
        else {
          mover[l]++;
          mover[l + die1]--;
        }
        if (mover[0] > 0)
          break;
      }
      if (count == 2)
        moverecord(mover);
      else {
        mover[j]++;
        mover[j + die1]--;
      }
      if (mover[0] > 0)
        break;
    }
    if (count == 1)
      moverecord(mover);
    else {
      mover[i]++;
      mover[i + die1]--;
    }
    if (mover[0] > 0)
      break;
  }
}


x86 assembly (clang, -O0):
<movegen>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2ea1(%rip),%rax
movl   $0x0,(%rax)
mov    0x2e94(%rip),%rax
cmpl   $0x18,(%rax)
jg     180e <movegen+0x6ee>
mov    0x2e54(%rip),%rax
movl   $0x0,(%rax)
mov    -0x8(%rbp),%rax
mov    0x2e73(%rip),%rcx
movslq (%rcx),%rcx
cmpl   $0x0,(%rax,%rcx,4)
jne    1177 <movegen+0x57>
jmp    17f4 <movegen+0x6d4>
mov    $0x19,%eax
mov    0x2e55(%rip),%rcx
sub    (%rcx),%eax
mov    0x2e5c(%rip),%rcx
sub    (%rcx),%eax
mov    %eax,-0x14(%rbp)
cmp    $0x0,%eax
jle    11c3 <movegen+0xa3>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
cmpl   $0x2,(%rax,%rcx,4)
jl     11c3 <movegen+0xa3>
mov    -0x8(%rbp),%rax
cmpl   $0x0,(%rax)
jle    11be <movegen+0x9e>
jmp    180e <movegen+0x6ee>
jmp    17f4 <movegen+0x6d4>
cmpl   $0x0,-0x14(%rbp)
jg     1237 <movegen+0x117>
mov    -0x8(%rbp),%rdi
xor    %esi,%esi
mov    $0x12,%edx
call   1040 <piececount@plt>
cmp    $0x0,%rax
je     11ec <movegen+0xcc>
jmp    180e <movegen+0x6ee>
mov    0x2de5(%rip),%rax
mov    (%rax),%eax
mov    0x2dec(%rip),%rcx
add    (%rcx),%eax
cmp    $0x19,%eax
je     1232 <movegen+0x112>
mov    -0x8(%rbp),%rdi
mov    $0x18,%edx
mov    0x2dd1(%rip),%rax
sub    (%rax),%edx
mov    $0x13,%esi
call   1040 <piececount@plt>
cmp    $0x0,%rax
je     1232 <movegen+0x112>
jmp    180e <movegen+0x6ee>
jmp    1237 <movegen+0x117>
mov    -0x8(%rbp),%rax
mov    0x2d96(%rip),%rcx
movslq (%rcx),%rcx
mov    (%rax,%rcx,4),%edx
add    $0xffffffff,%edx
mov    %edx,(%rax,%rcx,4)
mov    -0x8(%rbp),%rax
mov    0x2d7f(%rip),%rcx
mov    (%rcx),%ecx
mov    0x2d86(%rip),%rdx
add    (%rdx),%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,4),%edx
add    $0x1,%edx
mov    %edx,(%rax,%rcx,4)
mov    0x2d31(%rip),%rax
movl   $0x1,(%rax)
mov    0x2d3c(%rip),%rax
movl   $0x0,(%rax)
mov    0x2d2f(%rip),%rax
cmpl   $0x18,(%rax)
jg     1786 <movegen+0x666>
mov    -0x8(%rbp),%rax
mov    0x2d1b(%rip),%rcx
movslq (%rcx),%rcx
cmpl   $0x0,(%rax,%rcx,4)
jne    12b7 <movegen+0x197>
jmp    176c <movegen+0x64c>
mov    $0x19,%eax
mov    0x2cfd(%rip),%rcx
sub    (%rcx),%eax
mov    0x2cfc(%rip),%rcx
sub    (%rcx),%eax
mov    %eax,-0x14(%rbp)
cmp    $0x0,%eax
jle    1303 <movegen+0x1e3>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
cmpl   $0x2,(%rax,%rcx,4)
jl     1303 <movegen+0x1e3>
mov    -0x8(%rbp),%rax
cmpl   $0x0,(%rax)
jle    12fe <movegen+0x1de>
jmp    1786 <movegen+0x666>
jmp    176c <movegen+0x64c>
cmpl   $0x0,-0x14(%rbp)
jg     1377 <movegen+0x257>
mov    -0x8(%rbp),%rdi
xor    %esi,%esi
mov    $0x12,%edx
call   1040 <piececount@plt>
cmp    $0x0,%rax
je     132c <movegen+0x20c>
jmp    1786 <movegen+0x666>
mov    0x2c8d(%rip),%rax
mov    (%rax),%eax
mov    0x2c8c(%rip),%rcx
add    (%rcx),%eax
cmp    $0x19,%eax
je     1372 <movegen+0x252>
mov    -0x8(%rbp),%rdi
mov    $0x18,%edx
mov    0x2c71(%rip),%rax
sub    (%rax),%edx
mov    $0x13,%esi
call   1040 <piececount@plt>
cmp    $0x0,%rax
je     1372 <movegen+0x252>
jmp    1786 <movegen+0x666>
jmp    1377 <movegen+0x257>
mov    -0x8(%rbp),%rax
mov    0x2c3e(%rip),%rcx
movslq (%rcx),%rcx
mov    (%rax,%rcx,4),%edx
add    $0xffffffff,%edx
mov    %edx,(%rax,%rcx,4)
mov    -0x8(%rbp),%rax
mov    0x2c27(%rip),%rcx
mov    (%rcx),%ecx
mov    0x2c26(%rip),%rdx
add    (%rdx),%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,4),%edx
add    $0x1,%edx
mov    %edx,(%rax,%rcx,4)
mov    0x2bf1(%rip),%rax
movl   $0x2,(%rax)
mov    0x2c24(%rip),%rax
mov    (%rax),%eax
mov    0x2bfb(%rip),%rcx
cmp    (%rcx),%eax
je     13f5 <movegen+0x2d5>
mov    -0x8(%rbp),%rdi
call   1030 <moverecord@plt>
mov    -0x8(%rbp),%rax
cmpl   $0x0,(%rax)
jle    13f0 <movegen+0x2d0>
jmp    1786 <movegen+0x666>
jmp    176c <movegen+0x64c>
mov    0x2bbc(%rip),%rax
movl   $0x0,(%rax)
mov    0x2baf(%rip),%rax
cmpl   $0x18,(%rax)
jg     16fe <movegen+0x5de>
mov    -0x8(%rbp),%rax
mov    0x2b9b(%rip),%rcx
movslq (%rcx),%rcx
cmpl   $0x0,(%rax,%rcx,4)
jne    142f <movegen+0x30f>
jmp    16e4 <movegen+0x5c4>
mov    $0x19,%eax
mov    0x2b7d(%rip),%rcx
sub    (%rcx),%eax
mov    0x2ba4(%rip),%rcx
sub    (%rcx),%eax
mov    %eax,-0x14(%rbp)
cmp    $0x0,%eax
jle    147b <movegen+0x35b>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
cmpl   $0x2,(%rax,%rcx,4)
jl     147b <movegen+0x35b>
mov    -0x8(%rbp),%rax
cmpl   $0x0,(%rax)
jle    1476 <movegen+0x356>
jmp    16fe <movegen+0x5de>
jmp    16e4 <movegen+0x5c4>
cmpl   $0x0,-0x14(%rbp)
jg     14ef <movegen+0x3cf>
mov    -0x8(%rbp),%rdi
xor    %esi,%esi
mov    $0x12,%edx
call   1040 <piececount@plt>
cmp    $0x0,%rax
je     14a4 <movegen+0x384>
jmp    16fe <movegen+0x5de>
mov    0x2b0d(%rip),%rax
mov    (%rax),%eax
mov    0x2b14(%rip),%rcx
add    (%rcx),%eax
cmp    $0x19,%eax
je     14ea <movegen+0x3ca>
mov    -0x8(%rbp),%rdi
mov    $0x18,%edx
mov    0x2b19(%rip),%rax
sub    (%rax),%edx
mov    $0x13,%esi
call   1040 <piececount@plt>
cmp    $0x0,%rax
je     14ea <movegen+0x3ca>
jmp    16fe <movegen+0x5de>
jmp    14ef <movegen+0x3cf>
mov    -0x8(%rbp),%rax
mov    0x2abe(%rip),%rcx
movslq (%rcx),%rcx
mov    (%rax,%rcx,4),%edx
add    $0xffffffff,%edx
mov    %edx,(%rax,%rcx,4)
mov    -0x8(%rbp),%rax
mov    0x2aa7(%rip),%rcx
mov    (%rcx),%ecx
mov    0x2ace(%rip),%rdx
add    (%rdx),%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,4),%edx
add    $0x1,%edx
mov    %edx,(%rax,%rcx,4)
mov    0x2a79(%rip),%rax
movl   $0x3,(%rax)
mov    0x2aa4(%rip),%rax
movl   $0x0,(%rax)
mov    0x2a97(%rip),%rax
cmpl   $0x18,(%rax)
jg     1676 <movegen+0x556>
mov    -0x8(%rbp),%rax
mov    0x2a83(%rip),%rcx
movslq (%rcx),%rcx
cmpl   $0x0,(%rax,%rcx,4)
jne    156f <movegen+0x44f>
jmp    165c <movegen+0x53c>
mov    $0x19,%eax
mov    0x2a65(%rip),%rcx
sub    (%rcx),%eax
mov    0x2a64(%rip),%rcx
sub    (%rcx),%eax
mov    %eax,-0x14(%rbp)
cmp    $0x0,%eax
jl     15bb <movegen+0x49b>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
cmpl   $0x2,(%rax,%rcx,4)
jl     15bb <movegen+0x49b>
mov    -0x8(%rbp),%rax
cmpl   $0x0,(%rax)
jle    15b6 <movegen+0x496>
jmp    1676 <movegen+0x556>
jmp    165c <movegen+0x53c>
cmpl   $0x0,-0x14(%rbp)
jg     162f <movegen+0x50f>
mov    -0x8(%rbp),%rdi
xor    %esi,%esi
mov    $0x12,%edx
call   1040 <piececount@plt>
cmp    $0x0,%rax
je     15e4 <movegen+0x4c4>
jmp    1676 <movegen+0x556>
mov    0x29f5(%rip),%rax
mov    (%rax),%eax
mov    0x29d4(%rip),%rcx
add    (%rcx),%eax
cmp    $0x19,%eax
je     162a <movegen+0x50a>
mov    -0x8(%rbp),%rdi
mov    $0x18,%edx
mov    0x29d9(%rip),%rax
sub    (%rax),%edx
mov    $0x13,%esi
call   1040 <piececount@plt>
cmp    $0x0,%rax
je     162a <movegen+0x50a>
jmp    1676 <movegen+0x556>
jmp    162f <movegen+0x50f>
mov    0x2972(%rip),%rax
movl   $0x4,(%rax)
mov    -0x8(%rbp),%rdi
call   1030 <moverecord@plt>
mov    -0x8(%rbp),%rax
cmpl   $0x0,(%rax)
jle    1657 <movegen+0x537>
jmp    1676 <movegen+0x556>
jmp    165c <movegen+0x53c>
mov    0x297d(%rip),%rax
mov    (%rax),%ecx
add    $0x1,%ecx
mov    0x2971(%rip),%rax
mov    %ecx,(%rax)
jmp    1542 <movegen+0x422>
mov    0x292b(%rip),%rax
cmpl   $0x3,(%rax)
jne    1694 <movegen+0x574>
mov    -0x8(%rbp),%rdi
call   1030 <moverecord@plt>
jmp    16cd <movegen+0x5ad>
mov    -0x8(%rbp),%rax
mov    0x2919(%rip),%rcx
movslq (%rcx),%rcx
mov    (%rax,%rcx,4),%edx
add    $0x1,%edx
mov    %edx,(%rax,%rcx,4)
mov    -0x8(%rbp),%rax
mov    0x2902(%rip),%rcx
mov    (%rcx),%ecx
mov    0x2929(%rip),%rdx
add    (%rdx),%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,4),%edx
add    $0xffffffff,%edx
mov    %edx,(%rax,%rcx,4)
mov    -0x8(%rbp),%rax
cmpl   $0x0,(%rax)
jle    16df <movegen+0x5bf>
jmp    16fe <movegen+0x5de>
jmp    16e4 <movegen+0x5c4>
mov    0x28cd(%rip),%rax
mov    (%rax),%ecx
add    $0x1,%ecx
mov    0x28c1(%rip),%rax
mov    %ecx,(%rax)
jmp    1402 <movegen+0x2e2>
mov    0x28a3(%rip),%rax
cmpl   $0x2,(%rax)
jne    171c <movegen+0x5fc>
mov    -0x8(%rbp),%rdi
call   1030 <moverecord@plt>
jmp    1755 <movegen+0x635>
mov    -0x8(%rbp),%rax
mov    0x2899(%rip),%rcx
movslq (%rcx),%rcx
mov    (%rax,%rcx,4),%edx
add    $0x1,%edx
mov    %edx,(%rax,%rcx,4)
mov    -0x8(%rbp),%rax
mov    0x2882(%rip),%rcx
mov    (%rcx),%ecx
mov    0x28a1(%rip),%rdx
add    (%rdx),%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,4),%edx
add    $0xffffffff,%edx
mov    %edx,(%rax,%rcx,4)
mov    -0x8(%rbp),%rax
cmpl   $0x0,(%rax)
jle    1767 <movegen+0x647>
jmp    1786 <movegen+0x666>
jmp    176c <movegen+0x64c>
mov    0x284d(%rip),%rax
mov    (%rax),%ecx
add    $0x1,%ecx
mov    0x2841(%rip),%rax
mov    %ecx,(%rax)
jmp    128a <movegen+0x16a>
mov    0x281b(%rip),%rax
cmpl   $0x1,(%rax)
jne    17a4 <movegen+0x684>
mov    -0x8(%rbp),%rdi
call   1030 <moverecord@plt>
jmp    17dd <movegen+0x6bd>
mov    -0x8(%rbp),%rax
mov    0x2829(%rip),%rcx
movslq (%rcx),%rcx
mov    (%rax,%rcx,4),%edx
add    $0x1,%edx
mov    %edx,(%rax,%rcx,4)
mov    -0x8(%rbp),%rax
mov    0x2812(%rip),%rcx
mov    (%rcx),%ecx
mov    0x2819(%rip),%rdx
add    (%rdx),%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,4),%edx
add    $0xffffffff,%edx
mov    %edx,(%rax,%rcx,4)
mov    -0x8(%rbp),%rax
cmpl   $0x0,(%rax)
jle    17ef <movegen+0x6cf>
jmp    180e <movegen+0x6ee>
jmp    17f4 <movegen+0x6d4>
mov    0x27dd(%rip),%rax
mov    (%rax),%ecx
add    $0x1,%ecx
mov    0x27d1(%rip),%rax
mov    %ecx,(%rax)
jmp    113d <movegen+0x1d>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<movegen>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
mov    0x2ea0(%rip),%rdx
movl   $0x0,(%rdx)
xor    %eax,%eax
mov    0x2e61(%rip),%r12
mov    0x2e9a(%rip),%r13
mov    0x2e73(%rip),%r15
mov    0x2e84(%rip),%rbp
jmp    1180 <movegen+0x60>
cmpl   $0x0,(%rbx)
mov    0x2e70(%rip),%rdx
jg     1578 <movegen+0x458>
xchg   %ax,%ax
lea    0x1(%rax),%ecx
mov    %ecx,(%rdx)
cmp    $0x18,%eax
mov    %ecx,%eax
jge    1578 <movegen+0x458>
movl   $0x0,(%r12)
movslq %eax,%rcx
cmpl   $0x0,(%rbx,%rcx,4)
je     1170 <movegen+0x50>
mov    0x0(%r13),%edx
add    %eax,%edx
mov    $0x19,%ecx
sub    %edx,%ecx
test   %ecx,%ecx
jle    11c0 <movegen+0xa0>
mov    %ecx,%ecx
cmpl   $0x2,(%r14,%rcx,4)
jge    115e <movegen+0x3e>
mov    0x2e26(%rip),%rsi
jmp    1219 <movegen+0xf9>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %rbx,%rdi
xor    %esi,%esi
mov    $0x12,%edx
call   1040 <piececount@plt>
test   %rax,%rax
mov    0x2dff(%rip),%rdx
jne    1578 <movegen+0x458>
mov    (%rdx),%eax
mov    0x0(%r13),%ecx
mov    %rdx,%rsi
lea    (%rcx,%rax,1),%edx
cmp    $0x19,%edx
je     1219 <movegen+0xf9>
mov    $0x18,%edx
sub    %ecx,%edx
mov    %rbx,%rdi
mov    $0x13,%esi
call   1040 <piececount@plt>
test   %rax,%rax
mov    0x2dca(%rip),%rcx
jne    1578 <movegen+0x458>
mov    (%rcx),%eax
mov    %rcx,%rsi
cltq
addl   $0xffffffff,(%rbx,%rax,4)
movslq (%rsi),%rax
movslq 0x0(%r13),%rcx
add    %rax,%rcx
addl   $0x1,(%rbx,%rcx,4)
movl   $0x1,(%r12)
mov    0x2d84(%rip),%rax
movl   $0x0,(%rax)
xor    %eax,%eax
jmp    1278 <movegen+0x158>
cs nopw 0x0(%rax,%rax,1)
mov    %rbx,%rdi
call   1030 <moverecord@plt>
cmpl   $0x0,(%rbx)
jg     1530 <movegen+0x410>
mov    0x2d58(%rip),%rdx
mov    (%rdx),%ecx
lea    0x1(%rcx),%eax
mov    %eax,(%rdx)
cmp    $0x18,%ecx
jge    1530 <movegen+0x410>
movslq %eax,%rcx
cmpl   $0x0,(%rbx,%rcx,4)
je     1261 <movegen+0x141>
mov    (%r15),%edx
add    %eax,%edx
mov    $0x19,%ecx
sub    %edx,%ecx
test   %ecx,%ecx
jle    12a0 <movegen+0x180>
mov    %ecx,%ecx
cmpl   $0x2,(%r14,%rcx,4)
jge    1258 <movegen+0x138>
jmp    12f2 <movegen+0x1d2>
nopl   0x0(%rax)
mov    %rbx,%rdi
xor    %esi,%esi
mov    $0x12,%edx
call   1040 <piececount@plt>
test   %rax,%rax
jne    1530 <movegen+0x410>
mov    0x2d01(%rip),%rax
mov    (%rax),%eax
mov    (%r15),%ecx
lea    (%rcx,%rax,1),%edx
cmp    $0x19,%edx
je     12f2 <movegen+0x1d2>
mov    $0x18,%edx
sub    %ecx,%edx
mov    %rbx,%rdi
mov    $0x13,%esi
call   1040 <piececount@plt>
test   %rax,%rax
jne    1530 <movegen+0x410>
mov    0x2cd0(%rip),%rax
mov    (%rax),%eax
cltq
addl   $0xffffffff,(%rbx,%rax,4)
mov    0x2cc1(%rip),%rax
movslq (%rax),%rax
movslq (%r15),%rcx
add    %rax,%rcx
addl   $0x1,(%rbx,%rcx,4)
movl   $0x2,(%r12)
mov    0x0(%r13),%eax
cmp    (%r15),%eax
jne    1250 <movegen+0x130>
mov    0x2c90(%rip),%rdx
movl   $0x0,(%rdx)
xor    %eax,%eax
jmp    1360 <movegen+0x240>
cmpl   $0x0,(%rbx)
mov    0x2c7c(%rip),%rdx
jg     1500 <movegen+0x3e0>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
lea    0x1(%rax),%ecx
mov    %ecx,(%rdx)
cmp    $0x18,%eax
mov    %ecx,%eax
jge    1500 <movegen+0x3e0>
movslq %eax,%rcx
cmpl   $0x0,(%rbx,%rcx,4)
je     1350 <movegen+0x230>
mov    0x0(%r13),%edx
add    %eax,%edx
mov    $0x19,%ecx
sub    %edx,%ecx
test   %ecx,%ecx
jle    1390 <movegen+0x270>
mov    %ecx,%ecx
cmpl   $0x2,(%r14,%rcx,4)
jge    1332 <movegen+0x212>
mov    0x2c2e(%rip),%rdx
jmp    13e3 <movegen+0x2c3>
nopl   0x0(%rax)
mov    %rbx,%rdi
xor    %esi,%esi
mov    $0x12,%edx
call   1040 <piececount@plt>
test   %rax,%rax
mov    0x2c0f(%rip),%rdx
jne    1500 <movegen+0x3e0>
mov    (%rdx),%eax
mov    (%r15),%ecx
add    %eax,%ecx
cmp    $0x19,%ecx
je     13e3 <movegen+0x2c3>
mov    $0x18,%edx
sub    0x0(%r13),%edx
mov    %rbx,%rdi
mov    $0x13,%esi
call   1040 <piececount@plt>
mov    0x2be0(%rip),%rdx
test   %rax,%rax
jne    1500 <movegen+0x3e0>
mov    (%rdx),%eax
cltq
addl   $0xffffffff,(%rbx,%rax,4)
movslq (%rdx),%rax
movslq 0x0(%r13),%rcx
add    %rax,%rcx
addl   $0x1,(%rbx,%rcx,4)
movl   $0x3,(%r12)
movl   $0x0,0x0(%rbp)
xor    %eax,%eax
jmp    1431 <movegen+0x311>
cmpl   $0x0,(%rbx)
jg     14b0 <movegen+0x390>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
lea    0x1(%rax),%ecx
mov    %ecx,0x0(%rbp)
cmp    $0x18,%eax
mov    %ecx,%eax
jge    14b0 <movegen+0x390>
movslq %eax,%rcx
cmpl   $0x0,(%rbx,%rcx,4)
je     1420 <movegen+0x300>
mov    0x0(%r13),%ecx
add    %eax,%ecx
mov    $0x19,%edx
sub    %ecx,%edx
js     1457 <movegen+0x337>
mov    %edx,%edx
cmpl   $0x2,(%r14,%rdx,4)
jge    140a <movegen+0x2ea>
cmp    $0x19,%ecx
jne    1491 <movegen+0x371>
mov    %rbx,%rdi
xor    %esi,%esi
mov    $0x12,%edx
call   1040 <piececount@plt>
test   %rax,%rax
jne    14b0 <movegen+0x390>
mov    (%r15),%eax
add    0x0(%rbp),%eax
cmp    $0x19,%eax
je     1491 <movegen+0x371>
mov    $0x18,%edx
sub    0x0(%r13),%edx
mov    %rbx,%rdi
mov    $0x13,%esi
call   1040 <piececount@plt>
test   %rax,%rax
jne    14b0 <movegen+0x390>
movl   $0x4,(%r12)
mov    %rbx,%rdi
call   1030 <moverecord@plt>
cmpl   $0x0,(%rbx)
jg     14b0 <movegen+0x390>
mov    0x0(%rbp),%eax
jmp    1420 <movegen+0x300>
xchg   %ax,%ax
cmpl   $0x3,(%r12)
jne    14d0 <movegen+0x3b0>
mov    %rbx,%rdi
call   1030 <moverecord@plt>
mov    0x2af2(%rip),%rdx
cmpl   $0x0,(%rbx)
jle    14f1 <movegen+0x3d1>
jmp    1500 <movegen+0x3e0>
nopl   (%rax)
mov    0x2ae1(%rip),%rdx
movslq (%rdx),%rax
addl   $0x1,(%rbx,%rax,4)
movslq (%rdx),%rax
movslq 0x0(%r13),%rcx
add    %rax,%rcx
addl   $0xffffffff,(%rbx,%rcx,4)
cmpl   $0x0,(%rbx)
jg     1500 <movegen+0x3e0>
mov    (%rdx),%eax
jmp    1350 <movegen+0x230>
nopl   0x0(%rax,%rax,1)
cmpl   $0x2,(%r12)
je     1250 <movegen+0x130>
mov    0x2aae(%rip),%rcx
movslq (%rcx),%rax
addl   $0x1,(%rbx,%rax,4)
movslq (%rcx),%rax
movslq 0x0(%r13),%rcx
add    %rax,%rcx
addl   $0xffffffff,(%rbx,%rcx,4)
jmp    1258 <movegen+0x138>
nopl   0x0(%rax)
cmpl   $0x1,(%r12)
jne    1550 <movegen+0x430>
mov    %rbx,%rdi
call   1030 <moverecord@plt>
mov    0x2a92(%rip),%rdx
cmpl   $0x0,(%rbx)
jle    1571 <movegen+0x451>
jmp    1578 <movegen+0x458>
nopl   (%rax)
mov    0x2a81(%rip),%rdx
movslq (%rdx),%rax
addl   $0x1,(%rbx,%rax,4)
movslq (%rdx),%rax
movslq 0x0(%r13),%rcx
add    %rax,%rcx
addl   $0xffffffff,(%rbx,%rcx,4)
cmpl   $0x0,(%rbx)
jg     1578 <movegen+0x458>
mov    (%rdx),%eax
jmp    1170 <movegen+0x50>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
@i = external global i32
@count = external global i32
@die1 = external global i32
@j = external global i32
@die2 = external global i32
@l = external global i32
@m = external global i32
define void @movegen(i32* %0, i32* nocapture %1) {
store i32 0, i32* @i
br label %3
3: ; preds = %2, %269
%4 = phi i32 [ 0, %2 ], [ %271, %269 ]
store i32 0, i32* @count
%5 = sext i32 %4 to i64
%6 = getelementptr inbounds i32, i32* %0, i64 %5
%7 = load i32, i32* %6
%8 = icmp eq i32 %7, 0
br i1 %8, label %269, label %9
9: ; preds = %3
%10 = load i32, i32* @die1
%11 = add i32 %4, %10
%12 = sub i32 25, %11
%13 = icmp sgt i32 %12, 0
br i1 %13, label %14, label %22
14: ; preds = %9
%15 = zext i32 %12 to i64
%16 = getelementptr inbounds i32, i32* %1, i64 %15
%17 = load i32, i32* %16
%18 = icmp sgt i32 %17, 1
br i1 %18, label %19, label %36
19: ; preds = %14
%20 = load i32, i32* %0
%21 = icmp sgt i32 %20, 0
br i1 %21, label %273, label %269
22: ; preds = %9
%23 = tail call i64 @piececount(i32* %0, i32 0, i32 18)
%24 = icmp eq i64 %23, 0
br i1 %24, label %25, label %273
25: ; preds = %22
%26 = load i32, i32* @i
%27 = load i32, i32* @die1
%28 = add nsw i32 %27, %26
%29 = icmp eq i32 %28, 25
br i1 %29, label %36, label %30
30: ; preds = %25
%31 = sub nsw i32 24, %27
%32 = tail call i64 @piececount(i32* %0, i32 19, i32 %31)
%33 = icmp eq i64 %32, 0
br i1 %33, label %34, label %273
34: ; preds = %30
%35 = load i32, i32* @i
br label %36
36: ; preds = %34, %14, %25
%37 = phi i32 [ %35, %34 ], [ %4, %14 ], [ %26, %25 ]
%38 = sext i32 %37 to i64
%39 = getelementptr inbounds i32, i32* %0, i64 %38
%40 = load i32, i32* %39
%41 = add nsw i32 %40, -1
store i32 %41, i32* %39
%42 = load i32, i32* @i
%43 = load i32, i32* @die1
%44 = add nsw i32 %43, %42
%45 = sext i32 %44 to i64
%46 = getelementptr inbounds i32, i32* %0, i64 %45
%47 = load i32, i32* %46
%48 = add nsw i32 %47, 1
store i32 %48, i32* %46
store i32 1, i32* @count
store i32 0, i32* @j
br label %49
49: ; preds = %36, %242
%50 = phi i32 [ 0, %36 ], [ %244, %242 ]
%51 = sext i32 %50 to i64
%52 = getelementptr inbounds i32, i32* %0, i64 %51
%53 = load i32, i32* %52
%54 = icmp eq i32 %53, 0
br i1 %54, label %242, label %55
55: ; preds = %49
%56 = load i32, i32* @die2
%57 = add i32 %50, %56
%58 = sub i32 25, %57
%59 = icmp sgt i32 %58, 0
br i1 %59, label %60, label %68
60: ; preds = %55
%61 = zext i32 %58 to i64
%62 = getelementptr inbounds i32, i32* %1, i64 %61
%63 = load i32, i32* %62
%64 = icmp sgt i32 %63, 1
br i1 %64, label %65, label %82
65: ; preds = %60
%66 = load i32, i32* %0
%67 = icmp sgt i32 %66, 0
br i1 %67, label %246, label %242
68: ; preds = %55
%69 = tail call i64 @piececount(i32* %0, i32 0, i32 18)
%70 = icmp eq i64 %69, 0
br i1 %70, label %71, label %246
71: ; preds = %68
%72 = load i32, i32* @j
%73 = load i32, i32* @die2
%74 = add nsw i32 %73, %72
%75 = icmp eq i32 %74, 25
br i1 %75, label %82, label %76
76: ; preds = %71
%77 = sub nsw i32 24, %73
%78 = tail call i64 @piececount(i32* %0, i32 19, i32 %77)
%79 = icmp eq i64 %78, 0
br i1 %79, label %80, label %246
80: ; preds = %76
%81 = load i32, i32* @j
br label %82
82: ; preds = %80, %60, %71
%83 = phi i32 [ %81, %80 ], [ %50, %60 ], [ %72, %71 ]
%84 = sext i32 %83 to i64
%85 = getelementptr inbounds i32, i32* %0, i64 %84
%86 = load i32, i32* %85
%87 = add nsw i32 %86, -1
store i32 %87, i32* %85
%88 = load i32, i32* @j
%89 = load i32, i32* @die2
%90 = add nsw i32 %89, %88
%91 = sext i32 %90 to i64
%92 = getelementptr inbounds i32, i32* %0, i64 %91
%93 = load i32, i32* %92
%94 = add nsw i32 %93, 1
store i32 %94, i32* %92
store i32 2, i32* @count
%95 = load i32, i32* @die1
%96 = load i32, i32* @die2
%97 = icmp eq i32 %95, %96
br i1 %97, label %98, label %99
98: ; preds = %82
store i32 0, i32* @l
br label %103
99: ; preds = %82
%100 = tail call i32 @moverecord(i32* %0)
%101 = load i32, i32* %0
%102 = icmp sgt i32 %101, 0
br i1 %102, label %246, label %242
103: ; preds = %98, %217
%104 = phi i32 [ 0, %98 ], [ %219, %217 ]
%105 = sext i32 %104 to i64
%106 = getelementptr inbounds i32, i32* %0, i64 %105
%107 = load i32, i32* %106
%108 = icmp eq i32 %107, 0
br i1 %108, label %217, label %109
109: ; preds = %103
%110 = load i32, i32* @die1
%111 = add i32 %104, %110
%112 = sub i32 25, %111
%113 = icmp sgt i32 %112, 0
br i1 %113, label %114, label %122
114: ; preds = %109
%115 = zext i32 %112 to i64
%116 = getelementptr inbounds i32, i32* %1, i64 %115
%117 = load i32, i32* %116
%118 = icmp sgt i32 %117, 1
br i1 %118, label %119, label %137
119: ; preds = %114
%120 = load i32, i32* %0
%121 = icmp sgt i32 %120, 0
br i1 %121, label %221, label %217
122: ; preds = %109
%123 = tail call i64 @piececount(i32* %0, i32 0, i32 18)
%124 = icmp eq i64 %123, 0
br i1 %124, label %125, label %221
125: ; preds = %122
%126 = load i32, i32* @l
%127 = load i32, i32* @die2
%128 = add nsw i32 %127, %126
%129 = icmp eq i32 %128, 25
br i1 %129, label %137, label %130
130: ; preds = %125
%131 = load i32, i32* @die1
%132 = sub nsw i32 24, %131
%133 = tail call i64 @piececount(i32* %0, i32 19, i32 %132)
%134 = icmp eq i64 %133, 0
br i1 %134, label %135, label %221
135: ; preds = %130
%136 = load i32, i32* @l
br label %137
137: ; preds = %135, %114, %125
%138 = phi i32 [ %136, %135 ], [ %104, %114 ], [ %126, %125 ]
%139 = sext i32 %138 to i64
%140 = getelementptr inbounds i32, i32* %0, i64 %139
%141 = load i32, i32* %140
%142 = add nsw i32 %141, -1
store i32 %142, i32* %140
%143 = load i32, i32* @l
%144 = load i32, i32* @die1
%145 = add nsw i32 %144, %143
%146 = sext i32 %145 to i64
%147 = getelementptr inbounds i32, i32* %0, i64 %146
%148 = load i32, i32* %147
%149 = add nsw i32 %148, 1
store i32 %149, i32* %147
store i32 3, i32* @count
store i32 0, i32* @m
br label %150
150: ; preds = %137, %190
%151 = phi i32 [ 0, %137 ], [ %192, %190 ]
%152 = sext i32 %151 to i64
%153 = getelementptr inbounds i32, i32* %0, i64 %152
%154 = load i32, i32* %153
%155 = icmp eq i32 %154, 0
br i1 %155, label %190, label %156
156: ; preds = %150
%157 = load i32, i32* @die1
%158 = add i32 %157, %151
%159 = sub i32 25, %158
%160 = icmp sgt i32 %159, -1
br i1 %160, label %161, label %171
161: ; preds = %156
%162 = zext i32 %159 to i64
%163 = getelementptr inbounds i32, i32* %1, i64 %162
%164 = load i32, i32* %163
%165 = icmp sgt i32 %164, 1
br i1 %165, label %166, label %169
166: ; preds = %161
%167 = load i32, i32* %0
%168 = icmp sgt i32 %167, 0
br i1 %168, label %194, label %190
169: ; preds = %161
%170 = icmp eq i32 %158, 25
br i1 %170, label %171, label %184
171: ; preds = %156, %169
%172 = tail call i64 @piececount(i32* %0, i32 0, i32 18)
%173 = icmp eq i64 %172, 0
br i1 %173, label %174, label %194
174: ; preds = %171
%175 = load i32, i32* @m
%176 = load i32, i32* @die2
%177 = add nsw i32 %176, %175
%178 = icmp eq i32 %177, 25
br i1 %178, label %184, label %179
179: ; preds = %174
%180 = load i32, i32* @die1
%181 = sub nsw i32 24, %180
%182 = tail call i64 @piececount(i32* %0, i32 19, i32 %181)
%183 = icmp eq i64 %182, 0
br i1 %183, label %184, label %194
184: ; preds = %174, %179, %169
store i32 4, i32* @count
%185 = tail call i32 @moverecord(i32* %0)
%186 = load i32, i32* %0
%187 = icmp sgt i32 %186, 0
br i1 %187, label %194, label %188
188: ; preds = %184
%189 = load i32, i32* @m
br label %190
190: ; preds = %188, %166, %150
%191 = phi i32 [ %189, %188 ], [ %151, %166 ], [ %151, %150 ]
%192 = add nsw i32 %191, 1
store i32 %192, i32* @m
%193 = icmp slt i32 %191, 24
br i1 %193, label %150, label %194
194: ; preds = %184, %179, %171, %166, %190
%195 = load i32, i32* @count
%196 = icmp eq i32 %195, 3
br i1 %196, label %197, label %199
197: ; preds = %194
%198 = tail call i32 @moverecord(i32* %0)
br label %212
199: ; preds = %194
%200 = load i32, i32* @l
%201 = sext i32 %200 to i64
%202 = getelementptr inbounds i32, i32* %0, i64 %201
%203 = load i32, i32* %202
%204 = add nsw i32 %203, 1
store i32 %204, i32* %202
%205 = load i32, i32* @l
%206 = load i32, i32* @die1
%207 = add nsw i32 %206, %205
%208 = sext i32 %207 to i64
%209 = getelementptr inbounds i32, i32* %0, i64 %208
%210 = load i32, i32* %209
%211 = add nsw i32 %210, -1
store i32 %211, i32* %209
br label %212
212: ; preds = %199, %197
%213 = load i32, i32* %0
%214 = icmp sgt i32 %213, 0
br i1 %214, label %221, label %215
215: ; preds = %212
%216 = load i32, i32* @l
br label %217
217: ; preds = %215, %119, %103
%218 = phi i32 [ %216, %215 ], [ %104, %119 ], [ %104, %103 ]
%219 = add nsw i32 %218, 1
store i32 %219, i32* @l
%220 = icmp slt i32 %218, 24
br i1 %220, label %103, label %221
221: ; preds = %212, %130, %122, %119, %217
%222 = load i32, i32* @count
%223 = icmp eq i32 %222, 2
br i1 %223, label %224, label %226
224: ; preds = %221
%225 = tail call i32 @moverecord(i32* %0)
br label %239
226: ; preds = %221
%227 = load i32, i32* @j
%228 = sext i32 %227 to i64
%229 = getelementptr inbounds i32, i32* %0, i64 %228
%230 = load i32, i32* %229
%231 = add nsw i32 %230, 1
store i32 %231, i32* %229
%232 = load i32, i32* @j
%233 = load i32, i32* @die1
%234 = add nsw i32 %233, %232
%235 = sext i32 %234 to i64
%236 = getelementptr inbounds i32, i32* %0, i64 %235
%237 = load i32, i32* %236
%238 = add nsw i32 %237, -1
store i32 %238, i32* %236
br label %239
239: ; preds = %226, %224
%240 = load i32, i32* %0
%241 = icmp sgt i32 %240, 0
br i1 %241, label %246, label %242
242: ; preds = %239, %99, %65, %49
%243 = load i32, i32* @j
%244 = add nsw i32 %243, 1
store i32 %244, i32* @j
%245 = icmp slt i32 %243, 24
br i1 %245, label %49, label %246
246: ; preds = %239, %99, %76, %68, %65, %242
%247 = load i32, i32* @count
%248 = icmp eq i32 %247, 1
br i1 %248, label %249, label %251
249: ; preds = %246
%250 = tail call i32 @moverecord(i32* %0)
br label %264
251: ; preds = %246
%252 = load i32, i32* @i
%253 = sext i32 %252 to i64
%254 = getelementptr inbounds i32, i32* %0, i64 %253
%255 = load i32, i32* %254
%256 = add nsw i32 %255, 1
store i32 %256, i32* %254
%257 = load i32, i32* @i
%258 = load i32, i32* @die1
%259 = add nsw i32 %258, %257
%260 = sext i32 %259 to i64
%261 = getelementptr inbounds i32, i32* %0, i64 %260
%262 = load i32, i32* %261
%263 = add nsw i32 %262, -1
store i32 %263, i32* %261
br label %264
264: ; preds = %251, %249
%265 = load i32, i32* %0
%266 = icmp sgt i32 %265, 0
br i1 %266, label %273, label %267
267: ; preds = %264
%268 = load i32, i32* @i
br label %269
269: ; preds = %267, %19, %3
%270 = phi i32 [ %268, %267 ], [ %4, %19 ], [ %4, %3 ]
%271 = add nsw i32 %270, 1
store i32 %271, i32* @i
%272 = icmp slt i32 %270, 24
br i1 %272, label %3, label %273
273: ; preds = %264, %30, %22, %19, %269
ret void
}