user: What is the c source code of the assembly code below?

```asm
<a_article_search>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  push   %rbx
  sub    $0x8c8,%rsp
  mov    %rdi,-0x8b8(%rbp)
  mov    %rsi,-0x8c0(%rbp)
  mov    %rdx,-0x8c8(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x18(%rbp)
  xor    %eax,%eax
  movabs $0x73656d614e2e2f,%rax
  mov    %rax,-0x898(%rbp)
  mov    -0x8b8(%rbp),%rdx
  lea    -0x420(%rbp),%rax
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strcpy@plt>
  lea    -0x898(%rbp),%rdx
  lea    -0x420(%rbp),%rax
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strcat@plt>
  lea    -0x420(%rbp),%rax
  lea    D113(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <fopen@plt>
  mov    %rax,-0x8a8(%rbp)
  cmpq   $0x0,-0x8a8(%rbp)
  je     L93
  jmp    L104
L55:
  lea    -0x620(%rbp),%rax
  mov    $0x50,%esi
  mov    %rax,%rdi
  call   <bzero@plt>
  mov    -0x8b8(%rbp),%rdx
  lea    -0x620(%rbp),%rax
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strcpy@plt>
  mov    -0x8a8(%rbp),%rdx
  lea    -0x720(%rbp),%rax
  mov    $0x80,%esi
  mov    %rax,%rdi
  call   <fgets@plt>
  lea    -0x720(%rbp),%rax
  mov    $0x5,%edx
  lea    D31(%rip),%rcx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <strncmp@plt>
  test   %rax,%rax
  jne    L159
  mov    -0x8a8(%rbp),%rdx
  lea    -0x6a0(%rbp),%rax
  mov    $0x80,%esi
  mov    %rax,%rdi
  call   <fgets@plt>
  lea    -0x720(%rbp),%rax
  add    $0x2b,%rax
  lea    D51(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strstr@plt>
  test   %rax,%rax
  jne    L205
  lea    -0x720(%rbp),%rax
  add    $0x2b,%rax
  lea    D6(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strstr@plt>
  test   %rax,%rax
  jne    L205
  lea    -0x720(%rbp),%rax
  add    $0x5,%rax
  lea    D48(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strstr@plt>
  test   %rax,%rax
  jne    L205
  lea    -0x6a0(%rbp),%rax
  mov    $0x5,%edx
  lea    D105(%rip),%rcx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <strncmp@plt>
  test   %rax,%rax
  jne    L181
  lea    -0x6a0(%rbp),%rax
  mov    $0x7,%edx
  lea    D67(%rip),%rcx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <strncmp@plt>
  test   %rax,%rax
  jne    L40
  lea    -0x6a0(%rbp),%rax
  add    $0x7,%rax
  lea    -0x770(%rbp),%rcx
  mov    $0x50,%edx
  mov    %rax,%rsi
  mov    %rcx,%rdi
  call   <strncpy@plt>
  jmp    L64
L40:
  lea    -0x6a0(%rbp),%rax
  add    $0x5,%rax
  lea    -0x770(%rbp),%rcx
  mov    $0x50,%edx
  mov    %rax,%rsi
  mov    %rcx,%rdi
  call   <strncpy@plt>
L64:
  movb   $0x0,-0x721(%rbp)
L181:
  lea    -0x620(%rbp),%rax
  lea    D109(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strcat@plt>
  lea    -0x770(%rbp),%rdx
  lea    -0x620(%rbp),%rax
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strcat@plt>
  lea    -0x620(%rbp),%rax
  mov    %rax,%rdi
  call   <strlen@plt>
  sub    $0x1,%eax
  cltq
  movb   $0x0,-0x620(%rbp,%rax,1)
  lea    -0x8ac(%rbp),%rdx
  lea    -0x620(%rbp),%rax
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <lstat@plt>
  mov    -0x8ac(%rbp),%eax
  mov    %eax,%edi
  call   <S_ISDIR@plt>
  test   %rax,%rax
  je     L84
  mov    -0x8a8(%rbp),%rdx
  lea    -0x7b0(%rbp),%rax
  mov    $0x14,%esi
  mov    %rax,%rdi
  call   <fgets@plt>
  lea    -0x7b0(%rbp),%rax
  mov    $0x5,%edx
  lea    D122(%rip),%rcx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <strncmp@plt>
  test   %rax,%rax
  jne    L200
  lea    -0x7b0(%rbp),%rax
  mov    %rax,%rdi
  call   <strlen@plt>
  sub    $0x1,%eax
  cltq
  movb   $0x0,-0x7b0(%rbp,%rax,1)
L200:
  lea    -0x7b0(%rbp),%rax
  add    $0x5,%rax
  mov    -0x8c8(%rbp),%rdx
  lea    -0x520(%rbp),%rdi
  mov    %rax,%rcx
  lea    D56(%rip),%rax
  mov    %rax,%rsi
  call   <sprintf@plt>
  lea    -0x520(%rbp),%rdx
  mov    -0x8c0(%rbp),%rcx
  lea    -0x620(%rbp),%rax
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <a_article_search>
  jmp    L104
L84:
  mov    -0x8ac(%rbp),%eax
  mov    %eax,%edi
  call   <S_ISREG@plt>
  test   %rax,%rax
  je     L60
  lea    -0x7f0(%rbp),%rax
  mov    $0x40,%esi
  mov    %rax,%rdi
  call   <bzero@plt>
  lea    -0x720(%rbp),%rax
  add    $0x5,%rax
  lea    -0x7f0(%rbp),%rcx
  mov    $0x26,%edx
  mov    %rax,%rsi
  mov    %rcx,%rdi
  call   <strncpy@plt>
  lea    -0x7f0(%rbp),%rdx
  lea    -0x7b0(%rbp),%rax
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strcpy@plt>
  mov    -0x8c0(%rbp),%rdx
  lea    -0x830(%rbp),%rax
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strcpy@plt>
  lea    -0x7b0(%rbp),%rax
  mov    %rax,%rdi
  call   <toupper@plt>
  lea    -0x830(%rbp),%rax
  mov    %rax,%rdi
  call   <toupper@plt>
  lea    -0x830(%rbp),%rdx
  lea    -0x7b0(%rbp),%rax
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strstr@plt>
  test   %rax,%rax
  je     L201
  mov    -0x8a8(%rbp),%rdx
  lea    -0x890(%rbp),%rax
  mov    $0x14,%esi
  mov    %rax,%rdi
  call   <fgets@plt>
  lea    -0x890(%rbp),%rax
  mov    $0x5,%edx
  lea    D122(%rip),%rcx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <strncmp@plt>
  test   %rax,%rax
  jne    L144
  lea    -0x890(%rbp),%rax
  mov    %rax,%rdi
  call   <strlen@plt>
  sub    $0x1,%eax
  cltq
  movb   $0x0,-0x890(%rbp,%rax,1)
L144:
  lea    -0x890(%rbp),%rax
  add    $0x5,%rax
  mov    -0x8c8(%rbp),%rdx
  lea    -0x850(%rbp),%rdi
  mov    %rax,%rcx
  lea    D74(%rip),%rax
  mov    %rax,%rsi
  call   <sprintf@plt>
  lea    -0x7f0(%rbp),%rax
  mov    %rax,%rdi
  call   <strlen@plt>
  sub    $0x7,%eax
  cltq
  movb   $0x0,-0x7f0(%rbp,%rax,1)
  lea    -0x620(%rbp),%rax
  add    $0x13,%rax
  lea    -0x520(%rbp),%rdx
  mov    %rax,%rsi
  mov    %rdx,%rdi
  call   <strcpy@plt>
  lea    -0x520(%rbp),%rax
  mov    $0x2f,%esi
  mov    %rax,%rdi
  call   <strrchr@plt>
  mov    %rax,-0x8a0(%rbp)
  mov    -0x8a0(%rbp),%rdx
  lea    -0x870(%rbp),%rax
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strcpy@plt>
  lea    -0x520(%rbp),%rax
  mov    %rax,%rdi
  call   <strlen@plt>
  mov    %eax,%ebx
  mov    -0x8a0(%rbp),%rax
  mov    %rax,%rdi
  call   <strlen@plt>
  mov    %eax,%edx
  mov    %ebx,%eax
  sub    %edx,%eax
  cltq
  movb   $0x0,-0x520(%rbp,%rax,1)
  lea    -0x7f0(%rbp),%rax
  mov    %rax,%rdi
  call   <strlen@plt>
  sub    $0x1,%eax
  cltq
  movb   $0x0,-0x7f0(%rbp,%rax,1)
  lea    -0x7f0(%rbp),%rsi
  lea    -0x870(%rbp),%rcx
  lea    -0x520(%rbp),%rdx
  lea    -0x850(%rbp),%rax
  mov    %rsi,%r8
  mov    %rax,%rsi
  lea    D45(%rip),%rax
  mov    %rax,%rdi
  call   <printf@plt>
  jmp    L104
L201:
  movb   $0x0,-0x720(%rbp)
  movb   $0x0,-0x6a0(%rbp)
  jmp    L104
L205:
  nop
  jmp    L104
L60:
  nop
  jmp    L104
L159:
  movb   $0x0,-0x720(%rbp)
L104:
  mov    -0x8a8(%rbp),%rax
  mov    %rax,%rdi
  call   <feof@plt>
  test   %eax,%eax
  je     L55
  mov    -0x8a8(%rbp),%rax
  mov    %rax,%rdi
  call   <fclose@plt>
  jmp    L207
L93:
  nop
L207:
  mov    -0x18(%rbp),%rax
  sub    %fs:0x28,%rax
  je     L69
  call   <__stack_chk_fail@plt>
L69:
  mov    -0x8(%rbp),%rbx
  leave
  ret
```

tool_calls: name: retrieve_data
arguments: label: D113
type_guessed: string
name: retrieve_data
arguments: label: D31
type_guessed: string
name: retrieve_data
arguments: label: D51
type_guessed: string
name: retrieve_data
arguments: label: D6
type_guessed: string
name: retrieve_data
arguments: label: D48
type_guessed: string
name: retrieve_data
arguments: label: D105
type_guessed: string
name: retrieve_data
arguments: label: D67
type_guessed: string
name: retrieve_data
arguments: label: D109
type_guessed: string
name: retrieve_data
arguments: label: D122
type_guessed: string
name: retrieve_data
arguments: label: D56
type_guessed: string
name: retrieve_data
arguments: label: D74
type_guessed: string
name: retrieve_data
arguments: label: D45
type_guessed: string

tool: D113: r

tool: D31: Name=

tool: D51: (BM: BMS)

tool: D6: (BM: SYSOPS)

tool: D48: <HIDE>

tool: D105: Path=

tool: D67: Path=~/

tool: D109: /

tool: D122: Numb=

tool: D56: %s%s-

tool: D74: %s%s

tool: D45: %s,%s,%s,%s 


assistant: ```c
void a_article_search(char *path, char *key, char *location) {
  FILE *fp;
  struct stat buf;
  char index_file[] = "/.Names";
  char titlebuf[128];
  char pathbuf[128];
  char index_path[1024];
  char filename[256];
  strcpy(index_path, path);
  strcat(index_path, index_file);
  if ((fp = fopen(index_path, "r")) == NULL) {
    return;
  }
  while (!feof(fp)) {
    bzero(filename, 80);
    strcpy(filename, path);
    fgets(titlebuf, 128, fp);
    if (strncmp(titlebuf, "Name=", 5) == 0) {
      fgets(pathbuf, 128, fp);
      if (strstr(titlebuf + 43, "(BM: BMS)") || strstr(titlebuf + 43, "(BM: SYSOPS)") || strstr(titlebuf + 5, "<HIDE>"))
        continue;
      char temppath[80];
      if (strncmp(pathbuf, "Path=", 5) == 0) {
        if (strncmp(pathbuf, "Path=~/", 7) == 0)
          strncpy(temppath, pathbuf + 7, 80);
        else
          strncpy(temppath, pathbuf + 5, 80);
        temppath[79] = '\0';
      }
      strcat(filename, "/");
      strcat(filename, temppath);
      filename[strlen(filename) - 1] = '\0';
      lstat(filename, &buf);
      if (S_ISDIR(buf.st_mode)) {
        char linebuf[20];
        fgets(linebuf, 20, fp);
        if (strncmp(linebuf, "Numb=", 5) == 0)
          linebuf[strlen(linebuf) - 1] = '\0';
        char nextlocate[20];
        sprintf(nextlocate, "%s%s-", location, linebuf + 5);
        a_article_search(filename, key, nextlocate);
      } else if (S_ISREG(buf.st_mode)) {
        char temptitle[64];
        bzero(temptitle, sizeof(temptitle));
        strncpy(temptitle, titlebuf + 5, 38);
        char tempupper[64];
        strcpy(tempupper, temptitle);
        char keyupper[50];
        strcpy(keyupper, key);
        toupper(tempupper);
        toupper(keyupper);
        if (strstr(tempupper, keyupper) != NULL) {
          char linebuf[20];
          fgets(linebuf, 20, fp);
          if (strncmp(linebuf, "Numb=", 5) == 0)
            linebuf[strlen(linebuf) - 1] = '\0';
          char nextlocate[32];
          sprintf(nextlocate, "%s%s", location, linebuf + 5);
          temptitle[strlen(temptitle) - 7] = '\0';
          char *filenamenum;
          char tempresult[256];
          strcpy(tempresult, filename + 19);
          filenamenum = strrchr(tempresult, '/');
          char temptitleresult[30];
          strcpy(temptitleresult, filenamenum);
          tempresult[strlen(tempresult) - strlen(filenamenum)] = '\0';
          temptitle[strlen(temptitle) - 1] = '\0';
          printf("%s,%s,%s,%s \n", nextlocate, tempresult, temptitleresult, temptitle);
        } else {
          titlebuf[0] = '\0';
          pathbuf[0] = '\0';
        }
      } else {
        continue;
      }
    } else
      titlebuf[0] = '\0';
  }
  fclose(fp);
  return;
}
```