user: 请将以下的汇编代码转换成C语言代码:

```asm
<ansi_terminal>:
  endbr64
  push   %r13
  lea    D60(%rip),%rdi
  push   %r12
  push   %rbp
  call   <getenv@plt>
  mov    $0x1,%edi
  mov    %rax,%rbp
  call   <isatty@plt>
  test   %eax,%eax
  jne    L128
L3:
  xor    %eax,%eax
L62:
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
  xchg   %ax,%ax
L128:
  mov    $0x2,%edi
  call   <isatty@plt>
  test   %rbp,%rbp
  je     L3
  test   %eax,%eax
  je     L3
  lea    D99(%rip),%rsi
  mov    %rbp,%rdi
  call   <strcasecmp@plt>
  test   %rax,%rax
  jne    L182
L151:
  pop    %rbp
  mov    $0x1,%eax
  pop    %r12
  pop    %r13
  ret
  nopw   0x0(%rax,%rax,1)
L182:
  lea    D101(%rip),%rsi
  mov    %rbp,%rdi
  call   <strcasecmp@plt>
  test   %rax,%rax
  je     L151
  lea    D44(%rip),%rsi
  mov    %rbp,%rdi
  call   <strcasecmp@plt>
  test   %rax,%rax
  je     L151
  lea    D102(%rip),%r12
  mov    %rbp,%rdi
  mov    %r12,%rsi
  call   <strcasecmp@plt>
  test   %rax,%rax
  je     L151
  lea    D105(%rip),%r13
  mov    %rbp,%rdi
  mov    %r13,%rsi
  call   <strcasecmp@plt>
  test   %rax,%rax
  je     L151
  lea    D140(%rip),%rsi
  mov    %rbp,%rdi
  call   <strcasecmp@plt>
  test   %rax,%rax
  je     L151
  lea    D141(%rip),%rsi
  mov    %rbp,%rdi
  call   <strcasecmp@plt>
  test   %rax,%rax
  je     L151
  lea    D21(%rip),%rsi
  mov    %rbp,%rdi
  call   <strcasecmp@plt>
  test   %rax,%rax
  je     L151
  lea    D19(%rip),%rsi
  mov    %rbp,%rdi
  call   <strcasecmp@plt>
  test   %rax,%rax
  je     L151
  lea    D80(%rip),%rsi
  mov    %rbp,%rdi
  call   <strcasecmp@plt>
  test   %rax,%rax
  je     L151
  lea    D88(%rip),%rsi
  mov    %rbp,%rdi
  call   <strcasecmp@plt>
  test   %rax,%rax
  je     L151
  lea    D110(%rip),%rsi
  mov    %rbp,%rdi
  call   <strcasecmp@plt>
  test   %rax,%rax
  je     L151
  mov    %r12,%rsi
  mov    %rbp,%rdi
  call   <strcasecmp@plt>
  test   %rax,%rax
  je     L151
  mov    %r13,%rsi
  mov    %rbp,%rdi
  call   <strcasecmp@plt>
  test   %rax,%rax
  je     L151
  lea    D113(%rip),%rsi
  mov    %rbp,%rdi
  call   <strcasecmp@plt>
  test   %rax,%rax
  je     L151
  lea    D20(%rip),%rsi
  mov    %rbp,%rdi
  call   <strcasecmp@plt>
  test   %rax,%rax
  sete   %al
  jmp    L62
```

tool_calls: name: unpack_data
arguments: tag: D60
datatype: string
name: unpack_data
arguments: tag: D99
datatype: string
name: unpack_data
arguments: tag: D101
datatype: string
name: unpack_data
arguments: tag: D44
datatype: string
name: unpack_data
arguments: tag: D102
datatype: string
name: unpack_data
arguments: tag: D105
datatype: string
name: unpack_data
arguments: tag: D140
datatype: string
name: unpack_data
arguments: tag: D141
datatype: string
name: unpack_data
arguments: tag: D21
datatype: string
name: unpack_data
arguments: tag: D19
datatype: string
name: unpack_data
arguments: tag: D80
datatype: string
name: unpack_data
arguments: tag: D88
datatype: string
name: unpack_data
arguments: tag: D110
datatype: string
name: unpack_data
arguments: tag: D113
datatype: string
name: unpack_data
arguments: tag: D20
datatype: string

tool: D60: TERM

tool: D99: ansi

tool: D101: console

tool: D44: con80x25

tool: D102: linux

tool: D105: linux-80x25

tool: D140: screen

tool: D141: xterm

tool: D21: xterm-color

tool: D19: xterm-256color

tool: D80: xterm-16color

tool: D88: rxvt

tool: D110: konsole

tool: D113: konsole-16color

tool: D20: 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;
}
```