// File: /workspace/github_cpp_makefile_star2_O3/romkatv[P]hcproxy/src/acceptor.cc
// Function: hcproxy::Acceptor::Accept()
int Acceptor::Accept() {
  while (true) {
    struct sockaddr addr = {};
    socklen_t addrlen = sizeof(addr);
    int conn = accept4(fd_, &addr, &addrlen, SOCK_NONBLOCK);
    if (conn >= 0) {
      CHECK(addrlen == sizeof(addr));
      CHECK(addr.sa_family == AF_INET);
      LOG(INFO) << "[" << conn << "] accepted connection from " << IpPort(addr);
      SetSockOpt(conn, IPPROTO_TCP, TCP_NODELAY);
      return conn;
    }
    LOG(ERROR) << "accept4() failed: " << Errno();
    CHECK(errno == EMFILE || errno == ENFILE || errno == ENOBUFS || errno == ENOMEM) << Errno();
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movq %rdi, %r14
xorps %xmm0, %xmm0
leaq 0x30(%rsp), %rsi
movaps %xmm0, (%rsi)
leaq 0xc(%rsp), %rdx
movl $0x10, (%rdx)
movl (%rdi), %edi
movl $0x800, %ecx            # imm = 0x800
callq 0x15650
testl %eax, %eax
jns 0x19b8e
leaq 0x10(%rsp), %r12
leaq 0xb5938(%rip), %r13     # 0xcf431
leaq 0x30(%rsp), %rbp
leaq 0xc(%rsp), %r15
movq %r12, %rdi
leaq 0xb581b(%rip), %rsi     # 0xcf328
movl $0x4e, %edx
movl $0x2, %ecx
callq 0x2003c
movq 0x28(%rsp), %rdi
movl $0x12, %edx
movq %r13, %rsi
callq 0x8b8f0
movl 0x10(%rsp), %esi
movq 0x28(%rsp), %rdi
callq 0x200db
movq %r12, %rdi
callq 0x19d7a
callq 0x15640
movl (%rax), %eax
cmpl $0x18, %eax
ja 0x19b5a
movl $0x1801000, %ecx        # imm = 0x1801000
btl %eax, %ecx
jb 0x19b63
cmpl $0x69, %eax
jne 0x19c43
xorps %xmm0, %xmm0
movaps %xmm0, 0x30(%rsp)
movl $0x10, 0xc(%rsp)
movl (%r14), %edi
movq %rbp, %rsi
movq %r15, %rdx
movl $0x800, %ecx            # imm = 0x800
callq 0x15650
testl %eax, %eax
js 0x19b03
movl %eax, %ebx
cmpl $0x10, 0xc(%rsp)
jne 0x19c9b
cmpw $0x2, 0x30(%rsp)
jne 0x19ce6
leaq 0xb577a(%rip), %rsi     # 0xcf328
leaq 0x10(%rsp), %r14
movq %r14, %rdi
movl $0x4a, %edx
xorl %ecx, %ecx
callq 0x2003c
movq 0x18(%r14), %rdi
leaq 0xb5576(%rip), %rsi     # 0xcf143
movl $0x1, %edx
callq 0x8b8f0
movq 0x28(%rsp), %rdi
movl %ebx, %esi
callq 0x8c1c0
movq 0x28(%rsp), %rdi
leaq 0xb5826(%rip), %rsi     # 0xcf415
movl $0x1b, %edx
callq 0x8b8f0
leaq 0x40(%rsp), %rdi
leaq 0x30(%rsp), %rsi
callq 0x1bd94
movq 0x28(%rsp), %rdi
leaq 0x40(%rsp), %rsi
callq 0x1be91
leaq 0x10(%rsp), %rdi
callq 0x1959e
movl %ebx, %edi
movl $0x6, %esi
movl $0x1, %edx
callq 0x199ad
movl %ebx, %eax
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0xb56de(%rip), %rsi     # 0xcf328
leaq 0x10(%rsp), %rbx
movq %rbx, %rdi
movl $0x4f, %edx
movl $0x3, %ecx
callq 0x2003c
movq 0x18(%rbx), %rdi
leaq 0xb57d8(%rip), %rsi     # 0xcf444
movl $0x49, %edx
callq 0x8b8f0
movq 0x28(%rsp), %rdi
leaq 0xba649(%rip), %rsi     # 0xd42cb
movl $0x2, %edx
callq 0x8b8f0
leaq 0x10(%rsp), %rdi
callq 0x19d65
jmp 0x19d37
leaq 0xb5686(%rip), %rsi     # 0xcf328
leaq 0x10(%rsp), %rbx
movq %rbx, %rdi
movl $0x48, %edx
movl $0x3, %ecx
callq 0x2003c
movq 0x18(%rbx), %rdi
leaq 0xb571f(%rip), %rsi     # 0xcf3e3
movl $0x17, %edx
callq 0x8b8f0
movq 0x28(%rsp), %rdi
leaq 0xba5f1(%rip), %rsi     # 0xd42cb
movl $0x2, %edx
callq 0x8b8f0
jmp 0x19d37
leaq 0xb563b(%rip), %rsi     # 0xcf328
leaq 0x10(%rsp), %rbx
movq %rbx, %rdi
movl $0x49, %edx
movl $0x3, %ecx
callq 0x2003c
movq 0x18(%rbx), %rdi
leaq 0xb56ec(%rip), %rsi     # 0xcf3fb
movl $0x19, %edx
callq 0x8b8f0
movq 0x28(%rsp), %rdi
leaq 0xba5a6(%rip), %rsi     # 0xd42cb
movl $0x2, %edx
callq 0x8b8f0
jmp 0x19d37
jmp 0x19d37
jmp 0x19d37
jmp 0x19d41
leaq 0x10(%rsp), %rdi
callq 0x18a24
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
callq 0x1959e
jmp 0x19d5d
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
callq 0x19d7a
movq %rbx, %rdi
callq 0xcc750