user: 请将这段汇编代码片段转换成等效的C代码：

```asm
<lwe_key_gen_server_gen_a>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  mov    %rcx,%r13
  push   %r12
  mov    %rsi,%r12
  push   %rbp
  push   %rbx
  mov    %rdx,%rbx
  sub    $0x38,%rsp
  mov    %rdi,0x10(%rsp)
  mov    %fs:0x28,%rax
  mov    %rax,0x28(%rsp)
  xor    %eax,%eax
  call   <EVP_CIPHER_CTX_new@plt>
  test   %rax,%rax
  je     L187
  mov    %rax,%rbp
  xor    %eax,%eax
  call   <EVP_aes_128_ecb@plt>
  xor    %r8d,%r8d
  xor    %edx,%edx
  mov    %r12,%rcx
  mov    %eax,%esi
  mov    %rbp,%rdi
  call   <EVP_EncryptInit_ex@plt>
  cmp    $0x1,%eax
  je     L77
  mov    %rbp,%rdi
  call   <EVP_CIPHER_CTX_free@plt>
L187:
  xor    %r14d,%r14d
L162:
  mov    0x28(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L10
  add    $0x38,%rsp
  mov    %r14d,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L77:
  xor    %esi,%esi
  mov    %rbp,%rdi
  call   <EVP_CIPHER_CTX_set_padding@plt>
  mov    $0x5e00,%edi
  call   <OPENSSL_malloc@plt>
  mov    %r13,%rsi
  mov    %rax,%r12
  lea    0x20(%rax),%rcx
  lea    0x5e20(%rax),%rdi
  sub    %rax,%rsi
  test   %rax,%rax
  je     L187
  nopl   0x0(%rax)
L78:
  lea    -0x20(%rcx),%rax
  nopl   0x0(%rax)
L39:
  mov    (%rsi,%rax,1),%edx
  add    $0x4,%rax
  mov    %edx,-0x4(%rax)
  cmp    %rcx,%rax
  jne    L39
  lea    0x20(%rax),%rcx
  cmp    %rdi,%rcx
  jne    L78
  mov    $0xbc0,%edi
  call   <OPENSSL_malloc@plt>
  mov    %rax,%r15
  test   %rax,%rax
  je     L187
  mov    $0x5e00,%edi
  call   <OPENSSL_malloc@plt>
  mov    %rax,%r13
  test   %rax,%rax
  je     L187
  lea    0x5e00(%rax),%rsi
  xor    %edi,%edi
  nopl   (%rax)
L175:
  lea    -0x5e00(%rsi),%rax
  mov    %rbx,%rdx
  nopw   0x0(%rax,%rax,1)
L73:
  mov    (%rdx),%ecx
  add    $0xbc0,%rax
  add    $0x4,%rdx
  mov    %ecx,-0xbc0(%rax)
  cmp    %rsi,%rax
  jne    L73
  add    $0x1,%edi
  add    $0x20,%rbx
  lea    0x4(%rax),%rsi
  cmp    $0x2f0,%edi
  jne    L175
  lea    0x24(%rsp),%rax
  lea    0xbc0(%r15),%rbx
  movq   $0x0,0x8(%rsp)
  mov    %rax,0x18(%rsp)
L140:
  mov    $0xbc0,%edx
  xor    %esi,%esi
  mov    %r15,%rdi
  mov    0x8(%rsp),%r14d
  call   <memset@plt>
  mov    %r15,%rdx
  xor    %eax,%eax
  nopl   (%rax)
L18:
  mov    %eax,0x4(%rdx)
  add    $0x8,%eax
  add    $0x20,%rdx
  mov    %r14d,-0x20(%rdx)
  cmp    $0x2f0,%eax
  jne    L18
  mov    0x18(%rsp),%r14
  mov    %r15,%rcx
  mov    %r15,%rsi
  mov    %rbp,%rdi
  mov    $0xbc0,%r8d
  mov    %r14,%rdx
  call   <EVP_EncryptUpdate@plt>
  cmp    $0x1,%eax
  jne    L36
  cmpl   $0xbc0,0x24(%rsp)
  jne    L36
  mov    %r14,%rdx
  mov    %r15,%rsi
  mov    %rbp,%rdi
  call   <EVP_EncryptFinal_ex@plt>
  mov    %eax,%r14d
  cmp    $0x1,%eax
  jne    L36
  mov    0x8(%rsp),%rdi
  mov    %r13,%rsi
  xor    %r8d,%r8d
  sub    %r15,%rsi
  shl    $0x5,%rdi
  add    %r12,%rdi
L54:
  mov    %r15,%rax
  xor    %ecx,%ecx
  nopl   0x0(%rax)
L16:
  mov    (%rsi,%rax,1),%edx
  imul   (%rax),%edx
  add    $0x4,%rax
  add    %edx,%ecx
  cmp    %rax,%rbx
  jne    L16
  add    (%rdi),%ecx
  add    $0x2f0,%r8d
  add    $0x4,%rdi
  add    $0xbc0,%rsi
  mov    %ecx,%eax
  sar    $0x1f,%eax
  shr    $0x11,%eax
  add    %eax,%ecx
  and    $0x7fff,%ecx
  sub    %eax,%ecx
  mov    %ecx,-0x4(%rdi)
  cmp    $0x1780,%r8d
  jne    L54
  addq   $0x1,0x8(%rsp)
  mov    0x8(%rsp),%rax
  cmp    $0x2f0,%rax
  jne    L140
  mov    0x10(%rsp),%rdi
  mov    $0x1780,%ecx
  mov    %r12,%rdx
  mov    $0x2c10,%esi
  mov    $0xf,%r8d
  call   <lwe_pack@plt>
L158:
  mov    %rbp,%rdi
  call   <EVP_CIPHER_CTX_free@plt>
  mov    $0x5e00,%esi
  mov    %r12,%rdi
  call   <OPENSSL_cleanse@plt>
  mov    %r12,%rdi
  call   <OPENSSL_free@plt>
  mov    $0xbc0,%esi
  mov    %r15,%rdi
  call   <OPENSSL_cleanse@plt>
  mov    %r15,%rdi
  call   <OPENSSL_free@plt>
  mov    %r13,%rdi
  mov    $0x5e00,%esi
  call   <OPENSSL_cleanse@plt>
  mov    %r13,%rdi
  call   <OPENSSL_free@plt>
  jmp    L162
L36:
  xor    %r14d,%r14d
  jmp    L158
L10:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
int lwe_key_gen_server_gen_a(unsigned char *out, const uint8_t *seed, const uint16_t *s, const uint16_t *e) {
  int i, j, k;
  int ret = 0;
  uint16_t *out_unpacked = NULL;
  uint16_t *a_row = NULL;
  uint16_t *s_transpose = NULL;
  EVP_CIPHER_CTX *aes_ctx = EVP_CIPHER_CTX_new();
  if (aes_ctx == NULL) {
    goto err;
  }
  if (1 != EVP_EncryptInit_ex(aes_ctx, EVP_aes_128_ecb(), NULL, seed, NULL)) {
    goto err;
  }
  EVP_CIPHER_CTX_set_padding(aes_ctx, 0);
  out_unpacked = (uint16_t *)OPENSSL_malloc(8 * 752 * sizeof(int16_t));
  if (out_unpacked == NULL) {
    return 0;
  }
  for (i = 0; i < 752; i++)
    for (j = 0; j < 8; j++) {
      out_unpacked[i * 8 + j] = e[i * 8 + j];
    }
  size_t a_rowlen = 752 * sizeof(int16_t);
  a_row = (uint16_t *)OPENSSL_malloc(a_rowlen);
  if (a_row == NULL) {
    return 0;
  }
  s_transpose = (uint16_t *)OPENSSL_malloc(8 * 752 * sizeof(int16_t));
  if (s_transpose == NULL) {
    return 0;
  }
  for (j = 0; j < 752; j++)
    for (k = 0; k < 8; k++) {
      s_transpose[k * 752 + j] = s[j * 8 + k];
    }
  for (i = 0; i < 752; i++) {
    memset(a_row, 0, a_rowlen);
    for (j = 0; j < 752; j += 8) {
      a_row[j] = i;
      a_row[j + 1] = j;
    }
    int outlen;
    if (1 != EVP_EncryptUpdate(aes_ctx, (unsigned char *)a_row, &outlen, (unsigned char *)a_row, a_rowlen) || ((size_t)outlen != a_rowlen)) {
      goto err;
    }
    if (1 != EVP_EncryptFinal_ex(aes_ctx, (unsigned char *)a_row, &outlen)) {
      goto err;
    }
    for (k = 0; k < 8; k++) {
      uint16_t sum = 0;
      for (j = 0; j < 752; j++) {
        sum += a_row[j] * s_transpose[k * 752 + j];
      }
      out_unpacked[i * 8 + k] += sum;
      out_unpacked[i * 8 + k] %= (1 << 15);
    }
  }
  lwe_pack(out, (((8 * 752 * 15) + (8) - 1) / 8), out_unpacked, 752 * 8, 15);
  ret = 1;
err:
  if (aes_ctx != NULL) {
    EVP_CIPHER_CTX_free(aes_ctx);
  }
  if (out_unpacked != NULL) {
    OPENSSL_cleanse(out_unpacked, 8 * 752 * sizeof(uint16_t));
    OPENSSL_free(out_unpacked);
  }
  if (a_row != NULL) {
    OPENSSL_cleanse(a_row, a_rowlen);
    OPENSSL_free(a_row);
  }
  if (s_transpose != NULL) {
    OPENSSL_cleanse(s_transpose, 8 * 752 * sizeof(uint16_t));
    OPENSSL_free(s_transpose);
  }
  return ret;
}
```