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

```asm
<filter_image>:
  endbr64
  push   %r15
  xor    %eax,%eax
  push   %r14
  mov    %rcx,%r14
  push   %r13
  mov    %r9,%r13
  push   %r12
  mov    %rdx,%r12
  mov    %r9,%rdx
  push   %rbp
  mov    %rdi,%rbp
  push   %rbx
  mov    %r8,%rbx
  sub    $0x48,%rsp
  mov    %rsi,0x28(%rsp)
  mov    0x80(%rsp),%edi
  mov    0x88(%rsp),%rsi
  mov    %rcx,0x30(%rsp)
  call   <setup_filters@plt>
  mov    0x80(%rsp),%eax
  mov    $0xa,%edi
  sub    $0x2,%eax
  cmp    $0x1,%eax
  mov    $0x1,%eax
  cmova  0x80(%rsp),%eax
  cmp    $0x4,%rbx
  mov    $0xff,%ebx
  mov    %eax,0x80(%rsp)
  mov    $0x10,%eax
  cmove  %eax,%ebx
  call   <putchar@plt>
  lea    -0x1(%r12),%rax
  lea    -0x1(%r14),%rdi
  mov    %rax,0x38(%rsp)
  mov    %rdi,0x18(%rsp)
  cmp    $0x1,%rax
  jle    L75
  lea    -0x2(%r12),%rax
  add    $0x8,%rbp
  movq   $0x1,0x8(%rsp)
  mov    %rax,0x20(%rsp)
  nopl   0x0(%rax)
L76:
  mov    0x8(%rsp),%rax
  cmpq   $0x1,0x18(%rsp)
  mov    %eax,0x14(%rsp)
  jle    L28
  mov    0x28(%rsp),%rdi
  mov    $0x2,%r8d
  mov    $0x1,%r10d
  lea    0x12(%r13),%r9
  mov    (%rdi,%rax,8),%r12
  mov    0x30(%rsp),%eax
  lea    -0x1(%rax),%r11d
  xchg   %ax,%ax
L55:
  mov    %r13,%rsi
  mov    %rbp,%r15
  xor    %eax,%eax
L39:
  mov    -0x8(%r15),%rdi
  xor    %edx,%edx
  add    %r8,%rdi
L3:
  movswl -0x2(%rdi,%rdx,1),%ecx
  movswl (%rsi,%rdx,1),%r14d
  add    $0x2,%rdx
  imul   %r14d,%ecx
  add    %ecx,%eax
  cmp    $0x6,%rdx
  jne    L3
  add    $0x6,%rsi
  add    $0x8,%r15
  cmp    %rsi,%r9
  jne    L39
  cltd
  idivl  0x80(%rsp)
  xor    %edx,%edx
  test   %eax,%eax
  cmovs  %edx,%eax
  cmp    %ebx,%eax
  cmovg  %ebx,%eax
  add    $0x1,%r10d
  mov    %ax,(%r12,%r8,1)
  add    $0x2,%r8
  cmp    %r11d,%r10d
  jne    L55
L28:
  mov    0x14(%rsp),%esi
  mov    0x8(%rsp),%rdi
  add    $0x1,%esi
  cmp    %rdi,0x20(%rsp)
  je     L75
  imul   $0xcccccccd,%esi,%eax
  ror    %eax
  cmp    $0x19999999,%eax
  ja     L63
  lea    D1(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
L63:
  addq   $0x1,0x8(%rsp)
  add    $0x8,%rbp
  jmp    L76
L75:
  mov    0x18(%rsp),%rcx
  mov    0x38(%rsp),%rdx
  mov    $0x1,%esi
  xor    %eax,%eax
  mov    0x28(%rsp),%rdi
  call   <fix_edges@plt>
  add    $0x48,%rsp
  mov    $0x1,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
```

tool_calls: name: unpack_data
arguments: label: D1
type: string

tool: D1: %d 

assistant: ```c
int filter_image(the_image, out_image, rows, cols, bits_per_pixel, filter, type, low_high)
int type;
short filter[3][3], **the_image, **out_image;
char low_high[];
long rows, cols, bits_per_pixel;
{
  int a, b, d, i, j, k, length, max, sum, width;
  setup_filters(type, low_high, filter);
  d = type;
  if (type == 2 || type == 3)
    d = 1;
  max = 255;
  if (bits_per_pixel == 4)
    max = 16;
  printf("\n");
  for (i = 1; i < rows - 1; i++) {
    if ((i % 10) == 0)
      printf("%d ", i);
    for (j = 1; j < cols - 1; j++) {
      sum = 0;
      for (a = -1; a < 2; a++) {
        for (b = -1; b < 2; b++) {
          sum = sum + the_image[i + a][j + b] * filter[a + 1][b + 1];
        }
      }
      sum = sum / d;
      if (sum < 0)
        sum = 0;
      if (sum > max)
        sum = max;
      out_image[i][j] = sum;
    }
  }
  fix_edges(out_image, 1, rows - 1, cols - 1);
  return (1);
}
```