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

```asm
<factorial>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x360,%rsp
  mov    %edi,-0x354(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  lea    -0x330(%rbp),%rdx
  mov    $0x0,%eax
  mov    $0x64,%ecx
  mov    %rdx,%rdi
  rep stos %rax,%es:(%rdi)
  movl   $0x1,-0x344(%rbp)
  movl   $0x0,-0x340(%rbp)
  movl   $0x0,-0x33c(%rbp)
  movl   $0x0,-0x338(%rbp)
  movl   $0x1,-0x330(%rbp)
  jmp    L6
L40:
  movl   $0x0,-0x338(%rbp)
  jmp    L62
L75:
  mov    -0x338(%rbp),%eax
  cltq
  mov    -0x330(%rbp,%rax,4),%eax
  imul   -0x344(%rbp),%eax
  mov    %eax,%edx
  mov    -0x33c(%rbp),%eax
  add    %eax,%edx
  mov    -0x338(%rbp),%eax
  cltq
  mov    %edx,-0x330(%rbp,%rax,4)
  mov    -0x338(%rbp),%eax
  cltq
  mov    -0x330(%rbp,%rax,4),%eax
  movslq %eax,%rdx
  imul   $0x66666667,%rdx,%rdx
  shr    $0x20,%rdx
  sar    $0x2,%edx
  sar    $0x1f,%eax
  mov    %eax,%ecx
  mov    %edx,%eax
  sub    %ecx,%eax
  mov    %eax,-0x33c(%rbp)
  mov    -0x338(%rbp),%eax
  cltq
  mov    -0x330(%rbp,%rax,4),%ecx
  movslq %ecx,%rax
  imul   $0x66666667,%rax,%rax
  shr    $0x20,%rax
  sar    $0x2,%eax
  mov    %ecx,%esi
  sar    $0x1f,%esi
  sub    %esi,%eax
  mov    %eax,%edx
  mov    %edx,%eax
  shl    $0x2,%eax
  add    %edx,%eax
  add    %eax,%eax
  sub    %eax,%ecx
  mov    %ecx,%edx
  mov    -0x338(%rbp),%eax
  cltq
  mov    %edx,-0x330(%rbp,%rax,4)
  addl   $0x1,-0x338(%rbp)
L62:
  mov    -0x338(%rbp),%eax
  cmp    -0x340(%rbp),%eax
  jle    L75
  jmp    L27
L25:
  addl   $0x1,-0x340(%rbp)
  mov    -0x33c(%rbp),%ecx
  movslq %ecx,%rax
  imul   $0x66666667,%rax,%rax
  shr    $0x20,%rax
  sar    $0x2,%eax
  mov    %ecx,%esi
  sar    $0x1f,%esi
  sub    %esi,%eax
  mov    %eax,%edx
  mov    %edx,%eax
  shl    $0x2,%eax
  add    %edx,%eax
  add    %eax,%eax
  sub    %eax,%ecx
  mov    %ecx,%edx
  mov    -0x340(%rbp),%eax
  cltq
  mov    %edx,-0x330(%rbp,%rax,4)
  mov    -0x33c(%rbp),%eax
  movslq %eax,%rdx
  imul   $0x66666667,%rdx,%rdx
  shr    $0x20,%rdx
  sar    $0x2,%edx
  sar    $0x1f,%eax
  mov    %eax,%ecx
  mov    %edx,%eax
  sub    %ecx,%eax
  mov    %eax,-0x33c(%rbp)
L27:
  cmpl   $0x0,-0x33c(%rbp)
  jne    L25
  addl   $0x1,-0x344(%rbp)
L6:
  mov    -0x344(%rbp),%eax
  cmp    -0x354(%rbp),%eax
  jle    L40
  mov    -0x340(%rbp),%eax
  mov    %eax,-0x334(%rbp)
  jmp    L16
L86:
  mov    -0x334(%rbp),%eax
  cltq
  mov    -0x330(%rbp,%rax,4),%eax
  mov    %eax,%esi
  lea    D9(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  subl   $0x1,-0x334(%rbp)
L16:
  cmpl   $0x0,-0x334(%rbp)
  jns    L86
  mov    $0xa,%edi
  call   <putchar@plt>
  nop
  mov    -0x8(%rbp),%rax
  sub    %fs:0x28,%rax
  je     L73
  call   <__stack_chk_fail@plt>
L73:
  leave
  ret
```

tool_calls: name: parse_data
arguments: data_label: D9
type_guessed: string

tool: D9: %d

assistant: ```c
void factorial(int number) {
  int fact[200] = {0};
  int tempnum = 1;
  int index = 0;
  int carry = 0;
  int j = 0;
  fact[0] = 1;
  while (tempnum <= number) {
    j = 0;
    for (; j <= index; ++j) {
      fact[j] = fact[j] * tempnum + carry;
      carry = fact[j] / 10;
      fact[j] = fact[j] % 10;
    }
    while (carry) {
      index++;
      fact[index] = carry % 10;
      carry = carry / 10;
    }
    tempnum++;
  }
  for (int i = index; i >= 0; --i) {
    printf("%d", fact[i]);
  }
  printf("\n");
}
```