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

```asm
<mask_create2>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x140,%rsp
  mov    %rdi,-0x128(%rbp)
  mov    %rsi,-0x130(%rbp)
  mov    %rdx,-0x138(%rbp)
  mov    %ecx,-0x13c(%rbp)
  mov    %r8d,-0x140(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  cmpl   $0x1,-0x140(%rbp)
  je     L45
  lea    D24(%rip),%rax
  mov    %rax,%rcx
  mov    $0x4,%edx
  mov    $0x0,%esi
  mov    $0xffffffff,%edi
  call   <log_add@plt>
L45:
  mov    -0x130(%rbp),%rcx
  lea    -0x110(%rbp),%rax
  mov    $0x100,%edx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <strncpy@plt>
  mov    -0x128(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x7e,%al
  jne    L59
  addq   $0x1,-0x128(%rbp)
L59:
  lea    -0x110(%rbp),%rax
  mov    %rax,%rdi
  call   <strlen@plt>
  cltq
  lea    -0x1(%rax),%rdx
  lea    -0x110(%rbp),%rax
  add    %rdx,%rax
  mov    %rax,-0x118(%rbp)
  mov    -0x118(%rbp),%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  mov    %eax,%edi
  call   <isdigit@plt>
  test   %rax,%rax
  je     L92
  jmp    L74
L38:
  subq   $0x1,-0x118(%rbp)
L74:
  lea    -0x110(%rbp),%rax
  cmp    %rax,-0x118(%rbp)
  jbe    L66
  mov    -0x118(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x2e,%al
  jne    L38
L66:
  mov    -0x118(%rbp),%rax
  movb   $0x0,(%rax)
  lea    -0x110(%rbp),%rcx
  mov    -0x128(%rbp),%rdx
  mov    -0x13c(%rbp),%esi
  mov    -0x138(%rbp),%rax
  mov    %rcx,%r8
  mov    %rdx,%rcx
  lea    D34(%rip),%rdx
  mov    %rax,%rdi
  call   <snprintf@plt>
  jmp    L82
L92:
  lea    -0x110(%rbp),%rax
  mov    %rax,-0x118(%rbp)
  jmp    L18
L98:
  addq   $0x1,-0x118(%rbp)
L18:
  mov    -0x118(%rbp),%rax
  movzbl (%rax),%eax
  test   %al,%al
  je     L6
  mov    -0x118(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x2e,%al
  jne    L98
L6:
  mov    -0x118(%rbp),%rax
  mov    %rax,%rdi
  call   <strlen@plt>
  cmp    $0x4,%eax
  jg     L105
  lea    -0x110(%rbp),%rcx
  mov    -0x128(%rbp),%rdx
  mov    -0x13c(%rbp),%esi
  mov    -0x138(%rbp),%rax
  mov    %rcx,%r8
  mov    %rdx,%rcx
  lea    D20(%rip),%rdx
  mov    %rax,%rdi
  call   <snprintf@plt>
  jmp    L82
L105:
  mov    -0x118(%rbp),%rcx
  mov    -0x128(%rbp),%rdx
  mov    -0x13c(%rbp),%esi
  mov    -0x138(%rbp),%rax
  mov    %rcx,%r8
  mov    %rdx,%rcx
  lea    D28(%rip),%rdx
  mov    %rax,%rdi
  call   <snprintf@plt>
L82:
  mov    -0x138(%rbp),%rax
  mov    -0x8(%rbp),%rdx
  sub    %fs:0x28,%rdx
  je     L50
  call   <__stack_chk_fail@plt>
L50:
  leave
  ret
```

tool_calls: name: read_data
arguments: data_label: D24
type_infered: string
name: read_data
arguments: data_label: D34
type_infered: string
name: read_data
arguments: data_label: D20
type_infered: string
name: read_data
arguments: data_label: D28
type_infered: string

tool: D24: mask_create2: depth != 1 is not implemented.

tool: D34: *!*%s@%s.*

tool: D20: *!*%s@%s

tool: D28: *!*%s@*%s

assistant: ```c
char *mask_create2(char *user, char *_host, char *mask, int maxlen, int depth) {
  char host[256];
  char *p;
  if (depth != 1)
    log_add(-1, NULL, 0x00000004, "mask_create2: depth != 1 is not implemented.");
  strncpy(host, _host, 256);
  if (user[0] == '~')
    user++;
  p = host + strlen(host) - 1;
  if (isdigit(*p)) {
    while ((p > host) && (*p != '.'))
      p--;
    *p = 0;
    snprintf(mask, maxlen, "*!*%s@%s.*", user, host);
  } else {
    p = host;
    while ((*p) && (*p != '.'))
      p++;
    if (strlen(p) <= 4)
      snprintf(mask, maxlen, "*!*%s@%s", user, host);
    else
      snprintf(mask, maxlen, "*!*%s@*%s", user, p);
  }
  return mask;
}
```