user: Translate the below assembly code into C programming language:

```asm
<fac>:
  endbr64
  push   %r13
  mov    $0x1,%esi
  push   %r12
  push   %rbp
  sub    $0x20,%rsp
  mov    %edi,0xc(%rsp)
  lea    0xc(%rsp),%rbp
  mov    $0x2,%edi
  lea    0x14(%rsp),%r12
  mov    %fs:0x28,%rax
  mov    %rax,0x18(%rsp)
  xor    %eax,%eax
  call   <__CrestCall@plt>
  mov    %rbp,%rsi
  mov    $0x1,%edi
  call   <__CrestStore@plt>
  movslq 0xc(%rsp),%rdx
  mov    %rbp,%rsi
  mov    $0x5,%edi
  call   <__CrestLoad@plt>
  xor    %edx,%edx
  xor    %esi,%esi
  mov    $0x4,%edi
  call   <__CrestLoad@plt>
  mov    0xc(%rsp),%eax
  xor    %edx,%edx
  mov    $0xc,%esi
  mov    $0x3,%edi
  test   %eax,%eax
  sete   %dl
  call   <__CrestApply2@plt>
  mov    0xc(%rsp),%edx
  test   %edx,%edx
  jne    L15
  mov    $0x1,%edx
  mov    $0x2,%esi
  mov    $0x6,%edi
  call   <__CrestBranch@plt>
  mov    $0x1,%edx
  xor    %esi,%esi
  mov    $0x8,%edi
  call   <__CrestLoad@plt>
  mov    %r12,%rsi
  mov    $0x9,%edi
  call   <__CrestStore@plt>
  mov    $0x1,%eax
  mov    $0x1,%edx
L16:
  mov    %r12,%rsi
  mov    $0x13,%edi
  mov    %eax,0x14(%rsp)
  call   <__CrestLoad@plt>
  mov    $0x14,%edi
  call   <__CrestReturn@plt>
  mov    0x14(%rsp),%eax
  mov    0x18(%rsp),%rdx
  sub    %fs:0x28,%rdx
  jne    L7
  add    $0x20,%rsp
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
  nopw   0x0(%rax,%rax,1)
L15:
  xor    %edx,%edx
  mov    $0x4,%esi
  mov    $0x7,%edi
  call   <__CrestBranch@plt>
  movslq 0xc(%rsp),%rdx
  mov    %rbp,%rsi
  mov    $0xc,%edi
  lea    0x10(%rsp),%r13
  call   <__CrestLoad@plt>
  mov    $0x1,%edx
  xor    %esi,%esi
  mov    $0xb,%edi
  call   <__CrestLoad@plt>
  mov    0xc(%rsp),%eax
  mov    $0x1,%esi
  mov    $0xa,%edi
  lea    -0x1(%rax),%edx
  movslq %edx,%rdx
  call   <__CrestApply2@plt>
  mov    0xc(%rsp),%eax
  lea    -0x1(%rax),%edi
  call   <fac>
  mov    $0xe,%edi
  movslq %eax,%rsi
  mov    %eax,0x10(%rsp)
  call   <__CrestHandleReturn@plt>
  mov    %r13,%rsi
  mov    $0xd,%edi
  call   <__CrestStore@plt>
  movslq 0xc(%rsp),%rdx
  mov    %rbp,%rsi
  mov    $0x11,%edi
  call   <__CrestLoad@plt>
  movslq 0x10(%rsp),%rdx
  mov    %r13,%rsi
  mov    $0x10,%edi
  call   <__CrestLoad@plt>
  mov    0x10(%rsp),%edx
  add    0xc(%rsp),%edx
  xor    %esi,%esi
  movslq %edx,%rdx
  mov    $0xf,%edi
  call   <__CrestApply2@plt>
  mov    %r12,%rsi
  mov    $0x12,%edi
  call   <__CrestStore@plt>
  mov    0x10(%rsp),%eax
  add    0xc(%rsp),%eax
  movslq %eax,%rdx
  jmp    L16
L7:
  call   <__stack_chk_fail@plt>
```

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);
  }
  }
}
```