LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O2/cristian-bicheru[P]arith/./huffman.h
// Function: huffman::UncompressFile(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&)
CodecStatusCode UncompressFile(const std::string& InFile, const std::string& OutFile) {
        std::vector<unsigned char> CompressedBuffer;
        std::vector<unsigned char> UncompressedBuffer;

        if (buffer::LoadFile(&InFile, CompressedBuffer)) {
            try {
                UncompressBuffer<unsigned char, uint64_t>(UncompressedBuffer, CompressedBuffer);
            } catch (std::exception& e) {
                std::cerr << e.what() << std::endl;
                return BadCompressionStream;
            }

            if (buffer::SaveFile(UncompressedBuffer, &OutFile)) {
                return Success;
            } else {
                std::cerr << "File Write Error." << std::endl;
                return FileWriteError;
            }
        } else {
            std::cerr << "File Read Error." << std::endl;
            return FileReadError;
        }
    }

// Assembly:
pushq %rbx
subq $0x40, %rsp
movq %rsi, %rbx
xorps %xmm0, %xmm0
leaq 0x20(%rsp), %rsi
movaps %xmm0, (%rsi)
andq $0x0, 0x10(%rsi)
movaps %xmm0, (%rsp)
andq $0x0, 0x10(%rsp)
callq 0x24ec
testb %al, %al
je 0x3272
movq %rsp, %rdi
leaq 0x20(%rsp), %rsi
callq 0x3c31
movq %rsp, %rdi
movq %rbx, %rsi
callq 0x25ce
xorl %ebx, %ebx
testb %al, %al
jne 0x3290
movq 0x9d8e(%rip), %rdi      # 0xcfe8
leaq 0x4e53(%rip), %rsi      # 0x80b4
callq 0x21b0
movq %rax, %rdi
callq 0x20c0
pushq $0x2
jmp 0x328f
movq 0x9d6f(%rip), %rdi      # 0xcfe8
leaq 0x4e46(%rip), %rsi      # 0x80c6
callq 0x21b0
movq %rax, %rdi
callq 0x20c0
pushq $0x1
popq %rbx
movq %rsp, %rdi
callq 0x44a6
leaq 0x20(%rsp), %rdi
callq 0x44a6
movl %ebx, %eax
addq $0x40, %rsp
popq %rbx
retq
movq %rax, %rbx
cmpl $0x1, %edx
jne 0x32fa
movq %rbx, %rdi
callq 0x20b0
movq (%rax), %rcx
movq %rax, %rdi
callq *0x10(%rcx)
movq 0x9d1e(%rip), %rdi      # 0xcfe8
movq %rax, %rsi
callq 0x21b0
movq %rax, %rdi
callq 0x20c0
callq 0x22b0
pushq $0x3
jmp 0x328f
jmp 0x32f7
movq %rax, %rbx
callq 0x22b0
jmp 0x32fa
movq %rax, %rdi
callq 0x3a06
movq %rax, %rbx
movq %rsp, %rdi
callq 0x44a6
leaq 0x20(%rsp), %rdi
callq 0x44a6
movq %rbx, %rdi
callq 0x22e0
// File: /workspace/github_cpp_makefile_star2_O2/cristian-bicheru[P]arith/codec.cpp
// Function: print_help()
void print_help() {
    std::cout << usage << std::endl;
    std::cout << "options:" << std::endl;
    std::cout << help0 << std::endl;
    std::cout << help1 << std::endl;
    std::cout << help2 << std::endl;
}

// Assembly:
pushq %rbx
movq 0x9cac(%rip), %rbx      # 0xcfc8
leaq 0x9e8d(%rip), %rsi      # 0xd1b0
movq %rbx, %rdi
callq 0x2190
movq %rax, %rdi
callq 0x20c0
leaq 0x4e54(%rip), %rsi      # 0x818e
movq %rbx, %rdi
callq 0x21b0
movq %rax, %rdi
callq 0x20c0
leaq 0x9e7f(%rip), %rsi      # 0xd1d0
movq %rbx, %rdi
callq 0x2190
movq %rax, %rdi
callq 0x20c0
leaq 0x9e88(%rip), %rsi      # 0xd1f0
movq %rbx, %rdi
callq 0x2190
movq %rax, %rdi
callq 0x20c0
leaq 0x9e91(%rip), %rsi      # 0xd210
movq %rbx, %rdi
callq 0x2190
movq %rax, %rdi
popq %rbx
jmp 0x20c0
// File: /workspace/github_cpp_makefile_star2_O2/cristian-bicheru[P]arith/codec.cpp
// Function: main
int main(int argc, char* argv[]) {
    if (argc != 6) {
        print_help();
    } else if (strcmp(argv[1], "--algorithm") != 0) {
        print_help();
    } else {
        if (strcmp(argv[3], "--encode") == 0) {
            if (strcmp(argv[2], "arith") == 0) {
                arith::CompressFile(std::string(argv[4]), std::string(argv[5]));
            } else if (strcmp(argv[2], "huffman") == 0) {
                huffman::CompressFile(std::string(argv[4]), std::string(argv[5]));
            } else {
                print_help();
            }
        } else {
            if (strcmp(argv[2], "arith") == 0) {
                arith::UncompressFile(std::string(argv[4]), std::string(argv[5]));
            } else if (strcmp(argv[2], "huffman") == 0) {
                huffman::UncompressFile(std::string(argv[4]), std::string(argv[5]));
            } else {
                print_help();
            }
        }
    }
    exit(0);
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
subq $0x50, %rsp
cmpl $0x6, %edi
jne 0x3511
movq %rsi, %rbx
movq 0x8(%rsi), %rdi
leaq 0x4de8(%rip), %rsi      # 0x8197
callq 0x2240
testl %eax, %eax
jne 0x3511
movq 0x18(%rbx), %rdi
leaq 0x4ddc(%rip), %rsi      # 0x81a3
callq 0x2240
movl %eax, %ebp
movq 0x10(%rbx), %r14
leaq 0x4dd3(%rip), %rsi      # 0x81ac
movq %r14, %rdi
callq 0x2240
testl %ebp, %ebp
jne 0x3423
testl %eax, %eax
jne 0x3465
movq 0x20(%rbx), %rsi
leaq 0x30(%rsp), %rdi
leaq 0xf(%rsp), %rdx
callq 0x20a0
movq 0x28(%rbx), %rsi
leaq 0x10(%rsp), %rdi
leaq 0xe(%rsp), %rdx
callq 0x20a0
leaq 0x30(%rsp), %rdi
leaq 0x10(%rsp), %rsi
callq 0x2f62
jmp 0x34fb
testl %eax, %eax
jne 0x34b3
movq 0x20(%rbx), %rsi
leaq 0x30(%rsp), %rdi
leaq 0xf(%rsp), %rdx
callq 0x20a0
movq 0x28(%rbx), %rsi
leaq 0x10(%rsp), %rdi
leaq 0xe(%rsp), %rdx
callq 0x20a0
leaq 0x30(%rsp), %rdi
leaq 0x10(%rsp), %rsi
callq 0x302c
jmp 0x34fb
leaq 0x4d46(%rip), %rsi      # 0x81b2
movq %r14, %rdi
callq 0x2240
testl %eax, %eax
jne 0x3511
movq 0x20(%rbx), %rsi
leaq 0x30(%rsp), %rdi
leaq 0xf(%rsp), %rdx
callq 0x20a0
movq 0x28(%rbx), %rsi
leaq 0x10(%rsp), %rdi
leaq 0xe(%rsp), %rdx
callq 0x20a0
leaq 0x30(%rsp), %rdi
leaq 0x10(%rsp), %rsi
callq 0x3140
jmp 0x34fb
leaq 0x4cf8(%rip), %rsi      # 0x81b2
movq %r14, %rdi
callq 0x2240
testl %eax, %eax
jne 0x3511
movq 0x20(%rbx), %rsi
leaq 0x30(%rsp), %rdi
leaq 0xf(%rsp), %rdx
callq 0x20a0
movq 0x28(%rbx), %rsi
leaq 0x10(%rsp), %rdi
leaq 0xe(%rsp), %rdx
callq 0x20a0
leaq 0x30(%rsp), %rdi
leaq 0x10(%rsp), %rsi
callq 0x320a
leaq 0x10(%rsp), %rdi
callq 0x2308
leaq 0x30(%rsp), %rdi
callq 0x2308
jmp 0x3516
callq 0x3314
xorl %edi, %edi
callq 0x2200
jmp 0x3527
jmp 0x3527
jmp 0x353c
jmp 0x353c
jmp 0x3527
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
callq 0x2308
jmp 0x353f
jmp 0x354d
jmp 0x354d
jmp 0x353c
movq %rax, %rbx
leaq 0x30(%rsp), %rdi
callq 0x2308
jmp 0x3550
jmp 0x354d
movq %rax, %rbx
movq %rbx, %rdi
callq 0x22e0
// File: /workspace/github_cpp_makefile_star2_O2/cristian-bicheru[P]arith/./bufferops.h
// Function: buffer::CodecBufferWrapper::CodecBufferWrapper(std::vector<unsigned char, std::allocator<unsigned char>>&, unsigned char)
CodecBufferWrapper(std::vector<unsigned char>& InBuffer, uint8_t Shift) {
            Buffer = InBuffer;
            BitShift = Shift;
            IBitShift = 8u-Shift;
            EffectiveSize = Buffer.size() - (Shift == 0 ? 0 : 1); // If a shift is used, the buffer size effectively decreases by one
        }

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movl %edx, %ebp
movq %rdi, %rbx
xorps %xmm0, %xmm0
movups %xmm0, (%rdi)
andq $0x0, 0x10(%rdi)
callq 0x3e52
movb %bpl, 0x18(%rbx)
movb $0x8, %al
subb %bpl, %al
movb %al, 0x19(%rbx)
movq 0x8(%rbx), %rax
cmpb $0x1, %bpl
adcq $-0x1, %rax
subq (%rbx), %rax
movq %rax, 0x20(%rbx)
popq %rbx
popq %r14
popq %rbp
retq
movq %rax, %r14
movq %rbx, %rdi
callq 0x44a6
movq %r14, %rdi
callq 0x22e0
// File: /workspace/github_cpp_makefile_star2_O2/cristian-bicheru[P]arith/./bufferops.h
// Function: buffer::CodecByteStream::WriteBitBuffered(unsigned char)
void WriteBitBuffered(uint8_t Bit) {
            WriteBit(Bit);
            Bit ^= 1u;
            while (PendingBits > 0) {
                WriteBit(Bit);
                PendingBits--;
            }
        }

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
movl %esi, %ebp
movq %rdi, %rbx
callq 0x3718
xorb $0x1, %bpl
movl 0x28(%rbx), %eax
movzbl %bpl, %ebp
testl %eax, %eax
jle 0x3698
movq %rbx, %rdi
movl %ebp, %esi
callq 0x3718
movl 0x28(%rbx), %eax
decl %eax
movl %eax, 0x28(%rbx)
jmp 0x3680
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/cristian-bicheru[P]arith/./bufferops.h
// Function: buffer::CodecByteStream::WriteBit(unsigned char)
void WriteBit(uint8_t Bit) {
            Data[ByteIndex] |= Bit<<IBitIndex;
            if (IBitIndex == 0) {
                ByteIndex++;
                Data.push_back(0u);
                IBitIndex = 7u;
            } else {
                IBitIndex--;
            }
        }

// Assembly:
pushq %rbx
subq $0x10, %rsp
movq %rdi, %rbx
movb 0x18(%rdi), %cl
shll %cl, %esi
movq 0x20(%rdi), %rax
movq (%rdi), %rcx
orb %sil, (%rcx,%rax)
movb 0x18(%rdi), %al
testb %al, %al
je 0x373b
decb %al
jmp 0x3751
incq 0x20(%rbx)
leaq 0xf(%rsp), %rsi
movb $0x0, (%rsi)
movq %rbx, %rdi
callq 0x3f6a
movb $0x7, %al
movb %al, 0x18(%rbx)
addq $0x10, %rsp
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O2/cristian-bicheru[P]arith/./arith.h
// Function: arith::CodecProbabilityTable::DecodeFromCount(unsigned long)
std::tuple<uint32_t, uint32_t, uint8_t> DecodeFromCount(uint64_t count) {
            for (uint16_t i = 0; i < 256; i++) {
                if (Frequencies[i+1] > count) {
                    return std::make_tuple(Frequencies[i], Frequencies[i+1], i);
                }
            }
            throw std::runtime_error("Bad Value Encountered In Decode.");
        }

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
pushq $-0x1
popq %rax
cmpq $0xff, %rax
je 0x3791
movl 0x8(%rsi,%rax,4), %ecx
incq %rax
cmpq %rdx, %rcx
jbe 0x3761
movb %al, (%rdi)
movq (%rsi,%rax,4), %xmm0
pshufd $0xe1, %xmm0, %xmm0     # xmm0 = xmm0[1,0,2,3]
movq %xmm0, 0x4(%rdi)
movq %rdi, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
pushq $0x10
popq %rdi
callq 0x20d0
movq %rax, %rbx
leaq 0x4a31(%rip), %rsi      # 0x81d4
movq %rax, %rdi
callq 0x2090
movq 0x983e(%rip), %rsi      # 0xcff0
movq 0x9807(%rip), %rdx      # 0xcfc0
movq %rbx, %rdi
callq 0x22c0
movq %rax, %r14
movq %rbx, %rdi
callq 0x2140
movq %r14, %rdi
callq 0x22e0
// File: /workspace/github_cpp_makefile_star2_O2/cristian-bicheru[P]arith/./arith.h
// Function: arith::CodecProbabilityTable::GenerateTable(std::vector<unsigned char, std::allocator<unsigned char>>&)
void GenerateTable(std::vector<unsigned char>& UncompressedBuffer) {
            uint32_t tables[256*8] = {0};
            double deviations[8] = {0};

            for (uint16_t i = 0; i < 8; i++) {
                ComputeProbabilities(&tables[i*256], UncompressedBuffer, (uint8_t) i);
                deviations[i] = StandardDeviation(&tables[i*256], 256);
            }

            uint16_t max = 0u;
            double pmax = 0;

            for (uint16_t i = 0; i < 8; i++) {
                if (deviations[i] > pmax) {
                    pmax = deviations[i];
                    max = i;
                }
            }

            std::copy(tables+256*max, tables+256*(max+1), Frequencies + 1);

            for (uint16_t i = 1; i < 257; i++) {
                Frequencies[i] += Frequencies[i-1];
            }

            BitShift = max;
        }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x2040, %rsp           # imm = 0x2040
movq %rsi, %r14
movq %rdi, %rbx
leaq 0x40(%rsp), %r15
xorl %r12d, %r12d
movl $0x2000, %edx           # imm = 0x2000
movq %r15, %rdi
xorl %esi, %esi
callq 0x20f0
xorpd %xmm0, %xmm0
movapd %xmm0, 0x30(%rsp)
movapd %xmm0, 0x20(%rsp)
movapd %xmm0, 0x10(%rsp)
movapd %xmm0, (%rsp)
cmpq $0x8, %r12
je 0x3865
movzbl %r12b, %edx
movq %r15, %rdi
movq %r14, %rsi
callq 0x2654
movl $0x100, %esi            # imm = 0x100
movq %r15, %rdi
callq 0x270a
movsd %xmm0, (%rsp,%r12,8)
incq %r12
addq $0x400, %r15            # imm = 0x400
jmp 0x3831
xorpd %xmm0, %xmm0
xorl %eax, %eax
xorl %ebp, %ebp
cmpq $0x8, %rax
je 0x3890
movsd (%rsp,%rax,8), %xmm1
ucomisd %xmm0, %xmm1
movl %eax, %ecx
cmovbel %ebp, %ecx
maxsd %xmm0, %xmm1
incq %rax
movl %ecx, %ebp
movapd %xmm1, %xmm0
jmp 0x386d
movzwl %bp, %eax
shll $0xa, %eax
leaq (%rsp,%rax), %rsi
addq $0x40, %rsi
leaq 0x4(%rbx), %r14
movl $0x400, %edx            # imm = 0x400
movq %r14, %rdi
callq 0x2170
xorl %eax, %eax
cmpq $0x100, %rax            # imm = 0x100
je 0x38c7
movl -0x4(%r14,%rax,4), %ecx
addl %ecx, (%r14,%rax,4)
incq %rax
jmp 0x38b1
movb %bpl, 0x404(%rbx)
addq $0x2040, %rsp           # imm = 0x2040
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/cristian-bicheru[P]arith/./huffman.h
// Function: huffman::HuffmanTree<unsigned char, unsigned long>::ConstructSymbolTable()
void ConstructSymbolTable() {
            RootNodeIterator<SymbolType, ValueType> RootIterator(this);
            HuffmanNode<SymbolType, ValueType>* RootNode;
            do {
                RootNode = &RootIterator.GetCurrentRootNode();
                //std::cout << "Symbol: " << (int) RootNode->GetSymbol() << std::endl;
                SymbolTable[RootNode->GetSymbol()] = RootIterator.GetCurrentIndex();
            } while (RootIterator++);

        }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x68, %rsp
movq %rdi, %r14
leaq 0x38(%rsp), %r15
movq %r15, %rdi
movq %r14, %rsi
callq 0x6ba2
leaq 0x40(%rsp), %rbx
addq $0x8, %r14
leaq 0x10(%rsp), %r12
leaq 0xf(%rsp), %r13
movq %r15, %rdi
callq 0x6bfe
movq %rax, %rbp
movq %r12, %rdi
movq %rbx, %rsi
callq 0x7322
movb 0x11(%rbp), %al
movb %al, 0xf(%rsp)
movq %r14, %rdi
movq %r13, %rsi
callq 0x6c0e
movq %rax, %rdi
movq %r12, %rsi
callq 0x6c5c
movq %r12, %rdi
callq 0x490e
movq %r15, %rdi
xorl %esi, %esi
callq 0x6cae
testb %al, %al
jne 0x478a
movq %rbx, %rdi
callq 0x490e
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x47fb
movq %rax, %r14
leaq 0x10(%rsp), %rdi
callq 0x490e
jmp 0x47fe
movq %rax, %r14
movq %rbx, %rdi
callq 0x490e
movq %r14, %rdi
callq 0x22e0
// File: /workspace/github_cpp_makefile_star2_O2/cristian-bicheru[P]arith/./huffman.h
// Function: huffman::RootNodeIterator<unsigned char, unsigned long>::RootNodeIterator(huffman::HuffmanTree<unsigned char, unsigned long>*)
explicit RootNodeIterator(HuffmanTree<SymbolType, ValueType>* ITree) {
            Tree = ITree;
            do {
                Index.push_back(0);
            } while (!(*Tree)[Index].IsRoot());
        }

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
andq $0x0, 0x8(%rdi)
andl $0x0, 0x10(%rdi)
andq $0x0, 0x18(%rdi)
leaq 0x8(%rdi), %r14
andl $0x0, 0x20(%rdi)
andq $0x0, 0x28(%rdi)
movq %rsi, (%rdi)
movq %r14, %rdi
xorl %esi, %esi
callq 0x6d84
movq (%rbx), %rdi
movq %r14, %rsi
callq 0x6dc2
cmpb $0x1, 0x10(%rax)
jne 0x6bc7
addq $0x8, %rsp
popq %rbx
popq %r14
retq
movq %rax, %rbx
movq %r14, %rdi
callq 0x490e
movq %rbx, %rdi
callq 0x22e0
nop
// File: /workspace/github_cpp_makefile_star2_O2/cristian-bicheru[P]arith/./huffman.h
// Function: huffman::RootNodeIterator<unsigned char, unsigned long>::operator++(int)
bool operator++(int) {
            auto LastLeftBranch = std::find(Index.rbegin(), Index.rend(), false);
            if (LastLeftBranch != Index.rend()) {
                uint64_t LeftBranch = Index.size()-1ull-(LastLeftBranch-Index.rbegin());
                Index.resize(LeftBranch+1ull);
                Index[LeftBranch] = 1;
                while (!(*Tree)[Index].IsRoot()) {
                    Index.push_back(0);
                }
                //this->DumpIndex();
                return true;
            } else {
                return false;
            }

        }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x38, %rsp
movq %rdi, %rbx
movq 0x18(%rdi), %rax
movl 0x20(%rdi), %ecx
leaq 0x18(%rsp), %rsi
movq %rax, (%rsi)
movl %ecx, 0x8(%rsi)
movq 0x8(%rdi), %rax
leaq 0x8(%rsp), %rdx
movq %rax, (%rdx)
andl $0x0, 0x8(%rdx)
leaq 0x7(%rsp), %rcx
movb $0x0, (%rcx)
leaq 0x28(%rsp), %r14
movq %r14, %rdi
callq 0x76a9
movq 0x8(%rbx), %rcx
movq (%r14), %rax
movl 0x8(%r14), %edx
cmpq %rcx, %rax
setne %sil
testl %edx, %edx
setne %bpl
orb %sil, %bpl
cmpb $0x1, %bpl
jne 0x6d76
leaq 0x8(%rbx), %r14
movl %edx, %edx
movq 0x18(%rbx), %rdi
movl 0x20(%rbx), %r8d
movq %rdi, %rsi
subq %rcx, %rsi
leaq (%r8,%rsi,8), %rsi
subq %rax, %rdi
subq %rdx, %r8
leaq (%r8,%rdi,8), %rax
movq %rax, %r15
notq %r15
addq %rsi, %r15
subq %rax, %rsi
movq %r14, %rdi
xorl %edx, %edx
callq 0x76d4
movq %r14, %rdi
movq %r15, %rsi
callq 0x7742
orq %rdx, (%rax)
movq (%rbx), %rdi
movq %r14, %rsi
callq 0x6dc2
cmpb $0x0, 0x10(%rax)
jne 0x6d76
movq %r14, %rdi
xorl %esi, %esi
callq 0x6d84
jmp 0x6d59
movl %ebp, %eax
addq $0x38, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/oknenavin[P]cxon/examples/overriding-default-serializers.cxx
// Function: main
int main() {
    double d = 0.0;
        cxon::from_bytes(d, "0");
    assert(d == 42.);   // the override is used for double
    int i = 0;
        cxon::from_bytes(i, "42");
    assert(i == 42);    // the other types are intact
    float f = 0.0;
        cxon::from_bytes<CUSTOM_JSON>(f, "0");
    assert(f == 42.);   // the override is used for CUSTOM_JSON
    unsigned u = 0;
        cxon::from_bytes<CUSTOM_JSON>(u, "42");
    assert(u == 42);    // the other types are as in JSON<>
}

// Assembly:
pushq %rbx
subq $0x20, %rsp
leaq 0x4(%rsp), %rbx
andl $0x0, (%rbx)
leaq 0xe7b(%rip), %rdx       # 0x205b
leaq 0x8(%rsp), %rdi
movq %rbx, %rsi
callq 0x124f
cmpl $0x2a, (%rbx)
jne 0x1219
movq %rsp, %rbx
andl $0x0, (%rbx)
leaq 0xe5c(%rip), %rdx       # 0x205b
leaq 0x8(%rsp), %rdi
movq %rbx, %rsi
callq 0x15c3
cmpl $0x2a, (%rbx)
jne 0x1232
xorl %eax, %eax
addq $0x20, %rsp
popq %rbx
retq
leaq 0xe36(%rip), %rdi       # 0x2056
leaq 0xe01(%rip), %rsi       # 0x2028
leaq 0xe1d(%rip), %rcx       # 0x204b
pushq $0x27
jmp 0x1249
leaq 0xe25(%rip), %rdi       # 0x205e
leaq 0xde8(%rip), %rsi       # 0x2028
leaq 0xe04(%rip), %rcx       # 0x204b
pushq $0x2d
popq %rdx
callq 0x1080
// File: /workspace/github_cpp_makefile_star2_O2/janthonyo[P]Redes-Practicas/./domino.cc
// Function: domino::newHand()
std::vector <ficha> newHand()
	{
		std::vector<ficha> playerHand;
		int x;

		for(int i = 0; i < 7; i++)
		{
			x = rand() % (int) forStole.size();

			playerHand.push_back(forStole[x]);

			forStole.erase(forStole.begin() + x);
		}

		return playerHand;
	}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
andq $0x0, 0x10(%rdi)
xorps %xmm0, %xmm0
movups %xmm0, (%rdi)
leaq 0x18(%rsi), %r15
pushq $0x7
popq %r13
subl $0x1, %r13d
jb 0x415f
callq 0x2090
movq 0x18(%r14), %rcx
movq 0x20(%r14), %rsi
subq %rcx, %rsi
shrq $0x3, %rsi
cltd
idivl %esi
movslq %edx, %r12
leaq (%rcx,%r12,8), %rsi
movq %rbx, %rdi
callq 0x49a2
shlq $0x3, %r12
addq (%r15), %r12
movq %r15, %rdi
movq %r12, %rsi
callq 0x49c6
jmp 0x411f
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x4173
movq %rax, %r14
movq %rbx, %rdi
callq 0x4d28
movq %r14, %rdi
callq 0x2340
// File: /workspace/github_cpp_makefile_star2_O2/janthonyo[P]Redes-Practicas/./domino.cc
// Function: domino::hasFicha(ficha, std::vector<ficha, std::allocator<ficha>>)
bool hasFicha(ficha f, std::vector<ficha> hand)
	{
		bool result = false;

		for (int i = 0; i < (int) hand.size(); ++i)
		{
			if(( hand[i].left == f.left ) and ( hand[i].right == f.right ))
				result = true;

			else if (( hand[i].left == f.right ) and ( hand[i].right == f.left ))
				result = true;
		}

		return result;
	}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rsi, %rcx
shrq $0x20, %rcx
movq (%rdx), %rdi
movq 0x8(%rdx), %rdx
subq %rdi, %rdx
shrq $0x3, %rdx
xorl %r8d, %r8d
testl %edx, %edx
cmovlel %r8d, %edx
xorl %eax, %eax
cmpq %r8, %rdx
je 0x4456
movl (%rdi,%r8,8), %r10d
cmpl %esi, %r10d
jne 0x4438
movb $0x1, %r9b
cmpl %ecx, 0x4(%rdi,%r8,8)
je 0x444e
cmpl %ecx, %r10d
jne 0x444b
cmpl %esi, 0x4(%rdi,%r8,8)
sete %r9b
orb %al, %r9b
jmp 0x444e
movl %eax, %r9d
incq %r8
movl %r9d, %eax
jmp 0x4420
andb $0x1, %al
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/janthonyo[P]Redes-Practicas/./domino.cc
// Function: domino::stealPiece()
ficha stealPiece()
	{
		int x = rand() % (int) forStole.size();
		ficha stolenPiece = forStole[x];

		forStole.erase(forStole.begin() + x);

		return stolenPiece;
	}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
callq 0x2090
leaq 0x18(%rbx), %rdi
movq 0x18(%rbx), %rcx
movq 0x20(%rbx), %rsi
subq %rcx, %rsi
shrq $0x3, %rsi
cltd
idivl %esi
movslq %edx, %rax
leaq (%rcx,%rax,8), %rsi
movq (%rsi), %rbx
callq 0x49c6
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/janthonyo[P]Redes-Practicas/./domino.cc
// Function: domino::addToHand(int, ficha)
bool addToHand(int i, ficha pieceToAdd)
	{
		if(i==getSocketP1())
		{
			player1.hand.push_back(pieceToAdd);
		}
		else if(i==getSocketP2())
		{
			player2.hand.push_back(pieceToAdd);
		}
	}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdx, -0x8(%rbp)
cmpl %esi, 0x94(%rdi)
jne 0x44bc
addq $0x98, %rdi
leaq -0x8(%rbp), %rsi
callq 0x49a2
addq $0x118, %rdi            # imm = 0x118
leaq -0x8(%rbp), %rsi
callq 0x49a2
// File: /workspace/github_cpp_makefile_star2_O2/janthonyo[P]Redes-Practicas/./domino.cc
// Function: domino::quitPieceJ1(ficha)
void quitPieceJ1(ficha f)
	{
		bool erase = false;

		for (int i = 0; i < (int) player1.hand.size(); i++)
		{
			if (erase == false)
			{
				if(( player1.hand[i].left == f.left ) and ( player1.hand[i].right == f.right ))
				{
					player1.hand.erase(player1.hand.begin() + i);
					erase = true;
				}

				else if(( player1.hand[i].left == f.right ) and ( player1.hand[i].right == f.left ))
				{
					player1.hand.erase(player1.hand.begin() + i);
					erase = true;
				}
			}
		}
	}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
movq %rsi, %r12
shrq $0x20, %r12
leaq 0x98(%rdi), %rax
movq %rax, -0x30(%rbp)
xorl %r13d, %r13d
xorl %r15d, %r15d
xorl %eax, %eax
movq 0x98(%r14), %rsi
movq 0xa0(%r14), %rcx
subq %rsi, %rcx
shrq $0x3, %rcx
movslq %ecx, %rcx
cmpq %rcx, %r15
jge 0x4c89
testb $0x1, %al
jne 0x4c80
movl (%rsi,%r13), %ecx
cmpl %ebx, %ecx
jne 0x4c66
cmpl %r12d, 0x4(%rsi,%r13)
je 0x4c72
cmpl %r12d, %ecx
jne 0x4c80
cmpl %ebx, 0x4(%rsi,%r13)
jne 0x4c80
addq %r13, %rsi
movq -0x30(%rbp), %rdi
callq 0x49c6
movb $0x1, %al
incq %r15
addq $0x8, %r13
jmp 0x4c36
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/janthonyo[P]Redes-Practicas/./domino.cc
// Function: domino::quitPieceJ2(ficha)
void quitPieceJ2(ficha f)
	{
		bool erase = false;

		for (int i = 0; i < (int) player2.hand.size(); i++)
		{
			if (erase == false)
			{
				if(( player2.hand[i].left == f.left ) and ( player2.hand[i].right == f.right ))
				{
					player2.hand.erase(player2.hand.begin() + i);
					erase = true;
				}

				else if(( player2.hand[i].left == f.right ) and ( player2.hand[i].right == f.left ))
				{
					player2.hand.erase(player2.hand.begin() + i);
					erase = true;
				}
			}
		}
	}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
movq %rsi, %r12
shrq $0x20, %r12
leaq 0x118(%rdi), %rax
movq %rax, -0x30(%rbp)
xorl %r13d, %r13d
xorl %r15d, %r15d
xorl %eax, %eax
movq 0x118(%r14), %rsi
movq 0x120(%r14), %rcx
subq %rsi, %rcx
shrq $0x3, %rcx
movslq %ecx, %rcx
cmpq %rcx, %r15
jge 0x4d19
testb $0x1, %al
jne 0x4d10
movl (%rsi,%r13), %ecx
cmpl %ebx, %ecx
jne 0x4cf6
cmpl %r12d, 0x4(%rsi,%r13)
je 0x4d02
cmpl %r12d, %ecx
jne 0x4d10
cmpl %ebx, 0x4(%rsi,%r13)
jne 0x4d10
addq %r13, %rsi
movq -0x30(%rbp), %rdi
callq 0x49c6
movb $0x1, %al
incq %r15
addq $0x8, %r13
jmp 0x4cc6
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/janthonyo[P]Redes-Practicas/./domino.cc
// Function: domino::domino()
domino()
	{
		//Inicializador de numeros aleatorios.
		srand(time(NULL));

		first = -1;
		last = -1;
		board.clear();
		forStole.clear();
		player1.socket = -1;
		player2.socket = -1;

		//"Amontonamos" las fichas para repartir y robar.
		ficha aux;

		for (int i = 0; i < 7; i++)
		{
			for (int j = i; j < 7; j++)
			{
				aux.left = i;
				aux.right = j;

				forStole.push_back(aux);
			}
		}

	}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdi, %rbx
xorps %xmm0, %xmm0
andq $0x0, 0xa8(%rdi)
movups %xmm0, 0x98(%rdi)
andq $0x0, 0x128(%rdi)
movups %xmm0, 0x118(%rdi)
movups %xmm0, (%rdi)
movups %xmm0, 0x10(%rdi)
movups %xmm0, 0x20(%rdi)
xorl %edi, %edi
callq 0x21a0
movl %eax, %edi
callq 0x21d0
orq $-0x1, 0x130(%rbx)
movq (%rbx), %rax
cmpq %rax, 0x8(%rbx)
je 0x5491
movq %rax, 0x8(%rbx)
movq 0x18(%rbx), %rax
cmpq %rax, 0x20(%rbx)
je 0x549f
movq %rax, 0x20(%rbx)
orl $-0x1, 0x94(%rbx)
leaq 0x18(%rbx), %r14
orl $-0x1, 0x114(%rbx)
leaq 0x98(%rbx), %rax
movq %rax, -0x40(%rbp)
leaq 0x118(%rbx), %rax
movq %rax, -0x38(%rbp)
xorl %r12d, %r12d
leaq -0x30(%rbp), %r13
movl %r12d, %r15d
cmpl $0x7, %r12d
je 0x54fa
cmpl $0x7, %r15d
je 0x54f5
movl %r12d, -0x30(%rbp)
movl %r15d, -0x2c(%rbp)
movq %r14, %rdi
movq %r13, %rsi
callq 0x49a2
incl %r15d
jmp 0x54d7
incl %r12d
jmp 0x54ce
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %r13
movq -0x38(%rbp), %rdi
callq 0x4d28
movq -0x40(%rbp), %rdi
callq 0x4d28
movq %r14, %rdi
callq 0x4d28
movq %rbx, %rdi
callq 0x4d28
movq %r13, %rdi
callq 0x2340
// File: /workspace/github_cpp_makefile_star2_O2/janthonyo[P]Redes-Practicas/message.cc
// Function: sendBoardAndHands(domino&)
void sendBoardAndHands(domino& game)
{
    char mensaje[MSG_SIZE];

    // Enviamos el tablero
    strcpy(mensaje, game.showBoard().c_str());
    sendBoth(game, mensaje);

    // Send hands
    strcpy(mensaje, game.messageHandP1().c_str());
    send(game.getSocketP1(), mensaje, strlen(mensaje), 0);

    strcpy(mensaje, game.messageHandP2().c_str());
    send(game.getSocketP2(), mensaje, strlen(mensaje), 0);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x128, %rsp            # imm = 0x128
movq %rdi, %rbx
leaq -0x38(%rbp), %r15
movq %r15, %rdi
movq %rbx, %rsi
callq 0x5fac
movq (%r15), %rsi
leaq -0x140(%rbp), %r14
movq %r14, %rdi
callq 0x21b0
movq %r15, %rdi
callq 0x2100
movq %rbx, %rdi
movq %r14, %rsi
callq 0x59fc
movq %r15, %rdi
movq %rbx, %rsi
callq 0x61e4
movq (%r15), %rsi
movq %r14, %rdi
callq 0x21b0
movq %r15, %rdi
callq 0x2100
movl 0x94(%rbx), %r15d
movq %r14, %rdi
callq 0x20f0
movl %r15d, %edi
movq %r14, %rsi
movq %rax, %rdx
xorl %ecx, %ecx
callq 0x2110
leaq -0x38(%rbp), %r15
movq %r15, %rdi
movq %rbx, %rsi
callq 0x63fa
movq (%r15), %rsi
movq %r14, %rdi
callq 0x21b0
movq %r15, %rdi
callq 0x2100
movl 0x114(%rbx), %ebx
movq %r14, %rdi
callq 0x20f0
movl %ebx, %edi
movq %r14, %rsi
movq %rax, %rdx
xorl %ecx, %ecx
callq 0x2110
addq $0x128, %rsp            # imm = 0x128
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/janthonyo[P]Redes-Practicas/message.cc
// Function: nextTurnMessage(int*, domino&)
void nextTurnMessage(int *i, domino& game)
{
    char mensaje[MSG_SIZE];

    //Se informa de paso de turno
    if(*i == game.getSocketP1()){
        strcpy(mensaje, "+Ok. Turno de partida.\n\n");
        send(game.getSocketP2(), mensaje, strlen(mensaje), 0);

        strcpy(mensaje, "+Ok. Turno del otro jugador.\n\n");
        send(game.getSocketP1(), mensaje, strlen(mensaje), 0);
    }
    else if (*i == game.getSocketP2()) {
        strcpy(mensaje, "+Ok. Turno de partida.\n\n");
        send(game.getSocketP1(), mensaje, strlen(mensaje), 0);

        strcpy(mensaje, "+Ok. Turno del otro jugador.\n\n");
        send(game.getSocketP2(), mensaje, strlen(mensaje), 0);
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x108, %rsp            # imm = 0x108
movq %rsi, %rbx
movl (%rdi), %eax
movl 0x94(%rsi), %r14d
cmpl %r14d, %eax
jne 0x5b72
movups 0x2c85(%rip), %xmm0     # 0x87d2
movups %xmm0, -0x117(%rbp)
movups 0x2c6e(%rip), %xmm0     # 0x87c9
movaps %xmm0, -0x120(%rbp)
movl 0x114(%rbx), %r14d
addq $0x94, %rbx
jmp 0x5b9d
cmpl 0x114(%rbx), %eax
jne 0x5bec
addq $0x114, %rbx            # imm = 0x114
movups 0x2c4a(%rip), %xmm0     # 0x87d2
movups %xmm0, -0x117(%rbp)
movups 0x2c33(%rip), %xmm0     # 0x87c9
movaps %xmm0, -0x120(%rbp)
leaq -0x120(%rbp), %r15
movq %r15, %rdi
callq 0x20f0
movl %r14d, %edi
movq %r15, %rsi
movq %rax, %rdx
xorl %ecx, %ecx
callq 0x2110
movups 0x2c1f(%rip), %xmm0     # 0x87e2
movaps %xmm0, (%r15)
movups 0x2c23(%rip), %xmm0     # 0x87f1
movups %xmm0, 0xf(%r15)
movl (%rbx), %ebx
movq %r15, %rdi
callq 0x20f0
movl %ebx, %edi
movq %r15, %rsi
movq %rax, %rdx
xorl %ecx, %ecx
callq 0x2110
addq $0x108, %rsp            # imm = 0x108
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/janthonyo[P]Redes-Practicas/./domino.cc
// Function: domino::showBoard[abi:cxx11]()
std::string showBoard()
	{
		std::string tablero("TABLERO\t");

		if (isBoardEmpty())
		{
			tablero = tablero + "VACIO";
		}

		else
		{
			for (int i = 0; i < (int) board.size(); i++)
			{
				tablero = tablero + "|" + std::to_string(board[i].left) + "|" + std::to_string(board[i].right) + "|";
			}
		}

		tablero = tablero +"\n\n";

		return tablero;
	}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xe8, %rsp
movq %rsi, %r14
movq %rdi, %r15
leaq 0x2908(%rip), %rsi      # 0x88d5
leaq -0x50(%rbp), %rdx
callq 0x6610
movq (%r14), %rcx
movq 0x8(%r14), %rax
cmpq %rax, %rcx
movq %r15, -0x30(%rbp)
je 0x60fb
xorl %r15d, %r15d
leaq -0xf0(%rbp), %r12
subq %rcx, %rax
shrq $0x3, %rax
cltq
cmpq %rax, %r15
jge 0x6125
leaq -0x70(%rbp), %rdi
movq -0x30(%rbp), %rsi
leaq 0x2524(%rip), %rdx      # 0x8539
callq 0x4566
movq (%r14), %rax
movl (%rax,%r15,8), %esi
leaq -0xd0(%rbp), %r13
movq %r13, %rdi
callq 0x459e
movq %r12, %rdi
leaq -0x70(%rbp), %rsi
movq %r13, %rdx
callq 0x44f5
leaq -0x90(%rbp), %rdi
movq %r12, %rsi
leaq 0x24e9(%rip), %rdx      # 0x8539
callq 0x44cc
movq (%r14), %rax
movl 0x4(%rax,%r15,8), %esi
leaq -0xb0(%rbp), %rbx
movq %rbx, %rdi
callq 0x459e
leaq -0x110(%rbp), %r13
movq %r13, %rdi
leaq -0x90(%rbp), %rsi
movq %rbx, %rdx
callq 0x44f5
leaq -0x50(%rbp), %rbx
movq %rbx, %rdi
movq %r13, %rsi
leaq 0x24a3(%rip), %rdx      # 0x8539
callq 0x44cc
movq -0x30(%rbp), %rdi
movq %rbx, %rsi
callq 0x2270
movq %rbx, %rdi
callq 0x2100
movq %r13, %rdi
callq 0x2100
leaq -0xb0(%rbp), %rdi
callq 0x2100
leaq -0x90(%rbp), %rdi
callq 0x2100
movq %r12, %rdi
callq 0x2100
leaq -0xd0(%rbp), %rdi
callq 0x2100
leaq -0x70(%rbp), %rdi
callq 0x2100
incq %r15
movq (%r14), %rcx
movq 0x8(%r14), %rax
jmp 0x5ff4
leaq 0x27dc(%rip), %rdx      # 0x88de
leaq -0x50(%rbp), %rdi
movq %r15, %rsi
callq 0x4566
leaq -0x50(%rbp), %rbx
movq %r15, %rdi
movq %rbx, %rsi
callq 0x2270
movq %rbx, %rdi
callq 0x2100
leaq 0x24f6(%rip), %rdx      # 0x8622
leaq -0x50(%rbp), %rdi
movq -0x30(%rbp), %r14
movq %r14, %rsi
callq 0x4566
leaq -0x50(%rbp), %rbx
movq %r14, %rdi
movq %rbx, %rsi
callq 0x2270
movq %rbx, %rdi
callq 0x2100
movq %r14, %rax
addq $0xe8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x61b0
jmp 0x61b0
movq %rax, %rbx
jmp 0x61a2
movq %rax, %rbx
jmp 0x6196
movq %rax, %rbx
jmp 0x618a
movq %rax, %rbx
leaq -0x110(%rbp), %rdi
callq 0x2100
leaq -0xb0(%rbp), %rdi
callq 0x2100
leaq -0x90(%rbp), %rdi
callq 0x2100
leaq -0xf0(%rbp), %rdi
callq 0x2100
jmp 0x61bd
movq %rax, %rbx
jmp 0x61d2
movq %rax, %rbx
jmp 0x61c9
movq %rax, %rbx
leaq -0xd0(%rbp), %rdi
callq 0x2100
leaq -0x70(%rbp), %rdi
callq 0x2100
movq -0x30(%rbp), %rdi
callq 0x2100
movq %rbx, %rdi
callq 0x2340
nop
// File: /workspace/github_cpp_makefile_star2_O2/janthonyo[P]Redes-Practicas/./domino.cc
// Function: domino::messageHandP1[abi:cxx11]()
std::string messageHandP1()
	{
		std::string pieces("FICHAS\t");

		for (int i = 0; i < (int) player1.hand.size(); i++)
		{
			pieces = pieces + "|" + std::to_string(player1.hand[i].left) + "|" + std::to_string(player1.hand[i].right) + "|";
		}

		pieces = pieces +"\n\n";

		return pieces;
	}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xe8, %rsp
movq %rsi, %r14
leaq 0x270c(%rip), %rsi      # 0x890e
leaq -0x90(%rbp), %rdx
movq %rdi, -0x30(%rbp)
callq 0x6610
xorl %r15d, %r15d
leaq -0x110(%rbp), %rbx
movq 0xa0(%r14), %rax
subq 0x98(%r14), %rax
shrq $0x3, %rax
cltq
cmpq %rax, %r15
jge 0x632d
leaq -0x50(%rbp), %rdi
movq -0x30(%rbp), %rsi
leaq 0x22f1(%rip), %rdx      # 0x8539
callq 0x4566
movq 0x98(%r14), %rax
movl (%rax,%r15,8), %esi
leaq -0xd0(%rbp), %r12
movq %r12, %rdi
callq 0x459e
leaq -0xf0(%rbp), %r13
movq %r13, %rdi
leaq -0x50(%rbp), %rsi
movq %r12, %rdx
callq 0x44f5
leaq -0x70(%rbp), %rdi
movq %r13, %rsi
leaq 0x22ae(%rip), %rdx      # 0x8539
callq 0x44cc
movq 0x98(%r14), %rax
movl 0x4(%rax,%r15,8), %esi
leaq -0xb0(%rbp), %r12
movq %r12, %rdi
callq 0x459e
movq %rbx, %rdi
leaq -0x70(%rbp), %rsi
movq %r12, %rdx
callq 0x44f5
leaq -0x90(%rbp), %r12
movq %r12, %rdi
movq %rbx, %rsi
leaq 0x226b(%rip), %rdx      # 0x8539
callq 0x44cc
movq -0x30(%rbp), %rdi
movq %r12, %rsi
callq 0x2270
movq %r12, %rdi
callq 0x2100
movq %rbx, %rdi
callq 0x2100
leaq -0xb0(%rbp), %rdi
callq 0x2100
leaq -0x70(%rbp), %rdi
callq 0x2100
leaq -0xf0(%rbp), %rdi
callq 0x2100
leaq -0xd0(%rbp), %rdi
callq 0x2100
leaq -0x50(%rbp), %rdi
callq 0x2100
incq %r15
jmp 0x621c
leaq 0x22ee(%rip), %rdx      # 0x8622
leaq -0x90(%rbp), %rdi
movq -0x30(%rbp), %r14
movq %r14, %rsi
callq 0x4566
leaq -0x90(%rbp), %rbx
movq %r14, %rdi
movq %rbx, %rsi
callq 0x2270
movq %rbx, %rdi
callq 0x2100
movq %r14, %rax
addq $0xe8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
jmp 0x63ea
movq %rax, %rbx
movq -0x30(%rbp), %r14
jmp 0x63ea
movq %rax, %rbx
movq -0x30(%rbp), %r14
jmp 0x63e1
movq %rax, %rbx
leaq -0x110(%rbp), %rdi
callq 0x2100
jmp 0x63a1
movq %rax, %rbx
leaq -0xb0(%rbp), %rdi
callq 0x2100
jmp 0x63b7
movq %rax, %rbx
jmp 0x63c0
movq %rax, %rbx
leaq -0x70(%rbp), %rdi
callq 0x2100
leaq -0xf0(%rbp), %rdi
callq 0x2100
jmp 0x63d1
movq %rax, %rbx
movq -0x30(%rbp), %r14
leaq -0xd0(%rbp), %rdi
callq 0x2100
leaq -0x50(%rbp), %rdi
callq 0x2100
movq %r14, %rdi
callq 0x2100
movq %rbx, %rdi
callq 0x2340
// File: /workspace/github_cpp_makefile_star2_O2/janthonyo[P]Redes-Practicas/./domino.cc
// Function: domino::messageHandP2[abi:cxx11]()
std::string messageHandP2()
	{
		std::string pieces("FICHAS\t");

		for (int i = 0; i < (int) player2.hand.size(); i++)
		{
			pieces = pieces + "|" + std::to_string(player2.hand[i].left) + "|" + std::to_string(player2.hand[i].right) + "|";
		}

		pieces = pieces +"\n\n";

		return pieces;
	}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xe8, %rsp
movq %rsi, %r14
leaq 0x24f6(%rip), %rsi      # 0x890e
leaq -0x90(%rbp), %rdx
movq %rdi, -0x30(%rbp)
callq 0x6610
xorl %r15d, %r15d
leaq -0x110(%rbp), %rbx
movq 0x120(%r14), %rax
subq 0x118(%r14), %rax
shrq $0x3, %rax
cltq
cmpq %rax, %r15
jge 0x6543
leaq -0x50(%rbp), %rdi
movq -0x30(%rbp), %rsi
leaq 0x20db(%rip), %rdx      # 0x8539
callq 0x4566
movq 0x118(%r14), %rax
movl (%rax,%r15,8), %esi
leaq -0xd0(%rbp), %r12
movq %r12, %rdi
callq 0x459e
leaq -0xf0(%rbp), %r13
movq %r13, %rdi
leaq -0x50(%rbp), %rsi
movq %r12, %rdx
callq 0x44f5
leaq -0x70(%rbp), %rdi
movq %r13, %rsi
leaq 0x2098(%rip), %rdx      # 0x8539
callq 0x44cc
movq 0x118(%r14), %rax
movl 0x4(%rax,%r15,8), %esi
leaq -0xb0(%rbp), %r12
movq %r12, %rdi
callq 0x459e
movq %rbx, %rdi
leaq -0x70(%rbp), %rsi
movq %r12, %rdx
callq 0x44f5
leaq -0x90(%rbp), %r12
movq %r12, %rdi
movq %rbx, %rsi
leaq 0x2055(%rip), %rdx      # 0x8539
callq 0x44cc
movq -0x30(%rbp), %rdi
movq %r12, %rsi
callq 0x2270
movq %r12, %rdi
callq 0x2100
movq %rbx, %rdi
callq 0x2100
leaq -0xb0(%rbp), %rdi
callq 0x2100
leaq -0x70(%rbp), %rdi
callq 0x2100
leaq -0xf0(%rbp), %rdi
callq 0x2100
leaq -0xd0(%rbp), %rdi
callq 0x2100
leaq -0x50(%rbp), %rdi
callq 0x2100
incq %r15
jmp 0x6432
leaq 0x20d8(%rip), %rdx      # 0x8622
leaq -0x90(%rbp), %rdi
movq -0x30(%rbp), %r14
movq %r14, %rsi
callq 0x4566
leaq -0x90(%rbp), %rbx
movq %r14, %rdi
movq %rbx, %rsi
callq 0x2270
movq %rbx, %rdi
callq 0x2100
movq %r14, %rax
addq $0xe8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
jmp 0x6600
movq %rax, %rbx
movq -0x30(%rbp), %r14
jmp 0x6600
movq %rax, %rbx
movq -0x30(%rbp), %r14
jmp 0x65f7
movq %rax, %rbx
leaq -0x110(%rbp), %rdi
callq 0x2100
jmp 0x65b7
movq %rax, %rbx
leaq -0xb0(%rbp), %rdi
callq 0x2100
jmp 0x65cd
movq %rax, %rbx
jmp 0x65d6
movq %rax, %rbx
leaq -0x70(%rbp), %rdi
callq 0x2100
leaq -0xf0(%rbp), %rdi
callq 0x2100
jmp 0x65e7
movq %rax, %rbx
movq -0x30(%rbp), %r14
leaq -0xd0(%rbp), %rdi
callq 0x2100
leaq -0x50(%rbp), %rdi
callq 0x2100
movq %r14, %rdi
callq 0x2100
movq %rbx, %rdi
callq 0x2340
// File: /workspace/github_cpp_makefile_star2_O2/janthonyo[P]Redes-Practicas/funcionesServer.cc
// Function: salirCliente(int, fd_set*, int*, std::vector<cliente, std::allocator<cliente>>&)
void salirCliente(int socket, fd_set * readfds, int * numClientes, std::vector<cliente> &arrayClientes){

    char buffer[250];
    int j;

    close(socket);
    FD_CLR(socket,readfds);

    //Re-estructurar el array de clientes
    for (j = 0; j < (*numClientes) - 1; j++)
        if (arrayClientes[j].sd == socket)
            break;
    for (; j < (*numClientes) - 1; j++)
        (arrayClientes[j] = arrayClientes[j+1]);

    (*numClientes)--;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rcx, %r14
movq %rdx, %rbx
movq %rsi, %r12
movl %edi, %r15d
callq 0x23b0
pushq $-0x2
popq %rsi
movl %r15d, %ecx
rolq %cl, %rsi
pushq $0x40
popq %rcx
movl %r15d, %eax
cltd
idivl %ecx
cltq
andq %rsi, (%r12,%rax,8)
movl (%rbx), %eax
movq (%r14), %rcx
cmpl $0x2, %eax
pushq $0x1
popq %r12
cmovgel %eax, %r12d
decl %r12d
xorl %edx, %edx
cmpq %rdx, %r12
je 0x6751
cmpl %r15d, (%rcx)
je 0x674e
incq %rdx
addq $0xd4, %rcx
jmp 0x6738
movq %rdx, %r12
imulq $0xd4, %r12, %r15
movl $0xd4, %r13d
decl %eax
movslq %eax, %rcx
cmpq %rcx, %r12
jge 0x6786
incq %r12
movq (%r14), %rdi
addq %r15, %rdi
leaq (%rdi,%r13), %rsi
movl $0xd4, %edx
callq 0x2160
movl (%rbx), %eax
addq %r13, %r15
jmp 0x675e
movl %eax, (%rbx)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/janthonyo[P]Redes-Practicas/funcionesServer.cc
// Function: checkUser(char*)
bool checkUser(char buffer[])
{
	char user[100];
	char passwd[100];
	std::fstream dataFile;
	bool isUser = false;

	dataFile.open("Data-Clients.txt", std::fstream::in);

	// A la fuerza, cualquier cliente tendra que tener
	// un usuario y una contraseña para acceder al domino y,
	// por lo tanto en el fichero de datos deben aparecer ambos reflejados,
	// por lo que recorreremos el fichero guardando el valor
	// del nombre de usuario (user) y su password (passwd)

	while(!dataFile.eof())
	{
		dataFile >> user;
		dataFile >> passwd;

		if( strcmp(buffer, user) == 0 )
			isUser = true;
	}

	dataFile.close();

	return isUser;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x2e8, %rsp            # imm = 0x2E8
movq %rdi, %rbx
leaq -0x238(%rbp), %r14
movq %r14, %rdi
callq 0x2240
leaq 0x2132(%rip), %rsi      # 0x8916
pushq $0x8
popq %rdx
movq %r14, %rdi
callq 0x2190
xorl %r14d, %r14d
leaq -0x238(%rbp), %r15
leaq -0x310(%rbp), %r12
leaq -0x2a0(%rbp), %r13
movq -0x238(%rbp), %rax
movq -0x18(%rax), %rax
testb $0x2, -0x218(%rbp,%rax)
jne 0x6847
movq %r15, %rdi
movq %r12, %rsi
callq 0x72ec
movq %r15, %rdi
movq %r13, %rsi
callq 0x72ec
movq %rbx, %rdi
movq %r12, %rsi
callq 0x22a0
testl %eax, %eax
sete %al
orb %al, %r14b
jmp 0x6807
leaq -0x238(%rbp), %rdi
callq 0x2040
leaq -0x238(%rbp), %rdi
callq 0x2070
andb $0x1, %r14b
movl %r14d, %eax
addq $0x2e8, %rsp            # imm = 0x2E8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x687a
movq %rax, %rbx
leaq -0x238(%rbp), %rdi
callq 0x2070
movq %rbx, %rdi
callq 0x2340
// File: /workspace/github_cpp_makefile_star2_O2/janthonyo[P]Redes-Practicas/funcionesServer.cc
// Function: registerUser(char*, char*)
bool registerUser(char rUser[], char rPasswd[])
{
	bool registerCompleted = false;
	std::fstream dataFile;

	if(!checkUser(rUser))
	{
		dataFile.open("Data-Clients.txt", std::fstream::out | std::fstream::app);
		dataFile << rUser << " " << rPasswd << "\n";
		dataFile.close();
		registerCompleted = true;
	}

	return registerCompleted;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x218, %rsp            # imm = 0x218
movq %rsi, %r14
movq %rdi, %r15
leaq -0x228(%rbp), %rdi
callq 0x2240
movq %r15, %rdi
callq 0x67b7
movl %eax, %ebx
testb %al, %al
jne 0x691b
leaq 0x204e(%rip), %rsi      # 0x8916
leaq -0x228(%rbp), %rdi
pushq $0x11
popq %rdx
callq 0x2190
leaq -0x218(%rbp), %rdi
movq %r15, %rsi
callq 0x21e0
leaq 0x1b79(%rip), %rsi      # 0x8466
movq %rax, %rdi
callq 0x21e0
movq %rax, %rdi
movq %r14, %rsi
callq 0x21e0
leaq 0x1d1c(%rip), %rsi      # 0x8623
movq %rax, %rdi
callq 0x21e0
leaq -0x228(%rbp), %rdi
callq 0x2040
xorb $0x1, %bl
leaq -0x228(%rbp), %rdi
callq 0x2070
movl %ebx, %eax
addq $0x218, %rsp            # imm = 0x218
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq -0x228(%rbp), %rdi
callq 0x2070
movq %rbx, %rdi
callq 0x2340
// File: /workspace/github_cpp_makefile_star2_O2/janthonyo[P]Redes-Practicas/funcionesServer.cc
// Function: verifyPassword(char*, char*)
bool verifyPassword(char cUser[], char cPasswd[])
{
	char user[100];
	char passwd[100];
	bool foundClient = false;
	bool correctPasswd = false;

	std::fstream dataFile;
	dataFile.open("Data-Clients.txt", std::fstream::in);

	while ((!dataFile.eof()) and (!foundClient))
	{
		dataFile >> user;
		dataFile >> passwd;

		if(strcmp(cUser, user) == 0)
		{
			foundClient = true;

			if(strcmp(cPasswd, passwd) == 0)
			{
				correctPasswd = true;
			}
		}
	}

	dataFile.close();

	return correctPasswd;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x2f8, %rsp            # imm = 0x2F8
movq %rsi, -0x38(%rbp)
movq %rdi, %r14
leaq -0x248(%rbp), %rbx
movq %rbx, %rdi
callq 0x2240
leaq 0x1f94(%rip), %rsi      # 0x8916
pushq $0x8
popq %rdx
movq %rbx, %rdi
callq 0x2190
movl $0x0, -0x2c(%rbp)
leaq -0x248(%rbp), %r12
leaq -0x320(%rbp), %r13
leaq -0x2b0(%rbp), %rbx
xorl %r15d, %r15d
movq -0x248(%rbp), %rax
movq -0x18(%rax), %rax
testb $0x2, -0x228(%rbp,%rax)
jne 0x6a0b
testb $0x1, %r15b
jne 0x6a0b
movq %r12, %rdi
movq %r13, %rsi
callq 0x72ec
movq %r12, %rdi
movq %rbx, %rsi
callq 0x72ec
movq %r14, %rdi
movq %r13, %rsi
callq 0x22a0
testl %eax, %eax
sete %r15b
jne 0x69ac
movq -0x38(%rbp), %rdi
movq %rbx, %rsi
callq 0x22a0
testl %eax, %eax
sete %al
movl -0x2c(%rbp), %ecx
orb %al, %cl
movl %ecx, -0x2c(%rbp)
jmp 0x69ac
leaq -0x248(%rbp), %rdi
callq 0x2040
leaq -0x248(%rbp), %rdi
callq 0x2070
movl -0x2c(%rbp), %eax
andb $0x1, %al
addq $0x2f8, %rsp            # imm = 0x2F8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x6a3c
movq %rax, %rbx
leaq -0x248(%rbp), %rdi
callq 0x2070
movq %rbx, %rdi
callq 0x2340
// File: /workspace/github_cpp_makefile_star2_O2/janthonyo[P]Redes-Practicas/funcionesServer.cc
// Function: matchmaking(std::vector<domino, std::allocator<domino>>)
int matchmaking(std::vector<domino> games)
{
	int gameAssigned = -1;

	for(int i = 0; i < (int) games.size(); i++)
	{
		if(gameAssigned == -1)
		{
			if(!games[i].has2players())
			{
				gameAssigned = i;
			}
		}
	}

	return gameAssigned;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq (%rdi), %rsi
movq 0x8(%rdi), %rax
subq %rsi, %rax
movl $0x138, %ecx            # imm = 0x138
cqto
idivq %rcx
xorl %edx, %edx
testl %eax, %eax
cmovlel %edx, %eax
addq $0x114, %rsi            # imm = 0x114
movl $0xffffffff, %edi       # imm = 0xFFFFFFFF
movl %edi, %ecx
cmpq %rdx, %rax
je 0x6aa6
cmpl $-0x1, %ecx
jne 0x6a9a
cmpl $-0x1, (%rsi)
movl %edi, %ecx
jne 0x6a93
movl %edx, %ecx
cmpl $-0x1, -0x80(%rsi)
cmovel %edx, %ecx
incq %rdx
addq $0x138, %rsi            # imm = 0x138
jmp 0x6a80
movl %ecx, %eax
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/janthonyo[P]Redes-Practicas/funcionesServer.cc
// Function: alternatePlayerStatus(domino&, std::vector<cliente, std::allocator<cliente>>&)
void alternatePlayerStatus(domino& game, std::vector<cliente>& arrayClientes)
{
	int sdplayer1 = game.getSocketP1();
	int sdplayer2 = game.getSocketP2();

	for (int i = 0; i < (int) arrayClientes.size(); i++)
	{
		if (arrayClientes[i].sd == sdplayer1)
        {
        	if (arrayClientes[i].status == 3)
        		arrayClientes[i].status = 4;

        	else
        		arrayClientes[i].status = 3;
        }

        else if (arrayClientes[i].sd == sdplayer2)
        {
        	if (arrayClientes[i].status == 3)
        		arrayClientes[i].status = 4;

        	else
        		arrayClientes[i].status = 3;
        }
	}

}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movl 0x94(%rdi), %ecx
movl 0x114(%rdi), %edi
movq (%rsi), %r8
movq 0x8(%rsi), %rax
subq %r8, %rax
movl $0xd4, %esi
cqto
idivq %rsi
cltq
addq $0x4, %r8
xorl %edx, %edx
cmpq %rax, %rdx
jge 0x6b09
movl -0x4(%r8), %esi
cmpl %ecx, %esi
je 0x6ae7
cmpl %edi, %esi
jne 0x6afd
cmpl $0x3, (%r8)
jne 0x6af6
movl $0x4, (%r8)
jmp 0x6afd
movl $0x3, (%r8)
incq %rdx
addq $0xd4, %r8
jmp 0x6ad6
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/janthonyo[P]Redes-Practicas/funcionesServer.cc
// Function: userInWaitList(int, std::vector<int, std::allocator<int>>)
bool userInWaitList(int sd, std::vector <int> waitList)
{
	bool result = false;

	for(int i = 0; i < (int) waitList.size(); i++)
	{
		if(waitList[i] == sd)
			result = true;

	}

	return result;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq (%rsi), %rcx
movq 0x8(%rsi), %rdx
subq %rcx, %rdx
shrq $0x2, %rdx
xorl %esi, %esi
testl %edx, %edx
cmovlel %esi, %edx
xorl %eax, %eax
cmpq %rsi, %rdx
je 0x6d79
cmpl %edi, (%rcx,%rsi,4)
sete %r8b
orb %r8b, %al
incq %rsi
jmp 0x6d65
andb $0x1, %al
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/janthonyo[P]Redes-Practicas/funcionesServer.cc
// Function: managePostGame(std::vector<domino, std::allocator<domino>>&, int, std::vector<cliente, std::allocator<cliente>>&, int, int*)
void managePostGame(std::vector<domino> &partida, int pos, std::vector<cliente> &arrayClientes, int numClientes, int *numPartidas)
{
	for (int j = 0; j < numClientes; j++)
	{
	    if (arrayClientes[j].sd == partida[pos].getSocketP1())
	    {
	        // Cambiamos el estado para que puedan iniciar nueva partida
	        arrayClientes[j].status = 2;
	        arrayClientes[j].inGame = -1;
	    }

	    else if (arrayClientes[j].sd == partida[pos].getSocketP2())
	    {
	        // Cambiamos el estado para que puedan iniciar nueva partida
	        arrayClientes[j].status = 2;
	        arrayClientes[j].inGame = -1;
	    }
    }

    // Limpiamos la partida y la habilitamos para otros usuarios
    partida[pos].emptyBoard();
    (*numPartidas)--;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movq %r8, %rbx
movq %rdi, %rax
movq (%rdx), %rdx
movslq %esi, %rsi
imulq $0x138, %rsi, %rdi      # imm = 0x138
addq (%rax), %rdi
xorl %eax, %eax
testl %ecx, %ecx
cmovlel %eax, %ecx
imulq $0xd4, %rcx, %rcx
cmpq %rax, %rcx
je 0x6dd7
movl (%rdx,%rax), %esi
cmpl 0x94(%rdi), %esi
je 0x6dbf
cmpl 0x114(%rdi), %esi
jne 0x6dcf
movl $0x2, 0x4(%rdx,%rax)
orl $-0x1, 0xd0(%rdx,%rax)
addq $0xd4, %rax
jmp 0x6da7
callq 0x4378
decl (%rbx)
addq $0x8, %rsp
popq %rbx
popq %rbp
retq