// File: /workspace/github_cpp_makefile_star2_O3/Themaister[P]umusd/tcpcommand.cpp
// Function: TCPCommand::handle(EventHandler&)
void TCPCommand::handle(EventHandler &handler)
{
   int newfd = accept(fd, nullptr, nullptr);
   if (newfd < 0)
      return;
   
   connections.erase(std::remove_if(std::begin(connections), std::end(connections),
         [](std::shared_ptr<TCPSocket> sock) { return sock->dead(); }),
         connections.end());

   auto conn = std::make_shared<TCPSocket>(newfd);
   handler.add(conn);
   conn->set_remote(*remote);
   connections.push_back(conn);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movq %rsi, %r14
movq %rdi, %rbx
movl 0x18(%rdi), %edi
xorl %esi, %esi
xorl %edx, %edx
callq 0x55d0
movl %eax, 0x14(%rsp)
testl %eax, %eax
js 0xdffb
movq %r14, 0x8(%rsp)
leaq 0x28(%rbx), %rax
movq %rax, (%rsp)
movq 0x28(%rbx), %r12
movq 0x30(%rbx), %r14
movq %r14, %r15
subq %r12, %r15
movq %r15, %rbp
sarq $0x6, %rbp
testq %rbp, %rbp
jle 0xde76
incq %rbp
movq %r12, %rdi
callq 0xe7b6
testb %al, %al
jne 0xdeab
leaq 0x10(%r12), %r13
movq %r13, %rdi
callq 0xe7b6
testb %al, %al
jne 0xdeae
leaq 0x20(%r12), %r13
movq %r13, %rdi
callq 0xe7b6
testb %al, %al
jne 0xdeae
leaq 0x30(%r12), %r13
movq %r13, %rdi
callq 0xe7b6
testb %al, %al
jne 0xdeae
addq $0x40, %r12
decq %rbp
addq $-0x40, %r15
cmpq $0x1, %rbp
jg 0xde26
sarq $0x4, %r15
cmpq $0x1, %r15
movq 0x8(%rsp), %rbp
je 0xdecf
cmpq $0x2, %r15
je 0xdeb9
cmpq $0x3, %r15
jne 0xdf33
movq %r12, %rdi
callq 0xe7b6
testb %al, %al
movq (%rsp), %r15
jne 0xdee1
addq $0x10, %r12
jmp 0xdebd
movq %r12, %r13
movq (%rsp), %r15
movq 0x8(%rsp), %rbp
jmp 0xdee4
movq (%rsp), %r15
movq %r12, %rdi
callq 0xe7b6
testb %al, %al
jne 0xdee1
addq $0x10, %r12
jmp 0xded3
movq (%rsp), %r15
movq %r12, %rdi
callq 0xe7b6
testb %al, %al
cmoveq %r14, %r12
movq %r12, %r13
cmpq %r14, %r13
sete %al
leaq 0x10(%r13), %r12
cmpq %r14, %r12
sete %cl
orb %al, %cl
jne 0xdf3a
movq %r12, %rdi
callq 0xe7b6
testb %al, %al
jne 0xdf28
movups (%r12), %xmm0
xorps %xmm1, %xmm1
movups %xmm1, (%r12)
movq 0x8(%r13), %rdi
movups %xmm0, (%r13)
testq %rdi, %rdi
je 0xdf24
callq 0x69c2
addq $0x10, %r13
addq $0x10, %r12
cmpq %r14, %r12
jne 0xdef8
jmp 0xdf3a
movq %r14, %r13
movq (%rsp), %r15
movq 0x30(%rbx), %rdx
movq %r15, %rdi
movq %r13, %rsi
callq 0xea84
leaq 0x28(%rsp), %r12
leaq 0x38(%rsp), %rsi
leaq 0x14(%rsp), %rdx
movq %r12, %rdi
callq 0xeb44
movq (%r12), %rcx
movq 0x8(%r12), %rax
movq %rcx, 0x18(%rsp)
movq %rax, 0x20(%rsp)
testq %rax, %rax
je 0xdf8d
movq 0x8011(%rip), %rcx      # 0x15f90
cmpb $0x0, (%rcx)
je 0xdf89
incl 0xc(%rax)
jmp 0xdf8d
lock
incl 0xc(%rax)
leaq 0x18(%rsp), %rsi
movq %rbp, %rdi
callq 0x9c16
movq 0x20(%rsp), %rdi
testq %rdi, %rdi
je 0xdfd0
movq 0x7fe5(%rip), %rax      # 0x15f90
cmpb $0x0, (%rax)
je 0xdfbb
movl 0xc(%rdi), %eax
leal -0x1(%rax), %ecx
movl %ecx, 0xc(%rdi)
jmp 0xdfc5
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
lock
xaddl %eax, 0xc(%rdi)
cmpl $0x1, %eax
jne 0xdfd0
movq (%rdi), %rax
callq *0x18(%rax)
movq 0x28(%rsp), %rdi
movq 0x20(%rbx), %rsi
movq (%rdi), %rax
callq *0x10(%rax)
leaq 0x28(%rsp), %rsi
movq %r15, %rdi
callq 0xe9ea
movq 0x30(%rsp), %rdi
testq %rdi, %rdi
je 0xdffb
callq 0x69c2
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movq 0x20(%rsp), %rdi
testq %rdi, %rdi
je 0xe02f
leaq 0x38(%rsp), %r14
movq %rbx, %rsi
movq %r14, %rcx
callq 0x583b
movq (%r14), %rbx
jmp 0xe02f
movq %rax, %rbx
movq 0x30(%rsp), %rdi
testq %rdi, %rdi
je 0xe03e
callq 0x69c2
movq %rbx, %rdi
callq 0x5200