// File: /workspace/github_cpp_makefile_star2_O1/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 0x868f(%rip), %r14      # 0x14fd0
leaq 0x3b48(%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 0xe556
movq (%r15), %rsi
movq 0x8(%r15), %rdx
movq %r14, %rdi
callq 0x33a0
movq %rax, %r14
leaq 0x3b1e(%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 0xc9cd
callq 0x3320
movq -0x50(%rbp), %rax
movq (%rax), %r12
cmpq 0x8(%rax), %r12
movq %r13, %rbx
je 0xcc4f
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 0xc78e
cmpl $0x1e, %eax
je 0xcb02
cmpl $0x1f, %eax
jne 0xcc3a
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 0x62de
movq -0x58(%rbp), %rdi
movq -0x60(%rbp), %rsi
movq %r15, %rdx
callq 0x7dfe
movq -0xe8(%rbp), %rdi
leaq -0xd8(%rbp), %rax
cmpq %rax, %rdi
je 0xca6e
callq 0x3320
leaq -0x230(%rbp), %rdi
movq -0x68(%rbp), %rsi
callq 0xe582
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 0x62de
movq -0x230(%rbp), %rcx
movl $0xf, %esi
leaq -0x220(%rbp), %rax
cmpq %rax, %rcx
je 0xcac4
movq -0x220(%rbp), %rsi
movq -0x228(%rbp), %r8
movq -0x40(%rbp), %rdx
leaq (%rdx,%r8), %rax
cmpq %rsi, %rax
jbe 0xcaf0
movl $0xf, %esi
leaq -0x38(%rbp), %rdi
cmpq %rdi, -0x48(%rbp)
je 0xcaeb
movq -0x38(%rbp), %rsi
cmpq %rsi, %rax
jbe 0xcb3e
movq -0x48(%rbp), %rsi
leaq -0x230(%rbp), %rdi
callq 0x3100
jmp 0xcb4b
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 0x7dfe
movq -0x148(%rbp), %rdi
leaq -0x138(%rbp), %rax
jmp 0xcc30
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 0xcb72
movq %rdx, -0x88(%rbp)
movq (%rcx), %rdx
movq %rdx, -0x78(%rbp)
jmp 0xcb78
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 0xe556
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 0x6a6c
movq -0x128(%rbp), %rdi
leaq -0x118(%rbp), %rax
cmpq %rax, %rdi
je 0xcbfb
callq 0x3320
movq -0x88(%rbp), %rdi
leaq -0x78(%rbp), %rax
cmpq %rax, %rdi
je 0xcc10
callq 0x3320
movq -0x48(%rbp), %rdi
leaq -0x38(%rbp), %rax
cmpq %rax, %rdi
je 0xcc22
callq 0x3320
movq -0x230(%rbp), %rdi
leaq -0x220(%rbp), %rax
cmpq %rax, %rdi
je 0xcc3a
callq 0x3320
addq $0xe8, %r12
movq -0x50(%rbp), %rax
cmpq 0x8(%rax), %r12
jne 0xc9e8
movq (%rbx), %r12
movq 0x8(%rbx), %rax
movq %rax, -0x50(%rbp)
cmpq %rax, %r12
je 0xce2a
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 0xe582
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 0x62de
movq -0x48(%rbp), %rcx
movl $0xf, %esi
leaq -0x38(%rbp), %rax
cmpq %rax, %rcx
je 0xccd4
movq -0x38(%rbp), %rsi
movq -0x40(%rbp), %r8
movq -0xa0(%rbp), %rdx
leaq (%rdx,%r8), %rax
cmpq %rsi, %rax
jbe 0xcd09
movl $0xf, %esi
leaq -0x98(%rbp), %rdi
cmpq %rdi, -0xa8(%rbp)
je 0xcd04
movq -0x98(%rbp), %rsi
cmpq %rsi, %rax
jbe 0xcd1b
movq -0xa8(%rbp), %rsi
leaq -0x48(%rbp), %rdi
callq 0x3100
jmp 0xcd2b
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 0xcd51
movq %rdx, -0xc8(%rbp)
movq (%rcx), %rdx
movq %rdx, -0xb8(%rbp)
jmp 0xcd58
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 0xe556
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 0x6a6c
movq -0x108(%rbp), %rdi
leaq -0xf8(%rbp), %rax
cmpq %rax, %rdi
je 0xcdde
callq 0x3320
movq -0xc8(%rbp), %rdi
cmpq %r15, %rdi
je 0xcdef
callq 0x3320
movq -0xa8(%rbp), %rdi
leaq -0x98(%rbp), %rax
cmpq %rax, %rdi
je 0xce07
callq 0x3320
movq -0x48(%rbp), %rdi
leaq -0x38(%rbp), %rax
cmpq %rax, %rdi
je 0xce19
callq 0x3320
addq $0xe8, %r12
cmpq -0x50(%rbp), %r12
jne 0xcc71
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 0xcf3b
movq %rax, %r12
movq -0x128(%rbp), %rdi
leaq -0x118(%rbp), %rax
cmpq %rax, %rdi
je 0xce71
callq 0x3320
jmp 0xce71
jmp 0xcec8
movq %rax, %r12
movq -0x88(%rbp), %rdi
leaq -0x78(%rbp), %rax
cmpq %rax, %rdi
je 0xce8b
callq 0x3320
jmp 0xce8b
movq %rax, %r12
movq -0x48(%rbp), %rdi
leaq -0x38(%rbp), %rax
cmpq %rax, %rdi
je 0xceb8
callq 0x3320
jmp 0xceb8
movq %rax, %r12
movq -0x148(%rbp), %rdi
leaq -0x138(%rbp), %rax
jmp 0xcf3b
movq %rax, %r12
movq -0x230(%rbp), %rdi
leaq -0x220(%rbp), %rax
jmp 0xcf3b
movq %rax, %r12
jmp 0xcf45
movq %rax, %r12
movq -0xe8(%rbp), %rdi
leaq -0xd8(%rbp), %rax
jmp 0xcf3b
movq %rax, %r12
jmp 0xcf33
movq %rax, %r12
jmp 0xcf1b
movq %rax, %r12
jmp 0xcf0a
movq %rax, %r12
movq -0x108(%rbp), %rdi
leaq -0xf8(%rbp), %rax
cmpq %rax, %rdi
je 0xcf0a
callq 0x3320
movq -0xc8(%rbp), %rdi
cmpq %r15, %rdi
je 0xcf1b
callq 0x3320
movq -0xa8(%rbp), %rdi
leaq -0x98(%rbp), %rax
cmpq %rax, %rdi
je 0xcf33
callq 0x3320
movq -0x48(%rbp), %rdi
leaq -0x38(%rbp), %rax
cmpq %rax, %rdi
je 0xcf45
callq 0x3320
movq %r12, %rdi
callq 0x3580
nop