user: 请显示与下面列出的汇编代码相匹配的C语言实现:

```asm
<decode_block4>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  mov    %rdi,-0x28(%rbp)
  mov    %esi,-0x2c(%rbp)
  mov    %rdx,-0x38(%rbp)
  mov    %rcx,-0x40(%rbp)
  movl   $0x0,-0x10(%rbp)
  jmp    L46
L25:
  mov    -0x28(%rbp),%rax
  movzbl (%rax),%eax
  movzbl %al,%eax
  shl    $0x8,%eax
  mov    %eax,%edx
  mov    -0x28(%rbp),%rax
  add    $0x1,%rax
  movzbl (%rax),%eax
  movzbl %al,%eax
  add    %edx,%eax
  mov    %ax,-0x14(%rbp)
  addq   $0x2,-0x28(%rbp)
  movzwl -0x14(%rbp),%eax
  test   %ax,%ax
  js     L15
  movzwl -0x14(%rbp),%eax
  shr    $0x8,%ax
  mov    %ax,-0x16(%rbp)
  movzwl -0x16(%rbp),%eax
  and    $0xfe,%ax
  mov    %ax,-0x12(%rbp)
  movzwl -0x12(%rbp),%edx
  mov    -0x40(%rbp),%rax
  add    %rdx,%rax
  mov    %rax,-0x8(%rbp)
  mov    -0x8(%rbp),%rax
  movzbl (%rax),%eax
  movzbl %al,%eax
  shl    $0x8,%eax
  mov    %eax,%edx
  mov    -0x8(%rbp),%rax
  add    $0x1,%rax
  movzbl (%rax),%eax
  movzbl %al,%eax
  add    %edx,%eax
  mov    %ax,-0x12(%rbp)
  andw   $0x1,-0x16(%rbp)
  shlw   -0x12(%rbp)
  movzwl -0x12(%rbp),%eax
  or     %ax,-0x16(%rbp)
  movzwl -0x16(%rbp),%eax
  shr    $0x8,%ax
  mov    %eax,%edx
  mov    -0x38(%rbp),%rax
  mov    %dl,(%rax)
  mov    -0x38(%rbp),%rax
  add    $0x1,%rax
  movzwl -0x16(%rbp),%edx
  mov    %dl,(%rax)
  addq   $0x2,-0x38(%rbp)
  movzwl -0x14(%rbp),%eax
  and    $0xfe,%ax
  mov    %ax,-0x16(%rbp)
  movzwl -0x16(%rbp),%edx
  mov    -0x40(%rbp),%rax
  add    %rdx,%rax
  mov    %rax,-0x8(%rbp)
  mov    -0x8(%rbp),%rax
  movzbl (%rax),%eax
  movzbl %al,%eax
  shl    $0x8,%eax
  mov    %eax,%edx
  mov    -0x8(%rbp),%rax
  add    $0x1,%rax
  movzbl (%rax),%eax
  movzbl %al,%eax
  add    %edx,%eax
  mov    %ax,-0x16(%rbp)
  andw   $0x1,-0x14(%rbp)
  subl   $0x2,-0x2c(%rbp)
  shlw   -0x16(%rbp)
  movzwl -0x14(%rbp),%eax
  or     %ax,-0x16(%rbp)
  movzwl -0x16(%rbp),%eax
  shr    $0x8,%ax
  mov    %eax,%edx
  mov    -0x38(%rbp),%rax
  mov    %dl,(%rax)
  mov    -0x38(%rbp),%rax
  add    $0x1,%rax
  movzwl -0x16(%rbp),%edx
  mov    %dl,(%rax)
  addq   $0x2,-0x38(%rbp)
  addl   $0x4,-0x10(%rbp)
  jmp    L46
L15:
  movzwl -0x14(%rbp),%eax
  and    $0x1f,%eax
  mov    %ax,-0x16(%rbp)
  andw   $0x7fe0,-0x14(%rbp)
  shrw   $0x4,-0x14(%rbp)
  subl   $0x2,-0x2c(%rbp)
  movzwl -0x14(%rbp),%eax
  neg    %rax
  mov    %rax,%rdx
  mov    -0x38(%rbp),%rax
  add    %rdx,%rax
  mov    %rax,-0x8(%rbp)
  jmp    L50
L8:
  mov    -0x8(%rbp),%rax
  movzbl (%rax),%eax
  movzbl %al,%eax
  shl    $0x18,%eax
  mov    %eax,%edx
  mov    -0x8(%rbp),%rax
  add    $0x1,%rax
  movzbl (%rax),%eax
  movzbl %al,%eax
  shl    $0x10,%eax
  add    %eax,%edx
  mov    -0x8(%rbp),%rax
  add    $0x2,%rax
  movzbl (%rax),%eax
  movzbl %al,%eax
  shl    $0x8,%eax
  add    %eax,%edx
  mov    -0x8(%rbp),%rax
  add    $0x3,%rax
  movzbl (%rax),%eax
  movzbl %al,%eax
  add    %edx,%eax
  mov    %eax,-0xc(%rbp)
  addq   $0x4,-0x8(%rbp)
  subw   $0x1,-0x16(%rbp)
  mov    -0xc(%rbp),%eax
  shr    $0x18,%eax
  mov    %eax,%edx
  mov    -0x38(%rbp),%rax
  mov    %dl,(%rax)
  mov    -0xc(%rbp),%eax
  shr    $0x10,%eax
  mov    %eax,%edx
  mov    -0x38(%rbp),%rax
  add    $0x1,%rax
  mov    %dl,(%rax)
  mov    -0xc(%rbp),%eax
  shr    $0x8,%eax
  mov    %eax,%edx
  mov    -0x38(%rbp),%rax
  add    $0x2,%rax
  mov    %dl,(%rax)
  mov    -0x38(%rbp),%rax
  add    $0x3,%rax
  mov    -0xc(%rbp),%edx
  mov    %dl,(%rax)
  addq   $0x4,-0x38(%rbp)
  addl   $0x4,-0x10(%rbp)
L50:
  cmpw   $0x0,-0x16(%rbp)
  jne    L8
L46:
  cmpl   $0x0,-0x2c(%rbp)
  jne    L25
  mov    -0x10(%rbp),%eax
  pop    %rbp
  ret
```

assistant: ```c
int decode_block4(unsigned char *in, int length, unsigned char *out, unsigned char *lut) {
  unsigned char *look;
  unsigned int t3;
  unsigned short t0, t1, t2;
  int len = 0;
  while (length != 0) {
    t0 = (((in)[0] << 8) + ((in)[1]));
    in += 2;
    if ((t0 & 0x8000) == 0) {
      t1 = t0 >> 8;
      t2 = t1 & 0xFE;
      look = lut + t2;
      t2 = (((look)[0] << 8) + ((look)[1]));
      t1 &= 1;
      t2 <<= 1;
      t1 |= t2;
      do {
        (out)[0] = ((t1) >> 8) & 0xFF;
        (out)[1] = ((t1)) & 0xFF;
      } while (0);
      out += 2;
      t1 = t0 & 0xFE;
      look = lut + t1;
      t1 = (((look)[0] << 8) + ((look)[1]));
      t0 &= 1;
      length -= 2;
      t1 <<= 1;
      t1 |= t0;
      do {
        (out)[0] = ((t1) >> 8) & 0xFF;
        (out)[1] = ((t1)) & 0xFF;
      } while (0);
      out += 2;
      len += 4;
    } else {
      t1 = t0 & 0x1F;
      t0 &= 0x7FE0;
      t0 >>= 4;
      length -= 2;
      look = out - t0;
      while (t1 != 0) {
        t3 = (unsigned int)(((look)[0] << 24) + ((look)[1] << 16) + ((look)[2] << 8) + ((look)[3]));
        look += 4;
        t1 -= 1;
        do {
          (out)[0] = ((t3) >> 24) & 0xFF;
          (out)[1] = ((t3) >> 16) & 0xFF;
          (out)[2] = ((t3) >> 8) & 0xFF;
          (out)[3] = (t3)&0xFF;
        } while (0);
        out += 4;
        len += 4;
      }
    }
  }
  return len;
}
```