user: Translate the below assembly code into C programming language:

```asm
<homogeneityEdgeDetection>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  add    $0xffffffffffffff80,%rsp
  mov    %rdi,-0x58(%rbp)
  mov    %rsi,-0x60(%rbp)
  mov    %rdx,-0x68(%rbp)
  mov    %rcx,-0x70(%rbp)
  mov    %r8,-0x78(%rbp)
  mov    %r9,-0x80(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  movl   $0x0,-0x4c(%rbp)
  jmp    L236
L132:
  movl   $0x0,-0x48(%rbp)
  jmp    L2
L239:
  movl   $0x0,-0x44(%rbp)
  jmp    L119
L13:
  mov    -0x68(%rbp),%rax
  mov    (%rax),%eax
  imul   -0x4c(%rbp),%eax
  mov    %eax,%edx
  mov    -0x48(%rbp),%eax
  lea    (%rdx,%rax,1),%ecx
  mov    -0x60(%rbp),%rax
  mov    (%rax),%edx
  mov    -0x68(%rbp),%rax
  mov    (%rax),%eax
  imul   %edx,%eax
  imul   -0x44(%rbp),%eax
  add    %ecx,%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x58(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  mov    %eax,-0x38(%rbp)
  cmpl   $0x0,-0x4c(%rbp)
  jle    L153
  cmpl   $0x0,-0x48(%rbp)
  jle    L153
  mov    -0x68(%rbp),%rax
  mov    (%rax),%eax
  mov    -0x4c(%rbp),%edx
  sub    $0x1,%edx
  imul   %eax,%edx
  mov    -0x48(%rbp),%eax
  sub    $0x1,%eax
  lea    (%rdx,%rax,1),%ecx
  mov    -0x60(%rbp),%rax
  mov    (%rax),%edx
  mov    -0x68(%rbp),%rax
  mov    (%rax),%eax
  imul   %edx,%eax
  imul   -0x44(%rbp),%eax
  add    %ecx,%eax
  jmp    L77
L153:
  mov    -0x38(%rbp),%eax
L77:
  mov    %eax,-0x30(%rbp)
  cmpl   $0x0,-0x48(%rbp)
  jle    L6
  mov    -0x68(%rbp),%rax
  mov    (%rax),%eax
  imul   -0x4c(%rbp),%eax
  mov    %eax,%edx
  mov    -0x48(%rbp),%eax
  sub    $0x1,%eax
  lea    (%rdx,%rax,1),%ecx
  mov    -0x60(%rbp),%rax
  mov    (%rax),%edx
  mov    -0x68(%rbp),%rax
  mov    (%rax),%eax
  imul   %edx,%eax
  imul   -0x44(%rbp),%eax
  add    %ecx,%eax
  jmp    L86
L6:
  mov    -0x38(%rbp),%eax
L86:
  mov    %eax,-0x2c(%rbp)
  mov    -0x60(%rbp),%rax
  mov    (%rax),%eax
  sub    $0x1,%eax
  cmp    %eax,-0x4c(%rbp)
  jge    L0
  cmpl   $0x0,-0x48(%rbp)
  jle    L0
  mov    -0x68(%rbp),%rax
  mov    (%rax),%eax
  mov    -0x4c(%rbp),%edx
  add    $0x1,%edx
  imul   %eax,%edx
  mov    -0x48(%rbp),%eax
  sub    $0x1,%eax
  lea    (%rdx,%rax,1),%ecx
  mov    -0x60(%rbp),%rax
  mov    (%rax),%edx
  mov    -0x68(%rbp),%rax
  mov    (%rax),%eax
  imul   %edx,%eax
  imul   -0x44(%rbp),%eax
  add    %ecx,%eax
  jmp    L66
L0:
  mov    -0x38(%rbp),%eax
L66:
  mov    %eax,-0x28(%rbp)
  cmpl   $0x0,-0x4c(%rbp)
  jle    L82
  mov    -0x68(%rbp),%rax
  mov    (%rax),%eax
  mov    -0x4c(%rbp),%edx
  sub    $0x1,%edx
  imul   %eax,%edx
  mov    -0x48(%rbp),%eax
  lea    (%rdx,%rax,1),%ecx
  mov    -0x60(%rbp),%rax
  mov    (%rax),%edx
  mov    -0x68(%rbp),%rax
  mov    (%rax),%eax
  imul   %edx,%eax
  imul   -0x44(%rbp),%eax
  add    %ecx,%eax
  jmp    L298
L82:
  mov    -0x38(%rbp),%eax
L298:
  mov    %eax,-0x24(%rbp)
  mov    -0x60(%rbp),%rax
  mov    (%rax),%eax
  sub    $0x1,%eax
  cmp    %eax,-0x4c(%rbp)
  jge    L170
  mov    -0x68(%rbp),%rax
  mov    (%rax),%eax
  mov    -0x4c(%rbp),%edx
  add    $0x1,%edx
  imul   %eax,%edx
  mov    -0x48(%rbp),%eax
  lea    (%rdx,%rax,1),%ecx
  mov    -0x60(%rbp),%rax
  mov    (%rax),%edx
  mov    -0x68(%rbp),%rax
  mov    (%rax),%eax
  imul   %edx,%eax
  imul   -0x44(%rbp),%eax
  add    %ecx,%eax
  jmp    L4
L170:
  mov    -0x38(%rbp),%eax
L4:
  mov    %eax,-0x20(%rbp)
  cmpl   $0x0,-0x4c(%rbp)
  jle    L34
  mov    -0x68(%rbp),%rax
  mov    (%rax),%eax
  sub    $0x1,%eax
  cmp    %eax,-0x48(%rbp)
  jge    L34
  mov    -0x68(%rbp),%rax
  mov    (%rax),%eax
  mov    -0x4c(%rbp),%edx
  sub    $0x1,%edx
  imul   %eax,%edx
  mov    -0x48(%rbp),%eax
  add    $0x1,%eax
  lea    (%rdx,%rax,1),%ecx
  mov    -0x60(%rbp),%rax
  mov    (%rax),%edx
  mov    -0x68(%rbp),%rax
  mov    (%rax),%eax
  imul   %edx,%eax
  imul   -0x44(%rbp),%eax
  add    %ecx,%eax
  jmp    L57
L34:
  mov    -0x38(%rbp),%eax
L57:
  mov    %eax,-0x1c(%rbp)
  mov    -0x68(%rbp),%rax
  mov    (%rax),%eax
  sub    $0x1,%eax
  cmp    %eax,-0x48(%rbp)
  jge    L237
  mov    -0x68(%rbp),%rax
  mov    (%rax),%eax
  imul   -0x4c(%rbp),%eax
  mov    %eax,%edx
  mov    -0x48(%rbp),%eax
  add    $0x1,%eax
  lea    (%rdx,%rax,1),%ecx
  mov    -0x60(%rbp),%rax
  mov    (%rax),%edx
  mov    -0x68(%rbp),%rax
  mov    (%rax),%eax
  imul   %edx,%eax
  imul   -0x44(%rbp),%eax
  add    %ecx,%eax
  jmp    L28
L237:
  mov    -0x38(%rbp),%eax
L28:
  mov    %eax,-0x18(%rbp)
  mov    -0x60(%rbp),%rax
  mov    (%rax),%eax
  sub    $0x1,%eax
  cmp    %eax,-0x4c(%rbp)
  jge    L63
  mov    -0x68(%rbp),%rax
  mov    (%rax),%eax
  sub    $0x1,%eax
  cmp    %eax,-0x48(%rbp)
  jge    L63
  mov    -0x68(%rbp),%rax
  mov    (%rax),%eax
  mov    -0x4c(%rbp),%edx
  add    $0x1,%edx
  imul   %eax,%edx
  mov    -0x48(%rbp),%eax
  add    $0x1,%eax
  lea    (%rdx,%rax,1),%ecx
  mov    -0x60(%rbp),%rax
  mov    (%rax),%edx
  mov    -0x68(%rbp),%rax
  mov    (%rax),%eax
  imul   %edx,%eax
  imul   -0x44(%rbp),%eax
  add    %ecx,%eax
  jmp    L223
L63:
  mov    -0x38(%rbp),%eax
L223:
  mov    %eax,-0x14(%rbp)
  movl   $0x0,-0x3c(%rbp)
  movl   $0x0,-0x40(%rbp)
  jmp    L105
L45:
  mov    -0x40(%rbp),%eax
  cltq
  mov    -0x30(%rbp,%rax,4),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x58(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  sub    -0x38(%rbp),%eax
  mov    %eax,%edx
  neg    %edx
  cmovns %edx,%eax
  mov    %eax,-0x34(%rbp)
  mov    -0x34(%rbp),%eax
  cmp    -0x3c(%rbp),%eax
  jle    L48
  mov    -0x34(%rbp),%eax
  mov    %eax,-0x3c(%rbp)
L48:
  addl   $0x1,-0x40(%rbp)
L105:
  cmpl   $0x7,-0x40(%rbp)
  jle    L45
  mov    -0x78(%rbp),%rax
  mov    (%rax),%edx
  mov    -0x3c(%rbp),%eax
  add    %edx,%eax
  mov    -0x68(%rbp),%rdx
  mov    (%rdx),%edx
  mov    %edx,%ecx
  imul   -0x4c(%rbp),%ecx
  mov    -0x48(%rbp),%edx
  lea    (%rcx,%rdx,1),%esi
  mov    -0x60(%rbp),%rdx
  mov    (%rdx),%ecx
  mov    -0x68(%rbp),%rdx
  mov    (%rdx),%edx
  imul   %ecx,%edx
  imul   -0x44(%rbp),%edx
  add    %esi,%edx
  movslq %edx,%rdx
  lea    0x0(,%rdx,4),%rcx
  mov    -0x80(%rbp),%rdx
  add    %rcx,%rdx
  mov    $0xff,%ecx
  cmp    %ecx,%eax
  cmovg  %ecx,%eax
  mov    %eax,(%rdx)
  addl   $0x1,-0x44(%rbp)
L119:
  mov    -0x70(%rbp),%rax
  mov    (%rax),%eax
  cmp    %eax,-0x44(%rbp)
  jl     L13
  addl   $0x1,-0x48(%rbp)
L2:
  mov    -0x68(%rbp),%rax
  mov    (%rax),%eax
  cmp    %eax,-0x48(%rbp)
  jl     L239
  addl   $0x1,-0x4c(%rbp)
L236:
  mov    -0x60(%rbp),%rax
  mov    (%rax),%eax
  cmp    %eax,-0x4c(%rbp)
  jl     L132
  nop
  mov    -0x8(%rbp),%rax
  sub    %fs:0x28,%rax
  je     L181
  call   <__stack_chk_fail@plt>
L181:
  leave
  ret
```

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);
      }
    }
  }
}
```