user: 请从给定的汇编指令推导出C源代码：

```asm
<gui_completion_build_list_template>:
  endbr64
  push   %r15
  push   %r14
  lea    D0(%rip),%r14
  push   %r13
  mov    %rdx,%r13
  push   %r12
  mov    %rdi,%r12
  mov    %rsi,%rdi
  push   %rbp
  xor    %ebp,%ebp
  push   %rbx
  mov    %rsi,%rbx
  sub    $0x18,%rsp
  call   <strdup@plt>
  mov    %rax,%r15
  jmp    L93
  nopl   0x0(%rax)
L92:
  test   $0xdf,%al
  je     L11
L35:
  movslq %ebp,%rdx
  add    $0x1,%ebp
  mov    %al,(%r15,%rdx,1)
L138:
  test   $0xdf,%al
  je     L91
L75:
  add    $0x1,%rbx
L93:
  movzbl (%rbx),%eax
  cmp    $0x25,%al
  je     L66
  jle    L92
  cmp    $0x7c,%al
  jne    L35
  test   %ebp,%ebp
  je     L75
  jmp    L37
  nopl   0x0(%rax)
L66:
  movzbl 0x1(%rbx),%eax
  lea    0x1(%rbx),%rdx
  test   %al,%al
  jne    L98
L91:
  add    $0x18,%rsp
  mov    %r15,%rdi
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  jmp    10b0 <free@plt>
  nopw   0x0(%rax,%rax,1)
L11:
  test   %ebp,%ebp
  je     L91
L37:
  movslq %ebp,%rbp
  mov    %r14,%rcx
  xor    %edx,%edx
  mov    %r15,%rsi
  mov    %r12,%rdi
  movb   $0x0,(%r15,%rbp,1)
  xor    %ebp,%ebp
  call   <gui_completion_list_add@plt>
  movzbl (%rbx),%eax
  jmp    L138
  nopl   0x0(%rax,%rax,1)
L98:
  cmp    $0x28,%al
  je     L114
  cmp    $0x2d,%al
  jne    L133
  mov    %r12,%rdi
  call   <gui_completion_stop@plt>
  jmp    L91
  nopw   0x0(%rax,%rax,1)
L133:
  mov    %rdx,%rbx
  jmp    L138
  nopl   0x0(%rax,%rax,1)
L114:
  lea    0x2(%rbx),%rdi
  mov    $0x29,%esi
  mov    %rdi,0x8(%rsp)
  call   <strchr@plt>
  mov    0x8(%rsp),%rdi
  test   %rax,%rax
  mov    %rax,%rcx
  je     L124
  cmp    %rax,%rdi
  jb     L187
L51:
  movzbl 0x1(%rcx),%eax
  lea    0x1(%rcx),%rbx
  jmp    L138
  nopw   0x0(%rax,%rax,1)
L124:
  movzbl 0x2(%rbx),%eax
  mov    %rdi,%rbx
  jmp    L138
  nopl   0x0(%rax)
L187:
  mov    %eax,%esi
  mov    %rax,0x8(%rsp)
  sub    %edi,%esi
  call   <string_strndup@plt>
  mov    0x8(%rsp),%rcx
  test   %rax,%rax
  mov    %rax,%rbx
  je     L51
  mov    %r13,%rdx
  mov    %rax,%rsi
  mov    %r12,%rdi
  call   <gui_completion_custom@plt>
  mov    %rbx,%rdi
  call   <free@plt>
  mov    0x8(%rsp),%rcx
  jmp    L51
```

tool_calls: name: unpack_data
arguments: data_label: D0
type_infered: string

tool: D0: 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);
}
```