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

```asm
<uncompress>:
  endbr64
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0xc18,%rsp
  mov    %rdi,%rbx
  mov    %rsi,%rbp
  mov    %fs:0x28,%rax
  mov    %rax,0xc08(%rsp)
  xor    %eax,%eax
  movq   $0x0,0x400(%rsp)
  movq   $0x0,0x408(%rsp)
  lea    0x410(%rsp),%rdi
  mov    $0xfe,%ecx
  rep stos %rax,%es:(%rdi)
  movq   $0x0,(%rsp)
  movq   $0x0,0x8(%rsp)
  lea    0x10(%rsp),%rdi
  mov    $0x7e,%ecx
  rep stos %rax,%es:(%rdi)
  mov    %rbx,%rdx
  lea    D63(%rip),%rsi
  mov    $0x3,%edi
  call   <trace@plt>
  mov    %rsp,%r12
  mov    %rbx,%rsi
  mov    %r12,%rdi
  call   <strcpy@plt>
  mov    $0x2e,%esi
  mov    %r12,%rdi
  call   <strrchr@plt>
  test   %rax,%rax
  je     L92
  mov    %rax,%rbx
  lea    D77(%rip),%rsi
  mov    %rax,%rdi
  call   <strcmp@plt>
  test   %eax,%eax
  je     L169
  lea    D8(%rip),%rsi
  mov    %rbx,%rdi
  call   <strcmp@plt>
  test   %eax,%eax
  je     L169
  lea    D6(%rip),%rsi
  mov    %rbx,%rdi
  call   <strcmp@plt>
  test   %eax,%eax
  je     L169
  lea    D52(%rip),%rsi
  mov    %rbx,%rdi
  call   <strcmp@plt>
  test   %eax,%eax
  je     L169
  lea    D39(%rip),%rsi
  mov    %rbx,%rdi
  call   <strcmp@plt>
  test   %eax,%eax
  je     L169
  lea    D42(%rip),%rsi
  mov    %rbx,%rdi
  call   <strcmp@plt>
  test   %eax,%eax
  jne    L0
L169:
  mov    %rsp,%r12
  mov    %r12,%rsi
  mov    %rbp,%rdi
  call   <strcpy@plt>
  sub    %r12,%rbx
  movb   $0x0,0x0(%rbp,%rbx,1)
  lea    0x400(%rsp),%rbx
  mov    %rbp,%rcx
  mov    %r12,%rdx
  lea    D68(%rip),%rsi
  mov    %rbx,%rdi
  mov    $0x0,%eax
  call   <sprintf@plt>
  mov    %rbx,%rdi
  call   <execcmd@plt>
  test   %rax,%rax
  jne    L81
  mov    %rsp,%rdi
  mov    %rbp,%rsi
  call   <strcpy@plt>
  mov    $0x1,%r12d
L300:
  mov    %rsp,%rdi
  mov    $0x2e,%esi
  call   <strrchr@plt>
  mov    %rax,%rbx
  test   %rax,%rax
  je     L180
  lea    D88(%rip),%rsi
  mov    %rax,%rdi
  call   <strcmp@plt>
  test   %eax,%eax
  je     L48
L180:
  mov    %rsp,%rdi
  mov    $0x2e,%esi
  call   <strrchr@plt>
  mov    %rax,%rbx
  test   %rax,%rax
  je     L168
  mov    %rax,%rdi
  call   <strlen@plt>
  cmp    $0x3,%eax
  jle    L168
  movzbl 0x3(%rbx),%eax
  and    $0xffffffdf,%eax
  cmp    $0x44,%al
  je     L15
L168:
  mov    %r12d,%edx
  lea    D62(%rip),%rsi
  mov    $0x3,%edi
  mov    $0x0,%eax
  call   <trace@plt>
L186:
  mov    0xc08(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L60
  mov    %r12d,%eax
  add    $0xc18,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
L81:
  mov    %rbp,%rdi
  call   <remove@plt>
  mov    $0xffffffff,%r12d
  jmp    L186
L0:
  mov    $0x0,%r12d
  jmp    L300
L48:
  mov    %rsp,%r13
  mov    %r13,%rsi
  mov    %rbp,%rdi
  call   <strcpy@plt>
  sub    %r13,%rbx
  movb   $0x0,0x0(%rbp,%rbx,1)
  lea    0x400(%rsp),%rbx
  mov    %r13,%rdx
  lea    D80(%rip),%rsi
  mov    %rbx,%rdi
  mov    $0x0,%eax
  call   <sprintf@plt>
  mov    %rbx,%rdi
  call   <execcmd@plt>
  test   %rax,%rax
  jne    L206
  test   %r12d,%r12d
  jne    L188
  mov    $0x1,%r12d
  jmp    L168
L206:
  test   %r12d,%r12d
  jne    L115
  mov    $0xffffffff,%r12d
  jmp    L186
L115:
  mov    %rsp,%rdi
  call   <remove@plt>
  mov    $0xffffffff,%r12d
  jmp    L186
L188:
  mov    %rsp,%rdi
  call   <remove@plt>
  jmp    L168
L15:
  mov    %rsp,%rsi
  mov    %rbp,%rdi
  call   <strcpy@plt>
  cmpb   $0x44,0x3(%rbx)
  mov    $0x4f,%eax
  mov    $0x6f,%edx
  cmovne %edx,%eax
  mov    %rsp,%rdx
  sub    %rdx,%rbx
  mov    %al,0x3(%rbp,%rbx,1)
  lea    0x400(%rsp),%rbx
  mov    %rbp,%rcx
  lea    D73(%rip),%rsi
  mov    %rbx,%rdi
  mov    $0x0,%eax
  call   <sprintf@plt>
  mov    %rbx,%rdi
  call   <execcmd@plt>
  test   %rax,%rax
  jne    L184
  test   %r12d,%r12d
  jne    L76
  mov    $0x1,%r12d
  jmp    L168
L184:
  mov    %rbp,%rdi
  call   <remove@plt>
  test   %r12d,%r12d
  jne    L246
  mov    $0xffffffff,%r12d
  jmp    L186
L246:
  mov    %rsp,%rdi
  call   <remove@plt>
  mov    $0xffffffff,%r12d
  jmp    L186
L76:
  mov    %rsp,%rdi
  call   <remove@plt>
  jmp    L168
L92:
  mov    $0x0,%r12d
  jmp    L186
L60:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: parse_data
arguments: label: D63
type_guessed: string
name: parse_data
arguments: label: D77
type_guessed: string
name: parse_data
arguments: label: D8
type_guessed: string
name: parse_data
arguments: label: D6
type_guessed: string
name: parse_data
arguments: label: D52
type_guessed: string
name: parse_data
arguments: label: D39
type_guessed: string
name: parse_data
arguments: label: D42
type_guessed: string
name: parse_data
arguments: label: D68
type_guessed: string
name: parse_data
arguments: label: D88
type_guessed: string
name: parse_data
arguments: label: D62
type_guessed: string
name: parse_data
arguments: label: D80
type_guessed: string
name: parse_data
arguments: label: D73
type_guessed: string

tool: D63: uncompress: file=%s


tool: D77: .z

tool: D8: .Z

tool: D6: .gz

tool: D52: .GZ

tool: D39: .zip

tool: D42: .ZIP

tool: D68: gzip -f -d -c "%s" > "%s"

tool: D88: .tar

tool: D62: uncompress: stat=%d


tool: D80: tar -xf "%s"

tool: D73: crx2rnx < "%s" > "%s"

assistant: ```c
extern int uncompress(const char *file, char *uncfile) {
  int stat = 0;
  char *p, cmd[2048] = "", tmpfile[1024] = "";
  trace(3, "uncompress: file=%s\n", file);
  strcpy(tmpfile, file);
  if (!(p = strrchr(tmpfile, '.')))
    return 0;
  if (!strcmp(p, ".z") || !strcmp(p, ".Z") || !strcmp(p, ".gz") || !strcmp(p, ".GZ") || !strcmp(p, ".zip") || !strcmp(p, ".ZIP")) {
    strcpy(uncfile, tmpfile);
    uncfile[p - tmpfile] = '\0';
    sprintf(cmd, "gzip -f -d -c \"%s\" > \"%s\"", tmpfile, uncfile);
    if (execcmd(cmd)) {
      remove(uncfile);
      return -1;
    }
    strcpy(tmpfile, uncfile);
    stat = 1;
  }
  if ((p = strrchr(tmpfile, '.')) && !strcmp(p, ".tar")) {
    strcpy(uncfile, tmpfile);
    uncfile[p - tmpfile] = '\0';
    sprintf(cmd, "tar -xf \"%s\"", tmpfile);
    if (execcmd(cmd)) {
      if (stat)
        remove(tmpfile);
      return -1;
    }
    if (stat)
      remove(tmpfile);
    stat = 1;
  } else if ((p = strrchr(tmpfile, '.')) && strlen(p) > 3 && (*(p + 3) == 'd' || *(p + 3) == 'D')) {
    strcpy(uncfile, tmpfile);
    uncfile[p - tmpfile + 3] = *(p + 3) == 'D' ? 'O' : 'o';
    sprintf(cmd, "crx2rnx < \"%s\" > \"%s\"", tmpfile, uncfile);
    if (execcmd(cmd)) {
      remove(uncfile);
      if (stat)
        remove(tmpfile);
      return -1;
    }
    if (stat)
      remove(tmpfile);
    stat = 1;
  }
  trace(3, "uncompress: stat=%d\n", stat);
  return stat;
}
```