// File: /workspace/github_c_makefile_star2_O0/ArchLuke[P]YouSuck/Engine.c
// Function: Quiescence
static
int Quiescence(int alpha, int beta, S_BOARD *pos, S_SEARCHINFO *info) {
if(( info->nodes & 2047 ) == 0) {
        CheckUp(info);
    }
    
    info->nodes++;
    
    if(IsRepetition(pos) || pos->fiftyMove >= 100) {
        return 0;
    }
    
    if(pos->ply > MAXDEPTH - 1) {
        return EvalPosition(pos);
    }
    
    int Score = EvalPosition(pos);
    
    if(Score >= beta) {
        return beta;
    }
    
    if(Score > alpha) {
        alpha = Score;
    }
    
    S_MOVELIST list[1];
        GenerateAllMoves(pos,list,TRUE);
      
        int MoveNum = 0;
    int Legal = 0;
    int OldAlpha = alpha;
    int BestMove = NOMOVE;
    Score = -INFINITE;
    
    for(MoveNum = 0; MoveNum < list->count; ++MoveNum) {    
            
        PickNextMove(MoveNum, list);    
        
        if ( !MakeMove(pos,list->moves[MoveNum].move))  {
            continue;
        }
        
        Legal++;
        Score = -Quiescence( -beta, -alpha, pos, info);        
        TakeMove(pos);
        
        if(info->stopped == TRUE) {
            return 0;
        }
        
        if(Score > alpha) {
            if(Score >= beta) {
                if(Legal==1) {
                    info->fhf++;
                }
                info->fh++;    
                return beta;
            }
            alpha = Score;
            BestMove = list->moves[MoveNum].move;
        }        
    }
    
    return alpha;
}

// Assembly:
subq $0x838, %rsp            # imm = 0x838
movl %edi, 0x830(%rsp)
movl %esi, 0x82c(%rsp)
movq %rdx, 0x820(%rsp)
movq %rcx, 0x818(%rsp)
movq 0x818(%rsp), %rax
movq 0x18(%rax), %rax
andq $0x7ff, %rax            # imm = 0x7FF
cmpq $0x0, %rax
jne 0x71ca
movq 0x818(%rsp), %rdi
callq 0x7440
movq 0x818(%rsp), %rax
movq 0x18(%rax), %rcx
addq $0x1, %rcx
movq %rcx, 0x18(%rax)
movq 0x820(%rsp), %rdi
callq 0x7480
cmpl $0x0, %eax
jne 0x7201
movq 0x820(%rsp), %rax
cmpl $0x64, 0x208(%rax)
jl 0x7211
movl $0x0, 0x834(%rsp)
jmp 0x742a
movq 0x820(%rsp), %rax
cmpl $0x3f, 0x20c(%rax)
jle 0x723b
movq 0x820(%rsp), %rdi
callq 0x7510
movl %eax, 0x834(%rsp)
jmp 0x742a
movq 0x820(%rsp), %rdi
callq 0x7510
movl %eax, 0x814(%rsp)
movl 0x814(%rsp), %eax
cmpl 0x82c(%rsp), %eax
jl 0x7272
movl 0x82c(%rsp), %eax
movl %eax, 0x834(%rsp)
jmp 0x742a
movl 0x814(%rsp), %eax
cmpl 0x830(%rsp), %eax
jle 0x7290
movl 0x814(%rsp), %eax
movl %eax, 0x830(%rsp)
movq 0x820(%rsp), %rdi
leaq 0x10(%rsp), %rsi
movl $0x1, %edx
callq 0x45e0
movl $0x0, 0xc(%rsp)
movl $0x0, 0x8(%rsp)
movl 0x830(%rsp), %eax
movl %eax, 0x4(%rsp)
movl $0x0, (%rsp)
movl $0xffff8ad0, 0x814(%rsp) # imm = 0xFFFF8AD0
movl $0x0, 0xc(%rsp)
movl 0xc(%rsp), %eax
cmpl 0x810(%rsp), %eax
jge 0x741c
movl 0xc(%rsp), %edi
leaq 0x10(%rsp), %rsi
callq 0x7b70
movq 0x820(%rsp), %rdi
movslq 0xc(%rsp), %rax
movl 0x10(%rsp,%rax,8), %esi
callq 0x3c20
cmpl $0x0, %eax
jne 0x731b
jmp 0x740c
movl 0x8(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x8(%rsp)
xorl %edi, %edi
subl 0x82c(%rsp), %edi
xorl %esi, %esi
subl 0x830(%rsp), %esi
movq 0x820(%rsp), %rdx
movq 0x818(%rsp), %rcx
callq 0x7180
movl %eax, %ecx
xorl %eax, %eax
subl %ecx, %eax
movl %eax, 0x814(%rsp)
movq 0x820(%rsp), %rdi
callq 0x5ad0
movq 0x818(%rsp), %rax
cmpl $0x1, 0x20(%rax)
jne 0x7385
movl $0x0, 0x834(%rsp)
jmp 0x742a
movl 0x814(%rsp), %eax
cmpl 0x830(%rsp), %eax
jle 0x740a
movl 0x814(%rsp), %eax
cmpl 0x82c(%rsp), %eax
jl 0x73f0
cmpl $0x1, 0x8(%rsp)
jne 0x73c6
movq 0x818(%rsp), %rax
movss 0x4808(%rip), %xmm0     # 0xbbc4
addss 0x28(%rax), %xmm0
movss %xmm0, 0x28(%rax)
movq 0x818(%rsp), %rax
movss 0x47ee(%rip), %xmm0     # 0xbbc4
addss 0x24(%rax), %xmm0
movss %xmm0, 0x24(%rax)
movl 0x82c(%rsp), %eax
movl %eax, 0x834(%rsp)
jmp 0x742a
movl 0x814(%rsp), %eax
movl %eax, 0x830(%rsp)
movslq 0xc(%rsp), %rax
movl 0x10(%rsp,%rax,8), %eax
movl %eax, (%rsp)
jmp 0x740c
movl 0xc(%rsp), %eax
addl $0x1, %eax
movl %eax, 0xc(%rsp)
jmp 0x72dc
movl 0x830(%rsp), %eax
movl %eax, 0x834(%rsp)
movl 0x834(%rsp), %eax
addq $0x838, %rsp            # imm = 0x838
retq
nopl (%rax)