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

```asm
<sq905c_first_decompress>:
  endbr64
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x68,%rsp
  mov    %rsi,%r9
  mov    %fs:0x28,%rax
  mov    %rax,0x58(%rsp)
  xor    %eax,%eax
  movl   $0xffffffff,(%rsp)
  movl   $0x0,0x4(%rsp)
  movl   $0x2,0x8(%rsp)
  movl   $0x6,0xc(%rsp)
  movl   $0xe,0x10(%rsp)
  movl   $0xe,0x14(%rsp)
  movl   $0xe,0x18(%rsp)
  movl   $0xe,0x1c(%rsp)
  movl   $0xfb,0x20(%rsp)
  movabs $0xf3f2f1f00e060200,%rbx
  movabs $0xfbfaf9f8f7f6f5f4,%rsi
  mov    %rbx,0x30(%rsp)
  mov    %rsi,0x38(%rsp)
  movabs $0xd0c0b0a06090708,%rbx
  movabs $0x1020304050f0e,%rsi
  mov    %rbx,0x40(%rsp)
  mov    %rsi,0x48(%rsp)
  movb   $0x0,0x2e(%rsp)
  movb   $0x0,0x2f(%rsp)
  test   %edx,%edx
  je     L17
  mov    %rdi,%r11
  lea    -0x1(%rdx),%eax
  lea    0x1(%rdi,%rax,1),%r12
  mov    $0x8,%esi
  mov    $0x0,%r8d
  mov    $0x0,%ecx
  lea    0x30(%rsp),%r13
  mov    $0x0,%ebp
  lea    0x2f(%rsp),%r10
L22:
  lea    0x2e(%rsp),%rbx
L74:
  lea    0x4(%rsp),%rdi
  mov    %ebp,%eax
  jmp    L56
L65:
  add    %eax,%eax
  mov    %ecx,%edx
  shr    $0x7,%dl
  or     %edx,%eax
  add    %ecx,%ecx
  add    $0x1,%esi
  add    $0x4,%rdi
  movzbl %al,%edx
  cmp    -0x4(%rdi),%edx
  jle    L2
L56:
  cmp    $0x8,%esi
  jne    L65
  mov    %r8d,%edx
  movzbl (%r9,%rdx,1),%ecx
  add    $0x1,%r8d
  mov    $0x0,%esi
  jmp    L65
L2:
  mov    $0x0,%edx
L4:
  mov    %edx,%edi
  add    $0x1,%rdx
  cmp    %al,(%r10,%rdx,1)
  jne    L4
  mov    %edi,%edi
  movzbl 0x40(%rsp,%rdi,1),%eax
  mov    %al,(%rbx)
  add    $0x1,%rbx
  cmp    %r13,%rbx
  jne    L74
  movzbl 0x2e(%rsp),%eax
  shl    $0x4,%eax
  or     0x2f(%rsp),%al
  mov    %al,(%r11)
  add    $0x1,%r11
  cmp    %r12,%r11
  jne    L22
L17:
  mov    0x58(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L10
  mov    $0x0,%eax
  add    $0x68,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
L10:
  call   <__stack_chk_fail@plt>
```

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;
}
```