LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O1/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 %rbx
movq %rdi, %rbx
movq 0x8c55(%rip), %rax      # 0x1af80
addq $0x10, %rax
movq %rax, (%rdi)
leaq 0x18(%rdi), %rax
movq %rax, 0x8(%rdi)
xorl %eax, %eax
movq %rax, 0x10(%rdi)
movb $0x0, 0x18(%rdi)
addq $0x48, %rdi
movq %rax, 0x30(%rbx)
movl $0xa0, %edx
xorl %esi, %esi
callq 0xb3f0
movq 0x78(%rbx), %rax
testq %rax, %rax
je 0x12379
leaq 0x68(%rbx), %rdi
movq %rdi, %rsi
movl $0x3, %edx
callq *%rax
leaq 0x78(%rbx), %rax
xorps %xmm0, %xmm0
movups %xmm0, (%rax)
movq 0x98(%rbx), %rax
testq %rax, %rax
je 0x123a3
leaq 0x88(%rbx), %rdi
movq %rdi, %rsi
movl $0x3, %edx
callq *%rax
leaq 0x98(%rbx), %rax
xorps %xmm0, %xmm0
movups %xmm0, (%rax)
movq 0xb8(%rbx), %rax
testq %rax, %rax
je 0x123cd
leaq 0xa8(%rbx), %rdi
movq %rdi, %rsi
movl $0x3, %edx
callq *%rax
leaq 0xb8(%rbx), %rax
xorps %xmm0, %xmm0
movups %xmm0, (%rax)
movq 0xd8(%rbx), %rax
testq %rax, %rax
je 0x123f7
leaq 0xc8(%rbx), %rdi
movq %rdi, %rsi
movl $0x3, %edx
callq *%rax
leaq 0xd8(%rbx), %rax
xorps %xmm0, %xmm0
movups %xmm0, (%rax)
xorl %eax, %eax
xchgb %al, 0x168(%rbx)
movq $0xa, 0x38(%rbx)
movq $0x0, 0x40(%rbx)
popq %rbx
retq
jmp 0x12417
jmp 0x12417
jmp 0x12417
movq %rax, %rdi
callq 0xd7ee
nop
// File: /workspace/github_cpp_makefile_star2_O1/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 0xb1c0
movq %rax, %r14
cmpl $-0x1, %r14d
je 0x12d37
testq %r15, %r15
sete %al
testl %r14d, %r14d
setne %cl
orb %al, %cl
jne 0x12d29
movl 0x2c(%rbx), %edi
callq 0xbe10
cmpq $0x0, 0x78(%rbx)
je 0x12d29
leaq 0x68(%rbx), %rdi
movq %rbx, %rsi
callq *0x80(%rbx)
movl %r14d, %eax
addq $0x28, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movl $0x48, %edi
callq 0xb360
movq %rax, %rbx
callq 0xb070
movl (%rax), %edi
callq 0xb1e0
leaq 0x8(%rsp), %rdi
leaq 0x7(%rsp), %rdx
movq %rax, %rsi
callq 0xb290
movb $0x1, %bpl
leaq 0x8(%rsp), %rsi
movq %rbx, %rdi
callq 0xbb20
xorl %ebp, %ebp
movq 0x821d(%rip), %rsi      # 0x1af98
movq 0x820e(%rip), %rdx      # 0x1af90
movq %rbx, %rdi
callq 0xbc70
movq %rax, %r14
leaq 0x18(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x12da8
callq 0xb730
jmp 0x12da8
movq %rax, %r14
movb $0x1, %bpl
testb %bpl, %bpl
je 0x12db5
movq %rbx, %rdi
callq 0xb5b0
movq %r14, %rdi
callq 0xbce0
nop
// File: /workspace/github_cpp_makefile_star2_O1/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 %r15
pushq %r14
pushq %rbx
subq $0x28, %rsp
movq %rdi, %rbx
movl 0x2c(%rdi), %edi
xorl %ecx, %ecx
callq 0xb370
movq %rax, %r14
cmpl $-0x1, %r14d
jne 0x12e2a
callq 0xb070
cmpl $0x68, (%rax)
jne 0x12e38
movl 0x2c(%rbx), %edi
callq 0xbe10
cmpq $0x0, 0x78(%rbx)
je 0x12e2a
leaq 0x68(%rbx), %rdi
movq %rbx, %rsi
callq *0x80(%rbx)
movl %r14d, %eax
addq $0x28, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %r15
movl $0x48, %edi
callq 0xb360
movq %rax, %rbx
movl (%r15), %edi
callq 0xb1e0
leaq 0x8(%rsp), %rdi
leaq 0x7(%rsp), %rdx
movq %rax, %rsi
callq 0xb290
movb $0x1, %bpl
leaq 0x8(%rsp), %rsi
movq %rbx, %rdi
callq 0xbb20
xorl %ebp, %ebp
movq 0x811d(%rip), %rsi      # 0x1af98
movq 0x810e(%rip), %rdx      # 0x1af90
movq %rbx, %rdi
callq 0xbc70
movq %rax, %r14
leaq 0x18(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x12ea8
callq 0xb730
jmp 0x12ea8
movq %rax, %r14
movb $0x1, %bpl
testb %bpl, %bpl
je 0x12eb5
movq %rbx, %rdi
callq 0xb5b0
movq %r14, %rdi
callq 0xbce0
nop
// File: /workspace/github_cpp_makefile_star2_O1/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
movq $0x0, (%rdx)
movl 0x2c(%rdi), %edi
movl $0x541b, %esi           # imm = 0x541B
xorl %eax, %eax
callq 0xba50
cmpl $-0x1, %eax
je 0x12ef4
movq 0x8(%rsp), %rax
addq $0x30, %rsp
popq %rbx
popq %r14
popq %rbp
retq
movl $0x48, %edi
callq 0xb360
movq %rax, %rbx
callq 0xb070
movl (%rax), %edi
callq 0xb1e0
leaq 0x10(%rsp), %rdi
leaq 0x7(%rsp), %rdx
movq %rax, %rsi
callq 0xb290
movb $0x1, %bpl
leaq 0x10(%rsp), %rsi
movq %rbx, %rdi
callq 0xbb20
xorl %ebp, %ebp
movq 0x8060(%rip), %rsi      # 0x1af98
movq 0x8051(%rip), %rdx      # 0x1af90
movq %rbx, %rdi
callq 0xbc70
movq %rax, %r14
leaq 0x20(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x12f65
callq 0xb730
jmp 0x12f65
movq %rax, %r14
movb $0x1, %bpl
testb %bpl, %bpl
je 0x12f72
movq %rbx, %rdi
callq 0xb5b0
movq %r14, %rdi
callq 0xbce0
// File: /workspace/github_cpp_makefile_star2_O1/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 %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x779e(%rip), %rax      # 0x1afb0
addq $0x10, %rax
movq %rax, (%rdi)
leaq 0x50(%rdi), %r14
xorps %xmm0, %xmm0
movups %xmm0, 0x20(%rdi)
movups %xmm0, 0x30(%rdi)
movl $0xa0, %edx
movq %r14, %rdi
xorl %esi, %esi
callq 0xb3f0
movq 0x60(%rbx), %rax
testq %rax, %rax
je 0x13857
movq %r14, %rdi
movq %r14, %rsi
movl $0x3, %edx
callq *%rax
leaq 0x60(%rbx), %rax
xorps %xmm0, %xmm0
movups %xmm0, (%rax)
movq 0x80(%rbx), %rax
testq %rax, %rax
je 0x1387e
leaq 0x70(%rbx), %rdi
movq %rdi, %rsi
movl $0x3, %edx
callq *%rax
leaq 0x80(%rbx), %rax
xorps %xmm0, %xmm0
movups %xmm0, (%rax)
movq 0xa0(%rbx), %rax
testq %rax, %rax
je 0x138a8
leaq 0x90(%rbx), %rdi
movq %rdi, %rsi
movl $0x3, %edx
callq *%rax
leaq 0xa0(%rbx), %rax
xorps %xmm0, %xmm0
movups %xmm0, (%rax)
movq 0xc0(%rbx), %rax
testq %rax, %rax
je 0x138d2
leaq 0xb0(%rbx), %rdi
movq %rdi, %rsi
movl $0x3, %edx
callq *%rax
leaq 0xc0(%rbx), %rax
xorps %xmm0, %xmm0
movups %xmm0, (%rax)
movq 0xe0(%rbx), %rax
testq %rax, %rax
je 0x138fc
leaq 0xd0(%rbx), %rdi
movq %rdi, %rsi
movl $0x3, %edx
callq *%rax
leaq 0xe0(%rbx), %rax
xorps %xmm0, %xmm0
movups %xmm0, (%rax)
xorl %eax, %eax
xchgb %al, 0x174(%rbx)
movq $0xa, 0x40(%rbx)
movq $0x0, 0x48(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
jmp 0x13924
jmp 0x13924
jmp 0x13924
jmp 0x13924
movq %rax, %rdi
callq 0xd7ee
// File: /workspace/github_cpp_makefile_star2_O1/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 0x8(%rsp), %rdx
movl %esi, (%rdx)
movq 0x20(%rdi), %rdi
movq 0x28(%rbx), %rsi
callq 0xb3a0
movq 0x28(%rbx), %rdx
cmpq %rdx, %rax
je 0x14585
leaq 0x4(%rax), %rsi
cmpq %rdx, %rsi
je 0x144e1
subq %rsi, %rdx
movq %rax, %rdi
callq 0xbbb0
addq $-0x4, 0x28(%rbx)
movl 0x8(%rsp), %edi
callq 0xbe10
movl 0x8(%rsp), %ecx
movq $-0x2, %rax
rolq %cl, %rax
leal 0x3f(%rcx), %edx
testl %ecx, %ecx
cmovnsl %ecx, %edx
sarl $0x6, %edx
movslq %edx, %rdx
andq %rax, 0xf0(%rbx,%rdx,8)
movq 0x20(%rbx), %rsi
movq 0x28(%rbx), %rax
cmpq %rax, %rsi
sete %dil
movq %rsi, %rdx
addq $0x4, %rdx
cmpq %rax, %rdx
sete %r8b
orb %dil, %r8b
je 0x1453a
movq %rsi, %rdi
jmp 0x14554
movl (%rsi), %r8d
movq %rdx, %rdi
cmpl (%rdx), %r8d
jl 0x14548
movq %rsi, %rdi
addq $0x4, %rdx
movq %rdi, %rsi
cmpq %rax, %rdx
jne 0x1453a
leaq 0x18(%rbx), %rdx
cmpq %rax, %rdi
cmovneq %rdi, %rdx
movl (%rdx), %eax
movl %eax, 0x170(%rbx)
cmpq $0x0, 0x80(%rbx)
je 0x14585
leaq 0x70(%rbx), %rdi
leaq 0xc(%rsp), %rdx
movl %ecx, (%rdx)
movq %rbx, %rsi
callq *0x88(%rbx)
addq $0x10, %rsp
popq %rbx
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/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 0xb1c0
movq %rax, %r15
cmpl $-0x1, %r15d
je 0x145e2
testq %r12, %r12
sete %al
testl %r15d, %r15d
setne %cl
orb %al, %cl
jne 0x145d2
movq %r14, %rdi
movl %ebx, %esi
callq 0xba00
movl %r15d, %eax
addq $0x30, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movl $0x48, %edi
callq 0xb360
movq %rax, %rbx
callq 0xb070
movl (%rax), %edi
callq 0xb1e0
leaq 0x10(%rsp), %rdi
leaq 0xf(%rsp), %rdx
movq %rax, %rsi
callq 0xb290
movb $0x1, %bpl
leaq 0x10(%rsp), %rsi
movq %rbx, %rdi
callq 0xbb20
xorl %ebp, %ebp
movq 0x6972(%rip), %rsi      # 0x1af98
movq 0x6963(%rip), %rdx      # 0x1af90
movq %rbx, %rdi
callq 0xbc70
movq %rax, %r14
leaq 0x20(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x14653
callq 0xb730
jmp 0x14653
movq %rax, %r14
movb $0x1, %bpl
testb %bpl, %bpl
je 0x14660
movq %rbx, %rdi
callq 0xb5b0
movq %r14, %rdi
callq 0xbce0
// File: /workspace/github_cpp_makefile_star2_O1/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 %r12
pushq %rbx
subq $0x30, %rsp
movl %esi, %ebx
movq %rdi, %r14
movl %esi, %edi
movq %rdx, %rsi
movq %rcx, %rdx
xorl %ecx, %ecx
callq 0xb370
movq %rax, %r15
cmpl $-0x1, %r15d
jne 0x146a5
callq 0xb070
cmpl $0x68, (%rax)
jne 0x146b5
movq %r14, %rdi
movl %ebx, %esi
callq 0xba00
movl %r15d, %eax
addq $0x30, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %r12
movl $0x48, %edi
callq 0xb360
movq %rax, %rbx
movl (%r12), %edi
callq 0xb1e0
leaq 0x10(%rsp), %rdi
leaq 0xf(%rsp), %rdx
movq %rax, %rsi
callq 0xb290
movb $0x1, %bpl
leaq 0x10(%rsp), %rsi
movq %rbx, %rdi
callq 0xbb20
xorl %ebp, %ebp
movq 0x689f(%rip), %rsi      # 0x1af98
movq 0x6890(%rip), %rdx      # 0x1af90
movq %rbx, %rdi
callq 0xbc70
movq %rax, %r14
leaq 0x20(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x14726
callq 0xb730
jmp 0x14726
movq %rax, %r14
movb $0x1, %bpl
testb %bpl, %bpl
je 0x14733
movq %rbx, %rdi
callq 0xb5b0
movq %r14, %rdi
callq 0xbce0
nop
// File: /workspace/github_cpp_makefile_star2_O1/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
movq $0x0, (%rdx)
movl $0x541b, %esi           # imm = 0x541B
xorl %eax, %eax
callq 0xba50
cmpl $-0x1, %eax
je 0x14771
movq 0x8(%rsp), %rax
addq $0x30, %rsp
popq %rbx
popq %r14
popq %rbp
retq
movl $0x48, %edi
callq 0xb360
movq %rax, %rbx
callq 0xb070
movl (%rax), %edi
callq 0xb1e0
leaq 0x10(%rsp), %rdi
leaq 0x7(%rsp), %rdx
movq %rax, %rsi
callq 0xb290
movb $0x1, %bpl
leaq 0x10(%rsp), %rsi
movq %rbx, %rdi
callq 0xbb20
xorl %ebp, %ebp
movq 0x67e3(%rip), %rsi      # 0x1af98
movq 0x67d4(%rip), %rdx      # 0x1af90
movq %rbx, %rdi
callq 0xbc70
movq %rax, %r14
leaq 0x20(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x147e2
callq 0xb730
jmp 0x147e2
movq %rax, %r14
movb $0x1, %bpl
testb %bpl, %bpl
je 0x147ef
movq %rbx, %rdi
callq 0xb5b0
movq %r14, %rdi
callq 0xbce0
nop
// File: /workspace/github_cpp_makefile_star2_O1/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
movl $0x18, %edi
callq 0x1120
movq %rax, %rbx
movq $0x0, 0x10(%rax)
movaps 0xc62(%rip), %xmm0      # 0x2010
movups %xmm0, (%rax)
movb $0x0, 0x14(%rax)
xorl %edi, %edi
callq 0x10e0
movl %eax, %edi
callq 0x10f0
callq 0x1040
movl $0x284880, %esi         # imm = 0x284880
movl %eax, %edi
movl $0x3b6, %edx            # imm = 0x3B6
callq 0x1080
movl %eax, 0x10(%rbx)
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/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 0x1480
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 0x1160
movq %rax, %r15
movslq 0xc(%rbx), %rax
movq %rax, %rcx
shlq $0x8, %rcx
leaq (%rcx,%rax,8), %rdi
addq %r15, %rdi
movl $0x108, %edx            # imm = 0x108
movq %r14, %rsi
callq 0x10a0
movq %r15, %rdi
callq 0x1190
movb $0x0, 0x14(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/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 0x1646
callq 0x1713
cmpb $0x1, 0x2ba6(%rip)      # 0x40f1
jne 0x153f
movq 0x2a84(%rip), %rbx      # 0x3fd8
leaq 0xac5(%rip), %rsi       # 0x2020
movl $0x20, %edx
movq %rbx, %rdi
callq 0x1130
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x1100
movsbl %al, %esi
movq %rbx, %rdi
callq 0x1030
movq %rax, %rdi
callq 0x1090
movl 0x2b5f(%rip), %edi      # 0x40f4
callq 0x1510
movq %rax, %rbx
movl 0x2b55(%rip), %edi      # 0x40f8
callq 0x151e
movq %rax, %r14
cmpl $0x0, (%rax)
jle 0x15f6
xorl %r12d, %r12d
movq %rbx, %r13
movl (%r13), %edi
xorl %esi, %esi
xorl %edx, %edx
callq 0x1160
movq %rax, %r15
movl 0x10(%rax), %edi
xorl %esi, %esi
xorl %edx, %edx
callq 0x10b0
movq %r15, %rdi
callq 0x1190
movl (%r13), %edi
xorl %esi, %esi
xorl %edx, %edx
callq 0x10b0
incq %r12
movslq (%r14), %rax
addq $0x38, %r13
cmpq %rax, %r12
jl 0x15b6
movq %r14, %rdi
callq 0x1190
movq %rbx, %rdi
callq 0x1190
movl 0x2ae8(%rip), %edi      # 0x40f4
xorl %esi, %esi
xorl %edx, %edx
callq 0x10b0
movl 0x2add(%rip), %edi      # 0x40f8
xorl %esi, %esi
xorl %edx, %edx
callq 0x10b0
movq 0x29ad(%rip), %rdi      # 0x3fd8
leaq 0xa0f(%rip), %rsi       # 0x2041
callq 0x1110
movq %rax, %rdi
callq 0x1070
xorl %edi, %edi
callq 0x1150
// File: /workspace/github_cpp_makefile_star2_O1/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 0x10e0
movl %eax, %edi
callq 0x10f0
leaq 0x9e6(%rip), %rdi       # 0x2047
callq 0x10c0
movq 0x296b(%rip), %rbx      # 0x3fd8
leaq 0x9d9(%rip), %rsi       # 0x204d
movl $0x18, %edx
movq %rbx, %rdi
callq 0x1130
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x1100
movsbl %al, %esi
movq %rbx, %rdi
callq 0x1030
movq %rax, %rdi
callq 0x1090
movl 0x2a4a(%rip), %edi      # 0x40f8
callq 0x151e
movl $0x0, (%rax)
movq %rax, %rdi
callq 0x1190
leaq 0x99e(%rip), %rsi       # 0x2066
movl $0x13, %edx
movq %rbx, %rdi
callq 0x1130
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x1100
movsbl %al, %esi
movq %rbx, %rdi
callq 0x1030
movq %rax, %rdi
callq 0x1090
leaq 0x180(%rip), %rsi       # 0x1883
movl $0x2, %edi
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x1140
// File: /workspace/github_cpp_makefile_star2_O1/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 0x29ca(%rip), %edi      # 0x40f4
callq 0x1510
movq %rax, %r15
movl 0x29c0(%rip), %edi      # 0x40f8
callq 0x151e
movq %rax, %r14
movslq 0x29b5(%rip), %r12      # 0x40fc
cmpl (%rax), %r12d
je 0x1864
movl (%r14), %eax
cmpl %eax, %r12d
jge 0x185e
imulq $0x38, %r12, %rax
movq %r15, -0x30(%rbp)
addq %rax, %r15
movq 0x286a(%rip), %r13      # 0x3fd8
movq 0x30(%r15), %rax
movq %rax, -0x40(%rbp)
movups (%r15), %xmm0
movups 0x10(%r15), %xmm1
movups 0x20(%r15), %xmm2
movaps %xmm2, -0x50(%rbp)
movaps %xmm1, -0x60(%rbp)
movaps %xmm0, -0x70(%rbp)
xorl %edi, %edi
callq 0x10e0
movq %rax, -0x38(%rbp)
leaq -0x38(%rbp), %rdi
callq 0x1050
testq %rax, %rax
je 0x17c4
movq %rax, %rbx
movq %rax, %rdi
callq 0x1060
movq %r13, %rdi
movq %rbx, %rsi
movq %rax, %rdx
callq 0x1130
jmp 0x17dd
movq (%r13), %rax
movq -0x18(%rax), %rax
leaq (%rax,%r13), %rdi
movl 0x20(%r13,%rax), %esi
orl $0x1, %esi
callq 0x1180
movl $0x3, %edx
movq %r13, %rdi
leaq 0x88e(%rip), %rsi       # 0x207a
callq 0x1130
leaq -0x6c(%rbp), %rbx
movq %rbx, %rdi
callq 0x1060
movq %r13, %rdi
movq %rbx, %rsi
movq %rax, %rdx
callq 0x1130
movl $0x16, %edx
movq %r13, %rdi
leaq 0x864(%rip), %rsi       # 0x207e
callq 0x1130
movq (%r13), %rax
movq -0x18(%rax), %rdi
addq %r13, %rdi
movl $0xa, %esi
callq 0x1100
movsbl %al, %esi
movq %r13, %rdi
callq 0x1030
movq %rax, %rdi
callq 0x1090
incq %r12
movslq (%r14), %rax
addq $0x38, %r15
cmpq %rax, %r12
jl 0x176e
movq -0x30(%rbp), %r15
movl %eax, 0x2898(%rip)      # 0x40fc
movq %r14, %rdi
callq 0x1190
movq %r15, %rdi
callq 0x1190
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/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
movq 0x30(%rdi), %rsi
addq $0x30, %r15
movq %r15, %rdi
callq 0x2bb6
movl %ebp, %esi
movq %r15, %rdi
callq 0x2a32
movq 0x487b(%rip), %r15      # 0x6ff0
leaq 0x18d2(%rip), %rsi      # 0x404e
movl $0x27, %edx
movq %r15, %rdi
callq 0x2200
movq %r15, %rdi
movq %rbx, %rsi
callq 0x2190
movq %rax, %r15
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r15, %rdi
movl $0xa, %esi
callq 0x21a0
movsbl %al, %esi
movq %r15, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x2120
movq %r14, %rdi
movq %rbx, %rsi
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x3316
nop
// File: /workspace/github_cpp_makefile_star2_O1/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
movl 0x8(%rsi), %eax
movq 0x30(%rdi), %rdx
leaq (%rax,%rax,2), %rax
movq (%rdx,%rax,8), %rcx
movq 0x8(%rdx,%rax,8), %rdx
subq %rcx, %rdx
setne %al
je 0x28cb
leaq 0x8(%rsi), %r8
movq %r8, -0x8(%rsp)
sarq $0x3, %rdx
movl 0x4(%rsi), %r9d
testq %r9, %r9
sete %r10b
leaq (%rsi,%r9,4), %r11
addq $0x8, %r11
movq %rdi, -0x10(%rsp)
movq 0x10(%rdi), %rsi
xorl %ebx, %ebx
movq (%rcx,%rbx,8), %r14
incq %rsi
movl 0x4(%r14), %r15d
cmpl %r15d, %r9d
jae 0x28b4
movl %r10d, %ebp
testl %r9d, %r9d
je 0x28af
leaq (%r14,%r15,4), %rdi
addq $0x8, %rdi
addq $0x8, %r14
movq -0x8(%rsp), %r12
movq %rdi, %r8
subq %r14, %r8
sarq $0x2, %r8
testq %r8, %r8
jle 0x2890
movl (%r12), %ebp
movq %r8, %r15
shrq %r15
movq %r15, %r13
notq %r13
addq %r8, %r13
leaq (%r14,%r15,4), %r8
addq $0x4, %r8
cmpl %ebp, -0x4(%r8)
cmovaeq %r15, %r13
cmovbq %r8, %r14
movq %r13, %r8
testq %r13, %r13
jg 0x2865
cmpq %rdi, %r14
je 0x28b4
movl (%r14), %r8d
cmpl (%r12), %r8d
ja 0x28b4
addq $0x4, %r12
addq $0x4, %r14
cmpq %r11, %r12
sete %bpl
jne 0x2852
testb %bpl, %bpl
jne 0x28c2
incl %ebx
cmpq %rbx, %rdx
seta %al
ja 0x2829
movq -0x10(%rsp), %rcx
movq %rsi, 0x10(%rcx)
andb $0x1, %al
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/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 %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
incq (%rdi)
testl %edx, %edx
je 0x2999
movq %rsi, %rbx
cmpl $0x2, %edx
je 0x291c
cmpl $0x1, %edx
jne 0x29a5
movl (%rbx), %esi
movq 0x46cb(%rip), %rdi      # 0x6fd0
callq 0x2110
leaq 0x6(%rsp), %rsi
movb $0xa, (%rsi)
movl $0x1, %edx
movq %rax, %rdi
jmp 0x2994
movl (%rbx), %esi
movq 0x46ab(%rip), %rdi      # 0x6fd0
callq 0x2110
leaq 0x1745(%rip), %rsi      # 0x4076
movl $0x1, %edx
movq %rax, %rdi
callq 0x2200
cmpl $0x0, 0x4(%rbx)
je 0x2980
xorl %r12d, %r12d
movq 0x4682(%rip), %r14      # 0x6fd0
leaq 0x5(%rsp), %r15
movb $0x20, 0x5(%rsp)
movl $0x1, %edx
movq %r14, %rdi
movq %r15, %rsi
callq 0x2200
movl 0x8(%rbx,%r12,4), %esi
movq %rax, %rdi
callq 0x2110
incq %r12
movl 0x4(%rbx), %eax
cmpq %rax, %r12
jb 0x2953
leaq 0x7(%rsp), %rsi
movb $0xa, (%rsi)
movq 0x4641(%rip), %rdi      # 0x6fd0
movl $0x1, %edx
callq 0x2200
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
movq 0x4624(%rip), %rdi      # 0x6fd0
leaq 0x16c5(%rip), %rsi      # 0x4078
callq 0x21b0
leaq 0x16bf(%rip), %rdi      # 0x407e
leaq 0x16ba(%rip), %rsi      # 0x4080
leaq 0x16d0(%rip), %rcx      # 0x409d
movl $0x99, %edx
callq 0x2100
nop
// File: /workspace/github_cpp_makefile_star2_O1/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 0x37aeb(%rip), %xmm5    # 0x40470
movapd %xmm5, %xmm0
subsd %xmm4, %xmm0
movapd %xmm5, %xmm6
subsd %xmm3, %xmm6
jbe 0x89ad
mulsd %xmm1, %xmm0
mulsd %xmm1, %xmm0
subsd %xmm1, %xmm5
mulsd %xmm4, %xmm5
mulsd %xmm1, %xmm5
jmp 0x89c1
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_O1/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 0x8a62
ucomisd %xmm2, %xmm4
movsd 0x37a3e(%rip), %xmm0    # 0x40470
movapd %xmm0, %xmm5
subsd %xmm3, %xmm5
movapd %xmm0, %xmm3
subsd %xmm1, %xmm3
xorpd 0x37a66(%rip), %xmm3    # 0x404b0
jbe 0x8a96
subsd %xmm4, %xmm0
mulsd %xmm1, %xmm0
mulsd %xmm4, %xmm0
mulsd %xmm4, %xmm3
mulsd %xmm4, %xmm3
jmp 0x8aaa
ucomisd %xmm2, %xmm1
movsd 0x37a02(%rip), %xmm5    # 0x40470
movapd %xmm5, %xmm0
subsd %xmm4, %xmm0
movapd %xmm5, %xmm6
subsd %xmm3, %xmm6
jbe 0x8abf
mulsd %xmm1, %xmm0
mulsd %xmm1, %xmm0
subsd %xmm1, %xmm5
mulsd %xmm4, %xmm5
mulsd %xmm1, %xmm5
jmp 0x8ad3
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 0x379f2(%rip), %xmm0    # 0x404b0
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_O1/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 %r14
pushq %rbx
subq $0x38, %rsp
movl $0x100, %eax            # imm = 0x100
addq (%rsi), %rax
movq %rsp, %rbx
movq %rbx, %rdi
movq %rax, %rsi
movl $0x3a, %edx
callq 0x91a9
movq 0x8(%rbx), %rax
subq (%rbx), %rax
xorl %ebx, %ebx
cmpq $0x20, %rax
je 0xc690
leaq 0x28(%rsp), %r14
movq %r14, -0x10(%r14)
leaq 0x34093(%rip), %rsi     # 0x406ca
leaq 0x3408e(%rip), %rdx     # 0x406cc
leaq 0x18(%rsp), %rdi
callq 0x88ba
movq (%rsp), %rdi
movq 0x8(%rsp), %rsi
leaq 0x18(%rsp), %rdx
callq 0xf199
movq %rax, %rcx
subq (%rsp), %rcx
shrq $0x5, %rcx
cmpq 0x8(%rsp), %rax
movl $0x80000000, %ebx       # imm = 0x80000000
cmovnel %ecx, %ebx
movq 0x18(%rsp), %rdi
cmpq %r14, %rdi
je 0xc68a
movq 0x28(%rsp), %rsi
incq %rsi
callq 0x7420
movl %ebx, %eax
negl %eax
jo 0xc6a2
movq %rsp, %rdi
callq 0xd250
movl %ebx, %eax
addq $0x38, %rsp
popq %rbx
popq %r14
retq
movq 0x4a93f(%rip), %rdi     # 0x56fe8
leaq 0x3401d(%rip), %rsi     # 0x406cd
movl $0x68, %edx
callq 0x74b0
movq 0x4a927(%rip), %rdi     # 0x56fe8
callq 0x71b0
movl $0x1, %edi
callq 0x7510
jmp 0xc6ee
movq %rax, %rbx
movq 0x18(%rsp), %rdi
cmpq %r14, %rdi
je 0xc6f1
movq 0x28(%rsp), %rsi
incq %rsi
callq 0x7420
jmp 0xc6f1
movq %rax, %rbx
movq %rsp, %rdi
callq 0xd250
movq %rbx, %rdi
callq 0x7740
// File: /workspace/github_cpp_makefile_star2_O1/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:
movapd %xmm0, %xmm3
subsd %xmm1, %xmm3
movapd %xmm0, %xmm4
subsd %xmm2, %xmm4
movapd %xmm2, %xmm5
subsd %xmm1, %xmm5
movapd %xmm0, %xmm6
addsd %xmm1, %xmm6
divsd %xmm6, %xmm3
addsd %xmm2, %xmm0
divsd %xmm0, %xmm4
addsd %xmm2, %xmm1
divsd %xmm1, %xmm5
movsd %xmm3, 0x4b18e(%rip)    # 0x578e0
leaq 0x4b187(%rip), %rax     # 0x578e0
movsd %xmm4, 0x4b187(%rip)    # 0x578e8
movsd %xmm5, 0x4b187(%rip)    # 0x578f0
retq
// File: /workspace/github_cpp_makefile_star2_O1/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
xorl %eax, %eax
movq %rax, 0x10(%rdi)
xorps %xmm0, %xmm0
movups %xmm0, (%rdi)
leaq 0x18(%rsp), %rcx
movq %rcx, -0x10(%rcx)
movq %rax, -0x8(%rcx)
movb $0x0, (%rcx)
leaq 0x28(%rsp), %r12
leaq 0x8(%rsp), %r13
movq (%r15), %rsi
movq 0x8(%r15), %rcx
movq %r14, %rdi
xorl %edx, %edx
callq 0x7720
cmpq $-0x1, %rax
je 0xcb78
movq %rax, %rbp
movq %r12, %rdi
movq %r14, %rsi
xorl %edx, %edx
movq %rax, %rcx
callq 0x7450
movq %r13, %rdi
movq %r12, %rsi
callq 0x7520
movq 0x28(%rsp), %rdi
leaq 0x38(%rsp), %rax
cmpq %rax, %rdi
je 0xcb5a
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x7420
movq %rbx, %rdi
movq %r13, %rsi
callq 0xd92e
addq 0x8(%r15), %rbp
movq %r14, %rdi
xorl %esi, %esi
movq %rbp, %rdx
callq 0x70a0
jmp 0xcb09
movq %rbx, %rdi
movq %r14, %rsi
callq 0xd92e
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0xcb9f
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x7420
movq %rbx, %rax
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0xcbb5
jmp 0xcbb5
movq %rax, %r14
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0xcbd4
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x7420
movq %rbx, %rdi
callq 0xd250
movq %r14, %rdi
callq 0x7740
// File: /workspace/github_cpp_makefile_star2_O1/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 %rdi, %rbx
xorps %xmm0, %xmm0
movups %xmm0, (%rdi)
movq $0x0, 0x10(%rdi)
movq (%rdx), %rdx
cmpq %rdx, 0x8(%r14)
je 0xcd2a
movq %rsi, %r15
xorl %r12d, %r12d
xorl %r13d, %r13d
movq (%r15), %rdi
movq 0x8(%r15), %rsi
addq %r12, %rdx
callq 0xf965
cmpq 0x8(%r15), %rax
je 0xcc5b
subq (%r15), %rax
sarq $0x5, %rax
movq %rax, 0x8(%rsp)
movq 0x8(%rbx), %rsi
cmpq 0x10(%rbx), %rsi
je 0xccff
movq %rax, (%rsi)
addq $0x8, %rsi
movq %rsi, 0x8(%rbx)
jmp 0xcd0c
movl $0x1a, %edx
movq 0x4a381(%rip), %rdi     # 0x56fe8
leaq 0x33ac8(%rip), %rsi     # 0x40736
callq 0x74b0
movq (%r14), %rax
movq (%rax,%r12), %rsi
movq 0x8(%rax,%r12), %rdx
movq 0x4a362(%rip), %rdi     # 0x56fe8
callq 0x74b0
movq %rax, %rbp
movl $0x1, %edx
movq %rax, %rdi
leaq 0x33ab2(%rip), %rsi     # 0x4074f
callq 0x74b0
movq (%rbp), %rax
movq -0x18(%rax), %rdi
addq %rbp, %rdi
movl $0xa, %esi
callq 0x73f0
movsbl %al, %esi
movq %rbp, %rdi
callq 0x7040
movq %rax, %rdi
callq 0x72e0
leaq 0x10(%rsp), %rdi
movq %r15, %rsi
callq 0xda38
leaq 0x10(%rsp), %rbp
movq %rbp, %rdi
movq 0x4a302(%rip), %rsi     # 0x56fe8
movl $0x2c, %edx
movl $0x1, %ecx
callq 0xd96b
movq %rbp, %rdi
callq 0xd250
jmp 0xcd0c
movq %rbx, %rdi
leaq 0x8(%rsp), %rdx
callq 0xfb20
incq %r13
movq (%r14), %rdx
movq 0x8(%r14), %rax
subq %rdx, %rax
sarq $0x5, %rax
addq $0x20, %r12
cmpq %rax, %r13
jne 0xcc1c
movq %rbx, %rax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0xcd4d
movq %rax, %r14
leaq 0x10(%rsp), %rdi
callq 0xd250
jmp 0xcd50
movq %rax, %r14
movq (%rbx), %rdi
testq %rdi, %rdi
je 0xcd64
movq 0x10(%rbx), %rsi
subq %rdi, %rsi
callq 0x7420
movq %r14, %rdi
callq 0x7740
// File: /workspace/github_cpp_makefile_star2_O1/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 0x70d0
xorps %xmm0, %xmm0
cvtsi2sd %eax, %xmm0
divsd 0x33367(%rip), %xmm0    # 0x404a0
movsd 0x8(%rsp), %xmm1
ucomisd %xmm0, %xmm1
movabsq $0x3ff0000000000000, %r15 # imm = 0x3FF0000000000000
jb 0xd152
movq %r15, (%r14)
callq 0x70d0
xorps %xmm0, %xmm0
cvtsi2sd %eax, %xmm0
divsd 0x3333a(%rip), %xmm0    # 0x404a0
movsd 0x8(%rsp), %xmm1
ucomisd %xmm0, %xmm1
jb 0xd175
movq %r15, (%rbx)
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/millanek[P]Dsuite/./Dsuite_utils.h
// Function: double vector_sum<std::deque<double, std::allocator<double>>>(std::deque<double, std::allocator<double>>)
double vector_sum(T vector) {
    double sum = 0;
    for (int i = 0; i < vector.size(); i++) {
        sum += vector[i];
    }
    return sum;
}

// Assembly:
movq 0x48(%rdi), %rcx
movq 0x28(%rdi), %rax
movq %rcx, %rdx
subq %rax, %rdx
shrq $0x3, %rdx
cmpq $0x1, %rcx
adcq $-0x1, %rdx
movq 0x30(%rdi), %rsi
subq 0x38(%rdi), %rsi
shlq $0x6, %rdx
sarq $0x3, %rsi
addq %rdx, %rsi
movq 0x10(%rdi), %rcx
movq 0x20(%rdi), %rdx
subq %rcx, %rdx
sarq $0x3, %rdx
addq %rsi, %rdx
je 0x14617
pushq %rbx
movq %rcx, %rsi
subq 0x18(%rdi), %rsi
sarq $0x3, %rsi
xorpd %xmm0, %xmm0
xorl %edi, %edi
movabsq $-0x400000000000000, %r8 # imm = 0xFC00000000000000
movq %rsi, %r9
movq %rcx, %r10
cmpq $0x40, %r9
jb 0x14601
leaq (%rsi,%rdi), %r10
movq %r9, %r11
shrq $0x6, %r11
leaq (%r11,%r8), %rbx
testq %r9, %r9
cmovgq %r11, %rbx
movq %rbx, %r11
shlq $0x6, %r11
subq %r11, %r10
shlq $0x3, %r10
addq (%rax,%rbx,8), %r10
addsd (%r10), %xmm0
incq %rdi
addq $0x8, %rcx
incq %r9
decq %rdx
jne 0x145d0
popq %rbx
retq
xorps %xmm0, %xmm0
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/millanek[P]Dsuite/./Dsuite_utils.h
// Function: TrioDinfo::addRegionDs(int)
void addRegionDs(const int arrangement) {
        switch (arrangement) {
            case P3isTrios2: if(localD1denom > 0) regionDs[0].push_back(localD1num/localD1denom); localD1num = 0; localD1denom = 0; usedVars[0] = 0; break;
            case P3isTrios1: if(localD2denom > 0) regionDs[1].push_back(localD2num/localD2denom); localD2num = 0; localD2denom = 0; usedVars[1] = 0; break;
            case P3isTrios0: if(localD3denom > 0) regionDs[2].push_back(localD3num/localD3denom); localD3num = 0; localD3denom = 0; usedVars[2] = 0; break;
        }
    }

// Assembly:
pushq %rbx
subq $0x10, %rsp
movq %rdi, %rbx
cmpl $0x9, %esi
je 0x1cd0a
cmpl $0x8, %esi
je 0x1ccc3
cmpl $0x7, %esi
jne 0x1cdca
movsd 0x180(%rbx), %xmm0
xorpd %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jbe 0x1cdad
movq 0x198(%rbx), %rdi
movsd 0x168(%rbx), %xmm1
divsd %xmm0, %xmm1
movsd %xmm1, 0x8(%rsp)
movq 0x8(%rdi), %rsi
cmpq 0x10(%rdi), %rsi
je 0x1cda3
movsd %xmm1, (%rsi)
addq $0x8, %rsi
movq %rsi, 0x8(%rdi)
jmp 0x1cdad
movsd 0x188(%rbx), %xmm0
xorpd %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jbe 0x1cd5b
movq 0x198(%rbx), %rdi
movsd 0x170(%rbx), %xmm1
divsd %xmm0, %xmm1
movsd %xmm1, 0x8(%rsp)
movq 0x20(%rdi), %rsi
cmpq 0x28(%rdi), %rsi
je 0x1cd4d
movsd %xmm1, (%rsi)
addq $0x8, %rsi
movq %rsi, 0x20(%rdi)
jmp 0x1cd5b
movsd 0x190(%rbx), %xmm0
xorpd %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jbe 0x1cd86
movq 0x198(%rbx), %rdi
movsd 0x178(%rbx), %xmm1
divsd %xmm0, %xmm1
movsd %xmm1, 0x8(%rsp)
movq 0x38(%rdi), %rsi
cmpq 0x40(%rdi), %rsi
je 0x1cd78
movsd %xmm1, (%rsi)
addq $0x8, %rsi
movq %rsi, 0x38(%rdi)
jmp 0x1cd86
addq $0x18, %rdi
leaq 0x8(%rsp), %rdx
callq 0xf076
xorl %eax, %eax
movq %rax, 0x170(%rbx)
movq %rax, 0x188(%rbx)
movq 0x1b0(%rbx), %rax
addq $0x4, %rax
jmp 0x1cdc4
addq $0x30, %rdi
leaq 0x8(%rsp), %rdx
callq 0xf076
xorl %eax, %eax
movq %rax, 0x178(%rbx)
movq %rax, 0x190(%rbx)
movq 0x1b0(%rbx), %rax
addq $0x8, %rax
jmp 0x1cdc4
leaq 0x8(%rsp), %rdx
callq 0xf076
xorl %eax, %eax
movq %rax, 0x168(%rbx)
movq %rax, 0x180(%rbx)
movq 0x1b0(%rbx), %rax
movl $0x0, (%rax)
addq $0x10, %rsp
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O1/millanek[P]Dsuite/./Dsuite_utils.h
// Function: TrioDinfo::calculateFinalDs()
void calculateFinalDs() {
        double* Ds = calculateThreeDs(ABBAtotal, BABAtotal, BBAAtotal);
        D1 = Ds[0]; D2 = Ds[1]; D3 = Ds[2];
        
        // Get the standard error values:
        double D1stdErr = jackknive_std_err(regionDs[0]); double D2stdErr = jackknive_std_err(regionDs[1]);
        double D3stdErr = jackknive_std_err(regionDs[2]);
        //std::cerr << "Here: " << regionDs[2][0] << std::endl;
        // Get the Z-scores
        D1_Z = std::fabs(D1)/D1stdErr; D2_Z = std::fabs(D2)/D2stdErr; D3_Z = std::fabs(D3)/D3stdErr;
        // And p-values
        D1_p = 2 * (1 - normalCDF(D1_Z)); D2_p = 2 * (1 - normalCDF(D2_Z));
        D3_p = 2 * (1 - normalCDF(D3_Z));
    }

// Assembly:
pushq %rbx
subq $0x10, %rsp
movq %rdi, %rbx
movsd (%rdi), %xmm0
movsd 0x8(%rdi), %xmm1
movsd 0x10(%rdi), %xmm2
callq 0xc716
movsd (%rax), %xmm0
movsd %xmm0, 0x18(%rbx)
movsd 0x8(%rax), %xmm0
movsd %xmm0, 0x20(%rbx)
movsd 0x10(%rax), %xmm0
movsd %xmm0, 0x28(%rbx)
movq 0x198(%rbx), %rdi
callq 0x1f56f
movsd %xmm0, 0x8(%rsp)
movq 0x198(%rbx), %rdi
addq $0x18, %rdi
callq 0x1f56f
movsd %xmm0, (%rsp)
movq 0x198(%rbx), %rdi
addq $0x30, %rdi
callq 0x1f56f
movsd 0x18(%rbx), %xmm1
movsd 0x20(%rbx), %xmm2
movsd 0x28(%rbx), %xmm3
movapd 0x23ca4(%rip), %xmm4    # 0x411f0
andpd %xmm4, %xmm1
divsd 0x8(%rsp), %xmm1
movsd %xmm1, 0x60(%rbx)
andpd %xmm4, %xmm2
divsd (%rsp), %xmm2
movsd %xmm2, 0x68(%rbx)
andpd %xmm4, %xmm3
divsd %xmm0, %xmm3
movsd %xmm3, 0x70(%rbx)
movapd %xmm1, %xmm0
callq 0x894c
fld1
fsubp %st, %st(1)
fadd %st, %st(0)
fstpt 0x30(%rbx)
movsd 0x68(%rbx), %xmm0
callq 0x894c
fld1
fsubp %st, %st(1)
fadd %st, %st(0)
fstpt 0x40(%rbx)
movsd 0x70(%rbx), %xmm0
callq 0x894c
fld1
fsubp %st, %st(1)
fadd %st, %st(0)
fstpt 0x50(%rbx)
addq $0x10, %rsp
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O1/millanek[P]Dsuite/./Dsuite_utils.h
// Function: TrioDinfo::assignBBAAarrangement()
void assignBBAAarrangement() {
        // Find which topology is in agreement with the counts of the BBAA, BABA, and ABBA patterns
        if (BBAAtotal >= BABAtotal && BBAAtotal >= ABBAtotal) {
            if (D1 >= 0) BBAAarrangement = P3isTrios2_Dpositive; else BBAAarrangement = P3isTrios2_Dnegative;
        } else if (BABAtotal >= BBAAtotal && BABAtotal >= ABBAtotal) {
            if (D2 >= 0) BBAAarrangement = P3isTrios1_Dpositive; else BBAAarrangement = P3isTrios1_Dnegative;
        } else if (ABBAtotal >= BBAAtotal && ABBAtotal >= BABAtotal) {
            if (D3 >= 0) BBAAarrangement = P3isTrios0_Dpositive; else BBAAarrangement = P3isTrios0_Dnegative;
        }
    }

// Assembly:
movsd 0x10(%rdi), %xmm2
movsd (%rdi), %xmm0
movsd 0x8(%rdi), %xmm1
ucomisd %xmm1, %xmm2
jb 0x1d5e8
ucomisd %xmm0, %xmm2
jb 0x1d5e8
movsd 0x18(%rdi), %xmm0
xorpd %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jae 0x1d634
movl $0x2, 0x1fc(%rdi)
retq
ucomisd %xmm2, %xmm1
jb 0x1d60e
ucomisd %xmm0, %xmm1
jb 0x1d60e
movsd 0x20(%rdi), %xmm0
xorpd %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jae 0x1d63f
movl $0x4, 0x1fc(%rdi)
retq
ucomisd %xmm2, %xmm0
jb 0x1d633
ucomisd %xmm1, %xmm0
jb 0x1d633
movsd 0x28(%rdi), %xmm0
xorpd %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jae 0x1d64a
movl $0x6, 0x1fc(%rdi)
retq
movl $0x1, 0x1fc(%rdi)
retq
movl $0x3, 0x1fc(%rdi)
retq
movl $0x5, 0x1fc(%rdi)
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/millanek[P]Dsuite/./Dsuite_utils.h
// Function: TrioDinfo::assignDminArrangement()
void assignDminArrangement() {
        
        if (std::fabs(D1) <= std::fabs(D2) && std::fabs(D1) <= std::fabs(D3)) {
            if (D1 >= 0) DminArrangement = P3isTrios2_Dpositive; else DminArrangement = P3isTrios2_Dnegative;
        } else if (std::fabs(D2) <= std::fabs(D1) && std::fabs(D2) <= std::fabs(D3)) { // (P3 == S2)
            if (D2 >= 0) DminArrangement = P3isTrios1_Dpositive; else DminArrangement = P3isTrios1_Dnegative;
        } else if (std::fabs(D3) <= std::fabs(D1) && std::fabs(D3) <= std::fabs(D2)) { // (P3 == S1)
            if (D3 >= 0) DminArrangement = P3isTrios0_Dpositive; else DminArrangement = P3isTrios0_Dnegative;
        }
        
    }

// Assembly:
movsd 0x18(%rdi), %xmm3
movsd 0x20(%rdi), %xmm2
movapd 0x22ca2(%rip), %xmm0    # 0x411f0
movapd %xmm3, %xmm1
andpd %xmm0, %xmm1
andpd %xmm2, %xmm0
ucomisd %xmm1, %xmm0
jb 0x1e573
movsd 0x28(%rdi), %xmm4
andpd 0x22c83(%rip), %xmm4    # 0x411f0
ucomisd %xmm1, %xmm4
jae 0x1e5be
ucomisd %xmm0, %xmm1
jb 0x1e58c
movsd 0x28(%rdi), %xmm3
andpd 0x22c6a(%rip), %xmm3    # 0x411f0
ucomisd %xmm0, %xmm3
jae 0x1e5d3
movsd 0x28(%rdi), %xmm2
movapd 0x22c57(%rip), %xmm3    # 0x411f0
andpd %xmm2, %xmm3
ucomisd %xmm3, %xmm1
jb 0x1e5bd
ucomisd %xmm3, %xmm0
jb 0x1e5bd
xorpd %xmm0, %xmm0
ucomisd %xmm0, %xmm2
jae 0x1e5e8
movl $0x6, 0x200(%rdi)
retq
xorpd %xmm0, %xmm0
ucomisd %xmm0, %xmm3
jae 0x1e5f3
movl $0x2, 0x200(%rdi)
retq
xorpd %xmm0, %xmm0
ucomisd %xmm0, %xmm2
jae 0x1e5fe
movl $0x4, 0x200(%rdi)
retq
movl $0x5, 0x200(%rdi)
retq
movl $0x1, 0x200(%rdi)
retq
movl $0x3, 0x200(%rdi)
retq
nop