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

```asm
<_>:
  endbr64
  push   %r12
  push   %rbx
  movslq %edi,%rbx
  sub    $0x8,%rsp
  mov    0x90218,%edi
  cmp    $0x1,%esi
  jne    L121
  mov    0x901f0,%r12d
  add    %r12d,%ebx
  mov    %ebx,0x901f0
L3:
  add    $0x8,%rsp
  mov    %r12d,%eax
  pop    %rbx
  pop    %r12
  ret
  nopw   0x0(%rax,%rax,1)
L121:
  lea    -0x2(%rsi),%eax
  mov    %esi,%r8d
  test   %eax,%eax
  jne    L153
  lea    0x7c(%rbx),%rax
  mov    %edi,%r12d
  add    $0x87,%rbx
  nopl   0x0(%rax,%rax,1)
L91:
  mov    (%rax),%edx
  shl    $0x3,%r12d
  add    $0x1,%rax
  and    $0x7,%edx
  or     %edx,%r12d
  cmp    %rax,%rbx
  jne    L91
  add    $0x8,%rsp
  mov    %r12d,%eax
  pop    %rbx
  pop    %r12
  ret
L153:
  jle    L167
  movslq %edi,%rax
  mov    %edi,%r12d
  movzbl (%rax),%edx
  test   %dl,%dl
  je     L111
  xor    %ecx,%ecx
L122:
  lea    (%rcx,%rbx,1),%eax
  cltq
  cmp    %dl,(%rax)
  jne    L42
  add    $0x1,%ecx
  lea    (%r12,%rcx,1),%eax
L11:
  cltq
  movzbl (%rax),%edx
  test   %dl,%dl
  jne    L122
L111:
  cmp    $0x3,%r8d
  jne    L3
  movslq %r12d,%rax
  mov    (%rax),%eax
  test   %eax,%eax
  je     L3
  xor    %edx,%edx
  mov    $0x1,%esi
  mov    $0xa4,%edi
  call   <_>
  mov    0x901f4,%edx
  mov    $0x40,%esi
  movslq %eax,%rdi
  lea    0x8(%rdi),%eax
  mov    %rdi,%r9
  cltq
  mov    %edx,(%rax)
  lea    0x4(%rdi),%eax
  lea    0x40(%rdi),%edx
  cltq
  mov    %edi,0x901f4
  mov    %edx,(%rax)
  movslq %ebx,%rax
  lea    0x60(%rax),%r8
  sub    %rax,%rsi
  xchg   %ax,%ax
L76:
  mov    (%rax),%ecx
  lea    (%rax,%rsi,1),%rdx
  add    $0x1,%rax
  mov    %ecx,(%rdx,%rdi,1)
  cmp    %rax,%r8
  jne    L76
  lea    0x220(%r12),%eax
  lea    0x200(%r12),%edx
  cltq
  lea    0x218(%r12),%ecx
  mov    (%rax),%ebx
  movslq %ecx,%rcx
  mov    (%rcx),%esi
  add    %edx,%ebx
  lea    0xc(%rbx),%ecx
  mov    %ebx,%eax
  movslq %ecx,%rcx
  cmp    (%rcx),%esi
  jne    L164
L93:
  add    $0x10,%eax
  mov    $0x1,%esi
  cltq
  add    (%rax),%edx
  movslq %edx,%rax
  xor    %edx,%edx
  mov    %eax,(%rdi)
  mov    %r9d,%edi
  call   *%rax
  jmp    L3
  xchg   %ax,%ax
L42:
  movslq %r12d,%rsi
  mov    %edi,%eax
  lea    0x7c(%rsi),%rdx
  add    $0x87,%rsi
L142:
  mov    (%rdx),%ecx
  shl    $0x3,%eax
  add    $0x1,%rdx
  and    $0x7,%ecx
  or     %ecx,%eax
  cmp    %rdx,%rsi
  jne    L142
  add    $0x3ff,%eax
  xor    %ecx,%ecx
  and    $0xfffffe00,%eax
  add    %eax,%r12d
  mov    %r12d,%eax
  jmp    L11
L164:
  add    $0x28,%eax
  movslq %eax,%rcx
L113:
  mov    0xc(%rcx),%r8d
  mov    %ecx,%eax
  add    $0x28,%rcx
  cmp    %esi,%r8d
  je     L93
  jmp    L113
L167:
  mov    %edi,%r12d
  jmp    L3
```

assistant: ```c
int _(int t, int q, int d) {
  int i = 0, j = 0, n, D = *((int *)(0x90200 + 24));
  if (!--q) {
    *((int *)(0x90200 - 16)) += t;
    D = *((int *)(0x90200 - 16)) - t;
  }
  if (!--q) {
    for (i = 124; i < 135; i++)
      D = D << 3 | *((int *)(t + i)) & 7;
  }
  if (q > 0) {
    for (; n = *((signed char *)(D + i)); i++)
      if (n - *((signed char *)(t + i))) {
        D += _(D, 2, 0) + 1023 & ~511;
        i = ~0;
      }
    if (!--q) {
      if (*((int *)(D))) {
        n = _(164, 1, 0);
        *((int *)(n + 8)) = *((int *)(0x90200 - 12));
        *((int *)(0x90200 - 12)) = n;
        *((int *)(n + 4)) = i = n + 64;
        for (; j < 96; j++)
          *((int *)(i + j)) = *((int *)(t + j));
        i = D + 512;
        j = i + *((int *)(i + 32));
        for (; *((int *)(j + 12)) != *((int *)(i + 24)); j += 40)
          continue;
        ((int (*)(int t, int q, int d))(*((int *)(n)) = *((int *)(j + 16)) + i))(n, 1, 0);
      }
    }
  }
  return D;
}
```