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

```asm
<grabber_local_get>:
  endbr64
  push   %r15
  lea    D0(%rip),%rdx
  lea    D126(%rip),%rsi
  push   %r14
  movq   %rdx,%xmm0
  lea    D77(%rip),%rdx
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x498,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x488(%rsp)
  lea    D122(%rip),%rax
  movq   %rax,%xmm1
  lea    D57(%rip),%rax
  punpcklqdq %xmm1,%xmm0
  movq   %rax,%xmm2
  lea    D16(%rip),%rax
  movaps %xmm0,0x20(%rsp)
  movq   %rdx,%xmm0
  movq   %rax,%xmm3
  lea    D36(%rip),%rdx
  punpcklqdq %xmm2,%xmm0
  lea    D97(%rip),%rax
  movaps %xmm0,0x30(%rsp)
  movq   %rdx,%xmm0
  movq   %rax,%xmm4
  lea    D106(%rip),%rdx
  punpcklqdq %xmm3,%xmm0
  lea    D28(%rip),%rax
  movaps %xmm0,0x40(%rsp)
  movq   %rdx,%xmm0
  movq   %rax,%xmm5
  lea    D25(%rip),%rdx
  punpcklqdq %xmm4,%xmm0
  lea    D109(%rip),%rax
  movaps %xmm0,0x50(%rsp)
  movq   %rsi,%xmm0
  movq   %rax,%xmm6
  punpcklqdq %xmm5,%xmm0
  movaps %xmm0,0x60(%rsp)
  movq   %rdx,%xmm0
  punpcklqdq %xmm6,%xmm0
  movaps %xmm0,0x70(%rsp)
  test   %rdi,%rdi
  je     L24
  mov    $0x2f,%esi
  mov    %rdi,%rbx
  call   <strrchr@plt>
  mov    %rax,%r12
  test   %rax,%rax
  je     L24
  mov    %rbx,%rdi
  call   <strlen@plt>
  mov    %r12,%rdi
  mov    %eax,%ebp
  call   <strlen@plt>
  mov    %ebp,%esi
  mov    %rbx,%rdi
  sub    %eax,%esi
  call   <strndup@plt>
  mov    $0x2e,%esi
  mov    %rbx,%rdi
  mov    %rax,%rbp
  call   <strrchr@plt>
  mov    %rax,%r12
  test   %rax,%rax
  je     L131
  mov    %rbx,%rdi
  call   <strlen@plt>
  mov    %rbp,%rdi
  mov    %eax,%r13d
  call   <strlen@plt>
  mov    %r12,%rdi
  sub    %eax,%r13d
  call   <strlen@plt>
  mov    %rbp,%rdi
  mov    %eax,%r12d
  call   <strlen@plt>
  sub    %r12d,%r13d
  cltq
  lea    -0x1(%r13),%esi
  lea    D79(%rip),%r13
  lea    0x1(%rbx,%rax,1),%rdi
  lea    0x80(%rsp),%rbx
  call   <strndup@plt>
  mov    %rax,%r14
  lea    0x40(%rsp),%rax
  mov    %rax,%r15
  mov    %rax,0x10(%rsp)
  lea    0x90(%rsp),%rax
  mov    %r14,%rsi
  mov    %rax,(%rsp)
  mov    %rbp,%r14
  mov    %rax,%r12
  mov    %rsi,%rbp
  mov    %r15,0x8(%rsp)
L152:
  xor    %eax,%eax
  pxor   %xmm0,%xmm0
  mov    $0x7e,%ecx
  mov    %r12,%rdi
  mov    (%r15),%r9
  mov    %rbp,%r8
  mov    %r13,%rdx
  mov    $0x400,%esi
  movaps %xmm0,0x80(%rsp)
  rep stos %rax,%es:(%rdi)
  mov    %rbx,%rdi
  mov    %r14,%rcx
  call   <snprintf@plt>
  mov    %rbx,%rdi
  call   <vh_file_exists@plt>
  test   %rax,%rax
  jne    L92
  add    $0x8,%r15
  cmp    %r15,%rbx
  jne    L152
  mov    %rbp,%rax
  mov    %r14,%rbp
  mov    0x8(%rsp),%r12
  mov    0x10(%rsp),%r15
  mov    %rax,%r14
  lea    0x20(%rsp),%rax
  mov    %rax,0x8(%rsp)
  mov    %r14,0x18(%rsp)
L104:
  mov    0x8(%rsp),%r14
  mov    %rbp,%rax
  mov    %r14,%rbp
  mov    %rax,%r14
L103:
  mov    (%rsp),%rdi
  xor    %eax,%eax
  pxor   %xmm0,%xmm0
  mov    $0x7e,%ecx
  mov    (%r12),%r9
  mov    0x0(%rbp),%r8
  mov    %r13,%rdx
  mov    $0x400,%esi
  movaps %xmm0,0x80(%rsp)
  rep stos %rax,%es:(%rdi)
  mov    %rbx,%rdi
  mov    %r14,%rcx
  call   <snprintf@plt>
  mov    %rbx,%rdi
  call   <vh_file_exists@plt>
  test   %rax,%rax
  jne    L155
  add    $0x8,%rbp
  cmp    %rbp,%r15
  jne    L103
  add    $0x8,%r12
  mov    %r14,%rbp
  cmp    %rbx,%r12
  jne    L104
  mov    0x18(%rsp),%r14
  xor    %r12d,%r12d
  jmp    L99
  nopl   (%rax)
L24:
  xor    %r12d,%r12d
L70:
  mov    0x488(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L63
  add    $0x498,%rsp
  mov    %r12,%rax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nop
L155:
  mov    %rbx,%rdi
  mov    %r14,%rbp
  mov    0x18(%rsp),%r14
  call   <strdup@plt>
  mov    %rax,%r12
L99:
  test   %rbp,%rbp
  je     L77
  mov    %rbp,%rdi
  call   <free@plt>
L77:
  test   %r14,%r14
  je     L70
  mov    %r14,%rdi
  call   <free@plt>
  jmp    L70
  nop
L92:
  mov    %rbp,%rax
  mov    %rbx,%rdi
  mov    %r14,%rbp
  mov    %rax,%r14
  call   <strdup@plt>
  mov    %rax,%r12
  jmp    L99
  cs nopw 0x0(%rax,%rax,1)
L131:
  test   %rbp,%rbp
  je     L24
  mov    %rbp,%rdi
  call   <free@plt>
  jmp    L70
L63:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: read_data
arguments: data_label: D0
data_type: string
name: read_data
arguments: data_label: D126
data_type: string
name: read_data
arguments: data_label: D77
data_type: string
name: read_data
arguments: data_label: D122
data_type: string
name: read_data
arguments: data_label: D57
data_type: string
name: read_data
arguments: data_label: D16
data_type: string
name: read_data
arguments: data_label: D36
data_type: string
name: read_data
arguments: data_label: D97
data_type: string
name: read_data
arguments: data_label: D106
data_type: string
name: read_data
arguments: data_label: D28
data_type: string
name: read_data
arguments: data_label: D25
data_type: string
name: read_data
arguments: data_label: D109
data_type: string
name: read_data
arguments: data_label: D79
data_type: string

tool: D0: cover

tool: D126: png

tool: D77: front

tool: D122: COVER

tool: D57: FRONT

tool: D16: JPG

tool: D36: jpg

tool: D97: JPEG

tool: D106: jpeg

tool: D28: PNG

tool: D25: tbn

tool: D109: TBN

tool: D79: %s/%s.%s

assistant: ```c
char *grabber_local_get(const char *filename) {
  char *s, *dir = NULL, *file = NULL, *cv = NULL;
  unsigned int i, j;
  const char *known_filenames[] = {"cover", "COVER", "front", "FRONT"};
  const char *known_extensions[] = {"jpg", "JPG", "jpeg", "JPEG", "png", "PNG", "tbn", "TBN"};
  if (!filename)
    goto get_end;
  s = strrchr(filename, '/');
  if (!s)
    goto get_end;
  dir = strndup(filename, strlen(filename) - strlen(s));
  s = strrchr(filename, '.');
  if (!s)
    goto get_end;
  file = strndup(filename + strlen(dir) + 1, strlen(filename) - strlen(dir) - strlen(s) - 1);
  for (i = 0; i < (sizeof(known_extensions) / sizeof(known_extensions[0])); i++) {
    char cover[1024] = {0};
    snprintf(cover, sizeof(cover), "%s/%s.%s", dir, file, known_extensions[i]);
    if (vh_file_exists(cover)) {
      cv = strdup(cover);
      goto get_end;
    }
  }
  for (i = 0; i < (sizeof(known_extensions) / sizeof(known_extensions[0])); i++)
    for (j = 0; j < (sizeof(known_filenames) / sizeof(known_filenames[0])); j++) {
      char cover[1024] = {0};
      snprintf(cover, sizeof(cover), "%s/%s.%s", dir, known_filenames[j], known_extensions[i]);
      if (vh_file_exists(cover)) {
        cv = strdup(cover);
        goto get_end;
      }
    }
get_end:
  if (dir)
    free(dir);
  if (file)
    free(file);
  return cv;
}
```