// File: 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
subq $0xe0, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rdi
movq %rdi, -0xb0(%rbp)
addq $0x20, %rdi
movq %rdi, -0xb8(%rbp)
callq 0x6a60
movq -0xb8(%rbp), %rdi
movq -0xb0(%rbp), %rax
movl $0x1b, 0x180(%rax)
callq 0x6a90
movq -0xb0(%rbp), %rdi
addq $0x98, %rdi
callq 0x6a60
movq -0xb0(%rbp), %rsi
addq $0x970, %rsi            # imm = 0x970
leaq -0x28(%rbp), %rdi
callq 0x11dd0
movq -0xb0(%rbp), %rsi
addq $0x9d8, %rsi            # imm = 0x9D8
leaq -0x48(%rbp), %rdi
callq 0x3190
jmp 0xf15e
movq -0xb0(%rbp), %rdi
leaq -0x28(%rbp), %rsi
leaq -0x48(%rbp), %rdx
callq 0xe190
jmp 0xf174
leaq -0x48(%rbp), %rdi
callq 0x3280
leaq -0x28(%rbp), %rdi
callq 0x11a00
movq -0xb0(%rbp), %rdi
addq $0x98, %rdi
callq 0x6a90
movq -0x10(%rbp), %rax
addq $0x14, %rax
movq %rax, -0xc8(%rbp)
leaq -0x79(%rbp), %rdi
movq %rdi, -0xc0(%rbp)
callq 0x3620
movq -0xc8(%rbp), %rsi
movq -0xc0(%rbp), %rdx
leaq -0x78(%rbp), %rdi
callq 0x3480
jmp 0xf1d1
movq -0xb0(%rbp), %rdi
addq $0x9d8, %rdi            # imm = 0x9D8
movq %rdi, -0xd8(%rbp)
leaq -0x78(%rbp), %rsi
movq %rsi, -0xe0(%rbp)
callq 0x3430
movq -0xe0(%rbp), %rdi
callq 0x3280
leaq -0x79(%rbp), %rdi
callq 0x33e0
movq -0xb0(%rbp), %rdi
addq $0xc0, %rdi
callq 0x6a60
movl $0x48, %edi
callq 0x33b0
movq -0xd8(%rbp), %rsi
movq %rax, -0xd0(%rbp)
movb $0x1, -0xa1(%rbp)
leaq -0xa0(%rbp), %rdi
callq 0x3190
jmp 0xf24b
movq -0xd0(%rbp), %rdi
leaq -0xa0(%rbp), %rsi
movl $0x2328, %edx           # imm = 0x2328
callq 0x17690
jmp 0xf265
movq -0xb0(%rbp), %rax
movq -0xd0(%rbp), %rcx
movb $0x0, -0xa1(%rbp)
movq %rcx, 0x178(%rax)
leaq -0xa0(%rbp), %rdi
callq 0x3280
callq 0xf380
movq -0xb0(%rbp), %rdi
addq $0xc0, %rdi
callq 0x6a90
movq -0xb0(%rbp), %rdi
callq 0xdb60
movq -0xb0(%rbp), %rdi
addq $0x20, %rdi
callq 0x6a60
movq -0xb0(%rbp), %rdi
movl $0x18, 0x180(%rdi)
addq $0x20, %rdi
callq 0x6a90
addq $0xe0, %rsp
popq %rbp
retq
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
jmp 0xf307
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
leaq -0x48(%rbp), %rdi
callq 0x3280
leaq -0x28(%rbp), %rdi
callq 0x11a00
jmp 0xf368
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
leaq -0x79(%rbp), %rdi
callq 0x33e0
jmp 0xf368
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
jmp 0xf34f
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
leaq -0xa0(%rbp), %rdi
callq 0x3280
testb $0x1, -0xa1(%rbp)
jne 0xf35a
jmp 0xf366
movq -0xd0(%rbp), %rdi
callq 0x3370
jmp 0xf368
movq -0x50(%rbp), %rdi
callq 0x3610
nopw %cs:(%rax,%rax)