// File: 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
subq $0x230, %rsp            # imm = 0x230
movl $0x0, -0x4(%rbp)
movl %edi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
leaq -0x30(%rbp), %rdi
callq 0x2260
leaq -0x50(%rbp), %rdi
callq 0x2260
leaq -0x70(%rbp), %rdi
callq 0x2260
leaq -0x90(%rbp), %rdi
callq 0x2260
leaq -0xb0(%rbp), %rdi
callq 0x2260
cmpl $0x2, -0x8(%rbp)
je 0x2580
movq 0x3aa7(%rip), %rdi      # 0x5fd0
leaq 0x1ad4(%rip), %rsi      # 0x4004
callq 0x21c0
movq %rax, -0x200(%rbp)
jmp 0x253e
movq -0x200(%rbp), %rdi
movq 0x3a74(%rip), %rsi      # 0x5fc0
callq 0x2200
jmp 0x2553
movl $0xfffffffe, -0x4(%rbp) # imm = 0xFFFFFFFE
movl $0x1, -0xd0(%rbp)
jmp 0x296c
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xc8(%rbp)
movl %eax, -0xcc(%rbp)
jmp 0x29ab
movl $0x2, %edi
movl $0x1, %esi
callq 0x2210
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rsi
leaq -0x50(%rbp), %rdi
callq 0x2250
jmp 0x25a2
leaq -0x50(%rbp), %rdi
leaq 0x1a67(%rip), %rsi      # 0x4014
movq $-0x1, %rdx
callq 0x21b0
movl %eax, -0xb4(%rbp)
movslq -0xb4(%rbp), %rax
cmpq $-0x1, %rax
jne 0x25dd
leaq -0x70(%rbp), %rdi
leaq -0x50(%rbp), %rsi
callq 0x2040
jmp 0x25db
jmp 0x261d
movl -0xb4(%rbp), %eax
incl %eax
movslq %eax, %rdx
leaq -0xf0(%rbp), %rdi
leaq -0x50(%rbp), %rsi
movq $-0x1, %rcx
callq 0x21f0
jmp 0x2601
leaq -0x70(%rbp), %rdi
leaq -0xf0(%rbp), %rsi
callq 0x2220
leaq -0xf0(%rbp), %rdi
callq 0x2150
leaq 0x19f0(%rip), %rdx      # 0x4014
leaq -0x150(%rbp), %rdi
leaq -0x50(%rbp), %rsi
callq 0x2ad0
jmp 0x2636
leaq -0x130(%rbp), %rdi
leaq -0x150(%rbp), %rsi
leaq -0x70(%rbp), %rdx
callq 0x2a80
jmp 0x264f
leaq 0x19c0(%rip), %rdx      # 0x4016
leaq -0x110(%rbp), %rdi
leaq -0x130(%rbp), %rsi
callq 0x2a30
jmp 0x266b
leaq -0x90(%rbp), %rdi
leaq -0x110(%rbp), %rsi
movq %rsi, -0x208(%rbp)
callq 0x2220
movq -0x208(%rbp), %rdi
callq 0x2150
leaq -0x130(%rbp), %rdi
callq 0x2150
leaq -0x150(%rbp), %rdi
callq 0x2150
leaq 0x1964(%rip), %rdx      # 0x4014
leaq -0x1b0(%rbp), %rdi
leaq -0x50(%rbp), %rsi
callq 0x2ad0
jmp 0x26c2
leaq -0x190(%rbp), %rdi
leaq -0x1b0(%rbp), %rsi
leaq -0x70(%rbp), %rdx
callq 0x2a80
jmp 0x26db
leaq 0x1940(%rip), %rdx      # 0x4022
leaq -0x170(%rbp), %rdi
leaq -0x190(%rbp), %rsi
callq 0x2a30
jmp 0x26f7
leaq -0xb0(%rbp), %rdi
leaq -0x170(%rbp), %rsi
movq %rsi, -0x218(%rbp)
callq 0x2220
movq -0x218(%rbp), %rdi
callq 0x2150
leaq -0x190(%rbp), %rdi
callq 0x2150
leaq -0x1b0(%rbp), %rdi
callq 0x2150
movl $0x8, %edi
callq 0x21d0
movq %rax, -0x210(%rbp)
jmp 0x2748
movb $0x1, -0x1f1(%rbp)
leaq -0x1d0(%rbp), %rdi
leaq -0xb0(%rbp), %rsi
callq 0x20e0
jmp 0x2764
leaq -0x1f0(%rbp), %rdi
leaq -0x90(%rbp), %rsi
callq 0x20e0
jmp 0x2779
movq -0x210(%rbp), %rdi
leaq -0x1d0(%rbp), %rsi
leaq -0x1f0(%rbp), %rdx
callq 0x2b50
jmp 0x2795
movq -0x210(%rbp), %rax
movb $0x0, -0x1f1(%rbp)
movq %rax, -0xc0(%rbp)
leaq -0x1f0(%rbp), %rdi
callq 0x2150
leaq -0x1d0(%rbp), %rdi
callq 0x2150
movq 0x3817(%rip), %rdi      # 0x5fe0
leaq -0x30(%rbp), %rsi
callq 0x2060
movq %rax, -0x220(%rbp)
jmp 0x27db
movq -0x220(%rbp), %rdi
movq (%rdi), %rax
movq -0x18(%rax), %rax
addq %rax, %rdi
callq 0x22b0
movb %al, -0x221(%rbp)
jmp 0x27f9
movb -0x221(%rbp), %al
xorb $-0x1, %al
testb $0x1, %al
jne 0x280a
jmp 0x2931
movq -0xc0(%rbp), %rdi
leaq -0x30(%rbp), %rsi
callq 0x3690
movl %eax, -0x228(%rbp)
jmp 0x2822
movl -0x228(%rbp), %eax
cmpl $-0x1, %eax
jne 0x292c
jmp 0x2931
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xc8(%rbp)
movl %eax, -0xcc(%rbp)
jmp 0x2868
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xc8(%rbp)
movl %eax, -0xcc(%rbp)
leaq -0x130(%rbp), %rdi
callq 0x2150
leaq -0x150(%rbp), %rdi
callq 0x2150
jmp 0x29ab
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xc8(%rbp)
movl %eax, -0xcc(%rbp)
jmp 0x28ab
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xc8(%rbp)
movl %eax, -0xcc(%rbp)
leaq -0x190(%rbp), %rdi
callq 0x2150
leaq -0x1b0(%rbp), %rdi
callq 0x2150
jmp 0x29ab
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xc8(%rbp)
movl %eax, -0xcc(%rbp)
jmp 0x290e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xc8(%rbp)
movl %eax, -0xcc(%rbp)
jmp 0x2902
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xc8(%rbp)
movl %eax, -0xcc(%rbp)
leaq -0x1f0(%rbp), %rdi
callq 0x2150
leaq -0x1d0(%rbp), %rdi
callq 0x2150
testb $0x1, -0x1f1(%rbp)
jne 0x2919
jmp 0x292a
movq -0x210(%rbp), %rdi
movl $0x8, %esi
callq 0x21e0
jmp 0x29ab
jmp 0x27c2
movq -0xc0(%rbp), %rax
movq %rax, -0x230(%rbp)
cmpq $0x0, %rax
je 0x2962
movq -0x230(%rbp), %rdi
callq 0x2be0
movq -0x230(%rbp), %rdi
movl $0x8, %esi
callq 0x21e0
movl $0x0, -0xd0(%rbp)
leaq -0xb0(%rbp), %rdi
callq 0x2150
leaq -0x90(%rbp), %rdi
callq 0x2150
leaq -0x70(%rbp), %rdi
callq 0x2150
leaq -0x50(%rbp), %rdi
callq 0x2150
leaq -0x30(%rbp), %rdi
callq 0x2150
movl -0x4(%rbp), %eax
addq $0x230, %rsp            # imm = 0x230
popq %rbp
retq
leaq -0xb0(%rbp), %rdi
callq 0x2150
leaq -0x90(%rbp), %rdi
callq 0x2150
leaq -0x70(%rbp), %rdi
callq 0x2150
leaq -0x50(%rbp), %rdi
callq 0x2150
leaq -0x30(%rbp), %rdi
callq 0x2150
movq -0xc8(%rbp), %rdi
callq 0x22a0
nopw (%rax,%rax)