user: 提供的汇编代码用C语言表示会是什么样子：

```asm
<gui_completion_build_list_template>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x18,%rsp
  mov    %rdi,%r13
  mov    %rsi,%rbx
  mov    %rdx,0x8(%rsp)
  mov    %rsi,%rdi
  call   <strdup@plt>
  mov    %rax,%r12
  mov    $0x0,%ebp
  lea    D6(%rip),%r14
  jmp    L201
L20:
  cmp    $0x7c,%al
  jne    L194
  test   %ebp,%ebp
  jg     L147
  mov    $0x0,%ebp
  jmp    L127
L72:
  lea    0x1(%rbx),%rdx
  movzbl 0x1(%rbx),%eax
  test   %al,%al
  je     L181
  cmp    $0x28,%al
  je     L124
  cmp    $0x2d,%al
  jne    L42
  mov    %r13,%rdi
  call   <gui_completion_stop@plt>
  mov    %r12,%rdi
  call   <free@plt>
  jmp    L58
L124:
  add    $0x2,%rbx
  mov    $0x29,%esi
  mov    %rbx,%rdi
  call   <strchr@plt>
  mov    %rax,%r15
  test   %rax,%rax
  je     L190
  cmp    %rax,%rbx
  jb     L138
L142:
  lea    0x1(%r15),%rbx
  jmp    L190
L138:
  mov    %eax,%esi
  sub    %ebx,%esi
  mov    %rbx,%rdi
  call   <string_strndup@plt>
  mov    %rax,%rbx
  test   %rax,%rax
  je     L142
  mov    0x8(%rsp),%rdx
  mov    %rax,%rsi
  mov    %r13,%rdi
  call   <gui_completion_custom@plt>
  mov    %rbx,%rdi
  call   <free@plt>
  jmp    L142
L181:
  mov    %rdx,%rbx
L190:
  testb  $0xdf,(%rbx)
  je     L174
L127:
  add    $0x1,%rbx
L201:
  movzbl (%rbx),%eax
  cmp    $0x25,%al
  je     L72
  jg     L20
  test   $0xdf,%al
  je     L196
L194:
  movslq %ebp,%rdx
  mov    %al,(%r12,%rdx,1)
  lea    0x1(%rbp),%ebp
  jmp    L190
L42:
  mov    %rdx,%rbx
  jmp    L190
L174:
  mov    %r12,%rdi
  call   <free@plt>
L58:
  add    $0x18,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L196:
  test   %ebp,%ebp
  jle    L174
L147:
  movslq %ebp,%rbp
  movb   $0x0,(%r12,%rbp,1)
  mov    %r14,%rcx
  mov    $0x0,%edx
  mov    %r12,%rsi
  mov    %r13,%rdi
  call   <gui_completion_list_add@plt>
  mov    $0x0,%ebp
  jmp    L190
```

tool_calls: name: unpack_data
arguments: label: D6
type: string

tool: D6: sort

assistant: ```c
void gui_completion_build_list_template(struct t_gui_completion *completion, const char *template, struct t_dogechat_plugin *plugin) {
  char *word, *custom_completion;
  const char *pos, *pos_end;
  int word_offset;
  word = strdup(template);
  word_offset = 0;
  pos = template;
  while (pos) {
    switch (pos[0]) {
    case '\0':
    case ' ':
    case '|':
      if (word_offset > 0) {
        word[word_offset] = '\0';
        gui_completion_list_add(completion, word, 0, "sort");
      }
      word_offset = 0;
      break;
    case '%':
      pos++;
      if (pos && pos[0]) {
        switch (pos[0]) {
        case '-':
          gui_completion_stop(completion);
          free(word);
          return;
          break;
        case '*':
          break;
        case '(':
          pos++;
          pos_end = strchr(pos, ')');
          if (pos_end) {
            if (pos_end > pos) {
              custom_completion = string_strndup(pos, pos_end - pos);
              if (custom_completion) {
                gui_completion_custom(completion, custom_completion, plugin);
                free(custom_completion);
              }
            }
            pos = pos_end + 1;
          }
        }
      }
      break;
    default:
      word[word_offset++] = pos[0];
    }
    if (!pos[0] || (pos[0] == ' '))
      pos = NULL;
    else
      pos++;
  }
  free(word);
}
```