user: What is the c source code of the assembly code below:

```asm
<test_file>:
  endbr64
  push   %r12
  mov    %rdi,%rsi
  push   %rbp
  push   %rbx
  sub    $0x410,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x408(%rsp)
  xor    %eax,%eax
  mov    %rsp,%rbp
  mov    %rbp,%rdi
  call   <strcpy@plt>
  mov    $0x2e,%esi
  mov    %rbp,%rdi
  call   <strrchr@plt>
  test   %rax,%rax
  je     L1
  movzbl (%rax),%r12d
  mov    %rax,%rbx
  cmp    $0x2e,%r12d
  jne    L134
  cmpb   $0x7a,0x1(%rax)
  jne    L134
  cmpb   $0x0,0x2(%rax)
  jne    L134
L141:
  movb   $0x0,(%rbx)
  mov    %rbp,%rdi
  mov    $0x2,%r12d
  call   <exist_file@plt>
  test   %rax,%rax
  jne    L11
L93:
  mov    $0x2e,%esi
  mov    %rbp,%rdi
  call   <strrchr@plt>
  mov    %rax,%rbx
  test   %rax,%rax
  je     L62
  mov    %rax,%rdi
  call   <strlen@plt>
  cmp    $0x4,%eax
  je     L15
L62:
  mov    %rbp,%rdi
  call   <exist_file@plt>
  test   %rax,%rax
  mov    $0x0,%eax
  cmove  %eax,%r12d
L29:
  mov    0x408(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L43
  add    $0x410,%rsp
  mov    %r12d,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  ret
  nopl   (%rax)
L134:
  lea    D27(%rip),%rsi
  mov    %rbx,%rdi
  call   <strcmp@plt>
  test   %eax,%eax
  je     L141
  lea    D8(%rip),%rsi
  mov    %rbx,%rdi
  call   <strcmp@plt>
  test   %eax,%eax
  je     L141
  cmp    $0x2e,%r12d
  jne    L119
  cmpb   $0x5a,0x1(%rbx)
  je     L171
L119:
  lea    D2(%rip),%rsi
  mov    %rbx,%rdi
  call   <strcmp@plt>
  test   %eax,%eax
  je     L141
  lea    D36(%rip),%rsi
  mov    %rbx,%rdi
  call   <strcmp@plt>
  test   %eax,%eax
  je     L141
  nopl   0x0(%rax)
L1:
  mov    $0x1,%r12d
  jmp    L93
  nopl   0x0(%rax,%rax,1)
L11:
  mov    $0x1,%r12d
  jmp    L29
  nopl   0x0(%rax,%rax,1)
L15:
  movzbl 0x3(%rbx),%eax
  mov    %eax,%edx
  and    $0xffffffdf,%edx
  cmp    $0x44,%dl
  jne    L62
  cmp    $0x64,%al
  mov    $0x4f,%edx
  mov    $0x6f,%eax
  mov    %rbp,%rdi
  cmovne %edx,%eax
  mov    %al,0x3(%rbx)
  call   <exist_file@plt>
  test   %rax,%rax
  jne    L11
  mov    %rbp,%rdi
  xor    %r12d,%r12d
  call   <exist_file@plt>
  test   %rax,%rax
  setne  %r12b
  add    %r12d,%r12d
  jmp    L29
  nopl   0x0(%rax,%rax,1)
L171:
  cmpb   $0x0,0x2(%rbx)
  je     L141
  jmp    L119
L43:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: read_data
arguments: data_tag: D27
type_guessed: string
name: read_data
arguments: data_tag: D8
type_guessed: string
name: read_data
arguments: data_tag: D2
type_guessed: string
name: read_data
arguments: data_tag: D36
type_guessed: string

tool: D27: .gz

tool: D8: .zip

tool: D2: .GZ

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