user: What is the c source code of the assembly code below:

```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    L342
  mov    %edi,%ebx
  mov    %rsi,%r14
  mov    0x8(%rsi),%rdi
  lea    D14(%rip),%rsi
  call   <strcmp@plt>
  mov    $0x0,%r13d
  test   %rax,%rax
  jne    L314
L159:
  lea    D72(%rip),%rdi
  call   <puts@plt>
  mov    $0x2,%eax
  mov    $0x1,%r15d
L92:
  cmp    %eax,%ebx
  jle    L257
  movslq %eax,%rcx
  lea    0x0(,%rcx,8),%rdx
  mov    (%r14,%rcx,8),%r12
  lea    0x1(%rax),%ecx
  cmp    %ecx,%ebx
  jle    L336
  mov    0x8(%r14,%rdx,1),%rdi
  mov    %rdi,0x8(%rsp)
  add    $0x2,%eax
  mov    $0x7fffffff,%ebp
  cmp    %eax,%ebx
  jg     L321
L142:
  lea    D58(%rip),%rsi
  mov    %r12,%rdi
  call   <fopen@plt>
  mov    %rax,%r14
  test   %rax,%rax
  je     L302
  lea    D61(%rip),%rsi
  mov    0x8(%rsp),%rdi
  call   <fopen@plt>
  mov    %rax,(%rsp)
  mov    $0x0,%edi
  mov    $0x0,%r8d
  test   %rax,%rax
  jne    L21
  mov    0x8(%rsp),%rsi
  lea    D68(%rip),%rdi
  call   <printf@plt>
  mov    %r14,%rdi
  call   <fclose@plt>
  mov    $0x1,%eax
  jmp    L332
L342:
  call   <usage@plt>
  jmp    L332
L314:
  mov    0x8(%r14),%rdi
  lea    D75(%rip),%rsi
  call   <strcmp@plt>
  test   %rax,%rax
  je     L75
  mov    $0x1,%eax
  mov    $0x0,%r15d
  jmp    L92
L257:
  mov    $0x0,%eax
  call   <usage@plt>
  jmp    L332
L336:
  mov    $0x0,%eax
  call   <usage@plt>
  jmp    L332
L321:
  mov    0x10(%r14,%rdx,1),%rdi
  mov    $0x10,%edx
  mov    $0x0,%esi
  call   <strtol@plt>
  mov    %eax,%ebp
  jmp    L142
L302:
  mov    %r12,%rsi
  lea    D68(%rip),%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  mov    $0x1,%eax
  jmp    L332
L392:
  mov    %eax,0x10(%rsp,%rdi,4)
  add    $0x1,%rdi
  cmp    $0x100,%rdi
  je     L339
L21:
  mov    %edi,%ecx
  mov    $0x8,%edx
  mov    %r8d,%eax
L12:
  add    %eax,%eax
  mov    %ecx,%esi
  and    $0x1,%esi
  or     %esi,%eax
  sar    %ecx
  sub    $0x1,%edx
  jne    L12
  jmp    L392
L277:
  test   %eax,%eax
  jle    L343
  mov    %eax,%edx
  mov    $0x0,%eax
L10:
  mov    %eax,%edi
  cmpb   $0xff,(%rax,%r12,1)
  je     L220
  add    $0x1,%rax
  cmp    %rdx,%rax
  jne    L10
  mov    $0x0,%edi
  jmp    L335
L220:
  add    %eax,%ebp
  mov    $0x0,%r15d
L335:
  test   %r13d,%r13d
  jne    L363
L18:
  test   %esi,%esi
  jle    L36
L164:
  lea    0x410(%rsp),%rax
  mov    $0x0,%edx
L320:
  movzbl (%rax),%ecx
  mov    0x10(%rsp,%rcx,4),%ecx
  mov    %cl,(%rax)
  add    $0x1,%edx
  add    $0x1,%rax
  cmp    %edx,%esi
  jg     L320
L36:
  mov    %esi,%edx
  sub    %edi,%edx
  movslq %edi,%rdi
  add    %r12,%rdi
  mov    (%rsp),%rcx
  mov    $0x1,%esi
  call   <fwrite@plt>
L45:
  mov    %r14,%rdi
  call   <feof@plt>
  test   %ebp,%ebp
  je     L67
  test   %eax,%eax
  jne    L67
  mov    $0x1000,%edx
  cmp    %edx,%ebp
  cmovle %ebp,%edx
  sub    %edx,%ebp
  mov    %r14,%rcx
  mov    $0x1,%esi
  mov    %r12,%rdi
  call   <fread@plt>
  mov    %eax,%esi
  test   %r15d,%r15d
  jne    L277
  test   %r13d,%r13d
  jne    L111
  mov    %r13d,%edi
  mov    %r13d,%r15d
  jmp    L18
L111:
  test   %eax,%eax
  jle    L255
  mov    %r15d,%edi
L363:
  lea    0x410(%rsp),%rdx
  lea    -0x1(%rsi),%eax
  lea    0x411(%rsp,%rax,1),%r8
L222:
  movzbl (%rdx),%eax
  mov    %ebx,%ecx
  mov    %eax,%ebx
  shr    $0x4,%bl
  movzbl %bl,%ebx
  shl    $0x4,%eax
  or     %ecx,%eax
  mov    %al,(%rdx)
  add    $0x1,%rdx
  cmp    %r8,%rdx
  jne    L222
  jmp    L164
L255:
  mov    %r15d,%edi
  jmp    L36
L387:
  mov    %r13d,%r15d
  mov    $0x0,%edi
  jmp    L36
L339:
  mov    $0xf,%ebx
  lea    0x410(%rsp),%r12
  jmp    L45
L67:
  mov    %r14,%rdi
  call   <fclose@plt>
  mov    (%rsp),%rdi
  call   <fclose@plt>
  mov    $0x0,%eax
L332:
  mov    0x1418(%rsp),%rdx
  sub    %fs:0x28,%rdx
  jne    L31
  add    $0x1428,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L75:
  lea    D59(%rip),%rdi
  call   <puts@plt>
  mov    $0x1,%r13d
  jmp    L159
L343:
  test   %r13d,%r13d
  jne    L387
  mov    %r13d,%edi
  jmp    L18
L31:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: extract_symbolic_data
arguments: tag: D14
data_type: string
name: extract_symbolic_data
arguments: tag: D72
data_type: string
name: extract_symbolic_data
arguments: tag: D58
data_type: string
name: extract_symbolic_data
arguments: tag: D61
data_type: string
name: extract_symbolic_data
arguments: tag: D68
data_type: string
name: extract_symbolic_data
arguments: tag: D75
data_type: string
name: extract_symbolic_data
arguments: tag: D59
data_type: string

tool: D14: -h

tool: D72: HeaderStrip Enabled

tool: D58: rb

tool: D61: wb

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


tool: D75: -n

tool: D59: NibbleShift Enabled

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