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

    
    int pce = pos->pieces[sq];
    
    
    int col = PieceCol[pce];
    int index = 0;
    int t_pceNum = -1;
    
    HASH_PCE(pce,sq);
    
    pos->pieces[sq] = EMPTY;
    pos->material[col] -= PieceVal[pce];
    
    if(PieceBig[pce]) {
        pos->bigPce[col]--;
        
    } else {
        CLRBIT(pos->pawns[col],SQ64(sq));
        CLRBIT(pos->pawns[BOTH],SQ64(sq));
    }
    
    for(index = 0; index < pos->pceNum[pce]; ++index) {
        if(pos->pList[pce][index] == sq) {
            t_pceNum = index;
            break;
        }
    }
    
    
    pos->pceNum[pce]--;        
    
    pos->pList[pce][t_pceNum] = pos->pList[pce][pos->pceNum[pce]];
 
}

// Assembly:
movl %edi, -0x4(%rsp)
movq %rsi, -0x10(%rsp)
movq -0x10(%rsp), %rax
movslq -0x4(%rsp), %rcx
movl (%rax,%rcx,4), %eax
movl %eax, -0x14(%rsp)
movslq -0x14(%rsp), %rcx
leaq 0x5dfa(%rip), %rax      # 0xb360
movl (%rax,%rcx,4), %eax
movl %eax, -0x18(%rsp)
movl $0x0, -0x1c(%rsp)
movl $0xffffffff, -0x20(%rsp) # imm = 0xFFFFFFFF
movslq -0x14(%rsp), %rcx
leaq 0x22b07(%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 -0x14(%rsp), %rcx
leaq 0x5dd4(%rip), %rax      # 0xb3a0
movl (%rax,%rcx,4), %esi
movq -0x10(%rsp), %rax
movslq -0x18(%rsp), %rcx
movl 0x264(%rax,%rcx,4), %edx
subl %esi, %edx
movl %edx, 0x264(%rax,%rcx,4)
movslq -0x14(%rsp), %rcx
leaq 0x635b(%rip), %rax      # 0xb950
cmpl $0x0, (%rax,%rcx,4)
je 0x5618
movq -0x10(%rsp), %rax
movslq -0x18(%rsp), %rcx
movl 0x25c(%rax,%rcx,4), %edx
addl $-0x1, %edx
movl %edx, 0x25c(%rax,%rcx,4)
jmp 0x567b
movslq -0x4(%rsp), %rcx
leaq 0xa29c(%rip), %rax      # 0xf8c0
movslq (%rax,%rcx,4), %rcx
leaq 0x22301(%rip), %rax     # 0x27930
movq (%rax,%rcx,8), %rdx
movq -0x10(%rsp), %rax
movslq -0x18(%rsp), %rcx
andq 0x1e0(%rax,%rcx,8), %rdx
movq %rdx, 0x1e0(%rax,%rcx,8)
movslq -0x4(%rsp), %rcx
leaq 0xa267(%rip), %rax      # 0xf8c0
movslq (%rax,%rcx,4), %rcx
leaq 0x222cc(%rip), %rax     # 0x27930
movq (%rax,%rcx,8), %rcx
movq -0x10(%rsp), %rax
andq 0x1f0(%rax), %rcx
movq %rcx, 0x1f0(%rax)
movl $0x0, -0x1c(%rsp)
movl -0x1c(%rsp), %eax
movq -0x10(%rsp), %rcx
movslq -0x14(%rsp), %rdx
cmpl 0x228(%rcx,%rdx,4), %eax
jge 0x56d8
movq -0x10(%rsp), %rax
addq $0xc270, %rax           # imm = 0xC270
movslq -0x14(%rsp), %rcx
imulq $0x28, %rcx, %rcx
addq %rcx, %rax
movslq -0x1c(%rsp), %rcx
movl (%rax,%rcx,4), %eax
cmpl -0x4(%rsp), %eax
jne 0x56c9
movl -0x1c(%rsp), %eax
movl %eax, -0x20(%rsp)
jmp 0x56d8
jmp 0x56cb
movl -0x1c(%rsp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rsp)
jmp 0x5683
movq -0x10(%rsp), %rax
movslq -0x14(%rsp), %rcx
movl 0x228(%rax,%rcx,4), %edx
addl $-0x1, %edx
movl %edx, 0x228(%rax,%rcx,4)
movq -0x10(%rsp), %rax
addq $0xc270, %rax           # imm = 0xC270
movslq -0x14(%rsp), %rcx
imulq $0x28, %rcx, %rcx
addq %rcx, %rax
movq -0x10(%rsp), %rcx
movslq -0x14(%rsp), %rdx
movslq 0x228(%rcx,%rdx,4), %rcx
movl (%rax,%rcx,4), %edx
movq -0x10(%rsp), %rax
addq $0xc270, %rax           # imm = 0xC270
movslq -0x14(%rsp), %rcx
imulq $0x28, %rcx, %rcx
addq %rcx, %rax
movslq -0x20(%rsp), %rcx
movl %edx, (%rax,%rcx,4)
retq
nop