user: 请将以下的汇编代码转换成C语言代码:

```asm
<gettotalJS>:
  endbr64
  push   %r15
  mov    %esi,%r15d
  mov    $0x4,%esi
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  lea    0x1(%r9),%ebx
  movslq %ebx,%r13
  sub    $0x98,%rsp
  mov    %rdi,0x18(%rsp)
  mov    %r13,%rdi
  mov    %ecx,0x8(%rsp)
  mov    %edx,0x10(%rsp)
  mov    %r8,0x20(%rsp)
  mov    %r9d,0x58(%rsp)
  mov    %ebx,0x5c(%rsp)
  call   <calloc@plt>
  mov    %r13,%rdi
  mov    $0x4,%esi
  mov    %rax,0x40(%rsp)
  call   <calloc@plt>
  mov    %r13,%rdi
  mov    $0x4,%esi
  mov    %rax,0x30(%rsp)
  call   <calloc@plt>
  mov    %r13,%rdi
  mov    $0x4,%esi
  mov    %rax,0x48(%rsp)
  call   <calloc@plt>
  mov    %r13,%rdi
  mov    $0x4,%esi
  mov    %rax,%rbp
  call   <calloc@plt>
  mov    %r13,%rdi
  mov    $0x4,%esi
  mov    %rax,%r12
  call   <calloc@plt>
  mov    %r15d,%esi
  mov    %ebx,%edi
  mov    %rax,%r13
  xor    %eax,%eax
  call   <fmatrix@plt>
  mov    %r15d,%esi
  mov    %ebx,%edi
  mov    %r15d,0x3c(%rsp)
  movslq %eax,%r14
  xor    %eax,%eax
  mov    %ebx,%r15d
  call   <fmatrix@plt>
  mov    0x3c(%rsp),%esi
  mov    %r15d,%edi
  movslq %eax,%rbx
  xor    %eax,%eax
  call   <imatrix@plt>
  mov    0x3c(%rsp),%esi
  movslq %eax,%rdi
  xor    %eax,%eax
  mov    %rdi,0x50(%rsp)
  mov    %r15d,%edi
  call   <fmatrix@plt>
  mov    0x10(%rsp),%ecx
  movslq 0x8(%rsp),%rdi
  movslq %eax,%r15
  test   %ecx,%ecx
  jle    L277
  mov    %r15,0x28(%rsp)
  mov    0x50(%rsp),%r11
  xor    %r10d,%r10d
  xor    %r9d,%r9d
  xchg   %ax,%ax
L270:
  mov    0x20(%rsp),%rsi
  mov    0x8(%rsp),%edx
  movslq %r10d,%r8
  xor    %eax,%eax
  add    %r8,%rsi
  add    0x18(%rsp),%r8
  test   %edx,%edx
  jle    L83
  xchg   %ax,%ax
L92:
  movzbl (%rsi,%rax,1),%edx
  test   %dl,%dl
  je     L213
  pxor   %xmm1,%xmm1
  lea    0x0(,%rdx,4),%rcx
  cvtsi2ss %eax,%xmm1
  lea    0x0(%rbp,%rcx,1),%r15
  addl   $0x1,0x0(%r13,%rcx,1)
  movss  (%r15),%xmm0
  addss  %xmm1,%xmm0
  movss  %xmm0,(%r15)
  pxor   %xmm0,%xmm0
  lea    (%r12,%rcx,1),%r15
  movzbl (%r8,%rax,1),%ecx
  cvtsi2ss %r9d,%xmm0
  movss  (%r15),%xmm2
  shl    $0x2,%rcx
  addss  %xmm0,%xmm2
  movss  %xmm2,(%r15)
  mov    (%rbx,%rdx,8),%r15
  add    %rcx,%r15
  addss  (%r15),%xmm1
  movss  %xmm1,(%r15)
  mov    (%r14,%rdx,8),%r15
  add    %rcx,%r15
  add    (%r11,%rdx,8),%rcx
  addss  (%r15),%xmm0
  movss  %xmm0,(%r15)
  addl   $0x1,(%rcx)
L213:
  add    $0x1,%rax
  cmp    %rdi,%rax
  jne    L92
  add    0x8(%rsp),%r10d
L83:
  add    $0x1,%r9d
  cmp    %r9d,0x10(%rsp)
  jne    L270
  mov    0x28(%rsp),%r15
L277:
  mov    0x58(%rsp),%eax
  test   %eax,%eax
  jle    L189
  mov    0x3c(%rsp),%esi
  mov    0x5c(%rsp),%ecx
  mov    %r14,%r11
  mov    %r14,0x60(%rsp)
  mov    %rbx,0x68(%rsp)
  lea    0x8(%rbx),%rdi
  sub    %rbx,%r11
  mov    $0x1,%r9d
  lea    -0x1(%rsi),%eax
  mov    %r15,0x70(%rsp)
  mov    %esi,%r14d
  mov    %eax,0x28(%rsp)
  lea    0x4(,%rax,4),%r8
  mov    0x50(%rsp),%rax
  sub    %rbx,%rax
  mov    %rcx,%rbx
  mov    %rax,%r15
  nopw   0x0(%rax,%rax,1)
L296:
  pxor   %xmm1,%xmm1
  movss  0x0(%rbp,%r9,4),%xmm0
  cvtsi2ssl 0x0(%r13,%r9,4),%xmm1
  divss  %xmm1,%xmm0
  movss  %xmm0,0x0(%rbp,%r9,4)
  movss  (%r12,%r9,4),%xmm0
  divss  %xmm1,%xmm0
  movss  %xmm0,(%r12,%r9,4)
  test   %r14d,%r14d
  jle    L151
  mov    (%r15,%rdi,1),%rsi
  lea    (%r11,%rdi,1),%r10
  xor    %eax,%eax
  nopl   0x0(%rax)
L256:
  mov    (%rsi,%rax,1),%edx
  test   %edx,%edx
  jle    L46
  mov    (%rdi),%rcx
  pxor   %xmm1,%xmm1
  cvtsi2ss %edx,%xmm1
  mov    (%r10),%rdx
  add    %rax,%rcx
  movss  (%rcx),%xmm0
  add    %rax,%rdx
  divss  %xmm1,%xmm0
  movss  %xmm0,(%rcx)
  movss  (%rdx),%xmm0
  divss  %xmm1,%xmm0
  movss  %xmm0,(%rdx)
L46:
  add    $0x4,%rax
  cmp    %r8,%rax
  jne    L256
L151:
  add    $0x1,%r9
  add    $0x8,%rdi
  cmp    %rbx,%r9
  jne    L296
  mov    0x10(%rsp),%eax
  mov    0x60(%rsp),%r14
  mov    0x68(%rsp),%rbx
  mov    0x70(%rsp),%r15
  test   %eax,%eax
  jle    L201
L8:
  mov    %r13,0x60(%rsp)
  movslq 0x8(%rsp),%r8
  xor    %r9d,%r9d
  xor    %r11d,%r11d
  mov    0x40(%rsp),%r13
  nopl   (%rax)
L35:
  mov    0x20(%rsp),%rax
  movslq %r9d,%r10
  xor    %edx,%edx
  lea    (%rax,%r10,1),%rdi
  mov    0x8(%rsp),%eax
  add    0x18(%rsp),%r10
  test   %eax,%eax
  jle    L264
  mov    %r9d,0x28(%rsp)
  nopl   0x0(%rax)
L153:
  movzbl (%rdi,%rdx,1),%eax
  test   %al,%al
  je     L117
  pxor   %xmm0,%xmm0
  pxor   %xmm2,%xmm2
  mov    (%r15,%rax,8),%rsi
  mov    (%r14,%rax,8),%r9
  cvtsi2ss %r11d,%xmm0
  lea    0x0(%r13,%rax,4),%rcx
  cvtsi2ss %edx,%xmm2
  movaps %xmm0,%xmm1
  subss  (%r12,%rax,4),%xmm1
  movaps %xmm2,%xmm3
  subss  0x0(%rbp,%rax,4),%xmm3
  mov    (%rbx,%rax,8),%rax
  mulss  %xmm1,%xmm1
  mulss  %xmm3,%xmm3
  addss  %xmm3,%xmm1
  addss  (%rcx),%xmm1
  movss  %xmm1,(%rcx)
  movzbl (%r10,%rdx,1),%ecx
  subss  (%rax,%rcx,4),%xmm2
  subss  (%r9,%rcx,4),%xmm0
  lea    (%rsi,%rcx,4),%rsi
  mulss  %xmm0,%xmm0
  movaps %xmm2,%xmm1
  mulss  %xmm2,%xmm1
  addss  %xmm1,%xmm0
  addss  (%rsi),%xmm0
  movss  %xmm0,(%rsi)
L117:
  add    $0x1,%rdx
  cmp    %rdx,%r8
  jne    L153
  mov    0x28(%rsp),%r9d
  add    0x8(%rsp),%r9d
L264:
  add    $0x1,%r11d
  cmp    %r11d,0x10(%rsp)
  jne    L35
  mov    0x58(%rsp),%esi
  mov    0x60(%rsp),%r13
  test   %esi,%esi
  jle    L272
  mov    0x3c(%rsp),%eax
  sub    $0x1,%eax
  mov    %eax,0x28(%rsp)
L201:
  mov    0x58(%rsp),%edi
  mov    0x48(%rsp),%rax
  lea    0x8(%r15),%r8
  mov    0x28(%rsp),%r11d
  mov    0x3c(%rsp),%r10d
  mov    %r8,%rsi
  sub    $0x1,%edi
  lea    0x4(%rax),%rcx
  mov    %rdi,0x88(%rsp)
  lea    0x4(,%r11,4),%r9
  lea    0x8(%rax,%rdi,4),%rdi
  nopl   0x0(%rax,%rax,1)
L261:
  test   %r10d,%r10d
  jle    L159
  mov    (%rsi),%rax
  movss  (%rcx),%xmm0
  lea    (%r9,%rax,1),%rdx
L53:
  addss  (%rax),%xmm0
  add    $0x4,%rax
  cmp    %rax,%rdx
  jne    L53
  movss  %xmm0,(%rcx)
L159:
  add    $0x4,%rcx
  add    $0x8,%rsi
  cmp    %rdi,%rcx
  jne    L261
  mov    $0x1,%edx
  pxor   %xmm3,%xmm3
  mov    %rbp,0x28(%rsp)
  lea    D16(%rip),%rcx
  mov    %r12,0x60(%rsp)
  movaps %xmm3,%xmm0
  mov    %rdx,%rbp
  mov    0x40(%rsp),%r12
  mov    %r14,0x70(%rsp)
  mov    0x48(%rsp),%r14
  mov    %rbx,0x78(%rsp)
  mov    0xd0(%rsp),%rbx
  mov    %r15,0x80(%rsp)
  mov    %r13,%r15
  mov    0x58(%rsp),%r13d
  mov    %r11,0x20(%rsp)
  mov    %r8,0x68(%rsp)
  jmp    L49
  cs nopw 0x0(%rax,%rax,1)
L140:
  movss  (%r12,%rbp,4),%xmm1
  mov    0x30(%rsp),%rax
  subss  %xmm2,%xmm1
  movss  %xmm1,(%rax,%rbp,4)
  divss  %xmm2,%xmm1
  pxor   %xmm2,%xmm2
  cvtsi2ssl (%r15,%rbp,4),%xmm2
  movss  %xmm1,(%rbx,%rbp,4)
  mulss  %xmm2,%xmm1
  add    $0x1,%rbp
  addss  %xmm1,%xmm0
  cmp    %ebp,%r13d
  jl     L288
L49:
  movss  (%r14,%rbp,4),%xmm2
  mov    %ebp,%esi
  ucomiss %xmm3,%xmm2
  jp     L140
  jne    L140
  mov    %rcx,%rdi
  xor    %eax,%eax
  add    $0x1,%rbp
  movss  %xmm0,0x18(%rsp)
  call   <printf@plt>
  movss  0x18(%rsp),%xmm0
  lea    D16(%rip),%rcx
  pxor   %xmm3,%xmm3
  cmp    %ebp,%r13d
  jge    L49
L288:
  pxor   %xmm1,%xmm1
  mov    0xe0(%rsp),%ecx
  mov    %r15,%r13
  mov    0x20(%rsp),%r11
  cvtsi2ssl 0x10(%rsp),%xmm1
  mov    0x28(%rsp),%rbp
  mov    0x60(%rsp),%r12
  mov    0x68(%rsp),%r8
  mov    0x70(%rsp),%r14
  mov    0x78(%rsp),%rbx
  mov    0x80(%rsp),%r15
  divss  %xmm1,%xmm0
  pxor   %xmm1,%xmm1
  cvtsi2ssl 0x8(%rsp),%xmm1
  divss  %xmm1,%xmm0
  test   %ecx,%ecx
  jle    L97
  movslq 0x3c(%rsp),%r10
  mov    0x88(%rsp),%rsi
  mov    %rbp,0x8(%rsp)
  mov    0x40(%rsp),%rdi
  mov    0xd8(%rsp),%r9
  mov    %r12,0x10(%rsp)
  mov    %r10,%rax
  lea    0x10(%r15,%rsi,8),%rsi
  shl    $0x2,%r10
  add    $0x4,%rdi
  sub    %r15,%r9
  mov    %rsi,%rbp
  mov    %eax,%r12d
  nopw   0x0(%rax,%rax,1)
L108:
  mov    (%r9,%r8,1),%rcx
  test   %r12d,%r12d
  jle    L221
  mov    (%r8),%rsi
  xor    %eax,%eax
  cs nopw 0x0(%rax,%rax,1)
L7:
  movss  (%rsi,%rax,4),%xmm1
  mov    %rax,%rdx
  movss  %xmm1,(%rcx,%rax,4)
  add    $0x1,%rax
  cmp    %rdx,%r11
  jne    L7
L221:
  movss  (%rdi),%xmm1
  add    $0x8,%r8
  add    $0x4,%rdi
  movss  %xmm1,(%rcx,%r10,1)
  cmp    %r8,%rbp
  jne    L108
  mov    0x8(%rsp),%rbp
  mov    0x10(%rsp),%r12
L97:
  mov    %rbp,%rdi
  movss  %xmm0,0x8(%rsp)
  call   <free@plt>
  mov    %r12,%rdi
  call   <free@plt>
  mov    %r13,%rdi
  call   <free@plt>
  mov    0x40(%rsp),%rdi
  call   <free@plt>
  mov    0x30(%rsp),%rdi
  call   <free@plt>
  mov    0x48(%rsp),%rdi
  call   <free@plt>
  mov    0x5c(%rsp),%ebp
  mov    %rbx,%rdi
  xor    %eax,%eax
  mov    %ebp,%esi
  call   <free_fmatrix@plt>
  mov    %ebp,%esi
  mov    %r14,%rdi
  xor    %eax,%eax
  call   <free_fmatrix@plt>
  mov    0x50(%rsp),%rdi
  mov    %ebp,%esi
  xor    %eax,%eax
  call   <free_imatrix@plt>
  mov    %ebp,%esi
  mov    %r15,%rdi
  xor    %eax,%eax
  call   <free_fmatrix@plt>
  movss  0x8(%rsp),%xmm0
  add    $0x98,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L189:
  mov    0x10(%rsp),%edx
  test   %edx,%edx
  jg     L8
L272:
  pxor   %xmm1,%xmm1
  pxor   %xmm0,%xmm0
  cvtsi2ssl 0x10(%rsp),%xmm1
  divss  %xmm1,%xmm0
  pxor   %xmm1,%xmm1
  cvtsi2ssl 0x8(%rsp),%xmm1
  divss  %xmm1,%xmm0
  jmp    L97
```

tool_calls: name: extract_symbolic_data
arguments: tag: D16
type: string

tool: D16: Sw[%d]=0


assistant: ```c
float gettotalJS(unsigned char *cmap, int N, int ny, int nx, unsigned char *rmap, int TR, float *totalJ, float **mapmatrix, int oldTR) {
  int iy, ix, i, j, *StN, **avgN, l;
  float *St, *Sb, *Sw, *Stmeanx, *Stmeany, **avgy, **avgx, overallJ, **var;
  int debug = 0;
  St = (float *)calloc(TR + 1, sizeof(float));
  Sb = (float *)calloc(TR + 1, sizeof(float));
  Sw = (float *)calloc(TR + 1, sizeof(float));
  Stmeanx = (float *)calloc(TR + 1, sizeof(float));
  Stmeany = (float *)calloc(TR + 1, sizeof(float));
  StN = (int *)calloc(TR + 1, sizeof(int));
  avgy = (float **)fmatrix(TR + 1, N);
  avgx = (float **)fmatrix(TR + 1, N);
  avgN = (int **)imatrix(TR + 1, N);
  var = (float **)fmatrix(TR + 1, N);
  l = 0;
  for (iy = 0; iy < ny; iy++) {
    for (ix = 0; ix < nx; ix++) {
      if (rmap[l] > 0) {
        i = rmap[l];
        j = cmap[l];
        Stmeanx[i] += ix;
        Stmeany[i] += iy;
        StN[i]++;
        avgx[i][j] += ix;
        avgy[i][j] += iy;
        avgN[i][j]++;
      }
      l++;
    }
  }
  for (i = 1; i <= TR; i++) {
    Stmeanx[i] /= StN[i];
    Stmeany[i] /= StN[i];
    for (j = 0; j < N; j++) {
      if (avgN[i][j] > 0) {
        avgx[i][j] /= avgN[i][j];
        avgy[i][j] /= avgN[i][j];
      }
    }
  }
  l = 0;
  for (iy = 0; iy < ny; iy++) {
    for (ix = 0; ix < nx; ix++) {
      if (rmap[l] > 0) {
        i = rmap[l];
        j = cmap[l];
        St[i] += ((iy - Stmeany[i]) * (iy - Stmeany[i])) + ((ix - Stmeanx[i]) * (ix - Stmeanx[i]));
        var[i][j] += ((iy - avgy[i][j]) * (iy - avgy[i][j])) + ((ix - avgx[i][j]) * (ix - avgx[i][j]));
      }
      l++;
    }
  }
  for (i = 1; i <= TR; i++) {
    for (j = 0; j < N; j++)
      Sw[i] += var[i][j];
  }
  overallJ = 0;
  for (i = 1; i <= TR; i++) {
    if (Sw[i] == 0)
      printf("Sw[%d]=0\n", i);
    else {
      Sb[i] = St[i] - Sw[i];
      totalJ[i] = Sb[i] / Sw[i];
      overallJ += StN[i] * totalJ[i];
    }
  }
  overallJ = overallJ / ny / nx;
  if (debug)
    printf("\n%5.3f\n", overallJ);
  if (oldTR > 0) {
    for (i = 1; i <= TR; i++) {
      for (j = 0; j < N; j++)
        mapmatrix[i][j] = var[i][j];
      mapmatrix[i][N] = St[i];
    }
  }
  free(Stmeanx);
  free(Stmeany);
  free(StN);
  free(St);
  free(Sb);
  free(Sw);
  free_fmatrix(avgx, TR + 1);
  free_fmatrix(avgy, TR + 1);
  free_imatrix(avgN, TR + 1);
  free_fmatrix(var, TR + 1);
  return overallJ;
}
```