LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O3/kelwinfc[P]ci4721-Fernandez-Gyomrey/src/inst.cpp
// Function: quad::quad(inst::OP, opd*, opd*, opd*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
quad::quad(OP op, opd *arg0, opd *arg1, opd *arg2, string comment){
    this->op = op;
    this->arg0 = arg0;
    this->arg1 = arg1;
    this->arg2 = arg2;
    if (comment.compare("")) {
        comment = "# " + comment + "\n";
    }
    this->comment = comment;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x40, %rsp
movq %r9, %r14
movq %rdi, %rbx
leaq 0x38(%rdi), %r12
movq %r12, 0x28(%rdi)
movq $0x0, 0x30(%rdi)
movb $0x0, 0x38(%rdi)
leaq 0x21190(%rip), %rax     # 0x3ecc8
movq %rax, (%rdi)
movl %esi, 0xc(%rdi)
movq %rdx, 0x10(%rdi)
movq %rcx, 0x18(%rdi)
movq %r8, 0x20(%rdi)
leaq 0x11831(%rip), %rsi     # 0x2f382
movq %r9, %rdi
callq 0x60d0
testl %eax, %eax
je 0x1dc08
leaq 0x11b66(%rip), %rsi     # 0x2f6ce
movq %rsp, %rdi
movq %r14, %rdx
callq 0x1ca11
leaq 0x11807(%rip), %rsi     # 0x2f381
movq %rsp, %rdi
callq 0x65b0
leaq 0x30(%rsp), %r13
movq %r13, -0x10(%r13)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x1dba9
movq %rdx, 0x20(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x30(%rsp)
jmp 0x1dbb1
movups (%rcx), %xmm0
movups %xmm0, (%r13)
movq 0x8(%rax), %rdx
leaq 0x20(%rsp), %r15
movq %rdx, 0x8(%r15)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movq %r14, %rdi
movq %r15, %rsi
callq 0x63d0
movq (%r15), %rdi
cmpq %r13, %rdi
je 0x1dbed
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x6300
leaq 0x10(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x1dc08
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x6300
leaq 0x28(%rbx), %rdi
movq %r14, %rsi
callq 0x6180
addq $0x40, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
movq %rax, %r14
leaq 0x10(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x1dc47
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x6300
jmp 0x1dc47
jmp 0x1dc44
movq %rax, %r14
leaq 0x210ca(%rip), %rax     # 0x3ed18
movq %rax, (%rbx)
movq 0x28(%rbx), %rdi
cmpq %r12, %rdi
je 0x1dc66
movq (%r12), %rsi
incq %rsi
callq 0x6300
movq %r14, %rdi
callq 0x6560
// File: /workspace/github_cpp_makefile_star2_O3/kelwinfc[P]ci4721-Fernandez-Gyomrey/src/string_table.cpp
// Function: string_table::string_table()
string_table::string_table() {
    offset = 0;
    push_back("Se trató de utilizar una propiedad no activa de la unión en (");
    push_back(", ");
    push_back(")");
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x60, %rsp
movq %rdi, %r14
leaq 0x8(%rdi), %rbx
xorps %xmm0, %xmm0
movups %xmm0, 0x8(%rdi)
movq $0x0, 0x18(%rdi)
movl $0x0, (%rdi)
leaq 0x50(%rsp), %r15
movq %r15, -0x10(%r15)
leaq 0xcd5e(%rip), %rsi      # 0x2f7f3
leaq 0xcd96(%rip), %rdx      # 0x2f832
leaq 0x40(%rsp), %rdi
callq 0x7008
leaq 0x40(%rsp), %rsi
movq %rbx, %rdi
callq 0x22e20
movl (%r14), %eax
movl 0x48(%rsp), %ecx
addl %ecx, %eax
incl %eax
movl %eax, (%r14)
movq 0x40(%rsp), %rdi
cmpq %r15, %rdi
je 0x22ad8
movq 0x50(%rsp), %rsi
incq %rsi
callq 0x6300
leaq 0x30(%rsp), %r15
movq %r15, -0x10(%r15)
leaq 0xaf5e(%rip), %rsi      # 0x2da46
leaq 0xaf59(%rip), %rdx      # 0x2da48
leaq 0x20(%rsp), %rdi
callq 0x7008
leaq 0x20(%rsp), %rsi
movq %rbx, %rdi
callq 0x22e20
movl (%r14), %eax
movl 0x28(%rsp), %ecx
addl %ecx, %eax
incl %eax
movl %eax, (%r14)
movq 0x20(%rsp), %rdi
cmpq %r15, %rdi
je 0x22b2b
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x6300
leaq 0x10(%rsp), %r15
movq %r15, -0x10(%r15)
leaq 0xa9bd(%rip), %rsi      # 0x2d4f8
leaq 0xa9b7(%rip), %rdx      # 0x2d4f9
movq %rsp, %rdi
callq 0x7008
movq %rsp, %rsi
movq %rbx, %rdi
callq 0x22e20
movl (%r14), %eax
movl 0x8(%rsp), %ecx
addl %ecx, %eax
incl %eax
movl %eax, (%r14)
movq (%rsp), %rdi
cmpq %r15, %rdi
je 0x22b79
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x6300
addq $0x60, %rsp
popq %rbx
popq %r14
popq %r15
retq
movq %rax, %r14
movq (%rsp), %rdi
cmpq %r15, %rdi
je 0x22bcd
movq 0x10(%rsp), %rsi
jmp 0x22bc0
jmp 0x22bca
movq %rax, %r14
movq 0x20(%rsp), %rdi
cmpq %r15, %rdi
je 0x22bcd
movq 0x30(%rsp), %rsi
jmp 0x22bc0
jmp 0x22bca
movq %rax, %r14
movq 0x40(%rsp), %rdi
cmpq %r15, %rdi
je 0x22bcd
movq 0x50(%rsp), %rsi
incq %rsi
callq 0x6300
jmp 0x22bcd
movq %rax, %r14
movq %rbx, %rdi
callq 0x1ae52
movq %r14, %rdi
callq 0x6560
nop
// File: /workspace/github_cpp_makefile_star2_O3/kelwinfc[P]ci4721-Fernandez-Gyomrey/src/string_table.cpp
// Function: string_table::push_back(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
int string_table::push_back(string s) {
    table.push_back(s);
    int t = offset;
    offset += s.length() + 1;//El null para asciiz
    return t;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
addq $0x8, %rdi
callq 0x22e20
movl (%r14), %eax
movl 0x8(%rbx), %ecx
addl %eax, %ecx
incl %ecx
movl %ecx, (%r14)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O3/kelwinfc[P]ci4721-Fernandez-Gyomrey/src/string_table.cpp
// Function: string_table::to_string(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
string string_table::to_string(string s) {
    string ss = "";
    for (unsigned int i = 0; i < s.length(); ++ i) {
        if ('\\' == s[i]) ss += '\\';
        ss += s[i];
    }
    return ss;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rsi, %r14
movq %rdi, %rbx
leaq 0x10(%rdi), %r15
movq %r15, (%rdi)
leaq 0xc75c(%rip), %rdx      # 0x2f382
movq %rdx, %rsi
callq 0x7008
cmpq $0x0, 0x8(%r14)
je 0x22c72
movl $0x1, %ebp
xorl %r12d, %r12d
movq (%r14), %rax
movb (%rax,%r12), %al
cmpb $0x5c, %al
jne 0x22c5c
movq %rbx, %rdi
movl $0x5c, %esi
callq 0x62a0
movq (%r14), %rax
movb (%rax,%r12), %al
movsbl %al, %esi
movq %rbx, %rdi
callq 0x62a0
movl %ebp, %r12d
incl %ebp
cmpq %r12, 0x8(%r14)
ja 0x22c3d
movq %rbx, %rax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %r14
movq (%rbx), %rdi
cmpq %r15, %rdi
je 0x22c94
movq (%r15), %rsi
incq %rsi
callq 0x6300
movq %r14, %rdi
callq 0x6560
// File: /workspace/github_cpp_makefile_star2_O3/kelwinfc[P]ci4721-Fernandez-Gyomrey/src/main.cpp
// Function: main_ast_create(main_args)
AST* main_ast_create(main_args args){

    p = new AST();
    yyin = args.in;
    do {
        yyparse();
    } while (!feof(yyin));

    if (args.to_single_archive){
        main_redirect_stdout("bla.output");
    }
    return p;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %r14
movq %rdi, %rbx
movl $0x28, %edi
callq 0x62f0
movq %rax, %r15
movq %rax, %rdi
callq 0x15c4e
movq %r15, 0x14b23(%rip)     # 0x3f3d0
movq %r14, 0x14be4(%rip)     # 0x3f498
callq 0x2300c
movq 0x14bd8(%rip), %rdi     # 0x3f498
callq 0x6490
testl %eax, %eax
je 0x2a8b4
testb $0x1, %bl
je 0x2a8da
leaq 0x82ad(%rip), %rdi      # 0x32b82
callq 0x2a983
movq 0x14aef(%rip), %rax     # 0x3f3d0
popq %rbx
popq %r14
popq %r15
retq
movq %rax, %rbx
movl $0x28, %esi
movq %r15, %rdi
callq 0x6300
movq %rbx, %rdi
callq 0x6560
// File: /workspace/github_cpp_makefile_star2_O3/kelwinfc[P]ci4721-Fernandez-Gyomrey/src/main.cpp
// Function: main_ast_check(AST*)
string_table* main_ast_check(AST *ast){

    string_table* strings = new string_table();
    symbol_table* st = new symbol_table(strings);
    
    ast->fill_and_check(st);
    
    delete st;

    return strings;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %r14
movl $0x20, %edi
callq 0x62f0
movq %rax, %rbx
movq %rax, %rdi
callq 0x22a60
movl $0x48, %edi
callq 0x62f0
movq %rax, %r15
movq %rax, %rdi
movq %rbx, %rsi
callq 0x18390
movq (%r14), %rax
movq %r14, %rdi
movq %r15, %rsi
callq *0x8(%rax)
movq %r15, %rdi
callq 0x166f8
movl $0x48, %esi
movq %r15, %rdi
callq 0x6300
movq %rbx, %rax
popq %rbx
popq %r14
popq %r15
retq
movq %rax, %r14
movl $0x48, %esi
movq %r15, %rdi
jmp 0x2a976
movq %rax, %r14
movl $0x20, %esi
movq %rbx, %rdi
callq 0x6300
movq %r14, %rdi
callq 0x6560
// File: /workspace/github_cpp_makefile_star2_O3/kelwinfc[P]ci4721-Fernandez-Gyomrey/src/main.cpp
// Function: main_redirect_stdout(char const*)
void main_redirect_stdout(const char *f)
{
    static FILE *fd = 0, *stdout_back = 0;
    static streambuf *rdbuf_back = 0;
    static ofstream filestr;
    if (0 == stdout_back) {
        stdout_back = stdout;
        rdbuf_back = cout.rdbuf();
    }
    if (0 != fd && stdout != fd) {
        fclose(fd);
        filestr.close();
    }
    if (0 == f) {
        stdout = stdout_back;
        cout.rdbuf(rdbuf_back);
    } else {
        fd = stdout = fopen(f, "w");
        filestr.open(f);
        cout.rdbuf(filestr.rdbuf());
    }
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movb 0x14d88(%rip), %al      # 0x3f718
testb %al, %al
je 0x2aa6c
cmpq $0x0, 0x14b68(%rip)     # 0x3f508
movq 0x145d9(%rip), %r14     # 0x3ef80
movq (%r14), %rax
jne 0x2a9d0
movq %rax, 0x14b55(%rip)     # 0x3f508
movq 0x14606(%rip), %rcx     # 0x3efc0
movq (%rcx), %rdx
movq -0x18(%rdx), %rdx
movq 0xe8(%rcx,%rdx), %rcx
movq %rcx, 0x14b40(%rip)     # 0x3f510
movq 0x14b29(%rip), %rdi     # 0x3f500
testq %rdi, %rdi
sete %cl
cmpq %rdi, %rax
sete %al
orb %cl, %al
jne 0x2a9f8
callq 0x62e0
leaq 0x14b25(%rip), %rdi     # 0x3f518
callq 0x6420
testq %rbx, %rbx
je 0x2aa41
leaq 0x82b2(%rip), %rsi      # 0x32cb6
movq %rbx, %rdi
callq 0x63a0
movq %rax, (%r14)
movq %rax, 0x14aea(%rip)     # 0x3f500
leaq 0x14afb(%rip), %rdi     # 0x3f518
movq %rbx, %rsi
movl $0x10, %edx
callq 0x6070
movq 0x1458f(%rip), %rdi     # 0x3efc0
movq (%rdi), %rax
addq -0x18(%rax), %rdi
leaq 0x14ae1(%rip), %rsi     # 0x3f520
jmp 0x2aa60
movq 0x14ac0(%rip), %rax     # 0x3f508
movq %rax, (%r14)
movq 0x1456e(%rip), %rdi     # 0x3efc0
movq (%rdi), %rax
addq -0x18(%rax), %rdi
movq 0x14ab0(%rip), %rsi     # 0x3f510
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x65a0
leaq 0x14ca5(%rip), %rdi     # 0x3f718
callq 0x6580
testl %eax, %eax
je 0x2a998
leaq 0x14a91(%rip), %rdi     # 0x3f518
callq 0x6520
movq 0x1453d(%rip), %rdi     # 0x3efd0
leaq 0x14a7e(%rip), %rsi     # 0x3f518
leaq 0x1484f(%rip), %rdx     # 0x3f2f0
callq 0x62b0
leaq 0x14c6b(%rip), %rdi     # 0x3f718
callq 0x61c0
jmp 0x2a998
movq %rax, %rbx
leaq 0x14c57(%rip), %rdi     # 0x3f718
callq 0x61b0
movq %rbx, %rdi
callq 0x6560
// File: /workspace/github_cpp_makefile_star2_O3/kelwinfc[P]ci4721-Fernandez-Gyomrey/src/main.cpp
// Function: main_tac_create(main_args, AST*)
Tac* main_tac_create(main_args args, AST *ast){

    Tac* tac = ast->to_tac();
    if (args.to_separate_archives) {
        main_redirect_stdout("bla.tac");
    }
    tac->dump(cout, args.tac_with_comments);

    if (!args.to_separate_archives) {
        cout << "-------------------------------------------------------" << endl << endl;
    }

    return tac;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %r14
movq (%rdx), %rax
movq %rdx, %rdi
callq *0x10(%rax)
movq %rax, %rbx
btl $0x8, %r14d
jb 0x2ab71
shrl $0x18, %r14d
andl $0x1, %r14d
movq 0x144c4(%rip), %r15     # 0x3efc0
movq %rbx, %rdi
movq %r15, %rsi
movl %r14d, %edx
callq 0x2b3ac
leaq 0x7fc8(%rip), %rsi      # 0x32ad9
movl $0x37, %edx
movq %r15, %rdi
callq 0x6370
movq (%r15), %rax
movq -0x18(%rax), %rdi
addq %r15, %rdi
movl $0xa, %esi
callq 0x62c0
movsbl %al, %esi
movq %r15, %rdi
callq 0x6040
movq %rax, %rdi
callq 0x6200
movq %rax, %r14
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x62c0
movsbl %al, %esi
movq %r14, %rdi
callq 0x6040
movq %rax, %rdi
callq 0x6200
jmp 0x2ab97
leaq 0x808b(%rip), %rdi      # 0x32c03
callq 0x2a983
shrl $0x18, %r14d
andl $0x1, %r14d
movq 0x14434(%rip), %rsi     # 0x3efc0
movq %rbx, %rdi
movl %r14d, %edx
callq 0x2b3ac
movq %rbx, %rax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O3/kelwinfc[P]ci4721-Fernandez-Gyomrey/src/main.cpp
// Function: main_tac_dump(main_args, Tac*)
void main_tac_dump(main_args args, Tac* tac)
{
    main_redirect_stdout();
    cout << "Escribiendo bloques básico en bla.blocks"
         << " y grafo de flujo en bla.png\n\n";
    dump_in_file("bla");

    if (!args.to_separate_archives && !args.to_single_archive) {
        cout << "-------------------------------------------------------" << endl << endl;
    }
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rdi, %r14
xorl %edi, %edi
callq 0x2a983
movq 0x143f2(%rip), %rbx     # 0x3efc0
leaq 0x8036(%rip), %rsi      # 0x32c0b
movl $0x29, %edx
movq %rbx, %rdi
callq 0x6370
leaq 0x804c(%rip), %rsi      # 0x32c35
movl $0x1e, %edx
movq %rbx, %rdi
callq 0x6370
leaq 0x18(%rsp), %r12
movq %r12, -0x10(%r12)
leaq 0x477c(%rip), %rsi      # 0x2f383
leaq 0x4778(%rip), %rdx      # 0x2f386
leaq 0x8(%rsp), %r15
movq %r15, %rdi
callq 0x7008
movq %r15, %rdi
callq 0x1c155
movq 0x8(%rsp), %rdi
cmpq %r12, %rdi
je 0x2ac3a
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x6300
btl $0x8, %r14d
jb 0x2acac
testb $0x1, %r14b
jne 0x2acac
leaq 0x7e8b(%rip), %rsi      # 0x32ad9
movl $0x37, %edx
movq %rbx, %rdi
callq 0x6370
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x62c0
movsbl %al, %esi
movq %rbx, %rdi
callq 0x6040
movq %rax, %rdi
callq 0x6200
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x62c0
movsbl %al, %esi
movq %rbx, %rdi
callq 0x6040
movq %rax, %rdi
callq 0x6200
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
movq %rax, %rbx
movq 0x8(%rsp), %rdi
cmpq %r12, %rdi
je 0x2acd2
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x6300
movq %rbx, %rdi
callq 0x6560
// File: /workspace/github_cpp_makefile_star2_O3/kelwinfc[P]ci4721-Fernandez-Gyomrey/src/Tac.cpp
// Function: Tac::backpatch(std::__cxx11::list<int, std::allocator<int>>&, int)
void Tac::backpatch(list<int>& l, int instr){
    list<int>::iterator it;
    for (it = l.begin(); it != l.end(); ++it){
        quad* in = (quad*)(*(block->instructions.vinst))[*it];
        in->arg2 = new opd(instr, O_LABEL);
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq (%rsi), %r13
cmpq %rsi, %r13
je 0x2b376
movl %edx, %ebx
movq %rsi, %r14
movq %rdi, %r15
movq (%r15), %rax
movq 0x8(%rax), %rax
movslq 0x10(%r13), %rcx
movq (%rax), %rax
movq (%rax,%rcx,8), %rbp
movl $0x18, %edi
callq 0x62f0
movq %rax, %r12
movq %rax, %rdi
movl %ebx, %esi
movl $0x6, %edx
callq 0x1d02a
movq %r12, 0x20(%rbp)
movq (%r13), %r13
cmpq %r14, %r13
jne 0x2b33b
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movl $0x18, %esi
movq %r12, %rdi
callq 0x6300
movq %rbx, %rdi
callq 0x6560
nop
// File: /workspace/github_cpp_makefile_star2_O3/kelwinfc[P]ci4721-Fernandez-Gyomrey/src/codegen.cpp
// Function: register_descriptor::release_cost()
int register_descriptor::release_cost(){
    
    int cost = 0;
    set<symbol*>::iterator it = variables_available.begin();
    
    for ( ; it != variables_available.end(); ++it){
        symbol* s = *it;
        if ( s->availability.size() == 1 )
            cost++;
    }
    
    return cost;
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x40(%rdi), %rax
addq $0x30, %rbx
xorl %ebp, %ebp
cmpq %rbx, %rax
je 0x2b8e3
movq 0x20(%rax), %rcx
xorl %edx, %edx
cmpq $0x1, 0x70(%rcx)
sete %dl
addl %edx, %ebp
movq %rax, %rdi
callq 0x6380
jmp 0x2b8c4
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/kelwinfc[P]ci4721-Fernandez-Gyomrey/src/codegen.cpp
// Function: get_reg(symbol*)
int get_reg(symbol* s){
    
    int index = 0;
    int empty = -1;
    
    vector<register_descriptor>::iterator it = register_descriptors.begin();
    
    if ( s ){
        // Si ya esta en un registro, aprovecharlo
        for( ; it != register_descriptors.end(); ++it){
            if ( it->contains(s) )
                return index;
            else if ( it->is_free() ){
                empty = index;
            }
            index++;
        }
        
        // El simbolo no se encuentra ya en un registro
        
        // Hay algun registro vacio, usarlo
        if ( empty != -1 ){
            return empty;
        }
    }
    
    int cheapest_register = 0;
    int cost = register_descriptors[0].release_cost();
    
    it = register_descriptors.begin()+1;
    index = 0;
    for( ; it != register_descriptors.end(); ++it){
        int next_cost = it->release_cost();
        
        if ( next_cost < cost ){
            cheapest_register = index;
            cost = next_cost;
        }
        index++;
    }
    
    //TODO liberar lo que sea necesario liberar (hacer los ST respectivos)
    //TODO cargar el simbolo en un registro
    return cheapest_register;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rdi, %rax
leaq 0x139a6(%rip), %rcx     # 0x3f3a0
movq (%rcx), %rbx
movq 0x8(%rcx), %r15
movq %rbx, %rdi
testq %rax, %rax
sete %cl
cmpq %r15, %rbx
sete %dl
orb %cl, %dl
jne 0x2ba6a
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
xorl %ecx, %ecx
movq %rdi, %rdx
movq 0x38(%rdx), %rsi
testq %rsi, %rsi
je 0x2ba52
leaq 0x30(%rdx), %r9
movq %r9, %r8
xorl %r10d, %r10d
cmpq %rax, 0x20(%rsi)
setb %r10b
cmovaeq %rsi, %r8
movq 0x10(%rsi,%r10,8), %rsi
testq %rsi, %rsi
jne 0x2ba2e
cmpq %r9, %r8
je 0x2ba52
cmpq %rax, 0x20(%r8)
jbe 0x2baa5
cmpq $0x0, 0x50(%rdx)
cmovel %ecx, %ebp
incl %ecx
addq $0x60, %rdx
cmpq %r15, %rdx
jne 0x2ba1e
cmpl $-0x1, %ebp
jne 0x2baa7
addq $0x60, %rbx
cmpq %r15, %rbx
je 0x2baa1
callq 0x2b8b4
movl %eax, %r14d
xorl %r12d, %r12d
xorl %ebp, %ebp
movq %rbx, %rdi
callq 0x2b8b4
cmpl %r14d, %eax
cmovll %r12d, %ebp
cmovll %eax, %r14d
incl %r12d
addq $0x60, %rbx
cmpq %r15, %rbx
jne 0x2ba80
jmp 0x2baa7
xorl %ebp, %ebp
jmp 0x2baa7
movl %ecx, %ebp
movl %ebp, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/SethKasmann[P]clever-girl/main.cpp
// Function: main
int main(int argc, char* argv[])
{
    mg_init();
    Zobrist::init();
    bb_init();
    uci();
    return 0;
}

// Assembly:
pushq %rax
callq 0xfcf4
callq 0x1a328
callq 0xd81c
callq 0x19b6c
xorl %eax, %eax
popq %rcx
retq
nopl (%rax)
// File: /workspace/github_cpp_makefile_star2_O3/SethKasmann[P]clever-girl/src/MagicMoves.cpp
// Function: initmagicmoves_occ(int const*, int, unsigned long long)
U64 initmagicmoves_occ(const int* squares, const int numSquares, const U64 linocc)
{
	int i;
	U64 ret=0;
	for(i=0;i<numSquares;i++)
		if(linocc&(((U64)(1))<<i)) ret|=(((U64)(1))<<squares[i]);
	return ret;
}

// Assembly:
testl %esi, %esi
jle 0xd549
movl %esi, %ecx
xorl %esi, %esi
xorl %eax, %eax
btq %rsi, %rdx
jae 0xd540
movb (%rdi,%rsi,4), %r8b
btsq %r8, %rax
incq %rsi
cmpq %rsi, %rcx
jne 0xd532
retq
xorl %eax, %eax
retq
// File: /workspace/github_cpp_makefile_star2_O3/SethKasmann[P]clever-girl/src/MagicMoves.cpp
// Function: initmagicmoves_Rmoves(int, unsigned long long)
U64 initmagicmoves_Rmoves(const int square, const U64 occ)
{
	U64 ret=0;
	U64 bit;
	U64 rowbits=(((U64)0xFF)<<(8*(square/8)));
	
	bit=(((U64)(1))<<square);
	do
	{
		bit<<=8;
		ret|=bit;
	}while(bit && !(bit&occ));
	bit=(((U64)(1))<<square);
	do
	{
		bit>>=8;
		ret|=bit;
	}while(bit && !(bit&occ));
	bit=(((U64)(1))<<square);
	do
	{
		bit<<=1;
		if(bit&rowbits) ret|=bit;
		else break;
	}while(!(bit&occ));
	bit=(((U64)(1))<<square);
	do
	{
		bit>>=1;
		if(bit&rowbits) ret|=bit;
		else break;
	}while(!(bit&occ));
	return ret;
}

// Assembly:
movl %edi, %ecx
leal 0x7(%rcx), %edx
testl %edi, %edi
cmovnsl %edi, %edx
movl $0x1, %edi
shlq %cl, %rdi
andl $-0x8, %edx
xorl %eax, %eax
movq %rdi, %rcx
shlq $0x8, %rcx
orq %rcx, %rax
testq %rcx, %rcx
je 0xd57a
movq %rcx, %r8
andq %rsi, %r8
je 0xd566
movq %rdi, %rcx
movq %rcx, %r8
shrq $0x8, %rcx
orq %rcx, %rax
cmpq $0x100, %r8             # imm = 0x100
jb 0xd598
movq %rcx, %r8
andq %rsi, %r8
je 0xd57d
movl $0xff, %r8d
movl %edx, %ecx
shlq %cl, %r8
movq %rdi, %rcx
addq %rcx, %rcx
testq %r8, %rcx
je 0xd5c0
orq %rcx, %rax
testq %rsi, %rcx
je 0xd5a6
jmp 0xd5c0
orq %rdi, %rax
testq %rsi, %rdi
jne 0xd5c8
shrq %rdi
testq %r8, %rdi
jne 0xd5b8
retq
// File: /workspace/github_cpp_makefile_star2_O3/SethKasmann[P]clever-girl/src/MagicMoves.cpp
// Function: initmagicmoves_Bmoves(int, unsigned long long)
U64 initmagicmoves_Bmoves(const int square, const U64 occ)
{
	U64 ret=0;
	U64 bit;
	U64 bit2;
	U64 rowbits=(((U64)0xFF)<<(8*(square/8)));
	
	bit=(((U64)(1))<<square);
	bit2=bit;
	do
	{
		bit<<=8-1;
		bit2>>=1;
		if(bit2&rowbits) ret|=bit;
		else break;
	}while(bit && !(bit&occ));
	bit=(((U64)(1))<<square);
	bit2=bit;
	do
	{
		bit<<=8+1;
		bit2<<=1;
		if(bit2&rowbits) ret|=bit;
		else break;
	}while(bit && !(bit&occ));
	bit=(((U64)(1))<<square);
	bit2=bit;
	do
	{
		bit>>=8-1;
		bit2<<=1;
		if(bit2&rowbits) ret|=bit;
		else break;
	}while(bit && !(bit&occ));
	bit=(((U64)(1))<<square);
	bit2=bit;
	do
	{
		bit>>=8+1;
		bit2>>=1;
		if(bit2&rowbits) ret|=bit;
		else break;
	}while(bit && !(bit&occ));
	return ret;
}

// Assembly:
leal 0x7(%rdi), %eax
testl %edi, %edi
movzbl %al, %ecx
cmovnsl %edi, %ecx
andb $-0x8, %cl
movl $0xff, %edx
shlq %cl, %rdx
movl $0x1, %r8d
movl %edi, %ecx
shlq %cl, %r8
xorl %eax, %eax
movq %r8, %rcx
movq %r8, %rdi
shrq %rdi
testq %rdx, %rdi
je 0xd60e
shlq $0x7, %rcx
orq %rcx, %rax
testq %rcx, %rcx
je 0xd60e
movq %rcx, %r9
andq %rsi, %r9
je 0xd5f2
movq %r8, %rcx
movq %r8, %rdi
addq %rdi, %rdi
testq %rdx, %rdi
je 0xd630
shlq $0x9, %rcx
orq %rcx, %rax
testq %rcx, %rcx
je 0xd630
movq %rcx, %r9
andq %rsi, %r9
je 0xd614
movq %r8, %rdi
movq %r8, %rcx
addq %rcx, %rcx
testq %rdx, %rcx
je 0xd65c
movq %rdi, %r9
shrq $0x7, %r9
orq %r9, %rax
cmpq $0x80, %rdi
jb 0xd65c
movq %r9, %r10
movq %r9, %rdi
andq %rsi, %r10
je 0xd636
movq %r8, %rcx
shrq %rcx
testq %rdx, %rcx
je 0xd685
movq %r8, %rdi
shrq $0x9, %rdi
orq %rdi, %rax
cmpq $0x200, %r8             # imm = 0x200
jb 0xd685
movq %rdi, %r9
movq %rdi, %r8
andq %rsi, %r9
je 0xd65f
retq
// File: /workspace/github_cpp_makefile_star2_O3/SethKasmann[P]clever-girl/src/bitboard.cpp
// Function: print_bb(unsigned long long)
void print_bb(U64 bb)
{
    const U64 MSB = 0x8000000000000000ULL;
    std::string ret;
    for (int i = 0; i < 64; ++i)
    {
        if (i % 8 == 0)
        {
            if (i != 0)
            {
                ret.append("\n");
            }
            for (int j = 0; j < 8; ++j)
            {
                ret.append("+-");
            }
            ret.append("+\n|");
        }
        U64 bit = pow(2, i);
        if (bb << i & MSB)
        {
            ret.append("1|");
        }
        else
        {
            ret.append("0|");
        }
    }
    ret.append("\n");
    for (int j = 0; j < 8; ++j)
    {
        ret.append("+-");
    }
    ret.append("+\n");
    std::cout << ret;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rdi, %rbx
leaq 0x18(%rsp), %rax
movq %rax, -0x10(%rax)
movq $0x0, -0x8(%rax)
movb $0x0, (%rax)
xorl %r14d, %r14d
leaq 0xdf7e(%rip), %r15      # 0x1be40
leaq 0x8(%rsp), %r12
leaq 0xdf7c(%rip), %r13      # 0x1be4a
testb $0x7, %r14b
jne 0xdf0b
testq %r14, %r14
je 0xdee8
movq %r12, %rdi
leaq 0xdf6b(%rip), %rsi      # 0x1be4e
callq 0x43e0
movl $0x8, %ebp
movq %r12, %rdi
movq %r15, %rsi
callq 0x43e0
decl %ebp
jne 0xdeed
movq %r12, %rdi
leaq 0xdf3d(%rip), %rsi      # 0x1be43
callq 0x43e0
xorps %xmm0, %xmm0
cvtsi2sd %r14d, %xmm0
callq 0x41e0
movq %rbx, %rax
movl %r14d, %ecx
shlq %cl, %rax
testq %rax, %rax
leaq 0xdf1c(%rip), %rsi      # 0x1be47
cmovnsq %r13, %rsi
movq %r12, %rdi
callq 0x43e0
incq %r14
cmpq $0x40, %r14
jne 0xdece
leaq 0xdf07(%rip), %rsi      # 0x1be4e
leaq 0x8(%rsp), %rdi
callq 0x43e0
movl $0x8, %ebp
leaq 0xdee3(%rip), %rbx      # 0x1be40
leaq 0x8(%rsp), %r14
movq %r14, %rdi
movq %rbx, %rsi
callq 0x43e0
decl %ebp
jne 0xdf62
leaq 0xded5(%rip), %rsi      # 0x1be4d
leaq 0x8(%rsp), %rdi
callq 0x43e0
movq 0x8(%rsp), %rsi
movq 0x10(%rsp), %rdx
movq 0x1700d(%rip), %rdi     # 0x24fa0
callq 0x4290
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0xdfb4
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x4250
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0xdfcb
jmp 0xdfcb
jmp 0xdfcb
jmp 0xdfcb
movq %rax, %rbx
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0xdfea
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x4250
movq %rbx, %rdi
callq 0x43b0
nop
// File: /workspace/github_cpp_makefile_star2_O3/SethKasmann[P]clever-girl/src/evaluation.cpp
// Function: int Evaluate::outpost<(PieceType)1>(Square, Color)
int Evaluate::outpost(Square p, Color c)
{
    int score;
    // To be an outpost, the piece must be supported by a friendly pawn
    // and unable to be attacked by an opponents pawn.
    if (   !(p & outpost_area[c])
        || !(pawn_attacks[!c][p] & mState.getPieceBB<pawn>(c))
        || in_front[c][p] & adj_files[p] & mState.getPieceBB<pawn>(!c))
        return 0;

    score = PieceSquareTable::outpost[PT == bishop][c][p];

    // Extra bonus if the outpost cannot be captured by a minor piece.
    if (   !mState.getPieceBB<knight>(!c)
        && !(mState.getPieceBB<bishop>(!c) & squares_of_color(p)))
        score *= 2;

    return score;
}

// Assembly:
movl %edx, %r8d
leaq 0x10b07a(%rip), %r9     # 0x11a670
movl %esi, %esi
leaq 0xe9471(%rip), %rax     # 0xf8a70
movq (%rax,%rsi,8), %rcx
xorl %eax, %eax
testq %rcx, (%r9,%r8,8)
je 0xf671
xorl %r9d, %r9d
testl %edx, %edx
sete %r9b
movl %r9d, %r10d
shll $0x9, %r10d
addq 0x1598e(%rip), %r10     # 0x24fb0
movq 0x8(%rdi), %rdx
leaq (%r8,%r8,2), %rdi
shlq $0x4, %rdi
movq 0x288(%rdx,%rdi), %rdi
testq %rdi, (%r10,%rsi,8)
je 0xf671
addq $0x288, %rdx            # imm = 0x288
movq %r8, %rdi
shlq $0x9, %rdi
addq 0x15957(%rip), %rdi     # 0x24fa8
leaq 0x10a618(%rip), %r10    # 0x119c70
movq (%r10,%rsi,8), %r10
andq (%rdi,%rsi,8), %r10
leaq (%r9,%r9,2), %rdi
movl %edi, %r9d
shll $0x4, %r9d
testq %r10, (%rdx,%r9)
je 0xf672
retq
shlq $0x8, %r8
leaq 0xca93(%rip), %rax      # 0x1c110
addq %r8, %rax
movl (%rax,%rsi,4), %eax
movl %edi, %esi
shll $0x4, %esi
cmpq $0x0, 0x8(%rdx,%rsi)
jne 0xf671
shll $0x4, %edi
movabsq $0x55aa55aa55aa55aa, %rsi # imm = 0x55AA55AA55AA55AA
testq %rsi, %rcx
movabsq $-0x55aa55aa55aa55ab, %rcx # imm = 0xAA55AA55AA55AA55
cmovneq %rsi, %rcx
testq %rcx, 0x10(%rdx,%rdi)
sete %cl
shll %cl, %eax
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/SethKasmann[P]clever-girl/src/line_manager.cpp
// Function: LineManager::checkPv(State&)
void LineManager::checkPv(State& pState)
{
    State c;
    Move nextMove;
    std::memmove(&c, &pState, sizeof(pState));
    for (int i = 0; i < Max_ply; ++i)
    {
        nextMove = mPv[i].first;
        if (nextMove == nullMove)
        {
            mSize = i;
            break;
        }
        // Push moves to the move list.
        MoveList moveList(c);

        // If the next pv move is in the move list, make the move.
        if (moveList.contains(nextMove))
            c.make_t(nextMove);
        // If the next pv move is not found, break the loop.
        else
        {
            mSize = i;
            break;
        }
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xd68, %rsp            # imm = 0xD68
movq %rdi, %r13
leaq 0x860(%rsp), %r14
movl $0x508, %edx            # imm = 0x508
movq %r14, %rdi
callq 0x41c0
xorl %ebx, %ebx
leaq 0x8(%rsp), %r15
movq %r13, (%rsp)
movzwl (%r13), %ebp
testw %bp, %bp
je 0xfa1b
movq %r15, %rdi
movq %r14, %rsi
callq 0x10b60
movzwl %bp, %r12d
movq %r15, %rdi
movl %r12d, %esi
callq 0xfdc6
movl %eax, %ebp
testb %al, %al
je 0xf9dd
movq %r14, %rdi
movl %r12d, %esi
callq 0x17a3a
jmp 0xf9e8
movq (%rsp), %rax
movq %rbx, 0x4fb8(%rax)
movq 0x838(%rsp), %rdi
testq %rdi, %rdi
je 0xfa05
movq 0x848(%rsp), %rsi
subq %rdi, %rsi
callq 0x4250
cmpq $0x31, %rbx
leaq 0x1(%rbx), %rbx
setne %al
addq $0x10, %r13
testb %al, %bpl
jne 0xf9a6
jmp 0xfa26
movq (%rsp), %rax
movq %rbx, 0x4fb8(%rax)
addq $0xd68, %rsp            # imm = 0xD68
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movq 0x838(%rsp), %rdi
testq %rdi, %rdi
je 0xfa58
movq 0x848(%rsp), %rsi
subq %rdi, %rsi
callq 0x4250
movq %rbx, %rdi
callq 0x43b0
// File: /workspace/github_cpp_makefile_star2_O3/SethKasmann[P]clever-girl/src/move.h
// Function: toString[abi:cxx11](unsigned short)
inline std::string toString(Move m)
{
	std::string ret;
	Square src, dst;

	src = getSrc(m);
	dst = getDst(m);

	ret = SQ[src] + SQ[dst];

	switch (getPiecePromo(m))
	{
		case knight:
			ret += "n";
			break;
		case bishop:
			ret += "b";
			break;
		case rook:
			ret += "r";
			break;
		case queen:
			ret += "q";
			break;
		default:
			break;
	}

	return ret;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x28, %rsp
movl %esi, %ebp
movq %rdi, %rbx
leaq 0x10(%rdi), %r15
movq %r15, (%rdi)
movq $0x0, 0x8(%rdi)
movb $0x0, 0x10(%rdi)
movl %esi, %edx
shrl $0x6, %edx
andl $0x3f, %edx
andl $0x3f, %esi
shll $0x5, %esi
leaq 0x13b72e(%rip), %rax    # 0x14b2a0
addq %rax, %rsi
shll $0x5, %edx
addq %rax, %rdx
leaq 0x8(%rsp), %rdi
callq 0xfc04
leaq 0x8(%rsp), %r14
movq %rbx, %rdi
movq %r14, %rsi
callq 0x42a0
movq (%r14), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0xfbaf
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x4250
shrl $0xc, %ebp
andl $0x7, %ebp
decl %ebp
cmpw $0x4, %bp
jae 0xfbd6
movzwl %bp, %eax
leaq 0xcad9(%rip), %rcx      # 0x1c6a0
movslq (%rcx,%rax,4), %rsi
addq %rcx, %rsi
movq %rbx, %rdi
callq 0x43e0
movq %rbx, %rax
addq $0x28, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
jmp 0xfbe6
movq %rax, %r14
movq (%rbx), %rdi
cmpq %r15, %rdi
je 0xfbfc
movq (%r15), %rsi
incq %rsi
callq 0x4250
movq %r14, %rdi
callq 0x43b0
// File: /workspace/github_cpp_makefile_star2_O3/SethKasmann[P]clever-girl/src/move_generator.cpp
// Function: MoveList::MoveList(State const&, unsigned short, History*, int, bool)
MoveList::MoveList(const State& pState, Move pBest, History* pHistory, int pPly, bool pQSearch)
: mState(pState), mValid(Full), mBest(pBest), mQSearch(pQSearch), mKiller1(nullMove), mKiller2(nullMove)
, mSize(0), mHistory(pHistory), mPly(pPly)
{
    if (pHistory)
    {
        mKiller1 = mHistory->getKiller(pPly).first;
        mKiller2 = mHistory->getKiller(pPly).second;
    }

    if (mState.inCheck())
    {
        Square k = mState.getKingSquare(mState.getOurColor());
        Square c = get_lsb(mState.getCheckersBB());
        mValid = between[k][c] | mState.getCheckersBB();
        mStage = nEvadeBestMove;
    }
    else
        mStage = mQSearch ? qBestMove : nBestMove;
}

// Assembly:
movb %r9b, (%rdi)
movq $-0x1, 0x8(%rdi)
movq %rsi, 0x18(%rdi)
movq %rcx, 0x20(%rdi)
movl %r8d, 0x28(%rdi)
xorps %xmm0, %xmm0
movups %xmm0, 0x830(%rdi)
movups %xmm0, 0x840(%rdi)
movw %dx, 0x850(%rdi)
movl $0x0, 0x852(%rdi)
testq %rcx, %rcx
je 0xfd45
movslq %r8d, %rax
movl 0x18(%rcx,%rax,4), %eax
movl %eax, 0x852(%rdi)
movq 0x28(%rsi), %rax
testq %rax, %rax
je 0xfd7c
movl (%rsi), %ecx
imulq $0xf0, %rcx, %rcx
movl 0x3f0(%rsi,%rcx), %ecx
bsfq %rax, %rdx
shlq $0x9, %rcx
addq 0x1525b(%rip), %rcx     # 0x24fc8
orq (%rcx,%rdx,8), %rax
movq %rax, 0x8(%rdi)
movl $0xc, %eax
jmp 0xfd89
xorl %ecx, %ecx
testb %r9b, %r9b
movl $0x7, %eax
cmovel %ecx, %eax
movl %eax, 0x2c(%rdi)
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/SethKasmann[P]clever-girl/src/move_generator.cpp
// Function: void MoveList::generateMoves<(MoveType)2>()
void MoveList::generateMoves<MoveType::Evasions>()
{
    assert(mState.inCheck());

    Square k, c;

    mValid = mState.getOccupancyBB(mState.getTheirColor()) | mState.getEmptyBB();
    pushMoves<MoveType::Evasions, king>();

    if (mState.inDoubleCheck())
        return;

    k = mState.getKingSquare(mState.getOurColor());
    c = get_lsb(mState.getCheckersBB());
    mValid = between[k][c] | mState.getCheckersBB();

    mState.getOurColor() == white ? pushPawnMoves<MoveType::Evasions, white>() 
                                  : pushPawnMoves<MoveType::Evasions, black>();
    pushMoves<MoveType::Evasions, knight>();
    pushMoves<MoveType::Evasions, bishop>();
    pushMoves<MoveType::Evasions, rook>();
    pushMoves<MoveType::Evasions, queen>();
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movq 0x18(%rdi), %rax
movl 0x4(%rax), %ecx
movq 0x80(%rax), %rdx
orq 0x78(%rax), %rdx
notq %rdx
orq 0x78(%rax,%rcx,8), %rdx
movq %rdx, 0x8(%rdi)
callq 0x10be4
movq 0x18(%rbx), %rcx
movq 0x28(%rcx), %rax
movq %rax, %rdx
shrq %rdx
movabsq $0x5555555555555555, %rsi # imm = 0x5555555555555555
andq %rdx, %rsi
movq %rax, %rdx
subq %rsi, %rdx
movabsq $0x3333333333333333, %rsi # imm = 0x3333333333333333
movq %rdx, %rdi
andq %rsi, %rdi
shrq $0x2, %rdx
andq %rsi, %rdx
addq %rdi, %rdx
movq %rdx, %rsi
shrq $0x4, %rsi
addq %rdx, %rsi
movabsq $0xf0f0f0f0f0f0f0f, %rdx # imm = 0xF0F0F0F0F0F0F0F
andq %rsi, %rdx
movabsq $0x101010101010101, %rsi # imm = 0x101010101010101
imulq %rdx, %rsi
shrq $0x38, %rsi
cmpl $0x2, %esi
jne 0xfef6
popq %rbx
retq
movl (%rcx), %edx
imulq $0xf0, %rdx, %rsi
movl 0x3f0(%rcx,%rsi), %ecx
bsfq %rax, %rsi
shlq $0x9, %rcx
addq 0x150b3(%rip), %rcx     # 0x24fc8
orq (%rcx,%rsi,8), %rax
movq %rax, 0x8(%rbx)
movq %rbx, %rdi
testq %rdx, %rdx
je 0xff2c
callq 0x10dd6
jmp 0xff31
callq 0x10c52
movq %rbx, %rdi
callq 0x10f58
movq %rbx, %rdi
callq 0x10fc6
movq %rbx, %rdi
callq 0x1107c
movq %rbx, %rdi
popq %rbx
jmp 0x11132
// File: /workspace/github_cpp_makefile_star2_O3/SethKasmann[P]clever-girl/src/move_generator.cpp
// Function: void MoveList::generateMoves<(MoveType)4>()
void MoveList::generateMoves<MoveType::All>()
{
    if (mState.inCheck())
    {
        generateMoves<MoveType::Evasions>();
        return;
    }

    mValid = mState.getOccupancyBB(mState.getTheirColor()) | mState.getEmptyBB();

    mState.getOurColor() == white ? pushPawnMoves<MoveType::All, white>() 
                                  : pushPawnMoves<MoveType::All, black>();
    pushMoves<MoveType::All, knight>();
    pushMoves<MoveType::All, bishop>();
    pushMoves<MoveType::All, rook>();
    pushMoves<MoveType::All, queen>();
    pushMoves<MoveType::All, king>();
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movq 0x18(%rdi), %rax
cmpq $0x0, 0x28(%rax)
je 0xff6a
movq %rbx, %rdi
popq %rbx
jmp 0xfe64
movq 0x80(%rax), %rcx
orq 0x78(%rax), %rcx
movl 0x4(%rax), %edx
notq %rcx
orq 0x78(%rax,%rdx,8), %rcx
movq %rcx, 0x8(%rbx)
cmpl $0x0, (%rax)
je 0xff93
movq %rbx, %rdi
callq 0x113a0
jmp 0xff9b
movq %rbx, %rdi
callq 0x1122a
movq %rbx, %rdi
callq 0x11518
movq %rbx, %rdi
callq 0x11586
movq %rbx, %rdi
callq 0x1163c
movq %rbx, %rdi
callq 0x116f2
movq %rbx, %rdi
popq %rbx
jmp 0x117ea
// File: /workspace/github_cpp_makefile_star2_O3/SethKasmann[P]clever-girl/src/move_generator.cpp
// Function: void MoveList::pushMoves<(MoveType)2, (PieceType)4>()
void MoveList::pushMoves()
{
    U64 m;
    Square dst;
    Color c = mState.getOurColor();

    for (Square src : mState.getPieceList<P>(c))
    {
        if (src == no_sq)
            break;

        m = mState.getAttackBB<P>(src) & mValid;

        if (T == MoveType::QuietChecks)
        {
            if (square_bb[src] & mDiscover)
            {
                if (P == king)
                    m &= ~coplanar[src][mState.getKingSquare(!c)];
            }
            else
                m &= mState.getCheckSquaresBB(P);
        }

        while (m)
            push(makeMove(src, pop_lsb(m)));

        if (P == king && T != MoveType::Attacks && T != MoveType::Evasions)
            pushCastle<T>();
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq 0x8(%rdi), %rax
movq 0x18(%rdi), %rdx
movl (%rdx), %ecx
imulq $0xf0, %rcx, %rcx
leaq (%rdx,%rcx), %rsi
addq $0x3c8, %rsi            # imm = 0x3C8
movq 0x848(%rdi), %rbp
xorl %r8d, %r8d
leaq 0x142a7(%rip), %r14     # 0x25410
leaq 0xa1d0(%rip), %r15      # 0x1b340
leaq 0x9fc9(%rip), %r12      # 0x1b140
leaq 0x9ec2(%rip), %r13      # 0x1b040
movl (%rsi,%r8), %r9d
cmpq $0x40, %r9
je 0x1121e
movq 0x80(%rdx), %r10
orq 0x78(%rdx), %r10
leaq 0xa6a2(%rip), %rcx      # 0x1b840
movq (%rcx,%r9,8), %r11
andq %r10, %r11
leaq 0xa494(%rip), %rcx      # 0x1b640
imulq (%rcx,%r9,8), %r11
leaq 0xa388(%rip), %rcx      # 0x1b540
movb (%rcx,%r9,4), %cl
shrq %cl, %r11
movq (%r14,%r9,8), %rbx
andq (%r15,%r9,8), %r10
imulq (%r12,%r9,8), %r10
movb (%r13,%r9,4), %cl
shrq %cl, %r10
movq (%rbx,%r10,8), %rcx
leaq 0x14031(%rip), %r10     # 0x25210
movq (%r10,%r9,8), %r10
orq (%r10,%r11,8), %rcx
andq %rax, %rcx
je 0x11210
leaq -0x1(%rcx), %r10
bsfq %rcx, %r11
shll $0x6, %r11d
orl %r9d, %r11d
movw %r11w, 0x30(%rdi,%rbp,8)
incq %rbp
andq %r10, %rcx
jne 0x111ec
movq %rbp, 0x848(%rdi)
addq $0x4, %r8
cmpq $0x28, %r8
jne 0x1117e
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/SethKasmann[P]clever-girl/src/move_generator.cpp
// Function: void MoveList::generateMoves<(MoveType)0>()
void MoveList::generateMoves()
{
    assert(!mState.inCheck());

    if (T == MoveType::QuietChecks)
        mDiscover = mState.getDiscoveredChecks(mState.getOurColor());

    mValid = T == MoveType::Attacks 
                ? mState.getOccupancyBB(mState.getTheirColor())
                : mState.getEmptyBB();

    mState.getOurColor() == white ? pushPawnMoves<T, white>() 
                                  : pushPawnMoves<T, black>();
    pushMoves<T, knight>();
    pushMoves<T, bishop>();
    pushMoves<T, rook>();
    pushMoves<T, queen>();
    pushMoves<T, king>();
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movq 0x18(%rdi), %rax
movl 0x4(%rax), %ecx
movq 0x78(%rax,%rcx,8), %rcx
movq %rcx, 0x8(%rdi)
cmpl $0x0, (%rax)
je 0x11895
movq %rbx, %rdi
callq 0x12188
jmp 0x1189d
movq %rbx, %rdi
callq 0x1209e
movq %rbx, %rdi
callq 0x12264
movq %rbx, %rdi
callq 0x122d2
movq %rbx, %rdi
callq 0x12388
movq %rbx, %rdi
callq 0x1243e
movq %rbx, %rdi
popq %rbx
jmp 0x12536
// File: /workspace/github_cpp_makefile_star2_O3/SethKasmann[P]clever-girl/src/perft.cpp
// Function: perft(State&, int)
int perft(State & s, int depth)
{
	int nodes = 0;

	if (s.getFiftyMoveRule() > 99)
		return nodes;

	MoveList mlist(s);

	if (depth == 1)
		return mlist.size();

	Move m;

	while (m = mlist.getBestMove())
	{
		State c(s);
		c.make_t(m);
		nodes += perft(c, depth-1);
	}

	return nodes;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xd68, %rsp            # imm = 0xD68
xorl %ebx, %ebx
cmpl $0x63, 0x8(%rdi)
jg 0x13d8e
movl %esi, %ebp
movq %rdi, %r14
leaq 0x8(%rsp), %rdi
movq %r14, %rsi
callq 0x10b60
cmpl $0x1, %ebp
jne 0x13da2
leaq 0x8(%rsp), %rdi
callq 0xfd8e
movq %rax, %rbx
movq 0x838(%rsp), %rdi
testq %rdi, %rdi
je 0x13d8e
movq 0x848(%rsp), %rsi
subq %rdi, %rsi
callq 0x4250
movl %ebx, %eax
addq $0xd68, %rsp            # imm = 0xD68
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
decl %ebp
xorl %ebx, %ebx
leaq 0x8(%rsp), %r15
leaq 0x860(%rsp), %r12
movq %r15, %rdi
callq 0xffc4
movl %eax, %r13d
testw %ax, %ax
je 0x13d71
movq %r12, %rdi
movq %r14, %rsi
callq 0x1637c
movzwl %r13w, %esi
movq %r12, %rdi
callq 0x17a3a
movq %r12, %rdi
movl %ebp, %esi
callq 0x13d34
addl %eax, %ebx
jmp 0x13db3
jmp 0x13dec
jmp 0x13dec
movq %rax, %rbx
movq 0x838(%rsp), %rdi
testq %rdi, %rdi
je 0x13e0c
movq 0x848(%rsp), %rsi
subq %rdi, %rsi
callq 0x4250
movq %rbx, %rdi
callq 0x43b0
// File: /workspace/github_cpp_makefile_star2_O3/SethKasmann[P]clever-girl/src/perft.cpp
// Function: test(State, MoveList*, int, int)
void test(State s, MoveList* mList, int depth, int id)
{
	{
		std::unique_lock<std::mutex> lk(qMutex);
		cv.wait(lk, [] { return ready; });
	}

	Move m;

	{
		std::lock_guard<std::mutex> lk(qMutex);
		m = mList->getBestMove();
	}

	while (m != nullMove)
	{
		State c(s);
		c.make_t(m);
		int nodes = perft(c, depth - 1);
		
		{
			std::lock_guard<std::mutex> lk(qMutex);
			nodeCount.push_back(nodes);
			m = mList->getBestMove();
		} 
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x518, %rsp            # imm = 0x518
movl %edx, %ebx
movq %rsi, %r14
movq %rdi, %r15
leaq 0x141004(%rip), %rax    # 0x154e38
leaq 0x10(%rsp), %r12
movq %rax, (%r12)
movb $0x0, 0x8(%r12)
movq %r12, %rdi
callq 0x14b9c
movb $0x1, 0x8(%r12)
cmpb $0x0, 0x140fa8(%rip)    # 0x154e00
jne 0x13e7a
leaq 0x140fa7(%rip), %r12    # 0x154e08
leaq 0x10(%rsp), %r13
movq %r12, %rdi
movq %r13, %rsi
callq 0x40a0
cmpb $0x1, 0x140f88(%rip)    # 0x154e00
jne 0x13e66
leaq 0x10(%rsp), %rdi
callq 0x14824
leaq 0x140fad(%rip), %rdi    # 0x154e38
callq 0x4320
testl %eax, %eax
jne 0x13f52
movq %r14, %rdi
callq 0xffc4
movl %eax, %ebp
leaq 0x140f8f(%rip), %rdi    # 0x154e38
callq 0x41a0
testw %bp, %bp
je 0x13f40
decl %ebx
leaq 0x10(%rsp), %r12
leaq 0x140f73(%rip), %r13    # 0x154e38
movq %r12, %rdi
movq %r15, %rsi
callq 0x1637c
movzwl %bp, %esi
movq %r12, %rdi
callq 0x17a3a
movq %r12, %rdi
movl %ebx, %esi
callq 0x13d34
movl %eax, 0xc(%rsp)
movq %r13, %rdi
callq 0x4320
testl %eax, %eax
jne 0x13f52
movq 0x140fbc(%rip), %rsi    # 0x154eb8
cmpq 0x140fbd(%rip), %rsi    # 0x154ec0
je 0x13f18
movl 0xc(%rsp), %eax
movl %eax, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x140fa2(%rip)    # 0x154eb8
jmp 0x13f29
leaq 0x140f91(%rip), %rdi    # 0x154eb0
leaq 0xc(%rsp), %rdx
callq 0x14c00
movq %r14, %rdi
callq 0xffc4
movl %eax, %ebp
movq %r13, %rdi
callq 0x41a0
testw %bp, %bp
jne 0x13ec5
addq $0x518, %rsp            # imm = 0x518
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl %eax, %edi
callq 0x4150
jmp 0x13f5b
movq %rax, %rbx
leaq 0x140ed3(%rip), %rdi    # 0x154e38
callq 0x41a0
movq %rbx, %rdi
callq 0x43b0
// File: /workspace/github_cpp_makefile_star2_O3/SethKasmann[P]clever-girl/src/perft.cpp
// Function: MTperft(State&, int)
int MTperft(State& s, int depth)
{
	unsigned int nThreads = std::thread::hardware_concurrency();
	std::vector<std::thread> threads;
	nodeCount.clear();
	MoveList mlist(s);

	for (unsigned int i = 0; i < nThreads; ++i)
		threads.push_back(std::thread(test, s, &mlist, depth, i));

	{
		std::lock_guard<std::mutex> lk(qMutex);
		ready = true;
		cv.notify_all();
	}

	for (std::thread& thread : threads)
		thread.join();

	return std::accumulate(nodeCount.begin(), nodeCount.end(), 0);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x888, %rsp            # imm = 0x888
movq %rdi, %rbx
movl %esi, 0x4(%rsp)
callq 0x42c0
movl %eax, %ebp
xorps %xmm0, %xmm0
movaps %xmm0, 0x10(%rsp)
movq $0x0, 0x20(%rsp)
movq 0x140f07(%rip), %rax    # 0x154eb0
cmpq %rax, 0x140f08(%rip)    # 0x154eb8
je 0x13fb9
movq %rax, 0x140eff(%rip)    # 0x154eb8
leaq 0x30(%rsp), %rdi
movq %rbx, %rsi
callq 0x10b60
movl $0x0, (%rsp)
testl %ebp, %ebp
je 0x1402d
leaq 0x8(%rsp), %r12
leaq 0x4(%rsp), %r14
movq %rsp, %r15
leaq 0x10(%rsp), %r13
leaq 0x30(%rsp), %rax
movq %rax, 0x28(%rsp)
movq %r12, %rdi
leaq -0x1e3(%rip), %rsi      # 0x13e14
movq %rbx, %rdx
leaq 0x28(%rsp), %rcx
movq %r14, %r8
movq %r15, %r9
callq 0x1483a
movq %r13, %rdi
movq %r12, %rsi
callq 0x14dee
cmpq $0x0, 0x8(%rsp)
jne 0x140ed
movl (%rsp), %eax
incl %eax
movl %eax, (%rsp)
cmpl %ebp, %eax
jb 0x13fe3
leaq 0x140e04(%rip), %rdi    # 0x154e38
callq 0x4320
testl %eax, %eax
jne 0x140d5
movb $0x1, 0x140db8(%rip)    # 0x154e00
leaq 0x140db9(%rip), %rdi    # 0x154e08
callq 0x4380
leaq 0x140ddd(%rip), %rdi    # 0x154e38
callq 0x41a0
movq 0x10(%rsp), %rbx
movq 0x18(%rsp), %r14
cmpq %r14, %rbx
je 0x1407d
movq %rbx, %rdi
callq 0x4390
addq $0x8, %rbx
jmp 0x1406a
movq 0x140e2c(%rip), %rax    # 0x154eb0
movq 0x140e2d(%rip), %rcx    # 0x154eb8
xorl %ebx, %ebx
cmpq %rcx, %rax
je 0x1409a
addl (%rax), %ebx
addq $0x4, %rax
jmp 0x1408d
movq 0x860(%rsp), %rdi
testq %rdi, %rdi
je 0x140b7
movq 0x870(%rsp), %rsi
subq %rdi, %rsi
callq 0x4250
leaq 0x10(%rsp), %rdi
callq 0x148e8
movl %ebx, %eax
addq $0x888, %rsp            # imm = 0x888
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl %eax, %edi
callq 0x4150
jmp 0x140f2
movq %rax, %rbx
jmp 0x14112
jmp 0x140f2
cmpq $0x0, 0x8(%rsp)
je 0x140f2
callq 0x4080
movq %rax, %rbx
movq 0x860(%rsp), %rdi
testq %rdi, %rdi
je 0x14112
movq 0x870(%rsp), %rsi
subq %rdi, %rsi
callq 0x4250
leaq 0x10(%rsp), %rdi
callq 0x148e8
movq %rbx, %rdi
callq 0x43b0
// File: /workspace/github_cpp_makefile_star2_O3/SethKasmann[P]clever-girl/src/perft.cpp
// Function: perftTestDebug()
void perftTestDebug()
{
	int nodes;
	for (int i = 0; i < totalTests; ++i)
	{
		history.clear();
		State s(perftFen[i]);
		history.push(std::make_pair(nullMove, s.getKey()));
		nodes = MTperft(s, perftDepth[i]);
		//std::cout << perftFen[i] << std::endl;
		std::cout << (nodes == perftResults[i] ? "Success " : "Fail ")
		          << nodes << " == " << perftResults[i] << std::endl;
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x518, %rsp            # imm = 0x518
leaq 0x138493(%rip), %rbx    # 0x14cac0
xorl %r14d, %r14d
leaq 0x1386e9(%rip), %r12    # 0x14cd20
leaq 0x10(%rsp), %r15
movq 0x1095d(%rip), %r13     # 0x24fa0
movq %r12, %rdi
callq 0x14924
movq %r15, %rdi
movq %rbx, %rsi
callq 0x1655c
movq 0x28(%rsp), %rax
movw $0x0, (%rsp)
movq %rax, 0x8(%rsp)
movq 0x1386bb(%rip), %rsi    # 0x14cd28
cmpq 0x1386bc(%rip), %rsi    # 0x14cd30
je 0x14687
movups (%rsp), %xmm0
movups %xmm0, (%rsi)
addq $0x10, 0x1386a3(%rip)   # 0x14cd28
jmp 0x14692
movq %r12, %rdi
movq %rsp, %rdx
callq 0x14a78
leaq 0x9aa7(%rip), %rax      # 0x1e140
movl (%r14,%rax), %esi
movq %r15, %rdi
callq 0x13f72
movl %eax, %ebp
leaq 0x9ae2(%rip), %rax      # 0x1e190
movl (%r14,%rax), %r12d
xorl %eax, %eax
cmpl %r12d, %ebp
sete %al
leaq 0x9a56(%rip), %rsi      # 0x1e117
leaq 0x9a46(%rip), %rcx      # 0x1e10e
cmoveq %rcx, %rsi
leaq (%rax,%rax,2), %rdx
addq $0x5, %rdx
movq %r13, %rdi
callq 0x4290
movq %r13, %rdi
movl %ebp, %esi
callq 0x43a0
movq %rax, %rbp
movl $0x4, %edx
movq %rax, %rdi
leaq 0x9a25(%rip), %rsi      # 0x1e11d
callq 0x4290
movq %rbp, %rdi
movl %r12d, %esi
callq 0x43a0
movq %rax, %r12
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r12, %rdi
movl $0xa, %esi
callq 0x4230
movsbl %al, %esi
movq %r12, %rdi
callq 0x4040
movq %rax, %rdi
callq 0x4170
addq $0x4, %r14
addq $0x20, %rbx
cmpq $0x4c, %r14
leaq 0x1385db(%rip), %r12    # 0x14cd20
jne 0x14643
addq $0x518, %rsp            # imm = 0x518
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/SethKasmann[P]clever-girl/src/history.h
// Function: History::History()
History()
	: mKillers{}, mHistory{}
	{
		mGameHistory.reserve(1024);
		for (std::array<int, Board_size>& arr : mButterfly)
			arr.fill(1);
	}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
addq $0x40e0, %rdi           # imm = 0x40E0
movl $0x4000, %edx           # imm = 0x4000
xorl %esi, %esi
callq 0x4120
movl $0xe0, %r14d
movl $0xe0, %edx
movq %rbx, %rdi
xorl %esi, %esi
callq 0x4120
movl $0x400, %esi            # imm = 0x400
movq %rbx, %rdi
callq 0x149aa
addq $0xe0, %rbx
movaps 0x9778(%rip), %xmm0     # 0x1df20
movl $0x100, %eax            # imm = 0x100
xorl %ecx, %ecx
movups %xmm0, (%rbx,%rcx,4)
addq $0x4, %rcx
cmpq $0x40, %rcx
jne 0x147af
addq %rax, %r14
addq %rax, %rbx
cmpq $0x40e0, %r14           # imm = 0x40E0
jne 0x147ad
addq $0x8, %rsp
popq %rbx
popq %r14
retq
movq %rax, %r14
movq (%rbx), %rdi
testq %rdi, %rdi
je 0x147eb
movq 0x10(%rbx), %rsi
subq %rdi, %rsi
callq 0x4250
movq %r14, %rdi
callq 0x43b0
nop
// File: /workspace/github_cpp_makefile_star2_O3/SethKasmann[P]clever-girl/src/history.h
// Function: History::clear()
void clear()
	{
		mKillers = {};
		mHistory = {};
		for (std::array<int, Board_size>& arr : mButterfly)
			arr.fill(1);
	}

// Assembly:
pushq %r14
pushq %rbx
subq $0xc8, %rsp
movq %rdi, %rbx
movq %rsp, %rdi
xorl %r14d, %r14d
movl $0xc8, %edx
xorl %esi, %esi
callq 0x4120
movl (%rsp,%r14,4), %eax
movl %eax, 0x18(%rbx,%r14,4)
incq %r14
cmpq $0x32, %r14
jne 0x14943
leaq 0x40e0(%rbx), %rdi
movl $0x4000, %edx           # imm = 0x4000
xorl %esi, %esi
callq 0x4120
addq $0xe0, %rbx
movl $0xe0, %eax
movaps 0x95a5(%rip), %xmm0     # 0x1df20
movl $0x100, %ecx            # imm = 0x100
xorl %edx, %edx
movups %xmm0, (%rbx,%rdx,4)
addq $0x4, %rdx
cmpq $0x40, %rdx
jne 0x14982
addq %rcx, %rax
addq %rcx, %rbx
cmpq $0x40e0, %rax           # imm = 0x40E0
jne 0x14980
addq $0xc8, %rsp
popq %rbx
popq %r14
retq
nop