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

```asm
<main>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x50,%rsp
  mov    %edi,-0x44(%rbp)
  mov    %rsi,-0x50(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  movq   $0x0,-0x18(%rbp)
  movq   $0x0,-0x10(%rbp)
  movl   $0xfeed1281,-0x38(%rbp)
  movl   $0x0,-0x34(%rbp)
  movl   $0x0,-0x30(%rbp)
  movl   $0x0,-0x2c(%rbp)
  movl   $0x0,-0x20(%rbp)
  movl   $0x0,-0x1c(%rbp)
  movl   $0x0,-0x28(%rbp)
  movl   $0x0,-0x24(%rbp)
  cmpl   $0x3,-0x44(%rbp)
  je     L19
  mov    $0x0,%eax
  call   <usage@plt>
L19:
  mov    -0x50(%rbp),%rax
  add    $0x8,%rax
  mov    (%rax),%rax
  lea    D84(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <fopen@plt>
  mov    %rax,-0x18(%rbp)
  cmpq   $0x0,-0x18(%rbp)
  jne    L75
  lea    D29(%rip),%rax
  mov    %rax,%rdi
  call   <pexit@plt>
L75:
  mov    -0x50(%rbp),%rax
  add    $0x10,%rax
  mov    (%rax),%rax
  lea    D159(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <fopen@plt>
  mov    %rax,-0x10(%rbp)
  cmpq   $0x0,-0x10(%rbp)
  jne    L89
  lea    D29(%rip),%rax
  mov    %rax,%rdi
  call   <pexit@plt>
L89:
  mov    -0x18(%rbp),%rdx
  lea    -0x38(%rbp),%rax
  mov    %rdx,%rcx
  mov    $0x1,%edx
  mov    $0x4,%esi
  mov    %rax,%rdi
  call   <fread@plt>
  cmp    $0x1,%eax
  je     L141
  lea    D171(%rip),%rax
  mov    %rax,%rdi
  call   <pexit@plt>
L141:
  mov    -0x38(%rbp),%eax
  mov    %eax,%esi
  lea    D198(%rip),%rax
  mov    %rax,%rdi
  call   <printf@plt>
  mov    -0x18(%rbp),%rdx
  lea    -0x34(%rbp),%rax
  mov    %rdx,%rcx
  mov    $0x1,%edx
  mov    $0x4,%esi
  mov    %rax,%rdi
  call   <fread@plt>
  cmp    $0x1,%eax
  je     L108
  lea    D171(%rip),%rax
  mov    %rax,%rdi
  call   <pexit@plt>
L108:
  mov    -0x34(%rbp),%eax
  mov    %eax,%esi
  lea    D15(%rip),%rax
  mov    %rax,%rdi
  call   <printf@plt>
  mov    -0x18(%rbp),%rdx
  lea    -0x30(%rbp),%rax
  mov    %rdx,%rcx
  mov    $0x1,%edx
  mov    $0x4,%esi
  mov    %rax,%rdi
  call   <fread@plt>
  cmp    $0x1,%eax
  je     L21
  lea    D171(%rip),%rax
  mov    %rax,%rdi
  call   <pexit@plt>
L21:
  mov    -0x30(%rbp),%eax
  mov    %eax,%esi
  lea    D26(%rip),%rax
  mov    %rax,%rdi
  call   <printf@plt>
  mov    -0x34(%rbp),%edx
  mov    -0x30(%rbp),%eax
  add    %edx,%eax
  mov    %eax,-0x20(%rbp)
  jmp    L36
L31:
  mov    -0x18(%rbp),%rdx
  lea    -0x3c(%rbp),%rax
  mov    %rdx,%rcx
  mov    $0x1,%edx
  mov    $0x4,%esi
  mov    %rax,%rdi
  call   <fread@plt>
  cmp    $0x1,%eax
  je     L101
  lea    D171(%rip),%rax
  mov    %rax,%rdi
  call   <pexit@plt>
L101:
  addl   $0x1,-0x1c(%rbp)
  mov    -0x10(%rbp),%rdx
  lea    -0x3c(%rbp),%rax
  mov    %rdx,%rcx
  mov    $0x1,%edx
  mov    $0x4,%esi
  mov    %rax,%rdi
  call   <fwrite@plt>
  cmp    $0x1,%eax
  je     L131
  lea    D27(%rip),%rax
  mov    %rax,%rdi
  call   <pexit@plt>
L131:
  mov    -0x3c(%rbp),%eax
  add    %eax,-0x20(%rbp)
L36:
  mov    -0x34(%rbp),%eax
  cmp    %eax,-0x1c(%rbp)
  jl     L31
  negl   -0x20(%rbp)
  mov    -0x20(%rbp),%eax
  mov    %eax,%esi
  lea    D103(%rip),%rax
  mov    %rax,%rdi
  call   <printf@plt>
  mov    -0x18(%rbp),%rdx
  lea    -0x2c(%rbp),%rax
  mov    %rdx,%rcx
  mov    $0x1,%edx
  mov    $0x4,%esi
  mov    %rax,%rdi
  call   <fread@plt>
  cmp    $0x1,%eax
  je     L18
  lea    D171(%rip),%rax
  mov    %rax,%rdi
  call   <pexit@plt>
L18:
  mov    -0x2c(%rbp),%eax
  mov    %eax,%esi
  lea    D102(%rip),%rax
  mov    %rax,%rdi
  call   <printf@plt>
  mov    -0x18(%rbp),%rdx
  lea    -0x28(%rbp),%rax
  mov    %rdx,%rcx
  mov    $0x1,%edx
  mov    $0x4,%esi
  mov    %rax,%rdi
  call   <fread@plt>
  cmp    $0x1,%eax
  je     L70
  lea    D171(%rip),%rax
  mov    %rax,%rdi
  call   <pexit@plt>
L70:
  mov    -0x28(%rbp),%eax
  mov    %eax,%esi
  lea    D148(%rip),%rax
  mov    %rax,%rdi
  call   <printf@plt>
  mov    -0x18(%rbp),%rdx
  lea    -0x24(%rbp),%rax
  mov    %rdx,%rcx
  mov    $0x1,%edx
  mov    $0x4,%esi
  mov    %rax,%rdi
  call   <fread@plt>
  cmp    $0x1,%eax
  je     L96
  lea    D171(%rip),%rax
  mov    %rax,%rdi
  call   <pexit@plt>
L96:
  mov    -0x24(%rbp),%eax
  mov    %eax,%esi
  lea    D184(%rip),%rax
  mov    %rax,%rdi
  call   <printf@plt>
  mov    -0x18(%rbp),%rax
  mov    %rax,%rdi
  call   <fclose@plt>
  mov    -0x10(%rbp),%rax
  mov    %rax,%rdi
  call   <fclose@plt>
  test   %rax,%rax
  je     L105
  lea    D83(%rip),%rax
  mov    %rax,%rdi
  call   <pexit@plt>
L105:
  mov    $0x0,%eax
  mov    -0x8(%rbp),%rdx
  sub    %fs:0x28,%rdx
  je     L68
  call   <__stack_chk_fail@plt>
L68:
  leave
  ret
```

tool_calls: name: disassemble_data
arguments: tag: D84
type_guessed: string
name: disassemble_data
arguments: tag: D29
type_guessed: string
name: disassemble_data
arguments: tag: D159
type_guessed: string
name: disassemble_data
arguments: tag: D171
type_guessed: string
name: disassemble_data
arguments: tag: D198
type_guessed: string
name: disassemble_data
arguments: tag: D15
type_guessed: string
name: disassemble_data
arguments: tag: D26
type_guessed: string
name: disassemble_data
arguments: tag: D27
type_guessed: string
name: disassemble_data
arguments: tag: D103
type_guessed: string
name: disassemble_data
arguments: tag: D102
type_guessed: string
name: disassemble_data
arguments: tag: D148
type_guessed: string
name: disassemble_data
arguments: tag: D184
type_guessed: string
name: disassemble_data
arguments: tag: D83
type_guessed: string

tool: D84: rb

tool: D29: fopen

tool: D159: w+b

tool: D171: fread

tool: D198: MAGIC=0x%X


tool: D15: RECLENGHT=0x%X


tool: D26: LOADADDR=0x%X


tool: D27: fwrite

tool: D103: CHECKSUM_CALC=0x%X


tool: D102: CHECKSUM=0x%X


tool: D148: ZERO=0x%X


tool: D184: ENTRY=0x%X


tool: D83: fclose

assistant: ```c
int main(int argc, char *argv[]) {
  FILE *in = NULL, *out = NULL;
  uint8_t buf;
  uint32_t magic = 0xfeed1281L;
  uint32_t reclength = 0;
  uint32_t loadaddress = 0;
  uint32_t checksum = 0;
  uint32_t checksum_calc = 0;
  uint32_t compsize = 0;
  uint32_t zero = 0;
  uint32_t entry = 0;
  if (argc != 3)
    usage();
  in = fopen(argv[1], "rb");
  if (!in)
    pexit("fopen");
  out = fopen(argv[2], "w+b");
  if (!out)
    pexit("fopen");
  if (1 != fread(&magic, sizeof magic, 1, in))
    pexit("fread");
  printf("MAGIC=0x%X\n", magic);
  if (1 != fread(&reclength, sizeof reclength, 1, in))
    pexit("fread");
  printf("RECLENGHT=0x%X\n", reclength);
  if (1 != fread(&loadaddress, sizeof loadaddress, 1, in))
    pexit("fread");
  printf("LOADADDR=0x%X\n", loadaddress);
  checksum_calc = reclength + loadaddress;
  while (compsize < reclength) {
    if (1 != fread(&buf, sizeof buf, 1, in))
      pexit("fread");
    compsize++;
    if (1 != fwrite(&buf, sizeof buf, 1, out))
      pexit("fwrite");
    checksum_calc += buf;
  }
  checksum_calc = ~checksum_calc + 1;
  printf("CHECKSUM_CALC=0x%X\n", checksum_calc);
  if (1 != fread(&checksum, sizeof checksum, 1, in))
    pexit("fread");
  printf("CHECKSUM=0x%X\n", checksum);
  if (1 != fread(&zero, sizeof zero, 1, in))
    pexit("fread");
  printf("ZERO=0x%X\n", zero);
  if (1 != fread(&entry, sizeof entry, 1, in))
    pexit("fread");
  printf("ENTRY=0x%X\n", entry);
  fclose(in);
  if (fclose(out))
    pexit("fclose");
  return 0;
}
```