// File: /workspace/github_c_makefile_star2_O0/ArchLuke[P]YouSuck/Engine.c
// Function: UpdateListsMaterial
static
void UpdateListsMaterial(S_BOARD *pos) {    
    
    int piece,sq,index,colour;
    
    for(index = 0; index < BRD_SQ_NUM; ++index) {
        sq = index;
        piece = pos->pieces[index];
        if(piece!=OFFBOARD && piece!= EMPTY) {
            colour = PieceCol[piece];
            
            if( PieceBig[piece] == TRUE) pos->bigPce[colour]++;
            if(piece==wK) pos->KingSq[WHITE] = sq;
            else if(piece==bK) pos->KingSq[BLACK] = sq;    
            else
                pos->material[colour] += PieceVal[piece];
            
            pos->pList[piece][pos->pceNum[piece]] = sq;
            pos->pceNum[piece]++;
            
                    
            if(piece==wP) {
                SETBIT(pos->pawns[WHITE],SQ64(sq));
                SETBIT(pos->pawns[BOTH],SQ64(sq));
            } else if(piece==bP) {
                SETBIT(pos->pawns[BLACK],SQ64(sq));
                SETBIT(pos->pawns[BOTH],SQ64(sq));
            }
        }
    }
}

// Assembly:
movq %rdi, -0x8(%rsp)
movl $0x0, -0x14(%rsp)
cmpl $0x78, -0x14(%rsp)
jge 0x45d9
movl -0x14(%rsp), %eax
movl %eax, -0x10(%rsp)
movq -0x8(%rsp), %rax
movslq -0x14(%rsp), %rcx
movl (%rax,%rcx,4), %eax
movl %eax, -0xc(%rsp)
cmpl $0x64, -0xc(%rsp)
je 0x45c7
cmpl $0x0, -0xc(%rsp)
je 0x45c7
movslq -0xc(%rsp), %rcx
leaq 0x6f3d(%rip), %rax      # 0xb360
movl (%rax,%rcx,4), %eax
movl %eax, -0x18(%rsp)
movslq -0xc(%rsp), %rcx
leaq 0x751a(%rip), %rax      # 0xb950
cmpl $0x1, (%rax,%rcx,4)
jne 0x4457
movq -0x8(%rsp), %rax
movslq -0x18(%rsp), %rcx
movl 0x25c(%rax,%rcx,4), %edx
addl $0x1, %edx
movl %edx, 0x25c(%rax,%rcx,4)
cmpl $0x6, -0xc(%rsp)
jne 0x446f
movl -0x10(%rsp), %ecx
movq -0x8(%rsp), %rax
movl %ecx, 0x1f8(%rax)
jmp 0x44b0
cmpl $0xc, -0xc(%rsp)
jne 0x4487
movl -0x10(%rsp), %ecx
movq -0x8(%rsp), %rax
movl %ecx, 0x1fc(%rax)
jmp 0x44ae
movslq -0xc(%rsp), %rcx
leaq 0x6f0d(%rip), %rax      # 0xb3a0
movl (%rax,%rcx,4), %edx
movq -0x8(%rsp), %rax
movslq -0x18(%rsp), %rcx
addl 0x264(%rax,%rcx,4), %edx
movl %edx, 0x264(%rax,%rcx,4)
jmp 0x44b0
movl -0x10(%rsp), %edx
movq -0x8(%rsp), %rax
addq $0xc270, %rax           # imm = 0xC270
movslq -0xc(%rsp), %rcx
imulq $0x28, %rcx, %rcx
addq %rcx, %rax
movq -0x8(%rsp), %rcx
movslq -0xc(%rsp), %rsi
movslq 0x228(%rcx,%rsi,4), %rcx
movl %edx, (%rax,%rcx,4)
movq -0x8(%rsp), %rax
movslq -0xc(%rsp), %rcx
movl 0x228(%rax,%rcx,4), %edx
addl $0x1, %edx
movl %edx, 0x228(%rax,%rcx,4)
cmpl $0x1, -0xc(%rsp)
jne 0x4560
movslq -0x10(%rsp), %rcx
leaq 0xb3b2(%rip), %rax      # 0xf8c0
movslq (%rax,%rcx,4), %rcx
leaq 0x23617(%rip), %rax     # 0x27b30
movq (%rax,%rcx,8), %rcx
movq -0x8(%rsp), %rax
orq 0x1e0(%rax), %rcx
movq %rcx, 0x1e0(%rax)
movslq -0x10(%rsp), %rcx
leaq 0xb384(%rip), %rax      # 0xf8c0
movslq (%rax,%rcx,4), %rcx
leaq 0x235e9(%rip), %rax     # 0x27b30
movq (%rax,%rcx,8), %rcx
movq -0x8(%rsp), %rax
orq 0x1f0(%rax), %rcx
movq %rcx, 0x1f0(%rax)
jmp 0x45c5
cmpl $0x7, -0xc(%rsp)
jne 0x45c3
movslq -0x10(%rsp), %rcx
leaq 0xb34d(%rip), %rax      # 0xf8c0
movslq (%rax,%rcx,4), %rcx
leaq 0x235b2(%rip), %rax     # 0x27b30
movq (%rax,%rcx,8), %rcx
movq -0x8(%rsp), %rax
orq 0x1e8(%rax), %rcx
movq %rcx, 0x1e8(%rax)
movslq -0x10(%rsp), %rcx
leaq 0xb31f(%rip), %rax      # 0xf8c0
movslq (%rax,%rcx,4), %rcx
leaq 0x23584(%rip), %rax     # 0x27b30
movq (%rax,%rcx,8), %rcx
movq -0x8(%rsp), %rax
orq 0x1f0(%rax), %rcx
movq %rcx, 0x1f0(%rax)
jmp 0x45c5
jmp 0x45c7
jmp 0x45c9
movl -0x14(%rsp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rsp)
jmp 0x43dd
retq
nopw (%rax,%rax)