// File: romkatv[P]hcproxy/src/forwarder.cc
// Function: hcproxy::(anonymous namespace)::LinkEventHandler::New(hcproxy::EventLoop*, int, int, hcproxy::Forwarder::Options const&)
static void New(EventLoop* loop, int client_fd, int server_fd, const Forwarder::Options& opt) {
    LOG(INFO) << "Forwarding traffic: "
              << "[" << client_fd << "] (client)"
              << " <=> "
              << "[" << server_fd << "] (server)";
    auto* client = new LinkEventHandler(client_fd, "client");
    auto* server = new LinkEventHandler(server_fd, "server");
    if (!client->out_.Init(opt.server_to_client_buffer_size_bytes) ||
        !server->out_.Init(opt.client_to_server_buffer_size_bytes)) {
      for (auto* p : {client, server}) {
        LOG(INFO) << "[" << p->fd() << "] (" << p->name_ << ") close";
        CHECK(close(p->fd()) == 0) << Errno();
        p->readable_ = false;
        p->writable_ = false;
        delete p;
      }
      return;
    }
    client->other_ = server;
    server->other_ = client;
    client->IncRef();
    server->IncRef();
    loop->Add(client, EPOLLIN | EPOLLOUT | EPOLLET);
    loop->Add(server, EPOLLIN | EPOLLOUT | EPOLLET);
    client->out_.Write(kResponse);
  }

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x1b0, %rsp            # imm = 0x1B0
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movl %edx, -0x10(%rbp)
movq %rcx, -0x18(%rbp)
leaq 0xb70ec(%rip), %rsi     # 0xe4f7c
leaq -0x38(%rbp), %rdi
movq %rdi, -0x108(%rbp)
movl $0x97, %edx
xorl %ecx, %ecx
callq 0x1c360
movq -0x108(%rbp), %rdi
callq 0x194e0
movq %rax, %rdi
leaq 0xb70ee(%rip), %rsi     # 0xe4fab
callq 0x1c400
movq %rax, -0x100(%rbp)
jmp 0x2decb
movq -0x100(%rbp), %rdi
leaq 0xb6307(%rip), %rsi     # 0xe41e0
callq 0x1bb10
movq %rax, -0x110(%rbp)
jmp 0x2dee7
movq -0x110(%rbp), %rdi
leaq -0xc(%rbp), %rsi
callq 0x1bad0
movq %rax, -0x118(%rbp)
jmp 0x2df00
movq -0x118(%rbp), %rdi
leaq 0xb70b2(%rip), %rsi     # 0xe4fc0
callq 0x1c330
movq %rax, -0x120(%rbp)
jmp 0x2df1c
movq -0x120(%rbp), %rdi
leaq 0xb70a1(%rip), %rsi     # 0xe4fcb
callq 0x19560
movq %rax, -0x128(%rbp)
jmp 0x2df38
movq -0x128(%rbp), %rdi
leaq 0xb629a(%rip), %rsi     # 0xe41e0
callq 0x1bb10
movq %rax, -0x130(%rbp)
jmp 0x2df54
movq -0x130(%rbp), %rdi
leaq -0x10(%rbp), %rsi
callq 0x1bad0
movq %rax, -0x138(%rbp)
jmp 0x2df6d
movq -0x138(%rbp), %rdi
leaq 0xb7056(%rip), %rsi     # 0xe4fd1
callq 0x1c330
movq %rax, -0x140(%rbp)
jmp 0x2df89
movq -0x140(%rbp), %rsi
leaq -0x45(%rbp), %rdi
callq 0x194f0
leaq -0x38(%rbp), %rdi
callq 0x1c390
movl $0x60, %edi
callq 0x35bb0
movq %rax, %rdi
movq %rdi, %rax
movq %rax, -0x148(%rbp)
movl -0xc(%rbp), %esi
leaq 0xb7019(%rip), %rdx     # 0xe4fdc
callq 0x2e410
jmp 0x2dfca
movq -0x148(%rbp), %rax
movq %rax, -0x50(%rbp)
movl $0x60, %edi
callq 0x35bb0
movq %rax, %rdi
movq %rdi, %rax
movq %rax, -0x150(%rbp)
movl -0x10(%rbp), %esi
leaq 0xb6fed(%rip), %rdx     # 0xe4fe3
callq 0x2e410
jmp 0x2dffd
movq -0x150(%rbp), %rax
movq %rax, -0x58(%rbp)
movq -0x50(%rbp), %rdi
addq $0x40, %rdi
movq -0x18(%rbp), %rax
movq 0x8(%rax), %rsi
callq 0x2e490
testb $0x1, %al
jne 0x2e023
jmp 0x2e03f
movq -0x58(%rbp), %rdi
addq $0x40, %rdi
movq -0x18(%rbp), %rax
movq (%rax), %rsi
callq 0x2e490
testb $0x1, %al
jne 0x2e374
movq -0x50(%rbp), %rax
movq %rax, -0x80(%rbp)
movq -0x58(%rbp), %rax
movq %rax, -0x78(%rbp)
leaq -0x80(%rbp), %rax
movq %rax, -0x70(%rbp)
movq $0x2, -0x68(%rbp)
leaq -0x70(%rbp), %rax
movq %rax, -0x60(%rbp)
movq -0x60(%rbp), %rdi
callq 0x2eb10
movq %rax, -0x88(%rbp)
movq -0x60(%rbp), %rdi
callq 0x2eb30
movq %rax, -0x90(%rbp)
movq -0x88(%rbp), %rax
cmpq -0x90(%rbp), %rax
je 0x2e36f
movq -0x88(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x98(%rbp)
leaq 0xb6ec9(%rip), %rsi     # 0xe4f7c
leaq -0xb8(%rbp), %rdi
movq %rdi, -0x160(%rbp)
movl $0xa0, %edx
xorl %ecx, %ecx
callq 0x1c360
movq -0x160(%rbp), %rdi
callq 0x194e0
movq %rax, %rdi
leaq 0xb60fd(%rip), %rsi     # 0xe41e0
callq 0x1bb10
movq %rax, -0x158(%rbp)
jmp 0x2e0f1
movq -0x98(%rbp), %rdi
callq 0x1bb70
movl %eax, -0x164(%rbp)
jmp 0x2e105
movq -0x158(%rbp), %rdi
movl -0x164(%rbp), %eax
movl %eax, -0xbc(%rbp)
leaq -0xbc(%rbp), %rsi
callq 0x1bad0
movq %rax, -0x170(%rbp)
jmp 0x2e12d
movq -0x170(%rbp), %rdi
leaq 0xb6eaf(%rip), %rsi     # 0xe4fea
callq 0x22810
movq %rax, -0x178(%rbp)
jmp 0x2e149
movq -0x178(%rbp), %rdi
movq -0x98(%rbp), %rsi
addq $0x38, %rsi
callq 0x1db60
movq %rax, -0x180(%rbp)
jmp 0x2e169
movq -0x180(%rbp), %rdi
leaq 0xb6e77(%rip), %rsi     # 0xe4fee
callq 0x1ae20
movq %rax, -0x188(%rbp)
jmp 0x2e185
movq -0x188(%rbp), %rsi
leaq -0xbd(%rbp), %rdi
callq 0x194f0
leaq -0xb8(%rbp), %rdi
callq 0x1c390
movq -0x98(%rbp), %rdi
callq 0x1bb70
movl %eax, %edi
callq 0x15140
movb $0x0, -0xe1(%rbp)
cmpl $0x0, %eax
jne 0x2e1c8
jmp 0x2e262
leaq 0xb6dad(%rip), %rsi     # 0xe4f7c
leaq -0xe0(%rbp), %rdi
movq %rdi, -0x198(%rbp)
movl $0xa1, %edx
movl $0x3, %ecx
callq 0x194b0
movq -0x198(%rbp), %rdi
movb $0x1, -0xe1(%rbp)
callq 0x194e0
movq %rax, %rdi
leaq 0xb6ded(%rip), %rsi     # 0xe4ff6
callq 0x19620
movq %rax, -0x190(%rbp)
jmp 0x2e217
movq -0x190(%rbp), %rdi
leaq 0xbb166(%rip), %rsi     # 0xe938b
callq 0x19450
movq %rax, -0x1a0(%rbp)
jmp 0x2e233
callq 0x1c0c0
jmp 0x2e23a
movq -0x1a0(%rbp), %rdi
callq 0x1c050
movq %rax, -0x1a8(%rbp)
jmp 0x2e24f
movq -0x1a8(%rbp), %rsi
leaq -0xe4(%rbp), %rdi
callq 0x194f0
testb $0x1, -0xe1(%rbp)
jne 0x2e270
jmp 0x2e30e
leaq -0xe0(%rbp), %rdi
callq 0x19500
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0x38(%rbp), %rdi
callq 0x1c390
jmp 0x2e402
movq -0x148(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
movl $0x60, %esi
callq 0x34c20
jmp 0x2e402
movq -0x150(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
movl $0x60, %esi
callq 0x34c20
jmp 0x2e402
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0xb8(%rbp), %rdi
callq 0x1c390
jmp 0x2e402
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
testb $0x1, -0xe1(%rbp)
jne 0x2e35e
jmp 0x2e36a
movq -0x98(%rbp), %rax
movb $0x0, 0x50(%rax)
movq -0x98(%rbp), %rax
movb $0x0, 0x51(%rax)
movq -0x98(%rbp), %rax
movq %rax, -0x1b0(%rbp)
cmpq $0x0, %rax
je 0x2e345
movq -0x1b0(%rbp), %rdi
movq (%rdi), %rax
callq *0x18(%rax)
jmp 0x2e347
movq -0x88(%rbp), %rax
addq $0x8, %rax
movq %rax, -0x88(%rbp)
jmp 0x2e087
leaq -0xe0(%rbp), %rdi
callq 0x19500
jmp 0x2e402
jmp 0x2e3f9
movq -0x58(%rbp), %rcx
movq -0x50(%rbp), %rax
movq %rcx, 0x58(%rax)
movq -0x50(%rbp), %rcx
movq -0x58(%rbp), %rax
movq %rcx, 0x58(%rax)
movq -0x50(%rbp), %rdi
callq 0x31860
movq -0x58(%rbp), %rdi
callq 0x31860
movq -0x8(%rbp), %rdi
movq -0x50(%rbp), %rsi
movl $0x80000005, %edx       # imm = 0x80000005
callq 0x32bf0
movq -0x8(%rbp), %rdi
movq -0x58(%rbp), %rsi
movl $0x80000005, %edx       # imm = 0x80000005
callq 0x32bf0
movq -0x50(%rbp), %rdi
addq $0x40, %rdi
movq 0xfb347(%rip), %rax     # 0x129718
movq %rax, -0xf8(%rbp)
movq 0xfb341(%rip), %rax     # 0x129720
movq %rax, -0xf0(%rbp)
movq -0xf8(%rbp), %rsi
movq -0xf0(%rbp), %rdx
callq 0x2eb70
addq $0x1b0, %rsp            # imm = 0x1B0
popq %rbp
retq
movq -0x40(%rbp), %rdi
callq 0xe1080
nopl (%rax,%rax)