// File: /workspace/github_cpp_makefile_star2_O1/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 $0x38, %rsp
movq %rsi, %r14
movq %rdi, %rbx
movl 0x18(%rdi), %edi
xorl %esi, %esi
xorl %edx, %edx
callq 0x55d0
movl %eax, 0x4(%rsp)
testl %eax, %eax
js 0xdea8
movq 0x28(%rbx), %r15
movq 0x30(%rbx), %rbp
movq %rbp, %r13
subq %r15, %r13
sarq $0x6, %r13
testq %r13, %r13
jle 0xdd2b
incq %r13
movq %r15, %rdi
callq 0xe614
testb %al, %al
jne 0xdd78
leaq 0x10(%r15), %r12
movq %r12, %rdi
callq 0xe614
testb %al, %al
jne 0xdd7b
leaq 0x20(%r15), %r12
movq %r12, %rdi
callq 0xe614
testb %al, %al
jne 0xdd7b
leaq 0x30(%r15), %r12
movq %r12, %rdi
callq 0xe614
testb %al, %al
jne 0xdd7b
addq $0x40, %r15
decq %r13
cmpq $0x1, %r13
jg 0xdcde
movq %rbp, %rax
subq %r15, %rax
sarq $0x4, %rax
cmpq $0x1, %rax
je 0xdd6a
cmpq $0x2, %rax
je 0xdd5a
movq %rbp, %r12
cmpq $0x3, %rax
jne 0xdd7b
movq %r15, %rdi
callq 0xe614
testb %al, %al
jne 0xdd78
addq $0x10, %r15
movq %r15, %rdi
callq 0xe614
testb %al, %al
jne 0xdd78
addq $0x10, %r15
movq %r15, %rdi
callq 0xe614
testb %al, %al
cmoveq %rbp, %r15
movq %r15, %r12
leaq 0x28(%rbx), %r15
cmpq %rbp, %r12
sete %al
leaq 0x10(%r12), %r13
cmpq %rbp, %r13
sete %cl
orb %al, %cl
jne 0xddce
movq %r13, %rdi
callq 0xe614
testb %al, %al
jne 0xddc5
movups (%r13), %xmm0
xorps %xmm1, %xmm1
movups %xmm1, (%r13)
movq 0x8(%r12), %rdi
movups %xmm0, (%r12)
testq %rdi, %rdi
je 0xddc1
callq 0x65e2
addq $0x10, %r12
addq $0x10, %r13
cmpq %rbp, %r13
jne 0xdd94
movq 0x30(%rbx), %rdx
movq %r15, %rdi
movq %r12, %rsi
callq 0xe8dc
leaq 0x10(%rsp), %rdi
movq $0x0, -0x8(%rdi)
leaq 0x8(%rsp), %r12
leaq 0x28(%rsp), %rdx
leaq 0x4(%rsp), %rcx
movq %r12, %rsi
callq 0xe998
movq (%r12), %rsi
movq %r12, %rdi
callq 0xea46
movq (%r12), %rcx
movq 0x8(%r12), %rax
movq %rcx, 0x18(%rsp)
movq %rax, 0x20(%rsp)
testq %rax, %rax
je 0xde3a
movq 0x8164(%rip), %rcx      # 0x15f90
cmpb $0x0, (%rcx)
je 0xde36
incl 0xc(%rax)
jmp 0xde3a
lock
incl 0xc(%rax)
leaq 0x18(%rsp), %rsi
movq %r14, %rdi
callq 0x996a
movq 0x20(%rsp), %rdi
testq %rdi, %rdi
je 0xde7d
movq 0x8138(%rip), %rax      # 0x15f90
cmpb $0x0, (%rax)
je 0xde68
movl 0xc(%rdi), %eax
leal -0x1(%rax), %ecx
movl %ecx, 0xc(%rdi)
jmp 0xde72
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
lock
xaddl %eax, 0xc(%rdi)
cmpl $0x1, %eax
jne 0xde7d
movq (%rdi), %rax
callq *0x18(%rax)
movq 0x8(%rsp), %rdi
movq 0x20(%rbx), %rsi
movq (%rdi), %rax
callq *0x10(%rax)
leaq 0x8(%rsp), %rsi
movq %r15, %rdi
callq 0xe848
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0xdea8
callq 0x65e2
addq $0x38, %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 0xdedc
leaq 0x28(%rsp), %r14
movq %rbx, %rsi
movq %r14, %rcx
callq 0x583d
movq (%r14), %rbx
jmp 0xdedc
movq %rax, %rbx
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0xdeeb
callq 0x65e2
movq %rbx, %rdi
callq 0x5200
nop