user: Please show me the C implementation that matches the assembly code listed below:

```asm
<dilate_not_join>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x50,%rsp
  mov    %rdi,-0x28(%rbp)
  mov    %rsi,-0x30(%rbp)
  mov    %ecx,%eax
  mov    %r8,-0x40(%rbp)
  mov    %r9,-0x48(%rbp)
  mov    %dx,-0x34(%rbp)
  mov    %ax,-0x38(%rbp)
  movl   $0x0,-0x8(%rbp)
  jmp    L305
L74:
  movl   $0x0,-0x4(%rbp)
  jmp    L400
L24:
  mov    -0x8(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rdx
  mov    -0x4(%rbp),%eax
  cltq
  add    %rax,%rax
  add    %rdx,%rax
  mov    -0x8(%rbp),%edx
  movslq %edx,%rdx
  lea    0x0(,%rdx,8),%rcx
  mov    -0x30(%rbp),%rdx
  add    %rcx,%rdx
  mov    (%rdx),%rcx
  mov    -0x4(%rbp),%edx
  movslq %edx,%rdx
  add    %rdx,%rdx
  add    %rcx,%rdx
  movzwl (%rax),%eax
  mov    %ax,(%rdx)
  addl   $0x1,-0x4(%rbp)
L400:
  mov    -0x4(%rbp),%eax
  cltq
  cmp    %rax,-0x48(%rbp)
  jg     L24
  addl   $0x1,-0x8(%rbp)
L305:
  mov    -0x8(%rbp),%eax
  cltq
  cmp    %rax,-0x40(%rbp)
  jg     L74
  mov    $0xa,%edi
  call   <putchar@plt>
  movl   $0x1,-0x8(%rbp)
  jmp    L561
L715:
  mov    -0x8(%rbp),%ecx
  movslq %ecx,%rax
  imul   $0x66666667,%rax,%rax
  shr    $0x20,%rax
  sar    $0x2,%eax
  mov    %ecx,%esi
  sar    $0x1f,%esi
  sub    %esi,%eax
  mov    %eax,%edx
  mov    %edx,%eax
  shl    $0x2,%eax
  add    %edx,%eax
  add    %eax,%eax
  sub    %eax,%ecx
  mov    %ecx,%edx
  test   %edx,%edx
  jne    L558
  mov    -0x8(%rbp),%eax
  mov    %eax,%esi
  lea    D8(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
L558:
  movl   $0x1,-0x4(%rbp)
  jmp    L611
L429:
  mov    -0x8(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rdx
  mov    -0x4(%rbp),%eax
  cltq
  add    %rax,%rax
  sub    $0x2,%rax
  add    %rdx,%rax
  movzwl (%rax),%eax
  cmp    %ax,-0x34(%rbp)
  jne    L533
  mov    -0x8(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rdx
  mov    -0x4(%rbp),%eax
  cltq
  add    %rax,%rax
  add    %rdx,%rax
  movzwl (%rax),%eax
  test   %ax,%ax
  jne    L533
  movl   $0x0,-0xc(%rbp)
  movl   $0xffffffff,-0x14(%rbp)
  jmp    L79
L701:
  movl   $0xffffffff,-0x10(%rbp)
  jmp    L134
L542:
  mov    -0x8(%rbp),%edx
  mov    -0x14(%rbp),%eax
  add    %edx,%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rdx
  mov    -0x4(%rbp),%ecx
  mov    -0x10(%rbp),%eax
  add    %ecx,%eax
  cltq
  add    %rax,%rax
  add    %rdx,%rax
  movzwl (%rax),%eax
  cmp    %ax,-0x34(%rbp)
  jne    L371
  addl   $0x1,-0xc(%rbp)
L371:
  addl   $0x1,-0x10(%rbp)
L134:
  cmpl   $0x1,-0x10(%rbp)
  jle    L542
  addl   $0x1,-0x14(%rbp)
L79:
  cmpl   $0x1,-0x14(%rbp)
  jle    L701
  movswl -0x38(%rbp),%eax
  cmp    %eax,-0xc(%rbp)
  jle    L533
  movswl -0x34(%rbp),%ecx
  mov    -0x4(%rbp),%edx
  mov    -0x8(%rbp),%esi
  mov    -0x28(%rbp),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <can_dilate@plt>
  test   %eax,%eax
  je     L533
  mov    -0x8(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x30(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rdx
  mov    -0x4(%rbp),%eax
  cltq
  add    %rax,%rax
  add    %rax,%rdx
  movzwl -0x34(%rbp),%eax
  mov    %ax,(%rdx)
L533:
  addl   $0x1,-0x4(%rbp)
L611:
  mov    -0x4(%rbp),%eax
  cltq
  mov    -0x48(%rbp),%rdx
  sub    $0x1,%rdx
  cmp    %rdx,%rax
  jl     L429
  addl   $0x1,-0x8(%rbp)
L561:
  mov    -0x8(%rbp),%eax
  cltq
  mov    -0x40(%rbp),%rdx
  sub    $0x1,%rdx
  cmp    %rdx,%rax
  jl     L715
  movl   $0x0,-0x8(%rbp)
  jmp    L699
L472:
  movl   $0x0,-0x4(%rbp)
  jmp    L417
L584:
  mov    -0x8(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x30(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rdx
  mov    -0x4(%rbp),%eax
  cltq
  add    %rax,%rax
  add    %rdx,%rax
  mov    -0x8(%rbp),%edx
  movslq %edx,%rdx
  lea    0x0(,%rdx,8),%rcx
  mov    -0x28(%rbp),%rdx
  add    %rcx,%rdx
  mov    (%rdx),%rcx
  mov    -0x4(%rbp),%edx
  movslq %edx,%rdx
  add    %rdx,%rdx
  add    %rcx,%rdx
  movzwl (%rax),%eax
  mov    %ax,(%rdx)
  addl   $0x1,-0x4(%rbp)
L417:
  mov    -0x4(%rbp),%eax
  cltq
  cmp    %rax,-0x48(%rbp)
  jg     L584
  addl   $0x1,-0x8(%rbp)
L699:
  mov    -0x8(%rbp),%eax
  cltq
  cmp    %rax,-0x40(%rbp)
  jg     L472
  mov    $0xa,%edi
  call   <putchar@plt>
  movl   $0x1,-0x8(%rbp)
  jmp    L467
L322:
  mov    -0x8(%rbp),%ecx
  movslq %ecx,%rax
  imul   $0x66666667,%rax,%rax
  shr    $0x20,%rax
  sar    $0x2,%eax
  mov    %ecx,%esi
  sar    $0x1f,%esi
  sub    %esi,%eax
  mov    %eax,%edx
  mov    %edx,%eax
  shl    $0x2,%eax
  add    %edx,%eax
  add    %eax,%eax
  sub    %eax,%ecx
  mov    %ecx,%edx
  test   %edx,%edx
  jne    L740
  mov    -0x8(%rbp),%eax
  mov    %eax,%esi
  lea    D8(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
L740:
  movl   $0x1,-0x4(%rbp)
  jmp    L505
L625:
  mov    -0x8(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rdx
  mov    -0x4(%rbp),%eax
  cltq
  add    $0x1,%rax
  add    %rax,%rax
  add    %rdx,%rax
  movzwl (%rax),%eax
  cmp    %ax,-0x34(%rbp)
  jne    L197
  mov    -0x8(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rdx
  mov    -0x4(%rbp),%eax
  cltq
  add    %rax,%rax
  add    %rdx,%rax
  movzwl (%rax),%eax
  test   %ax,%ax
  jne    L197
  movl   $0x0,-0xc(%rbp)
  movl   $0xffffffff,-0x14(%rbp)
  jmp    L554
L509:
  movl   $0xffffffff,-0x10(%rbp)
  jmp    L476
L583:
  mov    -0x8(%rbp),%edx
  mov    -0x14(%rbp),%eax
  add    %edx,%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rdx
  mov    -0x4(%rbp),%ecx
  mov    -0x10(%rbp),%eax
  add    %ecx,%eax
  cltq
  add    %rax,%rax
  add    %rdx,%rax
  movzwl (%rax),%eax
  cmp    %ax,-0x34(%rbp)
  jne    L15
  addl   $0x1,-0xc(%rbp)
L15:
  addl   $0x1,-0x10(%rbp)
L476:
  cmpl   $0x1,-0x10(%rbp)
  jle    L583
  addl   $0x1,-0x14(%rbp)
L554:
  cmpl   $0x1,-0x14(%rbp)
  jle    L509
  movswl -0x38(%rbp),%eax
  cmp    %eax,-0xc(%rbp)
  jle    L197
  movswl -0x34(%rbp),%ecx
  mov    -0x4(%rbp),%edx
  mov    -0x8(%rbp),%esi
  mov    -0x28(%rbp),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <can_dilate@plt>
  test   %eax,%eax
  je     L197
  mov    -0x8(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x30(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rdx
  mov    -0x4(%rbp),%eax
  cltq
  add    %rax,%rax
  add    %rax,%rdx
  movzwl -0x34(%rbp),%eax
  mov    %ax,(%rdx)
L197:
  addl   $0x1,-0x4(%rbp)
L505:
  mov    -0x4(%rbp),%eax
  cltq
  mov    -0x48(%rbp),%rdx
  sub    $0x1,%rdx
  cmp    %rdx,%rax
  jl     L625
  addl   $0x1,-0x8(%rbp)
L467:
  mov    -0x8(%rbp),%eax
  cltq
  mov    -0x40(%rbp),%rdx
  sub    $0x1,%rdx
  cmp    %rdx,%rax
  jl     L322
  movl   $0x0,-0x8(%rbp)
  jmp    L448
L227:
  movl   $0x0,-0x4(%rbp)
  jmp    L722
L364:
  mov    -0x8(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x30(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rdx
  mov    -0x4(%rbp),%eax
  cltq
  add    %rax,%rax
  add    %rdx,%rax
  mov    -0x8(%rbp),%edx
  movslq %edx,%rdx
  lea    0x0(,%rdx,8),%rcx
  mov    -0x28(%rbp),%rdx
  add    %rcx,%rdx
  mov    (%rdx),%rcx
  mov    -0x4(%rbp),%edx
  movslq %edx,%rdx
  add    %rdx,%rdx
  add    %rcx,%rdx
  movzwl (%rax),%eax
  mov    %ax,(%rdx)
  addl   $0x1,-0x4(%rbp)
L722:
  mov    -0x4(%rbp),%eax
  cltq
  cmp    %rax,-0x48(%rbp)
  jg     L364
  addl   $0x1,-0x8(%rbp)
L448:
  mov    -0x8(%rbp),%eax
  cltq
  cmp    %rax,-0x40(%rbp)
  jg     L227
  mov    $0xa,%edi
  call   <putchar@plt>
  movl   $0x1,-0x4(%rbp)
  jmp    L226
L365:
  mov    -0x4(%rbp),%ecx
  movslq %ecx,%rax
  imul   $0x66666667,%rax,%rax
  shr    $0x20,%rax
  sar    $0x2,%eax
  mov    %ecx,%esi
  sar    $0x1f,%esi
  sub    %esi,%eax
  mov    %eax,%edx
  mov    %edx,%eax
  shl    $0x2,%eax
  add    %edx,%eax
  add    %eax,%eax
  sub    %eax,%ecx
  mov    %ecx,%edx
  test   %edx,%edx
  jne    L150
  mov    -0x4(%rbp),%eax
  mov    %eax,%esi
  lea    D8(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
L150:
  movl   $0x1,-0x8(%rbp)
  jmp    L281
L359:
  mov    -0x8(%rbp),%eax
  cltq
  shl    $0x3,%rax
  lea    -0x8(%rax),%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rdx
  mov    -0x4(%rbp),%eax
  cltq
  add    %rax,%rax
  add    %rdx,%rax
  movzwl (%rax),%eax
  cmp    %ax,-0x34(%rbp)
  jne    L182
  mov    -0x8(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rdx
  mov    -0x4(%rbp),%eax
  cltq
  add    %rax,%rax
  add    %rdx,%rax
  movzwl (%rax),%eax
  test   %ax,%ax
  jne    L182
  movl   $0x0,-0xc(%rbp)
  movl   $0xffffffff,-0x14(%rbp)
  jmp    L637
L312:
  movl   $0xffffffff,-0x10(%rbp)
  jmp    L598
L635:
  mov    -0x8(%rbp),%edx
  mov    -0x14(%rbp),%eax
  add    %edx,%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rdx
  mov    -0x4(%rbp),%ecx
  mov    -0x10(%rbp),%eax
  add    %ecx,%eax
  cltq
  add    %rax,%rax
  add    %rdx,%rax
  movzwl (%rax),%eax
  cmp    %ax,-0x34(%rbp)
  jne    L652
  addl   $0x1,-0xc(%rbp)
L652:
  addl   $0x1,-0x10(%rbp)
L598:
  cmpl   $0x1,-0x10(%rbp)
  jle    L635
  addl   $0x1,-0x14(%rbp)
L637:
  cmpl   $0x1,-0x14(%rbp)
  jle    L312
  movswl -0x38(%rbp),%eax
  cmp    %eax,-0xc(%rbp)
  jle    L182
  movswl -0x34(%rbp),%ecx
  mov    -0x4(%rbp),%edx
  mov    -0x8(%rbp),%esi
  mov    -0x28(%rbp),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <can_dilate@plt>
  test   %eax,%eax
  je     L182
  mov    -0x8(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x30(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rdx
  mov    -0x4(%rbp),%eax
  cltq
  add    %rax,%rax
  add    %rax,%rdx
  movzwl -0x34(%rbp),%eax
  mov    %ax,(%rdx)
L182:
  addl   $0x1,-0x8(%rbp)
L281:
  mov    -0x8(%rbp),%eax
  cltq
  mov    -0x40(%rbp),%rdx
  sub    $0x1,%rdx
  cmp    %rdx,%rax
  jl     L359
  addl   $0x1,-0x4(%rbp)
L226:
  mov    -0x4(%rbp),%eax
  cltq
  mov    -0x48(%rbp),%rdx
  sub    $0x1,%rdx
  cmp    %rdx,%rax
  jl     L365
  movl   $0x0,-0x8(%rbp)
  jmp    L200
L681:
  movl   $0x0,-0x4(%rbp)
  jmp    L679
L480:
  mov    -0x8(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x30(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rdx
  mov    -0x4(%rbp),%eax
  cltq
  add    %rax,%rax
  add    %rdx,%rax
  mov    -0x8(%rbp),%edx
  movslq %edx,%rdx
  lea    0x0(,%rdx,8),%rcx
  mov    -0x28(%rbp),%rdx
  add    %rcx,%rdx
  mov    (%rdx),%rcx
  mov    -0x4(%rbp),%edx
  movslq %edx,%rdx
  add    %rdx,%rdx
  add    %rcx,%rdx
  movzwl (%rax),%eax
  mov    %ax,(%rdx)
  addl   $0x1,-0x4(%rbp)
L679:
  mov    -0x4(%rbp),%eax
  cltq
  cmp    %rax,-0x48(%rbp)
  jg     L480
  addl   $0x1,-0x8(%rbp)
L200:
  mov    -0x8(%rbp),%eax
  cltq
  cmp    %rax,-0x40(%rbp)
  jg     L681
  mov    $0xa,%edi
  call   <putchar@plt>
  movl   $0x1,-0x4(%rbp)
  jmp    L260
L599:
  mov    -0x4(%rbp),%ecx
  movslq %ecx,%rax
  imul   $0x66666667,%rax,%rax
  shr    $0x20,%rax
  sar    $0x2,%eax
  mov    %ecx,%esi
  sar    $0x1f,%esi
  sub    %esi,%eax
  mov    %eax,%edx
  mov    %edx,%eax
  shl    $0x2,%eax
  add    %edx,%eax
  add    %eax,%eax
  sub    %eax,%ecx
  mov    %ecx,%edx
  test   %edx,%edx
  jne    L586
  mov    -0x4(%rbp),%eax
  mov    %eax,%esi
  lea    D8(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
L586:
  movl   $0x1,-0x8(%rbp)
  jmp    L217
L31:
  mov    -0x8(%rbp),%eax
  cltq
  add    $0x1,%rax
  lea    0x0(,%rax,8),%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rdx
  mov    -0x4(%rbp),%eax
  cltq
  add    %rax,%rax
  add    %rdx,%rax
  movzwl (%rax),%eax
  cmp    %ax,-0x34(%rbp)
  jne    L676
  mov    -0x8(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rdx
  mov    -0x4(%rbp),%eax
  cltq
  add    %rax,%rax
  add    %rdx,%rax
  movzwl (%rax),%eax
  test   %ax,%ax
  jne    L676
  movl   $0x0,-0xc(%rbp)
  movl   $0xffffffff,-0x14(%rbp)
  jmp    L270
L569:
  movl   $0xffffffff,-0x10(%rbp)
  jmp    L350
L347:
  mov    -0x8(%rbp),%edx
  mov    -0x14(%rbp),%eax
  add    %edx,%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rdx
  mov    -0x4(%rbp),%ecx
  mov    -0x10(%rbp),%eax
  add    %ecx,%eax
  cltq
  add    %rax,%rax
  add    %rdx,%rax
  movzwl (%rax),%eax
  cmp    %ax,-0x34(%rbp)
  jne    L677
  addl   $0x1,-0xc(%rbp)
L677:
  addl   $0x1,-0x10(%rbp)
L350:
  cmpl   $0x1,-0x10(%rbp)
  jle    L347
  addl   $0x1,-0x14(%rbp)
L270:
  cmpl   $0x1,-0x14(%rbp)
  jle    L569
  movswl -0x38(%rbp),%eax
  cmp    %eax,-0xc(%rbp)
  jle    L676
  movswl -0x34(%rbp),%ecx
  mov    -0x4(%rbp),%edx
  mov    -0x8(%rbp),%esi
  mov    -0x28(%rbp),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <can_dilate@plt>
  test   %eax,%eax
  je     L676
  mov    -0x8(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x30(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rdx
  mov    -0x4(%rbp),%eax
  cltq
  add    %rax,%rax
  add    %rax,%rdx
  movzwl -0x34(%rbp),%eax
  mov    %ax,(%rdx)
L676:
  addl   $0x1,-0x8(%rbp)
L217:
  mov    -0x8(%rbp),%eax
  cltq
  mov    -0x40(%rbp),%rdx
  sub    $0x1,%rdx
  cmp    %rdx,%rax
  jl     L31
  addl   $0x1,-0x4(%rbp)
L260:
  mov    -0x4(%rbp),%eax
  cltq
  mov    -0x48(%rbp),%rdx
  sub    $0x1,%rdx
  cmp    %rdx,%rax
  jl     L599
  movl   $0x0,-0x8(%rbp)
  jmp    L690
L255:
  movl   $0x0,-0x4(%rbp)
  jmp    L137
L621:
  mov    -0x8(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x30(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rdx
  mov    -0x4(%rbp),%eax
  cltq
  add    %rax,%rax
  add    %rdx,%rax
  mov    -0x8(%rbp),%edx
  movslq %edx,%rdx
  lea    0x0(,%rdx,8),%rcx
  mov    -0x28(%rbp),%rdx
  add    %rcx,%rdx
  mov    (%rdx),%rcx
  mov    -0x4(%rbp),%edx
  movslq %edx,%rdx
  add    %rdx,%rdx
  add    %rcx,%rdx
  movzwl (%rax),%eax
  mov    %ax,(%rdx)
  addl   $0x1,-0x4(%rbp)
L137:
  mov    -0x4(%rbp),%eax
  cltq
  cmp    %rax,-0x48(%rbp)
  jg     L621
  addl   $0x1,-0x8(%rbp)
L690:
  mov    -0x8(%rbp),%eax
  cltq
  cmp    %rax,-0x40(%rbp)
  jg     L255
  mov    $0x1,%eax
  leave
  ret
```

tool_calls: name: disassemble_data
arguments: label: D8
type_guessed: string

tool: D8: %3d

assistant: ```c
int dilate_not_join(the_image, out_image, value, threshold, rows, cols)
short **the_image, **out_image, threshold, value;
long cols, rows;
{
  int a, b, count, i, j, k;
  for (i = 0; i < rows; i++)
    for (j = 0; j < cols; j++)
      out_image[i][j] = the_image[i][j];
  printf("\n");
  for (i = 1; i < rows - 1; i++) {
    if ((i % 10) == 0)
      printf("%3d", i);
    for (j = 1; j < cols - 1; j++) {
      if (the_image[i][j - 1] == value && the_image[i][j] == 0) {
        count = 0;
        for (a = -1; a <= 1; a++) {
          for (b = -1; b <= 1; b++) {
            if (the_image[i + a][j + b] == value)
              count++;
          }
        }
        if (count > threshold) {
          if (can_dilate(the_image, i, j, value)) {
            out_image[i][j] = value;
          }
        }
      }
    }
  }
  for (i = 0; i < rows; i++)
    for (j = 0; j < cols; j++)
      the_image[i][j] = out_image[i][j];
  printf("\n");
  for (i = 1; i < rows - 1; i++) {
    if ((i % 10) == 0)
      printf("%3d", i);
    for (j = 1; j < cols - 1; j++) {
      if (the_image[i][j + 1] == value && the_image[i][j] == 0) {
        count = 0;
        for (a = -1; a <= 1; a++) {
          for (b = -1; b <= 1; b++) {
            if (the_image[i + a][j + b] == value)
              count++;
          }
        }
        if (count > threshold) {
          if (can_dilate(the_image, i, j, value)) {
            out_image[i][j] = value;
          }
        }
      }
    }
  }
  for (i = 0; i < rows; i++)
    for (j = 0; j < cols; j++)
      the_image[i][j] = out_image[i][j];
  printf("\n");
  for (j = 1; j < cols - 1; j++) {
    if ((j % 10) == 0)
      printf("%3d", j);
    for (i = 1; i < rows - 1; i++) {
      if (the_image[i - 1][j] == value && the_image[i][j] == 0) {
        count = 0;
        for (a = -1; a <= 1; a++) {
          for (b = -1; b <= 1; b++) {
            if (the_image[i + a][j + b] == value)
              count++;
          }
        }
        if (count > threshold) {
          if (can_dilate(the_image, i, j, value)) {
            out_image[i][j] = value;
          }
        }
      }
    }
  }
  for (i = 0; i < rows; i++)
    for (j = 0; j < cols; j++)
      the_image[i][j] = out_image[i][j];
  printf("\n");
  for (j = 1; j < cols - 1; j++) {
    if ((j % 10) == 0)
      printf("%3d", j);
    for (i = 1; i < rows - 1; i++) {
      if (the_image[i + 1][j] == value && the_image[i][j] == 0) {
        count = 0;
        for (a = -1; a <= 1; a++) {
          for (b = -1; b <= 1; b++) {
            if (the_image[i + a][j + b] == value)
              count++;
          }
        }
        if (count > threshold) {
          if (can_dilate(the_image, i, j, value)) {
            out_image[i][j] = value;
          }
        }
      }
    }
  }
  for (i = 0; i < rows; i++)
    for (j = 0; j < cols; j++)
      the_image[i][j] = out_image[i][j];
  return (1);
}
```