user: 请显示与下面列出的汇编代码相匹配的C语言实现：

```asm
<main>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbx
  sub    $0x38,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,-0x38(%rbp)
  xor    %eax,%eax
  lea    -0x10000(%rsp),%rax
  cmp    %rax,%rsp
  je     L33
L35:
  sub    $0x1000,%rsp
  orq    $0x0,0xff8(%rsp)
  cmp    %rax,%rsp
  jne    L35
L33:
  mov    %rsp,-0x50(%rbp)
  cmp    $0x3,%edi
  jne    L55
  mov    0x10(%rsi),%r14
  mov    0x8(%rsi),%rdi
  lea    D36(%rip),%rsi
  lea    D70(%rip),%r15
  lea    D3(%rip),%rbx
  call   <fopen@plt>
  mov    %r14,%rdi
  lea    D68(%rip),%rsi
  mov    %rax,%r12
  call   <fopen@plt>
  mov    $0x22,%edx
  mov    $0x1,%esi
  lea    D65(%rip),%rdi
  mov    %rax,%rcx
  mov    %rax,%r14
  call   <fwrite@plt>
  nopl   0x0(%rax,%rax,1)
L8:
  mov    -0x50(%rbp),%rdi
  mov    %r12,%rcx
  mov    $0xffff,%edx
  mov    $0x1,%esi
  call   <fread@plt>
  mov    %rax,-0x48(%rbp)
  test   %rax,%rax
  je     L11
  mov    -0x48(%rbp),%rax
  xor    %r13d,%r13d
  sub    $0x1,%rax
  mov    %rax,-0x58(%rbp)
  nopw   0x0(%rax,%rax,1)
L72:
  mov    %r12,%rdi
  call   <feof@plt>
  mov    %rbx,%rcx
  test   %rax,%rax
  je     L85
  cmp    %r13,-0x58(%rbp)
  lea    D49(%rip),%rcx
  cmovne %rbx,%rcx
L85:
  mov    -0x50(%rbp),%rax
  mov    %r15,%rsi
  mov    %r14,%rdi
  movzbl (%rax,%r13,1),%edx
  xor    %eax,%eax
  add    $0x1,%r13
  call   <fprintf@plt>
  cmp    %r13,-0x48(%rbp)
  jne    L72
  jmp    L8
L55:
  mov    (%rsi),%rsi
  lea    D46(%rip),%rdi
  call   <printf@plt>
  mov    $0x1,%eax
L59:
  mov    -0x38(%rbp),%rdx
  sub    %fs:0x28,%rdx
  jne    L54
  lea    -0x28(%rbp),%rsp
  pop    %rbx
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  pop    %rbp
  ret
L11:
  mov    %r14,%rcx
  mov    $0x3,%edx
  mov    $0x1,%esi
  lea    D2(%rip),%rdi
  call   <fwrite@plt>
  mov    %r12,%rdi
  call   <fclose@plt>
  mov    %r14,%rdi
  call   <fclose@plt>
  xor    %eax,%eax
  jmp    L59
L54:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: extract_symbolic_data
arguments: label: D36
type: string
name: extract_symbolic_data
arguments: label: D70
type: string
name: extract_symbolic_data
arguments: label: D3
type: string
name: extract_symbolic_data
arguments: label: D68
type: string
name: extract_symbolic_data
arguments: label: D65
type: string
name: extract_symbolic_data
arguments: label: D49
type: string
name: extract_symbolic_data
arguments: label: D46
type: string
name: extract_symbolic_data
arguments: label: D2
type: string

tool: D36: r

tool: D70:     0x%x%s


tool: D3: ,

tool: D68: w

tool: D65: unsigned char resource_data[] = {


tool: 

tool: D46: Usage: %s input.dat output.c


tool: D2: };


assistant: ```c
int main(int argc, char *argv[]) {
  char *fname_in;
  char *fname_out;
  FILE *fp_in;
  FILE *fp_out;
  const int BUFSIZE = 0xFFFF;
  unsigned char buf[BUFSIZE];
  size_t size;
  int i;
  if (argc != 3) {
    printf("Usage: %s input.dat output.c\n", argv[0]);
    return 1;
  }
  fname_in = argv[1];
  fname_out = argv[2];
  fp_in = fopen(fname_in, "r");
  fp_out = fopen(fname_out, "w");
  fprintf(fp_out, "unsigned char resource_data[] = {\n");
  while (size = fread(buf, 1, BUFSIZE, fp_in)) {
    for (i = 0; i < size; ++i) {
      int last = feof(fp_in) && i == size - 1;
      fprintf(fp_out, "    0x%x%s\n", buf[i], last ? "" : ",");
    }
  }
  fprintf(fp_out, "};\n");
  fclose(fp_in);
  fclose(fp_out);
  return 0;
}
```