// File: /workspace/github_cpp_makefile_star2_O1/billDrett[P]Bulletin-Boards/boardServer.cpp
// Function: BoardServer::sendChanelsList()
void BoardServer::sendChanelsList()
{
    char convert[24];
    string buff;
    int nwrite;
    int total = 0;

    if((nwrite = write(pipeServer2BoardPost, "<Chanel>", 8))== -1) //start tag gia chanel
    {
        perror("Cant write to pipe S2BP");
    }

    //prwta to start tag
    if((nwrite = write(pipeServer2BoardPost, "<start>", 7))== -1)
    {
        perror("Cant write to pipe S2BP");
    }
    total += nwrite;
    for(Node<Chanel>* i = chanels->get_begin(); i != NULL; i = i->get_next()) //stelnw ena ena ta chanel
    {
        buff = i->get_data()->get_name(); //prwta to onoma
        buff.append(" ");
        sprintf(convert, "%d", i->get_data()->get_id()); //meta to id
        buff.append(convert);
        buff.append("\n");

        if((nwrite = write(pipeServer2BoardPost, buff.c_str(), buff.size()))== -1)
        {
            perror("Cant write to pipe S2BP");
            cout<<nwrite<<endl;
        }
        total += nwrite;
    }

    //telos to end tag
    if((nwrite = write(pipeServer2BoardPost, "<end>", 5))== -1)
    {
        perror("Cant write to pipe S2BP");
    }
    total += nwrite;
    if((nwrite = write(pipeServer2BoardPost, "<Chanel>", 8))== -1)
    {
        perror("Cant write to pipe S2BP");
    }
    total += nwrite;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x68, %rsp
leaq -0x40(%rbp), %rax
movq %rax, -0x10(%rax)
movq $0x0, -0x8(%rax)
movb $0x0, (%rax)
movq %rdi, -0x30(%rbp)
movl 0xc(%rdi), %edi
leaq 0x3638(%rip), %rsi      # 0x80d6
movl $0x8, %edx
callq 0x20f0
cmpl $-0x1, %eax
je 0x4c51
movq -0x30(%rbp), %rax
movl 0xc(%rax), %edi
leaq 0x3644(%rip), %rsi      # 0x8103
movl $0x7, %edx
callq 0x20f0
cmpl $-0x1, %eax
je 0x4c62
movq -0x30(%rbp), %rax
movq 0x30(%rax), %rdi
callq 0x71b4
movq %rax, %r14
leaq -0x70(%rbp), %r15
leaq -0x50(%rbp), %r12
leaq -0x90(%rbp), %r13
testq %r14, %r14
je 0x4bef
movq %r14, %rdi
callq 0x758a
movq %r15, %rdi
movq %rax, %rsi
callq 0x7824
movq %r12, %rdi
movq %r15, %rsi
callq 0x22b0
movq -0x70(%rbp), %rdi
leaq -0x60(%rbp), %rax
cmpq %rax, %rdi
je 0x4b31
movq -0x60(%rbp), %rsi
incq %rsi
callq 0x2230
movq %r12, %rdi
leaq 0x35bd(%rip), %rsi      # 0x80f8
callq 0x23f0
movq %r14, %rdi
callq 0x758a
movq %rax, %rdi
callq 0x781c
movq %r13, %rdi
leaq 0x35b1(%rip), %rsi      # 0x810b
movl %eax, %edx
xorl %eax, %eax
callq 0x2080
movq %r12, %rdi
movq %r13, %rsi
callq 0x23f0
movq %r12, %rdi
leaq 0x36a6(%rip), %rsi      # 0x821e
callq 0x23f0
movq -0x30(%rbp), %rax
movl 0xc(%rax), %edi
movq -0x50(%rbp), %rsi
movq -0x48(%rbp), %rdx
callq 0x20f0
cmpl $-0x1, %eax
je 0x4ba6
movq %r14, %rdi
callq 0x7580
movq %rax, %r14
jmp 0x4af1
leaq 0x3659(%rip), %rdi      # 0x8206
callq 0x21d0
movq 0x7417(%rip), %rdi      # 0xbfd0
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0x23a0
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x2210
movsbl %al, %esi
movq %rbx, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x2190
jmp 0x4b96
movq -0x30(%rbp), %rax
movl 0xc(%rax), %edi
leaq 0x3645(%rip), %rsi      # 0x8242
movl $0x5, %edx
callq 0x20f0
cmpl $-0x1, %eax
je 0x4c73
movq -0x30(%rbp), %rax
movl 0xc(%rax), %edi
leaq 0x34bc(%rip), %rsi      # 0x80d6
movl $0x8, %edx
callq 0x20f0
cmpl $-0x1, %eax
je 0x4c81
movq -0x50(%rbp), %rdi
leaq -0x40(%rbp), %rax
cmpq %rax, %rdi
je 0x4c42
movq -0x40(%rbp), %rsi
incq %rsi
callq 0x2230
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x35ae(%rip), %rdi      # 0x8206
callq 0x21d0
jmp 0x4ab1
leaq 0x359d(%rip), %rdi      # 0x8206
callq 0x21d0
jmp 0x4ad2
leaq 0x358c(%rip), %rdi      # 0x8206
callq 0x21d0
jmp 0x4c0c
leaq 0x357e(%rip), %rdi      # 0x8206
callq 0x21d0
jmp 0x4c29
jmp 0x4c95
jmp 0x4c95
jmp 0x4c95
movq %rax, %rbx
movq -0x50(%rbp), %rdi
leaq -0x40(%rbp), %rax
cmpq %rax, %rdi
je 0x4cb1
movq -0x40(%rbp), %rsi
incq %rsi
callq 0x2230
movq %rbx, %rdi
callq 0x23c0
nop