user: 请将以下的汇编代码转换成C语言代码:

```asm
<set_userdest>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x18,%rsp
  mov    %rdi,%rbx
  mov    %esi,0xc(%rsp)
  mov    %rdx,%rbp
  mov    %rcx,%r12
  mov    $0x0,%r14d
  cmpb   $0x40,(%rdi)
  jne    L74
L48:
  lea    0xc(%rsp),%r15
  mov    %r15,%rdx
  mov    %r12,%rsi
  mov    %rbx,%rdi
  call   <quotstrtok@plt>
  mov    %rax,%r13
  mov    %r15,%rdx
  mov    %r12,%rsi
  mov    %rbx,%rdi
  call   <quotstrtok@plt>
  mov    %rax,(%rsp)
  mov    %r15,%rdx
  mov    %r12,%rsi
  mov    %rbx,%rdi
  call   <quotstrtok@plt>
  mov    %rax,%rbx
  mov    %rbp,%rdx
  mov    %r13,%rsi
  mov    %r14,%rdi
  call   <fw_forward@plt>
  test   %rax,%rax
  jne    L34
  mov    %rbp,%rdi
  call   <fw_transparent_forward@plt>
  test   %rax,%rax
  jne    L6
  mov    %rbp,%rdi
  call   <fw_transparent@plt>
  test   %rax,%rax
  jne    L8
  mov    %rbp,%rdx
  mov    %rbx,%rsi
  mov    (%rsp),%rdi
  call   <fw_port_mode@plt>
  test   %rax,%rax
  jne    L43
  mov    %r14,%rdi
  call   <free@plt>
  mov    %r13,%rdi
  call   <free@plt>
  mov    (%rsp),%rdi
  call   <free@plt>
  mov    %rbx,%rdi
  call   <free@plt>
  mov    $0x0,%eax
L98:
  add    $0x18,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L74:
  lea    0xc(%rsp),%rdx
  mov    %rcx,%rsi
  call   <quotstrtok@plt>
  mov    %rax,%r14
  jmp    L48
L34:
  mov    %r14,%rdi
  call   <free@plt>
  mov    %r13,%rdi
  call   <free@plt>
  mov    (%rsp),%rdi
  call   <free@plt>
  mov    %rbx,%rdi
  call   <free@plt>
  mov    $0xfffffffe,%eax
  jmp    L98
L6:
  mov    %r14,%rdi
  call   <free@plt>
  mov    %r13,%rdi
  call   <free@plt>
  mov    (%rsp),%rdi
  call   <free@plt>
  mov    %rbx,%rdi
  call   <free@plt>
  mov    $0xfffffffe,%eax
  jmp    L98
L8:
  mov    %r14,%rdi
  call   <free@plt>
  mov    %r13,%rdi
  call   <free@plt>
  mov    (%rsp),%rdi
  call   <free@plt>
  mov    %rbx,%rdi
  call   <free@plt>
  mov    $0xfffffffe,%eax
  jmp    L98
L43:
  mov    %r14,%rdi
  call   <free@plt>
  mov    %r13,%rdi
  call   <free@plt>
  mov    (%rsp),%rdi
  call   <free@plt>
  mov    %rbx,%rdi
  call   <free@plt>
  mov    $0xfffffffe,%eax
  jmp    L98
```

assistant: ```c
int set_userdest(const char *buffer, int offset, struct clientinfo *clntinfo, const char *delimiters) {
  char *user, *host, *port, *mode;
  if (buffer[0] == '@') {
    user = (char *)0;
  } else {
    user = quotstrtok(buffer, delimiters, &offset);
  }
  host = quotstrtok(buffer, delimiters, &offset);
  port = quotstrtok(buffer, delimiters, &offset);
  mode = quotstrtok(buffer, delimiters, &offset);
  if (fw_forward(user, host, clntinfo) != 0) {
    free(user);
    free(host);
    free(port);
    free(mode);
    return (-2);
  }
  if (fw_transparent_forward(clntinfo) != 0) {
    free(user);
    free(host);
    free(port);
    free(mode);
    return (-2);
  }
  if (fw_transparent(clntinfo) != 0) {
    free(user);
    free(host);
    free(port);
    free(mode);
    return (-2);
  }
  if (fw_port_mode(port, mode, clntinfo) != 0) {
    free(user);
    free(host);
    free(port);
    free(mode);
    return (-2);
  }
  free(user);
  free(host);
  free(port);
  free(mode);
  return 0;
}
```