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

```asm
<serveGetRequest>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x1000,%rsp
  orq    $0x0,(%rsp)
  sub    $0x38,%rsp
  mov    %rsi,%r12
  lea    0x10(%rsp),%r13
  mov    %edi,%ebp
  mov    %rdx,%rdi
  mov    %fs:0x28,%rax
  mov    %rax,0x1028(%rsp)
  xor    %eax,%eax
  mov    %rdx,%rbx
  mov    %ecx,%r14d
  call   <stripTrailingSlash@plt>
  mov    %r12,%rsi
  mov    %r13,%rdi
  lea    0xc(%rsp),%r12
  call   <strcpy@plt>
  mov    %rbx,%rsi
  mov    %r13,%rdi
  call   <strcat@plt>
  mov    %r12,%rsi
  mov    %r13,%rdi
  call   <stat@plt>
  test   %rax,%rax
  je     L197
  test   %r14d,%r14d
  jne    L59
L4:
  mov    $0x194,%esi
  mov    %ebp,%edi
  call   <writeError@plt>
L71:
  mov    0x1028(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L152
  add    $0x1038,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  xchg   %ax,%ax
L59:
  mov    %r13,%rsi
  lea    D90(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
  jmp    L4
  nopl   0x0(%rax,%rax,1)
L197:
  mov    0xc(%rsp),%edi
  call   <S_ISREG@plt>
  test   %rax,%rax
  je     L122
  test   %r14d,%r14d
  jne    L195
L60:
  mov    0xc(%rsp),%edx
  mov    %r13,%rsi
  mov    %ebp,%edi
  call   <writeFileResponse@plt>
  jmp    L71
  nopl   0x0(%rax,%rax,1)
L195:
  mov    %r13,%rsi
  lea    D79(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
  jmp    L60
  nopl   0x0(%rax,%rax,1)
L122:
  mov    0xc(%rsp),%edi
  call   <S_ISDIR@plt>
  test   %rax,%rax
  je     L71
  test   %r14d,%r14d
  jne    L91
  lea    0x820(%rsp),%r14
  mov    %r13,%rsi
  movb   $0x0,0x820(%rsp)
  mov    %r14,%rdi
  call   <strcat@plt>
  lea    D35(%rip),%rsi
  mov    %r14,%rdi
  call   <strcat@plt>
  mov    %r12,%rsi
  mov    %r14,%rdi
  call   <stat@plt>
  test   %rax,%rax
  je     L40
L127:
  mov    $0x805,%edi
  call   <malloc@plt>
  mov    %rbx,%rdx
  lea    D3(%rip),%rsi
  mov    %rax,%rdi
  mov    %rax,%r12
  xor    %eax,%eax
  call   <sprintf@plt>
  mov    %r13,%rdi
  call   <opendir@plt>
  mov    %rax,%r13
  nopl   (%rax)
L43:
  mov    %r13,%rdi
  call   <readdir@plt>
  mov    %rax,%r15
  test   %rax,%rax
  je     L150
  mov    (%r15),%rdi
  lea    D71(%rip),%rsi
  call   <strcmp@plt>
  test   %rax,%rax
  jne    L202
  cmpb   $0x0,(%rbx)
  je     L43
  mov    %rbx,%rsi
  mov    $0x2f,%edx
  mov    %r14,%rdi
  call   <substringTo@plt>
  mov    %r12,%rdi
  call   <strlen@plt>
  mov    %r14,%rdx
  lea    D124(%rip),%rsi
  lea    (%r12,%rax,1),%rdi
  xor    %eax,%eax
  call   <sprintf@plt>
  jmp    L43
L91:
  lea    0x820(%rsp),%r14
  mov    %r13,%rsi
  lea    D43(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
  mov    %r13,%rsi
  mov    %r14,%rdi
  movb   $0x0,0x820(%rsp)
  call   <strcat@plt>
  lea    D35(%rip),%rsi
  mov    %r14,%rdi
  call   <strcat@plt>
  mov    %r12,%rsi
  mov    %r14,%rdi
  call   <stat@plt>
  test   %rax,%rax
  je     L107
  lea    D48(%rip),%rdi
  call   <puts@plt>
  jmp    L127
L202:
  mov    (%r15),%rdi
  lea    D28(%rip),%rsi
  call   <strcmp@plt>
  test   %rax,%rax
  je     L43
  mov    (%r15),%r15
  mov    %r12,%rdi
  call   <strlen@plt>
  mov    %rbx,%rdx
  lea    D78(%rip),%rsi
  lea    (%r12,%rax,1),%rdi
  mov    %r15,%r8
  mov    %r15,%rcx
  xor    %eax,%eax
  call   <sprintf@plt>
  jmp    L43
  nopl   0x0(%rax,%rax,1)
L150:
  mov    %r13,%rdi
  call   <closedir@plt>
  lea    D116(%rip),%rsi
  mov    %r12,%rdi
  call   <strcat@plt>
  mov    %r12,%rdi
  call   <strlen@plt>
  mov    %ebp,%edi
  mov    %r12,%rdx
  mov    $0xc8,%esi
  mov    %eax,%r8d
  lea    D55(%rip),%rcx
  call   <writeBasicResponse@plt>
  mov    %r12,%rdi
  call   <free@plt>
  jmp    L71
L107:
  lea    D133(%rip),%rdi
  call   <puts@plt>
L40:
  mov    0xc(%rsp),%edx
  mov    %r14,%rsi
  mov    %ebp,%edi
  call   <writeFileResponse@plt>
  jmp    L71
L152:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: retrieve_data
arguments: data_label: D90
type: string
name: retrieve_data
arguments: data_label: D79
type: string
name: retrieve_data
arguments: data_label: D35
type: string
name: retrieve_data
arguments: data_label: D3
type: string
name: retrieve_data
arguments: data_label: D71
type: string
name: retrieve_data
arguments: data_label: D124
type: string
name: retrieve_data
arguments: data_label: D43
type: string
name: retrieve_data
arguments: data_label: D48
type: string
name: retrieve_data
arguments: data_label: D28
type: string
name: retrieve_data
arguments: data_label: D78
type: string
name: retrieve_data
arguments: data_label: D116
type: string
name: retrieve_data
arguments: data_label: D55
type: string
name: retrieve_data
arguments: data_label: D133
type: string

tool: D90:  - Unable to stat %s


tool: D79:  - %s is a regular file.


tool: D35: /index.html

tool: D3: <!DOCTYPE html>
<html lang="en">
<head><title>Directory Listing</title></head>
<body>
<h1>Index of %s</h1>
<p><ul>


tool: D71: ..

tool: D124: <li><a href="%s">Parent Directory</a></li>


tool: D43:  - %s is a directory.


tool: D48:  - Generating directory listing.

tool: D28: .

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


tool: D116: </ul></p></body>
</html>

tool: D55: text/html

tool: D133:  - Found index.html file in directory.

assistant: ```c
void serveGetRequest(int hSocket, const char *webDirectory, char *resource, int verbose) {
  char directory[(1024 * 2) + 2 + 1];
  char dirFile[(1024 * 2) + 2 + 1];
  struct stat filestat;
  DIR *dirp;
  struct dirent *dp;
  stripTrailingSlash(resource);
  strcpy(directory, webDirectory);
  strcat(directory, resource);
  if (stat(directory, &filestat)) {
    if (verbose) {
      printf(" - Unable to stat %s\n", directory);
    }
    writeError(hSocket, 404);
  } else if (S_ISREG(filestat.st_mode)) {
    if (verbose) {
      printf(" - %s is a regular file.\n", directory);
    }
    writeFileResponse(hSocket, directory, filestat);
  } else if (S_ISDIR(filestat.st_mode)) {
    if (verbose) {
      printf(" - %s is a directory.\n", directory);
    }
    dirFile[0] = 0;
    strcat(dirFile, directory);
    strcat(dirFile, "/index.html");
    if (stat(dirFile, &filestat)) {
      if (verbose) {
        printf(" - Generating directory listing.\n");
      }
      char *directoryList = malloc(((1024 * 2) + 2 * 2 + 1) * sizeof(char));
      sprintf(directoryList, "<!DOCTYPE html>\n<html lang=\"en\">\n<head><title>Directory Listing</title></head>\n<body>\n<h1>Index of %s</h1>\n<p><ul>\n", resource);
      dirp = opendir(directory);
      while ((dp = readdir(dirp)) != NULL) {
        if (strcmp(dp->d_name, "..") == 0) {
          if (resource[0] != 0) {
            substringTo(dirFile, resource, '/');
            sprintf(&directoryList[strlen(directoryList)], "<li><a href=\"%s\">Parent Directory</a></li>\n", dirFile);
          }
        } else if (strcmp(dp->d_name, ".") != 0) {
          sprintf(&directoryList[strlen(directoryList)], "<li><a href=\"%s/%s/\">%s</a></li>\n", resource, dp->d_name, dp->d_name);
        }
      }
      closedir(dirp);
      strcat(directoryList, "</ul></p></body>\n</html>");
      writeBasicResponse(hSocket, 200, directoryList, "text/html", (int)strlen(directoryList));
      free(directoryList);
    } else {
      if (verbose) {
        printf(" - Found index.html file in directory.\n");
      }
      writeFileResponse(hSocket, dirFile, filestat);
    }
  }
}
```