LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O1/iZhangHui[P]CppPrimer/CH13_CopyControl/examples/StrFolder.cc
// Function: swap(Message&, Message&)
void swap(Message &lhs, Message &rhs)
{
	using std::swap;  // not strictly needed in this case, but good habit

	// remove pointers to each Message from their (original) respective Folders
	for (auto f : lhs.folders)
		f->remMsg(&lhs);
	for (auto f : rhs.folders)
		f->remMsg(&rhs);

	// swap the contents and Folder pointer sets
	swap(lhs.folders, rhs.folders);   // uses swap(set&, set&)
	swap(lhs.contents, rhs.contents); // swap(String&, String&)

	// add pointers to each Message to their (new) respective Folders
	for (auto f : lhs.folders)
		f->addMsg(&lhs);
	for (auto f : rhs.folders)
		f->addMsg(&rhs);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %rsi, -0x50(%rbp)
movq %rdi, %r14
movq 0x28(%rdi), %r15
leaq 0x18(%rdi), %rbx
cmpq %rbx, %r15
je 0x13e3
leaq -0x30(%rbp), %r12
movq 0x20(%r15), %r13
movq %r14, -0x30(%rbp)
movq %r13, %rdi
movq %r12, %rsi
callq 0x2c1a
movq %r13, %rdi
movq %rax, %rsi
callq 0x2c9c
movq %r15, %rdi
callq 0x1150
movq %rax, %r15
cmpq %rbx, %rax
jne 0x13b5
movq %rbx, -0x58(%rbp)
leaq 0x10(%r14), %rax
movq %rax, -0x40(%rbp)
movq -0x50(%rbp), %rbx
leaq 0x10(%rbx), %rax
movq %rax, -0x38(%rbp)
movq 0x28(%rbx), %r13
leaq 0x18(%rbx), %r15
cmpq %r15, %r13
je 0x1437
movq 0x20(%r13), %r12
movq %rbx, -0x30(%rbp)
movq %r12, %rdi
leaq -0x30(%rbp), %rsi
callq 0x2c1a
movq %r12, %rdi
movq %rax, %rsi
callq 0x2c9c
movq %r13, %rdi
callq 0x1150
movq %rax, %r13
cmpq %r15, %rax
jne 0x1408
movq %r15, -0x48(%rbp)
movq -0x40(%rbp), %rdi
movq -0x38(%rbp), %rsi
callq 0x2d22
movq 0x8(%r14), %rax
movq 0x8(%rbx), %rcx
movq %rcx, 0x8(%r14)
movq %rax, 0x8(%rbx)
movq (%r14), %rax
movq (%rbx), %rcx
movq %rcx, (%r14)
movq %rax, (%rbx)
movq 0x28(%r14), %r15
movq -0x58(%rbp), %r13
cmpq %r13, %r15
je 0x1495
leaq -0x30(%rbp), %r12
movq 0x20(%r15), %rdi
movq %r14, -0x30(%rbp)
movq %r12, %rsi
callq 0x1f06
movq %r15, %rdi
callq 0x1150
movq %rax, %r15
cmpq %r13, %rax
jne 0x1475
movq 0x28(%rbx), %r14
movq -0x48(%rbp), %r12
cmpq %r12, %r14
je 0x14c6
leaq -0x30(%rbp), %r15
movq 0x20(%r14), %rdi
movq %rbx, -0x30(%rbp)
movq %r15, %rsi
callq 0x1f06
movq %r14, %rdi
callq 0x1150
movq %rax, %r14
cmpq %r12, %rax
jne 0x14a6
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/iZhangHui[P]CppPrimer/CH13_CopyControl/examples/StrFolder.cc
// Function: Folder::operator=(Folder&&)
Folder& Folder::operator=(Folder&& f)
{
	if (this != &f) {        // direct check for self-assignment
		remove_from_Msgs();  // remove this Folder from the current msgs
		move_Messages(&f);   // make each Message point to this Folder
	}
	return *this;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movq %rdi, %rbx
cmpq %rsi, %rdi
je 0x15de
movq %rsi, %r14
cmpq $0x0, 0x28(%rbx)
je 0x15d3
movq 0x18(%rbx), %rax
movq 0x20(%rax), %rdi
movq %rbx, %rsi
callq 0x19fa
jmp 0x15ba
movq %rbx, %rdi
movq %r14, %rsi
callq 0x151a
movq %rbx, %rax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/iZhangHui[P]CppPrimer/CH13_CopyControl/examples/String.cc
// Function: String::operator=(String const&)
String& String::operator=(const String& rhs)
{
	// copying the right-hand operand before deleting the left handles self-assignment
	auto newp = a.allocate(rhs.sz); // copy the underlying string from rhs
	uninitialized_copy(rhs.p, rhs.p + rhs.sz, newp);

	if (p)
		a.deallocate(p, sz); // free the memory used by the left-hand operand
	p = newp;    // p now points to the newly allocated string
	sz = rhs.sz; // update the size

	return *this;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq (%rsi), %rdi
testq %rdi, %rdi
js 0x4439
movq %rsi, %r14
callq 0x1110
movq %rax, %r15
movq (%r14), %rdx
testq %rdx, %rdx
je 0x4410
movq 0x8(%r14), %rsi
movq %r15, %rdi
callq 0x1180
movq 0x8(%rbx), %rdi
testq %rdi, %rdi
je 0x4421
movq (%rbx), %rsi
callq 0x1120
movq %r15, 0x8(%rbx)
movq (%r14), %rax
movq %rax, (%rbx)
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
callq 0x1060
// File: /workspace/github_cpp_makefile_star2_O1/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 0x4476
movq %rsi, %r14
movq 0x8(%rbx), %rdi
testq %rdi, %rdi
je 0x4461
movq (%rbx), %rsi
callq 0x1120
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_O1/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 0x449c
movq (%rbx), %rsi
callq 0x1120
movq %r14, %rdi
callq 0x1080
movq %rax, (%rbx)
testq %rax, %rax
js 0x44d3
movq %rax, %rdi
callq 0x1110
movq %rax, 0x8(%rbx)
movq (%rbx), %rdx
testq %rdx, %rdx
je 0x44cb
movq %rax, %rdi
movq %r14, %rsi
callq 0x10e0
movq %rbx, %rax
popq %rbx
popq %r14
popq %rbp
retq
callq 0x1060
// File: /workspace/github_cpp_makefile_star2_O1/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 0x44f6
movq (%rbx), %rsi
callq 0x1120
movq $0x1, (%rbx)
movl $0x1, %edi
callq 0x1110
movq %rax, 0x8(%rbx)
movb %r14b, (%rax)
movq %rbx, %rax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/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 0x453a
movq (%rbx), %rsi
callq 0x1120
movq %r14, (%rbx)
testq %r14, %r14
js 0x456f
movq %r14, %rdi
callq 0x1110
movq %rax, 0x8(%rbx)
testq %r14, %r14
je 0x4561
movq %rax, %rdi
movq %r15, %rsi
movq %r14, %rdx
callq 0x10e0
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
callq 0x1060
// File: /workspace/github_cpp_makefile_star2_O1/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 %r12
pushq %rbx
subq $0x10, %rsp
movq %rdi, %rbx
cmpq $0x0, (%rsi)
je 0x45bd
movq %rsi, %r14
movq 0x8(%rsi), %r12
leaq -0x21(%rbp), %r15
movb (%r12), %al
incq %r12
movb %al, -0x21(%rbp)
movl $0x1, %edx
movq %rbx, %rdi
movq %r15, %rsi
callq 0x1140
movq 0x8(%r14), %rax
addq (%r14), %rax
cmpq %rax, %r12
jne 0x4597
movq %rbx, %rax
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/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 %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
xorps %xmm0, %xmm0
movups %xmm0, (%rdi)
movq (%rsi), %r15
addq (%rdx), %r15
movq %r15, (%rdi)
js 0x4645
movq %rdx, %r14
movq %rsi, %r13
movq %r15, %rdi
callq 0x1110
movq %rax, %r12
movq %rax, 0x8(%rbx)
movq (%r13), %r15
testq %r15, %r15
je 0x461c
movq 0x8(%r13), %rsi
movq %r12, %rdi
movq %r15, %rdx
callq 0x1180
movq (%r14), %rdx
testq %rdx, %rdx
je 0x4633
movq 0x8(%r14), %rsi
addq %r15, %r12
movq %r12, %rdi
callq 0x1180
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0x1060
movq %rax, %r14
movq 0x8(%rbx), %rdi
testq %rdi, %rdi
je 0x465e
movq %r15, %rsi
callq 0x1120
movq %r14, %rdi
callq 0x11b0
// File: /workspace/github_cpp_makefile_star2_O1/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
movl $0x1, %esi
xorl %eax, %eax
callq 0x21b0
movl %eax, (%rbx)
testl %eax, %eax
js 0x3889
movq (%r14), %rdi
movl $0x2, %esi
xorl %eax, %eax
callq 0x21b0
movl %eax, 0x4(%rbx)
testl %eax, %eax
js 0x3897
popq %rbx
popq %r14
popq %rbp
retq
leaq 0x4820(%rip), %rdi      # 0x80b0
callq 0x21d0
jmp 0x386e
leaq 0x4825(%rip), %rdi      # 0x80c3
popq %rbx
popq %r14
popq %rbp
jmp 0x21d0
nop
// File: /workspace/github_cpp_makefile_star2_O1/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 %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %rdx, %r14
movl %esi, %r15d
movq %rdi, %rbx
leaq -0x38(%rbp), %r13
movq %r13, -0x10(%r13)
movq $0x0, -0x8(%r13)
movb $0x0, (%r13)
movl (%rdi), %edi
leaq 0x47de(%rip), %rsi      # 0x80d6
movl $0x8, %edx
callq 0x20f0
cmpl $-0x1, %eax
je 0x39bf
movl (%rbx), %edi
leaq 0x47ef(%rip), %rsi      # 0x8103
movl $0x7, %edx
callq 0x20f0
cmpl $-0x1, %eax
je 0x39d0
leaq 0x47c8(%rip), %rsi      # 0x80f6
leaq -0x60(%rbp), %r12
movq %r12, %rdi
movl %r15d, %edx
xorl %eax, %eax
callq 0x2080
leaq -0x48(%rbp), %rdi
movq %r12, %rsi
callq 0x23f0
movq (%r14), %rsi
leaq -0x48(%rbp), %rdi
callq 0x23f0
movl (%rbx), %edi
movq -0x48(%rbp), %rsi
movq -0x40(%rbp), %rdx
callq 0x20f0
cmpl $-0x1, %eax
je 0x39e1
movl (%rbx), %edi
leaq 0x48ce(%rip), %rsi      # 0x8242
movl $0x5, %edx
callq 0x20f0
cmpl $-0x1, %eax
je 0x39f2
movl (%rbx), %edi
leaq 0x474a(%rip), %rsi      # 0x80d6
movl $0x8, %edx
callq 0x20f0
cmpl $-0x1, %eax
je 0x3a00
movq -0x48(%rbp), %rdi
cmpq %r13, %rdi
je 0x39b0
movq -0x38(%rbp), %rsi
incq %rsi
callq 0x2230
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x4719(%rip), %rdi      # 0x80df
callq 0x21d0
jmp 0x390b
leaq 0x4708(%rip), %rdi      # 0x80df
callq 0x21d0
jmp 0x3927
leaq 0x46f7(%rip), %rdi      # 0x80df
callq 0x21d0
jmp 0x396b
leaq 0x46e6(%rip), %rdi      # 0x80df
callq 0x21d0
jmp 0x3983
leaq 0x46d8(%rip), %rdi      # 0x80df
callq 0x21d0
jmp 0x399b
movq %rax, %rbx
movq -0x48(%rbp), %rdi
cmpq %r13, %rdi
je 0x3a26
movq -0x38(%rbp), %rsi
incq %rsi
callq 0x2230
movq %rbx, %rdi
callq 0x23c0
// File: /workspace/github_cpp_makefile_star2_O1/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 %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movl %esi, %r14d
movq %rdi, %rbx
leaq -0x38(%rbp), %r13
movq %r13, -0x10(%r13)
movq $0x0, -0x8(%r13)
movb $0x0, (%r13)
movl (%rdi), %edi
leaq 0x4697(%rip), %rsi      # 0x80fa
movl $0x10, %edx
callq 0x20f0
cmpl $-0x1, %eax
je 0x3b0d
leaq 0x468e(%rip), %rsi      # 0x810b
leaq -0x60(%rbp), %r15
movq %r15, %rdi
movl %r14d, %edx
xorl %eax, %eax
callq 0x2080
leaq -0x48(%rbp), %r14
movq 0x8(%r14), %r12
movq %r15, %rdi
callq 0x2120
movq %r14, %rdi
xorl %esi, %esi
movq %r12, %rdx
movq %r15, %rcx
movq %rax, %r8
callq 0x2360
movl (%rbx), %edi
movq -0x48(%rbp), %rsi
movq -0x40(%rbp), %rdx
callq 0x20f0
cmpl $-0x1, %eax
je 0x3b1e
movl (%rbx), %edi
leaq 0x4640(%rip), %rsi      # 0x810e
movl $0xe, %edx
callq 0x20f0
cmpl $-0x1, %eax
je 0x3b6a
movq %rbx, %rdi
callq 0x3b9c
movq -0x48(%rbp), %rdi
cmpq %r13, %rdi
je 0x3afe
movq -0x38(%rbp), %rsi
incq %rsi
callq 0x2230
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x45cb(%rip), %rdi      # 0x80df
callq 0x21d0
jmp 0x3a76
leaq 0x45ba(%rip), %rdi      # 0x80df
callq 0x21d0
movq 0x849f(%rip), %rdi      # 0xbfd0
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0x23a0
movq %rax, %r14
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x2210
movsbl %al, %esi
movq %r14, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x2190
jmp 0x3ac5
leaq 0x456e(%rip), %rdi      # 0x80df
callq 0x21d0
jmp 0x3ae1
movq %rax, %rbx
movq -0x48(%rbp), %rdi
cmpq %r13, %rdi
je 0x3b93
movq -0x38(%rbp), %rsi
incq %rsi
callq 0x2230
movq %rbx, %rdi
callq 0x23c0
nop
// File: /workspace/github_cpp_makefile_star2_O1/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 0x10(%rdi), %rbx
leaq 0x20(%rdi), %rax
movq %rax, -0x30(%rbp)
movq %rax, 0x10(%rdi)
movq $0x0, 0x18(%rdi)
movb $0x0, 0x20(%rdi)
movq (%rsi), %rdi
movl $0x2, %esi
xorl %eax, %eax
callq 0x21b0
movl %eax, (%r14)
testl %eax, %eax
js 0x483e
movq (%r13), %rdi
movl $0x1, %esi
xorl %eax, %eax
callq 0x21b0
movl %eax, 0x4(%r14)
testl %eax, %eax
js 0x4843
movq (%r12), %rdi
movl $0x2, %esi
xorl %eax, %eax
callq 0x21b0
movl %eax, 0x8(%r14)
testl %eax, %eax
js 0x4848
movl $0xffffffff, 0xc(%r14)  # imm = 0xFFFFFFFF
movq (%r15), %r15
movq 0x18(%r14), %r12
movq %r15, %rdi
callq 0x2120
movq %rbx, %rdi
xorl %esi, %esi
movq %r12, %rdx
movq %r15, %rcx
movq %rax, %r8
callq 0x2360
movl $0x18, %edi
callq 0x2220
movq %rax, %r15
movq %rax, %rdi
callq 0x7138
movq %r15, 0x30(%r14)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0x2478
callq 0x2460
callq 0x2448
movq %rax, %r14
movl $0x18, %esi
movq %r15, %rdi
callq 0x2230
jmp 0x4862
movq %rax, %r14
movq (%rbx), %rdi
cmpq -0x30(%rbp), %rdi
je 0x487a
movq -0x30(%rbp), %rax
movq (%rax), %rsi
incq %rsi
callq 0x2230
movq %r14, %rdi
callq 0x23c0
// File: /workspace/github_cpp_makefile_star2_O1/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 %r14
pushq %rbx
movq %rdi, %rbx
movq 0x30(%rdi), %rdi
callq 0x72b0
movq %rax, %r14
testq %r14, %r14
je 0x48c0
movq %r14, %rdi
callq 0x7736
movl $0x50, %esi
movq %r14, %rdi
callq 0x2230
movq 0x30(%rbx), %rdi
callq 0x72b0
movq %rax, %r14
jmp 0x4898
movq 0x30(%rbx), %r14
testq %r14, %r14
je 0x48de
movq %r14, %rdi
callq 0x714c
movl $0x18, %esi
movq %r14, %rdi
callq 0x2230
movq %rbx, %rdi
callq 0x4912
movq 0x10(%rbx), %rdi
addq $0x20, %rbx
cmpq %rbx, %rdi
je 0x4902
movq (%rbx), %rsi
incq %rsi
popq %rbx
popq %r14
popq %rbp
jmp 0x2230
popq %rbx
popq %r14
popq %rbp
retq
jmp 0x4909
movq %rax, %rdi
callq 0x64ea
nop
// File: /workspace/github_cpp_makefile_star2_O1/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 0x2400
movl (%rbx), %edi
callq 0x2400
movl 0xc(%rbx), %edi
callq 0x2400
movl 0x4(%rbx), %edi
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x2400
// File: /workspace/github_cpp_makefile_star2_O1/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 0x71b4
testq %rax, %rax
je 0x4a00
movq %rax, %r14
movq %r14, %rdi
callq 0x758a
movq %rax, %rdi
callq 0x781c
movq %r14, %rdi
cmpl %ebx, %eax
je 0x4a07
callq 0x7580
movq %rax, %r14
testq %rax, %rax
jne 0x49dc
xorl %eax, %eax
popq %rbx
popq %r14
popq %rbp
retq
popq %rbx
popq %r14
popq %rbp
jmp 0x758a
// File: /workspace/github_cpp_makefile_star2_O1/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 0x49c2
movq %rax, %r14
testq %rax, %rax
je 0x4a32
movq %r14, %rdi
movq %rbx, %rsi
callq 0x789c
testq %r14, %r14
setne %al
popq %rbx
popq %r14
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/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 0x49c2
movq %rax, %r14
testq %rax, %rax
je 0x4a60
movq %r14, %rdi
movq %rbx, %rsi
callq 0x788e
testq %r14, %r14
setne %al
popq %rbx
popq %r14
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/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 %r15
pushq %r14
pushq %rbx
subq $0x28, %rsp
movq %rdi, %rbx
callq 0x49c2
leaq -0x28(%rbp), %r15
movq %r15, -0x10(%r15)
movq $0x0, -0x8(%r15)
movb $0x0, (%r15)
testq %rax, %rax
je 0x4d03
movq %rax, %r14
movq %rbx, %rdi
movq %rax, %rsi
callq 0x4d58
movq %rbx, %rdi
movq %r14, %rsi
callq 0x4e96
jmp 0x4d17
movl 0x4(%rbx), %edi
leaq 0x3410(%rip), %rsi      # 0x811d
movl $0x6, %edx
callq 0x20f0
movq -0x38(%rbp), %rdi
cmpq %r15, %rdi
je 0x4d2c
movq -0x28(%rbp), %rsi
incq %rsi
callq 0x2230
addq $0x28, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movq -0x38(%rbp), %rdi
cmpq %r15, %rdi
je 0x4d4f
movq -0x28(%rbp), %rsi
incq %rsi
callq 0x2230
movq %rbx, %rdi
callq 0x23c0
nop
// File: /workspace/github_cpp_makefile_star2_O1/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 %r12
pushq %rbx
subq $0x420, %rsp            # imm = 0x420
movq %rdi, %r14
leaq -0x40(%rbp), %rbx
movq %rbx, %rdi
callq 0x7852
movq (%rbx), %rdi
xorl %esi, %esi
movl $0x1a4, %edx            # imm = 0x1A4
xorl %eax, %eax
callq 0x21b0
movl %eax, %ebx
leaq -0x30(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x4da5
movq -0x30(%rbp), %rsi
incq %rsi
callq 0x2230
movl 0x4(%r14), %edi
leaq 0x334a(%rip), %rsi      # 0x80fa
movl $0x10, %edx
callq 0x20f0
cmpl $-0x1, %eax
je 0x4e52
leaq -0x440(%rbp), %rsi
movl $0x400, %edx            # imm = 0x400
movl %ebx, %edi
callq 0x2300
testl %eax, %eax
jle 0x4e21
leaq -0x440(%rbp), %r15
leaq 0x3438(%rip), %r12      # 0x8220
movl 0x4(%r14), %edi
andl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
movq %r15, %rsi
movq %rax, %rdx
callq 0x20f0
cmpq $-0x1, %rax
je 0x4e17
movl $0x400, %edx            # imm = 0x400
movl %ebx, %edi
movq %r15, %rsi
callq 0x2300
testl %eax, %eax
jg 0x4de8
jmp 0x4e21
movq %r12, %rdi
callq 0x21d0
jmp 0x4e02
movl 0x4(%r14), %edi
leaq 0x32e2(%rip), %rsi      # 0x810e
movl $0xe, %edx
callq 0x20f0
cmpl $-0x1, %eax
je 0x4e63
movl %ebx, %edi
callq 0x2400
addq $0x420, %rsp            # imm = 0x420
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
leaq 0x33c7(%rip), %rdi      # 0x8220
callq 0x21d0
jmp 0x4dc3
leaq 0x33b6(%rip), %rdi      # 0x8220
callq 0x21d0
jmp 0x4e3b
movq %rax, %rbx
leaq -0x30(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x4e8d
movq -0x30(%rbp), %rsi
incq %rsi
callq 0x2230
movq %rbx, %rdi
callq 0x23c0
nop
// File: /workspace/github_cpp_makefile_star2_O1/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 %r12
pushq %rbx
subq $0x100, %rsp            # imm = 0x100
movq %rdi, %rbx
xorps %xmm0, %xmm0
leaq -0xa0(%rbp), %r14
movaps %xmm0, (%r14)
movaps %xmm0, 0x10(%r14)
movaps %xmm0, 0x20(%r14)
movaps %xmm0, 0x30(%r14)
movaps %xmm0, 0x40(%r14)
movaps %xmm0, 0x50(%r14)
movaps %xmm0, 0x60(%r14)
movaps %xmm0, 0x70(%r14)
movl (%rdi), %eax
leal 0x3f(%rax), %edx
testl %eax, %eax
cmovnsl %eax, %edx
movl %edx, %esi
andl $-0x40, %esi
movl %eax, %ecx
subl %esi, %ecx
movl $0x1, %esi
shlq %cl, %rsi
movl $0x1, %edi
sarl $0x6, %edx
movslq %edx, %rcx
orq %rsi, -0xa0(%rbp,%rcx,8)
movl 0x8(%rbx), %r15d
leal 0x3f(%r15), %edx
testl %r15d, %r15d
cmovnsl %r15d, %edx
movl %edx, %esi
andl $-0x40, %esi
movl %r15d, %ecx
subl %esi, %ecx
shlq %cl, %rdi
sarl $0x6, %edx
movslq %edx, %rcx
orq %rdi, -0xa0(%rbp,%rcx,8)
cmpl %r15d, %eax
cmovgl %eax, %r15d
incl %r15d
leaq -0x120(%rbp), %r12
movl $0x10, %ecx
movq %r12, %rdi
movq %r14, %rsi
rep  movsq (%rsi), %es:(%rdi)
movl %r15d, %edi
movq %r12, %rsi
xorl %edx, %edx
xorl %ecx, %ecx
xorl %r8d, %r8d
callq 0x2200
movl (%rbx), %eax
leal 0x3f(%rax), %ecx
testl %eax, %eax
cmovnsl %eax, %ecx
sarl $0x6, %ecx
movslq %ecx, %rcx
movq -0x120(%rbp,%rcx,8), %rcx
btq %rax, %rcx
jae 0x5229
movq %rbx, %rdi
callq 0x5262
testb %al, %al
je 0x5252
movl 0x8(%rbx), %eax
leal 0x3f(%rax), %ecx
testl %eax, %eax
cmovnsl %eax, %ecx
sarl $0x6, %ecx
movslq %ecx, %rcx
movq -0x120(%rbp,%rcx,8), %rcx
btq %rax, %rcx
jae 0x51df
movq %rbx, %rdi
callq 0x5610
jmp 0x51df
addq $0x100, %rsp            # imm = 0x100
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/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 %r12
pushq %rbx
subq $0x10, %rsp
movq %r9, %r15
movq %r8, %r12
movq %rsi, %rbx
movl %edx, -0x24(%rbp)
movq (%rcx), %rsi
movq %rbx, %rdi
callq 0x6594
movq %rax, %r14
movq (%r12), %rsi
movl -0x24(%rbp), %edx
movq %rbx, %rdi
callq 0x6594
movq %rax, %r12
movq (%r15), %rsi
movl -0x24(%rbp), %edx
movq %rbx, %rdi
callq 0x6594
movslq -0x24(%rbp), %rcx
addq %rbx, %rcx
testq %r14, %r14
cmoveq %rcx, %r14
testq %r12, %r12
cmoveq %rcx, %r12
testq %rax, %rax
cmoveq %rcx, %rax
cmpq %r12, %r14
jbe 0x5aa2
xorl %r15d, %r15d
cmpq %r12, %rax
adcl $0x2, %r15d
jmp 0x5af2
movl $0x3, %r15d
cmpq %rax, %r14
ja 0x5af2
movl $0x1, %r15d
cmpq %rcx, %r14
jne 0x5af2
leaq 0x267e(%rip), %rsi      # 0x813d
leaq -0x24(%rbp), %rdx
movq %rbx, %rdi
callq 0x65ee
movl $0xffffffff, %r15d      # imm = 0xFFFFFFFF
testq %rax, %rax
je 0x5af2
movq 0x10(%rbp), %rdi
decq %rax
movslq -0x24(%rbp), %r8
incq %r8
movq 0x8(%rdi), %rdx
xorl %esi, %esi
movq %rax, %rcx
callq 0x2360
movl %r15d, %eax
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/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 %r13
pushq %r12
pushq %rbx
subq $0x1c8, %rsp            # imm = 0x1C8
movq %r8, %r14
movl %ecx, %r15d
movq %rdi, %rbx
leaq -0x40(%rbp), %r12
movq %r12, -0x10(%r12)
movq $0x0, -0x8(%r12)
movb $0x0, (%r12)
movslq %edx, %rdx
movq %r8, %rdi
callq 0x2060
cmpl $0x3, %r15d
jne 0x5c0f
leaq -0x1f0(%rbp), %rdi
movq %r14, %rsi
movl $0x8, %edx
callq 0x2380
leaq -0x1f0(%rbp), %rdi
leaq -0x2c(%rbp), %rsi
callq 0x2180
leaq -0x50(%rbp), %rsi
movq %rax, %rdi
callq 0x22c0
movq -0x1f0(%rbp), %rax
movq -0x18(%rax), %rax
testb $0x5, -0x1d0(%rbp,%rax)
jne 0x5c36
movl $0x50, %edi
callq 0x2220
movq %rax, %r14
movl -0x2c(%rbp), %r15d
leaq -0x60(%rbp), %r13
movq %r13, -0x10(%r13)
movq -0x50(%rbp), %rsi
movq -0x48(%rbp), %rdx
addq %rsi, %rdx
leaq -0x70(%rbp), %rdi
callq 0x37b2
leaq -0x70(%rbp), %rdx
movq %r14, %rdi
movl %r15d, %esi
callq 0x75ac
movq -0x70(%rbp), %rdi
cmpq %r13, %rdi
je 0x5be5
movq -0x60(%rbp), %rsi
incq %rsi
callq 0x2230
movq %rbx, %rdi
movq %r14, %rsi
callq 0x4974
movq 0x63d1(%rip), %rsi      # 0xbfc8
leaq -0x1f0(%rbp), %rdi
callq 0x22f0
leaq -0x178(%rbp), %rdi
callq 0x20e0
movq -0x50(%rbp), %rdi
cmpq %r12, %rdi
je 0x5c24
movq -0x40(%rbp), %rsi
incq %rsi
callq 0x2230
addq $0x1c8, %rsp            # imm = 0x1C8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x2629(%rip), %rdi      # 0x8266
callq 0x21d0
jmp 0x5bf0
movq %rax, %rbx
movq -0x70(%rbp), %rdi
cmpq %r13, %rdi
je 0x5c61
movq -0x60(%rbp), %rsi
incq %rsi
callq 0x2230
jmp 0x5c61
movq %rax, %rbx
movl $0x50, %esi
movq %r14, %rdi
callq 0x2230
jmp 0x5c77
jmp 0x5c98
jmp 0x5c74
movq %rax, %rbx
movq 0x634a(%rip), %rsi      # 0xbfc8
leaq -0x1f0(%rbp), %rdi
callq 0x22f0
leaq -0x178(%rbp), %rdi
callq 0x20e0
jmp 0x5c9b
movq %rax, %rbx
movq -0x50(%rbp), %rdi
cmpq %r12, %rdi
je 0x5cb0
movq -0x40(%rbp), %rsi
incq %rsi
callq 0x2230
movq %rbx, %rdi
callq 0x23c0
// File: /workspace/github_cpp_makefile_star2_O1/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 0x2060
cmpl $0x3, %r15d
jne 0x5ff6
leaq -0x1a0(%rbp), %r15
movq %r15, %rdi
movq %r14, %rsi
movl $0x8, %edx
callq 0x2380
leaq -0x1c(%rbp), %rsi
movq %r15, %rdi
callq 0x2180
movq -0x1a0(%rbp), %rax
movq -0x18(%rax), %rax
testb $0x5, -0x180(%rbp,%rax)
jne 0x6004
movl -0x1c(%rbp), %esi
movq %rbx, %rdi
callq 0x4cba
movq 0x5fea(%rip), %rsi      # 0xbfc8
leaq -0x1a0(%rbp), %rdi
callq 0x22f0
leaq -0x128(%rbp), %rdi
callq 0x20e0
addq $0x188, %rsp            # imm = 0x188
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
leaq 0x225b(%rip), %rdi      # 0x8266
callq 0x21d0
jmp 0x5fd7
movq %rax, %rbx
movq 0x5fac(%rip), %rsi      # 0xbfc8
leaq -0x1a0(%rbp), %rdi
callq 0x22f0
leaq -0x128(%rbp), %rdi
callq 0x20e0
movq %rbx, %rdi
callq 0x23c0
// File: /workspace/github_cpp_makefile_star2_O1/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 %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movq %r8, %r14
movl %ecx, %r15d
movq %rdi, %rbx
movslq %edx, %rdx
movq %r8, %rdi
callq 0x2060
cmpl $0x3, %r15d
jne 0x6160
leaq -0x60(%rbp), %r13
movq %r13, -0x10(%r13)
movq $0x0, -0x8(%r13)
movb $0x0, (%r13)
movl 0x8(%r14), %eax
leaq -0x30(%rbp), %rdx
movl %eax, (%rdx)
movq (%r14), %rdi
leaq 0x21e9(%rip), %rsi      # 0x827d
callq 0x65ee
movq %rax, %r12
leaq -0x30(%rbp), %rdx
movl (%rdx), %eax
movl %eax, -0x2c(%rbp)
leaq 0x21d1(%rip), %rsi      # 0x827d
movq %r12, %rdi
callq 0x664c
movslq -0x30(%rbp), %r8
leaq -0x70(%rbp), %rdi
movq 0x8(%rdi), %rdx
xorl %esi, %esi
movq %r12, %rcx
callq 0x2360
movq -0x70(%rbp), %rdi
callq 0x2370
movl %eax, %r15d
leaq 0x21a0(%rip), %rsi      # 0x827d
leaq -0x2c(%rbp), %rdx
movq %r12, %rdi
callq 0x65ee
movslq -0x2c(%rbp), %r8
movq 0x8(%r14), %rdx
movq %r14, %rdi
xorl %esi, %esi
movq %rax, %rcx
callq 0x2360
leaq -0x40(%rbp), %r12
movq %r12, -0x10(%r12)
movq (%r14), %rsi
movq 0x8(%r14), %rdx
addq %rsi, %rdx
leaq -0x50(%rbp), %rdi
callq 0x37b2
movq %rbx, %rdi
movl %r15d, %esi
callq 0x49c2
testq %rax, %rax
je 0x6136
leaq -0x50(%rbp), %rsi
movq %rax, %rdi
callq 0x789c
movq -0x50(%rbp), %rdi
cmpq %r12, %rdi
je 0x614b
movq -0x40(%rbp), %rsi
incq %rsi
callq 0x2230
movq -0x70(%rbp), %rdi
cmpq %r13, %rdi
je 0x6160
movq -0x60(%rbp), %rsi
incq %rsi
callq 0x2230
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movq -0x50(%rbp), %rdi
cmpq %r12, %rdi
je 0x618c
movq -0x40(%rbp), %rsi
incq %rsi
callq 0x2230
jmp 0x618c
movq %rax, %rbx
movq -0x70(%rbp), %rdi
cmpq %r13, %rdi
je 0x61a1
movq -0x60(%rbp), %rsi
incq %rsi
callq 0x2230
movq %rbx, %rdi
callq 0x23c0
nop
// File: /workspace/github_cpp_makefile_star2_O1/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 %r12
pushq %rbx
xorl %ebx, %ebx
testl %edx, %edx
jle 0x65e2
movl %edx, %r12d
movq %rsi, %r15
movq %rdi, %r14
movq %rsi, %rdi
callq 0x2120
movl %r12d, %ecx
incq %r14
xorl %edx, %edx
movb -0x1(%r14), %sil
movl %edx, %edi
incl %edx
cmpb (%r15,%rdi), %sil
cmovnel %ebx, %edx
cmpq %rdx, %rax
je 0x65dc
incq %r14
decq %rcx
jne 0x65be
jmp 0x65e2
subq %rdx, %r14
movq %r14, %rbx
movq %rbx, %rax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/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 0x6594
testq %rax, %rax
je 0x663b
movq %rax, %r15
movq %rbx, %rdi
callq 0x2120
movl %r15d, %ecx
subl %r13d, %ecx
addl %ecx, %eax
subl %eax, %r12d
movl %r12d, (%r14)
movq %rbx, %rdi
callq 0x2120
addq %r15, %rax
jmp 0x663d
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_O1/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
movq (%rdi), %rdi
xorl %esi, %esi
movl $0x1a4, %edx            # imm = 0x1A4
xorl %eax, %eax
callq 0x21b0
cmpl $-0x1, %eax
je 0x66fd
movl %eax, %r12d
leaq 0x19e0(%rip), %r14      # 0x8084
leaq 0x1c39(%rip), %r15      # 0x82e4
movl $0x1, %ecx
movq %rbx, %rdi
movq %r14, %rsi
xorl %edx, %edx
callq 0x23b0
cmpl $-0x1, %eax
jne 0x66c6
movq 0x8(%rbx), %rax
movslq %eax, %rsi
movl $0x5, %r8d
movq %rbx, %rdi
xorl %edx, %edx
movq %r15, %rcx
callq 0x2270
movl %r12d, %edi
callq 0x2400
movq (%rbx), %rdi
xorl %esi, %esi
movl $0x1a4, %edx            # imm = 0x1A4
xorl %eax, %eax
callq 0x21b0
movl %eax, %r12d
cmpl $-0x1, %eax
jne 0x66ab
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/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 %rbx
pushq %rax
movq 0x8(%rdi), %r14
testq %r14, %r14
je 0x6778
movq %rdi, %rbx
movq %r14, %rdi
callq 0x74ae
movq %rax, %r15
decl (%rbx)
movq %r14, %rdi
callq 0x74a8
movl $0x10, %esi
movq %r14, %rdi
callq 0x2230
movq %r15, %r14
testq %r15, %r15
jne 0x674e
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rdi
callq 0x64ea
nop
// File: /workspace/github_cpp_makefile_star2_O1/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)
movl $0x10, %edi
callq 0x2220
movq %rax, %r14
movq %rax, %rdi
movq %r15, %rsi
callq 0x7494
cmpl $0x0, (%rbx)
je 0x67fd
movq 0x10(%rbx), %rdi
movq %r14, %rsi
callq 0x74c2
movq %r14, %rdi
xorl %esi, %esi
callq 0x74c2
jmp 0x6801
movq %r14, 0x8(%rbx)
movq %r14, 0x10(%rbx)
incl (%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movl $0x10, %esi
movq %r14, %rdi
callq 0x2230
movq %rbx, %rdi
callq 0x23c0
// File: /workspace/github_cpp_makefile_star2_O1/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)
movl $0x10, %edi
callq 0x2220
movq %rax, %r14
movq %rax, %rdi
movq %r15, %rsi
callq 0x7494
cmpl $0x0, (%rbx)
je 0x686c
leaq 0x8(%rbx), %r15
movq (%r15), %rsi
movq %r14, %rdi
callq 0x74c2
jmp 0x6874
movq %r14, 0x8(%rbx)
leaq 0x10(%rbx), %r15
movq %r14, (%r15)
incl (%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movl $0x10, %esi
movq %r14, %rdi
callq 0x2230
movq %rbx, %rdi
callq 0x23c0
// File: /workspace/github_cpp_makefile_star2_O1/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 0x6952
movq %rdi, %rbx
movq 0x8(%rdi), %r14
cmpl $0x1, %eax
jne 0x6957
leaq 0x8(%rbx), %r12
movq %r14, %rdi
callq 0x74b8
movq %rax, %r15
movq (%r12), %r14
testq %r14, %r14
je 0x6948
movq %r14, %rdi
callq 0x74a8
movl $0x10, %esi
movq %r14, %rdi
callq 0x2230
xorps %xmm0, %xmm0
movups %xmm0, (%r12)
jmp 0x69ac
xorl %r15d, %r15d
jmp 0x69ae
movq %r14, %rdi
callq 0x74ae
movq 0x10(%rbx), %rdi
cmpq %rdi, %rax
je 0x6978
movq %r14, %rdi
callq 0x74ae
movq %rax, %r14
movq %rax, %rdi
jmp 0x695a
callq 0x74b8
movq %rax, %r15
movq 0x10(%rbx), %r12
testq %r12, %r12
je 0x699e
movq %r12, %rdi
callq 0x74a8
movl $0x10, %esi
movq %r12, %rdi
callq 0x2230
movq %r14, 0x10(%rbx)
movq %r14, %rdi
xorl %esi, %esi
callq 0x74c2
decl (%rbx)
movq %r15, %rax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/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 %rbx
pushq %rax
cmpl $0x0, (%rdi)
je 0x6a0c
movq %rsi, %r15
movq %rdi, %rbx
movq 0x8(%rdi), %r14
cmpq %rsi, %r14
je 0x6a10
cmpq %r15, 0x10(%rbx)
je 0x6a6d
movq %r14, %rdi
callq 0x74ae
movq %r14, %rdi
cmpq %r15, %rax
je 0x6a22
callq 0x74ae
testq %rax, %rax
je 0x6a0c
movq %r14, %rdi
callq 0x74ae
movq %rax, %r14
movq %rax, %rdi
jmp 0x69e5
xorl %eax, %eax
jmp 0x6a62
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x689c
callq 0x74ae
movq %rax, %r15
movq %rax, %rdi
callq 0x74ae
movq %r14, %rdi
movq %rax, %rsi
callq 0x74c2
movq %r15, %rdi
callq 0x74b8
movq %rax, %r14
decl (%rbx)
movq %r15, %rdi
callq 0x74a8
movl $0x10, %esi
movq %r15, %rdi
callq 0x2230
movq %r14, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x68fe
nop