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

```asm
<benchmark>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  push   %r15
  push   %r14
  mov    %edi,%r14d
  push   %r13
  mov    %esi,%r13d
  push   %r12
  push   %rbx
  sub    $0x28,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,-0x38(%rbp)
  xor    %eax,%eax
  movslq %esi,%rax
  mov    %rsp,%rcx
  mov    %rax,-0x48(%rbp)
  lea    0xf(,%rax,8),%rax
  mov    %rax,%rsi
  mov    %rax,%rdx
  and    $0xfffffffffffff000,%rsi
  and    $0xfffffffffffffff0,%rdx
  sub    %rsi,%rcx
  cmp    %rcx,%rsp
  je     L88
L104:
  sub    $0x1000,%rsp
  orq    $0x0,0xff8(%rsp)
  cmp    %rcx,%rsp
  jne    L104
L88:
  and    $0xfff,%edx
  sub    %rdx,%rsp
  test   %rdx,%rdx
  jne    L20
L9:
  mov    %rax,%rdx
  mov    %rsp,%rcx
  and    $0xfffffffffffff000,%rax
  mov    %rsp,%rbx
  sub    %rax,%rcx
  and    $0xfffffffffffffff0,%rdx
  cmp    %rcx,%rsp
  je     L117
L46:
  sub    $0x1000,%rsp
  orq    $0x0,0xff8(%rsp)
  cmp    %rcx,%rsp
  jne    L46
L117:
  and    $0xfff,%edx
  sub    %rdx,%rsp
  test   %rdx,%rdx
  jne    L127
L48:
  mov    %rsp,%r12
  test   %r13d,%r13d
  jle    L86
  xor    %r15d,%r15d
  nopl   0x0(%rax)
L19:
  xor    %eax,%eax
  call   <rand_double@plt>
  mulsd  D20(%rip),%xmm0
  xor    %eax,%eax
  subsd  D0(%rip),%xmm0
  movsd  %xmm0,(%rbx,%r15,8)
  call   <rand_double@plt>
  mulsd  D20(%rip),%xmm0
  subsd  D0(%rip),%xmm0
  movsd  %xmm0,(%r12,%r15,8)
  add    $0x1,%r15
  cmp    %r15,-0x48(%rbp)
  jne    L19
L86:
  xor    %eax,%eax
  call   <tic@plt>
  movsd  %xmm0,-0x48(%rbp)
  test   %r14d,%r14d
  jle    L67
  xor    %r15d,%r15d
  jmp    L7
  xchg   %ax,%ax
L50:
  add    $0x1,%r15d
  cmp    %r15d,%r14d
  je     L67
L7:
  mov    $0x1,%r8d
  mov    %r12,%rcx
  mov    %rbx,%rsi
  mov    %r13d,%edi
  mov    $0x1,%edx
  call   <c_ddot@plt>
  ucomisd %xmm0,%xmm0
  jnp    L50
  lea    D29(%rip),%r12
  mov    %r12,%rdi
  call   <printf@plt>
  xor    %eax,%eax
  call   <tic@plt>
  subsd  -0x48(%rbp),%xmm0
  mov    %r12,%rdi
  movsd  %xmm0,-0x48(%rbp)
  call   <printf@plt>
  movsd  -0x48(%rbp),%xmm0
L72:
  mov    -0x38(%rbp),%rax
  sub    %fs:0x28,%rax
  jne    L14
  lea    -0x28(%rbp),%rsp
  pop    %rbx
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  pop    %rbp
  ret
  nopl   0x0(%rax,%rax,1)
L20:
  orq    $0x0,-0x8(%rsp,%rdx,1)
  jmp    L9
  nopl   0x0(%rax,%rax,1)
L67:
  xor    %eax,%eax
  call   <tic@plt>
  subsd  -0x48(%rbp),%xmm0
  jmp    L72
L127:
  orq    $0x0,-0x8(%rsp,%rdx,1)
  jmp    L48
L14:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: unpack_data
arguments: tag: D20
datatype: f64
name: unpack_data
arguments: tag: D0
datatype: f64
name: unpack_data
arguments: tag: D29
datatype: string

tool: D20: 20000

tool: D0: 10000

tool: D29: should not return NaN


assistant: ```c
double benchmark(int iterations, int len) {
  double elapsed;
  double x[len];
  double y[len];
  double z;
  double t;
  int i;
  for (i = 0; i < len; i++) {
    x[i] = (rand_double() * 20000.0) - 10000.0;
    y[i] = (rand_double() * 20000.0) - 10000.0;
  }
  z = 0.0;
  t = tic();
  for (i = 0; i < iterations; i++) {
    z = c_ddot(len, x, 1, y, 1);
    if (z != z) {
      printf("should not return NaN\n");
      break;
    }
  }
  elapsed = tic() - t;
  if (z != z) {
    printf("should not return NaN\n");
  }
  return elapsed;
}
```