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

```asm
<main>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  lea    -0x18000(%rsp),%r11
L21:
  sub    $0x1000,%rsp
  orq    $0x0,(%rsp)
  cmp    %r11,%rsp
  jne    L21
  sub    $0x6d0,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  lea    -0x186d0(%rbp),%rax
  mov    %rax,%rsi
  lea    D26(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <scanf@plt>
  jmp    L89
L246:
  lea    -0x186b0(%rbp),%rax
  mov    %rax,%rsi
  lea    D29(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <scanf@plt>
  movl   $0x0,-0x186cc(%rbp)
  jmp    L209
L20:
  addl   $0x1,-0x186cc(%rbp)
L209:
  mov    -0x186cc(%rbp),%eax
  cltq
  movzbl -0x186b0(%rbp,%rax,1),%eax
  test   %al,%al
  jne    L20
  mov    -0x186cc(%rbp),%eax
  mov    %eax,-0x186bc(%rbp)
  movl   $0x0,-0x186c4(%rbp)
  movl   $0x1,-0x186c0(%rbp)
  movl   $0x0,-0x186cc(%rbp)
  mov    -0x186bc(%rbp),%eax
  sub    $0x1,%eax
  mov    %eax,-0x186c8(%rbp)
  jmp    L57
L177:
  mov    -0x186cc(%rbp),%eax
  cmp    -0x186c8(%rbp),%eax
  jle    L66
  addl   $0x1,-0x186c0(%rbp)
  movl   $0x0,-0x186cc(%rbp)
  mov    -0x186bc(%rbp),%eax
  sub    $0x1,%eax
  mov    %eax,-0x186c8(%rbp)
  jmp    L57
L66:
  mov    -0x186cc(%rbp),%eax
  cltq
  movzbl -0x186b0(%rbp,%rax,1),%eax
  cmp    $0x63,%al
  jne    L106
  mov    -0x186bc(%rbp),%edx
  mov    -0x186cc(%rbp),%ecx
  lea    -0x186b0(%rbp),%rax
  mov    %ecx,%esi
  mov    %rax,%rdi
  call   <next_right@plt>
  mov    %eax,-0x186cc(%rbp)
  jmp    L57
L106:
  mov    -0x186c8(%rbp),%eax
  cltq
  movzbl -0x186b0(%rbp,%rax,1),%eax
  cmp    $0x63,%al
  jne    L158
  mov    -0x186bc(%rbp),%edx
  mov    -0x186c8(%rbp),%ecx
  lea    -0x186b0(%rbp),%rax
  mov    %ecx,%esi
  mov    %rax,%rdi
  call   <next_left@plt>
  mov    %eax,-0x186c8(%rbp)
  jmp    L57
L158:
  mov    -0x186cc(%rbp),%eax
  cltq
  movzbl -0x186b0(%rbp,%rax,1),%edx
  mov    -0x186c8(%rbp),%eax
  cltq
  movzbl -0x186b0(%rbp,%rax,1),%eax
  cmp    %al,%dl
  jne    L14
  mov    -0x186cc(%rbp),%eax
  cltq
  movb   $0x63,-0x186b0(%rbp,%rax,1)
  mov    -0x186c8(%rbp),%eax
  cltq
  movb   $0x63,-0x186b0(%rbp,%rax,1)
  mov    -0x186bc(%rbp),%edx
  mov    -0x186cc(%rbp),%ecx
  lea    -0x186b0(%rbp),%rax
  mov    %ecx,%esi
  mov    %rax,%rdi
  call   <next_right@plt>
  mov    %eax,-0x186cc(%rbp)
  mov    -0x186bc(%rbp),%edx
  mov    -0x186c8(%rbp),%ecx
  lea    -0x186b0(%rbp),%rax
  mov    %ecx,%esi
  mov    %rax,%rdi
  call   <next_left@plt>
  mov    %eax,-0x186c8(%rbp)
  addl   $0x1,-0x186c4(%rbp)
  mov    -0x186cc(%rbp),%eax
  cmp    -0x186c8(%rbp),%eax
  je     L57
  addl   $0x1,-0x186c4(%rbp)
  jmp    L57
L14:
  mov    -0x186bc(%rbp),%edx
  mov    -0x186cc(%rbp),%ecx
  lea    -0x186b0(%rbp),%rax
  mov    %ecx,%esi
  mov    %rax,%rdi
  call   <next_right@plt>
  mov    %eax,-0x186b8(%rbp)
  mov    -0x186b8(%rbp),%eax
  cmp    -0x186bc(%rbp),%eax
  jl     L136
  mov    -0x186b8(%rbp),%eax
  mov    %eax,-0x186cc(%rbp)
  jmp    L57
L136:
  mov    -0x186b8(%rbp),%eax
  cltq
  movzbl -0x186b0(%rbp,%rax,1),%edx
  mov    -0x186c8(%rbp),%eax
  cltq
  movzbl -0x186b0(%rbp,%rax,1),%eax
  cmp    %al,%dl
  jne    L179
  mov    -0x186b8(%rbp),%eax
  mov    %eax,-0x186cc(%rbp)
  jmp    L57
L179:
  mov    -0x186bc(%rbp),%edx
  mov    -0x186c8(%rbp),%ecx
  lea    -0x186b0(%rbp),%rax
  mov    %ecx,%esi
  mov    %rax,%rdi
  call   <next_left@plt>
  mov    %eax,-0x186b4(%rbp)
  cmpl   $0x0,-0x186b4(%rbp)
  jns    L150
  mov    -0x186b4(%rbp),%eax
  mov    %eax,-0x186c8(%rbp)
  jmp    L57
L150:
  mov    -0x186cc(%rbp),%eax
  cltq
  movzbl -0x186b0(%rbp,%rax,1),%edx
  mov    -0x186b4(%rbp),%eax
  cltq
  movzbl -0x186b0(%rbp,%rax,1),%eax
  cmp    %al,%dl
  jne    L171
  mov    -0x186b4(%rbp),%eax
  mov    %eax,-0x186c8(%rbp)
  jmp    L57
L171:
  mov    -0x186b8(%rbp),%eax
  mov    %eax,-0x186cc(%rbp)
  mov    -0x186b4(%rbp),%eax
  mov    %eax,-0x186c8(%rbp)
L57:
  mov    -0x186c4(%rbp),%eax
  cmp    -0x186bc(%rbp),%eax
  jl     L177
  mov    -0x186c0(%rbp),%eax
  mov    %eax,%esi
  lea    D5(%rip),%rax
  mov    %rax,%rdi
  call   <printf@plt>
L89:
  mov    -0x186d0(%rbp),%eax
  lea    -0x1(%rax),%edx
  mov    %edx,-0x186d0(%rbp)
  test   %eax,%eax
  jg     L246
  mov    $0x0,%eax
  mov    -0x8(%rbp),%rdx
  sub    %fs:0x28,%rdx
  je     L54
  call   <__stack_chk_fail@plt>
L54:
  leave
  ret
```

tool_calls: name: unpack_data
arguments: label: D26
type_guessed: string
name: unpack_data
arguments: label: D29
type_guessed: string
name: unpack_data
arguments: label: D5
type_guessed: string

tool: D26: %d

tool: D29: %s

tool: D5: %d


assistant: ```c
int main() {
  int t, i, j, len, count, ans, ni, nj;
  char H[100001];
  scanf("%d", &t);
  while (t-- > 0) {
    scanf("%s", H);
    for (i = 0; H[i] != '\0'; i++)
      ;
    len = i;
    count = 0;
    ans = 1;
    for (i = 0, j = len - 1; count < len;) {
      if (i > j) {
        ans++;
        i = 0;
        j = len - 1;
        continue;
      }
      if (H[i] == 'c') {
        i = next_right(H, i, len);
        continue;
      }
      if (H[j] == 'c') {
        j = next_left(H, j, len);
        continue;
      }
      if (H[i] == H[j]) {
        H[i] = 'c';
        H[j] = 'c';
        i = next_right(H, i, len);
        j = next_left(H, j, len);
        count++;
        if (i != j)
          count++;
        continue;
      }
      ni = next_right(H, i, len);
      if (ni >= len) {
        i = ni;
        continue;
      }
      if (H[ni] == H[j]) {
        i = ni;
        continue;
      }
      nj = next_left(H, j, len);
      if (nj < 0) {
        j = nj;
        continue;
      }
      if (H[i] == H[nj]) {
        j = nj;
        continue;
      }
      i = ni;
      j = nj;
    }
    printf("%d\n", ans);
  }
  return 0;
}
```