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

```asm
<get_directory>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  lea    -0x5000(%rsp),%r11
L12:
  sub    $0x1000,%rsp
  orq    $0x0,(%rsp)
  cmp    %r11,%rsp
  jne    L12
  sub    $0x18,%rsp
  mov    $0x1fe,%ecx
  pxor   %xmm0,%xmm0
  mov    %fs:0x28,%rax
  mov    %rax,0x5008(%rsp)
  xor    %eax,%eax
  mov    %rdi,%r12
  lea    0x10(%rsp),%rdi
  mov    %rdx,%rbp
  mov    %rsi,%r14
  xor    %edx,%edx
  mov    %rbp,%rsi
  movaps %xmm0,(%rsp)
  movaps %xmm0,0x1000(%rsp)
  movaps %xmm0,0x2000(%rsp)
  movaps %xmm0,0x3000(%rsp)
  movaps %xmm0,0x4000(%rsp)
  rep stos %rax,%es:(%rdi)
  lea    0x1010(%rsp),%rdi
  mov    $0x1fe,%ecx
  rep stos %rax,%es:(%rdi)
  lea    0x2010(%rsp),%rdi
  mov    $0x1fe,%ecx
  rep stos %rax,%es:(%rdi)
  lea    0x3010(%rsp),%rdi
  mov    $0x1fe,%ecx
  rep stos %rax,%es:(%rdi)
  lea    0x4010(%rsp),%rdi
  mov    $0x1fe,%ecx
  rep stos %rax,%es:(%rdi)
  mov    %r12,%rdi
  call   <get_next_line@plt>
  cmp    $0xffffffff,%eax
  je     L30
  mov    %eax,%r13d
  lea    0x2000(%rsp),%rbx
  xor    %eax,%eax
  mov    %r14,%rcx
  lea    0x1000(%rsp),%r15
  mov    %rbx,%r8
  lea    D58(%rip),%rsi
  mov    %rbp,%rdi
  mov    %r15,%rdx
  call   <sscanf@plt>
  cmp    $0x3,%eax
  je     L69
L30:
  mov    $0xffffffff,%eax
L26:
  mov    0x5008(%rsp),%rdx
  sub    %fs:0x28,%rdx
  jne    L82
  add    $0x5018,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  xchg   %ax,%ax
L69:
  lea    D24(%rip),%rsi
  mov    %r15,%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  jne    L30
  lea    D36(%rip),%rsi
  mov    %rbx,%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  jne    L30
  mov    %rsp,%rbp
  mov    %r13d,%edx
  mov    %r12,%rdi
  mov    %rbp,%rsi
  call   <get_next_line@plt>
  mov    %eax,%r13d
  cmp    $0xffffffff,%eax
  je     L30
  lea    0x3000(%rsp),%r14
  lea    D27(%rip),%r15
  mov    %rbp,%rdi
  xor    %eax,%eax
  mov    %r15,%rsi
  mov    %r14,%rdx
  call   <sscanf@plt>
  lea    D5(%rip),%rsi
  mov    %r14,%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  je     L28
  lea    D14(%rip),%rsi
  mov    %r14,%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  jne    L30
L28:
  xor    %esi,%esi
  mov    $0x1000,%edx
  mov    %rbp,%rdi
  call   <memset@plt>
  mov    %r12,%rdi
  mov    %r13d,%edx
  mov    %rbp,%rsi
  call   <get_next_line@plt>
  mov    %r15,%rsi
  mov    %rbp,%rdi
  xor    %eax,%eax
  lea    0x4000(%rsp),%r12
  mov    %r12,%rdx
  call   <sscanf@plt>
  lea    D65(%rip),%rsi
  mov    %r12,%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  jne    L30
  mov    $0x1,%eax
  jmp    L26
L82:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: disassemble_data
arguments: data_tag: D58
type_guessed: string
name: disassemble_data
arguments: data_tag: D24
type_guessed: string
name: disassemble_data
arguments: data_tag: D36
type_guessed: string
name: disassemble_data
arguments: data_tag: D27
type_guessed: string
name: disassemble_data
arguments: data_tag: D5
type_guessed: string
name: disassemble_data
arguments: data_tag: D14
type_guessed: string
name: disassemble_data
arguments: data_tag: D65
type_guessed: string

tool: D58: %s %s %s

tool: D24: GET

tool: D36: HTTP/1.1

tool: D27: %s

tool: D5: From:

tool: D14: Host:

tool: D65: User-Agent:

assistant: ```c
int get_directory(char *buffer, char *directory, char *getline) {
  char line[4096] = {0};
  char get[4096] = {0};
  char http[4096] = {0};
  char from[4096] = {0};
  char useragent[4096] = {0};
  int position = 0;
  position = get_next_line(buffer, getline, position);
  if (position == -1)
    return -1;
  if ((sscanf(getline, "%s %s %s", get, directory, http) != 3) || (strcmp(get, "GET") != 0) || (strcmp(http, "HTTP/1.1") != 0))
    return -1;
  position = get_next_line(buffer, line, position);
  if (position == -1)
    return -1;
  sscanf(line, "%s", from);
  if (strcmp(from, "From:") != 0 && strcmp(from, "Host:") != 0)
    return -1;
  memset(line, 0, sizeof(line));
  get_next_line(buffer, line, position);
  sscanf(line, "%s", useragent);
  if (strcmp(useragent, "User-Agent:") != 0)
    return -1;
  return 1;
}
```