user: Converte this assembly snippet into its equivalent C code:

```asm
<main>:
  endbr64
  push   %r15
  mov    $0x20000,%edx
  lea    D4(%rip),%rsi
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0xb8,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0xa8(%rsp)
  xor    %eax,%eax
  mov    D67(%rip),%rax
  mov    (%rax),%edi
  call   <read@plt>
  xor    %edi,%edi
  cmp    $0x4000,%rax
  mov    %rax,%r15
  setbe  %dil
  call   <assert@plt>
  test   %r15,%r15
  je     L135
L73:
  lea    D4(%rip),%rdi
  lea    -0x1(%r15),%rax
  cmpq   $0x0,-0x8(%rdi,%r15,8)
  jne    L135
  mov    %rax,%r15
  test   %r15,%r15
  jne    L73
L135:
  xor    %r8d,%r8d
  lea    0x38(%rsp),%rdi
  mov    $0xffffffff,%r13d
  xor    %ebx,%ebx
  mov    %rdi,0x20(%rsp)
  mov    %r8d,%edi
  mov    $0xffffffff,%eax
  mov    %r15,%r8
  xor    %r14d,%r14d
  xor    %r9d,%r9d
  mov    %edi,%r15d
  jmp    L140
  nopl   0x0(%rax)
L21:
  mov    %r10d,%r13d
L140:
  mov    %r15d,%r12d
  cmp    %r8,%r12
  je     L74
  lea    D4(%rip),%rdi
  add    $0x1,%r15d
  mov    (%rdi,%r12,8),%rbp
  mov    %ebp,%r10d
L171:
  mov    %r13d,%esi
  lea    0x2(%rbx),%edx
  lea    0x0(,%r14,4),%ecx
  cmp    %rbp,%rax
  je     L211
  cmp    %rsi,%rbp
  jne    L96
L87:
  or     $0x3,%ecx
  mov    %ecx,%r14d
L130:
  mov    %edx,%ebx
  cmp    $0x7,%edx
  ja     L20
L207:
  mov    %r13d,%eax
  cmp    %r8,%r12
  je     10e0 <main.cold>
  jmp    L21
L211:
  mov    %ecx,%r14d
  or     $0x2,%r14d
  cmp    %rsi,%rbp
  je     L87
  mov    %edx,%ebx
  cmp    $0x7,%edx
  jbe    L207
L20:
  sub    $0x8,%ebx
  mov    %r14d,%eax
  xor    %edi,%edi
  mov    %r10d,0x1c(%rsp)
  mov    %ebx,%ecx
  mov    %r8,0x10(%rsp)
  shr    %cl,%eax
  mov    %r9,0x8(%rsp)
  cmp    $0x1,%rax
  mov    %rax,0x38(%rsp)
  setne  %dil
  call   <assert@plt>
  mov    0x20(%rsp),%rsi
  mov    $0x1,%edx
  mov    D56(%rip),%rax
  mov    (%rax),%edi
  call   <write_all@plt>
  mov    0x8(%rsp),%r9
  lea    0x60(%rsp),%rsi
  mov    D56(%rip),%rax
  mov    (%rax),%edi
  mov    %r9d,%edx
  call   <write_all@plt>
  mov    $0x1,%eax
  mov    %ebx,%ecx
  xor    %r9d,%r9d
  shl    %cl,%eax
  mov    0x10(%rsp),%r8
  mov    0x1c(%rsp),%r10d
  sub    $0x1,%eax
  and    %eax,%r14d
  jmp    L207
  nopl   0x0(%rax)
L74:
  test   %ebx,%ebx
  je     L133
  xor    %r10d,%r10d
  xor    %ebp,%ebp
  jmp    L171
  nopw   0x0(%rax,%rax,1)
L96:
  lea    0x40(%rsp),%rsi
  mov    %r13d,%edi
  mov    %r10d,0x1c(%rsp)
  mov    %r8,0x10(%rsp)
  mov    %r9,0x8(%rsp)
  mov    %ecx,0x2c(%rsp)
  mov    %edx,0x28(%rsp)
  call   <opts@plt>
  cmp    0x40(%rsp),%rbp
  mov    0x8(%rsp),%r9
  mov    0x10(%rsp),%r8
  mov    0x1c(%rsp),%r10d
  je     L177
  cmp    0x48(%rsp),%rbp
  je     L201
  cmp    0x50(%rsp),%rbp
  je     L24
  cmp    0x58(%rsp),%rbp
  mov    0x28(%rsp),%edx
  mov    $0x3,%eax
  mov    0x2c(%rsp),%ecx
  je     L48
  mov    %rbp,0x60(%rsp,%r9,8)
  mov    %ecx,%r14d
  add    $0x1,%r9
  jmp    L130
  nopl   0x0(%rax)
L133:
  mov    D56(%rip),%rax
  mov    0x20(%rsp),%rsi
  mov    $0x1,%edx
  movq   $0x1,0x38(%rsp)
  mov    (%rax),%edi
  call   <write_all@plt>
  mov    0xa8(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L190
  add    $0xb8,%rsp
  xor    %eax,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L177:
  xor    %eax,%eax
L48:
  shl    $0x4,%r14d
  lea    0x4(%rbx),%edx
  or     %eax,%r14d
  or     $0x4,%r14d
  jmp    L130
L201:
  mov    $0x1,%eax
  jmp    L48
L24:
  mov    $0x2,%eax
  jmp    L48
L190:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
int main() {
  static uint8_t source[0x4000];
  size_t size = read(STDIN_FILENO, &source, sizeof(source));
  unsigned pos = 0;
  assert(size <= 0x4000);
  while (size && source[size - 1] == 0) {
    size--;
  }
  uint8_t literals[8];
  size_t literals_size = 0;
  unsigned bits = 0;
  unsigned control = 0;
  unsigned prev[2] = {-1, -1};
  while (true) {
    uint8_t byte = 0;
    if (pos == size) {
      if (bits == 0)
        break;
    } else {
      byte = source[pos++];
    }
    if (byte == prev[0] || byte == prev[1]) {
      bits += 2;
      control <<= 1;
      control |= 1;
      control <<= 1;
      if (byte == prev[1]) {
        control |= 1;
      }
    } else {
      bits += 2;
      control <<= 2;
      uint8_t options[4];
      opts(prev[1], options);
      bool found = false;
      for (unsigned i = 0; i < 4; i++) {
        if (options[i] == byte) {
          control |= 1;
          bits += 2;
          control <<= 2;
          control |= i;
          found = true;
          break;
        }
      }
      if (!found) {
        literals[literals_size++] = byte;
      }
    }
    prev[0] = prev[1];
    prev[1] = byte;
    if (bits >= 8) {
      uint8_t outctl = control >> (bits - 8);
      assert(outctl != 1);
      write_all(STDOUT_FILENO, &outctl, 1);
      write_all(STDOUT_FILENO, literals, literals_size);
      bits -= 8;
      control &= (1 << bits) - 1;
      literals_size = 0;
    }
  }
  uint8_t end_byte = 1;
  write_all(STDOUT_FILENO, &end_byte, 1);
  return 0;
}
```