// File: /workspace/github_cpp_makefile_star2_O2/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 $0x58, %rsp
leaq -0x38(%rbp), %rax
movq %rax, -0x10(%rax)
andq $0x0, -0x8(%rax)
movq %rdi, %rbx
movb $0x0, (%rax)
movl 0xc(%rdi), %edi
leaq 0x328c(%rip), %rsi      # 0x70d2
pushq $0x8
popq %rdx
callq 0x20e0
cmpl $-0x1, %eax
je 0x3f95
movl 0xc(%rbx), %edi
leaq 0x329e(%rip), %rsi      # 0x70ff
pushq $0x7
popq %rdx
callq 0x20e0
cmpl $-0x1, %eax
je 0x3fa6
movq 0x30(%rbx), %rdi
callq 0x5fbe
movq %rax, %r14
leaq -0x80(%rbp), %r15
leaq -0x48(%rbp), %r12
leaq -0x60(%rbp), %r13
testq %r14, %r14
je 0x3f4f
movq %r14, %rdi
callq 0x6392
movq %r15, %rdi
movq %rax, %rsi
callq 0x6588
movq %r12, %rdi
movq %r15, %rsi
callq 0x22a0
movq %r15, %rdi
callq 0x2130
movq %r12, %rdi
leaq 0x3231(%rip), %rsi      # 0x70f4
callq 0x23c0
movq %r14, %rdi
callq 0x6392
movq %rax, %rdi
callq 0x6580
movq %r13, %rdi
leaq 0x3225(%rip), %rsi      # 0x7107
movl %eax, %edx
xorl %eax, %eax
callq 0x2070
movq %r12, %rdi
movq %r13, %rsi
callq 0x23c0
movq %r12, %rdi
leaq 0x331a(%rip), %rsi      # 0x721a
callq 0x23c0
movl 0xc(%rbx), %edi
movq -0x48(%rbp), %rsi
movq -0x40(%rbp), %rdx
callq 0x20e0
cmpl $-0x1, %eax
je 0x3f2a
movq %r14, %rdi
callq 0x6388
movq %rax, %r14
jmp 0x3e8a
leaq 0x32d1(%rip), %rdi      # 0x7202
callq 0x21e0
movq 0x7093(%rip), %rdi      # 0xafd0
pushq $-0x1
popq %rsi
callq 0x2380
movq %rax, %rdi
callq 0x2170
jmp 0x3f1a
movl 0xc(%rbx), %edi
leaq 0x32e5(%rip), %rsi      # 0x723e
pushq $0x5
popq %rdx
callq 0x20e0
cmpl $-0x1, %eax
je 0x3fb7
movl 0xc(%rbx), %edi
leaq 0x3162(%rip), %rsi      # 0x70d2
pushq $0x8
popq %rdx
callq 0x20e0
cmpl $-0x1, %eax
je 0x3fc5
leaq -0x48(%rbp), %rdi
callq 0x2130
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x3266(%rip), %rdi      # 0x7202
callq 0x21e0
jmp 0x3e57
leaq 0x3255(%rip), %rdi      # 0x7202
callq 0x21e0
jmp 0x3e72
leaq 0x3244(%rip), %rdi      # 0x7202
callq 0x21e0
jmp 0x3f66
leaq 0x3236(%rip), %rdi      # 0x7202
callq 0x21e0
jmp 0x3f7d
jmp 0x3fd9
jmp 0x3fd9
jmp 0x3fd9
movq %rax, %rbx
leaq -0x48(%rbp), %rdi
callq 0x2130
movq %rbx, %rdi
callq 0x2390
nop