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

```asm
<dist1>:
  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    L334
  cmpl   $0x0,-0x4c(%rbp)
  jne    L334
  movl   $0x0,-0x24(%rbp)
  jmp    L304
L327:
  mov    -0x18(%rbp),%rax
  movzbl (%rax),%eax
  movzbl %al,%edx
  mov    -0x8(%rbp),%rax
  movzbl (%rax),%eax
  movzbl %al,%ecx
  mov    %edx,%eax
  sub    %ecx,%eax
  mov    %eax,-0x1c(%rbp)
  cmpl   $0x0,-0x1c(%rbp)
  jns    L329
  negl   -0x1c(%rbp)
L329:
  mov    -0x1c(%rbp),%eax
  add    %eax,-0x20(%rbp)
  mov    -0x18(%rbp),%rax
  add    $0x1,%rax
  movzbl (%rax),%eax
  movzbl %al,%eax
  mov    -0x8(%rbp),%rdx
  add    $0x1,%rdx
  movzbl (%rdx),%edx
  movzbl %dl,%edx
  sub    %edx,%eax
  mov    %eax,-0x1c(%rbp)
  cmpl   $0x0,-0x1c(%rbp)
  jns    L276
  negl   -0x1c(%rbp)
L276:
  mov    -0x1c(%rbp),%eax
  add    %eax,-0x20(%rbp)
  mov    -0x18(%rbp),%rax
  add    $0x2,%rax
  movzbl (%rax),%eax
  movzbl %al,%eax
  mov    -0x8(%rbp),%rdx
  add    $0x2,%rdx
  movzbl (%rdx),%edx
  movzbl %dl,%edx
  sub    %edx,%eax
  mov    %eax,-0x1c(%rbp)
  cmpl   $0x0,-0x1c(%rbp)
  jns    L0
  negl   -0x1c(%rbp)
L0:
  mov    -0x1c(%rbp),%eax
  add    %eax,-0x20(%rbp)
  mov    -0x18(%rbp),%rax
  add    $0x3,%rax
  movzbl (%rax),%eax
  movzbl %al,%eax
  mov    -0x8(%rbp),%rdx
  add    $0x3,%rdx
  movzbl (%rdx),%edx
  movzbl %dl,%edx
  sub    %edx,%eax
  mov    %eax,-0x1c(%rbp)
  cmpl   $0x0,-0x1c(%rbp)
  jns    L461
  negl   -0x1c(%rbp)
L461:
  mov    -0x1c(%rbp),%eax
  add    %eax,-0x20(%rbp)
  mov    -0x18(%rbp),%rax
  add    $0x4,%rax
  movzbl (%rax),%eax
  movzbl %al,%eax
  mov    -0x8(%rbp),%rdx
  add    $0x4,%rdx
  movzbl (%rdx),%edx
  movzbl %dl,%edx
  sub    %edx,%eax
  mov    %eax,-0x1c(%rbp)
  cmpl   $0x0,-0x1c(%rbp)
  jns    L214
  negl   -0x1c(%rbp)
L214:
  mov    -0x1c(%rbp),%eax
  add    %eax,-0x20(%rbp)
  mov    -0x18(%rbp),%rax
  add    $0x5,%rax
  movzbl (%rax),%eax
  movzbl %al,%eax
  mov    -0x8(%rbp),%rdx
  add    $0x5,%rdx
  movzbl (%rdx),%edx
  movzbl %dl,%edx
  sub    %edx,%eax
  mov    %eax,-0x1c(%rbp)
  cmpl   $0x0,-0x1c(%rbp)
  jns    L364
  negl   -0x1c(%rbp)
L364:
  mov    -0x1c(%rbp),%eax
  add    %eax,-0x20(%rbp)
  mov    -0x18(%rbp),%rax
  add    $0x6,%rax
  movzbl (%rax),%eax
  movzbl %al,%eax
  mov    -0x8(%rbp),%rdx
  add    $0x6,%rdx
  movzbl (%rdx),%edx
  movzbl %dl,%edx
  sub    %edx,%eax
  mov    %eax,-0x1c(%rbp)
  cmpl   $0x0,-0x1c(%rbp)
  jns    L16
  negl   -0x1c(%rbp)
L16:
  mov    -0x1c(%rbp),%eax
  add    %eax,-0x20(%rbp)
  mov    -0x18(%rbp),%rax
  add    $0x7,%rax
  movzbl (%rax),%eax
  movzbl %al,%eax
  mov    -0x8(%rbp),%rdx
  add    $0x7,%rdx
  movzbl (%rdx),%edx
  movzbl %dl,%edx
  sub    %edx,%eax
  mov    %eax,-0x1c(%rbp)
  cmpl   $0x0,-0x1c(%rbp)
  jns    L128
  negl   -0x1c(%rbp)
L128:
  mov    -0x1c(%rbp),%eax
  add    %eax,-0x20(%rbp)
  mov    -0x18(%rbp),%rax
  add    $0x8,%rax
  movzbl (%rax),%eax
  movzbl %al,%eax
  mov    -0x8(%rbp),%rdx
  add    $0x8,%rdx
  movzbl (%rdx),%edx
  movzbl %dl,%edx
  sub    %edx,%eax
  mov    %eax,-0x1c(%rbp)
  cmpl   $0x0,-0x1c(%rbp)
  jns    L116
  negl   -0x1c(%rbp)
L116:
  mov    -0x1c(%rbp),%eax
  add    %eax,-0x20(%rbp)
  mov    -0x18(%rbp),%rax
  add    $0x9,%rax
  movzbl (%rax),%eax
  movzbl %al,%eax
  mov    -0x8(%rbp),%rdx
  add    $0x9,%rdx
  movzbl (%rdx),%edx
  movzbl %dl,%edx
  sub    %edx,%eax
  mov    %eax,-0x1c(%rbp)
  cmpl   $0x0,-0x1c(%rbp)
  jns    L157
  negl   -0x1c(%rbp)
L157:
  mov    -0x1c(%rbp),%eax
  add    %eax,-0x20(%rbp)
  mov    -0x18(%rbp),%rax
  add    $0xa,%rax
  movzbl (%rax),%eax
  movzbl %al,%eax
  mov    -0x8(%rbp),%rdx
  add    $0xa,%rdx
  movzbl (%rdx),%edx
  movzbl %dl,%edx
  sub    %edx,%eax
  mov    %eax,-0x1c(%rbp)
  cmpl   $0x0,-0x1c(%rbp)
  jns    L323
  negl   -0x1c(%rbp)
L323:
  mov    -0x1c(%rbp),%eax
  add    %eax,-0x20(%rbp)
  mov    -0x18(%rbp),%rax
  add    $0xb,%rax
  movzbl (%rax),%eax
  movzbl %al,%eax
  mov    -0x8(%rbp),%rdx
  add    $0xb,%rdx
  movzbl (%rdx),%edx
  movzbl %dl,%edx
  sub    %edx,%eax
  mov    %eax,-0x1c(%rbp)
  cmpl   $0x0,-0x1c(%rbp)
  jns    L40
  negl   -0x1c(%rbp)
L40:
  mov    -0x1c(%rbp),%eax
  add    %eax,-0x20(%rbp)
  mov    -0x18(%rbp),%rax
  add    $0xc,%rax
  movzbl (%rax),%eax
  movzbl %al,%eax
  mov    -0x8(%rbp),%rdx
  add    $0xc,%rdx
  movzbl (%rdx),%edx
  movzbl %dl,%edx
  sub    %edx,%eax
  mov    %eax,-0x1c(%rbp)
  cmpl   $0x0,-0x1c(%rbp)
  jns    L34
  negl   -0x1c(%rbp)
L34:
  mov    -0x1c(%rbp),%eax
  add    %eax,-0x20(%rbp)
  mov    -0x18(%rbp),%rax
  add    $0xd,%rax
  movzbl (%rax),%eax
  movzbl %al,%eax
  mov    -0x8(%rbp),%rdx
  add    $0xd,%rdx
  movzbl (%rdx),%edx
  movzbl %dl,%edx
  sub    %edx,%eax
  mov    %eax,-0x1c(%rbp)
  cmpl   $0x0,-0x1c(%rbp)
  jns    L371
  negl   -0x1c(%rbp)
L371:
  mov    -0x1c(%rbp),%eax
  add    %eax,-0x20(%rbp)
  mov    -0x18(%rbp),%rax
  add    $0xe,%rax
  movzbl (%rax),%eax
  movzbl %al,%eax
  mov    -0x8(%rbp),%rdx
  add    $0xe,%rdx
  movzbl (%rdx),%edx
  movzbl %dl,%edx
  sub    %edx,%eax
  mov    %eax,-0x1c(%rbp)
  cmpl   $0x0,-0x1c(%rbp)
  jns    L78
  negl   -0x1c(%rbp)
L78:
  mov    -0x1c(%rbp),%eax
  add    %eax,-0x20(%rbp)
  mov    -0x18(%rbp),%rax
  add    $0xf,%rax
  movzbl (%rax),%eax
  movzbl %al,%eax
  mov    -0x8(%rbp),%rdx
  add    $0xf,%rdx
  movzbl (%rdx),%edx
  movzbl %dl,%edx
  sub    %edx,%eax
  mov    %eax,-0x1c(%rbp)
  cmpl   $0x0,-0x1c(%rbp)
  jns    L112
  negl   -0x1c(%rbp)
L112:
  mov    -0x1c(%rbp),%eax
  add    %eax,-0x20(%rbp)
  mov    -0x20(%rbp),%eax
  cmp    0x10(%rbp),%eax
  jge    L195
  mov    -0x44(%rbp),%eax
  cltq
  add    %rax,-0x18(%rbp)
  mov    -0x44(%rbp),%eax
  cltq
  add    %rax,-0x8(%rbp)
  addl   $0x1,-0x24(%rbp)
L304:
  mov    -0x24(%rbp),%eax
  cmp    -0x50(%rbp),%eax
  jl     L327
  jmp    L154
L195:
  nop
  jmp    L154
L334:
  cmpl   $0x0,-0x48(%rbp)
  je     L432
  cmpl   $0x0,-0x4c(%rbp)
  jne    L432
  movl   $0x0,-0x24(%rbp)
  jmp    L414
L404:
  movl   $0x0,-0x28(%rbp)
  jmp    L145
L71:
  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)
  cmpl   $0x0,-0x1c(%rbp)
  js     L469
  mov    -0x1c(%rbp),%eax
  add    %eax,-0x20(%rbp)
  jmp    L335
L469:
  mov    -0x1c(%rbp),%eax
  sub    %eax,-0x20(%rbp)
L335:
  addl   $0x1,-0x28(%rbp)
L145:
  cmpl   $0xf,-0x28(%rbp)
  jle    L71
  mov    -0x44(%rbp),%eax
  cltq
  add    %rax,-0x18(%rbp)
  mov    -0x44(%rbp),%eax
  cltq
  add    %rax,-0x8(%rbp)
  addl   $0x1,-0x24(%rbp)
L414:
  mov    -0x24(%rbp),%eax
  cmp    -0x50(%rbp),%eax
  jl     L404
  jmp    L154
L432:
  cmpl   $0x0,-0x48(%rbp)
  jne    L62
  cmpl   $0x0,-0x4c(%rbp)
  je     L62
  mov    -0x44(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  mov    %rax,-0x10(%rbp)
  movl   $0x0,-0x24(%rbp)
  jmp    L347
L168:
  movl   $0x0,-0x28(%rbp)
  jmp    L242
L36:
  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)
  cmpl   $0x0,-0x1c(%rbp)
  js     L82
  mov    -0x1c(%rbp),%eax
  add    %eax,-0x20(%rbp)
  jmp    L159
L82:
  mov    -0x1c(%rbp),%eax
  sub    %eax,-0x20(%rbp)
L159:
  addl   $0x1,-0x28(%rbp)
L242:
  cmpl   $0xf,-0x28(%rbp)
  jle    L36
  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)
L347:
  mov    -0x24(%rbp),%eax
  cmp    -0x50(%rbp),%eax
  jl     L168
  jmp    L154
L62:
  mov    -0x44(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  mov    %rax,-0x10(%rbp)
  movl   $0x0,-0x24(%rbp)
  jmp    L169
L81:
  movl   $0x0,-0x28(%rbp)
  jmp    L29
L230:
  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)
  cmpl   $0x0,-0x1c(%rbp)
  js     L274
  mov    -0x1c(%rbp),%eax
  add    %eax,-0x20(%rbp)
  jmp    L268
L274:
  mov    -0x1c(%rbp),%eax
  sub    %eax,-0x20(%rbp)
L268:
  addl   $0x1,-0x28(%rbp)
L29:
  cmpl   $0xf,-0x28(%rbp)
  jle    L230
  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)
L169:
  mov    -0x24(%rbp),%eax
  cmp    -0x50(%rbp),%eax
  jl     L81
L154:
  mov    -0x20(%rbp),%eax
  pop    %rbp
  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;
}
```