// File: vianna274[P]dropbox/src/Server.cpp
// Function: Dropbox::Server::initializeUsers()
void Server::initializeUsers()
{
    DIR *dir;
    struct dirent *ent;
    if ((dir = opendir (rootDir.c_str())) != NULL) {
        while ((ent = readdir (dir)) != NULL) {
            if(ent->d_type == 0x4 && string(ent->d_name) != string("..") && string(ent->d_name) != string(".")) {
                User *user = new User(ent->d_name, rootDir+ent->d_name+"/");
                users.push_back(user);
            }
        }
        closedir(dir);
    } 
    else if(mkdir(rootDir.c_str(), 0777) == 0) 
        cout << "CREATED ROOT DIR" << endl;
    else
        cout << "COULDN'T OPEN OR CREATE ROOT DIR" << endl;

    cout << "System Users :" << endl;
    for(User *user : users)
    {
        cout << user->getUsername().c_str() << endl;
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x1f0, %rsp            # imm = 0x1F0
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rdi
movq %rdi, -0x188(%rbp)
callq 0x3180
movq %rax, %rdi
callq 0x3520
movq %rax, -0x10(%rbp)
cmpq $0x0, %rax
je 0xc4b0
jmp 0xbff7
movq -0x10(%rbp), %rdi
callq 0x3540
movq %rax, -0x18(%rbp)
cmpq $0x0, %rax
je 0xc4a5
movq -0x18(%rbp), %rax
movzbl 0x12(%rax), %ecx
movb $0x0, -0x3a(%rbp)
movb $0x0, -0x4d(%rbp)
movb $0x0, -0x72(%rbp)
movb $0x0, -0x73(%rbp)
movb $0x0, -0x9a(%rbp)
movb $0x0, -0x9b(%rbp)
movb $0x0, -0xc2(%rbp)
movb $0x0, -0xc3(%rbp)
xorl %eax, %eax
cmpl $0x4, %ecx
movb %al, -0x189(%rbp)
jne 0xc187
movq -0x18(%rbp), %rax
addq $0x13, %rax
movq %rax, -0x1a0(%rbp)
leaq -0x39(%rbp), %rdi
movq %rdi, -0x198(%rbp)
callq 0x3620
movq -0x1a0(%rbp), %rsi
movq -0x198(%rbp), %rdx
movb $0x1, -0x3a(%rbp)
leaq -0x38(%rbp), %rdi
callq 0x3480
jmp 0xc08f
movb $0x1, -0x4d(%rbp)
leaq -0x71(%rbp), %rdi
movq %rdi, -0x1a8(%rbp)
callq 0x3620
movq -0x1a8(%rbp), %rdx
movb $0x1, -0x72(%rbp)
leaq 0xd367(%rip), %rsi      # 0x1941c
leaq -0x70(%rbp), %rdi
callq 0x3480
jmp 0xc0c0
movb $0x1, -0x73(%rbp)
leaq -0x38(%rbp), %rdi
leaq -0x70(%rbp), %rsi
callq 0x123d0
movb %al, %cl
xorl %eax, %eax
testb $0x1, %cl
movb %al, -0x189(%rbp)
jne 0xc0e5
jmp 0xc187
movq -0x18(%rbp), %rax
addq $0x13, %rax
movq %rax, -0x1b8(%rbp)
leaq -0x99(%rbp), %rdi
movq %rdi, -0x1b0(%rbp)
callq 0x3620
movq -0x1b8(%rbp), %rsi
movq -0x1b0(%rbp), %rdx
movb $0x1, -0x9a(%rbp)
leaq -0x98(%rbp), %rdi
callq 0x3480
jmp 0xc12a
movb $0x1, -0x9b(%rbp)
leaq -0xc1(%rbp), %rdi
movq %rdi, -0x1c0(%rbp)
callq 0x3620
movq -0x1c0(%rbp), %rdx
movb $0x1, -0xc2(%rbp)
leaq 0xd2c4(%rip), %rsi      # 0x1941d
leaq -0xc0(%rbp), %rdi
callq 0x3480
jmp 0xc167
movb $0x1, -0xc3(%rbp)
leaq -0x98(%rbp), %rdi
leaq -0xc0(%rbp), %rsi
callq 0x123d0
movb %al, -0x189(%rbp)
movb -0x189(%rbp), %al
movb %al, -0x1c1(%rbp)
testb $0x1, -0xc3(%rbp)
jne 0xc19e
jmp 0xc1aa
leaq -0xc0(%rbp), %rdi
callq 0x3280
testb $0x1, -0xc2(%rbp)
jne 0xc1b5
jmp 0xc1c1
leaq -0xc1(%rbp), %rdi
callq 0x33e0
testb $0x1, -0x9b(%rbp)
jne 0xc1cc
jmp 0xc1d8
leaq -0x98(%rbp), %rdi
callq 0x3280
testb $0x1, -0x9a(%rbp)
jne 0xc1e3
jmp 0xc1ef
leaq -0x99(%rbp), %rdi
callq 0x33e0
testb $0x1, -0x73(%rbp)
jne 0xc1f7
jmp 0xc200
leaq -0x70(%rbp), %rdi
callq 0x3280
testb $0x1, -0x72(%rbp)
jne 0xc208
jmp 0xc211
leaq -0x71(%rbp), %rdi
callq 0x33e0
testb $0x1, -0x4d(%rbp)
jne 0xc219
jmp 0xc222
leaq -0x38(%rbp), %rdi
callq 0x3280
testb $0x1, -0x3a(%rbp)
jne 0xc22a
jmp 0xc233
leaq -0x39(%rbp), %rdi
callq 0x33e0
movb -0x1c1(%rbp), %al
testb $0x1, %al
jne 0xc242
jmp 0xc4a0
movl $0x98, %edi
callq 0x33b0
movq %rax, -0x1e0(%rbp)
movb $0x1, -0x139(%rbp)
movq -0x18(%rbp), %rax
addq $0x13, %rax
movq %rax, -0x1d8(%rbp)
leaq -0xf1(%rbp), %rdi
movq %rdi, -0x1d0(%rbp)
callq 0x3620
movq -0x1d8(%rbp), %rsi
movq -0x1d0(%rbp), %rdx
leaq -0xf0(%rbp), %rdi
callq 0x3480
jmp 0xc298
movq -0x188(%rbp), %rsi
movq -0x18(%rbp), %rdx
addq $0x13, %rdx
leaq -0x138(%rbp), %rdi
callq 0xbb80
jmp 0xc2b5
leaq 0xd14b(%rip), %rdx      # 0x19407
leaq -0x118(%rbp), %rdi
leaq -0x138(%rbp), %rsi
callq 0x6730
jmp 0xc2d1
movq -0x1e0(%rbp), %rdi
leaq -0xf0(%rbp), %rsi
leaq -0x118(%rbp), %rdx
callq 0x16aa0
jmp 0xc2ed
movb $0x0, -0x139(%rbp)
leaq -0x118(%rbp), %rdi
callq 0x3280
leaq -0x138(%rbp), %rdi
callq 0x3280
leaq -0xf0(%rbp), %rdi
callq 0x3280
leaq -0xf1(%rbp), %rdi
callq 0x33e0
movq -0x1e0(%rbp), %rax
movq -0x188(%rbp), %rdi
movq %rax, -0xd0(%rbp)
addq $0x958, %rdi            # imm = 0x958
leaq -0xd0(%rbp), %rsi
callq 0x12360
jmp 0xc4a0
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
jmp 0xc408
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
jmp 0xc3e4
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
jmp 0xc3ba
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
testb $0x1, -0xc2(%rbp)
jne 0xc395
jmp 0xc3a1
leaq -0xc1(%rbp), %rdi
callq 0x33e0
testb $0x1, -0x9b(%rbp)
jne 0xc3ac
jmp 0xc3b8
leaq -0x98(%rbp), %rdi
callq 0x3280
jmp 0xc3ba
testb $0x1, -0x9a(%rbp)
jne 0xc3c5
jmp 0xc3d1
leaq -0x99(%rbp), %rdi
callq 0x33e0
testb $0x1, -0x73(%rbp)
jne 0xc3d9
jmp 0xc3e2
leaq -0x70(%rbp), %rdi
callq 0x3280
jmp 0xc3e4
testb $0x1, -0x72(%rbp)
jne 0xc3ec
jmp 0xc3f5
leaq -0x71(%rbp), %rdi
callq 0x33e0
testb $0x1, -0x4d(%rbp)
jne 0xc3fd
jmp 0xc406
leaq -0x38(%rbp), %rdi
callq 0x3280
jmp 0xc408
testb $0x1, -0x3a(%rbp)
jne 0xc410
jmp 0xc419
leaq -0x39(%rbp), %rdi
callq 0x33e0
jmp 0xc637
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
jmp 0xc478
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
jmp 0xc46c
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
jmp 0xc460
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
leaq -0x118(%rbp), %rdi
callq 0x3280
leaq -0x138(%rbp), %rdi
callq 0x3280
leaq -0xf0(%rbp), %rdi
callq 0x3280
leaq -0xf1(%rbp), %rdi
callq 0x33e0
testb $0x1, -0x139(%rbp)
jne 0xc48f
jmp 0xc49b
movq -0x1e0(%rbp), %rdi
callq 0x3370
jmp 0xc637
jmp 0xbff7
movq -0x10(%rbp), %rdi
callq 0x3580
jmp 0xc516
movq -0x188(%rbp), %rdi
callq 0x3180
movq %rax, %rdi
movl $0x1ff, %esi            # imm = 0x1FF
callq 0x31d0
cmpl $0x0, %eax
jne 0xc4f2
movq 0x16af3(%rip), %rdi     # 0x22fc8
leaq 0xcf43(%rip), %rsi      # 0x1941f
callq 0x33a0
movq %rax, %rdi
movq 0x16ac5(%rip), %rsi     # 0x22fb0
callq 0x33d0
jmp 0xc514
movq 0x16acf(%rip), %rdi     # 0x22fc8
leaq 0xcf30(%rip), %rsi      # 0x19430
callq 0x33a0
movq %rax, %rdi
movq 0x16aa1(%rip), %rsi     # 0x22fb0
callq 0x33d0
jmp 0xc516
movq 0x16aab(%rip), %rdi     # 0x22fc8
leaq 0xcf2d(%rip), %rsi      # 0x19451
callq 0x33a0
movq %rax, %rdi
movq 0x16a7d(%rip), %rsi     # 0x22fb0
callq 0x33d0
movq -0x188(%rbp), %rax
addq $0x958, %rax            # imm = 0x958
movq %rax, -0x148(%rbp)
movq -0x148(%rbp), %rdi
callq 0x12070
movq %rax, -0x150(%rbp)
movq -0x148(%rbp), %rdi
callq 0x120a0
movq %rax, -0x158(%rbp)
leaq -0x150(%rbp), %rdi
leaq -0x158(%rbp), %rsi
callq 0x120d0
testb $0x1, %al
jne 0xc58e
jmp 0xc62e
leaq -0x150(%rbp), %rdi
callq 0x12110
movq (%rax), %rax
movq %rax, -0x160(%rbp)
movq -0x160(%rbp), %rsi
leaq -0x180(%rbp), %rdi
movq %rdi, -0x1f0(%rbp)
callq 0x17010
movq -0x1f0(%rbp), %rdi
callq 0x3180
movq %rax, %rsi
movq 0x169f4(%rip), %rdi     # 0x22fc8
callq 0x33a0
movq %rax, -0x1e8(%rbp)
jmp 0xc5e2
movq -0x1e8(%rbp), %rdi
movq 0x169c0(%rip), %rsi     # 0x22fb0
callq 0x33d0
jmp 0xc5f7
leaq -0x180(%rbp), %rdi
callq 0x3280
leaq -0x150(%rbp), %rdi
callq 0x12180
jmp 0xc572
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
leaq -0x180(%rbp), %rdi
callq 0x3280
jmp 0xc637
addq $0x1f0, %rsp            # imm = 0x1F0
popq %rbp
retq
movq -0x48(%rbp), %rdi
callq 0x3610