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

```asm
<difference_edge>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x28,%rsp
  mov    %rdi,%rbx
  mov    %rsi,0x8(%rsp)
  mov    %rdx,%rdi
  mov    %rdx,(%rsp)
  mov    %rcx,%r15
  mov    %r9d,0x14(%rsp)
  cmp    $0x4,%r8
  mov    $0x10,%r14d
  mov    $0x3,%eax
  cmove  %eax,%r14d
  mov    $0xfa,%edx
  mov    $0xa,%eax
  cmovne %edx,%eax
  mov    %eax,0x1c(%rsp)
  test   %rdi,%rdi
  jle    L10
  mov    %rsi,%rcx
  lea    (%rsi,%rdi,8),%rdi
  lea    (%r15,%r15,1),%rsi
  jmp    L194
L27:
  mov    (%rcx),%rdx
  movw   $0x0,(%rdx,%rax,1)
  add    $0x2,%rax
  cmp    %rsi,%rax
  jne    L27
L195:
  add    $0x8,%rcx
  cmp    %rdi,%rcx
  je     L10
L194:
  mov    $0x0,%eax
  test   %r15,%r15
  jg     L27
  jmp    L195
L10:
  mov    (%rsp),%rax
  cmp    $0x2,%rax
  jle    L168
  mov    0x8(%rsp),%rdi
  lea    0x8(%rdi),%rbp
  sub    $0x1,%rax
  lea    -0x4(%r15,%r15,1),%r12
  mov    $0x2,%r13d
  mov    %r14d,0x18(%rsp)
  mov    %rax,%r14
  jmp    L133
L1:
  add    $0x1,%r13
  add    $0x8,%rbx
  add    $0x8,%rbp
L133:
  cmp    $0x2,%r15
  jle    L112
  mov    $0x0,%edx
L48:
  mov    (%rbx),%r9
  mov    %rdx,%rcx
  add    $0x2,%rdx
  mov    0x10(%rbx),%r8
  mov    0x8(%rbx),%r10
  mov    0x0(%rbp),%rdi
  movswl (%r9,%rcx,1),%esi
  movswl 0x4(%r8,%rcx,1),%eax
  sub    %eax,%esi
  mov    %esi,%eax
  neg    %eax
  cmovs  %esi,%eax
  movswl 0x4(%r9,%rcx,1),%esi
  movswl (%r8,%rcx,1),%r11d
  sub    %r11d,%esi
  mov    %esi,%r11d
  neg    %r11d
  cmovns %r11d,%esi
  cmp    %esi,%eax
  cmovl  %esi,%eax
  test   %eax,%eax
  mov    $0x0,%esi
  cmovs  %esi,%eax
  movswl (%r10,%rcx,1),%esi
  movswl 0x4(%r10,%rcx,1),%r10d
  mov    %esi,%ecx
  sub    %r10d,%ecx
  mov    %ecx,%esi
  neg    %esi
  cmovns %esi,%ecx
  cmp    %ecx,%eax
  cmovl  %ecx,%eax
  movswl (%r9,%rdx,1),%ecx
  movswl (%r8,%rdx,1),%esi
  sub    %esi,%ecx
  mov    %ecx,%esi
  neg    %esi
  cmovns %esi,%ecx
  cmp    %ecx,%eax
  cmovl  %ecx,%eax
  mov    %ax,(%rdi,%rdx,1)
  cmp    %r12,%rdx
  jne    L48
L112:
  mov    %r13d,%esi
  cmp    %r14,%r13
  je     L148
  movslq %r13d,%rax
  imul   $0x66666667,%rax,%rax
  sar    $0x22,%rax
  mov    %r13d,%edx
  sar    $0x1f,%edx
  sub    %edx,%eax
  lea    (%rax,%rax,4),%eax
  add    %eax,%eax
  cmp    %r13d,%eax
  jne    L1
  lea    D0(%rip),%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  jmp    L1
L148:
  mov    0x18(%rsp),%r14d
L168:
  cmpl   $0x1,0x14(%rsp)
  je     L0
L49:
  mov    $0x1,%eax
  add    $0x28,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L0:
  mov    (%rsp),%rax
  test   %rax,%rax
  jle    L49
  mov    0x8(%rsp),%rdi
  mov    %rdi,%rsi
  lea    (%rdi,%rax,8),%r8
  lea    (%r15,%r15,1),%rdi
  mov    0x1c(%rsp),%r9d
  mov    0x60(%rsp),%r10d
  jmp    L36
L191:
  mov    %rax,%rdx
  add    (%rsi),%rdx
  movswl (%rdx),%ecx
  cmp    %r10d,%ecx
  mov    %r9d,%ecx
  cmovle %r14d,%ecx
  mov    %cx,(%rdx)
  add    $0x2,%rax
  cmp    %rax,%rdi
  jne    L191
L56:
  add    $0x8,%rsi
  cmp    %r8,%rsi
  je     L49
L36:
  mov    $0x0,%eax
  test   %r15,%r15
  jg     L191
  jmp    L56
```

tool_calls: name: disassemble_data
arguments: data_label: D0
type_guessed: string

tool: D0: %4d

assistant: ```c
int difference_edge(the_image, out_image, rows, cols, bits_per_pixel, threshold, high)
int high, threshold;
short **the_image, **out_image;
long rows, cols, bits_per_pixel;
{
  int a, b, absdiff, absmax, diff, i, j, length, max, max_diff, new_hi, new_low, width;
  new_hi = 250;
  new_low = 16;
  if (bits_per_pixel == 4) {
    new_hi = 10;
    new_low = 3;
  }
  max = 255;
  if (bits_per_pixel == 4)
    max = 16;
  for (i = 0; i < rows; i++)
    for (j = 0; j < cols; j++)
      out_image[i][j] = 0;
  for (i = 1; i < rows - 1; i++) {
    if ((i % 10) == 0)
      printf("%4d", i);
    for (j = 1; j < cols - 1; j++) {
      max_diff = 0;
      absdiff = abs(the_image[i - 1][j - 1] - the_image[i + 1][j + 1]);
      if (absdiff > max_diff)
        max_diff = absdiff;
      absdiff = abs(the_image[i - 1][j + 1] - the_image[i + 1][j - 1]);
      if (absdiff > max_diff)
        max_diff = absdiff;
      absdiff = abs(the_image[i][j - 1] - the_image[i][j + 1]);
      if (absdiff > max_diff)
        max_diff = absdiff;
      absdiff = abs(the_image[i - 1][j] - the_image[i + 1][j]);
      if (absdiff > max_diff)
        max_diff = absdiff;
      out_image[i][j] = max_diff;
    }
  }
  if (threshold == 1) {
    for (i = 0; i < rows; i++) {
      for (j = 0; j < cols; j++) {
        if (out_image[i][j] > high) {
          out_image[i][j] = new_hi;
        } else {
          out_image[i][j] = new_low;
        }
      }
    }
  }
  return (1);
}
```