user: 请将这段汇编代码片段转换成等效的C代码:

```asm
<szl_socket_new_server>:
  endbr64
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x50,%rsp
  mov    %rdi,%rbp
  mov    %rsi,%rdi
  mov    %rdx,%rsi
  mov    %fs:0x28,%rax
  mov    %rax,0x48(%rsp)
  xor    %eax,%eax
  movl   $0x1,0x4(%rsp)
  mov    D62(%rip),%rax
  mov    (%rax),%eax
  mov    D76(%rip),%rdx
  or     (%rdx),%eax
  mov    %eax,0x10(%rsp)
  mov    D24(%rip),%rax
  mov    (%rax),%eax
  mov    %eax,0x30(%rsp)
  mov    %ecx,0x14(%rsp)
  movq   $0x0,0x28(%rsp)
  movq   $0x0,0x18(%rsp)
  movq   $0x0,0x20(%rsp)
  movq   $0x0,0x40(%rsp)
  movq   $0x0,0x38(%rsp)
  lea    0x8(%rsp),%rcx
  lea    0x10(%rsp),%rdx
  call   <getaddrinfo@plt>
  test   %rax,%rax
  jne    L15
  mov    0x8(%rsp),%rax
  mov    0x18(%rax),%rdx
  mov    0x4(%rax),%esi
  mov    0x20(%rax),%edi
  call   <socket@plt>
  mov    %eax,%ebx
  test   %eax,%eax
  js     L14
  lea    0x4(%rsp),%rcx
  mov    $0x4,%r8d
  mov    D2(%rip),%rax
  mov    (%rax),%edx
  mov    D42(%rip),%rax
  mov    (%rax),%esi
  mov    %ebx,%edi
  call   <setsockopt@plt>
  test   %rax,%rax
  js     L3
  mov    0x8(%rsp),%rax
  mov    0x8(%rax),%rdx
  mov    0x10(%rax),%rsi
  mov    %ebx,%edi
  call   <bind@plt>
  test   %rax,%rax
  js     L67
  mov    0x8(%rsp),%rdi
  call   <freeaddrinfo@plt>
L12:
  mov    0x48(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L69
  mov    %ebx,%eax
  add    $0x50,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  ret
L14:
  mov    D70(%rip),%rax
  mov    (%rax),%ebx
  mov    0x8(%rsp),%rdi
  call   <freeaddrinfo@plt>
  mov    %ebx,%esi
  mov    %rbp,%rdi
  call   <szl_set_last_strerror@plt>
  mov    $0xffffffff,%ebx
  jmp    L12
L3:
  mov    D70(%rip),%rax
  mov    (%rax),%r12d
  mov    %ebx,%edi
  call   <close@plt>
  mov    0x8(%rsp),%rdi
  call   <freeaddrinfo@plt>
  mov    %r12d,%esi
  mov    %rbp,%rdi
  call   <szl_set_last_strerror@plt>
  mov    $0xffffffff,%ebx
  jmp    L12
L67:
  mov    D70(%rip),%rax
  mov    (%rax),%r12d
  mov    %ebx,%edi
  call   <close@plt>
  mov    0x8(%rsp),%rdi
  call   <freeaddrinfo@plt>
  mov    %r12d,%esi
  mov    %rbp,%rdi
  call   <szl_set_last_strerror@plt>
  mov    $0xffffffff,%ebx
  jmp    L12
L15:
  mov    $0xffffffff,%ebx
  jmp    L12
L69:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
int szl_socket_new_server(struct szl_interp *interp, const char *host, const char *service, const int type) {
  struct addrinfo hints, *res;
  int fd, one = 1, err;
  hints.ai_flags = AI_PASSIVE | AI_ADDRCONFIG;
  hints.ai_family = AF_UNSPEC;
  hints.ai_socktype = type;
  hints.ai_protocol = 0;
  hints.ai_addrlen = 0;
  hints.ai_addr = NULL;
  hints.ai_canonname = NULL;
  hints.ai_next = NULL;
  if (getaddrinfo(host, service, &hints, &res) != 0)
    return -1;
  fd = socket(res->ai_family, res->ai_socktype, res->ai_protocol);
  if (fd < 0) {
    err = errno;
    freeaddrinfo(res);
    szl_set_last_strerror(interp, err);
    return -1;
  }
  if (setsockopt(fd, SOL_SOCKET, SO_REUSEADDR, &one, sizeof(one)) < 0) {
    err = errno;
    close(fd);
    freeaddrinfo(res);
    szl_set_last_strerror(interp, err);
    return -1;
  }
  if (bind(fd, res->ai_addr, res->ai_addrlen) < 0) {
    err = errno;
    close(fd);
    freeaddrinfo(res);
    szl_set_last_strerror(interp, err);
    return -1;
  }
  freeaddrinfo(res);
  return fd;
}
```