LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: vianna274[P]dropbox/src/Server.cpp
// Function: Dropbox::Server::becomeMain()
void Server::becomeMain() {
    backupList.lock();
    for(string ip : this->backups) {
        WrapperSocket socket(ip, 9000);
        MessageData packet = make_packet(TYPE_COORDINATOR, 1, 1, ipLocal.size(), ipLocal.c_str());
        socket.send(&packet, 100);
    }
    backupList.unlock();
    this->isMain = true;
    this->electionMutex.lock();
    this->status = STATUS_COORDINATOR;
    this->electionMutex.unlock();
    this->propagateNewBoss();
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10b0, %rsp           # imm = 0x10B0
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rdi
movq %rdi, -0x1090(%rbp)
addq $0x98, %rdi
callq 0x6a60
movq -0x1090(%rbp), %rax
addq $0x970, %rax            # imm = 0x970
movq %rax, -0x10(%rbp)
movq -0x10(%rbp), %rdi
callq 0x11ec0
movq %rax, -0x18(%rbp)
movq -0x10(%rbp), %rdi
callq 0x11f30
movq %rax, -0x20(%rbp)
leaq -0x18(%rbp), %rdi
leaq -0x20(%rbp), %rsi
callq 0x11ef0
testb $0x1, %al
jne 0xe757
jmp 0xe898
leaq -0x18(%rbp), %rdi
callq 0x11f60
movq %rax, %rsi
leaq -0x40(%rbp), %rdi
movq %rdi, -0x1098(%rbp)
callq 0x3190
movq -0x1098(%rbp), %rsi
leaq -0xa8(%rbp), %rdi
callq 0x3190
jmp 0xe788
leaq -0x88(%rbp), %rdi
leaq -0xa8(%rbp), %rsi
movl $0x2328, %edx           # imm = 0x2328
callq 0x17690
jmp 0xe7a2
leaq -0xa8(%rbp), %rdi
callq 0x3280
movq -0x1090(%rbp), %rdi
addq $0x9b8, %rdi            # imm = 0x9B8
movq %rdi, -0x10a8(%rbp)
callq 0x32b0
movq -0x10a8(%rbp), %rdi
movl %eax, -0x109c(%rbp)
callq 0x3180
movl -0x109c(%rbp), %r8d
movq %rax, %r9
leaq -0x1088(%rbp), %rdi
movl $0x15, %esi
movl $0x1, %ecx
movl %ecx, %edx
callq 0x97a0
jmp 0xe7fe
leaq -0x88(%rbp), %rdi
leaq -0x1088(%rbp), %rsi
movl $0x64, %edx
callq 0x178c0
jmp 0xe818
leaq -0x88(%rbp), %rdi
callq 0x17770
leaq -0x40(%rbp), %rdi
callq 0x3280
leaq -0x18(%rbp), %rdi
callq 0x12050
jmp 0xe741
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xb0(%rbp)
movl %eax, -0xb4(%rbp)
jmp 0xe88d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xb0(%rbp)
movl %eax, -0xb4(%rbp)
leaq -0xa8(%rbp), %rdi
callq 0x3280
jmp 0xe88d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xb0(%rbp)
movl %eax, -0xb4(%rbp)
leaq -0x88(%rbp), %rdi
callq 0x17770
leaq -0x40(%rbp), %rdi
callq 0x3280
jmp 0xe8f1
movq -0x1090(%rbp), %rdi
addq $0x98, %rdi
callq 0x6a90
movq -0x1090(%rbp), %rdi
movb $0x1, 0x9f8(%rdi)
addq $0x20, %rdi
callq 0x6a60
movq -0x1090(%rbp), %rdi
movl $0x1a, 0x180(%rdi)
addq $0x20, %rdi
callq 0x6a90
movq -0x1090(%rbp), %rdi
callq 0xe470
addq $0x10b0, %rsp           # imm = 0x10B0
popq %rbp
retq
movq -0xb0(%rbp), %rdi
callq 0x3610
nopl (%rax)
// File: vianna274[P]dropbox/src/Server.cpp
// Function: Dropbox::Server::getHighers[abi:cxx11]()
vector<string> Server::getHighers() {
    vector<string> highers;
    backupList.lock();
    removeFromBackup(this->backups, this->ipMain);
    for(string ip : this->backups) {
        if (ip > ipLocal)
            highers.push_back(ip);
    }
    backupList.unlock();
    return highers;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xb0, %rsp
movq %rdi, -0xb0(%rbp)
movq %rdi, %rax
movq %rax, -0xa8(%rbp)
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0xa0(%rbp)
movb $0x0, -0x11(%rbp)
callq 0x11880
movq -0xa0(%rbp), %rdi
addq $0x98, %rdi
callq 0x6a60
jmp 0xe94d
movq -0xa0(%rbp), %rsi
addq $0x970, %rsi            # imm = 0x970
leaq -0x40(%rbp), %rdi
callq 0x11dd0
jmp 0xe966
movq -0xa0(%rbp), %rsi
addq $0x9d8, %rsi            # imm = 0x9D8
leaq -0x60(%rbp), %rdi
callq 0x3190
jmp 0xe97f
movq -0xa0(%rbp), %rdi
leaq -0x40(%rbp), %rsi
leaq -0x60(%rbp), %rdx
callq 0xe190
jmp 0xe995
leaq -0x60(%rbp), %rdi
callq 0x3280
leaq -0x40(%rbp), %rdi
callq 0x11a00
movq -0xa0(%rbp), %rax
addq $0x970, %rax            # imm = 0x970
movq %rax, -0x68(%rbp)
movq -0x68(%rbp), %rdi
callq 0x11ec0
movq %rax, -0x70(%rbp)
movq -0x68(%rbp), %rdi
callq 0x11f30
movq %rax, -0x78(%rbp)
leaq -0x70(%rbp), %rdi
leaq -0x78(%rbp), %rsi
callq 0x11ef0
testb $0x1, %al
jne 0xe9e8
jmp 0xeaac
leaq -0x70(%rbp), %rdi
callq 0x11f60
movq %rax, %rsi
leaq -0x98(%rbp), %rdi
callq 0x3190
jmp 0xea02
movq -0xa0(%rbp), %rsi
addq $0x9b8, %rsi            # imm = 0x9B8
leaq -0x98(%rbp), %rdi
callq 0x121a0
testb $0x1, %al
jne 0xea22
jmp 0xea92
movq -0xb0(%rbp), %rdi
leaq -0x98(%rbp), %rsi
callq 0x11f80
jmp 0xea37
jmp 0xea92
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x20(%rbp)
movl %eax, -0x24(%rbp)
jmp 0xeae7
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x20(%rbp)
movl %eax, -0x24(%rbp)
jmp 0xea6d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x20(%rbp)
movl %eax, -0x24(%rbp)
leaq -0x60(%rbp), %rdi
callq 0x3280
leaq -0x40(%rbp), %rdi
callq 0x11a00
jmp 0xeae7
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x20(%rbp)
movl %eax, -0x24(%rbp)
leaq -0x98(%rbp), %rdi
callq 0x3280
jmp 0xeae7
leaq -0x98(%rbp), %rdi
callq 0x3280
leaq -0x70(%rbp), %rdi
callq 0x12050
jmp 0xe9d2
movq -0xa0(%rbp), %rdi
addq $0x98, %rdi
callq 0x6a90
jmp 0xeac1
movb $0x1, -0x11(%rbp)
testb $0x1, -0x11(%rbp)
jne 0xead7
movq -0xb0(%rbp), %rdi
callq 0x11a00
movq -0xa8(%rbp), %rax
addq $0xb0, %rsp
popq %rbp
retq
movq -0xb0(%rbp), %rdi
callq 0x11a00
movq -0x20(%rbp), %rdi
callq 0x3610
nopl (%rax)
// File: vianna274[P]dropbox/src/Server.cpp
// Function: Dropbox::Server::sendHighersElection(std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>>)
void Server::sendHighersElection(vector<string> highers) {
    for(string higher : highers) {
        WrapperSocket socket(higher, 9000);
        MessageData packet = make_packet(TYPE_ELECTION, 1, 1, ipLocal.size(), ipLocal.c_str());
        socket.send(&packet);
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10b0, %rsp           # imm = 0x10B0
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x1098(%rbp)
movq %rsi, -0x18(%rbp)
movq -0x18(%rbp), %rdi
callq 0x11ec0
movq %rax, -0x20(%rbp)
movq -0x18(%rbp), %rdi
callq 0x11f30
movq %rax, -0x28(%rbp)
leaq -0x20(%rbp), %rdi
leaq -0x28(%rbp), %rsi
callq 0x11ef0
testb $0x1, %al
jne 0xeb52
jmp 0xec8e
leaq -0x20(%rbp), %rdi
callq 0x11f60
movq %rax, %rsi
leaq -0x48(%rbp), %rdi
movq %rdi, -0x10a0(%rbp)
callq 0x3190
movq -0x10a0(%rbp), %rsi
leaq -0xb0(%rbp), %rdi
callq 0x3190
jmp 0xeb83
leaq -0x90(%rbp), %rdi
leaq -0xb0(%rbp), %rsi
movl $0x2328, %edx           # imm = 0x2328
callq 0x17690
jmp 0xeb9d
leaq -0xb0(%rbp), %rdi
callq 0x3280
movq -0x1098(%rbp), %rdi
addq $0x9b8, %rdi            # imm = 0x9B8
movq %rdi, -0x10b0(%rbp)
callq 0x32b0
movq -0x10b0(%rbp), %rdi
movl %eax, -0x10a4(%rbp)
callq 0x3180
movl -0x10a4(%rbp), %r8d
movq %rax, %r9
leaq -0x1090(%rbp), %rdi
movl $0x14, %esi
movl $0x1, %ecx
movl %ecx, %edx
callq 0x97a0
jmp 0xebf9
leaq -0x90(%rbp), %rdi
leaq -0x1090(%rbp), %rsi
callq 0x17d90
jmp 0xec0e
leaq -0x90(%rbp), %rdi
callq 0x17770
leaq -0x48(%rbp), %rdi
callq 0x3280
leaq -0x20(%rbp), %rdi
callq 0x12050
jmp 0xeb3c
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xb8(%rbp)
movl %eax, -0xbc(%rbp)
jmp 0xec83
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xb8(%rbp)
movl %eax, -0xbc(%rbp)
leaq -0xb0(%rbp), %rdi
callq 0x3280
jmp 0xec83
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xb8(%rbp)
movl %eax, -0xbc(%rbp)
leaq -0x90(%rbp), %rdi
callq 0x17770
leaq -0x48(%rbp), %rdi
callq 0x3280
jmp 0xec97
addq $0x10b0, %rsp           # imm = 0x10B0
popq %rbp
retq
movq -0xb8(%rbp), %rdi
callq 0x3610
nopw %cs:(%rax,%rax)
// File: vianna274[P]dropbox/src/Server.cpp
// Function: Dropbox::Server::startElection(std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>>)
void Server::startElection(vector<string> highers)
{
    this->electionMutex.lock();
    this->status = STATUS_ELECTION;
    this->electionMutex.unlock();
    this->sendHighersElection(highers);
    if (this->waitForAnswer()) {
        if (this->waitForCoordinator() || this->status == STATUS_NOT_YET)
            return;
        this->becomeMain();
    }
    this->becomeMain();
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x60, %rsp
movq %rsi, -0x50(%rbp)
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rdi
movq %rdi, -0x48(%rbp)
addq $0x20, %rdi
movq %rdi, -0x58(%rbp)
callq 0x6a60
movq -0x58(%rbp), %rdi
movq -0x48(%rbp), %rax
movl $0x19, 0x180(%rax)
callq 0x6a90
movq -0x50(%rbp), %rsi
leaq -0x28(%rbp), %rdi
movq %rdi, -0x40(%rbp)
callq 0x11dd0
movq -0x48(%rbp), %rdi
movq -0x40(%rbp), %rsi
callq 0xeb00
jmp 0xed10
leaq -0x28(%rbp), %rdi
callq 0x11a00
movq -0x48(%rbp), %rdi
callq 0xed80
testb $0x1, %al
jne 0xed28
jmp 0xed64
movq -0x48(%rbp), %rdi
callq 0xee20
testb $0x1, %al
jne 0xed42
movq -0x48(%rbp), %rax
cmpl $0x1b, 0x180(%rax)
jne 0xed5b
jmp 0xed6d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
leaq -0x28(%rbp), %rdi
callq 0x11a00
jmp 0xed73
movq -0x48(%rbp), %rdi
callq 0xe6f0
movq -0x48(%rbp), %rdi
callq 0xe6f0
addq $0x60, %rsp
popq %rbp
retq
movq -0x30(%rbp), %rdi
callq 0x3610
nopl (%rax)
// File: vianna274[P]dropbox/src/Server.cpp
// Function: Dropbox::Server::waitForAnswer()
bool Server::waitForAnswer()
{
    while(true) {
        MessageData * res = this->listenToServersSocket.receive(TIMEOUT_ON, 1500);
        if (res == NULL)
            return false;
        cout << res->type << endl;
        if (res->type == TYPE_ANSWER) {
            return true;
        }
        if (res->type == TYPE_COORDINATOR) {
            handleReceiveCoordinator(res);
            return true;
        }
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x10(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rdi
addq $0x130, %rdi            # imm = 0x130
movl $0x1, %esi
movl $0x5dc, %edx            # imm = 0x5DC
callq 0x17bc0
movq %rax, -0x18(%rbp)
cmpq $0x0, -0x18(%rbp)
jne 0xedbf
movb $0x0, -0x1(%rbp)
jmp 0xee0d
movq -0x18(%rbp), %rax
movl (%rax), %esi
movq 0x141fc(%rip), %rdi     # 0x22fc8
callq 0x35d0
movq %rax, %rdi
movq 0x141d5(%rip), %rsi     # 0x22fb0
callq 0x33d0
movq -0x18(%rbp), %rax
cmpl $0x16, (%rax)
jne 0xedef
movb $0x1, -0x1(%rbp)
jmp 0xee0d
movq -0x18(%rbp), %rax
cmpl $0x15, (%rax)
jne 0xee0b
movq -0x20(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0xf0d0
movb $0x1, -0x1(%rbp)
jmp 0xee0d
jmp 0xed94
movb -0x1(%rbp), %al
andb $0x1, %al
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: vianna274[P]dropbox/src/Server.cpp
// Function: Dropbox::Server::waitForCoordinator()
bool Server::waitForCoordinator()
{
    while(true) {
        MessageData * res = this->listenToServersSocket.receive(TIMEOUT_ON, 1500);
        if (res == NULL)
            return false;
        if (res->type == TYPE_COORDINATOR) {
            handleReceiveCoordinator(res);
            return true;
        }
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x10(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rdi
addq $0x130, %rdi            # imm = 0x130
movl $0x1, %esi
movl $0x5dc, %edx            # imm = 0x5DC
callq 0x17bc0
movq %rax, -0x18(%rbp)
cmpq $0x0, -0x18(%rbp)
jne 0xee5f
movb $0x0, -0x1(%rbp)
jmp 0xee7d
movq -0x18(%rbp), %rax
cmpl $0x15, (%rax)
jne 0xee7b
movq -0x20(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0xf0d0
movb $0x1, -0x1(%rbp)
jmp 0xee7d
jmp 0xee34
movb -0x1(%rbp), %al
andb $0x1, %al
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: vianna274[P]dropbox/src/Server.cpp
// Function: Dropbox::Server::createNewPortBackup(Dropbox::WrapperSocket*)
void Server::createNewPortBackup(WrapperSocket * socket)
{
    int newPort = getAvailablePort();
    MessageData packet = make_packet(TYPE_MAKE_CONNECTION, 1, 1, -1, to_string(newPort).c_str());
    WrapperSocket * newSocket = new WrapperSocket(newPort);
    socket->send(&packet);
    thread listenToBackupThread(&Server::listenToServers, this, newSocket);
    listenToBackupThread.detach();
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x1060, %rsp           # imm = 0x1060
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rdi
movq %rdi, -0x1050(%rbp)
callq 0xf030
movl %eax, -0x14(%rbp)
movl -0x14(%rbp), %esi
leaq -0x1008(%rbp), %rdi
movq %rdi, -0x1048(%rbp)
callq 0x6e00
movq -0x1048(%rbp), %rdi
callq 0x3180
movq %rax, %r9
leaq -0xfe8(%rbp), %rdi
movl $0x2, %esi
movl $0x1, %ecx
movl $0xffffffff, %r8d       # imm = 0xFFFFFFFF
movl %ecx, %edx
callq 0x97a0
jmp 0xeefb
leaq -0x1008(%rbp), %rdi
callq 0x3280
movl $0x48, %edi
callq 0x33b0
movq %rax, %rdi
movq %rdi, %rax
movq %rax, -0x1058(%rbp)
movl -0x14(%rbp), %esi
callq 0x177a0
jmp 0xef28
movq -0x1058(%rbp), %rax
movq %rax, -0x1020(%rbp)
movq -0x10(%rbp), %rdi
leaq -0xfe8(%rbp), %rsi
callq 0x17d90
movq -0x1050(%rbp), %rax
leaq -0x21c4(%rip), %rcx     # 0xcd90
movq %rcx, -0x1038(%rbp)
movq $0x0, -0x1030(%rbp)
movq %rax, -0x1040(%rbp)
leaq -0x1028(%rbp), %rdi
movq %rdi, -0x1060(%rbp)
leaq -0x1038(%rbp), %rsi
leaq -0x1040(%rbp), %rdx
leaq -0x1020(%rbp), %rcx
callq 0x121e0
movq -0x1060(%rbp), %rdi
callq 0x3600
jmp 0xefa3
leaq -0x1028(%rbp), %rdi
callq 0x69d0
addq $0x1060, %rsp           # imm = 0x1060
popq %rbp
retq
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x1010(%rbp)
movl %eax, -0x1014(%rbp)
leaq -0x1008(%rbp), %rdi
callq 0x3280
jmp 0xf016
movq -0x1058(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x1010(%rbp)
movl %eax, -0x1014(%rbp)
callq 0x3370
jmp 0xf016
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x1010(%rbp)
movl %eax, -0x1014(%rbp)
leaq -0x1028(%rbp), %rdi
callq 0x69d0
movq -0x1010(%rbp), %rdi
callq 0x3610
nopw %cs:(%rax,%rax)
// File: vianna274[P]dropbox/src/Server.cpp
// Function: Dropbox::Server::getAvailablePort()
int Server::getAvailablePort()
{
    portsMutex.lock();
    for(int p = FIRST_PORT; p <= LAST_PORT; p++){
        int i = p - FIRST_PORT;
        if(portsAvailable[i]){
            portsAvailable[i] = false;
            portsMutex.unlock();
            return p;
        }
    }
    portsMutex.unlock();
    return -1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x10(%rbp)
movq -0x10(%rbp), %rdi
movq %rdi, -0x20(%rbp)
addq $0x70, %rdi
callq 0x6a60
movl $0xfa1, -0x14(%rbp)     # imm = 0xFA1
cmpl $0x1770, -0x14(%rbp)    # imm = 0x1770
jg 0xf0a9
movq -0x20(%rbp), %rax
movl -0x14(%rbp), %ecx
subl $0xfa1, %ecx            # imm = 0xFA1
movl %ecx, -0x18(%rbp)
movslq -0x18(%rbp), %rcx
testb $0x1, 0x184(%rax,%rcx)
je 0xf09c
movq -0x20(%rbp), %rdi
movslq -0x18(%rbp), %rax
movb $0x0, 0x184(%rdi,%rax)
addq $0x70, %rdi
callq 0x6a90
movl -0x14(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0xf0bd
jmp 0xf09e
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0xf054
movq -0x20(%rbp), %rdi
addq $0x70, %rdi
callq 0x6a90
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
movl -0x4(%rbp), %eax
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: vianna274[P]dropbox/src/Server.cpp
// Function: Dropbox::Server::getUser(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
User* Server::getUser(string username)
{
    for(unsigned i = 0; i < users.size(); i++){
        if(users[i]->getUsername() == username){
            return users[i];
        }
    }
    return nullptr;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x60, %rsp
movq %rsi, -0x50(%rbp)
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x48(%rbp)
movl $0x0, -0x1c(%rbp)
movq -0x48(%rbp), %rdi
movl -0x1c(%rbp), %eax
movq %rax, -0x58(%rbp)
addq $0x958, %rdi            # imm = 0x958
callq 0x12400
movq %rax, %rcx
movq -0x58(%rbp), %rax
cmpq %rcx, %rax
jae 0xf467
movq -0x48(%rbp), %rdi
addq $0x958, %rdi            # imm = 0x958
movl -0x1c(%rbp), %eax
movl %eax, %esi
callq 0x12420
movq (%rax), %rsi
leaq -0x40(%rbp), %rdi
callq 0x17010
movq -0x50(%rbp), %rsi
leaq -0x40(%rbp), %rdi
callq 0x6fe0
movb %al, -0x59(%rbp)
leaq -0x40(%rbp), %rdi
callq 0x3280
movb -0x59(%rbp), %al
testb $0x1, %al
jne 0xf439
jmp 0xf457
movq -0x48(%rbp), %rdi
addq $0x958, %rdi            # imm = 0x958
movl -0x1c(%rbp), %eax
movl %eax, %esi
callq 0x12420
movq (%rax), %rax
movq %rax, -0x8(%rbp)
jmp 0xf46f
jmp 0xf459
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rbp)
jmp 0xf3d3
movq $0x0, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x60, %rsp
popq %rbp
retq
nopl (%rax)
// File: vianna274[P]dropbox/src/Server.cpp
// Function: Dropbox::Server::propagateConnection(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
void Server::propagateConnection(string username, string userIp)
{   
    propagationMutex.lock();
    MessageData packet = make_packet(TYPE_CREATE_USER, 1, 1, -1, userIp.c_str(), username.c_str());
    for(WrapperSocket * socket : this->backupsSockets) {
        socket->send(&packet);
    }
    propagationMutex.unlock();
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x1040, %rsp           # imm = 0x1040
movq %rsi, -0x1028(%rbp)
movq %rdx, -0x1030(%rbp)
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x8(%rbp), %rdi
movq %rdi, -0x1018(%rbp)
addq $0x48, %rdi
callq 0x6a60
movq -0x1030(%rbp), %rdi
callq 0x3180
movq -0x1028(%rbp), %rdi
movq %rax, -0x1020(%rbp)
callq 0x3180
movq -0x1020(%rbp), %r9
leaq -0xfec(%rbp), %rdi
movl $0x12, %esi
movl $0x1, %ecx
movl $0xffffffff, %r8d       # imm = 0xFFFFFFFF
movl %ecx, %edx
movq %rax, (%rsp)
callq 0x9830
movq -0x1018(%rbp), %rax
addq $0x9a0, %rax            # imm = 0x9A0
movq %rax, -0xff8(%rbp)
movq -0xff8(%rbp), %rdi
callq 0x12550
movq %rax, -0x1000(%rbp)
movq -0xff8(%rbp), %rdi
callq 0x12580
movq %rax, -0x1008(%rbp)
leaq -0x1000(%rbp), %rdi
leaq -0x1008(%rbp), %rsi
callq 0x125b0
testb $0x1, %al
jne 0xf714
jmp 0xf74b
leaq -0x1000(%rbp), %rdi
callq 0x125f0
movq (%rax), %rax
movq %rax, -0x1010(%rbp)
movq -0x1010(%rbp), %rdi
leaq -0xfec(%rbp), %rsi
callq 0x17d90
leaq -0x1000(%rbp), %rdi
callq 0x12610
jmp 0xf6fb
movq -0x1018(%rbp), %rdi
addq $0x48, %rdi
callq 0x6a90
addq $0x1040, %rsp           # imm = 0x1040
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: vianna274[P]dropbox/src/Server.cpp
// Function: Dropbox::Server::propagateDelete(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
void Server::propagateDelete(string filename, string username) 
{
    propagationMutex.lock();
    User * user = getUser(username);
    for(WrapperSocket * socket : this->backupsSockets) {
        this->sendDeleteFile(socket, filename.c_str(), username);
        user->removeFileRecord(filename);
    }
    propagationMutex.unlock();
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x130, %rsp            # imm = 0x130
movq %rsi, -0x100(%rbp)
movq %rdx, -0xf8(%rbp)
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x8(%rbp), %rdi
movq %rdi, -0xf0(%rbp)
addq $0x48, %rdi
callq 0x6a60
movq -0xf8(%rbp), %rsi
leaq -0x40(%rbp), %rdi
movq %rdi, -0xe8(%rbp)
callq 0x3190
movq -0xf0(%rbp), %rdi
movq -0xe8(%rbp), %rsi
callq 0xf3b0
movq %rax, -0xe0(%rbp)
jmp 0x105ac
leaq -0x40(%rbp), %rdi
callq 0x3280
movq -0xe0(%rbp), %rcx
movq -0xf0(%rbp), %rax
movq %rcx, -0x20(%rbp)
addq $0x9a0, %rax            # imm = 0x9A0
movq %rax, -0x58(%rbp)
movq -0x58(%rbp), %rdi
callq 0x12550
movq %rax, -0x60(%rbp)
movq -0x58(%rbp), %rdi
callq 0x12580
movq %rax, -0x68(%rbp)
leaq -0x60(%rbp), %rdi
leaq -0x68(%rbp), %rsi
callq 0x125b0
testb $0x1, %al
jne 0x10601
jmp 0x10790
leaq -0x60(%rbp), %rdi
callq 0x125f0
movq -0x100(%rbp), %rdi
movq (%rax), %rax
movq %rax, -0x70(%rbp)
movq -0x70(%rbp), %rax
movq %rax, -0x118(%rbp)
callq 0x3180
movq %rax, -0x110(%rbp)
leaq -0x91(%rbp), %rdi
movq %rdi, -0x108(%rbp)
callq 0x3620
movq -0x110(%rbp), %rsi
movq -0x108(%rbp), %rdx
leaq -0x90(%rbp), %rdi
callq 0x3480
jmp 0x1065e
movq -0xf8(%rbp), %rsi
leaq -0xb8(%rbp), %rdi
callq 0x3190
jmp 0x10673
movq -0x118(%rbp), %rsi
movq -0xf0(%rbp), %rdi
leaq -0x90(%rbp), %rdx
leaq -0xb8(%rbp), %rcx
callq 0xb920
jmp 0x10696
leaq -0xb8(%rbp), %rdi
callq 0x3280
leaq -0x90(%rbp), %rdi
callq 0x3280
leaq -0x91(%rbp), %rdi
callq 0x33e0
movq -0x100(%rbp), %rsi
movq -0x20(%rbp), %rax
movq %rax, -0x128(%rbp)
leaq -0xd8(%rbp), %rdi
movq %rdi, -0x120(%rbp)
callq 0x3190
movq -0x128(%rbp), %rdi
movq -0x120(%rbp), %rsi
callq 0x16d00
jmp 0x106f4
leaq -0xd8(%rbp), %rdi
callq 0x3280
leaq -0x60(%rbp), %rdi
callq 0x12610
jmp 0x105eb
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
leaq -0x40(%rbp), %rdi
callq 0x3280
jmp 0x107a9
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
jmp 0x10768
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
jmp 0x1075c
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
leaq -0xb8(%rbp), %rdi
callq 0x3280
leaq -0x90(%rbp), %rdi
callq 0x3280
leaq -0x91(%rbp), %rdi
callq 0x33e0
jmp 0x107a9
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
leaq -0xd8(%rbp), %rdi
callq 0x3280
jmp 0x107a9
movq -0xf0(%rbp), %rdi
addq $0x48, %rdi
callq 0x6a90
addq $0x130, %rsp            # imm = 0x130
popq %rbp
retq
movq -0x48(%rbp), %rdi
callq 0x3610
nopw %cs:(%rax,%rax)
// File: vianna274[P]dropbox/src/Server.cpp
// Function: Dropbox::Server::receiveAskUpdate(Dropbox::WrapperSocket*, Dropbox::User*)
void Server::receiveAskUpdate(WrapperSocket * socket, User * user) {
    vector<FileRecord> clientFiles = this->receiveFileList(socket);
    this->updateClient(this->getFileList(user->getDirPath()), clientFiles, socket, user);
    MessageData packet = make_packet(TYPE_REQUEST_UPDATE_DONE, 1, 1, sizeof("request_update_done"), "request_update_done");
	socket->send(&packet);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x1070, %rsp           # imm = 0x1070
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x8(%rbp), %rsi
movq %rsi, -0x1070(%rbp)
movq -0x10(%rbp), %rdx
leaq -0x30(%rbp), %rdi
callq 0xb200
movq -0x18(%rbp), %rsi
leaq -0x68(%rbp), %rdi
callq 0x17040
jmp 0x10bee
movq -0x1070(%rbp), %rsi
leaq -0x48(%rbp), %rdi
leaq -0x68(%rbp), %rdx
callq 0x9910
jmp 0x10c04
leaq -0x90(%rbp), %rdi
leaq -0x30(%rbp), %rsi
callq 0x6bc0
jmp 0x10c16
movq -0x1070(%rbp), %rdi
movq -0x10(%rbp), %rcx
movq -0x18(%rbp), %r8
leaq -0x48(%rbp), %rsi
leaq -0x90(%rbp), %rdx
callq 0x110c0
jmp 0x10c37
leaq -0x90(%rbp), %rdi
callq 0x6a00
leaq -0x48(%rbp), %rdi
callq 0x6a00
leaq -0x68(%rbp), %rdi
callq 0x3280
leaq 0x8867(%rip), %r9       # 0x194c3
leaq -0x1064(%rbp), %rdi
movl $0xf, %esi
movl $0x1, %ecx
movl $0x14, %r8d
movl %ecx, %edx
callq 0x97a0
jmp 0x10c7c
movq -0x10(%rbp), %rdi
leaq -0x1064(%rbp), %rsi
callq 0x17d90
jmp 0x10c8e
leaq -0x30(%rbp), %rdi
callq 0x6a00
addq $0x1070, %rsp           # imm = 0x1070
popq %rbp
retq
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x70(%rbp)
movl %eax, -0x74(%rbp)
jmp 0x10cf4
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x70(%rbp)
movl %eax, -0x74(%rbp)
jmp 0x10ceb
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x70(%rbp)
movl %eax, -0x74(%rbp)
jmp 0x10ce2
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x70(%rbp)
movl %eax, -0x74(%rbp)
leaq -0x90(%rbp), %rdi
callq 0x6a00
leaq -0x48(%rbp), %rdi
callq 0x6a00
leaq -0x68(%rbp), %rdi
callq 0x3280
leaq -0x30(%rbp), %rdi
callq 0x6a00
movq -0x70(%rbp), %rdi
callq 0x3610
nopw %cs:(%rax,%rax)
// File: vianna274[P]dropbox/src/Server.cpp
// Function: Dropbox::Server::exitUser(Dropbox::WrapperSocket*, Dropbox::User*)
void Server::exitUser(WrapperSocket *socket, User *user){
    int port = socket->getPortInt();
    user->closeDeviceSession(socket);
    setPortAvailable(port);
    cout << "User " + user->getUsername() + " ended session on device on port " << port << endl;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xb0, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0xa0(%rbp)
movq -0x10(%rbp), %rdi
callq 0x18600
movl %eax, -0x1c(%rbp)
movq -0x18(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0x170c0
movq -0xa0(%rbp), %rdi
movl -0x1c(%rbp), %esi
callq 0x11780
movq -0x18(%rbp), %rsi
leaq -0x80(%rbp), %rdi
movq %rdi, -0x98(%rbp)
callq 0x17010
movq -0x98(%rbp), %rdx
leaq 0x875b(%rip), %rsi      # 0x194d7
leaq -0x60(%rbp), %rdi
callq 0x6db0
jmp 0x10d87
leaq 0x874f(%rip), %rdx      # 0x194dd
leaq -0x40(%rbp), %rdi
leaq -0x60(%rbp), %rsi
callq 0x6730
jmp 0x10d9d
movq 0x12224(%rip), %rdi     # 0x22fc8
leaq -0x40(%rbp), %rsi
callq 0x3330
movq %rax, -0xa8(%rbp)
jmp 0x10db6
movq -0xa8(%rbp), %rdi
movl -0x1c(%rbp), %esi
callq 0x35d0
movq %rax, -0xb0(%rbp)
jmp 0x10dce
movq -0xb0(%rbp), %rdi
movq 0x121d4(%rip), %rsi     # 0x22fb0
callq 0x33d0
jmp 0x10de3
leaq -0x40(%rbp), %rdi
callq 0x3280
leaq -0x60(%rbp), %rdi
callq 0x3280
leaq -0x80(%rbp), %rdi
callq 0x3280
addq $0xb0, %rsp
popq %rbp
retq
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x88(%rbp)
movl %eax, -0x8c(%rbp)
jmp 0x10e53
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x88(%rbp)
movl %eax, -0x8c(%rbp)
jmp 0x10e4a
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x88(%rbp)
movl %eax, -0x8c(%rbp)
leaq -0x40(%rbp), %rdi
callq 0x3280
leaq -0x60(%rbp), %rdi
callq 0x3280
leaq -0x80(%rbp), %rdi
callq 0x3280
movq -0x88(%rbp), %rdi
callq 0x3610
nopl (%rax,%rax)
// File: vianna274[P]dropbox/src/Server.cpp
// Function: Dropbox::Server::lookForRecordAndRemove(Dropbox::_FileRecord, std::vector<Dropbox::_FileRecord, std::allocator<Dropbox::_FileRecord>>*, Dropbox::_FileRecord*)
int Server::lookForRecordAndRemove(FileRecord file, vector<FileRecord> *files, FileRecord *updatedFile) {
    vector<FileRecord>::iterator it;
    for(it = files->begin(); it != files->end(); it++) {
        if (string(it->filename) == string(file.filename)) {
            if (it->modificationTime == file.modificationTime) {
                files->erase(it);
                return OK;
            }
            else {
                *updatedFile = *it;
                files->erase(it);
                return UPDATE;
            }
        }
    }
    return DELETE;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x100, %rsp            # imm = 0x100
leaq 0x10(%rbp), %rax
movq %rax, -0xc8(%rbp)
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
leaq -0x28(%rbp), %rdi
callq 0x6f20
movq -0x18(%rbp), %rdi
callq 0x6f40
movq %rax, -0x30(%rbp)
movq -0x30(%rbp), %rax
movq %rax, -0x28(%rbp)
movq -0x18(%rbp), %rdi
callq 0x6fb0
movq %rax, -0x38(%rbp)
leaq -0x28(%rbp), %rdi
leaq -0x38(%rbp), %rsi
callq 0x6f70
testb $0x1, %al
jne 0x10ed3
jmp 0x11099
leaq -0x28(%rbp), %rdi
callq 0x7070
movq %rax, -0xd8(%rbp)
leaq -0x59(%rbp), %rdi
movq %rdi, -0xd0(%rbp)
callq 0x3620
movq -0xd8(%rbp), %rsi
movq -0xd0(%rbp), %rdx
leaq -0x58(%rbp), %rdi
callq 0x3480
jmp 0x10f0c
leaq -0x91(%rbp), %rdi
movq %rdi, -0xe0(%rbp)
callq 0x3620
movq -0xc8(%rbp), %rsi
movq -0xe0(%rbp), %rdx
leaq -0x90(%rbp), %rdi
callq 0x3480
jmp 0x10f3b
leaq -0x58(%rbp), %rdi
leaq -0x90(%rbp), %rsi
callq 0x6fe0
movb %al, -0xe1(%rbp)
leaq -0x90(%rbp), %rdi
callq 0x3280
leaq -0x91(%rbp), %rdi
callq 0x33e0
leaq -0x58(%rbp), %rdi
callq 0x3280
leaq -0x59(%rbp), %rdi
callq 0x33e0
movb -0xe1(%rbp), %al
testb $0x1, %al
jne 0x10f8a
jmp 0x11080
leaq -0x28(%rbp), %rdi
callq 0x7070
movq -0xc8(%rbp), %rcx
movq 0xd8(%rax), %rax
cmpq 0xd8(%rcx), %rax
jne 0x11028
movq -0x18(%rbp), %rax
movq %rax, -0xf0(%rbp)
leaq -0xa0(%rbp), %rdi
leaq -0x28(%rbp), %rsi
callq 0x7100
movq -0xf0(%rbp), %rdi
movq -0xa0(%rbp), %rsi
callq 0x7090
movq %rax, -0xa8(%rbp)
movl $0x1d, -0x4(%rbp)
jmp 0x110a0
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x68(%rbp)
movl %eax, -0x6c(%rbp)
jmp 0x1101a
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x68(%rbp)
movl %eax, -0x6c(%rbp)
leaq -0x91(%rbp), %rdi
callq 0x33e0
leaq -0x58(%rbp), %rdi
callq 0x3280
leaq -0x59(%rbp), %rdi
callq 0x33e0
jmp 0x110ac
leaq -0x28(%rbp), %rdi
callq 0x7180
movq %rax, %rsi
movq -0x20(%rbp), %rdi
movl $0xe8, %edx
callq 0x3300
movq -0x18(%rbp), %rax
movq %rax, -0xf8(%rbp)
leaq -0xb0(%rbp), %rdi
leaq -0x28(%rbp), %rsi
callq 0x7100
movq -0xf8(%rbp), %rdi
movq -0xb0(%rbp), %rsi
callq 0x7090
movq %rax, -0xb8(%rbp)
movl $0x1f, -0x4(%rbp)
jmp 0x110a0
jmp 0x11082
leaq -0x28(%rbp), %rdi
xorl %esi, %esi
callq 0x7140
movq %rax, -0xc0(%rbp)
jmp 0x10eb0
movl $0x1e, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x100, %rsp            # imm = 0x100
popq %rbp
retq
movq -0x68(%rbp), %rdi
callq 0x3610
nopw %cs:(%rax,%rax)
// File: vianna274[P]dropbox/src/User.cpp
// Function: Dropbox::User::createUserDir()
void User::createUserDir(){
    struct stat st;
	if(stat(dirPath.c_str(), &st) == -1) //Se não existe cria, se existe faz nada
		mkdir(dirPath.c_str(), 0777);
    DIR * dir;
    struct dirent *ent;
    struct stat filestatus;
    if ((dir = opendir (dirPath.c_str())) != NULL) {
        while ((ent = readdir (dir)) != NULL) {
            if(ent->d_type == 0x8) {
                stat((dirPath + ent->d_name).c_str(), &filestatus);
                FileRecord fileRecord = make_record(ent->d_name, filestatus.st_ctim.tv_sec, filestatus.st_atim.tv_sec, filestatus.st_mtim.tv_sec, filestatus.st_size);
				fileRecords.push_back(fileRecord);
            }
        }
        closedir(dir);
    } 
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x250, %rsp            # imm = 0x250
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rdi
movq %rdi, -0x248(%rbp)
addq $0x20, %rdi
callq 0x3180
movq %rax, %rdi
leaq -0x98(%rbp), %rsi
callq 0x3340
cmpl $-0x1, %eax
jne 0x16bc4
movq -0x248(%rbp), %rdi
addq $0x20, %rdi
callq 0x3180
movq %rax, %rdi
movl $0x1ff, %esi            # imm = 0x1FF
callq 0x31d0
movq -0x248(%rbp), %rdi
addq $0x20, %rdi
callq 0x3180
movq %rax, %rdi
callq 0x3520
movq %rax, -0xa0(%rbp)
cmpq $0x0, %rax
je 0x16cc7
jmp 0x16bef
movq -0xa0(%rbp), %rdi
callq 0x3540
movq %rax, -0xa8(%rbp)
cmpq $0x0, %rax
je 0x16cbb
movq -0xa8(%rbp), %rax
movzbl 0x12(%rax), %eax
cmpl $0x8, %eax
jne 0x16cb6
movq -0x248(%rbp), %rsi
addq $0x20, %rsi
movq -0xa8(%rbp), %rdx
addq $0x13, %rdx
leaq -0x158(%rbp), %rdi
callq 0xbb80
leaq -0x158(%rbp), %rdi
callq 0x3180
movq %rax, %rdi
leaq -0x138(%rbp), %rsi
callq 0x3340
leaq -0x158(%rbp), %rdi
callq 0x3280
movq -0xa8(%rbp), %rsi
addq $0x13, %rsi
movq -0xd0(%rbp), %rdx
movq -0xf0(%rbp), %rcx
movq -0xe0(%rbp), %r8
movq -0x108(%rbp), %rax
movl %eax, %r9d
leaq -0x240(%rbp), %rdi
callq 0x9730
movq -0x248(%rbp), %rdi
addq $0x40, %rdi
leaq -0x240(%rbp), %rsi
callq 0x71a0
jmp 0x16bef
movq -0xa0(%rbp), %rdi
callq 0x3580
addq $0x250, %rsp            # imm = 0x250
popq %rbp
retq
// File: vianna274[P]dropbox/src/User.cpp
// Function: Dropbox::User::closeDeviceSession(Dropbox::WrapperSocket*)
void User::closeDeviceSession(WrapperSocket *socket){
    for(auto it = this->devices.begin(); it != this->devices.end(); it++){
        if(*it == socket){
            this->devices.erase(it);
            break;
        }
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rdi
movq %rdi, -0x40(%rbp)
addq $0x58, %rdi
callq 0x12550
movq %rax, -0x18(%rbp)
movq -0x40(%rbp), %rdi
addq $0x58, %rdi
callq 0x12580
movq %rax, -0x20(%rbp)
leaq -0x18(%rbp), %rdi
leaq -0x20(%rbp), %rsi
callq 0x125b0
testb $0x1, %al
jne 0x17109
jmp 0x1715a
leaq -0x18(%rbp), %rdi
callq 0x125f0
movq (%rax), %rax
cmpq -0x10(%rbp), %rax
jne 0x17147
movq -0x40(%rbp), %rax
addq $0x58, %rax
movq %rax, -0x48(%rbp)
leaq -0x28(%rbp), %rdi
leaq -0x18(%rbp), %rsi
callq 0x171d0
movq -0x48(%rbp), %rdi
movq -0x28(%rbp), %rsi
callq 0x17160
movq %rax, -0x30(%rbp)
jmp 0x1715a
jmp 0x17149
leaq -0x18(%rbp), %rdi
xorl %esi, %esi
callq 0x17210
movq %rax, -0x38(%rbp)
jmp 0x170e5
addq $0x50, %rsp
popq %rbp
retq
// File: vianna274[P]dropbox/src/WrapperSocket.cpp
// Function: Dropbox::WrapperSocket::WrapperSocket(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, int)
WrapperSocket::WrapperSocket (string host, int port) {
  this->localSocketHandler = socket(AF_INET, SOCK_DGRAM, 0);
  this->lastData = NULL;
  if (this->localSocketHandler == ERROR) {
    fprintf(stderr, "Error on creating socket");
    exit(1);
  }
  this->socketSeq = 0;
  this->server = gethostbyname(host.c_str());
  this->remoteSocketAddr.sin_family = AF_INET;
  this->remoteSocketAddr.sin_port = htons(port);
  this->remoteSocketAddr.sin_addr = *((struct in_addr *)this->server->h_addr);
  bzero(&(this->remoteSocketAddr.sin_zero), 8);
  this->remoteSocketLen = sizeof(struct sockaddr_in);

  this->portInt = port;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rsi, -0x28(%rbp)
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl %edx, -0x14(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x20(%rbp)
movl $0x2, %esi
xorl %edx, %edx
movl %esi, %edi
callq 0x30e0
movl %eax, %ecx
movq -0x20(%rbp), %rax
movl %ecx, (%rax)
movq $0x0, 0x10(%rax)
cmpl $-0x1, (%rax)
jne 0x176f4
movq 0xb8f7(%rip), %rax      # 0x22fd0
movq (%rax), %rdi
leaq 0x1f29(%rip), %rsi      # 0x1960c
movb $0x0, %al
callq 0x34b0
movl $0x1, %edi
callq 0x3420
movq -0x20(%rbp), %rax
movq -0x28(%rbp), %rdi
movl $0x0, 0x8(%rax)
callq 0x3180
movq %rax, %rdi
callq 0x3400
movq %rax, %rcx
movq -0x20(%rbp), %rax
movq %rcx, 0x18(%rax)
movw $0x2, 0x20(%rax)
movl -0x14(%rbp), %eax
movzwl %ax, %edi
callq 0x3090
movq -0x20(%rbp), %rdi
movw %ax, 0x22(%rdi)
movq 0x18(%rdi), %rax
movq 0x18(%rax), %rax
movq (%rax), %rax
movl (%rax), %eax
movl %eax, 0x24(%rdi)
addq $0x20, %rdi
addq $0x8, %rdi
movl $0x8, %esi
callq 0x35f0
movq -0x20(%rbp), %rax
movl $0x10, 0x40(%rax)
movl -0x14(%rbp), %ecx
movl %ecx, 0x4(%rax)
addq $0x30, %rsp
popq %rbp
retq
nopl (%rax)
// File: vianna274[P]dropbox/src/WrapperSocket.cpp
// Function: Dropbox::WrapperSocket::WrapperSocket(int)
WrapperSocket::WrapperSocket (int port) {
  this->socketSeq = 0;
  this->lastData = NULL;
  this->localSocketHandler = socket(AF_INET, SOCK_DGRAM, 0);
  if (this->localSocketHandler == ERROR) {
    fprintf(stderr, "Error on creating socket");
    exit(1);
  }
  this->bindSocket(port);
  this->remoteSocketLen = sizeof(struct sockaddr_in);

  this->portInt = port;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x18(%rbp)
movl $0x0, 0x8(%rax)
movq $0x0, 0x10(%rax)
movl $0x2, %esi
xorl %edx, %edx
movl %esi, %edi
callq 0x30e0
movl %eax, %ecx
movq -0x18(%rbp), %rax
movl %ecx, (%rax)
cmpl $-0x1, (%rax)
jne 0x17803
movq 0xb7e8(%rip), %rax      # 0x22fd0
movq (%rax), %rdi
leaq 0x1e1a(%rip), %rsi      # 0x1960c
movb $0x0, %al
callq 0x34b0
movl $0x1, %edi
callq 0x3420
movq -0x18(%rbp), %rdi
movl -0xc(%rbp), %esi
callq 0x17830
movq -0x18(%rbp), %rax
movl $0x10, 0x40(%rax)
movl -0xc(%rbp), %ecx
movl %ecx, 0x4(%rax)
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: vianna274[P]dropbox/src/WrapperSocket.cpp
// Function: Dropbox::WrapperSocket::bindSocket(int)
void WrapperSocket::bindSocket(int port) {
  this->remoteSocketAddr.sin_family = AF_INET;
	this->remoteSocketAddr.sin_port = htons(port);
	this->remoteSocketAddr.sin_addr.s_addr = INADDR_ANY;
  bzero(&(this->remoteSocketAddr.sin_zero), 8);
  if (bind(this->localSocketHandler, (struct sockaddr *) &this->remoteSocketAddr, sizeof(struct sockaddr)) < 0) {
    fprintf(stderr, "Error on binding");
    exit(1);
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x18(%rbp)
movw $0x2, 0x20(%rax)
movl -0xc(%rbp), %eax
movzwl %ax, %edi
callq 0x3090
movq -0x18(%rbp), %rdi
movw %ax, 0x22(%rdi)
movl $0x0, 0x24(%rdi)
addq $0x20, %rdi
addq $0x8, %rdi
movl $0x8, %esi
callq 0x35f0
movq -0x18(%rbp), %rsi
movl (%rsi), %edi
addq $0x20, %rsi
movl $0x10, %edx
callq 0x30c0
cmpl $0x0, %eax
jge 0x178b4
movq 0xb737(%rip), %rax      # 0x22fd0
movq (%rax), %rdi
leaq 0x1dcc(%rip), %rsi      # 0x1966f
movb $0x0, %al
callq 0x34b0
movl $0x1, %edi
callq 0x3420
addq $0x20, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: vianna274[P]dropbox/src/WrapperSocket.cpp
// Function: Dropbox::WrapperSocket::waitAck(int, int)
bool WrapperSocket::waitAck(int seq, int wait) {
  bool acked = false;
  while(!acked) {
    MessageData *response = this->receive(TIMEOUT_ON, wait);
    if(!response) {
      return false;
    } 
    if(response->type == TYPE_ACK && response->seq == seq) { 
      return true;
    }
  }
  return false;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movl %esi, -0x14(%rbp)
movl %edx, -0x18(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x30(%rbp)
movb $0x0, -0x19(%rbp)
movb -0x19(%rbp), %al
xorb $-0x1, %al
testb $0x1, %al
jne 0x17b69
jmp 0x17ba8
movq -0x30(%rbp), %rdi
movl -0x18(%rbp), %edx
movl $0x1, %esi
callq 0x17bc0
movq %rax, -0x28(%rbp)
cmpq $0x0, -0x28(%rbp)
jne 0x17b8b
movb $0x0, -0x1(%rbp)
jmp 0x17bac
movq -0x28(%rbp), %rax
cmpl $0x1, (%rax)
jne 0x17ba6
movq -0x28(%rbp), %rax
movl 0x4(%rax), %eax
cmpl -0x14(%rbp), %eax
jne 0x17ba6
movb $0x1, -0x1(%rbp)
jmp 0x17bac
jmp 0x17b5e
movb $0x0, -0x1(%rbp)
movb -0x1(%rbp), %al
andb $0x1, %al
addq $0x30, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: vianna274[P]dropbox/src/WrapperSocket.cpp
// Function: Dropbox::WrapperSocket::waitAck(int)
bool WrapperSocket::waitAck(int seq) {
  bool acked = false;
  while(!acked) {
    MessageData *response = this->receive(TIMEOUT_ON);
    if(!response) {
      return false;
    } 
    if(response->type == TYPE_ACK && response->seq == seq) { 
      return true;
    }
  }
  return false;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movl %esi, -0x14(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x28(%rbp)
movb $0x0, -0x15(%rbp)
movb -0x15(%rbp), %al
xorb $-0x1, %al
testb $0x1, %al
jne 0x18036
jmp 0x18072
movq -0x28(%rbp), %rdi
movl $0x1, %esi
callq 0x18090
movq %rax, -0x20(%rbp)
cmpq $0x0, -0x20(%rbp)
jne 0x18055
movb $0x0, -0x1(%rbp)
jmp 0x18076
movq -0x20(%rbp), %rax
cmpl $0x1, (%rax)
jne 0x18070
movq -0x20(%rbp), %rax
movl 0x4(%rax), %eax
cmpl -0x14(%rbp), %eax
jne 0x18070
movb $0x1, -0x1(%rbp)
jmp 0x18076
jmp 0x1802b
movb $0x0, -0x1(%rbp)
movb -0x1(%rbp), %al
andb $0x1, %al
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: mdpkh[P]retro6k/src/main.cpp
// Function: SetHWPalette(SDL_Palette*)
int SetHWPalette(SDL_Palette* dstpal)
{
	SDL_Color d[256];
	for (int j = 0; j < 256; ++j)
	{
		d[j].a = 255;
		int i = ((j & 0x8) >> 2 | (j & 0x80) >> 7) * 0x11;
		d[j].r = ((j & 0x4) >> 1 | (j & 0x40) >> 6) * 0x44 | i;
		d[j].g = ((j & 0x2) | (j & 0x20) >> 5) * 0x44 | i;
		d[j].b = ((j & 0x1) << 1 | (j & 0x10) >> 4) * 0x44 | i;
	}
	return SDL_SetPaletteColors(dstpal, d, 0, 256);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x420, %rsp            # imm = 0x420
movq %rdi, -0x8(%rbp)
movl $0x0, -0x414(%rbp)
cmpl $0x100, -0x414(%rbp)    # imm = 0x100
jge 0x8b66
movslq -0x414(%rbp), %rax
movb $-0x1, -0x40d(%rbp,%rax,4)
movl -0x414(%rbp), %eax
andl $0x8, %eax
sarl $0x2, %eax
movl -0x414(%rbp), %ecx
andl $0x80, %ecx
sarl $0x7, %ecx
orl %ecx, %eax
imull $0x11, %eax, %eax
movl %eax, -0x418(%rbp)
movl -0x414(%rbp), %eax
andl $0x4, %eax
sarl %eax
movl -0x414(%rbp), %ecx
andl $0x40, %ecx
sarl $0x6, %ecx
orl %ecx, %eax
imull $0x44, %eax, %eax
orl -0x418(%rbp), %eax
movb %al, %cl
movslq -0x414(%rbp), %rax
movb %cl, -0x410(%rbp,%rax,4)
movl -0x414(%rbp), %eax
andl $0x2, %eax
movl -0x414(%rbp), %ecx
andl $0x20, %ecx
sarl $0x5, %ecx
orl %ecx, %eax
imull $0x44, %eax, %eax
orl -0x418(%rbp), %eax
movb %al, %cl
movslq -0x414(%rbp), %rax
movb %cl, -0x40f(%rbp,%rax,4)
movl -0x414(%rbp), %eax
andl $0x1, %eax
shll %eax
movl -0x414(%rbp), %ecx
andl $0x10, %ecx
sarl $0x4, %ecx
orl %ecx, %eax
imull $0x44, %eax, %eax
orl -0x418(%rbp), %eax
movb %al, %cl
movslq -0x414(%rbp), %rax
movb %cl, -0x40e(%rbp,%rax,4)
movl -0x414(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x414(%rbp)
jmp 0x8a79
movq -0x8(%rbp), %rdi
leaq -0x410(%rbp), %rsi
xorl %edx, %edx
movl $0x100, %ecx            # imm = 0x100
callq 0x7240
addq $0x420, %rsp            # imm = 0x420
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: mdpkh[P]retro6k/src/main.cpp
// Function: TextWidth(char const*)
int TextWidth(const char* text)
{
	int w = 0;
	while (*text)
	{
		w += hifont[(unsigned char)*text].w;
		++text;
	}
	return w;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x8(%rbp)
movl $0x0, -0xc(%rbp)
movq -0x8(%rbp), %rax
cmpb $0x0, (%rax)
je 0x8f06
movq -0x8(%rbp), %rax
movzbl (%rax), %eax
movl %eax, %ecx
leaq 0x180c8(%rip), %rax     # 0x20fb0
imulq $0x22, %rcx, %rcx
addq %rcx, %rax
movzbl (%rax), %eax
addl -0xc(%rbp), %eax
movl %eax, -0xc(%rbp)
movq -0x8(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x8(%rbp)
jmp 0x8ecf
movl -0xc(%rbp), %eax
popq %rbp
retq
nopl (%rax,%rax)
// File: mdpkh[P]retro6k/src/main.cpp
// Function: DrawLogo(int, int, SDL_Surface*)
void DrawLogo(int x0, int y0, SDL_Surface* destsurf) {
	char* sptr = (char*)aboutlogopixels;
	char* rptr = (char*)(destsurf->pixels) + y0 * (long long)destsurf->pitch + x0;
	for (int y = 0; y < 27; ++y)
	{
		char* dptr = rptr;
		for (int x = 0; x < 29; ++x)
		{
			*dptr++ = *sptr++;
		}
		rptr += destsurf->pitch;
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movl %edi, -0x4(%rbp)
movl %esi, -0x8(%rbp)
movq %rdx, -0x10(%rbp)
leaq 0x171eb(%rip), %rax     # 0x20340
movq %rax, -0x18(%rbp)
movq -0x10(%rbp), %rax
movq 0x20(%rax), %rax
movslq -0x8(%rbp), %rcx
movq -0x10(%rbp), %rdx
movslq 0x18(%rdx), %rdx
imulq %rdx, %rcx
addq %rcx, %rax
movslq -0x4(%rbp), %rcx
addq %rcx, %rax
movq %rax, -0x20(%rbp)
movl $0x0, -0x24(%rbp)
cmpl $0x1b, -0x24(%rbp)
jge 0x91ee
movq -0x20(%rbp), %rax
movq %rax, -0x30(%rbp)
movl $0x0, -0x34(%rbp)
cmpl $0x1d, -0x34(%rbp)
jge 0x91ce
movq -0x18(%rbp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, -0x18(%rbp)
movb (%rax), %cl
movq -0x30(%rbp), %rax
movq %rax, %rdx
addq $0x1, %rdx
movq %rdx, -0x30(%rbp)
movb %cl, (%rax)
movl -0x34(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x34(%rbp)
jmp 0x919b
movq -0x10(%rbp), %rax
movl 0x18(%rax), %ecx
movq -0x20(%rbp), %rax
movslq %ecx, %rcx
addq %rcx, %rax
movq %rax, -0x20(%rbp)
movl -0x24(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x24(%rbp)
jmp 0x9186
popq %rbp
retq
// File: mdpkh[P]retro6k/src/main.cpp
// Function: PickAndInsertCartridge()
void PickAndInsertCartridge()
{
	std::string cart;
	DoPickFile(filetype::FT_CART, cart);
	if (cart.empty())
		return;
	LoadCartridge(cart.c_str());
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
leaq -0x20(%rbp), %rdi
movq %rdi, -0x38(%rbp)
callq 0x75e0
movq -0x38(%rbp), %rsi
movl $0x1, %edi
callq 0xbb90
jmp 0xbb25
leaq -0x20(%rbp), %rdi
callq 0x76d0
testb $0x1, %al
jne 0xbb34
jmp 0xbb54
movl $0x1, -0x30(%rbp)
jmp 0xbb6e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
leaq -0x20(%rbp), %rdi
callq 0x72c0
jmp 0xbb7d
leaq -0x20(%rbp), %rdi
callq 0x71b0
movq %rax, %rdi
callq 0x15790
jmp 0xbb67
movl $0x0, -0x30(%rbp)
leaq -0x20(%rbp), %rdi
callq 0x72c0
addq $0x40, %rsp
popq %rbp
retq
movq -0x28(%rbp), %rdi
callq 0x7710
nopw %cs:(%rax,%rax)
// File: mdpkh[P]retro6k/src/main.cpp
// Function: ExtendLog(dletype)
dlogentry* ExtendLog(dletype etype)
{
	if (debuglogend == debuglogstart)
	{
		++debuglogstart;
		debuglogstart &= dlogidxmask;
	}
	debuglog[debuglogstart].entrytype = dletype::LT_START;
	debuglog[debuglogend].entrytype = etype;
	dlogentry* newentry = debuglog + debuglogend;
	++debuglogend;
	debuglogend &= dlogidxmask;
	return newentry;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movb %dil, %al
movb %al, -0x1(%rbp)
movl 0x1f020(%rip), %eax     # 0x2c400
cmpl 0x82054a(%rip), %eax    # 0x82d930
jne 0xd408
movl 0x820542(%rip), %eax    # 0x82d930
addl $0x1, %eax
movl %eax, 0x820539(%rip)    # 0x82d930
movl 0x820533(%rip), %eax    # 0x82d930
andl $0x7ffff, %eax          # imm = 0x7FFFF
movl %eax, 0x820528(%rip)    # 0x82d930
movslq 0x820521(%rip), %rcx    # 0x82d930
leaq 0x2051a(%rip), %rax     # 0x2d930
shlq $0x4, %rcx
addq %rcx, %rax
movb $0x0, (%rax)
movb -0x1(%rbp), %cl
movslq 0x1efd6(%rip), %rdx     # 0x2c400
leaq 0x204ff(%rip), %rax     # 0x2d930
shlq $0x4, %rdx
addq %rdx, %rax
movb %cl, (%rax)
movslq 0x1efbf(%rip), %rcx     # 0x2c400
leaq 0x204e8(%rip), %rax     # 0x2d930
shlq $0x4, %rcx
addq %rcx, %rax
movq %rax, -0x10(%rbp)
movl 0x1efa7(%rip), %eax     # 0x2c400
addl $0x1, %eax
movl %eax, 0x1ef9e(%rip)     # 0x2c400
movl 0x1ef98(%rip), %eax     # 0x2c400
andl $0x7ffff, %eax          # imm = 0x7FFFF
movl %eax, 0x1ef8d(%rip)     # 0x2c400
movq -0x10(%rbp), %rax
popq %rbp
retq
nopl (%rax)
// File: mdpkh[P]retro6k/src/main.cpp
// Function: InitEmulator()
int InitEmulator()
{
	for (int y = 0; y < 18; ++y)
		for (int x = 0; x < 32; ++x)
		{
			PaintCell(x, y);
		}
	debuglog[debuglogstart].entrytype = dletype::LT_START;
	hookexternal((void*)LogStep);
	keypressregister = 0;
	{
		unsigned int uebase = SDL_RegisterEvents(1);
		UE_RESETCPU = uebase;
	}
	{
		SDL_Event newevent;
		newevent.type = UE_RESETCPU;
		SDL_PushEvent(&newevent);
	}
	soundfreqregister[0] = 0;
	soundfreqregister[1] = 0;
	soundfreqregister[2] = 0;
	soundfreqregister[3] = 0;
	soundvolregister[0] = 0x00;
	soundvolregister[1] = 0x00;
	soundvolregister[2] = 0x00;
	soundvolregister[3] = 0x00;
	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movl $0x0, -0x4(%rbp)
cmpl $0x12, -0x4(%rbp)
jge 0xe0fd
movl $0x0, -0x8(%rbp)
cmpl $0x20, -0x8(%rbp)
jge 0xe0f0
movl -0x8(%rbp), %eax
movb %al, %cl
movl -0x4(%rbp), %eax
movzbl %cl, %edi
movzbl %al, %esi
callq 0x14040
movl -0x8(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x8(%rbp)
jmp 0xe0cc
jmp 0xe0f2
movl -0x4(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x4(%rbp)
jmp 0xe0bf
movslq 0x81f82c(%rip), %rcx    # 0x82d930
leaq 0x1f825(%rip), %rax     # 0x2d930
shlq $0x4, %rcx
addq %rcx, %rax
movb $0x0, (%rax)
leaq 0x84(%rip), %rdi        # 0xe1a0
callq 0x1cd60
movb $0x0, 0x1f69c(%rip)     # 0x2d7c4
movl $0x1, %edi
callq 0x7450
movl %eax, -0xc(%rbp)
movl -0xc(%rbp), %eax
movl %eax, 0x8232e6(%rip)    # 0x831424
movl 0x8232e0(%rip), %eax    # 0x831424
movl %eax, -0x48(%rbp)
leaq -0x48(%rbp), %rdi
callq 0x7700
movw $0x0, 0x1f66d(%rip)     # 0x2d7c6
movw $0x0, 0x1f666(%rip)     # 0x2d7c8
movw $0x0, 0x1f65f(%rip)     # 0x2d7ca
movw $0x0, 0x1f658(%rip)     # 0x2d7cc
movb $0x0, 0x1f653(%rip)     # 0x2d7ce
movb $0x0, 0x1f64d(%rip)     # 0x2d7cf
movb $0x0, 0x1f647(%rip)     # 0x2d7d0
movb $0x0, 0x1f641(%rip)     # 0x2d7d1
xorl %eax, %eax
addq $0x50, %rsp
popq %rbp
retq
nopl (%rax,%rax)