user: Converte this assembly snippet into its equivalent C code:

```asm
<process_get_request>:
  endbr64
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x1000,%rsp
  orq    $0x0,(%rsp)
  sub    $0x28,%rsp
  mov    %rdi,%rbp
  mov    %rsi,%rbx
  mov    %rdx,%r12
  mov    %fs:0x28,%rax
  mov    %rax,0x1018(%rsp)
  xor    %eax,%eax
  lea    0xc(%rsp),%rsi
  mov    %rbx,%rdi
  call   <stat@plt>
  test   %rax,%rax
  js     L27
  mov    0xc(%rsp),%edi
  call   <S_ISDIR@plt>
  test   %rax,%rax
  je     L89
  mov    %rbx,%rdi
  call   <strlen@plt>
  test   %eax,%eax
  je     L81
  cltq
  cmpb   $0x2f,-0x1(%rbx,%rax,1)
  je     L50
L81:
  lea    0x10(%rsp),%rbx
  mov    %r12,%rcx
  lea    D44(%rip),%rdx
  mov    $0x1000,%esi
  mov    %rbx,%rdi
  call   <snprintf@plt>
  mov    %rbx,%rsi
  lea    D69(%rip),%rdi
  call   <log_debug@plt>
  lea    D1(%rip),%r8
  mov    %rbx,%rcx
  lea    D21(%rip),%rdx
  mov    $0x12e,%esi
  mov    %rbp,%rdi
  call   <send_response@plt>
  jmp    L98
L50:
  lea    0x10(%rsp),%r13
  mov    %rbx,%rcx
  lea    D3(%rip),%rdx
  mov    $0x1000,%esi
  mov    %r13,%rdi
  call   <snprintf@plt>
  lea    0xc(%rsp),%rsi
  mov    %r13,%rdi
  call   <stat@plt>
  test   %rax,%rax
  js     L61
  lea    0xc(%rsp),%rdx
  mov    %r13,%rsi
  mov    %rbp,%rdi
  call   <send_file@plt>
  jmp    L98
L61:
  mov    %rbx,%rcx
  mov    %r12,%rdx
  mov    0xc(%rsp),%esi
  mov    %rbp,%rdi
  call   <send_directory_listing@plt>
  jmp    L98
L89:
  lea    0xc(%rsp),%rdx
  mov    %rbx,%rsi
  mov    %rbp,%rdi
  call   <send_file@plt>
  jmp    L98
L27:
  lea    D41(%rip),%r8
  mov    $0x0,%ecx
  lea    D46(%rip),%rdx
  mov    $0x194,%esi
  mov    %rbp,%rdi
  call   <send_response@plt>
L98:
  mov    0x1018(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L14
  mov    $0x0,%eax
  add    $0x1028,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
L14:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: disassemble_data
arguments: tag: D44
type: string
name: disassemble_data
arguments: tag: D69
type: string
name: disassemble_data
arguments: tag: D1
type: string
name: disassemble_data
arguments: tag: D21
type: string
name: disassemble_data
arguments: tag: D3
type: string
name: disassemble_data
arguments: tag: D41
type: string
name: disassemble_data
arguments: tag: D46
type: string

tool: D44: Location: %s/

tool: D69: HTTP 302, %s

tool: D1: Directories must end with a slash.

tool: D21: Found

tool: D3: %sindex.html

tool: D41: File not found

tool: D46: Not found

assistant: ```c
int process_get_request(FILE *f, char *path, char *relative_path) {
  struct stat statbuf;
  char pathbuf[4096];
  int len;
  if (stat(path, &statbuf) >= 0) {
    if (S_ISDIR(statbuf.st_mode)) {
      len = strlen(path);
      if (len == 0 || path[len - 1] != '/') {
        snprintf(pathbuf, sizeof(pathbuf), "Location: %s/", relative_path);
        log_debug("HTTP 302, %s", pathbuf);
        send_response(f, 302, "Found", pathbuf, "Directories must end with a slash.");
      } else {
        snprintf(pathbuf, sizeof(pathbuf), "%sindex.html", path);
        if (stat(pathbuf, &statbuf) >= 0) {
          send_file(f, pathbuf, &statbuf);
        } else {
          send_directory_listing(f, statbuf, relative_path, path);
        }
      }
    } else {
      send_file(f, path, &statbuf);
    }
  } else {
    send_response(f, 404, "Not found", NULL, "File not found");
  }
  return 0;
}
```