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

```asm
<main>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x18,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x8(%rsp)
  xor    %eax,%eax
  mov    $0x7d0,%edi
  call   <malloc@plt>
  mov    %rax,%rbp
  movl   $0x1,0x4(%rsp)
  lea    0x4(%rsp),%rsi
  lea    D14(%rip),%rdi
  mov    $0x0,%eax
  call   <scanf@plt>
  cmpl   $0x0,0x4(%rsp)
  jle    L141
  mov    $0x0,%r12d
  lea    D0(%rip),%r14
  mov    $0x0,%ebx
  lea    D26(%rip),%r13
  jmp    L156
L105:
  mov    $0x0,%r9d
L153:
  mov    %r9d,%esi
  mov    %r13,%rdi
  call   <printf@plt>
  add    $0x1,%r12d
  cmp    %r12d,0x4(%rsp)
  jle    L141
L156:
  mov    %rbp,%rsi
  mov    %r14,%rdi
  mov    $0x0,%eax
  call   <scanf@plt>
  movzbl 0x0(%rbp),%eax
  test   %al,%al
  je     L105
  lea    0x1(%rbp),%rsi
  mov    $0x0,%r9d
  mov    %ebx,%edi
  mov    %ebx,%ecx
  mov    $0x31,%edx
  mov    $0x31,%r8d
  mov    $0x1,%r10d
  mov    $0x30,%r11d
  jmp    L155
L141:
  mov    0x8(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L88
  mov    $0x0,%eax
  add    $0x18,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L69:
  mov    %ebx,%edi
  mov    %ebx,%ecx
L82:
  movzbl (%rsi),%eax
  test   %al,%al
  je     L153
  test   %ecx,%ecx
  mov    %r8d,%r15d
  lea    0x30(%rdi),%edx
  cmove  %r15d,%edx
L113:
  add    $0x1,%rsi
L155:
  lea    -0x61(%rax),%r15d
  cmp    $0x19,%r15b
  jbe    L69
  cmp    %al,%dl
  sete   %al
  test   %ecx,%ecx
  jne    L45
  test   %al,%al
  jne    L47
L45:
  and    %ecx,%eax
  test   %edi,%edi
  jne    L123
  test   %al,%al
  jne    L166
L123:
  test   %edi,%edi
  je     L82
  test   %al,%al
  je     L82
  add    $0x1,%r9d
  movzbl (%rsi),%eax
  test   %al,%al
  je     L153
  mov    %ebx,%edi
  mov    %r10d,%ecx
  mov    %r11d,%edx
  jmp    L113
L47:
  mov    %ebx,%edi
  mov    %r10d,%ecx
  jmp    L82
L166:
  mov    %r10d,%edi
  mov    %r10d,%ecx
  jmp    L82
L88:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: disassemble_data
arguments: tag: D14
type: string
name: disassemble_data
arguments: tag: D0
type: string
name: disassemble_data
arguments: tag: D26
type: string

tool: D14: %d

tool: D0: %s

tool: D26: %d


assistant: ```c
int main() {
  char *str = (char *)malloc(sizeof(char) * 2000);
  char nextChar = '1';
  int fa = 0, fb = 0, fc = 0;
  int i = 0, count = 0, t = 1, y = 0;
  scanf("%d", &t);
  while (y++ < t) {
    fa = 0, fb = 0, fc = 0;
    count = 0, i = 0;
    scanf("%s", str);
    while (str[i] != '\0') {
      if (fa == 0) {
        nextChar = '1';
      } else if (fa == 1 && fb == 0) {
        nextChar = '0';
      } else if (fa == 1 && fb == 1) {
        nextChar = '1';
      }
      if (str[i] >= 97 && str[i] <= 122) {
        fa = 0;
        fb = 0;
        fc = 0;
      } else if (fa == 0 && str[i] == nextChar) {
        fa = 1;
        fb = 0;
        fc = 0;
      } else if (fa == 1 && fb == 0 && str[i] == nextChar) {
        fa = 1;
        fb = 1;
        fc = 0;
      } else if (fa == 1 && fb == 1 && fc == 0 && str[i] == nextChar) {
        fa = 1;
        fb = 1;
        fc = 1;
      }
      if (fa == 1 && fb == 1 && fc == 1) {
        count++;
        fa = 1;
        fb = 0;
        fc = 0;
      }
      i++;
    }
    printf("%d\n", count);
  }
  return 0;
}
```