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

```asm
<sq905c_first_decompress>:
  endbr64
  test   %edx,%edx
  je     L292
  push   %rbp
  lea    -0x1(%rdx),%eax
  mov    %rsi,%r8
  xor    %edx,%edx
  push   %rbx
  lea    0x1(%rdi,%rax,1),%r9
  mov    $0x8,%esi
  xor    %r11d,%r11d
L982:
  cmp    $0x8,%esi
  je     L578
  movzbl %r11b,%ebx
  lea    0x1(%rsi),%r10d
  add    %ebx,%ebx
  mov    %ebx,%ecx
  test   %r11b,%r11b
  jns    L133
  cmp    $0x8,%r10d
  jne    L157
  mov    %edx,%eax
  mov    $0x1,%r10d
  add    $0x1,%edx
  movzbl (%r8,%rax,1),%esi
  mov    %esi,%eax
  add    %esi,%esi
  shr    $0x7,%al
  mov    %esi,%ecx
  or     $0x2,%eax
  cmp    $0x3,%al
  jne    L549
  mov    %esi,%eax
  lea    (%rsi,%rsi,1),%ecx
  mov    $0x2,%r10d
  shr    $0x7,%al
  or     $0x6,%eax
  cmp    $0x7,%al
  jne    L904
L27:
  mov    %ecx,%eax
  add    $0x1,%r10d
  add    %ecx,%ecx
  shr    $0x7,%al
  or     $0xe,%eax
  cmp    $0xf,%al
  jne    L411
  cmp    $0x8,%r10d
  jne    L122
  mov    %edx,%eax
  mov    $0x2,%r11d
  add    $0x1,%edx
  movzbl (%r8,%rax,1),%eax
  mov    %eax,%ecx
  lea    (%rax,%rax,1),%esi
  shl    $0x2,%eax
  shr    $0x7,%cl
  shr    $0x7,%sil
  or     $0x1e,%ecx
  add    %ecx,%ecx
  or     %esi,%ecx
  movzbl %cl,%ecx
L224:
  lea    (%rcx,%rcx,1),%esi
  lea    (%rax,%rax,1),%ecx
  shr    $0x7,%al
  or     %esi,%eax
  lea    0x1(%r11),%r10d
  movzbl %al,%eax
  cmp    $0x7,%r11d
  jne    L16
  mov    %edx,%ecx
  mov    $0x1,%r10d
  add    $0x1,%edx
  movzbl (%r8,%rcx,1),%ecx
  jmp    L573
  nopw   0x0(%rax,%rax,1)
L578:
  mov    %edx,%eax
  add    $0x1,%edx
  movzbl (%r8,%rax,1),%r10d
  mov    %r10d,%eax
  add    %r10d,%r10d
  shr    $0x7,%al
  je     L674
  mov    %r10d,%eax
  lea    (%r10,%r10,1),%ecx
  mov    $0x2,%r10d
  shr    $0x7,%al
  or     $0x2,%eax
  cmp    $0x3,%al
  jne    L549
L379:
  mov    %ecx,%eax
  add    $0x1,%r10d
  add    %ecx,%ecx
  shr    $0x7,%al
  or     $0x6,%eax
  cmp    $0x7,%al
  jne    L904
  cmp    $0x8,%r10d
  jne    L27
  mov    %edx,%eax
  add    $0x1,%edx
  movzbl (%r8,%rax,1),%r10d
  mov    %r10d,%eax
  add    %r10d,%r10d
  shr    $0x7,%al
  mov    %r10d,%ecx
  or     $0xe,%eax
  cmp    $0xf,%al
  jne    L52
  lea    (%r10,%r10,1),%esi
  shr    $0x7,%r10b
  mov    $0x2,%ebx
  or     $0x1e,%r10d
  movzbl %r10b,%ecx
L75:
  add    %ecx,%ecx
  lea    (%rsi,%rsi,1),%eax
  shr    $0x7,%sil
  lea    0x1(%rbx),%r11d
  or     %ecx,%esi
  movzbl %sil,%ecx
  cmp    $0x7,%ebx
  jne    L224
  mov    %edx,%eax
  lea    (%rcx,%rcx,1),%esi
  add    $0x1,%edx
  mov    $0x1,%r10d
  movzbl (%r8,%rax,1),%eax
  lea    (%rax,%rax,1),%ecx
  shr    $0x7,%al
  or     %esi,%eax
  movzbl %al,%eax
  jmp    L16
  nopl   0x0(%rax)
L157:
  mov    %ebx,%eax
  lea    0x2(%rsi),%r10d
  lea    (%rbx,%rbx,1),%ecx
  shr    $0x7,%al
  or     $0x2,%eax
  cmp    $0x3,%al
  jne    L549
  cmp    $0x8,%r10d
  jne    L379
  mov    %edx,%eax
  mov    $0x1,%r10d
  add    $0x1,%edx
  movzbl (%r8,%rax,1),%esi
  mov    %esi,%eax
  add    %esi,%esi
  shr    $0x7,%al
  mov    %esi,%ecx
  or     $0x6,%eax
  cmp    $0x7,%al
  jne    L904
  mov    %esi,%eax
  lea    (%rsi,%rsi,1),%ecx
  mov    $0x2,%r10d
  shr    $0x7,%al
  or     $0xe,%eax
  cmp    $0xf,%al
  jne    L411
L122:
  lea    (%rcx,%rcx,1),%esi
  shr    $0x7,%cl
  lea    0x1(%r10),%ebx
  or     $0x1e,%ecx
  movzbl %cl,%ecx
  cmp    $0x7,%r10d
  jne    L75
  mov    %edx,%eax
  add    %ecx,%ecx
  add    $0x1,%edx
  movzbl (%r8,%rax,1),%r10d
  mov    %r10d,%eax
  lea    (%r10,%r10,1),%esi
  shr    $0x7,%al
  shr    $0x7,%sil
  or     %ecx,%eax
  lea    0x0(,%r10,4),%ecx
  mov    $0x2,%r10d
  add    %eax,%eax
  or     %esi,%eax
  movzbl %al,%eax
L16:
  add    $0x1,%r10d
L573:
  lea    (%rax,%rax,1),%esi
  mov    %ecx,%eax
  add    %ecx,%ecx
  shr    $0x7,%al
  or     %esi,%eax
  cmp    $0xf0,%al
  je     L270
L436:
  cmp    $0xf1,%al
  je     L371
  cmp    $0xf2,%al
  je     L719
  cmp    $0xf3,%al
  je     L484
  cmp    $0xf4,%al
  je     L211
  cmp    $0xf5,%al
  je     L733
  cmp    $0xf6,%al
  je     L132
  cmp    $0xf7,%al
  je     L114
  cmp    $0xf8,%al
  je     L687
  cmp    $0xf9,%al
  je     L243
  cmp    $0xfa,%al
  sete   %bl
L221:
  cmp    $0x8,%r10d
  je     L312
  lea    0x1(%r10),%esi
  lea    (%rcx,%rcx,1),%r11d
  test   %cl,%cl
  jns    L597
  cmp    $0x8,%esi
  jne    L680
  mov    %edx,%eax
  mov    $0x1,%esi
  add    $0x1,%edx
  movzbl (%r8,%rax,1),%ecx
  mov    %ecx,%eax
  add    %ecx,%ecx
  shr    $0x7,%al
  mov    %ecx,%r11d
  or     $0x2,%eax
  cmp    $0x3,%al
  jne    L500
  mov    %ecx,%eax
  lea    (%rcx,%rcx,1),%r11d
  mov    $0x2,%esi
  shr    $0x7,%al
  or     $0x6,%eax
  cmp    $0x7,%al
  jne    L817
L92:
  mov    %r11d,%eax
  add    $0x1,%esi
  add    %r11d,%r11d
  shr    $0x7,%al
  or     $0xe,%eax
  cmp    $0xf,%al
  jne    L635
  cmp    $0x8,%esi
  jne    L42
  mov    %edx,%eax
  add    $0x1,%edx
  movzbl (%r8,%rax,1),%eax
  mov    %eax,%ecx
  lea    (%rax,%rax,1),%esi
  shl    $0x2,%eax
  shr    $0x7,%cl
  shr    $0x7,%sil
  or     $0x1e,%ecx
  add    %ecx,%ecx
  or     %esi,%ecx
  mov    $0x2,%esi
  movzbl %cl,%ecx
L53:
  add    %ecx,%ecx
  lea    (%rax,%rax,1),%r11d
  shr    $0x7,%al
  lea    0x1(%rsi),%r10d
  or     %ecx,%eax
  movzbl %al,%eax
  cmp    $0x7,%esi
  jne    L463
  mov    %edx,%ecx
  mov    $0x1,%esi
  add    $0x1,%edx
  movzbl (%r8,%rcx,1),%r11d
  jmp    L747
  nopl   (%rax)
L549:
  mov    $0x7,%ebx
  cmp    $0x2,%al
  jne    L436
  jmp    L221
  nopw   0x0(%rax,%rax,1)
L312:
  mov    %edx,%eax
  mov    $0x1,%esi
  add    $0x1,%edx
  movzbl (%r8,%rax,1),%ecx
  mov    %ecx,%eax
  add    %ecx,%ecx
  mov    %ecx,%r11d
  test   %al,%al
  jns    L597
  mov    %ecx,%eax
  lea    (%rcx,%rcx,1),%r11d
  mov    $0x2,%esi
  shr    $0x7,%al
  or     $0x2,%eax
  cmp    $0x3,%al
  jne    L500
L587:
  mov    %r11d,%eax
  add    $0x1,%esi
  add    %r11d,%r11d
  shr    $0x7,%al
  or     $0x6,%eax
  cmp    $0x7,%al
  jne    L817
  cmp    $0x8,%esi
  jne    L92
  mov    %edx,%eax
  add    $0x1,%edx
  movzbl (%r8,%rax,1),%ecx
  mov    %ecx,%eax
  lea    (%rcx,%rcx,1),%esi
  shr    $0x7,%al
  mov    %esi,%r11d
  or     $0xe,%eax
  cmp    $0xf,%al
  jne    L477
  lea    (%rsi,%rsi,1),%ecx
  shr    $0x7,%sil
  mov    $0x2,%ebp
  or     $0x1e,%esi
  movzbl %sil,%r10d
L239:
  add    %r10d,%r10d
  lea    (%rcx,%rcx,1),%eax
  shr    $0x7,%cl
  lea    0x1(%rbp),%esi
  or     %r10d,%ecx
  movzbl %cl,%ecx
  cmp    $0x7,%ebp
  jne    L53
  mov    %edx,%eax
  add    %ecx,%ecx
  add    $0x1,%edx
  mov    $0x1,%r10d
  movzbl (%r8,%rax,1),%eax
  lea    (%rax,%rax,1),%r11d
  shr    $0x7,%al
  or     %ecx,%eax
  movzbl %al,%eax
L463:
  lea    0x1(%r10),%esi
L747:
  lea    (%rax,%rax,1),%ecx
  mov    %r11d,%eax
  add    %r11d,%r11d
  shr    $0x7,%al
  or     %ecx,%eax
  cmp    $0xf0,%al
  je     L823
L625:
  cmp    $0xf1,%al
  je     L848
  cmp    $0xf2,%al
  je     L1
  cmp    $0xf3,%al
  je     L875
  cmp    $0xf4,%al
  je     L717
  cmp    $0xf5,%al
  je     L457
  cmp    $0xf6,%al
  je     L601
  cmp    $0xf7,%al
  je     L853
  cmp    $0xf8,%al
  je     L299
  cmp    $0xf9,%al
  je     L428
  mov    $0x1,%ecx
  cmp    $0xfa,%al
  je     L51
L864:
  xor    %ecx,%ecx
L51:
  shl    $0x4,%ebx
  add    $0x1,%rdi
  or     %ecx,%ebx
  mov    %bl,-0x1(%rdi)
  cmp    %rdi,%r9
  jne    L982
  xor    %eax,%eax
  pop    %rbx
  pop    %rbp
  ret
L674:
  lea    (%r10,%r10,1),%r11d
  mov    $0x8,%ebx
  mov    $0x2,%esi
  test   %r10b,%r10b
  jns    L597
L680:
  mov    %r11d,%eax
  add    $0x1,%esi
  add    %r11d,%r11d
  shr    $0x7,%al
  or     $0x2,%eax
  cmp    $0x3,%al
  jne    L500
  cmp    $0x8,%esi
  jne    L587
  mov    %edx,%eax
  mov    $0x1,%esi
  add    $0x1,%edx
  movzbl (%r8,%rax,1),%ecx
  mov    %ecx,%eax
  add    %ecx,%ecx
  shr    $0x7,%al
  mov    %ecx,%r11d
  or     $0x6,%eax
  cmp    $0x7,%al
  jne    L817
  mov    %ecx,%eax
  lea    (%rcx,%rcx,1),%r11d
  mov    $0x2,%esi
  shr    $0x7,%al
  or     $0xe,%eax
  cmp    $0xf,%al
  jne    L635
L42:
  lea    (%r11,%r11,1),%ecx
  shr    $0x7,%r11b
  lea    0x1(%rsi),%ebp
  mov    %r11d,%r10d
  or     $0x1e,%r10d
  movzbl %r10b,%r10d
  cmp    $0x7,%esi
  jne    L239
  mov    %edx,%eax
  add    %r10d,%r10d
  add    $0x1,%edx
  movzbl (%r8,%rax,1),%r11d
  mov    %r11d,%eax
  lea    (%r11,%r11,1),%ecx
  shl    $0x2,%r11d
  shr    $0x7,%al
  shr    $0x7,%cl
  or     %r10d,%eax
  mov    $0x2,%r10d
  add    %eax,%eax
  or     %ecx,%eax
  movzbl %al,%eax
  jmp    L463
L500:
  mov    $0x7,%ecx
  cmp    $0x2,%al
  jne    L864
  jmp    L51
L477:
  mov    $0x1,%esi
L635:
  mov    $0x6,%ecx
  cmp    $0xe,%al
  je     L51
  jmp    L625
L904:
  mov    $0x9,%ebx
  cmp    $0x6,%al
  je     L221
  jmp    L436
L52:
  mov    $0x1,%r10d
L411:
  mov    $0x6,%ebx
  cmp    $0xe,%al
  je     L221
  jmp    L436
L133:
  mov    $0x8,%ebx
  jmp    L221
L597:
  mov    $0x8,%ecx
  jmp    L51
L817:
  mov    $0x9,%ecx
  cmp    $0x6,%al
  je     L51
  jmp    L625
L270:
  mov    $0xa,%ebx
  jmp    L221
L371:
  mov    $0xb,%ebx
  jmp    L221
L719:
  mov    $0xc,%ebx
  jmp    L221
L484:
  mov    $0xd,%ebx
  jmp    L221
L211:
  mov    $0xe,%ebx
  jmp    L221
L733:
  mov    $0xf,%ebx
  jmp    L221
L132:
  mov    $0x5,%ebx
  jmp    L221
L292:
  xor    %eax,%eax
  ret
L114:
  mov    $0x4,%ebx
  jmp    L221
L687:
  mov    $0x3,%ebx
  jmp    L221
L243:
  mov    $0x2,%ebx
  jmp    L221
L823:
  mov    $0xa,%ecx
  jmp    L51
L848:
  mov    $0xb,%ecx
  jmp    L51
L1:
  mov    $0xc,%ecx
  jmp    L51
L875:
  mov    $0xd,%ecx
  jmp    L51
L717:
  mov    $0xe,%ecx
  jmp    L51
L457:
  mov    $0xf,%ecx
  jmp    L51
L601:
  mov    $0x5,%ecx
  jmp    L51
L853:
  mov    $0x4,%ecx
  jmp    L51
L428:
  mov    $0x2,%ecx
  jmp    L51
L299:
  mov    $0x3,%ecx
  jmp    L51
```

assistant: ```c
int sq905c_first_decompress(unsigned char *output, const unsigned char *input, unsigned int outputsize) {
  unsigned char parity = 0;
  unsigned char nibble_to_keep[2];
  unsigned char temp1 = 0, temp2 = 0;
  unsigned char input_byte;
  unsigned char lookup = 0;
  unsigned int i = 0;
  unsigned int bytes_used = 0;
  unsigned int bytes_done = 0;
  unsigned int bit_counter = 8;
  unsigned int cycles = 0;
  int table[9] = {-1, 0, 2, 6, 0x0e, 0x0e, 0x0e, 0x0e, 0xfb};
  unsigned char lookup_table[16] = {0, 2, 6, 0x0e, 0xf0, 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, 0xf8, 0xf9, 0xfa, 0xfb};
  unsigned char translator[16] = {8, 7, 9, 6, 10, 11, 12, 13, 14, 15, 5, 4, 3, 2, 1, 0};
  nibble_to_keep[0] = 0;
  nibble_to_keep[1] = 0;
  while (bytes_done < outputsize) {
    while (parity < 2) {
      while (lookup > table[cycles]) {
        if (bit_counter == 8) {
          input_byte = input[bytes_used];
          bytes_used++;
          temp1 = input_byte;
          bit_counter = 0;
        }
        input_byte = temp1;
        temp2 = (temp2 << 1) & 0xFF;
        input_byte = input_byte >> 7;
        temp2 = temp2 | input_byte;
        temp1 = (temp1 << 1) & 0xFF;
        bit_counter++;
        cycles++;
        if (cycles > 9)
          return -1;
        lookup = temp2 & 0xff;
      }
      temp2 = 0;
      for (i = 0; i < 17; i++) {
        if (lookup == lookup_table[i]) {
          nibble_to_keep[parity] = translator[i];
          break;
        }
        if (i == 16)
          return -1;
      }
      cycles = 0;
      parity++;
    }
    output[bytes_done] = (nibble_to_keep[0] << 4) | nibble_to_keep[1];
    bytes_done++;
    parity = 0;
  }
  return 0;
}
```