user: What is the c source code of the assembly code below?

```asm
<dist1>:
  endbr64
  mov    %ecx,%eax
  push   %rbx
  mov    0x10(%rsp),%r10d
  or     %r8d,%eax
  jne    L99
  test   %r9d,%r9d
  jle    L148
  xor    %r8d,%r8d
  movslq %edx,%rcx
  jmp    L86
  cs nopw 0x0(%rax,%rax,1)
L83:
  add    $0x1,%r8d
  add    %rcx,%rdi
  add    %rcx,%rsi
  cmp    %r8d,%r9d
  je     L148
L86:
  movzbl (%rsi),%r11d
  movzbl (%rdi),%edx
  mov    %r11d,%ebx
  sub    %edx,%ebx
  sub    %r11d,%edx
  movzbl 0x1(%rsi),%r11d
  cmovs  %ebx,%edx
  mov    %r11d,%ebx
  add    %eax,%edx
  movzbl 0x1(%rdi),%eax
  sub    %eax,%ebx
  sub    %r11d,%eax
  movzbl 0x2(%rsi),%r11d
  cmovs  %ebx,%eax
  mov    %r11d,%ebx
  add    %eax,%edx
  movzbl 0x2(%rdi),%eax
  sub    %eax,%ebx
  sub    %r11d,%eax
  movzbl 0x3(%rsi),%r11d
  cmovs  %ebx,%eax
  mov    %r11d,%ebx
  add    %eax,%edx
  movzbl 0x3(%rdi),%eax
  sub    %eax,%ebx
  sub    %r11d,%eax
  movzbl 0x4(%rsi),%r11d
  cmovs  %ebx,%eax
  mov    %r11d,%ebx
  add    %eax,%edx
  movzbl 0x4(%rdi),%eax
  sub    %eax,%ebx
  sub    %r11d,%eax
  movzbl 0x5(%rsi),%r11d
  cmovs  %ebx,%eax
  mov    %r11d,%ebx
  add    %eax,%edx
  movzbl 0x5(%rdi),%eax
  sub    %eax,%ebx
  sub    %r11d,%eax
  movzbl 0x6(%rsi),%r11d
  cmovs  %ebx,%eax
  mov    %r11d,%ebx
  add    %eax,%edx
  movzbl 0x6(%rdi),%eax
  sub    %eax,%ebx
  sub    %r11d,%eax
  movzbl 0x7(%rsi),%r11d
  cmovs  %ebx,%eax
  mov    %r11d,%ebx
  add    %eax,%edx
  movzbl 0x7(%rdi),%eax
  sub    %eax,%ebx
  sub    %r11d,%eax
  movzbl 0x8(%rsi),%r11d
  cmovs  %ebx,%eax
  mov    %r11d,%ebx
  add    %eax,%edx
  movzbl 0x8(%rdi),%eax
  sub    %eax,%ebx
  sub    %r11d,%eax
  movzbl 0x9(%rsi),%r11d
  cmovs  %ebx,%eax
  mov    %r11d,%ebx
  add    %eax,%edx
  movzbl 0x9(%rdi),%eax
  sub    %eax,%ebx
  sub    %r11d,%eax
  movzbl 0xa(%rsi),%r11d
  cmovs  %ebx,%eax
  mov    %r11d,%ebx
  add    %eax,%edx
  movzbl 0xa(%rdi),%eax
  sub    %eax,%ebx
  sub    %r11d,%eax
  movzbl 0xb(%rsi),%r11d
  cmovs  %ebx,%eax
  mov    %r11d,%ebx
  add    %eax,%edx
  movzbl 0xb(%rdi),%eax
  sub    %eax,%ebx
  sub    %r11d,%eax
  movzbl 0xc(%rsi),%r11d
  cmovs  %ebx,%eax
  mov    %r11d,%ebx
  add    %eax,%edx
  movzbl 0xc(%rdi),%eax
  sub    %eax,%ebx
  sub    %r11d,%eax
  movzbl 0xd(%rsi),%r11d
  cmovs  %ebx,%eax
  mov    %r11d,%ebx
  add    %eax,%edx
  movzbl 0xd(%rdi),%eax
  sub    %eax,%ebx
  sub    %r11d,%eax
  movzbl 0xe(%rsi),%r11d
  cmovs  %ebx,%eax
  mov    %r11d,%ebx
  add    %eax,%edx
  movzbl 0xe(%rdi),%eax
  sub    %eax,%ebx
  sub    %r11d,%eax
  movzbl 0xf(%rsi),%r11d
  cmovs  %ebx,%eax
  mov    %r11d,%ebx
  add    %eax,%edx
  movzbl 0xf(%rdi),%eax
  sub    %eax,%ebx
  sub    %r11d,%eax
  cmovs  %ebx,%eax
  add    %edx,%eax
  cmp    %r10d,%eax
  jl     L83
L148:
  pop    %rbx
  ret
  nopl   0x0(%rax)
L99:
  test   %ecx,%ecx
  je     L160
  test   %r8d,%r8d
  jne    L160
  test   %r9d,%r9d
  jle    L5
  movslq %edx,%r10
  xor    %eax,%eax
  xor    %r11d,%r11d
  nopw   0x0(%rax,%rax,1)
L39:
  xor    %ecx,%ecx
  nopw   0x0(%rax,%rax,1)
L28:
  movzbl (%rdi,%rcx,1),%r8d
  movzbl 0x1(%rdi,%rcx,1),%edx
  lea    0x1(%r8,%rdx,1),%edx
  movzbl (%rsi,%rcx,1),%r8d
  shr    %edx
  sub    %r8d,%edx
  lea    (%rax,%rdx,1),%r8d
  sub    %edx,%eax
  test   %edx,%edx
  cmovns %r8d,%eax
  add    $0x1,%rcx
  cmp    $0x10,%rcx
  jne    L28
  add    $0x1,%r11d
  add    %r10,%rdi
  add    %r10,%rsi
  cmp    %r11d,%r9d
  jne    L39
  pop    %rbx
  ret
L160:
  movslq %edx,%r11
  xor    %eax,%eax
  lea    (%rdi,%r11,1),%r10
  test   %ecx,%ecx
  jne    L119
  test   %r8d,%r8d
  je     L119
  test   %r9d,%r9d
  jle    L148
  xor    %ebx,%ebx
  nopl   (%rax)
L61:
  xor    %ecx,%ecx
  nopw   0x0(%rax,%rax,1)
L173:
  movzbl (%rdi,%rcx,1),%r8d
  movzbl (%r10,%rcx,1),%edx
  lea    0x1(%r8,%rdx,1),%edx
  movzbl (%rsi,%rcx,1),%r8d
  shr    %edx
  sub    %r8d,%edx
  lea    (%rax,%rdx,1),%r8d
  sub    %edx,%eax
  test   %edx,%edx
  cmovns %r8d,%eax
  add    $0x1,%rcx
  cmp    $0x10,%rcx
  jne    L173
  add    $0x1,%ebx
  add    %r11,%r10
  add    %r11,%rsi
  add    %r11,%rdi
  cmp    %ebx,%r9d
  jne    L61
  pop    %rbx
  ret
L119:
  test   %r9d,%r9d
  jle    L148
  xor    %ebx,%ebx
  nopl   (%rax)
L52:
  xor    %edx,%edx
  nopw   0x0(%rax,%rax,1)
L12:
  movzbl 0x1(%rdi,%rdx,1),%r8d
  movzbl (%rdi,%rdx,1),%ecx
  add    %r8d,%ecx
  movzbl (%r10,%rdx,1),%r8d
  add    %r8d,%ecx
  movzbl 0x1(%r10,%rdx,1),%r8d
  lea    0x2(%rcx,%r8,1),%ecx
  movzbl (%rsi,%rdx,1),%r8d
  shr    $0x2,%ecx
  sub    %r8d,%ecx
  lea    (%rax,%rcx,1),%r8d
  sub    %ecx,%eax
  test   %ecx,%ecx
  cmovns %r8d,%eax
  add    $0x1,%rdx
  cmp    $0x10,%rdx
  jne    L12
  add    $0x1,%ebx
  add    %r11,%r10
  add    %r11,%rsi
  add    %r11,%rdi
  cmp    %ebx,%r9d
  jne    L52
  pop    %rbx
  ret
L5:
  xor    %eax,%eax
  pop    %rbx
  ret
```

assistant: ```c
int dist1(blk1, blk2, lx, hx, hy, h, distlim)
unsigned char *blk1, *blk2;
int lx, hx, hy, h;
int distlim;
{
  unsigned char *p1, *p1a, *p2;
  int i, j;
  int s, v;
  s = 0;
  p1 = blk1;
  p2 = blk2;
  if (!hx && !hy)
    for (j = 0; j < h; j++) {
      if ((v = p1[0] - p2[0]) < 0)
        v = -v;
      s += v;
      if ((v = p1[1] - p2[1]) < 0)
        v = -v;
      s += v;
      if ((v = p1[2] - p2[2]) < 0)
        v = -v;
      s += v;
      if ((v = p1[3] - p2[3]) < 0)
        v = -v;
      s += v;
      if ((v = p1[4] - p2[4]) < 0)
        v = -v;
      s += v;
      if ((v = p1[5] - p2[5]) < 0)
        v = -v;
      s += v;
      if ((v = p1[6] - p2[6]) < 0)
        v = -v;
      s += v;
      if ((v = p1[7] - p2[7]) < 0)
        v = -v;
      s += v;
      if ((v = p1[8] - p2[8]) < 0)
        v = -v;
      s += v;
      if ((v = p1[9] - p2[9]) < 0)
        v = -v;
      s += v;
      if ((v = p1[10] - p2[10]) < 0)
        v = -v;
      s += v;
      if ((v = p1[11] - p2[11]) < 0)
        v = -v;
      s += v;
      if ((v = p1[12] - p2[12]) < 0)
        v = -v;
      s += v;
      if ((v = p1[13] - p2[13]) < 0)
        v = -v;
      s += v;
      if ((v = p1[14] - p2[14]) < 0)
        v = -v;
      s += v;
      if ((v = p1[15] - p2[15]) < 0)
        v = -v;
      s += v;
      if (s >= distlim)
        break;
      p1 += lx;
      p2 += lx;
    }
  else if (hx && !hy)
    for (j = 0; j < h; j++) {
      for (i = 0; i < 16; i++) {
        v = ((unsigned int)(p1[i] + p1[i + 1] + 1) >> 1) - p2[i];
        if (v >= 0)
          s += v;
        else
          s -= v;
      }
      p1 += lx;
      p2 += lx;
    }
  else if (!hx && hy) {
    p1a = p1 + lx;
    for (j = 0; j < h; j++) {
      for (i = 0; i < 16; i++) {
        v = ((unsigned int)(p1[i] + p1a[i] + 1) >> 1) - p2[i];
        if (v >= 0)
          s += v;
        else
          s -= v;
      }
      p1 = p1a;
      p1a += lx;
      p2 += lx;
    }
  } else {
    p1a = p1 + lx;
    for (j = 0; j < h; j++) {
      for (i = 0; i < 16; i++) {
        v = ((unsigned int)(p1[i] + p1[i + 1] + p1a[i] + p1a[i + 1] + 2) >> 2) - p2[i];
        if (v >= 0)
          s += v;
        else
          s -= v;
      }
      p1 = p1a;
      p1a += lx;
      p2 += lx;
    }
  }
  return s;
}
```