LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O2/Unreality3D[P]Unreality3D/indie-studio/include/Network/protocol/IndieProtocol.hpp
// Function: IndieProtocol::operator<<(std::ostream&, IndieProtocol::Serialized const&)
inline std::ostream &operator<< (std::ostream &s, IndieProtocol::Serialized const &data)
{
  auto flags = s.flags();

  s << std::endl << "===== SERIALIZED PACKET =====" << std::endl;
  s << "size : " << data.size << " bytes" << std::endl;

  s << "hex:" << std::endl;
  for (int i = 0; i < data.size; ++i)
    {
      s << std::setw(2) << std::setfill('0') << std::hex << (int)(data.data[i]) << " ";

      if (i%16 == 15)
	s << std::endl;
    }
  s << std::endl << "raw : " << std::endl;

  s.flags(flags);
  for (int i = 0; i < data.size; ++i)
    {
      s << data.data[i];
    }
  s << std::endl << "===== END OF PACKET =====" << std::endl;
  return s;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
movq (%rdi), %rax
movq -0x18(%rax), %rax
movl 0x18(%rdi,%rax), %r12d
callq 0xf4c0
leaq 0x379a(%rip), %rsi      # 0x18416
movq %rax, %rdi
callq 0xfb10
movq %rax, %rdi
callq 0xf4c0
leaq 0x37a1(%rip), %rsi      # 0x18434
movq %rbx, %rdi
callq 0xfb10
movl (%r14), %esi
movq %rax, %rdi
callq 0xf770
leaq 0x378f(%rip), %rsi      # 0x1843c
movq %rax, %rdi
callq 0xfb10
movq %rax, %rdi
callq 0xf4c0
leaq 0x377f(%rip), %rsi      # 0x18443
movq %rbx, %rdi
callq 0xfb10
movq %rax, %rdi
callq 0xf4c0
xorl %r13d, %r13d
pushq $0x30
popq %rbp
leaq 0x3597(%rip), %r15      # 0x18278
movl (%r14), %eax
cmpq %rax, %r13
jae 0x14d4a
movq (%rbx), %rax
movq -0x18(%rax), %rax
movq $0x2, 0x10(%rbx,%rax)
movq %rbx, %rdi
movl %ebp, %esi
callq 0x10070
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
movl 0x18(%rax,%rcx), %edx
andl $-0x4b, %edx
orl $0x8, %edx
movl %edx, 0x18(%rax,%rcx)
movq 0x8(%r14), %rcx
movsbl (%rcx,%r13), %esi
movq %rax, %rdi
callq 0x10280
movq %rax, %rdi
movq %r15, %rsi
callq 0xfb10
movl %r13d, %eax
notl %eax
testb $0xf, %al
jne 0x14d45
movq %rbx, %rdi
callq 0xf4c0
incq %r13
jmp 0x14ce1
movq %rbx, %rdi
callq 0xf4c0
leaq 0x36ef(%rip), %rsi      # 0x18448
movq %rax, %rdi
callq 0xfb10
movq %rax, %rdi
callq 0xf4c0
movq (%rbx), %rax
movq -0x18(%rax), %rax
movl %r12d, 0x18(%rbx,%rax)
xorl %r15d, %r15d
movl (%r14), %eax
cmpq %rax, %r15
jae 0x14d96
movq 0x8(%r14), %rax
movsbl (%rax,%r15), %esi
movq %rbx, %rdi
callq 0xfc40
incq %r15
jmp 0x14d78
movq %rbx, %rdi
callq 0xf4c0
leaq 0x36aa(%rip), %rsi      # 0x1844f
movq %rax, %rdi
callq 0xfb10
movq %rax, %rdi
callq 0xf4c0
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/Unreality3D[P]Unreality3D/indie-studio/include/Network/protocol/IndieProtocol.hpp
// Function: IndieProtocol::Serialized::operator+(IndieProtocol::Serialized const&) const
Serialized operator+ (Serialized const &oth) const
    {
      Serialized result;

      result.size = size + oth.size;
      result.data = new char[result.size];
      memcpy(result.data, data, size);
      memcpy(result.data + size, oth.data, oth.size);
      return result;
    }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %r14
movq %rsi, %r12
movq %rdi, %rbx
pushq $0x1
popq %rdi
callq 0xf030
movq %rax, 0x8(%rbx)
movl (%r12), %r13d
movl (%r14), %r15d
leal (%r15,%r13), %edi
movl %edi, (%rbx)
callq 0xf030
movq %rax, %rbp
movq %rax, 0x8(%rbx)
movq 0x8(%r12), %rsi
movq %rax, %rdi
movq %r13, %rdx
callq 0xf960
addq %r13, %rbp
movq 0x8(%r14), %rsi
movq %rbp, %rdi
movq %r15, %rdx
callq 0xf960
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %r14
movq %rbx, %rdi
callq 0xf7b0
movq %r14, %rdi
callq 0x102f0
// File: /workspace/github_cpp_makefile_star2_O2/Unreality3D[P]Unreality3D/indie-studio/source/Network/protocol/Serializer.cpp
// Function: IndieProtocol::Serializer::operator()(IndieProtocol::Connect const&)
Serialized	Serializer::operator() (Connect const &packet)
  {
    uint32_t	size = sizeof(Header) + getStringSize(packet.name);
    Serialized	buff;

    buff.data = new char[size];
    serializeHeader(buff, Header(PacketType::CONNECT, size));
    serializeString(buff, packet.name);

    return buff;
  }

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdx, %r14
movq %rdi, %rbx
movl 0x8(%rdx), %r15d
addl $0x8, %r15d
andl $0x0, (%rdi)
pushq $0x1
popq %rdi
callq 0xf030
movq %rax, 0x8(%rbx)
movq %r15, %rdi
callq 0xf030
movq %rax, 0x8(%rbx)
movl %r15d, (%rax)
movw $0x1, 0x4(%rax)
movl $0x6, (%rbx)
movq %rbx, %rsi
movq %r14, %rdx
callq 0xfbd0
movq %rbx, %rax
popq %rbx
popq %r14
popq %r15
retq
movq %rax, %r14
movq %rbx, %rdi
callq 0xf7b0
movq %r14, %rdi
callq 0x102f0
// File: /workspace/github_cpp_makefile_star2_O2/Unreality3D[P]Unreality3D/indie-studio/source/Network/protocol/Serializer.cpp
// Function: IndieProtocol::Serializer::operator()(IndieProtocol::List const&)
Serialized	Serializer::operator() (List const &packet)
  {
    uint32_t	size = sizeof(Header) + sizeof(uint16_t);
    uint16_t	listSize = packet.clients.size();
    Serialized	buff;

    for (auto it = packet.clients.begin(); it != packet.clients.end(); ++it)
      size += getStringSize(*it);

    buff.data = new char[size];
    serializeHeader(buff, Header(PacketType::LIST, size));
    buff.append(&listSize, sizeof(listSize));
    for (auto it = packet.clients.begin(); it != packet.clients.end(); ++it)
      serializeString(buff, *it);

    return buff;
  }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %r14
movq %rdi, %rbx
movq (%rdx), %r15
movq 0x8(%rdx), %r12
movq %r12, %r13
subq %r15, %r13
shrq $0x5, %r13
andl $0x0, (%rdi)
pushq $0x1
popq %rdi
callq 0xf030
movq %rax, 0x8(%rbx)
pushq $0x8
popq %rbp
movq %r15, %rax
cmpq %r12, %rax
je 0x152e2
movl 0x8(%rax), %ecx
addl %ecx, %ebp
addl $0x2, %ebp
addq $0x20, %rax
jmp 0x152cf
movl %ebp, %edi
callq 0xf030
movq %rax, 0x8(%rbx)
movl %ebp, (%rax)
movw $0x2, 0x4(%rax)
movw %r13w, 0x6(%rax)
movl $0x8, (%rbx)
cmpq %r12, %r15
je 0x1531a
movq %rbx, %rsi
movq %r15, %rdx
callq 0xfbd0
addq $0x20, %r15
movq 0x8(%r14), %r12
jmp 0x15300
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %r14
movq %rbx, %rdi
callq 0xf7b0
movq %r14, %rdi
callq 0x102f0
nop
// File: /workspace/github_cpp_makefile_star2_O2/Unreality3D[P]Unreality3D/indie-studio/source/Network/protocol/Serializer.cpp
// Function: IndieProtocol::Serializer::operator()(IndieProtocol::Message const&)
Serialized	Serializer::operator() (Message const &packet)
  {
    uint16_t	size =
      sizeof(Header) +
      getStringSize(packet.target) +
      getStringSize(packet.topic) +
      getStringSize(packet.event) +
      sizeof (packet.payloadSize) +
      packet.payloadSize;

    Serialized	buff;
    buff.data = new char[size];

    serializeHeader(buff, Header(PacketType::MESSAGE, size));
    serializeString(buff, packet.target);
    serializeString(buff, packet.topic);
    serializeString(buff, packet.event);
    buff.append(&packet.payloadSize, sizeof(packet.payloadSize));
    buff.append(packet.payload, packet.payloadSize);

    return buff;
  }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %r14
movq %rdi, %rbx
movzwl 0x8(%rdx), %ebp
addw 0x28(%rdx), %bp
addw 0x48(%rdx), %bp
addw 0x60(%rdx), %bp
addl $0x10, %ebp
andl $0x0, (%rdi)
pushq $0x1
popq %rdi
callq 0xf030
movq %rax, 0x8(%rbx)
movzwl %bp, %r15d
movq %r15, %rdi
callq 0xf030
leaq 0x40(%r14), %r12
leaq 0x20(%r14), %r13
movq %rax, 0x8(%rbx)
movl %r15d, (%rax)
movw $0x3, 0x4(%rax)
movl $0x6, (%rbx)
movq %rbx, %rsi
movq %r14, %rdx
callq 0xfbd0
movq %rbx, %rsi
movq %r13, %rdx
callq 0xfbd0
movq %rbx, %rsi
movq %r12, %rdx
callq 0xfbd0
movq 0x8(%rbx), %rax
movl (%rbx), %r15d
movl 0x60(%r14), %ecx
movl %ecx, (%rax,%r15)
leal 0x4(%r15), %edi
movq 0x68(%r14), %rsi
movl 0x60(%r14), %r14d
addq %rax, %rdi
movq %r14, %rdx
callq 0xf960
leal (%r15,%r14), %eax
addl $0x4, %eax
movl %eax, (%rbx)
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %r14
movq %rbx, %rdi
callq 0xf7b0
movq %r14, %rdi
callq 0x102f0
nop
// File: /workspace/github_cpp_makefile_star2_O2/Unreality3D[P]Unreality3D/indie-studio/source/Network/sockets/Client.cpp
// Function: Socket::Client::Client()
Client::Client()
  {
    _stateThread = std::thread();
    _OnDisconnect = NULL;
    _OnReadPossible = NULL;
    _OnWritePossible = NULL;
    _OnStart = NULL;
    _isRunning = false;
    _timeout.tv_sec = 10;
    _timeout.tv_usec = 0;
  }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdi, %rbx
movq 0x9b58(%rip), %rax      # 0x1ef80
addq $0x10, %rax
movq %rax, (%rdi)
leaq 0x18(%rdi), %rax
movq %rax, 0x8(%rdi)
andq $0x0, 0x10(%rdi)
xorl %r15d, %r15d
movb %r15b, 0x18(%rdi)
leaq 0x30(%rdi), %r12
andq $0x0, 0x30(%rdi)
addq $0x48, %rdi
leaq 0x68(%rbx), %r13
leaq 0x88(%rbx), %rbp
leaq 0xa8(%rbx), %rax
movq %rax, (%rsp)
leaq 0xc8(%rbx), %rax
movq %rax, 0x8(%rsp)
movl $0xa0, %edx
xorl %esi, %esi
callq 0xf5c0
leaq 0x10(%rsp), %r14
andq $0x0, (%r14)
movq %r12, %rdi
movq %r14, %rsi
callq 0x101a0
movq %r14, %rdi
callq 0x10040
movq %r13, %rdi
xorl %esi, %esi
callq 0xf940
movq %rbp, %rdi
xorl %esi, %esi
callq 0xf8f0
movq (%rsp), %rdi
xorl %esi, %esi
callq 0xf940
movq 0x8(%rsp), %rdi
xorl %esi, %esi
callq 0xf910
xchgb %r15b, 0x168(%rbx)
movq $0xa, 0x38(%rbx)
andq $0x0, 0x40(%rbx)
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/Unreality3D[P]Unreality3D/indie-studio/source/Network/sockets/Client.cpp
// Function: Socket::Client::stateChecker()
void Client::stateChecker()
  {
    int fd;
    int nb_fd;
    fd_set read_set, write_set;
    timeval timeout;

    // event loop
    while (_isRunning)
      {
	SLEEPMS(0);
	memcpy(&read_set, &_fd_set, sizeof(_fd_set));
	memcpy(&write_set, &_fd_set, sizeof(_fd_set));

	timeout = _timeout;
	// wait for an event
	nb_fd = select(_fd + 1, &read_set, &write_set, NULL, &timeout);
	if (nb_fd < 0 && errno != EINTR)
	  throw SocketIOError(std::string(strerror(getError())));

	if (FD_ISSET(_fd, &read_set))
	  {
	    // read event
	    if (bytesAvailables() == 0)
	      {
		break;
	      }
	    else if (_OnReadPossible)
	      _OnReadPossible(*this, bytesAvailables());
	  }

	// write event
	if (FD_ISSET(_fd, &write_set))
	  {
	    if (_OnWritePossible)
	      _OnWritePossible(*this);
	  }
      }
    disconnect();
  }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x158, %rsp            # imm = 0x158
movq %rdi, %rbx
leaq 0xe8(%rdi), %r14
leaq 0x38(%rdi), %rax
movq %rax, 0x18(%rsp)
leaq 0x88(%rdi), %rax
movq %rax, 0x8(%rsp)
leaq 0xa8(%rdi), %rax
movq %rax, 0x10(%rsp)
pushq $0x10
popq %r13
leaq 0xd8(%rsp), %rbp
leaq 0x58(%rsp), %r15
pushq $0x40
popq %r12
movb 0x168(%rbx), %al
testb $0x1, %al
je 0x15aea
xorl %edi, %edi
callq 0xff20
movq %r13, %rcx
movq %rbp, %rdi
movq %r14, %rsi
rep  movsq (%rsi), %es:(%rdi)
movq %r13, %rcx
movq %r15, %rdi
movq %r14, %rsi
rep  movsq (%rsi), %es:(%rdi)
movq 0x18(%rsp), %rax
movups (%rax), %xmm0
movaps %xmm0, 0x20(%rsp)
movl 0x2c(%rbx), %edi
incl %edi
movq %rbp, %rsi
movq %r15, %rdx
xorl %ecx, %ecx
leaq 0x20(%rsp), %r8
callq 0xfa80
testl %eax, %eax
jns 0x15a6c
callq 0xf070
cmpl $0x4, (%rax)
jne 0x15b04
movl 0x2c(%rbx), %eax
cltd
idivl %r12d
cltq
movq 0xd8(%rsp,%rax,8), %rax
btq %rdx, %rax
jae 0x15ab2
movq %rbx, %rdi
callq 0xf430
testq %rax, %rax
je 0x15aea
cmpq $0x0, 0x98(%rbx)
je 0x15ab2
movq %rbx, %rdi
callq 0xf430
movq 0x8(%rsp), %rdi
movq %rbx, %rsi
movq %rax, %rdx
callq 0xfd70
movl 0x2c(%rbx), %eax
cltd
idivl %r12d
cltq
movq 0x58(%rsp,%rax,8), %rax
btq %rdx, %rax
jae 0x15a09
cmpq $0x0, 0xb8(%rbx)
je 0x15a09
movq 0x10(%rsp), %rdi
movq %rbx, %rsi
callq 0x103e0
jmp 0x15a09
movq %rbx, %rdi
callq 0x100d0
addq $0x158, %rsp            # imm = 0x158
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
pushq $0x48
popq %rdi
callq 0xf4d0
movq %rax, %rbx
callq 0x159ad
movl %eax, %edi
callq 0xf330
leaq 0x38(%rsp), %rdi
leaq 0x7(%rsp), %rdx
movq %rax, %rsi
callq 0xf3f0
movb $0x1, %bpl
leaq 0x38(%rsp), %rsi
movq %rbx, %rdi
callq 0x10010
xorl %ebp, %ebp
movq 0x9452(%rip), %rsi      # 0x1ef98
movq 0x9443(%rip), %rdx      # 0x1ef90
movq %rbx, %rdi
callq 0x10260
movq %rax, %r14
leaq 0x38(%rsp), %rdi
callq 0xf450
testb %bpl, %bpl
jne 0x15b6c
jmp 0x15b74
movq %rax, %r14
movq %rbx, %rdi
callq 0xf820
movq %r14, %rdi
callq 0x102f0
// File: /workspace/github_cpp_makefile_star2_O2/Unreality3D[P]Unreality3D/indie-studio/source/Network/sockets/Client.cpp
// Function: Socket::Client::read(void*, unsigned long)
int  Client::read(void *buffer, size_t size)
  {
    int tmp;

    if ((tmp = ::recv(_fd, (char *)buffer, size, 0)) == -1)
      {
	throw SocketIOError(std::string(strerror(getError())));
      }
    if (size != 0 && tmp == 0)
      disconnect();
    return tmp;
  }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x28, %rsp
movq %rdx, %r15
movq %rdi, %rbx
movl 0x2c(%rdi), %edi
xorl %ecx, %ecx
callq 0xf310
movq %rax, %r14
cmpl $-0x1, %r14d
je 0x15c5d
testq %r15, %r15
sete %al
testl %r14d, %r14d
setne %cl
orb %al, %cl
jne 0x15c4f
movq %rbx, %rdi
callq 0x100d0
movl %r14d, %eax
addq $0x28, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
pushq $0x48
popq %rdi
callq 0xf4d0
movq %rax, %rbx
callq 0x159ad
movl %eax, %edi
callq 0xf330
leaq 0x8(%rsp), %rdi
leaq 0x7(%rsp), %rdx
movq %rax, %rsi
callq 0xf3f0
movb $0x1, %bpl
leaq 0x8(%rsp), %rsi
movq %rbx, %rdi
callq 0x10010
xorl %ebp, %ebp
movq 0x92f9(%rip), %rsi      # 0x1ef98
movq 0x92ea(%rip), %rdx      # 0x1ef90
movq %rbx, %rdi
callq 0x10260
movq %rax, %r14
leaq 0x8(%rsp), %rdi
callq 0xf450
testb %bpl, %bpl
jne 0x15cc5
jmp 0x15ccd
movq %rax, %r14
movq %rbx, %rdi
callq 0xf820
movq %r14, %rdi
callq 0x102f0
nop
// File: /workspace/github_cpp_makefile_star2_O2/Unreality3D[P]Unreality3D/indie-studio/source/Network/sockets/Client.cpp
// Function: Socket::Client::write(void const*, unsigned long)
int  Client::write(void const *buffer, size_t size)
  {
    int tmp;

    if ((tmp = ::send(_fd, (char *)buffer, size, 0)) == -1)
      {
	if (errno == ECONNRESET)
	  disconnect();
	else
	  throw SocketIOError(std::string(strerror(getError())));
      }
    return tmp;
  }

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
subq $0x30, %rsp
movq %rdi, %rbx
movl 0x2c(%rdi), %edi
xorl %ecx, %ecx
callq 0xf4f0
movq %rax, %r14
cmpl $-0x1, %r14d
jne 0x15d28
callq 0xf070
cmpl $0x68, (%rax)
jne 0x15d34
movq %rbx, %rdi
callq 0x100d0
movl %r14d, %eax
addq $0x30, %rsp
popq %rbx
popq %r14
popq %rbp
retq
pushq $0x48
popq %rdi
callq 0xf4d0
movq %rax, %rbx
callq 0x159ad
movl %eax, %edi
callq 0xf330
leaq 0x10(%rsp), %rdi
leaq 0xf(%rsp), %rdx
movq %rax, %rsi
callq 0xf3f0
movb $0x1, %bpl
leaq 0x10(%rsp), %rsi
movq %rbx, %rdi
callq 0x10010
xorl %ebp, %ebp
movq 0x9222(%rip), %rsi      # 0x1ef98
movq 0x9213(%rip), %rdx      # 0x1ef90
movq %rbx, %rdi
callq 0x10260
movq %rax, %r14
leaq 0x10(%rsp), %rdi
callq 0xf450
testb %bpl, %bpl
jne 0x15d9c
jmp 0x15da4
movq %rax, %r14
movq %rbx, %rdi
callq 0xf820
movq %r14, %rdi
callq 0x102f0
// File: /workspace/github_cpp_makefile_star2_O2/Unreality3D[P]Unreality3D/indie-studio/source/Network/sockets/Client.cpp
// Function: Socket::Client::bytesAvailables() const
size_t Client::bytesAvailables() const
  {
#ifdef _WIN32
    u_long bytes = 0;
#else
    size_t bytes = 0;
#endif

    if (::ioctl(_fd, FIONREAD, &bytes) == -1)
      {
	throw SocketIOError(std::string(strerror(getError())));
      }
    return bytes;
  }

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
subq $0x30, %rsp
leaq 0x8(%rsp), %rdx
andq $0x0, (%rdx)
movl 0x2c(%rdi), %edi
movl $0x541b, %esi           # imm = 0x541B
xorl %eax, %eax
callq 0xfef0
cmpl $-0x1, %eax
je 0x15ddf
movq 0x8(%rsp), %rax
addq $0x30, %rsp
popq %rbx
popq %r14
popq %rbp
retq
pushq $0x48
popq %rdi
callq 0xf4d0
movq %rax, %rbx
callq 0x159ad
movl %eax, %edi
callq 0xf330
leaq 0x10(%rsp), %rdi
leaq 0x7(%rsp), %rdx
movq %rax, %rsi
callq 0xf3f0
movb $0x1, %bpl
leaq 0x10(%rsp), %rsi
movq %rbx, %rdi
callq 0x10010
xorl %ebp, %ebp
movq 0x9177(%rip), %rsi      # 0x1ef98
movq 0x9168(%rip), %rdx      # 0x1ef90
movq %rbx, %rdi
callq 0x10260
movq %rax, %r14
leaq 0x10(%rsp), %rdi
callq 0xf450
testb %bpl, %bpl
jne 0x15e47
jmp 0x15e4f
movq %rax, %r14
movq %rbx, %rdi
callq 0xf820
movq %r14, %rdi
callq 0x102f0
nop
// File: /workspace/github_cpp_makefile_star2_O2/Unreality3D[P]Unreality3D/indie-studio/source/Network/sockets/Server.cpp
// Function: Socket::Server::Server()
Server::Server()
		{
			_stateThread = std::thread();
			_OnConnect = NULL;
			_OnDisconnect = NULL;
			_OnReadPossible = NULL;
			_OnWritePossible = NULL;
			_OnStart = NULL;
			_isRunning = false;
			_timeout.tv_sec = 10;
			_timeout.tv_usec = 0;
		}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rdi, %rbx
movq 0x89e4(%rip), %rax      # 0x1efb0
addq $0x10, %rax
movq %rax, (%rdi)
leaq 0x38(%rdi), %rbp
leaq 0x50(%rdi), %r14
leaq 0x70(%rdi), %r13
leaq 0x90(%rdi), %rax
movq %rax, 0x8(%rsp)
leaq 0xb0(%rdi), %rax
movq %rax, 0x10(%rsp)
leaq 0xd0(%rdi), %rax
movq %rax, 0x18(%rsp)
xorps %xmm0, %xmm0
movups %xmm0, 0x20(%rdi)
movups %xmm0, 0x30(%rdi)
xorl %r12d, %r12d
movl $0xa0, %edx
movq %r14, %rdi
xorl %esi, %esi
callq 0xf5c0
leaq 0x20(%rsp), %r15
andq $0x0, (%r15)
movq %rbp, %rdi
movq %r15, %rsi
callq 0x101a0
movq %r15, %rdi
callq 0x10040
movq %r14, %rdi
xorl %esi, %esi
callq 0xf5f0
movq %r13, %rdi
xorl %esi, %esi
callq 0xf5f0
movq 0x8(%rsp), %rdi
xorl %esi, %esi
callq 0x10140
movq 0x10(%rsp), %rdi
xorl %esi, %esi
callq 0xf5f0
movq 0x18(%rsp), %rdi
xorl %esi, %esi
callq 0xf5f0
xchgb %r12b, 0x174(%rbx)
movq $0xa, 0x40(%rbx)
andq $0x0, 0x48(%rbx)
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/Unreality3D[P]Unreality3D/indie-studio/source/Network/sockets/Server.cpp
// Function: Socket::Server::disconnect(int)
void  Server::disconnect(int fd)
	{
		auto found = std::find(_clients.begin(), _clients.end(), fd);

		if (found != std::end(_clients))
		{
			_clients.erase(found);
			closesocket(fd);
			FD_CLR(fd, &_fd_set);

			auto max = (std::max_element(_clients.begin(), _clients.end()));
			if (max != _clients.end())
				_max_fd = *max;
			else
				_max_fd = _fd;

			if (_OnDisconnect)
				_OnDisconnect(*this, fd);
		}
	}

// Assembly:
pushq %rbx
subq $0x10, %rsp
movq %rdi, %rbx
leaq 0xc(%rsp), %rdx
movl %esi, (%rdx)
movq 0x20(%rdi), %rdi
movq 0x28(%rbx), %rsi
callq 0xf540
cmpq 0x28(%rbx), %rax
je 0x1707a
leaq 0x20(%rbx), %rdi
movq %rax, %rsi
callq 0xfa30
movl 0xc(%rsp), %edi
callq 0x104b0
movl 0xc(%rsp), %eax
pushq $-0x2
popq %rsi
movl %eax, %ecx
rolq %cl, %rsi
pushq $0x40
popq %rcx
cltd
idivl %ecx
cltq
andq %rsi, 0xf0(%rbx,%rax,8)
movq 0x20(%rbx), %rdi
movq 0x28(%rbx), %rsi
callq 0xf700
leaq 0x18(%rbx), %rcx
cmpq 0x28(%rbx), %rax
cmovneq %rax, %rcx
movl (%rcx), %eax
movl %eax, 0x170(%rbx)
cmpq $0x0, 0x80(%rbx)
je 0x1707a
leaq 0x70(%rbx), %rdi
movl 0xc(%rsp), %edx
movq %rbx, %rsi
callq 0xfbc0
addq $0x10, %rsp
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O2/Unreality3D[P]Unreality3D/indie-studio/source/Network/sockets/Server.cpp
// Function: Socket::Server::read(int, void*, unsigned long)
int  Server::read(int fd, void *buffer, size_t size)
	{
		int tmp;

		if ((tmp = ::recv(fd, (char *)buffer, size, 0)) == -1)
		{
			throw SocketIOError(std::string(strerror(getError())));
		}
		if (size != 0 && tmp == 0)
			disconnect(fd);
		return tmp;
	}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x30, %rsp
movq %rcx, %r12
movl %esi, %ebx
movq %rdi, %r14
movl %esi, %edi
movq %rdx, %rsi
movq %rcx, %rdx
xorl %ecx, %ecx
callq 0xf310
movq %rax, %r15
cmpl $-0x1, %r15d
je 0x170d6
testq %r12, %r12
sete %al
testl %r15d, %r15d
setne %cl
orb %al, %cl
jne 0x170c6
movq %r14, %rdi
movl %ebx, %esi
callq 0xfe60
movl %r15d, %eax
addq $0x30, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
pushq $0x48
popq %rdi
callq 0xf4d0
movq %rax, %rbx
callq 0x16b21
movl %eax, %edi
callq 0xf330
leaq 0x10(%rsp), %rdi
leaq 0xf(%rsp), %rdx
movq %rax, %rsi
callq 0xf3f0
movb $0x1, %bpl
leaq 0x10(%rsp), %rsi
movq %rbx, %rdi
callq 0x10010
xorl %ebp, %ebp
movq 0x7e80(%rip), %rsi      # 0x1ef98
movq 0x7e71(%rip), %rdx      # 0x1ef90
movq %rbx, %rdi
callq 0x10260
movq %rax, %r14
leaq 0x10(%rsp), %rdi
callq 0xf450
testb %bpl, %bpl
jne 0x1713e
jmp 0x17146
movq %rax, %r14
movq %rbx, %rdi
callq 0xf820
movq %r14, %rdi
callq 0x102f0
// File: /workspace/github_cpp_makefile_star2_O2/Unreality3D[P]Unreality3D/indie-studio/source/Network/sockets/Server.cpp
// Function: Socket::Server::write(int, void const*, unsigned long)
int  Server::write(int fd, void const *buffer, size_t size)
	{
		int tmp;

		if ((tmp = ::send(fd, (char *)buffer, size, 0)) == -1)
		{
			if (errno == ECONNRESET)
				disconnect(fd);
			else
				throw SocketIOError(std::string(strerror(getError())));
		}
		return tmp;
	}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x28, %rsp
movl %esi, %ebx
movq %rdi, %r14
movl %esi, %edi
movq %rdx, %rsi
movq %rcx, %rdx
xorl %ecx, %ecx
callq 0xf4f0
movq %rax, %r15
cmpl $-0x1, %r15d
jne 0x17189
callq 0xf070
cmpl $0x68, (%rax)
jne 0x17197
movq %r14, %rdi
movl %ebx, %esi
callq 0xfe60
movl %r15d, %eax
addq $0x28, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
pushq $0x48
popq %rdi
callq 0xf4d0
movq %rax, %rbx
callq 0x16b21
movl %eax, %edi
callq 0xf330
leaq 0x8(%rsp), %rdi
leaq 0x7(%rsp), %rdx
movq %rax, %rsi
callq 0xf3f0
movb $0x1, %bpl
leaq 0x8(%rsp), %rsi
movq %rbx, %rdi
callq 0x10010
xorl %ebp, %ebp
movq 0x7dbf(%rip), %rsi      # 0x1ef98
movq 0x7db0(%rip), %rdx      # 0x1ef90
movq %rbx, %rdi
callq 0x10260
movq %rax, %r14
leaq 0x8(%rsp), %rdi
callq 0xf450
testb %bpl, %bpl
jne 0x171ff
jmp 0x17207
movq %rax, %r14
movq %rbx, %rdi
callq 0xf820
movq %r14, %rdi
callq 0x102f0
nop
// File: /workspace/github_cpp_makefile_star2_O2/Unreality3D[P]Unreality3D/indie-studio/source/Network/sockets/Server.cpp
// Function: Socket::Server::bytesAvailables(int) const
size_t Server::bytesAvailables(int fd) const
	{
#ifdef _WIN32
	    u_long bytes = 0;
#else
	    size_t bytes = 0;
#endif

	    if (::ioctl(fd, FIONREAD, &bytes) == -1)
	    {
	    	throw SocketIOError(std::string(strerror(getError())));
	    }
	    return bytes;
	}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
subq $0x30, %rsp
movl %esi, %edi
leaq 0x8(%rsp), %rdx
andq $0x0, (%rdx)
movl $0x541b, %esi           # imm = 0x541B
xorl %eax, %eax
callq 0xfef0
cmpl $-0x1, %eax
je 0x17242
movq 0x8(%rsp), %rax
addq $0x30, %rsp
popq %rbx
popq %r14
popq %rbp
retq
pushq $0x48
popq %rdi
callq 0xf4d0
movq %rax, %rbx
callq 0x16b21
movl %eax, %edi
callq 0xf330
leaq 0x10(%rsp), %rdi
leaq 0x7(%rsp), %rdx
movq %rax, %rsi
callq 0xf3f0
movb $0x1, %bpl
leaq 0x10(%rsp), %rsi
movq %rbx, %rdi
callq 0x10010
xorl %ebp, %ebp
movq 0x7d14(%rip), %rsi      # 0x1ef98
movq 0x7d05(%rip), %rdx      # 0x1ef90
movq %rbx, %rdi
callq 0x10260
movq %rax, %r14
leaq 0x10(%rsp), %rdi
callq 0xf450
testb %bpl, %bpl
jne 0x172aa
jmp 0x172b2
movq %rax, %r14
movq %rbx, %rdi
callq 0xf820
movq %r14, %rdi
callq 0x102f0
// File: /workspace/github_cpp_makefile_star2_O2/andersonfernandes[P]sm-chat/src/shm_queue.cpp
// Function: create_queue()
ShmQueue* create_queue() {
  ShmQueue* shmq = new ShmQueue();
  shmq->capacity = MAX_MESSAGES;  
  shmq->front = shmq->size = 0;  
  shmq->rear = MAX_MESSAGES - 1;
  shmq->locked = false;
  shmq->messages_list_shmid = shmget(generate_key(), MAX_MESSAGES * sizeof(Message), 0666|IPC_CREAT);

  return shmq;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
pushq $0x18
popq %rdi
callq 0x10e0
movq %rax, %rbx
andq $0x0, 0x10(%rax)
movaps 0xcc7(%rip), %xmm0      # 0x2010
movups %xmm0, (%rax)
callq 0x136f
movl $0x284880, %esi         # imm = 0x284880
movl %eax, %edi
movl $0x3b6, %edx            # imm = 0x3B6
callq 0x1060
movl %eax, 0x10(%rbx)
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/andersonfernandes[P]sm-chat/src/shm_queue.cpp
// Function: enqueue(ShmQueue*, Message*)
void enqueue(ShmQueue* shmq, Message* message) {
  if(full(shmq)) return;
  shmq->locked = true;

  shmq->rear = (shmq->rear + 1) % shmq->capacity;
  shmq->size = shmq->size + 1;

  Message* messages = (Message*) shmat(shmq->messages_list_shmid, NULL, 0);
  memcpy(&messages[shmq->rear], message, sizeof(Message));
  shmdt(messages);
  shmq->locked = false;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %r14
movl (%rdi), %esi
movl 0x4(%rdi), %ecx
cmpl %esi, %ecx
je 0x1405
movq %rdi, %rbx
movb $0x1, 0x14(%rdi)
movl 0xc(%rdi), %eax
movl 0x10(%rdi), %edi
incl %eax
cltd
idivl %esi
movl %edx, 0xc(%rbx)
incl %ecx
movl %ecx, 0x4(%rbx)
xorl %esi, %esi
xorl %edx, %edx
callq 0x1110
movq %rax, %r15
movslq 0xc(%rbx), %rax
imulq $0x108, %rax, %rdi      # imm = 0x108
addq %r15, %rdi
movl $0x108, %edx            # imm = 0x108
movq %r14, %rsi
callq 0x1070
movq %r15, %rdi
callq 0x1130
movb $0x0, 0x14(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/andersonfernandes[P]sm-chat/src/server.cpp
// Function: main
int main() {
  init();

  while (1) {
    process_new_users();

    if(kill_server_flag) {
      cout << "\nCleaning shared memory segments" << endl;

      User *users = att_users(users_shmid);
      int *users_count = att_users_count(users_count_shmid);
      for (int i = 0; i < (*users_count); i++) {

        ShmQueue* shmq = (ShmQueue*) shmat(users[i].shmq_id, NULL, 0);
        shmctl(shmq->messages_list_shmid, IPC_RMID, NULL);
        shmdt(shmq);

        shmctl(users[i].shmq_id, IPC_RMID, NULL);
      }

      shmdt(users_count);
      shmdt(users);

      shmctl(users_shmid, IPC_RMID, NULL);
      shmctl(users_count_shmid, IPC_RMID, NULL);

      cout << "\nBye!" << endl;
      exit(0);
    }
  }

  return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
callq 0x159c
callq 0x161c
cmpb $0x1, 0x2bf6(%rip)      # 0x40c1
jne 0x14bf
movq 0x2b04(%rip), %rdi      # 0x3fd8
leaq 0xb45(%rip), %rsi       # 0x2020
callq 0x10d0
movq %rax, %rdi
callq 0x1050
movl 0x2bd6(%rip), %edi      # 0x40c4
callq 0x1490
movq %rax, %rbx
movl 0x2bcc(%rip), %edi      # 0x40c8
callq 0x149e
movq %rax, %r14
xorl %r12d, %r12d
movq %rbx, %r13
movslq (%r14), %rax
cmpq %rax, %r12
jge 0x154c
movl (%r13), %edi
xorl %esi, %esi
xorl %edx, %edx
callq 0x1110
movq %rax, %r15
movl 0x10(%rax), %edi
xorl %esi, %esi
xorl %edx, %edx
callq 0x1080
movq %r15, %rdi
callq 0x1130
movl (%r13), %edi
xorl %esi, %esi
xorl %edx, %edx
callq 0x1080
incq %r12
addq $0x38, %r13
jmp 0x150a
movq %r14, %rdi
callq 0x1130
movq %rbx, %rdi
callq 0x1130
movl 0x2b62(%rip), %edi      # 0x40c4
xorl %esi, %esi
xorl %edx, %edx
callq 0x1080
movl 0x2b57(%rip), %edi      # 0x40c8
xorl %esi, %esi
xorl %edx, %edx
callq 0x1080
movq 0x2a57(%rip), %rdi      # 0x3fd8
leaq 0xab9(%rip), %rsi       # 0x2041
callq 0x10d0
movq %rax, %rdi
callq 0x1050
xorl %edi, %edi
callq 0x1100
// File: /workspace/github_cpp_makefile_star2_O2/andersonfernandes[P]sm-chat/src/server.cpp
// Function: init()
void init() {
  srand(time(NULL));

  system("clear");
  cout << "\n> Starting the server \n" <<  endl;

  int *users_count = att_users_count(users_count_shmid);
  *users_count = 0;
  shmdt(users_count);

  cout << "Use Ctrl-C to stop\n" << endl;
  signal(SIGINT, sigint_handler);

}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
xorl %edi, %edi
callq 0x10b0
movl %eax, %edi
callq 0x10c0
leaq 0xa90(%rip), %rdi       # 0x2047
callq 0x1090
movq 0x2a15(%rip), %rbx      # 0x3fd8
leaq 0xa83(%rip), %rsi       # 0x204d
movq %rbx, %rdi
callq 0x10d0
movq %rax, %rdi
callq 0x1050
movl 0x2ae8(%rip), %edi      # 0x40c8
callq 0x149e
andl $0x0, (%rax)
movq %rax, %rdi
callq 0x1130
leaq 0xa6f(%rip), %rsi       # 0x2066
movq %rbx, %rdi
callq 0x10d0
movq %rax, %rdi
callq 0x1050
leaq 0x10f(%rip), %rsi       # 0x171d
pushq $0x2
popq %rdi
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x10f0
// File: /workspace/github_cpp_makefile_star2_O2/andersonfernandes[P]sm-chat/src/server.cpp
// Function: process_new_users()
void process_new_users() {
  User *users = att_users(users_shmid);
  int *users_count = att_users_count(users_count_shmid);

  if(old_count != *users_count) {
    for (int i = old_count; i < *users_count; i++) {
      User user = users[i];

      time_t now = time(0);
      cout << ctime(&now) << " > ";
      cout << user.name << " logged on the server\n" <<  endl;  
    }

    old_count = (*users_count);
  }

  shmdt(users_count);
  shmdt(users);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movl 0x2a91(%rip), %edi      # 0x40c4
callq 0x1490
movq %rax, %rbx
movl 0x2a87(%rip), %edi      # 0x40c8
callq 0x149e
movq %rax, %r14
movslq 0x2a7c(%rip), %r12      # 0x40cc
movl (%rax), %eax
cmpl %eax, %r12d
je 0x16fe
imulq $0x38, %r12, %rcx
movq %rbx, -0x30(%rbp)
addq %rcx, %rbx
movq 0x296b(%rip), %r13      # 0x3fd8
leaq 0xa0a(%rip), %r15       # 0x207e
movslq %eax, %rcx
cmpq %rcx, %r12
jge 0x16f4
movq 0x30(%rbx), %rax
movq %rax, -0x40(%rbp)
movups (%rbx), %xmm0
movups 0x10(%rbx), %xmm1
movups 0x20(%rbx), %xmm2
movaps %xmm2, -0x50(%rbp)
movaps %xmm1, -0x60(%rbp)
movaps %xmm0, -0x70(%rbp)
xorl %edi, %edi
callq 0x10b0
movq %rax, -0x38(%rbp)
leaq -0x38(%rbp), %rdi
callq 0x1040
movq %r13, %rdi
movq %rax, %rsi
callq 0x10d0
movq %rax, %rdi
leaq 0x9b6(%rip), %rsi       # 0x207a
callq 0x10d0
movq %r13, %rdi
leaq -0x6c(%rbp), %rsi
callq 0x10d0
movq %rax, %rdi
movq %r15, %rsi
callq 0x10d0
movq %rax, %rdi
callq 0x1050
incq %r12
movl (%r14), %eax
addq $0x38, %rbx
jmp 0x1674
movl %eax, 0x29d2(%rip)      # 0x40cc
movq -0x30(%rbp), %rbx
movq %r14, %rdi
callq 0x1130
movq %rbx, %rdi
callq 0x1130
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/roberto-bayardo[P]google-extremal-sets/all-maximal-sets-satelite.cc
// Function: google_extremal_sets::AllMaximalSetsSateLite::PrepareForDataScan(google_extremal_sets::DataSourceIterator*, unsigned int, long)
bool AllMaximalSetsSateLite::PrepareForDataScan(
    DataSourceIterator* data, uint32_t max_item_id, off_t resume_offset) {
  occurs_.clear();
  occurs_.resize(max_item_id);
  std::cerr << "; Starting new dataset scan at offset: "
            << resume_offset << std::endl;
  return data->Seek(resume_offset);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rcx, %rbx
movl %edx, %ebp
movq %rsi, %r14
movq %rdi, %r15
addq $0x30, %r15
movq %r15, %rdi
callq 0x28be
movl %ebp, %esi
movq %r15, %rdi
callq 0x28c6
movq 0x4959(%rip), %rdi      # 0x6ff0
leaq 0x19b0(%rip), %rsi      # 0x404e
callq 0x21a0
movq %rax, %rdi
movq %rbx, %rsi
callq 0x2190
movq %rax, %rdi
callq 0x20d0
movq %r14, %rdi
movq %rbx, %rsi
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x30ca
nop
// File: /workspace/github_cpp_makefile_star2_O2/roberto-bayardo[P]google-extremal-sets/all-maximal-sets-satelite.cc
// Function: google_extremal_sets::AllMaximalSetsSateLite::IsSubsumed(google_extremal_sets::SetProperties const&)
inline bool IsSubsumedBy(const SetProperties& set1, const SetProperties& set2) {
  if (set1.size >= set2.size)
    return false;
  const uint32_t* it1 = set1.begin();
  const uint32_t* it2 = set2.begin();
  const uint32_t* it1_end = set1.end();
  const uint32_t* it2_end = set2.end();

  while (it1 != it1_end) {
    it2 = std::lower_bound(it2, it2_end, *it1);
    if (it2 == it2_end || *it2 > *it1)
      return false;
    ++it1;
    ++it2;
  }
  return true;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
leaq 0x8(%rsi), %rax
movq %rax, (%rsp)
movq %rsi, 0x10(%rsp)
movl 0x8(%rsi), %eax
imulq $0x18, %rax, %rbp
movq %rdi, 0x8(%rsp)
addq 0x30(%rdi), %rbp
xorl %r13d, %r13d
movl %r13d, %r13d
movq (%rbp), %rax
movq 0x8(%rbp), %r14
subq %rax, %r14
sarq $0x3, %r14
cmpq %r13, %r14
jbe 0x2774
movq (%rax,%r13,8), %rax
movq 0x8(%rsp), %rcx
incq 0x10(%rcx)
movq 0x10(%rsp), %rcx
movl 0x4(%rcx), %ebx
movl 0x4(%rax), %ecx
cmpl %ecx, %ebx
jae 0x276f
leaq (%rax,%rcx,4), %r15
addq $0x8, %r15
addq $0x8, %rax
shlq $0x2, %rbx
movq (%rsp), %r12
testq %rbx, %rbx
je 0x2774
movq %rax, %rdi
movq %r15, %rsi
movq %r12, %rdx
callq 0x2906
cmpq %r15, %rax
je 0x276f
movl (%rax), %ecx
cmpl (%r12), %ecx
ja 0x276f
addq $0x4, %r12
addq $0x4, %rax
addq $-0x4, %rbx
jmp 0x2741
incl %r13d
jmp 0x26fa
cmpq %r13, %r14
seta %al
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/roberto-bayardo[P]google-extremal-sets/all-maximal-sets-satelite.cc
// Function: google_extremal_sets::AllMaximalSetsSateLite::FoundMaximalSet(google_extremal_sets::SetProperties const&, google_extremal_sets::OutputModeEnum)
void AllMaximalSetsSateLite::FoundMaximalSet(
    const SetProperties& maximal_set, OutputModeEnum output_mode) {
  ++maximal_sets_count_;
  switch (output_mode) {
    case COUNT_ONLY:
      break;
    case ID:
      std::cout << maximal_set.set_id << '\n';
      break;
    case ID_AND_ITEMS:
      std::cout << maximal_set.set_id << ":";
      for (unsigned int i = 0; i < maximal_set.size; ++i) {
        std::cout << ' ' << maximal_set.item[i];
      }
      std::cout << '\n';
      break;
    default:
      std::cout << "Huh?\n";
      assert(0);
      break;
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
incq (%rdi)
testl %edx, %edx
je 0x2815
movq %rsi, %rbx
cmpl $0x2, %edx
je 0x27cb
cmpl $0x1, %edx
jne 0x2820
movl (%rbx), %esi
movq 0x4822(%rip), %rdi      # 0x6fd0
callq 0x2110
movq %rax, %r14
pushq $0xa
popq %rsi
movq %r14, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x21e0
movl (%rbx), %esi
movq 0x47fc(%rip), %r14      # 0x6fd0
movq %r14, %rdi
callq 0x2110
leaq 0x1893(%rip), %rsi      # 0x4076
movq %rax, %rdi
callq 0x21a0
xorl %r15d, %r15d
pushq $0x20
popq %rbp
movl 0x4(%rbx), %eax
cmpq %rax, %r15
jae 0x27b6
movq %r14, %rdi
movl %ebp, %esi
callq 0x21e0
movl 0x8(%rbx,%r15,4), %esi
movq %rax, %rdi
callq 0x2110
incq %r15
jmp 0x27f1
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movq 0x47a9(%rip), %rdi      # 0x6fd0
leaq 0x184a(%rip), %rsi      # 0x4078
callq 0x21a0
leaq 0x1844(%rip), %rdi      # 0x407e
leaq 0x183f(%rip), %rsi      # 0x4080
leaq 0x1855(%rip), %rcx      # 0x409d
movl $0x99, %edx
callq 0x2100
// File: /workspace/github_cpp_makefile_star2_O2/millanek[P]Dsuite/Dsuite_utils.cpp
// Function: Fd_Denom_perVariant(double, double, double, double)
double Fd_Denom_perVariant(double p1, double p2, double p3, double pO) {
    double Fd_Denom = 0;
    if (p2 > p3) Fd_Denom = ((1-p1)*p2*p2*(1-pO)) - (p1*(1-p2)*p2*(1-pO));
    else Fd_Denom = ((1-p1)*p3*p3*(1-pO)) - (p1*(1-p3)*p3*(1-pO));
    return Fd_Denom;
}

// Assembly:
movapd %xmm0, %xmm4
ucomisd %xmm2, %xmm1
movsd 0x2e257(%rip), %xmm5    # 0x36470
movapd %xmm5, %xmm0
subsd %xmm4, %xmm0
movapd %xmm5, %xmm6
subsd %xmm3, %xmm6
jbe 0x8241
mulsd %xmm1, %xmm0
mulsd %xmm1, %xmm0
subsd %xmm1, %xmm5
mulsd %xmm4, %xmm5
mulsd %xmm1, %xmm5
jmp 0x8255
mulsd %xmm2, %xmm0
mulsd %xmm2, %xmm0
subsd %xmm2, %xmm5
mulsd %xmm4, %xmm5
mulsd %xmm2, %xmm5
mulsd %xmm6, %xmm5
mulsd %xmm6, %xmm0
subsd %xmm5, %xmm0
retq
// File: /workspace/github_cpp_makefile_star2_O2/millanek[P]Dsuite/Dsuite_utils.cpp
// Function: FdM_Denom_perVariant(double, double, double, double)
double FdM_Denom_perVariant(double p1, double p2, double p3, double pO) {
    double FdM_Denom = 0;
    if (p1 <= p2) {
        if (p2 > p3) FdM_Denom = ((1-p1) * p2 * p2 * (1-pO)) - (p1 * (1-p2) * p2 * (1-pO));
        else FdM_Denom = ((1-p1) * p3 * p3 * (1-pO)) - (p1 * (1-p3) * p3 * (1-pO));
    } else {
        if (p1 > p3) FdM_Denom = -(((1-p1)*p2*p1*(1-pO)) - (p1*(1-p2)*p1*(1-pO)));
        else FdM_Denom = -(((1-p3)*p2*p3*(1-pO)) - (p3*(1-p2)*p3*(1-pO)));
    }
    return FdM_Denom;
}

// Assembly:
movapd %xmm0, %xmm4
ucomisd %xmm0, %xmm1
jae 0x82f6
ucomisd %xmm2, %xmm4
movsd 0x2e1aa(%rip), %xmm0    # 0x36470
movapd %xmm0, %xmm5
subsd %xmm3, %xmm5
movapd %xmm0, %xmm3
subsd %xmm1, %xmm3
xorpd 0x2e1d2(%rip), %xmm3    # 0x364b0
jbe 0x832a
subsd %xmm4, %xmm0
mulsd %xmm1, %xmm0
mulsd %xmm4, %xmm0
mulsd %xmm4, %xmm3
mulsd %xmm4, %xmm3
jmp 0x833e
ucomisd %xmm2, %xmm1
movsd 0x2e16e(%rip), %xmm5    # 0x36470
movapd %xmm5, %xmm0
subsd %xmm4, %xmm0
movapd %xmm5, %xmm6
subsd %xmm3, %xmm6
jbe 0x8353
mulsd %xmm1, %xmm0
mulsd %xmm1, %xmm0
subsd %xmm1, %xmm5
mulsd %xmm4, %xmm5
mulsd %xmm1, %xmm5
jmp 0x8367
subsd %xmm2, %xmm0
mulsd %xmm1, %xmm0
mulsd %xmm2, %xmm0
mulsd %xmm2, %xmm3
mulsd %xmm2, %xmm3
mulsd %xmm5, %xmm3
mulsd %xmm5, %xmm0
addsd %xmm3, %xmm0
xorpd 0x2e15e(%rip), %xmm0    # 0x364b0
retq
mulsd %xmm2, %xmm0
mulsd %xmm2, %xmm0
subsd %xmm2, %xmm5
mulsd %xmm4, %xmm5
mulsd %xmm2, %xmm5
mulsd %xmm6, %xmm5
mulsd %xmm6, %xmm0
subsd %xmm5, %xmm0
retq
// File: /workspace/github_cpp_makefile_star2_O2/millanek[P]Dsuite/Dsuite_utils.cpp
// Function: GeneralSetCounts::findADtagPosition(std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>> const&)
int GeneralSetCounts::findADtagPosition(const std::vector<std::string>& vcfLineFields) {
    
    std::vector<std::string> format = split(vcfLineFields[8], ':');
    if (format.size() == 1) return LikelihoodsProbabilitiesAbsent; // The GT tag must be present in the first place
    
    int ADTagPosition = returnFormatTagPosition(format, "AD");
    if (ADTagPosition == std::numeric_limits<int>::min()) {
        std::cerr << "Could not find the AD tag in the VCF file. This tag is requored to use the pool-seq option. Exiting ...." << std::endl;
        exit(1);
    }
    return ADTagPosition;
}

// Assembly:
pushq %rbx
subq $0x40, %rsp
movl $0x100, %eax            # imm = 0x100
addq (%rsi), %rax
leaq 0x8(%rsp), %rbx
pushq $0x3a
popq %rdx
movq %rbx, %rdi
movq %rax, %rsi
callq 0x88f1
movq 0x8(%rbx), %rax
subq (%rbx), %rax
xorl %ebx, %ebx
cmpq $0x20, %rax
je 0xaeb4
leaq 0x2b846(%rip), %rsi     # 0x366ca
leaq 0x20(%rsp), %rdi
leaq 0x7(%rsp), %rdx
callq 0x8102
leaq 0x8(%rsp), %rsi
leaq 0x20(%rsp), %rdx
callq 0x878e
movl %eax, %ebx
leaq 0x20(%rsp), %rdi
callq 0x7898
movl %ebx, %eax
negl %eax
jo 0xaec6
leaq 0x8(%rsp), %rdi
callq 0xb80c
movl %ebx, %eax
addq $0x40, %rsp
popq %rbx
retq
movq 0x4611b(%rip), %rdi     # 0x50fe8
leaq 0x2b7f9(%rip), %rsi     # 0x366cd
callq 0x7400
movq %rax, %rdi
callq 0x71e0
pushq $0x1
popq %rdi
callq 0x74f0
jmp 0xaefa
movq %rax, %rbx
leaq 0x20(%rsp), %rdi
callq 0x7898
jmp 0xaefd
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0xb80c
movq %rbx, %rdi
callq 0x7750
// File: /workspace/github_cpp_makefile_star2_O2/millanek[P]Dsuite/Dsuite_utils.cpp
// Function: calculateThreeDs(double, double, double)
double* calculateThreeDs(double ABBAtotal, double BABAtotal, double BBAAtotal) {
    // Get the D values
    double Dnum1 = ABBAtotal - BABAtotal;
    double Dnum2 = ABBAtotal - BBAAtotal;
    double Dnum3 = BBAAtotal - BABAtotal;
    
    double Ddenom1 = ABBAtotal + BABAtotal;
    double Ddenom2 = ABBAtotal + BBAAtotal;
    double Ddenom3 = BBAAtotal + BABAtotal;
    static double Ds[3]; Ds[0] = Dnum1/Ddenom1; Ds[1] = Dnum2/Ddenom2; Ds[2] = Dnum3/Ddenom3;
    return Ds;
}

// Assembly:
unpcklpd %xmm0, %xmm0            # xmm0 = xmm0[0,0]
movapd %xmm1, %xmm3
unpcklpd %xmm2, %xmm3            # xmm3 = xmm3[0],xmm2[0]
movapd %xmm0, %xmm4
subpd %xmm3, %xmm4
movapd %xmm2, %xmm5
subsd %xmm1, %xmm5
addpd %xmm0, %xmm3
divpd %xmm3, %xmm4
addsd %xmm2, %xmm1
divsd %xmm1, %xmm5
movapd %xmm4, 0x469b8(%rip)    # 0x51910
leaq 0x469b1(%rip), %rax     # 0x51910
movsd %xmm5, 0x469b9(%rip)    # 0x51920
retq
// File: /workspace/github_cpp_makefile_star2_O2/millanek[P]Dsuite/Dsuite_utils.cpp
// Function: split2(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::vector<std::string> split2(std::string s, string delim) {
    std::vector<std::string> elems;
    size_t pos = 0;
    std::string token;
    while ((pos = s.find(delim)) != std::string::npos) {
        token = s.substr(0, pos);
        elems.push_back(token);
        s.erase(0, pos + delim.length());
    }
    elems.push_back(s);
    return elems;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movq %rdx, %r15
movq %rsi, %r14
movq %rdi, %rbx
xorps %xmm0, %xmm0
andq $0x0, 0x10(%rdi)
leaq 0x18(%rsp), %rax
movq %rax, -0x10(%rax)
andq $0x0, -0x8(%rax)
movups %xmm0, (%rdi)
movb $0x0, (%rax)
leaq 0x28(%rsp), %r12
leaq 0x8(%rsp), %r13
movq %r14, %rdi
movq %r15, %rsi
xorl %edx, %edx
callq 0x7860
cmpq $-0x1, %rax
je 0xb22c
movq %rax, %rbp
movq %r12, %rdi
movq %r14, %rsi
xorl %edx, %edx
movq %rax, %rcx
callq 0x7450
movq %r13, %rdi
movq %r12, %rsi
callq 0x7500
movq %r12, %rdi
callq 0x7898
movq %rbx, %rdi
movq %r13, %rsi
callq 0xbdc2
addq 0x8(%r15), %rbp
movq %r14, %rdi
xorl %esi, %esi
movq %rbp, %rdx
callq 0x70b0
jmp 0xb1d5
movq %rbx, %rdi
movq %r14, %rsi
callq 0xbdc2
leaq 0x8(%rsp), %rdi
callq 0x7898
movq %rbx, %rax
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0xb257
jmp 0xb257
movq %rax, %r14
leaq 0x8(%rsp), %rdi
callq 0x7898
movq %rbx, %rdi
callq 0xb80c
movq %r14, %rdi
callq 0x7750
// File: /workspace/github_cpp_makefile_star2_O2/millanek[P]Dsuite/Dsuite_utils.cpp
// Function: locateSet(std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>> const&, std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>> const&)
std::vector<size_t> locateSet(const std::vector<std::string>& sample_names, const std::vector<std::string>& set) {
    std::vector<size_t> setLocs;
    for (std::vector<std::string>::size_type i = 0; i != set.size(); i++) {
        std::vector<std::string>::const_iterator it = std::find(sample_names.begin(), sample_names.end(), set[i]);
        if (it == sample_names.end()) {
            std::cerr << "Did not find the sample: \"" << set[i] << "\"" << std::endl;
            print_vector(sample_names, std::cerr,',');
        } else {
            size_t loc = std::distance(sample_names.begin(), it);
            setLocs.push_back(loc);
        }
    }
    return setLocs;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %rbx
xorps %xmm0, %xmm0
movups %xmm0, (%rdi)
andq $0x0, 0x10(%rdi)
xorl %ebp, %ebp
leaq 0x10(%rsp), %r13
xorl %r12d, %r12d
movq (%r14), %rdx
movq 0x8(%r14), %rax
subq %rdx, %rax
sarq $0x5, %rax
cmpq %rax, %r12
je 0xb353
movq (%r15), %rdi
movq 0x8(%r15), %rsi
addq %rbp, %rdx
callq 0xdcff
cmpq 0x8(%r15), %rax
je 0xb2e7
subq (%r15), %rax
sarq $0x5, %rax
movq %rax, 0x8(%rsp)
movq %rbx, %rdi
leaq 0x8(%rsp), %rsi
callq 0xbeba
jmp 0xb347
movq 0x45cfa(%rip), %rdi     # 0x50fe8
leaq 0x2b441(%rip), %rsi     # 0x36736
callq 0x7400
movq (%r14), %rsi
addq %rbp, %rsi
movq %rax, %rdi
callq 0x73c0
movq %rax, %rdi
leaq 0x2b43d(%rip), %rsi     # 0x3674f
callq 0x7400
movq %rax, %rdi
callq 0x71e0
movq %r13, %rdi
movq %r15, %rsi
callq 0xbe66
movq %r13, %rdi
movq 0x45cb4(%rip), %rsi     # 0x50fe8
pushq $0x2c
popq %rdx
pushq $0x1
popq %rcx
callq 0xbdee
movq %r13, %rdi
callq 0xb80c
incq %r12
addq $0x20, %rbp
jmp 0xb2a0
movq %rbx, %rax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %r14
leaq 0x10(%rsp), %rdi
callq 0xb80c
jmp 0xb379
jmp 0xb376
movq %rax, %r14
movq %rbx, %rdi
callq 0xc14a
movq %r14, %rdi
callq 0x7750
// File: /workspace/github_cpp_makefile_star2_O2/millanek[P]Dsuite/Dsuite_utils.cpp
// Function: assignSplits01FromAlleleFrequency(double, double&, double&)
void assignSplits01FromAlleleFrequency(const double p, double& splitA, double& splitB) {
    double r = ((double) rand() / (RAND_MAX));
    if (r <= p) { splitA = 1; }
    double r2 = ((double) rand() / (RAND_MAX));
    if (r2 <= p) { splitB = 1; }
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %rsi, %rbx
movq %rdi, %r14
movsd %xmm0, 0x8(%rsp)
callq 0x7100
cvtsi2sd %eax, %xmm0
divsd 0x2ad7b(%rip), %xmm0    # 0x36498
movsd 0x8(%rsp), %xmm1
ucomisd %xmm0, %xmm1
movabsq $0x3ff0000000000000, %r15 # imm = 0x3FF0000000000000
jb 0xb736
movq %r15, (%r14)
callq 0x7100
cvtsi2sd %eax, %xmm0
divsd 0x2ad51(%rip), %xmm0    # 0x36498
movsd 0x8(%rsp), %xmm1
ucomisd %xmm0, %xmm1
jb 0xb756
movq %r15, (%rbx)
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O2/millanek[P]Dsuite/D.cpp
// Function: TestTrioInfo::mergeABBA_BABA_SiteCoordsOverChoms()
void TestTrioInfo::mergeABBA_BABA_SiteCoordsOverChoms() {
    int totalNumABBAsites = 0;
    for(std::map<string,std::vector<int>>::iterator it = ABBAsitePositionsPerChomosome.begin(); it != ABBAsitePositionsPerChomosome.end(); it++) {
        totalNumABBAsites = totalNumABBAsites + (int)it->second.size();
    } linearABBApos.reserve(totalNumABBAsites);
    
    int linearPosSoFar = 0;
    for(std::map<string,std::vector<int>>::iterator it = ABBAsitePositionsPerChomosome.begin(); it != ABBAsitePositionsPerChomosome.end(); it++) {
        for (std::vector<int>::size_type i = 0; i < it->second.size(); i++) {
            linearABBApos.push_back(it->second[i] + linearPosSoFar);
        }
    }
    
    int totalNumBABAsites = 0;
    for(std::map<string,std::vector<int>>::iterator it = BABAsitePositionsPerChomosome.begin(); it != BABAsitePositionsPerChomosome.end(); it++) {
        totalNumBABAsites = totalNumBABAsites + (int)it->second.size();
    } linearBABApos.reserve(totalNumBABAsites);
    
    linearPosSoFar = 0;
    for(std::map<string,std::vector<int>>::iterator it = BABAsitePositionsPerChomosome.begin(); it != BABAsitePositionsPerChomosome.end(); it++) {
        for (std::vector<int>::size_type i = 0; i < it->second.size(); i++) {
            linearBABApos.push_back(it->second[i] + linearPosSoFar);
        }
    }
    
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x18(%rdi), %rax
leaq 0x8(%rdi), %r13
xorl %ebp, %ebp
cmpq %r13, %rax
je 0xfbe1
movq 0x48(%rax), %rcx
subq 0x40(%rax), %rcx
shrq $0x2, %rcx
addl %ecx, %ebp
movq %rax, %rdi
callq 0x7300
jmp 0xfbc4
leaq 0x30(%rbx), %r14
movslq %ebp, %rsi
movq %r14, %rdi
callq 0x11580
movq 0x18(%rbx), %r12
leaq 0x4(%rsp), %r15
cmpq %r13, %r12
je 0xfc3a
xorl %ebp, %ebp
movq 0x40(%r12), %rax
movq 0x48(%r12), %rcx
subq %rax, %rcx
sarq $0x2, %rcx
cmpq %rcx, %rbp
jae 0xfc2d
movl (%rax,%rbp,4), %eax
movl %eax, 0x4(%rsp)
movq %r14, %rdi
movq %r15, %rsi
callq 0xd98a
incq %rbp
jmp 0xfc00
movq %r12, %rdi
callq 0x7300
movq %rax, %r12
jmp 0xfbf9
movq 0x60(%rbx), %rax
leaq 0x50(%rbx), %r12
xorl %ebp, %ebp
cmpq %r12, %rax
je 0xfc61
movq 0x48(%rax), %rcx
subq 0x40(%rax), %rcx
shrq $0x2, %rcx
addl %ecx, %ebp
movq %rax, %rdi
callq 0x7300
jmp 0xfc44
leaq 0x78(%rbx), %r14
movslq %ebp, %rsi
movq %r14, %rdi
callq 0x11580
movq 0x60(%rbx), %r15
movq %rsp, %rbx
cmpq %r12, %r15
je 0xfcb7
xorl %r13d, %r13d
movq 0x40(%r15), %rax
movq 0x48(%r15), %rcx
subq %rax, %rcx
sarq $0x2, %rcx
cmpq %rcx, %r13
jae 0xfcaa
movl (%rax,%r13,4), %eax
movl %eax, (%rsp)
movq %r14, %rdi
movq %rbx, %rsi
callq 0xd98a
incq %r13
jmp 0xfc7f
movq %r15, %rdi
callq 0x7300
movq %rax, %r15
jmp 0xfc77
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq