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

```asm
<luminousarc>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x90,%rsp
  mov    %rdi,-0x78(%rbp)
  mov    %esi,-0x7c(%rbp)
  mov    %rdx,-0x88(%rbp)
  mov    %ecx,-0x80(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  mov    %rsp,%rax
  mov    %rax,%rsi
  movl   $0x0,-0x60(%rbp)
  movl   $0x0,-0x5c(%rbp)
  movl   $0x1004,-0x40(%rbp)
  mov    -0x40(%rbp),%eax
  movslq %eax,%rdx
  sub    $0x1,%rdx
  mov    %rdx,-0x18(%rbp)
  movslq %eax,%rdx
  mov    %rdx,%r10
  mov    $0x0,%r11d
  movslq %eax,%rdx
  mov    %rdx,%r8
  mov    $0x0,%r9d
  cltq
  mov    $0x10,%edx
  sub    $0x1,%rdx
  add    %rdx,%rax
  mov    $0x10,%edi
  mov    $0x0,%edx
  div    %rdi
  imul   $0x10,%rax,%rax
  mov    %rax,%rcx
  and    $0xfffffffffffff000,%rcx
  mov    %rsp,%rdx
  sub    %rcx,%rdx
L49:
  cmp    %rdx,%rsp
  je     L159
  sub    $0x1000,%rsp
  orq    $0x0,0xff8(%rsp)
  jmp    L49
L159:
  mov    %rax,%rdx
  and    $0xfff,%edx
  sub    %rdx,%rsp
  mov    %rax,%rdx
  and    $0xfff,%edx
  test   %rdx,%rdx
  je     L317
  and    $0xfff,%eax
  sub    $0x8,%rax
  add    %rsp,%rax
  orq    $0x0,(%rax)
L317:
  mov    %rsp,%rax
  add    $0x0,%rax
  mov    %rax,-0x10(%rbp)
  movl   $0x0,-0x58(%rbp)
  movl   $0x0,-0x54(%rbp)
  movl   $0x0,-0x50(%rbp)
  movl   $0x3,-0x4c(%rbp)
  jmp    L456
L495:
  cmpl   $0x3,-0x4c(%rbp)
  jne    L111
  mov    -0x5c(%rbp),%eax
  cmp    -0x7c(%rbp),%eax
  jl     L505
  mov    $0xffffffff,%eax
  jmp    L494
L505:
  mov    -0x5c(%rbp),%eax
  lea    0x1(%rax),%edx
  mov    %edx,-0x5c(%rbp)
  movslq %eax,%rdx
  mov    -0x78(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  movzbl %al,%eax
  mov    %eax,-0x50(%rbp)
  cmpl   $0x0,-0x50(%rbp)
  jns    L149
  mov    $0xffffffff,%eax
  jmp    L494
L149:
  movl   $0xc0,-0x4c(%rbp)
  jmp    L474
L111:
  sarl   $0x2,-0x4c(%rbp)
  sarl   $0x2,-0x50(%rbp)
L474:
  mov    -0x50(%rbp),%eax
  and    $0x3,%eax
  cmp    $0x3,%eax
  je     L188
  cmp    $0x3,%eax
  jg     L482
  cmp    $0x2,%eax
  je     L440
  cmp    $0x2,%eax
  jg     L482
  test   %eax,%eax
  je     L365
  cmp    $0x1,%eax
  je     L429
  jmp    L482
L365:
  mov    -0x5c(%rbp),%eax
  add    $0x1,%eax
  cmp    %eax,-0x7c(%rbp)
  jg     L393
  mov    $0xffffffff,%eax
  jmp    L494
L393:
  mov    -0x5c(%rbp),%eax
  lea    0x1(%rax),%edx
  mov    %edx,-0x5c(%rbp)
  movslq %eax,%rdx
  mov    -0x78(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  movzbl %al,%eax
  mov    %eax,-0x28(%rbp)
  mov    -0x5c(%rbp),%eax
  lea    0x1(%rax),%edx
  mov    %edx,-0x5c(%rbp)
  movslq %eax,%rdx
  mov    -0x78(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  movzbl %al,%eax
  mov    %eax,-0x24(%rbp)
  cmpl   $0x0,-0x24(%rbp)
  jns    L166
  mov    $0xffffffff,%eax
  jmp    L494
L166:
  mov    -0x24(%rbp),%eax
  sar    $0x4,%eax
  mov    %eax,-0x20(%rbp)
  addl   $0x3,-0x20(%rbp)
  mov    -0x24(%rbp),%eax
  shl    $0x8,%eax
  and    $0xf00,%eax
  or     -0x28(%rbp),%eax
  mov    %eax,-0x1c(%rbp)
  addl   $0x5,-0x1c(%rbp)
  mov    -0x1c(%rbp),%eax
  cmp    -0x54(%rbp),%eax
  jle    L387
  mov    $0xffffffff,%eax
  jmp    L494
L387:
  mov    -0x58(%rbp),%edx
  mov    -0x40(%rbp),%eax
  add    %edx,%eax
  sub    -0x1c(%rbp),%eax
  mov    %eax,-0x48(%rbp)
  movl   $0x0,-0x64(%rbp)
  jmp    L285
L289:
  mov    -0x48(%rbp),%eax
  cltd
  idivl  -0x40(%rbp)
  mov    %edx,%eax
  mov    -0x10(%rbp),%rdx
  cltq
  movzbl (%rdx,%rax,1),%eax
  mov    %al,-0x65(%rbp)
  addl   $0x1,-0x48(%rbp)
  mov    -0x60(%rbp),%eax
  lea    0x1(%rax),%edx
  mov    %edx,-0x60(%rbp)
  movslq %eax,%rdx
  mov    -0x88(%rbp),%rax
  add    %rax,%rdx
  movzbl -0x65(%rbp),%eax
  mov    %al,(%rdx)
  mov    -0x10(%rbp),%rdx
  mov    -0x58(%rbp),%eax
  cltq
  movzbl -0x65(%rbp),%ecx
  mov    %cl,(%rdx,%rax,1)
  mov    -0x58(%rbp),%eax
  add    $0x1,%eax
  cltd
  idivl  -0x40(%rbp)
  mov    %edx,-0x58(%rbp)
  addl   $0x1,-0x64(%rbp)
L285:
  mov    -0x64(%rbp),%eax
  cmp    -0x20(%rbp),%eax
  jl     L289
  mov    -0x20(%rbp),%eax
  add    %eax,-0x54(%rbp)
  jmp    L456
L429:
  mov    -0x5c(%rbp),%eax
  cmp    -0x7c(%rbp),%eax
  jl     L53
  mov    $0xffffffff,%eax
  jmp    L494
L53:
  mov    -0x5c(%rbp),%eax
  lea    0x1(%rax),%edx
  mov    %edx,-0x5c(%rbp)
  movslq %eax,%rdx
  mov    -0x78(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  movzbl %al,%eax
  mov    %eax,-0x34(%rbp)
  cmpl   $0x0,-0x34(%rbp)
  jns    L346
  mov    $0xffffffff,%eax
  jmp    L494
L346:
  mov    -0x34(%rbp),%eax
  sar    $0x2,%eax
  mov    %eax,-0x30(%rbp)
  addl   $0x2,-0x30(%rbp)
  mov    -0x34(%rbp),%eax
  and    $0x3,%eax
  mov    %eax,-0x2c(%rbp)
  addl   $0x1,-0x2c(%rbp)
  mov    -0x2c(%rbp),%eax
  cmp    -0x54(%rbp),%eax
  jle    L309
  mov    $0xffffffff,%eax
  jmp    L494
L309:
  mov    -0x58(%rbp),%edx
  mov    -0x40(%rbp),%eax
  add    %edx,%eax
  sub    -0x2c(%rbp),%eax
  mov    %eax,-0x44(%rbp)
  movl   $0x0,-0x64(%rbp)
  jmp    L91
L107:
  mov    -0x44(%rbp),%eax
  cltd
  idivl  -0x40(%rbp)
  mov    %edx,%eax
  mov    -0x10(%rbp),%rdx
  cltq
  movzbl (%rdx,%rax,1),%eax
  mov    %al,-0x66(%rbp)
  addl   $0x1,-0x44(%rbp)
  mov    -0x60(%rbp),%eax
  lea    0x1(%rax),%edx
  mov    %edx,-0x60(%rbp)
  movslq %eax,%rdx
  mov    -0x88(%rbp),%rax
  add    %rax,%rdx
  movzbl -0x66(%rbp),%eax
  mov    %al,(%rdx)
  mov    -0x10(%rbp),%rdx
  mov    -0x58(%rbp),%eax
  cltq
  movzbl -0x66(%rbp),%ecx
  mov    %cl,(%rdx,%rax,1)
  mov    -0x58(%rbp),%eax
  add    $0x1,%eax
  cltd
  idivl  -0x40(%rbp)
  mov    %edx,-0x58(%rbp)
  addl   $0x1,-0x64(%rbp)
L91:
  mov    -0x64(%rbp),%eax
  cmp    -0x30(%rbp),%eax
  jl     L107
  mov    -0x30(%rbp),%eax
  add    %eax,-0x54(%rbp)
  jmp    L456
L440:
  mov    -0x5c(%rbp),%eax
  cmp    -0x7c(%rbp),%eax
  jl     L180
  mov    $0xffffffff,%eax
  jmp    L494
L180:
  mov    -0x5c(%rbp),%eax
  lea    0x1(%rax),%edx
  mov    %edx,-0x5c(%rbp)
  movslq %eax,%rdx
  mov    -0x78(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  movzbl %al,%eax
  mov    %eax,-0x38(%rbp)
  cmpl   $0x0,-0x38(%rbp)
  jns    L357
  mov    $0xffffffff,%eax
  jmp    L494
L357:
  addl   $0x1,-0x54(%rbp)
  mov    -0x60(%rbp),%eax
  lea    0x1(%rax),%edx
  mov    %edx,-0x60(%rbp)
  movslq %eax,%rdx
  mov    -0x88(%rbp),%rax
  add    %rdx,%rax
  mov    -0x38(%rbp),%edx
  mov    %dl,(%rax)
  mov    -0x38(%rbp),%eax
  mov    %eax,%ecx
  mov    -0x10(%rbp),%rdx
  mov    -0x58(%rbp),%eax
  cltq
  mov    %cl,(%rdx,%rax,1)
  mov    -0x58(%rbp),%eax
  add    $0x1,%eax
  cltd
  idivl  -0x40(%rbp)
  mov    %edx,-0x58(%rbp)
  jmp    L456
L188:
  movl   $0x0,-0x64(%rbp)
  jmp    L113
L398:
  mov    -0x5c(%rbp),%eax
  cmp    -0x7c(%rbp),%eax
  jl     L35
  mov    $0xffffffff,%eax
  jmp    L494
L35:
  mov    -0x5c(%rbp),%eax
  lea    0x1(%rax),%edx
  mov    %edx,-0x5c(%rbp)
  movslq %eax,%rdx
  mov    -0x78(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  movzbl %al,%eax
  mov    %eax,-0x3c(%rbp)
  cmpl   $0x0,-0x3c(%rbp)
  jns    L324
  mov    $0xffffffff,%eax
  jmp    L494
L324:
  addl   $0x1,-0x54(%rbp)
  mov    -0x60(%rbp),%eax
  lea    0x1(%rax),%edx
  mov    %edx,-0x60(%rbp)
  movslq %eax,%rdx
  mov    -0x88(%rbp),%rax
  add    %rdx,%rax
  mov    -0x3c(%rbp),%edx
  mov    %dl,(%rax)
  mov    -0x3c(%rbp),%eax
  mov    %eax,%ecx
  mov    -0x10(%rbp),%rdx
  mov    -0x58(%rbp),%eax
  cltq
  mov    %cl,(%rdx,%rax,1)
  mov    -0x58(%rbp),%eax
  add    $0x1,%eax
  cltd
  idivl  -0x40(%rbp)
  mov    %edx,-0x58(%rbp)
  addl   $0x1,-0x64(%rbp)
L113:
  cmpl   $0x2,-0x64(%rbp)
  jle    L398
  jmp    L456
L482:
  mov    $0xffffffff,%eax
  jmp    L494
L456:
  mov    -0x54(%rbp),%eax
  cmp    -0x80(%rbp),%eax
  jl     L495
  mov    -0x5c(%rbp),%eax
  cmp    -0x7c(%rbp),%eax
  jge    L117
  mov    -0x5c(%rbp),%eax
  and    $0xfffffffc,%eax
  add    $0x4,%eax
  cmp    %eax,-0x7c(%rbp)
  jle    L117
  mov    $0xffffffff,%eax
  jmp    L494
L117:
  mov    -0x60(%rbp),%eax
L494:
  mov    %rsi,%rsp
  mov    -0x8(%rbp),%rdx
  sub    %fs:0x28,%rdx
  je     L209
  call   <__stack_chk_fail@plt>
L209:
  leave
  ret
```

assistant: ```c
int luminousarc(unsigned char *instream, int inLength, unsigned char *outstream, int decompressedSize) {
  int i, o = 0;
  int readBytes = 0;
  int bufferLength = 0xFFF + 5;
  unsigned char buffer[bufferLength];
  int bufferOffset = 0;
  int currentOutSize = 0;
  int flags = 0, mask = 3;
  while (currentOutSize < decompressedSize) {
    if (mask == 3) {
      if (readBytes >= inLength)
        return (-1);
      flags = instream[readBytes++];
      if (flags < 0)
        return (-1);
      mask = 0xC0;
    } else {
      mask >>= 2;
      flags >>= 2;
    }
    switch (flags & 0x3) {
    case 0: {
      if (readBytes + 1 >= inLength) {
        return (-1);
      }
      int byte1 = instream[readBytes++];
      int byte2 = instream[readBytes++];
      if (byte2 < 0)
        return (-1);
      int length = byte2 >> 4;
      length += 3;
      int disp = ((byte2 & 0x0F) << 8) | byte1;
      disp += 5;
      if (disp > currentOutSize)
        return (-1);
      int bufIdx = bufferOffset + bufferLength - disp;
      for (i = 0; i < length; i++) {
        unsigned char next = buffer[bufIdx % bufferLength];
        bufIdx++;
        outstream[o++] = next;
        buffer[bufferOffset] = next;
        bufferOffset = (bufferOffset + 1) % bufferLength;
      }
      currentOutSize += length;
      break;
    }
    case 1: {
      if (readBytes >= inLength) {
        return (-1);
      }
      int b = instream[readBytes++];
      if (b < 0)
        return (-1);
      int length = b >> 2;
      length += 2;
      int disp = (b & 0x03);
      disp += 1;
      if (disp > currentOutSize)
        return (-1);
      int bufIdx = bufferOffset + bufferLength - disp;
      for (i = 0; i < length; i++) {
        unsigned char next = buffer[bufIdx % bufferLength];
        bufIdx++;
        outstream[o++] = next;
        buffer[bufferOffset] = next;
        bufferOffset = (bufferOffset + 1) % bufferLength;
      }
      currentOutSize += length;
      break;
    }
    case 2: {
      if (readBytes >= inLength)
        return (-1);
      int next = instream[readBytes++];
      if (next < 0)
        return (-1);
      currentOutSize++;
      outstream[o++] = next;
      buffer[bufferOffset] = (unsigned char)next;
      bufferOffset = (bufferOffset + 1) % bufferLength;
      break;
    }
    case 3: {
      for (i = 0; i < 3; i++) {
        if (readBytes >= inLength)
          return (-1);
        int next = instream[readBytes++];
        if (next < 0)
          return (-1);
        currentOutSize++;
        outstream[o++] = next;
        buffer[bufferOffset] = (unsigned char)next;
        bufferOffset = (bufferOffset + 1) % bufferLength;
      }
      break;
    }
    default:
      return (-1);
    }
  }
  if (readBytes < inLength) {
    if ((readBytes ^ (readBytes & 3)) + 4 < inLength)
      return (-1);
  }
  return (o);
}
```