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

```asm
<random_bench>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  mov    %edi,%ebp
  push   %rbx
  lea    D23(%rip),%rbx
  mov    %rbx,%r13
  lea    0x40000(%rbx),%r12
  sub    $0x18,%rsp
  mov    %esi,0x4(%rsp)
  nopl   0x0(%rax)
L59:
  xor    %eax,%eax
  add    $0x4,%r13
  call   <rand@plt>
  movslq %eax,%rdx
  mov    %eax,%ecx
  imul   $0x666665c3,%rdx,%rdx
  sar    $0x1f,%ecx
  sar    $0x36,%rdx
  sub    %ecx,%edx
  imul   $0xa00001,%edx,%edx
  sub    %edx,%eax
  mov    %eax,-0x4(%r13)
  cmp    %r13,%r12
  jne    L59
  lea    D22(%rip),%r12
  mov    %r12,%r13
  lea    0x20000(%r12),%r14
  nopl   0x0(%rax,%rax,1)
L52:
  xor    %eax,%eax
  add    $0x4,%r13
  call   <rand@plt>
  cltd
  idiv   %ebp
  add    $0x1,%edx
  mov    %edx,-0x4(%r13)
  cmp    %r13,%r14
  jne    L52
  mov    $0x64,%edi
  call   <sleepms@plt>
  xor    %eax,%eax
  call   <gettime@plt>
  mov    %eax,0x8(%rsp)
  mov    0x4(%rsp),%eax
  test   %eax,%eax
  je     L53
  xor    %r15d,%r15d
  lea    D3(%rip),%r14
  lea    D55(%rip),%r13
  nopl   0x0(%rax)
L24:
  mov    %r15d,%ebp
  lea    (%r15,%r15,1),%eax
  lea    0x1(%r15),%r15d
  mov    %ebp,%edx
  and    $0x7fff,%edx
  mov    (%r12,%rdx,4),%r8d
  lea    0x1(%rax),%edx
  and    $0xfffe,%eax
  movzwl %dx,%edx
  movslq (%rbx,%rax,4),%rdi
  movslq (%rbx,%rdx,4),%rsi
  mov    %r8d,%edx
  add    %r13,%rdi
  add    %r14,%rsi
  call   <memcpy@plt>
  cmp    %r15d,0x4(%rsp)
  jne    L24
  xor    %eax,%eax
  xor    %r15d,%r15d
  call   <gettime@plt>
  mov    $0x64,%edi
  sub    0x8(%rsp),%eax
  mov    %eax,0xc(%rsp)
  call   <sleepms@plt>
  xor    %eax,%eax
  call   <gettime@plt>
  mov    %eax,0x8(%rsp)
  xchg   %ax,%ax
L46:
  lea    (%r15,%r15,1),%eax
  mov    %r15d,%r8d
  add    $0x1,%r15d
  lea    0x1(%rax),%esi
  mov    %r8d,%edx
  and    $0xfffe,%eax
  mov    %r8d,0x4(%rsp)
  movzwl %si,%esi
  movslq (%rbx,%rax,4),%rdi
  and    $0x7fff,%edx
  movslq (%rbx,%rsi,4),%rsi
  mov    (%r12,%rdx,4),%edx
  add    %r13,%rdi
  add    %r14,%rsi
  call   <memcpy_fast@plt>
  mov    0x4(%rsp),%r8d
  cmp    %ebp,%r8d
  jne    L46
L49:
  xor    %eax,%eax
  call   <gettime@plt>
  lea    D27(%rip),%rdi
  mov    %eax,%ebx
  call   <puts@plt>
  sub    0x8(%rsp),%ebx
  mov    0xc(%rsp),%edx
  xor    %eax,%eax
  add    $0x18,%rsp
  mov    %ebx,%esi
  lea    D57(%rip),%rdi
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  jmp    10c0 <printf@plt>
L53:
  xor    %eax,%eax
  call   <gettime@plt>
  mov    $0x64,%edi
  sub    0x8(%rsp),%eax
  mov    %eax,0xc(%rsp)
  call   <sleepms@plt>
  xor    %eax,%eax
  call   <gettime@plt>
  mov    %eax,0x8(%rsp)
  jmp    L49
```

tool_calls: name: disassemble_data
arguments: tag: D27
data_type: string
name: disassemble_data
arguments: tag: D57
data_type: string

tool: D27: benchmark random access:

tool: D57: memcpy_fast=%dms memcpy=%dms



assistant: ```c
void random_bench(int maxsize, int times) {
  static char A[11 * 1024 * 1024 + 2];
  static char B[11 * 1024 * 1024 + 2];
  static int random_offsets[0x10000];
  static int random_sizes[0x8000];
  unsigned int i, p1, p2;
  unsigned int t1, t2;
  for (i = 0; i < 0x10000; i++) {
    random_offsets[i] = rand() % (10 * 1024 * 1024 + 1);
  }
  for (i = 0; i < 0x8000; i++) {
    random_sizes[i] = 1 + rand() % maxsize;
  }
  sleepms(100);
  t1 = gettime();
  for (p1 = 0, p2 = 0, i = 0; i < times; i++) {
    int offset1 = random_offsets[(p1++) & 0xffff];
    int offset2 = random_offsets[(p1++) & 0xffff];
    int size = random_sizes[(p2++) & 0x7fff];
    memcpy(A + offset1, B + offset2, size);
  }
  t1 = gettime() - t1;
  sleepms(100);
  t2 = gettime();
  for (p1 = 0, p2 = 0, i = 0; i < times; i++) {
    int offset1 = random_offsets[(p1++) & 0xffff];
    int offset2 = random_offsets[(p1++) & 0xffff];
    int size = random_sizes[(p2++) & 0x7fff];
    memcpy_fast(A + offset1, B + offset2, size);
  }
  t2 = gettime() - t2;
  printf("benchmark random access:\n");
  printf("memcpy_fast=%dms memcpy=%dms\n\n", (int)t2, (int)t1);
}
```