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

```asm
<ShowRefs>:
  endbr64
  push   %r14
  push   %r13
  push   %r12
  mov    %rdi,%r12
  lea    D10(%rip),%rdi
  push   %rbp
  push   %rbx
  sub    $0x410,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x408(%rsp)
  xor    %eax,%eax
  mov    %rsp,%r13
  mov    %r13,%rsi
  call   <FixFilename@plt>
  mov    %r13,%rdi
  call   <strlen@plt>
  cltq
  cmpb   $0x2f,-0x1(%rsp,%rax,1)
  je     L3
  lea    D35(%rip),%rsi
  mov    %r13,%rdi
  call   <strcat@plt>
L3:
  lea    0x100(%rsp),%r14
  mov    %r12,%rsi
  mov    %r14,%rdi
  call   <strcpy@plt>
  mov    $0x2e,%esi
  mov    %r14,%rdi
  call   <strrchr@plt>
  test   %rax,%rax
  je     L6
  movb   $0x0,(%rax)
L6:
  lea    0x200(%rsp),%rbx
  mov    %r14,%rcx
  mov    %r13,%rdx
  lea    D43(%rip),%rsi
  mov    %rbx,%rdi
  call   <sprintf@plt>
  lea    D40(%rip),%rsi
  mov    %rbx,%rdi
  call   <fopen@plt>
  mov    %rax,%rbp
  test   %rax,%rax
  je     L81
  mov    %r12,%rsi
  mov    %rbx,%rdi
  call   <strcpy@plt>
  mov    $0x2e,%esi
  mov    %rbx,%rdi
  call   <strrchr@plt>
  test   %rax,%rax
  je     L88
  movb   $0x0,(%rax)
L88:
  mov    %rbx,%rsi
  lea    D11(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
  lea    D44(%rip),%r12
  jmp    L47
  nopl   0x0(%rax)
L108:
  mov    %rbp,%rdx
  mov    $0x1ff,%esi
  mov    %rbx,%rdi
  call   <fgets@plt>
  test   %rax,%rax
  jne    L23
L47:
  mov    %rbp,%rdi
  call   <feof@plt>
  test   %eax,%eax
  je     L108
  mov    %rbp,%rdi
  call   <fclose@plt>
  lea    D41(%rip),%rdi
  call   <puts@plt>
L81:
  mov    0x408(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L96
  add    $0x410,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  ret
L23:
  mov    %rbx,%rdi
  call   <strlen@plt>
  cltq
  lea    -0x1(%rbx,%rax,1),%rax
  cmpb   $0xa,(%rax)
  je     L50
  mov    %rbx,%rdx
  mov    %rbx,%rsi
  mov    %r12,%rdi
  xor    %eax,%eax
  call   <printf@plt>
  jmp    L47
  cs nopw 0x0(%rax,%rax,1)
L50:
  movb   $0x0,(%rax)
  mov    %rbx,%rdx
  mov    %rbx,%rsi
  mov    %r12,%rdi
  xor    %eax,%eax
  call   <printf@plt>
  jmp    L47
L96:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: parse_data
arguments: data_label: D10
type_infered: string
name: parse_data
arguments: data_label: D35
type_infered: string
name: parse_data
arguments: data_label: D43
type_infered: string
name: parse_data
arguments: data_label: D40
type_infered: string
name: parse_data
arguments: data_label: D11
type_infered: string
name: parse_data
arguments: data_label: D44
type_infered: string
name: parse_data
arguments: data_label: D41
type_infered: string

tool: D10: logs/

tool: D35: /

tool: D43: %s%s.ref

tool: D40: r

tool: D11: <h2>Reference URL's for %s.html</h2>
<ul>


tool: D44: <li><a href="%s">%s</a><br>


tool: D41: </ul><hr>

assistant: ```c
void ShowRefs(char *filename) {
  char logdir[256];
  char fn[256];
  char buf[512];
  FILE *fp;
  char *s;
  if ("logs/"[0] != '/')
    FixFilename("logs/", logdir);
  else
    strcpy(logdir, "logs/");
  s = logdir + strlen(logdir) - 1;
  if (*s != '/')
    strcat(logdir, "/");
  strcpy(fn, filename);
  s = strrchr(fn, '.');
  if (s)
    *s = '\0';
  sprintf(buf, "%s%s.ref", logdir, fn);
  fp = fopen(buf, "r");
  if (!fp)
    return;
  strcpy(buf, filename);
  s = strrchr(buf, '.');
  if (s)
    *s = '\0';
  printf("<h2>Reference URL's for %s.html</h2>\n<ul>\n", buf);
  while (!feof(fp)) {
    if (fgets(buf, 511, fp)) {
      s = buf + strlen(buf) - 1;
      if (*s == '\n')
        *s = '\0';
      printf("<li><a href=\"%s\">%s</a><br>\n", buf, buf);
    }
  }
  fclose(fp);
  puts("</ul><hr>");
}
```