LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O2/iZhangHui[P]CppPrimer/CH13_CopyControl/examples/String.cc
// Function: String::operator=(String&&)
String& String::operator=(String&& rhs) noexcept
{
	// explicit check for self-assignment
	if (this != &rhs) {
		if (p)
			a.deallocate(p, sz);  // do the work of the destructor
		p = rhs.p;    // take over the old memory
		sz = rhs.sz;

		rhs.p = 0;    // deleting rhs.p is safe
		rhs.sz = 0;
	}
	return *this;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movq %rdi, %rbx
cmpq %rsi, %rdi
je 0x4052
movq %rsi, %r14
movq 0x8(%rbx), %rdi
testq %rdi, %rdi
je 0x403d
movq (%rbx), %rsi
callq 0x1100
movq 0x8(%r14), %rax
movq %rax, 0x8(%rbx)
movq (%r14), %rax
movq %rax, (%rbx)
xorps %xmm0, %xmm0
movups %xmm0, (%r14)
movq %rbx, %rax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/iZhangHui[P]CppPrimer/CH13_CopyControl/examples/String.cc
// Function: String::operator=(char const*)
String& String::operator=(const char* cp)
{
	if (p) a.deallocate(p, sz);
	p = a.allocate(sz = strlen(cp));
	uninitialized_copy(cp, cp + sz, p);
	return *this;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movq %rsi, %r14
movq %rdi, %rbx
movq 0x8(%rdi), %rdi
testq %rdi, %rdi
je 0x4078
movq (%rbx), %rsi
callq 0x1100
movq %r14, %rdi
callq 0x1070
movq %rax, (%rbx)
leaq 0x5062(%rip), %rdi      # 0x90ec
movq %rax, %rsi
xorl %edx, %edx
callq 0x203c
movq %rax, 0x8(%rbx)
movq (%rbx), %rdx
testq %rdx, %rdx
je 0x40ab
movq %rax, %rdi
movq %r14, %rsi
callq 0x1160
movq %rbx, %rax
popq %rbx
popq %r14
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/iZhangHui[P]CppPrimer/CH13_CopyControl/examples/String.cc
// Function: String::operator=(char)
String& String::operator=(char c)
{
	if(p) a.deallocate(p, sz);
	p = a.allocate(sz = 1);
	*p = c;
	return *this;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movl %esi, %r14d
movq %rdi, %rbx
movq 0x8(%rdi), %rdi
testq %rdi, %rdi
je 0x40d2
movq (%rbx), %rsi
callq 0x1100
movq $0x1, (%rbx)
pushq $0x1
popq %rdi
callq 0x10f0
movq %rax, 0x8(%rbx)
movb %r14b, (%rax)
movq %rbx, %rax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/iZhangHui[P]CppPrimer/CH13_CopyControl/examples/String.cc
// Function: String::operator=(std::initializer_list<char>)
String& String::operator=(initializer_list<char> il)
{
	// no need to check for self-assignment
	if (p)
		a.deallocate(p, sz);        // do the work of the destructor
	p = a.allocate(sz = il.size()); // do the work of the copy constructor
	uninitialized_copy(il.begin(), il.end(), p);
	return *this;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %rbx
movq 0x8(%rdi), %rdi
testq %rdi, %rdi
je 0x4114
movq (%rbx), %rsi
callq 0x1100
movq %r14, (%rbx)
leaq 0x4fce(%rip), %rdi      # 0x90ec
movq %r14, %rsi
xorl %edx, %edx
callq 0x203c
movq %rax, 0x8(%rbx)
testq %r14, %r14
je 0x413f
movq %rax, %rdi
movq %r15, %rsi
movq %r14, %rdx
callq 0x1160
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/iZhangHui[P]CppPrimer/CH13_CopyControl/examples/String.cc
// Function: print(std::ostream&, String const&)
ostream& print(ostream& os, const String& s)
{
	auto p = s.begin();
	while (p != s.end())
		os << *p++ ;
	return os;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
movq 0x8(%rsi), %rax
movq %rax, %r15
addq (%r14), %rax
cmpq %rax, %r15
je 0x4181
movsbl (%r15), %esi
incq %r15
movq %rbx, %rdi
callq 0x1130
movq 0x8(%r14), %rax
jmp 0x4164
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/iZhangHui[P]CppPrimer/CH13_CopyControl/examples/String.cc
// Function: add(String const&, String const&)
String add(const String& lhs, const String& rhs)
{
	String ret;
	ret.sz = rhs.size() + lhs.size();   // size of the combined String
	ret.p = String::a.allocate(ret.sz); // allocate new space
	uninitialized_copy(lhs.begin(), lhs.end(), ret.p); // copy the operands
	uninitialized_copy(rhs.begin(), rhs.end(), ret.p + lhs.sz);
	return ret;  // return a copy of the newly created String
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rdx, %r15
movq %rsi, %r14
movq %rdi, %rbx
andq $0x0, 0x8(%rdi)
movq (%rsi), %rsi
addq (%rdx), %rsi
movq %rsi, (%rdi)
leaq 0x4f34(%rip), %rdi      # 0x90ec
xorl %edx, %edx
callq 0x203c
movq %rax, %r12
movq %rax, 0x8(%rbx)
movq (%r14), %rdx
testq %rdx, %rdx
je 0x41da
movq 0x8(%r14), %rsi
movq %r12, %rdi
callq 0x1160
movq (%r15), %rdx
testq %rdx, %rdx
je 0x41f1
movq 0x8(%r15), %rsi
addq (%r14), %r12
movq %r12, %rdi
callq 0x1160
movq %rbx, %rax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %r14
movq %rbx, %rdi
callq 0x1b0a
movq %r14, %rdi
callq 0x1190
// File: /workspace/github_cpp_makefile_star2_O2/billDrett[P]Bulletin-Boards/boardClient.cpp
// Function: BoardClient::BoardClient(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
BoardClient::BoardClient(std::string C2S, std::string S2C)
{
    if((pipeClient2Server = open(C2S.c_str(), O_WRONLY)) < 0)
    {
        perror("fifo C2S not found");
    }

    if((pipeServer2Client = open(S2C.c_str(), O_RDWR)) < 0) //isws kai O_NONBLOCK
    {
        perror("fifo S2C not found");
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movq %rdx, %r14
movq %rdi, %rbx
movq (%rsi), %rdi
pushq $0x1
popq %rsi
xorl %eax, %eax
callq 0x21c0
movl %eax, (%rbx)
testl %eax, %eax
js 0x2ff1
movq (%r14), %rdi
pushq $0x2
popq %rsi
xorl %eax, %eax
callq 0x21c0
movl %eax, 0x4(%rbx)
testl %eax, %eax
js 0x2fff
popq %rbx
popq %r14
popq %rbp
retq
leaq 0x40b4(%rip), %rdi      # 0x70ac
callq 0x21e0
jmp 0x2fd8
leaq 0x40b9(%rip), %rdi      # 0x70bf
popq %rbx
popq %r14
popq %rbp
jmp 0x21e0
nop
// File: /workspace/github_cpp_makefile_star2_O2/billDrett[P]Bulletin-Boards/boardClient.cpp
// Function: BoardClient::createChanel(int, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
void BoardClient::createChanel(int Id, std::string Name)
{
    int nwrite;
    char convert[24];
    string buff;

    if((nwrite = write(pipeClient2Server, "<Chanel>", 8))== -1) //stelnoume ta tags gia to ksekinima tou aitimatos
    {
        perror("Cant write to pipe C2S");
    }

    if((nwrite = write(pipeClient2Server, "<start>", 7))== -1)
    {
        perror("Cant write to pipe C2S");
    }

    sprintf(convert, "%d ", Id);
    buff.append(convert);
    buff.append(Name.c_str());
    if((nwrite = write(pipeClient2Server, buff.c_str(), buff.size()))== -1) //stelnw to id kai to onoma tou chanel
    {
        perror("Cant write to pipe C2S");
    }

    if((nwrite = write(pipeClient2Server, "<end>", 5))== -1)
    {
        perror("Cant write to pipe C2S");
    }

    if((nwrite = write(pipeClient2Server, "<Chanel>", 8))== -1) //telos tou aitimatos
    {
        perror("Cant write to pipe C2S");
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x40, %rsp
movq %rdx, %r14
leaq -0x30(%rbp), %rax
movq %rax, -0x10(%rax)
andq $0x0, -0x8(%rax)
movl %esi, %r15d
movq %rdi, %rbx
movb $0x0, (%rax)
movl (%rdi), %edi
leaq 0x4079(%rip), %rsi      # 0x70d2
pushq $0x8
popq %rdx
callq 0x20e0
cmpl $-0x1, %eax
je 0x310a
movl (%rbx), %edi
leaq 0x408c(%rip), %rsi      # 0x70ff
pushq $0x7
popq %rdx
callq 0x20e0
cmpl $-0x1, %eax
je 0x311b
leaq 0x4067(%rip), %rsi      # 0x70f2
leaq -0x60(%rbp), %r12
movq %r12, %rdi
movl %r15d, %edx
xorl %eax, %eax
callq 0x2070
leaq -0x40(%rbp), %rdi
movq %r12, %rsi
callq 0x23c0
movq (%r14), %rsi
leaq -0x40(%rbp), %rdi
callq 0x23c0
movl (%rbx), %edi
movq -0x40(%rbp), %rsi
movq -0x38(%rbp), %rdx
callq 0x20e0
cmpl $-0x1, %eax
je 0x312c
movl (%rbx), %edi
leaq 0x416d(%rip), %rsi      # 0x723e
pushq $0x5
popq %rdx
callq 0x20e0
cmpl $-0x1, %eax
je 0x313a
movl (%rbx), %edi
leaq 0x3feb(%rip), %rsi      # 0x70d2
pushq $0x8
popq %rdx
callq 0x20e0
cmpl $-0x1, %eax
je 0x3148
leaq -0x40(%rbp), %rdi
callq 0x2130
addq $0x40, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
leaq 0x3fca(%rip), %rdi      # 0x70db
callq 0x21e0
jmp 0x306a
leaq 0x3fb9(%rip), %rdi      # 0x70db
callq 0x21e0
jmp 0x3084
leaq 0x3fa8(%rip), %rdi      # 0x70db
callq 0x21e0
jmp 0x30c8
leaq 0x3f9a(%rip), %rdi      # 0x70db
callq 0x21e0
jmp 0x30de
leaq 0x3f8c(%rip), %rdi      # 0x70db
callq 0x21e0
jmp 0x30f4
movq %rax, %rbx
leaq -0x40(%rbp), %rdi
callq 0x2130
movq %rbx, %rdi
callq 0x2390
// File: /workspace/github_cpp_makefile_star2_O2/billDrett[P]Bulletin-Boards/boardClient.cpp
// Function: BoardClient::getMessages(int)
void BoardClient::getMessages(int Id)
{
    char convert[24];
    string buff;

    int nwrite;
    if((nwrite = write(pipeClient2Server, "<Message><start>", 16))== -1) //zhtaw apo to server ta messages kai arxeia
    {
        perror("Cant write to pipe C2S");
    }
    sprintf(convert, "%d", Id);
    buff = convert;
    if((nwrite = write(pipeClient2Server, buff.c_str(), buff.size()))== -1)
    {
        perror("Cant write to pipe C2S");
        cout<<nwrite<<endl;
    }

    if((nwrite = write(pipeClient2Server, "<end><Message>", 14))== -1) //telos aitimatos
    {
        perror("Cant write to pipe C2S");
    }

    this->readMessages(); //twra ta diavazw
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x38, %rsp
leaq -0x28(%rbp), %rax
movq %rax, -0x10(%rax)
andq $0x0, -0x8(%rax)
movl %esi, %r14d
movq %rdi, %rbx
movb $0x0, (%rax)
movl (%rdi), %edi
leaq 0x3f60(%rip), %rsi      # 0x70f6
pushq $0x10
popq %rdx
callq 0x20e0
cmpl $-0x1, %eax
je 0x320d
leaq 0x3f5d(%rip), %rsi      # 0x7107
leaq -0x50(%rbp), %r15
movq %r15, %rdi
movl %r14d, %edx
xorl %eax, %eax
callq 0x2070
leaq -0x38(%rbp), %rdi
movq %r15, %rsi
callq 0x23d0
movl (%rbx), %edi
movq -0x38(%rbp), %rsi
movq -0x30(%rbp), %rdx
callq 0x20e0
cmpl $-0x1, %eax
je 0x321b
movl (%rbx), %edi
leaq 0x3f26(%rip), %rsi      # 0x710a
pushq $0xe
popq %rdx
callq 0x20e0
cmpl $-0x1, %eax
je 0x3240
movq %rbx, %rdi
callq 0x3262
leaq -0x38(%rbp), %rdi
callq 0x2130
addq $0x38, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
leaq 0x3ec7(%rip), %rdi      # 0x70db
callq 0x21e0
jmp 0x31a3
leaq 0x3eb9(%rip), %rdi      # 0x70db
callq 0x21e0
movq 0x7da2(%rip), %rdi      # 0xafd0
pushq $-0x1
popq %rsi
callq 0x2380
movq %rax, %rdi
callq 0x2170
jmp 0x31db
leaq 0x3e94(%rip), %rdi      # 0x70db
callq 0x21e0
jmp 0x31f1
movq %rax, %rbx
leaq -0x38(%rbp), %rdi
callq 0x2130
movq %rbx, %rdi
callq 0x2390
// File: /workspace/github_cpp_makefile_star2_O2/billDrett[P]Bulletin-Boards/boardServer.cpp
// Function: BoardServer::BoardServer(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
BoardServer::BoardServer(string C2S, string S2C, string BP2S, string S2BP)
{
    if((pipeClient2Server = open(C2S.c_str(), O_RDWR)) < 0) //isws kai O_NONBLOCK
    {
        perror("fifo C2S not found");
        exit(1);
    }

    if((pipeServer2Client = open(S2C.c_str(), O_WRONLY)) < 0)
    {
        perror("fifo S2C not found");
        exit(1);
    }

    if((pipeBoardPost2Server = open(BP2S.c_str(), O_RDWR)) < 0)
    {
        perror("fifo BP2S not found");
        exit(1);
    }

    /*if((pipeServer2BoardPost = open(S2BP.c_str(), O_WRONLY)) < 0)
    {
        perror("fifo S2BP not found");
    }*/
    pipeServer2BoardPost = -1; //tha to anoiksw otan xreiastei na kanw to write
    this->Server2BoardPost = S2BP.c_str(); //apothikeuw to onoma sto opoio vrisketai


    chanels = new List<Chanel>;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %r8, %r15
movq %rcx, %r12
movq %rdx, %r13
movq %rdi, %r14
leaq 0x20(%rdi), %rax
movq %rax, 0x10(%rdi)
andq $0x0, 0x18(%rdi)
leaq 0x10(%rdi), %rbx
movb $0x0, 0x20(%rdi)
movq (%rsi), %rdi
pushq $0x2
popq %rsi
xorl %eax, %eax
callq 0x21c0
movl %eax, (%r14)
testl %eax, %eax
js 0x3bf5
movq (%r13), %rdi
pushq $0x1
popq %rsi
xorl %eax, %eax
callq 0x21c0
movl %eax, 0x4(%r14)
testl %eax, %eax
js 0x3bfe
movq (%r12), %rdi
pushq $0x2
popq %rsi
xorl %eax, %eax
callq 0x21c0
movl %eax, 0x8(%r14)
testl %eax, %eax
js 0x3c07
orl $-0x1, 0xc(%r14)
movq (%r15), %rsi
movq %rbx, %rdi
callq 0x23d0
pushq $0x18
popq %rdi
callq 0x2240
movq %rax, %r15
movq %rax, %rdi
callq 0x5f48
movq %r15, 0x30(%r14)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x34b0(%rip), %rdi      # 0x70ac
jmp 0x3c0e
leaq 0x34ba(%rip), %rdi      # 0x70bf
jmp 0x3c0e
leaq 0x35e0(%rip), %rdi      # 0x71ee
callq 0x21e0
pushq $0x1
popq %rdi
callq 0x2290
movq %rax, %r14
pushq $0x18
popq %rsi
movq %r15, %rdi
callq 0x2250
jmp 0x3c2e
movq %rax, %r14
movq %rbx, %rdi
callq 0x2130
movq %r14, %rdi
callq 0x2390
// File: /workspace/github_cpp_makefile_star2_O2/billDrett[P]Bulletin-Boards/boardServer.cpp
// Function: BoardServer::~BoardServer()
BoardServer::~BoardServer()
{
    Chanel* tmp;

    tmp = chanels->deleteFirstNode();
    while(tmp != NULL)
    {
        delete tmp;
        tmp = chanels->deleteFirstNode();//diagrafoume ta stoixeia tis listas
    }
    delete chanels;
    this->shutDown();
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x30(%rdi), %rdi
callq 0x60c4
movq %rax, %r15
pushq $0x50
popq %r14
testq %r15, %r15
je 0x3c81
movq %r15, %rdi
callq 0x64d4
movq %r15, %rdi
movq %r14, %rsi
callq 0x2250
movq 0x30(%rbx), %rdi
callq 0x60c4
movq %rax, %r15
jmp 0x3c5b
movq 0x30(%rbx), %r14
testq %r14, %r14
je 0x3c92
movq %r14, %rdi
callq 0x5f58
pushq $0x18
popq %rsi
movq %r14, %rdi
callq 0x2250
movq %rbx, %rdi
callq 0x3cc6
addq $0x10, %rbx
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x2130
jmp 0x3cbd
movq %rax, %rdi
callq 0x528b
nop
// File: /workspace/github_cpp_makefile_star2_O2/billDrett[P]Bulletin-Boards/boardServer.cpp
// Function: BoardServer::shutDown()
void BoardServer::shutDown() //kleinei ola ta pipes
{
    close(pipeBoardPost2Server);
    close(pipeClient2Server);
    close(pipeServer2BoardPost);
    close(pipeServer2Client);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
movl 0x8(%rdi), %edi
callq 0x23f0
movl (%rbx), %edi
callq 0x23f0
movl 0xc(%rbx), %edi
callq 0x23f0
movl 0x4(%rbx), %edi
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x23f0
// File: /workspace/github_cpp_makefile_star2_O2/billDrett[P]Bulletin-Boards/boardServer.cpp
// Function: BoardServer::addChanel(Chanel*)
void BoardServer::addChanel(Chanel* inChanel)
{
    if(searchChanel(inChanel->get_id()) != NULL)
    {
        delete inChanel;
        return;
    }

    chanels->insertEnd(inChanel);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
movq %rsi, %rdi
callq 0x6580
movq %r14, %rdi
movl %eax, %esi
callq 0x3d74
testq %rax, %rax
je 0x3d63
movq %rbx, %rdi
callq 0x64d4
pushq $0x50
popq %rsi
movq %rbx, %rdi
popq %rbx
popq %r14
popq %rbp
jmp 0x2250
movq 0x30(%r14), %rdi
movq %rbx, %rsi
popq %rbx
popq %r14
popq %rbp
jmp 0x5fd2
nop
// File: /workspace/github_cpp_makefile_star2_O2/billDrett[P]Bulletin-Boards/boardServer.cpp
// Function: BoardServer::searchChanel(int)
Chanel* BoardServer::searchChanel(int Id)
{
    for(Node<Chanel>* i = chanels->get_begin(); i != NULL; i = i->get_next()) //vriskei to chanel me auto to ID
    {
        if(i->get_data()->get_id() == Id)
        {
            return i->get_data();
        }
    }

    return NULL;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movl %esi, %ebx
movq 0x30(%rdi), %rdi
callq 0x5fbe
movq %rax, %r14
testq %rax, %rax
je 0x3dac
movq %r14, %rdi
callq 0x6392
movq %rax, %rdi
callq 0x6580
movq %r14, %rdi
cmpl %ebx, %eax
je 0x3db3
callq 0x6388
jmp 0x3d86
xorl %eax, %eax
popq %rbx
popq %r14
popq %rbp
retq
popq %rbx
popq %r14
popq %rbp
jmp 0x6392
// File: /workspace/github_cpp_makefile_star2_O2/billDrett[P]Bulletin-Boards/boardServer.cpp
// Function: BoardServer::addMessageToChanel(int, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
bool BoardServer::addMessageToChanel(int Id, string message)
{
    Chanel* tmp = searchChanel(Id);
    if(tmp == NULL) return false; //dn yparxei chanel me auto to id

    tmp->addMessage(message);
    return true;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movq %rdx, %rbx
callq 0x3d74
movq %rax, %r14
testq %rax, %rax
je 0x3dde
movq %r14, %rdi
movq %rbx, %rsi
callq 0x65dc
testq %r14, %r14
setne %al
popq %rbx
popq %r14
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/billDrett[P]Bulletin-Boards/boardServer.cpp
// Function: BoardServer::addFileToChanel(int, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>*)
bool BoardServer::addFileToChanel(int Id, string* file)
{
    Chanel* tmp = searchChanel(Id);
    if(tmp == NULL) return false; //dn yparxei chanel me auto to id

    tmp->addFile(file);
    return true;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movq %rdx, %rbx
callq 0x3d74
movq %rax, %r14
testq %rax, %rax
je 0x3e0c
movq %r14, %rdi
movq %rbx, %rsi
callq 0x65ce
testq %r14, %r14
setne %al
popq %rbx
popq %r14
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/billDrett[P]Bulletin-Boards/boardServer.cpp
// Function: BoardServer::sendMsgAndFiles(int)
void BoardServer::sendMsgAndFiles(int Id)
{
    Chanel* tmp = searchChanel(Id);
    string buff;
    int nwrite;
    if(tmp == NULL) //an den ypaxei to kanali stelnw <NONE>
    {
        write(pipeServer2Client, "<NONE>", 6);
        return;
    }

    this->sendMesg(tmp); //stelnw message
    this->sendFiles(tmp); //stelnw arxeia
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
subq $0x20, %rsp
movq %rdi, %rbx
callq 0x3d74
leaq -0x20(%rbp), %rcx
movq %rcx, -0x10(%rcx)
andq $0x0, -0x8(%rcx)
movb $0x0, (%rcx)
testq %rax, %rax
je 0x4031
movq %rax, %r14
movq %rbx, %rdi
movq %rax, %rsi
callq 0x406a
movq %rbx, %rdi
movq %r14, %rsi
callq 0x414c
jmp 0x4043
movl 0x4(%rbx), %edi
leaq 0x30de(%rip), %rsi      # 0x7119
pushq $0x6
popq %rdx
callq 0x20e0
leaq -0x30(%rbp), %rdi
callq 0x2130
addq $0x20, %rsp
popq %rbx
popq %r14
popq %rbp
retq
movq %rax, %rbx
leaq -0x30(%rbp), %rdi
callq 0x2130
movq %rbx, %rdi
callq 0x2390
nop
// File: /workspace/github_cpp_makefile_star2_O2/billDrett[P]Bulletin-Boards/boardServer.cpp
// Function: BoardServer::sendMesg(Chanel*)
void BoardServer::sendMesg(Chanel* chanelId)
{
    char buff[BUFFERSIZE];
    int file;
    int nread, nwrite;

    file=open(chanelId->get_messagesFile().c_str(), O_RDONLY, 0644);

    if((nwrite = write(pipeServer2Client, "<Message><start>", 16))== -1) //arxh message
    {
        perror("Cant write to pipe S2C");
    }

    while((nread = read(file, buff, BUFFERSIZE)) > 0) //diavazw apo to arxeio kai stelnw to message
    {
        if(write(pipeServer2Client, buff, nread) == -1)
        {
            perror("Cant write to pipe S2C");
        }
    }

    if((nwrite = write(pipeServer2Client, "<end><Message>", 14))== -1) //telos message
    {
        perror("Cant write to pipe S2C");
    }
    close(file);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x428, %rsp            # imm = 0x428
movq %rdi, %r14
leaq -0x38(%rbp), %rbx
movq %rbx, %rdi
callq 0x65a4
movq (%rbx), %rdi
xorl %esi, %esi
movl $0x1a4, %edx            # imm = 0x1A4
xorl %eax, %eax
callq 0x21c0
movl %eax, %ebx
leaq -0x38(%rbp), %rdi
callq 0x2130
movl 0x4(%r14), %edi
leaq 0x3046(%rip), %rsi      # 0x70f6
pushq $0x10
popq %rdx
callq 0x20e0
cmpl $-0x1, %eax
je 0x40d3
jmp 0x40df
movq %rax, %rbx
leaq -0x38(%rbp), %rdi
callq 0x2130
movq %rbx, %rdi
callq 0x2390
leaq 0x3142(%rip), %rdi      # 0x721c
callq 0x21e0
leaq -0x440(%rbp), %r15
movl $0x400, %edx            # imm = 0x400
movl %ebx, %edi
movq %r15, %rsi
callq 0x2300
movl 0x4(%r14), %edi
testl %eax, %eax
jle 0x4115
andl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
movq %r15, %rsi
movq %rax, %rdx
callq 0x20e0
cmpq $-0x1, %rax
jne 0x40e6
jmp 0x40d3
leaq 0x2fee(%rip), %rsi      # 0x710a
pushq $0xe
popq %rdx
callq 0x20e0
cmpl $-0x1, %eax
je 0x413e
movl %ebx, %edi
callq 0x23f0
addq $0x428, %rsp            # imm = 0x428
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
leaq 0x30d7(%rip), %rdi      # 0x721c
callq 0x21e0
jmp 0x4129
// File: /workspace/github_cpp_makefile_star2_O2/billDrett[P]Bulletin-Boards/boardServer.cpp
// Function: BoardServer::parser()
void BoardServer::parser()
{
    fd_set set_read, set_copy;
    int maxfd = 0;

    FD_ZERO(&set_read);
    FD_SET(pipeClient2Server, &set_read);
    FD_SET(pipeBoardPost2Server, &set_read);

    if(pipeClient2Server > pipeBoardPost2Server) maxfd = pipeClient2Server;
    else maxfd = pipeBoardPost2Server;

    while(1)
    {
        set_copy = set_read;
        select(maxfd + 1, &set_copy, NULL, NULL, NULL);
        if(FD_ISSET(pipeClient2Server, &set_copy)) //otan einai etoimo diavazw apo to pipe client to server
        {
            if(this->readFromC2S() == false)
            {
                return;
            }
        }
        if(FD_ISSET(pipeBoardPost2Server, &set_copy)) //otan einai etoimo diavazw apo to pipe boardPost to server
        {
            this->readFromBp2S();
        }

    }

}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x108, %rsp            # imm = 0x108
movq %rdi, %rbx
xorl %eax, %eax
cmpq $0x10, %rax
je 0x43b3
andq $0x0, -0xa8(%rbp,%rax,8)
incq %rax
jmp 0x439f
movl (%rbx), %esi
pushq $0x40
popq %r15
movl %esi, %eax
cltd
idivl %r15d
movslq %eax, %rdx
shll $0x6, %eax
movl %esi, %ecx
subl %eax, %ecx
pushq $0x1
popq %rdi
movq %rdi, %rax
shlq %cl, %rax
orq %rax, -0xa8(%rbp,%rdx,8)
movl 0x8(%rbx), %r14d
movl %r14d, %eax
cltd
idivl %r15d
movslq %eax, %rdx
shll $0x6, %eax
movl %r14d, %ecx
subl %eax, %ecx
shlq %cl, %rdi
orq %rdi, -0xa8(%rbp,%rdx,8)
cmpl %r14d, %esi
cmovgl %esi, %r14d
incl %r14d
leaq -0x128(%rbp), %r12
leaq -0xa8(%rbp), %r13
pushq $0x10
popq %rcx
movq %r12, %rdi
movq %r13, %rsi
rep  movsq (%rsi), %es:(%rdi)
movl %r14d, %edi
movq %r12, %rsi
xorl %edx, %edx
xorl %ecx, %ecx
xorl %r8d, %r8d
callq 0x2220
movl (%rbx), %eax
cltd
idivl %r15d
cltq
movq -0x128(%rbp,%rax,8), %rax
btq %rdx, %rax
jae 0x4453
movq %rbx, %rdi
callq 0x4486
testb %al, %al
je 0x4474
movl 0x8(%rbx), %eax
cltd
idivl %r15d
cltq
movq -0x128(%rbp,%rax,8), %rax
btq %rdx, %rax
jae 0x4413
movq %rbx, %rdi
callq 0x473c
jmp 0x4413
addq $0x108, %rsp            # imm = 0x108
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/billDrett[P]Bulletin-Boards/boardServer.cpp
// Function: BoardServer::nextState(char*, int, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>&)
int BoardServer::nextState(char* buff, int nread, std::string str1, std::string str2, std::string str3, std::string& commandRest) //mporei na exw panw apo mia entolh sto idio read 'h na min exw kamia
{                                                                                                                                 // prepei na parw thn prwth pou tha sinantisw
    char* tmp1 = findSubstring(buff, str1.c_str(), nread);
    char* tmp2 = findSubstring(buff, str2.c_str(), nread);
    char* tmp3 = findSubstring(buff, str3.c_str(), nread);


    if(tmp1 == NULL)tmp1 = buff + nread; //vazw thn megaliteri thmi se periptwsh poun dn yparxei
    if(tmp2 == NULL)tmp2 = buff + nread;
    if(tmp3 == NULL)tmp3 = buff + nread;

    if(tmp1 > tmp2) //prepei na parw thn pio mikri timh
    {
        if(tmp2 > tmp3) return 3;
        else return 2;
    }
    else //tmp1 <= tmp2
    {
        if(tmp1> tmp3) return 3;
        else //tmp1 <= tmp2 and tmp1 <=tmp3
        {
            if(tmp1 == (buff + nread)) //mporei na einai ola isa tote dn yparxei kanena
            {
                if((tmp1 = getAfterTag(buff, "<", nread)) != NULL) //apothikeuw meros tou string
                {
                    commandRest.assign(tmp1-1, nread+1); // -1 giati thelw na krathsw kai to "< kai +1 sto read gia na to symperilavw
                }

                return -1;
            }
            return 1;
        }
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %r9, %r12
movq %r8, %r15
movl %edx, %r13d
movq %rsi, %rbx
movl %edx, -0x2c(%rbp)
movq (%rcx), %rsi
movq %rbx, %rdi
callq 0x53c0
movq %rax, %r14
movq (%r15), %rsi
movq %rbx, %rdi
movl %r13d, %edx
callq 0x53c0
movq %rax, %r15
movq (%r12), %rsi
movq %rbx, %rdi
movl %r13d, %edx
callq 0x53c0
movslq %r13d, %rcx
addq %rbx, %rcx
testq %r14, %r14
cmoveq %rcx, %r14
testq %r15, %r15
cmoveq %rcx, %r15
testq %rax, %rax
cmoveq %rcx, %rax
cmpq %r15, %r14
jbe 0x4a97
xorl %ebx, %ebx
cmpq %r15, %rax
adcl $0x2, %ebx
jmp 0x4aa8
cmpq %rax, %r14
jbe 0x4aa0
pushq $0x3
jmp 0x4aa7
cmpq %rcx, %r14
je 0x4ab9
pushq $0x1
popq %rbx
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x2679(%rip), %rsi      # 0x7139
leaq -0x2c(%rbp), %rdx
movq %rbx, %rdi
callq 0x5421
pushq $-0x1
popq %rbx
testq %rax, %rax
je 0x4aa8
movq 0x10(%rbp), %rdi
decq %rax
movslq -0x2c(%rbp), %rdx
incq %rdx
movq %rax, %rsi
callq 0x22d0
jmp 0x4aa8
// File: /workspace/github_cpp_makefile_star2_O2/billDrett[P]Bulletin-Boards/boardServer.cpp
// Function: BoardServer::parseAddChanel(char*, int, int, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>&)
void BoardServer::parseAddChanel(char* buffer, int nread, int state, std::string& previousRead) //prosthetw to kanali sthn lista
{
    string  name;
    int id;
    Chanel* ch;

    previousRead.append(buffer, nread); //prosthetw dedomena mporei na xreiastei panw apo ena loop
    if(state == waitingEndCommand)
    {
        istringstream iss(previousRead);
        iss>>id >> name;
        if(iss.fail())
        {
            perror("error detail of chanel");
        }
        else
        {
            Chanel* ch = new Chanel(id, name);
            this->addChanel(ch);
        }
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x1c8, %rsp            # imm = 0x1C8
movq %r8, %r14
movl %ecx, %r15d
leaq -0x30(%rbp), %rax
movq %rax, -0x10(%rax)
andq $0x0, -0x8(%rax)
movq %rdi, %rbx
movb $0x0, (%rax)
movslq %edx, %rdx
movq %r8, %rdi
callq 0x2050
cmpl $0x3, %r15d
jne 0x4bb8
leaq -0x1e0(%rbp), %rdi
pushq $0x8
popq %rdx
movq %r14, %rsi
callq 0x2360
leaq -0x1e0(%rbp), %rdi
leaq -0x1c(%rbp), %rsi
callq 0x21a0
leaq -0x40(%rbp), %rsi
movq %rax, %rdi
callq 0x22b0
movq -0x1e0(%rbp), %rax
movq -0x18(%rax), %rax
testb $0x5, -0x1c0(%rbp,%rax)
jne 0x4bcf
pushq $0x50
popq %rdi
callq 0x2240
movq %rax, %r14
movl -0x1c(%rbp), %r15d
leaq -0x60(%rbp), %rdi
leaq -0x40(%rbp), %rsi
callq 0x22e0
leaq -0x60(%rbp), %rdx
movq %r14, %rdi
movl %r15d, %esi
callq 0x63b4
leaq -0x60(%rbp), %rdi
callq 0x2130
movq %rbx, %rdi
movq %r14, %rsi
callq 0x3d28
leaq -0x1e0(%rbp), %rdi
callq 0x2150
leaq -0x40(%rbp), %rdi
callq 0x2130
addq $0x1c8, %rsp            # imm = 0x1C8
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
leaq 0x268c(%rip), %rdi      # 0x7262
callq 0x21e0
jmp 0x4bac
movq %rax, %rbx
leaq -0x60(%rbp), %rdi
callq 0x2130
jmp 0x4bee
movq %rax, %rbx
pushq $0x50
popq %rsi
movq %r14, %rdi
callq 0x2250
jmp 0x4c02
jmp 0x4c10
jmp 0x4bff
movq %rax, %rbx
leaq -0x1e0(%rbp), %rdi
callq 0x2150
jmp 0x4c13
movq %rax, %rbx
leaq -0x40(%rbp), %rdi
callq 0x2130
movq %rbx, %rdi
callq 0x2390
// File: /workspace/github_cpp_makefile_star2_O2/billDrett[P]Bulletin-Boards/boardServer.cpp
// Function: BoardServer::parseSendMessage(char*, int, int, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>&)
void BoardServer::parseSendMessage(char* buffer, int nread, int state, std::string& previousRead) //diavazei apo poio kanali thelei na lavei ta messages o client
{
    int id;

    previousRead.append(buffer, nread);
    if(state == waitingEndCommand)
    {
        istringstream iss(previousRead);
        iss>>id;
        if(iss.fail())
        {
            perror("error detail of chanel");
        }
        else
        {
            this->sendMsgAndFiles(id); //stelnei ta messages tou chanel
        }
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x188, %rsp            # imm = 0x188
movq %r8, %r14
movl %ecx, %r15d
movq %rdi, %rbx
movslq %edx, %rdx
movq %r8, %rdi
callq 0x2050
cmpl $0x3, %r15d
jne 0x4eef
leaq -0x1a0(%rbp), %r15
pushq $0x8
popq %rdx
movq %r15, %rdi
movq %r14, %rsi
callq 0x2360
leaq -0x1c(%rbp), %rsi
movq %r15, %rdi
callq 0x21a0
movq -0x1a0(%rbp), %rax
movq -0x18(%rax), %rax
testb $0x5, -0x180(%rbp,%rax)
jne 0x4efd
movl -0x1c(%rbp), %esi
movq %rbx, %rdi
callq 0x3fee
leaq -0x1a0(%rbp), %rdi
callq 0x2150
addq $0x188, %rsp            # imm = 0x188
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
leaq 0x235e(%rip), %rdi      # 0x7262
callq 0x21e0
jmp 0x4ee3
movq %rax, %rbx
leaq -0x1a0(%rbp), %rdi
callq 0x2150
movq %rbx, %rdi
callq 0x2390
// File: /workspace/github_cpp_makefile_star2_O2/billDrett[P]Bulletin-Boards/boardServer.cpp
// Function: BoardServer::parseGetMessage(char*, int, int, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>&)
void BoardServer::parseGetMessage(char* buffer, int nread, int state, std::string& previousRead)
{
    char* chanel1;
    int id, chanelSize1, chanelSize2;

    previousRead.append(buffer, nread);

    if(state == waitingEndCommand)
    {
        string chanelString;
        chanelSize1 = previousRead.size();
        chanel1 = getAfterTag(previousRead.c_str(), "*", chanelSize1); //anamesa sta * * vrisketo to chanel sto opoio tha apothikeutei to message

        chanelSize2 = chanelSize1;
        getBeforeTag(chanel1, "*", chanelSize1);

        chanelString.assign(chanel1, chanelSize1);
        id = atoi(chanelString.c_str());
        chanel1 = getAfterTag(chanel1, "*", chanelSize2);
        previousRead.assign(chanel1, chanelSize2);
        this->addMessageToChanel(id, previousRead);
    }

}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x50, %rsp
movq %r8, %r14
movl %ecx, %r15d
movq %rdi, %rbx
movslq %edx, %rdx
movq %r8, %rdi
callq 0x2050
cmpl $0x3, %r15d
jne 0x4ffe
leaq -0x38(%rbp), %rax
movq %rax, -0x10(%rax)
andq $0x0, -0x8(%rax)
movb $0x0, (%rax)
movl 0x8(%r14), %eax
leaq -0x28(%rbp), %rdx
movl %eax, (%rdx)
movq (%r14), %rdi
leaq 0x2306(%rip), %rsi      # 0x7279
callq 0x5421
movq %rax, %r15
leaq -0x28(%rbp), %rdx
movl (%rdx), %eax
movl %eax, -0x24(%rbp)
leaq 0x22ee(%rip), %rsi      # 0x7279
movq %r15, %rdi
callq 0x547f
movslq -0x28(%rbp), %rdx
leaq -0x48(%rbp), %rdi
movq %r15, %rsi
callq 0x22d0
movq -0x48(%rbp), %rdi
callq 0x2350
movl %eax, %r12d
leaq 0x22c3(%rip), %rsi      # 0x7279
leaq -0x24(%rbp), %rdx
movq %r15, %rdi
callq 0x5421
movslq -0x24(%rbp), %rdx
movq %r14, %rdi
movq %rax, %rsi
callq 0x22d0
leaq -0x68(%rbp), %rdi
movq %r14, %rsi
callq 0x22e0
leaq -0x68(%rbp), %rdx
movq %rbx, %rdi
movl %r12d, %esi
callq 0x3dbc
leaq -0x68(%rbp), %rdi
callq 0x2130
leaq -0x48(%rbp), %rdi
callq 0x2130
addq $0x50, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq -0x68(%rbp), %rdi
callq 0x2130
jmp 0x501c
movq %rax, %rbx
leaq -0x48(%rbp), %rdi
callq 0x2130
movq %rbx, %rdi
callq 0x2390
nop
// File: /workspace/github_cpp_makefile_star2_O2/billDrett[P]Bulletin-Boards/stringFuctions.cpp
// Function: findSubstring(char const*, char const*, int)
char* findSubstring(const char* mainString, const char* substring, int mainLength) //epistrefei thn thesh pou vrisketai to subString sto mainString
{
    unsigned int j=0;
    for(int i =0; i < mainLength; i++)
    {
        if(mainString[i]==substring[j])
        {
            j++;
        }
        else
        {
            j = 0;
        }
        if(j == strlen(substring))
        {
            return ((char*)mainString+i-j+1); //to i exei timi thn thesh tou teleutaiou xarakthra tou substring, gia auto afairw to j pou einai to mhkos tou substring kai prosthetw 1 gia na parw thn arxh sto mainString
        }
    }
    return NULL;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %edx, %r15d
movq %rsi, %r12
movq %rdi, %r14
xorl %ebx, %ebx
testl %edx, %edx
cmovlel %ebx, %r15d
xorl %r13d, %r13d
subq $0x1, %r15
jb 0x540f
movb (%r14), %al
movl %r13d, %ecx
incl %r13d
cmpb (%r12,%rcx), %al
cmovnel %ebx, %r13d
movq %r12, %rdi
callq 0x2110
incq %r14
cmpq %r13, %rax
jne 0x53e2
subq %r13, %r14
movq %r14, %rbx
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/billDrett[P]Bulletin-Boards/stringFuctions.cpp
// Function: getAfterTag(char const*, char const*, int&)
char* getAfterTag(const char* mainString, const char* tag, int& length) //epistrefei thn thesh meta to substring, allazei to length gia na ypologisei ta enapominanta bytes
{
    char* start = findSubstring(mainString, tag, length);
    if(start == NULL) return NULL;

    length -= strlen(tag) + (start - mainString); //afairoume ta bytes pou prosperasame
    start+=strlen(tag); //thesh meta to substring
    return start;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %r14
movq %rsi, %rbx
movq %rdi, %r13
movl (%rdx), %r12d
movl %r12d, %edx
callq 0x53c0
testq %rax, %rax
je 0x546e
movq %rax, %r15
movq %rbx, %rdi
callq 0x2110
movl %r15d, %ecx
subl %r13d, %ecx
addl %ecx, %eax
subl %eax, %r12d
movl %r12d, (%r14)
movq %rbx, %rdi
callq 0x2110
addq %r15, %rax
jmp 0x5470
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/billDrett[P]Bulletin-Boards/stringFuctions.cpp
// Function: fileNameExists(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>&)
void fileNameExists(string& fileN) //an yparxei to arxeio sto current directory tou prosthetei sto telos to _copy.
{
    int fp;
    while((fp=open(fileN.c_str(), O_RDONLY, 0644)) != -1)
    {
        int found = fileN.find(".");
        if(found ==string::npos) //an dn yparxei h teleia mpainei sto telos
        {
            found = fileN.size();
        }
        fileN.insert(found, "_copy"); //to _copy prepei na mpei prin thn teleia
        close(fp);
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rdi, %rbx
leaq 0x1bc6(%rip), %r14      # 0x7084
leaq 0x1dfa(%rip), %r15      # 0x72bf
movq (%rbx), %rdi
xorl %esi, %esi
movl $0x1a4, %edx            # imm = 0x1A4
xorl %eax, %eax
callq 0x21c0
cmpl $-0x1, %eax
je 0x550c
movl %eax, %r12d
movq %rbx, %rdi
movq %r14, %rsi
xorl %edx, %edx
callq 0x2400
cmpl $-0x1, %eax
jne 0x54f4
movq 0x8(%rbx), %rax
movslq %eax, %rsi
movq %rbx, %rdi
movq %r15, %rdx
callq 0x20a0
movl %r12d, %edi
callq 0x23f0
jmp 0x54c5
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/billDrett[P]Bulletin-Boards/List.cpp
// Function: List<int>::~List()
List<T>::~List()
{
    Node<T>* tmp = start;
    Node<T>* del;

    while(tmp != NULL)//diagrafoume enan enan tous komvous
    {
        del = tmp;
        tmp = tmp->get_next();
        listSize--;
        delete del;
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rdi, %rbx
movq 0x8(%rdi), %r15
pushq $0x10
popq %r14
testq %r15, %r15
je 0x5584
movq %r15, %rdi
callq 0x62bc
movq %rax, %r12
decl (%rbx)
movq %r15, %rdi
callq 0x62b6
movq %r15, %rdi
movq %r14, %rsi
callq 0x2250
movq %r12, %r15
jmp 0x555a
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rdi
callq 0x528b
nop
// File: /workspace/github_cpp_makefile_star2_O2/billDrett[P]Bulletin-Boards/List.cpp
// Function: List<int>::insertEnd(int*)
void List<T>::insertEnd(T* account)
{
	Node<T>* node = new Node<T>(account);

	if(checkEmpty()) //an einai to monadiko stoixeio prepei na allaksw ton deikti start kai last
	{
	    start = node;
	    last = node;
	    listSize++;
		return;
	}
	//alliws eisodos sto telos ths listas
    last->set_next(node);
    node->set_next(NULL);
    last = node;
    listSize++;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
leaq -0x20(%rbp), %r15
movq %rsi, (%r15)
pushq $0x10
popq %rdi
callq 0x2240
movq %rax, %r14
movq %rax, %rdi
movq %r15, %rsi
callq 0x62a4
cmpl $0x0, (%rbx)
je 0x560d
movq 0x10(%rbx), %rdi
movq %r14, %rsi
callq 0x62d0
movq %r14, %rdi
xorl %esi, %esi
callq 0x62d0
movq %r14, 0x10(%rbx)
movl (%rbx), %eax
incl %eax
jmp 0x5618
movq %r14, 0x8(%rbx)
movq %r14, 0x10(%rbx)
pushq $0x1
popq %rax
movl %eax, (%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
pushq $0x10
popq %rsi
movq %r14, %rdi
callq 0x2250
movq %rbx, %rdi
callq 0x2390
nop
// File: /workspace/github_cpp_makefile_star2_O2/billDrett[P]Bulletin-Boards/List.cpp
// Function: List<int>::insertBeginning(int*)
void List<T>::insertBeginning(T* account)
{
	Node<T>* node = new Node<T>(account);

	if(checkEmpty()) //an einai to monadiko stoixeio prepei na allaksw ton deikti start kai last
	{
	    start = node;
	    last = node;
	    listSize++;
		return;
	}
	//alliws eisodos stin arxi
    node->set_next(start);
    start = node;
    listSize++;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
leaq -0x20(%rbp), %r15
movq %rsi, (%r15)
pushq $0x10
popq %rdi
callq 0x2240
movq %rax, %r14
movq %rax, %rdi
movq %r15, %rsi
callq 0x62a4
cmpl $0x0, (%rbx)
je 0x5681
movq 0x8(%rbx), %rsi
movq %r14, %rdi
callq 0x62d0
movq %r14, 0x8(%rbx)
movl (%rbx), %eax
incl %eax
jmp 0x568c
movq %r14, 0x8(%rbx)
movq %r14, 0x10(%rbx)
pushq $0x1
popq %rax
movl %eax, (%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
pushq $0x10
popq %rsi
movq %r14, %rdi
callq 0x2250
movq %rbx, %rdi
callq 0x2390
nop
// File: /workspace/github_cpp_makefile_star2_O2/billDrett[P]Bulletin-Boards/List.cpp
// Function: List<int>::deleteLastNode()
T* List<T>::deleteLastNode()
{
    Node<T>* tmp = start;
    T* tmpAccount;
    if(checkEmpty())
    {
        return NULL;
    }

    if(listSize == 1) //an exei mono ena stoixeio tote prepei na allaksei kai o deiktis start
    {
        tmpAccount = start->get_data();
        delete start;
        start = NULL;
        last = NULL;
        listSize--;
        return tmpAccount;
    }

    while(tmp->get_next() != last) //pairnw to proteleutaio stoixeio
    {
        tmp = tmp->get_next();
    }
    tmpAccount = last->get_data();
    delete last;
    last = tmp;
    tmp->set_next(NULL);
    listSize--;
    return tmpAccount;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movl (%rdi), %eax
testl %eax, %eax
je 0x57b6
movq %rdi, %rbx
movq 0x8(%rdi), %r15
cmpl $0x1, %eax
jne 0x576f
leaq 0x8(%rbx), %r12
movq %r15, %rdi
callq 0x62c6
movq %rax, %r14
movq (%r12), %r15
testq %r15, %r15
je 0x574f
movq %r15, %rdi
callq 0x62b6
pushq $0x10
popq %rsi
movq %r15, %rdi
callq 0x2250
xorps %xmm0, %xmm0
movups %xmm0, (%r12)
jmp 0x57b2
movq %r15, %rdi
callq 0x62bc
movq %rax, %r15
movq %r15, %rdi
callq 0x62bc
movq 0x10(%rbx), %rdi
cmpq %rdi, %rax
jne 0x5764
callq 0x62c6
movq %rax, %r14
movq 0x10(%rbx), %r12
testq %r12, %r12
je 0x5799
movq %r12, %rdi
callq 0x62b6
pushq $0x10
popq %rsi
movq %r12, %rdi
callq 0x2250
movq %r15, 0x10(%rbx)
movq %r15, %rdi
xorl %esi, %esi
callq 0x62d0
decl (%rbx)
jmp 0x57b9
xorl %r14d, %r14d
movq %r14, %rax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/billDrett[P]Bulletin-Boards/List.cpp
// Function: List<int>::deleteNode(Node<int>*)
T* List<T>::deleteNode(Node<T>* node) //diagrafei tou sigekrimenou node
{
    Node<T>* tmp = start;
    Node<T>* del = NULL;
    T* data = NULL;

    if(checkEmpty() == true)
    {
        return NULL;
    }

    if(start == node) // an einai o prwtos 'h o monadikos komvos
    {
        return this->deleteFirstNode();
    }

    if(last == node) //an o teleutaios
    {
        return this->deleteLastNode();
    }

    while(tmp->get_next() != node)
    {
        if(tmp->get_next() == NULL)
        {
            return NULL;
        }
        tmp = tmp->get_next();
    }
    del = tmp->get_next();
    tmp->set_next(del->get_next());

    data = del->get_data();
    listSize--;
    delete del;
    return data;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
cmpl $0x0, (%rdi)
je 0x581b
movq %rsi, %r14
movq %rdi, %rbx
movq 0x8(%rdi), %r15
cmpq %rsi, %r15
je 0x581f
cmpq %r14, 0x10(%rbx)
je 0x5835
movq %r15, %rdi
callq 0x62bc
movq %rax, %r13
movq %r15, %rdi
callq 0x62bc
movq %rax, %r12
cmpq %r14, %r13
je 0x584b
testq %r12, %r12
je 0x581b
movq %r15, %rdi
callq 0x62bc
movq %rax, %r15
jmp 0x57ee
xorl %eax, %eax
jmp 0x5881
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x56b0
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x570e
movq %r12, %rdi
callq 0x62bc
movq %r15, %rdi
movq %rax, %rsi
callq 0x62d0
movq %r12, %rdi
callq 0x62c6
movq %rax, %r14
decl (%rbx)
movq %r12, %rdi
callq 0x62b6
pushq $0x10
popq %rsi
movq %r12, %rdi
callq 0x2250
movq %r14, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/billDrett[P]Bulletin-Boards/chanel.cpp
// Function: Chanel::Chanel(int, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
Chanel::Chanel(int Id, string Name): id(Id)
{
    ofstream messageFile;
    char buffId[12];
    name = Name;
    files = new List<string>();

    sprintf(buffId, "%d", Id);
    messageFileName = "message_";
    messageFileName.append(buffId);
    messageFile.open(messageFileName.c_str()); //dimiourgoume to arxeio gia thn apothikeush twn mhnymatwn
    messageFile.close();
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x218, %rsp            # imm = 0x218
movq %rdx, %r13
movl %esi, %r15d
movq %rdi, %r12
movl %esi, (%rdi)
leaq 0x8(%rdi), %rbx
leaq 0x18(%rdi), %rax
movq %rax, 0x8(%rdi)
andq $0x0, 0x10(%rdi)
xorl %eax, %eax
movb %al, 0x18(%rdi)
leaq 0x28(%rdi), %r14
leaq 0x38(%rdi), %rcx
movq %rcx, 0x28(%rdi)
andq $0x0, 0x30(%rdi)
movb %al, 0x38(%rdi)
leaq -0x238(%rbp), %rdi
callq 0x2370
movq %rbx, %rdi
movq %r13, %rsi
callq 0x2190
pushq $0x18
popq %rdi
callq 0x2240
movq %rax, %r13
movq %rax, %rdi
callq 0x5890
movq %r13, 0x48(%r12)
leaq 0xcd4(%rip), %rsi       # 0x7107
leaq -0x34(%rbp), %rdi
movl %r15d, %edx
xorl %eax, %eax
callq 0x2070
leaq 0xe7d(%rip), %rsi       # 0x72c5
movq %r14, %rdi
callq 0x23d0
leaq -0x34(%rbp), %rsi
movq %r14, %rdi
callq 0x23c0
movq (%r14), %rsi
leaq -0x238(%rbp), %rdi
pushq $0x10
popq %rdx
callq 0x2040
leaq -0x238(%rbp), %rdi
callq 0x22f0
leaq -0x238(%rbp), %rdi
callq 0x2330
addq $0x218, %rsp            # imm = 0x218
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %r15
pushq $0x18
popq %rsi
movq %r13, %rdi
callq 0x2250
jmp 0x64b0
movq %rax, %r15
jmp 0x64bc
movq %rax, %r15
leaq -0x238(%rbp), %rdi
callq 0x2330
movq %r14, %rdi
callq 0x2130
movq %rbx, %rdi
callq 0x2130
movq %r15, %rdi
callq 0x2390
// File: /workspace/github_cpp_makefile_star2_O2/billDrett[P]Bulletin-Boards/chanel.cpp
// Function: Chanel::removeAllFiles()
void Chanel::removeAllFiles()
{
    string* tmp;

    tmp = files->deleteFirstNode();
    while(tmp != NULL)
    {
        unlink(tmp->c_str());
        delete tmp;
        tmp = files->deleteFirstNode();//diagrafoume ta stoixeia tis listas
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
pushq $0x20
popq %r14
movq 0x48(%rbx), %rdi
callq 0x5a0c
testq %rax, %rax
je 0x6575
movq %rax, %r15
movq (%rax), %rdi
callq 0x2160
movq %r15, %rdi
callq 0x2130
movq %r15, %rdi
movq %r14, %rsi
callq 0x2250
jmp 0x6547
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/billDrett[P]Bulletin-Boards/chanel.cpp
// Function: Chanel::addMessage(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>&)
void Chanel::addMessage(string& message) //apothikeuoume to onoma sto telos tou arxeiou
{
    ofstream messageFile;
    messageFile.open(messageFileName.c_str(), std::ofstream::out | std::ofstream::app);
    if(!messageFile)
    {
        perror("chanel file cant open");
        exit(3);
    }

    messageFile << message;
    messageFile.close();
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x208, %rsp            # imm = 0x208
movq %rsi, %rbx
movq %rdi, %r14
leaq -0x218(%rbp), %r15
movq %r15, %rdi
callq 0x2370
movq 0x28(%r14), %rsi
pushq $0x11
popq %rdx
movq %r15, %rdi
callq 0x2040
movq -0x218(%rbp), %rax
movq -0x18(%rax), %rax
testb $0x5, -0x1f8(%rbp,%rax)
jne 0x665a
leaq -0x218(%rbp), %rdi
movq %rbx, %rsi
callq 0x2200
leaq -0x218(%rbp), %rdi
callq 0x22f0
leaq -0x218(%rbp), %rdi
callq 0x2330
addq $0x208, %rsp            # imm = 0x208
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
leaq 0xc6d(%rip), %rdi       # 0x72ce
callq 0x21e0
pushq $0x3
popq %rdi
callq 0x2290
movq %rax, %rbx
leaq -0x218(%rbp), %rdi
callq 0x2330
movq %rbx, %rdi
callq 0x2390
// File: /workspace/github_cpp_makefile_star2_O2/7shi[P]8086run/v1/main.cpp
// Function: getch()
int getch() {
    char ret;
    if (kbchar == EOF) {
        if (read(STDIN_FILENO, &ret, 1) < 1) return EOF;
    } else {
        ret = kbchar;
        kbchar = EOF;
    }
    if (ret == 10) ret = 13;
    return ret;
}

// Assembly:
pushq %rax
movl 0x6e4d(%rip), %eax      # 0x80d0
cmpl $-0x1, %eax
je 0x1291
orl $-0x1, 0x6e41(%rip)     # 0x80d0
jmp 0x12a9
leaq 0x7(%rsp), %rsi
pushq $0x1
popq %rdx
xorl %edi, %edi
callq 0x1140
testq %rax, %rax
jle 0x12b9
movb 0x7(%rsp), %al
cmpb $0xa, %al
movzbl %al, %eax
pushq $0xd
popq %rcx
cmovnel %eax, %ecx
movsbl %cl, %eax
popq %rcx
retq
pushq $-0x1
popq %rax
jmp 0x12b7
// File: /workspace/github_cpp_makefile_star2_O2/7shi[P]8086run/v1/main.cpp
// Function: kbhit()
int kbhit() {
    if (kbchar != EOF) return 1;
    int f = fcntl(STDIN_FILENO, F_GETFL, 0);
    fcntl(STDIN_FILENO, F_SETFL, f | O_NONBLOCK);
    char ch;
    kbchar = read(STDIN_FILENO, &ch, 1) < 1 ? EOF : ch;
    fcntl(STDIN_FILENO, F_SETFL, f);
    return kbchar != EOF;
}

// Assembly:
cmpl $-0x1, 0x6e0b(%rip)     # 0x80d0
je 0x12cb
pushq $0x1
popq %rax
retq
pushq %rbp
pushq %r14
pushq %rbx
subq $0x10, %rsp
pushq $0x3
popq %rsi
xorl %edi, %edi
xorl %edx, %edx
xorl %eax, %eax
callq 0x1050
movl %eax, %ebx
movl %eax, %edx
orl $0x800, %edx            # imm = 0x800
pushq $0x4
popq %rbp
xorl %edi, %edi
movl %ebp, %esi
xorl %eax, %eax
callq 0x1050
leaq 0xf(%rsp), %r14
pushq $0x1
popq %rdx
xorl %edi, %edi
movq %r14, %rsi
callq 0x1140
testq %rax, %rax
movsbl (%r14), %eax
pushq $-0x1
popq %rcx
cmovgl %eax, %ecx
movl %ecx, 0x6db2(%rip)      # 0x80d0
xorl %edi, %edi
movl %ebp, %esi
movl %ebx, %edx
xorl %eax, %eax
callq 0x1050
xorl %eax, %eax
cmpl $-0x1, 0x6d9c(%rip)     # 0x80d0
setne %al
addq $0x10, %rsp
popq %rbx
popq %r14
popq %rbp
retq