// File: romkatv[P]hcproxy/src/acceptor.cc
// Function: hcproxy::Acceptor::Acceptor(hcproxy::Acceptor::Options const&)
Acceptor::Acceptor(const Options& opt) {
  addrinfo* addr = Resolve(opt.listen_addr.c_str(), opt.listen_port);
  LOG(INFO) << "Listening on " << IpPort(*addr);
  CHECK((fd_ = socket(addr->ai_family, SOCK_STREAM, 0)) >= 0) << Errno();
  SetSockOpt(fd_, SOL_SOCKET, SO_REUSEADDR);
  CHECK(bind(fd_, addr->ai_addr, addr->ai_addrlen) == 0) << Errno();
  CHECK(listen(fd_, opt.accept_queue_size) == 0) << Errno();
  freeaddrinfo(addr);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x170, %rsp            # imm = 0x170
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0xe8(%rbp)
movq -0x10(%rbp), %rdi
callq 0xb1320
movq %rax, %rdi
movq -0x10(%rbp), %rax
movzwl 0x20(%rax), %esi
callq 0x1cef0
movq %rax, -0x18(%rbp)
leaq 0xc785b(%rip), %rsi     # 0xe433d
leaq -0x38(%rbp), %rdi
movq %rdi, -0xe0(%rbp)
movl $0x38, %edx
xorl %ecx, %ecx
callq 0x1c360
movq -0xe0(%rbp), %rdi
callq 0x194e0
movq %rax, -0xd8(%rbp)
jmp 0x1cb0e
movq -0xd8(%rbp), %rdi
leaq 0xc7831(%rip), %rsi     # 0xe434d
callq 0x19590
movq %rax, -0xf0(%rbp)
jmp 0x1cb2a
movq -0x18(%rbp), %rsi
leaq -0x50(%rbp), %rdi
callq 0x24f60
jmp 0x1cb39
movq -0xf0(%rbp), %rdi
leaq -0x50(%rbp), %rsi
callq 0x1d880
movq %rax, -0xf8(%rbp)
jmp 0x1cb52
movq -0xf8(%rbp), %rsi
leaq -0x51(%rbp), %rdi
callq 0x194f0
jmp 0x1cb64
leaq -0x38(%rbp), %rdi
callq 0x1c390
movq -0x18(%rbp), %rax
movl 0x4(%rax), %edi
movl $0x1, %esi
xorl %edx, %edx
callq 0x155d0
movq -0xe8(%rbp), %rcx
movl %eax, (%rcx)
movb $0x0, -0x79(%rbp)
cmpl $0x0, %eax
jl 0x1cb97
jmp 0x1cc39
leaq 0xc779f(%rip), %rsi     # 0xe433d
leaq -0x78(%rbp), %rdi
movq %rdi, -0x108(%rbp)
movl $0x39, %edx
movl $0x3, %ecx
callq 0x194b0
movq -0x108(%rbp), %rdi
movb $0x1, -0x79(%rbp)
callq 0x194e0
movq %rax, -0x100(%rbp)
jmp 0x1cbd1
movq -0x100(%rbp), %rdi
leaq 0xc777c(%rip), %rsi     # 0xe435b
callq 0x1d8b0
movq %rax, -0x110(%rbp)
jmp 0x1cbed
movq -0x110(%rbp), %rdi
leaq 0xcc790(%rip), %rsi     # 0xe938b
callq 0x19450
movq %rax, -0x118(%rbp)
jmp 0x1cc09
callq 0x1c0c0
jmp 0x1cc10
movq -0x118(%rbp), %rdi
callq 0x1c050
movq %rax, -0x120(%rbp)
jmp 0x1cc25
movq -0x120(%rbp), %rsi
leaq -0x7c(%rbp), %rdi
callq 0x194f0
jmp 0x1cc37
jmp 0x1cc39
testb $0x1, -0x79(%rbp)
jne 0x1cc41
jmp 0x1cc7f
leaq -0x78(%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 0x1cee3
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
testb $0x1, -0x79(%rbp)
jne 0x1cd87
jmp 0x1cd90
movq -0xe8(%rbp), %rax
movl (%rax), %edi
movl $0x1, %esi
movl $0x2, %edx
callq 0x1d1c0
movq -0xe8(%rbp), %rax
movl (%rax), %edi
movq -0x18(%rbp), %rax
movq 0x18(%rax), %rsi
movq -0x18(%rbp), %rax
movl 0x10(%rax), %edx
callq 0x15800
movb $0x0, -0xa1(%rbp)
cmpl $0x0, %eax
jne 0x1ccc5
jmp 0x1cd70
leaq 0xc7671(%rip), %rsi     # 0xe433d
leaq -0xa0(%rbp), %rdi
movq %rdi, -0x130(%rbp)
movl $0x3b, %edx
movl $0x3, %ecx
callq 0x194b0
movq -0x130(%rbp), %rdi
movb $0x1, -0xa1(%rbp)
callq 0x194e0
movq %rax, -0x128(%rbp)
jmp 0x1cd05
movq -0x128(%rbp), %rdi
leaq 0xc767d(%rip), %rsi     # 0xe4390
callq 0x1d8e0
movq %rax, -0x138(%rbp)
jmp 0x1cd21
movq -0x138(%rbp), %rdi
leaq 0xcc65c(%rip), %rsi     # 0xe938b
callq 0x19450
movq %rax, -0x140(%rbp)
jmp 0x1cd3d
callq 0x1c0c0
jmp 0x1cd44
movq -0x140(%rbp), %rdi
callq 0x1c050
movq %rax, -0x148(%rbp)
jmp 0x1cd59
movq -0x148(%rbp), %rsi
leaq -0xa4(%rbp), %rdi
callq 0x194f0
jmp 0x1cd6e
jmp 0x1cd70
testb $0x1, -0xa1(%rbp)
jne 0x1cd7b
jmp 0x1cdb3
leaq -0xa0(%rbp), %rdi
callq 0x19500
leaq -0x78(%rbp), %rdi
callq 0x19500
jmp 0x1cee3
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
testb $0x1, -0xa1(%rbp)
jne 0x1ce9e
jmp 0x1ceaa
movq -0xe8(%rbp), %rax
movl (%rax), %edi
movq -0x10(%rbp), %rax
movq 0x28(%rax), %rax
movl %eax, %esi
callq 0x153d0
movb $0x0, -0xc9(%rbp)
cmpl $0x0, %eax
jne 0x1cddc
jmp 0x1ce87
leaq 0xc755a(%rip), %rsi     # 0xe433d
leaq -0xc8(%rbp), %rdi
movq %rdi, -0x158(%rbp)
movl $0x3c, %edx
movl $0x3, %ecx
callq 0x194b0
movq -0x158(%rbp), %rdi
movb $0x1, -0xc9(%rbp)
callq 0x194e0
movq %rax, -0x150(%rbp)
jmp 0x1ce1c
movq -0x150(%rbp), %rdi
leaq 0xc7596(%rip), %rsi     # 0xe43c0
callq 0x1d910
movq %rax, -0x160(%rbp)
jmp 0x1ce38
movq -0x160(%rbp), %rdi
leaq 0xcc545(%rip), %rsi     # 0xe938b
callq 0x19450
movq %rax, -0x168(%rbp)
jmp 0x1ce54
callq 0x1c0c0
jmp 0x1ce5b
movq -0x168(%rbp), %rdi
callq 0x1c050
movq %rax, -0x170(%rbp)
jmp 0x1ce70
movq -0x170(%rbp), %rsi
leaq -0xcc(%rbp), %rdi
callq 0x194f0
jmp 0x1ce85
jmp 0x1ce87
testb $0x1, -0xc9(%rbp)
jne 0x1ce92
jmp 0x1cec3
leaq -0xc8(%rbp), %rdi
callq 0x19500
leaq -0xa0(%rbp), %rdi
callq 0x19500
jmp 0x1cee3
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
testb $0x1, -0xc9(%rbp)
jne 0x1ced5
jmp 0x1cee1
movq -0x18(%rbp), %rdi
callq 0x15380
addq $0x170, %rsp            # imm = 0x170
popq %rbp
retq
leaq -0xc8(%rbp), %rdi
callq 0x19500
jmp 0x1cee3
movq -0x40(%rbp), %rdi
callq 0xe1080
nopl (%rax)