user: 请将以下的汇编代码转换成C语言代码：

```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)
  cmpl   $0x0,-0x48(%rbp)
  jne    L136
  cmpl   $0x0,-0x4c(%rbp)
  jne    L230
  movl   $0x0,-0x28(%rbp)
  mov    -0x38(%rbp),%rax
  mov    %rax,-0x18(%rbp)
  mov    -0x40(%rbp),%rax
  mov    %rax,-0x8(%rbp)
  movl   $0x0,-0x2c(%rbp)
  jmp    L105
L235:
  movl   $0x0,-0x30(%rbp)
  jmp    L198
L325:
  mov    -0x30(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  movzbl %al,%eax
  mov    -0x30(%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)
  cmpl   $0x0,-0x1c(%rbp)
  js     L199
  mov    -0x1c(%rbp),%eax
  mov    %eax,-0x24(%rbp)
  jmp    L210
L199:
  mov    -0x1c(%rbp),%eax
  neg    %eax
  mov    %eax,-0x24(%rbp)
L210:
  mov    -0x24(%rbp),%eax
  add    %eax,-0x28(%rbp)
  addl   $0x1,-0x30(%rbp)
L198:
  cmpl   $0xf,-0x30(%rbp)
  jle    L325
  mov    -0x44(%rbp),%eax
  cltq
  add    %rax,-0x18(%rbp)
  mov    -0x44(%rbp),%eax
  cltq
  add    %rax,-0x8(%rbp)
  addl   $0x1,-0x2c(%rbp)
L105:
  mov    -0x2c(%rbp),%eax
  cmp    -0x50(%rbp),%eax
  jl     L235
  jmp    L301
L136:
  nop
  jmp    L81
L230:
  nop
L81:
  cmpl   $0x0,-0x48(%rbp)
  je     L346
  cmpl   $0x0,-0x4c(%rbp)
  jne    L315
  movl   $0x0,-0x28(%rbp)
  mov    -0x38(%rbp),%rax
  mov    %rax,-0x18(%rbp)
  mov    -0x40(%rbp),%rax
  mov    %rax,-0x8(%rbp)
  movl   $0x0,-0x2c(%rbp)
  jmp    L127
L66:
  movl   $0x0,-0x30(%rbp)
  jmp    L293
L51:
  mov    -0x30(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  movzbl %al,%edx
  mov    -0x30(%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    -0x30(%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     L308
  mov    -0x1c(%rbp),%eax
  add    %eax,-0x28(%rbp)
  jmp    L287
L308:
  mov    -0x1c(%rbp),%eax
  sub    %eax,-0x28(%rbp)
L287:
  addl   $0x1,-0x30(%rbp)
L293:
  cmpl   $0xf,-0x30(%rbp)
  jle    L51
  mov    -0x44(%rbp),%eax
  cltq
  add    %rax,-0x18(%rbp)
  mov    -0x44(%rbp),%eax
  cltq
  add    %rax,-0x8(%rbp)
  addl   $0x1,-0x2c(%rbp)
L127:
  mov    -0x2c(%rbp),%eax
  cmp    -0x50(%rbp),%eax
  jl     L66
  jmp    L301
L346:
  nop
  jmp    L240
L315:
  nop
L240:
  cmpl   $0x0,-0x48(%rbp)
  jne    L342
  cmpl   $0x0,-0x4c(%rbp)
  je     L31
  movl   $0x0,-0x28(%rbp)
  mov    -0x38(%rbp),%rax
  mov    %rax,-0x18(%rbp)
  mov    -0x40(%rbp),%rax
  mov    %rax,-0x8(%rbp)
  mov    -0x44(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  mov    %rax,-0x10(%rbp)
  movl   $0x0,-0x2c(%rbp)
  jmp    L140
L126:
  movl   $0x0,-0x30(%rbp)
  jmp    L109
L145:
  mov    -0x30(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  movzbl %al,%edx
  mov    -0x30(%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    -0x30(%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     L353
  mov    -0x1c(%rbp),%eax
  add    %eax,-0x28(%rbp)
  jmp    L18
L353:
  mov    -0x1c(%rbp),%eax
  sub    %eax,-0x28(%rbp)
L18:
  addl   $0x1,-0x30(%rbp)
L109:
  cmpl   $0xf,-0x30(%rbp)
  jle    L145
  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,-0x2c(%rbp)
L140:
  mov    -0x2c(%rbp),%eax
  cmp    -0x50(%rbp),%eax
  jl     L126
  jmp    L301
L342:
  nop
  jmp    L150
L31:
  nop
L150:
  movl   $0x0,-0x28(%rbp)
  mov    -0x38(%rbp),%rax
  mov    %rax,-0x18(%rbp)
  mov    -0x40(%rbp),%rax
  mov    %rax,-0x8(%rbp)
  mov    -0x44(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  mov    %rax,-0x10(%rbp)
  movl   $0x0,-0x2c(%rbp)
  jmp    L271
L211:
  movl   $0x0,-0x30(%rbp)
  jmp    L183
L11:
  mov    -0x30(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  movzbl %al,%edx
  mov    -0x30(%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    -0x30(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x10(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  movzbl %al,%eax
  lea    (%rcx,%rax,1),%edx
  mov    -0x30(%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    -0x30(%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     L246
  mov    -0x1c(%rbp),%eax
  add    %eax,-0x28(%rbp)
  jmp    L86
L246:
  mov    -0x1c(%rbp),%eax
  sub    %eax,-0x28(%rbp)
L86:
  addl   $0x1,-0x30(%rbp)
L183:
  cmpl   $0xf,-0x30(%rbp)
  jle    L11
  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,-0x2c(%rbp)
L271:
  mov    -0x2c(%rbp),%eax
  cmp    -0x50(%rbp),%eax
  jl     L211
L301:
  mov    -0x28(%rbp),%eax
  pop    %rbp
  ret
```

assistant: ```c
int dist1(unsigned char *blk1, unsigned char *blk2, int lx, int hx, int hy, int h, int distlim) {
  unsigned char *p1;
  unsigned char *p1a;
  unsigned char *p2;
  int i;
  int j;
  int s;
  int v;
  int sa;
  int tmp;
  {
    sa = 0;
    if (!hx) {
      if (!hy) {
        s = 0;
        p1 = blk1;
        p2 = blk2;
        j = 0;
        while (j < h) {
          i = 0;
          while (i < 16) {
            v = (int)*(p1 + i) - (int)*(p2 + i);
            if (v >= 0) {
              tmp = v;
            } else {
              tmp = -v;
            }
            s += tmp;
            i++;
          }
          p1 += lx;
          p2 += lx;
          j++;
        }
      } else {
        goto _L___1;
      }
    } else
    _L___1:
      if (hx) {
        if (!hy) {
          s = 0;
          p1 = blk1;
          p2 = blk2;
          j = 0;
          while (j < h) {
            i = 0;
            while (i < 16) {
              v = (int)(((unsigned int)(((int)*(p1 + i) + (int)*(p1 + (i + 1))) + 1) >> 1) - (unsigned int)*(p2 + i));
              if (v >= 0) {
                s += v;
              } else {
                s -= v;
              }
              i++;
            }
            p1 += lx;
            p2 += lx;
            j++;
          }
        } else {
          goto _L___0;
        }
      } else
      _L___0:
        if (!hx) {
          if (hy) {
            s = 0;
            p1 = blk1;
            p2 = blk2;
            p1a = p1 + lx;
            j = 0;
            while (j < h) {
              i = 0;
              while (i < 16) {
                v = (int)(((unsigned int)(((int)*(p1 + i) + (int)*(p1a + i)) + 1) >> 1) - (unsigned int)*(p2 + i));
                if (v >= 0) {
                  s += v;
                } else {
                  s -= v;
                }
                i++;
              }
              p1 = p1a;
              p1a += lx;
              p2 += lx;
              j++;
            }
          } else {
            goto _L;
          }
        } else {
        _L:
          s = 0;
          p1 = blk1;
          p2 = blk2;
          p1a = p1 + lx;
          j = 0;
          while (j < h) {
            i = 0;
            while (i < 16) {
              v = (int)(((unsigned int)(((((int)*(p1 + i) + (int)*(p1 + (i + 1))) + (int)*(p1a + i)) + (int)*(p1a + (i + 1))) + 2) >> 2) - (unsigned int)*(p2 + i));
              if (v >= 0) {
                s += v;
              } else {
                s -= v;
              }
              i++;
            }
            p1 = p1a;
            p1a += lx;
            p2 += lx;
            j++;
          }
        }
    return (s);
  }
}
```