user: 下面的汇编指令对应的C源代码是什么:

```asm
<load_terminfo>:
  endbr64
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x1000,%rsp
  orq    $0x0,(%rsp)
  sub    $0x10,%rsp
  lea    D86(%rip),%rdi
  mov    %fs:0x28,%rax
  mov    %rax,0x1008(%rsp)
  xor    %eax,%eax
  call   <getenv@plt>
  mov    %rax,%r12
  test   %rax,%rax
  je     L65
  lea    D20(%rip),%rdi
  call   <getenv@plt>
  mov    %rax,%rdi
  test   %rax,%rax
  je     L16
  mov    0x1008(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L52
  add    $0x1010,%rsp
  mov    %r12,%rsi
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  jmp    10b0 <terminfo_try_path@plt>
  nopl   0x0(%rax)
L16:
  lea    D65(%rip),%rdi
  call   <getenv@plt>
  mov    %rax,%rcx
  test   %rax,%rax
  je     L77
  mov    %rsp,%rbp
  mov    $0x1000,%esi
  lea    D56(%rip),%rdx
  mov    %rbp,%rdi
  call   <snprintf@plt>
  mov    %r12,%rsi
  mov    %rbp,%rdi
  movb   $0x0,0xfff(%rsp)
  call   <terminfo_try_path@plt>
  test   %rax,%rax
  je     L77
L56:
  mov    %rax,%r12
L65:
  mov    0x1008(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L52
  add    $0x1010,%rsp
  mov    %r12,%rax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  ret
L77:
  lea    D2(%rip),%rdi
  call   <getenv@plt>
  mov    %rax,%rcx
  test   %rax,%rax
  je     L99
  mov    %rsp,%rbp
  lea    D54(%rip),%rdx
  mov    $0x1000,%esi
  mov    %rbp,%rdi
  lea    D98(%rip),%rbx
  call   <snprintf@plt>
  mov    %rbp,%rdi
  mov    %rbx,%rsi
  movb   $0x0,0xfff(%rsp)
  call   <strtok@plt>
  mov    %rax,%rbp
  test   %rax,%rax
  je     L99
  lea    D68(%rip),%r14
  lea    D35(%rip),%r13
  jmp    L17
  nopl   0x0(%rax)
L19:
  mov    %rbx,%rsi
  xor    %edi,%edi
  call   <strtok@plt>
  mov    %rax,%rbp
  test   %rax,%rax
  je     L99
L17:
  mov    %rbp,%rdi
  mov    %r14,%rsi
  call   <strcmp@plt>
  mov    %r12,%rsi
  test   %rax,%rax
  cmove  %r13,%rbp
  mov    %rbp,%rdi
  call   <terminfo_try_path@plt>
  test   %rax,%rax
  je     L19
  jmp    L56
  nopl   0x0(%rax)
L99:
  mov    %r12,%rsi
  lea    D35(%rip),%rdi
  call   <terminfo_try_path@plt>
  mov    %rax,%r12
  jmp    L65
L52:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: unpack_data
arguments: tag: D86
datatype: string
name: unpack_data
arguments: tag: D20
datatype: string
name: unpack_data
arguments: tag: D65
datatype: string
name: unpack_data
arguments: tag: D56
datatype: string
name: unpack_data
arguments: tag: D2
datatype: string
name: unpack_data
arguments: tag: D54
datatype: string
name: unpack_data
arguments: tag: D98
datatype: string
name: unpack_data
arguments: tag: D68
datatype: string
name: unpack_data
arguments: tag: D35
datatype: string

tool: D86: TERM

tool: D20: TERMINFO

tool: D65: HOME

tool: D56: %s/.terminfo

tool: D2: TERMINFO_DIRS

tool: D54: %s

tool: D98: :

tool: 

tool: D35: /usr/share/terminfo

assistant: ```c
char *load_terminfo(void) {
  char tmp[4096];
  const char *term = getenv("TERM");
  if (!term) {
    return 0;
  }
  const char *terminfo = getenv("TERMINFO");
  if (terminfo) {
    return terminfo_try_path(terminfo, term);
  }
  const char *home = getenv("HOME");
  if (home) {
    snprintf(tmp, sizeof(tmp), "%s/.terminfo", home);
    tmp[sizeof(tmp) - 1] = '\0';
    char *data = terminfo_try_path(tmp, term);
    if (data)
      return data;
  }
  const char *dirs = getenv("TERMINFO_DIRS");
  if (dirs) {
    snprintf(tmp, sizeof(tmp), "%s", dirs);
    tmp[sizeof(tmp) - 1] = '\0';
    char *dir = strtok(tmp, ":");
    while (dir) {
      const char *cdir = dir;
      if (strcmp(cdir, "") == 0) {
        cdir = "/usr/share/terminfo";
      }
      char *data = terminfo_try_path(cdir, term);
      if (data)
        return data;
      dir = strtok(0, ":");
    }
  }
  return terminfo_try_path("/usr/share/terminfo", term);
}
```