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

```asm
<main>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  lea    D16(%rip),%rbx
  mov    %rbx,%rdi
  sub    $0x348,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x338(%rsp)
  xor    %eax,%eax
  lea    0x8(%rsp),%rsi
  call   <scanf@plt>
  mov    0x8(%rsp),%eax
  lea    -0x1(%rax),%edx
  mov    %edx,0x8(%rsp)
  test   %eax,%eax
  je     L108
  lea    0xc(%rsp),%r12
  lea    0x10(%rsp),%r14
  lea    0x14(%rsp),%rbp
  jmp    L121
L47:
  mov    $0x1,%esi
  lea    D9(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
  mov    0x8(%rsp),%eax
  lea    -0x1(%rax),%edx
  mov    %edx,0x8(%rsp)
  test   %eax,%eax
  je     L108
L121:
  mov    %r12,%rsi
  mov    %rbx,%rdi
  call   <scanf@plt>
  mov    0xc(%rsp),%esi
  cmp    $0x1,%esi
  jbe    L47
  mov    %r14,%r9
  mov    %esi,%edx
  xor    %r8d,%r8d
  nopw   0x0(%rax,%rax,1)
L33:
  movslq %edx,%rax
  mov    %edx,%edi
  add    $0x4,%r9
  imul   $0x66666667,%rax,%rax
  sar    $0x1f,%edi
  sar    $0x22,%rax
  sub    %edi,%eax
  lea    (%rax,%rax,4),%edi
  add    %edi,%edi
  sub    %edi,%edx
  mov    %edx,-0x4(%r9)
  mov    %eax,%edx
  movslq %r8d,%rax
  add    $0x1,%r8d
  test   %edx,%edx
  jne    L33
  sub    $0x1,%esi
  lea    -0x1(%r8),%r10d
  mov    %esi,0xc(%rsp)
  je     L86
  nopw   0x0(%rax,%rax,1)
L120:
  mov    %r10d,%eax
  mov    %r14,%rdi
  lea    0x0(%rbp,%rax,4),%r9
  xor    %eax,%eax
  nopl   (%rax)
L56:
  mov    (%rdi),%edx
  add    $0x4,%rdi
  imul   %esi,%edx
  add    %eax,%edx
  movslq %edx,%rax
  mov    %edx,%r11d
  imul   $0x66666667,%rax,%rax
  sar    $0x1f,%r11d
  sar    $0x22,%rax
  sub    %r11d,%eax
  lea    (%rax,%rax,4),%r11d
  add    %r11d,%r11d
  sub    %r11d,%edx
  mov    %edx,-0x4(%rdi)
  cmp    %r9,%rdi
  jne    L56
  test   %eax,%eax
  je     L102
  lea    0x1(%r8),%edi
  movslq %edi,%rdi
L107:
  movslq %eax,%rdx
  mov    %eax,%r8d
  imul   $0x66666667,%rdx,%rdx
  sar    $0x1f,%r8d
  sar    $0x22,%rdx
  sub    %r8d,%edx
  lea    (%rdx,%rdx,4),%r8d
  add    %r8d,%r8d
  sub    %r8d,%eax
  mov    %edi,%r8d
  mov    %eax,-0x4(%r14,%rdi,4)
  mov    %edx,%eax
  add    $0x1,%rdi
  test   %edx,%edx
  jne    L107
  lea    -0x1(%r8),%r10d
L102:
  sub    $0x1,%esi
  jne    L120
  movl   $0x0,0xc(%rsp)
  movslq %r10d,%rax
L86:
  lea    (%r14,%rax,4),%r13
  lea    -0x4(%r14),%r15
  nopl   0x0(%rax)
L113:
  mov    0x0(%r13),%esi
  mov    %rbx,%rdi
  xor    %eax,%eax
  sub    $0x4,%r13
  call   <printf@plt>
  cmp    %r13,%r15
  jne    L113
  mov    $0xa,%edi
  call   <putchar@plt>
  mov    0x8(%rsp),%eax
  lea    -0x1(%rax),%edx
  mov    %edx,0x8(%rsp)
  test   %eax,%eax
  jne    L121
L108:
  mov    0x338(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L57
  add    $0x348,%rsp
  xor    %eax,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L57:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: parse_data
arguments: data_tag: D16
type_guessed: string
name: parse_data
arguments: data_tag: D9
type_guessed: string

tool: D16: %d

tool: D9: %d


assistant: ```c
int main(void) {
  int t, n, fact[201], x, temp, m = 0, i, j = 0, temp_n = 0, index = 0;
  scanf("%d", &t);
  while (t--) {
    scanf("%d", &n);
    if (n == 0 || n == 1) {
      printf("%d\n", 1);
    } else {
      temp_n = n;
      while (temp_n != 0) {
        fact[index] = temp_n % 10;
        temp_n /= 10;
        index++;
        m++;
      }
      index = 0;
      n -= 1;
      while (n != 0) {
        temp = 0;
        for (j = 0; j < m; j++) {
          x = fact[j] * n + temp;
          fact[j] = x % 10;
          temp = x / 10;
        }
        while (temp != 0) {
          fact[j] = temp % 10;
          temp /= 10;
          j++;
          m++;
        }
        n -= 1;
      }
      for (i = m - 1; i >= 0; i--) {
        printf("%d", fact[i]);
      }
      m = 0;
      i = 0;
      j = 0;
      x = 0;
      temp = 0;
      printf("\n");
    }
  }
  return 0;
}
```