user: 请从给定的汇编指令推导出C源代码：

```asm
<homogeneityEdgeDetection>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x78,%rsp
  mov    %rsi,0x18(%rsp)
  mov    %rcx,0x8(%rsp)
  mov    %r8,0x20(%rsp)
  mov    %r9,0x28(%rsp)
  mov    %fs:0x28,%rax
  mov    %rax,0x68(%rsp)
  xor    %eax,%eax
  movl   $0xffffffff,0x14(%rsp)
  cmpl   $0x0,(%rsi)
  jle    L260
  mov    %rdi,%r14
  mov    $0x0,%r12d
  lea    0x60(%rsp),%r13
  mov    %r12d,%r15d
  mov    %rdx,%r12
  jmp    L153
L117:
  mov    %eax,0x40(%rsp)
  test   %r8d,%r8d
  jg     L234
  sub    $0x1,%r11d
  cmp    %r11d,%r15d
  setl   %r11b
  mov    %eax,%ebp
  mov    %eax,%ebx
L67:
  mov    %ebp,0x44(%rsp)
  mov    %ebx,0x48(%rsp)
  test   %r15d,%r15d
  jle    L90
  mov    0x14(%rsp),%r10d
  imul   %edx,%r10d
  add    %r8d,%r10d
  add    %ecx,%r10d
  mov    %r10d,0x4c(%rsp)
  test   %r11b,%r11b
  jne    L70
  mov    %eax,0x50(%rsp)
L209:
  lea    -0x1(%rdx),%r10d
  cmp    %r8d,%r10d
  jle    L211
  mov    0x3c(%rsp),%ebx
  imul   %edx,%ebx
  add    0x34(%rsp),%ebx
  add    %ecx,%ebx
  mov    %ebx,0x54(%rsp)
L94:
  mov    0x34(%rsp),%ebx
  add    %ebx,%edi
  add    %ecx,%edi
  cmp    %r10d,%r8d
  jge    L75
  test   %r11b,%r11b
  je     L75
  imul   0x30(%rsp),%edx
  add    %ebx,%edx
  add    %ecx,%edx
  jmp    L127
L75:
  mov    %eax,%edx
  jmp    L127
L190:
  add    $0x1,%r8d
  addl   $0x1,0x10(%rsp)
  cmp    %r8d,(%r12)
  jle    L284
L287:
  mov    $0x0,%r9d
  lea    -0x1(%r8),%eax
  mov    %eax,0x38(%rsp)
  lea    0x1(%r8),%eax
  mov    %eax,0x34(%rsp)
  mov    0x8(%rsp),%rax
  cmpl   $0x0,(%rax)
  jg     L252
  jmp    L190
L284:
  add    $0x1,%r15d
  addl   $0x1,0x14(%rsp)
  mov    0x18(%rsp),%rax
  cmp    %r15d,(%rax)
  jle    L260
L153:
  movl   $0xffffffff,0x10(%rsp)
  mov    $0x0,%r8d
  lea    0x1(%r15),%eax
  mov    %eax,0x30(%rsp)
  lea    -0x1(%r15),%eax
  mov    %eax,0x3c(%rsp)
  cmpl   $0x0,(%r12)
  jg     L287
  jmp    L284
L211:
  mov    %eax,0x54(%rsp)
L207:
  mov    %eax,%edi
  mov    %eax,%edx
L127:
  mov    %edi,0x58(%rsp)
  mov    %edx,0x5c(%rsp)
  lea    0x40(%rsp),%rdi
  mov    $0x0,%r10d
L110:
  movslq (%rdi),%rdx
  mov    (%r14,%rdx,4),%edx
  sub    %eax,%edx
  mov    %edx,%ecx
  neg    %ecx
  cmovns %ecx,%edx
  cmp    %edx,%r10d
  cmovl  %edx,%r10d
  add    $0x4,%rdi
  cmp    %r13,%rdi
  jne    L110
  mov    0x20(%rsp),%rax
  add    (%rax),%r10d
  mov    $0xff,%eax
  cmp    %eax,%r10d
  cmovg  %eax,%r10d
  mov    0x28(%rsp),%rax
  mov    %r10d,(%rax,%rsi,4)
  add    $0x1,%r9d
  mov    0x8(%rsp),%rax
  cmp    %r9d,(%rax)
  jle    L190
L252:
  mov    (%r12),%edx
  mov    %edx,%edi
  imul   %r15d,%edi
  mov    0x18(%rsp),%rax
  mov    (%rax),%r11d
  mov    %edx,%ecx
  imul   %r11d,%ecx
  imul   %r9d,%ecx
  lea    (%rdi,%r8,1),%esi
  add    %ecx,%esi
  movslq %esi,%rsi
  mov    (%r14,%rsi,4),%eax
  test   %r8d,%r8d
  setg   %r10b
  test   %r15d,%r15d
  jle    L117
  test   %r10b,%r10b
  je     L117
  mov    0x14(%rsp),%ebx
  imul   %edx,%ebx
  add    0x10(%rsp),%ebx
  add    %ecx,%ebx
  mov    %ebx,0x40(%rsp)
L234:
  mov    0x10(%rsp),%ebx
  lea    (%rbx,%rdi,1),%ebp
  add    %ecx,%ebp
  sub    $0x1,%r11d
  cmp    %r15d,%r11d
  setg   %r11b
  mov    %eax,%ebx
  and    %r11b,%r10b
  je     L67
  mov    0x30(%rsp),%ebx
  imul   %edx,%ebx
  add    0x38(%rsp),%ebx
  add    %ecx,%ebx
  mov    %r10d,%r11d
  jmp    L67
L216:
  mov    %eax,0x50(%rsp)
  mov    %eax,0x54(%rsp)
  sub    $0x1,%edx
  cmp    %edx,%r8d
  jge    L207
  add    0x34(%rsp),%edi
  add    %ecx,%edi
  mov    %eax,%edx
  jmp    L127
L90:
  mov    %eax,0x4c(%rsp)
  test   %r11b,%r11b
  je     L216
  mov    0x30(%rsp),%r10d
  imul   %edx,%r10d
  add    %r8d,%r10d
  add    %ecx,%r10d
  mov    %r10d,0x50(%rsp)
  mov    %eax,0x54(%rsp)
  lea    -0x1(%rdx),%r10d
  cmp    %r8d,%r10d
  jle    L207
  jmp    L94
L70:
  mov    0x30(%rsp),%r10d
  imul   %edx,%r10d
  add    %r8d,%r10d
  add    %ecx,%r10d
  mov    %r10d,0x50(%rsp)
  jmp    L209
L260:
  mov    0x68(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L1
  add    $0x78,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L1:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
void homogeneityEdgeDetection(int *image, int *width, int *height, int *depth, int *bias, int *ret) {
  int x, y, d, i;
  int max, value;
  for (x = 0; x < *width; x++) {
    for (y = 0; y < *height; y++) {
      for (d = 0; d < *depth; d++) {
        int current = image[((*height) * (x) + (y) + (*width) * (*height) * (d))];
        int n[8];
        n[0] = (x - 1 < 0 || y - 1 < 0) ? current : ((*height) * (x - 1) + (y - 1) + (*width) * (*height) * (d));
        n[1] = (y - 1 < 0) ? current : ((*height) * (x) + (y - 1) + (*width) * (*height) * (d));
        n[2] = (x + 1 > *width - 1 || y - 1 < 0) ? current : ((*height) * (x + 1) + (y - 1) + (*width) * (*height) * (d));
        n[3] = (x - 1 < 0) ? current : ((*height) * (x - 1) + (y) + (*width) * (*height) * (d));
        n[4] = (x + 1 > *width - 1) ? current : ((*height) * (x + 1) + (y) + (*width) * (*height) * (d));
        n[5] = (x - 1 < 0 || y + 1 > *height - 1) ? current : ((*height) * (x - 1) + (y + 1) + (*width) * (*height) * (d));
        n[6] = (y + 1 > *height - 1) ? current : ((*height) * (x) + (y + 1) + (*width) * (*height) * (d));
        n[7] = (x + 1 > *width - 1 || y + 1 > *height - 1) ? current : ((*height) * (x + 1) + (y + 1) + (*width) * (*height) * (d));
        max = 0;
        for (i = 0; i < 8; i++) {
          value = abs(image[n[i]] - current);
          if (value > max) {
            max = value;
          }
        }
        ret[((*height) * (x) + (y) + (*width) * (*height) * (d))] = (max + *bias) >= (255) ? (255) : (max + *bias);
      }
    }
  }
}
```