user: Translate the below assembly code into C programming language:

```asm
<main>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x888,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x878(%rsp)
  xor    %eax,%eax
  mov    $0x0,%edi
  call   <time@plt>
  mov    %eax,%edi
  call   <srand@plt>
  lea    D27(%rip),%rsi
  lea    D76(%rip),%rdi
  call   <fopen@plt>
  mov    %rax,%rbp
  mov    $0x186a0,%ebx
  lea    D75(%rip),%r12
L39:
  mov    $0x0,%eax
  call   <rand@plt>
  movslq %eax,%rcx
  imul   $0x7fc01ff1,%rcx,%rcx
  sar    $0x28,%rcx
  cltd
  sub    %edx,%ecx
  mov    %ecx,%edx
  shl    $0x9,%edx
  add    %edx,%ecx
  mov    %eax,%edx
  sub    %ecx,%edx
  mov    %r12,%rsi
  mov    %rbp,%rdi
  call   <fprintf@plt>
  sub    $0x1,%ebx
  jne    L39
  mov    %rbp,%rdi
  call   <fclose@plt>
  lea    D55(%rip),%rsi
  lea    D76(%rip),%rdi
  call   <fopen@plt>
  mov    %rax,%rbx
  mov    %rsp,%rdi
  mov    $0x100,%ecx
  mov    $0x0,%eax
  rep stos %rax,%es:(%rdi)
  movl   $0x0,(%rdi)
  lea    0x810(%rsp),%rbp
L81:
  mov    %rbx,%rdi
  call   <feof@plt>
  test   %eax,%eax
  jne    L36
  movq   $0x0,0x810(%rsp)
  movq   $0x0,0x818(%rsp)
  movq   $0x0,0x820(%rsp)
  movq   $0x0,0x828(%rsp)
  movq   $0x0,0x830(%rsp)
  movq   $0x0,0x838(%rsp)
  movq   $0x0,0x840(%rsp)
  movq   $0x0,0x848(%rsp)
  movq   $0x0,0x850(%rsp)
  movq   $0x0,0x858(%rsp)
  movq   $0x0,0x860(%rsp)
  movq   $0x0,0x868(%rsp)
  movl   $0x0,0x870(%rsp)
  mov    %rbx,%rdx
  mov    $0x64,%esi
  mov    %rbp,%rdi
  call   <fgets@plt>
  cmpb   $0x0,0x810(%rsp)
  je     L81
  mov    %rbp,%rdi
  call   <atoi@plt>
  cltq
  addl   $0x1,(%rsp,%rax,4)
  jmp    L81
L36:
  mov    %rbx,%rdi
  call   <fclose@plt>
  lea    D27(%rip),%rsi
  lea    D79(%rip),%rdi
  call   <fopen@plt>
  mov    %rax,%r13
  mov    $0x0,%r15d
  lea    D75(%rip),%r14
  jmp    L69
L29:
  mov    %r12d,%edx
  mov    %r14,%rsi
  mov    %r13,%rdi
  call   <fprintf@plt>
  add    $0x1,%ebx
  cmp    %ebp,%ebx
  jne    L29
L64:
  add    $0x1,%r15
  cmp    $0x201,%r15
  je     L61
L69:
  mov    %r15d,%r12d
  mov    (%rsp,%r15,4),%ebp
  mov    $0x0,%ebx
  test   %ebp,%ebp
  jg     L29
  jmp    L64
L61:
  mov    %r13,%rdi
  call   <fclose@plt>
  lea    D40(%rip),%rdi
  call   <printf@plt>
  mov    0x878(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L87
  mov    $0x0,%eax
  add    $0x888,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L87:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: extract_symbolic_data
arguments: data_tag: D27
type_guessed: string
name: extract_symbolic_data
arguments: data_tag: D76
type_guessed: string
name: extract_symbolic_data
arguments: data_tag: D75
type_guessed: string
name: extract_symbolic_data
arguments: data_tag: D55
type_guessed: string
name: extract_symbolic_data
arguments: data_tag: D79
type_guessed: string
name: extract_symbolic_data
arguments: data_tag: D40
type_guessed: string

tool: D27: w

tool: D76: D:\temp\a.txt

tool: D75: %d


tool: D55: r

tool: D79: D:\temp\b.txt

tool: D40: end


assistant: ```c
int main(void) {
  srand((unsigned int)time(NULL));
  int i;
  FILE *p = fopen("D:\\temp\\a.txt", "w");
  for (i = 0; i < 100000; i++) {
    fprintf(p, "%d\n", (int)rand() % 513);
  }
  fclose(p);
  p = fopen("D:\\temp\\a.txt", "r");
  int array[513] = {0};
  while (!feof(p)) {
    char buf[100] = {0};
    fgets(buf, sizeof(buf), p);
    if (buf[0] != 0) {
      int value = atoi(buf);
      array[value]++;
    }
  }
  fclose(p);
  p = fopen("D:\\temp\\b.txt", "w");
  int j;
  for (i = 0; i < 513; i++) {
    for (j = 0; j < array[i]; j++) {
      fprintf(p, "%d\n", i);
    }
  }
  fclose(p);
  printf("end\n");
  return 0;
}
```