// File: /workspace/github_c_makefile_star2_O0/ArchLuke[P]YouSuck/Engine.c
// Function: MovePiece
static
void MovePiece(const int from, const int to, S_BOARD *pos) {

    int index = 0;
    int pce = pos->pieces[from];    
    int col = PieceCol[pce];
    
    int t_PieceNum = FALSE;

    HASH_PCE(pce,from);
    pos->pieces[from] = EMPTY;
    
    HASH_PCE(pce,to);
    pos->pieces[to] = pce;
    
    if(!PieceBig[pce]) {
        CLRBIT(pos->pawns[col],SQ64(from));
        CLRBIT(pos->pawns[BOTH],SQ64(from));
        SETBIT(pos->pawns[col],SQ64(to));
        SETBIT(pos->pawns[BOTH],SQ64(to));        
    }    
    
    for(index = 0; index < pos->pceNum[pce]; ++index) {
        if(pos->pList[pce][index] == from) {
            pos->pList[pce][index] = to;
            t_PieceNum = TRUE;
            break;
        }
    }
}

// Assembly:
movl %edi, -0x4(%rsp)
movl %esi, -0x8(%rsp)
movq %rdx, -0x10(%rsp)
movl $0x0, -0x14(%rsp)
movq -0x10(%rsp), %rax
movslq -0x4(%rsp), %rcx
movl (%rax,%rcx,4), %eax
movl %eax, -0x18(%rsp)
movslq -0x18(%rsp), %rcx
leaq 0x5bee(%rip), %rax      # 0xb360
movl (%rax,%rcx,4), %eax
movl %eax, -0x1c(%rsp)
movl $0x0, -0x20(%rsp)
movslq -0x18(%rsp), %rcx
leaq 0x22903(%rip), %rax     # 0x28090
imulq $0x3c0, %rcx, %rcx      # imm = 0x3C0
addq %rcx, %rax
movslq -0x4(%rsp), %rcx
movq (%rax,%rcx,8), %rcx
movq -0x10(%rsp), %rax
xorq 0x220(%rax), %rcx
movq %rcx, 0x220(%rax)
movq -0x10(%rsp), %rax
movslq -0x4(%rsp), %rcx
movl $0x0, (%rax,%rcx,4)
movslq -0x18(%rsp), %rcx
leaq 0x228c0(%rip), %rax     # 0x28090
imulq $0x3c0, %rcx, %rcx      # imm = 0x3C0
addq %rcx, %rax
movslq -0x8(%rsp), %rcx
movq (%rax,%rcx,8), %rcx
movq -0x10(%rsp), %rax
xorq 0x220(%rax), %rcx
movq %rcx, 0x220(%rax)
movl -0x18(%rsp), %edx
movq -0x10(%rsp), %rax
movslq -0x8(%rsp), %rcx
movl %edx, (%rax,%rcx,4)
movslq -0x18(%rsp), %rcx
leaq 0x613d(%rip), %rax      # 0xb950
cmpl $0x0, (%rax,%rcx,4)
jne 0x58e3
movslq -0x4(%rsp), %rcx
leaq 0xa097(%rip), %rax      # 0xf8c0
movslq (%rax,%rcx,4), %rcx
leaq 0x220fc(%rip), %rax     # 0x27930
movq (%rax,%rcx,8), %rdx
movq -0x10(%rsp), %rax
movslq -0x1c(%rsp), %rcx
andq 0x1e0(%rax,%rcx,8), %rdx
movq %rdx, 0x1e0(%rax,%rcx,8)
movslq -0x4(%rsp), %rcx
leaq 0xa062(%rip), %rax      # 0xf8c0
movslq (%rax,%rcx,4), %rcx
leaq 0x220c7(%rip), %rax     # 0x27930
movq (%rax,%rcx,8), %rcx
movq -0x10(%rsp), %rax
andq 0x1f0(%rax), %rcx
movq %rcx, 0x1f0(%rax)
movslq -0x8(%rsp), %rcx
leaq 0xa034(%rip), %rax      # 0xf8c0
movslq (%rax,%rcx,4), %rcx
leaq 0x22299(%rip), %rax     # 0x27b30
movq (%rax,%rcx,8), %rdx
movq -0x10(%rsp), %rax
movslq -0x1c(%rsp), %rcx
orq 0x1e0(%rax,%rcx,8), %rdx
movq %rdx, 0x1e0(%rax,%rcx,8)
movslq -0x8(%rsp), %rcx
leaq 0x9fff(%rip), %rax      # 0xf8c0
movslq (%rax,%rcx,4), %rcx
leaq 0x22264(%rip), %rax     # 0x27b30
movq (%rax,%rcx,8), %rcx
movq -0x10(%rsp), %rax
orq 0x1f0(%rax), %rcx
movq %rcx, 0x1f0(%rax)
movl $0x0, -0x14(%rsp)
movl -0x14(%rsp), %eax
movq -0x10(%rsp), %rcx
movslq -0x18(%rsp), %rdx
cmpl 0x228(%rcx,%rdx,4), %eax
jge 0x5963
movq -0x10(%rsp), %rax
addq $0xc270, %rax           # imm = 0xC270
movslq -0x18(%rsp), %rcx
imulq $0x28, %rcx, %rcx
addq %rcx, %rax
movslq -0x14(%rsp), %rcx
movl (%rax,%rcx,4), %eax
cmpl -0x4(%rsp), %eax
jne 0x5954
movl -0x8(%rsp), %edx
movq -0x10(%rsp), %rax
addq $0xc270, %rax           # imm = 0xC270
movslq -0x18(%rsp), %rcx
imulq $0x28, %rcx, %rcx
addq %rcx, %rax
movslq -0x14(%rsp), %rcx
movl %edx, (%rax,%rcx,4)
movl $0x1, -0x20(%rsp)
jmp 0x5963
jmp 0x5956
movl -0x14(%rsp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rsp)
jmp 0x58eb
retq
nopw %cs:(%rax,%rax)