user: What is the c source code of the assembly code below?

```asm
<getRandomHexChars>:
  endbr64
  push   %r13
  push   %r12
  push   %rbp
  mov    %esi,%ebp
  lea    D7(%rip),%rsi
  push   %rbx
  mov    %rdi,%rbx
  lea    D8(%rip),%rdi
  sub    $0x28,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x18(%rsp)
  xor    %eax,%eax
  call   <fopen@plt>
  mov    %rax,%r12
  test   %rax,%rax
  je     L5
  mov    %rax,%rcx
  mov    $0x1,%edx
  mov    %ebp,%esi
  mov    %rbx,%rdi
  call   <fread@plt>
  test   %rax,%rax
  jne    L130
L5:
  xor    %eax,%eax
  lea    0x10(%rsp),%r13
  call   <getpid@plt>
  xor    %esi,%esi
  mov    %r13,%rdi
  mov    %eax,0xc(%rsp)
  call   <gettimeofday@plt>
  cmp    $0x3,%ebp
  ja     L118
  test   %ebp,%ebp
  je     L116
L104:
  xor    %r13d,%r13d
  nopl   0x0(%rax,%rax,1)
L17:
  xor    %eax,%eax
  call   <rand@plt>
  xor    %al,(%rbx,%r13,1)
  add    $0x1,%r13
  cmp    %r13d,%ebp
  ja     L17
  test   %ebp,%ebp
  je     L116
L51:
  xor    %eax,%eax
  lea    D22(%rip),%rcx
  nopl   0x0(%rax)
L114:
  movzbl (%rbx,%rax,1),%edx
  and    $0xf,%edx
  movzbl (%rcx,%rdx,1),%edx
  mov    %dl,(%rbx,%rax,1)
  add    $0x1,%rax
  cmp    %eax,%ebp
  ja     L114
L116:
  test   %r12,%r12
  jne    L43
  mov    0x18(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L131
  add    $0x28,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
  nopw   0x0(%rax,%rax,1)
L130:
  test   %ebp,%ebp
  jne    L51
  nopl   0x0(%rax)
L43:
  mov    0x18(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L131
  add    $0x28,%rsp
  mov    %r12,%rdi
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  jmp    10e0 <fclose@plt>
  nopw   0x0(%rax,%rax,1)
L118:
  mov    %rbx,%rdi
  lea    0x14(%rsp),%rsi
  mov    $0x4,%edx
  call   <memcpy@plt>
  lea    -0x4(%rbp),%eax
  lea    0x4(%rbx),%rdi
  cmp    $0x3,%eax
  jbe    L104
  mov    $0x4,%edx
  mov    %r13,%rsi
  call   <memcpy@plt>
  lea    -0x8(%rbp),%eax
  lea    0x8(%rbx),%rdi
  cmp    $0x3,%eax
  jbe    L104
  lea    0xc(%rsp),%rsi
  mov    $0x4,%edx
  call   <memcpy@plt>
  jmp    L104
L131:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: extract_symbolic_data
arguments: data_label: D7
type_infered: string
name: extract_symbolic_data
arguments: data_label: D8
type_infered: string
name: extract_symbolic_data
arguments: data_label: D22
type_infered: string

tool: D7: r

tool: D8: /dev/urandom

tool: D22: 0123456789abcdef

assistant: ```c
void getRandomHexChars(char *p, unsigned int len) {
  FILE *fp = fopen("/dev/urandom", "r");
  char *charset = "0123456789abcdef";
  unsigned int j;
  if (fp == NULL || fread(p, len, 1, fp) == 0) {
    char *x = p;
    unsigned int l = len;
    struct timeval tv;
    pid_t pid = getpid();
    gettimeofday(&tv, NULL);
    if (l >= sizeof(tv.tv_usec)) {
      memcpy(x, &tv.tv_usec, sizeof(tv.tv_usec));
      l -= sizeof(tv.tv_usec);
      x += sizeof(tv.tv_usec);
    }
    if (l >= sizeof(tv.tv_sec)) {
      memcpy(x, &tv.tv_sec, sizeof(tv.tv_sec));
      l -= sizeof(tv.tv_sec);
      x += sizeof(tv.tv_sec);
    }
    if (l >= sizeof(pid)) {
      memcpy(x, &pid, sizeof(pid));
      l -= sizeof(pid);
      x += sizeof(pid);
    }
    for (j = 0; j < len; j++) {
      p[j] ^= rand();
    }
  }
  for (j = 0; j < len; j++) {
    p[j] = charset[p[j] & 0x0F];
  }
  if (fp) {
    fclose(fp);
  }
}
```