#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int uint16_t;
typedef int /*<<< orphan*/ int16_t;
typedef int /*<<< orphan*/ EVP_CIPHER_CTX;

/* Variables and functions */
int /*<<< orphan*/ EVP_CIPHER_CTX_free(int /*<<< orphan*/ *);
int /*<<< orphan*/ *EVP_CIPHER_CTX_new();
int /*<<< orphan*/ EVP_CIPHER_CTX_set_padding(int /*<<< orphan*/ *,
                                              int /*<<< orphan*/);
int EVP_EncryptFinal_ex(int /*<<< orphan*/ *, unsigned char *, int *);
int EVP_EncryptInit_ex(int /*<<< orphan*/ *, int /*<<< orphan*/,
                       int /*<<< orphan*/ *, int /*<<< orphan*/ const *,
                       int /*<<< orphan*/ *);
int EVP_EncryptUpdate(int /*<<< orphan*/ *, unsigned char *, int *,
                      unsigned char *, size_t);
int /*<<< orphan*/ EVP_aes_128_ecb();
int /*<<< orphan*/ OPENSSL_cleanse(int *, int);
int /*<<< orphan*/ OPENSSL_free(int *);
scalar_t__ OPENSSL_malloc(int);
int /*<<< orphan*/ lwe_pack(unsigned char *, int, int *, int, int);
int /*<<< orphan*/ memset(int *, int /*<<< orphan*/, size_t);
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;
}


x86 assembly (clang, -O0):
<lwe_key_gen_server_gen_a>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %rcx,-0x28(%rbp)
movl   $0x0,-0x38(%rbp)
movq   $0x0,-0x40(%rbp)
movq   $0x0,-0x48(%rbp)
movq   $0x0,-0x50(%rbp)
mov    $0x0,%al
call   10d0 <EVP_CIPHER_CTX_new@plt>
mov    %rax,-0x58(%rbp)
cmpq   $0x0,-0x58(%rbp)
jne    1215 <lwe_key_gen_server_gen_a+0x55>
jmp    1555 <lwe_key_gen_server_gen_a+0x395>
mov    -0x58(%rbp),%rax
mov    %rax,-0x70(%rbp)
mov    $0x0,%al
call   1070 <EVP_aes_128_ecb@plt>
mov    -0x70(%rbp),%rdi
mov    %eax,%esi
mov    -0x18(%rbp),%rcx
xor    %eax,%eax
mov    %eax,%r8d
mov    %r8,%rdx
call   10b0 <EVP_EncryptInit_ex@plt>
mov    %eax,%ecx
mov    $0x1,%eax
cmp    %ecx,%eax
je     124f <lwe_key_gen_server_gen_a+0x8f>
jmp    1555 <lwe_key_gen_server_gen_a+0x395>
mov    -0x58(%rbp),%rdi
xor    %esi,%esi
call   1080 <EVP_CIPHER_CTX_set_padding@plt>
mov    $0x5e00,%edi
call   10a0 <OPENSSL_malloc@plt>
mov    %rax,-0x40(%rbp)
cmpq   $0x0,-0x40(%rbp)
jne    127f <lwe_key_gen_server_gen_a+0xbf>
movl   $0x0,-0x4(%rbp)
jmp    15d6 <lwe_key_gen_server_gen_a+0x416>
movl   $0x0,-0x2c(%rbp)
cmpl   $0x2f0,-0x2c(%rbp)
jge    12eb <lwe_key_gen_server_gen_a+0x12b>
movl   $0x0,-0x30(%rbp)
cmpl   $0x8,-0x30(%rbp)
jge    12d8 <lwe_key_gen_server_gen_a+0x118>
mov    -0x28(%rbp),%rax
mov    -0x2c(%rbp),%ecx
shl    $0x3,%ecx
add    -0x30(%rbp),%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,4),%edx
mov    -0x40(%rbp),%rax
mov    -0x2c(%rbp),%ecx
shl    $0x3,%ecx
add    -0x30(%rbp),%ecx
movslq %ecx,%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x30(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x30(%rbp)
jmp    129a <lwe_key_gen_server_gen_a+0xda>
jmp    12dd <lwe_key_gen_server_gen_a+0x11d>
mov    -0x2c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2c(%rbp)
jmp    1286 <lwe_key_gen_server_gen_a+0xc6>
movq   $0xbc0,-0x60(%rbp)
mov    -0x60(%rbp),%rax
mov    %eax,%edi
call   10a0 <OPENSSL_malloc@plt>
mov    %rax,-0x48(%rbp)
cmpq   $0x0,-0x48(%rbp)
jne    1319 <lwe_key_gen_server_gen_a+0x159>
movl   $0x0,-0x4(%rbp)
jmp    15d6 <lwe_key_gen_server_gen_a+0x416>
mov    $0x5e00,%edi
call   10a0 <OPENSSL_malloc@plt>
mov    %rax,-0x50(%rbp)
cmpq   $0x0,-0x50(%rbp)
jne    133e <lwe_key_gen_server_gen_a+0x17e>
movl   $0x0,-0x4(%rbp)
jmp    15d6 <lwe_key_gen_server_gen_a+0x416>
movl   $0x0,-0x30(%rbp)
cmpl   $0x2f0,-0x30(%rbp)
jge    13ab <lwe_key_gen_server_gen_a+0x1eb>
movl   $0x0,-0x34(%rbp)
cmpl   $0x8,-0x34(%rbp)
jge    1398 <lwe_key_gen_server_gen_a+0x1d8>
mov    -0x20(%rbp),%rax
mov    -0x30(%rbp),%ecx
shl    $0x3,%ecx
add    -0x34(%rbp),%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,4),%edx
mov    -0x50(%rbp),%rax
imul   $0x2f0,-0x34(%rbp),%ecx
add    -0x30(%rbp),%ecx
movslq %ecx,%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    1359 <lwe_key_gen_server_gen_a+0x199>
jmp    139d <lwe_key_gen_server_gen_a+0x1dd>
mov    -0x30(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x30(%rbp)
jmp    1345 <lwe_key_gen_server_gen_a+0x185>
movl   $0x0,-0x2c(%rbp)
cmpl   $0x2f0,-0x2c(%rbp)
jge    1531 <lwe_key_gen_server_gen_a+0x371>
mov    -0x48(%rbp),%rdi
mov    -0x60(%rbp),%rdx
xor    %esi,%esi
call   1030 <memset@plt>
movl   $0x0,-0x30(%rbp)
cmpl   $0x2f0,-0x30(%rbp)
jge    1411 <lwe_key_gen_server_gen_a+0x251>
mov    -0x2c(%rbp),%edx
mov    -0x48(%rbp),%rax
movslq -0x30(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x30(%rbp),%edx
mov    -0x48(%rbp),%rax
mov    -0x30(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x30(%rbp),%eax
add    $0x8,%eax
mov    %eax,-0x30(%rbp)
jmp    13d5 <lwe_key_gen_server_gen_a+0x215>
mov    -0x58(%rbp),%rdi
mov    -0x48(%rbp),%rsi
mov    -0x48(%rbp),%rcx
mov    -0x60(%rbp),%r8
lea    -0x64(%rbp),%rdx
call   1060 <EVP_EncryptUpdate@plt>
mov    %eax,%ecx
mov    $0x1,%eax
cmp    %ecx,%eax
jne    1447 <lwe_key_gen_server_gen_a+0x287>
movslq -0x64(%rbp),%rax
cmp    -0x60(%rbp),%rax
je     144c <lwe_key_gen_server_gen_a+0x28c>
jmp    1555 <lwe_key_gen_server_gen_a+0x395>
mov    -0x58(%rbp),%rdi
mov    -0x48(%rbp),%rsi
lea    -0x64(%rbp),%rdx
call   1090 <EVP_EncryptFinal_ex@plt>
mov    %eax,%ecx
mov    $0x1,%eax
cmp    %ecx,%eax
je     1471 <lwe_key_gen_server_gen_a+0x2b1>
jmp    1555 <lwe_key_gen_server_gen_a+0x395>
movl   $0x0,-0x34(%rbp)
cmpl   $0x8,-0x34(%rbp)
jge    151e <lwe_key_gen_server_gen_a+0x35e>
movl   $0x0,-0x68(%rbp)
movl   $0x0,-0x30(%rbp)
cmpl   $0x2f0,-0x30(%rbp)
jge    14d1 <lwe_key_gen_server_gen_a+0x311>
mov    -0x48(%rbp),%rax
movslq -0x30(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
mov    -0x50(%rbp),%rcx
imul   $0x2f0,-0x34(%rbp),%edx
add    -0x30(%rbp),%edx
movslq %edx,%rdx
imul   (%rcx,%rdx,4),%eax
add    -0x68(%rbp),%eax
mov    %eax,-0x68(%rbp)
mov    -0x30(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x30(%rbp)
jmp    1490 <lwe_key_gen_server_gen_a+0x2d0>
mov    -0x68(%rbp),%edx
mov    -0x40(%rbp),%rax
mov    -0x2c(%rbp),%ecx
shl    $0x3,%ecx
add    -0x34(%rbp),%ecx
movslq %ecx,%rcx
add    (%rax,%rcx,4),%edx
mov    %edx,(%rax,%rcx,4)
mov    -0x40(%rbp),%rax
mov    %rax,-0x78(%rbp)
mov    -0x2c(%rbp),%ecx
shl    $0x3,%ecx
add    -0x34(%rbp),%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,4),%eax
mov    $0x8000,%esi
cltd
idiv   %esi
mov    -0x78(%rbp),%rax
mov    %edx,(%rax,%rcx,4)
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    1478 <lwe_key_gen_server_gen_a+0x2b8>
jmp    1523 <lwe_key_gen_server_gen_a+0x363>
mov    -0x2c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2c(%rbp)
jmp    13b2 <lwe_key_gen_server_gen_a+0x1f2>
mov    -0x10(%rbp),%rdi
mov    -0x40(%rbp),%rdx
mov    $0x2c10,%esi
mov    $0x1780,%ecx
mov    $0xf,%r8d
call   10c0 <lwe_pack@plt>
movl   $0x1,-0x38(%rbp)
cmpq   $0x0,-0x58(%rbp)
je     1569 <lwe_key_gen_server_gen_a+0x3a9>
mov    -0x58(%rbp),%rdi
call   1050 <EVP_CIPHER_CTX_free@plt>
cmpq   $0x0,-0x40(%rbp)
je     158b <lwe_key_gen_server_gen_a+0x3cb>
mov    -0x40(%rbp),%rdi
mov    $0x5e00,%esi
call   1040 <OPENSSL_cleanse@plt>
mov    -0x40(%rbp),%rdi
call   10e0 <OPENSSL_free@plt>
cmpq   $0x0,-0x48(%rbp)
je     15ae <lwe_key_gen_server_gen_a+0x3ee>
mov    -0x48(%rbp),%rdi
mov    -0x60(%rbp),%rax
mov    %eax,%esi
call   1040 <OPENSSL_cleanse@plt>
mov    -0x48(%rbp),%rdi
call   10e0 <OPENSSL_free@plt>
cmpq   $0x0,-0x50(%rbp)
je     15d0 <lwe_key_gen_server_gen_a+0x410>
mov    -0x50(%rbp),%rdi
mov    $0x5e00,%esi
call   1040 <OPENSSL_cleanse@plt>
mov    -0x50(%rbp),%rdi
call   10e0 <OPENSSL_free@plt>
mov    -0x38(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lwe_key_gen_server_gen_a>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
mov    %rcx,%rbx
mov    %rdx,%r14
mov    %rsi,%r12
mov    %rdi,0x10(%rsp)
xor    %r15d,%r15d
xor    %eax,%eax
call   10d0 <EVP_CIPHER_CTX_new@plt>
test   %rax,%rax
je     156e <lwe_key_gen_server_gen_a+0x3ae>
mov    %rax,%rbp
xor    %r15d,%r15d
xor    %eax,%eax
call   1070 <EVP_aes_128_ecb@plt>
mov    %rbp,%rdi
mov    %eax,%esi
xor    %edx,%edx
mov    %r12,%rcx
xor    %r8d,%r8d
call   10b0 <EVP_EncryptInit_ex@plt>
cmp    $0x1,%eax
jne    1566 <lwe_key_gen_server_gen_a+0x3a6>
xor    %r15d,%r15d
mov    %rbp,%rdi
xor    %esi,%esi
call   1080 <EVP_CIPHER_CTX_set_padding@plt>
mov    $0x5e00,%edi
call   10a0 <OPENSSL_malloc@plt>
test   %rax,%rax
je     156e <lwe_key_gen_server_gen_a+0x3ae>
mov    %rax,%r13
mov    $0x1c,%eax
nop
mov    -0x1c(%rbx,%rax,1),%ecx
mov    %ecx,-0x1c(%r13,%rax,1)
mov    -0x18(%rbx,%rax,1),%ecx
mov    %ecx,-0x18(%r13,%rax,1)
mov    -0x14(%rbx,%rax,1),%ecx
mov    %ecx,-0x14(%r13,%rax,1)
mov    -0x10(%rbx,%rax,1),%ecx
mov    %ecx,-0x10(%r13,%rax,1)
mov    -0xc(%rbx,%rax,1),%ecx
mov    %ecx,-0xc(%r13,%rax,1)
mov    -0x8(%rbx,%rax,1),%ecx
mov    %ecx,-0x8(%r13,%rax,1)
mov    -0x4(%rbx,%rax,1),%ecx
mov    %ecx,-0x4(%r13,%rax,1)
mov    (%rbx,%rax,1),%ecx
mov    %ecx,0x0(%r13,%rax,1)
add    $0x20,%rax
cmp    $0x5e1c,%rax
jne    1240 <lwe_key_gen_server_gen_a+0x80>
mov    $0xbc0,%edi
call   10a0 <OPENSSL_malloc@plt>
test   %rax,%rax
je     156e <lwe_key_gen_server_gen_a+0x3ae>
mov    %rax,%rbx
mov    $0x5e00,%edi
call   10a0 <OPENSSL_malloc@plt>
test   %rax,%rax
je     156e <lwe_key_gen_server_gen_a+0x3ae>
mov    %rax,%r12
mov    %rbp,0x8(%rsp)
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
mov    (%r14,%rax,8),%ecx
mov    %ecx,(%r12,%rax,1)
mov    0x4(%r14,%rax,8),%ecx
mov    %ecx,0xbc0(%r12,%rax,1)
mov    0x8(%r14,%rax,8),%ecx
mov    %ecx,0x1780(%r12,%rax,1)
mov    0xc(%r14,%rax,8),%ecx
mov    %ecx,0x2340(%r12,%rax,1)
mov    0x10(%r14,%rax,8),%ecx
mov    %ecx,0x2f00(%r12,%rax,1)
mov    0x14(%r14,%rax,8),%ecx
mov    %ecx,0x3ac0(%r12,%rax,1)
mov    0x18(%r14,%rax,8),%ecx
mov    %ecx,0x4680(%r12,%rax,1)
mov    0x1c(%r14,%rax,8),%ecx
mov    %ecx,0x5240(%r12,%rax,1)
add    $0x4,%rax
cmp    $0xbc0,%rax
jne    12d0 <lwe_key_gen_server_gen_a+0x110>
xor    %r15d,%r15d
lea    0x4(%rsp),%r14
mov    0x8(%rsp),%rbp
nopl   0x0(%rax)
mov    $0xbc0,%edx
mov    %rbx,%rdi
xor    %esi,%esi
call   1030 <memset@plt>
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %r15d,(%rbx,%rax,4)
mov    %eax,0x4(%rbx,%rax,4)
mov    %r15d,0x20(%rbx,%rax,4)
lea    0x8(%rax),%rcx
mov    %ecx,0x24(%rbx,%rax,4)
add    $0x10,%rax
cmp    $0x2e8,%rcx
jb     1370 <lwe_key_gen_server_gen_a+0x1b0>
mov    $0xbc0,%r8d
mov    %rbp,%rdi
mov    %rbx,%rsi
mov    %r14,%rdx
mov    %rbx,%rcx
call   1060 <EVP_EncryptUpdate@plt>
cmp    $0x1,%eax
jne    1580 <lwe_key_gen_server_gen_a+0x3c0>
cmpl   $0xbc0,0x4(%rsp)
jne    1580 <lwe_key_gen_server_gen_a+0x3c0>
mov    %rbp,%rdi
mov    %rbx,%rsi
mov    %r14,%rdx
call   1090 <EVP_EncryptFinal_ex@plt>
cmp    $0x1,%eax
jne    1580 <lwe_key_gen_server_gen_a+0x3c0>
lea    0x0(,%r15,8),%r8
mov    %r12,%rcx
xor    %edx,%edx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
pxor   %xmm0,%xmm0
mov    $0xc,%esi
pxor   %xmm1,%xmm1
nopl   (%rax)
movdqu -0x30(%rbx,%rsi,4),%xmm5
movdqu -0x20(%rbx,%rsi,4),%xmm10
movdqu -0x10(%rbx,%rsi,4),%xmm9
movdqu (%rbx,%rsi,4),%xmm8
movdqu -0x30(%rcx,%rsi,4),%xmm7
movdqu -0x20(%rcx,%rsi,4),%xmm2
movdqu -0x10(%rcx,%rsi,4),%xmm4
movdqu (%rcx,%rsi,4),%xmm3
pshufd $0xf5,%xmm7,%xmm6
pmuludq %xmm5,%xmm7
pshufd $0xe8,%xmm7,%xmm7
pshufd $0xf5,%xmm5,%xmm5
pmuludq %xmm6,%xmm5
pshufd $0xe8,%xmm5,%xmm5
punpckldq %xmm5,%xmm7
paddd  %xmm0,%xmm7
pshufd $0xf5,%xmm2,%xmm0
pmuludq %xmm10,%xmm2
pshufd $0xe8,%xmm2,%xmm2
pshufd $0xf5,%xmm10,%xmm5
pmuludq %xmm0,%xmm5
pshufd $0xe8,%xmm5,%xmm0
punpckldq %xmm0,%xmm2
paddd  %xmm1,%xmm2
pshufd $0xf5,%xmm4,%xmm1
pmuludq %xmm9,%xmm4
pshufd $0xe8,%xmm4,%xmm0
pshufd $0xf5,%xmm9,%xmm4
pmuludq %xmm1,%xmm4
pshufd $0xe8,%xmm4,%xmm1
punpckldq %xmm1,%xmm0
paddd  %xmm7,%xmm0
pshufd $0xf5,%xmm3,%xmm4
pmuludq %xmm8,%xmm3
pshufd $0xe8,%xmm3,%xmm1
pshufd $0xf5,%xmm8,%xmm3
pmuludq %xmm4,%xmm3
pshufd $0xe8,%xmm3,%xmm3
punpckldq %xmm3,%xmm1
paddd  %xmm2,%xmm1
add    $0x10,%rsi
cmp    $0x2fc,%rsi
jne    1400 <lwe_key_gen_server_gen_a+0x240>
paddd  %xmm0,%xmm1
pshufd $0xee,%xmm1,%xmm0
paddd  %xmm1,%xmm0
pshufd $0x55,%xmm0,%xmm1
paddd  %xmm0,%xmm1
movd   %xmm1,%esi
lea    (%rdx,%r8,1),%rdi
mov    0x0(%r13,%rdi,4),%eax
lea    (%rax,%rsi,1),%ebp
add    $0x7fff,%ebp
add    %esi,%eax
cmovns %eax,%ebp
and    $0xffff8000,%ebp
sub    %ebp,%eax
mov    %eax,0x0(%r13,%rdi,4)
add    $0x1,%rdx
add    $0xbc0,%rcx
cmp    $0x8,%rdx
jne    13f0 <lwe_key_gen_server_gen_a+0x230>
add    $0x1,%r15
cmp    $0x2f0,%r15
mov    0x8(%rsp),%rbp
jne    1350 <lwe_key_gen_server_gen_a+0x190>
mov    0x10(%rsp),%rdi
mov    $0x2c10,%esi
mov    %r13,%rdx
mov    $0x1780,%ecx
mov    $0xf,%r8d
call   10c0 <lwe_pack@plt>
mov    $0x1,%r15d
jmp    1583 <lwe_key_gen_server_gen_a+0x3c3>
mov    %rbp,%rdi
call   1050 <EVP_CIPHER_CTX_free@plt>
mov    %r15d,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
xor    %r15d,%r15d
mov    %rbp,%rdi
call   1050 <EVP_CIPHER_CTX_free@plt>
mov    %r13,%rdi
mov    $0x5e00,%esi
call   1040 <OPENSSL_cleanse@plt>
mov    %r13,%rdi
call   10e0 <OPENSSL_free@plt>
mov    %rbx,%rdi
mov    $0xbc0,%esi
call   1040 <OPENSSL_cleanse@plt>
mov    %rbx,%rdi
call   10e0 <OPENSSL_free@plt>
mov    %r12,%rdi
mov    $0x5e00,%esi
call   1040 <OPENSSL_cleanse@plt>
mov    %r12,%rdi
call   10e0 <OPENSSL_free@plt>
jmp    156e <lwe_key_gen_server_gen_a+0x3ae>

LLVM IR (-O0):
define i32 @lwe_key_gen_server_gen_a(i8* %0, i32* %1, i32* %2, i32* %3) {
%5 = alloca i32
%6 = alloca i8*
%7 = alloca i32*
%8 = alloca i32*
%9 = alloca i32*
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
%14 = alloca i32*
%15 = alloca i32*
%16 = alloca i32*
%17 = alloca i32*
%18 = alloca i64
%19 = alloca i32
%20 = alloca i32
store i8* %0, i8** %6
store i32* %1, i32** %7
store i32* %2, i32** %8
store i32* %3, i32** %9
store i32 0, i32* %13
store i32* null, i32** %14
store i32* null, i32** %15
store i32* null, i32** %16
%21 = call i32* (...) @EVP_CIPHER_CTX_new()
store i32* %21, i32** %17
%22 = load i32*, i32** %17
%23 = icmp eq i32* %22, null
br i1 %23, label %24, label %25
24: ; preds = %4
br label %223
25: ; preds = %4
%26 = load i32*, i32** %17
%27 = call i32 (...) @EVP_aes_128_ecb()
%28 = load i32*, i32** %7
%29 = call i32 @EVP_EncryptInit_ex(i32* %26, i32 %27, i32* null, i32* %28, i32* null)
%30 = icmp ne i32 1, %29
br i1 %30, label %31, label %32
31: ; preds = %25
br label %223
32: ; preds = %25
%33 = load i32*, i32** %17
%34 = call i32 @EVP_CIPHER_CTX_set_padding(i32* %33, i32 0)
%35 = call i64 @OPENSSL_malloc(i32 24064)
%36 = inttoptr i64 %35 to i32*
store i32* %36, i32** %14
%37 = load i32*, i32** %14
%38 = icmp eq i32* %37, null
br i1 %38, label %39, label %40
39: ; preds = %32
store i32 0, i32* %5
br label %257
40: ; preds = %32
store i32 0, i32* %10
br label %41
41: ; preds = %68, %40
%42 = load i32, i32* %10
%43 = icmp slt i32 %42, 752
br i1 %43, label %44, label %71
44: ; preds = %41
store i32 0, i32* %11
br label %45
45: ; preds = %64, %44
%46 = load i32, i32* %11
%47 = icmp slt i32 %46, 8
br i1 %47, label %48, label %67
48: ; preds = %45
%49 = load i32*, i32** %9
%50 = load i32, i32* %10
%51 = mul nsw i32 %50, 8
%52 = load i32, i32* %11
%53 = add nsw i32 %51, %52
%54 = sext i32 %53 to i64
%55 = getelementptr inbounds i32, i32* %49, i64 %54
%56 = load i32, i32* %55
%57 = load i32*, i32** %14
%58 = load i32, i32* %10
%59 = mul nsw i32 %58, 8
%60 = load i32, i32* %11
%61 = add nsw i32 %59, %60
%62 = sext i32 %61 to i64
%63 = getelementptr inbounds i32, i32* %57, i64 %62
store i32 %56, i32* %63
br label %64
64: ; preds = %48
%65 = load i32, i32* %11
%66 = add nsw i32 %65, 1
store i32 %66, i32* %11
br label %45
67: ; preds = %45
br label %68
68: ; preds = %67
%69 = load i32, i32* %10
%70 = add nsw i32 %69, 1
store i32 %70, i32* %10
br label %41
71: ; preds = %41
store i64 3008, i64* %18
%72 = load i64, i64* %18
%73 = trunc i64 %72 to i32
%74 = call i64 @OPENSSL_malloc(i32 %73)
%75 = inttoptr i64 %74 to i32*
store i32* %75, i32** %15
%76 = load i32*, i32** %15
%77 = icmp eq i32* %76, null
br i1 %77, label %78, label %79
78: ; preds = %71
store i32 0, i32* %5
br label %257
79: ; preds = %71
%80 = call i64 @OPENSSL_malloc(i32 24064)
%81 = inttoptr i64 %80 to i32*
store i32* %81, i32** %16
%82 = load i32*, i32** %16
%83 = icmp eq i32* %82, null
br i1 %83, label %84, label %85
84: ; preds = %79
store i32 0, i32* %5
br label %257
85: ; preds = %79
store i32 0, i32* %11
br label %86
86: ; preds = %113, %85
%87 = load i32, i32* %11
%88 = icmp slt i32 %87, 752
br i1 %88, label %89, label %116
89: ; preds = %86
store i32 0, i32* %12
br label %90
90: ; preds = %109, %89
%91 = load i32, i32* %12
%92 = icmp slt i32 %91, 8
br i1 %92, label %93, label %112
93: ; preds = %90
%94 = load i32*, i32** %8
%95 = load i32, i32* %11
%96 = mul nsw i32 %95, 8
%97 = load i32, i32* %12
%98 = add nsw i32 %96, %97
%99 = sext i32 %98 to i64
%100 = getelementptr inbounds i32, i32* %94, i64 %99
%101 = load i32, i32* %100
%102 = load i32*, i32** %16
%103 = load i32, i32* %12
%104 = mul nsw i32 %103, 752
%105 = load i32, i32* %11
%106 = add nsw i32 %104, %105
%107 = sext i32 %106 to i64
%108 = getelementptr inbounds i32, i32* %102, i64 %107
store i32 %101, i32* %108
br label %109
109: ; preds = %93
%110 = load i32, i32* %12
%111 = add nsw i32 %110, 1
store i32 %111, i32* %12
br label %90
112: ; preds = %90
br label %113
113: ; preds = %112
%114 = load i32, i32* %11
%115 = add nsw i32 %114, 1
store i32 %115, i32* %11
br label %86
116: ; preds = %86
store i32 0, i32* %10
br label %117
117: ; preds = %216, %116
%118 = load i32, i32* %10
%119 = icmp slt i32 %118, 752
br i1 %119, label %120, label %219
120: ; preds = %117
%121 = load i32*, i32** %15
%122 = load i64, i64* %18
%123 = call i32 @memset(i32* %121, i32 0, i64 %122)
store i32 0, i32* %11
br label %124
124: ; preds = %139, %120
%125 = load i32, i32* %11
%126 = icmp slt i32 %125, 752
br i1 %126, label %127, label %142
127: ; preds = %124
%128 = load i32, i32* %10
%129 = load i32*, i32** %15
%130 = load i32, i32* %11
%131 = sext i32 %130 to i64
%132 = getelementptr inbounds i32, i32* %129, i64 %131
store i32 %128, i32* %132
%133 = load i32, i32* %11
%134 = load i32*, i32** %15
%135 = load i32, i32* %11
%136 = add nsw i32 %135, 1
%137 = sext i32 %136 to i64
%138 = getelementptr inbounds i32, i32* %134, i64 %137
store i32 %133, i32* %138
br label %139
139: ; preds = %127
%140 = load i32, i32* %11
%141 = add nsw i32 %140, 8
store i32 %141, i32* %11
br label %124
142: ; preds = %124
%143 = load i32*, i32** %17
%144 = load i32*, i32** %15
%145 = bitcast i32* %144 to i8*
%146 = load i32*, i32** %15
%147 = bitcast i32* %146 to i8*
%148 = load i64, i64* %18
%149 = call i32 @EVP_EncryptUpdate(i32* %143, i8* %145, i32* %19, i8* %147, i64 %148)
%150 = icmp ne i32 1, %149
br i1 %150, label %156, label %151
151: ; preds = %142
%152 = load i32, i32* %19
%153 = sext i32 %152 to i64
%154 = load i64, i64* %18
%155 = icmp ne i64 %153, %154
br i1 %155, label %156, label %157
156: ; preds = %151, %142
br label %223
157: ; preds = %151
%158 = load i32*, i32** %17
%159 = load i32*, i32** %15
%160 = bitcast i32* %159 to i8*
%161 = call i32 @EVP_EncryptFinal_ex(i32* %158, i8* %160, i32* %19)
%162 = icmp ne i32 1, %161
br i1 %162, label %163, label %164
163: ; preds = %157
br label %223
164: ; preds = %157
store i32 0, i32* %12
br label %165
165: ; preds = %212, %164
%166 = load i32, i32* %12
%167 = icmp slt i32 %166, 8
br i1 %167, label %168, label %215
168: ; preds = %165
store i32 0, i32* %20
store i32 0, i32* %11
br label %169
169: ; preds = %189, %168
%170 = load i32, i32* %11
%171 = icmp slt i32 %170, 752
br i1 %171, label %172, label %192
172: ; preds = %169
%173 = load i32*, i32** %15
%174 = load i32, i32* %11
%175 = sext i32 %174 to i64
%176 = getelementptr inbounds i32, i32* %173, i64 %175
%177 = load i32, i32* %176
%178 = load i32*, i32** %16
%179 = load i32, i32* %12
%180 = mul nsw i32 %179, 752
%181 = load i32, i32* %11
%182 = add nsw i32 %180, %181
%183 = sext i32 %182 to i64
%184 = getelementptr inbounds i32, i32* %178, i64 %183
%185 = load i32, i32* %184
%186 = mul nsw i32 %177, %185
%187 = load i32, i32* %20
%188 = add nsw i32 %187, %186
store i32 %188, i32* %20
br label %189
189: ; preds = %172
%190 = load i32, i32* %11
%191 = add nsw i32 %190, 1
store i32 %191, i32* %11
br label %169
192: ; preds = %169
%193 = load i32, i32* %20
%194 = load i32*, i32** %14
%195 = load i32, i32* %10
%196 = mul nsw i32 %195, 8
%197 = load i32, i32* %12
%198 = add nsw i32 %196, %197
%199 = sext i32 %198 to i64
%200 = getelementptr inbounds i32, i32* %194, i64 %199
%201 = load i32, i32* %200
%202 = add nsw i32 %201, %193
store i32 %202, i32* %200
%203 = load i32*, i32** %14
%204 = load i32, i32* %10
%205 = mul nsw i32 %204, 8
%206 = load i32, i32* %12
%207 = add nsw i32 %205, %206
%208 = sext i32 %207 to i64
%209 = getelementptr inbounds i32, i32* %203, i64 %208
%210 = load i32, i32* %209
%211 = srem i32 %210, 32768
store i32 %211, i32* %209
br label %212
212: ; preds = %192
%213 = load i32, i32* %12
%214 = add nsw i32 %213, 1
store i32 %214, i32* %12
br label %165
215: ; preds = %165
br label %216
216: ; preds = %215
%217 = load i32, i32* %10
%218 = add nsw i32 %217, 1
store i32 %218, i32* %10
br label %117
219: ; preds = %117
%220 = load i8*, i8** %6
%221 = load i32*, i32** %14
%222 = call i32 @lwe_pack(i8* %220, i32 11280, i32* %221, i32 6016, i32 15)
store i32 1, i32* %13
br label %223
223: ; preds = %219, %163, %156, %31, %24
%224 = load i32*, i32** %17
%225 = icmp ne i32* %224, null
br i1 %225, label %226, label %229
226: ; preds = %223
%227 = load i32*, i32** %17
%228 = call i32 @EVP_CIPHER_CTX_free(i32* %227)
br label %229
229: ; preds = %226, %223
%230 = load i32*, i32** %14
%231 = icmp ne i32* %230, null
br i1 %231, label %232, label %237
232: ; preds = %229
%233 = load i32*, i32** %14
%234 = call i32 @OPENSSL_cleanse(i32* %233, i32 24064)
%235 = load i32*, i32** %14
%236 = call i32 @OPENSSL_free(i32* %235)
br label %237
237: ; preds = %232, %229
%238 = load i32*, i32** %15
%239 = icmp ne i32* %238, null
br i1 %239, label %240, label %247
240: ; preds = %237
%241 = load i32*, i32** %15
%242 = load i64, i64* %18
%243 = trunc i64 %242 to i32
%244 = call i32 @OPENSSL_cleanse(i32* %241, i32 %243)
%245 = load i32*, i32** %15
%246 = call i32 @OPENSSL_free(i32* %245)
br label %247
247: ; preds = %240, %237
%248 = load i32*, i32** %16
%249 = icmp ne i32* %248, null
br i1 %249, label %250, label %255
250: ; preds = %247
%251 = load i32*, i32** %16
%252 = call i32 @OPENSSL_cleanse(i32* %251, i32 24064)
%253 = load i32*, i32** %16
%254 = call i32 @OPENSSL_free(i32* %253)
br label %255
255: ; preds = %250, %247
%256 = load i32, i32* %13
store i32 %256, i32* %5
br label %257
257: ; preds = %255, %84, %78, %39
%258 = load i32, i32* %5
ret i32 %258
}

LLVM IR (-O2):
define i32 @lwe_key_gen_server_gen_a(i8* %0, i32* %1, i32* nocapture %2, i32* nocapture %3) {
%5 = alloca i32
%6 = tail call i32* (...) @EVP_CIPHER_CTX_new()
%7 = icmp eq i32* %6, null
br i1 %7, label %206, label %8
8: ; preds = %4
%9 = tail call i32 (...) @EVP_aes_128_ecb()
%10 = tail call i32 @EVP_EncryptInit_ex(i32* %6, i32 %9, i32* null, i32* %1, i32* null)
%11 = icmp eq i32 %10, 1
br i1 %11, label %12, label %204
12: ; preds = %8
%13 = tail call i32 @EVP_CIPHER_CTX_set_padding(i32* %6, i32 0)
%14 = tail call i64 @OPENSSL_malloc(i32 24064)
%15 = inttoptr i64 %14 to i32*
%16 = icmp eq i64 %14, 0
br i1 %16, label %206, label %17
17: ; preds = %12, %17
%18 = phi i64 [ %51, %17 ], [ 0, %12 ]
%19 = shl nsw i64 %18, 3
%20 = getelementptr inbounds i32, i32* %3, i64 %19
%21 = load i32, i32* %20
%22 = getelementptr inbounds i32, i32* %15, i64 %19
store i32 %21, i32* %22
%23 = or i64 %19, 1
%24 = getelementptr inbounds i32, i32* %3, i64 %23
%25 = load i32, i32* %24
%26 = getelementptr inbounds i32, i32* %15, i64 %23
store i32 %25, i32* %26
%27 = or i64 %19, 2
%28 = getelementptr inbounds i32, i32* %3, i64 %27
%29 = load i32, i32* %28
%30 = getelementptr inbounds i32, i32* %15, i64 %27
store i32 %29, i32* %30
%31 = or i64 %19, 3
%32 = getelementptr inbounds i32, i32* %3, i64 %31
%33 = load i32, i32* %32
%34 = getelementptr inbounds i32, i32* %15, i64 %31
store i32 %33, i32* %34
%35 = or i64 %19, 4
%36 = getelementptr inbounds i32, i32* %3, i64 %35
%37 = load i32, i32* %36
%38 = getelementptr inbounds i32, i32* %15, i64 %35
store i32 %37, i32* %38
%39 = or i64 %19, 5
%40 = getelementptr inbounds i32, i32* %3, i64 %39
%41 = load i32, i32* %40
%42 = getelementptr inbounds i32, i32* %15, i64 %39
store i32 %41, i32* %42
%43 = or i64 %19, 6
%44 = getelementptr inbounds i32, i32* %3, i64 %43
%45 = load i32, i32* %44
%46 = getelementptr inbounds i32, i32* %15, i64 %43
store i32 %45, i32* %46
%47 = or i64 %19, 7
%48 = getelementptr inbounds i32, i32* %3, i64 %47
%49 = load i32, i32* %48
%50 = getelementptr inbounds i32, i32* %15, i64 %47
store i32 %49, i32* %50
%51 = add nuw nsw i64 %18, 1
%52 = icmp eq i64 %51, 752
br i1 %52, label %53, label %17
53: ; preds = %17
%54 = tail call i64 @OPENSSL_malloc(i32 3008)
%55 = inttoptr i64 %54 to i32*
%56 = icmp eq i64 %54, 0
br i1 %56, label %206, label %57
57: ; preds = %53
%58 = tail call i64 @OPENSSL_malloc(i32 24064)
%59 = inttoptr i64 %58 to i32*
%60 = icmp eq i64 %58, 0
br i1 %60, label %206, label %61
61: ; preds = %57, %61
%62 = phi i64 [ %102, %61 ], [ 0, %57 ]
%63 = shl nsw i64 %62, 3
%64 = getelementptr inbounds i32, i32* %2, i64 %63
%65 = load i32, i32* %64
%66 = getelementptr inbounds i32, i32* %59, i64 %62
store i32 %65, i32* %66
%67 = or i64 %63, 1
%68 = getelementptr inbounds i32, i32* %2, i64 %67
%69 = load i32, i32* %68
%70 = add nuw nsw i64 %62, 752
%71 = getelementptr inbounds i32, i32* %59, i64 %70
store i32 %69, i32* %71
%72 = or i64 %63, 2
%73 = getelementptr inbounds i32, i32* %2, i64 %72
%74 = load i32, i32* %73
%75 = add nuw nsw i64 %62, 1504
%76 = getelementptr inbounds i32, i32* %59, i64 %75
store i32 %74, i32* %76
%77 = or i64 %63, 3
%78 = getelementptr inbounds i32, i32* %2, i64 %77
%79 = load i32, i32* %78
%80 = add nuw nsw i64 %62, 2256
%81 = getelementptr inbounds i32, i32* %59, i64 %80
store i32 %79, i32* %81
%82 = or i64 %63, 4
%83 = getelementptr inbounds i32, i32* %2, i64 %82
%84 = load i32, i32* %83
%85 = add nuw nsw i64 %62, 3008
%86 = getelementptr inbounds i32, i32* %59, i64 %85
store i32 %84, i32* %86
%87 = or i64 %63, 5
%88 = getelementptr inbounds i32, i32* %2, i64 %87
%89 = load i32, i32* %88
%90 = add nuw nsw i64 %62, 3760
%91 = getelementptr inbounds i32, i32* %59, i64 %90
store i32 %89, i32* %91
%92 = or i64 %63, 6
%93 = getelementptr inbounds i32, i32* %2, i64 %92
%94 = load i32, i32* %93
%95 = add nuw nsw i64 %62, 4512
%96 = getelementptr inbounds i32, i32* %59, i64 %95
store i32 %94, i32* %96
%97 = or i64 %63, 7
%98 = getelementptr inbounds i32, i32* %2, i64 %97
%99 = load i32, i32* %98
%100 = add nuw nsw i64 %62, 5264
%101 = getelementptr inbounds i32, i32* %59, i64 %100
store i32 %99, i32* %101
%102 = add nuw nsw i64 %62, 1
%103 = icmp eq i64 %102, 752
br i1 %103, label %104, label %61
104: ; preds = %61
%105 = bitcast i32* %5 to i8*
%106 = inttoptr i64 %54 to i8*
br label %107
107: ; preds = %104, %189
%108 = phi i64 [ 0, %104 ], [ %190, %189 ]
%109 = call i32 @memset(i32* %55, i32 0, i64 3008)
%110 = trunc i64 %108 to i32
br label %111
111: ; preds = %111, %107
%112 = phi i64 [ 0, %107 ], [ %122, %111 ]
%113 = getelementptr inbounds i32, i32* %55, i64 %112
store i32 %110, i32* %113
%114 = or i64 %112, 1
%115 = getelementptr inbounds i32, i32* %55, i64 %114
%116 = trunc i64 %112 to i32
store i32 %116, i32* %115
%117 = or i64 %112, 8
%118 = getelementptr inbounds i32, i32* %55, i64 %117
store i32 %110, i32* %118
%119 = or i64 %112, 9
%120 = getelementptr inbounds i32, i32* %55, i64 %119
%121 = trunc i64 %117 to i32
store i32 %121, i32* %120
%122 = add nuw nsw i64 %112, 16
%123 = icmp ult i64 %117, 744
br i1 %123, label %111, label %124
124: ; preds = %111
%125 = call i32 @EVP_EncryptUpdate(i32* %6, i8* %106, i32* %5, i8* %106, i64 3008)
%126 = icmp eq i32 %125, 1
%127 = load i32, i32* %5
%128 = icmp eq i32 %127, 3008
%129 = select i1 %126, i1 %128, i1 false
br i1 %129, label %130, label %194
130: ; preds = %124
%131 = call i32 @EVP_EncryptFinal_ex(i32* %6, i8* %106, i32* %5)
%132 = icmp eq i32 %131, 1
br i1 %132, label %133, label %194
133: ; preds = %130
%134 = shl nsw i64 %108, 3
br label %135
135: ; preds = %133, %179
%136 = phi i64 [ 0, %133 ], [ %187, %179 ]
%137 = mul nuw nsw i64 %136, 752
br label %138
138: ; preds = %138, %135
%139 = phi i64 [ 0, %135 ], [ %177, %138 ]
%140 = phi <4 x i32> [ zeroinitializer, %135 ], [ %175, %138 ]
%141 = phi <4 x i32> [ zeroinitializer, %135 ], [ %176, %138 ]
%142 = getelementptr inbounds i32, i32* %55, i64 %139
%143 = bitcast i32* %142 to <4 x i32>*
%144 = load <4 x i32>, <4 x i32>* %143
%145 = getelementptr inbounds i32, i32* %142, i64 4
%146 = bitcast i32* %145 to <4 x i32>*
%147 = load <4 x i32>, <4 x i32>* %146
%148 = add nuw nsw i64 %139, %137
%149 = getelementptr inbounds i32, i32* %59, i64 %148
%150 = bitcast i32* %149 to <4 x i32>*
%151 = load <4 x i32>, <4 x i32>* %150
%152 = getelementptr inbounds i32, i32* %149, i64 4
%153 = bitcast i32* %152 to <4 x i32>*
%154 = load <4 x i32>, <4 x i32>* %153
%155 = mul nsw <4 x i32> %151, %144
%156 = mul nsw <4 x i32> %154, %147
%157 = add <4 x i32> %155, %140
%158 = add <4 x i32> %156, %141
%159 = or i64 %139, 8
%160 = getelementptr inbounds i32, i32* %55, i64 %159
%161 = bitcast i32* %160 to <4 x i32>*
%162 = load <4 x i32>, <4 x i32>* %161
%163 = getelementptr inbounds i32, i32* %160, i64 4
%164 = bitcast i32* %163 to <4 x i32>*
%165 = load <4 x i32>, <4 x i32>* %164
%166 = add nuw nsw i64 %159, %137
%167 = getelementptr inbounds i32, i32* %59, i64 %166
%168 = bitcast i32* %167 to <4 x i32>*
%169 = load <4 x i32>, <4 x i32>* %168
%170 = getelementptr inbounds i32, i32* %167, i64 4
%171 = bitcast i32* %170 to <4 x i32>*
%172 = load <4 x i32>, <4 x i32>* %171
%173 = mul nsw <4 x i32> %169, %162
%174 = mul nsw <4 x i32> %172, %165
%175 = add <4 x i32> %173, %157
%176 = add <4 x i32> %174, %158
%177 = add nuw nsw i64 %139, 16
%178 = icmp eq i64 %177, 752
br i1 %178, label %179, label %138
179: ; preds = %138
%180 = add <4 x i32> %176, %175
%181 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %180)
%182 = add nuw nsw i64 %136, %134
%183 = getelementptr inbounds i32, i32* %15, i64 %182
%184 = load i32, i32* %183
%185 = add nsw i32 %184, %181
%186 = srem i32 %185, 32768
store i32 %186, i32* %183
%187 = add nuw nsw i64 %136, 1
%188 = icmp eq i64 %187, 8
br i1 %188, label %189, label %135
189: ; preds = %179
%190 = add nuw nsw i64 %108, 1
%191 = icmp eq i64 %190, 752
br i1 %191, label %192, label %107
192: ; preds = %189
%193 = call i32 @lwe_pack(i8* %0, i32 11280, i32* %15, i32 6016, i32 15)
br label %195
194: ; preds = %130, %124
br label %195
195: ; preds = %194, %192
%196 = phi i32 [ 1, %192 ], [ 0, %194 ]
%197 = call i32 @EVP_CIPHER_CTX_free(i32* %6)
%198 = call i32 @OPENSSL_cleanse(i32* %15, i32 24064)
%199 = call i32 @OPENSSL_free(i32* %15)
%200 = call i32 @OPENSSL_cleanse(i32* %55, i32 3008)
%201 = call i32 @OPENSSL_free(i32* %55)
%202 = call i32 @OPENSSL_cleanse(i32* %59, i32 24064)
%203 = call i32 @OPENSSL_free(i32* %59)
br label %206
204: ; preds = %8
%205 = call i32 @EVP_CIPHER_CTX_free(i32* %6)
br label %206
206: ; preds = %204, %4, %195, %57, %53, %12
%207 = phi i32 [ 0, %12 ], [ 0, %53 ], [ 0, %57 ], [ %196, %195 ], [ 0, %4 ], [ 0, %204 ]
ret i32 %207
}