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

```asm
<do_title_expn>:
  endbr64
  push   %r15
  xor    %r15d,%r15d
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  mov    %rdi,%rbp
  push   %rbx
  mov    %rdx,%rbx
  sub    $0x138,%rsp
  mov    %rcx,0x18(%rsp)
  mov    %fs:0x28,%rax
  mov    %rax,0x128(%rsp)
  xor    %eax,%eax
  lea    -0x1(%rsi),%eax
  movb   $0x0,(%rdi)
  mov    %eax,0x4(%rsp)
  mov    %eax,%r13d
  test   %eax,%eax
  jle    L398
L174:
  movzbl (%rbx),%eax
  test   %al,%al
  je     L398
L159:
  lea    0x1(%rbx),%r12
  cmp    $0x25,%al
  je     L468
  cmp    $0x5c,%al
  jne    L601
  test   %r15w,%r15w
  je     L357
L601:
  mov    0x4(%rsp),%edx
  sub    %r13d,%edx
  sub    $0x1,%r13d
  movslq %edx,%rdx
  mov    %al,0x0(%rbp,%rdx,1)
  movb   $0x0,0x1(%rbp,%rdx,1)
L450:
  mov    %r12,%rbx
  test   %r13d,%r13d
  jle    L398
  movzbl (%rbx),%eax
  xor    %r15d,%r15d
  test   %al,%al
  jne    L159
L398:
  xor    %eax,%eax
  test   %r13d,%r13d
  mov    0x4(%rsp),%ebx
  cmovns %r13d,%eax
  sub    %eax,%ebx
  movslq %ebx,%rbx
  movb   $0x0,0x0(%rbp,%rbx,1)
  mov    0x128(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L446
  add    $0x138,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopl   (%rax)
L468:
  test   %r15w,%r15w
  jne    L601
  movsbl 0x1(%rbx),%edi
  test   %dil,%dil
  je     L610
  cmp    $0x28,%dil
  jne    L319
L115:
  movsbl 0x2(%rbx),%edi
  test   %dil,%dil
  je     L122
L600:
  mov    0x18(%rsp),%rsi
  call   <title_expn_subs@plt>
  movzbl 0x3(%rbx),%esi
  mov    %rax,%r11
  test   %sil,%sil
  je     L566
L309:
  cmpb   $0x0,0x4(%rbx)
  lea    0x4(%rbx),%r14
  je     L218
L35:
  xor    %ecx,%ecx
  lea    0x20(%rsp),%r12
  test   %r11,%r11
  jne    L505
  jmp    L542
  nopl   0x0(%rax,%rax,1)
L15:
  add    $0x1,%rcx
L505:
  movslq %ecx,%rax
  test   %r15w,%r15w
  jne    L327
  cmp    %sil,(%r14)
  je     L557
L327:
  cmp    $0xfe,%rcx
  je     L459
L290:
  movzbl (%r14),%eax
  xor    %r15d,%r15d
  cmp    $0x5c,%al
  mov    %al,(%r12,%rcx,1)
  sete   %r15b
  add    $0x1,%r14
  cmpb   $0x0,(%r14)
  jne    L15
  lea    D58(%rip),%rdi
  mov    %rcx,0x10(%rsp)
  mov    %sil,0x8(%rsp)
  call   <fatal@plt>
  mov    0x10(%rsp),%rcx
  movzbl 0x8(%rsp),%esi
  jmp    L15
  nopl   0x0(%rax,%rax,1)
L357:
  mov    $0x1,%r15d
L401:
  mov    %r12,%rbx
  jmp    L174
  xchg   %ax,%ax
L319:
  mov    0x18(%rsp),%rsi
  call   <title_expn_subs@plt>
  mov    %rax,%r14
  test   %rax,%rax
  je     L131
  lea    -0x1(%r13),%edx
  mov    %rax,%rsi
  mov    %rbp,%rdi
  add    $0x1,%r12
  call   <strncat@plt>
  mov    %r14,%rdi
  call   <strlen@plt>
  sub    %eax,%r13d
  jmp    L450
  nopl   0x0(%rax)
L610:
  lea    D58(%rip),%rdi
  call   <fatal@plt>
  movsbl 0x1(%rbx),%edi
  cmp    $0x28,%dil
  je     L115
  jmp    L319
  nopl   0x0(%rax)
L459:
  lea    D95(%rip),%rdi
  mov    %rcx,0x10(%rsp)
  mov    %sil,0x8(%rsp)
  call   <fatal@plt>
  mov    0x10(%rsp),%rcx
  movzbl 0x8(%rsp),%esi
  jmp    L290
  nopl   (%rax)
L557:
  mov    %r14,%rbx
  movb   $0x0,0x20(%rsp,%rax,1)
  lea    D58(%rip),%r14
  jmp    L506
  nopl   0x0(%rax)
L29:
  lea    0x1(%rbx),%r15
  test   %al,%al
  je     L190
  mov    %eax,%esi
L162:
  mov    %r15,%rbx
L506:
  cmp    $0x29,%sil
  je     L56
L295:
  movzbl 0x1(%rbx),%eax
  cmp    $0x5c,%sil
  jne    L29
  test   %al,%al
  je     L599
L259:
  movzbl 0x2(%rbx),%esi
  lea    0x2(%rbx),%r15
  test   %sil,%sil
  jne    L162
  mov    %r14,%rdi
  call   <fatal@plt>
  movzbl 0x2(%rbx),%esi
  jmp    L162
  nopl   0x0(%rax)
L190:
  mov    %r14,%rdi
  call   <fatal@plt>
  movzbl 0x1(%rbx),%esi
  mov    %r15,%rbx
  cmp    $0x29,%sil
  jne    L295
  nopl   (%rax)
L56:
  movslq 0x4(%rsp),%r14
  movslq %r13d,%rax
  mov    0x18(%rsp),%rcx
  mov    %r12,%rdx
  mov    %r13d,%esi
  lea    0x1(%rbx),%r12
  sub    %rax,%r14
  add    %rbp,%r14
  mov    %r14,%rdi
  call   <do_title_expn>
  mov    %r14,%rdi
  call   <strlen@plt>
  sub    %eax,%r13d
  jmp    L450
  nopl   (%rax)
L599:
  mov    %r14,%rdi
  call   <fatal@plt>
  jmp    L259
  nopw   0x0(%rax,%rax,1)
L131:
  add    $0x1,%r12
  jmp    L401
  nopl   0x0(%rax)
L218:
  lea    D58(%rip),%rdi
  mov    %r11,0x10(%rsp)
  mov    %sil,0x8(%rsp)
  call   <fatal@plt>
  mov    0x10(%rsp),%r11
  movzbl 0x8(%rsp),%esi
  jmp    L35
  nopl   (%rax)
L566:
  lea    D58(%rip),%rdi
  mov    %rax,0x8(%rsp)
  call   <fatal@plt>
  movzbl 0x3(%rbx),%esi
  mov    0x8(%rsp),%r11
  jmp    L309
  nopw   0x0(%rax,%rax,1)
L122:
  lea    D58(%rip),%rdi
  call   <fatal@plt>
  movsbl 0x2(%rbx),%edi
  jmp    L600
  nopl   (%rax)
L542:
  movzbl 0x4(%rbx),%eax
  lea    D58(%rip),%r12
  jmp    L570
  nopl   (%rax)
L533:
  lea    0x1(%r14),%rbx
  test   %cl,%cl
  je     L213
  mov    %ecx,%eax
L154:
  mov    %rbx,%r14
L570:
  cmp    %sil,%al
  je     L404
L356:
  movzbl 0x1(%r14),%ecx
  cmp    $0x5c,%al
  jne    L533
  test   %cl,%cl
  je     L318
L625:
  movzbl 0x2(%r14),%eax
  lea    0x2(%r14),%rbx
  test   %al,%al
  jne    L154
  mov    %r12,%rdi
  mov    %sil,0x8(%rsp)
  call   <fatal@plt>
  movzbl 0x2(%r14),%eax
  movzbl 0x8(%rsp),%esi
  jmp    L154
  nopl   0x0(%rax)
L213:
  mov    %r12,%rdi
  mov    %sil,0x8(%rsp)
  call   <fatal@plt>
  movzbl 0x1(%r14),%eax
  movzbl 0x8(%rsp),%esi
  mov    %rbx,%r14
  cmp    %sil,%al
  jne    L356
L404:
  cmpb   $0x0,0x1(%r14)
  lea    0x1(%r14),%rbx
  je     L150
L94:
  movzbl 0x1(%r14),%ecx
  xor    %r15d,%r15d
  lea    0x20(%rsp),%r12
  jmp    L167
  nopl   (%rax)
L68:
  test   %cl,%cl
  je     L221
L142:
  mov    %r14,%rbx
L167:
  cmp    $0x29,%cl
  je     L428
L65:
  movslq %r15d,%rdx
  add    %r12,%rdx
  cmp    $0xfe,%r15d
  je     L240
L422:
  movzbl (%rbx),%eax
  movzbl 0x1(%rbx),%ecx
  add    $0x1,%r15d
  lea    0x1(%rbx),%r14
  mov    %al,(%rdx)
  cmp    $0x5c,%al
  jne    L68
  add    $0x1,%rdx
  test   %cl,%cl
  je     L415
  mov    %r14,%rbx
  cmp    $0xfe,%r15d
  jne    L422
L240:
  lea    D94(%rip),%rdi
  mov    %rdx,0x8(%rsp)
  call   <fatal@plt>
  mov    0x8(%rsp),%rdx
  jmp    L422
  nopl   0x0(%rax,%rax,1)
L221:
  lea    D58(%rip),%rdi
  call   <fatal@plt>
  movzbl 0x1(%rbx),%ecx
  jmp    L142
  nopw   0x0(%rax,%rax,1)
L415:
  lea    D58(%rip),%rdi
  mov    %r14,%rbx
  call   <fatal@plt>
  jmp    L65
  nopl   0x0(%rax)
L428:
  movslq %r15d,%r15
  movb   $0x0,0x20(%rsp,%r15,1)
  jmp    L56
  xchg   %ax,%ax
L318:
  mov    %r12,%rdi
  mov    %sil,0x8(%rsp)
  call   <fatal@plt>
  movzbl 0x8(%rsp),%esi
  jmp    L625
L150:
  lea    D58(%rip),%rdi
  call   <fatal@plt>
  jmp    L94
L446:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: retrieve_data
arguments: label: D58
type: string
name: retrieve_data
arguments: label: D95
type: string
name: retrieve_data
arguments: label: D94
type: string

tool: D58: Unexpected end of title expression

tool: D95: nasted trenary expression too long

tool: D94: trenary expression too long

assistant: ```c
void do_title_expn(char *dest, int size, const char *fmt, const struct file_tags *tags) {
  const char *h;
  int free = --size;
  short escape = 0;
  dest[0] = 0;
  while (free > 0 && *fmt) {
    if (*fmt == '%' && !escape) {
      if ((*++fmt) == '\0')
        fatal("Unexpected end of title expression");
      if (*fmt == '(') {
        char separator, expr[256];
        int expr_pos = 0;
        if ((*++fmt) == '\0')
          fatal("Unexpected end of title expression");
        h = title_expn_subs(*fmt, tags);
        if ((*++fmt) == '\0')
          fatal("Unexpected end of title expression");
        separator = *fmt;
        if ((*++fmt) == '\0')
          fatal("Unexpected end of title expression");
        if (h) {
          while (escape || *fmt != separator) {
            if (expr_pos == sizeof(expr) - 2)
              fatal("nasted trenary expression too long");
            expr[expr_pos++] = *fmt;
            if (*fmt == '\\')
              escape = 1;
            else
              escape = 0;
            if ((*++fmt) == '\0')
              fatal("Unexpected end of title expression");
          }
          expr[expr_pos] = '\0';
          while (escape || *fmt != ')') {
            if (escape)
              escape = 0;
            else if (*fmt == '\\')
              escape = 1;
            if ((*++fmt) == '\0')
              fatal("Unexpected end of title expression");
          }
        } else {
          while (escape || *fmt != separator) {
            if (escape)
              escape = 0;
            else if (*fmt == '\\')
              escape = 1;
            if ((*++fmt) == '\0')
              fatal("Unexpected end of title expression");
          }
          if ((*++fmt) == '\0')
            fatal("Unexpected end of title expression");
          while (escape || *fmt != ')') {
            if (expr_pos == sizeof(expr) - 2)
              fatal("trenary expression too long");
            expr[expr_pos++] = *fmt;
            if (*fmt == '\\')
              escape = 1;
            else
              escape = 0;
            if ((*++fmt) == '\0')
              fatal("Unexpected end of title expression");
          }
          expr[expr_pos] = '\0';
        }
        do_title_expn((dest + size - free), free, expr, tags);
        free -= strlen(dest + size - free);
      } else {
        h = title_expn_subs(*fmt, tags);
        if (h) {
          strncat(dest, h, free - 1);
          free -= strlen(h);
        }
      }
    } else if (*fmt == '\\' && !escape)
      escape = 1;
    else {
      dest[size - free] = *fmt;
      dest[size - free + 1] = 0;
      --free;
      escape = 0;
    }
    fmt++;
  }
  free = free < 0 ? 0 : free;
  dest[size - free] = '\0';
}
```