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

```asm
<imcomp_test_overlap>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0xa8,%rsp
  mov    %edi,0x2c(%rsp)
  mov    %rsi,0x18(%rsp)
  mov    %rdx,0x8(%rsp)
  mov    %rcx,0x10(%rsp)
  mov    %r8,0x20(%rsp)
  mov    0xe0(%rsp),%r13
  mov    %fs:0x28,%rax
  mov    %rax,0x98(%rsp)
  xor    %eax,%eax
  mov    0x0(%r13),%eax
  test   %eax,%eax
  jg     L140
  test   %edi,%edi
  jle    L216
  lea    0x60(%rsp),%r15
  lea    0x30(%rsp),%r14
  mov    $0x0,%r11d
L132:
  mov    0x8(%rsp),%rax
  mov    (%rax,%r11,8),%rdi
  mov    0x10(%rsp),%rax
  mov    (%rax,%r11,8),%r10
  cmp    %r10,%rdi
  jl     L218
  mov    0x18(%rsp),%rax
  mov    (%rax,%r11,8),%rbx
  mov    0x20(%rsp),%rax
  mov    (%rax,%r11,8),%rax
  cmp    %rax,%rbx
  jg     L158
  mov    (%r9,%r11,8),%rdx
  mov    %rdx,%rsi
  neg    %rsi
  cmovs  %rdx,%rsi
  sub    %r10,%rax
  cqto
  idiv   %rsi
  test   %rax,%rax
  js     L82
  mov    %rdi,%rax
  sub    %rbx,%rax
  add    $0x1,%rax
  mov    %r14,%r12
  mov    %rax,(%r14)
  test   %rax,%rax
  jle    L60
  test   %r11d,%r11d
  jle    L39
  imul   -0x8(%r14),%rax
  mov    %rax,(%r14)
L39:
  lea    -0x1(%rbx),%rcx
  lea    -0x1(%r10),%rbp
  mov    $0x1,%r8d
  sub    %r10,%r8
L90:
  lea    (%r8,%rcx,1),%rax
  cqto
  idiv   %rsi
  test   %rdx,%rdx
  je     L129
  add    $0x1,%rcx
  cmp    %rcx,%rdi
  jg     L90
  mov    $0x0,%eax
L140:
  mov    0x98(%rsp),%rdx
  sub    %fs:0x28,%rdx
  jne    L69
  add    $0xa8,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L82:
  movl   $0x143,0x0(%r13)
  mov    $0x0,%eax
  jmp    L140
L60:
  movl   $0x143,0x0(%r13)
  mov    $0x0,%eax
  jmp    L140
L129:
  sub    %r10,%rdi
L84:
  mov    %rdi,%rax
  cqto
  idiv   %rsi
  test   %rdx,%rdx
  je     L51
  sub    $0x1,%rdi
  lea    0x0(%rbp,%rdi,1),%rax
  cmp    %rax,%rcx
  jle    L84
  mov    $0x0,%eax
  jmp    L140
L51:
  mov    %r15,%rdi
  mov    %r10,%rax
  sub    %rbx,%rax
  cmovs  %rdx,%rax
  mov    %rax,(%r15)
L201:
  mov    (%rdi),%rcx
  lea    (%rbx,%rcx,1),%rax
  sub    %r10,%rax
  cqto
  idiv   %rsi
  test   %rdx,%rdx
  je     L19
  add    $0x1,%rcx
  mov    %rcx,(%rdi)
  cmp    (%r12),%rcx
  jl     L201
  mov    $0x0,%eax
  jmp    L140
L19:
  add    $0x1,%r11
  add    $0x8,%r15
  add    $0x8,%r14
  cmp    %r11d,0x2c(%rsp)
  jg     L132
  mov    $0x1,%eax
  jmp    L140
L216:
  mov    $0x1,%eax
  jmp    L140
L218:
  mov    $0x0,%eax
  jmp    L140
L158:
  mov    $0x0,%eax
  jmp    L140
L69:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
int imcomp_test_overlap(int ndim, long *tfpixel, long *tlpixel, long *fpixel, long *lpixel, long *ininc, int *status) {
  long imgdim[6];
  long tiledim[6];
  long imgfpix[6];
  long imglpix[6];
  long tilefpix[6];
  long inc[6];
  int ii;
  long tf, tl;
  if (*status > 0)
    return (*status);
  for (ii = 0; ii < ndim; ii++) {
    if (tlpixel[ii] < fpixel[ii] || tfpixel[ii] > lpixel[ii])
      return (0);
    inc[ii] = ininc[ii];
    imgdim[ii] = (lpixel[ii] - fpixel[ii]) / labs(inc[ii]) + 1;
    if (imgdim[ii] < 1) {
      *status = 323;
      return (0);
    }
    tiledim[ii] = tlpixel[ii] - tfpixel[ii] + 1;
    if (tiledim[ii] < 1) {
      *status = 323;
      return (0);
    }
    if (ii > 0)
      tiledim[ii] *= tiledim[ii - 1];
    tf = tfpixel[ii] - 1;
    tl = tlpixel[ii] - 1;
    while ((tf - (fpixel[ii] - 1)) % labs(inc[ii])) {
      tf++;
      if (tf > tl)
        return (0);
    }
    while ((tl - (fpixel[ii] - 1)) % labs(inc[ii])) {
      tl--;
      if (tf > tl)
        return (0);
    }
    imgfpix[ii] = (((tf - fpixel[ii] + 1) / labs(inc[ii])) > (0) ? ((tf - fpixel[ii] + 1) / labs(inc[ii])) : (0));
    imglpix[ii] = (((tl - fpixel[ii] + 1) / labs(inc[ii])) < (imgdim[ii] - 1) ? ((tl - fpixel[ii] + 1) / labs(inc[ii])) : (imgdim[ii] - 1));
    tilefpix[ii] = ((fpixel[ii] - tfpixel[ii]) > (0) ? (fpixel[ii] - tfpixel[ii]) : (0));
    while ((tfpixel[ii] + tilefpix[ii] - fpixel[ii]) % labs(inc[ii])) {
      (tilefpix[ii])++;
      if (tilefpix[ii] >= tiledim[ii])
        return (0);
    }
    if (ii > 0)
      imgdim[ii] *= imgdim[ii - 1];
  }
  return (1);
}
```