user: 请将这段汇编代码片段转换成等效的C代码：

```asm
<getNum>:
  endbr64
  push   %r14
  xor    %edi,%edi
  push   %r13
  lea    D10(%rip),%r13
  push   %r12
  push   %rbp
  push   %rbx
  lea    D59(%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    %r13,%rdi
  lea    D24(%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),%r12d
  call   <fopen@plt>
  mov    $0x1c,%ecx
  mov    %rbp,%rdi
  mov    %rax,%r14
  xor    %eax,%eax
  rep stos %rax,%es:(%rdi)
  movl   $0x0,(%rdi)
  jmp    L149
  nopl   0x0(%rax,%rax,1)
L162:
  lea    0xc(%rsp),%rdx
  mov    %rbx,%rsi
  mov    %r14,%rdi
  call   <fscanf@plt>
  movslq 0xc(%rsp),%rax
  movl   $0x1,0x10(%rsp,%rax,4)
L149:
  mov    %r14,%rdi
  call   <feof@plt>
  test   %eax,%eax
  je     L162
  mov    %r14,%rdi
  lea    0x14(%rsp),%rbx
  call   <fclose@plt>
  mov    %rbx,%rax
  lea    0xf4(%rsp),%rdx
  jmp    L152
  nopl   0x0(%rax,%rax,1)
L119:
  add    $0x4,%rax
  cmp    %rax,%rdx
  je     L48
L152:
  mov    (%rax),%ecx
  test   %ecx,%ecx
  jne    L119
  lea    D30(%rip),%r14
L84:
  test   %r12d,%r12d
  je     L159
  nopw   0x0(%rax,%rax,1)
L53:
  movslq %r12d,%rcx
  mov    $0x38,%eax
  mov    0x10(%rsp,%rcx,4),%edx
  jmp    L111
  xchg   %ax,%ax
L154:
  sub    $0x1,%eax
  je     L7
L111:
  cmp    $0x1,%edx
  jne    L154
  xor    %eax,%eax
  call   <rand@plt>
  movslq %eax,%rdx
  mov    %rdx,%r12
  imul   $0xffffffff92492493,%rdx,%rdx
  mov    %r12d,%eax
  sar    $0x1f,%eax
  shr    $0x20,%rdx
  add    %r12d,%edx
  sar    $0x5,%edx
  sub    %eax,%edx
  imul   $0x38,%edx,%edx
  sub    %edx,%r12d
  add    $0x1,%r12d
  jne    L53
L159:
  xor    %r12d,%r12d
  jmp    L122
  nopl   0x0(%rax)
L7:
  movl   $0x1,0x10(%rsp,%rcx,4)
L122:
  mov    %r14,%rsi
  mov    %r13,%rdi
  mov    $0x1,%ebx
  call   <fopen@plt>
  lea    D55(%rip),%r14
  mov    %rax,%r13
  jmp    L144
  nopl   0x0(%rax)
L113:
  add    $0x1,%rbx
  cmp    $0x39,%rbx
  je     L115
L144:
  cmpl   $0x1,0x0(%rbp,%rbx,4)
  mov    %ebx,%edx
  jne    L113
  mov    %r14,%rsi
  mov    %r13,%rdi
  xor    %eax,%eax
  add    $0x1,%rbx
  call   <fprintf@plt>
  cmp    $0x39,%rbx
  jne    L144
L115:
  mov    %r13,%rdi
  call   <fclose@plt>
  mov    0xf8(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L126
  add    $0x100,%rsp
  mov    %r12d,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  ret
L48:
  lea    D30(%rip),%r14
  mov    %r13,%rdi
  mov    %r14,%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    L84
L126:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: disassemble_data
arguments: label: D10
data_type: string
name: disassemble_data
arguments: label: D59
data_type: string
name: disassemble_data
arguments: label: D24
data_type: string
name: disassemble_data
arguments: label: D30
data_type: string
name: disassemble_data
arguments: label: D55
data_type: string

tool: D10: previous.dat

tool: D59: %d

tool: D24: r

tool: D30: w

tool: D55: %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;
}
```