user: Please show me the C implementation that matches the assembly code listed below:

```asm
<getNum>:
  endbr64
  push   %r14
  xor    %edi,%edi
  push   %r13
  push   %r12
  lea    D51(%rip),%r12
  push   %rbp
  push   %rbx
  lea    D33(%rip),%rbx
  sub    $0x100,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0xf8(%rsp)
  xor    %eax,%eax
  lea    0x10(%rsp),%rbp
  call   <time@plt>
  mov    %eax,%edi
  call   <srand@plt>
  xor    %eax,%eax
  call   <rand@plt>
  mov    %r12,%rdi
  lea    D16(%rip),%rsi
  movslq %eax,%rdx
  mov    %eax,%ecx
  imul   $0xffffffff92492493,%rdx,%rdx
  sar    $0x1f,%ecx
  shr    $0x20,%rdx
  add    %eax,%edx
  sar    $0x5,%edx
  sub    %ecx,%edx
  imul   $0x38,%edx,%edx
  sub    %edx,%eax
  lea    0x1(%rax),%r14d
  call   <fopen@plt>
  mov    $0x1c,%ecx
  mov    %rbp,%rdi
  mov    %rax,%r13
  xor    %eax,%eax
  rep stos %rax,%es:(%rdi)
  movl   $0x0,(%rdi)
  jmp    L114
  nopl   0x0(%rax,%rax,1)
L20:
  lea    0xc(%rsp),%rdx
  mov    %rbx,%rsi
  mov    %r13,%rdi
  call   <fscanf@plt>
  movslq 0xc(%rsp),%rax
  movl   $0x1,0x10(%rsp,%rax,4)
L114:
  mov    %r13,%rdi
  call   <feof@plt>
  test   %eax,%eax
  je     L20
  mov    %r13,%rdi
  lea    0x14(%rsp),%rbx
  call   <fclose@plt>
  mov    %rbx,%rax
  lea    0xf4(%rsp),%rdx
  jmp    L25
  nopl   0x0(%rax,%rax,1)
L108:
  add    $0x4,%rax
  cmp    %rax,%rdx
  je     L123
L25:
  mov    (%rax),%ecx
  test   %ecx,%ecx
  jne    L108
  lea    D40(%rip),%r13
L63:
  test   %r14d,%r14d
  je     L41
  nopl   0x0(%rax,%rax,1)
L17:
  movslq %r14d,%rax
  cmpl   $0x1,0x10(%rsp,%rax,4)
  je     L118
  movl   $0x1,0x10(%rsp,%rax,4)
L100:
  mov    %r13,%rsi
  mov    %r12,%rdi
  mov    $0x1,%ebx
  call   <fopen@plt>
  lea    D25(%rip),%r13
  mov    %rax,%r12
  jmp    L106
  nopw   0x0(%rax,%rax,1)
L109:
  add    $0x1,%rbx
  cmp    $0x39,%rbx
  je     L94
L106:
  cmpl   $0x1,0x0(%rbp,%rbx,4)
  mov    %ebx,%edx
  jne    L109
  mov    %r13,%rsi
  mov    %r12,%rdi
  xor    %eax,%eax
  add    $0x1,%rbx
  call   <fprintf@plt>
  cmp    $0x39,%rbx
  jne    L106
L94:
  mov    %r12,%rdi
  call   <fclose@plt>
  mov    0xf8(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L34
  add    $0x100,%rsp
  mov    %r14d,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  ret
L118:
  xor    %eax,%eax
  call   <rand@plt>
  movslq %eax,%rdx
  mov    %eax,%ecx
  imul   $0xffffffff92492493,%rdx,%rdx
  sar    $0x1f,%ecx
  shr    $0x20,%rdx
  add    %eax,%edx
  sar    $0x5,%edx
  sub    %ecx,%edx
  imul   $0x38,%edx,%edx
  sub    %edx,%eax
  add    $0x1,%eax
  mov    %eax,%r14d
  jne    L17
L41:
  xor    %r14d,%r14d
  jmp    L100
L123:
  lea    D40(%rip),%r13
  mov    %r12,%rdi
  mov    %r13,%rsi
  call   <fopen@plt>
  mov    %rax,%rdi
  call   <fclose@plt>
  lea    0x18(%rsp),%rdi
  mov    %rbx,%rcx
  xor    %eax,%eax
  movq   $0x0,0x14(%rsp)
  sub    %rdi,%rcx
  add    $0xe0,%ecx
  movq   $0x0,0xec(%rsp)
  shr    $0x3,%ecx
  rep stos %rax,%es:(%rdi)
  jmp    L63
L34:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: parse_data
arguments: tag: D51
type_guessed: string
name: parse_data
arguments: tag: D33
type_guessed: string
name: parse_data
arguments: tag: D16
type_guessed: string
name: parse_data
arguments: tag: D40
type_guessed: string
name: parse_data
arguments: tag: D25
type_guessed: string

tool: D51: previous.dat

tool: D33: %d

tool: D16: r

tool: D40: w

tool: D25: %d


assistant: ```c
int getNum() {
  int i;
  srand(time(NULL));
  int temp = (rand() % 56) + 1;
  int finalNum = 0;
  FILE *fp3;
  fp3 = fopen("previous.dat", "r");
  int readNums[57] = {0};
  int arrayTemp;
  while (!feof(fp3)) {
    fscanf(fp3, "%d", &arrayTemp);
    readNums[arrayTemp] = 1;
  }
  fclose(fp3);
  int nothingLeft = 1;
  for (i = 1; i < 57; ++i) {
    if (readNums[i] == 0) {
      nothingLeft = 0;
      break;
    }
  }
  if (nothingLeft == 1) {
    fp3 = fopen("previous.dat", "w");
    fprintf(fp3, "%s", "");
    fclose(fp3);
    for (i = 1; i < 57; ++i) {
      readNums[i] = 0;
    }
  }
  int isFinal = 1;
  while (finalNum != temp) {
    isFinal = 1;
    for (i = 1; i < 57; ++i) {
      if (readNums[temp] == 1) {
        isFinal = 0;
        temp = (rand() % 56) + 1;
        break;
      }
    }
    if (isFinal == 1) {
      finalNum = temp;
      readNums[finalNum] = 1;
    }
  }
  fp3 = fopen("previous.dat", "w");
  for (i = 1; i < 57; ++i) {
    if (readNums[i] == 1) {
      fprintf(fp3, "%d\n", i);
    }
  }
  fclose(fp3);
  return finalNum;
}
```