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

```asm
<orangesRotting>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x38,%rsp
  mov    %rdi,0x10(%rsp)
  mov    (%rdx),%ebx
  test   %esi,%esi
  jle    L238
  mov    %esi,%r14d
  lea    -0x1(%rsi),%eax
  mov    %rdi,%rsi
  lea    0x8(%rdi,%rax,8),%r8
  mov    %r8,0x18(%rsp)
  lea    -0x1(%rbx),%ebp
  mov    $0x0,%r15d
  lea    0x4(,%rbp,4),%rdi
  jmp    L18
L258:
  mov    (%rsi),%rax
  lea    (%rdi,%rax,1),%rcx
L176:
  cmpl   $0x1,(%rax)
  sete   %dl
  movzbl %dl,%edx
  add    %edx,%r15d
  add    $0x4,%rax
  cmp    %rcx,%rax
  jne    L176
L253:
  add    $0x8,%rsi
  cmp    %r8,%rsi
  je     L278
L18:
  test   %ebx,%ebx
  jg     L258
  jmp    L253
L212:
  test   %r10d,%r10d
  jle    L307
  mov    -0x8(%rsi),%rcx
  cmpl   $0x2,(%rcx,%rax,1)
  je     L55
L307:
  cmp    %r11d,%r14d
  jle    L265
  mov    0x8(%r8),%rcx
  cmpl   $0x2,(%rcx,%rax,1)
  je     L55
L265:
  test   %edx,%edx
  jle    L168
  cmpl   $0x2,-0x4(%rdi,%rax,1)
  je     L55
L168:
  lea    0x1(%rdx),%ecx
  cmp    %ecx,%ebx
  jle    L170
  cmpl   $0x2,0x4(%rdi,%rax,1)
  je     L55
L170:
  mov    (%r9),%rcx
  movl   $0x1,(%rcx,%rax,1)
  add    $0x1,%ebp
  jmp    L4
L55:
  mov    (%r9),%rcx
  movl   $0x2,(%rcx,%rax,1)
L4:
  add    $0x1,%edx
  add    $0x4,%rax
  cmp    %edx,%ebx
  je     L74
L187:
  mov    %rsi,%r8
  mov    (%rsi),%rdi
  mov    (%rdi,%rax,1),%ecx
  cmp    $0x1,%ecx
  je     L212
  mov    (%r9),%rdi
  mov    %ecx,(%rdi,%rax,1)
  jmp    L4
L74:
  add    $0x1,%r10d
  add    $0x1,%r11
  add    $0x8,%r9
  add    $0x8,%rsi
  cmp    %r10d,%r14d
  je     L100
L156:
  mov    $0x0,%eax
  mov    $0x0,%edx
  test   %ebx,%ebx
  jg     L187
  jmp    L74
L100:
  mov    %r12,%rax
  mov    %r13,%r12
  cmp    %ebp,%r15d
  je     L24
  mov    %ebp,%r15d
  mov    %rax,%r13
L171:
  test   %r15d,%r15d
  jle    L106
  addl   $0x1,0x10(%rsp)
  mov    %r12,%r9
  mov    %r13,%rsi
  mov    $0x1,%r11d
  mov    $0x0,%r10d
  mov    $0x0,%ebp
  jmp    L156
L24:
  mov    %r10d,%edx
  mov    0x8(%rsp),%rsi
  mov    0x20(%rsp),%rdi
  call   <freeSpace@plt>
  mov    $0xffffffff,%r15d
  jmp    L42
L106:
  mov    %r14d,%edx
  mov    0x8(%rsp),%rsi
  mov    0x20(%rsp),%rdi
  call   <freeSpace@plt>
  mov    0x10(%rsp),%r15d
  jmp    L42
L238:
  mov    $0x0,%r15d
  jmp    L42
L279:
  lea    0x0(,%r14,8),%r12d
  mov    %r12d,%edi
  call   <malloc@plt>
  mov    %rax,0x20(%rsp)
  mov    %r12d,%edi
  call   <malloc@plt>
  mov    %rax,0x8(%rsp)
  lea    0x0(,%rbx,4),%edi
  lea    0x4(,%rbp,4),%r13
  mov    0x10(%rsp),%rsi
  mov    %rsi,%rbp
  mov    0x20(%rsp),%rax
  sub    %rsi,%rax
  mov    %r15d,0x28(%rsp)
  mov    %r14d,0x2c(%rsp)
  mov    %edi,%r14d
  mov    %rax,%r15
L183:
  mov    %r14d,%edi
  call   <malloc@plt>
  mov    %rax,%r12
  mov    %r14d,%edi
  call   <malloc@plt>
  test   %ebx,%ebx
  jle    L126
  mov    $0x0,%edx
L132:
  mov    0x0(%rbp),%rcx
  mov    (%rcx,%rdx,1),%ecx
  mov    %ecx,(%rax,%rdx,1)
  mov    %ecx,(%r12,%rdx,1)
  add    $0x4,%rdx
  cmp    %r13,%rdx
  jne    L132
L126:
  mov    %r12,(%r15,%rbp,1)
  mov    0x8(%rsp),%rdx
  sub    0x10(%rsp),%rdx
  mov    %rax,(%rdx,%rbp,1)
  add    $0x8,%rbp
  cmp    0x18(%rsp),%rbp
  jne    L183
  mov    0x28(%rsp),%r15d
  mov    0x2c(%rsp),%r14d
  mov    0x8(%rsp),%r12
  mov    0x20(%rsp),%r13
  movl   $0x0,0x10(%rsp)
  jmp    L171
L278:
  test   %r15d,%r15d
  jne    L279
L42:
  mov    %r15d,%eax
  add    $0x38,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
```

assistant: ```c
int orangesRotting(int **grid, int gridSize, int *gridColSize) {
  int colSize = *gridColSize;
  int firstFresh = 0;
  for (int i = 0; i < gridSize; i++) {
    for (int j = 0; j < colSize; j++) {
      if (grid[i][j] == 1) {
        firstFresh++;
      }
    }
  }
  if (firstFresh == 0) {
    return 0;
  }
  int **gridA, **gridB, **cur, **next, **temp;
  gridA = (int **)malloc(sizeof(int *) * gridSize);
  gridB = (int **)malloc(sizeof(int *) * gridSize);
  for (int i = 0; i < gridSize; i++) {
    int *rowA = (int *)malloc(sizeof(int) * colSize);
    int *rowB = (int *)malloc(sizeof(int) * colSize);
    for (int j = 0; j < colSize; j++) {
      rowA[j] = rowB[j] = grid[i][j];
    }
    gridA[i] = rowA;
    gridB[i] = rowB;
  }
  cur = gridA, next = gridB;
  int prevFresh = firstFresh, fresh = 0;
  int minute = 0;
  while (prevFresh > 0) {
    fresh = 0;
    minute++;
    for (int i = 0; i < gridSize; i++) {
      for (int j = 0; j < colSize; j++) {
        if (cur[i][j] == 1) {
          if ((i - 1 >= 0 && cur[i - 1][j] == 2) || (i + 1 < gridSize && cur[i + 1][j] == 2) || (j - 1 >= 0 && cur[i][j - 1] == 2) || (j + 1 < colSize && cur[i][j + 1] == 2)) {
            next[i][j] = 2;
          } else {
            next[i][j] = cur[i][j];
            fresh++;
          }
        } else {
          next[i][j] = cur[i][j];
        }
      }
    }
    if (fresh == prevFresh) {
      freeSpace(gridA, gridB, gridSize);
      return -1;
    } else {
      prevFresh = fresh;
      temp = cur;
      cur = next;
      next = temp;
    }
  }
  freeSpace(gridA, gridB, gridSize);
  return minute;
}
```