// File: romkatv[P]hcproxy/src/acceptor.cc
// Function: hcproxy::(anonymous namespace)::Resolve(char const*, unsigned short)
addrinfo* Resolve(const char* host, uint16_t port) {
  addrinfo* res;
  addrinfo hint = {};
  hint.ai_family = AF_INET;
  hint.ai_socktype = SOCK_STREAM;
  hint.ai_flags = AI_PASSIVE;
  int ret;
  CHECK((ret = getaddrinfo(host, std::to_string(port).c_str(), &hint, &res)) == 0)
      << gai_strerror(ret);
  CHECK(res->ai_addr->sa_family == AF_INET);
  return res;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x140, %rsp            # imm = 0x140
movw %si, %ax
movq %rdi, -0x8(%rbp)
movw %ax, -0xa(%rbp)
xorps %xmm0, %xmm0
movaps %xmm0, -0x30(%rbp)
movaps %xmm0, -0x40(%rbp)
movaps %xmm0, -0x50(%rbp)
movl $0x2, -0x4c(%rbp)
movl $0x1, -0x48(%rbp)
movl $0x1, -0x50(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0xf0(%rbp)
movzwl -0xa(%rbp), %esi
leaq -0x78(%rbp), %rdi
movq %rdi, -0xf8(%rbp)
callq 0x1da40
movq -0xf8(%rbp), %rdi
callq 0xb1320
movq -0xf0(%rbp), %rdi
movq %rax, %rsi
movb $0x0, -0xa9(%rbp)
leaq -0x50(%rbp), %rdx
leaq -0x18(%rbp), %rcx
callq 0x151e0
movl %eax, -0xe8(%rbp)
jmp 0x1cf7b
movl -0xe8(%rbp), %eax
movl %eax, -0x54(%rbp)
cmpl $0x0, %eax
jne 0x1cf8e
jmp 0x1d043
leaq 0xc73a8(%rip), %rsi     # 0xe433d
leaq -0xa8(%rbp), %rdi
movl $0x29, %edx
movl $0x3, %ecx
callq 0x194b0
jmp 0x1cfad
movb $0x1, -0xa9(%rbp)
leaq -0xa8(%rbp), %rdi
callq 0x194e0
movq %rax, -0x100(%rbp)
jmp 0x1cfc9
movq -0x100(%rbp), %rdi
leaq 0xc74cc(%rip), %rsi     # 0xe44a3
callq 0x1da10
movq %rax, -0x108(%rbp)
jmp 0x1cfe5
movq -0x108(%rbp), %rdi
leaq 0xcc398(%rip), %rsi     # 0xe938b
callq 0x19450
movq %rax, -0x110(%rbp)
jmp 0x1d001
movl -0x54(%rbp), %edi
callq 0x15870
movq -0x110(%rbp), %rdi
movq %rax, -0xb8(%rbp)
leaq -0xb8(%rbp), %rsi
callq 0x1db60
movq %rax, -0x118(%rbp)
jmp 0x1d02c
movq -0x118(%rbp), %rsi
leaq -0xb9(%rbp), %rdi
callq 0x194f0
jmp 0x1d041
jmp 0x1d043
testb $0x1, -0xa9(%rbp)
jne 0x1d04e
jmp 0x1d08f
leaq -0xa8(%rbp), %rdi
callq 0x19500
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x80(%rbp)
movl %eax, -0x84(%rbp)
jmp 0x1d168
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x80(%rbp)
movl %eax, -0x84(%rbp)
testb $0x1, -0xa9(%rbp)
jne 0x1d15a
jmp 0x1d166
leaq -0x78(%rbp), %rdi
callq 0xaf8e0
movq -0x18(%rbp), %rax
movq 0x18(%rax), %rax
movzwl (%rax), %eax
movb $0x0, -0xe1(%rbp)
cmpl $0x2, %eax
jne 0x1d0b4
jmp 0x1d143
leaq 0xc7282(%rip), %rsi     # 0xe433d
leaq -0xe0(%rbp), %rdi
movq %rdi, -0x128(%rbp)
movl $0x2b, %edx
movl $0x3, %ecx
callq 0x194b0
movq -0x128(%rbp), %rdi
movb $0x1, -0xe1(%rbp)
callq 0x194e0
movq %rax, -0x120(%rbp)
jmp 0x1d0f4
movq -0x120(%rbp), %rdi
leaq 0xc73eb(%rip), %rsi     # 0xe44ed
callq 0x1dba0
movq %rax, -0x130(%rbp)
jmp 0x1d110
movq -0x130(%rbp), %rdi
leaq 0xcc26d(%rip), %rsi     # 0xe938b
callq 0x19450
movq %rax, -0x138(%rbp)
jmp 0x1d12c
movq -0x138(%rbp), %rsi
leaq -0xe2(%rbp), %rdi
callq 0x194f0
jmp 0x1d141
jmp 0x1d143
testb $0x1, -0xe1(%rbp)
jne 0x1d14e
jmp 0x1d18d
leaq -0xe0(%rbp), %rdi
callq 0x19500
leaq -0xa8(%rbp), %rdi
callq 0x19500
jmp 0x1d168
leaq -0x78(%rbp), %rdi
callq 0xaf8e0
jmp 0x1d1a8
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x80(%rbp)
movl %eax, -0x84(%rbp)
testb $0x1, -0xe1(%rbp)
jne 0x1d19a
jmp 0x1d1a6
movq -0x18(%rbp), %rax
addq $0x140, %rsp            # imm = 0x140
popq %rbp
retq
leaq -0xe0(%rbp), %rdi
callq 0x19500
jmp 0x1d1a8
movq -0x80(%rbp), %rdi
callq 0xe1080
nopw %cs:(%rax,%rax)