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

```asm
<tiff_encode_16>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  mov    %ecx,-0x28(%rsp)
  mov    %r8d,-0x14(%rsp)
  test   %r8d,%r8d
  jle    L223
  mov    %edx,%ebp
  lea    -0x1(%rdx),%r15d
  shr    $0x2,%edx
  mov    %rsi,%rax
  mov    %ebp,%ebx
  lea    -0x1(%rdx),%r10d
  mov    %r15d,-0x24(%rsp)
  lea    0x4(,%r15,4),%r12
  and    $0xfffffffc,%ebx
  movl   $0x0,-0x18(%rsp)
  add    $0x1,%r10
  lea    0x1(%rbx),%edx
  mov    %ebx,-0x20(%rsp)
  mov    %ebx,%r14d
  shl    $0x4,%r10
  mov    %edx,-0x10(%rsp)
  lea    0x2(%rbx),%edx
  shl    $0x2,%r14
  mov    %edx,-0xc(%rsp)
  mov    %ebp,%edx
  sub    %ebx,%edx
  mov    %edx,-0x1c(%rsp)
  nopl   0x0(%rax,%rax,1)
L153:
  mov    %rdi,%rcx
  test   %ebp,%ebp
  jle    L62
  lea    0x4(%rdi),%rcx
  mov    %rax,%rdx
  sub    %rcx,%rdx
  cmp    $0x8,%rdx
  mov    $0x0,%edx
  jbe    L107
  cmpl   $0x2,-0x24(%rsp)
  jbe    L107
  nopl   0x0(%rax,%rax,1)
L111:
  movdqu (%rdi,%rdx,1),%xmm3
  movups %xmm3,(%rax,%rdx,1)
  add    $0x10,%rdx
  cmp    %r10,%rdx
  jne    L111
  lea    (%rdi,%r14,1),%rcx
  lea    (%rax,%r14,1),%rdx
  cmp    -0x20(%rsp),%ebp
  je     L210
  mov    (%rcx),%esi
  mov    %esi,(%rdx)
  cmp    -0x10(%rsp),%ebp
  jle    L210
  mov    0x4(%rcx),%esi
  mov    %esi,0x4(%rdx)
  cmp    %ebp,-0xc(%rsp)
  jge    L210
  mov    0x8(%rcx),%ecx
  mov    %ecx,0x8(%rdx)
L210:
  lea    (%rdi,%r12,1),%rcx
  add    %r12,%rax
L62:
  cmpl   $0x1,-0x28(%rsp)
  mov    %rdi,%rdx
  mov    $0x1,%r11d
  mov    %rcx,%rdi
  jle    L219
  nopw   0x0(%rax,%rax,1)
L42:
  test   %ebp,%ebp
  jle    L139
  lea    0x4(%rdi),%rsi
  mov    %rax,%rcx
  lea    0x4(%rdx),%r8
  sub    %rsi,%rcx
  mov    %rax,%rsi
  cmp    $0x8,%rcx
  seta   %cl
  sub    %r8,%rsi
  cmp    $0x8,%rsi
  seta   %sil
  test   %sil,%cl
  je     L37
  cmp    $0x1,%ebp
  je     L37
  cmpl   $0x2,-0x24(%rsp)
  jbe    L230
  xor    %ecx,%ecx
  nopw   0x0(%rax,%rax,1)
L40:
  movdqu (%rdi,%rcx,1),%xmm0
  movdqu (%rdx,%rcx,1),%xmm2
  psubd  %xmm2,%xmm0
  movups %xmm0,(%rax,%rcx,1)
  add    $0x10,%rcx
  cmp    %r10,%rcx
  jne    L40
  mov    -0x20(%rsp),%r9d
  lea    (%rdi,%r14,1),%r8
  lea    (%rax,%r14,1),%rcx
  lea    (%rdx,%r14,1),%rsi
  cmp    %r9d,%ebp
  je     L8
  mov    -0x1c(%rsp),%ebx
  mov    %ebx,%r13d
  cmp    $0x1,%ebx
  je     L162
L156:
  movq   (%rdi,%r9,4),%xmm0
  movq   (%rdx,%r9,4),%xmm1
  mov    %r13d,%ebx
  and    $0xfffffffe,%ebx
  psubd  %xmm1,%xmm0
  movq   %xmm0,(%rax,%r9,4)
  mov    %ebx,%r9d
  shl    $0x2,%r9
  add    %r9,%r8
  add    %r9,%rcx
  add    %r9,%rsi
  cmp    %ebx,%r13d
  je     L8
L162:
  mov    (%r8),%r8d
  sub    (%rsi),%r8d
  mov    %r8d,(%rcx)
L8:
  add    %r12,%rdi
  add    %r12,%rax
  add    %r12,%rdx
L139:
  add    $0x1,%r11d
  cmp    %r11d,-0x28(%rsp)
  jne    L42
L219:
  addl   $0x1,-0x18(%rsp)
  mov    -0x18(%rsp),%ebx
  cmp    %ebx,-0x14(%rsp)
  jne    L153
L223:
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopl   (%rax)
L107:
  mov    (%rdi,%rdx,4),%ecx
  mov    %ecx,(%rax,%rdx,4)
  mov    %rdx,%rcx
  add    $0x1,%rdx
  cmp    %rcx,%r15
  jne    L107
  jmp    L210
  nop
L37:
  xor    %ecx,%ecx
  nopw   0x0(%rax,%rax,1)
L48:
  mov    (%rdi,%rcx,4),%esi
  sub    (%rdx,%rcx,4),%esi
  mov    %esi,(%rax,%rcx,4)
  mov    %rcx,%rsi
  add    $0x1,%rcx
  cmp    %rsi,%r15
  jne    L48
  jmp    L8
L230:
  mov    %ebp,%r13d
  mov    %rdx,%rsi
  mov    %rax,%rcx
  mov    %rdi,%r8
  xor    %r9d,%r9d
  jmp    L156
```

assistant: ```c
void tiff_encode_16(uint8_t *in, uint8_t *out, uint8_t colors, uint16_t columns, uint16_t rows) {
  int i;
  int j;
  int r;
  uint16_t *in_p = (uint16_t *)in;
  uint16_t *out_p = (uint16_t *)out;
  for (r = 0; r < rows; r++) {
    uint16_t *prev = in_p;
    for (j = 0; j < colors; j++) {
      *out_p++ = *in_p++;
    }
    for (i = 1; i < columns; i++) {
      for (j = 0; j < colors; j++) {
        *out_p++ = *in_p++ - *prev++;
      }
    }
  }
}
```