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

```asm
<encode_alpha_block_DXT5>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  mov    %rdi,-0x48(%rbp)
  mov    %rsi,-0x50(%rbp)
  mov    %edx,-0x54(%rbp)
  mov    -0x54(%rbp),%eax
  cltq
  add    %rax,-0x50(%rbp)
  addq   $0x3,-0x50(%rbp)
  mov    -0x50(%rbp),%rax
  movzbl (%rax),%eax
  movzbl %al,%eax
  mov    %eax,-0x2c(%rbp)
  mov    -0x2c(%rbp),%eax
  mov    %eax,-0x30(%rbp)
  movl   $0x0,-0x34(%rbp)
  jmp    L67
L33:
  mov    -0x34(%rbp),%eax
  shl    $0x2,%eax
  movslq %eax,%rdx
  mov    -0x50(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  movzbl %al,%eax
  mov    %eax,-0x4(%rbp)
  mov    -0x4(%rbp),%eax
  cmp    -0x2c(%rbp),%eax
  jle    L12
  mov    -0x4(%rbp),%eax
  mov    %eax,-0x2c(%rbp)
L12:
  mov    -0x4(%rbp),%eax
  cmp    -0x30(%rbp),%eax
  jge    L17
  mov    -0x4(%rbp),%eax
  mov    %eax,-0x30(%rbp)
L17:
  addl   $0x1,-0x34(%rbp)
L67:
  cmpl   $0xf,-0x34(%rbp)
  jle    L33
  mov    -0x48(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x48(%rbp)
  mov    -0x2c(%rbp),%edx
  mov    %dl,(%rax)
  mov    -0x48(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x48(%rbp)
  mov    -0x30(%rbp),%edx
  mov    %dl,(%rax)
  mov    -0x2c(%rbp),%eax
  sub    -0x30(%rbp),%eax
  mov    %eax,-0x20(%rbp)
  mov    -0x30(%rbp),%edx
  mov    %edx,%eax
  shl    $0x3,%eax
  sub    %edx,%eax
  mov    %eax,%ecx
  mov    -0x20(%rbp),%eax
  sar    %eax
  mov    %eax,%edx
  mov    %ecx,%eax
  sub    %edx,%eax
  mov    %eax,-0x1c(%rbp)
  mov    -0x20(%rbp),%eax
  shl    $0x2,%eax
  mov    %eax,-0x18(%rbp)
  mov    -0x20(%rbp),%eax
  add    %eax,%eax
  mov    %eax,-0x14(%rbp)
  movl   $0x0,-0x28(%rbp)
  movl   $0x0,-0x24(%rbp)
  movl   $0x0,-0x34(%rbp)
  jmp    L4
L54:
  mov    -0x34(%rbp),%eax
  shl    $0x2,%eax
  movslq %eax,%rdx
  mov    -0x50(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  movzbl %al,%edx
  mov    %edx,%eax
  shl    $0x3,%eax
  sub    %edx,%eax
  sub    -0x1c(%rbp),%eax
  mov    %eax,-0x10(%rbp)
  mov    -0x18(%rbp),%eax
  sub    -0x10(%rbp),%eax
  sar    $0x1f,%eax
  mov    %eax,-0xc(%rbp)
  mov    -0xc(%rbp),%eax
  and    $0x4,%eax
  mov    %eax,-0x8(%rbp)
  mov    -0x18(%rbp),%eax
  and    -0xc(%rbp),%eax
  sub    %eax,-0x10(%rbp)
  mov    -0x14(%rbp),%eax
  sub    -0x10(%rbp),%eax
  sar    $0x1f,%eax
  mov    %eax,-0xc(%rbp)
  mov    -0xc(%rbp),%eax
  and    $0x2,%eax
  add    %eax,-0x8(%rbp)
  mov    -0x14(%rbp),%eax
  and    -0xc(%rbp),%eax
  sub    %eax,-0x10(%rbp)
  mov    -0x20(%rbp),%eax
  sub    -0x10(%rbp),%eax
  sar    $0x1f,%eax
  mov    %eax,-0xc(%rbp)
  mov    -0xc(%rbp),%eax
  and    $0x1,%eax
  add    %eax,-0x8(%rbp)
  mov    -0x8(%rbp),%eax
  neg    %eax
  and    $0x7,%eax
  mov    %eax,-0x8(%rbp)
  cmpl   $0x1,-0x8(%rbp)
  setle  %al
  movzbl %al,%eax
  xor    %eax,-0x8(%rbp)
  mov    -0x28(%rbp),%eax
  mov    -0x8(%rbp),%edx
  mov    %eax,%ecx
  shl    %cl,%edx
  mov    %edx,%eax
  or     %eax,-0x24(%rbp)
  addl   $0x3,-0x28(%rbp)
  cmpl   $0x7,-0x28(%rbp)
  jle    L38
  mov    -0x48(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x48(%rbp)
  mov    -0x24(%rbp),%edx
  mov    %dl,(%rax)
  sarl   $0x8,-0x24(%rbp)
  subl   $0x8,-0x28(%rbp)
L38:
  addl   $0x1,-0x34(%rbp)
L4:
  cmpl   $0xf,-0x34(%rbp)
  jle    L54
  nop
  nop
  pop    %rbp
  ret
```

assistant: ```c
void encode_alpha_block_DXT5(unsigned char *dst, const unsigned char *block, const int offset) {
  int i, v, mn, mx;
  int dist, bias, dist2, dist4, bits, mask;
  int a, idx, t;
  block += offset;
  block += 3;
  mn = mx = block[0];
  for (i = 0; i < 16; ++i) {
    v = block[4 * i];
    if (v > mx)
      mx = v;
    if (v < mn)
      mn = v;
  }
  *dst++ = mx;
  *dst++ = mn;
  dist = mx - mn;
  bias = mn * 7 - (dist >> 1);
  dist4 = dist * 4;
  dist2 = dist * 2;
  bits = 0;
  mask = 0;
  for (i = 0; i < 16; ++i) {
    a = block[4 * i] * 7 - bias;
    t = (dist4 - a) >> 31;
    idx = t & 4;
    a -= dist4 & t;
    t = (dist2 - a) >> 31;
    idx += t & 2;
    a -= dist2 & t;
    t = (dist - a) >> 31;
    idx += t & 1;
    idx = -idx & 7;
    idx ^= (2 > idx);
    mask |= idx << bits;
    if ((bits += 3) >= 8) {
      *dst++ = mask;
      mask >>= 8;
      bits -= 8;
    }
  }
}
```