user: 请将这段汇编代码片段转换成等效的C代码:

```asm
<cheleg>:
  endbr64
  push   %r15
  mov    %edx,%r15d
  push   %r14
  push   %r13
  mov    %esi,%r13d
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x78,%rsp
  mov    %edi,0x38(%rsp)
  mov    %rcx,0x28(%rsp)
  mov    %r8,0x30(%rsp)
  mov    %fs:0x28,%rax
  mov    %rax,0x68(%rsp)
  xor    %eax,%eax
  cmp    %esi,%edx
  mov    %esi,0x18(%rsp)
  mov    $0x8,%esi
  cmovge %edx,%r13d
  lea    0x3(%r13,%r13,2),%edi
  call   <calloc@plt>
  movslq %r13d,%rdx
  mov    0x18(%rsp),%r9d
  add    $0x1,%rdx
  mov    %rax,%rsi
  mov    %rax,0x8(%rsp)
  lea    0x0(,%rdx,8),%rax
  movq   %rsi,%xmm0
  lea    (%rsi,%rax,1),%rcx
  movq   %rcx,%xmm6
  add    %rcx,%rax
  test   %r13d,%r13d
  mov    %rcx,0x10(%rsp)
  punpcklqdq %xmm6,%xmm0
  mov    %rax,0x60(%rsp)
  movaps %xmm0,0x50(%rsp)
  js     L117
  lea    0x0(,%rdx,8),%eax
  mov    %r15d,%ecx
  xor    %ebx,%ebx
  mov    $0xaaaaaaab,%r14d
  mov    %eax,0x24(%rsp)
  lea    0x8(,%r9,8),%eax
  mov    %eax,0x3c(%rsp)
  lea    0x1(%r15),%eax
  mov    %r9d,%r15d
  mov    %eax,0x44(%rsp)
  shl    $0x3,%eax
  mov    %eax,0x40(%rsp)
  lea    -0x3(%r13),%eax
  shr    %eax
  add    $0x2,%eax
  add    %rax,%rax
  mov    %rax,0x48(%rsp)
  nopl   (%rax)
L171:
  mov    %ebx,%ebp
  imul   %r14,%rbp
  shr    $0x21,%rbp
  lea    0x0(%rbp,%rbp,2),%eax
  mov    %ebx,%ebp
  sub    %eax,%ebp
  test   %ebx,%ebx
  je     L67
  cmp    $0x1,%ebx
  jne    L133
  mov    0x10(%rsp),%rax
  mov    D9(%rip),%rdi
  mov    %rdi,0x8(%rax)
L74:
  cmp    %ebx,%r15d
  je     L2
L176:
  cmp    %ebx,%ecx
  je     L218
L77:
  add    $0x1,%ebx
  cmp    %ebx,%r13d
  jge    L171
L117:
  mov    0x8(%rsp),%rdi
  call   <free@plt>
  mov    0x68(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L6
  add    $0x78,%rsp
  xor    %eax,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nop
L67:
  mov    0x8(%rsp),%rax
  mov    D9(%rip),%rdi
  mov    %rdi,(%rax)
  cmp    %ebx,%r15d
  jne    L176
L2:
  movslq %ebp,%rax
  mov    0x3c(%rsp),%edx
  mov    0x28(%rsp),%rdi
  mov    %ecx,0x18(%rsp)
  mov    0x50(%rsp,%rax,8),%rsi
  call   <memcpy@plt>
  mov    0x18(%rsp),%ecx
  cmp    %ebx,%ecx
  jne    L77
  cs nopw 0x0(%rax,%rax,1)
L218:
  movslq %ebp,%rbp
  mov    0x40(%rsp),%edx
  mov    0x30(%rsp),%rdi
  mov    %ecx,0x18(%rsp)
  mov    0x50(%rsp,%rbp,8),%rsi
  call   <memcpy@plt>
  mov    0x44(%rsp),%eax
  mov    0x18(%rsp),%ecx
  cmp    %eax,%r13d
  mov    %eax,%ebx
  jge    L171
  jmp    L117
  nopw   0x0(%rax,%rax,1)
L133:
  lea    -0x1(%rbx),%r9d
  lea    -0x2(%rbx),%r8d
  xor    %esi,%esi
  mov    %ecx,0x18(%rsp)
  mov    %r9,%rax
  imul   %r14,%r9
  shr    $0x21,%r9
  lea    (%r9,%r9,2),%edx
  sub    %edx,%eax
  mov    %eax,0x20(%rsp)
  mov    %r8,%rax
  imul   %r14,%r8
  shr    $0x21,%r8
  lea    (%r8,%r8,2),%edx
  sub    %edx,%eax
  mov    0x24(%rsp),%edx
  mov    %eax,0x1c(%rsp)
  movslq %ebp,%rax
  mov    0x50(%rsp,%rax,8),%r12
  mov    %r12,%rdi
  call   <memset@plt>
  pxor   %xmm2,%xmm2
  test   %r13d,%r13d
  mov    0x18(%rsp),%ecx
  cvtsi2sd %ebx,%xmm2
  je     L74
  mov    0x38(%rsp),%eax
  movslq 0x1c(%rsp),%r8
  movslq 0x20(%rsp),%r9
  cmp    $0x1,%eax
  je     L129
  cmp    $0x2,%eax
  jne    L74
  lea    0x50(%rsp),%rax
  lea    (%rax,%r8,8),%rdx
  lea    (%rax,%r9,8),%rax
  cmp    $0x2,%r13d
  jle    L187
  movapd %xmm2,%xmm3
  mov    (%rax),%rsi
  movapd %xmm2,%xmm5
  mov    (%rdx),%rdi
  addsd  %xmm2,%xmm3
  movsd  (%r12),%xmm0
  mov    $0x2,%edx
  mov    D9(%rip),%rax
  movq   %rax,%xmm6
  movapd %xmm3,%xmm7
  subsd  %xmm6,%xmm5
  subsd  %xmm6,%xmm7
L99:
  movsd  -0x10(%rsi,%rdx,8),%xmm1
  movslq %edx,%rax
  mulsd  %xmm7,%xmm1
  divsd  %xmm2,%xmm1
  movsd  %xmm1,-0x8(%r12,%rdx,8)
  movsd  -0x10(%rdi,%rdx,8),%xmm4
  mulsd  %xmm5,%xmm4
  divsd  %xmm2,%xmm4
  subsd  %xmm4,%xmm0
  movsd  %xmm0,-0x10(%r12,%rdx,8)
  movsd  -0x8(%rsi,%rdx,8),%xmm0
  mulsd  %xmm7,%xmm0
  divsd  %xmm2,%xmm0
  movsd  %xmm0,(%r12,%rdx,8)
  movsd  -0x8(%rdi,%rdx,8),%xmm4
  mulsd  %xmm5,%xmm4
  divsd  %xmm2,%xmm4
  subsd  %xmm4,%xmm1
  movsd  %xmm1,-0x8(%r12,%rdx,8)
  add    $0x2,%rdx
  cmp    %rdx,0x48(%rsp)
  jne    L99
L141:
  movapd %xmm2,%xmm4
  subsd  %xmm6,%xmm3
  mov    0x50(%rsp,%r9,8),%rdx
  mov    0x50(%rsp,%r8,8),%rsi
  subsd  %xmm6,%xmm4
  nopl   0x0(%rax)
L80:
  movsd  (%rdx,%rax,8),%xmm0
  mulsd  %xmm3,%xmm0
  divsd  %xmm2,%xmm0
  movsd  %xmm0,0x8(%r12,%rax,8)
  movsd  (%rsi,%rax,8),%xmm1
  movsd  (%r12,%rax,8),%xmm0
  mulsd  %xmm4,%xmm1
  divsd  %xmm2,%xmm1
  subsd  %xmm1,%xmm0
  movsd  %xmm0,(%r12,%rax,8)
  add    $0x1,%rax
  cmp    %eax,%r13d
  jg     L80
  jmp    L74
  nopw   0x0(%rax,%rax,1)
L129:
  lea    0x50(%rsp),%rax
  lea    (%rax,%r8,8),%rdx
  lea    (%rax,%r9,8),%rax
  cmp    $0x2,%r13d
  jle    L90
  movsd  (%r12),%xmm0
  mov    (%rax),%rsi
  mov    (%rdx),%rdi
  mov    $0x2,%edx
L33:
  movsd  -0x10(%rsi,%rdx,8),%xmm1
  movslq %edx,%rax
  addsd  %xmm1,%xmm1
  movsd  %xmm1,-0x8(%r12,%rdx,8)
  subsd  -0x10(%rdi,%rdx,8),%xmm0
  movsd  %xmm0,-0x10(%r12,%rdx,8)
  movsd  -0x8(%rsi,%rdx,8),%xmm0
  addsd  %xmm0,%xmm0
  movsd  %xmm0,(%r12,%rdx,8)
  subsd  -0x8(%rdi,%rdx,8),%xmm1
  movsd  %xmm1,-0x8(%r12,%rdx,8)
  add    $0x2,%rdx
  cmp    %rdx,0x48(%rsp)
  jne    L33
L131:
  mov    0x50(%rsp,%r9,8),%rsi
  mov    0x50(%rsp,%r8,8),%rdx
  nopl   0x0(%rax,%rax,1)
L180:
  movsd  (%rsi,%rax,8),%xmm0
  addsd  %xmm0,%xmm0
  movsd  %xmm0,0x8(%r12,%rax,8)
  movsd  (%r12,%rax,8),%xmm0
  subsd  (%rdx,%rax,8),%xmm0
  movsd  %xmm0,(%r12,%rax,8)
  add    $0x1,%rax
  cmp    %eax,%r13d
  jg     L180
  jmp    L74
L90:
  xor    %eax,%eax
  jmp    L131
L187:
  mov    D9(%rip),%rdi
  movapd %xmm2,%xmm3
  xor    %eax,%eax
  addsd  %xmm2,%xmm3
  movq   %rdi,%xmm6
  jmp    L141
L6:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: extract_symbolic_data
arguments: data_label: D9
datatype: f64

tool: D9: 1

assistant: ```c
int cheleg(int kind, int m, int n, double coeffm[], double coeffn[]) {
  int j, j0, j1, j2, k, N;
  double *coeff[3], d;
  N = (m > n) ? m : n;
  coeff[0] = calloc(3 * (N + 1), sizeof(double));
  coeff[1] = coeff[0] + (N + 1);
  coeff[2] = coeff[1] + (N + 1);
  for (j = 0; j <= N; j++) {
    j0 = j % 3;
    if (j == 0) {
      coeff[0][0] = 1.0;
    } else if (j == 1) {
      coeff[1][1] = 1.0;
    } else {
      j1 = (j - 1) % 3;
      j2 = (j - 2) % 3;
      memset(coeff[j0], 0, (N + 1) * sizeof(double));
      d = (double)j;
      for (k = 0; k < N; k++) {
        if (kind == 1) {
          coeff[j0][k + 1] = 2.0 * coeff[j1][k];
          coeff[j0][k] -= coeff[j2][k];
        } else if (kind == 2) {
          coeff[j0][k + 1] = ((2.0 * d - 1.0) * coeff[j1][k]) / d;
          coeff[j0][k] -= ((d - 1.0) * coeff[j2][k]) / d;
        }
      }
    }
    if (j == m)
      memcpy(coeffm, coeff[j0], (m + 1) * sizeof(double));
    if (j == n)
      memcpy(coeffn, coeff[j0], (n + 1) * sizeof(double));
  }
  free(coeff[0]);
  return 0;
}
```