user: 请从给定的汇编指令推导出C源代码:

```asm
<decode_block1>:
  endbr64
  test   %esi,%esi
  je     L222
  mov    %rdi,%rcx
  lea    -0x2(%rsi),%eax
  push   %rbp
  movdqa D5(%rip),%xmm3
  push   %rbx
  mov    %rdx,%rdi
  lea    0x2(%rcx,%rax,1),%rsi
  xor    %r8d,%r8d
  pxor   %xmm4,%xmm4
  jmp    L190
  nopl   (%rax)
L41:
  add    %edx,%edx
  and    $0x3f,%eax
  add    $0x2,%rdi
  add    $0x2,%r8d
  and    $0xffffff80,%edx
  or     %eax,%edx
  rol    $0x8,%dx
  mov    %dx,-0x2(%rdi)
L249:
  cmp    %rsi,%rcx
  je     L3
L190:
  movzbl (%rcx),%eax
  movzbl 0x1(%rcx),%edx
  add    $0x2,%rcx
  shl    $0x8,%eax
  add    %edx,%eax
  movzwl %ax,%edx
  test   %ax,%ax
  jns    L41
  sar    $0x5,%edx
  mov    %rdi,%r9
  and    $0x3ff,%edx
  mov    %rdx,%r11
  sub    %rdx,%r9
  neg    %r11
  and    $0x1f,%ax
  je     L249
  lea    -0x1(%rax),%r10d
  cmp    $0xe,%r10w
  jbe    L126
  cmp    $0xffffffffffffffe0,%r11
  ja     L126
  movdqu (%r9),%xmm0
  movdqu 0x10(%r9),%xmm1
  movdqu (%r9),%xmm2
  pand   %xmm3,%xmm1
  pand   %xmm3,%xmm0
  packuswb %xmm1,%xmm0
  movdqu 0x10(%r9),%xmm1
  psrlw  $0x8,%xmm2
  psrlw  $0x8,%xmm1
  packuswb %xmm1,%xmm2
  movdqa %xmm0,%xmm1
  punpckhbw %xmm4,%xmm0
  movdqa %xmm2,%xmm5
  punpcklbw %xmm4,%xmm1
  punpckhbw %xmm4,%xmm2
  psllw  $0x8,%xmm1
  psllw  $0x8,%xmm0
  punpcklbw %xmm4,%xmm5
  paddw  %xmm5,%xmm1
  paddw  %xmm2,%xmm0
  movdqa %xmm0,%xmm5
  movdqa %xmm1,%xmm2
  pand   %xmm3,%xmm0
  psrlw  $0x8,%xmm2
  psrlw  $0x8,%xmm5
  pand   %xmm3,%xmm1
  pand   %xmm3,%xmm2
  pand   %xmm3,%xmm5
  packuswb %xmm0,%xmm1
  packuswb %xmm5,%xmm2
  movdqa %xmm2,%xmm0
  punpckhbw %xmm1,%xmm2
  punpcklbw %xmm1,%xmm0
  movups %xmm2,0x10(%rdi)
  movups %xmm0,(%rdi)
  cmp    $0x10,%ax
  je     L241
  movzbl 0x20(%r9),%edx
  movzbl 0x21(%r9),%r11d
  shl    $0x8,%edx
  add    %r11d,%edx
  rol    $0x8,%dx
  mov    %dx,0x20(%rdi)
  cmp    $0x11,%ax
  je     L134
  movzbl 0x22(%r9),%edx
  movzbl 0x23(%r9),%r11d
  shl    $0x8,%edx
  add    %r11d,%edx
  rol    $0x8,%dx
  mov    %dx,0x22(%rdi)
  cmp    $0x12,%ax
  je     L134
  movzbl 0x24(%r9),%edx
  movzbl 0x25(%r9),%r11d
  shl    $0x8,%edx
  add    %r11d,%edx
  rol    $0x8,%dx
  mov    %dx,0x24(%rdi)
  cmp    $0x13,%ax
  je     L134
  movzbl 0x26(%r9),%edx
  movzbl 0x27(%r9),%r11d
  shl    $0x8,%edx
  add    %r11d,%edx
  rol    $0x8,%dx
  mov    %dx,0x26(%rdi)
  cmp    $0x14,%ax
  je     L134
  movzbl 0x28(%r9),%edx
  movzbl 0x29(%r9),%r11d
  shl    $0x8,%edx
  add    %r11d,%edx
  rol    $0x8,%dx
  mov    %dx,0x28(%rdi)
  cmp    $0x15,%ax
  je     L134
  movzbl 0x2a(%r9),%edx
  movzbl 0x2b(%r9),%r11d
  shl    $0x8,%edx
  add    %r11d,%edx
  rol    $0x8,%dx
  mov    %dx,0x2a(%rdi)
  cmp    $0x16,%ax
  je     L134
  movzbl 0x2c(%r9),%edx
  movzbl 0x2d(%r9),%r11d
  shl    $0x8,%edx
  add    %r11d,%edx
  rol    $0x8,%dx
  mov    %dx,0x2c(%rdi)
  cmp    $0x17,%ax
  je     L134
  movzbl 0x2e(%r9),%edx
  movzbl 0x2f(%r9),%r11d
  shl    $0x8,%edx
  add    %r11d,%edx
  rol    $0x8,%dx
  mov    %dx,0x2e(%rdi)
  cmp    $0x18,%ax
  je     L134
  movzbl 0x30(%r9),%edx
  movzbl 0x31(%r9),%r11d
  shl    $0x8,%edx
  add    %r11d,%edx
  rol    $0x8,%dx
  mov    %dx,0x30(%rdi)
  cmp    $0x19,%ax
  je     L134
  movzbl 0x32(%r9),%edx
  movzbl 0x33(%r9),%r11d
  shl    $0x8,%edx
  add    %r11d,%edx
  rol    $0x8,%dx
  mov    %dx,0x32(%rdi)
  cmp    $0x1a,%ax
  je     L134
  movzbl 0x34(%r9),%edx
  movzbl 0x35(%r9),%r11d
  shl    $0x8,%edx
  add    %r11d,%edx
  rol    $0x8,%dx
  mov    %dx,0x34(%rdi)
  cmp    $0x1b,%ax
  je     L134
  movzbl 0x36(%r9),%edx
  movzbl 0x37(%r9),%r11d
  shl    $0x8,%edx
  add    %r11d,%edx
  rol    $0x8,%dx
  mov    %dx,0x36(%rdi)
  cmp    $0x1c,%ax
  je     L134
  movzbl 0x38(%r9),%edx
  movzbl 0x39(%r9),%r11d
  shl    $0x8,%edx
  add    %r11d,%edx
  mov    %eax,%r11d
  rol    $0x8,%dx
  mov    %dx,0x38(%rdi)
  sub    $0x1d,%r11w
  je     L134
  movzbl 0x3a(%r9),%edx
  movzbl 0x3b(%r9),%ebx
  shl    $0x8,%edx
  add    %ebx,%edx
  rol    $0x8,%dx
  mov    %dx,0x3a(%rdi)
  cmp    $0x1,%r11w
  je     L134
  movzbl 0x3c(%r9),%edx
  movzbl 0x3d(%r9),%r9d
  shl    $0x8,%edx
  add    %r9d,%edx
  rol    $0x8,%dx
  mov    %dx,0x3c(%rdi)
  nopl   0x0(%rax,%rax,1)
L134:
  movzwl %ax,%eax
L45:
  movzwl %r10w,%r10d
  lea    (%rdi,%rax,2),%rdi
  lea    0x2(%r8,%r10,2),%r8d
  cmp    %rsi,%rcx
  jne    L190
L3:
  mov    %r8d,%eax
  pop    %rbx
  pop    %rbp
  ret
  nop
L126:
  movzwl %ax,%eax
  mov    %rdi,%rdx
  lea    (%r9,%rax,2),%rbp
  nopw   0x0(%rax,%rax,1)
L24:
  movzbl (%r9),%ebx
  movzbl 0x1(%r9),%r11d
  add    $0x2,%r9
  add    $0x2,%rdx
  mov    %bl,-0x2(%rdx)
  mov    %r11b,-0x1(%rdx)
  cmp    %rbp,%r9
  jne    L24
  jmp    L45
L241:
  mov    $0x10,%eax
  jmp    L45
L222:
  xor    %eax,%eax
  ret
```

tool_calls: name: unpack_data
arguments: tag: D5
type_guessed: byte[16]

tool: {"D5": [0xff,0x00,0xff,0x00,0xff,0x00,0xff,0x00,0xff,0x00,0xff,0x00,0xff,0x00,0xff,0x00]}

assistant: ```c
int decode_block1(unsigned char *in, int length, unsigned char *out) {
  unsigned short t0, t1, t3;
  unsigned char *t2;
  int len = 0;
  while (length != 0) {
    t0 = (((in)[0] << 8) + ((in)[1]));
    in += 2;
    if ((t0 & 0x8000) == 0) {
      t1 = (t0 & 0xFFC0) << 1;
      t0 &= 0x3F;
      t0 = t0 | t1;
      do {
        (out)[0] = ((t0) >> 8) & 0xFF;
        (out)[1] = ((t0)) & 0xFF;
      } while (0);
      out += 2;
      len += 2;
      length -= 2;
    } else {
      t1 = t0 & 0x1F;
      t0 = (t0 & 0x7FFF) >> 5;
      length -= 2;
      t2 = out - t0;
      while (t1 != 0) {
        t3 = (((t2)[0] << 8) + ((t2)[1]));
        t2 += 2;
        out += 2;
        len += 2;
        t1 -= 1;
        do {
          (out - 2)[0] = ((t3) >> 8) & 0xFF;
          (out - 2)[1] = ((t3)) & 0xFF;
        } while (0);
      }
    }
  }
  return len;
}
```