LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O3/jswaff[P]prophet3/src/xboard.cpp
// Function: print_thinking_output(move_line*, int, int, int, unsigned long long)
void print_thinking_output(move_line* line,int32 depth,int32 score,int32 start_time,uint64 nodes) {
    assert(line);
    assert(line->n > 0);

    char buffer[1024];
    line_to_str(line,buffer);
    int32 time_centis = (milli_timer() - start_time) / 10;
    print("%2d %5d %5d %7llu %s\n",depth,score,time_centis,nodes,buffer);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x400, %rsp            # imm = 0x400
testq %rdi, %rdi
je 0xead4
cmpl $0x0, (%rdi)
jle 0xeaf3
movq %r8, %rbx
movl %ecx, %r15d
movl %edx, %ebp
movl %esi, %r14d
movq %rsp, %r12
movq %r12, %rsi
callq 0xdfef
callq 0xdf08
subl %r15d, %eax
cltq
imulq $0x66666667, %rax, %rcx # imm = 0x66666667
movq %rcx, %rax
shrq $0x3f, %rax
sarq $0x22, %rcx
addl %eax, %ecx
leaq 0x1e510(%rip), %rdi     # 0x2cfc2
movl %r14d, %esi
movl %ebp, %edx
movq %rbx, %r8
movq %r12, %r9
xorl %eax, %eax
callq 0x64b9
addq $0x400, %rsp            # imm = 0x400
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
leaq 0x1e3bd(%rip), %rdi     # 0x2ce98
leaq 0x1e480(%rip), %rsi     # 0x2cf62
leaq 0x1e488(%rip), %rcx     # 0x2cf71
movl $0x42, %edx
callq 0x20d0
leaq 0x1e4bc(%rip), %rdi     # 0x2cfb6
leaq 0x1e461(%rip), %rsi     # 0x2cf62
leaq 0x1e469(%rip), %rcx     # 0x2cf71
movl $0x43, %edx
callq 0x20d0
// File: /workspace/github_cpp_makefile_star2_O3/jswaff[P]prophet3/src/xboard.cpp
// Function: think_and_make_move()
void think_and_make_move() {
    // check if game is over before we even get started.
    game_status gs = get_game_status();
    if (gs != INPROGRESS) {
        print_result(gs);
        return;
    }

    think();
}

// Assembly:
pushq %rax
callq 0xe781
testl %eax, %eax
je 0xeb87
movl %eax, %edi
popq %rax
jmp 0xeb12
popq %rax
jmp 0xd372
// File: /workspace/github_cpp_makefile_star2_O3/jswaff[P]prophet3/src/xboard.cpp
// Function: handle_level()
void handle_level() {
    char mps[10],base[10];
    if (scanf("%s",mps)==EOF) return;
    if (scanf("%s",base)==EOF) return;
    float f_inc = 0.0;
    if (scanf("%f",&f_inc)==EOF) return;
    int32 my_increment = (int32)(f_inc * 1000); // convert to ms
    printd("# increment: %d\n",my_increment);
    set_increment(my_increment);
}

// Assembly:
pushq %rbx
subq $0x20, %rsp
leaq 0x1db01(%rip), %rdi     # 0x2c6d4
leaq 0x16(%rsp), %rsi
xorl %eax, %eax
callq 0x2190
cmpl $-0x1, %eax
je 0xec43
leaq 0x1dae9(%rip), %rdi     # 0x2c6d4
leaq 0xc(%rsp), %rsi
xorl %eax, %eax
callq 0x2190
cmpl $-0x1, %eax
je 0xec43
leaq 0x8(%rsp), %rsi
movl $0x0, (%rsi)
leaq 0x1e498(%rip), %rdi     # 0x2d0a6
xorl %eax, %eax
callq 0x2190
cmpl $-0x1, %eax
je 0xec43
movss 0x8(%rsp), %xmm0
mulss 0x1e2f4(%rip), %xmm0    # 0x2cf1c
cvttss2si %xmm0, %ebx
leaq 0x1e476(%rip), %rdi     # 0x2d0a9
movl %ebx, %esi
xorl %eax, %eax
callq 0x65d9
movl %ebx, %edi
callq 0xd2e7
addq $0x20, %rsp
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O3/jswaff[P]prophet3/src/xboard.cpp
// Function: handle_memory()
void handle_memory() {
    int32 mem_in_mb;
    if (scanf("%d",&mem_in_mb)==EOF) return;

    printd("# received memory command, N=%d\n",mem_in_mb);
    if (mem_in_mb != last_mem_in_mb) {
        free(htbl.tblptr);
        free(phtbl.tblptr);

        uint32 total_hash_size = mem_in_mb * 1024 * 1024; // convert to bytes

        init_hash_table(&htbl,total_hash_size / 2);
        init_hash_table(&phtbl,total_hash_size / 2);

        last_mem_in_mb = mem_in_mb;
    } else {
        printd("# memory usage hasn't changed, skipping free/malloc\n");
    }
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
subq $0x10, %rsp
leaq 0x1e462(%rip), %rdi     # 0x2d0ba
leaq 0xc(%rsp), %rsi
xorl %eax, %eax
callq 0x2190
cmpl $-0x1, %eax
je 0xece0
movl 0xc(%rsp), %esi
leaq 0x1e449(%rip), %rdi     # 0x2d0bd
xorl %eax, %eax
callq 0x65d9
movl 0xc(%rsp), %eax
cmpl 0x8a710f(%rip), %eax    # 0x8b5d94
jne 0xec97
leaq 0x1e450(%rip), %rdi     # 0x2d0de
xorl %eax, %eax
callq 0x65d9
jmp 0xece0
leaq 0xe9252(%rip), %rbx     # 0xf7ef0
movq (%rbx), %rdi
callq 0x21e0
leaq 0xe9273(%rip), %r14     # 0xf7f20
movq (%r14), %rdi
callq 0x21e0
movl 0xc(%rsp), %ebp
shll $0x13, %ebp
andl $0x7ff80000, %ebp       # imm = 0x7FF80000
movq %rbx, %rdi
movl %ebp, %esi
callq 0x6224
movq %r14, %rdi
movl %ebp, %esi
callq 0x6224
movl 0xc(%rsp), %eax
movl %eax, 0x8a70b4(%rip)    # 0x8b5d94
addq $0x10, %rsp
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/jswaff[P]prophet3/src/xboard.cpp
// Function: handle_new()
void handle_new() {
    stop_search_thread();
    force_mode = false;
    reset_pos(&gpos);
    set_max_depth(0);
}

// Assembly:
pushq %rax
movl $0x1, %edi
callq 0xd31b
leaq 0xe986d(%rip), %rax     # 0xf8590
movq (%rax), %rdi
xorl %esi, %esi
callq 0x2130
movb $0x0, 0x3347c(%rip)     # 0x421b0
leaq 0xb9be5(%rip), %rdi     # 0xc8920
callq 0xaa51
xorl %edi, %edi
popq %rax
jmp 0xd2ee
// File: /workspace/github_cpp_makefile_star2_O3/jswaff[P]prophet3/src/xboard.cpp
// Function: handle_perft()
void handle_perft() {
    draw_board(&gpos);
    int max_depth;
    if (scanf("%d",&max_depth) != EOF) {
        int32 start = milli_timer();
        uint64 nodes=perft_iterate(max_depth);
        int32 end = milli_timer();
        if (end==start) end = start+1;
        print("\n# nodes: %lu\n",nodes);
        print("# elapsed time: %d ms\n",end-start);
        print("# rate: %.2f n/s\n\n",nodes*1000.0/(end-start));
    }
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x10, %rsp
leaq 0xb9bab(%rip), %rdi     # 0xc8920
callq 0x4bd8
leaq 0x1e339(%rip), %rdi     # 0x2d0ba
leaq 0xc(%rsp), %rsi
xorl %eax, %eax
callq 0x2190
cmpl $-0x1, %eax
je 0xee1f
callq 0xdf08
movl %eax, %r14d
movl 0xc(%rsp), %edi
callq 0x984f
movq %rax, %r15
callq 0xdf08
leal 0x1(%r14), %ebx
cmpl %r14d, %eax
cmovnel %eax, %ebx
leaq 0x1e353(%rip), %rdi     # 0x2d113
movq %r15, %rsi
xorl %eax, %eax
callq 0x64b9
subl %r14d, %ebx
leaq 0x1e34e(%rip), %rdi     # 0x2d122
movl %ebx, %esi
xorl %eax, %eax
callq 0x64b9
movq %r15, %xmm1
punpckldq 0x1da26(%rip), %xmm1 # xmm1 = xmm1[0],mem[0],xmm1[1],mem[1]
subpd 0x1da2e(%rip), %xmm1    # 0x2c820
movapd %xmm1, %xmm0
unpckhpd %xmm1, %xmm0            # xmm0 = xmm0[1],xmm1[1]
addsd %xmm1, %xmm0
mulsd 0x1da32(%rip), %xmm0    # 0x2c838
xorps %xmm1, %xmm1
cvtsi2sd %ebx, %xmm1
divsd %xmm1, %xmm0
leaq 0x1e321(%rip), %rdi     # 0x2d139
movb $0x1, %al
callq 0x64b9
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O3/jswaff[P]prophet3/src/xboard.cpp
// Function: handle_ping()
void handle_ping() {
    if (!is_pondering()) {
        stop_search_thread();
    }
    int n;
    if (scanf("%d",&n) != EOF) {
        print("pong %d\n",n);
    }
}

// Assembly:
pushq %rax
callq 0xd30c
testb %al, %al
jne 0xee78
movl $0x1, %edi
callq 0xd31b
leaq 0xe9722(%rip), %rax     # 0xf8590
movq (%rax), %rdi
xorl %esi, %esi
callq 0x2130
leaq 0x1e23b(%rip), %rdi     # 0x2d0ba
leaq 0x4(%rsp), %rsi
xorl %eax, %eax
callq 0x2190
cmpl $-0x1, %eax
je 0xeea2
movl 0x4(%rsp), %esi
leaq 0x1e2b1(%rip), %rdi     # 0x2d14c
xorl %eax, %eax
callq 0x64b9
popq %rax
retq
// File: /workspace/github_cpp_makefile_star2_O3/jswaff[P]prophet3/src/xboard.cpp
// Function: handle_probe_book()
void handle_probe_book() {
    move mv = probe_book(&gpos);
    if (mv==0) {
        print("no move found.\n");
    } else {
        print_move(mv);
    }
}

// Assembly:
pushq %rax
leaq 0xb9a6a(%rip), %rdi     # 0xc8920
callq 0x465c
testq %rax, %rax
je 0xeec9
movq %rax, %rdi
popq %rax
jmp 0xe7f9
leaq 0x1e285(%rip), %rdi     # 0x2d155
xorl %eax, %eax
popq %rcx
jmp 0x64b9
// File: /workspace/github_cpp_makefile_star2_O3/jswaff[P]prophet3/src/xboard.cpp
// Function: handle_protover()
void handle_protover() {
    int version;
    if (scanf("%d",&version) != EOF) {
        if (version < 2) {
            error("protover >= 2 expected.\n");
            exit(0);
        }

        print("feature analyze=0 black=0 colors=0 cores=0 ping=1 draw=0 debug=1 edit=0 ics=1\n");
        print("feature level=0 name=1 nps=0 memory=1 playother=1 pause=0 resume=0 reuse=1 san=0\n");
        print("feature setboard=1 sigint=0 sigterm=0 smp=0 st=0 time=1 usermove=1\n");
        print("feature white=0 variants=\"normal\"\n");
        print("feature done=1\n"); // must be last
    }
}

// Assembly:
pushq %rax
leaq 0x1e1da(%rip), %rdi     # 0x2d0ba
leaq 0x4(%rsp), %rsi
xorl %eax, %eax
callq 0x2190
cmpl $-0x1, %eax
je 0xef3e
cmpl $0x1, 0x4(%rsp)
jle 0xef40
leaq 0x1e27f(%rip), %rdi     # 0x2d17e
xorl %eax, %eax
callq 0x64b9
leaq 0x1e2c0(%rip), %rdi     # 0x2d1cd
xorl %eax, %eax
callq 0x64b9
leaq 0x1e304(%rip), %rdi     # 0x2d21f
xorl %eax, %eax
callq 0x64b9
leaq 0x1e33a(%rip), %rdi     # 0x2d263
xorl %eax, %eax
callq 0x64b9
leaq 0x1e34f(%rip), %rdi     # 0x2d286
xorl %eax, %eax
callq 0x64b9
popq %rax
retq
leaq 0x1e21e(%rip), %rdi     # 0x2d165
xorl %eax, %eax
callq 0x2330
xorl %edi, %edi
callq 0x21f0
// File: /workspace/github_cpp_makefile_star2_O3/jswaff[P]prophet3/src/xboard.cpp
// Function: handle_quit()
void handle_quit() {
    stop_search_thread();
    if (book_db != 0) {
        sqlite3_close(book_db);
    }
    free(htbl.tblptr);
    free(phtbl.tblptr);

    print("bye...\n");
    exit(0);
}

// Assembly:
pushq %rax
movl $0x1, %edi
callq 0xd31b
leaq 0xe9629(%rip), %rax     # 0xf8590
movq (%rax), %rdi
xorl %esi, %esi
callq 0x2130
leaq 0xb59a0(%rip), %rax     # 0xc4918
movq (%rax), %rdi
testq %rdi, %rdi
je 0xef85
callq 0x20a0
leaq 0xe8f64(%rip), %rax     # 0xf7ef0
movq (%rax), %rdi
callq 0x21e0
leaq 0xe8f85(%rip), %rax     # 0xf7f20
movq (%rax), %rdi
callq 0x21e0
leaq 0x1e2ec(%rip), %rdi     # 0x2d296
xorl %eax, %eax
callq 0x64b9
xorl %edi, %edi
callq 0x21f0
// File: /workspace/github_cpp_makefile_star2_O3/jswaff[P]prophet3/src/xboard.cpp
// Function: handle_sd()
void handle_sd() {
    int32 my_max_depth;
    if (scanf("%d",&my_max_depth)==EOF) return;
    printd("# MAX DEPTH: %d\n",my_max_depth);
    set_max_depth(my_max_depth);
}

// Assembly:
pushq %rax
leaq 0x1dfa4(%rip), %rdi     # 0x2d0ba
leaq 0x4(%rsp), %rsi
xorl %eax, %eax
callq 0x2190
cmpl $-0x1, %eax
je 0xf142
movl 0x4(%rsp), %esi
leaq 0x1e189(%rip), %rdi     # 0x2d2bb
xorl %eax, %eax
callq 0x65d9
movl 0x4(%rsp), %edi
callq 0xd2ee
popq %rax
retq
// File: /workspace/github_cpp_makefile_star2_O3/jswaff[P]prophet3/src/xboard.cpp
// Function: handle_setboard()
void handle_setboard() {
    char fen[255];
    if (!fgets(fen, 255, stdin)) {
        return;
    }
    printd("# SETBOARD FEN: %s\n",fen);
    if (!set_pos(&gpos,fen)) {
        print("tellusererror illegal position\n");
    }
    draw_board(&gpos);
}

// Assembly:
pushq %rbx
subq $0x100, %rsp            # imm = 0x100
movq 0x32e6d(%rip), %rax     # 0x41fc0
movq (%rax), %rdx
movq %rsp, %rdi
movl $0xff, %esi
callq 0x22d0
testq %rax, %rax
je 0xf1a9
leaq 0x1e15d(%rip), %rdi     # 0x2d2cc
movq %rsp, %rbx
movq %rbx, %rsi
xorl %eax, %eax
callq 0x65d9
leaq 0xb979d(%rip), %rdi     # 0xc8920
movq %rbx, %rsi
callq 0xaa82
testb %al, %al
jne 0xf19d
leaq 0x1e14a(%rip), %rdi     # 0x2d2e0
xorl %eax, %eax
callq 0x64b9
leaq 0xb977c(%rip), %rdi     # 0xc8920
callq 0x4bd8
addq $0x100, %rsp            # imm = 0x100
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O3/jswaff[P]prophet3/src/xboard.cpp
// Function: handle_time()
void handle_time() {
    int32 my_time_remaining;
    if (scanf("%d",&my_time_remaining)==EOF) return;
    my_time_remaining *= 10; // centiseconds to milliseconds
    printd("# TIME REMAINING: %d\n",my_time_remaining);
    set_time_remaining(my_time_remaining);
}

// Assembly:
pushq %rax
leaq 0x1df00(%rip), %rdi     # 0x2d0ba
leaq 0x4(%rsp), %rsi
xorl %eax, %eax
callq 0x2190
cmpl $-0x1, %eax
je 0xf1ef
movl 0x4(%rsp), %eax
addl %eax, %eax
leal (%rax,%rax,4), %esi
movl %esi, 0x4(%rsp)
leaq 0x1e121(%rip), %rdi     # 0x2d300
xorl %eax, %eax
callq 0x65d9
movl 0x4(%rsp), %edi
callq 0xd2e0
popq %rax
retq
// File: /workspace/github_cpp_makefile_star2_O3/jswaff[P]prophet3/src/xboard.cpp
// Function: parse_command(char const*)
void parse_command(const char *cmd) {

    last_input_time = milli_timer();
    printd("# RECEIVED: %s\n",cmd);

    int len=sizeof(function_table)/sizeof(function_table_entry);

    for (int i=0;i<len;i++) {
        function_table_entry fte = function_table[i];
        if (strcmp(cmd,fte.name)==0) {
            fte.func();
            return;
        }
    }

    print("Error (unknown command): %s\n",cmd);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
callq 0xdf08
movl %eax, 0x8a6a01(%rip)    # 0x8b5d90
leaq 0x1e130(%rip), %rdi     # 0x2d4c6
movq %rbx, %rsi
xorl %eax, %eax
callq 0x65d9
movl $0x8, %eax
leaq 0x32e14(%rip), %r15     # 0x421c0
movq %rax, %r14
movq -0x8(%rax,%r15), %rsi
movq %rbx, %rdi
callq 0x2260
testl %eax, %eax
je 0xf3e5
movq %r14, %rax
addq $0x10, %rax
cmpq $0x2c8, %rax            # imm = 0x2C8
jne 0xf3ac
leaq 0x1e100(%rip), %rdi     # 0x2d4d6
movq %rbx, %rsi
xorl %eax, %eax
popq %rbx
popq %r14
popq %r15
jmp 0x64b9
movq %r14, %rax
movq %r15, %rcx
popq %rbx
popq %r14
popq %r15
jmpq *(%rax,%rcx)
nop
// File: /workspace/github_cpp_makefile_star2_O3/jswaff[P]prophet3/test/apply__test.cpp
// Function: test_undo_double_pawn_push()
void test_undo_double_pawn_push() {
    position pos;
    reset_pos(&pos);

    position save_pos;
    memcpy(&save_pos,&pos,sizeof(position));

    move mv = to_move(PAWN,E2,E4);
    apply_move(&pos,mv,gundos);

    undo_last_move(&pos,gundos);
    assert(equal_pos(&pos,&save_pos,true));
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x390, %rsp            # imm = 0x390
leaq 0x1c8(%rsp), %rbx
movq %rbx, %rdi
callq 0xaa51
movq %rsp, %r14
movl $0x1c8, %edx            # imm = 0x1C8
movq %r14, %rdi
movq %rbx, %rsi
callq 0x2100
movl $0x1, %edi
movl $0x34, %esi
movl $0x24, %edx
callq 0x775c
leaq 0xb8e51(%rip), %r15     # 0xc8af0
movq %rbx, %rdi
movq %rax, %rsi
movq %r15, %rdx
callq 0x30e1
movq %rbx, %rdi
movq %r15, %rsi
callq 0x334b
movq %rbx, %rdi
movq %r14, %rsi
movl $0x1, %edx
callq 0xa0b8
testb %al, %al
je 0xfcd9
addq $0x390, %rsp            # imm = 0x390
popq %rbx
popq %r14
popq %r15
retq
leaq 0x1dc38(%rip), %rdi     # 0x2d918
leaq 0x1d848(%rip), %rsi     # 0x2d52f
leaq 0x1dc49(%rip), %rcx     # 0x2d937
movl $0x85, %edx
callq 0x20d0
// File: /workspace/github_cpp_makefile_star2_O3/jswaff[P]prophet3/test/apply__test.cpp
// Function: test_undo_capturing_promotion()
void test_undo_capturing_promotion() {
    position pos;
    set_pos(&pos,"r7/1PK5/8/8/k7/8/8/8 w - -");

    position save_pos;
    memcpy(&save_pos,&pos,sizeof(position));

    move mv = to_capture(PAWN,B7,A8,ROOK);
    set_promopiece(&mv,QUEEN);
    apply_move(&pos,mv,gundos);

    undo_last_move(&pos,gundos);
    assert(equal_pos(&pos,&save_pos,true));
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x3a0, %rsp            # imm = 0x3A0
leaq 0x1dc4e(%rip), %rsi     # 0x2d959
leaq 0x1d8(%rsp), %rbx
movq %rbx, %rdi
callq 0xaa82
leaq 0x10(%rsp), %r14
movl $0x1c8, %edx            # imm = 0x1C8
movq %r14, %rdi
movq %rbx, %rsi
callq 0x2100
movl $0x1, %edi
movl $0x9, %esi
xorl %edx, %edx
movl $0x4, %ecx
callq 0x777b
leaq 0x8(%rsp), %r15
movq %rax, (%r15)
movq %r15, %rdi
movl $0x5, %esi
callq 0x7824
movq (%r15), %rsi
leaq 0xb8d8b(%rip), %r15     # 0xc8af0
movq %rbx, %rdi
movq %r15, %rdx
callq 0x30e1
movq %rbx, %rdi
movq %r15, %rsi
callq 0x334b
movq %rbx, %rdi
movq %r14, %rsi
movl $0x1, %edx
callq 0xa0b8
testb %al, %al
je 0xfd9c
addq $0x3a0, %rsp            # imm = 0x3A0
popq %rbx
popq %r14
popq %r15
retq
leaq 0x1db75(%rip), %rdi     # 0x2d918
leaq 0x1d785(%rip), %rsi     # 0x2d52f
leaq 0x1dbc3(%rip), %rcx     # 0x2d974
movl $0x94, %edx
callq 0x20d0
// File: /workspace/github_cpp_makefile_star2_O3/jswaff[P]prophet3/test/apply__test.cpp
// Function: test_undo_epcapture()
void test_undo_epcapture() {
    position pos;
    set_pos(&pos,"k7/8/8/8/pP6/8/K7/8 b - b3");

    position save_pos;
    memcpy(&save_pos,&pos,sizeof(position));

    move mv = to_capture(PAWN,A4,B3,PAWN);
    set_epcapture(&mv);
    apply_move(&pos,mv,gundos);

    undo_last_move(&pos,gundos);
    assert(equal_pos(&pos,&save_pos,true));
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x3a0, %rsp            # imm = 0x3A0
leaq 0x1dbcb(%rip), %rsi     # 0x2d999
leaq 0x1d8(%rsp), %rbx
movq %rbx, %rdi
callq 0xaa82
leaq 0x10(%rsp), %r14
movl $0x1c8, %edx            # imm = 0x1C8
movq %r14, %rdi
movq %rbx, %rsi
callq 0x2100
movl $0x1, %edi
movl $0x20, %esi
movl $0x29, %edx
movl $0x1, %ecx
callq 0x777b
leaq 0x8(%rsp), %r15
movq %rax, (%r15)
movq %r15, %rdi
callq 0x783b
movq (%r15), %rsi
leaq 0xb8cca(%rip), %r15     # 0xc8af0
movq %rbx, %rdi
movq %r15, %rdx
callq 0x30e1
movq %rbx, %rdi
movq %r15, %rsi
callq 0x334b
movq %rbx, %rdi
movq %r14, %rsi
movl $0x1, %edx
callq 0xa0b8
testb %al, %al
je 0xfe5d
addq $0x3a0, %rsp            # imm = 0x3A0
popq %rbx
popq %r14
popq %r15
retq
leaq 0x1dab4(%rip), %rdi     # 0x2d918
leaq 0x1d6c4(%rip), %rsi     # 0x2d52f
leaq 0x1db42(%rip), %rcx     # 0x2d9b4
movl $0xa3, %edx
callq 0x20d0
// File: /workspace/github_cpp_makefile_star2_O3/jswaff[P]prophet3/test/apply__test.cpp
// Function: test_undo_castle()
void test_undo_castle() {
    position pos;
    set_pos(&pos,"k7/8/8/8/8/8/8/4K2R w K -");

    position save_pos;
    memcpy(&save_pos,&pos,sizeof(position));

    move mv = to_move(KING,E1,G1);
    set_castle(&mv);
    apply_move(&pos,mv,gundos);

    undo_last_move(&pos,gundos);
    assert(equal_pos(&pos,&save_pos,true));
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x3a0, %rsp            # imm = 0x3A0
leaq 0x1db40(%rip), %rsi     # 0x2d9cf
leaq 0x1d8(%rsp), %rbx
movq %rbx, %rdi
callq 0xaa82
leaq 0x10(%rsp), %r14
movl $0x1c8, %edx            # imm = 0x1C8
movq %r14, %rdi
movq %rbx, %rsi
callq 0x2100
movl $0x6, %edi
movl $0x3c, %esi
movl $0x3e, %edx
callq 0x775c
leaq 0x8(%rsp), %r15
movq %rax, (%r15)
movq %r15, %rdi
callq 0x784f
movq (%r15), %rsi
leaq 0xb8c0e(%rip), %r15     # 0xc8af0
movq %rbx, %rdi
movq %r15, %rdx
callq 0x30e1
movq %rbx, %rdi
movq %r15, %rsi
callq 0x334b
movq %rbx, %rdi
movq %r14, %rsi
movl $0x1, %edx
callq 0xa0b8
testb %al, %al
je 0xff19
addq $0x3a0, %rsp            # imm = 0x3A0
popq %rbx
popq %r14
popq %r15
retq
leaq 0x1d9f8(%rip), %rdi     # 0x2d918
leaq 0x1d608(%rip), %rsi     # 0x2d52f
leaq 0x1dabb(%rip), %rcx     # 0x2d9e9
movl $0xb2, %edx
callq 0x20d0
// File: /workspace/github_cpp_makefile_star2_O3/jswaff[P]prophet3/test/apply__test.cpp
// Function: test_apply()
void test_apply() {
    test_apply_move();
    test_undo_double_pawn_push();
    test_undo_capturing_promotion();
    test_undo_epcapture();
    test_undo_castle();
}

// Assembly:
pushq %rax
callq 0xf3f4
callq 0xfc55
callq 0xfcf8
callq 0xfdbb
popq %rax
jmp 0xfe7c
nop
// File: /workspace/github_cpp_makefile_star2_O3/jswaff[P]prophet3/test/attack__test.cpp
// Function: test_attacked_by_knight()
void test_attacked_by_knight() {
    position pos;
    set_pos(&pos,"3k4/8/8/3n4/3N4/8/8/3K4 w - - 0 1");

    uint64 white_map=0,black_map=0;
    for (int32 sq=A8;sq<=H1;sq++) {
        if (attacked_by_knight(&pos,(square_t)sq,WHITE)) {
            white_map |= bb_squares[sq];
        }

        if (attacked_by_knight(&pos,(square_t)sq,BLACK)) {
            black_map |= bb_squares[sq];
        }
    }

    assert(white_map==(bb_squares[C6] | bb_squares[E6] | bb_squares[F5]
                     | bb_squares[F3] | bb_squares[E2] | bb_squares[C2]
                     | bb_squares[B3] | bb_squares[B5]));


    assert(black_map==(bb_squares[C7] | bb_squares[E7] | bb_squares[F6]
                     | bb_squares[F4] | bb_squares[E3] | bb_squares[C3]
                     | bb_squares[B4] | bb_squares[B6]));


}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x1d0, %rsp            # imm = 0x1D0
leaq 0x1da96(%rip), %rsi     # 0x2da01
leaq 0x8(%rsp), %rbx
movq %rbx, %rdi
callq 0xaa82
xorl %r14d, %r14d
leaq 0xea52e(%rip), %r15     # 0xfa4b0
xorl %r12d, %r12d
xorl %r13d, %r13d
movq %rbx, %rdi
movl %r14d, %esi
movl $0x1, %edx
callq 0x36d0
testb %al, %al
je 0xffa0
orq (%r15,%r14,8), %r13
movq %rbx, %rdi
movl %r14d, %esi
xorl %edx, %edx
callq 0x36d0
testb %al, %al
je 0xffb5
orq (%r15,%r14,8), %r12
incq %r14
cmpq $0x40, %r14
jne 0xff88
movq 0xa0(%r15), %rax
orq 0x90(%r15), %rax
orq 0xe8(%r15), %rax
orq 0x168(%r15), %rax
orq 0x1a0(%r15), %rax
orq 0x190(%r15), %rax
orq 0x148(%r15), %rax
orq 0xc8(%r15), %rax
cmpq %rax, %r13
jne 0x10043
movq 0x60(%r15), %rax
orq 0x50(%r15), %rax
orq 0xa8(%r15), %rax
orq 0x128(%r15), %rax
orq 0x160(%r15), %rax
orq 0x150(%r15), %rax
orq 0x108(%r15), %rax
orq 0x88(%r15), %rax
cmpq %rax, %r12
jne 0x10062
addq $0x1d0, %rsp            # imm = 0x1D0
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
leaq 0x1d9d9(%rip), %rdi     # 0x2da23
leaq 0x1da65(%rip), %rsi     # 0x2dab6
leaq 0x1da74(%rip), %rcx     # 0x2dacc
movl $0x1d, %edx
callq 0x20d0
leaq 0x1da82(%rip), %rdi     # 0x2daeb
leaq 0x1da46(%rip), %rsi     # 0x2dab6
leaq 0x1da55(%rip), %rcx     # 0x2dacc
movl $0x22, %edx
callq 0x20d0
// File: /workspace/github_cpp_makefile_star2_O3/jswaff[P]prophet3/test/attack__test.cpp
// Function: test_attacked_by_king()
void test_attacked_by_king() {
    position pos;
    set_pos(&pos,"3k4/8/8/3n4/3K4/8/8/8 w - - 0 1");

    uint64 white_map=0,black_map=0;
    for (int32 sq=A8;sq<=H1;sq++) {
        if (attacked_by_king(&pos,(square_t)sq,WHITE)) {
            white_map |= bb_squares[sq];
        }

        if (attacked_by_king(&pos,(square_t)sq,BLACK)) {
            black_map |= bb_squares[sq];
        }
    }
    assert(white_map==(bb_squares[C5] | bb_squares[D5] | bb_squares[E5]
                     | bb_squares[C4] | bb_squares[E4] | bb_squares[C3]
                     | bb_squares[D3] | bb_squares[E3]));


    assert(black_map==(bb_squares[C8] | bb_squares[E8] | bb_squares[C7]
                     | bb_squares[D7] | bb_squares[E7]));
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x1d0, %rsp            # imm = 0x1D0
leaq 0x1dae6(%rip), %rsi     # 0x2db7e
leaq 0x8(%rsp), %rbx
movq %rbx, %rdi
callq 0xaa82
xorl %r14d, %r14d
leaq 0xea401(%rip), %r15     # 0xfa4b0
xorl %r12d, %r12d
xorl %r13d, %r13d
movq %rbx, %rdi
movl %r14d, %esi
movl $0x1, %edx
callq 0x375f
testb %al, %al
je 0x100cd
orq (%r15,%r14,8), %r13
movq %rbx, %rdi
movl %r14d, %esi
xorl %edx, %edx
callq 0x375f
testb %al, %al
je 0x100e2
orq (%r15,%r14,8), %r12
incq %r14
cmpq $0x40, %r14
jne 0x100b5
movq 0xd8(%r15), %rax
orq 0xd0(%r15), %rax
orq 0xe0(%r15), %rax
orq 0x110(%r15), %rax
orq 0x120(%r15), %rax
orq 0x150(%r15), %rax
orq 0x158(%r15), %rax
orq 0x160(%r15), %rax
cmpq %rax, %r13
jne 0x10152
movq 0x20(%r15), %rax
orq 0x10(%r15), %rax
orq 0x50(%r15), %rax
orq 0x58(%r15), %rax
orq 0x60(%r15), %rax
cmpq %rax, %r12
jne 0x10171
addq $0x1d0, %rsp            # imm = 0x1D0
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
leaq 0x1da45(%rip), %rdi     # 0x2db9e
leaq 0x1d956(%rip), %rsi     # 0x2dab6
leaq 0x1daca(%rip), %rcx     # 0x2dc31
movl $0x37, %edx
callq 0x20d0
leaq 0x1dad6(%rip), %rdi     # 0x2dc4e
leaq 0x1d937(%rip), %rsi     # 0x2dab6
leaq 0x1daab(%rip), %rcx     # 0x2dc31
movl $0x3b, %edx
callq 0x20d0
// File: /workspace/github_cpp_makefile_star2_O3/jswaff[P]prophet3/test/attack__test.cpp
// Function: test_attacked_by_pawn()
void test_attacked_by_pawn() {
    position pos;
    set_pos(&pos,"3k4/8/8/3p4/3P3P/8/8/3K4 w - - 0 1");

    for (int32 sq=A8;sq<=H1;sq++) {
        assert(attacked_by_pawn(&pos,(square_t)sq,WHITE)==
                (sq==C5 || sq==E5 || sq==G5));

        assert(attacked_by_pawn(&pos,(square_t)sq,BLACK)==
                (sq==C4 || sq==E4));
    }
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
subq $0x1d0, %rsp            # imm = 0x1D0
leaq 0x1db0c(%rip), %rsi     # 0x2dcae
leaq 0x8(%rsp), %rbx
movq %rbx, %rdi
callq 0xaa82
xorl %r14d, %r14d
movl $0x1, %ebp
movq %rbx, %rdi
movl %r14d, %esi
movl $0x1, %edx
callq 0x3852
cmpl $0x1a, %r14d
je 0x101dd
cmpl $0x1c, %r14d
je 0x101dd
xorl %ebp, %ebp
cmpl $0x1e, %r14d
sete %bpl
movzbl %al, %eax
cmpl %eax, %ebp
jne 0x10236
movq %rbx, %rdi
movl %r14d, %esi
xorl %edx, %edx
callq 0x3852
leal -0x22(%r14), %ecx
testl $0xfffffffd, %ecx       # imm = 0xFFFFFFFD
setne %cl
cmpb %al, %cl
je 0x10217
incl %r14d
cmpl $0x40, %r14d
jne 0x101b2
addq $0x1d0, %rsp            # imm = 0x1D0
popq %rbx
popq %r14
popq %rbp
retq
leaq 0x1db19(%rip), %rdi     # 0x2dd37
leaq 0x1d891(%rip), %rsi     # 0x2dab6
leaq 0x1daee(%rip), %rcx     # 0x2dd1a
movl $0x47, %edx
callq 0x20d0
leaq 0x1da94(%rip), %rdi     # 0x2dcd1
leaq 0x1d872(%rip), %rsi     # 0x2dab6
leaq 0x1dacf(%rip), %rcx     # 0x2dd1a
movl $0x44, %edx
callq 0x20d0
// File: /workspace/github_cpp_makefile_star2_O3/jswaff[P]prophet3/test/attack__test.cpp
// Function: test_attacked_by_rook()
void test_attacked_by_rook() {
    position pos;
    set_pos(&pos,"8/1r3k2/8/3p4/3P3P/8/1P6/3K4 b - - 0 1");

    uint64 white_map=0,black_map=0;
    for (int32 sq=A8;sq<=H1;sq++) {
        if (attacked_by_rook(&pos,(square_t)sq,WHITE)) {
            white_map |= bb_squares[sq];
        }

        if (attacked_by_rook(&pos,(square_t)sq,BLACK)) {
            black_map |= bb_squares[sq];
        }
    }

    assert(white_map==0);
    assert(black_map==(bb_squares[B8] | bb_squares[A7] | bb_squares[C7]
            | bb_squares[D7] | bb_squares[E7] | bb_squares[F7]
            | bb_squares[B6] | bb_squares[B5] | bb_squares[B4]
            | bb_squares[B3] | bb_squares[B2]));
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x1d0, %rsp            # imm = 0x1D0
leaq 0x1db0a(%rip), %rsi     # 0x2dd76
leaq 0x8(%rsp), %rbx
movq %rbx, %rdi
callq 0xaa82
xorl %r14d, %r14d
leaq 0xea22d(%rip), %r12     # 0xfa4b0
xorl %r15d, %r15d
xorl %r13d, %r13d
movq %rbx, %rdi
movl %r14d, %esi
movl $0x1, %edx
callq 0x37f8
testb %al, %al
je 0x102a1
orq (%r12,%r14,8), %r13
movq %rbx, %rdi
movl %r14d, %esi
xorl %edx, %edx
callq 0x37f8
testb %al, %al
je 0x102b6
orq (%r12,%r14,8), %r15
incq %r14
cmpq $0x40, %r14
jne 0x10289
testq %r13, %r13
jne 0x10331
movq 0x8(%r12), %rax
movdqa 0x50(%r12), %xmm0
movq 0xc8(%r12), %rcx
por 0x60(%r12), %xmm0
movq 0x148(%r12), %rdx
pshufd $0xee, %xmm0, %xmm1     # xmm1 = xmm0[2,3,2,3]
por %xmm0, %xmm1
movq %xmm1, %rsi
orq 0x40(%r12), %rsi
orq 0x88(%r12), %rax
orq 0x108(%r12), %rcx
orq 0x188(%r12), %rdx
orq %rcx, %rdx
orq %rax, %rdx
orq %rsi, %rdx
cmpq %rdx, %r15
jne 0x10350
addq $0x1d0, %rsp            # imm = 0x1D0
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
leaq 0x1da65(%rip), %rdi     # 0x2dd9d
leaq 0x1d777(%rip), %rsi     # 0x2dab6
leaq 0x1da64(%rip), %rcx     # 0x2ddaa
movl $0x5a, %edx
callq 0x20d0
leaq 0x1da70(%rip), %rdi     # 0x2ddc7
leaq 0x1d758(%rip), %rsi     # 0x2dab6
leaq 0x1da45(%rip), %rcx     # 0x2ddaa
movl $0x5e, %edx
callq 0x20d0
// File: /workspace/github_cpp_makefile_star2_O3/jswaff[P]prophet3/test/attack__test.cpp
// Function: test_attacked_by_bishop()
void test_attacked_by_bishop() {
    position pos;
    set_pos(&pos,"8/1r3k2/8/3bB3/8/8/8/3K4 b - - 0 1");

    uint64 white_map=0,black_map=0;
    for (int32 sq=A8;sq<=H1;sq++) {
        if (attacked_by_bishop(&pos,(square_t)sq,WHITE)) {
            white_map |= bb_squares[sq];
        }

        if (attacked_by_bishop(&pos,(square_t)sq,BLACK)) {
            black_map |= bb_squares[sq];
        }
    }

    assert(white_map==(bb_squares[D6] | bb_squares[C7] | bb_squares[B8]
            | bb_squares[F6] | bb_squares[G7] | bb_squares[H8]
            | bb_squares[D4] | bb_squares[C3] | bb_squares[B2] | bb_squares[A1]
            | bb_squares[F4] | bb_squares[G3] | bb_squares[H2]));

    assert(black_map==(bb_squares[C6] | bb_squares[B7]
            | bb_squares[E6] | bb_squares[F7]
            | bb_squares[C4] | bb_squares[B3] | bb_squares[A2]
            | bb_squares[E4] | bb_squares[F3] | bb_squares[G2] | bb_squares[H1]));
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x1d0, %rsp            # imm = 0x1D0
leaq 0x1db07(%rip), %rsi     # 0x2de8d
leaq 0x8(%rsp), %rbx
movq %rbx, %rdi
callq 0xaa82
xorl %r14d, %r14d
leaq 0xea113(%rip), %r15     # 0xfa4b0
xorl %r12d, %r12d
xorl %r13d, %r13d
movq %rbx, %rdi
movl %r14d, %esi
movl $0x1, %edx
callq 0x3816
testb %al, %al
je 0x103bb
orq (%r15,%r14,8), %r13
movq %rbx, %rdi
movl %r14d, %esi
xorl %edx, %edx
callq 0x3816
testb %al, %al
je 0x103d0
orq (%r15,%r14,8), %r12
incq %r14
cmpq $0x40, %r14
jne 0x103a3
movq 0x50(%r15), %rax
orq 0x98(%r15), %rax
orq 0x8(%r15), %rax
orq 0xa8(%r15), %rax
orq 0x70(%r15), %rax
orq 0x38(%r15), %rax
orq 0x118(%r15), %rax
orq 0x150(%r15), %rax
orq 0x188(%r15), %rax
orq 0x1c0(%r15), %rax
orq 0x128(%r15), %rax
orq 0x170(%r15), %rax
orq 0x1b8(%r15), %rax
cmpq %rax, %r13
jne 0x1048a
movq 0x48(%r15), %rax
orq 0x90(%r15), %rax
orq 0xa0(%r15), %rax
orq 0x68(%r15), %rax
orq 0x110(%r15), %rax
orq 0x148(%r15), %rax
orq 0x180(%r15), %rax
orq 0x120(%r15), %rax
orq 0x168(%r15), %rax
orq 0x1b0(%r15), %rax
orq 0x1f8(%r15), %rax
cmpq %rax, %r12
jne 0x104a9
addq $0x1d0, %rsp            # imm = 0x1D0
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
leaq 0x1da1f(%rip), %rdi     # 0x2deb0
leaq 0x1d61e(%rip), %rsi     # 0x2dab6
leaq 0x1daf9(%rip), %rcx     # 0x2df98
movl $0x73, %edx
callq 0x20d0
leaq 0x1db07(%rip), %rdi     # 0x2dfb7
leaq 0x1d5ff(%rip), %rsi     # 0x2dab6
leaq 0x1dada(%rip), %rcx     # 0x2df98
movl $0x78, %edx
callq 0x20d0
// File: /workspace/github_cpp_makefile_star2_O3/jswaff[P]prophet3/test/attack__test.cpp
// Function: test_get_attackers()
void test_get_attackers() {
    position pos;
    set_pos(&pos,"1k1r3q/1ppn3p/p4b2/4p3/8/P2N2P1/1PP1R1BP/2K1Q3 w - -");

    uint64 attackers = get_attackers(&pos,E5,WHITE);

    assert(attackers & bb_squares[D3]);
    assert(attackers & bb_squares[E2]);
    assert(get_num_bits(attackers)==2);
}

// Assembly:
pushq %rbx
subq $0x1d0, %rsp            # imm = 0x1D0
leaq 0x1dd0d(%rip), %rsi     # 0x2e3e3
leaq 0x8(%rsp), %rbx
movq %rbx, %rdi
callq 0xaa82
movq %rbx, %rdi
movl $0x1c, %esi
movl $0x1, %edx
callq 0x39eb
leaq 0xe9db4(%rip), %rcx     # 0xfa4b0
testq %rax, 0x158(%rcx)
je 0x10724
testq %rax, 0x1a0(%rcx)
je 0x10743
movq %rax, %rdi
callq 0x3b14
cmpl $0x2, %eax
jne 0x10762
addq $0x1d0, %rsp            # imm = 0x1D0
popq %rbx
retq
leaq 0x1dced(%rip), %rdi     # 0x2e418
leaq 0x1d384(%rip), %rsi     # 0x2dab6
leaq 0x1dcfa(%rip), %rcx     # 0x2e433
movl $0xa1, %edx
callq 0x20d0
leaq 0x1dd03(%rip), %rdi     # 0x2e44d
leaq 0x1d365(%rip), %rsi     # 0x2dab6
leaq 0x1dcdb(%rip), %rcx     # 0x2e433
movl $0xa2, %edx
callq 0x20d0
leaq 0x1dcff(%rip), %rdi     # 0x2e468
leaq 0x1d346(%rip), %rsi     # 0x2dab6
leaq 0x1dcbc(%rip), %rcx     # 0x2e433
movl $0xa3, %edx
callq 0x20d0
// File: /workspace/github_cpp_makefile_star2_O3/jswaff[P]prophet3/test/attack__test.cpp
// Function: test_get_attackers2()
void test_get_attackers2() {
    position pos;
    set_pos(&pos,"1k1r3q/1ppn3p/p4b2/4p3/8/P2N2P1/1PP1R1BP/2K1Q3 w - -");

    uint64 attackers = get_attackers(&pos,E5,BLACK);

    assert(attackers & bb_squares[D7]);
    assert(attackers & bb_squares[F6]);
    assert(get_num_bits(attackers)==2);
}

// Assembly:
pushq %rbx
subq $0x1d0, %rsp            # imm = 0x1D0
leaq 0x1dc53(%rip), %rsi     # 0x2e3e3
leaq 0x8(%rsp), %rbx
movq %rbx, %rdi
callq 0xaa82
movq %rbx, %rdi
movl $0x1c, %esi
xorl %edx, %edx
callq 0x39eb
leaq 0xe9cfd(%rip), %rcx     # 0xfa4b0
testq %rax, 0x58(%rcx)
je 0x107d8
testq %rax, 0xa8(%rcx)
je 0x107f7
movq %rax, %rdi
callq 0x3b14
cmpl $0x2, %eax
jne 0x10816
addq $0x1d0, %rsp            # imm = 0x1D0
popq %rbx
retq
leaq 0x1dca4(%rip), %rdi     # 0x2e483
leaq 0x1d2d0(%rip), %rsi     # 0x2dab6
leaq 0x1dcb1(%rip), %rcx     # 0x2e49e
movl $0xac, %edx
callq 0x20d0
leaq 0x1dcbb(%rip), %rdi     # 0x2e4b9
leaq 0x1d2b1(%rip), %rsi     # 0x2dab6
leaq 0x1dc92(%rip), %rcx     # 0x2e49e
movl $0xad, %edx
callq 0x20d0
leaq 0x1dc4b(%rip), %rdi     # 0x2e468
leaq 0x1d292(%rip), %rsi     # 0x2dab6
leaq 0x1dc73(%rip), %rcx     # 0x2e49e
movl $0xae, %edx
callq 0x20d0
// File: /workspace/github_cpp_makefile_star2_O3/jswaff[P]prophet3/test/attack__test.cpp
// Function: test_get_attackers3()
void test_get_attackers3() {
    position pos;
    set_pos(&pos,"8/p1k5/1p6/8/3b4/1Q6/8/7K w - -");

    uint64 attackers = get_attackers(&pos,B6,WHITE);

    assert(attackers & bb_squares[B3]);
    assert(get_num_bits(attackers)==1);
}

// Assembly:
pushq %rbx
subq $0x1d0, %rsp            # imm = 0x1D0
leaq 0x1dc90(%rip), %rsi     # 0x2e4d4
leaq 0x8(%rsp), %rbx
movq %rbx, %rdi
callq 0xaa82
movq %rbx, %rdi
movl $0x11, %esi
movl $0x1, %edx
callq 0x39eb
leaq 0xe9c46(%rip), %rcx     # 0xfa4b0
testq %rax, 0x148(%rcx)
je 0x10889
movq %rax, %rdi
callq 0x3b14
cmpl $0x1, %eax
jne 0x108a8
addq $0x1d0, %rsp            # imm = 0x1D0
popq %rbx
retq
leaq 0x1dc64(%rip), %rdi     # 0x2e4f4
leaq 0x1d21f(%rip), %rsi     # 0x2dab6
leaq 0x1dc71(%rip), %rcx     # 0x2e50f
movl $0xb7, %edx
callq 0x20d0
leaq 0x1dc7b(%rip), %rdi     # 0x2e52a
leaq 0x1d200(%rip), %rsi     # 0x2dab6
leaq 0x1dc52(%rip), %rcx     # 0x2e50f
movl $0xb8, %edx
callq 0x20d0
// File: /workspace/github_cpp_makefile_star2_O3/jswaff[P]prophet3/test/attack__test.cpp
// Function: test_get_attackers4()
void test_get_attackers4() {
    position pos;
    set_pos(&pos,"8/p1k5/1p6/8/3b4/1Q6/8/7K w - -");

    uint64 attackers = get_attackers(&pos,B6,BLACK);

    assert(attackers & bb_squares[C7]);
    assert(attackers & bb_squares[A7]);
    assert(attackers & bb_squares[D4]);
    assert(get_num_bits(attackers)==3);
}

// Assembly:
pushq %rbx
subq $0x1d0, %rsp            # imm = 0x1D0
leaq 0x1dbfe(%rip), %rsi     # 0x2e4d4
leaq 0x8(%rsp), %rbx
movq %rbx, %rdi
callq 0xaa82
movq %rbx, %rdi
movl $0x11, %esi
xorl %edx, %edx
callq 0x39eb
leaq 0xe9bb7(%rip), %rcx     # 0xfa4b0
testq %rax, 0x50(%rcx)
je 0x10924
testq %rax, 0x40(%rcx)
je 0x10943
testq %rax, 0x118(%rcx)
je 0x10962
movq %rax, %rdi
callq 0x3b14
cmpl $0x3, %eax
jne 0x10981
addq $0x1d0, %rsp            # imm = 0x1D0
popq %rbx
retq
leaq 0x1dc1a(%rip), %rdi     # 0x2e545
leaq 0x1d184(%rip), %rsi     # 0x2dab6
leaq 0x1dc27(%rip), %rcx     # 0x2e560
movl $0xc1, %edx
callq 0x20d0
leaq 0x1dc31(%rip), %rdi     # 0x2e57b
leaq 0x1d165(%rip), %rsi     # 0x2dab6
leaq 0x1dc08(%rip), %rcx     # 0x2e560
movl $0xc2, %edx
callq 0x20d0
leaq 0x1dc2d(%rip), %rdi     # 0x2e596
leaq 0x1d146(%rip), %rsi     # 0x2dab6
leaq 0x1dbe9(%rip), %rcx     # 0x2e560
movl $0xc3, %edx
callq 0x20d0
leaq 0x1dc29(%rip), %rdi     # 0x2e5b1
leaq 0x1d127(%rip), %rsi     # 0x2dab6
leaq 0x1dbca(%rip), %rcx     # 0x2e560
movl $0xc4, %edx
callq 0x20d0
// File: /workspace/github_cpp_makefile_star2_O3/jswaff[P]prophet3/test/attack__test.cpp
// Function: test_attack()
void test_attack() {
    test_attacked_by_knight();
    test_attacked_by_king();
    test_attacked_by_pawn();
    test_attacked_by_rook();
    test_attacked_by_bishop();
    test_attacked_by_queen();
    test_get_attackers();
    test_get_attackers2();
    test_get_attackers3();
    test_get_attackers4();
}

// Assembly:
pushq %rax
callq 0xff54
callq 0x10081
callq 0x10190
callq 0x10255
callq 0x1036f
callq 0x104c8
callq 0x106c7
callq 0x10781
callq 0x10835
popq %rax
jmp 0x108c7
// File: /workspace/github_cpp_makefile_star2_O3/jswaff[P]prophet3/test/bitboards__test.cpp
// Function: test_isolate_lsb_bit()
void test_isolate_lsb_bit() {
    uint64 mask = bb_squares[A8] | bb_squares[E4] | bb_squares[F4] | bb_squares[D1];

    assert(isolate_lsb_bit(mask,0)==bb_squares[A8]);
    assert(isolate_lsb_bit(mask,1)==bb_squares[E4]);
    assert(isolate_lsb_bit(mask,2)==bb_squares[F4]);
    assert(isolate_lsb_bit(mask,3)==bb_squares[D1]);
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
leaq 0xe998b(%rip), %r14     # 0xfa4b0
movq 0x120(%r14), %rbx
orq (%r14), %rbx
orq 0x128(%r14), %rbx
orq 0x1d8(%r14), %rbx
movq %rbx, %rdi
xorl %esi, %esi
callq 0x3caa
cmpq (%r14), %rax
jne 0x10b96
movq %rbx, %rdi
movl $0x1, %esi
callq 0x3caa
cmpq 0x120(%r14), %rax
jne 0x10bb5
movq %rbx, %rdi
movl $0x2, %esi
callq 0x3caa
cmpq 0x128(%r14), %rax
jne 0x10bd4
movq %rbx, %rdi
movl $0x3, %esi
callq 0x3caa
cmpq 0x1d8(%r14), %rax
jne 0x10bf3
addq $0x8, %rsp
popq %rbx
popq %r14
retq
leaq 0x1db3f(%rip), %rdi     # 0x2e6dc
leaq 0x1da48(%rip), %rsi     # 0x2e5ec
leaq 0x1db59(%rip), %rcx     # 0x2e704
movl $0x1e, %edx
callq 0x20d0
leaq 0x1db64(%rip), %rdi     # 0x2e720
leaq 0x1da29(%rip), %rsi     # 0x2e5ec
leaq 0x1db3a(%rip), %rcx     # 0x2e704
movl $0x1f, %edx
callq 0x20d0
leaq 0x1db6d(%rip), %rdi     # 0x2e748
leaq 0x1da0a(%rip), %rsi     # 0x2e5ec
leaq 0x1db1b(%rip), %rcx     # 0x2e704
movl $0x20, %edx
callq 0x20d0
leaq 0x1db76(%rip), %rdi     # 0x2e770
leaq 0x1d9eb(%rip), %rsi     # 0x2e5ec
leaq 0x1dafc(%rip), %rcx     # 0x2e704
movl $0x21, %edx
callq 0x20d0
// File: /workspace/github_cpp_makefile_star2_O3/jswaff[P]prophet3/test/bitboards__test.cpp
// Function: test_pawn_attacks()
void test_pawn_attacks() {
    assert(bb_pawn_attacks[E4][WHITE]==(bb_squares[D5] | bb_squares[F5]));
    assert(bb_pawn_attacks[E4][BLACK]==(bb_squares[D3] | bb_squares[F3]));

    assert(bb_pawn_attacks[A2][WHITE]==bb_squares[B3]);
    assert(bb_pawn_attacks[A2][BLACK]==bb_squares[B1]);

    assert(bb_pawn_attacks[H7][WHITE]==bb_squares[G8]);
    assert(bb_pawn_attacks[H7][BLACK]==bb_squares[G6]);
}

// Assembly:
pushq %rax
leaq 0xe987d(%rip), %rax     # 0xfaab0
leaq 0xe9276(%rip), %rcx     # 0xfa4b0
movq 0xe8(%rcx), %rdx
orq 0xd8(%rcx), %rdx
cmpq %rdx, 0x248(%rax)
jne 0x112b3
movq 0x168(%rcx), %rdx
orq 0x158(%rcx), %rdx
cmpq %rdx, 0x240(%rax)
jne 0x112d2
movq 0x308(%rax), %rdx
cmpq 0x148(%rcx), %rdx
jne 0x112f1
movq 0x300(%rax), %rdx
cmpq 0x1c8(%rcx), %rdx
jne 0x11310
movq 0xf8(%rax), %rdx
cmpq 0x30(%rcx), %rdx
jne 0x1132f
movq 0xf0(%rax), %rax
cmpq 0xb0(%rcx), %rax
jne 0x1134e
popq %rax
retq
leaq 0x1d74c(%rip), %rdi     # 0x2ea06
leaq 0x1d32b(%rip), %rsi     # 0x2e5ec
leaq 0x1d77c(%rip), %rcx     # 0x2ea44
movl $0x7b, %edx
callq 0x20d0
leaq 0x1d784(%rip), %rdi     # 0x2ea5d
leaq 0x1d30c(%rip), %rsi     # 0x2e5ec
leaq 0x1d75d(%rip), %rcx     # 0x2ea44
movl $0x7c, %edx
callq 0x20d0
leaq 0x1d7a3(%rip), %rdi     # 0x2ea9b
leaq 0x1d2ed(%rip), %rsi     # 0x2e5ec
leaq 0x1d73e(%rip), %rcx     # 0x2ea44
movl $0x7e, %edx
callq 0x20d0
leaq 0x1d7af(%rip), %rdi     # 0x2eac6
leaq 0x1d2ce(%rip), %rsi     # 0x2e5ec
leaq 0x1d71f(%rip), %rcx     # 0x2ea44
movl $0x7f, %edx
callq 0x20d0
leaq 0x1d7bb(%rip), %rdi     # 0x2eaf1
leaq 0x1d2af(%rip), %rsi     # 0x2e5ec
leaq 0x1d700(%rip), %rcx     # 0x2ea44
movl $0x81, %edx
callq 0x20d0
leaq 0x1d7c7(%rip), %rdi     # 0x2eb1c
leaq 0x1d290(%rip), %rsi     # 0x2e5ec
leaq 0x1d6e1(%rip), %rcx     # 0x2ea44
movl $0x82, %edx
callq 0x20d0
// File: /workspace/github_cpp_makefile_star2_O3/jswaff[P]prophet3/test/bitboards__test.cpp
// Function: test_rays()
void test_rays() {
    assert(bb_rays[D5][NORTH] == (bb_squares[D6] | bb_squares[D7] | bb_squares[D8]));
    assert(bb_rays[D5][SOUTH] == (bb_squares[D4] | bb_squares[D3] | bb_squares[D2] | bb_squares[D1]));
    assert(bb_rays[D5][WEST] == (bb_squares[C5] | bb_squares[B5] | bb_squares[A5]));
    assert(bb_rays[D5][EAST] == (bb_squares[E5] | bb_squares[F5] | bb_squares[G5] | bb_squares[H5]));
    assert(bb_rays[D5][NORTHEAST] == (bb_squares[E6] | bb_squares[F7] | bb_squares[G8]));
    assert(bb_rays[D5][SOUTHEAST] == (bb_squares[E4] | bb_squares[F3] | bb_squares[G2] | bb_squares[H1]));
    assert(bb_rays[D5][SOUTHWEST] == (bb_squares[C4] | bb_squares[B3] | bb_squares[A2]));
    assert(bb_rays[D5][NORTHWEST] == (bb_squares[C6] | bb_squares[B7] | bb_squares[A8]));
}

// Assembly:
pushq %rax
leaq 0xe9b3b(%rip), %rax     # 0xfaeb0
leaq 0xe9134(%rip), %rcx     # 0xfa4b0
movq 0x58(%rcx), %rdx
orq 0x98(%rcx), %rdx
orq 0x18(%rcx), %rdx
cmpq %rdx, 0x6c0(%rax)
jne 0x11492
movq 0x158(%rcx), %rdx
orq 0x118(%rcx), %rdx
orq 0x198(%rcx), %rdx
orq 0x1d8(%rcx), %rdx
cmpq %rdx, 0x6e0(%rax)
jne 0x114b1
movq 0xc8(%rcx), %rdx
orq 0xd0(%rcx), %rdx
orq 0xc0(%rcx), %rdx
cmpq %rdx, 0x6f0(%rax)
jne 0x114d0
movdqa 0xe0(%rcx), %xmm0
por 0xf0(%rcx), %xmm0
pshufd $0xee, %xmm0, %xmm1     # xmm1 = xmm0[2,3,2,3]
por %xmm0, %xmm1
movq %xmm1, %rdx
cmpq %rdx, 0x6d0(%rax)
jne 0x114ef
movq 0x68(%rcx), %rdx
orq 0xa0(%rcx), %rdx
orq 0x30(%rcx), %rdx
cmpq %rdx, 0x6c8(%rax)
jne 0x1150e
movq 0x168(%rcx), %rdx
orq 0x120(%rcx), %rdx
orq 0x1b0(%rcx), %rdx
orq 0x1f8(%rcx), %rdx
cmpq %rdx, 0x6d8(%rax)
jne 0x1152d
movq 0x148(%rcx), %rdx
orq 0x110(%rcx), %rdx
orq 0x180(%rcx), %rdx
cmpq %rdx, 0x6e8(%rax)
jne 0x1154c
movq 0x48(%rcx), %rdx
orq 0x90(%rcx), %rdx
orq (%rcx), %rdx
cmpq %rdx, 0x6f8(%rax)
jne 0x1156b
popq %rax
retq
leaq 0x1d6ae(%rip), %rdi     # 0x2eb47
leaq 0x1d14c(%rip), %rsi     # 0x2e5ec
leaq 0x1d6e9(%rip), %rcx     # 0x2eb90
movl $0x86, %edx
callq 0x20d0
leaq 0x1d6e9(%rip), %rdi     # 0x2eba1
leaq 0x1d12d(%rip), %rsi     # 0x2e5ec
leaq 0x1d6ca(%rip), %rcx     # 0x2eb90
movl $0x87, %edx
callq 0x20d0
leaq 0x1d724(%rip), %rdi     # 0x2ebfb
leaq 0x1d10e(%rip), %rsi     # 0x2e5ec
leaq 0x1d6ab(%rip), %rcx     # 0x2eb90
movl $0x88, %edx
callq 0x20d0
leaq 0x1d74d(%rip), %rdi     # 0x2ec43
leaq 0x1d0ef(%rip), %rsi     # 0x2e5ec
leaq 0x1d68c(%rip), %rcx     # 0x2eb90
movl $0x89, %edx
callq 0x20d0
leaq 0x1d787(%rip), %rdi     # 0x2ec9c
leaq 0x1d0d0(%rip), %rsi     # 0x2e5ec
leaq 0x1d66d(%rip), %rcx     # 0x2eb90
movl $0x8a, %edx
callq 0x20d0
leaq 0x1d7b5(%rip), %rdi     # 0x2ece9
leaq 0x1d0b1(%rip), %rsi     # 0x2e5ec
leaq 0x1d64e(%rip), %rcx     # 0x2eb90
movl $0x8b, %edx
callq 0x20d0
leaq 0x1d7f4(%rip), %rdi     # 0x2ed47
leaq 0x1d092(%rip), %rsi     # 0x2e5ec
leaq 0x1d62f(%rip), %rcx     # 0x2eb90
movl $0x8c, %edx
callq 0x20d0
leaq 0x1d822(%rip), %rdi     # 0x2ed94
leaq 0x1d073(%rip), %rsi     # 0x2e5ec
leaq 0x1d610(%rip), %rcx     # 0x2eb90
movl $0x8d, %edx
callq 0x20d0
// File: /workspace/github_cpp_makefile_star2_O3/jswaff[P]prophet3/test/bitboards__test.cpp
// Function: test_bitboards()
void test_bitboards() {
    test_get_num_bits();
    test_get_lsb();
    test_get_msb();
    test_isolate_lsb_bit();
    test_knight_moves();
    test_king_moves();
    test_pawn_attacks();
    test_rays();
}

// Assembly:
pushq %rax
callq 0x109d4
callq 0x10a3e
callq 0x10aac
callq 0x10b1a
callq 0x10c12
callq 0x10f06
callq 0x1122b
popq %rax
jmp 0x1136d
// File: /workspace/github_cpp_makefile_star2_O3/jswaff[P]prophet3/test/book__test.cpp
// Function: test_build_book_key()
void test_build_book_key() {
    position pos;
    reset_pos(&pos);

    int64 bkey = build_book_key(&pos);
    assert(bkey==8683256505108505948L);

    set_pos(&pos,"8/4Pk1p/6p1/1r6/8/5N2/2B2PPP/b5K1 w - - ");
    bkey = build_book_key(&pos);
    assert(bkey==5404474865777589476L);

    set_pos(&pos,"8/8/3k4/2n1P3/8/8/3rP3/RN2K2R w KQ - 0 1");
    bkey = build_book_key(&pos);
    assert(bkey==-6221215072275532145L);

    set_pos(&pos,"rnbqkbnr/pppppppp/8/8/4P3/8/PPPP1PPP/RNBQKBNR b KQkq e3 0 1");
    bkey = build_book_key(&pos);
    assert(bkey==8410219886346271288L);

    set_pos(&pos,"r3k2r/8/8/8/8/5Q2/8/4K3 b kq - 0 1");
    bkey = build_book_key(&pos);
    assert(bkey==-7818203441519759474);
}

// Assembly:
pushq %rbx
subq $0x1d0, %rsp            # imm = 0x1D0
leaq 0x8(%rsp), %rbx
movq %rbx, %rdi
callq 0xaa51
movq %rbx, %rdi
callq 0x459b
movabsq $0x78811fc91897a55c, %rcx # imm = 0x78811FC91897A55C
cmpq %rcx, %rax
jne 0x116a9
leaq 0x1d840(%rip), %rsi     # 0x2ee2b
leaq 0x8(%rsp), %rbx
movq %rbx, %rdi
callq 0xaa82
movq %rbx, %rdi
callq 0x459b
movabsq $0x4b008d419c333ce4, %rcx # imm = 0x4B008D419C333CE4
cmpq %rcx, %rax
jne 0x116c8
leaq 0x1d855(%rip), %rsi     # 0x2ee6f
leaq 0x8(%rsp), %rbx
movq %rbx, %rdi
callq 0xaa82
movq %rbx, %rdi
callq 0x459b
movabsq $-0x56563225964a0971, %rcx # imm = 0xA9A9CDDA69B5F68F
cmpq %rcx, %rax
jne 0x116e7
leaq 0x1beaa(%rip), %rsi     # 0x2d4f3
leaq 0x8(%rsp), %rbx
movq %rbx, %rdi
callq 0xaa82
movq %rbx, %rdi
callq 0x459b
movabsq $0x74b71a6d68987a38, %rcx # imm = 0x74B71A6D68987A38
cmpq %rcx, %rax
jne 0x11706
leaq 0x1d857(%rip), %rsi     # 0x2eecf
leaq 0x8(%rsp), %rbx
movq %rbx, %rdi
callq 0xaa82
movq %rbx, %rdi
callq 0x459b
movabsq $-0x6c7fd69b81859072, %rcx # imm = 0x938029647E7A6F8E
cmpq %rcx, %rax
jne 0x11725
addq $0x1d0, %rsp            # imm = 0x1D0
popq %rbx
retq
leaq 0x1d731(%rip), %rdi     # 0x2ede1
leaq 0x1d745(%rip), %rsi     # 0x2edfc
leaq 0x1d752(%rip), %rcx     # 0x2ee10
movl $0x12, %edx
callq 0x20d0
leaq 0x1d785(%rip), %rdi     # 0x2ee54
leaq 0x1d726(%rip), %rsi     # 0x2edfc
leaq 0x1d733(%rip), %rcx     # 0x2ee10
movl $0x16, %edx
callq 0x20d0
leaq 0x1d7aa(%rip), %rdi     # 0x2ee98
leaq 0x1d707(%rip), %rsi     # 0x2edfc
leaq 0x1d714(%rip), %rcx     # 0x2ee10
movl $0x1a, %edx
callq 0x20d0
leaq 0x1d7a7(%rip), %rdi     # 0x2eeb4
leaq 0x1d6e8(%rip), %rsi     # 0x2edfc
leaq 0x1d6f5(%rip), %rcx     # 0x2ee10
movl $0x1e, %edx
callq 0x20d0
leaq 0x1d7c6(%rip), %rdi     # 0x2eef2
leaq 0x1d6c9(%rip), %rsi     # 0x2edfc
leaq 0x1d6d6(%rip), %rcx     # 0x2ee10
movl $0x22, %edx
callq 0x20d0
// File: /workspace/github_cpp_makefile_star2_O3/jswaff[P]prophet3/test/draw__test.cpp
// Function: test_is_draw_by_50()
void test_is_draw_by_50() {
    position pos;
    reset_pos(&pos);
    assert(!is_draw_by_50(&pos));

    pos.fifty_counter=pos.move_counter=49;
    assert(!is_draw_by_50(&pos));

    pos.fifty_counter=pos.move_counter=50;
    assert(!is_draw_by_50(&pos));

    pos.fifty_counter=pos.move_counter=51;
    assert(!is_draw_by_50(&pos));

    pos.fifty_counter=pos.move_counter=99;
    assert(!is_draw_by_50(&pos));

    pos.fifty_counter=pos.move_counter=100;
    assert(is_draw_by_50(&pos));
}

// Assembly:
pushq %rbx
subq $0x1d0, %rsp            # imm = 0x1D0
leaq 0x8(%rsp), %rbx
movq %rbx, %rdi
callq 0xaa51
movq %rbx, %rdi
callq 0x4ba8
testb %al, %al
jne 0x11831
movabsq $0x3100000031, %rax     # imm = 0x3100000031
leaq 0x8(%rsp), %rdi
movq %rax, 0x144(%rdi)
callq 0x4ba8
testb %al, %al
jne 0x11850
movabsq $0x3200000032, %rax     # imm = 0x3200000032
leaq 0x8(%rsp), %rdi
movq %rax, 0x144(%rdi)
callq 0x4ba8
testb %al, %al
jne 0x1186f
movabsq $0x3300000033, %rax     # imm = 0x3300000033
leaq 0x8(%rsp), %rdi
movq %rax, 0x144(%rdi)
callq 0x4ba8
testb %al, %al
jne 0x1188e
movabsq $0x6300000063, %rax     # imm = 0x6300000063
leaq 0x8(%rsp), %rdi
movq %rax, 0x144(%rdi)
callq 0x4ba8
testb %al, %al
jne 0x118ad
movabsq $0x6400000064, %rax     # imm = 0x6400000064
leaq 0x8(%rsp), %rdi
movq %rax, 0x144(%rdi)
callq 0x4ba8
testb %al, %al
je 0x118cc
addq $0x1d0, %rsp            # imm = 0x1D0
popq %rbx
retq
leaq 0x1d6d5(%rip), %rdi     # 0x2ef0d
leaq 0x1d6e3(%rip), %rsi     # 0x2ef22
leaq 0x1d6f0(%rip), %rcx     # 0x2ef36
movl $0xf, %edx
callq 0x20d0
leaq 0x1d6b6(%rip), %rdi     # 0x2ef0d
leaq 0x1d6c4(%rip), %rsi     # 0x2ef22
leaq 0x1d6d1(%rip), %rcx     # 0x2ef36
movl $0x12, %edx
callq 0x20d0
leaq 0x1d697(%rip), %rdi     # 0x2ef0d
leaq 0x1d6a5(%rip), %rsi     # 0x2ef22
leaq 0x1d6b2(%rip), %rcx     # 0x2ef36
movl $0x15, %edx
callq 0x20d0
leaq 0x1d678(%rip), %rdi     # 0x2ef0d
leaq 0x1d686(%rip), %rsi     # 0x2ef22
leaq 0x1d693(%rip), %rcx     # 0x2ef36
movl $0x18, %edx
callq 0x20d0
leaq 0x1d659(%rip), %rdi     # 0x2ef0d
leaq 0x1d667(%rip), %rsi     # 0x2ef22
leaq 0x1d674(%rip), %rcx     # 0x2ef36
movl $0x1b, %edx
callq 0x20d0
leaq 0x1d63b(%rip), %rdi     # 0x2ef0e
leaq 0x1d648(%rip), %rsi     # 0x2ef22
leaq 0x1d655(%rip), %rcx     # 0x2ef36
movl $0x1e, %edx
callq 0x20d0
// File: /workspace/github_cpp_makefile_star2_O3/jswaff[P]prophet3/test/eval__test.cpp
// Function: test_start_pos_is_0()
void test_start_pos_is_0() {
    position pos;
    reset_pos(&pos);
    int32 score=eval(&pos,false);
    assert(score==0);
}

// Assembly:
pushq %rbx
subq $0x1d0, %rsp            # imm = 0x1D0
leaq 0x8(%rsp), %rbx
movq %rbx, %rdi
callq 0xaa51
movq %rbx, %rdi
xorl %esi, %esi
callq 0x58f7
testl %eax, %eax
jne 0x120b8
addq $0x1d0, %rsp            # imm = 0x1D0
popq %rbx
retq
leaq 0x1d041(%rip), %rdi     # 0x2f100
leaq 0x1d043(%rip), %rsi     # 0x2f109
leaq 0x1d050(%rip), %rcx     # 0x2f11d
movl $0x12, %edx
callq 0x20d0