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

```asm
<main>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x4e0,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  lea    -0x4c0(%rbp),%rdx
  mov    $0x0,%eax
  mov    $0x32,%ecx
  mov    %rdx,%rdi
  rep stos %rax,%es:(%rdi)
  lea    -0x330(%rbp),%rdx
  mov    $0x0,%eax
  mov    $0x32,%ecx
  mov    %rdx,%rdi
  rep stos %rax,%es:(%rdi)
  lea    -0x1a0(%rbp),%rdx
  mov    $0x0,%eax
  mov    $0x32,%ecx
  mov    %rdx,%rdi
  rep stos %rax,%es:(%rdi)
  jmp    L231
L212:
  movl   $0x1,-0x4c4(%rbp)
  jmp    L105
L115:
  movl   $0x0,-0x4d0(%rbp)
  jmp    L14
L131:
  lea    -0x4c0(%rbp),%rdx
  mov    -0x4d0(%rbp),%eax
  cltq
  shl    $0x2,%rax
  add    %rdx,%rax
  mov    %rax,%rsi
  lea    D20(%rip),%rax
  mov    %rax,%rdi
  call   <scanf@plt>
  addl   $0x1,-0x4d0(%rbp)
L14:
  cmpl   $0x9,-0x4d0(%rbp)
  jle    L131
  lea    -0x1a0(%rbp),%rax
  mov    $0x190,%edx
  mov    $0x0,%esi
  mov    %rax,%rdi
  call   <memset@plt>
  movl   $0x1,-0x150(%rbp)
  movl   $0x0,-0x4c8(%rbp)
  jmp    L93
L82:
  movl   $0x1,-0x4cc(%rbp)
  jmp    L234
L177:
  mov    -0x4cc(%rbp),%eax
  cltq
  mov    -0x1a0(%rbp,%rax,4),%eax
  cmp    $0x3,%eax
  je     L236
  cmp    $0x3,%eax
  jg     L243
  cmp    $0x2,%eax
  je     L40
  cmp    $0x2,%eax
  jg     L243
  test   %eax,%eax
  je     L161
  cmp    $0x1,%eax
  je     L53
  jmp    L243
L161:
  lea    D2(%rip),%rax
  mov    %rax,%rdi
  call   <printf@plt>
  jmp    L235
L53:
  lea    D10(%rip),%rax
  mov    %rax,%rdi
  call   <printf@plt>
  jmp    L235
L40:
  lea    D29(%rip),%rax
  mov    %rax,%rdi
  call   <printf@plt>
  jmp    L235
L236:
  lea    D58(%rip),%rax
  mov    %rax,%rdi
  call   <printf@plt>
  jmp    L235
L243:
  nop
L235:
  addl   $0x1,-0x4cc(%rbp)
L234:
  cmpl   $0x28,-0x4cc(%rbp)
  jle    L177
  mov    $0xa,%edi
  call   <putchar@plt>
  lea    -0x1a0(%rbp),%rcx
  lea    -0x330(%rbp),%rax
  mov    $0x190,%edx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <memcpy@plt>
  movl   $0x2,-0x4cc(%rbp)
  jmp    L116
L111:
  mov    -0x4cc(%rbp),%eax
  cltq
  mov    -0x330(%rbp,%rax,4),%edx
  mov    -0x4cc(%rbp),%eax
  sub    $0x1,%eax
  cltq
  mov    -0x330(%rbp,%rax,4),%eax
  add    %eax,%edx
  mov    -0x4cc(%rbp),%eax
  add    $0x1,%eax
  cltq
  mov    -0x330(%rbp,%rax,4),%eax
  add    %edx,%eax
  cltq
  mov    -0x4c0(%rbp,%rax,4),%edx
  mov    -0x4cc(%rbp),%eax
  cltq
  mov    %edx,-0x1a0(%rbp,%rax,4)
  addl   $0x1,-0x4cc(%rbp)
L116:
  cmpl   $0x28,-0x4cc(%rbp)
  jle    L111
  mov    -0x32c(%rbp),%edx
  mov    -0x328(%rbp),%eax
  add    %edx,%eax
  cltq
  mov    -0x4c0(%rbp,%rax,4),%eax
  mov    %eax,-0x19c(%rbp)
  addl   $0x1,-0x4c8(%rbp)
L93:
  cmpl   $0x31,-0x4c8(%rbp)
  jle    L82
  mov    -0x4d4(%rbp),%eax
  cmp    %eax,-0x4c4(%rbp)
  jge    L213
  mov    $0xa,%edi
  call   <putchar@plt>
L213:
  addl   $0x1,-0x4c4(%rbp)
L105:
  mov    -0x4d4(%rbp),%eax
  cmp    %eax,-0x4c4(%rbp)
  jle    L115
L231:
  lea    -0x4d4(%rbp),%rax
  mov    %rax,%rsi
  lea    D20(%rip),%rax
  mov    %rax,%rdi
  call   <scanf@plt>
  test   %rax,%rax
  jg     L212
  mov    $0x0,%eax
  mov    -0x8(%rbp),%rdx
  sub    %fs:0x28,%rdx
  je     L195
  call   <__stack_chk_fail@plt>
L195:
  leave
  ret
```

tool_calls: name: read_data
arguments: data_tag: D20
datatype: string
name: read_data
arguments: data_tag: D2
datatype: string
name: read_data
arguments: data_tag: D10
datatype: string
name: read_data
arguments: data_tag: D29
datatype: string
name: read_data
arguments: data_tag: D58
datatype: string

tool: D20: %d

tool: D2:  

tool: D10: .

tool: D29: x

tool: D58: W

assistant: ```c
main() {
  int n, d[100] = {0}, y[100] = {0}, t[100] = {0}, i, j, k, l, m;
  while (scanf("%d", &n) > 0) {
    for (m = 1; m <= n; m++) {
      for (i = 0; i < 10; i++)
        scanf("%d", &d[i]);
      memset(t, 0, sizeof(t));
      t[20] = 1;
      for (l = 0; l < 50; l++) {
        for (j = 1; j <= 40; j++)
          switch (t[j]) {
          case 0:
            printf(" ");
            break;
          case 1:
            printf(".");
            break;
          case 2:
            printf("x");
            break;
          case 3:
            printf("W");
            break;
          default:
            break;
          }
        putchar('\n');
        memcpy(y, t, sizeof(y));
        for (j = 2; j <= 40; j++)
          t[j] = d[y[j] + y[j - 1] + y[j + 1]];
        t[1] = d[y[1] + y[2]];
      }
      if (m < n)
        putchar('\n');
    }
  }
  return 0;
}
```