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

```asm
<CCC>:
  endbr64
  push   %rbp
  mov    %rdi,%r10
  mov    %rsp,%rbp
  push   %r15
  mov    %ecx,%r15d
  push   %r14
  push   %r13
  mov    %esi,%r13d
  push   %r12
  push   %rbx
  mov    %rdx,%rbx
  sub    $0x58,%rsp
  mov    %r8,-0x68(%rbp)
  mov    %r9,-0x70(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x38(%rbp)
  xor    %eax,%eax
  lea    0x1(%rsi),%eax
  mov    %rsp,%rsi
  cltq
  lea    0xf(,%rax,8),%rax
  mov    %rax,%rdx
  and    $0xfffffffffffff000,%rax
  sub    %rax,%rsi
  and    $0xfffffffffffffff0,%rdx
  cmp    %rsi,%rsp
  je     L86
L126:
  sub    $0x1000,%rsp
  orq    $0x0,0xff8(%rsp)
  cmp    %rsi,%rsp
  jne    L126
L86:
  and    $0xfff,%edx
  sub    %rdx,%rsp
  test   %rdx,%rdx
  jne    L133
L211:
  lea    0x1(%r15),%eax
  mov    %rsp,%rsi
  mov    %rsp,%r14
  cltq
  lea    0xf(,%rax,8),%rax
  mov    %rax,%rdx
  and    $0xfffffffffffff000,%rax
  sub    %rax,%rsi
  and    $0xfffffffffffffff0,%rdx
  cmp    %rsi,%rsp
  je     L181
L125:
  sub    $0x1000,%rsp
  orq    $0x0,0xff8(%rsp)
  cmp    %rsi,%rsp
  jne    L125
L181:
  and    $0xfff,%edx
  sub    %rdx,%rsp
  test   %rdx,%rdx
  jne    L158
L130:
  mov    %rsp,%r12
  test   %r13d,%r13d
  jle    L19
  movslq %r13d,%r11
  mov    %r10,%rsi
  mov    %r14,%rdi
  mov    %r10,-0x60(%rbp)
  shl    $0x3,%r11
  mov    %r11,%rdx
  mov    %r11,-0x78(%rbp)
  call   <memcpy@plt>
  test   %r15d,%r15d
  mov    -0x60(%rbp),%r10
  mov    -0x78(%rbp),%r11
  jle    L79
  movslq %r15d,%rdx
  mov    %rbx,%rsi
  mov    %r12,%rdi
  mov    %r11,-0x78(%rbp)
  shl    $0x3,%rdx
  mov    %r10,-0x60(%rbp)
  call   <memcpy@plt>
  sub    $0x8,%rsp
  mov    %r12,%rdx
  mov    %r13d,%esi
  push   $0x1
  mov    %r14,%rdi
  lea    -0x48(%rbp),%r9
  lea    -0x50(%rbp),%r8
  mov    %r15d,%ecx
  xor    %eax,%eax
  call   <CCC_posi@plt>
  pop    %rax
  mov    -0x60(%rbp),%rsi
  mov    %r14,%rdi
  pop    %rdx
  mov    -0x78(%rbp),%rdx
  call   <memcpy@plt>
L49:
  test   %r15d,%r15d
  mov    $0x1,%esi
  cmovg  %r15d,%esi
  cmp    $0x1,%r15d
  je     L155
  mov    %esi,%edx
  movapd D14(%rip),%xmm1
  xor    %eax,%eax
  shr    %edx
  shl    $0x4,%rdx
  nopl   0x0(%rax,%rax,1)
L187:
  movupd (%rbx,%rax,1),%xmm0
  xorpd  %xmm1,%xmm0
  movups %xmm0,(%r12,%rax,1)
  add    $0x10,%rax
  cmp    %rdx,%rax
  jne    L187
  mov    %esi,%eax
  and    $0xfffffffe,%eax
  cmp    %esi,%eax
  je     L169
L145:
  cltq
  movq   D24(%rip),%xmm1
  movsd  (%rbx,%rax,8),%xmm0
  xorpd  %xmm1,%xmm0
  movsd  %xmm0,(%r12,%rax,8)
L118:
  sub    $0x8,%rsp
  xor    %eax,%eax
  lea    -0x40(%rbp),%r9
  mov    %r15d,%ecx
  push   $0x1
  lea    -0x4c(%rbp),%r8
  mov    %r12,%rdx
  mov    %r13d,%esi
  mov    %r14,%rdi
  movaps %xmm1,-0x60(%rbp)
  call   <CCC_posi@plt>
  movsd  -0x40(%rbp),%xmm0
  movapd -0x60(%rbp),%xmm1
  cmpl   $0x1,0x10(%rbp)
  pop    %r11
  xorpd  %xmm1,%xmm0
  pop    %rbx
  movsd  %xmm0,-0x40(%rbp)
  je     L159
  cmpl   $0xffffffff,0x10(%rbp)
  jne    L56
  mov    -0x4c(%rbp),%eax
  mov    -0x68(%rbp),%rcx
  mov    %eax,(%rcx)
  mov    -0x70(%rbp),%rax
  movsd  %xmm0,(%rax)
L88:
  mov    -0x38(%rbp),%rax
  sub    %fs:0x28,%rax
  jne    L179
  lea    -0x28(%rbp),%rsp
  xor    %eax,%eax
  pop    %rbx
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  pop    %rbp
  ret
  nopl   (%rax)
L133:
  orq    $0x0,-0x8(%rsp,%rdx,1)
  jmp    L211
  nopl   0x0(%rax,%rax,1)
L159:
  mov    -0x50(%rbp),%eax
  mov    -0x68(%rbp),%rcx
  movsd  -0x48(%rbp),%xmm0
  mov    %eax,(%rcx)
  mov    -0x70(%rbp),%rax
  movsd  %xmm0,(%rax)
  jmp    L88
L79:
  sub    $0x8,%rsp
  lea    -0x48(%rbp),%r9
  mov    %r12,%rdx
  mov    %r13d,%esi
  push   $0x1
  mov    %r14,%rdi
  lea    -0x50(%rbp),%r8
  mov    %r15d,%ecx
  xor    %eax,%eax
  mov    %r10,-0x60(%rbp)
  mov    %r11,-0x78(%rbp)
  call   <CCC_posi@plt>
  mov    -0x78(%rbp),%rdx
  mov    -0x60(%rbp),%rsi
  mov    %r14,%rdi
  pop    %r9
  pop    %r10
  call   <memcpy@plt>
L169:
  movq   D24(%rip),%xmm1
  jmp    L118
  nopw   0x0(%rax,%rax,1)
L56:
  movsd  -0x48(%rbp),%xmm0
  call   <fabs@plt>
  movsd  -0x40(%rbp),%xmm0
  mov    %rax,%rbx
  call   <fabs@plt>
  cmp    %rax,%rbx
  jge    L159
  movsd  -0x48(%rbp),%xmm0
  call   <fabs@plt>
  movsd  -0x40(%rbp),%xmm0
  mov    %rax,%rbx
  call   <fabs@plt>
  cmp    %rax,%rbx
  jge    L88
  mov    -0x4c(%rbp),%eax
  mov    -0x68(%rbp),%rcx
  movsd  -0x40(%rbp),%xmm0
  mov    %eax,(%rcx)
  mov    -0x70(%rbp),%rax
  movsd  %xmm0,(%rax)
  jmp    L88
L19:
  test   %r15d,%r15d
  jle    L114
  movslq %r15d,%rdx
  mov    %rbx,%rsi
  mov    %r12,%rdi
  shl    $0x3,%rdx
  call   <memcpy@plt>
  sub    $0x8,%rsp
  mov    %r15d,%ecx
  mov    %r13d,%esi
  push   $0x1
  lea    -0x48(%rbp),%r9
  lea    -0x50(%rbp),%r8
  mov    %r12,%rdx
  mov    %r14,%rdi
  xor    %eax,%eax
  call   <CCC_posi@plt>
  pop    %rcx
  pop    %rsi
  jmp    L49
L155:
  xor    %eax,%eax
  jmp    L145
L158:
  orq    $0x0,-0x8(%rsp,%rdx,1)
  jmp    L130
L114:
  sub    $0x8,%rsp
  lea    -0x50(%rbp),%r8
  mov    %r14,%rdi
  mov    %r15d,%ecx
  push   $0x1
  lea    -0x48(%rbp),%r9
  mov    %r12,%rdx
  mov    %r13d,%esi
  xor    %eax,%eax
  call   <CCC_posi@plt>
  pop    %rdi
  movq   D24(%rip),%xmm1
  pop    %r8
  jmp    L118
L179:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: disassemble_data
arguments: data_tag: D14
datatype: byte[16]
name: disassemble_data
arguments: data_tag: D24
datatype: byte[8]

tool: {"D14": [0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80]}

tool: {"D24": [0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80]}

assistant: ```c
int CCC(double *x, int npts_x, double *y, int npts_y, int *shift, double *ccc, int flag) {
  int CCC_posi();
  int i, j;
  double x_tmp[npts_x + 1];
  double y_tmp[npts_y + 1];
  int shift_posi, shift_nega;
  double ccc_posi, ccc_nega;
  for (i = 0; i < npts_x; i++)
    x_tmp[i] = x[i];
  for (i = 0; i < npts_y; i++)
    y_tmp[i] = y[i];
  CCC_posi(x_tmp, npts_x, y_tmp, npts_y, &shift_posi, &ccc_posi, 1);
  for (i = 0; i < npts_x; i++)
    x_tmp[i] = x[i];
  for (i = 0; i < npts_y; i++)
    y_tmp[i] = -1.0 * y[i];
  CCC_posi(x_tmp, npts_x, y_tmp, npts_y, &shift_nega, &ccc_nega, 1);
  ccc_nega = -1 * ccc_nega;
  if (flag == 1) {
    *shift = shift_posi;
    *ccc = ccc_posi;
  } else if (flag == -1) {
    *shift = shift_nega;
    *ccc = ccc_nega;
  } else {
    if (fabs(ccc_posi) >= fabs(ccc_nega)) {
      *shift = shift_posi;
      *ccc = ccc_posi;
    } else if (fabs(ccc_posi) < fabs(ccc_nega)) {
      *shift = shift_nega;
      *ccc = ccc_nega;
    }
  }
  return 0;
}
```