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

```asm
<readNumOfBytes>:
  endbr64
  push   %r13
  xor    %eax,%eax
  mov    %rdi,%r13
  lea    D14(%rip),%rdi
  push   %r12
  mov    %esi,%r12d
  push   %rbp
  push   %rbx
  sub    $0x8,%rsp
  mov    D68(%rip),%edx
  call   <printf@plt>
  test   %r12d,%r12d
  jg     L13
  add    $0x8,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
  nopl   0x0(%rax,%rax,1)
L13:
  mov    %r12d,%edi
  call   <malloc@plt>
  mov    %rax,%rbp
  test   %r13,%r13
  je     L11
  mov    %rax,%rdi
  mov    %r13,%rcx
  mov    %r12d,%edx
  mov    $0x1,%esi
  call   <fread@plt>
  mov    %r13,%rdi
  call   <feof@plt>
  test   %rax,%rax
  jne    L108
L89:
  xor    %ebx,%ebx
  lea    D51(%rip),%r13
  jmp    L52
  nop
L86:
  add    $0x1,%rbp
  cmp    %r12d,%ebx
  jge    L87
L52:
  movzbl 0x0(%rbp),%esi
  mov    %r13,%rdi
  xor    %eax,%eax
  add    $0x1,%ebx
  call   <printf@plt>
  imul   $0xcccccccd,%ebx,%edx
  ror    %edx
  cmp    $0x19999999,%edx
  ja     L86
  mov    $0xa,%edi
  add    $0x1,%rbp
  call   <putchar@plt>
  cmp    %r12d,%ebx
  jl     L52
L87:
  lea    D19(%rip),%rdi
  call   <puts@plt>
  add    %r12d,D25(%rip)
  add    $0x8,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
  nopl   0x0(%rax,%rax,1)
L108:
  mov    %r13,%rdi
  call   <ftell@plt>
  cmp    %eax,D25(%rip)
  mov    %eax,%ebx
  jl     L65
  lea    D25(%rip),%rdi
  xor    %r12d,%r12d
  call   <puts@plt>
  jmp    L87
  nopl   0x0(%rax,%rax,1)
L11:
  add    $0x8,%rsp
  lea    D4(%rip),%rdi
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  jmp    10c0 <puts@plt>
  xchg   %ax,%ax
L65:
  mov    %r12d,%esi
  lea    D90(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
  lea    D102(%rip),%rdi
  call   <puts@plt>
  sub    D25(%rip),%ebx
  mov    %ebx,%r12d
  test   %ebx,%ebx
  jg     L89
  jmp    L87
```

tool_calls: name: read_data
arguments: tag: D14
type_infered: string
name: read_data
arguments: tag: D51
type_infered: string
name: read_data
arguments: tag: D19
type_infered: string
name: read_data
arguments: tag: D25
type_infered: string
name: read_data
arguments: tag: D4
type_infered: string
name: read_data
arguments: tag: D90
type_infered: string
name: read_data
arguments: tag: D102
type_infered: string

tool: D14: First entering funcall:
size = %d
bytesRead = %d


tool: D51: %02x 

tool: D19: 



tool: D25: 
Error: File ran out of data!

tool: D4: Sorry, file does not exist!


tool: D90: Sorry, there was less than %d bytes of data in the file!


tool: D102: The size was adjusted accordingly...


assistant: ```c
void readNumOfBytes(FILE *fp, int size, unsigned char *p_buffer) {
  static int bytesRead = 0;
  int flag = 0;
  int oldSize = 0;
  printf("First entering funcall:\nsize = %d\nbytesRead = %d\n", size, bytesRead);
  if (size > 0) {
    p_buffer = (unsigned char *)malloc(sizeof(unsigned char) * size);
    if (fp == NULL)
      printf("Sorry, file does not exist!\n\n");
    else {
      fread(p_buffer, 1, size, fp);
      if (feof(fp)) {
        oldSize = size;
        size = ftell(fp);
        flag = 1;
      }
      if (flag) {
        if (bytesRead >= size) {
          size = 0;
          printf("\nError: File ran out of data!\n");
        } else {
          printf("Sorry, there was less than %d bytes of data in the file!\n", oldSize);
          printf("The size was adjusted accordingly...\n\n");
          size -= bytesRead;
        }
      }
      for (int i = 0; i < size && i >= 0; i++) {
        printf("%02x ", p_buffer[i]);
        if (!((i + 1) % 10))
          printf("\n");
      }
      printf("\n\n\n");
      bytesRead += size;
    }
  }
}
```