// File: /workspace/github_cpp_makefile_star2_O3/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 0x3644(%rip), %rsi      # 0x80ea
movl $0x8, %edx
callq 0x20f0
cmpl $-0x1, %eax
je 0x4c59
movq -0x30(%rbp), %rax
movl 0xc(%rax), %edi
leaq 0x3650(%rip), %rsi      # 0x8117
movl $0x7, %edx
callq 0x20f0
cmpl $-0x1, %eax
je 0x4c6a
movq -0x30(%rbp), %rax
movq 0x30(%rax), %rdi
callq 0x721e
movq %rax, %r14
leaq -0x70(%rbp), %r15
leaq -0x50(%rbp), %r12
leaq -0x90(%rbp), %r13
testq %r14, %r14
je 0x4bf7
movq %r14, %rdi
callq 0x760a
movq %r15, %rdi
movq %rax, %rsi
callq 0x78a4
movq %r12, %rdi
movq %r15, %rsi
callq 0x22b0
movq -0x70(%rbp), %rdi
leaq -0x60(%rbp), %rax
cmpq %rax, %rdi
je 0x4b39
movq -0x60(%rbp), %rsi
incq %rsi
callq 0x2230
movq %r12, %rdi
leaq 0x35c9(%rip), %rsi      # 0x810c
callq 0x23f0
movq %r14, %rdi
callq 0x760a
movq %rax, %rdi
callq 0x789c
movq %r13, %rdi
leaq 0x35bd(%rip), %rsi      # 0x811f
movl %eax, %edx
xorl %eax, %eax
callq 0x2080
movq %r12, %rdi
movq %r13, %rsi
callq 0x23f0
movq %r12, %rdi
leaq 0x36b2(%rip), %rsi      # 0x8232
callq 0x23f0
movq -0x30(%rbp), %rax
movl 0xc(%rax), %edi
movq -0x50(%rbp), %rsi
movq -0x48(%rbp), %rdx
callq 0x20f0
cmpl $-0x1, %eax
je 0x4bae
movq %r14, %rdi
callq 0x7600
movq %rax, %r14
jmp 0x4af9
leaq 0x3665(%rip), %rdi      # 0x821a
callq 0x21d0
movq 0x740f(%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 0x4b9e
movq -0x30(%rbp), %rax
movl 0xc(%rax), %edi
leaq 0x3651(%rip), %rsi      # 0x8256
movl $0x5, %edx
callq 0x20f0
cmpl $-0x1, %eax
je 0x4c7b
movq -0x30(%rbp), %rax
movl 0xc(%rax), %edi
leaq 0x34c8(%rip), %rsi      # 0x80ea
movl $0x8, %edx
callq 0x20f0
cmpl $-0x1, %eax
je 0x4c89
movq -0x50(%rbp), %rdi
leaq -0x40(%rbp), %rax
cmpq %rax, %rdi
je 0x4c4a
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 0x35ba(%rip), %rdi      # 0x821a
callq 0x21d0
jmp 0x4ab9
leaq 0x35a9(%rip), %rdi      # 0x821a
callq 0x21d0
jmp 0x4ada
leaq 0x3598(%rip), %rdi      # 0x821a
callq 0x21d0
jmp 0x4c14
leaq 0x358a(%rip), %rdi      # 0x821a
callq 0x21d0
jmp 0x4c31
jmp 0x4c9d
jmp 0x4c9d
jmp 0x4c9d
movq %rax, %rbx
movq -0x50(%rbp), %rdi
leaq -0x40(%rbp), %rax
cmpq %rax, %rdi
je 0x4cb9
movq -0x40(%rbp), %rsi
incq %rsi
callq 0x2230
movq %rbx, %rdi
callq 0x23c0
nop