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

```asm
<main>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x1000,%rsp
  orq    $0x0,(%rsp)
  sub    $0x38,%rsp
  mov    %rsi,%rbx
  mov    %fs:0x28,%rax
  mov    %rax,0x1028(%rsp)
  xor    %eax,%eax
  cmp    $0x3,%edi
  jne    L25
L129:
  mov    0x8(%rbx),%rdi
  lea    D92(%rip),%rsi
  call   <fopen@plt>
  mov    %rax,%r13
  test   %rax,%rax
  je     L114
L34:
  mov    0x10(%rbx),%rdi
  lea    D78(%rip),%rsi
  call   <fopen@plt>
  mov    %rax,(%rsp)
  test   %rax,%rax
  je     L6
L109:
  lea    D5(%rip),%rdi
  call   <puts@plt>
  lea    0x101e(%rsp),%rbx
  mov    %r13,%rdx
  mov    $0xa,%esi
  mov    %rbx,%rdi
  call   <fgets@plt>
  lea    0x10(%rsp),%rax
  mov    %rax,0x8(%rsp)
  lea    0x12(%rsp),%rdx
  lea    D98(%rip),%rsi
  mov    %rbx,%rdi
  call   <sscanf@plt>
  lea    0x6a(%rsp),%r12
  lea    0x472(%rsp),%r15
  lea    D98(%rip),%r14
L53:
  lea    -0x56(%r12),%rbx
L100:
  lea    0x101e(%rsp),%rbp
  mov    %r13,%rdx
  mov    $0xa,%esi
  mov    %rbp,%rdi
  call   <fgets@plt>
  mov    %rbx,%rdx
  mov    %r14,%rsi
  mov    %rbp,%rdi
  call   <sscanf@plt>
  add    $0x2,%rbx
  cmp    %r12,%rbx
  jne    L100
  add    $0x56,%r12
  cmp    %r15,%r12
  jne    L53
  movw   $0x205,0x10(%rsp)
  lea    0x10(%rsp),%rdi
  mov    (%rsp),%rbx
  mov    %rbx,%rcx
  mov    $0x206,%edx
  mov    $0x2,%esi
  call   <fwrite@plt>
  mov    %r13,%rdi
  call   <fclose@plt>
  mov    %rbx,%rdi
  call   <fclose@plt>
  movzwl 0x824(%rsp),%edx
  mov    $0x40c,%esi
  lea    D42(%rip),%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  mov    0x8(%rsp),%rbp
  add    $0x10,%rbp
  mov    $0x0,%r13d
  lea    D65(%rip),%r14
  lea    D12(%rip),%r12
  jmp    L127
L25:
  lea    D81(%rip),%rdi
  call   <puts@plt>
  mov    $0xffffffff,%edi
  call   <exit@plt>
  jmp    L129
L114:
  mov    0x8(%rbx),%rsi
  lea    D58(%rip),%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  mov    $0xffffffff,%edi
  call   <exit@plt>
  jmp    L34
L6:
  mov    0x10(%rbx),%rsi
  lea    D39(%rip),%rdi
  call   <printf@plt>
  mov    $0xffffffff,%edi
  call   <exit@plt>
  jmp    L109
L38:
  mov    $0xa,%edi
  call   <putchar@plt>
  add    $0x8,%r13d
  add    $0x10,%rbp
  cmp    $0x208,%r13d
  je     L33
L127:
  lea    0x0(%r13,%r13,1),%esi
  mov    %r14,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  lea    -0x10(%rbp),%rbx
L65:
  movzwl (%rbx),%esi
  mov    %r12,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  add    $0x2,%rbx
  cmp    %rbx,%rbp
  jne    L65
  jmp    L38
L33:
  mov    $0xa,%edi
  call   <putchar@plt>
  mov    0x1028(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L49
  mov    $0x0,%eax
  add    $0x1038,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L49:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: retrieve_data
arguments: label: D92
type_infered: string
name: retrieve_data
arguments: label: D78
type_infered: string
name: retrieve_data
arguments: label: D5
type_infered: string
name: retrieve_data
arguments: label: D98
type_infered: string
name: retrieve_data
arguments: label: D42
type_infered: string
name: retrieve_data
arguments: label: D65
type_infered: string
name: retrieve_data
arguments: label: D12
type_infered: string
name: retrieve_data
arguments: label: D81
type_infered: string
name: retrieve_data
arguments: label: D58
type_infered: string
name: retrieve_data
arguments: label: D39
type_infered: string

tool: D92: r

tool: D78: wb

tool: D5: Starting into the file

tool: D98: %04x


tool: D42: Wrote %d bytes, last value = 0x%04X


tool: D65: %04X:

tool: D12:  %04x

tool: D81: Invalid argument count

tool: D58: Cannot open %s for reading 


tool: D39: Cannot open %s for writing


assistant: ```c
main(int argc, char **argv) {
  FILE *fpin, *fpout;
  char inny[10];
  unsigned short outy[2048], *pouty;
  int i = 0, j, k;
  if (argc != 3) {
    printf("Invalid argument count\n");
    exit(-1);
  }
  if ((fpin = fopen(argv[1], "r")) == NULL) {
    printf("Cannot open %s for reading \n", argv[1]);
    exit(-1);
  }
  if ((fpout = fopen(argv[2], "wb")) == NULL) {
    printf("Cannot open %s for writing\n", argv[2]);
    exit(-1);
  }
  printf("Starting into the file\n");
  pouty = outy;
  pouty++;
  i++;
  fgets(inny, 10, fpin);
  sscanf(inny, "%04x\n", pouty);
  pouty++;
  i++;
  for (j = 0; j < 12; j++) {
    for (k = 0; k < 43; k++) {
      fgets(inny, 10, fpin);
      sscanf(inny, "%04x\n", pouty);
      pouty++;
      i++;
    }
  }
  outy[0] = i - 1;
  fwrite(outy, 2, i, fpout);
  fclose(fpin);
  fclose(fpout);
  printf("Wrote %d bytes, last value = 0x%04X\n", i * 2, pouty[i - 2]);
  for (j = 0; j < 1 + (12 * 43 + 2) / 8; j++) {
    printf("%04X:", j * 16);
    for (k = 0; k < 8; k++) {
      printf(" %04x", outy[j * 8 + k]);
    }
    printf("\n");
  }
  printf("\n");
}
```