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

```asm
<imcomp_test_overlap>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x58,%rsp
  mov    %rsi,(%rsp)
  mov    0x90(%rsp),%r15
  mov    %r8,0x8(%rsp)
  mov    %fs:0x28,%rax
  mov    %rax,0x48(%rsp)
  mov    (%r15),%eax
  test   %eax,%eax
  jg     L173
  mov    %edi,%ebx
  test   %edi,%edi
  jle    L115
  mov    %rdx,%rbp
  mov    %rcx,%r12
  lea    0x10(%rsp),%r13
  xor    %r10d,%r10d
L152:
  mov    0x0(%rbp,%r10,8),%rdi
  mov    (%r12,%r10,8),%r14
  cmp    %r14,%rdi
  jl     L22
  mov    (%rsp),%rax
  mov    (%rax,%r10,8),%r11
  mov    0x8(%rsp),%rax
  mov    (%rax,%r10,8),%rax
  cmp    %rax,%r11
  jg     L22
  mov    (%r9,%r10,8),%rdx
  mov    %rdx,%rsi
  neg    %rsi
  cmovs  %rdx,%rsi
  sub    %r14,%rax
  cqto
  idiv   %rsi
  test   %rax,%rax
  js     L169
  mov    %rdi,%rax
  sub    %r11,%rax
  add    $0x1,%rax
  mov    %rax,0x0(%r13)
  test   %rax,%rax
  jle    L169
  test   %r10,%r10
  je     L108
  imul   -0x8(%r13),%rax
  mov    %rax,0x0(%r13)
L108:
  mov    $0x1,%r8d
  lea    -0x1(%r11),%rcx
  sub    $0x1,%rdi
  sub    %r14,%r8
  jmp    L25
  nopw   0x0(%rax,%rax,1)
L41:
  add    $0x1,%rcx
  cmp    %rcx,%rdi
  jl     L22
L25:
  lea    (%rcx,%r8,1),%rax
  cqto
  idiv   %rsi
  test   %rdx,%rdx
  jne    L41
  jmp    L121
  nopl   (%rax)
L20:
  sub    $0x1,%rdi
  cmp    %rdi,%rcx
  jg     L22
L121:
  lea    (%rdi,%r8,1),%rax
  cqto
  idiv   %rsi
  test   %rdx,%rdx
  jne    L20
  mov    %r14,%rcx
  mov    $0x0,%eax
  sub    %r11,%rcx
  cmovs  %rax,%rcx
  sub    %r14,%r11
  jmp    L90
  nop
L83:
  add    $0x1,%rcx
  cmp    0x0(%r13),%rcx
  jge    L22
L90:
  lea    (%r11,%rcx,1),%rax
  cqto
  idiv   %rsi
  test   %rdx,%rdx
  jne    L83
  add    $0x1,%r10
  add    $0x8,%r13
  cmp    %r10d,%ebx
  jg     L152
L115:
  mov    $0x1,%eax
  xchg   %ax,%ax
L173:
  mov    0x48(%rsp),%rdx
  sub    %fs:0x28,%rdx
  jne    L8
  add    $0x58,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L169:
  movl   $0x143,(%r15)
  cs nopw 0x0(%rax,%rax,1)
L22:
  xor    %eax,%eax
  jmp    L173
L8:
  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);
}
```