user: 请显示与下面列出的汇编代码相匹配的C语言实现:

```asm
<ss_connect_to_ipv4_host_impl>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  mov    %rdi,%r13
  push   %r12
  mov    %rsi,%r12
  xor    %esi,%esi
  push   %rbp
  push   %rbx
  sub    $0x48,%rsp
  mov    %dx,(%rsp)
  lea    0x20(%rsp),%r15
  mov    $0x18,%edx
  mov    %ecx,0x4(%rsp)
  mov    %r15,%rdi
  mov    %fs:0x28,%rax
  mov    %rax,0x38(%rsp)
  xor    %eax,%eax
  call   <memset@plt>
  mov    D85(%rip),%rax
  mov    %r13,%rdi
  mov    (%rax),%eax
  mov    %eax,0x8(%rsp)
  mov    D2(%rip),%rax
  movd   0x8(%rsp),%xmm1
  movd   (%rax),%xmm0
  punpckldq %xmm1,%xmm0
  movq   %xmm0,0x30(%rsp)
  call   <Slock_object@plt>
  test   %r12,%r12
  je     L150
  mov    %r12,%rdi
  call   <Slock_object@plt>
  xor    %eax,%eax
  call   <Sdeactivate_thread@plt>
  lea    0x18(%rsp),%rcx
  mov    %r15,%rdx
  mov    %r12,%rsi
  mov    %r13,%rdi
  call   <getaddrinfo@plt>
  test   %rax,%rax
  jne    L66
  mov    0x18(%rsp),%r15
  test   %r15,%r15
  je     L66
L191:
  movzwl (%rsp),%eax
  mov    D10(%rip),%rbp
  mov    %eax,0x8(%rsp)
L107:
  mov    D2(%rip),%rax
  xor    %edx,%edx
  mov    (%rax),%esi
  mov    D85(%rip),%rax
  mov    (%rax),%edi
  call   <socket@plt>
  mov    %eax,%r14d
  cmp    $0xffffffff,%eax
  je     L17
  mov    D22(%rip),%rax
  mov    %r14d,%edi
  mov    (%rax),%esi
  xor    %eax,%eax
  call   <fcntl@plt>
  mov    D97(%rip),%rdx
  mov    %r14d,%edi
  or     (%rdx),%eax
  mov    %eax,%edx
  mov    D51(%rip),%rax
  mov    (%rax),%esi
  xor    %eax,%eax
  call   <fcntl@plt>
  mov    0x4(%rsp),%eax
  test   %eax,%eax
  je     L159
L189:
  cmpw   $0x0,(%rsp)
  mov    (%r15),%rbx
  je     L97
  jmp    L104
  cs nopw 0x0(%rax,%rax,1)
L127:
  mov    D103(%rip),%rax
  mov    0x0(%rbp),%edx
  cmp    (%rax),%edx
  jne    L143
L97:
  mov    $0x4,%edx
  mov    %rbx,%rsi
  mov    %r14d,%edi
  call   <connect@plt>
  cmp    $0xffffffff,%eax
  je     L127
  mov    0x0(%rbp),%ebx
  jmp    L46
  nopl   0x0(%rax,%rax,1)
L143:
  mov    D82(%rip),%rax
  mov    (%rax),%ebx
  cmp    %ebx,%edx
  jne    L240
L46:
  xor    %eax,%eax
  call   <Sactivate_thread@plt>
  mov    %r13,%rdi
  call   <Sunlock_object@plt>
  test   %r12,%r12
  je     L130
L137:
  mov    %r12,%rdi
  call   <Sunlock_object@plt>
L130:
  mov    0x18(%rsp),%rdi
  call   <freeaddrinfo@plt>
L112:
  mov    %ebx,0x0(%rbp)
  mov    0x38(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L109
  add    $0x48,%rsp
  mov    %r14d,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L150:
  xor    %eax,%eax
  call   <Sdeactivate_thread@plt>
  xor    %esi,%esi
  lea    0x18(%rsp),%rcx
  mov    %r15,%rdx
  mov    %r13,%rdi
  call   <getaddrinfo@plt>
  test   %rax,%rax
  jne    L131
  mov    0x18(%rsp),%r15
  test   %r15,%r15
  jne    L191
L131:
  mov    D10(%rip),%rbp
  xor    %eax,%eax
  mov    0x0(%rbp),%ebx
  call   <Sactivate_thread@plt>
  mov    %r13,%rdi
  call   <Sunlock_object@plt>
L73:
  mov    $0xffffffff,%r14d
  jmp    L112
  nopl   (%rax)
L159:
  mov    %r14d,%edi
  call   <ss_set_fd_non_blocking@plt>
  test   %eax,%eax
  jne    L189
  mov    %r14d,%edi
  mov    0x0(%rbp),%ebx
  call   <close@plt>
L15:
  xor    %eax,%eax
  mov    $0xfffffffe,%r14d
  call   <Sactivate_thread@plt>
  mov    %r13,%rdi
  call   <Sunlock_object@plt>
  test   %r12,%r12
  jne    L137
  jmp    L130
  xchg   %ax,%ax
L104:
  mov    0x8(%rsp),%edi
  call   <htons@plt>
  mov    %eax,(%rbx)
  jmp    L97
L240:
  mov    %r14d,%edi
  mov    %edx,0xc(%rsp)
  call   <close@plt>
  mov    0x8(%r15),%r15
  mov    0xc(%rsp),%edx
  test   %r15,%r15
  jne    L107
  xor    %eax,%eax
  mov    %edx,(%rsp)
  call   <Sactivate_thread@plt>
  mov    %r13,%rdi
  call   <Sunlock_object@plt>
  test   %r12,%r12
  mov    (%rsp),%edx
  je     L83
  mov    %edx,%ebx
  mov    $0xfffffffd,%r14d
  jmp    L137
L17:
  mov    0x0(%rbp),%ebx
  jmp    L15
L83:
  mov    0x18(%rsp),%rdi
  mov    $0xfffffffd,%r14d
  call   <freeaddrinfo@plt>
  mov    (%rsp),%ebx
  jmp    L112
L66:
  mov    D10(%rip),%rbp
  xor    %eax,%eax
  mov    0x0(%rbp),%ebx
  call   <Sactivate_thread@plt>
  mov    %r13,%rdi
  call   <Sunlock_object@plt>
  mov    %r12,%rdi
  call   <Sunlock_object@plt>
  jmp    L73
L109:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
int ss_connect_to_ipv4_host_impl(const char *address, const char *service, unsigned short port, int blocking) {
  struct addrinfo hints;
  memset(&hints, 0, sizeof(hints));
  hints.ai_family = AF_INET;
  hints.ai_socktype = SOCK_STREAM;
  Slock_object((void *)address);
  if (service)
    Slock_object((void *)service);
  Sdeactivate_thread();
  struct addrinfo *info;
  int saved_errno = 0;
  if (getaddrinfo(address, service, &hints, &info) || info == NULL) {
    saved_errno = errno;
    Sactivate_thread();
    Sunlock_object((void *)address);
    if (service)
      Sunlock_object((void *)service);
    errno = saved_errno;
    return -1;
  }
  int sock;
  struct addrinfo *tmp;
  int err = 0;
  for (tmp = info; tmp != NULL; tmp = tmp->ai_next) {
    err = 0;
    sock = socket(AF_INET, SOCK_STREAM, 0);
    if (sock == -1) {
      saved_errno = errno;
      err = -2;
      break;
    }
    fcntl(sock, F_SETFD, fcntl(sock, F_GETFD) | FD_CLOEXEC);
    if (!blocking && !(ss_set_fd_non_blocking(sock))) {
      saved_errno = errno;
      close(sock);
      err = -2;
      break;
    }
    struct sockaddr *in = tmp->ai_addr;
    if (port > 0)
      ((struct sockaddr_in *)in)->sin_port = htons(port);
    int res;
    do {
      res = connect(sock, in, sizeof(struct sockaddr_in));
    } while (res == -1 && errno == EINTR);
    saved_errno = errno;
    if (res == -1 && errno != EINPROGRESS) {
      close(sock);
      err = -3;
      continue;
    } else
      break;
  }
  Sactivate_thread();
  Sunlock_object((void *)address);
  if (service)
    Sunlock_object((void *)service);
  freeaddrinfo(info);
  errno = saved_errno;
  if (err)
    return err;
  return sock;
}
```