// File: /workspace/github_cpp_makefile_star2_O1/luisremis[P]SDFS/main.cpp
// Function: listeningCin(Membership*, FileSystem*)
void listeningCin(Membership* m, FileSystem* fs)
{
    std::string input;
    while (true)
    {
        std::cout << "Type a command (help for a list): ";
        // getline(std::cin, input);
        std::cin >> input;
        //std::cout << "You entered: " << input << std::endl;

        if (input.compare("help") == 0 || input.compare("h") == 0)
        {
            std::cout << "quit      (q)     - Exit normally" << std::endl;
            std::cout << "table     (t)     - Table of Membership List" << std::endl;
            std::cout << "join      (j)     - Join the system" << std::endl;
            std::cout << "leave     (l)     - Leave the system" << std::endl;
            std::cout << "leader    (ml)    - Leave the system" << std::endl;
            std::cout << "netstat   (n)     - Network usage" << std::endl;
            std::cout << "vtable    (vt)    - List the virtual ring for the filesystem" << std::endl;
            std::cout << "put       (p)     - Insert a file (put localfile remotefile)" << std::endl;
            std::cout << "get       (g)     - Get a file  (get remotefile localfile)" << std::endl;
            std::cout << "rm        ()      - Remove a file  (rm remotefile)" << std::endl;
            std::cout << "stored    ()      - List files in the present node" << std::endl;
        }
        else if (input.compare("quit") == 0 || input.compare("q") == 0)
        {
            std::cout << "Exiting normally " << std::endl;
            break;
        }
        else if (input.compare("clear") == 0 || input.compare("c") == 0)
        {
            system("clear");
        }
        else if (input.compare("table") == 0 || input.compare("t") == 0)
        {
            std::cout << m->printMember();
        }
        else if (input.compare("leave") == 0 || input.compare("l") == 0)
        {
            m->leave();
        }
        else if (input.compare("join") == 0 || input.compare("j") == 0)
        {
            m->join();
        }
        else if (input.compare("leader") == 0 || input.compare("ml") == 0)
        {
            std::cout << m->getLeader() << std::endl;
        }
        else if (input.compare("netstat") == 0 || input.compare("n") == 0)
        {
            std::cout << "UDP Stats: Sent: " << getUDPSent();
            std::cout << " Received: " << getUDPReceived() << std::endl;
        }
        else if (input.compare("put") == 0 || input.compare("p") == 0)
        {
            std::string localfile;
            std::string remotefile;
            std::cin >> localfile;
            std::cin >> remotefile;

            fs->put(localfile, remotefile);
        }
        else if (input.compare("get") == 0 || input.compare("g") == 0)
        {
            std::string localfile;
            std::string remotefile;
            std::cin >> remotefile;
            std::cin >> localfile;

            fs->get(localfile, remotefile);
        }
        else if (input.compare("vtable") == 0 || input.compare("vt") == 0)
        {
            fs->printVirtualRing();
        }
        else if (input.compare("rm") == 0)
        {
            std::string remotefile;
            std::cin >> remotefile;
            fs->deleteFromFS(remotefile);
        }
        else if (input.compare("list") == 0)
        {
            std::string remotefile;
            std::cin >> remotefile;
            fs->where(remotefile);
        }
        else if (input.compare("stored") == 0 || input.compare("s") == 0)
        {
            std::cout << "Local Files List: " << std::endl;
            std::cout << fs->getFileList() << std::endl;
        }
        else{
            std::cout << "PLEASE CHECK AGAIN THE POSSIBLE OPTIONS" << std::endl;
        }

    }

    return;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x138, %rsp            # imm = 0x138
movq %rsi, -0x50(%rbp)
movq %rdi, -0x78(%rbp)
leaq -0x148(%rbp), %rax
movq %rax, -0x10(%rax)
movq $0x0, -0x8(%rax)
movb $0x0, (%rax)
movq 0x145db(%rip), %r12     # 0x18fc0
movq 0x145ec(%rip), %r13     # 0x18fd8
leaq -0x158(%rbp), %rbx
leaq 0xe62d(%rip), %r14      # 0x13027
movl $0x22, %edx
movq %r12, %rdi
leaq 0xe5fb(%rip), %rsi      # 0x13004
callq 0x43f0
movq %r13, %rdi
movq %rbx, %rsi
callq 0x4430
movq %rbx, %rdi
movq %r14, %rsi
callq 0x4120
testl %eax, %eax
je 0x4c8c
movq %rbx, %rdi
leaq 0xe5f6(%rip), %rsi      # 0x1302c
callq 0x4120
testl %eax, %eax
je 0x4c8c
movq %rbx, %rdi
leaq 0xe7db(%rip), %rsi      # 0x13228
callq 0x4120
testl %eax, %eax
je 0x5300
movq %rbx, %rdi
leaq 0xe7c9(%rip), %rsi      # 0x1322d
callq 0x4120
testl %eax, %eax
je 0x5300
movq %rbx, %rdi
leaq 0xe7c6(%rip), %rsi      # 0x13241
callq 0x4120
testl %eax, %eax
je 0x4f28
movq %rbx, %rdi
leaq 0xe7b5(%rip), %rsi      # 0x13247
callq 0x4120
testl %eax, %eax
je 0x4f28
movq %rbx, %rdi
leaq 0xe7e6(%rip), %rsi      # 0x1328f
callq 0x4120
testl %eax, %eax
je 0x4f39
movq %rbx, %rdi
leaq 0xe7a6(%rip), %rsi      # 0x13266
callq 0x4120
testl %eax, %eax
je 0x4f39
movq %rbx, %rdi
leaq 0xe772(%rip), %rsi      # 0x13249
callq 0x4120
testl %eax, %eax
je 0x4f71
movq %rbx, %rdi
leaq 0xee85(%rip), %rsi      # 0x13973
callq 0x4120
testl %eax, %eax
je 0x4f71
movq %rbx, %rdi
leaq 0xe74a(%rip), %rsi      # 0x1324f
callq 0x4120
testl %eax, %eax
je 0x4f7f
movq %rbx, %rdi
leaq 0xe738(%rip), %rsi      # 0x13254
callq 0x4120
testl %eax, %eax
je 0x4f7f
movq %rbx, %rdi
leaq 0xe723(%rip), %rsi      # 0x13256
callq 0x4120
testl %eax, %eax
je 0x4f8d
movq %rbx, %rdi
leaq 0xe713(%rip), %rsi      # 0x1325d
callq 0x4120
testl %eax, %eax
je 0x4f8d
movq %rbx, %rdi
leaq 0xe6ff(%rip), %rsi      # 0x13260
callq 0x4120
testl %eax, %eax
je 0x4fd6
movq %rbx, %rdi
leaq 0xe8de(%rip), %rsi      # 0x13456
callq 0x4120
testl %eax, %eax
je 0x4fd6
movq %rbx, %rdi
leaq 0xe6f7(%rip), %rsi      # 0x13286
callq 0x4120
testl %eax, %eax
je 0x5038
movq %rbx, %rdi
leaq 0xe484(%rip), %rsi      # 0x1302a
callq 0x4120
testl %eax, %eax
je 0x5038
movq %rbx, %rdi
leaq 0xe6cd(%rip), %rsi      # 0x1328a
callq 0x4120
testl %eax, %eax
je 0x50fb
movq %rbx, %rdi
leaq 0xe73f(%rip), %rsi      # 0x13313
callq 0x4120
testl %eax, %eax
je 0x50fb
movq %rbx, %rdi
leaq 0xe6a3(%rip), %rsi      # 0x1328e
callq 0x4120
testl %eax, %eax
je 0x51de
movq %rbx, %rdi
leaq 0xe693(%rip), %rsi      # 0x13295
callq 0x4120
testl %eax, %eax
je 0x51de
movq %rbx, %rdi
leaq 0xe67f(%rip), %rsi      # 0x13298
callq 0x4120
testl %eax, %eax
je 0x51ec
movq %rbx, %rdi
leaq 0xe8c9(%rip), %rsi      # 0x134f9
callq 0x4120
testl %eax, %eax
je 0x5299
movq %rbx, %rdi
leaq 0xe654(%rip), %rsi      # 0x1329b
callq 0x4120
testl %eax, %eax
je 0x5253
movq %rbx, %rdi
leaq 0xee40(%rip), %rsi      # 0x13a9e
callq 0x4120
testl %eax, %eax
je 0x5253
movl $0x27, %edx
movq %r12, %rdi
leaq 0xe63b(%rip), %rsi      # 0x132b5
callq 0x43f0
movq %r12, %rdi
callq 0x41e0
jmp 0x49fa
movl $0x21, %edx
movq %r12, %rdi
leaq 0xe393(%rip), %rsi      # 0x1302e
callq 0x43f0
movq (%r12), %rax
movq -0x18(%rax), %rdi
addq %r12, %rdi
movl $0xa, %esi
callq 0x4380
movsbl %al, %esi
movq %r12, %rdi
callq 0x4040
movq %rax, %rdi
callq 0x4260
movl $0x2c, %edx
movq %r12, %rdi
leaq 0xe379(%rip), %rsi      # 0x13050
callq 0x43f0
movq (%r12), %rax
movq -0x18(%rax), %rdi
addq %r12, %rdi
movl $0xa, %esi
callq 0x4380
movsbl %al, %esi
movq %r12, %rdi
callq 0x4040
movq %rax, %rdi
callq 0x4260
movl $0x23, %edx
movq %r12, %rdi
leaq 0xe36a(%rip), %rsi      # 0x1307d
callq 0x43f0
movq (%r12), %rax
movq -0x18(%rax), %rdi
addq %r12, %rdi
movl $0xa, %esi
callq 0x4380
movsbl %al, %esi
movq %r12, %rdi
callq 0x4040
movq %rax, %rdi
callq 0x4260
movl $0x24, %edx
movq %r12, %rdi
leaq 0xe352(%rip), %rsi      # 0x130a1
callq 0x43f0
movq (%r12), %rax
movq -0x18(%rax), %rdi
addq %r12, %rdi
movl $0xa, %esi
callq 0x4380
movsbl %al, %esi
movq %r12, %rdi
callq 0x4040
movq %rax, %rdi
callq 0x4260
movl $0x24, %edx
movq %r12, %rdi
leaq 0xe33b(%rip), %rsi      # 0x130c6
callq 0x43f0
movq (%r12), %rax
movq -0x18(%rax), %rdi
addq %r12, %rdi
movl $0xa, %esi
callq 0x4380
movsbl %al, %esi
movq %r12, %rdi
callq 0x4040
movq %rax, %rdi
callq 0x4260
movl $0x21, %edx
movq %r12, %rdi
leaq 0xe324(%rip), %rsi      # 0x130eb
callq 0x43f0
movq (%r12), %rax
movq -0x18(%rax), %rdi
addq %r12, %rdi
movl $0xa, %esi
callq 0x4380
movsbl %al, %esi
movq %r12, %rdi
callq 0x4040
movq %rax, %rdi
callq 0x4260
movl $0x3c, %edx
movq %r12, %rdi
leaq 0xe30a(%rip), %rsi      # 0x1310d
callq 0x43f0
movq (%r12), %rax
movq -0x18(%rax), %rdi
addq %r12, %rdi
movl $0xa, %esi
callq 0x4380
movsbl %al, %esi
movq %r12, %rdi
callq 0x4040
movq %rax, %rdi
callq 0x4260
movl $0x3c, %edx
movq %r12, %rdi
leaq 0xe30b(%rip), %rsi      # 0x1314a
callq 0x43f0
movq (%r12), %rax
movq -0x18(%rax), %rdi
addq %r12, %rdi
movl $0xa, %esi
callq 0x4380
movsbl %al, %esi
movq %r12, %rdi
callq 0x4040
movq %rax, %rdi
callq 0x4260
movl $0x3a, %edx
movq %r12, %rdi
leaq 0xe30c(%rip), %rsi      # 0x13187
callq 0x43f0
movq (%r12), %rax
movq -0x18(%rax), %rdi
addq %r12, %rdi
movl $0xa, %esi
callq 0x4380
movsbl %al, %esi
movq %r12, %rdi
callq 0x4040
movq %rax, %rdi
callq 0x4260
movl $0x32, %edx
movq %r12, %rdi
leaq 0xe30b(%rip), %rsi      # 0x131c2
callq 0x43f0
movq (%r12), %rax
movq -0x18(%rax), %rdi
addq %r12, %rdi
movl $0xa, %esi
callq 0x4380
movsbl %al, %esi
movq %r12, %rdi
callq 0x4040
movq %rax, %rdi
callq 0x4260
movl $0x32, %edx
movq %r12, %rdi
leaq 0xe302(%rip), %rsi      # 0x131f5
callq 0x43f0
movq (%r12), %rax
movq -0x18(%rax), %rdi
addq %r12, %rdi
movl $0xa, %esi
callq 0x4380
movq %r12, %r15
movsbl %al, %esi
movq %r15, %rdi
callq 0x4040
movq %rax, %rdi
callq 0x4260
jmp 0x49fa
leaq 0xe312(%rip), %rdi      # 0x13241
callq 0x4300
jmp 0x49fa
leaq -0x48(%rbp), %rdi
movq -0x78(%rbp), %rsi
callq 0x93de
movq -0x48(%rbp), %rsi
movq -0x40(%rbp), %rdx
movq %r12, %rdi
callq 0x43f0
movq -0x48(%rbp), %rdi
leaq -0x38(%rbp), %rax
cmpq %rax, %rdi
je 0x49fa
callq 0x4360
jmp 0x49fa
movq -0x78(%rbp), %rdi
callq 0x7b72
jmp 0x49fa
movq -0x78(%rbp), %rdi
callq 0x5ebc
jmp 0x49fa
leaq -0x48(%rbp), %rdi
movq -0x78(%rbp), %rsi
callq 0x9954
movq -0x48(%rbp), %rsi
movq -0x40(%rbp), %rdx
movq %r12, %rdi
callq 0x43f0
movq %rax, %r15
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r15, %rdi
movl $0xa, %esi
callq 0x4380
movsbl %al, %esi
movq %r15, %rdi
callq 0x4040
movq %rax, %rdi
callq 0x4260
jmp 0x4f56
movl $0x11, %edx
movq %r12, %rdi
leaq 0xe283(%rip), %rsi      # 0x13268
callq 0x43f0
callq 0x11480
movq %r12, %rdi
movl %eax, %esi
callq 0x45f0
movl $0xb, %edx
movq %r12, %rdi
leaq 0xe272(%rip), %rsi      # 0x1327a
callq 0x43f0
callq 0x1148c
movq %r12, %rdi
movl %eax, %esi
callq 0x45f0
movq %rax, %r15
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r15, %rdi
movl $0xa, %esi
callq 0x4380
jmp 0x4f10
leaq -0x38(%rbp), %rax
movq %rax, -0x48(%rbp)
xorl %ecx, %ecx
movq %rcx, -0x40(%rbp)
movb %cl, -0x38(%rbp)
leaq -0x60(%rbp), %rax
movq %rax, -0x70(%rbp)
movq %rcx, -0x68(%rbp)
movb %cl, -0x60(%rbp)
movq %r13, %rdi
leaq -0x48(%rbp), %rsi
callq 0x4430
movq %r13, %rdi
leaq -0x70(%rbp), %rsi
callq 0x4430
leaq -0xa8(%rbp), %rax
movq %rax, -0xb8(%rbp)
movq -0x48(%rbp), %rsi
movq -0x40(%rbp), %rdx
addq %rsi, %rdx
leaq -0xb8(%rbp), %rdi
callq 0x570a
leaq -0x128(%rbp), %rax
movq %rax, -0x138(%rbp)
movq -0x70(%rbp), %rsi
movq -0x68(%rbp), %rdx
addq %rsi, %rdx
leaq -0x138(%rbp), %r15
movq %r15, %rdi
callq 0x570a
movq -0x50(%rbp), %rdi
leaq -0xb8(%rbp), %rsi
movq %r15, %rdx
callq 0xc942
movq -0x138(%rbp), %rdi
leaq -0x128(%rbp), %rax
cmpq %rax, %rdi
je 0x50e8
callq 0x4360
movq -0xb8(%rbp), %rdi
leaq -0xa8(%rbp), %rax
jmp 0x51b9
leaq -0x38(%rbp), %rax
movq %rax, -0x48(%rbp)
xorl %ecx, %ecx
movq %rcx, -0x40(%rbp)
movb %cl, -0x38(%rbp)
leaq -0x60(%rbp), %rax
movq %rax, -0x70(%rbp)
movq %rcx, -0x68(%rbp)
movb %cl, -0x60(%rbp)
movq %r13, %rdi
leaq -0x70(%rbp), %rsi
callq 0x4430
movq %r13, %rdi
leaq -0x48(%rbp), %rsi
callq 0x4430
leaq -0x88(%rbp), %rax
movq %rax, -0x98(%rbp)
movq -0x48(%rbp), %rsi
movq -0x40(%rbp), %rdx
addq %rsi, %rdx
leaq -0x98(%rbp), %rdi
callq 0x570a
leaq -0x108(%rbp), %rax
movq %rax, -0x118(%rbp)
movq -0x70(%rbp), %rsi
movq -0x68(%rbp), %rdx
addq %rsi, %rdx
leaq -0x118(%rbp), %r15
movq %r15, %rdi
callq 0x570a
movq -0x50(%rbp), %rdi
leaq -0x98(%rbp), %rsi
movq %r15, %rdx
callq 0xd2ee
movq -0x118(%rbp), %rdi
leaq -0x108(%rbp), %rax
cmpq %rax, %rdi
je 0x51ab
callq 0x4360
movq -0x98(%rbp), %rdi
leaq -0x88(%rbp), %rax
cmpq %rax, %rdi
je 0x51c3
callq 0x4360
movq -0x70(%rbp), %rdi
leaq -0x60(%rbp), %rax
cmpq %rax, %rdi
je 0x4f56
callq 0x4360
jmp 0x4f56
movq -0x50(%rbp), %rdi
callq 0xee06
jmp 0x49fa
leaq -0x38(%rbp), %rax
movq %rax, -0x48(%rbp)
movq $0x0, -0x40(%rbp)
movb $0x0, -0x38(%rbp)
movq %r13, %rdi
leaq -0x48(%rbp), %rsi
callq 0x4430
leaq -0xf8(%rbp), %r15
leaq -0xe8(%rbp), %rax
movq %rax, -0xf8(%rbp)
movq -0x48(%rbp), %rsi
movq -0x40(%rbp), %rdx
addq %rsi, %rdx
movq %r15, %rdi
callq 0x570a
movq -0x50(%rbp), %rdi
movq %r15, %rsi
callq 0xd84c
movq -0xf8(%rbp), %rdi
leaq -0xe8(%rbp), %rax
jmp 0x51cb
movl $0x12, %edx
movq %r12, %rdi
leaq 0xe040(%rip), %rsi      # 0x132a2
callq 0x43f0
movq %r12, %rdi
callq 0x41e0
leaq -0x48(%rbp), %rdi
movq -0x50(%rbp), %rsi
callq 0xe560
movq -0x48(%rbp), %rsi
movq -0x40(%rbp), %rdx
movq %r12, %rdi
callq 0x43f0
movq %rax, %rdi
callq 0x41e0
jmp 0x4f56
leaq -0x38(%rbp), %rax
movq %rax, -0x48(%rbp)
movq $0x0, -0x40(%rbp)
movb $0x0, -0x38(%rbp)
movq %r13, %rdi
leaq -0x48(%rbp), %rsi
callq 0x4430
leaq -0xd8(%rbp), %r15
leaq -0xc8(%rbp), %rax
movq %rax, -0xd8(%rbp)
movq -0x48(%rbp), %rsi
movq -0x40(%rbp), %rdx
addq %rsi, %rdx
movq %r15, %rdi
callq 0x570a
movq -0x50(%rbp), %rdi
movq %r15, %rsi
callq 0xcd0c
movq -0xd8(%rbp), %rdi
leaq -0xc8(%rbp), %rax
jmp 0x51cb
movq 0x13cb9(%rip), %rbx     # 0x18fc0
leaq 0xdf21(%rip), %rsi      # 0x1322f
movl $0x11, %edx
movq %rbx, %rdi
callq 0x43f0
movq (%rbx), %rax
addq -0x18(%rax), %rbx
movq %rbx, %rdi
movl $0xa, %esi
callq 0x4380
movsbl %al, %esi
movq 0x13c87(%rip), %rdi     # 0x18fc0
callq 0x4040
movq %rax, %rdi
callq 0x4260
movq -0x158(%rbp), %rdi
leaq -0x148(%rbp), %rax
cmpq %rax, %rdi
je 0x535e
callq 0x4360
addq $0x138, %rsp            # imm = 0x138
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movq -0xd8(%rbp), %rdi
leaq -0xc8(%rbp), %rax
jmp 0x5424
jmp 0x544f
jmp 0x5434
jmp 0x5434
movq %rax, %rbx
movq -0xf8(%rbp), %rdi
leaq -0xe8(%rbp), %rax
jmp 0x5424
jmp 0x5434
movq %rax, %rbx
movq -0x118(%rbp), %rdi
leaq -0x108(%rbp), %rax
cmpq %rax, %rdi
je 0x53cd
callq 0x4360
jmp 0x53cd
movq %rax, %rbx
movq -0x98(%rbp), %rdi
leaq -0x88(%rbp), %rax
jmp 0x540b
movq %rax, %rbx
movq -0x138(%rbp), %rdi
leaq -0x128(%rbp), %rax
cmpq %rax, %rdi
je 0x53fd
callq 0x4360
jmp 0x53fd
movq %rax, %rbx
movq -0xb8(%rbp), %rdi
leaq -0xa8(%rbp), %rax
cmpq %rax, %rdi
je 0x541c
callq 0x4360
jmp 0x541c
jmp 0x5419
movq %rax, %rbx
movq -0x70(%rbp), %rdi
leaq -0x60(%rbp), %rax
cmpq %rax, %rdi
je 0x5437
callq 0x4360
jmp 0x5437
jmp 0x544f
jmp 0x5434
movq %rax, %rbx
movq -0x48(%rbp), %rdi
leaq -0x38(%rbp), %rax
cmpq %rax, %rdi
je 0x5452
callq 0x4360
jmp 0x5452
jmp 0x544f
jmp 0x544f
movq %rax, %rbx
movq -0x158(%rbp), %rdi
leaq -0x148(%rbp), %rax
cmpq %rax, %rdi
je 0x546a
callq 0x4360
movq %rbx, %rdi
callq 0x4630