user: 请显示与下面列出的汇编代码相匹配的C语言实现:

```asm
<scd>:
  endbr64
  push   %r15
  mulsd  %xmm2,%xmm2
  movapd %xmm0,%xmm3
  pxor   %xmm0,%xmm0
  push   %r14
  xor    %r14d,%r14d
  mov    %rdx,%r15
  push   %r13
  mov    %rsi,%r13
  push   %r12
  mov    %rdi,%r12
  push   %rbp
  push   %rbx
  sub    $0x28,%rsp
  comisd %xmm3,%xmm0
  jbe    L59
  andpd  D64(%rip),%xmm3
  mov    $0x1,%r14d
L59:
  movapd %xmm1,%xmm5
  movapd %xmm3,%xmm0
  movsd  %xmm2,0x18(%rsp)
  xor    %ebp,%ebp
  mulsd  D51(%rip),%xmm5
  movsd  %xmm1,0x10(%rsp)
  movsd  %xmm3,0x8(%rsp)
  divsd  %xmm5,%xmm0
  movsd  %xmm5,(%rsp)
  call   <floor@plt>
  pxor   %xmm4,%xmm4
  movsd  (%rsp),%xmm5
  movsd  0x8(%rsp),%xmm3
  cvtsi2sd %eax,%xmm4
  movsd  0x10(%rsp),%xmm1
  movsd  0x18(%rsp),%xmm2
  mulsd  %xmm5,%xmm4
  subsd  %xmm4,%xmm3
  movapd %xmm3,%xmm0
  movapd %xmm1,%xmm3
  addsd  %xmm1,%xmm3
  comisd %xmm3,%xmm0
  jbe    L94
  subsd  %xmm3,%xmm0
  mov    $0x1,%ebp
L94:
  movsd  D39(%rip),%xmm3
  movsd  D27(%rip),%xmm5
  xor    %ebx,%ebx
  mulsd  %xmm3,%xmm1
  movapd %xmm5,%xmm4
  subsd  %xmm2,%xmm4
  cvttsd2si %xmm4,%edi
  comisd %xmm1,%xmm0
  jb     L35
  xchg   %ax,%ax
L76:
  mulsd  %xmm3,%xmm0
  add    $0x1,%ebx
  comisd %xmm1,%xmm0
  jae    L76
  mov    %r15,%rcx
  mov    %r13,%rdx
  mov    %r12,%rsi
  movsd  %xmm2,(%rsp)
  call   <scd2@plt>
  movsd  (%rsp),%xmm2
  test   %rax,%rax
  mov    D27(%rip),%rax
  movq   %rax,%xmm5
  je     L10
L41:
  mov    $0x1,%r14d
L90:
  add    $0x28,%rsp
  mov    %r14d,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  xchg   %ax,%ax
L10:
  movapd %xmm2,%xmm6
  movsd  (%r15),%xmm3
  addsd  %xmm2,%xmm6
  nopl   (%rax)
L39:
  movsd  (%r12),%xmm0
  movsd  0x0(%r13),%xmm4
  movapd %xmm5,%xmm7
  movapd %xmm0,%xmm1
  movapd %xmm0,%xmm9
  movapd %xmm0,%xmm8
  mulsd  %xmm2,%xmm1
  addsd  %xmm0,%xmm9
  mulsd  %xmm6,%xmm8
  mulsd  %xmm9,%xmm4
  mulsd  %xmm0,%xmm1
  mulsd  %xmm0,%xmm8
  mulsd  %xmm3,%xmm4
  movapd %xmm5,%xmm3
  mulsd  %xmm0,%xmm1
  subsd  %xmm8,%xmm3
  mulsd  %xmm0,%xmm1
  mulsd  %xmm9,%xmm0
  subsd  %xmm1,%xmm7
  addsd  %xmm1,%xmm3
  divsd  %xmm7,%xmm4
  divsd  %xmm7,%xmm3
  movsd  %xmm4,(%r12)
  movapd %xmm5,%xmm4
  subsd  %xmm0,%xmm4
  addsd  %xmm1,%xmm4
  divsd  %xmm7,%xmm4
  movsd  %xmm4,0x0(%r13)
  movsd  %xmm3,(%r15)
  sub    $0x1,%ebx
  jne    L39
L64:
  test   %ebp,%ebp
  je     L108
  movsd  (%r12),%xmm0
  movq   D45(%rip),%xmm1
  xorpd  %xmm1,%xmm0
  movsd  %xmm0,(%r12)
  movsd  0x0(%r13),%xmm0
  xorpd  %xmm1,%xmm0
  movsd  %xmm0,0x0(%r13)
L108:
  test   %r14d,%r14d
  je     L90
  movsd  (%r12),%xmm0
  xorpd  D45(%rip),%xmm0
  xor    %r14d,%r14d
  movsd  %xmm0,(%r12)
  jmp    L90
  nop
L35:
  mov    %r15,%rcx
  mov    %r13,%rdx
  mov    %r12,%rsi
  call   <scd2@plt>
  test   %rax,%rax
  je     L64
  jmp    L41
```

tool_calls: name: parse_data
arguments: data_tag: D64
type_infered: qword[2]
name: parse_data
arguments: data_tag: D51
type_infered: byte[8]
name: parse_data
arguments: data_tag: D39
type_infered: byte[8]
name: parse_data
arguments: data_tag: D27
type_infered: byte[8]
name: parse_data
arguments: data_tag: D45
type_infered: byte[16]

tool: {"D64": [0x7fffffffffffffff,0x0000000000000000]}

tool: {"D51": [0x00,0x00,0x00,0x00,0x00,0x00,0x10,0x40]}

tool: {"D39": [0x00,0x00,0x00,0x00,0x00,0x00,0xe0,0x3f]}

tool: {"D27": [0x00,0x00,0x00,0x00,0x00,0x00,0xf0,0x3f]}

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

assistant: ```c
int scd(double u, double K, double k, double *s, double *c, double *d) {
  double m;
  int Ndiv2 = 0;
  int N4K = 0;
  int K2 = 0;
  int NEG = 0;
  m = k * k;
  if (u < 0) {
    NEG = 1;
    u = fabs(u);
  }
  N4K = (int)floor(u / (4 * K));
  u -= 4 * K * ((double)N4K);
  if (u > 2.0 * K) {
    u -= 2.0 * K;
    K2 = 1;
  }
  while (u >= K / 2.0) {
    u /= 2;
    Ndiv2++;
  }
  if (scd2(u, 1 - m, s, c, d))
    return 1;
  else {
    if (Ndiv2) {
      double ss, cc, dd;
      double nom;
      while (Ndiv2) {
        nom = (1 - m * (*s) * (*s) * (*s) * (*s));
        ss = 2 * (*s) * (*c) * (*d) / nom;
        cc = (1 - 2 * (*s) * (*s) + m * (*s) * (*s) * (*s) * (*s)) / nom;
        dd = (1 - 2 * m * (*s) * (*s) + m * (*s) * (*s) * (*s) * (*s)) / nom;
        (*s) = ss;
        (*c) = cc;
        (*d) = dd;
        Ndiv2--;
      }
    }
    if (K2) {
      (*s) = -(*s);
      (*c) = -(*c);
    }
    if (NEG) {
      (*s) = -(*s);
      (*c) = (*c);
    }
  }
  return 0;
}
```