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

```asm
<PAKE_setup>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbx
  sub    $0x88,%rsp
  mov    0x18(%rbp),%rax
  mov    %rcx,-0x68(%rbp)
  mov    %rdx,-0x90(%rbp)
  mov    %rsp,%rcx
  mov    0x10(%rbp),%rbx
  mov    %rax,-0x48(%rbp)
  mov    0x20(%rbp),%rax
  mov    %rdi,-0x50(%rbp)
  mov    %rax,-0x78(%rbp)
  mov    0x28(%rbp),%rax
  mov    %rsi,-0x88(%rbp)
  mov    %rax,-0x70(%rbp)
  mov    0x30(%rbp),%rax
  mov    %r8,-0x58(%rbp)
  mov    %r9,-0x60(%rbp)
  mov    %rax,-0x80(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x38(%rbp)
  xor    %eax,%eax
  mov    D0(%rip),%rax
  movb   $0x0,-0x3a(%rbp)
  movslq (%rax),%rax
  mov    %rax,%r15
  add    $0xf,%rax
  mov    %rax,%rdx
  and    $0xfffffffffffff000,%rax
  sub    %rax,%rcx
  and    $0xfffffffffffffff0,%rdx
  cmp    %rcx,%rsp
  je     L364
L334:
  sub    $0x1000,%rsp
  orq    $0x0,0xff8(%rsp)
  cmp    %rcx,%rsp
  jne    L334
L364:
  and    $0xfff,%edx
  sub    %rdx,%rsp
  test   %rdx,%rdx
  jne    L290
L37:
  xor    %eax,%eax
  mov    %rsp,-0x98(%rbp)
  call   <BN_CTX_new@plt>
  mov    %rax,%r14
  test   %rax,%rax
  je     L332
  mov    %rax,%rdi
  call   <BN_CTX_start@plt>
  xor    %eax,%eax
  call   <BN_new@plt>
  mov    %rax,%r12
  xor    %eax,%eax
  call   <BN_new@plt>
  mov    %rax,%r13
  test   %r12,%r12
  je     L282
  test   %rax,%rax
  je     L282
  mov    -0x50(%rbp),%rdi
  mov    %r12,%rsi
  mov    %r14,%rdx
  call   <EC_GROUP_get_order@plt>
  lea    -0x39(%rbp),%rsi
  mov    %rsi,-0xa0(%rbp)
  test   %eax,%eax
  jne    L36
L261:
  mov    %rbx,%rdi
  call   <BN_clear@plt>
  mov    -0x48(%rbp),%rdi
  call   <BN_clear@plt>
  mov    -0x98(%rbp),%rdi
  mov    %r15d,%esi
  xor    %r15d,%r15d
  call   <bzero@plt>
  mov    -0xa0(%rbp),%rdi
  mov    $0x1,%esi
  call   <bzero@plt>
L370:
  mov    %r12,%rdi
  call   <BN_free@plt>
L223:
  test   %r13,%r13
  je     L174
  mov    %r13,%rdi
  call   <BN_clear_free@plt>
L174:
  mov    %r14,%rdi
  call   <BN_CTX_end@plt>
  mov    %r14,%rdi
  call   <BN_CTX_free@plt>
L142:
  mov    -0x38(%rbp),%rax
  sub    %fs:0x28,%rax
  jne    L182
  lea    -0x28(%rbp),%rsp
  mov    %r15d,%eax
  pop    %rbx
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  pop    %rbp
  ret
  nopl   (%rax)
L282:
  mov    %rbx,%rdi
  call   <BN_clear@plt>
  mov    -0x48(%rbp),%rdi
  call   <BN_clear@plt>
  mov    -0x98(%rbp),%rdi
  mov    %r15d,%esi
  xor    %r15d,%r15d
  call   <bzero@plt>
  lea    -0x39(%rbp),%rdi
  mov    $0x1,%esi
  call   <bzero@plt>
  test   %r12,%r12
  jne    L370
  jmp    L223
  nopw   0x0(%rax,%rax,1)
L332:
  mov    %rbx,%rdi
  call   <BN_clear@plt>
  mov    -0x48(%rbp),%rdi
  call   <BN_clear@plt>
  mov    %r15d,%esi
  mov    %rsp,%rdi
  xor    %r15d,%r15d
  call   <bzero@plt>
  lea    -0x39(%rbp),%rdi
  mov    $0x1,%esi
  call   <bzero@plt>
  jmp    L142
  nopw   0x0(%rax,%rax,1)
L36:
  mov    %r12,%rdi
  call   <BN_num_bits@plt>
  cmp    $0x1c0,%eax
  jg     L261
  mov    -0xa0(%rbp),%rdi
  call   <SHA512_Init@plt>
  test   %eax,%eax
  je     L261
  lea    -0x3a(%rbp),%rax
  mov    -0xa0(%rbp),%rdi
  mov    $0x1,%edx
  mov    %rax,-0xa8(%rbp)
  mov    %rax,%rsi
  xor    %eax,%eax
  call   <SHA512_Update@plt>
  test   %eax,%eax
  je     L261
  mov    -0x58(%rbp),%rdi
  call   <strlen@plt>
  mov    -0x58(%rbp),%rsi
  mov    -0xa0(%rbp),%rdi
  lea    0x1(%rax),%edx
  xor    %eax,%eax
  call   <SHA512_Update@plt>
  test   %eax,%eax
  je     L261
  mov    -0x60(%rbp),%rdi
  call   <strlen@plt>
  mov    -0x60(%rbp),%rsi
  mov    -0xa0(%rbp),%rdi
  lea    0x1(%rax),%edx
  xor    %eax,%eax
  call   <SHA512_Update@plt>
  test   %eax,%eax
  je     L261
  mov    -0x68(%rbp),%rdi
  call   <strlen@plt>
  mov    -0x68(%rbp),%rsi
  mov    -0xa0(%rbp),%rdi
  lea    0x1(%rax),%edx
  xor    %eax,%eax
  call   <SHA512_Update@plt>
  test   %eax,%eax
  je     L261
  mov    -0xa0(%rbp),%rsi
  mov    -0x98(%rbp),%rdi
  call   <SHA512_Final@plt>
  test   %eax,%eax
  je     L261
  mov    -0x98(%rbp),%rdi
  mov    %r13,%rdx
  mov    %r15d,%esi
  call   <BN_bin2bn@plt>
  test   %eax,%eax
  je     L261
  mov    %r14,%rcx
  mov    %r12,%rdx
  mov    %r13,%rsi
  mov    %rbx,%rdi
  call   <BN_nnmod@plt>
  test   %eax,%eax
  je     L261
  mov    -0xa0(%rbp),%rdi
  movb   $0x1,-0x3a(%rbp)
  call   <SHA512_Init@plt>
  test   %eax,%eax
  je     L261
  mov    -0xa8(%rbp),%rsi
  mov    -0xa0(%rbp),%rdi
  xor    %eax,%eax
  mov    $0x1,%edx
  call   <SHA512_Update@plt>
  test   %eax,%eax
  je     L261
  mov    -0x58(%rbp),%rdi
  call   <strlen@plt>
  mov    -0x58(%rbp),%rsi
  mov    -0xa0(%rbp),%rdi
  lea    0x1(%rax),%edx
  xor    %eax,%eax
  call   <SHA512_Update@plt>
  test   %eax,%eax
  je     L261
  mov    -0x60(%rbp),%rdi
  call   <strlen@plt>
  mov    -0x60(%rbp),%rsi
  mov    -0xa0(%rbp),%rdi
  lea    0x1(%rax),%edx
  xor    %eax,%eax
  call   <SHA512_Update@plt>
  test   %eax,%eax
  je     L261
  mov    -0x68(%rbp),%rdi
  call   <strlen@plt>
  mov    -0x68(%rbp),%rsi
  mov    -0xa0(%rbp),%rdi
  lea    0x1(%rax),%edx
  xor    %eax,%eax
  call   <SHA512_Update@plt>
  test   %eax,%eax
  je     L261
  mov    -0xa0(%rbp),%rsi
  mov    -0x98(%rbp),%rdi
  call   <SHA512_Final@plt>
  test   %eax,%eax
  je     L261
  mov    -0x98(%rbp),%rdi
  mov    %r13,%rdx
  mov    %r15d,%esi
  call   <BN_bin2bn@plt>
  test   %eax,%eax
  je     L261
  mov    -0x48(%rbp),%rdi
  mov    %r14,%rcx
  mov    %r12,%rdx
  mov    %r13,%rsi
  call   <BN_nnmod@plt>
  test   %eax,%eax
  je     L261
  cmpq   $0x0,-0x80(%rbp)
  je     L67
  mov    -0x90(%rbp),%rcx
  mov    -0x80(%rbp),%rsi
  xor    %edx,%edx
  mov    %r14,%r9
  mov    -0x50(%rbp),%rdi
  mov    %rbx,%r8
  call   <EC_POINT_mul@plt>
  test   %eax,%eax
  je     L261
L67:
  cmpq   $0x0,-0x70(%rbp)
  je     L232
  mov    -0x88(%rbp),%rcx
  mov    -0x70(%rbp),%rsi
  xor    %edx,%edx
  mov    %r14,%r9
  mov    -0x50(%rbp),%rdi
  mov    %rbx,%r8
  call   <EC_POINT_mul@plt>
  test   %eax,%eax
  je     L261
  mov    -0x70(%rbp),%rsi
  mov    -0x50(%rbp),%rdi
  mov    %r14,%rdx
  call   <EC_POINT_invert@plt>
  test   %eax,%eax
  je     L261
L232:
  cmpq   $0x0,-0x78(%rbp)
  je     L286
  mov    -0x48(%rbp),%rdx
  mov    -0x78(%rbp),%rsi
  xor    %r8d,%r8d
  xor    %ecx,%ecx
  mov    -0x50(%rbp),%rdi
  mov    %r14,%r9
  call   <EC_POINT_mul@plt>
  test   %eax,%eax
  je     L261
L286:
  mov    -0x98(%rbp),%rdi
  mov    %r15d,%esi
  mov    $0x1,%r15d
  call   <bzero@plt>
  mov    -0xa0(%rbp),%rdi
  mov    $0x1,%esi
  call   <bzero@plt>
  jmp    L370
  nopl   0x0(%rax)
L290:
  orq    $0x0,-0x8(%rsp,%rdx,1)
  jmp    L37
L182:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
int PAKE_setup(const EC_GROUP *group, const EC_POINT *U, const EC_POINT *V, const char *password, const char *server_name, const char *client_name, BIGNUM *pi_0, BIGNUM *pi_1, EC_POINT *L, EC_POINT *U_minus_pi_0, EC_POINT *V_pi_0) {
  int ret = 0;
  unsigned char side = 0;
  SHA512_CTX sha;
  unsigned char md[SHA512_DIGEST_LENGTH];
  BIGNUM *order = NULL, *tmp = NULL;
  BN_CTX *ctx = NULL;
  if (!(ctx = BN_CTX_new()))
    goto err;
  BN_CTX_start(ctx);
  order = BN_new();
  tmp = BN_new();
  if (!order || !tmp)
    goto err;
  if (!EC_GROUP_get_order(group, order, ctx))
    goto err;
  if (BN_num_bits(order) > 512 - 64)
    goto err;
  if (!SHA512_Init(&sha))
    goto err;
  if (!SHA512_Update(&sha, &side, 1))
    goto err;
  if (!SHA512_Update(&sha, server_name, 1 + strlen(server_name)))
    goto err;
  if (!SHA512_Update(&sha, client_name, 1 + strlen(client_name)))
    goto err;
  if (!SHA512_Update(&sha, password, 1 + strlen(password)))
    goto err;
  if (!SHA512_Final(md, &sha))
    goto err;
  if (!BN_bin2bn(md, sizeof(md), tmp))
    goto err;
  if (!BN_nnmod(pi_0, tmp, order, ctx))
    goto err;
  side = 1;
  if (!SHA512_Init(&sha))
    goto err;
  if (!SHA512_Update(&sha, &side, 1))
    goto err;
  if (!SHA512_Update(&sha, server_name, 1 + strlen(server_name)))
    goto err;
  if (!SHA512_Update(&sha, client_name, 1 + strlen(client_name)))
    goto err;
  if (!SHA512_Update(&sha, password, 1 + strlen(password)))
    goto err;
  if (!SHA512_Final(md, &sha))
    goto err;
  if (!BN_bin2bn(md, sizeof(md), tmp))
    goto err;
  if (!BN_nnmod(pi_1, tmp, order, ctx))
    goto err;
  if (V_pi_0 && !EC_POINT_mul(group, V_pi_0, NULL, V, pi_0, ctx))
    goto err;
  if (U_minus_pi_0 && (!EC_POINT_mul(group, U_minus_pi_0, NULL, U, pi_0, ctx) || !EC_POINT_invert(group, U_minus_pi_0, ctx)))
    goto err;
  if (L && !EC_POINT_mul(group, L, pi_1, NULL, NULL, ctx))
    goto err;
  ret = 1;
err:
  if (!ret) {
    BN_clear(pi_0);
    BN_clear(pi_1);
  }
  bzero(md, sizeof(md));
  bzero(&sha, sizeof(sha));
  if (order)
    BN_free(order);
  if (tmp)
    BN_clear_free(tmp);
  if (ctx) {
    BN_CTX_end(ctx);
    BN_CTX_free(ctx);
  }
  return ret;
}
```