user: Converte this assembly snippet into its equivalent C code:

```asm
<calcSC_ak1>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x48,%rsp
  mov    %edi,%ebx
  movsd  %xmm0,0x20(%rsp)
  movsd  %xmm1,0x18(%rsp)
  mov    %rsi,0x28(%rsp)
  mov    %rdx,0x30(%rsp)
  mov    %rcx,0x38(%rsp)
  mov    %r8,%rbp
  mov    %r9,%r12
  mov    0x80(%rsp),%r13
  mov    0x98(%rsp),%r14
  mov    0xa0(%rsp),%r15
  movsd  %xmm2,0x8(%rsp)
  movsd  %xmm3,0x10(%rsp)
  mov    %r9,%r8
  mov    %rbp,%rcx
  mov    0xa8(%rsp),%rdx
  mov    %r15,%rsi
  movapd %xmm3,%xmm1
  movapd %xmm2,%xmm0
  call   <QuadSD_ak1@plt>
  movslq %ebx,%rbx
  shl    $0x3,%rbx
  movsd  0x0(%rbp),%xmm1
  movq   D22(%rip),%xmm2
  andpd  %xmm2,%xmm1
  movsd  -0x8(%r15,%rbx,1),%xmm0
  andpd  %xmm2,%xmm0
  mulsd  D1(%rip),%xmm0
  comisd %xmm1,%xmm0
  jb     L9
  movsd  (%r12),%xmm1
  andpd  %xmm2,%xmm1
  movsd  -0x10(%r15,%rbx,1),%xmm0
  andpd  %xmm2,%xmm0
  mulsd  D1(%rip),%xmm0
  mov    $0x3,%eax
  comisd %xmm1,%xmm0
  jae    L4
L9:
  movsd  0x10(%rsp),%xmm0
  mulsd  0x18(%rsp),%xmm0
  movsd  %xmm0,(%r14)
  movsd  (%r12),%xmm2
  movsd  0x0(%rbp),%xmm1
  movq   D22(%rip),%xmm0
  movapd %xmm2,%xmm3
  andpd  %xmm0,%xmm3
  andpd  %xmm1,%xmm0
  comisd %xmm0,%xmm3
  jae    L27
  movsd  0x20(%rsp),%xmm4
  movapd %xmm4,%xmm0
  divsd  %xmm1,%xmm0
  movsd  %xmm0,0x0(%r13)
  movsd  (%r12),%xmm0
  divsd  0x0(%rbp),%xmm0
  mov    0x88(%rsp),%rax
  movsd  %xmm0,(%rax)
  movsd  0x8(%rsp),%xmm2
  mulsd  0x0(%r13),%xmm2
  mov    0x90(%rsp),%rax
  movsd  %xmm2,(%rax)
  movsd  (%r14),%xmm1
  divsd  0x0(%rbp),%xmm1
  movapd %xmm1,%xmm0
  addsd  %xmm2,%xmm0
  movsd  0x18(%rsp),%xmm5
  mulsd  %xmm5,%xmm0
  movapd %xmm4,%xmm1
  mulsd  0x0(%r13),%xmm1
  addsd  %xmm1,%xmm0
  mov    0x30(%rsp),%rax
  movsd  %xmm0,(%rax)
  movsd  (%r12),%xmm1
  divsd  0x0(%rbp),%xmm1
  mulsd  %xmm4,%xmm1
  subsd  %xmm1,%xmm5
  mov    0x28(%rsp),%rax
  movsd  %xmm5,(%rax)
  mov    0x90(%rsp),%rax
  movsd  (%rax),%xmm0
  mulsd  (%r12),%xmm0
  movsd  (%r14),%xmm1
  mov    0x88(%rsp),%rax
  mulsd  (%rax),%xmm1
  addsd  %xmm1,%xmm0
  addsd  %xmm4,%xmm0
  mov    0x38(%rsp),%rax
  movsd  %xmm0,(%rax)
  mov    $0x1,%eax
L4:
  add    $0x48,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L27:
  movsd  0x20(%rsp),%xmm6
  movapd %xmm6,%xmm0
  divsd  %xmm2,%xmm0
  movsd  %xmm0,0x0(%r13)
  movsd  0x0(%rbp),%xmm0
  divsd  (%r12),%xmm0
  mov    0x88(%rsp),%rax
  movsd  %xmm0,(%rax)
  movsd  0x8(%rsp),%xmm5
  movapd %xmm5,%xmm0
  movsd  0x18(%rsp),%xmm7
  mulsd  %xmm7,%xmm0
  mov    0x90(%rsp),%rax
  movsd  %xmm0,(%rax)
  movapd %xmm7,%xmm1
  divsd  (%r12),%xmm1
  mulsd  (%r14),%xmm1
  addsd  %xmm6,%xmm0
  mulsd  0x0(%r13),%xmm0
  addsd  %xmm0,%xmm1
  mov    0x30(%rsp),%rax
  movsd  %xmm1,(%rax)
  mov    0x88(%rsp),%rax
  mulsd  (%rax),%xmm7
  movapd %xmm7,%xmm0
  subsd  %xmm6,%xmm0
  mov    0x28(%rsp),%rax
  movsd  %xmm0,(%rax)
  mov    0x88(%rsp),%rax
  addsd  (%rax),%xmm5
  movapd %xmm5,%xmm0
  mulsd  %xmm6,%xmm0
  addsd  (%r14),%xmm0
  mov    0x38(%rsp),%rax
  movsd  %xmm0,(%rax)
  mov    $0x2,%eax
  jmp    L4
```

tool_calls: name: parse_data
arguments: data_tag: D22
type_infered: qword
name: parse_data
arguments: data_tag: D1
type_infered: byte[8]

tool: D22: 9223372036854775807

tool: {"D1": [0x00,0x00,0x00,0x00,0x00,0x00,0x19,0x3d]}

assistant: ```c
int calcSC_ak1(int N, double a, double b, double *a1, double *a3, double *a7, double *c, double *d, double *e, double *f, double *g, double *h, double K[100 + 1], double u, double v, double qk[100 + 1]) {
  int dumFlag = 3;
  QuadSD_ak1(N, u, v, K, qk, c, d);
  if (fabs((*c)) <= (100.0 * 2.2204460492503131e-016 * fabs(K[N - 1]))) {
    if (fabs((*d)) <= (100.0 * 2.2204460492503131e-016 * fabs(K[N - 2])))
      return dumFlag;
  }
  *h = v * b;
  if (fabs((*d)) >= fabs((*c))) {
    dumFlag = 2;
    *e = a / (*d);
    *f = (*c) / (*d);
    *g = u * b;
    *a3 = (*e) * ((*g) + a) + (*h) * (b / (*d));
    *a1 = -a + (*f) * b;
    *a7 = (*h) + ((*f) + u) * a;
  } else {
    dumFlag = 1;
    *e = a / (*c);
    *f = (*d) / (*c);
    *g = (*e) * u;
    *a3 = (*e) * a + ((*g) + (*h) / (*c)) * b;
    *a1 = -(a * ((*d) / (*c))) + b;
    *a7 = (*g) * (*d) + (*h) * (*f) + a;
  }
  return dumFlag;
}
```