user: 请将这段汇编代码片段转换成等效的C代码:

```asm
<ansi_terminal>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x10,%rsp
  lea    D49(%rip),%rax
  mov    %rax,%rdi
  call   <getenv@plt>
  mov    %rax,-0x8(%rbp)
  mov    $0x1,%edi
  call   <isatty@plt>
  test   %eax,%eax
  je     L240
  mov    $0x2,%edi
  call   <isatty@plt>
  test   %eax,%eax
  jne    L189
L240:
  mov    $0x0,%eax
  jmp    L61
L189:
  cmpq   $0x0,-0x8(%rbp)
  jne    L43
  mov    $0x0,%eax
  jmp    L61
L43:
  mov    -0x8(%rbp),%rax
  lea    D120(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strcasecmp@plt>
  test   %rax,%rax
  jne    L193
  mov    $0x1,%eax
  jmp    L61
L193:
  mov    -0x8(%rbp),%rax
  lea    D72(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strcasecmp@plt>
  test   %rax,%rax
  je     L210
  mov    -0x8(%rbp),%rax
  lea    D119(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strcasecmp@plt>
  test   %rax,%rax
  je     L210
  mov    -0x8(%rbp),%rax
  lea    D167(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strcasecmp@plt>
  test   %rax,%rax
  je     L210
  mov    -0x8(%rbp),%rax
  lea    D99(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strcasecmp@plt>
  test   %rax,%rax
  jne    L149
L210:
  mov    $0x1,%eax
  jmp    L61
L149:
  mov    -0x8(%rbp),%rax
  lea    D5(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strcasecmp@plt>
  test   %rax,%rax
  jne    L250
  mov    $0x1,%eax
  jmp    L61
L250:
  mov    -0x8(%rbp),%rax
  lea    D36(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strcasecmp@plt>
  test   %rax,%rax
  je     L113
  mov    -0x8(%rbp),%rax
  lea    D106(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strcasecmp@plt>
  test   %rax,%rax
  je     L113
  mov    -0x8(%rbp),%rax
  lea    D121(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strcasecmp@plt>
  test   %rax,%rax
  je     L113
  mov    -0x8(%rbp),%rax
  lea    D85(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strcasecmp@plt>
  test   %rax,%rax
  jne    L99
L113:
  mov    $0x1,%eax
  jmp    L61
L99:
  mov    -0x8(%rbp),%rax
  lea    D97(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strcasecmp@plt>
  test   %rax,%rax
  je     L171
  mov    -0x8(%rbp),%rax
  lea    D105(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strcasecmp@plt>
  test   %rax,%rax
  je     L171
  mov    -0x8(%rbp),%rax
  lea    D167(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strcasecmp@plt>
  test   %rax,%rax
  je     L171
  mov    -0x8(%rbp),%rax
  lea    D99(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strcasecmp@plt>
  test   %rax,%rax
  je     L171
  mov    -0x8(%rbp),%rax
  lea    D139(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strcasecmp@plt>
  test   %rax,%rax
  je     L171
  mov    -0x8(%rbp),%rax
  lea    D21(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strcasecmp@plt>
  test   %rax,%rax
  jne    L164
L171:
  mov    $0x1,%eax
  jmp    L61
L164:
  mov    $0x0,%eax
L61:
  leave
  ret
```

tool_calls: name: extract_symbolic_data
arguments: label: D49
data_type: string
name: extract_symbolic_data
arguments: label: D120
data_type: string
name: extract_symbolic_data
arguments: label: D72
data_type: string
name: extract_symbolic_data
arguments: label: D119
data_type: string
name: extract_symbolic_data
arguments: label: D167
data_type: string
name: extract_symbolic_data
arguments: label: D99
data_type: string
name: extract_symbolic_data
arguments: label: D5
data_type: string
name: extract_symbolic_data
arguments: label: D36
data_type: string
name: extract_symbolic_data
arguments: label: D106
data_type: string
name: extract_symbolic_data
arguments: label: D121
data_type: string
name: extract_symbolic_data
arguments: label: D85
data_type: string
name: extract_symbolic_data
arguments: label: D97
data_type: string
name: extract_symbolic_data
arguments: label: D105
data_type: string
name: extract_symbolic_data
arguments: label: D139
data_type: string
name: extract_symbolic_data
arguments: label: D21
data_type: string

tool: D49: TERM

tool: D120: ansi

tool: D72: console

tool: D119: con80x25

tool: D167: linux

tool: D99: linux-80x25

tool: D5: screen

tool: D36: xterm

tool: D106: xterm-color

tool: D121: xterm-256color

tool: D85: xterm-16color

tool: D97: rxvt

tool: D105: konsole

tool: D139: konsole-16color

tool: D21: rxvt-16color

assistant: ```c
char ansi_terminal(void) {
  const char *term = getenv("TERM");
  if (!isatty(1) || !isatty(2))
    return 0;
  if (!term)
    return 0;
  if (strcasecmp(term, "ansi") == 0)
    return 1;
  if (strcasecmp(term, "console") == 0 || strcasecmp(term, "con80x25") == 0 || strcasecmp(term, "linux") == 0 || strcasecmp(term, "linux-80x25") == 0)
    return 1;
  if (strcasecmp(term, "screen") == 0)
    return 1;
  if (strcasecmp(term, "xterm") == 0 || strcasecmp(term, "xterm-color") == 0 || strcasecmp(term, "xterm-256color") == 0 || strcasecmp(term, "xterm-16color") == 0)
    return 1;
  if (strcasecmp(term, "rxvt") == 0 || strcasecmp(term, "konsole") == 0 || strcasecmp(term, "linux") == 0 || strcasecmp(term, "linux-80x25") == 0 || strcasecmp(term, "konsole-16color") == 0 || strcasecmp(term, "rxvt-16color") == 0)
    return 1;
  return 0;
}
```