user: Translate the below assembly code into C programming language:

```asm
<dist2>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  mov    %rdi,-0x38(%rbp)
  mov    %rsi,-0x40(%rbp)
  mov    %edx,-0x44(%rbp)
  mov    %ecx,-0x48(%rbp)
  mov    %r8d,-0x4c(%rbp)
  mov    %r9d,-0x50(%rbp)
  movl   $0x0,-0x20(%rbp)
  mov    -0x38(%rbp),%rax
  mov    %rax,-0x18(%rbp)
  mov    -0x40(%rbp),%rax
  mov    %rax,-0x8(%rbp)
  cmpl   $0x0,-0x48(%rbp)
  jne    L209
  cmpl   $0x0,-0x4c(%rbp)
  jne    L209
  movl   $0x0,-0x24(%rbp)
  jmp    L13
L222:
  movl   $0x0,-0x28(%rbp)
  jmp    L47
L211:
  mov    -0x28(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  movzbl %al,%eax
  mov    -0x28(%rbp),%edx
  movslq %edx,%rcx
  mov    -0x8(%rbp),%rdx
  add    %rcx,%rdx
  movzbl (%rdx),%edx
  movzbl %dl,%edx
  sub    %edx,%eax
  mov    %eax,-0x1c(%rbp)
  mov    -0x1c(%rbp),%eax
  imul   %eax,%eax
  add    %eax,-0x20(%rbp)
  addl   $0x1,-0x28(%rbp)
L47:
  cmpl   $0xf,-0x28(%rbp)
  jle    L211
  mov    -0x44(%rbp),%eax
  cltq
  add    %rax,-0x18(%rbp)
  mov    -0x44(%rbp),%eax
  cltq
  add    %rax,-0x8(%rbp)
  addl   $0x1,-0x24(%rbp)
L13:
  mov    -0x24(%rbp),%eax
  cmp    -0x50(%rbp),%eax
  jl     L222
  jmp    L144
L209:
  cmpl   $0x0,-0x48(%rbp)
  je     L34
  cmpl   $0x0,-0x4c(%rbp)
  jne    L34
  movl   $0x0,-0x24(%rbp)
  jmp    L134
L197:
  movl   $0x0,-0x28(%rbp)
  jmp    L179
L30:
  mov    -0x28(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  movzbl %al,%edx
  mov    -0x28(%rbp),%eax
  cltq
  lea    0x1(%rax),%rcx
  mov    -0x18(%rbp),%rax
  add    %rcx,%rax
  movzbl (%rax),%eax
  movzbl %al,%eax
  add    %edx,%eax
  add    $0x1,%eax
  shr    %eax
  mov    %eax,%edx
  mov    -0x28(%rbp),%eax
  movslq %eax,%rcx
  mov    -0x8(%rbp),%rax
  add    %rcx,%rax
  movzbl (%rax),%eax
  movzbl %al,%ecx
  mov    %edx,%eax
  sub    %ecx,%eax
  mov    %eax,-0x1c(%rbp)
  mov    -0x1c(%rbp),%eax
  imul   %eax,%eax
  add    %eax,-0x20(%rbp)
  addl   $0x1,-0x28(%rbp)
L179:
  cmpl   $0xf,-0x28(%rbp)
  jle    L30
  mov    -0x44(%rbp),%eax
  cltq
  add    %rax,-0x18(%rbp)
  mov    -0x44(%rbp),%eax
  cltq
  add    %rax,-0x8(%rbp)
  addl   $0x1,-0x24(%rbp)
L134:
  mov    -0x24(%rbp),%eax
  cmp    -0x50(%rbp),%eax
  jl     L197
  jmp    L144
L34:
  cmpl   $0x0,-0x48(%rbp)
  jne    L98
  cmpl   $0x0,-0x4c(%rbp)
  je     L98
  mov    -0x44(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  mov    %rax,-0x10(%rbp)
  movl   $0x0,-0x24(%rbp)
  jmp    L235
L81:
  movl   $0x0,-0x28(%rbp)
  jmp    L241
L102:
  mov    -0x28(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  movzbl %al,%edx
  mov    -0x28(%rbp),%eax
  movslq %eax,%rcx
  mov    -0x10(%rbp),%rax
  add    %rcx,%rax
  movzbl (%rax),%eax
  movzbl %al,%eax
  add    %edx,%eax
  add    $0x1,%eax
  shr    %eax
  mov    %eax,%edx
  mov    -0x28(%rbp),%eax
  movslq %eax,%rcx
  mov    -0x8(%rbp),%rax
  add    %rcx,%rax
  movzbl (%rax),%eax
  movzbl %al,%ecx
  mov    %edx,%eax
  sub    %ecx,%eax
  mov    %eax,-0x1c(%rbp)
  mov    -0x1c(%rbp),%eax
  imul   %eax,%eax
  add    %eax,-0x20(%rbp)
  addl   $0x1,-0x28(%rbp)
L241:
  cmpl   $0xf,-0x28(%rbp)
  jle    L102
  mov    -0x10(%rbp),%rax
  mov    %rax,-0x18(%rbp)
  mov    -0x44(%rbp),%eax
  cltq
  add    %rax,-0x10(%rbp)
  mov    -0x44(%rbp),%eax
  cltq
  add    %rax,-0x8(%rbp)
  addl   $0x1,-0x24(%rbp)
L235:
  mov    -0x24(%rbp),%eax
  cmp    -0x50(%rbp),%eax
  jl     L81
  jmp    L144
L98:
  mov    -0x44(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  mov    %rax,-0x10(%rbp)
  movl   $0x0,-0x24(%rbp)
  jmp    L91
L113:
  movl   $0x0,-0x28(%rbp)
  jmp    L67
L201:
  mov    -0x28(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  movzbl %al,%edx
  mov    -0x28(%rbp),%eax
  cltq
  lea    0x1(%rax),%rcx
  mov    -0x18(%rbp),%rax
  add    %rcx,%rax
  movzbl (%rax),%eax
  movzbl %al,%eax
  lea    (%rdx,%rax,1),%ecx
  mov    -0x28(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x10(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  movzbl %al,%eax
  lea    (%rcx,%rax,1),%edx
  mov    -0x28(%rbp),%eax
  cltq
  lea    0x1(%rax),%rcx
  mov    -0x10(%rbp),%rax
  add    %rcx,%rax
  movzbl (%rax),%eax
  movzbl %al,%eax
  add    %edx,%eax
  add    $0x2,%eax
  shr    $0x2,%eax
  mov    %eax,%edx
  mov    -0x28(%rbp),%eax
  movslq %eax,%rcx
  mov    -0x8(%rbp),%rax
  add    %rcx,%rax
  movzbl (%rax),%eax
  movzbl %al,%ecx
  mov    %edx,%eax
  sub    %ecx,%eax
  mov    %eax,-0x1c(%rbp)
  mov    -0x1c(%rbp),%eax
  imul   %eax,%eax
  add    %eax,-0x20(%rbp)
  addl   $0x1,-0x28(%rbp)
L67:
  cmpl   $0xf,-0x28(%rbp)
  jle    L201
  mov    -0x10(%rbp),%rax
  mov    %rax,-0x18(%rbp)
  mov    -0x44(%rbp),%eax
  cltq
  add    %rax,-0x10(%rbp)
  mov    -0x44(%rbp),%eax
  cltq
  add    %rax,-0x8(%rbp)
  addl   $0x1,-0x24(%rbp)
L91:
  mov    -0x24(%rbp),%eax
  cmp    -0x50(%rbp),%eax
  jl     L113
L144:
  mov    -0x20(%rbp),%eax
  pop    %rbp
  ret
```

assistant: ```c
int dist2(blk1, blk2, lx, hx, hy, h)
unsigned char *blk1, *blk2;
int lx, hx, hy, h;
{
  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++) {
      for (i = 0; i < 16; i++) {
        v = p1[i] - p2[i];
        s += v * v;
      }
      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];
        s += v * 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];
        s += v * 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];
        s += v * v;
      }
      p1 = p1a;
      p1a += lx;
      p2 += lx;
    }
  }
  return s;
}
```