// File: /workspace/github_cpp_makefile_star2_O2/billDrett[P]Bulletin-Boards/boardPostTest.cpp
// Function: main
int main(int argc, char *argv[])
{
    string line, path, boardID, pipe1, pipe2;
    int found;
    BoardPost* bPost;

    if(argc != 2) //thelw ena mono argument
    {
        cout<<"error arguments"<<endl;
        return - 2;
    }

    signal(SIGINT, SIG_IGN); // agnow to control C
//while(1){}
    path = argv[1];
    found = path.find_last_of("/"); //thelw na parw to onoma tou current folder
    if(found ==  string::npos)
    {
        boardID = path;
    }
    else
    {
        boardID = path.substr(found+1);
    }
    pipe1 = path + "/" + boardID + "_othersS2BP";
    pipe2 = path + "/" + boardID + "_othersBP2S";
    bPost = new BoardPost(pipe2, pipe1);

    while(!getline(cin, line).eof()) //eisodos apo pliktrologio
    {
        //cout<<line<<endl;
        if(bPost->menu(line) == -1) break;
    }

    delete bPost;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x148, %rsp            # imm = 0x148
movq %rsi, %rbx
leaq -0x148(%rbp), %rax
movq %rax, -0x10(%rax)
andq $0x0, -0x8(%rax)
xorl %ecx, %ecx
leaq -0x28(%rbp), %rdx
movq %rdx, -0x10(%rdx)
andq $0x0, -0x8(%rdx)
leaq -0x88(%rbp), %rsi
movq %rsi, -0x10(%rsi)
andq $0x0, -0x8(%rsi)
movb %cl, (%rax)
movb %cl, (%rdx)
leaq -0xe8(%rbp), %rax
movq %rax, -0x10(%rax)
andq $0x0, -0x8(%rax)
leaq -0xc8(%rbp), %rdx
movq %rdx, -0x10(%rdx)
andq $0x0, -0x8(%rdx)
movb %cl, (%rsi)
movb %cl, (%rax)
movb %cl, (%rdx)
cmpl $0x2, %edi
jne 0x24ff
pushq $0x2
popq %rdi
pushq $0x1
popq %rsi
callq 0x21b0
movq 0x8(%rbx), %rsi
leaq -0x38(%rbp), %rdi
callq 0x2260
leaq 0x1b38(%rip), %rsi      # 0x4014
leaq -0x38(%rbp), %rdi
pushq $-0x1
popq %rdx
callq 0x2160
cmpl $-0x1, %eax
jne 0x2522
leaq -0x98(%rbp), %rdi
leaq -0x38(%rbp), %rsi
callq 0x2100
jmp 0x2558
movq 0x3aca(%rip), %rdi      # 0x5fd0
leaq 0x1af7(%rip), %rsi      # 0x4004
callq 0x2170
movq %rax, %rdi
callq 0x20e0
pushq $-0x2
popq %rbx
jmp 0x26da
incl %eax
movslq %eax, %rdx
leaq -0xb8(%rbp), %rdi
leaq -0x38(%rbp), %rsi
pushq $-0x1
popq %rcx
callq 0x21a0
leaq -0x98(%rbp), %rdi
leaq -0xb8(%rbp), %rbx
movq %rbx, %rsi
callq 0x21c0
movq %rbx, %rdi
callq 0x20c0
leaq 0x1ab5(%rip), %rdx      # 0x4014
leaq -0x58(%rbp), %rdi
leaq -0x38(%rbp), %rsi
callq 0x2833
leaq -0x78(%rbp), %rdi
leaq -0x58(%rbp), %rsi
leaq -0x98(%rbp), %rdx
callq 0x280a
leaq 0x1a8f(%rip), %rdx      # 0x4016
leaq -0xb8(%rbp), %rdi
leaq -0x78(%rbp), %rsi
callq 0x27e1
leaq -0xf8(%rbp), %rdi
leaq -0xb8(%rbp), %rbx
movq %rbx, %rsi
callq 0x21c0
movq %rbx, %rdi
callq 0x20c0
leaq -0x78(%rbp), %rdi
callq 0x20c0
leaq -0x58(%rbp), %rdi
callq 0x20c0
leaq 0x1a46(%rip), %rdx      # 0x4014
leaq -0x58(%rbp), %rdi
leaq -0x38(%rbp), %rsi
callq 0x2833
leaq -0x78(%rbp), %rdi
leaq -0x58(%rbp), %rsi
leaq -0x98(%rbp), %rdx
callq 0x280a
leaq 0x1a2c(%rip), %rdx      # 0x4022
leaq -0xb8(%rbp), %rdi
leaq -0x78(%rbp), %rsi
callq 0x27e1
leaq -0xd8(%rbp), %rdi
movq %rbx, %rsi
callq 0x21c0
movq %rbx, %rdi
callq 0x20c0
leaq -0x78(%rbp), %rdi
callq 0x20c0
leaq -0x58(%rbp), %rdi
callq 0x20c0
pushq $0x8
popq %rdi
callq 0x2180
movq %rax, %rbx
leaq -0x138(%rbp), %rdi
leaq -0xd8(%rbp), %rsi
callq 0x2200
leaq -0x118(%rbp), %rdi
leaq -0xf8(%rbp), %rsi
callq 0x2200
leaq -0x138(%rbp), %rsi
leaq -0x118(%rbp), %rdx
movq %rbx, %rdi
callq 0x286c
leaq -0x118(%rbp), %rdi
callq 0x20c0
leaq -0x138(%rbp), %rdi
callq 0x20c0
movq 0x394b(%rip), %r14      # 0x5fe0
leaq -0x158(%rbp), %r15
movq %r14, %rdi
movq %r15, %rsi
callq 0x2040
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
testb $0x2, 0x20(%rax,%rcx)
jne 0x26c5
movq %rbx, %rdi
movq %r15, %rsi
callq 0x2edc
cmpl $-0x1, %eax
jne 0x269c
movq %rbx, %rdi
callq 0x28c4
pushq $0x8
popq %rsi
movq %rbx, %rdi
callq 0x2190
xorl %ebx, %ebx
leaq -0xd8(%rbp), %rdi
callq 0x20c0
leaq -0xf8(%rbp), %rdi
callq 0x20c0
leaq -0x98(%rbp), %rdi
callq 0x20c0
leaq -0x38(%rbp), %rdi
callq 0x20c0
leaq -0x158(%rbp), %rdi
callq 0x20c0
movl %ebx, %eax
addq $0x148, %rsp            # imm = 0x148
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
jmp 0x277d
movq %rax, %r14
leaq -0x118(%rbp), %rdi
callq 0x20c0
jmp 0x2739
movq %rax, %r14
leaq -0x138(%rbp), %rdi
callq 0x20c0
jmp 0x274a
movq %rax, %r14
pushq $0x8
popq %rsi
movq %rbx, %rdi
callq 0x2190
jmp 0x2780
jmp 0x275d
jmp 0x276b
jmp 0x277d
movq %rax, %r14
leaq -0x78(%rbp), %rdi
callq 0x20c0
jmp 0x276e
movq %rax, %r14
leaq -0x58(%rbp), %rdi
callq 0x20c0
jmp 0x2780
jmp 0x277d
jmp 0x277d
movq %rax, %r14
leaq -0xd8(%rbp), %rdi
callq 0x20c0
leaq -0xf8(%rbp), %rdi
callq 0x20c0
leaq -0x98(%rbp), %rdi
callq 0x20c0
leaq -0x38(%rbp), %rdi
callq 0x20c0
leaq -0x158(%rbp), %rdi
callq 0x20c0
movq %r14, %rdi
callq 0x2240