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

```asm
<fac>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x20,%rsp
  mov    %edi,-0x14(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  mov    $0x1,%esi
  mov    $0x2,%edi
  call   <__CrestCall@plt>
  lea    -0x14(%rbp),%rax
  mov    %rax,%rsi
  mov    $0x1,%edi
  call   <__CrestStore@plt>
  mov    -0x14(%rbp),%eax
  movslq %eax,%rdx
  lea    -0x14(%rbp),%rax
  mov    %rax,%rsi
  mov    $0x5,%edi
  call   <__CrestLoad@plt>
  mov    $0x0,%edx
  mov    $0x0,%esi
  mov    $0x4,%edi
  call   <__CrestLoad@plt>
  mov    -0x14(%rbp),%eax
  test   %eax,%eax
  sete   %al
  movzbl %al,%eax
  mov    %rax,%rdx
  mov    $0xc,%esi
  mov    $0x3,%edi
  call   <__CrestApply2@plt>
  mov    -0x14(%rbp),%eax
  test   %eax,%eax
  jne    L17
  mov    $0x1,%edx
  mov    $0x2,%esi
  mov    $0x6,%edi
  call   <__CrestBranch@plt>
  mov    $0x1,%edx
  mov    $0x0,%esi
  mov    $0x8,%edi
  call   <__CrestLoad@plt>
  lea    -0xc(%rbp),%rax
  mov    %rax,%rsi
  mov    $0x9,%edi
  call   <__CrestStore@plt>
  movl   $0x1,-0xc(%rbp)
  jmp    L8
L17:
  mov    $0x0,%edx
  mov    $0x4,%esi
  mov    $0x7,%edi
  call   <__CrestBranch@plt>
  mov    -0x14(%rbp),%eax
  movslq %eax,%rdx
  lea    -0x14(%rbp),%rax
  mov    %rax,%rsi
  mov    $0xc,%edi
  call   <__CrestLoad@plt>
  mov    $0x1,%edx
  mov    $0x0,%esi
  mov    $0xb,%edi
  call   <__CrestLoad@plt>
  mov    -0x14(%rbp),%eax
  sub    $0x1,%eax
  cltq
  mov    %rax,%rdx
  mov    $0x1,%esi
  mov    $0xa,%edi
  call   <__CrestApply2@plt>
  mov    -0x14(%rbp),%eax
  sub    $0x1,%eax
  mov    %eax,%edi
  call   <fac>
  mov    %eax,-0x10(%rbp)
  mov    -0x10(%rbp),%eax
  cltq
  mov    %rax,%rsi
  mov    $0xe,%edi
  call   <__CrestHandleReturn@plt>
  lea    -0x10(%rbp),%rax
  mov    %rax,%rsi
  mov    $0xd,%edi
  call   <__CrestStore@plt>
  mov    -0x14(%rbp),%eax
  movslq %eax,%rdx
  lea    -0x14(%rbp),%rax
  mov    %rax,%rsi
  mov    $0x11,%edi
  call   <__CrestLoad@plt>
  mov    -0x10(%rbp),%eax
  movslq %eax,%rdx
  lea    -0x10(%rbp),%rax
  mov    %rax,%rsi
  mov    $0x10,%edi
  call   <__CrestLoad@plt>
  mov    -0x14(%rbp),%edx
  mov    -0x10(%rbp),%eax
  add    %edx,%eax
  cltq
  mov    %rax,%rdx
  mov    $0x0,%esi
  mov    $0xf,%edi
  call   <__CrestApply2@plt>
  lea    -0xc(%rbp),%rax
  mov    %rax,%rsi
  mov    $0x12,%edi
  call   <__CrestStore@plt>
  mov    -0x14(%rbp),%edx
  mov    -0x10(%rbp),%eax
  add    %edx,%eax
  mov    %eax,-0xc(%rbp)
  nop
L8:
  mov    -0xc(%rbp),%eax
  movslq %eax,%rdx
  lea    -0xc(%rbp),%rax
  mov    %rax,%rsi
  mov    $0x13,%edi
  call   <__CrestLoad@plt>
  mov    $0x14,%edi
  call   <__CrestReturn@plt>
  mov    -0xc(%rbp),%eax
  mov    -0x8(%rbp),%rdx
  sub    %fs:0x28,%rdx
  je     L24
  call   <__stack_chk_fail@plt>
L24:
  leave
  ret
```

assistant: ```c
int fac(int n) {
  int tmp;
  int __retres3;
  {
    __CrestCall(2, 1);
    __CrestStore(1, (unsigned long)(&n));
    {
      __CrestLoad(5, (unsigned long)(&n), (long long)n);
      __CrestLoad(4, (unsigned long)0, (long long)0);
      __CrestApply2(3, 12, (long long)(n == 0));
      if (n == 0) {
        __CrestBranch(6, 2, 1);
        __CrestLoad(8, (unsigned long)0, (long long)1);
        __CrestStore(9, (unsigned long)(&__retres3));
        __retres3 = 1;
        goto return_label;
      } else {
        __CrestBranch(7, 4, 0);
        __CrestLoad(12, (unsigned long)(&n), (long long)n);
        __CrestLoad(11, (unsigned long)0, (long long)1);
        __CrestApply2(10, 1, (long long)(n - 1));
        tmp = fac(n - 1);
        __CrestHandleReturn(14, (long long)tmp);
        __CrestStore(13, (unsigned long)(&tmp));
        __CrestLoad(17, (unsigned long)(&n), (long long)n);
        __CrestLoad(16, (unsigned long)(&tmp), (long long)tmp);
        __CrestApply2(15, 0, (long long)(n + tmp));
        __CrestStore(18, (unsigned long)(&__retres3));
        __retres3 = n + tmp;
        goto return_label;
      }
    }
  return_label : {
    __CrestLoad(19, (unsigned long)(&__retres3), (long long)__retres3);
    __CrestReturn(20);
    return (__retres3);
  }
  }
}
```