user: 请从给定的汇编指令推导出C源代码：

```asm
<main>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x1000,%rsp
  orq    $0x0,(%rsp)
  sub    $0x428,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x1418(%rsp)
  xor    %eax,%eax
  cmp    $0x1,%edi
  jle    L183
  mov    %edi,%ebp
  mov    0x8(%rsi),%rdi
  mov    %rsi,%r14
  lea    D42(%rip),%rsi
  call   <strcmp@plt>
  movl   $0x0,0xc(%rsp)
  test   %rax,%rax
  jne    L341
L87:
  lea    D19(%rip),%rdi
  call   <puts@plt>
  cmp    $0x2,%ebp
  je     L183
  mov    $0x1,%r12d
  mov    $0x2,%eax
L314:
  movslq %eax,%rcx
  mov    (%r14,%rcx,8),%r13
  lea    0x0(,%rcx,8),%rdx
  lea    0x1(%rax),%ecx
  cmp    %ecx,%ebp
  jle    L183
  add    $0x2,%eax
  mov    0x8(%r14,%rdx,1),%r15
  mov    $0x7fffffff,%ebx
  cmp    %eax,%ebp
  jg     L265
L106:
  lea    D23(%rip),%rsi
  mov    %r13,%rdi
  call   <fopen@plt>
  mov    %rax,%rbp
  test   %rax,%rax
  je     L196
  mov    %r15,%rdi
  lea    D25(%rip),%rsi
  call   <fopen@plt>
  xor    %edi,%edi
  lea    0x10(%rsp),%r8
  mov    %rax,%r14
  test   %rax,%rax
  je     L136
  nop
L126:
  mov    %edi,%ecx
  mov    $0x8,%edx
  xor    %eax,%eax
  nopl   0x0(%rax)
L311:
  mov    %ecx,%esi
  add    %eax,%eax
  sar    %ecx
  and    $0x1,%esi
  or     %esi,%eax
  sub    $0x1,%edx
  jne    L311
  mov    %eax,(%r8,%rdi,4)
  add    $0x1,%rdi
  cmp    $0x100,%rdi
  jne    L126
  mov    %rbp,%rdi
  mov    $0xf,%r15d
  lea    0x410(%rsp),%r13
  call   <feof@plt>
  test   %ebx,%ebx
  je     L236
L113:
  test   %eax,%eax
  jne    L236
  mov    $0x1000,%edx
  mov    $0x1,%esi
  mov    %rbp,%rcx
  mov    %r13,%rdi
  cmp    %edx,%ebx
  cmovle %ebx,%edx
  sub    %edx,%ebx
  call   <fread@plt>
  mov    %eax,%esi
  test   %r12d,%r12d
  jne    L150
  mov    0xc(%rsp),%eax
  test   %eax,%eax
  jne    L380
  test   %esi,%esi
  jle    L31
L211:
  mov    %esi,%r9d
  mov    %r13,%rdi
L102:
  mov    %r13,%rax
  xor    %edx,%edx
  nopl   (%rax)
L261:
  movzbl (%rax),%ecx
  add    $0x1,%edx
  add    $0x1,%rax
  mov    0x10(%rsp,%rcx,4),%ecx
  mov    %cl,-0x1(%rax)
  cmp    %edx,%esi
  jg     L261
L294:
  mov    %r14,%rcx
  mov    %r9d,%edx
  mov    $0x1,%esi
  call   <fwrite@plt>
  mov    %rbp,%rdi
  call   <feof@plt>
  test   %ebx,%ebx
  jne    L113
L236:
  mov    %rbp,%rdi
  call   <fclose@plt>
  mov    %r14,%rdi
  call   <fclose@plt>
  xor    %eax,%eax
L82:
  mov    0x1418(%rsp),%rdx
  sub    %fs:0x28,%rdx
  jne    L372
  add    $0x1428,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L183:
  mov    0x1418(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L372
  add    $0x1428,%rsp
  xor    %eax,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  jmp    1170 <usage@plt>
L341:
  mov    0x8(%r14),%rdi
  lea    D40(%rip),%rsi
  call   <strcmp@plt>
  test   %rax,%rax
  jne    L297
  lea    D44(%rip),%rdi
  call   <puts@plt>
  movl   $0x1,0xc(%rsp)
  jmp    L87
L150:
  test   %eax,%eax
  jle    L262
  movslq %eax,%rdx
  xor    %eax,%eax
  jmp    L255
  nopl   0x0(%rax)
L220:
  add    $0x1,%rax
  cmp    %rax,%rdx
  je     L357
L255:
  cmpb   $0xff,(%rax,%r13,1)
  movslq %eax,%rcx
  jne    L220
  add    %ecx,%ebx
  cmpl   $0x0,0xc(%rsp)
  jne    L245
  mov    %esi,%r9d
  lea    0x0(%r13,%rcx,1),%rdi
  xor    %r12d,%r12d
  sub    %ecx,%r9d
  jmp    L102
L380:
  test   %esi,%esi
  jle    L31
L81:
  xor    %ecx,%ecx
L185:
  mov    %r13,%rdx
  xor    %edi,%edi
  cs nopw 0x0(%rax,%rax,1)
L197:
  movzbl (%rdx),%eax
  mov    %r15d,%r9d
  add    $0x1,%edi
  add    $0x1,%rdx
  mov    %eax,%r15d
  shl    $0x4,%eax
  shr    $0x4,%r15b
  or     %r9d,%eax
  mov    %al,-0x1(%rdx)
  movzbl %r15b,%r15d
  cmp    %edi,%esi
  jg     L197
  mov    %esi,%r9d
  lea    0x0(%r13,%rcx,1),%rdi
  sub    %ecx,%r9d
  jmp    L102
L31:
  mov    %esi,%r9d
  mov    %r13,%rdi
  jmp    L294
L357:
  cmpl   $0x0,0xc(%rsp)
  je     L211
  mov    0xc(%rsp),%r12d
  jmp    L81
L297:
  xor    %r12d,%r12d
  mov    $0x1,%eax
  jmp    L314
L265:
  mov    0x10(%r14,%rdx,1),%rdi
  xor    %esi,%esi
  mov    $0x10,%edx
  call   <strtol@plt>
  mov    %eax,%ebx
  jmp    L106
L196:
  mov    %r13,%rsi
  lea    D73(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
  mov    $0x1,%eax
  jmp    L82
L245:
  xor    %r12d,%r12d
  jmp    L185
L262:
  cmpl   $0x0,0xc(%rsp)
  je     L31
  mov    0xc(%rsp),%r12d
  mov    %esi,%r9d
  mov    %r13,%rdi
  jmp    L294
L136:
  mov    %r15,%rsi
  lea    D73(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
  mov    %rbp,%rdi
  call   <fclose@plt>
  mov    $0x1,%eax
  jmp    L82
L372:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: disassemble_data
arguments: label: D42
type_infered: string
name: disassemble_data
arguments: label: D19
type_infered: string
name: disassemble_data
arguments: label: D23
type_infered: string
name: disassemble_data
arguments: label: D25
type_infered: string
name: disassemble_data
arguments: label: D40
type_infered: string
name: disassemble_data
arguments: label: D44
type_infered: string
name: disassemble_data
arguments: label: D73
type_infered: string

tool: D42: -h

tool: D19: HeaderStrip Enabled

tool: D23: rb

tool: D25: wb

tool: D40: -n

tool: D44: NibbleShift Enabled

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


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;
}
```