user: Translate the below assembly code into C programming language:

```asm
<test_file>:
  endbr64
  push   %rbp
  push   %rbx
  sub    $0x418,%rsp
  mov    %rdi,%rsi
  mov    %fs:0x28,%rax
  mov    %rax,0x408(%rsp)
  xor    %eax,%eax
  mov    %rsp,%rbx
  mov    %rbx,%rdi
  call   <strcpy@plt>
  mov    $0x2e,%esi
  mov    %rbx,%rdi
  call   <strrchr@plt>
  test   %rax,%rax
  je     L6
  mov    %rax,%rbx
  lea    D33(%rip),%rsi
  mov    %rax,%rdi
  call   <strcmp@plt>
  test   %eax,%eax
  je     L143
  lea    D20(%rip),%rsi
  mov    %rbx,%rdi
  call   <strcmp@plt>
  test   %eax,%eax
  je     L143
  lea    D18(%rip),%rsi
  mov    %rbx,%rdi
  call   <strcmp@plt>
  test   %eax,%eax
  je     L143
  lea    D1(%rip),%rsi
  mov    %rbx,%rdi
  call   <strcmp@plt>
  test   %eax,%eax
  je     L143
  lea    D56(%rip),%rsi
  mov    %rbx,%rdi
  call   <strcmp@plt>
  test   %eax,%eax
  je     L143
  lea    D11(%rip),%rsi
  mov    %rbx,%rdi
  call   <strcmp@plt>
  test   %eax,%eax
  jne    L57
L143:
  movb   $0x0,(%rbx)
  mov    %rsp,%rdi
  call   <exist_file@plt>
  mov    %rax,%rdx
  mov    $0x1,%eax
  mov    $0x1,%ebp
  test   %rdx,%rdx
  jne    L136
L77:
  mov    %rsp,%rdi
  mov    $0x2e,%esi
  call   <strrchr@plt>
  mov    %rax,%rbx
  test   %rax,%rax
  je     L120
  mov    %rax,%rdi
  call   <strlen@plt>
  cmp    $0x4,%eax
  je     L39
L120:
  mov    %rsp,%rdi
  call   <exist_file@plt>
  mov    %rax,%rdx
  lea    0x1(%rbp),%eax
  test   %rdx,%rdx
  mov    $0x0,%edx
  cmove  %edx,%eax
L136:
  mov    0x408(%rsp),%rdx
  sub    %fs:0x28,%rdx
  jne    L42
  add    $0x418,%rsp
  pop    %rbx
  pop    %rbp
  ret
L6:
  mov    $0x0,%ebp
  jmp    L77
L57:
  mov    $0x0,%ebp
  jmp    L77
L39:
  movzbl 0x3(%rbx),%eax
  mov    %eax,%edx
  and    $0xffffffdf,%edx
  cmp    $0x44,%dl
  jne    L120
  cmp    $0x64,%al
  mov    $0x6f,%eax
  mov    $0x4f,%edx
  cmovne %edx,%eax
  mov    %al,0x3(%rbx)
  mov    %rsp,%rdi
  call   <exist_file@plt>
  mov    %rax,%rdx
  mov    $0x1,%eax
  test   %rdx,%rdx
  jne    L136
  mov    $0x1,%ebp
  jmp    L120
L42:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: disassemble_data
arguments: data_tag: D33
data_type: string
name: disassemble_data
arguments: data_tag: D20
data_type: string
name: disassemble_data
arguments: data_tag: D18
data_type: string
name: disassemble_data
arguments: data_tag: D1
data_type: string
name: disassemble_data
arguments: data_tag: D56
data_type: string
name: disassemble_data
arguments: data_tag: D11
data_type: string

tool: D33: .z

tool: D20: .gz

tool: D18: .zip

tool: D1: .Z

tool: D56: .GZ

tool: D11: .ZIP

assistant: ```c
int test_file(const char *local) {
  char buff[1024], *p;
  int comp = 0;
  strcpy(buff, local);
  if ((p = strrchr(buff, '.')) && (!strcmp(p, ".z") || !strcmp(p, ".gz") || !strcmp(p, ".zip") || !strcmp(p, ".Z") || !strcmp(p, ".GZ") || !strcmp(p, ".ZIP"))) {
    *p = '\0';
    if (exist_file(buff))
      return 1;
    comp = 1;
  }
  if ((p = strrchr(buff, '.')) && strlen(p) == 4 && (*(p + 3) == 'd' || *(p + 3) == 'D')) {
    *(p + 3) = *(p + 3) == 'd' ? 'o' : 'O';
    if (exist_file(buff))
      return 1;
    comp = 1;
  }
  if (!exist_file(buff))
    return 0;
  return comp ? 2 : 1;
}
```