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

```asm
<main>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x40,%rsp
  mov    %edi,-0x34(%rbp)
  mov    %rsi,-0x40(%rbp)
  cmpl   $0x1,-0x34(%rbp)
  jg     L45
  mov    -0x40(%rbp),%rax
  mov    (%rax),%rax
  mov    %rax,%rsi
  lea    D16(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  mov    $0x1,%edi
  call   <exit@plt>
  jmp    L45
L40:
  mov    -0x40(%rbp),%rax
  mov    (%rax),%rax
  mov    %rax,-0x20(%rbp)
  mov    -0x20(%rbp),%rax
  mov    %rax,%rdi
  call   <strlen@plt>
  mov    %eax,-0x24(%rbp)
  movl   $0xffffffff,-0x28(%rbp)
  mov    -0x20(%rbp),%rax
  mov    %rax,%rsi
  lea    D47(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  mov    -0x40(%rbp),%rax
  mov    (%rax),%rax
  lea    D55(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <fopen@plt>
  mov    %rax,-0x18(%rbp)
  cmpq   $0x0,-0x18(%rbp)
  jne    L16
  lea    D66(%rip),%rax
  mov    %rax,%rdi
  call   <perror@plt>
  jmp    L81
L16:
  mov    -0x24(%rbp),%eax
  add    $0x1,%eax
  mov    %eax,%edi
  call   <malloc@plt>
  mov    %rax,-0x10(%rbp)
  mov    -0x20(%rbp),%rdx
  mov    -0x10(%rbp),%rax
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strcpy@plt>
  mov    -0x24(%rbp),%eax
  cltq
  lea    -0x1(%rax),%rdx
  mov    -0x10(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%edx
  sub    $0x1,%edx
  mov    %dl,(%rax)
  mov    -0x10(%rbp),%rax
  lea    D77(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <fopen@plt>
  mov    %rax,-0x8(%rbp)
  cmpq   $0x0,-0x8(%rbp)
  jne    L67
  lea    D66(%rip),%rax
  mov    %rax,%rdi
  call   <perror@plt>
  jmp    L32
L67:
  mov    -0x8(%rbp),%rdx
  mov    -0x18(%rbp),%rax
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <decompress@plt>
  mov    %eax,-0x28(%rbp)
  mov    -0x8(%rbp),%rax
  mov    %rax,%rdi
  call   <fclose@plt>
L32:
  mov    -0x10(%rbp),%rax
  mov    %rax,%rdi
  call   <free@plt>
  mov    -0x18(%rbp),%rax
  mov    %rax,%rdi
  call   <fclose@plt>
L81:
  cmpl   $0x0,-0x28(%rbp)
  je     L9
  lea    D59(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  jmp    L22
L9:
  lea    D31(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
L22:
  mov    $0xa,%edi
  call   <putchar@plt>
L45:
  addq   $0x8,-0x40(%rbp)
  mov    -0x40(%rbp),%rax
  mov    (%rax),%rax
  test   %rax,%rax
  jne    L40
  mov    $0x0,%eax
  leave
  ret
```

tool_calls: name: unpack_data
arguments: tag: D16
type_guessed: string
name: unpack_data
arguments: tag: D47
type_guessed: string
name: unpack_data
arguments: tag: D55
type_guessed: string
name: unpack_data
arguments: tag: D66
type_guessed: string
name: unpack_data
arguments: tag: D77
type_guessed: string
name: unpack_data
arguments: tag: D59
type_guessed: string
name: unpack_data
arguments: tag: D31
type_guessed: string

tool: D16: Usage: %s script.d ...


tool: D47: Uncompressing %s... 

tool: D55: rb

tool: 

tool: D77: wb

tool: D59: failed!

tool: D31: done!

assistant: ```c
int main(int argc, char *argv[]) {
  if (argc < 2) {
    printf("Usage: %s script.d ...\n", argv[0]);
    exit(1);
  }
  while (*(++argv)) {
    char *infile = *argv;
    char *outfile;
    int infile_len = strlen(infile);
    int success = -1;
    printf("Uncompressing %s... ", infile);
    FILE *in;
    if ((in = fopen(*argv, "rb")) == NULL) {
      perror("");
    } else {
      FILE *out;
      outfile = malloc(infile_len + 1);
      strcpy(outfile, infile);
      outfile[infile_len - 1]--;
      ;
      if ((out = fopen(outfile, "wb")) == NULL) {
        perror("");
      } else {
        success = decompress(in, out);
        fclose(out);
      }
      free(outfile);
      fclose(in);
    }
    if (success != 0)
      printf("failed!");
    else
      printf("done!");
    printf("\n");
  }
  return 0;
}
```