// File: /workspace/github_cpp_makefile_star2_O1/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 %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xb78, %rsp            # imm = 0xB78
leaq 0x11b42(%rip), %rsi     # 0x36b67
leaq 0x8(%rsp), %rbx
movq %rbx, %rdi
callq 0xaa74
leaq 0xd2eb7(%rip), %rdi     # 0xf7ef0
callq 0x6207
xorl %ebp, %ebp
leaq 0x1d0(%rsp), %r14
movl %ebp, (%r14)
leaq 0x4f8(%rsp), %r15
movq $0x0, 0x18(%r15)
movl %ebp, 0x28(%r15)
movl $0x2710, %edi           # imm = 0x2710
callq 0x24650
xorl %edi, %edi
callq 0xb2be
subq $0x8, %rsp
leaq 0xa3a75(%rip), %r13     # 0xc8af0
leaq 0x890d3e(%rip), %r12    # 0x8b5dc0
movq %rbx, %rdi
movq %r14, %rsi
movl $0xfffcf2c0, %edx       # imm = 0xFFFCF2C0
movl $0x30d40, %ecx          # imm = 0x30D40
movl $0x2, %r8d
movq %r15, %r9
pushq %rbp
pushq %r13
pushq %r12
callq 0xb398
addq $0x20, %rsp
testl %eax, %eax
je 0x25193
movabsq $0x6200000062, %rax     # imm = 0x6200000062
leaq 0x8(%rsp), %rbx
movq %rax, 0x144(%rbx)
movl $0x2710, %edi           # imm = 0x2710
callq 0x24650
leaq 0xd2e18(%rip), %rdi     # 0xf7ef0
callq 0x6207
subq $0x8, %rsp
leaq 0x1d8(%rsp), %rsi
leaq 0x500(%rsp), %r9
movq %rbx, %rdi
movl $0xfffcf2c0, %edx       # imm = 0xFFFCF2C0
movl $0x30d40, %ecx          # imm = 0x30D40
movl $0x2, %r8d
pushq $0x0
pushq %r13
pushq %r12
callq 0xb398
addq $0x20, %rsp
testl %eax, %eax
je 0x251b2
movabsq $0x6300000063, %rax     # imm = 0x6300000063
leaq 0x8(%rsp), %rbx
movq %rax, 0x144(%rbx)
movl $0x2710, %edi           # imm = 0x2710
callq 0x24650
leaq 0xd2dae(%rip), %rdi     # 0xf7ef0
callq 0x6207
subq $0x8, %rsp
leaq 0x1d8(%rsp), %rsi
leaq 0x500(%rsp), %r9
movq %rbx, %rdi
movl $0xfffcf2c0, %edx       # imm = 0xFFFCF2C0
movl $0x30d40, %ecx          # imm = 0x30D40
movl $0x2, %r8d
pushq $0x0
pushq %r13
pushq %r12
callq 0xb398
addq $0x20, %rsp
testl %eax, %eax
jne 0x251d1
addq $0xb78, %rsp            # imm = 0xB78
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x11a05(%rip), %rdi     # 0x36b9f
leaq 0x11730(%rip), %rsi     # 0x368d1
leaq 0x11a0a(%rip), %rcx     # 0x36bb2
movl $0xd2, %edx
callq 0x20d0
leaq 0x119e6(%rip), %rdi     # 0x36b9f
leaq 0x11711(%rip), %rsi     # 0x368d1
leaq 0x119eb(%rip), %rcx     # 0x36bb2
movl $0xd9, %edx
callq 0x20d0
leaq 0x119ee(%rip), %rdi     # 0x36bc6
leaq 0x116f2(%rip), %rsi     # 0x368d1
leaq 0x119cc(%rip), %rcx     # 0x36bb2
movl $0xe0, %edx
callq 0x20d0