LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O2/khedoros[P]khednes/mapper_001_mmc1.cpp
// Function: mapper_001::get_cbyte(unsigned int)
const unsigned int mapper_001::get_cbyte(const unsigned int addr) {
    if(addr>=8192) {
        std::cout<<"Trying to get CHR byte at address: "<<addr<<std::endl;
        return 0;
    }
    if(addr < 0x1000) return cart->crom[addr+chr_lo_offset];
    else return cart->crom[addr-0x1000+chr_hi_offset];
}

// Assembly:
pushq %rbx
movl %esi, %ebx
cmpl $0x2000, %esi           # imm = 0x2000
jb 0x109b6
movq 0xa61c(%rip), %rdi      # 0x1afb0
leaq 0x3b95(%rip), %rsi      # 0x14530
callq 0x4390
movl %ebx, %esi
movq %rax, %rdi
callq 0x4270
movq %rax, %rdi
callq 0x41c0
xorl %eax, %eax
jmp 0x109e0
movq 0x8(%rdi), %rax
cmpl $0xfff, %ebx            # imm = 0xFFF
ja 0x109ce
addl 0x4c(%rdi), %ebx
movq 0x58(%rax), %rax
movb (%rax,%rbx), %al
jmp 0x109e0
movl 0x50(%rdi), %ecx
addl %ebx, %ecx
addl $0xfffff000, %ecx       # imm = 0xFFFFF000
movq 0x58(%rax), %rax
movb (%rax,%rcx), %al
movzbl %al, %eax
popq %rbx
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/khedoros[P]khednes/mapper_001_mmc1.cpp
// Function: mapper_001::tempval(bool*)
int mapper_001::tempval(bool * val) {
    int retval = 0;
    for(int i = 4; i >= 0; --i) {
        retval<<=(1);
        retval |= int(val[i]);
    }
    return retval;
}

// Assembly:
pushq $0x4
popq %rcx
xorl %eax, %eax
testl %ecx, %ecx
js 0x10c94
movl %ecx, %edx
movzbl (%rsi,%rdx), %edx
leal (%rdx,%rax,2), %eax
decl %ecx
jmp 0x10c83
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/khedoros[P]khednes/mapper_001_mmc1.cpp
// Function: mapper_001::put_cbyte(unsigned int, unsigned int)
bool mapper_001::put_cbyte(const unsigned int val,const unsigned int addr) {
    if(cart->crom_pages == 0) {
        cart->crom[addr]=val;
        return true;
    }
    else return false;
}

// Assembly:
movq 0x8(%rdi), %rcx
movl 0x7c(%rcx), %eax
testl %eax, %eax
jne 0x10cab
movl %edx, %edx
movq 0x58(%rcx), %rcx
movb %sil, (%rcx,%rdx)
testl %eax, %eax
sete %al
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/khedoros[P]khednes/mapper_002_unrom.cpp
// Function: mapper_002::get_pbyte(unsigned int)
const unsigned int mapper_002::get_pbyte(const unsigned int addr) {
    if(addr < 0xC000)
        return cart->prom[addr-0x8000+prg_lo_offset];
    else
        return cart->prom[addr-0xC000+prg_hi_offset];
}

// Assembly:
movq 0x8(%rdi), %rax
movq 0x28(%rax), %rax
cmpl $0xbfff, %esi           # imm = 0xBFFF
ja 0x10e17
movl 0x10(%rdi), %ecx
addl %esi, %ecx
addl $0xffff8000, %ecx       # imm = 0xFFFF8000
jmp 0x10e22
movl 0x14(%rdi), %ecx
addl %esi, %ecx
addl $0xffff4000, %ecx       # imm = 0xFFFF4000
movl %ecx, %ecx
movzbl (%rax,%rcx), %eax
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/khedoros[P]khednes/mapper_002_unrom.cpp
// Function: mapper_002::get_pword(unsigned int)
const unsigned int mapper_002::get_pword(const unsigned int addr) {
    if(addr < 0xC000) {
        //std::cout<<"Reading: 0x"<<std::hex<<addr<<" (0x"<<(addr-0x8000+prg_lo_offset)<<")"<<std::endl;
        return cart->prom_w[addr-0x8000+prg_lo_offset];
    }
    else {
        //std::cout<<"Reading: 0x"<<std::hex<<addr<<" (0x"<<(addr-0xc000+prg_hi_offset)<<")"<<std::endl;
        return cart->prom_w[addr-0xC000+prg_hi_offset];
    }
}

// Assembly:
movq 0x8(%rdi), %rax
movq 0x40(%rax), %rax
cmpl $0xbfff, %esi           # imm = 0xBFFF
ja 0x10e47
movl 0x10(%rdi), %ecx
addl %esi, %ecx
addl $0xffff8000, %ecx       # imm = 0xFFFF8000
jmp 0x10e52
movl 0x14(%rdi), %ecx
addl %esi, %ecx
addl $0xffff4000, %ecx       # imm = 0xFFFF4000
movl %ecx, %ecx
movl (%rax,%rcx,4), %eax
retq
// File: /workspace/github_cpp_makefile_star2_O2/khedoros[P]khednes/mapper_002_unrom.cpp
// Function: mapper_002::put_cbyte(unsigned int, unsigned int)
bool mapper_002::put_cbyte(const unsigned int val,const unsigned int addr) {
    if(cart->crom_pages == 0) {
        cart->crom[addr]=val;
        cart->updated_crom = 3;
        return true;
    }
    else return false;
}

// Assembly:
movq 0x8(%rdi), %rcx
movl 0x7c(%rcx), %eax
testl %eax, %eax
jne 0x10e9d
movl %edx, %edx
movq 0x58(%rcx), %rcx
movb %sil, (%rcx,%rdx)
movq 0x8(%rdi), %rcx
movl $0x3, 0xa4(%rcx)
testl %eax, %eax
sete %al
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/khedoros[P]khednes/mapper_003_cnrom.cpp
// Function: mapper_003::get_pbyte(unsigned int)
const unsigned int mapper_003::get_pbyte(const unsigned int addr) {
    if(cart->prom_pages > 1) return cart->prom[addr-0x8000];
    else if(addr < 0xC000)
        return cart->prom[addr-0x8000];
    else
        return cart->prom[addr-0xC000];
}

// Assembly:
movq 0x8(%rdi), %rax
cmpl $0x2, 0x78(%rax)
jl 0x10f16
addl $0xffff8000, %esi       # imm = 0xFFFF8000
addq 0x28(%rax), %rsi
jmp 0x10f33
movq 0x28(%rax), %rax
cmpl $0xbfff, %esi           # imm = 0xBFFF
ja 0x10f2a
addl $0xffff8000, %esi       # imm = 0xFFFF8000
jmp 0x10f30
addl $0xffff4000, %esi       # imm = 0xFFFF4000
addq %rax, %rsi
movzbl (%rsi), %eax
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/khedoros[P]khednes/mapper_003_cnrom.cpp
// Function: mapper_003::get_pword(unsigned int)
const unsigned int mapper_003::get_pword(const unsigned int addr) {
    if(cart->prom_pages > 1) return cart->prom_w[addr-0x8000];
    else if(addr < 0xC000) {
        //std::cout<<"Reading: 0x"<<std::hex<<addr<<" (0x"<<(addr-0x8000+prg_lo_offset)<<")"<<std::endl;
        return cart->prom_w[addr-0x8000];
    }
    else {
        //std::cout<<"Reading: 0x"<<std::hex<<addr<<" (0x"<<(addr-0xc000+prg_hi_offset)<<")"<<std::endl;
        return cart->prom_w[addr-0xC000];
    }
}

// Assembly:
movq 0x8(%rdi), %rax
cmpl $0x2, 0x78(%rax)
jl 0x10f52
addl $0xffff8000, %esi       # imm = 0xFFFF8000
shlq $0x2, %rsi
addq 0x40(%rax), %rsi
jmp 0x10f70
movq 0x40(%rax), %rax
cmpl $0xbfff, %esi           # imm = 0xBFFF
ja 0x10f66
addl $0xffff8000, %esi       # imm = 0xFFFF8000
jmp 0x10f6c
addl $0xffff4000, %esi       # imm = 0xFFFF4000
leaq (%rax,%rsi,4), %rsi
movl (%rsi), %eax
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/khedoros[P]khednes/mapper_003_cnrom.cpp
// Function: mapper_003::get_cbyte(unsigned int)
const unsigned int mapper_003::get_cbyte(const unsigned int addr) {
    if(addr>=8192) {
        std::cout<<"Trying to get CHR byte at address: "<<addr<<std::endl;
        return 0;
    }
    return cart->crom[addr];
}

// Assembly:
pushq %rbx
movl %esi, %ebx
cmpl $0x2000, %esi           # imm = 0x2000
jb 0x10fa8
movq 0xa02a(%rip), %rdi      # 0x1afb0
leaq 0x35a3(%rip), %rsi      # 0x14530
callq 0x4390
movl %ebx, %esi
movq %rax, %rdi
callq 0x4270
movq %rax, %rdi
callq 0x41c0
xorl %eax, %eax
jmp 0x10fb6
movq 0x8(%rdi), %rax
movl %ebx, %ecx
movq 0x58(%rax), %rax
movzbl (%rax,%rcx), %eax
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O2/khedoros[P]khednes/mapper_003_cnrom.cpp
// Function: mapper_003::put_pbyte(unsigned int, unsigned int, unsigned int)
void mapper_003::put_pbyte(const unsigned int cycle, const unsigned int val,const unsigned int addr) {
        cart->updated_crom = 3;
        int real_val = ((val & get_pbyte(addr))&0x3);
        int new_chr_lo_offset = CHR_PAGE_SIZE * real_val;
        int new_chr_hi_offset = new_chr_lo_offset + 0x1000;
        ppu_change(cycle, lo_crom, new_chr_lo_offset);
        ppu_change(cycle, hi_crom, new_chr_hi_offset);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %edx, %r14d
movl %esi, %ebx
movq %rdi, %r15
movq 0x8(%rdi), %rax
movl $0x3, 0xa4(%rax)
movq (%rdi), %rax
movl %ecx, %esi
callq *(%rax)
andl %eax, %r14d
andl $0x3, %r14d
shll $0xd, %r14d
leal 0x1000(%r14), %ebp
movq (%r15), %rax
movq %r15, %rdi
movl %ebx, %esi
xorl %edx, %edx
movl %r14d, %ecx
callq *0x50(%rax)
movq (%r15), %rax
movq 0x50(%rax), %rax
pushq $0x1
popq %rdx
movq %r15, %rdi
movl %ebx, %esi
movl %ebp, %ecx
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmpq *%rax
nop
// File: /workspace/github_cpp_makefile_star2_O2/khedoros[P]khednes/mapper_003_cnrom.cpp
// Function: mapper_003::cycle_forward(unsigned int)
rom::ppu_change_t mapper_003::cycle_forward(unsigned int cycle) {
    unsigned int next_c = cycle + 1;
    if(ppu_queue.size() > 0) {
        next_c = ppu_queue.front().first;
    }
    rom::ppu_change_t changes;
    changes.val = 0;
    while(ppu_queue.size() > 0 && next_c < cycle) {
        rom_command_t comm = ppu_queue.front().second.first;
        int val = ppu_queue.front().second.second;
        switch(comm) {
        case lo_crom:
            changes.lo_crom = 1;
            chr_lo_offset = val;
            break;
        case hi_crom:
            changes.hi_crom = 1;
            chr_hi_offset = val;
            break;
        case set_horiz:
            changes.set_horiz = 1;
            cart->mirror_mode = HORIZ;
            break;
        case set_vert:
            changes.set_vert = 1;
            cart->mirror_mode = VERT;
            break;
        case set_4_scr:
            changes.set_4_scr = 1;
            cart->mirror_mode = FOUR_SCR;
            break;
        case set_bg:
            if(val == 0)
                changes.set_bg0 = 1;
            else
                changes.set_bg1 = 1;
            break;
        case set_spr:
            if(val == 0)
                changes.set_spr0 = 1;
            else
                changes.set_spr1 = 1;
            break;
        default:
            std::cout<<"Unknown command!"<<std::endl;
            break;
        }
        ppu_queue.pop_front();
        if(ppu_queue.size() > 0)
            next_c = ppu_queue.front().first;
    }
    return changes;

}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %esi, %ebx
movq %rdi, %r14
leaq 0x10(%rdi), %r15
movq 0x20(%rdi), %rax
testq %rax, %rax
je 0x1108d
movq (%r15), %rcx
movl 0x10(%rcx), %ebp
jmp 0x11090
leal 0x1(%rbx), %ebp
testq %rax, %rax
setne %al
xorl %r12d, %r12d
leaq 0x3528(%rip), %r13      # 0x145c8
testb $0x1, %al
je 0x1117c
cmpl %ebx, %ebp
jae 0x1117c
movq (%r15), %rax
movl 0x14(%rax), %ecx
cmpq $0x6, %rcx
ja 0x1110f
movl 0x18(%rax), %eax
movslq (%r13,%rcx,4), %rcx
addq %r13, %rcx
jmpq *%rcx
orl $0x1, %r12d
movl %eax, 0x28(%r14)
jmp 0x1115a
orl $0x10, %r12d
movq 0x8(%r14), %rax
movl $0x2, 0x88(%rax)
jmp 0x1115a
orl $0x4, %r12d
movq 0x8(%r14), %rax
movl $0x1, 0x88(%rax)
jmp 0x1115a
orl $0x8, %r12d
movq 0x8(%r14), %rax
andl $0x0, 0x88(%rax)
jmp 0x1115a
movq 0x9e9a(%rip), %rdi      # 0x1afb0
leaq 0x34d4(%rip), %rsi      # 0x145f1
callq 0x4390
movq %rax, %rdi
callq 0x41c0
jmp 0x1115a
orl $0x2, %r12d
movl %eax, 0x2c(%r14)
jmp 0x1115a
testl %eax, %eax
je 0x1114d
orl $0x40, %r12d
jmp 0x1115a
testl %eax, %eax
je 0x11153
orl $0x100, %r12d           # imm = 0x100
jmp 0x1115a
orl $0x20, %r12d
jmp 0x1115a
orl $0x80, %r12d
movq %r15, %rdi
callq 0x1119c
xorl %eax, %eax
cmpq $0x0, 0x20(%r14)
je 0x110a0
movq (%r15), %rax
movl 0x10(%rax), %ebp
movb $0x1, %al
jmp 0x110a0
movzwl %r12w, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/khedoros[P]khednes/mapper_011_color_dreams.cpp
// Function: mapper_011::mapper_011(rom*)
mapper_011::mapper_011(rom* r) : mapper(r) {
    prg_hi_offset = (r->prom_pages - 1) * PRG_PAGE_SIZE;
    prg_lo_offset = (r->prom_pages - 2) * PRG_PAGE_SIZE;
    chr_lo_offset = 0;
    chr_hi_offset = 0x1000;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
callq 0x107a4
leaq 0x9a02(%rip), %rax      # 0x1ac88
movq %rax, (%r14)
leaq 0x10(%r14), %rax
movq %rax, 0x18(%r14)
movq %rax, 0x10(%r14)
andq $0x0, 0x20(%r14)
movl 0x78(%rbx), %eax
shll $0xe, %eax
leal -0x4000(%rax), %ecx
movl %ecx, 0x28(%r14)
addl $0xffff8000, %eax       # imm = 0xFFFF8000
movl %eax, 0x2c(%r14)
movabsq $0x100000000000, %rax   # imm = 0x100000000000
movq %rax, 0x30(%r14)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/khedoros[P]khednes/mapper_011_color_dreams.cpp
// Function: mapper_011::get_pbyte(unsigned int)
const unsigned int mapper_011::get_pbyte(const unsigned int addr) {
    if(cart->prom_pages > 1) return cart->prom[addr-0x8000];
    else if(addr < 0xC000)
        return cart->prom[addr-0x8000];
    else
        return cart->prom[addr-0xC000];
}

// Assembly:
movq 0x8(%rdi), %rax
cmpl $0x2, 0x78(%rax)
jl 0x112e0
addl $0xffff8000, %esi       # imm = 0xFFFF8000
addq 0x28(%rax), %rsi
jmp 0x112fd
movq 0x28(%rax), %rax
cmpl $0xbfff, %esi           # imm = 0xBFFF
ja 0x112f4
addl $0xffff8000, %esi       # imm = 0xFFFF8000
jmp 0x112fa
addl $0xffff4000, %esi       # imm = 0xFFFF4000
addq %rax, %rsi
movzbl (%rsi), %eax
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/khedoros[P]khednes/mapper_011_color_dreams.cpp
// Function: mapper_011::get_cbyte(unsigned int)
const unsigned int mapper_011::get_cbyte(const unsigned int addr) {
    if(addr>=8192) {
        std::cout<<"Trying to get CHR byte at address: "<<addr<<std::endl;
        return 0;
    }
    return cart->crom[addr];
}

// Assembly:
pushq %rbx
movl %esi, %ebx
cmpl $0x2000, %esi           # imm = 0x2000
jb 0x11372
movq 0x9c60(%rip), %rdi      # 0x1afb0
leaq 0x31d9(%rip), %rsi      # 0x14530
callq 0x4390
movl %ebx, %esi
movq %rax, %rdi
callq 0x4270
movq %rax, %rdi
callq 0x41c0
xorl %eax, %eax
jmp 0x11380
movq 0x8(%rdi), %rax
movl %ebx, %ecx
movq 0x58(%rax), %rax
movzbl (%rax,%rcx), %eax
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O2/khedoros[P]khednes/mapper_011_color_dreams.cpp
// Function: mapper_011::put_pbyte(unsigned int, unsigned int, unsigned int)
void mapper_011::put_pbyte(const unsigned int cycle, const unsigned int val,const unsigned int addr) {
    int real_val = val & get_pbyte(addr);
    int prg_page = (real_val & 3);
    int chr_page = real_val / 16;
    //std::cout<<"Switch to PRG page "<<prg_page<<", CHR page "<<chr_page<<std::endl;
    prg_lo_offset = 2 * prg_page * PRG_PAGE_SIZE;
    prg_hi_offset = ((2 * prg_page) + 1) * PRG_PAGE_SIZE;
    int new_chr_lo_offset = chr_page * CHR_PAGE_SIZE;
    int new_chr_hi_offset = new_chr_lo_offset + 0x1000;
    ppu_change(cycle, lo_crom, new_chr_lo_offset);
    ppu_change(cycle, hi_crom, new_chr_hi_offset);
    cart->updated_crom = 3;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movl %edx, %r14d
movl %esi, %ebp
movq %rdi, %rbx
movq (%rdi), %rax
movl %ecx, %esi
callq *(%rax)
movl %eax, %ecx
andl %r14d, %ecx
pushq $0x10
popq %rsi
movl %ecx, %eax
cltd
idivl %esi
andl $0x3, %ecx
shll $0xf, %ecx
movl %ecx, 0x2c(%rbx)
orl $0x4000, %ecx           # imm = 0x4000
movl %ecx, 0x28(%rbx)
shll $0xd, %eax
leal 0x1000(%rax), %r14d
movq (%rbx), %r8
movq %rbx, %rdi
movl %ebp, %esi
xorl %edx, %edx
movl %eax, %ecx
callq *0x50(%r8)
movq (%rbx), %rax
pushq $0x1
popq %rdx
movq %rbx, %rdi
movl %ebp, %esi
movl %r14d, %ecx
callq *0x50(%rax)
movq 0x8(%rbx), %rax
movl $0x3, 0xa4(%rax)
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/khedoros[P]khednes/mapper_nsf.cpp
// Function: mapper_nsf::reset_map()
void mapper_nsf::reset_map() {
    if(cart->uses_banks) {
        for(int i=0;i<8;++i)
            bank[i] = cart->get_header(0x70+i);
    }
    else {
        for(int i=0;i<8;++i)
            bank[i] = i;
    }
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x10(%rdi), %rax
cmpb $0x0, 0xcf(%rax)
je 0x11728
xorl %r14d, %r14d
cmpq $0x8, %r14
je 0x11739
movq 0x10(%rbx), %rdi
movl %r14d, %esi
orl $0x70, %esi
callq 0x8e9c
movl %eax, 0x18(%rbx,%r14,4)
incq %r14
jmp 0x11709
xorl %eax, %eax
cmpq $0x8, %rax
je 0x11739
movl %eax, 0x18(%rbx,%rax,4)
incq %rax
jmp 0x1172a
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O2/rom1v[P]metahanoi/hanoi.cpp
// Function: Hanoi::solveRec(unsigned int, unsigned int)
void solveRec(size disks, tower target) {
        if (disks == 0) {
            return;
        }
        // the tower of the largest disk at this depth of recursion
        tower &largest = state[state.size() - disks];
        if (largest == target) {
            // the largest disk is already on the target tower
            solveRec(disks - 1, target);
        } else {
            // move disks above the largest to the intermediate tower
            solveRec(disks - 1, other(largest, target));
            // move the largest disk to the target
            largest = target;
            printState();
            // move back the disks on the largest
            solveRec(disks - 1, target);
        }
    }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %edx, %ebx
movl %esi, %ebp
movq %rdi, %r14
movl %esi, %r15d
decl %ebp
negq %r15
cmpl $-0x1, %ebp
je 0x1484
movq (%r14), %r13
movq 0x8(%r14), %r12
subq %r13, %r12
sarq $0x2, %r12
addq %r15, %r12
movl (%r13,%r12,4), %eax
cmpl %ebx, %eax
je 0x147d
addl %ebx, %eax
pushq $0x3
popq %rdx
subl %eax, %edx
movq %r14, %rdi
movl %ebp, %esi
callq 0x1426
movl %ebx, (%r13,%r12,4)
movq %r14, %rdi
callq 0x13f0
decl %ebp
incq %r15
jmp 0x1440
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/fpavetic[P]lcskpp/./random_strings.h
// Function: generate_similar(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, double const&)
std::string generate_similar(const std::string& a, 
                             const double& p_err) {
  std::string b = a;
  for (int i = 0; i < b.size(); ++i) {
    if (1.0*rand()/RAND_MAX <= p_err) {
      b[i] = get_random_base();
    }
  }
  return b;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdx, %rbx
movq %rdi, %r14
callq 0x2190
xorl %r15d, %r15d
cmpq %r15, 0x8(%r14)
jbe 0x23fc
callq 0x2050
cvtsi2sd %eax, %xmm0
divsd 0x3c27(%rip), %xmm0     # 0x6008
movsd (%rbx), %xmm1
ucomisd %xmm0, %xmm1
jb 0x23f7
callq 0x239c
movq (%r14), %rcx
movb %al, (%rcx,%r15)
incq %r15
jmp 0x23ca
movq %r14, %rax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O2/fpavetic[P]lcskpp/./random_strings.h
// Function: generate_string[abi:cxx11](int const&)
std::string generate_string(const int& len) {
  std::string ret;
  for (int i = 0; i < len; ++i) {
    ret += get_random_base();
  }
  assert(ret.size() == len);
  return ret;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movq %rdi, %rbx
leaq 0x10(%rdi), %rax
movq %rax, (%rdi)
andq $0x0, 0x8(%rdi)
movq %rsi, %r14
movb $0x0, 0x10(%rdi)
xorl %ebp, %ebp
movslq (%r14), %rax
cmpl %eax, %ebp
jge 0x243c
callq 0x239c
movsbl %al, %esi
movq %rbx, %rdi
callq 0x2100
incl %ebp
jmp 0x2421
cmpq %rax, 0x8(%rbx)
jne 0x244a
movq %rbx, %rax
popq %rbx
popq %r14
popq %rbp
retq
leaq 0x3be4(%rip), %rdi      # 0x6035
leaq 0x3bef(%rip), %rsi      # 0x6047
leaq 0x3bfb(%rip), %rcx      # 0x605a
pushq $0x27
popq %rdx
callq 0x20c0
movq %rax, %r14
movq %rbx, %rdi
callq 0x2218
movq %r14, %rdi
callq 0x21f0
// File: /workspace/github_cpp_makefile_star2_O2/fpavetic[P]lcskpp/test_lcskpp.cpp
// Function: test_lcskpp(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, int)
int test_lcskpp(const string& a, const string& b, const int K) {
  int lcskpp_length = 0;
  lcskpp_slow(a, b, K, &lcskpp_length);

  int lcskpp_sparse_slow_len = 0;
  vector<pair<int, int> > lcskpp_sparse_slow_recon;
  lcskpp_sparse_slow(a, b, K, &lcskpp_sparse_slow_len,
                     &lcskpp_sparse_slow_recon);

  int lcskpp_sparse_fast_len = 0;
  vector<pair<int, int> > lcskpp_sparse_fast_recon;
  lcskpp_sparse_fast(a, b, K, &lcskpp_sparse_fast_len,
                     &lcskpp_sparse_fast_recon);
  
  // printf("%d %d %d\n", 
  //        lcskpp_length, 
  //        lcskpp_sparse_slow_len,
  //        lcskpp_sparse_fast_len);
  // printf("%s\n%s\n", a.c_str(), b.c_str());
  assert(lcskpp_length == lcskpp_sparse_slow_len);
  assert(lcskpp_length == lcskpp_sparse_fast_len);
  assert(valid_lcskpp(a, b, K, lcskpp_sparse_slow_len, 
		      lcskpp_sparse_slow_recon));
  assert(valid_lcskpp(a, b, K, lcskpp_sparse_fast_len,
    		      lcskpp_sparse_fast_recon));
  
  return lcskpp_length;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x50, %rsp
movl %edx, %ebx
movq %rsi, %r14
movq %rdi, %r15
leaq 0x8(%rsp), %rcx
andl $0x0, (%rcx)
callq 0x382a
leaq 0xc(%rsp), %rcx
andl $0x0, (%rcx)
xorps %xmm0, %xmm0
leaq 0x30(%rsp), %r8
movaps %xmm0, (%r8)
andq $0x0, 0x10(%r8)
movq %r15, %rdi
movq %r14, %rsi
movl %ebx, %edx
callq 0x2c54
leaq 0x4(%rsp), %rcx
andl $0x0, (%rcx)
leaq 0x10(%rsp), %r8
xorps %xmm0, %xmm0
movaps %xmm0, (%r8)
andq $0x0, 0x10(%r8)
movq %r15, %rdi
movq %r14, %rsi
movl %ebx, %edx
callq 0x3227
movl 0x8(%rsp), %ecx
cmpl 0xc(%rsp), %ecx
jne 0x2548
cmpl 0x4(%rsp), %ecx
jne 0x2561
leaq 0x30(%rsp), %r8
movq %r15, %rdi
movq %r14, %rsi
movl %ebx, %edx
callq 0x3706
testb %al, %al
je 0x257a
movl 0x4(%rsp), %ecx
leaq 0x10(%rsp), %r8
movq %r15, %rdi
movq %r14, %rsi
movl %ebx, %edx
callq 0x3706
testb %al, %al
je 0x2593
movl 0x8(%rsp), %ebx
leaq 0x10(%rsp), %rdi
callq 0x2912
leaq 0x30(%rsp), %rdi
callq 0x2912
movl %ebx, %eax
addq $0x50, %rsp
popq %rbx
popq %r14
popq %r15
retq
leaq 0x3b34(%rip), %rdi      # 0x6083
leaq 0x3b55(%rip), %rsi      # 0x60ab
leaq 0x3b5e(%rip), %rcx      # 0x60bb
pushq $0x39
jmp 0x25aa
leaq 0x3b8e(%rip), %rdi      # 0x60f6
leaq 0x3b3c(%rip), %rsi      # 0x60ab
leaq 0x3b45(%rip), %rcx      # 0x60bb
pushq $0x3a
jmp 0x25aa
leaq 0x3b9d(%rip), %rdi      # 0x611e
leaq 0x3b23(%rip), %rsi      # 0x60ab
leaq 0x3b2c(%rip), %rcx      # 0x60bb
pushq $0x3c
jmp 0x25aa
leaq 0x3bcc(%rip), %rdi      # 0x6166
leaq 0x3b0a(%rip), %rsi      # 0x60ab
leaq 0x3b13(%rip), %rcx      # 0x60bb
pushq $0x3e
popq %rdx
callq 0x20c0
movq %rax, %rbx
jmp 0x25c2
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
callq 0x2912
leaq 0x30(%rsp), %rdi
callq 0x2912
movq %rbx, %rdi
callq 0x21f0
// File: /workspace/github_cpp_makefile_star2_O2/fpavetic[P]lcskpp/test_lcskpp.cpp
// Function: main
int main(int argc, char* argv[]) {
  printf("Running tests on %d random pairs ", kSimulationRuns);
  printf("with the following parameters:\n");
  printf("  string length=%d\n", kStringLen);
  printf("  k=%d\n", kK);
  printf("  pErr=%0.2lf\n", kPerr);

  srand(1603);

  map<int, double> distr;
  calculate_distribution(distr);

  double sum_prob = 0;
  double e_lcs = 0;

  for (int i = 0; i <= kStringLen; ++i) {
    double p = distr[i];
    sum_prob += p;
    e_lcs += p*i;
  }

  assert(0.99999 <= sum_prob <= 1.00001);
  printf("Expected LCSk++=%0.3lf\n", e_lcs);
  printf("Test PASSED!\n");
  return 0;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
subq $0x40, %rsp
leaq 0x3ab6(%rip), %rdi      # 0x61ae
xorl %ebp, %ebp
movl $0x3e8, %esi            # imm = 0x3E8
xorl %eax, %eax
callq 0x2030
leaq 0x3b06(%rip), %rdi      # 0x6213
callq 0x21c0
leaq 0x3ab7(%rip), %rdi      # 0x61d0
pushq $0x64
popq %rsi
xorl %eax, %eax
callq 0x2030
leaq 0x3aba(%rip), %rdi      # 0x61e4
pushq $0xa
popq %rsi
xorl %eax, %eax
callq 0x2030
leaq 0x3ab1(%rip), %rdi      # 0x61ec
movsd 0x38d5(%rip), %xmm0     # 0x6018
movb $0x1, %al
callq 0x2030
movl $0x643, %edi            # imm = 0x643
callq 0x2130
leaq 0x18(%rsp), %rax
andl $0x0, (%rax)
andq $0x0, 0x8(%rax)
movq %rax, 0x10(%rax)
movq %rax, 0x18(%rax)
andq $0x0, 0x20(%rax)
leaq 0x10(%rsp), %rdi
callq 0x269b
xorpd %xmm0, %xmm0
movsd %xmm0, 0x8(%rsp)
leaq 0x10(%rsp), %rbx
leaq 0x4(%rsp), %r14
movl %ebp, 0x4(%rsp)
cmpl $0x65, %ebp
jge 0x27c0
movq %rbx, %rdi
movq %r14, %rsi
callq 0x2870
movl 0x4(%rsp), %ebp
cvtsi2sd %ebp, %xmm0
mulsd (%rax), %xmm0
movsd 0x8(%rsp), %xmm1
addsd %xmm0, %xmm1
movsd %xmm1, 0x8(%rsp)
incl %ebp
jmp 0x278c
leaq 0x3a34(%rip), %rdi      # 0x61fb
movsd 0x8(%rsp), %xmm0
movb $0x1, %al
callq 0x2030
leaq 0x3a57(%rip), %rdi      # 0x6232
callq 0x21c0
leaq 0x10(%rsp), %rdi
callq 0x28ca
xorl %eax, %eax
addq $0x40, %rsp
popq %rbx
popq %r14
popq %rbp
retq
jmp 0x27f7
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
callq 0x28ca
movq %rbx, %rdi
callq 0x21f0
// File: /workspace/github_cpp_makefile_star2_O2/fpavetic[P]lcskpp/lcskpp.cpp
// Function: lcskpp_sparse_slow(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, int, int*, std::vector<std::pair<int, int>, std::allocator<std::pair<int, int>>>*)
void lcskpp_sparse_slow(
    const string& a, const string& b,
    const int k, int* lcskpp_length,
    vector<pair<int, int> >* lcskpp_reconstruction) {
  vector<pair<int, int> > matches;
  get_matches(a, b, k, &matches);
  lcskpp_sparse_slow(matches, k, lcskpp_length, 
                     lcskpp_reconstruction);  
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
subq $0x20, %rsp
movq %r8, %rbx
movq %rcx, %r14
movl %edx, %ebp
xorps %xmm0, %xmm0
movq %rsp, %rcx
movaps %xmm0, (%rcx)
andq $0x0, 0x10(%rcx)
callq 0x2cab
movq %rsp, %rdi
movl %ebp, %esi
movq %r14, %rdx
movq %rbx, %rcx
callq 0x2ff5
movq %rsp, %rdi
callq 0x2912
addq $0x20, %rsp
popq %rbx
popq %r14
popq %rbp
retq
movq %rax, %rbx
movq %rsp, %rdi
callq 0x2912
movq %rbx, %rdi
callq 0x21f0
// File: /workspace/github_cpp_makefile_star2_O2/fpavetic[P]lcskpp/lcskpp.cpp
// Function: valid_lcskpp(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, int, int, std::vector<std::pair<int, int>, std::allocator<std::pair<int, int>>> const&)
bool valid_lcskpp(const string& a, const string& b,
                  const int k, const int lcskpp_len,
                  const vector<pair<int, int> >& lcskpp_recon) {
  // 1) Ensure correct length.
  if (lcskpp_len != lcskpp_recon.size()) {
    return false;
  }

  // 2) Ensure chars corresponding to the indices match.
  for (auto match: lcskpp_recon) {
    int i = match.first;
    int j = match.second;
    
    if (i < 0 || i >= a.size()) { return false; }
    if (j < 0 || j >= b.size()) { return false; }
    if (a[i] != b[j]) { return false; }
  }

  // 3) Ensure runs of indices have at least length of k.
  int run_a = 1;
  int run_b = 1;
  for (size_t i = 1; i < lcskpp_recon.size(); ++i) {
    if (lcskpp_recon[i-1].first >= lcskpp_recon[i].first) { return false; }
    if (lcskpp_recon[i-1].second >= lcskpp_recon[i].second) { return false; }

    if (lcskpp_recon[i-1].first+1 == lcskpp_recon[i].first) { ++run_a; }
    if (lcskpp_recon[i-1].second+1 == lcskpp_recon[i].second) { ++run_b; }

    if (i+1 == lcskpp_recon.size() || 
        lcskpp_recon[i-1].first+1 != lcskpp_recon[i].first) {
      if (run_a < k) { return false; }
      run_a = 1;
    }

    if (i+1 == lcskpp_recon.size() ||
        lcskpp_recon[i-1].second+1 != lcskpp_recon[i].second) {
      if (run_b < k) { return false; }
      run_b = 1;
    }
  }

  return true;
}

// Assembly:
movslq %ecx, %rcx
movq (%r8), %r9
movq 0x8(%r8), %r8
movq %r8, %rax
subq %r9, %rax
sarq $0x3, %rax
cmpq %rcx, %rax
jne 0x3777
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq (%rdi), %r10
movq 0x8(%rdi), %rdi
movq (%rsi), %r11
movq 0x8(%rsi), %rsi
movq %r9, %rbx
cmpq %r8, %rbx
je 0x377a
movslq (%rbx), %r14
testq %r14, %r14
js 0x376a
xorl %eax, %eax
cmpq %r14, %rdi
jbe 0x376c
movl 0x4(%rbx), %r15d
testl %r15d, %r15d
js 0x376c
cmpq %r15, %rsi
jbe 0x376a
movb (%r10,%r14), %al
addq $0x8, %rbx
cmpb (%r11,%r15), %al
je 0x373a
xorl %eax, %eax
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
xorl %eax, %eax
retq
movabsq $0x2, %rsi
subq %rcx, %rsi
movabsq $0x1, %rdi
movl $0x1, %eax
movl %eax, %r11d
movl %eax, %r10d
cmpq %rcx, %rdi
setae %al
jae 0x376c
movl -0x8(%r9,%rdi,8), %r12d
movl (%r9,%rdi,8), %r13d
cmpl %r13d, %r12d
jge 0x376c
movl -0x4(%r9,%rdi,8), %r14d
movl 0x4(%r9,%rdi,8), %r15d
cmpl %r15d, %r14d
jge 0x376c
incl %r12d
leal 0x1(%r11), %ebx
incl %r14d
leal 0x1(%r10), %ebp
cmpl %r15d, %r14d
cmovel %ebp, %r10d
leaq (%rsi,%rdi), %r8
cmpq $0x1, %r8
jne 0x37f6
cmpl %r13d, %r12d
cmovel %ebx, %r11d
movl $0x1, %ebx
cmpl %edx, %r11d
jge 0x380e
jmp 0x376c
cmpl %r13d, %r12d
je 0x3809
movl $0x1, %ebx
cmpl %edx, %r11d
jl 0x376c
cmpl %r15d, %r14d
je 0x381c
movl $0x1, %ebp
cmpl %edx, %r10d
jl 0x376c
incq %rdi
movl %ebx, %r11d
movl %ebp, %r10d
jmp 0x379c
// File: /workspace/github_cpp_makefile_star2_O2/fpavetic[P]lcskpp/./fenwick.h
// Function: FenwickMax<std::pair<int, int>>::get(unsigned long)
T get(size_t pos) {
    ++pos;
    T ret = T();
    for ( ; pos > 0; pos -= lobit(pos)) {
      ret = std::max(ret, elements_[pos]);
    }
    return ret;
  }

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %rsi, %rbx
movq %rdi, %r14
incq %rbx
leaq 0x8(%rsp), %r15
andq $0x0, (%r15)
testq %rbx, %rbx
je 0x4c30
leaq (,%rbx,8), %rsi
addq (%r14), %rsi
movq %r15, %rdi
callq 0x56e6
movq (%rax), %rax
movq %rax, 0x8(%rsp)
leaq -0x1(%rbx), %rax
andq %rax, %rbx
jmp 0x4c07
movq 0x8(%rsp), %rax
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/Thomas1995[P]Rentz/src/score.cpp
// Function: Table::ChangeScore()
void Table::ChangeScore() {

    int crtConnection = firstPlayer - players.begin();

    int scoreToAdd = 0;

    if(gameType == KingOfHearts)
        ScoreKingOfHearts(scoreToAdd);

    if(gameType == Queens)
        ScoreQueens(scoreToAdd);

    if(gameType == Diamonds)
        ScoreDiamonds(scoreToAdd);

    if(gameType == Acool)
        ScoreAcool(scoreToAdd);

    if(gameType == Whist)
        ScoreWhist(scoreToAdd);

    if(gameType == TenClub)
        ScoreTenClub(scoreToAdd);

    if(gameType == Totals)
        ScoreTotals(scoreToAdd);

    score[crtConnection] += scoreToAdd * (1 + modeNV);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %rdi, %rbx
movq 0x8(%rdi), %r15
movq 0x20(%rdi), %r14
andl $0x0, 0xc(%rsp)
movl 0x58(%rdi), %eax
cmpl $0x1, %eax
jne 0x2e6d
leaq 0xc(%rsp), %rsi
movq %rbx, %rdi
callq 0x2f04
movl 0x58(%rbx), %eax
cmpl $0x2, %eax
jne 0x2e82
leaq 0xc(%rsp), %rsi
movq %rbx, %rdi
callq 0x2f58
movl 0x58(%rbx), %eax
cmpl $0x3, %eax
jne 0x2e97
leaq 0xc(%rsp), %rsi
movq %rbx, %rdi
callq 0x2fa0
movl 0x58(%rbx), %eax
cmpl $0x6, %eax
je 0x2eb4
cmpl $0x5, %eax
je 0x2ead
cmpl $0x4, %eax
jne 0x2ec4
addl $-0xa, 0xc(%rsp)
jmp 0x2ed6
addl $0xa, 0xc(%rsp)
jmp 0x2ed6
leaq 0xc(%rsp), %rsi
movq %rbx, %rdi
callq 0x2ff0
movl 0x58(%rbx), %eax
cmpl $0x7, %eax
jne 0x2ed6
leaq 0xc(%rsp), %rsi
movq %rbx, %rdi
callq 0x3044
subq %r15, %r14
movl $0x2058, %ecx           # imm = 0x2058
movq %r14, %rax
cqto
idivq %rcx
movzbl 0x5c(%rbx), %ecx
incl %ecx
imull 0xc(%rsp), %ecx
movq 0x40(%rbx), %rdx
cltq
addl %ecx, (%rdx,%rax,4)
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O2/Thomas1995[P]Rentz/src/score.cpp
// Function: Table::ScoreTotals(int&)
void Table::ScoreTotals(int& scoreToAdd) {
    ScoreKingOfHearts(scoreToAdd);
    ScoreQueens(scoreToAdd);
    ScoreDiamonds(scoreToAdd);
    ScoreAcool(scoreToAdd);
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
callq 0x2f04
movq %r14, %rdi
movq %rbx, %rsi
callq 0x2f58
movq %r14, %rdi
movq %rbx, %rsi
callq 0x2fa0
addl $-0xa, (%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O2/Thomas1995[P]Rentz/src/server.cpp
// Function: main
int main(int argc, char ** argv) {

  if(argc != 2) {
    printf("Usage: %s number-of-clients\n", argv[0]);
    exit(1);
  }

  int clientsNumber = atoi(argv[1]);

  require(clientsNumber >= 3 && clientsNumber <= 6,
    "The numbers of clients in a game should be between 3 and 6.\n");

  Table::TABLE_SIZE = clientsNumber;

  Table table;
  Server server;

  while(true) {
    const int n = server.poll();
    //there are n new incoming connections
    for(int i = 0; i < n; ++i) {
      const int client = server.acceptConnection();
      
      if(table.GAME_END) {
          Table newTable;
          table = newTable;
      }

      table.addPlayer(client);
    }

    std::this_thread::sleep_for(std::chrono::milliseconds(100));
  }

  return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xe8, %rsp
cmpl $0x2, %edi
jne 0x3412
movq 0x8(%rsi), %rdi
callq 0x23a0
movl %eax, %ebx
leaq 0x4d70(%rip), %rsi      # 0x80c0
leaq 0x8(%rsp), %rdi
leaq 0x28(%rsp), %rdx
callq 0x3074
leal -0x3(%rbx), %eax
xorl %edi, %edi
cmpl $0x4, %eax
setb %dil
leaq 0x8(%rsp), %rsi
callq 0x7154
leaq 0x8(%rsp), %rdi
callq 0x2110
leaq 0x9f92(%rip), %rax      # 0xd318
movl %ebx, (%rax)
leaq 0x28(%rsp), %rdi
callq 0x594c
movq %rsp, %rdi
callq 0x347a
movq %rsp, %rbx
xorl %r13d, %r13d
leaq 0x88(%rsp), %r14
leaq 0x28(%rsp), %r15
movq %rbx, %rdi
callq 0x35c6
movl %eax, %ebp
testl %eax, %eax
cmovlel %r13d, %ebp
subl $0x1, %ebp
jb 0x33fc
movq %rbx, %rdi
callq 0x3684
movl %eax, %r12d
cmpb $0x1, 0x28(%rsp)
jne 0x33ef
movq %r14, %rdi
callq 0x594c
movq %r15, %rdi
movq %r14, %rsi
callq 0x3726
movq %r14, %rdi
callq 0x377c
movq %r15, %rdi
movl %r12d, %esi
callq 0x6334
jmp 0x33bd
movq $0x64, 0x88(%rsp)
movq %r14, %rdi
callq 0x379f
jmp 0x33ad
movq (%rsi), %rsi
leaq 0x4c87(%rip), %rdi      # 0x80a3
xorl %eax, %eax
callq 0x2050
pushq $0x1
popq %rdi
callq 0x22c0
jmp 0x3443
jmp 0x3443
jmp 0x3443
movq %rax, %rbx
leaq 0x88(%rsp), %rdi
callq 0x377c
jmp 0x3446
movq %rax, %rbx
movq %rsp, %rdi
callq 0x37f4
jmp 0x3453
movq %rax, %rbx
leaq 0x28(%rsp), %rdi
callq 0x377c
jmp 0x3471
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x2110
jmp 0x3471
movq %rax, %rbx
movq %rbx, %rdi
callq 0x23e0
nop
// File: /workspace/github_cpp_makefile_star2_O2/Thomas1995[P]Rentz/src/./server.h
// Function: Server::Server()
Server() {
    //returns server's fd

    struct addrinfo hints, *rez;
    memset(&hints, 0, sizeof(hints));
    hints.ai_family = AF_UNSPEC;
    hints.ai_socktype = SOCK_STREAM;
    hints.ai_flags = AI_PASSIVE;

    getaddrinfo(NULL, PORT, &hints, &rez);

    int yes = 1;

    int server = -1;

    for(addrinfo *p = rez; p != NULL; p = p->ai_next) {
      server = socket(p->ai_family, p->ai_socktype, p->ai_protocol);

      if(server == -1) {
        perror("Socket() failed: ");
        continue;
      }

      if(setsockopt(server, SOL_SOCKET, SO_REUSEADDR, &yes, sizeof(int)) == -1) {
        perror("Setsockopt() failed: ");
        exit(1);
      }

      if(bind(server, p->ai_addr, p->ai_addrlen) == -1) {
        perror("Bind() failed: ");
        exit(1);
      }

      if(listen(server, BACKLOG) == -1) {
        perror("Listen() failed: ");
        exit(1);
      }

      break;
    }

    freeaddrinfo(rez);

    if(server == -1) {
      printf("Could not set up server\n");
      exit(1);
    }

    fd = server;

    epfd = epoll_create1(0);

    if(epfd == -1) {
      perror("Epoll_create() failed: ");
      exit(1);
    }

    addEpollEvent(server, EPOLLIN);

    printf("Server up and listening for connections\n");
  }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x40, %rsp
movq %rdi, %rbx
xorps %xmm0, %xmm0
leaq 0x10(%rsp), %rdx
movaps %xmm0, (%rdx)
movaps %xmm0, 0x10(%rdx)
movaps %xmm0, 0x20(%rdx)
pushq $0x1
popq %rbp
movl %ebp, 0x8(%rdx)
movl %ebp, (%rdx)
leaq 0x4d3b(%rip), %rsi      # 0x81e6
leaq 0x8(%rsp), %r14
xorl %edi, %edi
movq %r14, %rcx
callq 0x22e0
movl %ebp, 0x4(%rsp)
pushq $-0x1
popq %r12
leaq 0x4c34(%rip), %r15      # 0x80fd
movq (%r14), %r14
testq %r14, %r14
je 0x3583
movl 0x4(%r14), %edi
movl 0x8(%r14), %esi
movl 0xc(%r14), %edx
callq 0x2080
cmpl $-0x1, %eax
jne 0x34f9
movq %r15, %rdi
callq 0x21f0
addq $0x28, %r14
jmp 0x34c9
movl %eax, %ebp
pushq $0x1
popq %rsi
pushq $0x2
popq %rdx
leaq 0x4(%rsp), %rcx
pushq $0x4
popq %r8
movl %eax, %edi
callq 0x23f0
cmpl $-0x1, %eax
je 0x359f
movq 0x18(%r14), %rsi
movl 0x10(%r14), %edx
movl %ebp, %edi
callq 0x2070
cmpl $-0x1, %eax
je 0x35a8
pushq $0x10
popq %rsi
movl %ebp, %edi
callq 0x2280
cmpl $-0x1, %eax
je 0x35b1
movq 0x8(%rsp), %rdi
callq 0x2310
cmpl $-0x1, %ebp
je 0x3588
movl %ebp, (%rbx)
xorl %edi, %edi
callq 0x2320
movl %eax, 0x4(%rbx)
cmpl $-0x1, %eax
je 0x3596
pushq $0x1
popq %rdx
movq %rbx, %rdi
movl %ebp, %esi
callq 0x3806
leaq 0x4c35(%rip), %rdi      # 0x81a6
callq 0x2390
addq $0x40, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movl %r12d, %ebp
jmp 0x353d
leaq 0x4c3f(%rip), %rdi      # 0x81ce
callq 0x2390
jmp 0x35bd
leaq 0x4baa(%rip), %rdi      # 0x8147
jmp 0x35b8
leaq 0x4b69(%rip), %rdi      # 0x810f
jmp 0x35b8
leaq 0x4b76(%rip), %rdi      # 0x8125
jmp 0x35b8
leaq 0x4b7d(%rip), %rdi      # 0x8135
callq 0x21f0
pushq $0x1
popq %rdi
callq 0x22c0
nop
// File: /workspace/github_cpp_makefile_star2_O2/Thomas1995[P]Rentz/src/./server.h
// Function: Server::poll()
int poll() {
    static std::vector<epoll_event> events(MAX_EVENTS);
    const int n = epoll_wait(epfd, events.data(), MAX_EVENTS, -1);
    debug("Received %d events\n", n);
    return n;
  }

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movb 0x9cdd(%rip), %al       # 0xd2b0
testb %al, %al
je 0x361c
movl 0x4(%rbx), %edi
movq 0x9cb7(%rip), %rsi      # 0xd298
pushq $-0x1
popq %rcx
movl $0x400, %edx            # imm = 0x400
callq 0x2120
movl %eax, %ebx
movq 0x99d9(%rip), %r14      # 0xcfd0
movq (%r14), %rdi
leaq 0x4b5e(%rip), %rsi      # 0x815f
movl %eax, %edx
xorl %eax, %eax
callq 0x2350
movq (%r14), %rdi
callq 0x22b0
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
leaq 0x9c8d(%rip), %rdi      # 0xd2b0
callq 0x2410
testl %eax, %eax
je 0x35d7
leaq 0x9c65(%rip), %rdi      # 0xd298
leaq 0x7(%rsp), %rdx
movl $0x400, %esi            # imm = 0x400
callq 0x382c
leaq 0x235(%rip), %rdi       # 0x387e
leaq 0x9c48(%rip), %rsi      # 0xd298
leaq 0x9be1(%rip), %rdx      # 0xd238
callq 0x2210
leaq 0x9c4d(%rip), %rdi      # 0xd2b0
callq 0x21a0
jmp 0x35d7
movq %rax, %rbx
leaq 0x9c39(%rip), %rdi      # 0xd2b0
callq 0x2190
movq %rbx, %rdi
callq 0x23e0
// File: /workspace/github_cpp_makefile_star2_O2/Thomas1995[P]Rentz/src/./server.h
// Function: Server::acceptConnection()
int acceptConnection() {
    sockaddr_storage addr;
    socklen_t addrlen = sizeof(addr);
    int client = accept(fd, (sockaddr *)&addr, &addrlen);

    char buff[INET6_ADDRSTRLEN];

    if(addr.ss_family == AF_INET) {
      //the client is using IPv4
      sockaddr_in *sin = (sockaddr_in *)&addr;
      inet_ntop(sin->sin_family, (void *)&sin->sin_addr, buff, sizeof(buff));

      debug("Accepted connection from %s: %d\n", buff, sin->sin_port);
    } else {
      //the client is using IPv6
      sockaddr_in6 *sin = (sockaddr_in6 *)&addr;
      inet_ntop(sin->sin6_family, (void *)&sin->sin6_addr, buff, sizeof(buff));
      debug("Accepted connection from %s: %d\n", buff, sin->sin6_port);
    }

    if(client == -1) {
      perror("Accept() failed: ");
      exit(1);
    }
    return client;
  }

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0xc8, %rsp
leaq 0xc(%rsp), %rdx
movl $0x80, (%rdx)
movl (%rdi), %edi
leaq 0x48(%rsp), %r14
movq %r14, %rsi
callq 0x20c0
movl %eax, %ebx
movzwl (%r14), %edi
xorl %eax, %eax
cmpl $0x2, %edi
setne %al
leaq (%rsp,%rax,4), %rsi
addq $0x4c, %rsi
leaq 0x10(%rsp), %r15
pushq $0x2e
popq %rcx
movq %r15, %rdx
callq 0x2260
movq 0x98f7(%rip), %r12      # 0xcfd0
movq (%r12), %rdi
movzwl 0x2(%r14), %ecx
leaq 0x4a8a(%rip), %rsi      # 0x8173
movq %r15, %rdx
xorl %eax, %eax
callq 0x2350
movq (%r12), %rdi
callq 0x22b0
cmpl $-0x1, %ebx
je 0x3712
movl %ebx, %eax
addq $0xc8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
leaq 0x4a7b(%rip), %rdi      # 0x8194
callq 0x21f0
pushq $0x1
popq %rdi
callq 0x22c0
// File: /workspace/github_cpp_makefile_star2_O2/Thomas1995[P]Rentz/src/./server.h
// Function: Server::addEpollEvent(int, int)
void addEpollEvent(const int fd, const int flags) {
    epoll_event e;
    memset(&e, 0, sizeof(e));
    e.events = flags;
    e.data.fd = fd;
    epoll_ctl(epfd, EPOLL_CTL_ADD, fd, &e);
  }

// Assembly:
subq $0x18, %rsp
movl %esi, %eax
leaq 0xc(%rsp), %rcx
andl $0x0, 0x8(%rcx)
movl %edx, (%rcx)
movl %esi, 0x4(%rcx)
movl 0x4(%rdi), %edi
pushq $0x1
popq %rsi
movl %eax, %edx
callq 0x2340
addq $0x18, %rsp
retq
// File: /workspace/github_cpp_makefile_star2_O2/Thomas1995[P]Rentz/src/connection.cpp
// Function: Connection::handshake[abi:cxx11](unsigned char)
std::string Connection::handshake(uint8_t playerCount) {
  event req;
  req.type = event::EType::HANDSHAKE;
  req.len = 1;
  req.data = &playerCount;
  req.send(sfd);

  readAndAssert(resp);

  std::string name;

  for(size_t i = 0; i < resp.len; ++i) {
    name += resp.data[i];
  }

  resp.free();
  return name;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %rsi, %r14
movq %rdi, %rbx
leaq 0x7(%rsp), %rax
movb %dl, (%rax)
leaq 0x20(%rsp), %r15
movl $0x9, (%r15)
movq $0x1, 0x8(%r15)
movq %rax, 0x10(%r15)
movl 0x201c(%rsi), %esi
movq %r15, %rdi
callq 0x4ca0
leaq 0x8(%rsp), %r12
movq %r12, %rdi
movq %r14, %rsi
callq 0x742c
movl (%r12), %eax
cmpl (%r15), %eax
jne 0x4501
leaq 0x10(%rbx), %rax
movq %rax, (%rbx)
andq $0x0, 0x8(%rbx)
movb $0x0, 0x10(%rbx)
xorl %r14d, %r14d
cmpq 0x10(%rsp), %r14
jae 0x44e8
movq 0x18(%rsp), %rax
movsbl (%rax,%r14), %esi
movq %rbx, %rdi
callq 0x2200
incq %r14
jmp 0x44ca
leaq 0x8(%rsp), %rdi
callq 0x4e56
movq %rbx, %rax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
leaq 0x3d08(%rip), %rdi      # 0x8210
leaq 0x3d17(%rip), %rsi      # 0x8226
leaq 0x3d74(%rip), %rcx      # 0x828a
pushq $0x44
popq %rdx
callq 0x21b0
movq %rax, %r14
movq %rbx, %rdi
callq 0x2110
movq %r14, %rdi
callq 0x23e0
nop
// File: /workspace/github_cpp_makefile_star2_O2/Thomas1995[P]Rentz/src/connection.cpp
// Function: Connection::getCardChoice()
Card Connection::getCardChoice() {
  event req;
  req.type = event::ASK_CARD;
  req.len = 0;
  req.data = NULL;
  req.send(sfd);

  readAndAssert(resp);

  assert(resp.len == 1);

  Card card(resp.data[0]);

  //debug("Received card %s from client\n", card.to_string().c_str());

  bool in = 0;

  for(const auto &i: hand) {
      if(i == card)
          in = 1;
  }

  if(!in) {
      debug("The client has sent an incorrect card");
      exit(1);
  }

  hand.erase(find(hand.begin(), hand.end(), card));

  resp.free();
  return card;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %rsi, %r14
movq %rdi, %rbx
leaq 0x20(%rsp), %r15
movl $0x6, (%r15)
xorps %xmm0, %xmm0
movups %xmm0, 0x8(%r15)
movl 0x201c(%rsi), %esi
movq %r15, %rdi
callq 0x4ca0
leaq 0x8(%rsp), %r12
movq %r12, %rdi
movq %r14, %rsi
callq 0x742c
movl (%r12), %eax
cmpl (%r15), %eax
jne 0x4614
cmpq $0x1, 0x10(%rsp)
jne 0x462d
movq 0x18(%rsp), %rax
movzbl (%rax), %esi
movq %rbx, %rdi
callq 0x5434
leaq 0x2040(%r14), %r15
movq 0x2040(%r14), %r12
movq 0x2048(%r14), %r13
xorl %ebp, %ebp
cmpq %r13, %r12
je 0x45d1
movq %r12, %rdi
movq %rbx, %rsi
callq 0x54d6
orb %al, %bpl
addq $0x8, %r12
jmp 0x45b8
testb $0x1, %bpl
je 0x464a
movq 0x2040(%r14), %rdi
movq 0x2048(%r14), %rsi
movq %rbx, %rdx
callq 0x51de
movq %r15, %rdi
movq %rax, %rsi
callq 0x4e50
leaq 0x8(%rsp), %rdi
callq 0x4e56
movq %rbx, %rax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x3bf5(%rip), %rdi      # 0x8210
leaq 0x3c04(%rip), %rsi      # 0x8226
leaq 0x3c0c(%rip), %rcx      # 0x8235
pushq $0x1a
jmp 0x4644
leaq 0x3c22(%rip), %rdi      # 0x8256
leaq 0x3beb(%rip), %rsi      # 0x8226
leaq 0x3bf3(%rip), %rcx      # 0x8235
pushq $0x1c
popq %rdx
callq 0x21b0
movq 0x897f(%rip), %rbx      # 0xcfd0
movq (%rbx), %rcx
leaq 0x3c09(%rip), %rdi      # 0x8264
pushq $0x25
popq %rsi
pushq $0x1
popq %rdx
callq 0x2440
movq (%rbx), %rdi
callq 0x22b0
pushq $0x1
popq %rdi
callq 0x22c0
// File: /workspace/github_cpp_makefile_star2_O2/Thomas1995[P]Rentz/src/connection.cpp
// Function: encodeCards(std::vector<Card, std::allocator<Card>> const&)
std::vector<uint8_t> encodeCards(const std::vector<Card>& cards) {
  std::vector<uint8_t> ret;

  for(const auto &c: cards)
    ret.push_back(c.encode());

  return ret;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
xorps %xmm0, %xmm0
andq $0x0, 0x10(%rdi)
movups %xmm0, (%rdi)
movq (%rsi), %r14
movq 0x8(%rsi), %r12
leaq 0x7(%rsp), %r15
cmpq %r12, %r14
je 0x46ba
movq %r14, %rdi
callq 0x55e6
movb %al, 0x7(%rsp)
movq %rbx, %rdi
movq %r15, %rsi
callq 0x50f0
addq $0x8, %r14
jmp 0x4698
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
movq %rax, %r14
movq %rbx, %rdi
callq 0x4f7c
movq %r14, %rdi
callq 0x23e0
// File: /workspace/github_cpp_makefile_star2_O2/Thomas1995[P]Rentz/src/connection.cpp
// Function: Connection::sendCards(std::vector<Card, std::allocator<Card>> const&)
void Connection::sendCards(const std::vector<Card>& cardsOnTable) {

  auto cards = encodeCards(cardsOnTable);

  event req;
  req.type = event::EType::SEND_CARDS;
  req.len = cards.size();
  req.data = cards.data();
  req.send(sfd);

  readAndAssert(resp);

  resp.free();
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x48, %rsp
movq %rdi, %rbx
leaq 0x18(%rsp), %r14
movq %r14, %rdi
callq 0x4676
leaq 0x30(%rsp), %rdi
andl $0x0, (%rdi)
movq (%r14), %rax
movq 0x8(%r14), %rcx
subq %rax, %rcx
movq %rcx, 0x8(%rdi)
movq %rax, 0x10(%rdi)
movl 0x201c(%rbx), %esi
callq 0x4ca0
movq %rsp, %rdi
movq %rbx, %rsi
callq 0x742c
movl (%rsp), %eax
cmpl 0x30(%rsp), %eax
jne 0x4746
movq %rsp, %rdi
callq 0x4e56
leaq 0x18(%rsp), %rdi
callq 0x4f7c
addq $0x48, %rsp
popq %rbx
popq %r14
retq
leaq 0x3ac3(%rip), %rdi      # 0x8210
leaq 0x3ad2(%rip), %rsi      # 0x8226
leaq 0x3b5a(%rip), %rcx      # 0x82b5
pushq $0x5a
popq %rdx
callq 0x21b0
jmp 0x4765
movq %rax, %rbx
leaq 0x18(%rsp), %rdi
callq 0x4f7c
movq %rbx, %rdi
callq 0x23e0
// File: /workspace/github_cpp_makefile_star2_O2/Thomas1995[P]Rentz/src/connection.cpp
// Function: Connection::turnEnd()
void Connection::turnEnd() {
  event req;
  req.type = event::EType::TURN_END;
  req.len = 0;
  req.data = NULL;
  req.send(sfd);

  readAndAssert(resp);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x30, %rsp
movq %rdi, %rbx
leaq 0x18(%rsp), %r14
movl $0x5, (%r14)
xorps %xmm0, %xmm0
movups %xmm0, 0x8(%r14)
movl 0x201c(%rdi), %esi
movq %r14, %rdi
callq 0x4ca0
movq %rsp, %r15
movq %r15, %rdi
movq %rbx, %rsi
callq 0x742c
movl (%r15), %eax
cmpl (%r14), %eax
jne 0x47c8
addq $0x30, %rsp
popq %rbx
popq %r14
popq %r15
retq
leaq 0x3a41(%rip), %rdi      # 0x8210
leaq 0x3a50(%rip), %rsi      # 0x8226
leaq 0x3b0e(%rip), %rcx      # 0x82eb
pushq $0x66
popq %rdx
callq 0x21b0
nop
// File: /workspace/github_cpp_makefile_star2_O2/Thomas1995[P]Rentz/src/connection.cpp
// Function: Connection::sendScores(std::vector<int, std::allocator<int>> const&)
void Connection::sendScores(const std::vector<int>& allScores) {

  std::vector<uint8_t> data;

  data.reserve(allScores.size() * 4);

  for(const auto &i: allScores) {
    const int x = htonl(i);
    const uint8_t*const ptr = reinterpret_cast<const uint8_t *const>(&x);
    for(int i = 0; i < 4; ++i)
      data.push_back(ptr[i]);
  }

  event req;
  req.type = event::EType::ROUND_END;
  req.len = data.size();
  req.data = data.data();
  req.send(sfd);

  readAndAssert(resp);

  resp.free();
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x50, %rsp
movq %rsi, %r14
movq %rdi, %rbx
xorps %xmm0, %xmm0
movq %rsp, %rdi
andq $0x0, 0x10(%rdi)
movaps %xmm0, (%rdi)
movq 0x8(%rsi), %rsi
subq (%r14), %rsi
callq 0x4e64
movq (%r14), %r15
movq 0x8(%r14), %r12
movq %rsp, %r14
cmpq %r12, %r15
je 0x484f
movl (%r15), %eax
bswapl %eax
movl %eax, 0x20(%rsp)
xorl %r13d, %r13d
cmpq $0x4, %r13
je 0x4849
leaq (%rsp,%r13), %rsi
addq $0x20, %rsi
movq %r14, %rdi
callq 0x4eee
incq %r13
jmp 0x482e
addq $0x4, %r15
jmp 0x481d
leaq 0x20(%rsp), %rdi
movl $0x2, (%rdi)
movq (%rsp), %rax
movq 0x8(%rsp), %rcx
subq %rax, %rcx
movq %rcx, 0x8(%rdi)
movq %rax, 0x10(%rdi)
movl 0x201c(%rbx), %esi
callq 0x4ca0
leaq 0x38(%rsp), %rdi
movq %rbx, %rsi
callq 0x742c
movl 0x38(%rsp), %eax
cmpl 0x20(%rsp), %eax
jne 0x48b0
leaq 0x38(%rsp), %rdi
callq 0x4e56
movq %rsp, %rdi
callq 0x4f7c
addq $0x50, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
leaq 0x3959(%rip), %rdi      # 0x8210
leaq 0x3968(%rip), %rsi      # 0x8226
leaq 0x3a41(%rip), %rcx      # 0x8306
pushq $0x7c
popq %rdx
callq 0x21b0
jmp 0x48d3
jmp 0x48d3
jmp 0x48d3
movq %rax, %rbx
movq %rsp, %rdi
callq 0x4f7c
movq %rbx, %rdi
callq 0x23e0