// File: /workspace/github_cpp_makefile_star2_O2/jswaff[P]prophet3/test/search__test.cpp
// Function: test_draw_50()
void test_draw_50() {
    position pos;
    // minus one rook, to ensure not draw by eval
    set_pos(&pos,"rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/1NBQKBNR w Kkq - 0 1");
    clear_hash_table(&htbl);

    move_line pv; pv.n=0;
    search_stats stats; stats.nodes=0; stats.last_pv.n=0;
    start_timer(10000);

    set_abort_search(false);
    int32 score = search(&pos,&pv,-INF,INF,2,&stats,move_stack,gundos,false);
    assert(score != DRAWSCORE);

    // up to 99 (half) moves ... the extra comes from the root search
    pos.fifty_counter = pos.move_counter= 98;
    start_timer(10000);
    clear_hash_table(&htbl);
    score = search(&pos,&pv,-INF,INF,2,&stats,move_stack,gundos,false);
    assert(score != DRAWSCORE);

    // trigger 50 move rule
    pos.fifty_counter = pos.move_counter = 99;
    start_timer(10000);
    clear_hash_table(&htbl);
    score = search(&pos,&pv,-INF,INF,2,&stats,move_stack,gundos,false);
    assert(score == DRAWSCORE);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xb70, %rsp            # imm = 0xB70
leaq 0x11f32(%rip), %rsi     # 0x34cab
movq %rsp, %rbx
movq %rbx, %rdi
callq 0xa1b8
leaq 0xd8165(%rip), %rdi     # 0xfaef0
callq 0x5dd9
leaq 0x1c8(%rsp), %r14
andl $0x0, (%r14)
leaq 0x4f0(%rsp), %r15
andq $0x0, 0x18(%r15)
andl $0x0, 0x28(%r15)
movl $0x2710, %edi           # imm = 0x2710
callq 0x22420
xorl %edi, %edi
callq 0xa94e
subq $0x8, %rsp
leaq 0xa8d26(%rip), %r13     # 0xcbaf0
leaq 0x895fef(%rip), %r12    # 0x8b8dc0
pushq $0x2
popq %r8
movq %rbx, %rdi
movq %r14, %rsi
movl $0xfffcf2c0, %edx       # imm = 0xFFFCF2C0
movl $0x30d40, %ecx          # imm = 0x30D40
movq %r15, %r9
pushq $0x0
pushq %r13
pushq %r12
callq 0xaa1d
addq $0x20, %rsp
testl %eax, %eax
je 0x22ed8
movabsq $0x6200000062, %rax     # imm = 0x6200000062
movq %rsp, %rbx
movq %rax, 0x144(%rbx)
movl $0x2710, %edi           # imm = 0x2710
callq 0x22420
leaq 0xd80cc(%rip), %rdi     # 0xfaef0
callq 0x5dd9
subq $0x8, %rsp
leaq 0x1d0(%rsp), %rsi
pushq $0x2
popq %r8
leaq 0x4f8(%rsp), %r9
movq %rbx, %rdi
movl $0xfffcf2c0, %edx       # imm = 0xFFFCF2C0
movl $0x30d40, %ecx          # imm = 0x30D40
pushq $0x0
pushq %r13
pushq %r12
callq 0xaa1d
addq $0x20, %rsp
testl %eax, %eax
je 0x22ef7
movabsq $0x6300000063, %rax     # imm = 0x6300000063
movq %rsp, %rbx
movq %rax, 0x144(%rbx)
movl $0x2710, %edi           # imm = 0x2710
callq 0x22420
leaq 0xd8066(%rip), %rdi     # 0xfaef0
callq 0x5dd9
subq $0x8, %rsp
leaq 0x1d0(%rsp), %rsi
pushq $0x2
popq %r8
leaq 0x4f8(%rsp), %r9
movq %rbx, %rdi
movl $0xfffcf2c0, %edx       # imm = 0xFFFCF2C0
movl $0x30d40, %ecx          # imm = 0x30D40
pushq $0x0
pushq %r13
pushq %r12
callq 0xaa1d
addq $0x20, %rsp
testl %eax, %eax
jne 0x22f16
addq $0xb70, %rsp            # imm = 0xB70
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
leaq 0x11e04(%rip), %rdi     # 0x34ce3
leaq 0x11b2f(%rip), %rsi     # 0x34a15
leaq 0x11e09(%rip), %rcx     # 0x34cf6
movl $0xd2, %edx
callq 0x20c0
leaq 0x11de5(%rip), %rdi     # 0x34ce3
leaq 0x11b10(%rip), %rsi     # 0x34a15
leaq 0x11dea(%rip), %rcx     # 0x34cf6
movl $0xd9, %edx
callq 0x20c0
leaq 0x11ded(%rip), %rdi     # 0x34d0a
leaq 0x11af1(%rip), %rsi     # 0x34a15
leaq 0x11dcb(%rip), %rcx     # 0x34cf6
movl $0xe0, %edx
callq 0x20c0