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

```asm
<user_write_client_msg>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  push   %rbx
  sub    $0x48,%rsp
  mov    %edi,-0x34(%rbp)
  mov    %esi,-0x38(%rbp)
  mov    %rdx,-0x40(%rbp)
  mov    %rcx,-0x48(%rbp)
  movl   $0x0,-0x24(%rbp)
  cmpq   $0x0,-0x48(%rbp)
  jne    L39
  mov    -0x40(%rbp),%rax
  mov    %rax,%rdi
  call   <strlen@plt>
  add    $0xa,%eax
  mov    %eax,-0x28(%rbp)
  jmp    L67
L39:
  mov    -0x40(%rbp),%rax
  mov    %rax,%rdi
  call   <strlen@plt>
  mov    %eax,%ebx
  mov    -0x48(%rbp),%rax
  mov    %rax,%rdi
  call   <strlen@plt>
  add    %ebx,%eax
  add    $0x14,%eax
  mov    %eax,-0x28(%rbp)
L67:
  mov    -0x28(%rbp),%eax
  mov    %eax,%edi
  call   <malloc@plt>
  mov    %rax,-0x18(%rbp)
  cmpl   $0x0,-0x38(%rbp)
  je     L9
  lea    D18(%rip),%rax
  mov    %rax,-0x20(%rbp)
  cmpl   $0x1,-0x38(%rbp)
  jne    L27
  lea    D11(%rip),%rax
  mov    %rax,-0x20(%rbp)
L27:
  cmpq   $0x0,-0x48(%rbp)
  jne    L50
  mov    -0x28(%rbp),%eax
  lea    -0x1(%rax),%esi
  mov    -0x20(%rbp),%rcx
  mov    -0x40(%rbp),%rdx
  mov    -0x18(%rbp),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <snprintf@plt>
  mov    %eax,-0x28(%rbp)
  jmp    L36
L50:
  mov    -0x28(%rbp),%eax
  lea    -0x1(%rax),%esi
  mov    -0x48(%rbp),%rdi
  mov    -0x20(%rbp),%rcx
  mov    -0x40(%rbp),%rdx
  mov    -0x18(%rbp),%rax
  mov    %rdi,%r8
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <snprintf@plt>
  mov    %eax,-0x28(%rbp)
  jmp    L36
L9:
  cmpq   $0x0,-0x48(%rbp)
  jne    L54
  mov    -0x28(%rbp),%eax
  lea    -0x1(%rax),%ecx
  mov    -0x40(%rbp),%rdx
  mov    -0x18(%rbp),%rax
  mov    %ecx,%esi
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <snprintf@plt>
  mov    %eax,-0x28(%rbp)
  jmp    L36
L54:
  mov    -0x28(%rbp),%eax
  lea    -0x1(%rax),%esi
  mov    -0x48(%rbp),%rcx
  mov    -0x40(%rbp),%rdx
  mov    -0x18(%rbp),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <snprintf@plt>
  mov    %eax,-0x28(%rbp)
L36:
  mov    -0x28(%rbp),%eax
  lea    0x1(%rax),%edx
  mov    -0x18(%rbp),%rcx
  mov    -0x34(%rbp),%eax
  mov    %rcx,%rsi
  mov    %eax,%edi
  call   <write@plt>
  test   %rax,%rax
  jle    L15
  movl   $0x1,-0x24(%rbp)
L15:
  mov    -0x18(%rbp),%rax
  mov    %rax,%rdi
  call   <free@plt>
  mov    -0x24(%rbp),%eax
  mov    -0x8(%rbp),%rbx
  leave
  ret
```

tool_calls: name: unpack_data
arguments: data_tag: D18
data_type: string
name: unpack_data
arguments: data_tag: D11
data_type: string

tool: D18: FAIL

tool: D11: OK

assistant: ```c
int user_write_client_msg(int fd, int status, const char *msg, char *add) {
  int len, ret = 0;
  char *st, *buff;
  if (add == NULL) {
    len = strlen(msg) + 10;
  } else {
    len = strlen(msg) + strlen(add) + 20;
  }
  buff = malloc(sizeof(char) * len);
  if (status) {
    st = "FAIL";
    if (status == 1) {
      st = "OK";
    }
    if (add == NULL) {
      len = snprintf(buff, len - 1, msg, st);
    } else {
      len = snprintf(buff, len - 1, msg, st, add);
    }
  } else {
    if (add == NULL) {
      len = snprintf(buff, len - 1, msg);
    } else {
      len = snprintf(buff, len - 1, msg, add);
    }
  }
  if (write(fd, buff, len + 1) > 0) {
    ret = 1;
  }
  free(buff);
  return ret;
}
```