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

```asm
<mn_encode>:
  endbr64
  push   %r15
  movslq %ecx,%rcx
  push   %r14
  mov    %rdx,%r14
  push   %r13
  mov    %esi,%r13d
  push   %r12
  push   %rbp
  push   %rbx
  lea    (%rdx,%rcx,1),%rbx
  sub    $0x18,%rsp
  mov    %rdi,(%rsp)
  test   %r8,%r8
  je     L251
  cmpb   $0x0,(%r8)
  lea    D14(%rip),%rax
  cmovne %r8,%rax
  mov    %rax,0x8(%rsp)
  mov    %rax,%r15
L121:
  mov    %r13d,%edi
  xor    %r12d,%r12d
  call   <mn_words_required@plt>
  cmp    %r12d,%eax
  jle    L61
  nopw   0x0(%rax,%rax,1)
L186:
  cmp    %rbx,%r14
  jae    L250
  mov    %rbx,%rbp
  sub    %r14,%rbp
  add    %r15,%rbp
  jmp    L217
  nopl   0x0(%rax)
L148:
  call   <isletter@plt>
  test   %rax,%rax
  jne    L75
  mov    %r14,%rdi
  mov    %r15,%rsi
  movsb  %ds:(%rsi),%es:(%rdi)
  mov    %rsi,%r15
  mov    %rdi,%r14
  cmp    %rbp,%rsi
  je     L250
L217:
  movsbl (%r15),%edi
  test   %dil,%dil
  jne    L148
L198:
  movsbl -0x1(%r15),%edi
  call   <isletter@plt>
  test   %rax,%rax
  jne    L123
L114:
  mov    0x8(%rsp),%r15
  movzbl (%r15),%eax
  movsbl %al,%edi
  cmp    %r14,%rbx
  ja     L12
  jmp    L67
  nopl   0x0(%rax,%rax,1)
L79:
  call   <isletter@plt>
  test   %rax,%rax
  jne    L150
  mov    %r14,%rdi
  mov    %r15,%rsi
  movsb  %ds:(%rsi),%es:(%rdi)
  mov    %rdi,%r14
  cmp    %rdi,%rbx
  je     L100
  mov    %rsi,%r15
L12:
  movsbl (%r15),%edi
  test   %dil,%dil
  jne    L79
L67:
  call   <isletter@plt>
  test   %rax,%rax
  je     L45
L155:
  mov    (%rsp),%rdi
  mov    %r12d,%edx
  mov    %r13d,%esi
  call   <mn_encode_word@plt>
  mov    %rax,%rbp
  test   %rax,%rax
  jne    L163
  jmp    L250
  nopl   0x0(%rax)
L188:
  add    $0x1,%r15
L163:
  movsbl (%r15),%edi
  call   <isletter@plt>
  test   %rax,%rax
  jne    L188
  cmp    %rbx,%r14
  jb     L27
  jmp    L280
  nopl   0x0(%rax)
L209:
  add    $0x1,%r14
  add    $0x1,%rbp
  mov    %al,-0x1(%r14)
  cmp    %r14,%rbx
  je     L280
L27:
  movzbl 0x0(%rbp),%eax
  test   %al,%al
  jne    L209
L280:
  mov    %r13d,%edi
  add    $0x1,%r12d
  call   <mn_words_required@plt>
  cmp    %r12d,%eax
  jg     L186
L61:
  cmp    %rbx,%r14
  jae    L250
  movb   $0x0,(%r14)
  add    $0x18,%rsp
  xor    %eax,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L75:
  cmpb   $0x0,(%r15)
  jne    L155
  jmp    L198
  nop
L250:
  add    $0x18,%rsp
  mov    $0xfffffffe,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopl   0x0(%rax)
L123:
  mov    0x8(%rsp),%rax
  movsbl (%rax),%edi
  call   <isletter@plt>
  test   %rax,%rax
  je     L114
L45:
  add    $0x18,%rsp
  mov    $0xfffffff8,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopw   0x0(%rax,%rax,1)
L150:
  movsbl (%r15),%edi
  jmp    L67
  nopl   0x0(%rax)
L100:
  movsbl 0x1(%r15),%edi
  mov    %rsi,%r15
  jmp    L67
L251:
  lea    D14(%rip),%rax
  mov    %rax,0x8(%rsp)
  mov    %rax,%r15
  jmp    L121
```

tool_calls: name: parse_data
arguments: data_label: D14
data_type: string

tool: D14: x-x-x--

assistant: ```c
int mn_encode(void *src, int srcsize, char *dest, int destsize, char *format) {
  int n;
  char *fmt;
  char *destend = dest + destsize;
  const char *word;
  if (format == 0 || format[0] == '\0')
    format = "x-x-x--";
  fmt = format;
  for (n = 0; n < mn_words_required(srcsize); n++) {
    while (dest < destend && *fmt != '\0' && !isletter(*fmt))
      *dest++ = *fmt++;
    if (dest >= destend)
      return -2;
    if (*fmt == '\0') {
      if (isletter(fmt[-1]) && isletter(format[0]))
        return -8;
      fmt = format;
      while (dest < destend && *fmt != '\0' && !isletter(*fmt))
        *dest++ = *fmt++;
      if (!isletter(*fmt))
        return -8;
    }
    word = mn_encode_word(src, srcsize, n);
    if (word == 0)
      return -2;
    while (isletter(*fmt))
      fmt++;
    while (dest < destend && *word != '\0')
      *dest++ = *word++;
  }
  if (dest < destend)
    *dest++ = '\0';
  else
    return -2;
  return 0;
}
```