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

```asm
<getrmap1>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  mov    %edx,%r13d
  push   %r12
  mov    %r9d,%r12d
  push   %rbp
  push   %rbx
  sub    $0xb8,%rsp
  mov    0xf0(%rsp),%rax
  mov    %ecx,0xc(%rsp)
  imul   %edx,%ecx
  lea    0xa0(%rsp),%rdx
  mov    %rsi,0x10(%rsp)
  mov    0xf8(%rsp),%r15d
  mov    %r8,0x80(%rsp)
  mov    %r9d,0x7c(%rsp)
  mov    %rax,0x18(%rsp)
  movss  %xmm0,0x8c(%rsp)
  mov    %fs:0x28,%rax
  mov    %rax,0xa8(%rsp)
  xor    %eax,%eax
  mov    %ecx,0x20(%rsp)
  movl   $0x0,0x6c(%rsp)
  movl   $0x0,0x88(%rsp)
  mov    %rdx,0x50(%rsp)
  test   %r13d,%r13d
  jle    L123
  mov    %rdi,%r14
L374:
  mov    0x6c(%rsp),%edx
  mov    0xc(%rsp),%ecx
  movl   $0x0,0x5c(%rsp)
  mov    %edx,0x74(%rsp)
  add    $0x1,%edx
  mov    %edx,0x6c(%rsp)
  movslq %eax,%rdx
  mov    %rdx,0x60(%rsp)
  test   %ecx,%ecx
  jg     L288
  jmp    L274
  nopl   0x0(%rax)
L371:
  mov    0x68(%rsp),%eax
  addq   $0x1,0x60(%rsp)
  mov    0x5c(%rsp),%edi
  add    $0x1,%eax
  cmp    %edi,0xc(%rsp)
  je     L274
L288:
  mov    0x5c(%rsp),%eax
  mov    0x60(%rsp),%rcx
  mov    %eax,%edx
  add    $0x1,%eax
  mov    %ecx,0x68(%rsp)
  mov    %eax,0x5c(%rsp)
  movswl (%r14,%rcx,2),%eax
  mov    %ecx,0x70(%rsp)
  cmp    %r15d,%eax
  jne    L371
  mov    0x18(%rsp),%rax
  mov    %rcx,%rdi
  movzbl (%rax,%rcx,1),%eax
  mov    0x80(%rsp),%rcx
  movss  (%rcx,%rax,4),%xmm1
  mov    0x10(%rsp),%rax
  comiss (%rax,%rdi,4),%xmm1
  movss  %xmm1,0x24(%rsp)
  jb     L371
  mov    0x7c(%rsp),%r8d
  mov    0x74(%rsp),%ecx
  mov    $0xffffff9c,%esi
  xor    %ebx,%ebx
  addl   $0x1,0x88(%rsp)
  mov    0x88(%rsp),%eax
  mov    %r13d,%ebp
  mov    %si,(%r14,%rdi,2)
  mov    0x50(%rsp),%r13
  add    %eax,%r8d
  lea    0x9c(%rsp),%rax
  mov    %ecx,0x9c(%rsp)
  mov    %rax,0x38(%rsp)
  lea    0xa4(%rsp),%rax
  mov    %r8d,%r12d
  mov    %edx,0xa0(%rsp)
  mov    %edi,0xa4(%rsp)
  mov    %rax,0x28(%rsp)
  nopw   0x0(%rax,%rax,1)
L304:
  sub    $0x8,%rsp
  mov    %ebp,%r9d
  mov    %r12d,%r8d
  mov    %r15d,%ecx
  push   0x30(%rsp)
  mov    0x30(%rsp),%eax
  mov    %r13,%rdx
  mov    %r14,%rdi
  push   %rax
  push   0x30(%rsp)
  push   0x30(%rsp)
  mov    0x34(%rsp),%eax
  push   %rax
  movss  0x54(%rsp),%xmm0
  mov    0x68(%rsp),%rsi
  call   <rmapgrow1@plt>
  add    $0x30,%rsp
  add    %eax,%ebx
  test   %eax,%eax
  jne    L304
  mov    %r12d,%r8d
  mov    %ebp,%r13d
  test   %ebx,%ebx
  je     L371
  mov    0x68(%rsp),%eax
  add    $0x1,%eax
  mov    %eax,0x78(%rsp)
  mov    0x5c(%rsp),%eax
  cmp    %eax,0xc(%rsp)
  jle    L161
L349:
  movslq 0x78(%rsp),%rbp
  mov    %eax,0x40(%rsp)
  mov    %r13d,%eax
  xor    %ebx,%ebx
  mov    %r14,%r13
  mov    %eax,%r14d
  mov    %rbp,%r12
  mov    %r8d,%ebp
  jmp    L148
  xchg   %ax,%ax
L411:
  mov    0x40(%rsp),%eax
  add    $0x1,%r12
  add    $0x1,%eax
  cmp    %eax,0xc(%rsp)
  je     L368
  mov    %eax,0x40(%rsp)
L148:
  cmpw   $0xff9c,0x0(%r13,%r12,2)
  jne    L411
  mov    0x74(%rsp),%eax
  mov    %r12d,0xa4(%rsp)
  mov    %r12,0x30(%rsp)
  mov    %r14d,%r12d
  mov    0x50(%rsp),%r14
  mov    %eax,0x9c(%rsp)
  mov    0x40(%rsp),%eax
  mov    %eax,0xa0(%rsp)
  nopl   (%rax)
L68:
  sub    $0x8,%rsp
  mov    %r12d,%r9d
  mov    %ebp,%r8d
  mov    %r15d,%ecx
  push   0x30(%rsp)
  mov    0x30(%rsp),%eax
  mov    %r14,%rdx
  mov    %r13,%rdi
  push   %rax
  push   0x30(%rsp)
  push   0x30(%rsp)
  mov    0x34(%rsp),%eax
  push   %rax
  movss  0x54(%rsp),%xmm0
  mov    0x68(%rsp),%rsi
  call   <rmapgrow1@plt>
  add    $0x30,%rsp
  add    %eax,%ebx
  test   %eax,%eax
  jne    L68
  mov    %r12d,%r14d
  mov    0x30(%rsp),%r12
  jmp    L411
L368:
  mov    %r14d,%eax
  mov    0x68(%rsp),%edx
  mov    %r13,%r14
  mov    %ebp,%r8d
  mov    %eax,%r13d
  mov    0x40(%rsp),%eax
  sub    0x5c(%rsp),%eax
  lea    0x1(%rax,%rdx,1),%eax
  mov    %eax,0x58(%rsp)
  cmp    0x6c(%rsp),%r13d
  jle    L390
L318:
  mov    0x6c(%rsp),%eax
  mov    %ebx,0x40(%rsp)
  mov    %r8d,%r12d
  mov    %eax,0x30(%rsp)
  nopw   0x0(%rax,%rax,1)
L435:
  mov    0x58(%rsp),%eax
  xor    %ebx,%ebx
  lea    0x1(%rax),%r10d
  mov    %r13d,%eax
  mov    %r14,%r13
  movslq %r10d,%rbp
  mov    %eax,%r14d
  jmp    L194
  nopl   0x0(%rax,%rax,1)
L239:
  add    $0x1,%ebx
  add    $0x1,%rbp
  cmp    %ebx,0xc(%rsp)
  je     L357
L194:
  cmpw   $0xff9c,0x0(%r13,%rbp,2)
  jne    L239
  mov    0x30(%rsp),%eax
  mov    %ebx,0xa0(%rsp)
  mov    %ebp,0xa4(%rsp)
  mov    %eax,0x9c(%rsp)
  mov    %ebx,0x44(%rsp)
  mov    %r14d,%ebx
  mov    0x50(%rsp),%r14
  mov    %rbp,0x48(%rsp)
  mov    0x38(%rsp),%rbp
  nopl   0x0(%rax)
L244:
  sub    $0x8,%rsp
  mov    %ebx,%r9d
  mov    %r12d,%r8d
  mov    %r15d,%ecx
  push   0x30(%rsp)
  mov    0x30(%rsp),%eax
  mov    %r14,%rdx
  mov    %rbp,%rsi
  mov    %r13,%rdi
  push   %rax
  push   0x30(%rsp)
  push   0x30(%rsp)
  mov    0x34(%rsp),%eax
  push   %rax
  movss  0x54(%rsp),%xmm0
  call   <rmapgrow1@plt>
  add    %eax,0x70(%rsp)
  add    $0x30,%rsp
  test   %eax,%eax
  jne    L244
  mov    0x48(%rsp),%rbp
  mov    %ebx,%r14d
  mov    0x44(%rsp),%ebx
  add    $0x1,%rbp
  add    $0x1,%ebx
  cmp    %ebx,0xc(%rsp)
  jne    L194
L357:
  mov    %r14d,%eax
  addl   $0x1,0x30(%rsp)
  mov    %r13,%r14
  mov    0xc(%rsp),%edi
  mov    %eax,%r13d
  mov    0x30(%rsp),%eax
  add    %edi,0x58(%rsp)
  cmp    %eax,%r13d
  jg     L435
  mov    0x40(%rsp),%ebx
  mov    %r12d,%r8d
L390:
  test   %ebx,%ebx
  je     L371
  mov    0x5c(%rsp),%eax
  cmp    %eax,0xc(%rsp)
  jg     L349
L161:
  cmp    0x6c(%rsp),%r13d
  jle    L201
  mov    0x70(%rsp),%eax
  xor    %ebx,%ebx
  mov    %eax,0x58(%rsp)
  jmp    L318
L201:
  mov    0x70(%rsp),%eax
  add    $0x1,%eax
L274:
  cmp    0x6c(%rsp),%r13d
  jne    L374
  mov    0x7c(%rsp),%r12d
  mov    0x88(%rsp),%eax
  add    %eax,%r12d
  test   %eax,%eax
  jne    L108
L123:
  mov    0xa8(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L354
  add    $0xb8,%rsp
  mov    %r12d,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L108:
  lea    0x1(%r12),%r13d
  mov    $0x4,%esi
  mov    %r13d,%edi
  call   <calloc@plt>
  mov    0x20(%rsp),%edx
  mov    %rax,%rbp
  test   %edx,%edx
  jle    L185
  mov    0x20(%rsp),%eax
  mov    %r14,%rdx
  sub    $0x1,%eax
  lea    0x2(%r14,%rax,2),%rcx
L138:
  movswq (%rdx),%rsi
  cmp    0x7c(%rsp),%esi
  jle    L175
  addl   $0x1,0x0(%rbp,%rsi,4)
L175:
  add    $0x2,%rdx
  cmp    %rcx,%rdx
  jne    L138
L185:
  mov    %r13d,%edi
  mov    $0x4,%esi
  call   <calloc@plt>
  mov    %rax,%rdi
  lea    0x4(%rax),%rdx
  mov    $0x1,%eax
  test   %r12d,%r12d
  jle    L77
L397:
  mov    %eax,%ecx
  mov    %eax,(%rdx)
  add    $0x1,%eax
  add    $0x4,%rdx
  cmp    %ecx,%r12d
  jne    L397
L77:
  mov    0x7c(%rsp),%eax
  mov    %rbp,%r13
  mov    %r12d,%ebx
  lea    0x8(%rdi),%r9
  sub    %rdi,%r13
  add    $0x1,%eax
  movslq %eax,%rsi
  lea    (%rdi,%rsi,4),%rdx
  jmp    L137
L92:
  add    $0x1,%rsi
  add    $0x4,%rdx
  cmp    %eax,%r12d
  jl     L240
L137:
  movss  0x8c(%rsp),%xmm2
  pxor   %xmm0,%xmm0
  add    $0x1,%eax
  cvtsi2ssl 0x0(%r13,%rdx,1),%xmm0
  comiss %xmm0,%xmm2
  jbe    L92
  cmp    %eax,%r12d
  jl     L165
  mov    %r12d,%r8d
  movslq %eax,%rcx
  sub    %eax,%r8d
  lea    (%rdi,%rcx,4),%rcx
  add    %rsi,%r8
  lea    (%r9,%r8,4),%r10
L345:
  mov    (%rcx),%r8d
  cmp    (%rdx),%r8d
  jle    L425
  sub    $0x1,%r8d
  mov    %r8d,(%rcx)
L425:
  add    $0x4,%rcx
  cmp    %rcx,%r10
  jne    L345
L165:
  mov    %r15d,(%rdx)
  sub    $0x1,%ebx
  add    $0x1,%rsi
  add    $0x4,%rdx
  cmp    %eax,%r12d
  jge    L137
L240:
  mov    0x20(%rsp),%eax
  test   %eax,%eax
  jle    L210
  mov    0x20(%rsp),%eax
  mov    %r14,%r10
  sub    $0x1,%eax
  lea    0x2(%r14,%rax,2),%rdx
L347:
  movswq (%r10),%rcx
  cmp    0x7c(%rsp),%ecx
  jle    L111
  mov    (%rdi,%rcx,4),%eax
  mov    %ax,(%r10)
L111:
  add    $0x2,%r10
  cmp    %r10,%rdx
  jne    L347
L210:
  call   <free@plt>
  mov    %rbp,%rdi
  mov    %ebx,%r12d
  call   <free@plt>
  jmp    L123
L354:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
int getrmap1(short *rmap, float *J, int ny, int nx, float *threshJ, int TR, float RSIZE, unsigned char *rmap0, int n2bgrow) {
  int i, j, k, l, iy, ix, *count, *convert, newTR, loc, loc1, imgsize, grow, jy, jx;
  int grow1, ky, kx, kl;
  float threshJ1;
  imgsize = ny * nx;
  j = 0;
  loc = 0;
  for (iy = 0; iy < ny; iy++) {
    for (ix = 0; ix < nx; ix++) {
      if (rmap[loc] == n2bgrow && J[loc] <= threshJ[rmap0[loc]]) {
        threshJ1 = threshJ[rmap0[loc]];
        j++;
        rmap[loc] = -100;
        grow = 0;
        ky = iy;
        kx = ix;
        kl = loc;
        do {
          grow1 = rmapgrow1(rmap, &ky, &kx, n2bgrow, j + TR, ny, nx, J, threshJ1, rmap0, imgsize, &kl);
          grow += grow1;
        } while (grow1);
        while (grow) {
          grow = 0;
          loc1 = loc;
          jy = iy;
          for (jx = ix + 1; jx < nx; jx++) {
            loc1++;
            if (rmap[loc1] == -100) {
              ky = jy;
              kx = jx;
              kl = loc1;
              do {
                grow1 = rmapgrow1(rmap, &ky, &kx, n2bgrow, j + TR, ny, nx, J, threshJ1, rmap0, imgsize, &kl);
                grow += grow1;
              } while (grow1);
            }
          }
          for (jy = iy + 1; jy < ny; jy++) {
            for (jx = 0; jx < nx; jx++) {
              loc1++;
              if (rmap[loc1] == -100) {
                ky = jy;
                kx = jx;
                kl = loc1;
                do {
                  grow1 = rmapgrow1(rmap, &ky, &kx, n2bgrow, j + TR, ny, nx, J, threshJ1, rmap0, imgsize, &kl);
                  grow += grow1;
                } while (grow1);
              }
            }
          }
        }
      }
      loc++;
    }
  }
  newTR = j + TR;
  if (j > 0) {
    count = (int *)calloc(newTR + 1, sizeof(int));
    for (l = 0; l < imgsize; l++) {
      if (rmap[l] > TR)
        count[rmap[l]]++;
    }
    convert = (int *)calloc(newTR + 1, sizeof(int));
    for (i = 1; i <= newTR; i++)
      convert[i] = i;
    for (i = TR + 1; i <= j + TR; i++) {
      if (count[i] < RSIZE) {
        for (k = i + 1; k <= j + TR; k++) {
          if (convert[k] > convert[i])
            convert[k]--;
        }
        convert[i] = n2bgrow;
        newTR--;
      }
    }
    for (l = 0; l < imgsize; l++) {
      if (rmap[l] > TR)
        rmap[l] = convert[rmap[l]];
    }
    free(convert);
    free(count);
  }
  return newTR;
}
```