user: 请将这段汇编代码片段转换成等效的C代码:

```asm
<main>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x1000,%rsp
  orq    $0x0,(%rsp)
  sub    $0x480,%rsp
  mov    %edi,-0x1474(%rbp)
  mov    %rsi,-0x1480(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  movl   $0x0,-0x1440(%rbp)
  movl   $0x1,-0x1460(%rbp)
  mov    -0x1474(%rbp),%eax
  cmp    -0x1460(%rbp),%eax
  jg     L33
  mov    $0x0,%eax
  call   <usage@plt>
  jmp    L87
L33:
  movl   $0x0,-0x145c(%rbp)
  movl   $0x0,-0x1458(%rbp)
  mov    -0x1460(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x1480(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rax
  lea    D69(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  jne    L147
  movl   $0x1,-0x145c(%rbp)
  addl   $0x1,-0x1460(%rbp)
  jmp    L5
L147:
  mov    -0x1460(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x1480(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rax
  lea    D63(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  jne    L5
  movl   $0x1,-0x145c(%rbp)
  movl   $0x1,-0x1458(%rbp)
  addl   $0x1,-0x1460(%rbp)
L5:
  cmpl   $0x0,-0x1458(%rbp)
  je     L251
  lea    D7(%rip),%rax
  mov    %rax,%rdi
  call   <puts@plt>
L251:
  cmpl   $0x0,-0x145c(%rbp)
  je     L40
  lea    D31(%rip),%rax
  mov    %rax,%rdi
  call   <puts@plt>
L40:
  mov    -0x1474(%rbp),%eax
  cmp    -0x1460(%rbp),%eax
  jg     L39
  mov    $0x0,%eax
  call   <usage@plt>
  jmp    L87
L39:
  mov    -0x1460(%rbp),%eax
  lea    0x1(%rax),%edx
  mov    %edx,-0x1460(%rbp)
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x1480(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rax
  mov    %rax,-0x1430(%rbp)
  mov    -0x1474(%rbp),%eax
  cmp    -0x1460(%rbp),%eax
  jg     L108
  mov    $0x0,%eax
  call   <usage@plt>
  jmp    L87
L108:
  mov    -0x1460(%rbp),%eax
  lea    0x1(%rax),%edx
  mov    %edx,-0x1460(%rbp)
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x1480(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rax
  mov    %rax,-0x1428(%rbp)
  movl   $0x7fffffff,-0x1454(%rbp)
  mov    -0x1474(%rbp),%eax
  cmp    -0x1460(%rbp),%eax
  jle    L197
  mov    -0x1460(%rbp),%eax
  lea    0x1(%rax),%edx
  mov    %edx,-0x1460(%rbp)
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x1480(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rax
  mov    $0x10,%edx
  mov    $0x0,%esi
  mov    %rax,%rdi
  call   <strtol@plt>
  mov    %eax,-0x1454(%rbp)
L197:
  mov    -0x1430(%rbp),%rax
  lea    D47(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <fopen@plt>
  mov    %rax,-0x1420(%rbp)
  cmpq   $0x0,-0x1420(%rbp)
  jne    L3
  mov    -0x1430(%rbp),%rax
  mov    %rax,%rsi
  lea    D15(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  mov    $0x1,%eax
  jmp    L87
L3:
  mov    -0x1428(%rbp),%rax
  lea    D68(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <fopen@plt>
  mov    %rax,-0x1418(%rbp)
  cmpq   $0x0,-0x1418(%rbp)
  jne    L19
  mov    -0x1428(%rbp),%rax
  mov    %rax,%rsi
  lea    D15(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  mov    -0x1420(%rbp),%rax
  mov    %rax,%rdi
  call   <fclose@plt>
  mov    $0x1,%eax
  jmp    L87
L19:
  movl   $0x0,-0x1468(%rbp)
  jmp    L179
L226:
  mov    -0x1468(%rbp),%eax
  mov    %eax,-0x1450(%rbp)
  movl   $0x0,-0x144c(%rbp)
  movl   $0x0,-0x1464(%rbp)
  jmp    L306
L200:
  shll   -0x144c(%rbp)
  mov    -0x1450(%rbp),%eax
  and    $0x1,%eax
  or     %eax,-0x144c(%rbp)
  sarl   -0x1450(%rbp)
  addl   $0x1,-0x1464(%rbp)
L306:
  cmpl   $0x7,-0x1464(%rbp)
  jle    L200
  mov    -0x1468(%rbp),%eax
  cltq
  mov    -0x144c(%rbp),%edx
  mov    %edx,-0x1410(%rbp,%rax,4)
  addl   $0x1,-0x1468(%rbp)
L179:
  cmpl   $0xff,-0x1468(%rbp)
  jle    L226
  movl   $0xf,-0x1448(%rbp)
  jmp    L84
L131:
  mov    -0x1454(%rbp),%eax
  mov    $0x1000,%edx
  cmp    %edx,%eax
  cmovg  %edx,%eax
  mov    %eax,-0x143c(%rbp)
  mov    -0x143c(%rbp),%eax
  sub    %eax,-0x1454(%rbp)
  mov    -0x1420(%rbp),%rcx
  mov    -0x143c(%rbp),%edx
  lea    -0x1010(%rbp),%rax
  mov    $0x1,%esi
  mov    %rax,%rdi
  call   <fread@plt>
  mov    %eax,-0x1438(%rbp)
  movl   $0x0,-0x1444(%rbp)
  cmpl   $0x0,-0x145c(%rbp)
  je     L24
  movl   $0x0,-0x1468(%rbp)
  jmp    L214
L263:
  mov    -0x1468(%rbp),%eax
  cltq
  movzbl -0x1010(%rbp,%rax,1),%eax
  cmp    $0xff,%al
  jne    L287
  mov    -0x1468(%rbp),%eax
  mov    %eax,-0x1444(%rbp)
  movl   $0x0,-0x145c(%rbp)
  mov    -0x1444(%rbp),%eax
  add    %eax,-0x1454(%rbp)
  jmp    L24
L287:
  addl   $0x1,-0x1468(%rbp)
L214:
  mov    -0x1468(%rbp),%eax
  cmp    -0x1438(%rbp),%eax
  jl     L263
L24:
  cmpl   $0x0,-0x1458(%rbp)
  je     L57
  movl   $0x0,-0x1468(%rbp)
  jmp    L67
L171:
  mov    -0x1468(%rbp),%eax
  cltq
  movzbl -0x1010(%rbp,%rax,1),%eax
  shr    $0x4,%al
  movzbl %al,%eax
  mov    %eax,-0x1434(%rbp)
  mov    -0x1468(%rbp),%eax
  cltq
  movzbl -0x1010(%rbp,%rax,1),%eax
  movzbl %al,%eax
  shl    $0x4,%eax
  mov    %eax,%edx
  mov    -0x1448(%rbp),%eax
  or     %edx,%eax
  mov    %eax,%edx
  mov    -0x1468(%rbp),%eax
  cltq
  mov    %dl,-0x1010(%rbp,%rax,1)
  mov    -0x1434(%rbp),%eax
  mov    %eax,-0x1448(%rbp)
  addl   $0x1,-0x1468(%rbp)
L67:
  mov    -0x1468(%rbp),%eax
  cmp    -0x1438(%rbp),%eax
  jl     L171
L57:
  movl   $0x0,-0x1468(%rbp)
  jmp    L290
L12:
  mov    -0x1468(%rbp),%eax
  cltq
  movzbl -0x1010(%rbp,%rax,1),%eax
  movzbl %al,%eax
  cltq
  mov    -0x1410(%rbp,%rax,4),%eax
  mov    %eax,%edx
  mov    -0x1468(%rbp),%eax
  cltq
  mov    %dl,-0x1010(%rbp,%rax,1)
  addl   $0x1,-0x1468(%rbp)
L290:
  mov    -0x1468(%rbp),%eax
  cmp    -0x1438(%rbp),%eax
  jl     L12
  mov    -0x1438(%rbp),%eax
  sub    -0x1444(%rbp),%eax
  lea    -0x1010(%rbp),%rcx
  mov    -0x1444(%rbp),%edx
  movslq %edx,%rdx
  lea    (%rcx,%rdx,1),%rdi
  mov    -0x1418(%rbp),%rdx
  mov    %rdx,%rcx
  mov    %eax,%edx
  mov    $0x1,%esi
  call   <fwrite@plt>
L84:
  mov    -0x1420(%rbp),%rax
  mov    %rax,%rdi
  call   <feof@plt>
  test   %eax,%eax
  jne    L196
  cmpl   $0x0,-0x1454(%rbp)
  jne    L131
L196:
  mov    -0x1420(%rbp),%rax
  mov    %rax,%rdi
  call   <fclose@plt>
  mov    -0x1418(%rbp),%rax
  mov    %rax,%rdi
  call   <fclose@plt>
  mov    $0x0,%eax
L87:
  mov    -0x8(%rbp),%rdx
  sub    %fs:0x28,%rdx
  je     L183
  call   <__stack_chk_fail@plt>
L183:
  leave
  ret
```

tool_calls: name: parse_data
arguments: label: D69
datatype: string
name: parse_data
arguments: label: D63
datatype: string
name: parse_data
arguments: label: D7
datatype: string
name: parse_data
arguments: label: D31
datatype: string
name: parse_data
arguments: label: D47
datatype: string
name: parse_data
arguments: label: D15
datatype: string
name: parse_data
arguments: label: D68
datatype: string

tool: D69: -h

tool: D63: -n

tool: D7: NibbleShift Enabled

tool: D31: HeaderStrip Enabled

tool: D47: rb

tool: D15: Can't open file %s.


tool: D68: wb

assistant: ```c
int main(int argc, char **argv) {
  FILE *f;
  FILE *fo;
  unsigned char buffer[4096];
  char *filename, *filename2;
  int i, j, size;
  int argfail = 0;
  int argidx = 1;
  if (argc <= argidx) {
    return usage();
  }
  int headerStrip = 0;
  int nibbleShift = 0;
  if (strcmp(argv[argidx], "-h") == 0) {
    headerStrip = 1;
    argidx++;
  } else if (strcmp(argv[argidx], "-n") == 0) {
    headerStrip = 1;
    nibbleShift = 1;
    argidx++;
  }
  if (nibbleShift)
    printf("NibbleShift Enabled\n");
  if (headerStrip)
    printf("HeaderStrip Enabled\n");
  if (argc <= argidx) {
    return usage();
  }
  filename = argv[argidx++];
  if (argc <= argidx) {
    return usage();
  }
  filename2 = argv[argidx++];
  int truncate = 0x7FFFFFFF;
  if (argc > argidx) {
    truncate = (int)strtol(argv[argidx++], NULL, 16);
  }
  f = fopen(filename, "rb");
  if (!f) {
    printf("Can't open file %s.\n", filename);
    return 1;
  }
  fo = fopen(filename2, "wb");
  if (!fo) {
    printf("Can't open file %s.\n", filename2);
    fclose(f);
    return 1;
  }
  uint8_t swapped_bytes[256];
  for (i = 0; i < 256; i++) {
    uint8_t temp = (uint8_t)i;
    uint8_t swapped = 0;
    for (j = 0; j < 8; j++) {
      swapped <<= 1;
      swapped |= (temp & 1);
      temp >>= 1;
    }
    swapped_bytes[i] = swapped;
  }
  uint8_t nibble = 0x0F;
  uint8_t nibbleTemp;
  while (!feof(f) && (truncate)) {
    int now = (truncate > 4096) ? 4096 : truncate;
    truncate -= now;
    int read = fread((char *)buffer, 1, now, f);
    int start = 0;
    if (headerStrip) {
      for (i = 0; i < read; i++) {
        if (buffer[i] == 0xFF) {
          start = i;
          headerStrip = 0;
          truncate += start;
          break;
        }
      }
    }
    if (nibbleShift) {
      for (i = 0; i < read; i++) {
        nibbleTemp = buffer[i] >> 4;
        buffer[i] = (buffer[i] << 4) | nibble;
        nibble = nibbleTemp;
      }
    }
    for (i = 0; i < read; i++) {
      buffer[i] = swapped_bytes[buffer[i]];
    }
    fwrite(&buffer[start], 1, read - start, fo);
  }
  fclose(f);
  fclose(fo);
  return 0;
}
```