LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O3/vianna274[P]dropbox/src/Server.cpp
// Function: Dropbox::Server::removeFromBackup(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>>>>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
void Server::removeFromBackup(vector<string> backups, string main) {
    vector<string>::iterator it = backups.begin();
    vector<string> newBackups;
    for(it; it != backups.end(); it++) {
        if (main.compare(*it) == 0) {
            // it = backups.erase(it);
        } else {
            newBackups.push_back(*it);
        }
    }
    this->backups.clear();
    for(string backup: newBackups) {
        this->backups.push_back(backup);
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %rdi, %rbx
movq (%rsi), %r12
xorps %xmm0, %xmm0
movaps %xmm0, -0x40(%rbp)
movq $0x0, -0x30(%rbp)
cmpq 0x8(%rsi), %r12
je 0xa016
movq %rdx, %r14
movq %rsi, %r15
leaq -0x40(%rbp), %r13
movq %r14, %rdi
movq %r12, %rsi
callq 0x3050
testl %eax, %eax
je 0xa00c
movq %r13, %rdi
movq %r12, %rsi
callq 0xd23e
addq $0x20, %r12
cmpq 0x8(%r15), %r12
jne 0x9ff2
addq $0x970, %rbx            # imm = 0x970
movq %rbx, %rdi
callq 0xd28a
movq -0x40(%rbp), %r15
movq -0x38(%rbp), %r13
cmpq %r13, %r15
je 0xa072
leaq -0x50(%rbp), %r12
leaq -0x60(%rbp), %r14
movq %r12, -0x60(%rbp)
movq (%r15), %rsi
movq 0x8(%r15), %rdx
addq %rsi, %rdx
movq %r14, %rdi
callq 0x6270
movq %rbx, %rdi
movq %r14, %rsi
callq 0xd23e
movq -0x60(%rbp), %rdi
cmpq %r12, %rdi
je 0xa069
callq 0x3320
addq $0x20, %r15
cmpq %r13, %r15
jne 0xa03a
leaq -0x40(%rbp), %rdi
callq 0xcf3c
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0xa09f
movq %rax, %rbx
movq -0x60(%rbp), %rdi
cmpq %r12, %rdi
je 0xa0a2
callq 0x3320
jmp 0xa0a2
movq %rax, %rbx
leaq -0x40(%rbp), %rdi
callq 0xcf3c
movq %rbx, %rdi
callq 0x3580
nop
// File: /workspace/github_cpp_makefile_star2_O3/vianna274[P]dropbox/src/Server.cpp
// Function: Dropbox::Server::propagateNewBoss()
void Server::propagateNewBoss() {
    for (string ip : this->usersIp) {
        WrapperSocket userSocket(ip, 10000);
        MessageData packet = make_packet(TYPE_NEW_BOSS, 1, 1, -1, this->ipLocal.c_str());
        userSocket.send(&packet);
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x1068, %rsp           # imm = 0x1068
movq 0x988(%rdi), %r14
movq 0x990(%rdi), %rax
movq %rax, -0x50(%rbp)
cmpq %rax, %r14
je 0xa2c1
movq %rdi, %rbx
leaq -0xb8(%rbp), %r12
leaq -0x108c(%rbp), %r13
leaq -0x38(%rbp), %rax
movq %rax, -0x48(%rbp)
movq (%r14), %rsi
movq 0x8(%r14), %rdx
addq %rsi, %rdx
leaq -0x48(%rbp), %rdi
callq 0x6270
leaq -0x60(%rbp), %rax
movq %rax, -0x70(%rbp)
movq -0x48(%rbp), %rsi
movq -0x40(%rbp), %rdx
addq %rsi, %rdx
leaq -0x70(%rbp), %r15
movq %r15, %rdi
callq 0x6270
movq %r12, %rdi
movq %r15, %rsi
movl $0x2710, %edx           # imm = 0x2710
callq 0xe60a
movq -0x70(%rbp), %rdi
leaq -0x60(%rbp), %rax
cmpq %rax, %rdi
je 0xa26a
callq 0x3320
movq 0x9b8(%rbx), %r9
movq %r13, %rdi
movl $0x13, %esi
movl $0x1, %edx
movl $0x1, %ecx
movl $0xffffffff, %r8d       # imm = 0xFFFFFFFF
callq 0x65b0
movq %r12, %rdi
movq %r13, %rsi
callq 0xea3c
movq %r12, %rdi
callq 0xe69a
movq -0x48(%rbp), %rdi
leaq -0x38(%rbp), %rax
cmpq %rax, %rdi
je 0xa2b3
callq 0x3320
addq $0x20, %r14
cmpq -0x50(%rbp), %r14
jne 0xa20e
addq $0x1068, %rsp           # imm = 0x1068
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
jmp 0xa2fe
movq %rax, %rbx
movq -0x70(%rbp), %rdi
leaq -0x60(%rbp), %rax
cmpq %rax, %rdi
je 0xa2fe
callq 0x3320
jmp 0xa2fe
movq %rax, %rbx
leaq -0xb8(%rbp), %rdi
callq 0xe69a
movq -0x48(%rbp), %rdi
leaq -0x38(%rbp), %rax
cmpq %rax, %rdi
je 0xa310
callq 0x3320
movq %rbx, %rdi
callq 0x3580
// File: /workspace/github_cpp_makefile_star2_O3/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
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x1078, %rsp           # imm = 0x1078
movq %rdi, %rbx
addq $0x98, %rdi
movq %rdi, -0x50(%rbp)
callq 0x3470
testl %eax, %eax
jne 0xa53b
movq 0x970(%rbx), %r15
movq 0x978(%rbx), %rax
movq %rax, -0x58(%rbp)
cmpq %rax, %r15
je 0xa4ef
leaq -0xc0(%rbp), %r13
leaq -0x1094(%rbp), %r14
leaq -0x38(%rbp), %rax
movq %rax, -0x48(%rbp)
movq (%r15), %rsi
movq 0x8(%r15), %rdx
addq %rsi, %rdx
leaq -0x48(%rbp), %rdi
callq 0x6270
leaq -0x68(%rbp), %rax
movq %rax, -0x78(%rbp)
movq -0x48(%rbp), %rsi
movq -0x40(%rbp), %rdx
addq %rsi, %rdx
leaq -0x78(%rbp), %r12
movq %r12, %rdi
callq 0x6270
movq %r13, %rdi
movq %r12, %rsi
movl $0x2328, %edx           # imm = 0x2328
callq 0xe60a
movq -0x78(%rbp), %rdi
leaq -0x68(%rbp), %rax
cmpq %rax, %rdi
je 0xa492
callq 0x3320
movl 0x9c0(%rbx), %r8d
movq 0x9b8(%rbx), %r9
movq %r14, %rdi
movl $0x15, %esi
movl $0x1, %edx
movl $0x1, %ecx
callq 0x65b0
movq %r13, %rdi
movq %r14, %rsi
movl $0x64, %edx
callq 0xe752
movq %r13, %rdi
callq 0xe69a
movq -0x48(%rbp), %rdi
leaq -0x38(%rbp), %rax
cmpq %rax, %rdi
je 0xa4e1
callq 0x3320
addq $0x20, %r15
cmpq -0x58(%rbp), %r15
jne 0xa436
movq -0x50(%rbp), %rdi
callq 0x3280
movb $0x1, 0x9f8(%rbx)
leaq 0x20(%rbx), %r14
movq %r14, %rdi
callq 0x3470
testl %eax, %eax
jne 0xa53b
movl $0x1a, 0x180(%rbx)
movq %r14, %rdi
callq 0x3280
movq %rbx, %rdi
callq 0xa1ce
addq $0x1078, %rsp           # imm = 0x1078
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl %eax, %edi
callq 0x3250
movq %rax, %rbx
jmp 0xa56d
movq %rax, %rbx
movq -0x78(%rbp), %rdi
leaq -0x68(%rbp), %rax
cmpq %rax, %rdi
je 0xa56d
callq 0x3320
jmp 0xa56d
movq %rax, %rbx
leaq -0xc0(%rbp), %rdi
callq 0xe69a
movq -0x48(%rbp), %rdi
leaq -0x38(%rbp), %rax
cmpq %rax, %rdi
je 0xa57f
callq 0x3320
movq %rbx, %rdi
callq 0x3580
nop
// File: /workspace/github_cpp_makefile_star2_O3/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
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x68, %rsp
movq %rsi, %r14
xorps %xmm0, %xmm0
movups %xmm0, (%rdi)
movq %rdi, -0x30(%rbp)
movq $0x0, 0x10(%rdi)
leaq 0x98(%rsi), %r15
movq %r15, %rdi
callq 0x3470
testl %eax, %eax
jne 0xa6b2
leaq 0x970(%r14), %rsi
leaq -0x50(%rbp), %rdi
callq 0xd1b0
leaq -0x80(%rbp), %rbx
movq %rbx, -0x10(%rbx)
movq 0x9d8(%r14), %rsi
movq 0x9e0(%r14), %rdx
addq %rsi, %rdx
leaq -0x90(%rbp), %rdi
callq 0x6270
leaq -0x50(%rbp), %rsi
leaq -0x90(%rbp), %rdx
movq %r14, %rdi
callq 0x9fbc
movq %r15, -0x38(%rbp)
movq -0x90(%rbp), %rdi
cmpq %rbx, %rdi
je 0xa622
callq 0x3320
leaq -0x50(%rbp), %rdi
callq 0xcf3c
movq 0x970(%r14), %r13
movq 0x978(%r14), %rbx
cmpq %rbx, %r13
je 0xa696
leaq -0x60(%rbp), %r15
addq $0x9b8, %r14            # imm = 0x9B8
leaq -0x70(%rbp), %r12
movq %r15, -0x70(%rbp)
movq (%r13), %rsi
movq 0x8(%r13), %rdx
addq %rsi, %rdx
movq %r12, %rdi
callq 0x6270
movq %r12, %rdi
movq %r14, %rsi
callq 0x3050
testl %eax, %eax
jle 0xa67f
movq -0x30(%rbp), %rdi
movq %r12, %rsi
callq 0xd23e
movq -0x70(%rbp), %rdi
cmpq %r15, %rdi
je 0xa68d
callq 0x3320
addq $0x20, %r13
cmpq %rbx, %r13
jne 0xa64d
movq -0x38(%rbp), %rdi
callq 0x3280
movq -0x30(%rbp), %rax
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl %eax, %edi
callq 0x3250
movq %rax, %r14
movq -0x90(%rbp), %rdi
cmpq %rbx, %rdi
je 0xa6d2
callq 0x3320
jmp 0xa6d2
movq %rax, %r14
leaq -0x50(%rbp), %rdi
callq 0xcf3c
jmp 0xa6f5
jmp 0xa6f2
movq %rax, %r14
movq -0x70(%rbp), %rdi
cmpq %r15, %rdi
je 0xa6f5
callq 0x3320
jmp 0xa6f5
movq %rax, %r14
movq -0x30(%rbp), %rdi
callq 0xcf3c
movq %r14, %rdi
callq 0x3580
movq %rax, %rdi
callq 0xd403
// File: /workspace/github_cpp_makefile_star2_O3/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
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x1068, %rsp           # imm = 0x1068
movq (%rsi), %r14
movq 0x8(%rsi), %rax
movq %rax, -0x50(%rbp)
cmpq %rax, %r14
je 0xa7fb
movq %rdi, %rbx
leaq -0xb8(%rbp), %r12
leaq -0x108c(%rbp), %r13
leaq -0x38(%rbp), %rax
movq %rax, -0x48(%rbp)
movq (%r14), %rsi
movq 0x8(%r14), %rdx
addq %rsi, %rdx
leaq -0x48(%rbp), %rdi
callq 0x6270
leaq -0x60(%rbp), %rax
movq %rax, -0x70(%rbp)
movq -0x48(%rbp), %rsi
movq -0x40(%rbp), %rdx
addq %rsi, %rdx
leaq -0x70(%rbp), %r15
movq %r15, %rdi
callq 0x6270
movq %r12, %rdi
movq %r15, %rsi
movl $0x2328, %edx           # imm = 0x2328
callq 0xe60a
movq -0x70(%rbp), %rdi
leaq -0x60(%rbp), %rax
cmpq %rax, %rdi
je 0xa7a3
callq 0x3320
movl 0x9c0(%rbx), %r8d
movq 0x9b8(%rbx), %r9
movq %r13, %rdi
movl $0x14, %esi
movl $0x1, %edx
movl $0x1, %ecx
callq 0x65b0
movq %r12, %rdi
movq %r13, %rsi
callq 0xea3c
movq %r12, %rdi
callq 0xe69a
movq -0x48(%rbp), %rdi
leaq -0x38(%rbp), %rax
cmpq %rax, %rdi
je 0xa7ed
callq 0x3320
addq $0x20, %r14
cmpq -0x50(%rbp), %r14
jne 0xa747
addq $0x1068, %rsp           # imm = 0x1068
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
jmp 0xa838
movq %rax, %rbx
movq -0x70(%rbp), %rdi
leaq -0x60(%rbp), %rax
cmpq %rax, %rdi
je 0xa838
callq 0x3320
jmp 0xa838
movq %rax, %rbx
leaq -0xb8(%rbp), %rdi
callq 0xe69a
movq -0x48(%rbp), %rdi
leaq -0x38(%rbp), %rax
cmpq %rax, %rdi
je 0xa84a
callq 0x3320
movq %rbx, %rdi
callq 0x3580
// File: /workspace/github_cpp_makefile_star2_O3/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
pushq %r15
pushq %r14
pushq %rbx
subq $0x18, %rsp
movq %rsi, %r14
movq %rdi, %rbx
leaq 0x20(%rdi), %r15
movq %r15, %rdi
callq 0x3470
testl %eax, %eax
jne 0xa8e6
movl $0x19, 0x180(%rbx)
movq %r15, %rdi
callq 0x3280
leaq -0x30(%rbp), %r15
movq %r15, %rdi
movq %r14, %rsi
callq 0xd1b0
movq %rbx, %rdi
movq %r15, %rsi
callq 0xa70e
leaq -0x30(%rbp), %rdi
callq 0xcf3c
movq %rbx, %rdi
callq 0xa902
testb %al, %al
je 0xa8d3
movq %rbx, %rdi
callq 0xa9a0
testb %al, %al
jne 0xa8db
cmpl $0x1b, 0x180(%rbx)
je 0xa8db
movq %rbx, %rdi
callq 0xa3de
movq %rbx, %rdi
callq 0xa3de
addq $0x18, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movl %eax, %edi
callq 0x3250
movq %rax, %rbx
leaq -0x30(%rbp), %rdi
callq 0xcf3c
movq %rbx, %rdi
callq 0x3580
nop
// File: /workspace/github_cpp_makefile_star2_O3/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
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
leaq 0x130(%rdi), %r14
movq 0xa6af(%rip), %r15      # 0x14fd0
movq %r14, %rdi
movl $0x1, %esi
movl $0x5dc, %edx            # imm = 0x5DC
callq 0xe934
movq %rax, %r12
testq %rax, %rax
je 0xa98a
movl (%r12), %esi
movq %r15, %rdi
callq 0x3540
movq %rax, %r13
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r13, %rdi
movl $0xa, %esi
callq 0x3330
movsbl %al, %esi
movq %r13, %rdi
callq 0x3040
movq %rax, %rdi
callq 0x3260
movl (%r12), %eax
cmpl $0x16, %eax
je 0xa98a
cmpl $0x15, %eax
jne 0xa921
movq %rbx, %rdi
movq %r12, %rsi
callq 0xac00
testq %r12, %r12
setne %al
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/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
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
leaq 0x130(%rdi), %r14
movq %r14, %rdi
movl $0x1, %esi
movl $0x5dc, %edx            # imm = 0x5DC
callq 0xe934
movq %rax, %r15
testq %rax, %rax
je 0xa9df
cmpl $0x15, (%r15)
jne 0xa9b4
movq %rbx, %rdi
movq %r15, %rsi
callq 0xac00
testq %r15, %r15
setne %al
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/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
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x1028, %rsp           # imm = 0x1028
movq %rsi, -0x38(%rbp)
movq %rdi, -0x40(%rbp)
callq 0xab96
movl %eax, %r15d
movl %eax, %r12d
negl %r12d
cmovsl %eax, %r12d
movl $0x1, %r13d
cmpl $0xa, %r12d
jb 0xaa74
movl $0x4, %r13d
movl $0xd1b71759, %eax       # imm = 0xD1B71759
movl %r12d, %ecx
cmpl $0x63, %ecx
jbe 0xaa6b
cmpl $0x3e7, %ecx            # imm = 0x3E7
jbe 0xaa71
cmpl $0x2710, %ecx           # imm = 0x2710
jb 0xaa74
movl %ecx, %edx
imulq %rax, %rdx
shrq $0x2d, %rdx
addl $0x4, %r13d
cmpl $0x1869f, %ecx          # imm = 0x1869F
movl %edx, %ecx
ja 0xaa38
addl $-0x3, %r13d
jmp 0xaa74
addl $-0x2, %r13d
jmp 0xaa74
decl %r13d
movl %r15d, %r14d
shrl $0x1f, %r14d
leal (%r14,%r13), %esi
leaq -0x50(%rbp), %rax
movq %rax, -0x10(%rax)
leaq -0x60(%rbp), %rbx
movq %rbx, %rdi
movl $0x2d, %edx
callq 0x33b0
addq (%rbx), %r14
movq %r14, %rdi
movl %r13d, %esi
movl %r12d, %edx
callq 0x61fe
movq (%rbx), %r9
leaq -0x1044(%rbp), %rdi
movl $0x2, %esi
movl $0x1, %edx
movl $0x1, %ecx
movl $0xffffffff, %r8d       # imm = 0xFFFFFFFF
callq 0x65b0
movq -0x60(%rbp), %rdi
leaq -0x50(%rbp), %rax
cmpq %rax, %rdi
je 0xaadf
callq 0x3320
movl $0x48, %edi
callq 0x3340
movq %rax, %r12
movq %rax, %rdi
movl %r15d, %esi
callq 0xe6b0
leaq -0x70(%rbp), %rbx
movq %r12, (%rbx)
leaq -0x1044(%rbp), %rsi
movq -0x38(%rbp), %rdi
callq 0xea3c
leaq -0x1e1d(%rip), %rax     # 0x8cf8
leaq -0x60(%rbp), %rsi
movq %rax, (%rsi)
movq $0x0, 0x8(%rsi)
leaq -0x68(%rbp), %rdx
movq -0x40(%rbp), %rax
movq %rax, (%rdx)
leaq -0x30(%rbp), %r14
movq %r14, %rdi
movq %rbx, %rcx
callq 0xd2d0
movq %r14, %rdi
callq 0x3570
cmpq $0x0, -0x30(%rbp)
jne 0xab6b
addq $0x1028, %rsp           # imm = 0x1028
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
cmpq $0x0, -0x30(%rbp)
jne 0xab6b
movq %rax, %rbx
jmp 0xab8d
callq 0x30e0
movq %rax, %rbx
movq %r12, %rdi
jmp 0xab88
movq %rax, %rbx
movq -0x60(%rbp), %rdi
leaq -0x50(%rbp), %rax
cmpq %rax, %rdi
je 0xab8d
callq 0x3320
movq %rbx, %rdi
callq 0x3580
nop
// File: /workspace/github_cpp_makefile_star2_O3/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
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %r14
leaq 0x70(%rdi), %rbx
movq %rbx, %rdi
callq 0x3470
testl %eax, %eax
jne 0xabf9
xorl %eax, %eax
cmpb $0x0, 0x184(%r14,%rax)
jne 0xabd3
incq %rax
cmpq $0x7d0, %rax            # imm = 0x7D0
jne 0xabb5
movl $0xffffffff, %r15d      # imm = 0xFFFFFFFF
jmp 0xabe3
leal 0xfa1(%rax), %r15d
movb $0x0, 0x184(%r14,%rax)
movq %rbx, %rdi
callq 0x3280
movl %r15d, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movl %eax, %edi
callq 0x3250
// File: /workspace/github_cpp_makefile_star2_O3/vianna274[P]dropbox/src/Server.cpp
// Function: Dropbox::Server::handleReceiveCoordinator(Dropbox::_MessageData*)
void Server::handleReceiveCoordinator(MessageData * res) {
    this->electionMutex.lock();
    this->status = STATUS_NOT_YET;
    this->electionMutex.unlock();
    backupList.lock();
    removeFromBackup(this->backups, this->ipMain);
    backupList.unlock();
    this->ipMain = string(res->payload);
    talkToPrimaryMtx.lock();
    this->talkToPrimary = new WrapperSocket(ipMain, 9000);
    synchronize();
    talkToPrimaryMtx.unlock();
    this->makeConnection();
    this->electionMutex.lock();
    this->status = STATUS_NORMAL;
    this->electionMutex.unlock();
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x88, %rsp
movq %rsi, %r15
movq %rdi, %r14
leaq 0x20(%rdi), %rbx
movq %rbx, %rdi
callq 0x3470
testl %eax, %eax
jne 0xadcc
movl $0x1b, 0x180(%r14)
movq %rbx, -0x30(%rbp)
movq %rbx, %rdi
callq 0x3280
leaq 0x98(%r14), %r12
movq %r12, %rdi
callq 0x3470
testl %eax, %eax
jne 0xadcc
leaq 0x970(%r14), %rsi
leaq -0x48(%rbp), %rdi
callq 0xd1b0
leaq -0x78(%rbp), %rbx
movq %rbx, -0x10(%rbx)
movq 0x9d8(%r14), %rsi
movq 0x9e0(%r14), %rdx
addq %rsi, %rdx
leaq -0x88(%rbp), %rdi
callq 0x6270
leaq -0x48(%rbp), %rsi
leaq -0x88(%rbp), %rdx
movq %r14, %rdi
callq 0x9fbc
leaq 0x9d8(%r14), %r13
movq -0x88(%rbp), %rdi
cmpq %rbx, %rdi
je 0xacbc
callq 0x3320
leaq -0x48(%rbp), %rdi
callq 0xcf3c
movq %r12, %rdi
callq 0x3280
leaq 0x14(%r15), %r12
leaq -0x98(%rbp), %rbx
movq %rbx, -0x10(%rbx)
movq %r12, %rdi
callq 0x3170
leaq (%r15,%rax), %rdx
addq $0x14, %rdx
leaq -0xa8(%rbp), %r15
movq %r15, %rdi
movq %r12, %rsi
callq 0x630e
movq %r13, %rdi
movq %r15, %rsi
callq 0x33d0
movq (%r15), %rdi
cmpq %rbx, %rdi
je 0xad16
callq 0x3320
leaq 0xc0(%r14), %r15
movq %r15, %rdi
callq 0x3470
testl %eax, %eax
jne 0xadcc
movl $0x48, %edi
callq 0x3340
movq %rax, %r12
leaq -0x58(%rbp), %rbx
movq %rbx, -0x10(%rbx)
movq 0x9d8(%r14), %rsi
movq 0x9e0(%r14), %rdx
addq %rsi, %rdx
leaq -0x68(%rbp), %rdi
callq 0x6270
leaq -0x68(%rbp), %rsi
movq %r12, %rdi
movl $0x2328, %edx           # imm = 0x2328
callq 0xe60a
movq %r12, 0x178(%r14)
movq -0x68(%rbp), %rdi
cmpq %rbx, %rdi
je 0xad82
callq 0x3320
callq 0xae1d
movq %r15, %rdi
callq 0x3280
movq %r14, %rdi
callq 0x99aa
movq -0x30(%rbp), %rbx
movq %rbx, %rdi
callq 0x3470
testl %eax, %eax
jne 0xadcc
movl $0x18, 0x180(%r14)
movq %rbx, %rdi
callq 0x3280
addq $0x88, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl %eax, %edi
callq 0x3250
movq %rax, %r14
movq -0x68(%rbp), %rdi
cmpq %rbx, %rdi
je 0xade9
callq 0x3320
jmp 0xade9
movq %rax, %r14
movq %r12, %rdi
callq 0x3320
jmp 0xae15
movq %rax, %r14
movq -0x88(%rbp), %rdi
cmpq %rbx, %rdi
je 0xae0c
callq 0x3320
jmp 0xae0c
movq %rax, %r14
leaq -0x48(%rbp), %rdi
callq 0xcf3c
movq %r14, %rdi
callq 0x3580
// File: /workspace/github_cpp_makefile_star2_O3/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
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rsi, -0x30(%rbp)
movq 0x958(%rdi), %rax
cmpq %rax, 0x960(%rdi)
je 0xaf0a
movq %rdi, %r14
movl $0x1, %ebx
xorl %r12d, %r12d
movq (%rax,%r12,8), %rsi
leaq -0x50(%rbp), %rdi
callq 0xe50a
movq -0x48(%rbp), %rdx
movq -0x30(%rbp), %rax
cmpq 0x8(%rax), %rdx
jne 0xaec9
movq -0x50(%rbp), %r13
testq %rdx, %rdx
je 0xaed2
movq -0x30(%rbp), %rax
movq (%rax), %rsi
movq %r13, %rdi
callq 0x3350
testl %eax, %eax
sete %r15b
jmp 0xaed5
movq -0x50(%rbp), %r13
xorl %r15d, %r15d
jmp 0xaed5
movb $0x1, %r15b
leaq -0x40(%rbp), %rax
cmpq %rax, %r13
je 0xaee6
movq %r13, %rdi
callq 0x3320
testb %r15b, %r15b
jne 0xaf0e
movl %ebx, %r12d
movq 0x958(%r14), %rax
movq 0x960(%r14), %rcx
subq %rax, %rcx
sarq $0x3, %rcx
incl %ebx
cmpq %r12, %rcx
ja 0xae8e
xorl %eax, %eax
jmp 0xaf19
movq 0x958(%r14), %rax
movq (%rax,%r12,8), %rax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/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
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0xfe0, %rsp            # imm = 0xFE0
movq %rdx, %r12
movq %rsi, %r15
movq %rdi, %r14
leaq 0x48(%rdi), %rbx
movq %rbx, %rdi
callq 0x3470
testl %eax, %eax
jne 0xb26b
movq (%r12), %r9
movq (%r15), %rax
movq %rax, (%rsp)
leaq -0xff4(%rbp), %rdi
movl $0x12, %esi
movl $0x1, %edx
movl $0x1, %ecx
movl $0xffffffff, %r8d       # imm = 0xFFFFFFFF
callq 0x6607
movq 0x9a0(%r14), %r15
movq 0x9a8(%r14), %r12
cmpq %r12, %r15
je 0xb253
leaq -0xff4(%rbp), %r14
movq (%r15), %rdi
movq %r14, %rsi
callq 0xea3c
addq $0x8, %r15
cmpq %r12, %r15
jne 0xb23f
movq %rbx, %rdi
callq 0x3280
addq $0xfe0, %rsp            # imm = 0xFE0
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movl %eax, %edi
callq 0x3250
// File: /workspace/github_cpp_makefile_star2_O3/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
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xb8, %rsp
movq %rdx, %rbx
movq %rsi, %r15
movq %rdi, %r12
leaq 0x48(%rdi), %r13
movq %r13, %rdi
callq 0x3470
testl %eax, %eax
jne 0xbfbc
leaq -0xa8(%rbp), %rax
movq %rax, -0x10(%rax)
movq (%rbx), %rsi
movq %rbx, -0x58(%rbp)
movq 0x8(%rbx), %rdx
addq %rsi, %rdx
leaq -0xb8(%rbp), %r14
movq %r14, %rdi
callq 0x6270
movq %r12, -0x38(%rbp)
movq %r12, %rdi
movq %r14, %rsi
callq 0xae5a
movq %rax, -0x50(%rbp)
movq %r13, -0x40(%rbp)
movq -0xb8(%rbp), %rdi
leaq -0xa8(%rbp), %rax
cmpq %rax, %rdi
je 0xbeae
callq 0x3320
movq -0x38(%rbp), %rax
movq 0x9a0(%rax), %r12
movq 0x9a8(%rax), %rax
movq %rax, -0x48(%rbp)
cmpq %rax, %r12
je 0xbfa1
leaq -0xc8(%rbp), %r14
movq %r14, %r13
movq (%r12), %r14
movq (%r15), %rsi
leaq -0x98(%rbp), %rdi
leaq -0x29(%rbp), %rdx
callq 0x3150
leaq -0x68(%rbp), %rax
movq %rax, -0x78(%rbp)
movq -0x58(%rbp), %rax
movq (%rax), %rsi
movq 0x8(%rax), %rdx
addq %rsi, %rdx
leaq -0x78(%rbp), %rbx
movq %rbx, %rdi
callq 0x6270
movq -0x38(%rbp), %rdi
movq %r14, %rsi
leaq -0x98(%rbp), %rdx
movq %rbx, %rcx
callq 0x7e8c
movq -0x78(%rbp), %rdi
leaq -0x68(%rbp), %rax
cmpq %rax, %rdi
je 0xbf38
callq 0x3320
movq -0x98(%rbp), %rdi
leaq -0x88(%rbp), %rax
cmpq %rax, %rdi
je 0xbf50
callq 0x3320
movq %r13, %r14
movq %r13, -0xd8(%rbp)
movq (%r15), %rsi
movq 0x8(%r15), %rdx
addq %rsi, %rdx
leaq -0xd8(%rbp), %rbx
movq %rbx, %rdi
callq 0x6270
movq -0x50(%rbp), %rdi
movq %rbx, %rsi
callq 0xe2fe
movq -0xd8(%rbp), %rdi
cmpq %r14, %rdi
je 0xbf93
callq 0x3320
movq %r13, %r14
addq $0x8, %r12
cmpq -0x48(%rbp), %r12
jne 0xbed4
movq -0x40(%rbp), %rdi
callq 0x3280
addq $0xb8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl %eax, %edi
callq 0x3250
movq %rax, %rbx
movq -0xb8(%rbp), %rdi
leaq -0xa8(%rbp), %rax
jmp 0xc003
movq %rax, %rbx
jmp 0xc00d
movq %rax, %rbx
jmp 0xbff5
movq %rax, %rbx
movq -0x78(%rbp), %rdi
leaq -0x68(%rbp), %rax
cmpq %rax, %rdi
je 0xbff5
callq 0x3320
movq -0x98(%rbp), %rdi
leaq -0x88(%rbp), %rax
cmpq %rax, %rdi
je 0xc00d
callq 0x3320
movq %rbx, %rdi
callq 0x3580
movq %rax, %rbx
movq -0xd8(%rbp), %rdi
cmpq %r14, %rdi
jne 0xc008
jmp 0xc00d
// File: /workspace/github_cpp_makefile_star2_O3/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
pushq %r15
pushq %r14
pushq %rbx
subq $0x1048, %rsp           # imm = 0x1048
movq %rdx, %r14
movq %rsi, %rbx
movq %rdi, %r15
leaq -0x60(%rbp), %rdi
movq %r15, %rsi
movq %rbx, %rdx
callq 0x7840
leaq -0x80(%rbp), %rdi
movq %r14, %rsi
callq 0xe536
leaq -0x48(%rbp), %rdi
leaq -0x80(%rbp), %rdx
movq %r15, %rsi
callq 0x6682
leaq -0x30(%rbp), %rdi
leaq -0x60(%rbp), %rsi
callq 0x610c
leaq -0x48(%rbp), %rsi
leaq -0x30(%rbp), %rdx
movq %r15, %rdi
movq %rbx, %rcx
movq %r14, %r8
callq 0xc8c2
movq -0x30(%rbp), %rdi
testq %rdi, %rdi
je 0xc489
callq 0x3320
movq -0x48(%rbp), %rdi
testq %rdi, %rdi
je 0xc497
callq 0x3320
leaq -0x70(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0xc4a9
callq 0x3320
leaq 0x3fff(%rip), %r9       # 0x104af
leaq -0x1054(%rbp), %rdi
movl $0xf, %esi
movl $0x1, %edx
movl $0x1, %ecx
movl $0x14, %r8d
callq 0x65b0
leaq -0x1054(%rbp), %rsi
movq %rbx, %rdi
callq 0xea3c
movq -0x60(%rbp), %rdi
testq %rdi, %rdi
je 0xc4ee
callq 0x3320
addq $0x1048, %rsp           # imm = 0x1048
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movq -0x30(%rbp), %rdi
testq %rdi, %rdi
je 0xc512
callq 0x3320
jmp 0xc512
movq %rax, %rbx
movq -0x48(%rbp), %rdi
testq %rdi, %rdi
je 0xc525
callq 0x3320
jmp 0xc525
movq %rax, %rbx
leaq -0x70(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0xc53e
callq 0x3320
jmp 0xc53e
jmp 0xc53b
movq %rax, %rbx
movq -0x60(%rbp), %rdi
testq %rdi, %rdi
je 0xc54c
callq 0x3320
movq %rbx, %rdi
callq 0x3580
// File: /workspace/github_cpp_makefile_star2_O3/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
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x60, %rsp
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %r12
movq %rsi, %rdi
callq 0xef78
movl %eax, %ebx
movq %r14, %rdi
movq %r15, %rsi
callq 0xe5ac
movq %r12, %rdi
movl %ebx, %esi
callq 0xcef6
leaq -0x80(%rbp), %r15
movq %r15, %rdi
movq %r14, %rsi
callq 0xe50a
leaq 0x3f22(%rip), %rcx      # 0x104c3
movl $0x5, %r8d
movq %r15, %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x3370
leaq -0x30(%rbp), %r14
movq %r14, -0x10(%r14)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0xc5d7
movq %rdx, -0x40(%rbp)
movq (%rcx), %rdx
movq %rdx, -0x30(%rbp)
jmp 0xc5de
movups (%rcx), %xmm0
movups %xmm0, (%r14)
movq 0x8(%rax), %rdx
leaq -0x40(%rbp), %rdi
movq %rdx, 0x8(%rdi)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
leaq 0x3ec9(%rip), %rsi      # 0x104c9
callq 0x35c0
leaq -0x50(%rbp), %r15
movq %r15, -0x10(%r15)
movq (%rax), %rsi
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rsi
je 0xc629
movq %rsi, -0x60(%rbp)
movq (%rcx), %rdx
movq %rdx, -0x50(%rbp)
jmp 0xc633
movups (%rcx), %xmm0
movups %xmm0, (%r15)
movq %r15, %rsi
movq 0x8(%rax), %rdx
movq %rdx, -0x58(%rbp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movq 0x897f(%rip), %rdi      # 0x14fd0
callq 0x33a0
movq %rax, %rdi
movl %ebx, %esi
callq 0x3540
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x3330
movsbl %al, %esi
movq %rbx, %rdi
callq 0x3040
movq %rax, %rdi
callq 0x3260
movq -0x60(%rbp), %rdi
cmpq %r15, %rdi
je 0xc698
callq 0x3320
movq -0x40(%rbp), %rdi
cmpq %r14, %rdi
je 0xc6a6
callq 0x3320
leaq -0x70(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0xc6b8
callq 0x3320
addq $0x60, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
jmp 0xc6e0
movq %rax, %rbx
jmp 0xc6ee
movq %rax, %rbx
movq -0x60(%rbp), %rdi
cmpq %r15, %rdi
je 0xc6e0
callq 0x3320
movq -0x40(%rbp), %rdi
cmpq %r14, %rdi
je 0xc6ee
callq 0x3320
leaq -0x70(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0xc700
callq 0x3320
movq %rbx, %rdi
callq 0x3580
// File: /workspace/github_cpp_makefile_star2_O3/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
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x58, %rsp
movq (%rsi), %r12
movl $0x1e, %eax
cmpq 0x8(%rsi), %r12
je 0xc896
movq %rdx, -0x40(%rbp)
xorl %ebx, %ebx
movq %rsi, -0x38(%rbp)
leaq (%r12,%rbx), %r15
leaq -0x80(%rbp), %rdi
movq %r15, %rsi
leaq -0x29(%rbp), %rdx
callq 0x3150
leaq -0x50(%rbp), %rax
movq %rax, -0x60(%rbp)
leaq 0x10(%rbp), %r14
movq %r14, %rdi
callq 0x3170
leaq (%rax,%r14), %rdx
leaq -0x60(%rbp), %rdi
movq %r14, %rsi
callq 0x630e
movq -0x78(%rbp), %rdx
cmpq -0x58(%rbp), %rdx
jne 0xc794
movq -0x60(%rbp), %r14
testq %rdx, %rdx
je 0xc79d
movq -0x80(%rbp), %rdi
movq %r14, %rsi
callq 0x3350
testl %eax, %eax
sete %r13b
jmp 0xc7a0
movq -0x60(%rbp), %r14
xorl %r13d, %r13d
jmp 0xc7a0
movb $0x1, %r13b
leaq -0x50(%rbp), %rax
cmpq %rax, %r14
je 0xc7b1
movq %r14, %rdi
callq 0x3320
movq -0x80(%rbp), %rdi
leaq -0x70(%rbp), %rax
cmpq %rax, %rdi
je 0xc7c3
callq 0x3320
testb %r13b, %r13b
jne 0xc7f1
leaq (%r12,%rbx), %rax
addq $0xe8, %rax
addq $0xe8, %rbx
movq -0x38(%rbp), %rcx
cmpq 0x8(%rcx), %rax
jne 0xc735
movl $0x1e, %eax
jmp 0xc896
movq 0xd8(%r12,%rbx), %rax
leaq 0x10(%rbp), %rcx
cmpq 0xd8(%rcx), %rax
movq -0x38(%rbp), %r14
jne 0xc83a
leaq (%r12,%rbx), %rsi
addq $0xe8, %rsi
movq 0x8(%r14), %rdx
cmpq %rdx, %rsi
je 0xc87f
subq %r12, %rdx
subq %rbx, %rdx
addq $-0xe8, %rdx
movq %r15, %rdi
callq 0x3500
movl $0x1d, %eax
jmp 0xc879
movl $0xe8, %edx
movq -0x40(%rbp), %rdi
movq %r15, %rsi
callq 0x32b0
leaq (%r12,%rbx), %rsi
addq $0xe8, %rsi
movq 0x8(%r14), %rdx
cmpq %rdx, %rsi
je 0xc886
subq %r12, %rdx
subq %rbx, %rdx
addq $-0xe8, %rdx
movq %r15, %rdi
callq 0x3500
movl $0x1f, %eax
movq 0x8(%r14), %rdx
jmp 0xc88b
movl $0x1d, %eax
jmp 0xc88b
movl $0x1f, %eax
addq $-0xe8, %rdx
movq %rdx, 0x8(%r14)
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movq -0x80(%rbp), %rdi
leaq -0x70(%rbp), %rax
cmpq %rax, %rdi
je 0xc8ba
callq 0x3320
movq %rbx, %rdi
callq 0x3580
// File: /workspace/github_cpp_makefile_star2_O3/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
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x218, %rsp            # imm = 0x218
movq %rdi, %rbx
movq 0x20(%rdi), %rdi
leaq -0x238(%rbp), %rsi
callq 0x32f0
cmpl $-0x1, %eax
jne 0xe1b2
movq 0x20(%rbx), %rdi
movl $0x1ff, %esi            # imm = 0x1FF
callq 0x31a0
movq 0x20(%rbx), %rdi
callq 0x3490
testq %rax, %rax
je 0xe2b3
movq %rax, %r14
movq %rax, %rdi
callq 0x34b0
testq %rax, %rax
je 0xe2ab
movq %rax, %r15
leaq -0x198(%rbp), %r13
leaq 0x40(%rbx), %rax
movq %rax, -0x30(%rbp)
leaq -0x1a8(%rbp), %r12
cmpb $0x8, 0x12(%r15)
jne 0xe297
addq $0x13, %r15
movq %r13, -0x1a8(%rbp)
movq 0x20(%rbx), %rsi
movq 0x28(%rbx), %rdx
addq %rsi, %rdx
movq %r12, %rdi
callq 0x6270
movq %r12, %rdi
movq %r15, %rsi
callq 0x35c0
movq -0x1a8(%rbp), %rdi
leaq -0xc0(%rbp), %rsi
callq 0x32f0
movq -0x1a8(%rbp), %rdi
cmpq %r13, %rdi
je 0xe249
callq 0x3320
movq -0x58(%rbp), %rdx
movq -0x78(%rbp), %rcx
movq -0x68(%rbp), %r8
movl -0x90(%rbp), %r9d
movq %r12, %rdi
movq %r15, %rsi
callq 0x6560
movq 0x48(%rbx), %rsi
cmpq 0x50(%rbx), %rsi
je 0xe28b
movl $0xe8, %edx
movq %rsi, %rdi
movq %r12, %rsi
callq 0x32b0
addq $0xe8, 0x48(%rbx)
jmp 0xe297
movq -0x30(%rbp), %rdi
movq %r12, %rdx
callq 0x6414
movq %r14, %rdi
callq 0x34b0
movq %rax, %r15
testq %rax, %rax
jne 0xe1f1
movq %r14, %rdi
callq 0x34f0
addq $0x218, %rsp            # imm = 0x218
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movq -0x1a8(%rbp), %rdi
cmpq %r13, %rdi
je 0xe2d9
callq 0x3320
movq %rbx, %rdi
callq 0x3580
nop
// File: /workspace/github_cpp_makefile_star2_O3/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
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x58(%rdi), %rdi
movq 0x60(%rbx), %rax
cmpq %rax, %rdi
je 0xe5fa
movq %rax, %rdx
subq %rdi, %rdx
addq $-0x8, %rdx
cmpq %rsi, (%rdi)
je 0xe5e0
addq $0x8, %rdi
addq $-0x8, %rdx
cmpq %rax, %rdi
jne 0xe5cc
jmp 0xe5fa
leaq 0x8(%rdi), %rsi
cmpq %rax, %rsi
je 0xe5f2
callq 0x3500
movq 0x60(%rbx), %rax
addq $-0x8, %rax
movq %rax, 0x60(%rbx)
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_cpp_makefile_star2_O3/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
pushq %r14
pushq %rbx
movl %esi, %ebx
movq %rdi, %r14
movl $0x0, 0x8(%rdi)
movq $0x0, 0x10(%rdi)
movl $0x2, %edi
movl $0x2, %esi
xorl %edx, %edx
callq 0x30c0
movl %eax, (%r14)
cmpl $-0x1, %eax
je 0xe6ff
movq %r14, %rdi
movl %ebx, %esi
callq 0xe704
movl $0x10, 0x40(%r14)
movl %ebx, 0x4(%r14)
popq %rbx
popq %r14
popq %rbp
retq
callq 0x3733
// File: /workspace/github_cpp_makefile_star2_O3/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
pushq %r14
pushq %rbx
movq %rdi, %rbx
leaq 0x20(%rdi), %r14
rolw $0x8, %si
movw $0x2, 0x20(%rdi)
movw %si, 0x22(%rdi)
movl $0x0, 0x24(%rdi)
addq $0x28, %rdi
movl $0x8, %esi
callq 0x3560
movl (%rbx), %edi
movq %r14, %rsi
movl $0x10, %edx
callq 0x3090
testl %eax, %eax
js 0xe74d
popq %rbx
popq %r14
popq %rbp
retq
callq 0x375b
// File: /workspace/github_cpp_makefile_star2_O3/vianna274[P]dropbox/src/WrapperSocket.cpp
// Function: Dropbox::WrapperSocket::send(Dropbox::_MessageData*, int)
bool WrapperSocket::send(MessageData *packet, int wait) {
  set_socketSeq(packet, this->socketSeq);
  int tries = 0;
  do{

    if (sendto(this->localSocketHandler, (void *)packet, PACKET_LEN, 0,(const struct sockaddr *) &(this->remoteSocketAddr),sizeof(struct sockaddr_in)) < 0) {
      fprintf(stderr, "Error on sending");
      cout << string(packet->payload) << packet->type << " " << string(packet->username) << endl;
      exit(1);
    }
  
  }while(!this->waitAck(packet->seq, wait) && ++tries < TOTAL_TRIES);
  this->socketSeq++;
  
  if(tries == TOTAL_TRIES) return false;
  return true;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movl %edx, %r15d
movq %rsi, %rbx
movq %rdi, %r14
movl 0x8(%rdi), %esi
movq %rbx, %rdi
callq 0x6672
leaq 0x20(%r14), %r12
xorl %r13d, %r13d
movl (%r14), %edi
movl $0x1000, %edx           # imm = 0x1000
movq %rbx, %rsi
xorl %ecx, %ecx
movq %r12, %r8
movl $0x10, %r9d
callq 0x3070
testq %rax, %rax
js 0xe7d9
movl 0x4(%rbx), %esi
movq %r14, %rdi
movl %r15d, %edx
callq 0xe8ea
testb %al, %al
jne 0xe7bf
incl %r13d
cmpl $0x3, %r13d
jne 0xe77e
movl $0x3, %r13d
incl 0x8(%r14)
cmpl $0x3, %r13d
setne %al
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x67f8(%rip), %rax      # 0x14fd8
movq (%rax), %rcx
leaq 0x1e27(%rip), %rdi      # 0x10611
movl $0x10, %esi
movl $0x1, %edx
callq 0x35d0
leaq 0x14(%rbx), %r14
leaq -0x58(%rbp), %r12
movq %r12, -0x10(%r12)
movq %r14, %rdi
callq 0x3170
leaq (%rbx,%rax), %rdx
addq $0x14, %rdx
leaq -0x68(%rbp), %r15
movq %r15, %rdi
movq %r14, %rsi
callq 0x630e
movq (%r15), %rsi
movq 0x8(%r15), %rdx
movq 0x679d(%rip), %rdi      # 0x14fd0
callq 0x33a0
movl (%rbx), %esi
movq %rax, %rdi
callq 0x3540
movq %rax, %r14
leaq 0x1bba(%rip), %rsi      # 0x10406
movl $0x1, %edx
movq %rax, %rdi
callq 0x33a0
leaq 0xfb4(%rbx), %r15
leaq -0x38(%rbp), %r13
movq %r13, -0x10(%r13)
movq %r15, %rdi
callq 0x3170
leaq (%rbx,%rax), %rdx
addq $0xfb4, %rdx            # imm = 0xFB4
leaq -0x48(%rbp), %rdi
movq %r15, %rsi
callq 0x630e
movq -0x48(%rbp), %rsi
movq -0x40(%rbp), %rdx
movq %r14, %rdi
callq 0x33a0
movq %rax, %rdi
callq 0x31d0
leaq -0x48(%rbp), %rdi
callq 0x3180
leaq -0x68(%rbp), %rdi
callq 0x3180
movl $0x1, %edi
callq 0x33c0
movq %rax, %rbx
movq -0x48(%rbp), %rdi
cmpq %r13, %rdi
je 0xe8d3
callq 0x3320
jmp 0xe8d3
jmp 0xe8d0
movq %rax, %rbx
movq -0x68(%rbp), %rdi
cmpq %r12, %rdi
je 0xe8e1
callq 0x3320
movq %rbx, %rdi
callq 0x3580
nop
// File: /workspace/github_cpp_makefile_star2_O3/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
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %edx, %ebx
movl %esi, %r14d
movq %rdi, %r15
movl $0x1, %esi
callq 0xe934
testq %rax, %rax
je 0xe922
cmpl $0x1, (%rax)
jne 0xe916
cmpl %r14d, 0x4(%rax)
je 0xe926
movq %r15, %rdi
movl $0x1, %esi
movl %ebx, %edx
jmp 0xe901
xorl %eax, %eax
jmp 0xe928
movb $0x1, %al
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/vianna274[P]dropbox/src/WrapperSocket.cpp
// Function: Dropbox::WrapperSocket::receive(int, int)
MessageData* WrapperSocket::receive(int timeout, int time) {
  if(timeout == TIMEOUT_ON) {
    struct pollfd fd;
    fd.fd = this->localSocketHandler;
    fd.events = POLLIN;
    int ret = poll(&fd, 1, time);
    switch(ret) {
      case -1: printf("Error\n");
        return NULL;
      case 0: 
        return NULL;
      default: break;
    }
  }

  char* msg = new char[PACKET_LEN];
  memset(msg, 0, PACKET_LEN);
  bool receivedCorrectly = false;
  MessageData * data;
  while(!receivedCorrectly) {

    int msgSize = recvfrom(this->localSocketHandler, (void *) msg, 
      PACKET_LEN, 0, (struct sockaddr *) &this->remoteSocketAddr, &this->remoteSocketLen);
    if (msgSize < 0) {
      fprintf(stderr, "Error on receiving\n");
      exit(1);
    }
    data = (MessageData *) msg;

    if (data->socketSeq == -1)
      break;
    if (data->socketSeq == 0)
      this->socketSeq = 0;
    if (data->socketSeq == this->socketSeq && data->type != TYPE_ACK) {
      MessageData message = make_packet(TYPE_ACK, data->seq, 1, -1, "");
      this->sendAck(&message);
      this->socketSeq = data->socketSeq + 1;
      receivedCorrectly = true;
    }
  }

  
  // TODO delete msg
  return data;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0xfe0, %rsp            # imm = 0xFE0
movq %rdi, %rbx
cmpl $0x1, %esi
jne 0xe986
movl (%rbx), %eax
leaq -0xff4(%rbp), %rdi
movl %eax, (%rdi)
movw $0x1, 0x4(%rdi)
movl $0x1, %esi
callq 0x34a0
testl %eax, %eax
je 0xe97e
cmpl $-0x1, %eax
jne 0xe986
leaq 0x1ce3(%rip), %rdi      # 0x1065c
callq 0x34d0
xorl %r14d, %r14d
jmp 0xea24
movl $0x1000, %edi           # imm = 0x1000
callq 0x3030
movq %rax, %r14
movl $0x1000, %edx           # imm = 0x1000
movq %rax, %rdi
xorl %esi, %esi
callq 0x3230
leaq 0x20(%rbx), %r15
leaq 0x40(%rbx), %r12
movl (%rbx), %edi
movl $0x1000, %edx           # imm = 0x1000
movq %r14, %rsi
xorl %ecx, %ecx
movq %r15, %r8
movq %r12, %r9
callq 0x3290
testl %eax, %eax
js 0xea37
movl 0x10(%r14), %eax
testl %eax, %eax
je 0xe9d9
cmpl $-0x1, %eax
je 0xea24
cmpl 0x8(%rbx), %eax
jne 0xe9aa
jmp 0xe9e0
movl $0x0, 0x8(%rbx)
cmpl $0x1, (%r14)
je 0xe9aa
movl 0x4(%r14), %edx
leaq 0x1c44(%rip), %r9       # 0x10635
leaq -0xff4(%rbp), %r15
movq %r15, %rdi
movl $0x1, %esi
movl $0x1, %ecx
movl $0xffffffff, %r8d       # imm = 0xFFFFFFFF
callq 0x65b0
movq %rbx, %rdi
movq %r15, %rsi
callq 0xef46
movl 0x10(%r14), %eax
incl %eax
movl %eax, 0x8(%rbx)
movq %r14, %rax
addq $0xfe0, %rsp            # imm = 0xFE0
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
callq 0x3783
// File: /workspace/github_cpp_makefile_star2_O3/vianna274[P]dropbox/src/WrapperSocket.cpp
// Function: Dropbox::WrapperSocket::send(Dropbox::_MessageData*)
int WrapperSocket::send(MessageData *packet) {
  set_socketSeq(packet, this->socketSeq);
  int tries = 0;
  do{

    if (sendto(this->localSocketHandler, (void *)packet, PACKET_LEN, 0,(const struct sockaddr *) &(this->remoteSocketAddr),sizeof(struct sockaddr_in)) < 0) {
      fprintf(stderr, "Error on sending");
      cout << string(packet->payload) << packet->type << " " << string(packet->username) << endl;
      return -1;
    }
  
  }while(!this->waitAck(packet->seq) && ++tries < TOTAL_TRIES);
  this->socketSeq++;
  
  if(tries == TOTAL_TRIES) return 0;
  return 1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movq %rsi, %rbx
movq %rdi, %r14
movl 0x8(%rdi), %esi
movq %rbx, %rdi
callq 0x6672
leaq 0x20(%r14), %r15
movl $0x3, %r12d
movl (%r14), %edi
movl $0x1000, %edx           # imm = 0x1000
movq %rbx, %rsi
xorl %ecx, %ecx
movq %r15, %r8
movl $0x10, %r9d
callq 0x3070
testq %rax, %rax
js 0xeabc
movl 0x4(%rbx), %esi
movq %r14, %rdi
callq 0xebf8
testb %al, %al
jne 0xeaa4
decl %r12d
jne 0xea68
incl 0x8(%r14)
xorl %eax, %eax
jmp 0xeaad
incl 0x8(%r14)
movl $0x1, %eax
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x6515(%rip), %rax      # 0x14fd8
movq (%rax), %rcx
leaq 0x1b44(%rip), %rdi      # 0x10611
movl $0x10, %esi
movl $0x1, %edx
callq 0x35d0
leaq 0x14(%rbx), %r14
leaq -0x58(%rbp), %r12
movq %r12, -0x10(%r12)
movq %r14, %rdi
callq 0x3170
leaq (%rbx,%rax), %rdx
addq $0x14, %rdx
leaq -0x68(%rbp), %r15
movq %r15, %rdi
movq %r14, %rsi
callq 0x630e
movq (%r15), %rsi
movq 0x8(%r15), %rdx
movq 0x64ba(%rip), %rdi      # 0x14fd0
callq 0x33a0
movl (%rbx), %esi
movq %rax, %rdi
callq 0x3540
movq %rax, %r14
leaq 0x18d7(%rip), %rsi      # 0x10406
movl $0x1, %edx
movq %rax, %rdi
callq 0x33a0
leaq 0xfb4(%rbx), %r15
leaq -0x38(%rbp), %r13
movq %r13, -0x10(%r13)
movq %r15, %rdi
callq 0x3170
leaq (%rbx,%rax), %rdx
addq $0xfb4, %rdx            # imm = 0xFB4
leaq -0x48(%rbp), %rdi
movq %r15, %rsi
callq 0x630e
movq -0x48(%rbp), %rsi
movq -0x40(%rbp), %rdx
movq %r14, %rdi
callq 0x33a0
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x3330
movsbl %al, %esi
movq %rbx, %rdi
callq 0x3040
movq %rax, %rdi
callq 0x3260
movq -0x48(%rbp), %rdi
cmpq %r13, %rdi
je 0xebb2
callq 0x3320
movq -0x68(%rbp), %rdi
cmpq %r12, %rdi
je 0xebc0
callq 0x3320
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
jmp 0xeaad
jmp 0xebcc
movq %rax, %rbx
jmp 0xebe2
movq %rax, %rbx
movq -0x48(%rbp), %rdi
cmpq %r13, %rdi
je 0xebe2
callq 0x3320
movq -0x68(%rbp), %rdi
cmpq %r12, %rdi
je 0xebf0
callq 0x3320
movq %rbx, %rdi
callq 0x3580
// File: /workspace/github_cpp_makefile_star2_O3/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
pushq %r14
pushq %rbx
movl %esi, %ebx
movq %rdi, %r14
movl $0x1, %esi
callq 0xec2e
testq %rax, %rax
je 0xec22
cmpl $0x1, (%rax)
jne 0xec1d
cmpl %ebx, 0x4(%rax)
je 0xec26
movq %r14, %rdi
jmp 0xec04
xorl %eax, %eax
jmp 0xec28
movb $0x1, %al
popq %rbx
popq %r14
popq %rbp
retq
nop