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

```asm
<main>:
  endbr64
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  lea    D2(%rip),%rbx
  mov    %rbx,%rdi
  sub    $0x348,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x338(%rsp)
  xor    %eax,%eax
  lea    0x8(%rsp),%rsi
  lea    0xc(%rsp),%rbp
  call   <scanf@plt>
  mov    0x8(%rsp),%eax
  lea    -0x1(%rax),%edx
  mov    %edx,0x8(%rsp)
  test   %eax,%eax
  je     L118
L55:
  mov    %rbp,%rsi
  mov    %rbx,%rdi
  call   <scanf@plt>
  mov    0xc(%rsp),%r8d
  movl   $0x1,0x10(%rsp)
  test   %r8d,%r8d
  jle    L69
  add    $0x1,%r8d
  mov    $0x1,%edx
  mov    $0x1,%ecx
  xor    %r12d,%r12d
  mov    $0x1,%esi
  lea    0x10(%rsp),%rdi
  lea    0x14(%rsp),%r9
  nopl   0x0(%rax)
L87:
  mov    %r12d,%eax
  mov    %rdi,%r10
  lea    (%r9,%rax,4),%r11
  xor    %eax,%eax
  jmp    L106
  cs nopw 0x0(%rax,%rax,1)
L41:
  mov    (%r10),%edx
L106:
  imul   %ecx,%edx
  add    $0x4,%r10
  add    %eax,%edx
  movslq %edx,%rax
  mov    %edx,%r13d
  imul   $0x66666667,%rax,%rax
  sar    $0x1f,%r13d
  sar    $0x22,%rax
  sub    %r13d,%eax
  lea    (%rax,%rax,4),%r13d
  add    %r13d,%r13d
  sub    %r13d,%edx
  mov    %edx,-0x4(%r10)
  cmp    %r11,%r10
  jne    L41
  test   %eax,%eax
  je     L26
  lea    0x1(%rsi),%r10d
  movslq %r10d,%r10
  nopw   0x0(%rax,%rax,1)
L56:
  movslq %eax,%rdx
  mov    %eax,%r11d
  mov    %r10d,%esi
  imul   $0x66666667,%rdx,%rdx
  sar    $0x1f,%r11d
  sar    $0x22,%rdx
  sub    %r11d,%edx
  lea    (%rdx,%rdx,4),%r11d
  add    %r11d,%r11d
  sub    %r11d,%eax
  mov    %eax,-0x4(%rdi,%r10,4)
  mov    %edx,%eax
  add    $0x1,%r10
  test   %edx,%edx
  jne    L56
  lea    -0x1(%rsi),%r12d
L26:
  add    $0x1,%ecx
  cmp    %r8d,%ecx
  je     L31
  mov    0x10(%rsp),%edx
  jmp    L87
  nopl   0x0(%rax)
L31:
  movslq %r12d,%rax
  mov    0x10(%rsp,%rax,4),%esi
L50:
  sub    $0x1,%r12d
  movslq %r12d,%r12
  jmp    L11
  nopl   0x0(%rax,%rax,1)
L104:
  mov    0x10(%rsp,%r12,4),%esi
  sub    $0x1,%r12
L11:
  xor    %eax,%eax
  mov    %rbx,%rdi
  call   <printf@plt>
  cmp    $0xffffffff,%r12d
  jne    L104
  mov    $0xa,%edi
  call   <putchar@plt>
  mov    0x8(%rsp),%eax
  lea    -0x1(%rax),%edx
  mov    %edx,0x8(%rsp)
  test   %eax,%eax
  jne    L55
L118:
  mov    0x338(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L67
  add    $0x348,%rsp
  xor    %eax,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
L69:
  mov    $0x1,%esi
  xor    %r12d,%r12d
  jmp    L50
L67:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: disassemble_data
arguments: data_tag: D2
type_guessed: string

tool: D2: %d

assistant: ```c
int main() {
  int test;
  scanf("%d", &test);
  while (test--) {
    int array[200];
    int m;
    int n;
    int i;
    int hold, index;
    scanf("%d", &n);
    hold = n;
    array[0] = 1;
    m = 1;
    i = 1;
    while (i <= n) {
      int temp = 0;
      for (index = 0; index < m; index++) {
        int x = i * array[index] + temp;
        array[index] = x % 10;
        temp = x / 10;
      }
      while (temp != 0) {
        array[m++] = temp % 10;
        temp /= 10;
      }
      i++;
    }
    for (i = m - 1; i >= 0; i--) {
      printf("%d", array[i]);
    }
    printf("\n");
  }
  return 0;
}
```