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

```asm
<prs_decompress_size>:
  endbr64
  mov    (%rdi),%r8d
  lea    0x4(%rdi),%rdx
  xor    %eax,%eax
  mov    $0x9,%esi
  mov    $0x4,%r9d
  nopl   0x0(%rax,%rax,1)
L53:
  mov    %esi,%ecx
  sub    $0x1,%ecx
  jne    L60
L131:
  mov    (%rdx),%r8d
  add    $0x4,%rdx
  mov    %r8d,%edi
  sar    %edi
  test   $0x1,%r8b
  jne    L161
  sar    $0x2,%r8d
  test   $0x1,%dil
  je     L132
  mov    $0x7,%esi
L48:
  mov    0x4(%rdx),%edi
  mov    (%rdx),%ecx
  shl    $0x8,%edi
  or     %ecx,%edi
  je     L19
  and    $0x7,%ecx
  je     L192
  add    $0x8,%rdx
  add    $0x2,%ecx
L30:
  movslq %ecx,%rdi
  shl    $0x2,%rdi
  test   %ecx,%ecx
  mov    %esi,%ecx
  cmovle %r9,%rdi
  add    %rdi,%rax
  sub    $0x1,%ecx
  je     L131
L60:
  mov    %r8d,%edi
  sar    %edi
  test   $0x1,%r8b
  jne    L207
  mov    %esi,%r10d
  sub    $0x2,%r10d
  jne    L122
  mov    (%rdx),%ecx
  mov    $0x8,%esi
  add    $0x4,%rdx
  mov    %ecx,%r8d
  sar    %r8d
  test   $0x1,%cl
  jne    L48
  mov    %ecx,%edi
  mov    %rdx,%r11
  mov    %r8d,%ecx
  mov    $0x6,%esi
  sar    $0x2,%edi
  nopl   (%rax)
L107:
  add    %ecx,%ecx
  mov    %edi,%r8d
  lea    0x4(%r11),%rdx
  and    $0x1,%edi
  and    $0x2,%ecx
  sar    %r8d
  or     %edi,%ecx
  add    $0x2,%ecx
  jmp    L30
  nopl   0x0(%rax)
L192:
  mov    0x8(%rdx),%ecx
  add    $0xc,%rdx
  test   %ecx,%ecx
  js     L53
  add    $0x1,%ecx
  jmp    L30
  nop
L207:
  mov    %edi,%r8d
  mov    %ecx,%esi
L126:
  add    $0x4,%rdx
  add    $0x4,%rax
  jmp    L53
  nopw   0x0(%rax,%rax,1)
L161:
  mov    %edi,%r8d
  mov    $0x8,%esi
  jmp    L126
  nopw   0x0(%rax,%rax,1)
L19:
  sar    $0x2,%rax
  ret
L122:
  mov    %r8d,%ecx
  sar    $0x2,%ecx
  test   $0x1,%dil
  je     L112
  mov    %ecx,%r8d
  mov    %r10d,%esi
  jmp    L48
  nopl   0x0(%rax)
L112:
  lea    0x4(%rdx),%r11
  cmp    $0x1,%r10d
  jne    L188
  mov    (%rdx),%ecx
  mov    $0x7,%esi
  mov    %ecx,%edi
  sar    %edi
  jmp    L107
L188:
  sub    $0x4,%esi
  jne    L13
  mov    (%rdx),%edi
  mov    $0x8,%esi
  jmp    L107
L132:
  mov    %r8d,%ecx
  mov    $0x5,%esi
L13:
  sar    $0x2,%edi
  mov    %rdx,%r11
  jmp    L107
```

assistant: ```c
uint32_t prs_decompress_size(void *source) {
  uint32_t r0, r3, r5, r6, r9;
  uint32_t bitpos = 9;
  uint8_t *sourceptr = (uint8_t *)source;
  uint8_t *destptr = NULL;
  uint8_t *destptr_orig = NULL;
  uint8_t currentbyte, lastbyte;
  bool flag;
  int offset;
  uint32_t x, t;
  currentbyte = sourceptr[0];
  sourceptr++;
  for (;;) {
    bitpos--;
    if (bitpos == 0) {
      lastbyte = currentbyte = sourceptr[0];
      bitpos = 8;
      sourceptr++;
    }
    flag = currentbyte & 1;
    currentbyte = currentbyte >> 1;
    if (flag) {
      sourceptr++;
      destptr++;
      continue;
    }
    bitpos--;
    if (bitpos == 0) {
      lastbyte = currentbyte = sourceptr[0];
      bitpos = 8;
      sourceptr++;
    }
    flag = currentbyte & 1;
    currentbyte = currentbyte >> 1;
    if (flag) {
      r3 = sourceptr[0];
      offset = (sourceptr[1] << 8) | r3;
      sourceptr += 2;
      if (offset == 0) {
        return (uint32_t)(destptr - destptr_orig);
      }
      r3 = r3 & 0x00000007;
      r5 = (offset >> 3) | 0xFFFFE000;
      if (r3 == 0) {
        r3 = sourceptr[0];
        sourceptr++;
        r3++;
      } else {
        r3 += 2;
      }
      r5 += (uint32_t)destptr;
    } else {
      r3 = 0;
      for (x = 0; x < 2; x++) {
        bitpos--;
        if (bitpos == 0) {
          lastbyte = currentbyte = sourceptr[0];
          bitpos = 8;
          sourceptr++;
        }
        flag = currentbyte & 1;
        currentbyte = currentbyte >> 1;
        offset = r3 << 1;
        r3 = offset | flag;
      }
      offset = sourceptr[0] | 0xFFFFFF00;
      r3 += 2;
      sourceptr++;
      r5 = offset + (uint32_t)destptr;
    }
    if (r3 == 0) {
      continue;
    }
    t = r3;
    for (x = 0; x < t; x++) {
      r5++;
      r3++;
      destptr++;
    }
  }
}
```