// File: /workspace/github_cpp_makefile_star2_O3/vianna274[P]dropbox/src/Server.cpp
// Function: Dropbox::Server::updateClient(std::vector<Dropbox::_FileRecord, std::allocator<Dropbox::_FileRecord>>, std::vector<Dropbox::_FileRecord, std::allocator<Dropbox::_FileRecord>>, Dropbox::WrapperSocket*, Dropbox::User*)
void Server::updateClient(vector<FileRecord> serverFiles, vector<FileRecord> clientFiles, WrapperSocket *socket, User *user) {
    cout << "Checking if user " << user->getUsername() << " is updated." << endl;
    vector<FileRecord>::iterator it;
    FileRecord temp;
    for(it = clientFiles.begin(); it != clientFiles.end(); it++) {
        switch(this->lookForRecordAndRemove(*it, &serverFiles, &temp)) {
            case OK: 
                break;
            case DELETE:
                this->sendDeleteFile(socket, string(it->filename));
                break;
            case UPDATE: 
                this->sendDeleteFile(socket, string(temp.filename));
                this->sendFile(socket, user->getDirPath() + string(temp.filename), temp, user->getUsername());
                break;
        }
    }
    // Send files that the client didn't have at the moment
    for(FileRecord serverFile: serverFiles) { 
        this->sendFile(socket, user->getDirPath() + string(serverFile.filename), serverFile, user->getUsername());
    }

}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x5a8, %rsp            # imm = 0x5A8
movq %r8, %rbx
movq %rcx, -0x60(%rbp)
movq %rdx, -0x50(%rbp)
movq %rsi, %r13
movq %rdi, -0x58(%rbp)
movq 0x86e1(%rip), %r14      # 0x14fd0
leaq 0x3b9a(%rip), %rsi      # 0x10490
movl $0x11, %edx
movq %r14, %rdi
callq 0x33a0
leaq -0x318(%rbp), %r15
movq %r15, %rdi
movq %rbx, -0x68(%rbp)
movq %rbx, %rsi
callq 0xe50a
movq (%r15), %rsi
movq 0x8(%r15), %rdx
movq %r14, %rdi
callq 0x33a0
movq %rax, %r14
leaq 0x3b70(%rip), %rsi      # 0x104a2
movl $0xc, %edx
movq %rax, %rdi
callq 0x33a0
movq (%r14), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x3330
movsbl %al, %esi
movq %r14, %rdi
callq 0x3040
movq %rax, %rdi
callq 0x3260
leaq -0x308(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0xc97b
callq 0x3320
movq -0x50(%rbp), %rax
movq (%rax), %r12
cmpq 0x8(%rax), %r12
movq %r13, %rbx
je 0xcbfc
leaq -0x318(%rbp), %r13
movl $0x1d, %ecx
movq %rsp, %rdi
movq %r12, %rsi
rep  movsq (%rsi), %es:(%rdi)
movq %rbx, %rsi
movq %r13, %rdx
callq 0xc708
cmpl $0x1e, %eax
je 0xcaaf
cmpl $0x1f, %eax
jne 0xcbe7
leaq -0xd8(%rbp), %rax
movq %rax, -0xe8(%rbp)
movq %r13, %rdi
callq 0x3170
leaq (%rax,%rbp), %rdx
addq $-0x318, %rdx           # imm = 0xFCE8
leaq -0xe8(%rbp), %r15
movq %r15, %rdi
movq %r13, %rsi
callq 0x630e
movq -0x58(%rbp), %rdi
movq -0x60(%rbp), %rsi
movq %r15, %rdx
callq 0x7e3c
movq -0xe8(%rbp), %rdi
leaq -0xd8(%rbp), %rax
cmpq %rax, %rdi
je 0xca1c
callq 0x3320
leaq -0x230(%rbp), %rdi
movq -0x68(%rbp), %rsi
callq 0xe536
leaq -0x38(%rbp), %rax
movq %rax, -0x48(%rbp)
movq %r13, %rdi
callq 0x3170
leaq (%rax,%rbp), %rdx
addq $-0x318, %rdx           # imm = 0xFCE8
leaq -0x48(%rbp), %rdi
movq %r13, %rsi
callq 0x630e
movq -0x230(%rbp), %rcx
movl $0xf, %edi
leaq -0x220(%rbp), %rax
cmpq %rax, %rcx
je 0xca72
movq -0x220(%rbp), %rdi
movq -0x228(%rbp), %r8
movq -0x48(%rbp), %rsi
movq -0x40(%rbp), %rdx
leaq (%rdx,%r8), %rax
cmpq %rdi, %rax
jbe 0xcaa1
movl $0xf, %edi
leaq -0x38(%rbp), %r9
cmpq %r9, %rsi
je 0xca9c
movq -0x38(%rbp), %rdi
cmpq %rdi, %rax
jbe 0xcaeb
leaq -0x230(%rbp), %rdi
callq 0x3100
jmp 0xcaf8
leaq -0x148(%rbp), %r15
movq %r15, %rdi
movq %r12, %rsi
leaq -0x230(%rbp), %rdx
callq 0x3150
movq -0x58(%rbp), %rdi
movq -0x60(%rbp), %rsi
movq %r15, %rdx
callq 0x7e3c
movq -0x148(%rbp), %rdi
leaq -0x138(%rbp), %rax
jmp 0xcbdd
leaq -0x48(%rbp), %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x3370
leaq -0x78(%rbp), %rsi
movq %rsi, -0x88(%rbp)
movq (%rax), %rdx
leaq 0x10(%rax), %rcx
cmpq %rcx, %rdx
je 0xcb1f
movq %rdx, -0x88(%rbp)
movq (%rcx), %rdx
movq %rdx, -0x78(%rbp)
jmp 0xcb25
movups (%rcx), %xmm0
movups %xmm0, (%rsi)
movq %rax, %rdx
addq $0x8, %rdx
movq 0x8(%rax), %rsi
movq %rsi, -0x80(%rbp)
movq %rcx, (%rax)
movq $0x0, (%rdx)
movb $0x0, (%rcx)
movl $0xe8, %edx
leaq -0x4e8(%rbp), %r15
movq %r15, %rdi
movq %r13, %rsi
callq 0x32b0
leaq -0x128(%rbp), %r14
movq %r14, %rdi
movq -0x68(%rbp), %rsi
callq 0xe50a
movl $0x1d, %ecx
movq %rsp, %rdi
movq %r15, %rsi
rep  movsq (%rsi), %es:(%rdi)
movq -0x58(%rbp), %rdi
movq -0x60(%rbp), %rsi
leaq -0x88(%rbp), %rdx
movq %r14, %rcx
callq 0x6aaa
movq -0x128(%rbp), %rdi
leaq -0x118(%rbp), %rax
cmpq %rax, %rdi
je 0xcba8
callq 0x3320
movq -0x88(%rbp), %rdi
leaq -0x78(%rbp), %rax
cmpq %rax, %rdi
je 0xcbbd
callq 0x3320
movq -0x48(%rbp), %rdi
leaq -0x38(%rbp), %rax
cmpq %rax, %rdi
je 0xcbcf
callq 0x3320
movq -0x230(%rbp), %rdi
leaq -0x220(%rbp), %rax
cmpq %rax, %rdi
je 0xcbe7
callq 0x3320
addq $0xe8, %r12
movq -0x50(%rbp), %rax
cmpq 0x8(%rax), %r12
jne 0xc996
movq (%rbx), %r12
movq 0x8(%rbx), %rax
movq %rax, -0x50(%rbp)
cmpq %rax, %r12
je 0xcdd3
leaq -0xb8(%rbp), %r15
leaq -0x230(%rbp), %r13
movl $0xe8, %edx
movq %r13, %rdi
movq %r12, %rsi
callq 0x32b0
leaq -0x48(%rbp), %rdi
movq -0x68(%rbp), %rsi
callq 0xe536
leaq -0x98(%rbp), %rax
movq %rax, -0xa8(%rbp)
movq %r13, %rdi
callq 0x3170
leaq (%rax,%rbp), %rdx
addq $-0x230, %rdx           # imm = 0xFDD0
leaq -0xa8(%rbp), %rdi
movq %r13, %rsi
callq 0x630e
movq -0x48(%rbp), %rcx
movl $0xf, %edi
leaq -0x38(%rbp), %rax
cmpq %rax, %rcx
je 0xcc81
movq -0x38(%rbp), %rdi
movq -0x40(%rbp), %r8
movq -0xa8(%rbp), %rsi
movq -0xa0(%rbp), %rdx
leaq (%rdx,%r8), %rax
cmpq %rdi, %rax
jbe 0xccb9
movl $0xf, %edi
leaq -0x98(%rbp), %r9
cmpq %r9, %rsi
je 0xccb4
movq -0x98(%rbp), %rdi
cmpq %rdi, %rax
jbe 0xccc4
leaq -0x48(%rbp), %rdi
callq 0x3100
jmp 0xccd4
leaq -0xa8(%rbp), %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x3370
movq %r15, -0xc8(%rbp)
movq (%rax), %rdx
leaq 0x10(%rax), %rcx
cmpq %rcx, %rdx
je 0xccfa
movq %rdx, -0xc8(%rbp)
movq (%rcx), %rdx
movq %rdx, -0xb8(%rbp)
jmp 0xcd01
movups (%rcx), %xmm0
movups %xmm0, (%r15)
movq %rax, %rdx
addq $0x8, %rdx
movq 0x8(%rax), %rsi
movq %rsi, -0xc0(%rbp)
movq %rcx, (%rax)
movq $0x0, (%rdx)
movb $0x0, (%rcx)
movl $0xe8, %edx
leaq -0x400(%rbp), %r14
movq %r14, %rdi
movq %r13, %rsi
callq 0x32b0
leaq -0x108(%rbp), %rbx
movq %rbx, %rdi
movq -0x68(%rbp), %rsi
callq 0xe50a
movl $0x1d, %ecx
movq %rsp, %rdi
movq %r14, %rsi
rep  movsq (%rsi), %es:(%rdi)
movq -0x58(%rbp), %rdi
movq -0x60(%rbp), %rsi
leaq -0xc8(%rbp), %rdx
movq %rbx, %rcx
callq 0x6aaa
movq -0x108(%rbp), %rdi
leaq -0xf8(%rbp), %rax
cmpq %rax, %rdi
je 0xcd87
callq 0x3320
movq -0xc8(%rbp), %rdi
cmpq %r15, %rdi
je 0xcd98
callq 0x3320
movq -0xa8(%rbp), %rdi
leaq -0x98(%rbp), %rax
cmpq %rax, %rdi
je 0xcdb0
callq 0x3320
movq -0x48(%rbp), %rdi
leaq -0x38(%rbp), %rax
cmpq %rax, %rdi
je 0xcdc2
callq 0x3320
addq $0xe8, %r12
cmpq -0x50(%rbp), %r12
jne 0xcc1e
addq $0x5a8, %rsp            # imm = 0x5A8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %r12
leaq -0x308(%rbp), %rax
movq -0x10(%rax), %rdi
jmp 0xcee4
movq %rax, %r12
movq -0x128(%rbp), %rdi
leaq -0x118(%rbp), %rax
cmpq %rax, %rdi
je 0xce1a
callq 0x3320
jmp 0xce1a
jmp 0xce71
movq %rax, %r12
movq -0x88(%rbp), %rdi
leaq -0x78(%rbp), %rax
cmpq %rax, %rdi
je 0xce34
callq 0x3320
jmp 0xce34
movq %rax, %r12
movq -0x48(%rbp), %rdi
leaq -0x38(%rbp), %rax
cmpq %rax, %rdi
je 0xce61
callq 0x3320
jmp 0xce61
movq %rax, %r12
movq -0x148(%rbp), %rdi
leaq -0x138(%rbp), %rax
jmp 0xcee4
movq %rax, %r12
movq -0x230(%rbp), %rdi
leaq -0x220(%rbp), %rax
jmp 0xcee4
movq %rax, %r12
jmp 0xceee
movq %rax, %r12
movq -0xe8(%rbp), %rdi
leaq -0xd8(%rbp), %rax
jmp 0xcee4
movq %rax, %r12
jmp 0xcedc
movq %rax, %r12
jmp 0xcec4
movq %rax, %r12
jmp 0xceb3
movq %rax, %r12
movq -0x108(%rbp), %rdi
leaq -0xf8(%rbp), %rax
cmpq %rax, %rdi
je 0xceb3
callq 0x3320
movq -0xc8(%rbp), %rdi
cmpq %r15, %rdi
je 0xcec4
callq 0x3320
movq -0xa8(%rbp), %rdi
leaq -0x98(%rbp), %rax
cmpq %rax, %rdi
je 0xcedc
callq 0x3320
movq -0x48(%rbp), %rdi
leaq -0x38(%rbp), %rax
cmpq %rax, %rdi
je 0xceee
callq 0x3320
movq %r12, %rdi
callq 0x3580