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

```asm
<main>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x50,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  movl   $0x0,-0x48(%rbp)
  lea    -0x4c(%rbp),%rax
  mov    %rax,%rsi
  lea    D50(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <scanf@plt>
  mov    -0x4c(%rbp),%eax
  test   %eax,%eax
  js     L86
  mov    -0x4c(%rbp),%eax
  cmp    $0x14,%eax
  jg     L86
  jmp    L44
L129:
  lea    -0x4d(%rbp),%rax
  mov    %rax,%rsi
  lea    D61(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <scanf@plt>
  movzbl -0x4d(%rbp),%eax
  cmp    $0x20,%al
  je     L188
  lea    D66(%rip),%rax
  mov    %rax,%rdi
  call   <printf@plt>
  mov    $0x1,%eax
  jmp    L19
L188:
  lea    -0x4d(%rbp),%rax
  mov    %rax,%rsi
  lea    D61(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <scanf@plt>
  movzbl -0x4d(%rbp),%eax
  cmp    $0x30,%al
  je     L34
  movzbl -0x4d(%rbp),%eax
  cmp    $0x31,%al
  jne    L223
L34:
  cmpl   $0x0,-0x48(%rbp)
  je     L171
  mov    -0x4c(%rbp),%eax
  sub    $0x1,%eax
  cmp    %eax,-0x48(%rbp)
  jne    L155
L171:
  movzbl -0x4d(%rbp),%eax
  cmp    $0x31,%al
  jne    L155
  lea    D55(%rip),%rax
  mov    %rax,%rdi
  call   <printf@plt>
  mov    $0x1,%eax
  jmp    L19
L155:
  movzbl -0x4d(%rbp),%edx
  mov    -0x48(%rbp),%eax
  cltq
  mov    %dl,-0x40(%rbp,%rax,1)
  addl   $0x1,-0x48(%rbp)
  jmp    L44
L223:
  lea    D41(%rip),%rax
  mov    %rax,%rdi
  call   <printf@plt>
  mov    $0x1,%eax
  jmp    L19
L44:
  mov    -0x4c(%rbp),%eax
  cmp    %eax,-0x48(%rbp)
  jl     L129
  mov    -0x48(%rbp),%eax
  cltq
  movb   $0x0,-0x40(%rbp,%rax,1)
  movl   $0x0,-0x48(%rbp)
  jmp    L114
L146:
  movl   $0x0,-0x44(%rbp)
  jmp    L144
L105:
  mov    -0x44(%rbp),%eax
  cltq
  movzbl -0x40(%rbp,%rax,1),%eax
  cmp    $0x30,%al
  jne    L205
  lea    D88(%rip),%rax
  mov    %rax,%rdi
  call   <printf@plt>
  jmp    L51
L205:
  lea    D89(%rip),%rax
  mov    %rax,%rdi
  call   <printf@plt>
L51:
  addl   $0x1,-0x44(%rbp)
L144:
  mov    -0x4c(%rbp),%eax
  cmp    %eax,-0x44(%rbp)
  jl     L105
  lea    D39(%rip),%rax
  mov    %rax,%rdi
  call   <printf@plt>
  lea    -0x40(%rbp),%rax
  mov    $0x31,%esi
  mov    %rax,%rdi
  call   <strchr@plt>
  test   %rax,%rax
  je     L202
  mov    -0x4c(%rbp),%edx
  lea    -0x20(%rbp),%rcx
  lea    -0x40(%rbp),%rax
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <next_generation@plt>
  addl   $0x1,-0x48(%rbp)
L114:
  cmpl   $0x3e7,-0x48(%rbp)
  jle    L146
  jmp    L86
L202:
  nop
L86:
  mov    $0x0,%eax
L19:
  mov    -0x8(%rbp),%rdx
  sub    %fs:0x28,%rdx
  je     L85
  call   <__stack_chk_fail@plt>
L85:
  leave
  ret
```

tool_calls: name: extract_symbolic_data
arguments: data_label: D50
datatype: string
name: extract_symbolic_data
arguments: data_label: D61
datatype: string
name: extract_symbolic_data
arguments: data_label: D66
datatype: string
name: extract_symbolic_data
arguments: data_label: D55
datatype: string
name: extract_symbolic_data
arguments: data_label: D41
datatype: string
name: extract_symbolic_data
arguments: data_label: D88
datatype: string
name: extract_symbolic_data
arguments: data_label: D89
datatype: string
name: extract_symbolic_data
arguments: data_label: D39
datatype: string

tool: D50: %d

tool: D61: %c

tool: D66: error: Input error! Space expected.

tool: D55: error: Input error! cell chain must start and end with 0.

tool: D41: error: Input error! 0/1 expected.

tool: D88: .

tool: D89: *

tool: D39: 


assistant: ```c
int main() {
  int len, i = 0, j;
  char str[20], nextStr[20], temp;
  scanf("%d", &len);
  if (len >= 0 && len <= 20) {
    while (i < len) {
      scanf("%c", &temp);
      if (temp != ' ') {
        printf("error: Input error! Space expected.");
        return 1;
      }
      scanf("%c", &temp);
      if (temp == '0' || temp == '1') {
        if ((i == 0 || i == (len - 1)) && temp == '1') {
          printf("error: Input error! cell chain must start and end with 0.");
          return 1;
        }
        str[i] = temp;
      } else {
        printf("error: Input error! 0/1 expected.");
        return 1;
      }
      i++;
    }
    str[i] = '\0';
    for (i = 0; i < 1000; i++) {
      for (j = 0; j < len; j++) {
        if (str[j] == '0')
          printf(".");
        else
          printf("*");
      }
      printf("\n");
      if (strchr(str, '1') == NULL)
        break;
      next_generation(str, nextStr, len);
    }
  }
  return 0;
}
```