// File: /workspace/github_cpp_makefile_star2_O2/billDrett[P]Bulletin-Boards/boardPost.cpp
// Function: BoardPost::menu(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>&)
int BoardPost::menu(string& line)
{
    string command, msg;
    int id;
    istringstream iss(line);

    iss>> command;
    if(iss.fail())
    {
        cout<<"error command"<<endl;
        cout<<line<<endl;
        return 0;
    }
    if(command == "list")
    {
        cout<<"Available chanels: "<<endl;
        this->getChanels();
    }
    else if(command == "write") //theloume na steiloume mnm me space
    {
        iss >>id >> msg ;
        if(!iss)
        {
            cout<<"error command"<<endl;
        }
        msg.insert(0, " "); //mporei to msg na einai substring tou command gia auto to logo vazoume to space etsi eksasfalizoume oti to find dn tha vrei kapoio substring tou command
        int pos = line.find(msg);
        line.erase(0, pos+1); //thelw na svisw to space pou prosthesa arxika gia auto to kanw pos+1

        this->sendMessage(line, id);
        cout<<"Message send"<<endl;
    }
    else if(command == "send")
    {
        iss >>id >> msg ;
        if(!iss)
        {
            cout<<"error command"<<endl;
        }
        this->sendFile(msg, id);
        cout<<"File send"<<endl;
    }
    else if(command == "exit")
    {
        cout<<"Exit boardPost"<<endl;
        this->exitBoardPost();
        return -1;
    }
    else //error
    {
        cout<<"error"<<endl;
    }
    return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
subq $0x210, %rsp            # imm = 0x210
movq %rsi, %r14
movq %rdi, %rbx
leaq -0x48(%rbp), %rax
movq %rax, -0x10(%rax)
andq $0x0, -0x8(%rax)
xorl %ecx, %ecx
movb %cl, (%rax)
leaq -0x28(%rbp), %rax
movq %rax, -0x10(%rax)
andq $0x0, -0x8(%rax)
movb %cl, (%rax)
leaq -0x218(%rbp), %rdi
pushq $0x8
popq %rdx
callq 0x2230
leaq -0x218(%rbp), %rdi
leaq -0x58(%rbp), %rsi
callq 0x21d0
movq -0x218(%rbp), %rax
movq -0x18(%rax), %rax
testb $0x5, -0x1f8(%rbp,%rax)
je 0x2f7b
movq 0x3085(%rip), %rdi      # 0x5fd0
leaq 0x119f(%rip), %rsi      # 0x40f1
callq 0x2170
movq %rax, %rdi
callq 0x20e0
movq 0x306a(%rip), %rdi      # 0x5fd0
movq %r14, %rsi
callq 0x2150
movq %rax, %rdi
callq 0x20e0
jmp 0x3092
leaq 0x117d(%rip), %rsi      # 0x40ff
leaq -0x58(%rbp), %rdi
callq 0x31fd
testb %al, %al
je 0x2fb7
movq 0x303a(%rip), %rdi      # 0x5fd0
leaq 0x1167(%rip), %rsi      # 0x4104
callq 0x2170
movq %rax, %rdi
callq 0x20e0
movq %rbx, %rdi
callq 0x2908
jmp 0x3092
leaq 0x115a(%rip), %rsi      # 0x4118
leaq -0x58(%rbp), %rdi
callq 0x31fd
testb %al, %al
je 0x30c0
leaq -0x218(%rbp), %rdi
leaq -0x14(%rbp), %rsi
callq 0x2110
leaq -0x38(%rbp), %rsi
movq %rax, %rdi
callq 0x21d0
movq -0x218(%rbp), %rax
movq -0x18(%rax), %rax
testb $0x5, -0x1f8(%rbp,%rax)
je 0x301b
movq 0x2fc9(%rip), %rdi      # 0x5fd0
leaq 0x10e3(%rip), %rsi      # 0x40f1
callq 0x2170
movq %rax, %rdi
callq 0x20e0
leaq 0x10f4(%rip), %rdx      # 0x4116
leaq -0x38(%rbp), %rdi
xorl %esi, %esi
callq 0x2060
leaq -0x38(%rbp), %rsi
movq %r14, %rdi
xorl %edx, %edx
callq 0x22a0
incl %eax
movslq %eax, %rdx
movq %r14, %rdi
xorl %esi, %esi
callq 0x2050
leaq -0x98(%rbp), %rdi
movq %r14, %rsi
callq 0x2200
movl -0x14(%rbp), %edx
leaq -0x98(%rbp), %rsi
movq %rbx, %rdi
callq 0x2b60
leaq -0x98(%rbp), %rdi
callq 0x20c0
movq 0x2f52(%rip), %rdi      # 0x5fd0
leaq 0x1099(%rip), %rsi      # 0x411e
callq 0x2170
movq %rax, %rdi
callq 0x20e0
xorl %ebx, %ebx
leaq -0x218(%rbp), %rdi
callq 0x20d0
leaq -0x38(%rbp), %rdi
callq 0x20c0
leaq -0x58(%rbp), %rdi
callq 0x20c0
movl %ebx, %eax
addq $0x210, %rsp            # imm = 0x210
popq %rbx
popq %r14
popq %rbp
retq
leaq 0x105f(%rip), %rsi      # 0x4126
leaq -0x58(%rbp), %rdi
callq 0x31fd
testb %al, %al
je 0x314e
leaq -0x218(%rbp), %rdi
leaq -0x14(%rbp), %rsi
callq 0x2110
leaq -0x38(%rbp), %rsi
movq %rax, %rdi
callq 0x21d0
movq -0x218(%rbp), %rax
movq -0x18(%rax), %rax
testb $0x5, -0x1f8(%rbp,%rax)
je 0x3120
movq 0x2ec4(%rip), %rdi      # 0x5fd0
leaq 0xfde(%rip), %rsi       # 0x40f1
callq 0x2170
movq %rax, %rdi
callq 0x20e0
leaq -0x78(%rbp), %rdi
leaq -0x38(%rbp), %rsi
callq 0x2200
movl -0x14(%rbp), %edx
leaq -0x78(%rbp), %rsi
movq %rbx, %rdi
callq 0x2c82
leaq -0x78(%rbp), %rdi
callq 0x20c0
leaq 0xfdf(%rip), %rsi       # 0x412b
jmp 0x3194
leaq 0xfe0(%rip), %rsi       # 0x4135
leaq -0x58(%rbp), %rdi
callq 0x31fd
testb %al, %al
je 0x318d
movq 0x2e67(%rip), %rdi      # 0x5fd0
leaq 0xfca(%rip), %rsi       # 0x413a
callq 0x2170
movq %rax, %rdi
callq 0x20e0
movq %rbx, %rdi
callq 0x28d8
pushq $-0x1
popq %rbx
jmp 0x3094
leaq 0xfb5(%rip), %rsi       # 0x4149
movq 0x2e35(%rip), %rdi      # 0x5fd0
callq 0x2170
jmp 0x2f6e
movq %rax, %rbx
leaq -0x78(%rbp), %rdi
jmp 0x31b8
movq %rax, %rbx
leaq -0x98(%rbp), %rdi
callq 0x20c0
jmp 0x31c9
jmp 0x31c6
movq %rax, %rbx
jmp 0x31d5
movq %rax, %rbx
leaq -0x218(%rbp), %rdi
callq 0x20d0
leaq -0x38(%rbp), %rdi
callq 0x20c0
leaq -0x58(%rbp), %rdi
callq 0x20c0
movq %rbx, %rdi
callq 0x2240