// File: /workspace/github_cpp_makefile_star2_O3/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 0x11d6e(%rip), %rsi     # 0x36be7
leaq 0x8(%rsp), %rbx
movq %rbx, %rdi
callq 0xaa82
leaq 0xd3063(%rip), %rdi     # 0xf7ef0
callq 0x62b6
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 0x244a4
xorl %edi, %edi
callq 0xb2ba
subq $0x8, %rsp
leaq 0xa3c21(%rip), %r13     # 0xc8af0
leaq 0x890eea(%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 0xb394
addq $0x20, %rsp
testl %eax, %eax
je 0x24fe7
movabsq $0x6200000062, %rax     # imm = 0x6200000062
leaq 0x8(%rsp), %rbx
movq %rax, 0x144(%rbx)
movl $0x2710, %edi           # imm = 0x2710
callq 0x244a4
leaq 0xd2fc4(%rip), %rdi     # 0xf7ef0
callq 0x62b6
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 0xb394
addq $0x20, %rsp
testl %eax, %eax
je 0x25006
movabsq $0x6300000063, %rax     # imm = 0x6300000063
leaq 0x8(%rsp), %rbx
movq %rax, 0x144(%rbx)
movl $0x2710, %edi           # imm = 0x2710
callq 0x244a4
leaq 0xd2f5a(%rip), %rdi     # 0xf7ef0
callq 0x62b6
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 0xb394
addq $0x20, %rsp
testl %eax, %eax
jne 0x25025
addq $0xb78, %rsp            # imm = 0xB78
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x11c31(%rip), %rdi     # 0x36c1f
leaq 0x1195c(%rip), %rsi     # 0x36951
leaq 0x11c36(%rip), %rcx     # 0x36c32
movl $0xd2, %edx
callq 0x20d0
leaq 0x11c12(%rip), %rdi     # 0x36c1f
leaq 0x1193d(%rip), %rsi     # 0x36951
leaq 0x11c17(%rip), %rcx     # 0x36c32
movl $0xd9, %edx
callq 0x20d0
leaq 0x11c1a(%rip), %rdi     # 0x36c46
leaq 0x1191e(%rip), %rsi     # 0x36951
leaq 0x11bf8(%rip), %rcx     # 0x36c32
movl $0xe0, %edx
callq 0x20d0