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

```asm
<mesg_args>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x1000,%rsp
  orq    $0x0,(%rsp)
  sub    $0x1000,%rsp
  orq    $0x0,(%rsp)
  sub    $0x68,%rsp
  mov    %rdi,0x18(%rsp)
  mov    %rsi,0x20(%rsp)
  mov    %rdx,0x10(%rsp)
  mov    %ecx,%r14d
  mov    %r8b,0x2b(%rsp)
  mov    %r9d,%r13d
  movzbl 0x20a0(%rsp),%ebp
  mov    %fs:0x28,%rax
  mov    %rax,0x2058(%rsp)
  xor    %eax,%eax
  lea    0x50(%rsp),%r12
  mov    %rdi,%rdx
  mov    $0x2000,%esi
  mov    %r12,%rdi
  call   <strcpyn@plt>
  mov    $0x0,%ebx
  mov    $0x0,%r15d
  mov    $0x0,%ecx
  movl   $0x0,0xc(%rsp)
  mov    0x20a8(%rsp),%eax
  sub    $0x1,%eax
  mov    %eax,0x2c(%rsp)
  jmp    L80
L185:
  mov    0xc(%rsp),%eax
  test   %eax,%eax
  jle    L175
  mov    0x10(%rsp),%rsi
  mov    %rsi,%rbx
  lea    -0x1(%rax),%eax
  lea    0x8(%rsi,%rax,8),%rbp
L151:
  mov    (%rbx),%rdi
  call   <free@plt>
  add    $0x8,%rbx
  cmp    %rbp,%rbx
  jne    L151
  movl   $0xffffffff,0xc(%rsp)
  jmp    L54
L163:
  add    $0x1,%ebx
  jmp    L132
L190:
  xor    $0x1,%ecx
L132:
  add    $0x1,%ebx
  cmp    $0x1ffd,%ebx
  jg     L98
L80:
  movslq %ebx,%rax
  movzbl 0x50(%rsp,%rax,1),%eax
  test   %al,%al
  je     L185
  cmp    $0x5c,%al
  je     L163
  cmp    %bpl,%al
  je     L190
  test   %ecx,%ecx
  sete   %dl
  cmp    %r14b,%al
  jne    L34
  test   %dl,%dl
  jne    L64
L34:
  cmp    %r13b,%al
  jne    L153
  test   %dl,%dl
  jne    L204
L153:
  test   %r15d,%r15d
  setle  %sil
  test   %dl,%sil
  je     L132
  cmp    0x2b(%rsp),%al
  jne    L132
  mov    $0x0,%ecx
  mov    0xc(%rsp),%esi
  cmp    %esi,0x2c(%rsp)
  jle    L132
  movslq %ebx,%rax
  mov    %rax,0x30(%rsp)
  movb   $0x0,0x50(%rsp,%rax,1)
  movslq %esi,%rax
  mov    0x10(%rsp),%rdi
  lea    (%rdi,%rax,8),%rdi
  mov    %rdi,0x38(%rsp)
  mov    (%rdi),%rdi
  call   <free@plt>
  lea    0x50(%rsp),%rdi
  mov    %rdi,0x48(%rsp)
  sub    %r12,%rdi
  mov    0x30(%rsp),%rcx
  lea    0x1(%rdi,%rcx,1),%r11
  mov    %r11,0x40(%rsp)
  mov    %r11,%rdi
  call   <malloc@plt>
  mov    %rax,%rdi
  mov    0x38(%rsp),%r10
  mov    %rax,(%r10)
  addl   $0x1,0xc(%rsp)
  mov    %r12,%rdx
  mov    0x40(%rsp),%rsi
  call   <strcpyn@plt>
  mov    0x48(%rsp),%rsi
  mov    0x30(%rsp),%rcx
  lea    0x1(%rsi,%rcx,1),%r12
  mov    $0x0,%ecx
  jmp    L132
L64:
  add    $0x1,%r15d
  mov    $0x0,%ecx
  jmp    L132
L204:
  sub    $0x1,%r15d
  js     L35
  mov    $0x0,%ecx
  jmp    L132
L35:
  movslq %ebx,%rbx
  movb   $0x0,0x50(%rsp,%rbx,1)
  mov    0xc(%rsp),%r15d
  movslq %r15d,%rax
  mov    0x10(%rsp),%rcx
  lea    (%rcx,%rax,8),%r13
  mov    0x0(%r13),%rdi
  call   <free@plt>
  lea    0x50(%rsp),%rbp
  mov    %rbp,%rax
  sub    %r12,%rax
  lea    0x1(%rax,%rbx,1),%r14
  mov    %r14,%rdi
  call   <malloc@plt>
  mov    %rax,%rdi
  mov    %rax,0x0(%r13)
  add    $0x1,%r15d
  mov    %r15d,0xc(%rsp)
  mov    %r12,%rdx
  mov    %r14,%rsi
  call   <strcpyn@plt>
  lea    0x1(%rbp,%rbx,1),%r12
L98:
  movb   $0x0,0x204f(%rsp)
  mov    %r12,%rdx
  mov    0x20(%rsp),%rsi
  mov    0x18(%rsp),%rdi
  call   <strcpyn@plt>
L54:
  mov    0x2058(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L140
  mov    0xc(%rsp),%eax
  add    $0x2068,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L175:
  movl   $0xffffffff,0xc(%rsp)
  jmp    L54
L140:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
int mesg_args(char *wbuf, size_t maxlen, char **argv, char ulv, char sep, char dlv, char quot, int maxargs) {
  int argc = 0;
  char buf[((2048) * 4)];
  char *ptr;
  int litflag = 0;
  strcpyn(buf, sizeof(buf), wbuf);
  ptr = buf;
  for (int lev = 0, r = 0; (r < (((2048) * 4) - 2)); r++) {
    if (buf[r] == '\0') {
      for (int i = 0; i < argc; ++i) {
        free(argv[i]);
      }
      return (-1);
    } else if (buf[r] == '\\') {
      r++;
      continue;
    } else if (buf[r] == quot) {
      litflag = (!litflag);
    } else if (!litflag && buf[r] == ulv) {
      lev++;
      continue;
    } else if (!litflag && buf[r] == dlv) {
      lev--;
      if (lev < 0) {
        buf[r] = '\0';
        free(argv[argc]);
        argv[argc] = NULL;
        argv[argc] = malloc((size_t)((buf + r) - ptr) + 1);
        strcpyn(argv[argc++], (size_t)((buf + r) - ptr) + 1, ptr);
        ptr = buf + r + 1;
        break;
      }
      continue;
    } else if (!litflag && lev < 1 && buf[r] == sep) {
      if (argc < maxargs - 1) {
        buf[r] = '\0';
        free(argv[argc]);
        argv[argc] = NULL;
        argv[argc] = malloc((size_t)((buf + r) - ptr) + 1);
        strcpyn(argv[argc++], (size_t)((buf + r) - ptr) + 1, ptr);
        ptr = buf + r + 1;
      }
    }
  }
  buf[((2048) * 4) - 1] = '\0';
  strcpyn(wbuf, maxlen, ptr);
  return argc;
}
```