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     L113
  mov    %edi,%ebx
  test   %edi,%edi
  jle    L164
  mov    %rdx,%rbp
  mov    %rcx,%r12
  lea    0x10(%rsp),%r13
  xor    %r10d,%r10d
L125:
  mov    0x0(%rbp,%r10,8),%rdi
  mov    (%r12,%r10,8),%r14
  cmp    %r14,%rdi
  jl     L46
  mov    (%rsp),%rax
  mov    (%rax,%r10,8),%r11
  mov    0x8(%rsp),%rax
  mov    (%rax,%r10,8),%rax
  cmp    %rax,%r11
  jg     L46
  mov    (%r9,%r10,8),%rdx
  mov    %rdx,%rsi
  neg    %rsi
  cmovs  %rdx,%rsi
  sub    %r14,%rax
  cqto
  idiv   %rsi
  test   %rax,%rax
  js     L124
  mov    %rdi,%rax
  sub    %r11,%rax
  add    $0x1,%rax
  mov    %rax,0x0(%r13)
  test   %rax,%rax
  jle    L124
  test   %r10,%r10
  je     L161
  imul   -0x8(%r13),%rax
  mov    %rax,0x0(%r13)
L161:
  mov    $0x1,%r8d
  lea    -0x1(%r11),%rcx
  sub    $0x1,%rdi
  sub    %r14,%r8
  jmp    L131
  nopw   0x0(%rax,%rax,1)
L178:
  add    $0x1,%rcx
  cmp    %rcx,%rdi
  jl     L46
L131:
  lea    (%rcx,%r8,1),%rax
  cqto
  idiv   %rsi
  test   %rdx,%rdx
  jne    L178
  jmp    L10
  nopl   (%rax)
L140:
  sub    $0x1,%rdi
  cmp    %rdi,%rcx
  jg     L46
L10:
  lea    (%rdi,%r8,1),%rax
  cqto
  idiv   %rsi
  test   %rdx,%rdx
  jne    L140
  mov    %r14,%rcx
  mov    $0x0,%eax
  sub    %r11,%rcx
  cmovs  %rax,%rcx
  sub    %r14,%r11
  jmp    L104
  nop
L9:
  add    $0x1,%rcx
  cmp    0x0(%r13),%rcx
  jge    L46
L104:
  lea    (%r11,%rcx,1),%rax
  cqto
  idiv   %rsi
  test   %rdx,%rdx
  jne    L9
  add    $0x1,%r10
  add    $0x8,%r13
  cmp    %r10d,%ebx
  jg     L125
L164:
  mov    $0x1,%eax
  xchg   %ax,%ax
L113:
  mov    0x48(%rsp),%rdx
  sub    %fs:0x28,%rdx
  jne    L4
  add    $0x58,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L124:
  movl   $0x143,(%r15)
  cs nopw 0x0(%rax,%rax,1)
L46:
  xor    %eax,%eax
  jmp    L113
L4:
  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);
}
```