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

```asm
<short_lfn>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x40,%rsp
  mov    %rdi,-0x38(%rbp)
  mov    %rsi,-0x40(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  movq   $0x0,-0x11(%rbp)
  movb   $0x0,-0x9(%rbp)
  movl   $0x0,-0x15(%rbp)
  mov    -0x38(%rbp),%rax
  mov    $0x2e,%esi
  mov    %rax,%rdi
  call   <strrchr@plt>
  mov    %rax,-0x20(%rbp)
  cmpq   $0x0,-0x20(%rbp)
  je     L28
  mov    -0x20(%rbp),%rax
  cmp    -0x38(%rbp),%rax
  jne    L38
L28:
  mov    -0x38(%rbp),%rcx
  lea    -0x11(%rbp),%rax
  mov    $0x8,%edx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <strncpy@plt>
  movb   $0x0,-0x9(%rbp)
  mov    -0x38(%rbp),%rax
  mov    %rax,%rdi
  call   <strlen@plt>
  cmp    $0x8,%eax
  jle    L99
  mov    -0x38(%rbp),%rax
  lea    0x8(%rax),%rcx
  lea    -0x15(%rbp),%rax
  mov    $0x3,%edx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <strncpy@plt>
  movb   $0x0,-0x12(%rbp)
  jmp    L94
L99:
  movb   $0x0,-0x15(%rbp)
  jmp    L94
L38:
  mov    -0x20(%rbp),%rax
  sub    -0x38(%rbp),%rax
  mov    %eax,-0x2c(%rbp)
  cmpl   $0x8,-0x2c(%rbp)
  jle    L147
  movl   $0x8,-0x2c(%rbp)
L147:
  mov    -0x2c(%rbp),%edx
  mov    -0x38(%rbp),%rcx
  lea    -0x11(%rbp),%rax
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <strncpy@plt>
  mov    -0x2c(%rbp),%eax
  cltq
  movb   $0x0,-0x11(%rbp,%rax,1)
  mov    -0x20(%rbp),%rax
  lea    0x1(%rax),%rcx
  lea    -0x15(%rbp),%rax
  mov    $0x3,%edx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <strncpy@plt>
  movb   $0x0,-0x12(%rbp)
L94:
  lea    -0x11(%rbp),%rax
  mov    %rax,-0x28(%rbp)
  jmp    L86
L143:
  mov    -0x28(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x20,%al
  je     L104
  mov    -0x28(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x2e,%al
  jne    L4
L104:
  mov    -0x28(%rbp),%rax
  movb   $0x5f,(%rax)
L4:
  addq   $0x1,-0x28(%rbp)
L86:
  mov    -0x28(%rbp),%rax
  movzbl (%rax),%eax
  test   %al,%al
  jne    L143
  lea    -0x15(%rbp),%rax
  mov    %rax,-0x28(%rbp)
  jmp    L39
L56:
  mov    -0x28(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x20,%al
  je     L3
  mov    -0x28(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x2e,%al
  jne    L35
L3:
  mov    -0x28(%rbp),%rax
  movb   $0x5f,(%rax)
L35:
  addq   $0x1,-0x28(%rbp)
L39:
  mov    -0x28(%rbp),%rax
  movzbl (%rax),%eax
  test   %al,%al
  jne    L56
  lea    -0x11(%rbp),%rdx
  mov    -0x40(%rbp),%rax
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strcpy@plt>
  movzbl -0x15(%rbp),%eax
  test   %al,%al
  je     L22
  mov    -0x40(%rbp),%rax
  lea    D1(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strcat@plt>
  lea    -0x15(%rbp),%rdx
  mov    -0x40(%rbp),%rax
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strcat@plt>
L22:
  mov    -0x40(%rbp),%rax
  mov    -0x8(%rbp),%rdx
  sub    %fs:0x28,%rdx
  je     L87
  call   <__stack_chk_fail@plt>
L87:
  leave
  ret
```

tool_calls: name: parse_data
arguments: data_tag: D1
type_infered: string

tool: D1: .

assistant: ```c
char *short_lfn(const char *lfn, char *dos_name) {
  char name[9] = "", ext[4] = "";
  char *dot = strrchr(lfn, '.');
  if (dot == NULL || dot == lfn) {
    strncpy(name, lfn, 8);
    name[8] = '\0';
    if (strlen(lfn) > 8) {
      strncpy(ext, lfn + 8, 3);
      ext[3] = '\0';
    } else
      ext[0] = '\0';
  } else {
    int name_len = dot - lfn;
    if (name_len > 8)
      name_len = 8;
    strncpy(name, lfn, name_len);
    name[name_len] = '\0';
    strncpy(ext, dot + 1, 3);
    ext[3] = '\0';
  }
  {
    char *ptr;
    for (ptr = name; *ptr; ptr++)
      if (*ptr == ' ' || *ptr == '.')
        *ptr = '_';
    for (ptr = ext; *ptr; ptr++)
      if (*ptr == ' ' || *ptr == '.')
        *ptr = '_';
  }
  strcpy(dos_name, name);
  if (*ext) {
    strcat(dos_name, ".");
    strcat(dos_name, ext);
  }
  return dos_name;
}
```