user: Please show me the C implementation that matches the assembly code listed below:

```asm
<main>:
  endbr64
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x340,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x338(%rsp)
  xor    %eax,%eax
  lea    0x8(%rsp),%rsi
  lea    D17(%rip),%rdi
  call   <scanf@plt>
  mov    0x8(%rsp),%eax
  lea    -0x1(%rax),%edx
  mov    %edx,0x8(%rsp)
  test   %eax,%eax
  je     L153
  lea    D17(%rip),%rbx
  lea    0x14(%rsp),%rbp
  lea    D23(%rip),%r12
  jmp    L19
L42:
  mov    $0x1,%esi
  mov    %r12,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  jmp    L138
L86:
  lea    0x10(%rsp),%rdi
  lea    -0x1(%r8),%eax
  lea    0x0(%rbp,%rax,4),%r9
  mov    %esi,%eax
L127:
  mov    %ecx,%edx
  imul   (%rdi),%edx
  add    %eax,%edx
  movslq %edx,%rax
  imul   $0x66666667,%rax,%rax
  sar    $0x22,%rax
  mov    %edx,%r10d
  sar    $0x1f,%r10d
  sub    %r10d,%eax
  lea    (%rax,%rax,4),%r10d
  add    %r10d,%r10d
  sub    %r10d,%edx
  mov    %edx,(%rdi)
  add    $0x4,%rdi
  cmp    %r9,%rdi
  jne    L127
  test   %eax,%eax
  je     L26
  lea    0x1(%r8),%edi
  movslq %edi,%rdi
L119:
  movslq %eax,%rdx
  imul   $0x66666667,%rdx,%rdx
  sar    $0x22,%rdx
  mov    %eax,%r8d
  sar    $0x1f,%r8d
  sub    %r8d,%edx
  lea    (%rdx,%rdx,4),%r8d
  add    %r8d,%r8d
  sub    %r8d,%eax
  mov    %eax,0xc(%rsp,%rdi,4)
  mov    %edx,%eax
  mov    %edi,%r8d
  add    $0x1,%rdi
  test   %edx,%edx
  jne    L119
L26:
  sub    $0x1,%ecx
  je     L121
L113:
  test   %r8d,%r8d
  jg     L86
  jmp    L26
L121:
  movl   $0x0,0xc(%rsp)
L169:
  test   %r8d,%r8d
  jle    L117
  movslq %r8d,%rax
  shl    $0x2,%rax
  lea    0x10(%rsp,%rax,1),%r13
  lea    0xc(%rsp,%rax,1),%r14
  lea    -0x1(%r8),%eax
  shl    $0x2,%rax
  sub    %rax,%r14
L49:
  mov    -0x4(%r13),%esi
  mov    %rbx,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  sub    $0x4,%r13
  cmp    %r13,%r14
  jne    L49
L117:
  mov    $0xa,%edi
  call   <putchar@plt>
L138:
  mov    0x8(%rsp),%eax
  lea    -0x1(%rax),%edx
  mov    %edx,0x8(%rsp)
  test   %eax,%eax
  je     L153
L19:
  lea    0xc(%rsp),%rsi
  mov    %rbx,%rdi
  call   <scanf@plt>
  mov    0xc(%rsp),%ecx
  cmp    $0x1,%ecx
  jbe    L42
  mov    %ecx,%esi
  mov    $0x1,%edx
L66:
  movslq %esi,%rax
  imul   $0x66666667,%rax,%rax
  sar    $0x22,%rax
  mov    %esi,%edi
  sar    $0x1f,%edi
  sub    %edi,%eax
  lea    (%rax,%rax,4),%edi
  add    %edi,%edi
  sub    %edi,%esi
  mov    %esi,0xc(%rsp,%rdx,4)
  mov    %eax,%esi
  mov    %edx,%r8d
  add    $0x1,%rdx
  test   %eax,%eax
  jne    L66
  sub    $0x1,%ecx
  mov    %ecx,0xc(%rsp)
  jne    L113
  jmp    L169
L153:
  mov    0x338(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L166
  mov    $0x0,%eax
  add    $0x340,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  ret
L166:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: parse_data
arguments: label: D17
type: string
name: parse_data
arguments: label: D23
type: string

tool: D17: %d

tool: D23: %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;
}
```